/* ------------------------------------------------------------------ */
/*  Google Fonts                                                        */
/* ------------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Inter:wght@400;500;600;700&display=swap');

/* ------------------------------------------------------------------ */
/*  CSS Variables — Dark Theme                                          */
/* ------------------------------------------------------------------ */
:root {
  /* ── Dark theme — comfortable warm dark ── */
  --bg:           #1a1612;
  --bg-2:         #211d18;
  --bg-3:         #2a2520;
  --bg-input:     #302b25;
  --border:       #3d3630;
  --border-light: #4e4640;

  --text:         #ede8e2;
  --text-muted:   #9a8f85;
  --text-dim:     #5e5650;

  --muted:        #9a8f85;
  --dim:          #5e5650;

  --primary:      #e8e0d8;
  --primary-hover:#f5f0eb;

  --success:      #c8b49a;
  --danger:       #f87171;
  --warning:      #fbbf24;

  --radius-xs:    6px;
  --radius-sm:    8px;
  --radius:       16px;
  --radius-lg:    24px;

  --shadow:       0 2px 8px rgba(0,0,0,0.55);
  --shadow-md:    0 8px 32px rgba(0,0,0,0.65);

  --glow:         0 4px 20px rgba(0,0,0,0.50), 0 1px 4px rgba(0,0,0,0.35);
  --glow-hover:   0 10px 36px rgba(0,0,0,0.65), 0 2px 8px rgba(0,0,0,0.40);
  --glow-btn:     0 2px 8px rgba(0,0,0,0.40);
  --glow-btn-hover: 0 4px 16px rgba(0,0,0,0.50);

  --transition-pop: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s ease;
}

/* ------------------------------------------------------------------ */
/*  CSS Variables — Light Theme (warm beige)                           */
/* ------------------------------------------------------------------ */
html.light {
  /* ── Light theme — off-white with warm tint ── */
  --bg:           #e6e0d7;
  --bg-2:         #f5f2ec;
  --bg-3:         #eae5de;
  --bg-input:     #dfd9d0;
  --border:       #c2a98a;
  --border-light: #a8906e;

  --text:         #1a1410;
  --text-muted:   #6b5f55;
  --text-dim:     #a89e94;

  --muted:        #6b5f55;
  --dim:          #a89e94;

  --primary:      #2a1f16;
  --primary-hover:#0f0a06;

  --shadow:       0 2px 8px rgba(60,40,20,0.08);
  --shadow-md:    0 8px 32px rgba(60,40,20,0.12);

  --glow:         0 4px 16px rgba(60,40,20,0.14), 0 1px 4px rgba(60,40,20,0.10);
  --glow-hover:   0 10px 32px rgba(60,40,20,0.20), 0 2px 8px rgba(60,40,20,0.14);
  --glow-btn:     0 2px 8px rgba(60,40,20,0.16);
  --glow-btn-hover: 0 4px 16px rgba(60,40,20,0.24);
}

/* ------------------------------------------------------------------ */
/*  Reset & Base                                                        */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

html {
  /* Put the page background on <html> so the ambient .ln-ambient (z-index:-1)
     can sit between html bg and body content on pages that include it. */
  background-color: var(--bg);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background-color: transparent;
}

a { color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--text); }

/* ------------------------------------------------------------------ */
/*  Auth Page Layout — Two Column                                       */
/* ------------------------------------------------------------------ */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 520px;
}

/* ---- Left: Branding Panel ---- */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 88px;
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.03) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.02) 0%, transparent 50%);
  pointer-events: none;
}

.brand-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
}

.brand-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.brand-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 88px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--text);
  margin-bottom: 24px;
}

.brand-tagline {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 48px;
  max-width: 360px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.brand-feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.brand-divider {
  width: 48px;
  height: 1px;
  background: var(--border-light);
  margin: 48px 0;
}

/* ---- Right: Card Panel ---- */
.auth-panel {
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 72px;
  box-shadow: var(--glow);
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-card-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-3);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  box-sizing: border-box;
}

.form-group textarea {
  resize: vertical;
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555555' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-dim);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}

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

/* ------------------------------------------------------------------ */
/*  Buttons                                                             */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition-pop);
  text-decoration: none;
  box-shadow: var(--glow-btn);
  box-sizing: border-box;
  line-height: 1;
  vertical-align: middle;
  -webkit-appearance: none;
  appearance: none;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--glow-btn-hover);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
  border-radius: var(--radius-sm);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--bg);
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover { background: var(--bg-2); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 1px solid #b91c1c;
}
.btn-danger:hover {
  background: #ef4444;
  border-color: #991b1b;
}

/* ------------------------------------------------------------------ */
/*  Alerts                                                              */
/* ------------------------------------------------------------------ */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
}

.alert-error {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.alert-success {
  background: rgba(74, 222, 128, 0.1);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

/* ------------------------------------------------------------------ */
/*  Auth footer link                                                    */
/* ------------------------------------------------------------------ */
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--text);
  font-weight: 500;
}

.auth-footer a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/*  Divider in form                                                     */
/* ------------------------------------------------------------------ */
.form-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ------------------------------------------------------------------ */
/*  Navbar                                                              */
/* ------------------------------------------------------------------ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  z-index: 200;

  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;

  background: #2e1e0c;
  border-bottom: 1px solid rgba(255, 220, 170, 0.10);
  box-shadow: 0 2px 16px rgba(0,0,0,0.20);
}

/* Push content below the fixed navbar */
.main-content {
  padding: 32px 60px;
  padding-top: calc(52px + 28px);
}

.navbar-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: #f0e6d4;
  /* Warm amber glow */
  text-shadow: 0 0 16px rgba(255, 200, 120, 0.50),
               0 0 32px rgba(255, 170, 80, 0.22);
  letter-spacing: 0.01em;
}
.navbar-brand:hover {
  color: #fff8f0;
  text-shadow: 0 0 22px rgba(255, 210, 130, 0.70),
               0 0 44px rgba(255, 180, 80, 0.30);
}

html.light .navbar-brand {
  color: #ddd0be;
  text-shadow: 0 0 14px rgba(210, 190, 160, 0.30),
               0 0 28px rgba(190, 165, 130, 0.15);
}
html.light .navbar-brand:hover {
  color: #ede4d6;
  text-shadow: 0 0 18px rgba(210, 190, 160, 0.45),
               0 0 36px rgba(190, 165, 130, 0.22);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.navbar-nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: var(--bg-3);
  color: var(--text);
}

/* Custom tooltip via data-tip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  transition-delay: 0s;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
[data-tip]:hover::after {
  opacity: 1;
  transition-delay: 0.18s;
}

/* Theme toggle */
.navbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid rgba(255, 220, 170, 0.18);
  color: #c4b49e;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(255, 220, 170, 0.10);
  color: #f2e8d8;
  border-color: rgba(255, 220, 170, 0.35);
}

html.light .theme-toggle {
  border-color: rgba(200, 185, 165, 0.30);
  color: #c8b8a2;
}
html.light .theme-toggle:hover {
  background: rgba(200, 185, 165, 0.12);
  color: #ddd0be;
  border-color: rgba(200, 185, 165, 0.50);
}

/* Power / logout button */
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #f87171;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.logout-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: #f87171;
  color: #f87171;
}

html.light .logout-btn {
  border-color: rgba(248, 113, 113, 0.35);
  color: #f87171;
}
html.light .logout-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: #f87171;
  color: #fca5a5;
}

.navbar-settings-link {
  font-size: 13px;
  font-weight: 500;
  color: #c4b49e;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 220, 170, 0.18);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
html.light .navbar-settings-link {
  color: #c8b8a2;
  border-color: rgba(200, 185, 165, 0.28);
}
html.light .navbar-settings-link:hover {
  color: #ddd0be;
  border-color: rgba(200, 185, 165, 0.48);
  background: rgba(200, 185, 165, 0.10);
}
.navbar-settings-link:hover {
  color: #f2e8d8;
  border-color: rgba(255, 220, 170, 0.38);
  background: var(--bg-3);
}

/* ------------------------------------------------------------------ */
/*  Main Layout                                                         */
/* ------------------------------------------------------------------ */
/* main-content padding defined in navbar section above (includes top offset for floating nav) */

/* Dock trigger zone — thin strip always present on left edge */
.dock-zone {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;   /* invisible trigger strip */
  z-index: 200;
  pointer-events: auto;
}

.dock-zone.dock-open {
  width: 90px;   /* expand to cover dock so mouse can travel to it */
}

/* ------------------------------------------------------------------ */
/*  Cards (dashboard etc.)                                              */
/* ------------------------------------------------------------------ */
.card {
  background: var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--glow);
  padding: 24px;
  margin-bottom: 16px;
  transition: var(--transition-pop);
}

.card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--glow-hover);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* ------------------------------------------------------------------ */
/*  Trial Banner                                                        */
/* ------------------------------------------------------------------ */
.trial-banner {
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trial-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warning);
  flex-shrink: 0;
}

.trial-banner a { color: var(--text); font-weight: 500; }
.trial-banner a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/*  Page Header                                                         */
/* ------------------------------------------------------------------ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.page-date {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-dim);
}

.page-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Dashboard-specific greeting */
.dash-greeting {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 22px;
}
.dash-header {
  align-items: center;
  margin-bottom: 32px;
}


/* ------------------------------------------------------------------ */
/*  Button Size Variants                                                */
/* ------------------------------------------------------------------ */
.btn-sm {
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  width: auto;       /* override btn-primary full-width */
  margin-top: 0;
}

.btn-xs {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------------ */
/*  Stats Row                                                           */
/* ------------------------------------------------------------------ */
/* ------------------------------------------------------------------ */
/*  Trial upgrade banner                                                */
/* ------------------------------------------------------------------ */
.trial-upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(180,130,60,.22) 0%, rgba(180,130,60,.10) 100%);
  border: 1px solid rgba(180,130,60,.55);
  border-radius: var(--radius);
  padding: 16px 22px;
  margin-bottom: 20px;
  box-shadow: 0 2px 16px rgba(0,0,0,.35), 0 0 0 0 transparent;
}
html.light .trial-upgrade-banner {
  background: linear-gradient(135deg, rgba(180,130,60,.14) 0%, rgba(180,130,60,.06) 100%);
  border-color: rgba(140,100,30,.45);
  box-shadow: 0 2px 12px rgba(60,40,20,.12);
}
.tub-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.tub-pill {
  flex-shrink: 0;
  background: rgba(212,160,64,.22);
  color: #d4a040;
  border: 1px solid rgba(212,160,64,.50);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
html.light .tub-pill {
  color: #7a5010;
  background: rgba(140,100,30,.15);
  border-color: rgba(140,100,30,.35);
}
.tub-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tub-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.tub-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tub-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.tub-btn {
  display: inline-block;
  background: #b48230;
  color: #1a1612;
  border: 1px solid #b48230;
  border-radius: var(--radius-sm);
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(180,130,60,.35);
}
.tub-btn:hover {
  background: #c9973a;
  box-shadow: 0 4px 14px rgba(180,130,60,.50);
}
html.light .tub-btn { color: #fff; }
@media (max-width: 640px) {
  .trial-upgrade-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .tub-sub { display: none; }
  .tub-right { width: 100%; justify-content: space-between; }
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 32px;
  padding-top: 4px;
}

/* ── First-run welcome / onboarding overlay ──────────────────────────── */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 15, 10, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: welcomeFade 0.3s ease;
}
@keyframes welcomeFade { from { opacity: 0; } to { opacity: 1; } }
.welcome-overlay.welcome-hide { opacity: 0; transition: opacity 0.25s ease; }
.welcome-card {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 38px;
  box-shadow: 0 40px 90px -24px rgba(0, 0, 0, 0.6);
  animation: welcomePop 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes welcomePop {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.welcome-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b8893f;
  background: rgba(184, 137, 63, 0.12);
  border: 1px solid rgba(184, 137, 63, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.welcome-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 8px;
}
.welcome-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 26px;
  line-height: 1.6;
}
.welcome-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 30px;
}
.welcome-step { display: flex; gap: 14px; align-items: flex-start; }
.welcome-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #b8893f;
  color: #1a1410;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.welcome-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.welcome-step-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
/* "Maybe later" — full-width like the primary button, but secondary emphasis */
.welcome-btn-full {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
@media (max-width: 540px) {
  .welcome-card { padding: 30px 24px; }
  .welcome-actions .btn { flex: 1; text-align: center; }
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  padding-top: 22px;
  box-shadow: var(--glow);
  transition: var(--transition-pop);
  overflow: visible;
}

.stat-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--glow-hover);
  border-color: var(--border-light);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.stat-value--sm {
  font-size: 20px;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------------ */
/*  Section Header                                                      */
/* ------------------------------------------------------------------ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.section-link {
  font-size: 13px;
  color: var(--text-muted);
}

.section-link:hover { color: var(--text); }

/* ------------------------------------------------------------------ */
/*  Appointment List                                                    */
/* ------------------------------------------------------------------ */
.appt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 4px 12px;
  margin: 0 -4px;
}

/* Two-column split grid */
.appt-split-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0 24px;
  align-items: start;
}

.appt-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.appt-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
}

.appt-col-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.appt-group-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1px 8px;
}

.appt-col-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.appt-col-body::-webkit-scrollbar { width: 4px; }
.appt-col-body::-webkit-scrollbar-track { background: transparent; }
.appt-col-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.appt-col-empty {
  font-size: 13px;
  color: var(--dim);
  padding: 20px 0;
  text-align: center;
}

/* Vertical divider between columns */
.appt-col-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin-top: 0;
}

/* Responsive: stack on small screens */
@media (max-width: 800px) {
  .appt-split-grid {
    grid-template-columns: 1fr;
  }
  .appt-col-divider {
    height: 1px;
    width: 100%;
  }
}

.appt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  flex-shrink: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--glow);
  transition: var(--transition-pop);
}

.appt-row:hover {
  transform: translateY(-2px) scale(1.005);
  box-shadow: var(--glow-hover);
  border-color: var(--border-light);
}

.appt-row--done   { opacity: 0.5; }
.appt-row--noshow {
  opacity: 0.45;
  filter: grayscale(0.4);
}
.appt-row--noshow .appt-name,
.appt-row--noshow .appt-meta,
.appt-row--noshow .appt-time {
  text-decoration: line-through;
  text-decoration-color: var(--dim);
}

/* Left cluster: token · time · action buttons */
.appt-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Token number (#1, #2 …) */
.appt-token-num {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  min-width: 32px;
}

/* Divider line between token and time */
.appt-left-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

/* Right cluster: badge · patient name + meta */
.appt-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.appt-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: transparent;
  letter-spacing: 0.02em;
}

html.light .appt-time {
  border-color: #c8c8cc;
}

html:not(.light) .appt-time {
  border-color: #333;
}

/* Patient block — two lines */
.appt-patient {
  text-align: right;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Line 1: meta · name — all same size, left-to-right */
.appt-name-line {
  display: flex;
  align-items: baseline;
  gap: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appt-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.appt-meta-sep {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 5px;
}
.appt-meta {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Line 2: tags row — right-aligned, gap between each pill */
.appt-tags {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ */
/*  Badges                                                              */
/* ------------------------------------------------------------------ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: capitalize;
  white-space: nowrap;
}

.badge--scheduled,
.badge--completed,
.badge--cancelled,
.badge--no_show {
  background: rgba(200, 175, 145, 0.14);
  color: #c4b09a;
  border: 1px solid rgba(200, 175, 145, 0.22);
}
html.light .badge--scheduled,
html.light .badge--completed,
html.light .badge--cancelled,
html.light .badge--no_show {
  background: rgba(175, 145, 105, 0.16);
  color: #1a1208;
  border-color: rgba(155, 125, 85, 0.28);
}

html.light .alert-error   { color: #111; }
html.light .alert-success { color: #111; }

html.light .sub-status-badge--trial,
html.light .sub-status-badge--solo,
html.light .sub-status-badge--basic,
html.light .sub-status-badge--pro,
html.light .sub-status-badge--expired { color: #1a1208; background: rgba(175,145,105,0.16); border-color: rgba(155,125,85,0.28); }

html.light .badge-channel--walkin,
html.light .badge-channel--staff,
html.light .badge-channel--patient,
html.light .badge-channel--doctor,
html.light .badge-channel--scheduled,
html.light .badge-channel--completed,
html.light .badge-channel--cancelled,
html.light .badge-channel--no_show,
html.light .badge-channel--in_queue,
html.light .badge-channel--serving,
html.light .badge-channel--billing_pending,
html.light .badge-channel--billing,
html.light .badge-channel--emergency { color: #1a1208; background: rgba(175,145,105,0.16); border-color: rgba(155,125,85,0.28); }

html.light .billing-expired-title { color: #111; }

/* Calendar today ring — light theme */
html.light .cal-day--today {
  background: rgba(0,0,0,0.04);
}
html.light .cal-day--today .cal-day-num {
  border-color: rgba(0,0,0,0.60);
  box-shadow: 0 0 8px rgba(0,0,0,0.10), 0 0 18px rgba(0,0,0,0.05);
}

/* Theme toggle + logout light theme overrides — handled in navbar section above */

/* ------------------------------------------------------------------ */
/*  Empty State                                                         */
/* ------------------------------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-icon  { font-size: 32px; margin-bottom: 14px; opacity: 0.3; filter: grayscale(1); }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; max-width: 320px; margin-left: auto; margin-right: auto; }

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.empty-actions .btn {
  width: 180px;
  margin-top: 0;
}

/* ------------------------------------------------------------------ */
/*  Quick Actions                                                       */
/* ------------------------------------------------------------------ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.quick-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--glow);
  transition: var(--transition-pop);
}

.quick-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--glow-hover);
  border-color: var(--border-light);
  background: var(--bg-3);
  text-decoration: none;
}

.quick-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--text-dim);
}

.quick-card:hover .quick-icon { color: var(--text-muted); }

.quick-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ------------------------------------------------------------------ */
/*  Dock (macOS-style, auto-hide, every page)                           */
/* ------------------------------------------------------------------ */
.dash-dock {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%) translateX(calc(-100% - 16px));
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  background: #2e1e0c;
  border: 1px solid rgba(200, 170, 130, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 0.5px rgba(200,170,130,0.08);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.25s ease;
}

/* Visible when dock-zone is open */
.dock-zone.dock-open .dash-dock {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
  pointer-events: auto;
}

html.light .dash-dock {
  background: #2e1e0c;
  border-color: rgba(200, 170, 130, 0.22);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(200,170,130,0.10);
}

.dock-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: rgba(200, 170, 130, 0.08);
  border: 1px solid rgba(200, 170, 130, 0.14);
  color: #a0886a;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-pop), background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dock-item:hover {
  background: rgba(200, 170, 130, 0.18);
  border-color: rgba(200, 170, 130, 0.32);
  color: #ddd0be;
  text-decoration: none;
  transform: translateY(-2px) scale(1.06);
}

html.light .dock-item {
  background: rgba(200, 170, 130, 0.08);
  border-color: rgba(200, 170, 130, 0.14);
  color: #a0886a;
}

html.light .dock-item:hover {
  background: rgba(200, 170, 130, 0.20);
  border-color: rgba(200, 170, 130, 0.35);
  color: #ddd0be;
}

.dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dock-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* Tooltip: slides in from the right */
.dock-tooltip {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: #2e1e0c;
  border: 1px solid rgba(200, 170, 130, 0.22);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #ddd0be;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.30);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 210;
}

/* small arrow pointing left */
.dock-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: rgba(200, 170, 130, 0.22);
}
.dock-tooltip::after {
  content: '';
  position: absolute;
  right: calc(100% - 1px);
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #2e1e0c;
}

.dock-item:hover .dock-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Hide dock on narrow screens */
@media (max-width: 768px) {
  .dock-zone { display: none; }
}

/* ------------------------------------------------------------------ */
/*  Settings Page                                                       */
/* ------------------------------------------------------------------ */
.settings-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--glow);
  transition: box-shadow 0.22s ease;
}

.settings-card:hover {
  box-shadow: var(--glow-hover);
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.settings-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.settings-card-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- Schedule Grid ---- */
.schedule-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-day-card {
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.15s;
}

.schedule-day-card:hover {
  border-color: var(--border);
}

.schedule-day-card > .schedule-row,
.schedule-day-card > .schedule-shift-row,
.schedule-day-card > .schedule-add-row {
  margin: 0;
  flex-shrink: 0;
}

.schedule-header {
  display: grid;
  grid-template-columns: 110px 56px 1fr 1fr 110px 110px 110px;
  gap: 12px;
  padding: 0 12px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.schedule-row {
  display: grid;
  grid-template-columns: 110px 56px 1fr 1fr 110px 110px 110px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  transition: opacity 0.2s;
}

.schedule-row--off .schedule-day,
.schedule-row--off .input-sm {
  opacity: 0.3;
  pointer-events: none;
}

.schedule-day {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* ---- Extra shift sub-rows ---- */
.schedule-shift-row {
  display: grid;
  grid-template-columns: 110px 56px 1fr 1fr 110px 110px 110px;
  gap: 12px;
  align-items: center;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
}
.schedule-shift-row.schedule-row--off {
  opacity: 0.3;
  pointer-events: none;
}

.schedule-shift-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.2px;
}

/* ---- Add Shift row ---- */
.schedule-add-row {
  display: grid;
  grid-template-columns: 110px 56px 1fr 1fr 110px 110px 110px;
  gap: 12px;
  align-items: center;
  padding: 5px 12px 9px;
  border-top: 1px solid var(--border);
}

.btn-add-shift {
  grid-column: 3 / 7;
  background: none;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: color 0.15s, border-color 0.15s;
}
.btn-add-shift:hover { color: var(--text-muted); border-color: var(--text-dim); }

/* ---- Toggle Switch ---- */
.toggle {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.toggle input { display: none; }

.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border-light);
  border-radius: 100px;
  transition: background 0.2s;
  position: relative;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.toggle input:checked + .toggle-track {
  background: rgba(255,255,255,0.18);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(16px);
  background: var(--text);
}

/* Light theme: toggle is white-on-white without this override */
html.light .toggle-track { background: rgba(0,0,0,0.14); }
html.light .toggle-track::after { background: #666; }
html.light .toggle input:checked + .toggle-track { background: #222; }
html.light .toggle input:checked + .toggle-track::after { background: #fff; }

/* ---- Small inline inputs ---- */
.input-sm {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.input-sm:focus { border-color: var(--primary); }
.input-sm:disabled { opacity: 0.3; cursor: not-allowed; }
.input-sm option { background: var(--bg-2); }

select.input-sm {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555555' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}

/* ---- Clinic Profile grid ---- */
.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- Blocked Dates ---- */
.blocked-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
}

.blocked-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 0.15s;
}

.blocked-row:hover { border-color: var(--border); }

.blocked-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.blocked-date {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.blocked-reason {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-icon-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-icon-remove:hover {
  background: rgba(248,113,113,0.1);
  color: var(--danger);
  border-color: rgba(248,113,113,0.3);
}

.blocked-add-form { margin-top: 16px; }

.blocked-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-empty {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding: 16px 0;
}

/* ---- Booking Link Box ---- */
.booking-link-box {
  font-size: 13px;
  font-family: 'Courier New', monospace;
  color: var(--text-muted);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  letter-spacing: 0.3px;
  display: block;
}

.booking-link-url {
  word-break: break-all;
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
}

.booking-link-url:hover {
  border-color: var(--border-light);
  color: var(--text);
}

.booking-link-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ------------------------------------------------------------------ */
/*  Calendar                                                            */
/* ------------------------------------------------------------------ */
.cal-nav {
  margin-bottom: 20px;
}

.cal-nav-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--glow);
  margin-bottom: 16px;
}

.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}

.cal-header-cell {
  padding: 12px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.cal-body {
  display: flex;
  flex-direction: column;
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}

.cal-week:last-child { border-bottom: none; }

.cal-day {
  min-height: 88px;
  padding: 10px 12px;
  border-right: 1px solid var(--border);
  text-decoration: none;
  display: block;
  transition: background 0.15s;
  position: relative;
}

.cal-day:last-child { border-right: none; }

.cal-day:hover {
  background: var(--bg-3);
  text-decoration: none;
}

.cal-day--empty {
  background: transparent;
  pointer-events: none;
  cursor: default;
}

.cal-day--past .cal-day-num { color: var(--text-dim); }

.cal-day--today {
  background: rgba(255,255,255,0.025);
}

.cal-day--blocked {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(255,255,255,0.015) 6px,
    rgba(255,255,255,0.015) 12px
  );
}

.cal-day-num {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.cal-day--today .cal-day-num {
  background: transparent;
  color: var(--text);
  border-radius: 50%;
  font-weight: 700;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.18), 0 0 18px rgba(255, 255, 255, 0.07);
}

.cal-day--has-appts .cal-day-num { color: var(--text); }

.cal-blocked-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cal-dots {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-dot--scheduled { background: var(--text-dim); }
.cal-dot--completed { background: var(--success); }
.cal-dot--noshow    { background: var(--warning); }

.cal-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Calendar Legend */
.cal-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 4px 0;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------------ */
/*  Form Section Label                                                  */
/* ------------------------------------------------------------------ */
.form-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}

/* ------------------------------------------------------------------ */
/*  Appointments Page — Controls Row (date nav + search, same line)    */
/* ------------------------------------------------------------------ */
.appt-controls-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.date-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Appointment search bar */
.appt-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.appt-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.appt-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.appt-search-input {
  width: 100%;
  padding: 8px 32px 8px 36px;
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  height: 37px;        /* matches btn-sm height */
  box-sizing: border-box;
}

.appt-search-input:focus { border-color: var(--primary); }
.appt-search-input::placeholder { color: var(--text-dim); }

.appt-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px;
  line-height: 1;
}
.appt-search-clear:hover { color: var(--text); }

.date-nav-input {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  width: 160px;
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  cursor: pointer;
}

.date-nav-input:focus { border-color: var(--primary); }

/* ------------------------------------------------------------------ */
/*  Slot Picker                                                         */
/* ------------------------------------------------------------------ */
.slot-wrap {
  position: relative;
}

.slot-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  user-select: none;
  transition: border-color 0.15s;
}
.slot-trigger:hover { border-color: var(--primary); }
.slot-trigger svg { flex-shrink: 0; color: var(--text-dim); }
.slot-trigger-text { flex: 1; }
.slot-trigger-dim { color: var(--text-dim); }

.slot-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 196px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.slot-dropdown::-webkit-scrollbar { width: 5px; }
.slot-dropdown::-webkit-scrollbar-track { background: transparent; }
.slot-dropdown::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
.slot-dropdown--open { display: block; }

.slot-item {
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  transition: background 0.1s, color 0.1s;
  user-select: none;
}
.slot-item:last-child { border-bottom: none; }
.slot-item:hover { background: var(--bg-2); color: var(--text); }
.slot-item--active { background: var(--bg-2); color: var(--text); font-weight: 600; }

.slot-empty,
.slot-loading {
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text-dim);
}

/* ------------------------------------------------------------------ */
/*  New Appointment Form — Split Layout                                 */
/* ------------------------------------------------------------------ */
.appt-new-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 36%);
  gap: 24px;
  align-items: stretch;
}

/* ── New Appointment form card ────────────────────────────────── */
.appt-form-outer {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--glow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.apn-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
}
.apn-header-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(175,142,100,0.12);
  border: 1px solid rgba(175,142,100,0.25);
  display: flex; align-items: center; justify-content: center;
  color: #af8e64;
  flex-shrink: 0;
}
.apn-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.apn-card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Section wrapper */
.apn-section {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}
.apn-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.apn-section-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(175,142,100,0.12);
  border: 1px solid rgba(175,142,100,0.22);
  display: flex; align-items: center; justify-content: center;
  color: #af8e64;
  flex-shrink: 0;
}

/* Input with icon */
.apn-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.apn-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 1;
}
.apn-input-icon-field {
  padding-left: 36px !important;
  width: 100%;
}

/* Actions row */
.apn-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 28px;
}

/* Footer */
.apn-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--bg-3);
  border-top: 1px solid var(--border);
  gap: 20px;
  flex-wrap: wrap;
}
.apn-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.apn-footer-shield {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(175,142,100,0.1);
  border: 1px solid rgba(175,142,100,0.2);
  display: flex; align-items: center; justify-content: center;
  color: #af8e64;
  flex-shrink: 0;
}
.apn-footer-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.apn-footer-sub {
  font-size: 11px;
  color: var(--dim);
  margin-top: 1px;
}
.apn-footer-right { text-align: right; }
.apn-footer-phone {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}

/* Brand panel illustration */
.apn-brand-illustration {
  position: relative;
  width: 130px; height: 130px;
  margin: 0 auto 28px;
  display: flex; align-items: center; justify-content: center;
}
.apn-cal-icon { position: relative; z-index: 1; }
.apn-brand-deco {
  position: absolute;
  color: rgba(175,142,100,0.35);
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
  user-select: none;
}
.apn-brand-deco--tl { top: 8px; left: 4px; }
.apn-brand-deco--tr { top: 6px; right: 6px; font-size: 22px; }
.apn-brand-deco--ml { top: 50%; left: -6px; }
.apn-brand-deco--br { bottom: 8px; right: 4px; }

/* Feature list */
.apn-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  text-align: left;
  position: relative;
}
.apn-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.apn-feature-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(175,142,100,0.12);
  border: 1px solid rgba(175,142,100,0.22);
  display: flex; align-items: center; justify-content: center;
  color: #af8e64;
  flex-shrink: 0;
}
.apn-feature-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.apn-feature-sub {
  font-size: 11px;
  color: var(--dim);
  margin-top: 2px;
}
.apn-desk-illustration {
  width: 100%;
  margin-top: auto;
  padding-top: 24px;
  opacity: 0.7;
}

.appt-brand-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 36px;
}

.appt-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.035) 0%, transparent 65%),
    radial-gradient(ellipse at 50% 100%, rgba(255,255,255,0.015) 0%, transparent 60%);
  pointer-events: none;
}

.appt-brand-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 20px;
  position: relative;
}

.appt-brand-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(36px, 4vw, 62px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 24px;
  position: relative;
  word-break: break-word;
}

.appt-brand-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
  position: relative;
}

.appt-brand-divider {
  width: 36px;
  height: 1px;
  background: var(--border);
  margin: 24px auto;
  position: relative;
}

.appt-brand-features {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  position: relative;
  width: 100%;
}

.appt-brand-features li {
  font-size: 13px;
  color: var(--muted);
  padding: 5px 0 5px 20px;
  position: relative;
}

.appt-brand-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--text-dim);
  font-size: 11px;
  top: 6px;
}

.appt-brand-tagline {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 28px;
  position: relative;
}

.appt-brand-clinic {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  position: relative;
}

.appt-brand-clinic-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  position: relative;
}

@media (max-width: 1024px) {
  .appt-new-split {
    grid-template-columns: 1fr;
  }
  .appt-brand-panel { display: none; }
}

.appt-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* ------------------------------------------------------------------ */
/*  Appointment Detail                                                  */
/* ------------------------------------------------------------------ */
.appt-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
  margin-top: 4px;
}

.appt-detail-full { grid-column: 1 / -1; }

.appt-detail-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.appt-detail-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}

/* ------------------------------------------------------------------ */
/*  Status Action Buttons                                               */
/* ------------------------------------------------------------------ */
.appt-status-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-status {
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: var(--transition-pop);
}

.btn-status:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn-status--complete {
  background: rgba(74, 222, 128, 0.1);
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.25);
}
.btn-status--complete:hover { background: rgba(74, 222, 128, 0.18); }

.btn-status--noshow {
  background: rgba(251, 191, 36, 0.1);
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.25);
}
.btn-status--noshow:hover { background: rgba(251, 191, 36, 0.18); }

.btn-status--cancel {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.25);
}
.btn-status--cancel:hover { background: rgba(248, 113, 113, 0.18); }

/* ------------------------------------------------------------------ */
/*  Patients Page                                                       */
/* ------------------------------------------------------------------ */
/* Toolbar row: search + sort side by side */
.patient-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.patient-search-form {
  flex: 1;
  margin: 0;
}

.patient-sort-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.patient-search-wrap {
  position: relative;
  max-width: none;
}

.patient-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.patient-search-input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.patient-search-input:focus { border-color: var(--primary); }
.patient-search-input::placeholder { color: var(--text-dim); }

.patient-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-dim);
  padding: 4px;
  line-height: 1;
}
.patient-search-clear:hover { color: var(--text); }

/* List layout */
.patient-list-header {
  display: grid;
  grid-template-columns: 1fr 140px 70px 120px 32px 36px;
  gap: 16px;
  padding: 0 8px 10px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dim);
}

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

/* Wrapper card — hover lives here */
.patient-row-wrap {
  display: flex;
  align-items: stretch;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--glow);
  transition: var(--transition-pop);
  overflow: hidden;
  position: relative;
}
.patient-row-wrap::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #6b4a28;
  border-radius: 4px 0 0 4px;
  z-index: 1;
}
html.light .patient-row-wrap::before {
  background: #7a5230;
}

.patient-row-wrap:hover {
  transform: translateY(-2px) scale(1.005);
  box-shadow: var(--glow-hover);
  border-color: var(--border-light);
}

.patient-row-wrap--pinned {
  border-color: var(--border-light);
}

/* Link grid — fills the row */
.patient-row {
  display: grid;
  grid-template-columns: 1fr 140px 70px 120px 32px;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  flex: 1;
  text-decoration: none;
  background: none;
  border: none;
  box-shadow: none;
  min-width: 0;
}

.patient-row:hover { text-decoration: none; }

/* Pin button cell */
.patient-pin-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-left: 1px solid var(--border);
  width: 36px;
  flex-shrink: 0;
}

.patient-pin-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}

.patient-pin-btn:hover {
  color: var(--text);
  background: var(--bg-3);
}

.patient-pin-btn--active {
  color: var(--text);
}

/* Pinned section label */
.patient-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 2px 4px 6px;
}

/* Divider between pinned and other */
.patient-pin-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0 4px;
}

.patient-name  { font-size: 14px; font-weight: 500; color: var(--text); }
.patient-phone { font-size: 13px; color: var(--text-muted); }
.patient-visits { }
.patient-last  { font-size: 13px; color: var(--text-muted); }
.patient-arrow { font-size: 14px; color: var(--text-dim); text-align: right; }

/* ------------------------------------------------------------------ */
/*  Patient Pagination Bar                                              */
/* ------------------------------------------------------------------ */
.pt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pt-info {
  font-size: 13px;
  color: var(--text-muted);
}
.pt-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pt-btn:hover {
  background: var(--bg-3);
  color: var(--text);
  border-color: rgba(200,175,145,0.35);
}
.pt-btn--active {
  background: #6b4a28;
  color: #e8d5bc;
  border-color: #6b4a28;
  cursor: default;
}
.pt-btn--active:hover {
  background: #6b4a28;
  color: #e8d5bc;
  border-color: #6b4a28;
}
.pt-btn--disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}
.pt-btn--arrow {
  border-color: transparent;
  background: transparent;
}
.pt-btn--arrow:hover {
  background: var(--bg-3);
  border-color: var(--border);
}
.pt-ellipsis {
  font-size: 13px;
  color: var(--text-dim);
  padding: 0 4px;
  line-height: 32px;
}

html.light .pt-btn--active {
  background: #6b4a28;
  color: #f5ead8;
}

/* ------------------------------------------------------------------ */
/*  Public Booking Page                                                 */
/* ------------------------------------------------------------------ */
.pub-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 64px;
  background: var(--bg);
}

.pub-brand {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.pub-header {
  text-align: center;
  margin-bottom: 32px;
  max-width: 520px;
  width: 100%;
}

.pub-clinic-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.2;
}

.pub-doctor-name {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.pub-doctor-meta {
  font-size: 13px;
  color: var(--text-dim);
}

.pub-address {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

.pub-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--glow);
  padding: 32px 36px;
  width: 100%;
  max-width: 520px;
}

.pub-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.pub-card-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* Confirmation card */
.pub-confirm-card {
  text-align: center;
}

.pub-confirm-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--success);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.1);
}

.pub-confirm-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.pub-confirm-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.pub-summary {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 0;
  margin-bottom: 24px;
  text-align: left;
}

.pub-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}

.pub-summary-row:last-child { border-bottom: none; }

.pub-summary-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.pub-summary-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

.pub-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Not found */
.pub-notfound {
  text-align: center;
  padding: 60px 24px;
  max-width: 400px;
}

.pub-nf-icon {
  color: var(--text-dim);
  margin: 0 auto 20px;
  opacity: 0.4;
}

.pub-nf-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.pub-nf-sub {
  font-size: 14px;
  color: var(--text-muted);
}

.pub-footer {
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ------------------------------------------------------------------ */
/*  Mobile Responsive                                                   */
/* ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    padding: 48px 32px 32px;
    justify-content: flex-start;
  }

  .brand-title { font-size: 56px; }
  .brand-features { display: none; }
  .brand-divider  { display: none; }

  .auth-panel {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 32px 24px 48px;
  }

  .stats-row        { grid-template-columns: 1fr 1fr; }
  .quick-actions    { grid-template-columns: 1fr 1fr; }
  .settings-form-grid { grid-template-columns: 1fr; }
  .schedule-header      { display: none; }
  .schedule-row         { grid-template-columns: 90px 44px 1fr 1fr 80px 80px 80px; gap: 8px; }
  .schedule-shift-row   { grid-template-columns: 90px 44px 1fr 1fr 80px 80px 80px; gap: 8px; }
  .schedule-add-row     { grid-template-columns: 90px 44px 1fr 1fr 80px 80px 80px; gap: 8px; }
}

@media (max-width: 480px) {
  .brand-title         { font-size: 44px; }
  .form-row            { grid-template-columns: 1fr; }
  .stats-row           { grid-template-columns: 1fr 1fr; }
  .quick-actions       { grid-template-columns: 1fr 1fr; }
  .appt-row            { flex-wrap: wrap; gap: 8px; }
  .appt-right          { flex: 1; justify-content: flex-start; }
  .appt-patient        { text-align: left; }
  .page-header         { flex-direction: column; }
  .appt-detail-grid    { grid-template-columns: 1fr; }
  .appt-status-actions { flex-direction: column; }
  .appt-controls-row   { flex-direction: column; align-items: stretch; }
  .appt-search-form    { width: 100%; }
  .date-nav            { flex-wrap: wrap; gap: 8px; }
  .date-nav-input      { width: 130px; }
  .cal-day             { min-height: 60px; padding: 6px 8px; }
  .cal-day-num         { font-size: 12px; width: 22px; height: 22px; }
  .cal-count           { display: none; }
  .cal-header-cell     { font-size: 10px; padding: 8px 4px; }
  .pub-card            { padding: 24px 20px; }
  .pub-confirm-actions { flex-direction: column; align-items: stretch; }
  .patient-list-header { display: none; }
  .patient-row         { grid-template-columns: 1fr auto 32px; }
  .patient-phone       { display: none; }
  .patient-last        { display: none; }
  .patient-toolbar     { flex-wrap: wrap; }
  .patient-sort-group  { width: 100%; justify-content: flex-end; }
  .reports-grid        { grid-template-columns: 1fr; }
  .reports-new-patients{ flex-direction: column; gap: 16px; }
  .report-np-divider   { width: 100%; height: 1px; }
}

/* ─── Reports ───────────────────────────────────────── */

.reports-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* Top Patients list */
.report-patient-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.report-patient-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}
.report-patient-row:hover {
  background: rgba(255,255,255,0.04);
}

.report-patient-rank {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  flex-shrink: 0;
}

.report-patient-info {
  flex: 1;
  min-width: 0;
}
.report-patient-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-patient-phone {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.report-patient-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* Visit type breakdown */
.report-type-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-type-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-type-label {
  font-size: 13px;
  color: var(--muted);
  width: 110px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-type-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.report-type-bar {
  height: 100%;
  background: var(--text);
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.report-type-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* New patients comparison */
.reports-new-patients {
  display: flex;
  align-items: center;
  gap: 0;
}

.report-np-item {
  flex: 1;
  text-align: center;
}

.report-np-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.report-np-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.report-np-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
  flex-shrink: 0;
}

/* ─── Billing ────────────────────────────────────────── */

.billing-expired-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.billing-expired-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.billing-expired-title {
  font-size: 15px;
  font-weight: 600;
  color: #f87171;
  margin-bottom: 2px;
}
.billing-expired-sub {
  font-size: 13px;
  color: var(--muted);
}

.billing-status-row {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.billing-status-item {}
.billing-status-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.billing-status-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Outer border box enclosing both plan cards */
.billing-plans-box {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
html.light .billing-plans-box {
  border-color: rgba(0,0,0,0.14);
}

.billing-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: rgba(255,255,255,0.12); /* divider colour in dark */
}
html.light .billing-plans {
  background: rgba(0,0,0,0.10); /* divider colour in light */
}

.billing-plan-card {
  background: var(--bg-2);
  border: none;
  border-radius: 0;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: none;
  transition: background 0.15s;
  position: relative;
}
.billing-plan-card--pro {
  background: var(--bg-3);
}
html.light .billing-plan-card--pro {
  background: var(--bg-2);
}

.billing-plan-btn {
  width: 100%;
  margin-top: auto;
}

.plan-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.plan-badge--pro {
  color: var(--text);
}

.plan-name {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 28px;
  color: var(--text);
  margin-bottom: 8px;
}

.plan-price {
  font-size: 42px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 24px;
}
.plan-price span {
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-features li {
  font-size: 13px;
  color: var(--muted);
  padding-left: 20px;
  position: relative;
}
.plan-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
}

/* ─── Alert success ─── */
.alert-success {
  background: rgba(200,180,154,0.08);
  border: 1px solid rgba(200,180,154,0.25);
  color: #c8b49a;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* ─── Admin ──────────────────────────────────────────── */

.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.admin-table td {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td {
  border-bottom: none;
}
.admin-table tbody tr:hover td {
  background: rgba(255,255,255,0.02);
}
.admin-doctor-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.admin-doctor-email {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 768px) {
  .billing-plans       { grid-template-columns: 1fr; }
  .billing-status-row  { gap: 20px; }
  .admin-table th:nth-child(n+5),
  .admin-table td:nth-child(n+5) { display: none; }
}

/* ─── Settings — Subscription card ──────────────────── */

.sub-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius);
  border: 1px solid;
  text-transform: capitalize;
  white-space: nowrap;
}
.sub-status-badge--trial,
.sub-status-badge--solo,
.sub-status-badge--basic,
.sub-status-badge--pro,
.sub-status-badge--expired {
  color: #c4b09a;
  border-color: rgba(200, 175, 145, 0.25);
  background: rgba(200, 175, 145, 0.12);
}

.sub-plan-box {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius);
  overflow: hidden;
}
html.light .sub-plan-box {
  border-color: rgba(0,0,0,0.14);
}

.sub-plan-row {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.sub-plan-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px 24px;
}

/* ── Horizontal full-width plan card (settings page) ── */
.sub-plan-horizontal {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius);
  overflow: hidden;
}
html.light .sub-plan-horizontal {
  border-color: rgba(0,0,0,0.14);
}
.sub-plan-horizontal .sub-left {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}
.sub-plan-horizontal .sub-divider {
  background: rgba(255,255,255,0.12);
}
html.light .sub-plan-horizontal .sub-divider {
  background: rgba(0,0,0,0.10);
}
.sub-plan-horizontal .sub-right {
  padding: 28px 32px;
  display: flex;
  align-items: center;
}

.sub-plan-divider {
  width: 1px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}
html.light .sub-plan-divider {
  background: rgba(0,0,0,0.10);
}

.sub-plan-btn {
  margin-top: auto;
  width: 100%;
}

.sub-plan-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-pro-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  letter-spacing: 0.04em;
}
html.light .sub-pro-tag {
  background: rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.12);
  color: #333;
}

.sub-plan-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 16px;
}
.sub-plan-price span {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.sub-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}
.sub-plan-features li {
  font-size: 12px;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
}
.sub-plan-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

/* features grid — 2 columns inside the right half */
.sub-features-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  width: 100%;
}
.sub-features-grid li {
  font-size: 12px;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
}
.sub-features-grid li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 700px) {
  .sub-plan-row        { flex-direction: column; }
  .sub-plan-divider    { width: 100%; height: 1px; }
  .billing-plans       { grid-template-columns: 1fr; }
  .sub-plan-horizontal { grid-template-columns: 1fr; }
  .sub-plan-horizontal .sub-divider { display: none; }
  .sub-features-grid   { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ */
/*  PIN blur overlay (inline on page — no separate screen)             */
/* ------------------------------------------------------------------ */

/* Blur + disable interaction on the entire page when PIN is required  */
.pin-active .navbar,
.pin-active .main-content {
  filter: blur(14px) brightness(0.55);
  pointer-events: none;
  user-select: none;
  transition: filter 0.2s ease;
}

/* Full-viewport overlay sitting above the blurred content */
.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 8, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Small centered card */
.pin-dialog {
  background: rgba(14, 14, 14, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 24px 48px rgba(0,0,0,0.7);
}

.pin-dialog-icon {
  color: rgba(255,255,255,0.35);
  margin-bottom: 2px;
}

.pin-dialog-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin: 0;
}

.pin-dialog-error {
  font-size: 11px;
  color: #f87171;
  margin: 0;
  text-align: center;
}

.pin-dialog-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 20px;
  letter-spacing: 8px;
  text-align: center;
  padding: 10px 12px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.pin-dialog-input:focus {
  border-color: rgba(255,255,255,0.3);
}

.pin-dialog-btn {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  font-weight: 500;
  padding: 9px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pin-dialog-btn:hover {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.18);
}

/* Form inside dialog: stack input + button with a gap */
.pin-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* Back arrow — top-left of overlay */
.pin-back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.pin-back-btn:hover {
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
}

/* ------------------------------------------------------------------ */
/*  Walk-in panel                                                       */
/* ------------------------------------------------------------------ */

.walkin-panel {
  margin-bottom: 20px;
  animation: slideDown 0.15s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.walkin-panel-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.walkin-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.walkin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Each row inside the walk-in form */
.walkin-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.walkin-row .input-sm { flex: 1; }
.walkin-row .phone-wrap { flex: 1; }   /* phone-wrap added by initPhoneInput */
.walkin-row .phone-wrap .input-sm { width: 100%; }

.walkin-age   { flex: 0 0 90px  !important; }
.walkin-gender { flex: 0 0 120px !important; }
.walkin-notes  { flex: 1 !important; }

.walkin-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.walkin-submit { flex: 1; }

.walkin-field { width: 100%; }

/* ---- Emergency toggle button ---- */
.btn-emergency-toggle {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid rgba(248, 113, 113, 0.18);
  background: rgba(248, 113, 113, 0.06);
  color: rgba(248, 113, 113, 0.45);
  transition: background 0.18s ease, color 0.18s ease,
              border-color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn-emergency-toggle:hover {
  background: rgba(248, 113, 113, 0.12);
  color: rgba(248, 113, 113, 0.75);
  border-color: rgba(248, 113, 113, 0.30);
}
.btn-emergency-toggle.active {
  background: rgba(248, 113, 113, 0.22) !important;
  color: #f87171 !important;
  border-color: rgba(248, 113, 113, 0.55) !important;
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.18);
}
html.light .btn-emergency-toggle {
  border-color: rgba(220, 38, 38, 0.14);
  background: rgba(220, 38, 38, 0.05);
  color: rgba(220, 38, 38, 0.40);
}
html.light .btn-emergency-toggle:hover {
  background: rgba(220, 38, 38, 0.10);
  color: rgba(220, 38, 38, 0.65);
  border-color: rgba(220, 38, 38, 0.24);
}
html.light .btn-emergency-toggle.active {
  background: rgba(220, 38, 38, 0.15) !important;
  color: #b91c1c !important;
  border-color: rgba(220, 38, 38, 0.40) !important;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.12);
}

/* ---- Emergency appointment row & badge ---- */
@keyframes pulse-emergency {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.4); }
  50%       { box-shadow: 0 0 0 4px rgba(248, 113, 113, 0); }
}
.badge--emergency {
  background: rgba(200, 175, 145, 0.14);
  color: #c4b09a;
  border: 1px solid rgba(200, 175, 145, 0.22);
  animation: pulse-emergency 2s ease-in-out infinite;
}
html.light .badge--emergency {
  background: rgba(175, 145, 105, 0.16);
  color: #1a1208;
  border-color: rgba(220, 38, 38, 0.30);
}
.appt-row--emergency {
  border-left: 3px solid #f87171;
}

/* ------------------------------------------------------------------ */
/*  Booking channel badges                                              */
/* ------------------------------------------------------------------ */

.badge-channel {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Unified beige palette for all channel + status badges ─────────── */
.badge-channel--walkin,
.badge-channel--staff,
.badge-channel--doctor,
.badge-channel--patient,
.badge-channel--scheduled,
.badge-channel--completed,
.badge-channel--cancelled,
.badge-channel--no_show,
.badge-channel--in_queue,
.badge-channel--serving,
.badge-channel--billing_pending,
.badge-channel--billing,
.badge-channel--emergency {
  background: rgba(200, 175, 145, 0.14);
  color: #c4b09a;
  border: 1px solid rgba(200, 175, 145, 0.22);
}

/* ─── Phase 2: info card layout (clinic admin) ──────────────────────── */

.info-section-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* Responsive 2-up grid — wraps to 1 col on narrow screens */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.info-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--glow);
  transition: var(--transition-pop);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.info-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--glow-hover);
  border-color: var(--border-light);
}

.info-row {
  display: flex;
  align-items: baseline;
  gap: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}

.info-row:first-child {
  padding-top: 0;
}

.info-row:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.info-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  min-width: 110px;
  flex-shrink: 0;
}

.info-label::after {
  content: ":";
  margin-right: 8px;
}

.info-sep {
  display: none;
}

.info-value {
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
  flex: 1;
}

.info-value--bold {
  font-weight: 600;
  font-size: 14px;
}

.info-card-action {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ─── Phase 2: generic data table ──────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
  font-size: 14px;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover td {
  background: rgba(255,255,255,0.02);
}
html.light .data-table th {
  background: rgba(0,0,0,0.02);
}
html.light .data-table td {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
html.light .data-table tbody tr:hover td {
  background: rgba(0,0,0,0.02);
}

.empty-state-text {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 16px 0;
  margin: 0;
}

/* ─── Clinic admin doctor row ───────────────────────────────────────── */

.clinic-doc-row {
  display: grid;
  grid-template-columns: 1fr 160px 90px 64px 64px 56px;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--glow);
  transition: var(--transition-pop);
}

.clinic-doc-row:hover {
  transform: translateY(-2px) scale(1.005);
  box-shadow: var(--glow-hover);
  border-color: var(--border-light);
}

.clinic-doc-row--header {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.clinic-doc-row--header:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

/* Doctor selector tooltip — appointments page */
.doc-selector-btn {
  position: relative;
}
.doc-spec-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #2e1e0c;
  color: #ddd0be;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  border: 1px solid rgba(200,170,130,0.20);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: opacity 0.08s ease;
  transition-delay: 0s;
  z-index: 50;
}
.doc-spec-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #2e1e0c;
}
.doc-selector-btn:hover .doc-spec-tip {
  opacity: 1;
  transition-delay: 0.1s;
}

.clinic-doc-name  { min-width: 0; }
.clinic-doc-spec  { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clinic-doc-role  { }
.clinic-doc-count { text-align: center; }
.clinic-doc-action { text-align: right; }

/* ─── Clinic admin staff row ────────────────────────────────────────── */

.clinic-staff-row {
  display: grid;
  grid-template-columns: 160px 1fr 110px 80px;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--glow);
  transition: var(--transition-pop);
}

.clinic-staff-row:hover {
  transform: translateY(-2px) scale(1.005);
  box-shadow: var(--glow-hover);
  border-color: var(--border-light);
}

.clinic-staff-row--header {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.clinic-staff-row--header:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

/* Staff manage row (with action column) */
.clinic-staff-manage-row {
  display: grid;
  grid-template-columns: 160px 1fr 110px 80px 100px;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--glow);
  transition: var(--transition-pop);
}
.clinic-staff-manage-row:hover {
  transform: translateY(-2px) scale(1.005);
  box-shadow: var(--glow-hover);
  border-color: var(--border-light);
}

/* Invite row */
.clinic-invite-row {
  display: grid;
  grid-template-columns: 1fr 110px 110px 90px;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--glow);
  transition: var(--transition-pop);
}
.clinic-invite-row:hover {
  transform: translateY(-2px) scale(1.005);
  box-shadow: var(--glow-hover);
  border-color: var(--border-light);
}
.clinic-invite-row--header {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
}
.clinic-invite-row--header:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

/* ── Patient Note Timeline ──────────────────────────────────────── */
/* Wrapper takes the leftover space in the card; the timeline scrolls inside it.
   Because the timeline is absolutely positioned it contributes no intrinsic
   height, so the card height is driven by the Patient Information card instead
   of growing with the number of notes. */
.note-timeline-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 90px;
  margin-bottom: 8px;
}
.note-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.note-entry {
  position: relative;
  padding-bottom: 24px;
}
.note-entry:last-child { padding-bottom: 0; }

.note-entry-date {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.note-entry-date::before,
.note-entry-date::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.note-entry-body {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  position: relative;
  transition: border-color 0.2s;
}
.note-entry-body:hover { border-color: var(--border-light); }

.note-entry-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.note-entry-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.note-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-pop);
  max-width: 220px;
}
.note-file-chip:hover {
  color: var(--text);
  border-color: var(--border-light);
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--glow-hover);
}
.note-file-chip svg { flex-shrink: 0; }
.note-file-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-file-chip-size {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Edit + delete icon buttons — top-right of note body */
.note-entry-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 2px;
  z-index: 1;
}
.note-entry-action-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.note-entry-action-btn:hover {
  color: var(--text-muted);
  background: var(--bg-2);
}
.note-entry-action-btn--danger:hover {
  color: var(--danger);
  background: rgba(248,113,113,0.1);
}

/* Legacy alias — kept so any old references still work */
.note-entry-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  z-index: 1;
}
.note-entry-delete:hover {
  color: var(--danger);
  background: rgba(248,113,113,0.1);
}

/* Edit mode — note body becomes a form */
.note-entry-body--editing {
  border-color: var(--border-light) !important;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}
.note-edit-textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.65;
  padding: 10px 12px;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s;
  box-sizing: border-box;
  margin-bottom: 10px;
}
.note-edit-textarea:focus {
  outline: none;
  border-color: var(--border-light);
}

/* File chips in edit mode: not clickable, have × remove button */
.note-file-chip--editable {
  cursor: default;
  padding-right: 6px;
}
.note-file-chip--editable:hover {
  transform: none;
  box-shadow: none;
}
.note-file-chip-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  margin-left: 2px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.note-file-chip-remove:hover { color: var(--danger); }

/* New-file chips queued inside edit mode */
.note-file-chip--new {
  border-style: dashed;
  opacity: 0.85;
}

/* Add-more-files row inside edit mode */
.note-edit-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.note-edit-add-row label {
  cursor: pointer;
}

/* Edit action buttons row */
.note-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.note-empty-state {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 24px 0 16px;
  font-style: italic;
}

/* Compose area */
.note-compose {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 20px;
}

.note-compose textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.65;
  padding: 12px 14px;
  resize: vertical;
  min-height: 88px;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 10px;
  box-sizing: border-box;
}
.note-compose textarea:focus {
  outline: none;
  border-color: var(--border-light);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}

.note-compose-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.note-file-queue {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.note-file-queue-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 9px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-muted);
  max-width: 200px;
}
.note-file-queue-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-file-queue-chip button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s;
}
.note-file-queue-chip button:hover { color: var(--danger); }

/* Save feedback */
.note-save-error {
  font-size: 12px;
  color: var(--danger);
  margin-right: auto;
  display: none;
}

/* File upload modal */
.file-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 460px;
  margin: 0 24px;
  overflow: hidden;
}

.file-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.file-modal-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.file-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: color 0.15s, background 0.15s;
}
.file-modal-close:hover {
  color: var(--text);
  background: var(--bg-3);
}

.file-modal-body { padding: 20px 24px; }

.file-drop-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 28px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}
.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--text-muted);
  background: rgba(255,255,255,0.02);
}
.file-drop-zone-icon {
  color: var(--text-dim);
  margin-bottom: 10px;
}
.file-drop-zone-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.file-drop-zone-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.file-drop-limit {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 10px;
}

.file-modal-queue {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  max-height: 180px;
  overflow-y: auto;
}
.file-modal-queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.file-modal-queue-item svg { flex-shrink: 0; color: var(--text-muted); }
.file-modal-queue-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.file-modal-queue-size {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}
.file-modal-queue-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.file-modal-queue-remove:hover { color: var(--danger); }

.file-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--border);
}

/* ── Page slide transitions ─────────────────────────────────────── */
@keyframes pageSlideInRight {
  from { transform: translateX(52px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes pageSlideInLeft {
  from { transform: translateX(-52px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
.page-slide-right {
  animation: pageSlideInRight 0.27s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.page-slide-left {
  animation: pageSlideInLeft 0.27s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ------------------------------------------------------------------ */
/*  Phone input — digit counter hint                                    */
/* ------------------------------------------------------------------ */
.phone-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}
.phone-counter {
  font-size: 11px;
  margin-top: 4px;
  color: var(--muted);
  transition: color 0.15s;
}
.phone-counter.ok    { color: var(--success); }
.phone-counter.bad   { color: var(--danger);  }

/* ------------------------------------------------------------------ */
/*  New badge variants for queue states                                */
/* ------------------------------------------------------------------ */
.badge--in_queue,
.badge--serving,
.badge--billing_pending,
.badge--billing {
  background: rgba(200, 175, 145, 0.14);
  color: #c4b09a;
  border: 1px solid rgba(200, 175, 145, 0.22);
}

/* ------------------------------------------------------------------ */
/*  Merged Appointments + Queue page                                    */
/* ------------------------------------------------------------------ */

/* Live queue section container */
/* Queue + Today's Flow two-column wrapper */
.queue-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--glow);
  margin-bottom: 12px;
}

/* Today's Flow card — full-width horizontal strip above queue */
.flow-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  box-shadow: var(--glow);
  margin-bottom: 12px;
}
.flow-card-body {
  display: flex;
  align-items: center;
  gap: 0;
}
.flow-vdivider {
  width: 1px;
  height: 40px;
  background: var(--border);
  margin: 0 20px;
  flex-shrink: 0;
}
.flow-counts-row {
  display: flex;
  gap: 24px;
}
.flow-kpis-row {
  display: flex;
  gap: 28px;
}
@media (max-width: 900px) {
  .flow-card-body { flex-wrap: wrap; gap: 12px; }
  .flow-vdivider { display: none; }
}
.flow-card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
/* Progress bar */
.flow-bar-track {
  height: 8px;
  border-radius: var(--radius-xs);
  background: var(--bg-3);
  display: flex;
  overflow: hidden;
  margin-bottom: 14px;
}
.flow-bar-seg {
  height: 100%;
  transition: width .4s ease;
}
.flow-bar-seg--waiting  { background: #6b4a28; }
.flow-bar-seg--serving  { background: #9e7048; }
.flow-bar-seg--billing  { background: #c49a6c; }
.flow-bar-seg--done     { background: #dfc5a0; }
/* Status counts row */
.flow-counts-row {
  display: flex;
  gap: 20px;
}
.flow-count-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.flow-count-label-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.flow-count-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.flow-count-dot--waiting  { background: #6b4a28; }
.flow-count-dot--serving  { background: #9e7048; }
.flow-count-dot--billing  { background: #c49a6c; }
.flow-count-dot--done     { background: #dfc5a0; }
.flow-count-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--dim);
}
.flow-count-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
/* KPI row */
.flow-divider { height: 1px; background: var(--border); margin: 0 0 14px; }
.flow-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.flow-kpi { text-align: center; }
.flow-kpi-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--dim);
  display: block;
  margin-bottom: 4px;
}
.flow-kpi-val {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.flow-kpi-unit {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.queue-block { display: flex; flex-direction: column; gap: 8px; }

.queue-block-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 2px;
}
.queue-block--serving .queue-block-label {
  color: #22c55e;
}

.queue-empty {
  padding: 4px 8px;
  color: var(--muted);
}

/* Brown left strip on appointment rows in the schedule section */
.appt-row--striped {
  position: relative;
  overflow: hidden;
}
.appt-row--striped::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #6b4a28;
  border-radius: 4px 0 0 4px;
}
html.light .appt-row--striped::before {
  background: #7a5230;
}

/* Schedule card — matches queue-section dimensions */
.schedule-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--glow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Schedule section header (label + date nav + search in one row) */
.schedule-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.schedule-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* Appointment row – serving highlight */
.appt-row--serving {
  border-color: rgba(34,197,94,.3);
  background: rgba(34,197,94,.03);
}

/* ------------------------------------------------------------------ */
/*  Today's Queue  (visits_today.html — kept for standalone access)    */
/* ------------------------------------------------------------------ */

/* Walk-in check-in panel */
.walkin-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.walkin-form { width: 100%; }

/* Section count badge */
.section-count {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}

/* NOW SERVING card */
.visit-serving-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.30);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.08), var(--glow);
  position: relative;
  z-index: 10;
  margin-bottom: 4px;
}
html.light .visit-serving-card {
  background: rgba(34, 197, 94, 0.07);
  border-color: rgba(34, 197, 94, 0.28);
}
.visit-serving-card.visit-emergency {
  border-color: rgba(248,113,113,0.4);
  background: rgba(248,113,113,0.06);
  box-shadow: 0 0 24px rgba(248,113,113,0.12), var(--glow);
}

.visit-token {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  min-width: 60px;
  color: #22c55e;
}
.emergency-badge { font-size: 1rem; margin-left: 6px; }

/* Waiting list */
.visit-list { display: flex; flex-direction: column; gap: 6px; }

.visit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  position: relative;
  z-index: 1;
  transition: var(--transition-pop), background 0.15s ease;
}
.visit-row:hover {
  transform: translateY(-1px) scale(1.005);
  box-shadow: var(--glow-hover);
}
.visit-row.visit-emergency {
  border-color: rgba(248,113,113,0.35);
  background: rgba(248,113,113,0.04);
}
.visit-row--closed {
  opacity: 0.65;
}
.visit-row--closed:hover { opacity: 0.9; }

.visit-token-sm {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 38px;
  color: var(--text);
}

.visit-info { flex: 1; min-width: 0; }
.visit-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.visit-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.visit-status-badge { white-space: nowrap; }

.visit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* ⋮ more button */
.visit-more-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  user-select: none;
  line-height: 1;
}
.visit-more-btn:hover { background: var(--bg-3); color: var(--text); }

/* Dropdown menu */
.visit-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  min-width: 160px;
  overflow: hidden;
}
.visit-menu.open { display: block; }

.visit-menu-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}
.visit-menu-item:hover { background: var(--bg-3); }
.visit-menu-item.danger { color: var(--danger); }
.visit-menu-item.danger:hover { background: rgba(248,113,113,0.08); }

/* Dock active indicator */
.dock-item--active {
  background: rgba(200, 170, 130, 0.22) !important;
  border-color: rgba(200, 170, 130, 0.40) !important;
  color: #ede4d6 !important;
}
html.light .dock-item--active {
  background: rgba(200, 170, 130, 0.28) !important;
  border-color: rgba(200, 170, 130, 0.50) !important;
  color: #ede4d6 !important;
}

/* ══════════════════════════════════════════════════════════════════
   MODAL — shared base (used by bill modal + future modals)
══════════════════════════════════════════════════════════════════ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open {
  display: flex;
}
.modal-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  width: 100%;
  max-width: 460px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.modal-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }
.modal-actions {
  display: flex;
  gap: 0;
}
.modal-actions .btn {
  flex: 1;
  justify-content: center;
  border-radius: 0;
}
.modal-actions .btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: none;
}
.modal-actions .btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ══════════════════════════════════════════════════════════════════
   BILL MODAL specific
══════════════════════════════════════════════════════════════════ */
.bill-pinned-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bill-quick-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition-pop);
}
.bill-quick-btn:hover {
  border-color: var(--border-light);
  transform: translateY(-1px);
}
.bill-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.bill-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.bill-total-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bill-total-amount {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Standalone form primitives (used inside modals, not inside .form-group) ── */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.form-input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-3);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input::placeholder { color: var(--dim); }
.form-input:focus {
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}
html.light .form-input:focus { border-color: rgba(0,0,0,0.35); box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }
.form-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555555' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

/* Collect payment button */
.btn-collect {
  background: rgba(175,142,100,0.15);
  border: 1px solid rgba(175,142,100,0.5);
  color: #ede8e2;
  font-weight: 600;
}
html.light .btn-collect {
  background: rgba(107,74,40,0.1);
  border: 1px solid rgba(107,74,40,0.4);
  color: #3d2010;
}
.btn-collect:hover {
  background: rgba(175,142,100,0.25);
  transform: translateY(-1px);
}
html.light .btn-collect:hover {
  background: rgba(107,74,40,0.18);
}

/* ══════════════════════════════════════════════════════════════════
   PRICE CATALOG (settings)
══════════════════════════════════════════════════════════════════ */
.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.catalog-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.catalog-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.catalog-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.catalog-pin-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1px 8px;
}
.catalog-price {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  min-width: 70px;
  text-align: right;
}
.catalog-actions {
  display: flex;
  gap: 6px;
}
.catalog-add-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.catalog-pin-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════
   BILL HISTORY (patient detail)
══════════════════════════════════════════════════════════════════ */
.bill-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.bill-history-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--glow);
  transition: var(--transition-pop);
}
.bill-history-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow-hover);
}
.bill-history-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 90px;
}
.bill-history-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.bill-history-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bill-history-notes {
  font-size: 12px;
  color: var(--muted);
}
.bill-history-discount {
  font-size: 11px;
  color: var(--dim);
}
.bill-history-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.bill-history-amount {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.bill-history-link {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}
.bill-history-link:hover { color: var(--text); }
.bill-history-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

/* ══════════════════════════════════════════════════════════════════
   BILL DETAIL PAGE
══════════════════════════════════════════════════════════════════ */
.bill-detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
.bill-detail-parties {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.bill-detail-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bill-detail-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text);
}
.bill-detail-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bill-info-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bill-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.bill-info-label {
  color: var(--muted);
}
.bill-info-val {
  font-weight: 500;
  color: var(--text);
}
@media (max-width: 760px) {
  .bill-detail-grid { grid-template-columns: 1fr; }
}

/* Bill item rows inside modal */
.bill-items-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.bill-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.bill-item-remove {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.bill-item-remove:hover {
  color: var(--danger);
  border-color: rgba(248,113,113,.4);
}

/* ── Bill modal — item column labels ── */
.bill-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.bill-col-labels {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 5px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}
.bill-item-linetotal {
  width: 76px;
  text-align: right;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}

/* ── Toggle buttons (Discount / GST) ── */
.bill-toggle-row {
  display: flex;
  gap: 8px;
}
.bill-toggle-btn {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.bill-toggle-btn:hover {
  border-color: var(--border-light);
  color: var(--text);
}
.bill-toggle-btn.active {
  background: rgba(175,145,105,0.1);
  border-color: var(--border-light);
  border-style: solid;
  color: var(--text);
}

/* ── Payment mode row of buttons ── */
.bill-mode-btns {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.bill-mode-btn {
  flex: 1;
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.bill-mode-btn:last-child { border-right: none; }
.bill-mode-btn:hover { background: var(--bg-3); color: var(--text); }
.bill-mode-btn.active {
  background: rgba(175,145,105,0.18);
  color: var(--text);
  font-weight: 600;
}

/* ── Summary breakdown block ── */
.bill-summary-block {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.bill-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.bill-summary-line:last-child { border-bottom: none; }
.bill-summary-line--disc { color: #b45309; }
.bill-summary-line--total {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  padding: 11px 14px;
}

/* ── Bill detail — items table ── */
.bill-detail-items {
  margin-bottom: 8px;
}
.bill-detail-items-head {
  display: flex;
  gap: 8px;
  padding: 0 0 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}
.bill-detail-item-row {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.bill-detail-item-row:last-child { border-bottom: none; }

/* ── Patient billing history item chips ── */
.bill-history-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}
.bill-history-item-chip {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  white-space: nowrap;
}
.bill-history-item-chip--more {
  color: var(--muted);
  background: none;
  border-style: dashed;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Income Dashboard  (v59)
   ═══════════════════════════════════════════════════════════════════════════ */

/* KPI strip */
.income-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.income-kpi-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--glow);
  transition: var(--transition-pop);
}
.income-kpi-card:hover { transform: translateY(-2px) scale(1.01); }
.income-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.income-kpi-amount {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.income-kpi-amount.pnl-positive { color: var(--text); }
.income-kpi-amount.pnl-negative { color: var(--text); }
.income-kpi-sub { font-size: 12px; color: var(--muted); }
.income-kpi-sub.positive { color: var(--muted); }
.income-kpi-sub.negative { color: var(--muted); }

/* 30-day chart card */
.income-chart-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--glow);
  margin-bottom: 24px;
}
.income-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.income-chart-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 4px;
}
.income-chart-peak {
  font-size: 12px;
  color: var(--muted);
}
.income-chart-wrap {
  position: relative;
  width: 100%;
}
#revenueChart {
  width: 100%;
  height: 160px;
  display: block;
  overflow: visible;
}
.income-chart-tooltip {
  position: absolute;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  line-height: 1.5;
}
.income-chart-labels {
  position: relative;
  height: 20px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

/* Breakdown grids */
.income-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.income-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.income-breakdown-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--glow);
}
.income-breakdown-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Bar rows (used in all breakdown cards) */
.income-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.income-bar-row:last-child { margin-bottom: 0; }
.income-bar-label {
  font-size: 12px;
  color: var(--text);
  min-width: 72px;
  flex-shrink: 0;
}
.income-bar-track {
  flex: 1;
  height: 5px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}
.income-bar-fill {
  height: 100%;
  background: var(--text);
  border-radius: 3px;
  opacity: 0.45;
  transition: width 0.5s ease;
}
.income-bar-pct {
  font-size: 11px;
  color: var(--dim);
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}
.income-bar-amount {
  font-size: 12px;
  color: var(--muted);
  min-width: 64px;
  text-align: right;
  flex-shrink: 0;
}
.income-empty-state {
  font-size: 13px;
  color: var(--dim);
  padding: 12px 0;
  text-align: center;
}

/* Pending collections */
.pending-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--glow);
  margin-bottom: 24px;
}
.pending-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.pending-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pending-row:last-child { border-bottom: none; }
.pending-name { font-size: 13px; font-weight: 500; color: var(--text); }
.pending-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pending-amount {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #f87171;
  flex-shrink: 0;
  min-width: 70px;
  text-align: right;
}
.pending-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Recent transactions */
.txn-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--glow);
  margin-bottom: 24px;
}
.txn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.txn-row:last-child { border-bottom: none; }
.txn-token {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 36px;
  flex-shrink: 0;
}
.txn-name { flex: 1; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-type { color: var(--muted); font-size: 12px; min-width: 50px; flex-shrink: 0; }
.txn-date { color: var(--muted); font-size: 12px; min-width: 60px; text-align: right; flex-shrink: 0; }
.txn-mode { flex-shrink: 0; }
.txn-amount {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  min-width: 70px;
  text-align: right;
  flex-shrink: 0;
}
.txn-amount.free { color: var(--muted); font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 400; }

/* View all link on income page */
.txn-view-all {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  display: inline-block;
  transition: color 0.15s, border-color 0.15s;
}
.txn-view-all:hover { color: var(--text); border-color: rgba(200,175,145,0.35); }

/* Month chips on transactions page */
.txn-month-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.txn-month-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.txn-month-chip:hover {
  background: var(--bg-3);
  color: var(--text);
  border-color: rgba(200,175,145,0.35);
}
.txn-month-chip--active {
  background: #6b4a28;
  color: #e8d5bc;
  border-color: #6b4a28;
}
.txn-month-chip--active:hover {
  background: #6b4a28;
  color: #e8d5bc;
}

/* Total row at bottom of transactions list */
.txn-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 0;
  margin-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

html.light .txn-month-chip--active { background: #6b4a28; color: #f5ead8; }

/* ═══════════════════════════════════════════════════════════════════════════
   Expense Tracker
   ═══════════════════════════════════════════════════════════════════════════ */

.expense-month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.expense-month-label {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  min-width: 150px;
  text-align: center;
}

.expense-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.expense-kpi-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--glow);
}
.expense-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 6px;
}
.expense-kpi-val {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.expense-kpi-val.pnl-positive { color: var(--text); }
.expense-kpi-val.pnl-negative { color: var(--text); }

.expense-page-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 24px;
  align-items: start;
}

/* Add expense */
.add-expense-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--glow);
  margin-bottom: 20px;
}
.add-expense-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* Expense list */
.expense-list-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--glow);
}
.expense-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.expense-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.expense-row:last-child { border-bottom: none; }
.expense-cat-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: rgba(200, 175, 145, 0.14);
  border: 1px solid rgba(200, 175, 145, 0.22);
  color: #c4b09a;
  flex-shrink: 0;
}
html.light .expense-cat-badge {
  background: rgba(175, 145, 105, 0.16);
  border-color: rgba(155, 125, 85, 0.28);
  color: #1a1208;
}
.expense-desc {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.expense-date { color: var(--muted); font-size: 12px; min-width: 52px; text-align: right; flex-shrink: 0; }
.expense-amount {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  min-width: 70px;
  text-align: right;
  flex-shrink: 0;
}
.expense-del-btn {
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.expense-del-btn:hover { color: var(--danger); }

/* Category summary sidebar */
.cat-summary-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--glow);
  margin-bottom: 20px;
}

/* Recurring rules */
.recurring-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--glow);
}
.recurring-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.recurring-row:first-child { border-top: none; }
.recurring-label { font-weight: 500; color: var(--text); }
.recurring-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.recurring-amount {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  min-width: 60px;
  text-align: right;
  flex-shrink: 0;
}
.recurring-inactive { opacity: 0.40; }

/* Responsive */
@media (max-width: 1100px) {
  .income-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .income-grid-3 { grid-template-columns: 1fr; }
  .income-grid-2 { grid-template-columns: 1fr; }
  .expense-page-grid { grid-template-columns: 1fr; }
  .expense-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .income-kpi-grid { grid-template-columns: 1fr; }
  .expense-kpi-grid { grid-template-columns: 1fr; }
  .add-expense-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Dashboard two-column layout  (v60)
   ═══════════════════════════════════════════════════════════════════════════ */

.dash-body-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  align-items: stretch;
  min-height: calc(100vh - 180px);
}

/* Left column — stretches to fill grid height */
.dash-left {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.dash-left .schedule-section {
  flex: 1;
  min-height: 0;
}

/* Right column — stacked cards, fills full grid row height */
.dash-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: stretch;
}

/* Quick Expense card grows to fill leftover space */
.dash-expense-card {
  flex: 1;
}

/* Mini card (income + expense) */
.dash-mini-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--glow);
}
.dash-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dash-mini-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.dash-mini-link {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.dash-mini-link:hover { color: var(--text); }

/* Income section inside mini card */
.dash-income-today {
  margin-bottom: 12px;
}
.dash-income-amount {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.dash-income-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* Last transaction row */
.dash-last-txn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}
.dash-last-txn-label {
  font-size: 11px;
  color: var(--muted);
}
.dash-last-txn-amount {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.dash-mini-subheader {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--dim);
  margin-bottom: 10px;
}

/* Recent bills rows */
.dash-bill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.dash-bill-row:last-child { border-bottom: none; }
.dash-bill-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}
.dash-bill-token {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.dash-bill-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-bill-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.dash-bill-date { font-size: 11px; color: var(--dim); }
.dash-bill-amount {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  min-width: 46px;
  text-align: right;
}
.dash-bill-free { color: var(--muted); font-weight: 400; }

/* Quick expense form grid inside mini card */
.dash-expense-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

/* Responsive: stack to single column on smaller screens */
@media (max-width: 900px) {
  .dash-body-grid { grid-template-columns: 1fr; }
  .dash-right { position: static; }
}

/* ── Previous Appointments collapsible (dashboard) ── */
.dash-prev-section {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  /* Pull the section flush with the card's bottom padding */
  margin-bottom: -20px;
}
.dash-prev-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  padding: 14px 0 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: color .15s;
}
.dash-prev-toggle:hover,
.dash-prev-toggle--open { color: var(--text); }
.dash-prev-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.dash-prev-list {
  display: none;
  overflow: hidden;
}
.dash-prev-list--open {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px 12px;
  margin: 0 -4px;
  animation: slideDown .2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   APPOINTMENT CARD OVERLAY  (floating detail card)
═══════════════════════════════════════════════════════════════════ */
.appt-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px) brightness(.6);
  -webkit-backdrop-filter: blur(10px) brightness(.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  padding: 24px;
  box-sizing: border-box;
}
.appt-card-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.appt-card-container {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 920px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.55);
  transform: translateY(16px) scale(.97);
  transition: transform .25s cubic-bezier(.16,1,.3,1);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.appt-card-overlay.open .appt-card-container {
  transform: translateY(0) scale(1);
}

/* ── Card body ── */
.ac-wrap {
  padding: 28px 28px 24px;
  position: relative;
}

/* ── Header ── */
.ac-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}
.ac-identity { flex: 1; min-width: 0; }
.ac-name {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}
.ac-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.ac-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.ac-tag svg { opacity: .7; }
.ac-tag--emergency { color: var(--muted); }
.ac-tag-dot { color: var(--dim); font-size: 12px; }
.ac-appt-id {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--dim);
}
.ac-appt-id svg { opacity: .6; }

/* Header right — status + actions */
.ac-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ac-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius);
  letter-spacing: .03em;
}
.ac-status--scheduled,
.ac-status--completed,
.ac-status--cancelled,
.ac-status--no_show,
.ac-status--serving,
.ac-status--waiting,
.ac-status--billing_pending,
.ac-status--done {
  background: rgba(200, 175, 145, 0.14);
  color: #c4b09a;
  border: 1px solid rgba(200, 175, 145, 0.25);
}
html.light .ac-status--scheduled,
html.light .ac-status--completed,
html.light .ac-status--cancelled,
html.light .ac-status--no_show,
html.light .ac-status--serving,
html.light .ac-status--waiting,
html.light .ac-status--billing_pending,
html.light .ac-status--done {
  background: rgba(175, 145, 105, 0.16);
  color: #1a1208;
  border-color: rgba(155, 125, 85, 0.28);
}

.ac-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.ac-action-btn:hover { background: var(--bg-input); color: var(--text); }
.ac-action-btn--danger { color: #ef4444; border-color: rgba(239,68,68,.3); }
.ac-action-btn--danger:hover { background: rgba(239,68,68,.08); }

/* ── 3-column info grid ── */
.ac-info-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.ac-col { padding: 18px 20px; }
.ac-col-divider { background: var(--border); width: 1px; }
.ac-col-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--dim);
  margin-bottom: 16px;
}
.ac-col-title svg { opacity: .7; }
.ac-col-rows { display: flex; flex-direction: column; gap: 12px; }

/* Row = label (left) + value (right) on same line */
.ac-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.ac-row-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ac-row-label svg { opacity: .6; flex-shrink: 0; }
.ac-row-val {
  color: var(--text);
  font-size: 13px;
  text-align: right;
  flex: 1;
  min-width: 0;
}
.ac-dot-sep { color: var(--dim); margin: 0 3px; }

/* Follow-up inline form */
.ac-follow-up-form {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
  padding-left: 4px;
}
.ac-inline-edit {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--muted);
  cursor: pointer;
  margin-left: 8px;
  transition: all .15s;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.4;
}
.ac-inline-edit:hover { color: var(--text); background: var(--bg-input); border-color: var(--muted); }

/* Special value pills */
.ac-type-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius);
  background: rgba(200, 175, 145, 0.14);
  color: #c4b09a;
  border: 1px solid rgba(200, 175, 145, 0.25);
}
html.light .ac-type-pill {
  background: rgba(175, 145, 105, 0.16);
  color: #1a1208;
  border-color: rgba(155, 125, 85, 0.28);
}
.ac-blood-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(200, 175, 145, 0.14);
  color: #c4b09a;
  border: 1px solid rgba(200, 175, 145, 0.25);
}
html.light .ac-blood-badge {
  background: rgba(175, 145, 105, 0.16);
  color: #1a1208;
  border-color: rgba(155, 125, 85, 0.28);
}
.ac-pay-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius);
}
.ac-pay-status--paid,
.ac-pay-status--dues,
.ac-pay-status--free {
  background: rgba(200, 175, 145, 0.14);
  color: #c4b09a;
  border: 1px solid rgba(200, 175, 145, 0.25);
}
html.light .ac-pay-status--paid,
html.light .ac-pay-status--dues,
html.light .ac-pay-status--free {
  background: rgba(175, 145, 105, 0.16);
  color: #1a1208;
  border-color: rgba(155, 125, 85, 0.28);
}

/* ── Bottom grid ── */
.ac-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ac-bottom-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.ac-bottom-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--dim);
  margin-bottom: 14px;
}

/* Billing list inside card */
.ac-bill-list { font-size: 13px; }
.ac-bill-head-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--dim);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.ac-bill-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  color: var(--text);
  font-size: 13px;
}
.ac-bill-discount-row { color: #c8b49a; }
html.light .ac-bill-discount-row { color: #6b4a28; }
.ac-bill-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* Payment mode badge in billing header */
.ac-mode-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--dim);
  border: 1px solid var(--border);
}
.ac-mode-badge--cash,
.ac-mode-badge--upi,
.ac-mode-badge--card,
.ac-mode-badge--insurance,
.ac-mode-badge--free {
  background: rgba(200, 175, 145, 0.14);
  color: #c4b09a;
  border-color: rgba(200, 175, 145, 0.25);
}
html.light .ac-mode-badge--cash,
html.light .ac-mode-badge--upi,
html.light .ac-mode-badge--card,
html.light .ac-mode-badge--insurance,
html.light .ac-mode-badge--free {
  background: rgba(175, 145, 105, 0.16);
  color: #1a1208;
  border-color: rgba(155, 125, 85, 0.28);
}

/* btn-xs */
.btn-xs {
  font-size: 11px !important;
  padding: 4px 9px !important;
  border-radius: 8px !important;
}

/* ── Responsive ── */
@media (max-width: 760px) {
  .ac-info-grid { grid-template-columns: 1fr; }
  .ac-col-divider { width: 100%; height: 1px; }
  .ac-bottom-grid { grid-template-columns: 1fr; }
  .ac-header-right { flex-wrap: wrap; }
  .ac-row { flex-direction: column; gap: 2px; }
  .ac-row-val { text-align: left; }
}

/* ── Appointment Card — Edit Panel ── */
#acEditPanel {
  padding: 24px 28px 28px;
}
.ac-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.ac-edit-section {
  margin-bottom: 24px;
}
.ac-edit-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--dim);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.ac-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ac-edit-field { display: flex; flex-direction: column; gap: 5px; }
.ac-edit-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.ac-edit-field input,
.ac-edit-field select,
.ac-edit-field textarea {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color .15s;
  width: 100%;
  box-sizing: border-box;
}
.ac-edit-field input:focus,
.ac-edit-field select:focus,
.ac-edit-field textarea:focus { outline: none; border-color: var(--muted); }
.ac-edit-field textarea { resize: vertical; min-height: 80px; }
.ac-edit-field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

/* ── Edit Bill Modal — fixed above card overlay (z-index 1100) ── */
.ac-bill-modal-wrap {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.ac-bill-modal-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,.55);
}

@media (max-width: 640px) {
  .ac-edit-grid { grid-template-columns: 1fr; }
  .ac-edit-field[style*="span 2"] { grid-column: span 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   ACM — Edit Payment Modal  (inside appointment card overlay)
═══════════════════════════════════════════════════════════════════ */

/* Modal header */
.acm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.acm-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.acm-sub {
  font-size: 12px;
  color: var(--dim);
  margin-top: 3px;
}
.acm-close {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.acm-close:hover { background: var(--bg-input); color: var(--text); }

/* Quick-add pills */
.acm-quickadd {
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.acm-quickadd-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dim);
  margin-bottom: 8px;
}
.acm-quickadd-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.acm-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.acm-pill:hover { border-color: var(--muted); background: var(--bg-input); }
.acm-pill-price { color: var(--dim); font-size: 11px; }

/* Section wrapper */
.acm-section {
  margin-bottom: 16px;
}
.acm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.acm-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.acm-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.acm-add-btn:hover { background: var(--bg-input); color: var(--text); border-color: var(--muted); }

/* Item column headers */
.acm-item-head {
  display: grid;
  grid-template-columns: 1fr 110px 32px;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--dim);
  padding: 0 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.acm-item-list { display: flex; flex-direction: column; gap: 6px; }
.acm-item-row {
  display: grid;
  grid-template-columns: 1fr 110px 32px;
  gap: 8px;
  align-items: center;
}

/* Unified input style for the modal */
.acm-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .15s;
  -moz-appearance: textfield;
  appearance: textfield;
}
.acm-input::-webkit-inner-spin-button,
.acm-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.acm-input:focus { outline: none; border-color: var(--muted); }
.acm-input-name  { /* takes flex:1 from grid */ }
.acm-input-price { text-align: right; font-variant-numeric: tabular-nums; }
.acm-input-prefixed { padding-left: 28px; }

/* Remove button */
.acm-remove-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--dim);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.acm-remove-btn:hover { color: #ef4444; border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.07); }

/* Discount + payment mode grid */
.acm-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.acm-field { display: flex; flex-direction: column; gap: 5px; }
.acm-field--full { grid-column: span 2; }
.acm-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dim);
}

/* Prefix wrapper for discount */
.acm-input-wrap { position: relative; }
.acm-input-prefix {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--dim);
  pointer-events: none;
  font-weight: 600;
}

/* Custom select */
.acm-select-wrap { position: relative; }
.acm-select {
  width: 100%;
  padding: 9px 36px 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color .15s;
}
.acm-select:focus { outline: none; border-color: var(--muted); }
.acm-select-arrow {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--dim);
}

/* Total bar */
.acm-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.acm-total-left {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.acm-total-left svg { color: var(--dim); }
.acm-total-amount {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

/* Actions row */
.acm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Pending Billing stat card ── */
.stat-card--dues { cursor: pointer; }
.stat-value--warn { color: #c49a6c; }
html.light .stat-value--warn { color: #7a5020; }

/* Responsive — 5 cols → 3+2 on tablet */
@media (max-width: 1100px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
}

/* Navbar is always dark brown — no light theme override needed */

/* ── Patient Detail Split Layout ────────────────────────────────────────── */
.patient-detail-split {
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: 20px;
  align-items: stretch;
}
.patient-notes-col { display: flex; flex-direction: column; }
.patient-notes-col .settings-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}
/* Header and compose stay fixed; only the timeline wrapper flexes/scrolls */
.patient-notes-col .settings-card-header,
.patient-notes-col .note-compose { flex-shrink: 0; }

/* Expand-to-fullscreen button in the notes header */
.note-expand-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.note-expand-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--bg-3);
}

/* Backdrop shown behind the fullscreen notes card */
.notes-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 900;
}
.notes-backdrop.active { display: block; }

/* Fullscreen notes card */
.patient-notes-col.notes-fullscreen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(880px, 92vw);
  height: 88vh;
  z-index: 1000;
  margin: 0;
}
.patient-notes-col.notes-fullscreen .settings-card {
  height: 100%;
  box-shadow: 0 40px 90px -20px rgba(0,0,0,.5);
}
.patient-notes-col.notes-fullscreen .note-expand-icon { display: none; }
.patient-notes-col.notes-fullscreen .note-collapse-icon { display: block !important; }
.patient-info-col { display: flex; flex-direction: column; gap: 0; }

/* Stats row inside patient info card */
.patient-info-stats {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 20px;
}
.patient-info-stat {
  flex: 1;
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.patient-info-stat:last-child { border-right: none; }
.patient-info-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.patient-info-stat-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.patient-info-stat-value--sm { font-size: 15px; }

/* Info grid rows */
.patient-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.patient-info-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.patient-info-row:nth-child(even) { border-right: none; }
.patient-info-row:last-child { border-bottom: none; }
/* Strip the trailing pair's bottom border ONLY when the grid does not end in a
   full-width row — otherwise the cell above a full-width row (e.g. Allergies)
   loses its border and the table line looks half-drawn. */
.patient-info-grid:not(:has(.patient-info-row--full:last-child))
  .patient-info-row:nth-last-child(2):not(.patient-info-row--full) { border-bottom: none; }
.patient-info-row--full {
  grid-column: 1 / -1;
  border-right: none;
}
.patient-info-row--full:last-child { border-bottom: none; }
.patient-info-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
}
.patient-info-value {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

/* Responsive: collapse to single column on smaller screens */
@media (max-width: 900px) {
  .patient-detail-split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .patient-info-grid { grid-template-columns: 1fr; }
  .patient-info-row { border-right: none; }
  .patient-info-row:nth-child(even) { border-right: none; }
}


/* ================================================================== */
/*  v141 — Animations, Loading States, Security UX                    */
/* ================================================================== */

/* ── Page Enter Animation (fixes the broken .page-enter class) ────── */
.main-content.page-enter {
  animation: pageEnterFade 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes pageEnterFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── NProgress-style Top Loading Bar ──────────────────────────────── */
#nprogress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #c9b99a, #e8d5b0);
  z-index: 10000;
  transition: width 0.25s ease, opacity 0.4s ease;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}
html.light #nprogress-bar {
  background: linear-gradient(90deg, #8a6520, #b48230);
}
#nprogress-bar.done {
  width: 100% !important;
  opacity: 0;
}

/* ── Card Stagger Entrance ────────────────────────────────────────── */
@keyframes cardFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.stat-card,
.queue-row,
.appt-row,
.patient-row-wrap {
  animation: cardFadeUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stat-card:nth-child(1), .queue-row:nth-child(1),
.appt-row:nth-child(1),  .patient-row-wrap:nth-child(1) { animation-delay: 0ms;   }
.stat-card:nth-child(2), .queue-row:nth-child(2),
.appt-row:nth-child(2),  .patient-row-wrap:nth-child(2) { animation-delay: 55ms;  }
.stat-card:nth-child(3), .queue-row:nth-child(3),
.appt-row:nth-child(3),  .patient-row-wrap:nth-child(3) { animation-delay: 110ms; }
.stat-card:nth-child(4), .queue-row:nth-child(4),
.appt-row:nth-child(4),  .patient-row-wrap:nth-child(4) { animation-delay: 165ms; }
.stat-card:nth-child(5), .queue-row:nth-child(5),
.appt-row:nth-child(5),  .patient-row-wrap:nth-child(5) { animation-delay: 220ms; }
.stat-card:nth-child(6), .queue-row:nth-child(6),
.appt-row:nth-child(6),  .patient-row-wrap:nth-child(6) { animation-delay: 275ms; }
.stat-card:nth-child(7), .queue-row:nth-child(7),
.appt-row:nth-child(7),  .patient-row-wrap:nth-child(7) { animation-delay: 320ms; }
.stat-card:nth-child(8), .queue-row:nth-child(8),
.appt-row:nth-child(8),  .patient-row-wrap:nth-child(8) { animation-delay: 360ms; }

/* ── Button Loading State ─────────────────────────────────────────── */
.btn--loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}
.btn--loading .btn-text {
  visibility: hidden;
}
.btn--loading::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  top: 50%; left: 50%;
  margin-top: -8px; margin-left: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btnSpinRing 0.7s linear infinite;
}
@keyframes btnSpinRing {
  to { transform: rotate(360deg); }
}

/* ── Enhanced Input Focus Glow ────────────────────────────────────── */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--border-light, #6b5f55);
  box-shadow: 0 0 0 3px rgba(194, 169, 138, 0.15);
  transition: border-color 0.15s ease, box-shadow 0.2s ease;
}
html.light .form-group input:focus,
html.light .form-group select:focus,
html.light .form-group textarea:focus {
  border-color: var(--border-light, #c2a98a);
  box-shadow: 0 0 0 3px rgba(100, 70, 20, 0.12);
}

/* ── Toast Notifications ──────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--glow);
  max-width: 320px;
  pointer-events: auto;
  animation: toastIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  line-height: 1.45;
}
.toast.out {
  animation: toastOut 0.22s ease forwards;
}
.toast--success { border-left: 3px solid #4ade80; }
.toast--error   { border-left: 3px solid var(--danger, #f87171); }
.toast--info    { border-left: 3px solid var(--border); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0);    }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0);    }
  to   { opacity: 0; transform: translateX(16px); }
}

/* ── Skeleton Shimmer ─────────────────────────────────────────────── */
.skeleton {
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmerSweep 1.4s ease infinite;
}
html.light .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.04) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
}
@keyframes shimmerSweep {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}
.skeleton-row    { height: 48px; margin-bottom: 8px; }
.skeleton-row--sm { height: 32px; }
.skeleton-row--lg { height: 64px; }

/* ── Auth page layout when inside .auth-page-wrap (with navbar) ───── */
.auth-page-wrap .auth-page {
  min-height: 0;
  flex: 1;
}
.auth-page-wrap {
  min-height: 100vh;
}

/* ── Ambient drifting brown blobs (shared across landing + auth pages) ─ */
.ln-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.ln-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}
.ln-blob-1 {
  width: 360px; height: 360px;
  background: #8b6830;
  opacity: .40;
  top: -8%; left: -6%;
  animation: blobFloat1 18s linear infinite;
}
.ln-blob-2 {
  width: 320px; height: 320px;
  background: #a07845;
  opacity: .36;
  top: -4%; right: -6%;
  animation: blobFloat2 22s linear infinite;
}
.ln-blob-3 {
  width: 380px; height: 380px;
  background: #7a5828;
  opacity: .32;
  bottom: -10%; right: 8%;
  animation: blobFloat3 24s linear infinite;
}
.ln-blob-4 {
  width: 300px; height: 300px;
  background: #b48a52;
  opacity: .34;
  bottom: -6%; left: 12%;
  animation: blobFloat4 20s linear infinite;
}
@keyframes blobFloat1 {
  0%   { transform: translate(0px,   0px)   scale(1);   }
  20%  { transform: translate(220px, 80px)  scale(1.08); }
  40%  { transform: translate(320px, 240px) scale(.95); }
  60%  { transform: translate(140px, 300px) scale(1.05); }
  80%  { transform: translate(-40px, 160px) scale(1.00); }
  100% { transform: translate(0px,   0px)   scale(1);   }
}
@keyframes blobFloat2 {
  0%   { transform: translate(0px,    0px)   scale(1);   }
  20%  { transform: translate(-220px, 100px) scale(.96); }
  40%  { transform: translate(-300px, 260px) scale(1.08); }
  60%  { transform: translate(-160px, 340px) scale(1.02); }
  80%  { transform: translate(60px,   180px) scale(.94); }
  100% { transform: translate(0px,    0px)   scale(1);   }
}
@keyframes blobFloat3 {
  0%   { transform: translate(0px,    0px)    scale(1);   }
  20%  { transform: translate(-220px, -120px) scale(1.06); }
  40%  { transform: translate(-340px, -300px) scale(.94); }
  60%  { transform: translate(-160px, -360px) scale(1.10); }
  80%  { transform: translate(40px,   -200px) scale(1.00); }
  100% { transform: translate(0px,    0px)    scale(1);   }
}
@keyframes blobFloat4 {
  0%   { transform: translate(0px,   0px)    scale(1);   }
  20%  { transform: translate(180px, -120px) scale(1.05); }
  40%  { transform: translate(320px, -280px) scale(.96); }
  60%  { transform: translate(180px, -380px) scale(1.08); }
  80%  { transform: translate(-40px, -200px) scale(1.00); }
  100% { transform: translate(0px,   0px)    scale(1);   }
}
@media (prefers-reduced-motion: reduce) {
  .ln-blob { animation: none !important; }
}
