/* ============================================================
   Setter Hub — Design System
   Brand-neutral (NOT partner-specific). Optimized for setters &
   closers on live calls: high contrast, low friction, fast scan.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@500;700&display=swap');

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

:root {
  /* — Brand neutral palette — */
  --primary:        #4F46E5;     /* Indigo-600 — main accent */
  --primary-hover:  #4338CA;     /* Indigo-700 */
  --primary-soft:   #EEF2FF;     /* Indigo-50 */
  --primary-border: #C7D2FE;     /* Indigo-200 */

  --call:           #16A34A;     /* Green-600 — phone / "call" CTA */
  --call-hover:     #15803D;     /* Green-700 */
  --call-soft:      #F0FDF4;     /* Green-50 */

  --warn:           #D97706;     /* Amber-600 */
  --warn-soft:      #FFFBEB;
  --danger:         #DC2626;     /* Red-600 */
  --danger-soft:    #FEF2F2;

  /* — Surface & text — */
  --bg:             #F8FAFC;     /* Slate-50 */
  --bg-sidebar:     #F1F5F9;     /* Slate-100 */
  --surface:        #FFFFFF;
  --surface-hover:  #F8FAFC;
  --border:         #E2E8F0;     /* Slate-200 */
  --border-strong:  #CBD5E1;     /* Slate-300 */

  --text-0:         #0F172A;     /* Slate-900 — headings */
  --text-1:         #1E293B;     /* Slate-800 — body emphasis */
  --text-2:         #475569;     /* Slate-600 — body */
  --text-3:         #94A3B8;     /* Slate-400 — muted/labels */

  /* — Shadows & radii — */
  --shadow-sm:      0 1px 2px rgba(15,23,42,0.05);
  --shadow:         0 4px 12px rgba(15,23,42,0.08);
  --shadow-lg:      0 12px 32px rgba(15,23,42,0.12);
  --shadow-xl:      0 24px 60px rgba(15,23,42,0.18);

  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      14px;
  --radius-xl:      20px;

  /* — Layout — */
  --nav-h:          60px;
  --sidebar-w:      320px;
}

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(79,70,229,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(22,163,74,0.05) 0%, transparent 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-brand-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 16px;
}

.login-brand-text { font-size: 16px; font-weight: 800; color: var(--text-0); letter-spacing: -0.01em; }
.login-brand-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.login-card h1 {
  font-size: 22px; font-weight: 800; color: var(--text-0);
  margin-bottom: 4px; letter-spacing: -0.02em;
}

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

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-2); margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-0);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.btn-primary {
  width: 100%;
  margin-top: 8px;
  padding: 11px 16px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.error-banner {
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--danger-soft);
  border: 1px solid #FECACA;
  border-radius: var(--radius);
  color: #991B1B;
  font-size: 13px;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-3);
}

/* ============================================================
   TOP NAV
   ============================================================ */

.app-nav {
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 14px;
}
.nav-brand-text { font-size: 15px; font-weight: 800; color: var(--text-0); letter-spacing: -0.01em; }
.nav-brand-sub { font-size: 10px; color: var(--text-3); letter-spacing: 0.02em; }

.nav-tabs {
  display: flex;
  gap: 4px;
  margin-left: 24px;
}

.nav-tab {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: background 0.12s, color 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-tab:hover { background: var(--bg); color: var(--text-0); }

.nav-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.nav-tab .soon {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--border);
  color: var(--text-3);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.12s;
}

.nav-user:hover { background: var(--bg-sidebar); }

.nav-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

.nav-user-info { line-height: 1.2; }
.nav-user-name { font-size: 12px; font-weight: 600; color: var(--text-0); }
.nav-user-role { font-size: 10px; color: var(--text-3); }

.user-menu {
  position: absolute;
  top: calc(var(--nav-h) - 8px);
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 200px;
  z-index: 200;
}

.user-menu button, .user-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-1);
  text-align: left;
}

.user-menu button:hover, .user-menu a:hover { background: var(--bg); }
.user-menu .menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-menu .menu-danger { color: var(--danger); }

/* ============================================================
   APP LAYOUT
   ============================================================ */

.app-shell {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  height: calc(100vh - var(--nav-h));
  position: relative;
  overflow: hidden;
}

.app-main {
  overflow-y: auto;
  padding: 32px 40px;
}

.app-sidebar {
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================
   DASHBOARD (welcome state)
   ============================================================ */

.welcome {
  max-width: 760px;
}

.welcome-greeting {
  font-size: 28px; font-weight: 800;
  color: var(--text-0);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.welcome-sub {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 32px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.stat-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3);
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-0);
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.stat-meta { font-size: 12px; color: var(--text-2); margin-top: 4px; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 12px;
}

.empty-hint {
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.empty-hint-icon { font-size: 32px; margin-bottom: 8px; }
.empty-hint h3 { font-size: 15px; font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.empty-hint p { font-size: 13px; color: var(--text-2); }

/* ── Dashboard hub ── */
.dash { max-width: 1120px; }

.dash-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.dash-hero-text { min-width: 0; }
.dash-hero .welcome-sub { margin-bottom: 0; }

.dash-stats { display: flex; gap: 10px; flex-shrink: 0; }
.mini-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  text-align: center;
  min-width: 76px;
  box-shadow: var(--shadow-sm);
}
.mini-stat-value { font-size: 22px; font-weight: 800; color: var(--text-0); letter-spacing: -0.02em; line-height: 1.1; }
.mini-stat-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); margin-top: 3px;
}

.dash-section { margin-bottom: 28px; }
.dash-section .section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.section-count {
  font-size: 10px; font-weight: 700;
  padding: 1px 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-2);
  letter-spacing: 0;
}

.clinic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
}

.clinic-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.clinic-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.cc-logo {
  width: 42px; height: 42px;
  border-radius: 9px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px;
}
.cc-logo-fallback {
  width: 42px; height: 42px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}

.cc-name {
  font-size: 14px; font-weight: 700;
  color: var(--text-0);
  margin-top: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cc-loc {
  font-size: 12px; color: var(--text-3);
  margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cc-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 14px; padding-top: 13px;
  border-top: 1px solid var(--border);
}
.cc-partner {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 3px 8px; border-radius: 20px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 60%;
}
.cc-open { font-size: 12px; font-weight: 600; color: var(--text-3); transition: color 0.15s; flex-shrink: 0; }
.clinic-card:hover .cc-open { color: var(--primary); }

.cc-pin {
  position: absolute;
  top: 14px; right: 14px;
  padding: 2px 4px;
  border-radius: 5px;
  color: var(--text-3);
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.clinic-card:hover .cc-pin { opacity: 1; }
.cc-pin:hover { background: var(--bg); }
.cc-pin.pinned { opacity: 1; color: var(--warn); }

/* ============================================================
   SIDEBAR — Clinic List
   ============================================================ */

.sidebar-head {
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sidebar-title h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.01em;
}

.sidebar-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-2);
}

.search-wrap { position: relative; }

.search-input {
  width: 100%;
  padding: 9px 14px 9px 34px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-0);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.search-input::placeholder { color: var(--text-3); }

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

.search-kbd {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: 10px 10px 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.clinic-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}

.clinic-item:hover { background: var(--surface); }

.clinic-item.active {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.clinic-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.clinic-logo {
  width: 32px; height: 32px;
  border-radius: 7px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px;
  flex-shrink: 0;
}

.clinic-logo-fallback {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

.clinic-info { flex: 1; min-width: 0; }
.clinic-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clinic-sub {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clinic-pin {
  opacity: 0;
  padding: 4px;
  border-radius: 5px;
  color: var(--text-3);
  font-size: 14px;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.clinic-item:hover .clinic-pin { opacity: 1; }
.clinic-pin:hover { background: var(--bg); }
.clinic-pin.pinned { opacity: 1; color: var(--warn); }

.sidebar-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* ============================================================
   SLIDE-OVER (Cheat Sheet Panel)
   ============================================================ */

.sheet-backdrop {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15,23,42,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 50;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet-panel {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: var(--sidebar-w);
  bottom: 0;
  background: var(--bg);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 75;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-panel.open { transform: translateX(0); }

/* ── Sticky sheet header ── */
.sheet-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 1px 0 rgba(15,23,42,0.04);
  z-index: 2;
}

.sheet-close {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.sheet-close:hover { background: var(--border); color: var(--text-0); }

.sheet-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.sheet-logo {
  width: 48px; height: 48px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px;
  flex-shrink: 0;
}

.sheet-logo-fallback {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  flex-shrink: 0;
}

.sheet-titles { min-width: 0; }
.sheet-clinic-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-0);
  letter-spacing: -0.02em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sheet-clinic-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-2);
  margin-top: 3px;
}
.sheet-clinic-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.sheet-clinic-meta .partner-tag {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Sheet quick actions ── */
.sheet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.qa-btn {
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s, transform 0.1s;
}

.qa-btn:active { transform: scale(0.96); }

.qa-call {
  background: var(--call);
  color: white;
  padding: 0 16px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
}
.qa-call:hover { background: var(--call-hover); }

.qa-icon {
  background: var(--bg);
  color: var(--text-2);
  width: 38px;
  padding: 0;
  justify-content: center;
}
.qa-icon:hover { background: var(--border); color: var(--text-0); }
.qa-icon.pinned { background: var(--warn-soft); color: var(--warn); }

/* ── Sheet body ── */
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 60px;
}

.sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
}

.sheet-grid > .span-2 { grid-column: 1 / -1; }

/* ── Talk track (hero pitch box) ── */
.talk-track {
  background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}

.talk-track::before {
  content: '"';
  position: absolute;
  font-family: Georgia, serif;
  font-size: 120px;
  line-height: 1;
  opacity: 0.18;
  top: -10px;
  right: 20px;
  font-weight: 700;
}

.talk-track-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.7);
  margin-bottom: 6px;
}

.talk-track-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

/* ── Info cards ── */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.info-card-head {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.info-card-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.info-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}

.info-card-body { padding: 6px 0; }

.kv-row {
  padding: 8px 16px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.kv-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  width: 100px;
  flex-shrink: 0;
}

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

.kv-value.strong { font-weight: 600; }
.kv-value.large {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.kv-value.phone {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}
.kv-value a { color: var(--primary); text-decoration: none; font-weight: 500; }
.kv-value a:hover { text-decoration: underline; }

/* ── Live clock ── */
.live-clock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  padding: 3px 9px;
  background: var(--call-soft);
  border-radius: 20px;
}

.live-clock::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--call);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.35} }

/* ── Doctor card ── */
.doctor-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.doctor-photo-col {
  background: linear-gradient(135deg, var(--primary-soft) 0%, #E0E7FF 100%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-right: 1px solid var(--border);
}

.doctor-photo {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}

.doctor-photo-fallback {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  border: 3px solid white;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}

.doctor-photo-name { font-size: 13px; font-weight: 700; color: var(--text-0); line-height: 1.3; }
.doctor-photo-cred { font-size: 11px; color: var(--primary); font-weight: 600; margin-top: 2px; }

.doctor-detail-col { padding: 6px 0; }

/* ── Overview text block ── */
.text-block {
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-1);
}

.text-block.italic { font-style: italic; color: var(--text-2); }

/* ── Treatment cards ── */
.treatment-primary, .treatment-downsell {
  padding: 14px 16px;
}

.treatment-primary {
  background: linear-gradient(135deg, #EEF2FF 0%, #F5F3FF 100%);
  border-bottom: 1px solid var(--border);
}

.treatment-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.treatment-primary .treatment-label { color: var(--primary); }
.treatment-downsell .treatment-label { color: var(--warn); }

.treatment-value {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-0);
}

.treatment-primary .treatment-value { font-weight: 600; }

/* ── Financing tags ── */
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 14px;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.tag-green { background: var(--call-soft); color: var(--call); border: 1px solid #BBF7D0; }
.tag-gray  { background: var(--bg); color: var(--text-3); border: 1px solid var(--border); }

/* ── Alert ── */
.alert {
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  font-size: 13px;
  line-height: 1.55;
}

.alert-red {
  background: var(--danger-soft);
  border: 1px solid #FECACA;
  color: #7F1D1D;
}

.alert-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert strong { font-weight: 700; display: block; margin-bottom: 3px; }

/* ── Loading / Spinner ── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(79,70,229,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 13px;
  gap: 12px;
}

/* ── Map tab ── */
.map-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.map-head { flex-shrink: 0; }
.map-head-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.map-search { position: relative; display: flex; align-items: center; gap: 8px; }
.map-search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.map-search input {
  width: 240px;
  padding: 9px 12px 9px 32px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px; color: var(--text-0); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.map-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.map-search button {
  padding: 9px 16px;
  background: var(--primary); color: #fff;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  transition: background 0.15s;
}
.map-search button:hover { background: var(--primary-hover); }

.map-results {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 12px;
}
.map-results:empty { margin-top: 0; }
.map-results-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.map-results-msg { font-size: 12px; color: var(--text-2); }
.map-result-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.map-result-chip:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.map-result-chip .chip-name { font-size: 12px; font-weight: 600; color: var(--text-0); }
.map-result-chip .chip-dist { font-size: 11px; font-weight: 700; color: var(--primary); }

.map-pin-search {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--danger);
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(220,38,38,0.25), 0 1px 5px rgba(15,23,42,0.5);
  animation: pulse-dot 1.6s infinite;
}

#clinic-map {
  flex: 1;
  min-height: 420px;
  position: relative;
  z-index: 0;                /* contain Leaflet's internal z-indexes below the slide-over */
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--bg-sidebar);
}

.map-pin {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 2.5px solid #fff;
  box-shadow: 0 1px 5px rgba(15,23,42,0.45);
  cursor: pointer;
  transition: transform 0.12s;
}
.map-pin:hover { transform: scale(1.25); }
.map-pin.pinned { background: var(--warn); }

.leaflet-popup-content-wrapper { border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.leaflet-popup-content { margin: 12px 14px; }
.map-popup-name { font-size: 13px; font-weight: 700; color: var(--text-0); }
.map-popup-sub { font-size: 11px; color: var(--text-2); margin: 3px 0 9px; line-height: 1.4; }
.map-popup-btn {
  font-size: 12px; font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 7px;
  padding: 6px 11px;
}
.map-popup-btn:hover { background: var(--primary-border); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text-0);
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  z-index: 1000;
  pointer-events: none;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    bottom: 0;
    width: var(--sidebar-w);
    z-index: 60;
    transform: translateX(100%);
    transition: transform 0.25s;
    border-left: 1px solid var(--border);
  }
  .app-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sheet-panel { right: 0; }
  .sheet-grid { grid-template-columns: 1fr; }
  .doctor-card { grid-template-columns: 1fr; }
  .doctor-photo-col { border-right: none; border-bottom: 1px solid var(--border); padding: 18px; }
}

@media (max-width: 640px) {
  .nav-tabs { display: none; }
  .nav-brand-sub { display: none; }
  .app-main { padding: 20px; }
  .sheet-header { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  .sheet-actions { width: 100%; order: 3; }
  .qa-call { flex: 1; justify-content: center; }
  .sheet-body { padding: 16px 16px 40px; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .app-nav, .app-sidebar, .sheet-backdrop, .sheet-close, .sheet-actions { display: none !important; }
  .sheet-panel {
    position: static; transform: none;
    right: 0; height: auto;
  }
  body { background: white; }
}
