:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --text: #1F2933;
  --accent: #2F6FED;
  --muted: #6B7280;
  --border: #E5E7EB;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  min-height: 100vh;
}

.header {
  text-align: center;
  margin-bottom: 24px;
}

.brand h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.brand .tag {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.header .sub {
  margin: 6px 0 0;
  font-size: 1rem;
  color: var(--muted);
}

.tabs {
  display: flex;
  background: var(--surface);
  border-radius: 9999px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 9999px;
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.view {
  display: block;
}

.view.hidden {
  display: none;
}

.intro-card {
  background: var(--surface);
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.intro-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
}

.intro-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.counter {
  margin: 16px 0;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  background: var(--surface);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.counter strong, .waiting-count {
  font-weight: 700;
  color: var(--text);
}

.join-form {
  background: var(--surface);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-of-type {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
}

input, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

textarea {
  resize: vertical;
  min-height: 64px;
}

.btn {
  width: 100%;
  padding: 13px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--text);
  cursor: pointer;
}

.btn-accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dashboard-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.counter-inline {
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 999px;
}

.list-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.list-container {
  background: var(--surface);
  padding: 6px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.waitlist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entry-card {
  background: white;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.entry-card.status-booked {
  opacity: 0.85;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.entry-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.entry-header .phone {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.entry-body {
  font-size: 0.9rem;
  margin: 10px 0;
  color: #374151;
}

.entry-body p {
  margin: 3px 0;
}

.entry-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.75rem;
  margin-bottom: 10px;
}

.time {
  color: var(--muted);
}

.status-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: #E5E7EB;
  color: #374151;
}

.entry-card.status-contacted .status-badge {
  background: #FEF3C7;
  color: #92400E;
}

.entry-card.status-booked .status-badge {
  background: #DCFCE7;
  color: #166534;
}

.entry-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.entry-actions .completed {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.empty-state {
  text-align: center;
  padding: 38px 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 340px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  background: #1F2933;
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: none;
  z-index: 100;
}

.toast.success {
  background: #166534;
}

.toast.error {
  background: #991B1B;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .entry-actions {
    flex-wrap: wrap;
  }
}

/* Keyboard accessible focus states */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}