:root {
  --color-bg: #faf7f2;
  --color-surface: #ffffff;
  --color-border: #e8e0d4;
  --color-text: #2d2a26;
  --color-muted: #7a7268;
  --color-accent: #b8860b;
  --color-accent-dark: #8f6a08;
  --color-yes: #2e7d32;
  --color-yes-bg: #e6f4e6;
  --color-no: #9a9a9a;
  --color-no-bg: #f0efec;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  padding-bottom: 2rem;
}

.app-header {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
}

.app-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.event-sub {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  min-width: 100px;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-accent-dark);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.search-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
  padding: 0.5rem 1rem 0.75rem;
}

.search-bar input {
  width: 100%;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}

.search-bar input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.guest-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.guest-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guest-card[hidden] {
  display: none;
}

.guest-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.guest-info {
  min-width: 0;
}

.guest-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.guest-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.8rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.table-number {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.3rem 0.9rem;
  min-width: 64px;
}

.table-number-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
}

.table-number-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--color-accent-dark);
}

.guest-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-badge {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  white-space: nowrap;
}

.status-badge.status-yes {
  background: var(--color-yes-bg);
  color: var(--color-yes);
}

.status-badge.status-no {
  background: var(--color-no-bg);
  color: var(--color-no);
}

.btn-mark {
  flex: 1 1 auto;
  min-height: 48px;
  border: none;
  background: var(--color-accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(184, 134, 11, 0.35);
}

.btn-mark:active {
  background: var(--color-accent-dark);
}

.btn-copy {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 50%;
  cursor: pointer;
}

.btn-copy svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.btn-copy:active {
  background: var(--color-bg);
}

.empty-state,
.no-results {
  text-align: center;
  color: var(--color-muted);
  padding: 2rem 1rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 20px);
  background: var(--color-text);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Tablet and up: turn each card into a denser row */
@media (min-width: 700px) {
  .guest-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .guest-top {
    flex: 1 1 auto;
  }

  .guest-info {
    display: flex;
    align-items: baseline;
    gap: 1rem;
  }

  .guest-name {
    min-width: 200px;
  }

  .guest-meta {
    margin-top: 0;
  }

  .guest-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .btn-mark {
    flex: 0 0 auto;
  }
}

@media (min-width: 1024px) {
  .app-header h1 {
    font-size: 1.75rem;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 42, 38, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 30;
  padding: 0;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem 1.25rem 1.75rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-bg);
  color: var(--color-muted);
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.modal-box h2 {
  margin: 0 1.5rem 0.25rem 0;
  font-size: 1.15rem;
}

.modal-meta {
  margin: 0 0 1rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.modal-question {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btn-modal {
  min-height: 48px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-modal-yes {
  background: var(--color-yes);
  color: #fff;
}

.btn-modal-no {
  background: var(--color-no-bg);
  color: var(--color-text);
  border-color: var(--color-border);
}

/* Tablet and up: center the modal instead of docking it to the bottom */
@media (min-width: 700px) {
  .modal-overlay {
    align-items: center;
  }

  .modal-box {
    border-radius: var(--radius);
  }

  .modal-actions {
    flex-direction: row;
  }
}
