@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&family=Geist:wght@400;500;600;700&display=swap');

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

/* ── Tokens ── */
:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #FBFAF6;
  --ink: #11140F;
  --ink-2: #3B3F38;
  --muted: #7A7E74;
  --line: #E8E6DE;
  --line-2: #EFEDE6;
  --accent: #2E3A2A;
  --accent-soft: #E9EFE3;
  --gold: #B98A3F;
  --amber-soft: #F5EBD7;
  --green: #2F7A4F;
  --green-soft: #E1F0E7;
  --rose: #B14A3D;
  --rose-soft: #F6E3DE;

  --font-sans: 'Geist', -apple-system, system-ui, sans-serif;
  --font-serif: 'Instrument Serif', serif;

  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --radius-2xl: 18px;
  --radius-3xl: 20px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(17,20,15,0.03);
  --shadow-md: 0 1px 2px rgba(17,20,15,0.03), 0 8px 24px -16px rgba(17,20,15,0.10);
  --shadow-lg: 0 1px 2px rgba(17,20,15,0.04), 0 16px 40px -22px rgba(17,20,15,0.4);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* ── Base ── */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ── Utilities ── */
.text-muted { color: var(--muted); }
.text-serif { font-family: var(--font-serif); }
.text-accent { color: var(--accent); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* ── Shell Layout ── */
.shell { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 256px;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  position: sticky; top: 0;
  height: 100vh;
  padding: 22px 16px;
  display: flex; flex-direction: column;
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px 8px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: linear-gradient(160deg, #2E3A2A 0%, #1A2117 100%);
  display: flex; align-items: center; justify-content: center;
  color: #E9EFE3; font-weight: 700; font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 2px rgba(0,0,0,0.06);
}
.brand-name { font-family: var(--font-serif); font-size: 22px; line-height: 1; color: var(--ink); letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 2px; letter-spacing: 0.02em; }

.nav-group { margin-top: 10px; }
.nav-h { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.09em; padding: 0 10px 8px 10px; font-weight: 500; }
.nav-i {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--radius-sm); color: var(--ink-2);
  font-size: 13.5px; font-weight: 500; cursor: pointer; margin-bottom: 1px;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.nav-i:hover { background: rgba(46,58,42,0.05); color: var(--ink); }
.nav-i.on {
  background: var(--surface);
  color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 0 rgba(17,20,15,0.04), 0 1px 2px rgba(17,20,15,0.05);
}
.nav-i svg { width: 16px; height: 16px; stroke: currentColor; opacity: 0.8; flex-shrink: 0; }
.nav-c { margin-left: auto; font-size: 11px; color: var(--muted); background: var(--bg); padding: 1px 7px; border-radius: var(--radius-sm); font-weight: 500; }
.nav-i.on .nav-c { background: var(--accent-soft); color: var(--accent); }

.sb-foot {
  margin-top: auto; padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  display: flex; align-items: center; gap: 11px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.sb-foot:hover { background: var(--surface-2); }
.av {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: linear-gradient(140deg, #B98A3F, #6F5320);
  color: #FFF8E8; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.un { font-size: 13px; font-weight: 600; }
.ur { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ── Topbar ── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; padding: 0 36px; display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(247,246,242,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10;
  flex-shrink: 0;
}
.crumb { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.crumb .now { color: var(--ink); font-weight: 500; }
.crumb .sl { color: #C9C6BC; }
.search-box {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  width: 360px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 8px 13px; box-shadow: var(--shadow-sm);
}
.search-box input { border: none; background: transparent; outline: none; font-family: inherit; flex: 1; font-size: 13px; color: var(--ink); }
.search-box svg { width: 14px; height: 14px; stroke: var(--muted); flex-shrink: 0; }
.kbd { font-size: 10.5px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }
.ib {
  width: 38px; height: 38px; border-radius: 11px; background: var(--surface);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.ib:hover { background: var(--surface-2); }
.ib svg { width: 15px; height: 15px; stroke: var(--ink-2); }
.ib .pip { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; background: var(--rose); border-radius: 50%; border: 2px solid var(--surface); }

/* ── Content ── */
.content { padding: 32px 36px 60px 36px; flex: 1; }

/* ── Hero ── */
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-3xl);
  padding: 26px 28px;
  margin-bottom: 22px;
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
  box-shadow: var(--shadow-md);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -120px; top: -120px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(185,138,63,0.10), transparent 60%);
  pointer-events: none;
}
.hero-eyebrow { font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.hero-title { font-family: var(--font-serif); font-size: 36px; letter-spacing: -0.01em; line-height: 1.05; color: var(--ink); }
.hero-title em { font-style: italic; color: var(--gold); }
.hero-sub { font-size: 14px; color: var(--muted); margin-top: 10px; max-width: 520px; }
.hero-actions { display: flex; flex-direction: column; gap: 9px; min-width: 220px; }

/* ── Buttons ── */
.btn-pri {
  background: var(--accent); color: #F1F4ED;
  padding: 12px 18px; border-radius: var(--radius-md); border: none;
  font-family: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: 0 1px 2px rgba(17,20,15,0.12), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: background var(--duration-fast) var(--ease-out);
}
.btn-pri:hover { background: #243020; }
.btn-pri svg { width: 14px; height: 14px; }
.btn-sec {
  background: var(--surface-2); color: var(--ink);
  padding: 11px 18px; border-radius: var(--radius-md); border: 1px solid var(--line);
  font-family: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: background var(--duration-fast) var(--ease-out);
}
.btn-sec:hover { background: var(--line-2); }
.btn-sec svg { width: 14px; height: 14px; }
.btn-sm {
  padding: 8px 14px; font-size: 12.5px; border-radius: var(--radius-sm);
}
.btn-outline {
  background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: var(--radius-md); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background var(--duration-fast) var(--ease-out);
}
.btn-outline:hover { background: var(--surface-2); }
.btn-outline svg { width: 14px; height: 14px; }

/* ── Premise Pills ── */
.premise-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.premise-label { font-size: 12px; color: var(--muted); font-weight: 500; margin-right: 4px; }
.premise-pill {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500; cursor: pointer;
  box-shadow: 0 1px 2px rgba(17,20,15,0.02);
  transition: all var(--duration-fast) var(--ease-out);
}
.premise-pill svg { width: 13px; height: 13px; }
.premise-pill.on { background: var(--ink); color: #F1F4ED; border-color: var(--ink); box-shadow: 0 4px 12px -4px rgba(17,20,15,0.3); }
.premise-pill .pid { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.premise-pill.on .pid { color: rgba(241,244,237,0.6); }
.premise-pill.add { color: var(--accent); }

/* ── KPI Cards ── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-xl); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.kpi-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.kpi-lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.live {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--green);
  background: var(--green-soft); padding: 3px 9px; border-radius: var(--radius-full);
}
.live::before { content: ''; width: 5px; height: 5px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 3px rgba(47,122,79,0.18); }
.kpi-val { font-family: var(--font-serif); font-size: 34px; letter-spacing: -0.015em; line-height: 1; color: var(--ink); margin-bottom: 8px; }
.kpi-val sup { font-size: 16px; color: var(--muted); top: -10px; margin-right: 2px; }
.kpi-val .unit { font-size: 14px; margin-left: 4px; }
.kpi-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.delta-up { color: var(--green); font-weight: 600; }
.delta-dn { color: var(--rose); font-weight: 600; }
.spark { margin-top: 10px; }

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-2xl); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header { padding: 20px 22px 14px 22px; display: flex; align-items: flex-start; justify-content: space-between; }
.card-title { font-family: var(--font-serif); font-size: 22px; color: var(--ink); letter-spacing: -0.01em; line-height: 1.1; }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.card-link { font-size: 12.5px; color: var(--accent); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.card-link:hover { text-decoration: underline; }

/* ── Grid Layouts ── */
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 20px; }
.grid-1p2-1 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }

/* ── Dropdown ── */
.dropdown-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 500; color: var(--ink);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.dropdown-trigger:hover { background: var(--surface-2); }
.dropdown-trigger svg { width: 12px; height: 12px; }
.dropdown-panel {
  display: none; position: absolute; top: 100%; left: 0; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 4px;
  box-shadow: var(--shadow-md);
  z-index: 100; min-width: 180px;
}
.dropdown-panel.open { display: block; }
.dropdown-option {
  display: block; width: 100%;
  padding: 8px 12px; border-radius: 8px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  text-align: left; background: none; border: none; font-family: inherit;
  transition: background var(--duration-fast) var(--ease-out);
}
.dropdown-option:hover { background: var(--surface-2); color: var(--ink); }
.dropdown-option.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.dropdown-wrap { position: relative; display: inline-block; }

/* ── Request List ── */
.req-list { padding: 6px 10px 14px 10px; }
.req-item {
  display: grid; grid-template-columns: 42px 1fr auto auto;
  gap: 14px; align-items: center; padding: 14px 12px;
  border-radius: var(--radius-md); cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.req-item:hover { background: var(--surface-2); }
.req-icon {
  width: 42px; height: 42px; border-radius: var(--radius-md);
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
}
.req-icon svg { width: 17px; height: 17px; stroke: var(--accent); }
.req-icon.out { background: var(--amber-soft); }
.req-icon.out svg { stroke: var(--gold); }
.req-title { font-size: 13.5px; font-weight: 600; }
.req-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── Pills/Badges ── */
.pill {
  font-size: 11.5px; font-weight: 600; padding: 4px 11px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.prog { background: var(--accent-soft); color: var(--accent); }
.pill.sched { background: var(--green-soft); color: var(--green); }
.pill.action { background: var(--rose-soft); color: var(--rose); }
.pill.closed { background: var(--line-2); color: var(--muted); }
.pill.submitted { background: #E8EBF5; color: #4A5290; }
.pill.cancelled { background: #F0ECEC; color: #8A7F7F; }
.req-date { font-size: 12px; color: var(--muted); }

/* ── Billing Dark Card ── */
.billing-card {
  background: linear-gradient(155deg, #1A2117 0%, #2E3A2A 100%);
  color: #F1F4ED; border-radius: var(--radius-2xl); padding: 24px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.billing-card::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(185,138,63,0.25), transparent 65%);
  pointer-events: none;
}
.billing-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; position: relative; }
.billing-header-title { font-size: 13px; opacity: 0.7; font-weight: 500; }
.billing-header-prem { font-size: 11.5px; opacity: 0.5; margin-top: 3px; }
.billing-header-live { background: rgba(241,244,237,0.10); color: #C7E0BD; padding: 4px 10px; border-radius: var(--radius-full); font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.billing-header-live::before { content: ''; width: 5px; height: 5px; background: #7DC58A; border-radius: 50%; box-shadow: 0 0 0 3px rgba(125,197,138,0.25); }
.bal-amt { font-family: var(--font-serif); font-size: 48px; line-height: 1; letter-spacing: -0.02em; margin-bottom: 6px; }
.bal-amt sup { font-size: 22px; opacity: 0.6; top: -18px; }
.bal-meta { font-size: 12px; opacity: 0.65; margin-bottom: 22px; }
.bal-bar { height: 6px; background: rgba(241,244,237,0.10); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.bal-fill { height: 100%; background: linear-gradient(90deg, #C9A96B, #B98A3F); border-radius: 3px; transition: width var(--duration-normal) var(--ease-out); }
.bal-foot { display: flex; justify-content: space-between; font-size: 11.5px; opacity: 0.65; }
.bal-btn {
  margin-top: 20px; width: 100%;
  background: #F1F4ED; color: var(--ink);
  padding: 12px; border-radius: var(--radius-md); border: none;
  font-family: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--duration-fast) var(--ease-out);
}
.bal-btn:hover { background: #E4E8DF; }

/* ── Quick Actions ── */
.qa-list { padding: 8px 12px 16px 12px; }
.qa-item {
  display: grid; grid-template-columns: 44px 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px 12px; border-radius: var(--radius-md); cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.qa-item:hover { background: var(--surface-2); }
.qa-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.qa-icon svg { width: 18px; height: 18px; }
.qa-icon.a { background: var(--accent-soft); } .qa-icon.a svg { stroke: var(--accent); }
.qa-icon.b { background: var(--amber-soft); } .qa-icon.b svg { stroke: var(--gold); }
.qa-icon.c { background: #E2E8E0; } .qa-icon.c svg { stroke: #4A5A45; }
.qa-icon.d { background: var(--rose-soft); } .qa-icon.d svg { stroke: var(--rose); }
.qa-title { font-size: 13.5px; font-weight: 600; }
.qa-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.qa-arrow { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.qa-arrow svg { width: 13px; height: 13px; stroke: var(--ink-2); }

/* ── Appointment / Timeline ── */
.appt-banner {
  margin: 0 22px 16px 22px;
  background: linear-gradient(120deg, var(--accent-soft), var(--surface-2));
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px;
  display: flex; gap: 14px; align-items: center;
}
.appt-date-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 14px; text-align: center; min-width: 60px;
}
.appt-month { font-size: 10.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.appt-day { font-family: var(--font-serif); font-size: 26px; line-height: 1; color: var(--ink); }
.appt-title { font-size: 13.5px; font-weight: 600; }
.appt-window { font-size: 12px; color: var(--muted); margin-top: 3px; }

.timeline-list { padding: 4px 22px 18px 22px; }
.timeline-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 14px; padding: 10px 0; position: relative; }
.timeline-item:not(:last-child)::before {
  content: ''; position: absolute; left: 10px; top: 28px; bottom: -6px;
  width: 2px; background: var(--line-2);
}
.timeline-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
  margin-top: 4px; margin-left: 4px; z-index: 1;
}
.timeline-dot.fill { background: var(--accent); }
.timeline-dot.fade { border-color: #D7D4CB; }
.timeline-title { font-size: 13px; font-weight: 600; }
.timeline-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.timeline-time { font-size: 11.5px; color: #A8AAA1; white-space: nowrap; }

/* ── Footer ── */
.app-footer {
  border-top: 1px solid var(--line); padding: 20px 36px;
  font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between;
}
.dot-sep { margin: 0 8px; color: #C9C6BC; }

/* ── Toast ── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; pointer-events: none;
}
.toast {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 12px 18px;
  font-size: 13px; color: var(--ink); box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toast-in var(--duration-normal) var(--ease-out);
  display: flex; align-items: center; gap: 10px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--rose); }
.toast.info { border-left: 3px solid var(--accent); }
.toast.fade-out { animation: toast-out var(--duration-normal) var(--ease-out) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(10px); } }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17,20,15,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fade-in 200ms var(--ease-out);
}
.modal-backdrop.closing { animation: fade-out 200ms var(--ease-out) forwards; }
.modal-content {
  background: var(--surface); border-radius: var(--radius-3xl);
  padding: 28px; max-width: 480px; width: 90%;
  box-shadow: 0 25px 50px -12px rgba(17,20,15,0.25);
  animation: modal-in 200ms var(--ease-out);
}
.modal-backdrop.closing .modal-content { animation: modal-out 200ms var(--ease-out) forwards; }
.modal-title { font-family: var(--font-serif); font-size: 22px; margin-bottom: 12px; }
.modal-body { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes modal-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.95); } }

/* ── Login ── */
.login-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg); padding: 40px;
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; }
.login-brand .brand-mark { width: 48px; height: 48px; font-size: 20px; }
.login-heading { font-family: var(--font-serif); font-size: 36px; text-align: center; margin-bottom: 8px; }
.login-sub { color: var(--muted); font-size: 14px; text-align: center; margin-bottom: 36px; }
.login-cards { display: flex; gap: 20px; margin-bottom: 36px; }
.login-card {
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--radius-xl); padding: 24px;
  width: 260px; cursor: pointer; text-align: center;
  transition: all var(--duration-fast) var(--ease-out);
}
.login-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.login-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.login-card .av { width: 56px; height: 56px; border-radius: var(--radius-md); font-size: 18px; margin: 0 auto 14px; }
.login-card .login-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.login-card .login-role { font-size: 12.5px; color: var(--muted); }
.login-card .login-premises { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.login-form {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-xl); padding: 28px; width: 400px;
  box-shadow: var(--shadow-sm);
}
.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.login-form input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--ink);
  background: var(--surface-2); outline: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-form .btn-pri { width: 100%; justify-content: center; margin-top: 8px; }

/* ── Form Elements ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--ink);
  background: var(--surface); outline: none;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-input.error { border-color: var(--rose); }
.form-input.error:focus { box-shadow: 0 0 0 3px var(--rose-soft); }
.form-select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--ink);
  background: var(--surface); outline: none; 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='%237A7E74' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row { display: flex; gap: 16px; }
.form-row > * { flex: 1; }

/* Checkbox */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 14px; }
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; cursor: pointer; padding: 8px 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
}
.checkbox-label:hover { background: var(--accent-soft); }
.checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent);
}
.checkbox-label.checked { background: var(--accent-soft); border-color: var(--accent); }

/* Toggle */
.toggle-wrap { display: flex; align-items: center; gap: 12px; }
.toggle-switch {
  width: 44px; height: 24px; border-radius: 12px;
  background: var(--line); cursor: pointer; position: relative;
  transition: background var(--duration-fast) var(--ease-out);
}
.toggle-switch.on { background: var(--accent); }
.toggle-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: transform var(--duration-fast) var(--ease-out);
}
.toggle-switch.on::after { transform: translateX(20px); }
.toggle-label { font-size: 13.5px; font-weight: 500; }

/* ── Step Indicator ── */
.step-indicator { display: flex; align-items: center; gap: 0; margin-bottom: 32px; }
.step-item { display: flex; align-items: center; gap: 10px; }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  border: 2px solid var(--line); color: var(--muted);
  background: var(--surface);
  transition: all var(--duration-fast) var(--ease-out);
}
.step-circle.active { border-color: var(--accent); color: var(--surface); background: var(--accent); }
.step-circle.done { border-color: var(--green); color: var(--surface); background: var(--green); }
.step-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.step-item.active .step-label { color: var(--ink); font-weight: 600; }
.step-item.done .step-label { color: var(--green); }
.step-line { width: 60px; height: 2px; background: var(--line); margin: 0 8px; }
.step-line.done { background: var(--green); }

/* ── File Upload Area ── */
.file-upload-area {
  border: 2px dashed var(--line); border-radius: var(--radius-xl);
  padding: 32px; text-align: center; cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.file-upload-area:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-upload-icon { color: var(--muted); margin-bottom: 10px; }
.file-upload-text { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.file-upload-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.file-list { margin-top: 14px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-top: 8px; font-size: 13px;
}
.file-item svg { flex-shrink: 0; }
.file-item .file-name { flex: 1; font-weight: 500; }
.file-item .file-type { font-size: 11px; padding: 2px 8px; background: var(--accent-soft); border-radius: var(--radius-full); color: var(--accent); font-weight: 500; }

/* ── Lifecycle Rail ── */
.lifecycle-rail { display: flex; align-items: center; margin-bottom: 28px; padding: 20px 0; overflow-x: auto; }
.lifecycle-step { display: flex; align-items: center; white-space: nowrap; }
.lifecycle-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--surface);
  flex-shrink: 0;
}
.lifecycle-dot.completed { background: var(--green); border-color: var(--green); }
.lifecycle-dot.current { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.lifecycle-label { font-size: 11px; margin-left: 6px; color: var(--muted); font-weight: 500; }
.lifecycle-step.completed .lifecycle-label { color: var(--green); }
.lifecycle-step.current .lifecycle-label { color: var(--accent); font-weight: 600; }
.lifecycle-connector { width: 32px; height: 2px; background: var(--line); margin: 0 4px; flex-shrink: 0; }
.lifecycle-connector.completed { background: var(--green); }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 12px 16px;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: var(--ink); }
.data-table td {
  padding: 14px 16px; font-size: 13.5px;
  border-bottom: 1px solid var(--line-2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; transition: background var(--duration-fast) var(--ease-out); }
.data-table tbody tr:hover { background: var(--surface-2); }

/* ── Billing Viewer ── */
.billing-hero {
  background: linear-gradient(155deg, #1A2117 0%, #2E3A2A 100%);
  color: #F1F4ED; border-radius: var(--radius-3xl); padding: 32px;
  position: relative; overflow: hidden; margin-bottom: 24px;
}
.billing-hero::before {
  content: ''; position: absolute; top: -100px; right: -100px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(185,138,63,0.25), transparent 65%);
  pointer-events: none;
}

/* ── CIS Lookup ── */
.cis-result {
  background: var(--green-soft); border: 1px solid rgba(47,122,79,0.2);
  border-radius: var(--radius-md); padding: 16px; margin-top: 12px;
}
.cis-result .live { margin-bottom: 10px; }
.cis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cis-field-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.cis-field-value { font-size: 13.5px; font-weight: 500; margin-top: 2px; }

/* ── Empty State ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 24px; text-align: center;
}
.empty-state svg { color: var(--muted); margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.empty-state-msg { font-size: 13px; color: var(--muted); max-width: 300px; margin-bottom: 16px; }

/* ── Skeleton ── */
.skeleton-pulse {
  background: linear-gradient(90deg, var(--line-2) 25%, var(--line) 50%, var(--line-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-pulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Animations ── */
.animate-in {
  animation: animate-in 200ms var(--ease-out) both;
}
@keyframes animate-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sparkline draw-on */
.spark path:first-child {
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: spark-draw 1.2s var(--ease-out) 400ms forwards;
}
.spark path:last-child {
  opacity: 0;
  animation: spark-fill 0.6s var(--ease-out) 900ms forwards;
}
@keyframes spark-draw { to { stroke-dashoffset: 0; } }
@keyframes spark-fill { to { opacity: 1; } }

/* Sparkline bar grow */
.spark rect {
  transform: scaleY(0);
  transform-origin: bottom center;
  animation: spark-bar-grow 0.4s var(--ease-out) forwards;
}
.spark rect:nth-child(1) { animation-delay: 400ms; }
.spark rect:nth-child(2) { animation-delay: 450ms; }
.spark rect:nth-child(3) { animation-delay: 500ms; }
.spark rect:nth-child(4) { animation-delay: 550ms; }
.spark rect:nth-child(5) { animation-delay: 600ms; }
.spark rect:nth-child(6) { animation-delay: 650ms; }
.spark rect:nth-child(7) { animation-delay: 700ms; }
.spark rect:nth-child(8) { animation-delay: 750ms; }
@keyframes spark-bar-grow { to { transform: scaleY(1); } }
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }
.stagger-7 { animation-delay: 350ms; }
.stagger-8 { animation-delay: 400ms; }

/* ── Page Sections ── */
.page-header { margin-bottom: 24px; }
.page-title { font-family: var(--font-serif); font-size: 34px; color: var(--ink); letter-spacing: -0.01em; line-height: 1.1; }
.page-subtitle { font-size: 14px; color: var(--muted); margin-top: 6px; }
.page-actions { display: flex; gap: 10px; }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; }

/* ── Misc ── */
.section-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-2xl); padding: 24px;
  box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.section-title { font-family: var(--font-serif); font-size: 20px; margin-bottom: 16px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-field-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.detail-field-value { font-size: 14px; font-weight: 500; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); font-weight: 500;
  cursor: pointer; margin-bottom: 20px;
  transition: color var(--duration-fast) var(--ease-out);
}
.back-link:hover { color: var(--ink); }
.back-link svg { width: 14px; height: 14px; }

/* ── Request Tracker Table ── */
.tracker-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.tracker-count { font-size: 13px; color: var(--muted); margin-left: auto; }

/* ── Billing Light Card ── */
.billing-light {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-xl); padding: 20px;
}

/* ── Spinner ── */
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--line);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px; color: var(--muted); font-size: 13px;
}
