/* ============================================================
   HotVisa Heritage — SaaS / Console layer
   Extends design-system.css for dense, data-first product UI.

   Adaptation principles (vs. the marketing surface):
   · Neumorphic extrusion is reserved for top-level containers.
     Inside dense regions we separate rows with crisp hairlines,
     never soft shadows — contrast beats softness for data.
   · All numerics are tabular Geist Mono, right-aligned.
   · Inset wells mean "this accepts input" (search, fields, toggles-off).
   · The app chrome wears the passport cover (petrol) so the brand
     object frames the product.
   · Color stays restrained: accent = primary action + active state;
     status uses the semantic badge set only.
   · Hit targets ≥ 36px; default row height comfortable, compact on toggle.
   ============================================================ */

/* ===== FLATTEN: SaaS best practice ============================
   Replace heavy neumorphic double-shadows with hairline borders
   + a single soft shadow. Scoped to .app so the marketing-side
   design-system doc keeps its sculpted neumorphism.
   ============================================================ */
.app {
  --shadow-out:
    0 0 0 1px rgba(18,40,36,0.07),
    0 1px 2px rgba(18,40,36,0.05),
    0 4px 12px rgba(18,40,36,0.04);
  --shadow-in:
    inset 0 0 0 1px rgba(18,40,36,0.10);
  --shadow-drop:
    0 0 0 1px rgba(18,40,36,0.06),
    0 10px 28px rgba(10,35,32,0.13),
    0 3px 8px rgba(10,35,32,0.08);
  --r-lg: 16px;
  --r-xl: 18px;
  /* Contrast lift: design-system's --ink-3/--ok are tuned for large
     marketing type; here they carry 10.5-12.5px labels, so both are
     darkened to clear WCAG AA (4.5:1) on card surfaces. */
  --ink-3: #5c6b67;
  --ok:    #16705a;
  --draft-ink: #55635f;
  --head-ink: #55635f;
  --topbar-bg: color-mix(in oklab, var(--bg) 82%, white);
  --well: var(--bg);
  --raised: var(--bg);
  --thumb: var(--bg-elev);
  --well-card: var(--bg-elev);
  --menu-bg: var(--bg);
}

/* ===== APP SHELL ============================================== */
.app {
  display: grid;
  grid-template-columns: 256px 1fr;
  height: 100vh;
  min-height: 640px;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}
.app.rail { grid-template-columns: 76px 1fr; }

/* ----- Sidebar (petrol — the passport cover) ----- */
.side {
  background:
    linear-gradient(170deg, #0d2e29 0%, #0b2723 60%, #09201d 100%);
  color: #d8e0dc;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: relative;
  border-right: 1px solid rgba(0,0,0,0.2);
}
.side::before {
  content: ""; position: absolute; inset: 10px;
  border-radius: 16px;
  border: 1px solid rgba(194,149,74,0.14);
  pointer-events: none;
}
.side-top {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 8px 22px;
  position: relative;
}
.side-crest {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1.5px solid rgba(216,224,220,0.35);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 14px;
  letter-spacing: -0.04em; color: #e8ece9; flex-shrink: 0;
}
.side-word {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.side-word .nm {
  font-size: 15px; font-weight: 600; letter-spacing: -0.02em;
  color: #eef2ef; line-height: 1;
}
.side-word .sub {
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(216,224,220,0.5);
}
.app.rail .side-word, .app.rail .side-sect, .app.rail .nav-i .lbl,
.app.rail .nav-i .count, .app.rail .side-foot .who { display: none; }

.side-sect {
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(216,224,220,0.4);
  padding: 18px 10px 8px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; position: relative; }
.nav-i {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 11px; border-radius: 10px;
  color: rgba(216,224,220,0.72);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: 0; background: transparent;
  width: 100%; text-align: left;
  transition: background var(--t-fast) var(--easing), color var(--t-fast) var(--easing);
  position: relative;
}
.app.rail .nav-i { justify-content: center; padding: 11px; }
.nav-i:hover { background: rgba(216,224,220,0.07); color: #eef2ef; }
.nav-i.active { background: rgba(194,149,74,0.14); color: #fff; }
.nav-i.active::before {
  content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 2px; background: var(--accent-2);
}
.nav-i .ico { flex-shrink: 0; display: flex; opacity: 0.92; }
.nav-i .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-i .count {
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(216,224,220,0.12); color: rgba(232,236,233,0.85);
  letter-spacing: 0.02em;
}
.nav-i.active .count { background: rgba(194,149,74,0.25); color: #fff; }

.side-foot { margin-top: auto; position: relative; }
.side-card {
  background: rgba(216,224,220,0.06);
  border: 1px solid rgba(216,224,220,0.1);
  border-radius: 12px; padding: 13px 14px;
  display: flex; align-items: center; gap: 11px;
}
.app.rail .side-card { padding: 8px; justify-content: center; }
.side-card .av {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(150deg, var(--accent-2), #9c7637);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #1a1206;
}
.side-card .who { min-width: 0; }
.side-card .who .n { font-size: 12.5px; font-weight: 600; color: #eef2ef; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-card .who .r { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; color: rgba(216,224,220,0.5); text-transform: uppercase; }

/* ===== MAIN COLUMN =========================================== */
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* ----- Topbar ----- */
.topbar {
  height: 64px; flex-shrink: 0;
  display: flex; align-items: center; gap: 18px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
}
.topbar .crumb {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--ink-3);
}
.topbar .crumb .cur { color: var(--ink); font-weight: 500; }
.topbar .crumb .sep { color: var(--ink-3); opacity: 0.6; }
.topbar .grow { flex: 1; }
.rail-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 0;
  background: var(--raised); box-shadow: var(--shadow-out);
  color: var(--ink-2); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow var(--t-fast) var(--easing);
}
.rail-btn:hover { box-shadow: var(--shadow-in); }

/* Search (topbar) */
.tsearch {
  display: flex; align-items: center; gap: 10px;
  width: 320px; max-width: 38vw;
  padding: 9px 14px; border-radius: 10px;
  background: var(--well); box-shadow: var(--shadow-in);
  color: var(--ink-3);
}
.tsearch input {
  border: 0; background: transparent; outline: none; flex: 1;
  font-family: var(--font-sans); font-size: 13.5px; color: var(--ink);
}
.tsearch input::placeholder { color: var(--ink-3); }
.tsearch .kbd {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 5px; box-shadow: var(--shadow-out);
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 0;
  background: var(--raised); box-shadow: var(--shadow-out);
  color: var(--ink-2); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: box-shadow var(--t-fast) var(--easing), color var(--t-fast) var(--easing);
}
.icon-btn:hover { color: var(--accent); }
.icon-btn:active { box-shadow: var(--shadow-in); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2); border: 1.5px solid var(--topbar-bg);
}

/* ----- Scrolling content region ----- */
.content { flex: 1; overflow-y: auto; padding: 28px 26px 48px; }
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb { background: var(--bg-deep); border-radius: 8px; border: 3px solid var(--bg); }

/* Page header */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 24px;
}
.page-head .ttl {
  font-size: 32px; font-weight: 500; letter-spacing: -0.03em; margin: 0;
  line-height: 1;
}
.page-head .ttl em {
  font-family: var(--font-serif); font-style: italic; font-weight: 300;
  color: var(--accent);
}
.page-head .sub { color: var(--ink-2); font-size: 14px; margin: 9px 0 0; }
.page-head .acts { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* ===== KPI STAT TILES ======================================== */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi {
  background: var(--bg-elev); border-radius: var(--r-md);
  box-shadow: var(--shadow-out); padding: 20px 22px;
  display: flex; flex-direction: column; gap: 0;
}
.kpi .top { display: flex; align-items: center; justify-content: space-between; }
.kpi .lbl {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.kpi .well {
  width: 34px; height: 34px; border-radius: 10px;
  box-shadow: var(--shadow-in); background: var(--well-card);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.kpi .v {
  font-size: 38px; font-weight: 500; letter-spacing: -0.04em;
  line-height: 1; margin-top: 16px; color: var(--ink);
}
.kpi .v .u { font-size: 19px; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.kpi .foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  padding: 2px 7px; border-radius: 999px; letter-spacing: 0.01em;
}
.delta.up { color: var(--ok); background: rgba(31,138,109,0.12); }
.delta.down { color: #a82a23; background: rgba(192,50,42,0.1); }
.delta.flat { color: var(--ink-3); background: var(--bg-deep); }
.kpi .vs { font-size: 12px; color: var(--ink-3); }

/* ===== DASHBOARD GRID ======================================== */
.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-bottom: 22px; }
.panel {
  background: var(--bg-elev); border-radius: var(--r-lg);
  box-shadow: var(--shadow-out); padding: 24px;
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.panel-head h3 { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; margin: 0; }
.panel-head .sub { font-size: 12.5px; color: var(--ink-3); margin: 5px 0 0; }

/* Segmented control */
.seg {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: var(--well); box-shadow: var(--shadow-in); gap: 2px;
}
.seg button {
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  color: var(--ink-3); padding: 6px 13px; border-radius: 999px;
  transition: color var(--t-fast) var(--easing);
  white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.on {
  background: var(--thumb); color: var(--ink);
  box-shadow: var(--shadow-out);
}

/* Bar chart (pipeline over time) */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding-top: 8px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; justify-content: flex-end; }
.chart .stack { width: 100%; max-width: 34px; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; flex: 1; }
.chart .seg-bar { width: 100%; border-radius: 4px; }
.chart .seg-bar.a { background: var(--accent); }
.chart .seg-bar.b { background: color-mix(in oklab, var(--accent) 55%, var(--bg-elev)); }
.chart .seg-bar.c { background: var(--accent-2); }
.chart .xl { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.02em; }
.legend { display: flex; gap: 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.legend .li { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; }

/* Destination breakdown list */
.brk { display: flex; flex-direction: column; gap: 16px; }
.brk .row { display: grid; grid-template-columns: 28px 1fr auto; gap: 13px; align-items: center; }
.brk .dcode {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--ink-2); width: 28px;
}
.brk .track { height: 8px; border-radius: 999px; background: var(--well); box-shadow: var(--shadow-in); overflow: hidden; }
.brk .fill { height: 100%; border-radius: 999px; background: var(--accent); }
.brk .n { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Activity feed */
.feed { display: flex; flex-direction: column; }
.feed .ev {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 13px;
  padding: 13px 0; border-top: 1px solid var(--line); align-items: start;
}
.feed .ev:first-child { border-top: 0; padding-top: 0; }
.feed .ev .av {
  width: 30px; height: 30px; border-radius: 8px;
  box-shadow: var(--shadow-in); background: var(--well-card);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2);
}
.feed .ev .tx { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.feed .ev .tx b { color: var(--ink); font-weight: 600; }
.feed .ev .tm { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }

/* ===== TABLE TOOLBAR ========================================= */
.tbl-wrap { background: var(--bg-elev); border-radius: var(--r-lg); box-shadow: var(--shadow-out); overflow: hidden; }
.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.toolbar .search {
  display: flex; align-items: center; gap: 9px;
  width: 260px; padding: 8px 13px; border-radius: 9px;
  background: var(--well); box-shadow: var(--shadow-in); color: var(--ink-3);
}
.toolbar .search input { border: 0; background: transparent; outline: none; flex: 1; font-family: var(--font-sans); font-size: 13px; color: var(--ink); }
.toolbar .search input::placeholder { color: var(--ink-3); }
.toolbar .grow { flex: 1; }

/* Filter chip / button */
.chip-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 9px; border: 0; cursor: pointer;
  background: var(--raised); box-shadow: var(--shadow-out);
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  transition: box-shadow var(--t-fast) var(--easing), color var(--t-fast) var(--easing);
  white-space: nowrap;
}
.chip-btn:hover { color: var(--ink); }
.chip-btn.on { box-shadow: var(--shadow-in); color: var(--accent); }
.chip-btn .cnt {
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 1px 6px; border-radius: 999px; background: var(--bg-deep); color: var(--ink-2);
}
.chip-btn.on .cnt { background: rgba(14,107,98,0.14); color: var(--accent); }

/* Selection action bar (replaces toolbar when rows selected) */
.selbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: var(--accent-3); color: #e8ece9;
}
.selbar .n { font-size: 13px; font-weight: 500; }
.selbar .n b { font-family: var(--font-mono); }
.selbar .grow { flex: 1; }
.selbar .sb {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(255,255,255,0.13); color: #eef2ef;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500;
  transition: background var(--t-fast) var(--easing);
}
.selbar .sb:hover { background: rgba(255,255,255,0.22); }
.selbar .sb.x { background: transparent; color: rgba(232,236,233,0.7); }
.selbar .sb.x:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ===== DATA TABLE ============================================ */
.dtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dtable thead th {
  position: sticky; top: 0; z-index: 2;
  background: color-mix(in oklab, var(--bg-elev) 88%, var(--bg-deep));
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--head-ink);
  text-align: left; padding: 12px 16px; white-space: nowrap;
  border-bottom: 1px solid var(--line); user-select: none;
}
.dtable thead th.num { text-align: right; }
.dtable thead th.sortable { cursor: pointer; }
.dtable thead th.sortable:hover { color: var(--ink); }
.dtable th .th-in { display: inline-flex; align-items: center; gap: 6px; }
.dtable th.num .th-in { flex-direction: row-reverse; }
.dtable th .sort { display: inline-flex; opacity: 0; transition: opacity var(--t-fast) var(--easing); color: var(--accent); }
.dtable th.sortable:hover .sort { opacity: 0.5; }
.dtable th.sorted .sort { opacity: 1; }
.dtable th.sorted { color: var(--ink); }

.dtable tbody td {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  color: var(--ink-2); vertical-align: middle;
}
.dtable.compact tbody td { padding: 8px 16px; }
.dtable tbody tr { transition: background var(--t-fast) var(--easing); }
.dtable tbody tr:hover { background: color-mix(in oklab, var(--bg-elev) 60%, var(--bg)); }
.dtable tbody tr.sel { background: rgba(14,107,98,0.08); box-shadow: inset 3px 0 0 var(--accent); }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: 0.01em; }
.dtable td.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-2); letter-spacing: 0.02em; font-size: 12.5px; }

/* Applicant cell */
.who-cell { display: flex; align-items: center; gap: 11px; }
.who-cell .av {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  box-shadow: var(--shadow-in); background: var(--well-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; color: var(--accent);
}
.who-cell .nm { font-weight: 500; color: var(--ink); line-height: 1.25; }
.who-cell .em { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.01em; }

/* Country chip in cell */
.flagchip { display: inline-flex; align-items: center; gap: 10px; }
.flagchip .fc {
  width: 24px; height: 17px; border-radius: 3px; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-mono); font-size: 8px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); letter-spacing: 0.02em; background: var(--bg-deep);
}
.flagchip .dmeta { display: flex; flex-direction: column; line-height: 1.3; }
.flagchip .nm { color: var(--ink); font-weight: 500; white-space: nowrap; }
.flagchip .ty { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.02em; }

/* Status badge (table) */
.st {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 9px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
.st .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.st.approved { background: rgba(31,138,109,0.12); color: var(--ok); }
.st.review   { background: rgba(181,136,31,0.14); color: var(--warn); }
.st.action   { background: rgba(192,50,42,0.1); color: #a82a23; }
.st.draft    { background: var(--bg-deep); color: var(--draft-ink); }
.st.submitted{ background: rgba(14,107,98,0.1); color: var(--accent); }

/* Progress mini (in-cell stage) */
.stage { display: flex; align-items: center; gap: 9px; }
.stage .pips { display: flex; gap: 3px; }
.stage .pip { width: 14px; height: 5px; border-radius: 3px; background: var(--bg-deep); }
.stage .pip.on { background: var(--accent); }
.stage .pl { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }

/* Row actions (opportunistic) */
.rowact { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity var(--t-fast) var(--easing); }
.dtable tbody tr:hover .rowact { opacity: 1; }
.rowact button {
  width: 30px; height: 30px; border-radius: 8px; border: 0; cursor: pointer;
  background: transparent; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast) var(--easing), color var(--t-fast) var(--easing);
}
.rowact button:hover { background: var(--bg-deep); color: var(--accent); }

/* Checkbox */
.ck {
  width: 18px; height: 18px; border-radius: 5px; cursor: pointer;
  background: var(--well); box-shadow: var(--shadow-in);
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent; flex-shrink: 0;
  transition: background var(--t-fast) var(--easing), color var(--t-fast) var(--easing);
}
.ck.on { background: var(--accent); box-shadow: none; color: #fff; }
.ck.ind { background: var(--accent); box-shadow: none; color: #fff; }

/* ===== TABLE FOOTER / PAGINATION ============================= */
.tbl-foot {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-top: 1px solid var(--line);
}
.tbl-foot .info { font-size: 12.5px; color: var(--ink-3); }
.tbl-foot .info b { color: var(--ink-2); font-family: var(--font-mono); font-weight: 500; }
.tbl-foot .grow { flex: 1; }
.rows-sel {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-3);
}
.pager { display: inline-flex; align-items: center; gap: 4px; }
.pager button {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 0; cursor: pointer;
  background: transparent; color: var(--ink-2);
  font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--t-fast) var(--easing), color var(--t-fast) var(--easing);
}
.pager button:hover:not(:disabled) { background: var(--bg-deep); color: var(--ink); }
.pager button.on { background: var(--well); box-shadow: var(--shadow-in); color: var(--accent); }
.pager button:disabled { opacity: 0.35; cursor: default; }

/* ===== CONTROLS LIBRARY ====================================== */
.ctrl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ctrl-card { background: var(--bg-elev); border-radius: var(--r-lg); box-shadow: var(--shadow-out); padding: 24px; }
.ctrl-card .lbl {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px;
}
.ctrl-card .demo { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.ctrl-card .note { font-size: 12.5px; color: var(--ink-2); margin-top: 16px; line-height: 1.5; }

/* Toggle switch */
.tog { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.tog .sw {
  width: 42px; height: 24px; border-radius: 999px; flex-shrink: 0;
  background: var(--well); box-shadow: var(--shadow-in); position: relative;
  transition: background var(--t-base) var(--easing);
}
.tog .sw::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--thumb); box-shadow: var(--shadow-out);
  transition: transform var(--t-base) var(--easing), background var(--t-base) var(--easing);
}
.tog.on .sw { background: var(--accent); box-shadow: none; }
.tog.on .sw::after { transform: translateX(18px); background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.tog .tg-lbl { font-size: 13.5px; color: var(--ink); font-weight: 500; }

/* Radio + checkbox rows */
.opt-row { display: flex; flex-direction: column; gap: 11px; }
.opt { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.radio {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  background: var(--well); box-shadow: var(--shadow-in);
  display: inline-flex; align-items: center; justify-content: center;
}
.radio.on::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* Dropdown menu (visual) */
.menu {
  width: 210px; background: var(--menu-bg); border-radius: var(--r-md);
  box-shadow: var(--shadow-drop); padding: 6px; border: 1px solid var(--line);
}
.menu .mi {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.menu .mi:hover { background: var(--bg-deep); color: var(--ink); }
.menu .mi.danger { color: #a82a23; }
.menu .mi.danger:hover { background: rgba(192,50,42,0.08); }
.menu .sep { height: 1px; background: var(--line); margin: 5px 8px; }
.menu .mi .k { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }

/* Tabs (underline) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button {
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 500; color: var(--ink-3);
  padding: 10px 14px; position: relative;
  transition: color var(--t-fast) var(--easing);
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); }
.tabs button.on::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 1px;
}

/* Stepper */
.stepper { display: inline-flex; align-items: center; border-radius: 9px; background: var(--well); box-shadow: var(--shadow-in); }
.stepper button {
  width: 36px; height: 36px; border: 0; background: transparent; cursor: pointer;
  color: var(--ink-2); font-size: 18px; display: flex; align-items: center; justify-content: center;
}
.stepper button:hover { color: var(--accent); }
.stepper .val { min-width: 44px; text-align: center; font-family: var(--font-mono); font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Slider */
.slider { width: 100%; max-width: 260px; }
.slider .track { height: 8px; border-radius: 999px; background: var(--well); box-shadow: var(--shadow-in); position: relative; }
.slider .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); }
.slider .knob {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 20px; height: 20px; border-radius: 50%; background: var(--thumb);
  box-shadow: var(--shadow-out); border: 1.5px solid var(--accent);
}
.slider .sval { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); margin-top: 12px; }

/* Date range pill */
.daterange {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 9px; background: var(--raised); box-shadow: var(--shadow-out);
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.daterange .ic { color: var(--ink-3); display: flex; }

/* Tooltip */
.tip-host { position: relative; display: inline-flex; }
.tip {
  position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%);
  background: var(--accent-3); color: #e8ece9; font-size: 11.5px; line-height: 1.4;
  padding: 7px 11px; border-radius: 8px; white-space: nowrap; box-shadow: var(--shadow-drop);
}
.tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--accent-3);
}

/* Empty / inline helpers */
.empty {
  text-align: center; padding: 56px 24px; color: var(--ink-3);
}
.empty .well {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 18px;
  box-shadow: var(--shadow-in); background: var(--well-card);
  display: flex; align-items: center; justify-content: center; color: var(--ink-3);
}
.empty h4 { font-size: 17px; color: var(--ink); margin: 0 0 6px; font-weight: 500; letter-spacing: -0.01em; }
.empty p { font-size: 13.5px; margin: 0 auto; max-width: 38ch; line-height: 1.5; }

/* Section label between blocks */
.blk-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); margin: 28px 0 14px;
  display: flex; align-items: center; gap: 12px;
}
.blk-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .ctrl-grid { grid-template-columns: 1fr; }
}

/* ===== NIGHT MODE ============================================
   Dark theme as a token flip. Accent brightens for contrast on
   dark surfaces (teal #0e6b62 fails AA on near-black); status
   colors lift; wells go darker than their card instead of
   lighter. Scoped to .app.night — the marketing-side design
   system doc is untouched.
   ============================================================ */
body.night { background: #121a18; }
.app.night {
  --bg:       #121a18;
  --bg-elev:  #1a2422;
  --bg-deep:  #0d1413;
  --ink:      #e9efec;
  --ink-2:    #aebdb8;
  --ink-3:    #7f918c;
  --draft-ink: #a7b6b1;
  --head-ink: #a7b6b1;
  --accent:   #4cc0ae;
  --accent-2: #d9ae63;
  --accent-3: #24302d;
  --line:     rgba(233,239,236,0.12);
  --ok:       #43c39a;
  --warn:     #d9ae63;

  --topbar-bg: #16201e;
  --well:      var(--bg-deep);
  --raised:    #232f2c;
  --thumb:     #2c3a37;
  --well-card: var(--bg-deep);
  --menu-bg:   #1f2b28;

  --shadow-out:
    0 0 0 1px rgba(233,239,236,0.08),
    0 1px 2px rgba(0,0,0,0.32),
    0 4px 14px rgba(0,0,0,0.26);
  --shadow-in:
    inset 0 0 0 1px rgba(233,239,236,0.10);
  --shadow-drop:
    0 0 0 1px rgba(233,239,236,0.10),
    0 12px 34px rgba(0,0,0,0.52),
    0 3px 10px rgba(0,0,0,0.36);
}

/* Sidebar sits deeper than the page in night mode */
.app.night .side {
  background: linear-gradient(170deg, #101a18 0%, #0c1514 60%, #0a1211 100%);
  border-right: 1px solid rgba(233,239,236,0.09);
}
.app.night .side-card { background: rgba(233,239,236,0.05); border-color: rgba(233,239,236,0.09); }

/* Sticky table header — keep it distinct from row hover */
.app.night .dtable thead th { background: #1f2a27; }
.app.night .dtable tbody tr:hover { background: rgba(233,239,236,0.035); }
.app.night .dtable tbody tr.sel { background: rgba(76,192,174,0.10); }

/* Status + delta: brighter fills, lighter text for dark ground */
.app.night .st.approved  { background: rgba(67,195,154,0.16);  color: #6fd7b3; }
.app.night .st.review    { background: rgba(217,174,99,0.16);  color: #e2bd7c; }
.app.night .st.action    { background: rgba(232,106,96,0.16);  color: #f0958c; }
.app.night .st.submitted { background: rgba(76,192,174,0.14);  color: #5fcbba; }
.app.night .st.draft     { background: rgba(233,239,236,0.08); color: var(--draft-ink); }
.app.night .delta.up     { background: rgba(67,195,154,0.14);  color: #6fd7b3; }
.app.night .delta.down   { background: rgba(232,106,96,0.14);  color: #f0958c; }
.app.night .delta.flat   { background: rgba(233,239,236,0.08); color: var(--ink-3); }
.app.night .menu .mi.danger { color: #f0958c; }
.app.night .menu .mi.danger:hover { background: rgba(232,106,96,0.12); }

/* Selection bar: lift off the page with teal, not near-black */
.app.night .selbar { background: #14312c; border-bottom-color: rgba(233,239,236,0.1); }
.app.night .tip { background: #2b3a36; }

/* Country chip + toggle thumb */
.app.night .flagchip .fc { background: rgba(233,239,236,0.07); box-shadow: inset 0 0 0 1px var(--line); }
.app.night .ck.on, .app.night .ck.ind { color: #08110f; }
.app.night .tog.on .sw::after { background: #08110f; }
.app.night .stage .pip { background: rgba(233,239,236,0.13); }
.app.night .stage .pip.on { background: var(--accent); }
.app.night .content::-webkit-scrollbar-thumb { background: #26332f; border-color: var(--bg); }
.app.night .empty .well { color: var(--ink-3); }
