* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #0a0a0a;
  --paper: #fafaf8;
  --accent: #1a6b4a;
  --accent-light: #e8f5ee;
  --accent-hover: #155a3d;
  --warm: #f5f0e8;
  --muted: #6b6b6b;
  --border: #e0ddd6;
  --red: #c44536;
  --red-light: #fdf0ee;
  --success: #1a6b4a;
  --warning: #b45309;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; line-height: 1.15; }

/* Layout */
.app-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.app-narrow { max-width: 560px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.app-nav {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.app-nav .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.5px;
  text-decoration: none;
}
.app-nav .logo span { color: var(--accent); }
.app-nav .nav-links { display: flex; gap: 12px; align-items: center; }
.app-nav .nav-links a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
}
.app-nav .nav-links a:hover { color: var(--ink); background: var(--warm); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover { background: #222; }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--warm); }
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-error { color: var(--red); font-size: 13px; margin-top: 4px; }

/* Cards */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.auth-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-card h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.auth-card p {
  color: var(--muted);
  margin-bottom: 32px;
}
.auth-card .divider {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 20px 0;
}
.auth-card .footer-link {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}
.auth-card .footer-link a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.alert-error { background: var(--red-light); color: var(--red); border: 1px solid rgba(196, 69, 54, 0.2); }
.alert-success { background: var(--accent-light); color: var(--accent); border: 1px solid rgba(26, 107, 74, 0.2); }
.alert.show { display: block; }

/* Dashboard */
.dashboard-header {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.dashboard-header h1 { font-size: 32px; font-weight: 700; letter-spacing: -1px; }
.dashboard-header .subtitle { color: var(--muted); margin-top: 4px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--ink);
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'DM Sans', sans-serif;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }

/* Table */
.booking-list { display: flex; flex-direction: column; gap: 8px; }
.booking-item {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: box-shadow 0.2s;
}
.booking-item:hover { box-shadow: var(--shadow); }
.booking-customer { font-weight: 600; font-size: 15px; }
.booking-time { font-size: 14px; color: var(--muted); }
.booking-service { font-size: 13px; color: var(--muted); }

.badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-confirmed { background: var(--accent-light); color: var(--accent); }
.badge-cancelled { background: var(--red-light); color: var(--red); }
.badge-completed { background: var(--warm); color: var(--ink); }
.badge-no_show { background: #fef3cd; color: var(--warning); }

/* Chat (booking page) */
.chat-container {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px);
}
.chat-header {
  padding: 20px 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.chat-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.chat-header p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-bubble.ai {
  align-self: flex-start;
  background: var(--accent-light);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.chat-bubble.user {
  align-self: flex-end;
  background: var(--ink);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.system {
  align-self: center;
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  border-radius: 12px;
  padding: 16px 24px;
}
.chat-input-area {
  padding: 16px 0;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.chat-input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--accent); }
.chat-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.chat-send:hover { background: var(--accent-hover); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-send svg { width: 20px; height: 20px; }

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-self: flex-start;
}
.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--muted);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Booking confirmed card */
.booking-confirmed {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  margin: 12px 0;
  align-self: center;
  max-width: 90%;
  text-align: center;
}
.booking-confirmed h3 {
  color: var(--accent);
  font-size: 16px;
  margin-bottom: 8px;
}
.booking-confirmed p {
  font-size: 14px;
  color: var(--ink);
  margin: 4px 0;
}

/* Settings section */
.settings-section { margin-bottom: 32px; }
.settings-section h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 16px;
}

.hours-grid { display: flex; flex-direction: column; gap: 8px; }
.hours-row {
  display: grid;
  grid-template-columns: 100px 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}
.hours-row .day-name {
  font-weight: 600;
  font-size: 14px;
}
.hours-row input[type="time"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}

.service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.service-info h4 { font-size: 15px; font-weight: 600; }
.service-info p { font-size: 13px; color: var(--muted); }

/* Share link */
.share-box {
  background: var(--warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.share-box input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}

/* Onboarding */
.onboarding-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.onboarding-content {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 60px 24px;
}
.onboarding-content h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 8px;
}
.onboarding-content > p {
  color: var(--muted);
  margin-bottom: 40px;
  font-size: 16px;
}
.onboarding-step { display: none; }
.onboarding-step.active { display: block; }
.step-indicator {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
}
.step-dot {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.3s;
}
.step-dot.active { background: var(--accent); }
.step-dot.done { background: var(--ink); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}
.empty-state h3 { font-size: 18px; color: var(--ink); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 400px; margin: 0 auto; }

/* Responsive */
@media (max-width: 768px) {
  .booking-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hours-row {
    grid-template-columns: 80px 1fr;
    gap: 8px;
  }
}
