/* Fonts ship with the app (SIL Open Font License): no internet needed, no flash of fallback text. */
@font-face { font-family: 'Inter'; src: url('/fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
/* ==========================================================================
   Design system — tokens first. Brand colour comes from Settings (--brand).
   ========================================================================== */
:root {
  --brand: #1a4632; --brand-fg: #fff; --sidebar: #0b1f17;
  --gold: #c9a55c; --gold-light: #e2c88d; /* the website's gold: used only to mark where you are */
  --brand-ink: var(--brand); /* brand used as text; lightened in dark mode */
  --brand-soft: color-mix(in srgb, var(--brand) 10%, transparent);
  --brand-softer: color-mix(in srgb, var(--brand) 6%, transparent);
  --brand-ring: color-mix(in srgb, var(--brand) 32%, transparent);
  --brand-hover: color-mix(in srgb, var(--brand) 88%, #000);

  /* Neutrals in the brand's family (the website's ivory / ink / stone), kept near-white so dense tables stay crisp. */
  --bg: #f7f6f2; --surface: #ffffff; --surface-2: #fbfaf7; --surface-3: #f3f1ec;
  --border: #e7e4dc; --border-strong: #d6d2c7;
  --text: #13261d; --text-2: #485048; --text-3: #5c645b; /* 5:1+ on every light surface */

  --success: #2e7d32; --success-soft: #e9f5e4; /* approved / paid: a different green from the brand, and badges carry a tick */
  --warning: #9a5106; --warning-soft: #fdf1df;
  --danger: #c0352b; --danger-soft: #fdebea;
  --info: #2457c5; --info-soft: #e7eefc;
  --neutral: #485048; --neutral-soft: #efede6;

  --radius-sm: 7px; --radius: 10px; --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(19, 38, 29, .05);
  --shadow-sm: 0 1px 3px rgba(19, 38, 29, .07), 0 1px 2px rgba(19, 38, 29, .04);
  --shadow-md: 0 6px 16px -4px rgba(19, 38, 29, .10), 0 2px 4px -2px rgba(19, 38, 29, .05);
  --shadow-lg: 0 24px 48px -12px rgba(19, 38, 29, .22), 0 8px 16px -8px rgba(19, 38, 29, .10);
  --display: 'Fraunces', Georgia, 'Times New Roman', serif; /* page titles, as on the website */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'SF Mono', Consolas, monospace;
  --sb-w: 252px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  /* Night in the sidebar's green-black, not blue-black, so the page and the sidebar read as one surface family. */
  --bg: #09110d; --surface: #0f1813; --surface-2: #121d17; --surface-3: #17241d;
  --border: #213128; --border-strong: #2d4036;
  --text: #e8ece8; --text-2: #a9b5ad; --text-3: #8d9a91;
  --success: #8bd47e; --success-soft: rgba(139, 212, 126, .13);
  --brand-ink: color-mix(in srgb, var(--brand) 50%, #fff);
  --warning: #f0a54a; --warning-soft: rgba(240, 165, 74, .13);
  --danger: #f2706a; --danger-soft: rgba(242, 112, 106, .13);
  --info: #7aa2ff; --info-soft: rgba(122, 162, 255, .13);
  --neutral: #a9b5ad; --neutral-soft: rgba(169, 181, 173, .12);
  --brand-soft: color-mix(in srgb, var(--brand) 20%, transparent);
  --brand-softer: color-mix(in srgb, var(--brand) 10%, transparent);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01', 'ss03'; text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; font-weight: 650; color: var(--text); }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; font-family: var(--display); font-weight: 500; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0 0 .5em; }
a { color: var(--brand-ink); text-decoration: none; }
@media (hover: hover) { a:hover { text-decoration: underline; text-underline-offset: 2px; } }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
kbd { font-family: var(--font); font-size: 12px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--text-3); box-shadow: 0 1px 0 var(--border); }
hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-ring); outline-offset: 2px; }
a, button, input, select, textarea, label, summary { touch-action: manipulation; } /* no 300 ms tap delay on phones */
h1, h2 { text-wrap: balance; }
.skip-link { position: fixed; left: 12px; top: -64px; z-index: 1000; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--brand); color: var(--brand-fg); font: inherit; font-weight: 600; border: 0; cursor: pointer; box-shadow: var(--shadow-md); }
.skip-link:focus { top: 12px; }
::selection { background: var(--brand-soft); }

.mono { font-family: var(--mono); font-size: .92em; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { display: block; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prewrap { white-space: pre-wrap; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.ic { flex-shrink: 0; }
.link { font-weight: 500; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  --sb-bg: var(--sidebar); --sb-fg: var(--text-2); --sb-strong: var(--text); --sb-hover: var(--surface-3);
  --sb-active-bg: var(--brand-soft); --sb-active-fg: var(--brand); --sb-border: var(--border); --sb-muted: var(--text-3);
  position: sticky; top: 0; height: 100vh; width: var(--sb-w); flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--sb-bg); border-right: 1px solid var(--sb-border); z-index: 40;
}
.sb-dark .sidebar { --sb-fg: rgba(255,255,255,.72); --sb-strong: #fff; --sb-hover: rgba(255,255,255,.08); --sb-active-bg: rgba(201,165,92,.16); --sb-active-fg: var(--gold-light); --sb-border: rgba(255,255,255,.08); --sb-muted: rgba(255,255,255,.6); }
[data-theme="dark"]:not(.sb-dark) .sidebar { --sb-bg: var(--surface); }
.sb-brand { padding: 18px 18px 12px; }
.sb-brand a { display: block; }
.brand-logo { display: block; max-width: 168px; max-height: 44px; object-fit: contain; }
.brand-logo.on-dark, [data-theme="dark"] .sb-brand .brand-logo, [data-theme="dark"] .topbar-brand .brand-logo, [data-theme="dark"] .auth-mobile-brand .brand-logo { background: #fff; padding: 6px 10px; border-radius: 9px; box-sizing: content-box; }
/* Default logo: full colour on light backgrounds, the ivory one-colour version on dark ones (as on the website). */
.brand-pair .logo-mono { display: none; }
.brand-pair img.brand-logo.brand-logo { background: none; padding: 0; }
.brand-pair.force-dark .logo-color, .sb-dark .sb-brand .brand-pair .logo-color, [data-theme="dark"] .brand-pair .logo-color { display: none; }
.brand-pair.force-dark .logo-mono, .sb-dark .sb-brand .brand-pair .logo-mono, [data-theme="dark"] .brand-pair .logo-mono { display: block; }
.brand-text { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; color: var(--sb-strong, var(--text)); }
.sb-search {
  margin: 4px 12px 8px; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--sb-border); background: transparent; color: var(--sb-muted); font: inherit; font-size: 13px; cursor: pointer; text-align: left;
}
.sb-search span { flex: 1; }
@media (hover: hover) { .sb-search:hover { background: var(--sb-hover); color: var(--sb-fg); } }
.sb-dark .sb-search kbd { background: transparent; border-color: rgba(255,255,255,.18); color: var(--sb-muted); box-shadow: none; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: thin; scrollbar-color: var(--sb-border) transparent; }
.sb-dark .sb-nav { scrollbar-color: rgba(255,255,255,.18) transparent; }
.sb-nav::-webkit-scrollbar { width: 8px; } .sb-nav::-webkit-scrollbar-track { background: transparent; }
.sb-nav::-webkit-scrollbar-thumb { background: var(--sb-border); border-radius: 8px; } .sb-dark .sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }
.sb-group { margin-top: 14px; }
.sb-group:first-child { margin-top: 4px; }
.sb-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sb-muted); padding: 0 10px 6px; }
.sb-nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--sb-fg);
  font-weight: 500; font-size: 13.5px; margin-bottom: 1px; transition: background .12s, color .12s;
}
@media (hover: hover) { .sb-nav a:hover { background: var(--sb-hover); color: var(--sb-strong); text-decoration: none; } }
.sb-nav a.active { background: var(--sb-active-bg); color: var(--sb-active-fg); font-weight: 600; }
.sb-nav a span:first-of-type { flex: 1; }
.sb-count { font-size: 12px; font-weight: 600; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 999px; background: var(--warning); color: #fff; }
.sb-foot { position: relative; padding: 10px; border-top: 1px solid var(--sb-border); }
.sb-user { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); background: transparent; border: 0; cursor: pointer; text-align: left; color: var(--sb-muted); font: inherit; }
@media (hover: hover) { .sb-user:hover { background: var(--sb-hover); } }
.sb-user-text { flex: 1; min-width: 0; }
.sb-user-text b { display: block; font-size: 13px; color: var(--sb-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-text small { display: block; font-size: 12px; color: var(--sb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; left: 10px; right: 10px; bottom: calc(100% - 4px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; animation: pop .14s var(--ease); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
@media (hover: hover) { .menu a:hover, .menu button:hover { background: var(--surface-3); text-decoration: none; } }
.menu .danger { color: var(--danger); }
.menu-foot { font-size: 12px; color: var(--text-3); padding: 6px 10px 2px; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; gap: 6px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid transparent; }
.topbar-brand .brand-logo { max-height: 30px; max-width: 130px; }
.content { width: 100%; max-width: 1320px; margin: 0 auto; padding: 8px 32px 64px; outline: none; animation: fade .18s var(--ease); }
.mobile-only { display: none !important; }
.sb-overlay { display: none; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-2); cursor: pointer; flex-shrink: 0; }
.icon-btn:active { transform: scale(.94); }
@media (hover: hover) { .icon-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; } }
@media (hover: hover) { .icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); } }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- page header ---------- */
.page-head { margin: 8px 0 22px; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.crumbs a { color: var(--text-2); }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { min-width: 0; }
.page-title h1 { display: inline-flex; align-items: center; gap: 12px; vertical-align: middle; }
.page-title > .badge { margin-left: 10px; vertical-align: middle; }
.page-title p { margin: 6px 0 0; color: var(--text-2); max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.title-with-avatar { display: inline-flex; align-items: center; gap: 12px; }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 550; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs);
  transition: background .12s, border-color .12s, box-shadow .12s, transform .12s var(--ease);
}
@media (hover: hover) { .btn:hover { background: var(--surface-3); text-decoration: none; } }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); border-color: var(--brand-ink); color: var(--brand-fg); box-shadow: 0 1px 2px rgba(19,38,29,.12), inset 0 1px 0 rgba(255,255,255,.12); }
@media (hover: hover) { .btn.primary:hover { background: var(--brand-hover); } }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
@media (hover: hover) { .btn.success:hover { filter: brightness(.94); } }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
@media (hover: hover) { .btn.danger:hover { filter: brightness(.94); } }
.btn.danger-soft { background: var(--danger-soft); border-color: transparent; color: var(--danger); box-shadow: none; }
@media (hover: hover) { .btn.danger-soft:hover { filter: brightness(.97); } }
.btn.ghost { background: var(--surface); }
.btn.ghost.danger { background: var(--surface); color: var(--danger); border-color: var(--border); }
@media (hover: hover) { .btn.ghost.danger:hover { background: var(--danger-soft); border-color: transparent; } }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn.lg { height: 42px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.busy { color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ''; position: absolute; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--text-3) transparent var(--text-3) transparent; animation: spin .7s linear infinite; }
.btn.primary.busy::after, .btn.success.busy::after, .btn.danger.busy::after { border-color: #fff transparent #fff transparent; }
.icon-btn.busy { opacity: .5; pointer-events: none; }

/* ---------- badges & tags ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--neutral-soft); color: var(--neutral); }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge.muted { background: var(--neutral-soft); color: var(--text-3); text-decoration: line-through; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 12px; font-weight: 550; background: var(--neutral-soft); color: var(--neutral); white-space: nowrap; vertical-align: middle; }
.tag.warning { background: var(--warning-soft); color: var(--warning); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.success { background: var(--success-soft); color: var(--success); }
.tag.brand { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- avatar ---------- */
.avatar { display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 50%; font-weight: 600; letter-spacing: .02em; color: hsl(var(--h) 60% 26%); background: hsl(var(--h) 70% 92%); }
[data-theme="dark"] .avatar { color: hsl(var(--h) 70% 80%); background: hsl(var(--h) 35% 22%); }
.cell-user { display: flex; align-items: center; gap: 10px; }

/* ---------- cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); margin-bottom: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-body { padding: 16px 18px; }
.card.flush > .card-body { padding: 0; }
.card-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2 > *, .grid-2-1 > * { min-width: 0; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-xs); color: inherit; min-width: 0; }
.kpi.link { transition: border-color .15s, box-shadow .15s, transform .15s; }
@media (hover: hover) { .kpi.link:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); } }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.kpi-value { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-hint { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.kpi-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--neutral-soft); color: var(--neutral); flex-shrink: 0; }
.kpi-ic.lg { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 14px; }
.kpi-ic.success { background: var(--success-soft); color: var(--success); }
.kpi-ic.warning { background: var(--warning-soft); color: var(--warning); }
.kpi-ic.danger { background: var(--danger-soft); color: var(--danger); }
.kpi-ic.info { background: var(--info-soft); color: var(--info); }
.kpi-ic.brand { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- tables ---------- */
.tbl-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tbl-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-3); width: min(340px, 100%); transition: border-color .12s, box-shadow .12s; }
.search:focus-within { border-color: var(--brand-ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font: inherit; color: var(--text); padding: 0; height: 100%; box-shadow: none; }
.tbl-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 12px; font-weight: 550; color: var(--text-2); padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
.table th.sortable { cursor: pointer; }
@media (hover: hover) { .table th.sortable:hover { color: var(--text); } }
.table th .sort-ic { opacity: 0; margin-left: 3px; vertical-align: -2px; transition: transform .15s; }
@media (hover: hover) { .table th.sortable:hover .sort-ic { opacity: .4; } }
.table th.sorted .sort-ic { opacity: 1; }
.table th.sorted.asc .sort-ic { transform: rotate(180deg); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
@media (hover: hover) { .table tr.click:hover td { background: var(--brand-softer); } }
.table tr.click:focus-visible { outline: 2px solid var(--brand-ring); outline-offset: -2px; }
/* Wide lists (bookings): the name keeps room, the detail line is shorter, cells are a little tighter so the Status column stays in view at 1440. */
.table.dense td, .table.dense th { padding-left: 10px; padding-right: 10px; }
.table.dense td.bk-cust { min-width: 12rem; }
.table.dense .ellipsis { max-width: 20ch; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions .btn + .btn { margin-left: 6px; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.tbl-none { text-align: center; color: var(--text-3); padding: 32px !important; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12.5px; }
.card-body > .tbl:only-child .tbl-bar { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

/* ---------- tabs, chips, filters ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
@media (hover: hover) { .tab:hover { color: var(--text); text-decoration: none; } }
.tab.active { color: var(--text); border-bottom-color: var(--brand-ink); font-weight: 600; }
.tab-count { font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); line-height: 18px; }
.tab.active .tab-count { background: var(--brand-soft); color: var(--brand-ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-filter { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; }
@media (hover: hover) { .chip-filter:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); } }
.chip-filter.active { background: var(--text); color: var(--surface); border-color: var(--text); }
select.sm { height: 30px; padding: 0 28px 0 10px; font-size: 12.5px; width: auto; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid > .span-2, .form-grid > div.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 0; }
.sheet-body > .field, .card-body > .field, .form-section + .field { margin-top: 14px; }
.card-body > .field:first-of-type { margin-top: 0; }
.field-label { font-size: 13px; font-weight: 550; color: var(--text); }
.req { color: var(--danger); font-style: normal; margin-left: 2px; }
.hint { font-size: 12px; color: var(--text-3); display: block; }
input, select, textarea {
  width: 100%; height: 38px; padding: 0 11px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 80px; line-height: 1.5; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
@media (hover: hover) { input:hover, select:hover, textarea:hover { border-color: var(--text-3); } }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-ink); box-shadow: 0 0 0 3px var(--brand-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
input[type="color"] { padding: 3px; width: 46px; height: 38px; cursor: pointer; }
input[type="file"] { height: auto; padding: 0; border: 0; box-shadow: none; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--brand-ink); box-shadow: none; margin: 0; }
.input-affix { display: flex; align-items: stretch; }
.input-affix span { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--surface-3); color: var(--text-2); font-size: 13px; font-weight: 500; }
.input-affix input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.form-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.form-section h3 { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 12px; color: var(--text); }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; font-weight: 500; margin-bottom: 14px; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.inline-field input { height: 32px; width: auto; font-size: 13px; }
.color-field { display: flex; align-items: center; gap: 10px; }
.switch { appearance: none; width: 38px !important; height: 22px !important; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; flex-shrink: 0; border: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s var(--ease); }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(16px); }
.switch-row { display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; cursor: pointer; }
.switch-row p { margin: 2px 0 0; }

/* choice cards (voucher type) */
.choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.choice { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice b { display: block; font-size: 13px; }
.choice small { display: block; font-size: 12px; color: var(--text-3); line-height: 1.35; }
.choice-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); }
@media (hover: hover) { .choice:hover { border-color: var(--text-3); } }
.choice:has(input:checked) { border-color: var(--brand-ink); background: var(--brand-softer); box-shadow: 0 0 0 3px var(--brand-soft); }
.choice:has(input:checked) .choice-ic { background: var(--brand); color: var(--brand-fg); }
.choice:has(input:focus-visible) { outline: 2px solid var(--brand-ring); outline-offset: 2px; }
.posting-preview, .margin-preview { margin-top: 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); }
.margin-preview:empty { display: none; }
.margin-preview { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.margin-preview b { font-size: 16px; }
.pp-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.posting-preview table { width: 100%; font-size: 13px; border-collapse: collapse; }
.posting-preview th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 3px 0; }
.posting-preview td { padding: 4px 0; border-top: 1px solid var(--border); }
.posting-preview .num { text-align: right; font-variant-numeric: tabular-nums; }

/* upload */
.uploader { display: flex; gap: 10px; align-items: stretch; margin-bottom: 14px; }
.dropzone { position: relative; flex: 1; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-2); font-size: 13px; cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone:focus-within { border-color: var(--brand-ink); background: var(--brand-softer); }
@media (hover: hover) { .dropzone:hover { border-color: var(--brand-ink); background: var(--brand-softer); } }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.uploader .btn { align-self: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- lists ---------- */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 24px; margin: 0; }
.dl div { min-width: 0; }
.dl dt { font-size: 12px; color: var(--text-3); font-weight: 500; margin-bottom: 3px; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.amount-lg { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.desc { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-2); }
.list { list-style: none; margin: -6px -8px; padding: 0; }
.list li > a, .list li > .li-static { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: var(--radius-sm); color: inherit; }
@media (hover: hover) { .list li > a:hover { background: var(--surface-3); text-decoration: none; } }
.list li > button.link-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
@media (hover: hover) { .list li > button.link-row:hover { background: var(--surface-3); } }
.link-btn { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
.dept-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.visa-facts { margin-bottom: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.nowrap, td.mono { white-space: nowrap; }
.pb-h { font-size: 14px; margin: 18px 0 8px; display: flex; gap: 10px; align-items: baseline; }
.pb-line { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: var(--surface); }
.pb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pb-grid .span-2 { grid-column: span 2; }
.pb-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; min-height: 22px; }
.pb-shapes label { cursor: pointer; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; }
#marketPreview:not(:empty) { margin-top: 14px; }
.pb-total { flex-wrap: wrap; }
.choice small { display: block; font-size: 12px; }
@media (max-width: 700px) { .pb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.date-chip { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-ink); font-size: 12px; font-weight: 600; line-height: 1.1; flex-shrink: 0; text-transform: uppercase; }
.date-chip b { font-size: 16px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); flex-shrink: 0; }
.feed time { white-space: nowrap; }
.doc-list, .notif-list, .request-list, .period-list { list-style: none; margin: 0; padding: 0; }
.doc-list li, .notif-list li, .request-list li, .period-list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.doc-list li { padding: 10px 0; }
.doc-list li:last-child, .notif-list li:last-child, .request-list li:last-child, .period-list li:last-child { border-bottom: 0; }
.notif-list li.unread { background: var(--brand-softer); }
.notif-list li.unread .grow > div:first-child { font-weight: 600; }
.file-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--info-soft); color: var(--info); flex-shrink: 0; }
.acct-list { list-style: none; margin: 0; padding: 0; }
.acct-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.acct-list li:last-child { border-bottom: 0; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checklist a { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); color: inherit; }
@media (hover: hover) { .checklist a:hover { border-color: var(--brand-ink); background: var(--brand-softer); text-decoration: none; } }
.checklist p { margin: 0; font-size: 12.5px; color: var(--text-2); }
.checklist div { flex: 1; }
.checklist-edit { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.checklist-edit li { padding: 6px 0; }
.add-row { display: flex; gap: 8px; }
.add-row input { height: 32px; font-size: 13px; }
.bars { list-style: none; margin: 0; padding: 0; }
.bars a { display: flex; align-items: center; gap: 12px; padding: 7px 0; color: inherit; }
@media (hover: hover) { .bars a:hover { text-decoration: none; } }
.bars .grow { flex: 0 0 190px; }
.bar-track { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.progress { display: inline-block; width: 56px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.progress span { display: block; height: 100%; background: var(--success); border-radius: 99px; }
.profile { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile p { margin: 0; }
.logo-row { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.logo-row .btn { margin-right: 6px; }
.logo-preview { width: 150px; height: 64px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius); background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface) 0 50%) 50% / 14px 14px; padding: 8px; flex-shrink: 0; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- callouts, empty states ---------- */
.callout { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid transparent; background: var(--info-soft); color: var(--info); }
.callout .ic { margin-top: 1px; }
.callout-text { flex: 1; min-width: 0; color: var(--text); }
.callout-text b { font-weight: 600; }
.callout-text p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.callout > .btn, .callout > span { align-self: center; }
.callout.success { background: var(--success-soft); color: var(--success); }
.callout.warning { background: var(--warning-soft); color: var(--warning); }
.callout.danger { background: var(--danger-soft); color: var(--danger); }
.callout.neutral { background: var(--neutral-soft); color: var(--neutral); }
.callout.small { padding: 10px 12px; font-size: 13px; }
.empty { text-align: center; padding: 48px 24px; }
.empty-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--surface-3); color: var(--text-2); margin-bottom: 14px; }
.empty h2, .empty h3 { font-size: 15px; margin-bottom: 4px; }
.empty p { color: var(--text-2); max-width: 42ch; margin: 0 auto 16px; font-size: 13.5px; }
.card-body > .empty { padding: 32px 12px; }

/* ---------- stepper & timeline ---------- */
.stepper { display: flex; list-style: none; margin: 0; padding: 0; gap: 0; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--text-3); font-weight: 500; font-size: 13px; position: relative; }
.stepper li:not(:last-child)::after { content: ''; flex: 1; height: 2px; background: var(--border); margin: 0 12px; border-radius: 2px; }
.stepper li.done:not(:last-child)::after { background: var(--success); }
.step-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); font-size: 12px; font-weight: 600; flex-shrink: 0; background: var(--surface); }
.stepper li.done { color: var(--text); }
.stepper li.done .step-dot { background: var(--success); border-color: var(--success); color: #fff; }
.stepper li.current { color: var(--text); font-weight: 600; }
.stepper li.current .step-dot { border-color: var(--brand-ink); color: var(--brand-ink); box-shadow: 0 0 0 4px var(--brand-soft); }
.stepper li.failed { color: var(--danger); font-weight: 600; }
.stepper li.failed .step-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.step-label { white-space: nowrap; }
@media (max-width: 640px) {
  .stepper li:not(.current) .step-label { display: none; }
  .stepper li:not(:last-child)::after { margin: 0 6px; }
}
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.timeline li:not(:last-child)::before { content: ''; position: absolute; left: 4px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); margin-top: 5px; flex-shrink: 0; box-shadow: 0 0 0 3px var(--surface); }
.tl-dot.success { background: var(--success); } .tl-dot.danger { background: var(--danger); } .tl-dot.warning { background: var(--warning); } .tl-dot.brand { background: var(--brand); } .tl-dot.muted { background: var(--border-strong); }
.tl-body { min-width: 0; font-size: 13px; }
.tl-detail { color: var(--text-2); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.tl-body time { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- chart ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .axis { fill: var(--text-3); font-size: 12px; font-family: var(--font); }
.chart .bar { transition: opacity .15s; }
@media (hover: hover) { .chart .bar:hover { opacity: .8; } }
.chart .s0, .legend i.s0 { fill: var(--brand); background: var(--brand); }
.chart .s1, .legend i.s1 { fill: color-mix(in srgb, var(--warning) 70%, var(--surface)); background: color-mix(in srgb, var(--warning) 70%, var(--surface)); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- visas / packages ---------- */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.pipe { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit; position: relative; box-shadow: var(--shadow-xs); }
@media (hover: hover) { .pipe:hover { text-decoration: none; border-color: var(--border-strong); } }
.pipe.active { border-color: var(--brand-ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.pipe-count { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pipe-label { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.pkg { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); transition: box-shadow .15s, border-color .15s; }
@media (hover: hover) { .pkg:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); } }
.pkg.expired { opacity: .7; }
.pkg header { display: flex; align-items: center; gap: 6px; }
.pkg header .icon-btn { margin-left: auto; width: 30px; height: 30px; }
.pkg h2, .pkg h3 { font-size: 16px; }
.pkg p { font-size: 13px; margin: 0; flex: 1; }
.pkg details { font-size: 13px; }
.pkg summary { cursor: pointer; color: var(--brand-ink); font-weight: 500; }
.itinerary { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); }
.itinerary li { padding: 2px 0; }
.pkg footer { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.pkg-price { font-size: 18px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.report-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------- sheet (side panel) ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 100; }
.sheet-overlay { position: absolute; inset: 0; background: rgba(9, 17, 13, .38); opacity: 0; transition: opacity .2s; backdrop-filter: blur(1px); }
.sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .24s var(--ease); }
.sheet.wide { width: min(660px, 100%); }
.sheet-root.open .sheet-overlay { opacity: 1; }
.sheet-root.open .sheet { transform: none; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.sheet-head h2 { font-size: 17px; }
.sheet-head p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ---------- modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; }
.modal-overlay { position: absolute; inset: 0; background: rgba(9, 17, 13, .45); opacity: 0; transition: opacity .15s; }
.modal { position: relative; width: min(440px, 100%); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px; transform: scale(.96) translateY(6px); opacity: 0; transition: transform .16s var(--ease), opacity .16s; }
.modal-root.open .modal-overlay { opacity: 1; }
.modal-root.open .modal { transform: none; opacity: 1; }
.modal h2 { font-size: 16px; margin: 12px 0 6px; }
.modal p { color: var(--text-2); font-size: 13.5px; margin: 0 0 14px; }
.modal .field { margin-bottom: 4px; }
.modal-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); }
.modal-ic.danger { background: var(--danger-soft); color: var(--danger); }
.modal-ic.success { background: var(--success-soft); color: var(--success); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 11px 14px; border-radius: var(--radius); background: #111827; color: #f9fafb; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); cursor: pointer; transform: translateY(10px); opacity: 0; transition: transform .2s var(--ease), opacity .2s; }
[data-theme="dark"] .toast { background: #f3f4f6; color: #111827; }
.toast.in { transform: none; opacity: 1; }
.toast.success .ic { color: #34d399; } .toast.error .ic { color: #f87171; } .toast.info .ic { color: #93c5fd; }
[data-theme="dark"] .toast.success .ic { color: var(--success); }

/* ---------- command palette ---------- */
.palette-root { position: fixed; inset: 0; z-index: 250; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette-overlay { position: absolute; inset: 0; background: rgba(9, 17, 13, .42); animation: fade .12s; }
.palette { position: relative; width: min(620px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .15s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.palette-input input { border: 0; box-shadow: none; height: 52px; font-size: 15px; padding: 0; background: transparent; }
.palette-input input:focus { box-shadow: none; }
.palette-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.palette-group { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.palette-item.active { background: var(--brand-soft); }
@media (hover: hover) { .palette-item:hover { background: var(--brand-soft); } }
.palette-item .ic { color: var(--text-2); }
.palette-empty { padding: 28px; text-align: center; color: var(--text-3); }

/* ---------- auth ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); min-height: 100vh; }
.auth.single { grid-template-columns: 1fr; }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; color: #fff;
  background: radial-gradient(1200px 600px at 0% 0%, color-mix(in srgb, var(--brand) 70%, #fff) 0%, transparent 55%), linear-gradient(150deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 55%, #050b18) 100%); }
.auth-art::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(to bottom, transparent, #000 40%, transparent); pointer-events: none; }
.auth-art > * { position: relative; z-index: 1; }
.auth-brand .brand-logo { max-height: 52px; max-width: 220px; }
.auth-brand .brand-text { color: #fff; font-size: 22px; }
.auth-pitch h2 { color: #fff; font-size: 34px; line-height: 1.15; letter-spacing: -0.03em; max-width: 16ch; margin-bottom: 26px; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.auth-pitch li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: rgba(255,255,255,.88); }
.auth-pitch li span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.14); }
.auth-foot { font-size: 13px; color: rgba(255,255,255,.7); }
.auth-main { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.auth-card { width: min(380px, 100%); }
.auth-card h1 { font-size: 26px; margin-bottom: 4px; }
.auth-card > p.muted { margin-bottom: 26px; }
.auth-form { display: grid; gap: 16px; }
.auth-form .form-error { margin: 0; }
.auth-switch { margin-top: 22px; text-align: center; font-size: 13.5px; color: var(--text-2); }
.auth-switch a { display: inline-flex; align-items: center; gap: 4px; font-weight: 550; }
.auth-mobile-brand { display: none; margin-bottom: 28px; }
.auth-mobile-brand.show { display: block; }
.auth-mobile-brand .brand-logo { max-height: 44px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 42px; }
.pw-wrap .icon-btn { position: absolute; right: 3px; top: 2px; }

/* ---------- skeleton ---------- */
.skel { background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
.skel-page { padding-top: 8px; }
.skel.h1 { height: 30px; width: 280px; margin: 8px 0 26px; }
.skel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.skel.box { height: 104px; border-radius: var(--radius-lg); }
.skel.big { height: 320px; border-radius: var(--radius-lg); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .grid-2-1, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 8px 22px 56px; }
  .hide-md { display: none; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .24s var(--ease); box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .sb-overlay { display: block; position: fixed; inset: 0; background: rgba(9, 17, 13, .4); z-index: 35; }
  .mobile-only { display: inline-grid !important; }
  .topbar-brand.mobile-only { display: block !important; }
  .topbar { padding: 0 12px; border-bottom-color: var(--border); background: var(--surface); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-mobile-brand { display: block; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checklist { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .content { padding: 4px 16px 48px; }
  h1 { font-size: 21px; }
  .page-head-row { align-items: stretch; flex-direction: column; }
  .page-actions .btn { flex: 1; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 19px; }
  .kpi-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid.three > :last-child:nth-child(odd) { grid-column: span 2; }
  .hide-sm { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > .span-2, .form-grid > div.span-2 { grid-column: auto; }
  .checklist-edit { grid-template-columns: 1fr; }
  .stepper .step-label { display: none; }
  .stepper li.current .step-label, .stepper li.failed .step-label { display: inline; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bars .grow { flex-basis: 140px; }
  .uploader { flex-direction: column; }
  .table td, .table th { padding: 10px 12px; }
  /* Lists that opt in (table cfg stack) become one card per row on a phone: reference and amount on top, then the details. */
  .table.stack, .table.stack tbody { display: block; }
  .table.stack thead { display: none; }
  .table.stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table.stack tr:last-child { border-bottom: 0; }
  .table.stack td { display: block; padding: 0; border: 0; grid-column: 1 / -1; min-width: 0; }
  .table.stack td:first-child { grid-column: 1; grid-row: 1; }
  .table.stack td.hide-sm { display: none; }
  .table.stack td.num { grid-column: 2; grid-row: 1; }
  .table.stack td.num ~ td.num { grid-column: 1 / -1; grid-row: auto; text-align: left; }
  .table.stack td.num ~ td.num::before { content: attr(data-label) ': '; color: var(--text-3); font-weight: 400; }
  .table.stack tr.click:active td { background: var(--brand-softer); }
  .table.stack td.tbl-none { grid-column: 1 / -1; grid-row: auto; }
  .ellipsis { max-width: 22ch; }
  .search { width: 100%; }
  .tbl-tools { width: 100%; }
  #toasts { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .sheet-head, .sheet-body, .sheet-foot { padding-left: 18px; padding-right: 18px; }
  .sheet-foot .btn { flex: 1; }
}


/* ---------- v2: action center, threads, cash, public pages ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.alert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 16px; }
.alert-grid.compact { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.alert-card { --sev: var(--info); background: var(--surface); border: 1px solid color-mix(in srgb, var(--sev) 32%, var(--border)); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow-xs); }
.alert-card.danger { --sev: var(--danger); } .alert-card.warning { --sev: var(--warning); }
.alert-card header { display: flex; gap: 12px; align-items: flex-start; }
.alert-card h2, .alert-card h3 { font-size: 14px; }
.alert-card p { margin: 2px 0 0; color: var(--text-2); font-size: 12.5px; }
.alert-count { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.alert-card ul { list-style: none; margin: 10px -6px 4px; padding: 0; }
.alert-card li a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; padding: 7px 6px; min-height: 44px; border-radius: 6px; color: var(--text); font-size: 13px; line-height: 1.35; }
.alert-card li a > .grow { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 550; }
.alert-card li a > svg { grid-column: 2; grid-row: 1 / span 2; color: var(--text-3); }
@media (hover: hover) { .alert-card li a:hover { background: var(--surface-3); text-decoration: none; } }
.alert-card li .muted { grid-column: 1; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-tools { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.thread { list-style: none; margin: 0; padding: 0; }
.thread li { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.thread li.ho { background: var(--brand-softer); }
.thread li.internal { background: var(--warning-soft); }
.thread-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; font-size: 13px; }
.thread-meta time { margin-left: auto; }
.note-form { padding: 14px 16px; }
.note-form textarea { min-height: 64px; }
.note-form-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.inst-list { list-style: none; margin: 0 0 10px; padding: 0; }
.inst-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.inst-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.choice-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.variance { min-height: 24px; margin: 10px 0 4px; }
.card-body > .field + .field, .card-body > .field + .variance + .field { margin-top: 14px; }
.group-card { color: inherit; }
@media (hover: hover) { .group-card:hover { text-decoration: none; } }
.group-card footer { align-items: center; }
.auth-public { display: flex; justify-content: center; gap: 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; }
.auth-public a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; }
.public { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(900px 400px at 50% -10%, var(--brand-soft), transparent 70%), var(--bg); }
.public-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; flex-wrap: wrap; }
.public-head .brand-logo { max-height: 42px; }
.public-head nav { display: flex; gap: 18px; font-size: 13.5px; font-weight: 500; }
.public-head nav a { color: var(--text-2); }
.public-main { flex: 1; display: grid; place-items: start center; padding: 24px 16px 48px; }
.public-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; box-shadow: var(--shadow-md); }
.public-card.wide { width: min(640px, 100%); }
.public-card h1 { margin-bottom: 4px; }
.public-card > p.muted { margin-bottom: 20px; }
.public-foot { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 20px; }
.verify-result { display: flex; gap: 14px; margin-top: 20px; padding: 16px; border-radius: var(--radius); background: var(--info-soft); color: var(--info); }
.verify-result > div { flex: 1; color: var(--text); }
.verify-result.success { background: var(--success-soft); color: var(--success); }
.verify-result.danger { background: var(--danger-soft); color: var(--danger); }
.verify-result.warning { background: var(--warning-soft); color: var(--warning); }
.verify-result .dl { margin-top: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.track { margin-top: 22px; }
.track-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.track h3 { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.track .acct-list li { gap: 12px; }
@media (max-width: 860px) { .choice-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .alert-grid, .alert-grid.compact { grid-template-columns: 1fr; } .public-head { padding: 14px 16px; } .public-card { padding: 20px; } .verify-result .dl { grid-template-columns: 1fr; } }


/* ---------- v2.1: price list, products ---------- */
.choice-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.choice-grid.six .choice { padding: 10px; align-items: center; text-align: center; }
.hotel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.hotel-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.hotel-card.expired { opacity: .6; }
.hotel-card header { display: flex; gap: 8px; align-items: flex-start; }
.hotel-card h3 { font-size: 15px; }
.hotel-card p { margin: 0; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.hotel-card > .btn { align-self: flex-start; }
.stars { color: #e0a100; letter-spacing: 1px; margin-left: 4px; }
.rate-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rate-table th { text-align: left; font-size: 12px; font-weight: 550; color: var(--text-3); padding: 4px 0; border-bottom: 1px solid var(--border); }
.rate-table td { padding: 7px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.rate-table .num { text-align: right; }
.rate-table .actions { text-align: right; width: 32px; }
.rate-table .icon-btn { width: 26px; height: 26px; }
@media (max-width: 860px) { .choice-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ==========================================================================
   Print — A4 documents (quotation, invoice, receipt, statement, reports)
   ========================================================================== */
#print { display: none; }
@page { size: A4; margin: 14mm; }
@media print {
  body { background: #fff; color: #111; font-size: 11pt; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; }
  .doc { position: relative; font-family: var(--font); color: #111; }
  .doc-watermark { position: fixed; top: 40%; left: 0; right: 0; text-align: center; font-size: 64pt; font-weight: 800; color: rgba(200, 30, 30, .12); transform: rotate(-24deg); letter-spacing: .06em; }
  .doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid #111; }
  .doc-brand img { max-height: 54px; max-width: 220px; display: block; margin-bottom: 8px; }
  .doc-name { font-size: 20pt; font-weight: 700; }
  .doc-branch { font-size: 9.5pt; color: #444; line-height: 1.45; }
  .doc-title { text-align: right; }
  .doc-title h1 { font-size: 20pt; letter-spacing: .02em; text-transform: uppercase; margin-bottom: 8px; color: #111; }
  .doc-title p { color: #444; margin: 0; }
  .doc-title table { margin-left: auto; font-size: 10pt; border-collapse: collapse; }
  .doc-title td { padding: 1px 0 1px 14px; }
  .doc-title td:first-child { color: #666; }
  .doc-party { margin: 22px 0 6px; font-size: 10pt; line-height: 1.5; }
  .doc-label { font-size: 8.5pt; text-transform: uppercase; letter-spacing: .08em; color: #666; margin-bottom: 2px; }
  .doc-party-name { font-size: 13pt; font-weight: 650; }
  .doc-meta { margin: 14px 0; font-size: 10pt; border-collapse: collapse; }
  .doc-meta td { padding: 3px 24px 3px 0; }
  .doc-meta td:first-child { color: #666; }
  .doc-lines { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 10pt; }
  .doc-lines th { text-align: left; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .06em; color: #555; border-bottom: 1.5px solid #111; padding: 7px 6px; }
  .doc-lines td { padding: 8px 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
  .doc-lines .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .doc-lines tfoot td { font-weight: 700; font-size: 12pt; border-top: 2px solid #111; border-bottom: 0; padding-top: 10px; }
  .doc-words { margin-top: 14px; font-size: 10pt; }
  .doc-words span { color: #666; }
  .doc-note { margin-top: 18px; font-size: 9pt; color: #555; }
  .doc-sign { display: flex; justify-content: space-between; gap: 40px; margin-top: 64px; font-size: 9.5pt; color: #444; }
  .doc-sign div { flex: 1; max-width: 220px; }
  .doc-sign span { display: block; border-top: 1px solid #111; margin-bottom: 6px; }
  .doc-verify { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 22px; padding: 12px 14px; border: 1.5px dashed #111; border-radius: 6px; font-size: 9.5pt; }
  .doc-qr { flex: 0 0 29mm; display: block; color: #000; }
  .doc-qr svg { width: 29mm; height: 29mm; display: block; }
  .doc-verify-link { overflow-wrap: anywhere; color: #111; font-size: 8pt; }
  .doc-status { padding: 7px 10px; border: 1px solid #555; font-weight: 700; font-size: 10pt; }
  .doc-verify, .doc-sign, .doc-party, .doc-status, .doc-lines tr { break-inside: avoid; }
  .doc-lines thead { display: table-header-group; }
  .doc-lines tfoot { display: table-row-group; }
  .doc-lines td:first-child, .doc-meta td, .doc-sign b { overflow-wrap: anywhere; }
  .doc-sign { margin-top: 30px; gap: 20px; }
  .doc-sign b { color: #111; }
  .doc-code { font-family: var(--mono); font-size: 16pt; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
  .doc-meta .prewrap { white-space: pre-wrap; }
  .doc-foot { margin-top: 36px; padding-top: 10px; border-top: 1px solid #ddd; font-size: 8pt; color: #888; text-align: center; }
}

/* journal vouchers, balance sheet, bank reconciliation (v3.0) */
.inline-field select { height: 32px; width: auto; font-size: 13px; }
.jv-lines { margin-top: 14px; }
.jv-lines td { padding: 4px 6px; vertical-align: middle; }
.jv-lines select, .jv-lines input { width: 100%; min-width: 7.5rem; height: 34px; font-size: 13px; }
.jv-lines td:first-child select { min-width: 12rem; }
.jv-lines input.num { text-align: right; min-width: 6.5rem; }
.jv-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.jv-paste { margin-top: 6px; font-size: 13px; }
.jv-paste summary { cursor: pointer; color: var(--text-2); font-weight: 500; }
.jv-paste textarea { width: 100%; font-family: ui-monospace, monospace; font-size: 12.5px; margin: 6px 0; }
.acct-list li.acct-total { border-top: 2px solid var(--border-strong); border-bottom: 0; }
.rec-table input[type=checkbox] { width: 18px; height: 18px; vertical-align: middle; }

/* credit limit (v3.2) */
.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.credit-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.credit-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 10px 0 6px; }
.credit-bar span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.credit-bar.warning span { background: var(--warning); } .credit-bar.danger span { background: var(--danger); } .credit-bar.info span { background: var(--info); }

/* ---------- leads pipeline ---------- */
.board-tools { border: 0; padding: 0 0 12px; justify-content: flex-start; align-items: center; }
.board { display: grid; grid-template-columns: repeat(5, minmax(196px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; scroll-snap-type: x proximity; }
.board-col { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px; min-width: 0; scroll-snap-align: start; }
.board-col > header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 4px 10px; }
.board-col > header .muted { flex-basis: 100%; }
.board-cards { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.board-empty { padding: 8px 4px; margin: 0; }
.lead-card { display: flex; flex-direction: column; gap: 7px; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 11px; cursor: pointer; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
@media (hover: hover) { .lead-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); } }
.lead-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lead-top { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.lead-top b { overflow-wrap: anywhere; }
.lead-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.lead-foot { display: flex; align-items: center; gap: 6px; }
.grow-r { margin-left: auto; }
.lead-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sheet-h3 { font-size: 13px; font-weight: 600; margin: 20px 0 10px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 640px) { .board { grid-template-columns: repeat(5, 82vw); } }

/* ---------- accessibility pass (WCAG 2.2 AA, measured by scripts/ui-check.mjs) ---------- */
/* Filled success / danger buttons and counts on the light dark-mode tones need dark text. */
[data-theme="dark"] .btn.success:not(.ghost), [data-theme="dark"] .btn.danger:not(.ghost), [data-theme="dark"] .sb-count { color: #09110d; }
.dropzone small { font-size: 12px; }
/* Phones and tablets: 16px fields so iOS does not zoom in; 44px controls (38px for compact ones); links big enough to tap. */
@media (max-width: 860px) {
  /* !important: compact table / toolbar fields set their own size, but on a phone 16px and 44px are the floor */
  input, select, textarea { font-size: 16px !important; }
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), select { min-height: 44px !important; }
  input[type=color] { height: 44px; width: 52px; }
  input[type=file] { min-height: 44px; }
  .search { height: 44px; }
  .search input { min-height: 0 !important; } /* the 44px box around it is the target */
  .btn { height: 44px; }
  .btn.sm { height: 38px; padding: 0 12px; font-size: 13.5px; }
  .icon-btn { width: 40px !important; height: 40px !important; }
  .crumbs a, .link.small, .card-head a, .public-head a, .section-head a { display: inline-block; padding: 6px 0; }
}

input.cust-search { width: 100%; margin-bottom: 6px; }

/* Optional parts of a long form, collapsed until needed */
details.more { margin-top: 14px; }
details.more > summary { cursor: pointer; font-weight: 550; font-size: 13.5px; color: var(--text-2); padding: 8px 0; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .12s var(--ease); }
details.more[open] > summary::before { transform: rotate(45deg); }
details.more > summary:focus-visible { outline: 2px solid var(--brand-ring); outline-offset: 2px; border-radius: 6px; }
details.more > summary h3 { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
details.more > .form-grid { margin-top: 4px; }

.draft-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--brand-softer); font-size: 13px; color: var(--text-2); }
.draft-note span { display: inline-flex; align-items: center; gap: 6px; }

/* One authored moment: the dashboard's summary and attention cards settle in, once, in sequence. Skipped for reduced motion. */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .kpi-grid > .kpi, .alert-grid > .alert-card { animation: rise .28s var(--ease) both; }
  .kpi-grid > :nth-child(2), .alert-grid > :nth-child(2) { animation-delay: 40ms; }
  .kpi-grid > :nth-child(3), .alert-grid > :nth-child(3) { animation-delay: 80ms; }
  .kpi-grid > :nth-child(n+4), .alert-grid > :nth-child(n+4) { animation-delay: 120ms; }
}

/* Refund status lines stay readable inside a scrolling table (tablet widths); phones stack the row instead. */
.refund-lines { min-width: 15rem; }
@media (max-width: 640px) { .refund-lines { min-width: 0; } }

.rec-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.table td.rec-wide { min-width: 14rem; }
.table td.rec-mid { min-width: 9rem; }
@media (max-width: 640px) { .table td.rec-wide, .table td.rec-mid { min-width: 0; } }
