@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,600;0,700;1,600;1,700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ─── CSS Variables ─── */
:root {
  --ink: #070b14;
  --gold: #c9a96e;
  --gold-light: #e8c97e;
  --gold-dim: rgba(201, 169, 110, 0.15);
  --surface: #0f172a;
  --surface-2: #1e293b;
  --surface-3: #273349;
  --border: rgba(201, 169, 110, 0.2);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --info: #3b82f6;
  --sidebar-w: 240px;
  --nav-h: 60px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
}

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

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  line-height: 1.2;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

button { cursor: pointer; font-family: 'DM Sans', sans-serif; }

input, select, textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ─────────────────────────────────────────
   LOGIN PAGE
───────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(201,169,110,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(201,169,110,0.03) 0%, transparent 50%);
  padding: 1rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow), 0 0 60px rgba(201,169,110,0.05);
}

.login-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-logo .brand-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
}

.login-logo .brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 0.25rem;
  display: block;
}

.login-logo .logo-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: 700;
}

.login-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

/* ─── Form Elements ─── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.1);
}

.form-control::placeholder { color: var(--text-dim); }

select.form-control {
  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='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-gold {
  background: var(--gold);
  color: var(--ink);
  letter-spacing: 0.05em;
  font-weight: 600;
}
.btn-gold:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201,169,110,0.3);
}
.btn-gold:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border); background: var(--surface-2); }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-sm { padding: 0.4rem 0.875rem; font-size: 0.8rem; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ─── Error / Alert Messages ─── */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }

/* ─────────────────────────────────────────
   DASHBOARD LAYOUT
───────────────────────────────────────── */
.app-layout {
  display: grid;
  grid-template-rows: var(--nav-h) 1fr;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ─── Top Nav ─── */
.top-nav {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1rem;
}

.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  margin-left: 2rem;
}

.nav-link {
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--gold); background: var(--gold-dim); }

.nav-spacer { flex: 1; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.4rem;
  cursor: pointer;
}

/* ─── Sidebar ─── */
.sidebar {
  grid-column: 1;
  grid-row: 2;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
}

.sidebar-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  padding: 0.875rem 0.75rem 0.375rem;
  font-weight: 500;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-link:hover { color: var(--text); background: var(--surface-2); }
.sidebar-link.active { color: var(--gold); background: var(--gold-dim); }

.sidebar-link svg { opacity: 0.7; flex-shrink: 0; }
.sidebar-link.active svg { opacity: 1; }

/* ─── Main Content ─── */
.main-content {
  grid-column: 2;
  grid-row: 2;
  padding: 2rem;
  overflow-y: auto;
  max-width: 100%;
}

/* ─── Page Header ─── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 2rem;
  color: var(--text);
  font-weight: 700;
}
.page-title span { color: var(--gold); }

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
}

/* ─── Stats Cards ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.stat-card:hover { border-color: var(--gold); transform: translateY(-2px); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover::before { opacity: 1; }

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-value.gold { color: var(--gold); }

.stat-icon {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 1.5rem;
  opacity: 0.6;
}

.stat-delta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 1rem;
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'Cormorant Garamond', serif;
}

.card-body { padding: 1.5rem; }

/* ─── Tables ─── */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

tbody td {
  padding: 0.875rem 1rem;
  color: var(--text);
  vertical-align: middle;
}

.table-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

/* Status badges */
.badge-new { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.badge-contacted { background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.badge-qualified { background: rgba(34,197,94,0.15); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.badge-signed { background: rgba(201,169,110,0.15); color: var(--gold-light); border: 1px solid var(--border); }
.badge-lost { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); }

/* Urgency badges */
.badge-hot { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.badge-warm { background: rgba(249,115,22,0.15); color: #fdba74; border: 1px solid rgba(249,115,22,0.3); }
.badge-cold { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); }

/* Appointment status badges */
.badge-scheduled { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.badge-completed { background: rgba(34,197,94,0.15); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.badge-cancelled { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); }
.badge-no-show { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }

/* ─── Toolbar / Filters ─── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.search-input-wrap svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.search-input-wrap .form-control {
  padding-left: 2.5rem;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ─── Pagination ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  gap: 1rem;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  gap: 0.25rem;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-btn:hover { border-color: var(--gold); color: var(--gold); }
.page-btn.active { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow), 0 0 80px rgba(0,0,0,0.5);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.3rem;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
  transition: color var(--transition);
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 1.5rem; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ─── Lead Detail Sections ─── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-field label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}
.detail-field p {
  color: var(--text);
  font-size: 0.9rem;
}

.section-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 1.5rem 0;
}

.section-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* ─── Calendar ─── */
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.calendar-nav h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  text-align: center;
}

.week-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.week-grid-header {
  display: contents;
}

.day-header {
  padding: 0.625rem 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.time-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: right;
  padding: 0.25rem 0.5rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border-subtle);
}

.day-cell {
  min-height: 40px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.2rem;
  position: relative;
}
.day-cell:last-child { border-right: none; }

.cal-event {
  background: var(--gold-dim);
  border-left: 2px solid var(--gold);
  border-radius: 3px;
  padding: 0.2rem 0.4rem;
  font-size: 0.65rem;
  color: var(--gold-light);
  cursor: pointer;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event:hover { background: rgba(201,169,110,0.25); }

.view-toggle {
  display: flex;
  gap: 0.25rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 0.25rem;
}

.view-toggle-btn {
  padding: 0.375rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.8rem;
  border: none;
  background: none;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
}
.view-toggle-btn.active { background: var(--surface-3); color: var(--text); }

/* ─── Status Dropdown ─── */
.status-dropdown-wrap { position: relative; display: inline-block; }

.status-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 160px;
  z-index: 50;
  box-shadow: var(--shadow);
  display: none;
}
.status-dropdown.open { display: block; }

.status-dropdown-item {
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
}
.status-dropdown-item:hover { background: var(--surface-3); color: var(--text); }

/* ─── Loading State ─── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Section Layout ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (max-width: 960px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: var(--nav-h) 1fr;
  }

  .sidebar {
    grid-column: 1;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .main-content {
    grid-column: 1;
    padding: 1.25rem;
  }

  .hamburger { display: flex; }
  .nav-links { display: none; }
  .nav-email { display: none; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .modal { max-width: 100%; }
  .login-card { padding: 2rem 1.5rem; }
}

/* ─── Sidebar Overlay ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7,11,20,0.7);
  z-index: 140;
}
.sidebar-overlay.open { display: block; }

/* ─── Settings Section ─── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* ─── Autocomplete ─── */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 200px;
  overflow-y: auto;
  z-index: 60;
  display: none;
}
.autocomplete-list.open { display: block; }
.autocomplete-item {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition);
}
.autocomplete-item:hover { background: var(--surface-3); color: var(--text); }
.autocomplete-item small { display: block; font-size: 0.75rem; color: var(--text-dim); }

/* ─── Toast Notifications ─── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  pointer-events: all;
  max-width: 320px;
}
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(100%); } }

/* ─── Appointment list item ─── */
.appt-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition);
  border-radius: var(--radius);
  padding: 0.875rem;
}
.appt-item:hover { background: var(--surface-2); }

.appt-date-block {
  width: 48px;
  text-align: center;
  flex-shrink: 0;
}
.appt-date-block .day { font-size: 1.5rem; font-weight: 700; color: var(--gold); line-height: 1; font-family: 'Cormorant Garamond', serif; }
.appt-date-block .month { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); }

.appt-info { flex: 1; min-width: 0; }
.appt-name { font-weight: 500; color: var(--text); font-size: 0.9rem; }
.appt-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.1rem; }
