@import url('tokens.css');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500;1,9..144,600&display=swap');

/* =========================================================
   Navio — base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; }

a { color: var(--accent); text-decoration: none; transition: color var(--dur-1); }
a:hover { color: var(--accent-lo); }

h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.022em; margin: 0; line-height: 1.15; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 0; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 700; margin: 0; line-height: 1.4; }
p  { margin: 0; }

::selection { background: var(--accent-subtle); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--panel-3); border-radius: 999px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-3); background-clip: content-box; border: 3px solid transparent; }

/* =========================================================
   Layout utilities
   ========================================================= */
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.stack { display: flex; flex-direction: column; }
.row   { display: flex; }
.grow  { flex: 1; min-width: 0; }
.muted, .dim { color: var(--text-2); }
.tiny { font-size: 11px; } .small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .01em; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.p-2 { padding: 8px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; } .p-6 { padding: 24px; }
.hidden { display: none !important; }
.center { display: flex; align-items: center; justify-content: center; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.items-center { align-items: center; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border-radius: var(--r-md); border: 1px solid var(--border-2);
  background: var(--panel); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer; white-space: nowrap; user-select: none;
  box-shadow: 0 1px 0 rgba(17,20,24,.04);
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1), box-shadow var(--dur-1), transform 80ms;
}
.btn:hover { background: var(--panel-2); border-color: var(--border-3); }
.btn:active { transform: translateY(.5px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: var(--ring-accent), 0 1px 0 rgba(17,20,24,.04); }
.btn.primary {
  /* Brand gradient with inner highlight + warm glow — feels considered and
     tactile, not flat. The glow gives the button real presence on the page. */
  background: var(--grad-brand); color: #fff;
  border-color: var(--accent-lo);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    inset 0 -1px 0 rgba(0,0,0,.08),
    0 1px 0 rgba(17,20,24,.04),
    var(--glow-accent-soft);
}
.btn.primary:hover {
  background: var(--grad-brand);
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.25),
    inset 0 -1px 0 rgba(0,0,0,.10),
    0 1px 0 rgba(17,20,24,.04),
    var(--glow-accent);
}
.btn.primary:focus-visible {
  box-shadow:
    0 0 0 3px var(--accent-glow),
    inset 0 1px 0 rgba(255,255,255,.22),
    inset 0 -1px 0 rgba(0,0,0,.08);
}
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--panel-2); border-color: transparent; }
.btn.danger { color: var(--danger); border-color: var(--border-2); }
.btn.danger:hover { background: var(--danger-subtle); border-color: var(--danger); color: var(--danger); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; gap: 5px; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 14px; }
.btn.block { width: 100%; }
.btn-row { display: inline-flex; }
.btn-row .btn { border-radius: 0; margin-left: -1px; }
.btn-row .btn:first-child { border-radius: var(--r-md) 0 0 var(--r-md); margin-left: 0; }
.btn-row .btn:last-child  { border-radius: 0 var(--r-md) var(--r-md) 0; }

/* =========================================================
   Inputs
   ========================================================= */
.input, .select, .textarea {
  width: 100%;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border-2); border-radius: var(--r-md);
  padding: 8px 11px; font: inherit; font-size: 13.5px;
  line-height: 1.4;
  box-shadow: inset 0 1px 1px rgba(17,20,24,.025);
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: var(--ring-accent), inset 0 1px 1px rgba(17,20,24,.025);
}
.textarea { min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-2); margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.field { margin-bottom: 14px; }
.field .help { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.4; }

/* =========================================================
   Cards
   ========================================================= */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-1), box-shadow var(--dur-1), transform var(--dur-1);
  position: relative;
}
.card.pad { padding: 20px; }
.card.pad-lg { padding: 28px; }
.card.flat { box-shadow: none; }
.card.interactive { cursor: pointer; }
.card.interactive:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
/* Hero-flavored card — used for important callouts or feature panels. */
.card.feature {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border-color: var(--border);
  box-shadow: var(--shadow-2);
}
.card.feature::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--grad-brand);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.card-title {
  font-size: 14px; font-weight: 600; margin-bottom: 14px;
  color: var(--text); letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
.card-title .count { font-size: 12px; font-weight: 500; color: var(--text-3); }

.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* =========================================================
   Pills / badges
   ========================================================= */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.6;
  background: var(--panel-2); color: var(--text-2);
  border: 1px solid var(--border);
  letter-spacing: -0.005em;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.lead    { background: var(--warning-subtle); color: var(--warning); border-color: transparent; }
.pill.quoted  { background: var(--accent-subtle);  color: var(--accent);  border-color: transparent; }
.pill.booked  { background: var(--success-subtle); color: var(--success); border-color: transparent; }
.pill.traveled{ background: var(--panel-3);        color: var(--text-2);  border-color: transparent; }
.pill.cancelled{ background: var(--danger-subtle); color: var(--danger);  border-color: transparent; }
.pill.active  { background: var(--success-subtle); color: var(--success); border-color: transparent; }
.pill.inactive{ background: var(--panel-3);        color: var(--text-3);  border-color: transparent; }

/* =========================================================
   Tables
   ========================================================= */
.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--panel); border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--border);
  font-size: 13.5px;
}
.tbl th, .tbl td {
  text-align: left; padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl th {
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  background: var(--panel);
  letter-spacing: -0.005em;
  border-bottom-color: var(--border-2);
  position: sticky; top: 0; z-index: 1;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--dur-1); }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl tbody tr[onclick], .tbl tbody tr.clickable { cursor: pointer; }
.tbl td.text-r, .tbl th.text-r { text-align: right; }
.tbl td b { font-weight: 600; color: var(--text); }
.text-r { text-align: right; }

/* =========================================================
   App shell — sidebar + topbar
   ========================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "side top" "side main";
  min-height: 100vh;
}
.app-side {
  grid-area: side;
  background:
    linear-gradient(180deg, var(--panel) 0%, var(--panel) 70%, var(--panel-2) 100%),
    radial-gradient(400px 200px at 50% 0%, rgba(58,108,232,.04), transparent 70%);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: relative;
}
/* Hairline accent on the inside edge — catches light, very subtle. */
.app-side::after {
  content: ''; position: absolute; top: var(--topbar-h); right: -1px; bottom: 0;
  width: 1px; background: linear-gradient(180deg, var(--accent-glow), transparent 30%);
  opacity: .35; pointer-events: none;
}
.app-top {
  grid-area: top;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(1.6) blur(10px);
  -webkit-backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px;
  position: relative;
}
/* Tiny brand-gradient line just above the bottom border — catches the eye
   without being loud. Pure decoration that costs zero performance. */
.app-top::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: linear-gradient(90deg, transparent 0%, var(--accent-glow) 30%, var(--accent-glow) 70%, transparent 100%);
  opacity: .6;
}
[data-theme="dark"] .app-top { background: rgba(20,23,28,.85); }
.app-main {
  grid-area: main;
  padding: 28px 32px 80px;
  overflow-x: hidden;
  background: var(--bg);
  /* Subtle aurora mesh — adds visual interest to the workspace without
     fighting page content. The radial gradients are at low opacity so cards
     still read cleanly against them. */
  background-image: var(--bg-mesh);
  background-attachment: fixed;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; height: var(--topbar-h);
  font-weight: 700; font-size: 16px; letter-spacing: -0.025em;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--grad-brand);
  /* Layered shadows: inner highlight + brand-tinted outer glow create
     a "lit from above" feel, like a real product logo treatment. */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.30),
    inset 0 -1px 0 rgba(0,0,0,.12),
    0 1px 2px rgba(30,74,214,.25),
    0 4px 12px rgba(30,74,214,.18);
  display: grid; place-items: center; color: #fff;
  font-weight: 700; font-size: 13px; letter-spacing: -0.02em;
  flex: 0 0 auto;
  position: relative;
}
/* Tiny shine sweep on hover — small detail that makes the brand feel alive. */
.brand-mark::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 50%);
  pointer-events: none;
}

.nav { padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 7px 12px 7px 14px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; font-size: 13px;
  transition: background var(--dur-1), color var(--dur-1);
}
.nav a svg { width: 16px; height: 16px; flex: 0 0 auto; opacity: .85; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a:hover svg { opacity: 1; }
/* Active state: tinted background + a 2px accent bar on the leading edge.
   The bar is the visual hint that distinguishes active from hover without
   relying on color alone. Linear/Notion pattern. */
.nav a.active {
  background: linear-gradient(90deg, var(--accent-subtle) 0%, transparent 100%);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(30,74,214,.10);
}
.nav a.active::before {
  content: '';
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 2.5px; border-radius: 0 3px 3px 0;
  background: var(--grad-brand);
  box-shadow: 0 0 8px rgba(30,74,214,.4);
}
.nav a.active svg { opacity: 1; }
.nav .section-title {
  padding: 16px 14px 6px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--text-4);
}

.app-top .agency-switcher {
  font-weight: 600; font-size: 14px; color: var(--text);
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}
.app-top .right { margin-left: auto; display: flex; align-items: center; gap: 14px; position: relative; }

/* User-menu trigger — avatar + name + caret */
.who-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; height: 38px;
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  cursor: pointer; color: var(--text); font: inherit; font-size: 13px; font-weight: 500;
  transition: background var(--dur-1), border-color var(--dur-1);
}
.who-btn:hover { background: var(--panel-2); border-color: var(--border); }
.who-btn[aria-expanded="true"] { background: var(--panel-2); border-color: var(--border); }
.who-btn .who-caret { width: 13px; height: 13px; color: var(--text-3); transition: transform var(--dur-1); }
.who-btn[aria-expanded="true"] .who-caret { transform: rotate(180deg); }
.who-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .who-name { display: none; } }

/* Avatar — used in the topbar trigger AND inside the menu head */
.who-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: var(--grad-brand); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: -0.01em;
  background-size: cover; background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.who-avatar.lg { width: 44px; height: 44px; font-size: 16px; }

/* Dropdown menu — position: fixed, JS sets top/right from the trigger's
   bounding rect. Sidesteps overflow-clipping from grid-layout parents. */
.who-menu {
  position: fixed; z-index: 1000;
  width: 260px; padding: 6px;
  background: var(--panel); border: 1px solid var(--border-2);
  border-radius: var(--r-md); box-shadow: var(--shadow-3);
  animation: who-menu-in .15s var(--ease-out);
}
@keyframes who-menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.who-menu-head {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.who-menu-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.who-menu-email { font-size: 12px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
/* Tenure milestone pill in the user-menu head — picks up the same warm
   accent as the dashboard milestone strip's tenure category. */
.who-menu-tenure {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 3px 10px 3px 8px;
  background: rgba(91,33,182,.10);
  color: #5b21b6;
  border: 1px solid rgba(91,33,182,.22);
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: -0.005em;
  line-height: 1.3;
}
.who-menu-tenure.plain {
  background: var(--panel-2); color: var(--text-3);
  border-color: var(--border);
  font-weight: 500;
}
.who-menu-tenure .who-tenure-star { font-size: 12px; line-height: 1; }
.who-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: var(--r-sm);
  background: transparent; border: 0; cursor: pointer;
  font: inherit; font-size: 13.5px; color: var(--text); text-decoration: none;
  text-align: left;
}
.who-menu-item:hover { background: var(--panel-2); }
.who-menu-item svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--text-3); }
.who-menu-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* Brand stack — Navio wordmark + agency name underneath */
.brand-stack { line-height: 1.2; min-width: 0; flex: 1; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.025em; }
.brand-agency {
  font-size: 11.5px; color: var(--text-3); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 150px;
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
  .app-side { display: none; }
}

/* =========================================================
   Toast
   ========================================================= */
.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 1000;
  padding: 11px 16px; background: var(--text); color: var(--panel);
  border-radius: var(--r-md); box-shadow: var(--shadow-3);
  font-size: 13px; font-weight: 500; max-width: 380px;
  letter-spacing: -0.005em; line-height: 1.45;
  animation: toastin .28s var(--ease-out);
  border: 1px solid rgba(0,0,0,.05);
}
.toast.error   { background: var(--danger);  color: #fff; }
.toast.success { background: var(--success); color: #fff; }
.toast.info    { background: var(--info);    color: #fff; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px) scale(.98);} to { opacity: 1; transform: none; } }

/* =========================================================
   Empty state
   ========================================================= */
.empty {
  text-align: center; padding: 56px 24px; color: var(--text-3);
  background: var(--panel); border: 1px dashed var(--border-2);
  border-radius: var(--r-lg);
  font-size: 13.5px; line-height: 1.5;
}
.empty h3 {
  color: var(--text); margin-bottom: 8px;
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
}
.empty p { max-width: 380px; margin: 0 auto; }
.empty .actions { margin-top: 18px; display: inline-flex; gap: 8px; }

/* =========================================================
   Page header
   ========================================================= */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 28px; flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-head::after {
  /* Short brand-gradient underline beneath the page-head border, centered
     under the h1. Subtle visual anchor that says "this is the page title". */
  content: ''; position: absolute; left: 0; bottom: -1px;
  width: 56px; height: 2px; border-radius: 2px;
  background: var(--grad-brand);
}
.page-head .title h1 {
  font-size: 28px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.1;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-head .crumb {
  color: var(--text-3); font-size: 12.5px; font-weight: 500;
  letter-spacing: -0.005em; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: .04em;
}
.page-head .title .crumb { margin-top: 8px; margin-bottom: 0; text-transform: none; letter-spacing: -0.005em; font-size: 14px; color: var(--text-2); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =========================================================
   Stat cards
   ========================================================= */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width:  640px) { .stat-row { grid-template-columns: 1fr; } }
.stat {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel) 60%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--shadow-1);
  position: relative; overflow: hidden;
  transition: border-color var(--dur-1), box-shadow var(--dur-1), transform var(--dur-1);
}
.stat:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
/* Top accent bar — colored hint of the metric's category. */
.stat::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--grad-brand); opacity: .85;
}
.stat.success::before { background: linear-gradient(90deg, #0f9d6a, #34c785); }
.stat.warning::before { background: linear-gradient(90deg, #b8770a, #e89d2c); }
.stat.danger::before  { background: linear-gradient(90deg, #d22f3a, #ee5862); }
.stat .l {
  color: var(--text-3); font-size: 11.5px; font-weight: 600;
  letter-spacing: .02em;
}
.stat .v {
  font-size: 30px; font-weight: 700; letter-spacing: -0.03em;
  margin-top: 8px; line-height: 1.05;
  font-feature-settings: "tnum" 1, "lnum" 1;
  color: var(--text);
}
.stat .sub {
  color: var(--text-3); font-size: 12px; margin-top: 8px;
  display: inline-flex; align-items: center; gap: 4px;
}
/* Accent variants subtly tint the value to match the top bar. */
.stat.success .v { color: var(--success); }
.stat.warning .v { color: var(--warning); }
.stat.danger  .v { color: var(--danger); }
/* Legacy .ic blocks: hide so older callers that still emit emoji boxes
   degrade gracefully instead of jumping out. */
.stat .ic { display: none; }

/* =========================================================
   Modal dialog
   ========================================================= */
dialog.tc {
  border: 0; border-radius: var(--r-xl); padding: 0;
  box-shadow: var(--shadow-3); width: min(560px, 92vw);
  background: var(--panel); color: var(--text);
  animation: dialogin .22s var(--ease-out);
}
@keyframes dialogin { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
dialog.tc::backdrop {
  background: rgba(17,20,24,.40);
  backdrop-filter: blur(4px) saturate(1.1);
}
dialog.tc .head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 15px;
  letter-spacing: -0.01em;
  display: flex; align-items: center; justify-content: space-between;
}
dialog.tc .head .x {
  background: transparent; border: 0; color: var(--text-3);
  font-size: 18px; cursor: pointer;
  width: 28px; height: 28px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur-1), color var(--dur-1);
}
dialog.tc .head .x:hover { color: var(--text); background: var(--panel-2); }
dialog.tc .body { padding: 20px; max-height: 70vh; overflow-y: auto; }
dialog.tc .foot {
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--panel-2);
  display: flex; justify-content: flex-end; gap: 8px;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
dialog.tc.lg { width: min(720px, 96vw); }

/* =========================================================
   Drawer (slide-in panel)
   ========================================================= */
.drawer-back {
  position: fixed; inset: 0; background: rgba(15,28,60,.45);
  z-index: 50; display: none; backdrop-filter: blur(2px);
}
.drawer-back.open { display: block; animation: fadein .2s var(--ease); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 96vw);
  background: var(--panel); border-left: 1px solid var(--border); z-index: 51;
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform var(--dur-3) var(--ease);
}
.drawer.open { transform: translateX(0); }
.drawer .d-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer .d-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer .d-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }

/* =========================================================
   Kanban board
   ========================================================= */
.board {
  display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;
}
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width:  640px) { .board { grid-template-columns: 1fr; } }
.column {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column;
  min-height: 280px;
}
.column.drop-target {
  border-color: var(--accent); border-style: dashed;
  background: var(--accent-subtle);
}
.col-head {
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: transparent;
}
.col-head .label {
  font-weight: 600; font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-2); letter-spacing: -0.005em;
}
.col-head .count {
  font-size: 11px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.col-head .col-dot { width: 8px; height: 8px; border-radius: 50%; }
.col-head .col-dot.lead     { background: var(--pri-2); }
.col-head .col-dot.quoted   { background: var(--pri-4); }
.col-head .col-dot.booked   { background: var(--success); }
.col-head .col-dot.traveled { background: var(--text-4); }
.col-body { padding: 0 8px 8px; display: flex; flex-direction: column; gap: 6px; min-height: 80px; }
.tcard {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px; cursor: grab; user-select: none;
  transition: border-color var(--dur-1), transform var(--dur-1), box-shadow var(--dur-1);
  box-shadow: 0 1px 0 rgba(17,20,24,.03);
}
.tcard:hover { border-color: var(--border-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.tcard.dragging { opacity: .4; cursor: grabbing; }
.tcard .t-title {
  font-weight: 600; font-size: 13.5px; line-height: 1.3;
  letter-spacing: -0.005em; color: var(--text);
}
.tcard .t-sub   {
  color: var(--text-3); font-size: 12px; margin-top: 6px; line-height: 1.4;
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.tcard .t-sub .dotsep { color: var(--text-4); }
.tcard .t-foot {
  margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--text-3);
}
.tcard .t-foot .price {
  color: var(--text); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tcard .t-meta { display: inline-flex; gap: 4px; align-items: center; font-variant-numeric: tabular-nums; }

/* =========================================================
   Calendar (month grid)
   ========================================================= */
.cal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); background: var(--panel-2); }
.cal-head .dn { padding: 8px 10px; font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day {
  min-height: 96px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 6px; position: relative;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.muted { background: var(--panel-2); color: var(--text-4); }
.cal-day.today .d { background: var(--accent); color: #fff; }
.cal-day .d { display: inline-flex; min-width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 0 6px; }
.cal-evt {
  display: block; margin-top: 4px;
  padding: 2px 6px; border-radius: 4px;
  font-size: 11px; line-height: 1.3;
  background: var(--accent-subtle); color: var(--accent); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-evt.task { background: var(--warning-subtle); color: var(--warning); }
.cal-evt.booked { background: var(--success-subtle); color: var(--success); }

/* =========================================================
   Trip detail tabs
   ========================================================= */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tabs .tab {
  position: relative;
  padding: 10px 14px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-3);
  letter-spacing: -0.005em;
  background: transparent; border: 0;
  margin-bottom: -1px;
  transition: color var(--dur-1);
}
.tabs .tab:hover { color: var(--text-2); }
.tabs .tab.active {
  color: var(--text); font-weight: 600;
}
.tabs .tab.active::after {
  content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px;
  height: 2px; border-radius: 2px 2px 0 0;
  background: var(--accent);
}

/* =========================================================
   Activity timeline
   ========================================================= */
.tl { padding: 4px 0; }
.tl-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.tl-item:last-child { border-bottom: 0; }
.tl-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-3); color: var(--text-2); font-size: 13px; }
.tl-ic.call   { background: var(--success-subtle); color: var(--success); }
.tl-ic.email  { background: var(--accent-subtle);  color: var(--accent);  }
.tl-ic.meeting{ background: var(--warning-subtle); color: var(--warning); }
.tl-body { font-size: 13px; line-height: 1.5; }
.tl-meta { color: var(--text-3); font-size: 11.5px; margin-bottom: 2px; }

/* =========================================================
   Tasks list
   ========================================================= */
.task { display: flex; gap: 10px; padding: 9px 6px; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.task:last-child { border-bottom: 0; }
.task .chk { margin-top: 2px; width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }
.task.done .t-text { color: var(--text-3); text-decoration: line-through; }
.task .t-text { font-size: 13.5px; flex: 1; }
.task .t-sub  { color: var(--text-3); font-size: 11.5px; margin-top: 2px; }
.task .t-x { color: var(--text-3); background: transparent; border: 0; cursor: pointer; padding: 2px 6px; border-radius: 4px; font-size: 14px; }
.task .t-x:hover { color: var(--danger); background: var(--danger-subtle); }

/* =========================================================
   Brand mark (small)
   ========================================================= */
.bm-sm {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent));
  display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 11px;
}

/* =========================================================
   Lock/Unlock vault
   ========================================================= */
.vault-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--accent-subtle); color: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--r-md);
  font-size: 13px; font-weight: 600;
}
.vault-bar.locked { background: var(--warning-subtle); color: var(--warning); border-color: var(--warning); }
.vault-bar .grow { flex: 1; }

/* =========================================================
   Card brand pill (mini)
   ========================================================= */
.brand-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 22px; padding: 0 6px;
  border-radius: 4px; font-size: 10px; font-weight: 800; letter-spacing: .04em;
  background: var(--panel-3); color: var(--text-2);
}
.brand-pill.visa  { background: #1a1f71; color: #fff; }
.brand-pill.mc    { background: #eb001b; color: #fff; }
.brand-pill.amex  { background: #006fcf; color: #fff; }
.brand-pill.disc  { background: #ff6000; color: #fff; }

/* =========================================================
   Trip options (proposal variants)
   ========================================================= */
.opt-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow-1);
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.opt-card:hover { border-color: var(--border-3); }
.opt-card.selected { border-color: var(--success); box-shadow: 0 0 0 3px var(--success-subtle); }
.opt-card.sent     { border-color: var(--accent);  box-shadow: 0 0 0 2px var(--accent-subtle); }
.opt-cover {
  height: 160px; background: var(--panel-2); position: relative;
  background-size: cover; background-position: center;
}
.opt-cover.empty { background: linear-gradient(135deg, var(--accent-subtle), var(--panel-2)); display: grid; place-items: center; color: var(--text-3); font-size: 12px; }
.opt-cover .badge {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: rgba(255,255,255,.94); color: var(--text); backdrop-filter: blur(4px);
}
.opt-cover .price-tag {
  position: absolute; top: 12px; right: 12px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(15,28,60,.70); color: #fff; backdrop-filter: blur(4px);
  font-weight: 700; font-size: 13px;
}
.opt-head { padding: 14px 16px; }
.opt-head h3 { font-size: 17px; }
.opt-head .sub { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.opt-head .meta { color: var(--text-3); font-size: 12.5px; margin-top: 6px; }
.opt-body { border-top: 1px solid var(--border); padding: 14px 16px; }
.opt-foot { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.opt-collapsed-summary { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px dashed var(--border); color: var(--text-3); font-size: 12px; }
.opt-collapsed-summary span { display: inline-flex; align-items: center; gap: 4px; }

/* Public share — option chooser */
.opt-public {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px;
  margin-bottom: 24px;
}
.opt-public .o-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-1);
}
.opt-public .o-card.selected { border-color: var(--success); box-shadow: 0 0 0 3px var(--success-subtle); }
.opt-public .o-cover { height: 180px; background-size: cover; background-position: center; background-color: var(--panel-2); }
.opt-public .o-body { padding: 16px 18px; }
.opt-public .o-body h3 { font-size: 18px; }
.opt-public .o-body .sub { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.opt-public .o-body .price { color: var(--text); font-size: 22px; font-weight: 800; margin-top: 10px; letter-spacing: -0.02em; }

/* =========================================================
   Small utilities
   ========================================================= */
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.right { margin-left: auto; }
.text-r { text-align: right; }

/* =========================================================
   FINTECH OVERLAY (v1)
   --------------------------------------------------------
   Linear / Stripe / Vercel direction. Cool whites, hairline
   borders, sans-only Inter, tight letter-spacing on headlines,
   tabular numerals, single saturated accent. No serif italic
   moments — restraint is the point.
   ========================================================= */
:root {
  --fin-bg:        #fafafa;
  --fin-panel:     #ffffff;
  --fin-panel-2:   #f5f5f5;
  --fin-panel-3:   #ededed;
  --fin-border:    #ebebeb;
  --fin-border-2:  #d4d4d4;
  --fin-text:      #0a0a0a;
  --fin-text-2:    #525252;
  --fin-text-3:    #8e8e8e;
  --fin-accent:    #0a0a0a;        /* primary action = ink black */
  --fin-accent-2:  #1e4ad6;        /* brand-blue for accents */
  --fin-success:   #00875a;
  --fin-warning:   #c47a00;
  --fin-danger:    #d4334b;
}

/* ── Foundation: cool whites + Inter only ──────────────────
   NOTE: scoped to the light theme ONLY. This previously used a bare
   `:root body` selector, which matches regardless of data-theme and so
   forced the white --fin-bg / dark --fin-text onto the body in dark mode
   too (the "white is still there" bug). Dark mode now falls through to the
   base `html, body { background: var(--bg) }` rule with dark tokens. */
[data-theme="light"] body {
  background: var(--fin-bg);
  color: var(--fin-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11' 1, 'ss01' 1;
}
[data-theme="light"] .app-main { background: var(--fin-bg); }
/* Dark mode: keep Inter + the numeral font features, but let the surface
   colors come from the dark token set rather than the fintech whites. */
[data-theme="dark"] body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11' 1, 'ss01' 1;
}
[data-theme="dark"] .app-main { background: var(--bg); }

/* ── Sidebar (.app-side) ─────────────────────────────────────────────
   Linear/Stripe-grade polish: subtle background gradient, refined brand
   mark with depth shadow, tighter type, blue-tinted active state with
   leading accent bar, hairline-divided section groups, smooth hover
   transitions. Targets the fintech-overlay light theme. */
[data-theme="light"] .app-side {
  background:
    linear-gradient(180deg, #ffffff 0%, #fafaf9 100%);
  border-right: 1px solid var(--fin-border);
}
[data-theme="light"] .app-side::after { display: none; }

/* ── Brand block ──────────────────────────────────────────────────── */
[data-theme="light"] .app-side .brand {
  padding: 0 16px;
  border-bottom: 1px solid var(--fin-border);
  gap: 11px;
}
[data-theme="light"] .app-side .brand-mark {
  width: 30px; height: 30px;
  background: linear-gradient(140deg, #1a1a1a 0%, #2c2c2c 100%);
  color: var(--fin-panel);
  border-radius: 7px;
  font-size: 13.5px; font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow:
    0 1px 2px rgba(0,0,0,.06),
    0 0 0 1px rgba(0,0,0,.04),
    inset 0 1px 0 rgba(255,255,255,.10);
}
[data-theme="light"] .app-side .brand-mark::after { display: none; }
[data-theme="light"] .app-side .brand-name {
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 15.5px;
  letter-spacing: -0.025em; color: var(--fin-text);
  line-height: 1.15;
}
[data-theme="light"] .app-side .brand-agency {
  font-size: 11.5px; color: var(--fin-text-3); font-weight: 500;
  letter-spacing: -0.005em; line-height: 1.3; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 160px;
}

/* ── Nav container — tighter padding, deliberate vertical rhythm ──── */
[data-theme="light"] .app-side .nav {
  padding: 10px 10px 16px;
  gap: 0;
}

/* ── Nav links — base + hover ─────────────────────────────────────── */
[data-theme="light"] .app-side .nav > a {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  margin: 1px 0;
  color: var(--fin-text-2);
  font-weight: 500; font-size: 13.5px;
  letter-spacing: -0.005em;
  transition: background 140ms ease, color 140ms ease;
  box-shadow: none;
}
[data-theme="light"] .app-side .nav > a svg {
  width: 16px; height: 16px;
  color: var(--fin-text-3);
  opacity: 1;
  transition: color 140ms ease;
}
[data-theme="light"] .app-side .nav > a:hover {
  background: var(--fin-panel-2);
  color: var(--fin-text);
}
[data-theme="light"] .app-side .nav > a:hover svg {
  color: var(--fin-text-2);
}
[data-theme="light"] .app-side .nav > a:active {
  transform: translateY(0.5px);
}

/* ── Active state — warm-orange tinted bg + leading accent bar + ring
   The accent matches the editorial marketing site's --ink-warm
   (#c8451e), so the in-app polish reads as the same brand. */
[data-theme="light"] .app-side .nav > a.active {
  background: linear-gradient(90deg, rgba(200,69,30,.07) 0%, rgba(200,69,30,.02) 60%, transparent 100%);
  color: var(--fin-text);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(200,69,30,.16);
}
[data-theme="light"] .app-side .nav > a.active::before {
  content: '';
  position: absolute;
  left: -10px; top: 7px; bottom: 7px;
  width: 2.5px; border-radius: 0 3px 3px 0;
  background: #c8451e;
  box-shadow: 0 0 8px rgba(200,69,30,.40);
}
[data-theme="light"] .app-side .nav > a.active svg {
  color: #c8451e;
}

/* ── Section dividers — small caps + thin hairline ──────────────────
   The hairline above each group quietly separates Work / Agency /
   Staff. The first one (Sidebar root) gets no divider. */
[data-theme="light"] .app-side .nav .section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--fin-text-3);
  padding: 16px 10px 6px;
  margin-top: 8px;
  border-top: 1px solid var(--fin-border);
}
[data-theme="light"] .app-side .nav > .section-title:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 4px;
}

/* ── Topbar (.app-top) ───────────────────────────────────── */
[data-theme="light"] .app-top {
  background: var(--fin-panel);
  border-bottom: 1px solid var(--fin-border);
  backdrop-filter: none;
}
[data-theme="light"] .app-top::after { display: none; }

[data-theme="light"] .app-top .agency-switcher {
  font-weight: 600; font-size: 14px; color: var(--fin-text);
}
[data-theme="light"] .app-top .agency-switcher .select {
  font-weight: 600; font-size: 14px;
  background: transparent; border: 1px solid transparent;
  color: var(--fin-text); padding: 6px 10px;
  border-radius: 6px;
}
[data-theme="light"] .app-top .agency-switcher .select:hover {
  background: var(--fin-panel-2);
  border-color: var(--fin-border);
}

/* User dropdown trigger */
[data-theme="light"] .who-btn {
  background: transparent;
  border: 1px solid var(--fin-border);
  border-radius: 8px;
  color: var(--fin-text);
  padding: 4px 10px 4px 4px;
}
[data-theme="light"] .who-btn:hover,
[data-theme="light"] .who-btn[aria-expanded="true"] {
  background: var(--fin-panel-2);
  border-color: var(--fin-border-2);
}
[data-theme="light"] .who-avatar {
  /* `background-color` (not `background`) — the shorthand `background:` with
     !important silently wiped any inline `background-image: url(...)` set
     by shell.js for users with an uploaded photo. Use the longhand so the
     placeholder color sits behind the optional photo, not over it. */
  background-color: var(--fin-text) !important;
  color: var(--fin-panel) !important;
  border-radius: 6px;
}

/* User dropdown menu */
[data-theme="light"] .who-menu {
  background: var(--fin-panel);
  border: 1px solid var(--fin-border);
  box-shadow: 0 12px 32px rgba(0,0,0,.08), 0 4px 8px rgba(0,0,0,.04);
  border-radius: 8px;
}
[data-theme="light"] .who-menu-head {
  background: var(--fin-panel-2);
  border-bottom: 1px solid var(--fin-border);
}
[data-theme="light"] .who-menu-name {
  font-weight: 600; font-size: 14px; color: var(--fin-text);
  letter-spacing: -0.01em;
}
[data-theme="light"] .who-menu-email { color: var(--fin-text-3); }
[data-theme="light"] .who-menu-item {
  color: var(--fin-text-2); font-weight: 500; font-size: 13.5px;
}
[data-theme="light"] .who-menu-item:hover {
  background: var(--fin-panel-2); color: var(--fin-text);
}
[data-theme="light"] .who-menu-item svg { color: var(--fin-text-3); }
[data-theme="light"] .who-menu-divider { background: var(--fin-border); }

/* ──────────────────────────────────────────────────────────────────
   Custom dialog (replaces native confirm/alert/prompt). The component
   lives in js/dialog.js — these styles render the editorial-paper card
   on the dimmed backdrop. .is-danger swaps primary button + title to
   the destructive red. */
.tc-dialog-back {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15, 14, 10, .62);
  display: grid; place-items: center;
  padding: 16px;
  animation: tc-dialog-fade .15s ease-out;
}
@keyframes tc-dialog-fade { from { opacity: 0; } to { opacity: 1; } }
.tc-dialog {
  width: min(440px, calc(100vw - 32px));
  background: #faf6ee; color: #14110d;
  border-radius: 14px;
  padding: 24px 26px;
  box-shadow: 0 24px 48px rgba(0,0,0,.30), 0 4px 10px rgba(0,0,0,.16);
  font-family: 'Inter', system-ui, sans-serif;
  animation: tc-dialog-pop .18s cubic-bezier(.16,.84,.44,1);
}
@keyframes tc-dialog-pop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tc-dialog-title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic; font-weight: 500;
  font-size: 22px; line-height: 1.2; letter-spacing: -0.018em;
  color: #14110d; margin: 0 0 8px;
}
.tc-dialog.is-danger .tc-dialog-title { color: #d4334b; }
.tc-dialog-msg {
  font-size: 14.5px; line-height: 1.55; color: #4a4337;
  letter-spacing: -0.005em;
}
.tc-dialog-input {
  display: block; width: 100%; margin-top: 14px;
  padding: 10px 14px; font-size: 14.5px;
  border: 1px solid #e6e2d8; border-radius: 6px;
  background: #fff; color: #14110d;
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.tc-dialog-input:focus {
  outline: none; border-color: #c8451e;
  box-shadow: 0 0 0 3px rgba(200,69,30,.12);
}
.tc-dialog-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 18px;
}
.tc-dialog-btn {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em;
  padding: 9px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, transform .08s;
}
.tc-dialog-btn:focus { outline: 2px solid #c8451e; outline-offset: 2px; }
.tc-dialog-btn.cancel {
  background: transparent; color: #4a4337; border-color: #d8d4c8;
}
.tc-dialog-btn.cancel:hover { background: rgba(20,17,13,.04); color: #14110d; }
.tc-dialog-btn.primary {
  background: #14110d; color: #faf6ee; border-color: #14110d;
}
.tc-dialog-btn.primary:hover { background: #c8451e; border-color: #c8451e; transform: translateY(-1px); }
.tc-dialog.is-danger .tc-dialog-btn.primary {
  background: #d4334b; border-color: #d4334b;
}
.tc-dialog.is-danger .tc-dialog-btn.primary:hover {
  background: #b8273a; border-color: #b8273a;
}

/* ── Dialog — dark theme ──────────────────────────────────────────────
   The base dialog above hardcodes cream paper (#faf6ee) + near-black ink,
   which rendered a bright cream card on the dark app. Remap every surface,
   text, border and the primary/cancel buttons to the dark token set. */
[data-theme="dark"] .tc-dialog-back { background: rgba(0, 0, 0, .68); }
[data-theme="dark"] .tc-dialog {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 48px rgba(0,0,0,.55), 0 4px 10px rgba(0,0,0,.40);
  border: 1px solid var(--border-2);
}
[data-theme="dark"] .tc-dialog-title { color: var(--text); }
[data-theme="dark"] .tc-dialog.is-danger .tc-dialog-title { color: var(--danger); }
[data-theme="dark"] .tc-dialog-msg { color: var(--text-2); }
[data-theme="dark"] .tc-dialog-input {
  background: var(--panel-2); color: var(--text);
  border-color: var(--border-2);
}
[data-theme="dark"] .tc-dialog-input:focus {
  border-color: var(--ink-warm);
  box-shadow: 0 0 0 3px var(--ink-warm-bg);
}
[data-theme="dark"] .tc-dialog-btn.cancel {
  color: var(--text-2); border-color: var(--border-2);
}
[data-theme="dark"] .tc-dialog-btn.cancel:hover {
  background: var(--panel-3); color: var(--text);
}
[data-theme="dark"] .tc-dialog-btn.primary {
  background: var(--text); color: var(--panel); border-color: var(--text);
}
[data-theme="dark"] .tc-dialog-btn.primary:hover {
  background: var(--ink-warm); color: #fff; border-color: var(--ink-warm);
}
[data-theme="dark"] .tc-dialog.is-danger .tc-dialog-btn.primary {
  background: var(--danger); color: #fff; border-color: var(--danger);
}

/* ── Page heads ──────────────────────────────────────────────────────
   Editorial polish for the in-app fintech overlay: kicker (.crumb) reads
   as a magazine dateline (Fraunces italic, warm orange), the headline
   keeps Inter for density but the "feature word" can opt into Fraunces
   italic via <span class="name">…</span>. A short warm-orange stripe
   under the bottom hairline ties this to the dashboard hero. */
[data-theme="light"] .page-head {
  border-bottom: 1px solid var(--fin-border);
  padding-bottom: 20px;
  margin-bottom: 24px;
  position: relative;
}
[data-theme="light"] .page-head::after {
  content: ''; position: absolute; left: 0; bottom: -1px;
  width: 64px; height: 2px; background: #c8451e;
  border-radius: 2px;
}
[data-theme="light"] .page-head .crumb {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 13.5px; color: #c8451e;
  letter-spacing: -0.005em; text-transform: none;
  margin-bottom: 8px;
}
[data-theme="light"] .page-head h1,
[data-theme="light"] .page-head .title h1 {
  font-family: 'Inter', sans-serif; font-weight: 600;
  font-size: clamp(26px, 2.8vw, 36px);
  line-height: 1.08; letter-spacing: -0.025em;
  color: var(--fin-text);
  margin: 0;
}
[data-theme="light"] .page-head h1 .name,
[data-theme="light"] .page-head h1 .ital,
[data-theme="light"] .page-head .title h1 .name,
[data-theme="light"] .page-head .title h1 .ital {
  font-family: var(--serif);
  font-style: italic; font-weight: 500;
  letter-spacing: -0.018em;
  color: #14110d;
  padding: 0 0.02em;
}

/* ── Section headers (used across pages: dashboard, settings tabs,
   trip view, etc.) ──────────────────────────────────────────────── */
[data-theme="light"] .ed-section-head {
  display: flex; align-items: baseline; gap: 14px;
  margin: 32px 0 14px;
  border-top: 1px solid var(--fin-border);
  padding-top: 18px;
}
[data-theme="light"] .ed-section-head:first-of-type {
  border-top: 0; padding-top: 0;
}
[data-theme="light"] .ed-section-head h2 {
  font-family: var(--serif); font-weight: 500; font-style: italic;
  font-size: 22px; line-height: 1.15; letter-spacing: -0.018em;
  color: var(--fin-text); margin: 0; flex: 1;
}
[data-theme="light"] .ed-section-head .meta {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px; color: var(--fin-text-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
}

/* ── Stat values — the printed-magazine numerals look anywhere
   .stat > .v shows up (board stats, per-page summaries, etc.) ───── */
[data-theme="light"] .stat .v {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1; letter-spacing: -0.025em;
  color: var(--fin-text);
}
[data-theme="light"] .stat .l {
  font-family: 'Inter', sans-serif;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  font-weight: 600; color: var(--fin-text-3);
}

/* ── Tabs — warm-orange active indicator instead of cold blue ── */
[data-theme="light"] .tabs .tab.active {
  color: var(--fin-text);
  border-bottom-color: #c8451e;
}
[data-theme="light"] .tabs .tab.active::after {
  background: #c8451e;
}

/* ── Pull quote / blockquote in body content (settings notes,
   admin tab descriptions, KB articles) ─────────────────────────── */
[data-theme="light"] .quiet-quote {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 16px; line-height: 1.55; color: var(--fin-text-2);
  border-left: 2px solid #c8451e;
  padding: 4px 0 4px 14px;
  margin: 12px 0;
}

/* ── Cards ───────────────────────────────────────────────── */
[data-theme="light"] .card {
  background: var(--fin-panel);
  border: 1px solid var(--fin-border);
  border-radius: 10px;
  box-shadow: none;
}
[data-theme="light"] .card.pad-lg { padding: 24px; }
[data-theme="light"] .card-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600; font-style: normal;
  font-size: 14px; color: var(--fin-text);
  letter-spacing: -0.01em;
}

/* ── Buttons ─────────────────────────────────────────────── */
[data-theme="light"] .btn {
  background: var(--fin-panel);
  color: var(--fin-text);
  border: 1px solid var(--fin-border);
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: -0.005em;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
  transition: background var(--dur-1), border-color var(--dur-1), box-shadow var(--dur-1);
}
[data-theme="light"] .btn:hover {
  background: var(--fin-panel-2);
  border-color: var(--fin-border-2);
}
[data-theme="light"] .btn.primary {
  background: var(--fin-text);
  color: var(--fin-panel);
  border-color: var(--fin-text);
  box-shadow: 0 1px 0 rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.08);
}
[data-theme="light"] .btn.primary:hover {
  background: #1f1f1f;
  border-color: #1f1f1f;
}
[data-theme="light"] .btn.ghost {
  background: transparent; border-color: transparent; box-shadow: none;
}
[data-theme="light"] .btn.ghost:hover {
  background: var(--fin-panel-2); border-color: var(--fin-border);
}
[data-theme="light"] .btn.danger {
  color: var(--fin-danger); border-color: var(--fin-border);
}
[data-theme="light"] .btn.danger:hover {
  background: rgba(212,51,75,.08); border-color: var(--fin-danger);
}

/* ── Inputs ──────────────────────────────────────────────── */
[data-theme="light"] .input,
[data-theme="light"] .select,
[data-theme="light"] .textarea {
  background: var(--fin-panel);
  color: var(--fin-text);
  border: 1px solid var(--fin-border);
  border-radius: 8px;
  font-size: 14px;
}
[data-theme="light"] .input:focus,
[data-theme="light"] .select:focus,
[data-theme="light"] .textarea:focus {
  border-color: var(--fin-text);
  box-shadow: 0 0 0 3px rgba(10,10,10,.06);
  outline: none;
}
[data-theme="light"] .label {
  font-size: 12.5px; color: var(--fin-text-2); font-weight: 500;
  letter-spacing: 0; text-transform: none;
}

/* ── Tabs (underline) ────────────────────────────────────── */
[data-theme="light"] .tabs {
  border-bottom: 1px solid var(--fin-border);
  background: transparent;
  padding: 0;
  border-radius: 0;
}
[data-theme="light"] .tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 9px 14px;
  margin-bottom: -1px;
  color: var(--fin-text-2);
  font-weight: 500;
  font-size: 13.5px;
}
[data-theme="light"] .tab:hover { color: var(--fin-text); background: transparent; }
[data-theme="light"] .tab.active {
  color: var(--fin-text);
  border-bottom-color: var(--fin-text);
  background: transparent;
  font-weight: 600;
}

/* ── Tables ──────────────────────────────────────────────── */
[data-theme="light"] .tbl {
  background: var(--fin-panel);
  border-radius: 10px;
  border: 1px solid var(--fin-border);
  overflow: hidden;
}
[data-theme="light"] .tbl thead th {
  background: var(--fin-panel);
  color: var(--fin-text-3);
  font-size: 12px; font-weight: 500;
  text-transform: none; letter-spacing: 0;
  border-bottom: 1px solid var(--fin-border);
}
[data-theme="light"] .tbl tbody td {
  border-bottom: 1px solid var(--fin-border);
  color: var(--fin-text-2);
  font-size: 13.5px;
}
[data-theme="light"] .tbl tbody tr:hover { background: var(--fin-panel-2); }
[data-theme="light"] .tbl tbody td b { color: var(--fin-text); font-weight: 600; }

/* ── Pills ──────────────────────────────────────────────── */
[data-theme="light"] .pill {
  background: var(--fin-panel-2);
  color: var(--fin-text-2);
  border: 1px solid var(--fin-border);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  padding: 2px 8px;
}
[data-theme="light"] .pill.lead    { background: rgba(196,122,0,.08); color: var(--fin-warning); border-color: rgba(196,122,0,.20); }
[data-theme="light"] .pill.quoted  { background: rgba(30,74,214,.08); color: var(--fin-accent-2); border-color: rgba(30,74,214,.20); }
[data-theme="light"] .pill.booked  { background: rgba(0,135,90,.08); color: var(--fin-success); border-color: rgba(0,135,90,.20); }
[data-theme="light"] .pill.traveled { background: rgba(91,33,182,.08); color: #5b21b6; border-color: rgba(91,33,182,.20); }
[data-theme="light"] .pill.cancelled { background: rgba(212,51,75,.08); color: var(--fin-danger); border-color: rgba(212,51,75,.20); }
[data-theme="light"] .pill.active  { background: rgba(0,135,90,.08); color: var(--fin-success); border-color: rgba(0,135,90,.20); }
[data-theme="light"] .pill.inactive { background: var(--fin-panel-2); color: var(--fin-text-3); }

/* ── Stat cards ─────────────────────────────────────────── */
[data-theme="light"] .stat {
  background: var(--fin-panel);
  border: 1px solid var(--fin-border);
  border-radius: 10px;
  padding: 18px 20px;
}
[data-theme="light"] .stat .l {
  font-size: 12.5px; color: var(--fin-text-3); font-weight: 500;
  text-transform: none; letter-spacing: 0;
  margin-bottom: 8px;
}
[data-theme="light"] .stat .v {
  font-family: 'Inter', sans-serif;
  font-style: normal; font-weight: 600;
  font-size: 28px; line-height: 1;
  letter-spacing: -0.03em;
  color: var(--fin-text);
  font-variant-numeric: tabular-nums;
}
[data-theme="light"] .stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  border: 0; background: transparent;
}
[data-theme="light"] .stat-row .stat {
  border: 1px solid var(--fin-border); border-radius: 10px;
  background: var(--fin-panel);
}

/* ── Empty states ───────────────────────────────────────── */
[data-theme="light"] .empty {
  background: var(--fin-panel);
  border: 1px dashed var(--fin-border);
  border-radius: 10px;
  text-align: center;
  padding: 48px 24px;
  color: var(--fin-text-3);
}
[data-theme="light"] .empty h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 600; font-style: normal;
  font-size: 16px;
  color: var(--fin-text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

/* ── Dialogs ────────────────────────────────────────────── */
[data-theme="light"] dialog {
  background: var(--fin-panel);
  border: 1px solid var(--fin-border);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0,0,0,.12);
}
[data-theme="light"] dialog .head {
  background: var(--fin-panel);
  border-bottom: 1px solid var(--fin-border);
  font-family: 'Inter', sans-serif;
  font-weight: 600; font-style: normal;
  font-size: 15px;
  color: var(--fin-text);
}
[data-theme="light"] dialog .foot {
  background: var(--fin-panel);
  border-top: 1px solid var(--fin-border);
}

/* ── Dimmed text ────────────────────────────────────────── */
[data-theme="light"] .dim { color: var(--fin-text-3); }
[data-theme="light"] .dim.small { color: var(--fin-text-3); }

/* ── Vault bar ──────────────────────────────────────────── */
[data-theme="light"] .vault-bar {
  background: var(--fin-panel);
  border: 1px solid var(--fin-border);
  color: var(--fin-text);
  border-radius: 8px;
}
[data-theme="light"] .vault-bar.locked {
  background: rgba(212,51,75,.04);
  border-color: rgba(212,51,75,.20);
  color: var(--fin-text);
}