/* Ang Systems CRM v2. Data-dense dashboard: slate navy sidebar, pale slate
   workspace, one blue accent for actions, muted status colours, tabular
   numbers. The logo supplies the brand red. */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --text-3: #475569;
  --text-4: #64748b;

  --accent: #0369a1;
  --accent-hover: #075985;
  --accent-soft: #e0f2fe;
  --primary: #0369a1;
  --primary-hover: #075985;
  --on-primary: #f8fbff;
  --ink-inverse: #f8fafc;
  --brand-red: #e0453a;
  --whatsapp: #0f7a40;
  --whatsapp-hover: #0b6634;
  --border-hover: #94a3b8;
  --row-hover: #f8fafc;
  --row-muted: #fcfcfd;
  --toast-bg: #0f172a;
  --toast-text: #f8fafc;

  --side-bg: #0f172a;
  --side-text: #cbd5e1;
  --side-dim: #94a3b8;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(255, 255, 255, .1);

  --green: #047857;  --green-bg: #ecfdf5;  --green-dot: #10b981;
  --amber: #b45309;  --amber-bg: #fffbeb;  --amber-dot: #f59e0b;
  --red: #b91c1c;    --red-bg: #fef2f2;    --red-dot: #ef4444;
  --grey: #475569;   --grey-bg: #f1f5f9;   --grey-dot: #94a3b8;
  /* Prospects are orange. */
  --orange: #c2410c; --orange-bg: #fff4ea; --orange-dot: #f97316;
  /* Lead and Prospect pages are tinted; a Client's page isn't. */
  --lead-tint: #eef5fb; --lead-line: #bfdbf2;
  --prospect-tint: #fdf5ee; --prospect-line: #f6d2b3;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18);
  --sidebar-w: 232px;
  --ease: 150ms ease;

  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}


/* Dark theme: chosen under Settings → Appearance and applied by js/boot.js
   before the page draws. The sidebar is dark in both themes. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --surface: #121a2b;
  --surface-2: #162033;
  --surface-3: #1c2740;
  --border: #243049;
  --border-strong: #334155;
  --border-hover: #475569;
  --text: #e2e8f0;
  --text-2: #cbd5e1;
  --text-3: #a3b1c6;
  --text-4: #8b9ab1;

  --accent: #7dd3fc;
  --accent-hover: #bae6fd;
  --accent-soft: rgba(56, 189, 248, .14);
  --primary: #0369a1;
  --primary-hover: #0284c7;
  --whatsapp: #34d399;
  --whatsapp-hover: #6ee7b7;
  --row-hover: #172136;
  --row-muted: #141d30;
  --toast-bg: #e2e8f0;
  --toast-text: #0b1120;

  --side-bg: #060b16;

  --green: #6ee7b7;  --green-bg: rgba(16, 185, 129, .15);  --green-dot: #34d399;
  --amber: #fcd34d;  --amber-bg: rgba(245, 158, 11, .15);  --amber-dot: #fbbf24;
  --red: #fca5a5;    --red-bg: rgba(239, 68, 68, .16);     --red-dot: #f87171;
  --grey: #a3b1c6;   --grey-bg: rgba(148, 163, 184, .14); --grey-dot: #64748b;
  --orange: #fdba74; --orange-bg: rgba(249, 115, 22, .15); --orange-dot: #fb923c;
  --lead-tint: #0c1829; --lead-line: #1e3a56;
  --prospect-tint: #1a130d; --prospect-line: #4a2c14;

  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
}

/* Controls a role can't use are hidden (the server refuses them anyway). */
:root:not([data-perms~="hotels.edit"]) [data-need~="hotels.edit"],
:root:not([data-perms~="hotels.delete"]) [data-need~="hotels.delete"],
:root:not([data-perms~="finance.view"]) [data-need~="finance.view"],
:root:not([data-perms~="finance.edit"]) [data-need~="finance.edit"],
:root:not([data-perms~="sales.view"]) [data-need~="sales.view"],
:root:not([data-perms~="sales.edit"]) [data-need~="sales.edit"],
:root:not([data-perms~="onboarding.view"]) [data-need~="onboarding.view"],
:root:not([data-perms~="onboarding.edit"]) [data-need~="onboarding.edit"],
:root:not([data-perms~="data.transfer"]) [data-need~="data.transfer"],
:root:not([data-perms~="staff.manage"]) [data-need~="staff.manage"],
:root:not([data-perms~="settings.manage"]) [data-need~="settings.manage"],
:root:not([data-perms~="map.view"]) [data-need~="map.view"],
:root:not([data-perms~="ai.ask"]) [data-need~="ai.ask"],
:root:not([data-perms~="trash.manage"]) [data-need~="trash.manage"],
:root:not([data-perms~="report.view"]) [data-need~="report.view"],
:root:not([data-perms~="totals.view"]) [data-need~="totals.view"],
:root:not([data-perms~="history.view"]) [data-need~="history.view"],
:root:not([data-perms~="vault.view"]) [data-need~="vault.view"],
:root:not([data-perms~="vault.edit"]) [data-need~="vault.edit"] { display: none !important; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); min-height: 100vh; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, [role="button"], label.chip { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--accent); }

svg {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------- sidebar */

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--side-bg); color: var(--side-text);
  padding: 20px 12px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 0 0 10px; color: var(--ink-inverse); font-weight: 700; font-size: 13px; letter-spacing: .05em; }
.brand-name { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.brand-name small { margin-top: 2px; font-size: 11px; font-weight: 500; letter-spacing: .02em; color: var(--side-dim); }
.login-brand .brand-name small { color: var(--text-4); }
.collapse-btn {
  display: grid; place-items: center; width: 32px; height: 32px; margin-left: auto; border: 0; border-radius: 6px;
  background: none; color: var(--side-dim); transition: background var(--ease), color var(--ease);
}
.collapse-btn:hover { background: var(--side-hover); color: var(--ink-inverse); }

.brand img { border-radius: 7px; }
.nav-label { margin: 28px 10px 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--side-dim); }
nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--side-text); text-decoration: none; font-weight: 500;
  transition: background var(--ease), color var(--ease);
}
.nav-item svg { width: 18px; height: 18px; color: var(--side-dim); transition: color var(--ease); }
.nav-item:hover { background: var(--side-hover); color: var(--ink-inverse); }
.nav-item.active { background: rgba(255, 255, 255, .12); color: var(--ink-inverse); font-weight: 600; }
.nav-item.active svg { color: #f87171; }

.sidebar-user { margin-top: auto; padding: 12px 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.user-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: #334155; color: var(--ink-inverse); font-size: 12px; font-weight: 600;
}
.user-text { min-width: 0; }
.user-name { color: var(--ink-inverse); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 12px; color: var(--side-dim); }
.user-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin-top: 8px; margin-left: -8px; }
.side-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: none;
  color: var(--side-text); font-size: 12px; transition: background var(--ease), color var(--ease);
}
.side-link svg { width: 14px; height: 14px; color: var(--side-dim); }
.side-link:hover svg { color: var(--ink-inverse); }
.side-link:hover { background: var(--side-hover); color: var(--ink-inverse); }
.sidebar-foot { padding: 4px 10px 0; font-size: 11px; color: var(--side-dim); }

/* ------------------------------------------------------------------ main */

.main { margin-left: var(--sidebar-w); padding: 28px 32px 56px; }
.page { max-width: 1320px; margin: 0 auto; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.page-sub { margin-top: 2px; color: var(--text-3); }
.today {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-weight: 500; white-space: nowrap;
}
.today svg { color: var(--text-4); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ------------------------------------------------------------------ KPIs */

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; padding: 16px 18px; min-height: 140px; }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--text-3); }
.kpi-value { margin-top: 6px; font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-note { margin-top: 6px; color: var(--text-3); }
.kpi-value.late { color: var(--red); }
.kpi-value.soon { color: var(--amber); }
.kpi-split { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 16px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
  transition: border-color var(--ease), background var(--ease);
}
.chip:hover { border-color: var(--border-strong); background: var(--surface-2); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-green { background: var(--green-dot); }
.dot-grey { background: var(--grey-dot); }
.dot-orange { background: var(--orange-dot); }
.dot-blue { background: var(--accent); }

/* Hotel tags: Client (billed), Prospect, Lead. */
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tag-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-active { background: var(--green-bg); color: var(--green); }
.tag-inactive { background: var(--orange-bg); color: var(--orange); }
.tag-terminated { background: var(--grey-bg); color: var(--grey); }
.tag-lead { background: var(--accent-soft); color: var(--accent); }

.accounts { width: 100%; margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.accounts th, .accounts td { padding: 7px 0; border-bottom: 1px solid var(--surface-3); text-align: left; white-space: nowrap; }
.accounts tr:last-child th, .accounts tr:last-child td { border-bottom: 0; }
.accounts th { font-weight: 500; color: var(--text-2); }
.accounts .amt { text-align: right; font-weight: 600; font-size: 15px; }
.accounts .cnt { width: 1%; padding-left: 16px; text-align: right; color: var(--text-4); font-size: 12px; }
.accounts .total th, .accounts .total .amt { color: var(--text); font-weight: 600; }

.kpi-link {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: auto;
  min-height: 32px; padding: 0 2px; border: 0; background: none;
  color: var(--accent); font-weight: 600;
}
.kpi-link:hover { text-decoration: underline; }

/* ------------------------------------------------------------- buttons */

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.btn svg { color: var(--text-4); }
.btn:hover { background: var(--surface-2); border-color: var(--border-hover); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary svg { color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-whatsapp { color: var(--whatsapp); }
.btn-whatsapp svg { color: var(--whatsapp); }
.btn-quiet { border-color: transparent; background: none; }
.btn-quiet:hover { border-color: transparent; background: var(--surface-3); }
.btn-danger { color: var(--red); }
.btn-danger:hover { color: var(--red); background: var(--red-bg); }
.btn:disabled { opacity: .55; cursor: default; }

/* ----------------------------------------------------------- directory */

.directory { overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 16px; padding: 16px 20px; }
.card-head h2 { font-size: 16px; font-weight: 600; }
.card-sub { color: var(--text-4); font-size: 13px; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px;
  padding: 10px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.filters { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.filters button {
  min-height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: none;
  color: var(--text-3); font-size: 13px; font-weight: 500; transition: background var(--ease), color var(--ease);
}
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

.search { position: relative; display: flex; align-items: center; width: min(320px, 100%); }
.search svg { position: absolute; left: 10px; color: var(--text-4); pointer-events: none; }
.search input {
  width: 100%; min-height: 34px; padding: 0 12px 0 32px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

/* relative keeps the screen-reader-only labels inside the scroll area,
   otherwise they widen the whole page on a phone. */
.table-wrap { position: relative; overflow-x: auto; border-top: 1px solid var(--border); }
.table { width: 100%; min-width: 560px; border-collapse: collapse; }
/* Narrow screens scroll the directory sideways instead of squashing it. */
.table.hotels { min-width: 980px; }
.table th {
  padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--text-3);
}
.table th.num { text-align: right; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table th button {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; transition: color var(--ease);
}
.table th button:hover { color: var(--text); }
.table th button::after { content: ""; display: inline-block; width: 10px; color: var(--accent); }
.table th[aria-sort="ascending"] button, .table th[aria-sort="descending"] button { color: var(--text); }
.table th[aria-sort="ascending"] button::after { content: "↑"; }
.table th[aria-sort="descending"] button::after { content: "↓"; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--surface-3); color: var(--text-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--ease); }
.table tbody tr:hover td { background: var(--row-hover); }
.blank, .table .blank { color: var(--text-4); }
.table .sub { display: block; font-size: 12px; color: var(--text-4); }
.table td.num .sub { white-space: nowrap; }
.table .money { font-weight: 600; color: var(--text); }

.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500; text-align: left; text-decoration: none; }
.link:hover { text-decoration: underline; }
.row-title { color: var(--text); font-weight: 600; text-decoration: none; }
.row-title:hover { color: var(--accent); text-decoration: none; }
.tag { margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--grey-bg); color: var(--grey); font-size: 11px; font-weight: 600; }
.col-action { width: 1%; text-align: right; white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-grey { background: var(--grey-bg); color: var(--grey); }
.badge-none { background: none; color: var(--text-4); padding-left: 0; }
.badge-none::before { display: none; }

.empty-row td { padding: 40px 20px !important; text-align: center; color: var(--text-4); }
.footnote { margin: 12px 4px 0; font-size: 12px; color: var(--text-4); }
.footnote a { color: inherit; }
.empty { padding: 32px; color: var(--text-3); }

/* ------------------------------------------------------------ dialogs */

.dialog {
  width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); color: var(--text);
}
.dialog::backdrop { background: rgba(15, 23, 42, .5); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--text-4); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 18px 20px 4px; }
/* Fields fill their column and may shrink with it rather than overflow. */
.form-grid :is(input:not([type="checkbox"]), select, textarea), .password-field { width: 100%; min-width: 0; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.form-grid .span-2 { grid-column: span 2; }
.form-section { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-4); }
.form-section:not(:first-child) { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--surface-3); }
.form-grid input:not([type="checkbox"]), .form-grid select {
  min-height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 14px; font-weight: 400; color: var(--text); transition: border-color var(--ease);
}
.form-grid input:hover, .form-grid select:hover { border-color: var(--border-hover); }
.form-grid input:focus, .form-grid select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.form-grid input[aria-invalid="true"] { border-color: var(--red); }
.form-grid select:disabled { background: var(--surface-3); color: var(--text-4); }
.form-note { font-size: 13px; color: var(--text-3); }
.password-field { position: relative; display: flex; }
.password-field input { flex: 1; min-width: 0; padding-right: 42px !important; }
.eye {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 6px;
  background: none; color: var(--text-4); transition: background var(--ease), color var(--ease);
}
.eye:hover { background: var(--surface-3); color: var(--text); }
.notice { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber); font-size: 13px; font-weight: 500; }
.form-note:empty { display: none; }

.form-error { margin: 12px 20px 0; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--red-bg); color: var(--red); font-size: 13px; }
.dialog-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.grow { flex: 1; }

.import-body { padding: 16px 20px 0; }
.dim { color: var(--text-4); font-size: 13px; }
.report-group { margin-top: 12px; }
.report-group h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.report-group ul { margin: 0; padding: 8px 12px 8px 28px; max-height: 150px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; color: var(--text-3); }
.report-problems h3 { color: var(--red); }
.report-similar h3 { color: var(--amber); }
.check { flex-direction: row !important; display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 13px; font-weight: 400 !important; color: var(--text-3); }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }

/* ------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--toast-bg); color: var(--toast-text); font-size: 14px; box-shadow: var(--shadow-lg);
}
.toast.error { background: var(--red); }

/* ------------------------------------------------------------- login */

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: var(--side-bg); }
.login-card { width: min(400px, 100%); padding: 28px 28px 24px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; font-weight: 700; font-size: 14px; letter-spacing: .06em; }
.login-brand img { border-radius: 8px; }
.login-card h1 { font-size: 20px; }
.login-sub { margin-top: 2px; color: var(--text-3); }
.login-form { grid-template-columns: 1fr; padding: 20px 0 0; }
.login-form .form-error { margin: 0; }
.idle-notice { margin-top: 18px; }
.login-form .btn { min-height: 42px; margin-top: 4px; }
.login-help { margin-top: 16px; font-size: 13px; color: var(--text-4); }

/* -------------------------------------------------------- long forms */

.dialog-wide { width: min(760px, calc(100vw - 32px)); }
.dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.dialog-body { overflow-y: auto; }
fieldset { min-width: 0; margin: 0; border: 0; }
fieldset.form-grid { padding-top: 16px; }
fieldset + fieldset { border-top: 1px solid var(--surface-3); }
legend.form-section { float: left; width: 100%; grid-column: 1 / -1; margin: 0; padding: 0; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid textarea {
  padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  font: inherit; font-size: 14px; font-weight: 400; color: var(--text); resize: vertical;
}
.form-grid textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

/* --------------------------------------------------------- hotel page */

.back { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; color: var(--accent); font-weight: 500; text-decoration: none; }
.back:hover { text-decoration: underline; }
.eyebrow { margin-top: 12px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.profile-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin: 4px 0 20px; }
.profile-head h1 { font-size: 28px; }
.profile-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* The tag, dealer and onboarding badges sit right beside the hotel's name;
   rooms and the PMS with its hotel code go on the line underneath. */
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.profile-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 6px 0 4px; }
.fact {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 13px;
}
.fact strong { font-weight: 600; color: var(--text); }
.fact-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); }
.fact-pms { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); background: var(--accent-soft); }
.renew-note { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }
.renew-note svg { width: 13px; height: 13px; }
.avatar.small.renewal { background: var(--accent-soft); color: var(--accent); }
.avatar.small.renewal svg { width: 14px; height: 14px; }
.badge-blue { background: var(--accent-soft); color: var(--accent); text-decoration: none; }

.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.profile-card .card-head { border-bottom: 1px solid var(--border); }
.actions-inline { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }

.tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tabs [role="tab"] {
  flex: 1; min-height: 34px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none;
  color: var(--text-3); font-weight: 500; transition: background var(--ease), color var(--ease);
}
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow); }
.tab-panel { padding: 8px 20px 16px; }

.kv-list { margin: 0; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--surface-3); }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--text-4); }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.kv a { text-decoration: none; }
.kv a:hover { text-decoration: underline; }
/* A phone number with its WhatsApp button at the far end of the row. */
.phone-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.phone-line .icon-link { flex: none; }
.kv:has(.phone-line) { align-items: center; }
.pre { white-space: pre-wrap; }
.person { padding-top: 8px; }
.person + .person { margin-top: 4px; border-top: 1px solid var(--border); }
.person h3 { margin: 6px 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 44px 24px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border-radius: 50%; background: var(--surface-3); color: var(--text-4); }
.empty-icon svg { width: 20px; height: 20px; }
.empty-title { font-weight: 600; color: var(--text); }

.timeline { margin: 0; padding: 4px 20px 8px; list-style: none; max-height: 520px; overflow-y: auto; }
.entry { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--surface-3); }
.entry:last-child { border-bottom: 0; }
.entry-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text-3); }
.entry-call, .entry-whatsapp { background: var(--green-bg); color: var(--green); }
.entry-email { background: var(--accent-soft); color: var(--accent); }
.entry-meeting, .entry-visit { background: var(--amber-bg); color: var(--amber); }
.entry-meta { color: var(--text-2); }
.entry-note { margin-top: 2px; white-space: pre-wrap; color: var(--text); overflow-wrap: anywhere; }
.entry-follow { margin-top: 6px; font-size: 13px; color: var(--text-3); }
.entry .icon-btn { width: 28px; height: 28px; opacity: .6; }
.entry .icon-btn:hover { opacity: 1; }

.payments-card { overflow: hidden; }
.total-due { display: grid; justify-items: end; line-height: 1.3; text-align: right; }
.total-due strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.total-due.late strong { color: var(--red); }
.total-due .dim { font-size: 12px; }
.table tr.unpaid td { background: var(--row-muted); }

/* ------------------------------------------------------------- boards */

.page-wide { max-width: 1600px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 14px 16px; }
.stat-value { margin-top: 2px; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }

.board {
  display: grid; grid-template-columns: repeat(var(--columns), minmax(172px, 1fr)); gap: 12px;
  align-items: start; overflow-x: auto; padding-bottom: 8px;
}
.column {
  display: flex; flex-direction: column; min-height: 240px; padding: 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-3); transition: border-color var(--ease), background var(--ease);
}
.column.drop { border-color: var(--accent); background: var(--accent-soft); }
/* Each stage has its own colour, the same on both boards. */
.column { border-top: 3px solid var(--stage, var(--border-strong)); }
.column[data-stage="contacted"], .column[data-stage="setup"] { --stage: #0284c7; }
.column[data-stage="proposal"] { --stage: #7c3aed; }
.column[data-stage="negotiation"], .column[data-stage="training"] { --stage: #d97706; }
.column[data-stage="won"], .column[data-stage="live"] { --stage: #059669; }
.column[data-stage="lost"] { --stage: #dc2626; }
.column-head h2::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%;
  background: var(--stage, var(--grey-dot)); vertical-align: 1px;
}
.column-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 8px; }
.column-head h2 { font-size: 13px; font-weight: 600; color: var(--text-2); }
.count {
  min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  text-align: center; font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.column-sub { margin: -4px 4px 8px; font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.column-cards { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.column-empty {
  display: grid; place-items: center; flex: 1; min-height: 72px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--text-3);
}

.kcard {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 8px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); cursor: grab;
  transition: box-shadow var(--ease), border-color var(--ease), opacity var(--ease);
}
.kcard:hover { border-color: var(--border-strong); box-shadow: 0 2px 8px rgba(15, 23, 42, .08); }
.kcard.dragging { opacity: .45; }
.kcard-title { font-weight: 600; color: var(--text); text-decoration: none; text-align: left; overflow-wrap: anywhere; }
.kcard-title:hover { color: var(--accent); text-decoration: underline; }
.kcard-meta { font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.kcard-meta strong { color: var(--text); font-variant-numeric: tabular-nums; }
.kcard-client { align-self: flex-start; margin-top: 4px; text-decoration: none; }
.kcard .btn-small { align-self: flex-start; margin-top: 6px; }
.kcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.kcard-age { font-size: 12px; color: var(--text-4); }
.kcard-moves { display: inline-flex; gap: 2px; }
.icon-btn.small { width: 28px; height: 28px; }
.btn-small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-small svg { width: 14px; height: 14px; }

/* --------------------------------------------------- collapsed sidebar */

@media (min-width: 861px) {
  :root[data-sidebar="collapsed"] { --sidebar-w: 68px; }
  :root[data-sidebar="collapsed"] .sidebar { padding-left: 10px; padding-right: 10px; }
  :root[data-sidebar="collapsed"] .brand { flex-direction: column; gap: 14px; padding: 0; }
  :root[data-sidebar="collapsed"] .collapse-btn { margin: 0; }
  /* Labels are hidden from sight but still read out by screen readers. */
  :root[data-sidebar="collapsed"] :is(.brand-name, .nav-item span, .side-link span, .user-text) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  :root[data-sidebar="collapsed"] .nav-label { height: 1px; margin: 20px 6px 12px; overflow: hidden; background: rgba(255, 255, 255, .08); color: transparent; }
  :root[data-sidebar="collapsed"] .nav-item { justify-content: center; padding: 0; }
  :root[data-sidebar="collapsed"] .nav-item .nav-badge {
    position: absolute; top: 3px; right: 5px; width: auto; height: auto; min-width: 16px; padding: 0 4px;
    overflow: visible; clip: auto; font-size: 10px;
  }
  :root[data-sidebar="collapsed"] .sidebar-user { padding: 12px 0 0; }
  :root[data-sidebar="collapsed"] .user-row { justify-content: center; }
  :root[data-sidebar="collapsed"] .user-actions { flex-direction: column; align-items: center; margin: 8px 0 0; }
  :root[data-sidebar="collapsed"] .side-link { width: 40px; min-height: 36px; justify-content: center; padding: 0; }
  :root[data-sidebar="collapsed"] .side-link svg { width: 16px; height: 16px; }
  :root[data-sidebar="collapsed"] .sidebar-foot { display: none; }
}

/* ---------------------------------------------------- hotel form page */

.form-page-head {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 12px 16px; margin-bottom: 16px; padding: 4px 0 14px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.form-page-head h1 { margin-top: 2px; }
.form-page-head .form-error { margin: 0; }
#hotel-form > .form-error { margin: 0 0 16px; }
.form-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.form-card { padding: 16px 18px 18px; }
.form-card h2 { font-size: 15px; font-weight: 600; }
.form-card .form-grid { gap: 10px 12px; padding: 12px 0 0; }
.form-card fieldset.form-grid { padding-top: 12px; }
.form-card fieldset + fieldset { margin-top: 12px; }
.form-card .form-grid input:not([type="checkbox"]), .form-card .form-grid select { min-height: 36px; }
.form-card .form-grid label { font-size: 12px; }
.form-card .remarks { margin-top: 14px; border-top: 1px solid var(--surface-3); }
.fee-note { grid-column: 1 / -1; }

/* ------------------------------------------------------------ support */

.support-toolbar { border-top: 0; }
.support-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters [role="tab"][aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.select-inline select {
  min-height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 13px;
}
.support-count { padding: 12px 20px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-4); }
.log-group { padding: 0 20px; }
.log-group-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 16px 0 8px;
  border-bottom: 1px solid var(--border); background: var(--surface);
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
}
#support-list .timeline { max-height: none; overflow: visible; padding: 0; }
#support-list .entry { grid-template-columns: 32px minmax(0, 1fr); }
.entry-hotel { font-weight: 600; color: var(--text); text-decoration: none; }
.entry-hotel:hover { color: var(--accent); text-decoration: underline; }
.entry-sub { margin-top: 4px; font-size: 12px; color: var(--text-4); }
.more-row { padding: 12px 20px 18px; text-align: center; }

/* ------------------------------------------------------ icons & links */

svg.filled { fill: currentColor; stroke: none; }
.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.contact-icons { display: inline-flex; gap: 6px; }
.icon-link {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-3);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.icon-link svg { width: 15px; height: 15px; }
.icon-link:hover { border-color: var(--border-strong); color: var(--text); }
.icon-link.call:hover { background: var(--accent-soft); color: var(--accent); }
.icon-link.whatsapp { color: var(--whatsapp); }
.icon-link.whatsapp:hover { background: var(--green-bg); }
.icon-link.map { width: 26px; height: 26px; border-color: transparent; background: none; color: var(--text-4); }
.icon-link.map:hover { color: var(--accent); background: var(--accent-soft); }
.kv a svg { width: 13px; height: 13px; vertical-align: -2px; }
.kcard.readonly { cursor: default; }
.center { text-align: center !important; }
.small { font-size: 12px; }

/* --------------------------------------------------- roles and permissions */

.roles-card { margin-top: 16px; }
.roles-card .card-head { border-bottom: 1px solid var(--border); }
.roles-body { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 8px 24px; padding: 16px 20px 20px; }
.roles-body .table-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); }

.role-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--grey-bg); color: var(--grey);
}
.role-super_admin { background: rgba(224, 69, 58, .12); color: #b42318; }
.role-admin { background: var(--accent-soft); color: var(--accent); }
.role-staff { background: var(--green-bg); color: var(--green); }
.role-support { background: var(--amber-bg); color: var(--amber); }
:root[data-theme="dark"] .role-super_admin { background: rgba(248, 113, 113, .16); color: #fca5a5; }

.tree, .tree ul { margin: 0; padding: 0; list-style: none; }
.tree ul { margin-left: 14px; padding-left: 18px; border-left: 2px solid var(--border); }
.tree li { position: relative; padding-top: 10px; }
.tree ul > li::before {
  content: ""; position: absolute; left: -18px; top: 26px; width: 14px; border-top: 2px solid var(--border);
}
.tree ul > li:last-child::after {
  /* stop the vertical line at the last branch */
  content: ""; position: absolute; left: -20px; top: 28px; bottom: 0; width: 2px; background: var(--surface);
}
.tree-node {
  display: block; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--surface-3); color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background-color .15s ease-out, border-color .15s ease-out, opacity .15s ease-out;
}
.tree-node:hover { border-color: var(--border-hover); }
.tree-node[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.roles-body.is-focused .tree-node:not([aria-pressed="true"]) { opacity: .6; }
.roles-body.is-focused .tree-node:not([aria-pressed="true"]):hover { opacity: 1; }
.tree-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.tree-title .dim { color: var(--text-3); }
.tree-summary { display: block; margin-top: 4px; font-size: 12px; color: var(--text-3); }
.tree-node[aria-pressed="true"] .tree-summary { color: var(--text-2); }

.roles-detail { min-width: 0; }
.permissions-table thead th { white-space: normal; vertical-align: bottom; }
.permissions-table thead th:first-child, .permissions-table th[scope="row"] { width: 38%; min-width: 220px; }
.permissions-table thead th:not(:first-child), .permissions-table td { padding-left: 4px; padding-right: 4px; }
.pm-role {
  padding: 3px 6px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; line-height: 1.3; cursor: pointer;
}
.pm-role:hover { background: var(--surface-3); color: var(--text); }

.role-focus { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px 14px; animation: rf-in .18s cubic-bezier(.25, 1, .5, 1); }
@keyframes rf-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .role-focus { animation: none; } }
.rf-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rf-head .role-badge { font-size: 13px; padding: 3px 11px; }
.rf-count { font-size: 13px; color: var(--text-3); }
.rf-count strong { color: var(--text); font-size: 15px; }
.rf-summary { margin-top: 8px; font-size: 13px; color: var(--text-2); max-width: 70ch; }
.rf-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 20px; }
.rf-list li, .rf-assigns { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--surface-3); font-size: 13px; line-height: 1.45; }
.rf-assigns { margin-top: 6px; font-weight: 600; }
.role-focus .tick { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--green); stroke-width: 2.5; }
.rf-none { margin-top: 14px; font-size: 13px; color: var(--text-3); }
.rf-hint { margin-top: 10px; font-size: 12px; color: var(--text-3); }

.permissions-table { min-width: 620px; }
.permissions-table th[scope="row"] { font-weight: 500; color: var(--text-2); white-space: normal; background: none; border-bottom: 1px solid var(--surface-3); font-size: 13px; }
.permissions-table td { padding: 8px 10px; }
.permissions-table .tick { width: 16px; height: 16px; color: var(--green); stroke-width: 2.5; }

/* ------------------------------------------------- scheduled WhatsApp */

.nav-badge {
  margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px;
  background: #c8372d; color: var(--ink-inverse); font-size: 11px; font-weight: 700; text-align: center;
}
.btn-whatsapp-solid { background: #0f7a40; border-color: #0f7a40; color: var(--ink-inverse); }
.btn-whatsapp-solid svg { color: var(--ink-inverse); }
.btn-whatsapp-solid:hover { background: #0b6634; border-color: #0b6634; color: var(--ink-inverse); }

.messages-panel { margin-bottom: 20px; overflow: hidden; }
.messages-panel .card-head { border-bottom: 1px solid var(--border); }
.msg-list { margin: 0; padding: 0; list-style: none; }
.msg {
  display: grid; grid-template-columns: minmax(170px, auto) minmax(0, 1fr) auto; gap: 6px 16px; align-items: start;
  padding: 12px 20px; border-bottom: 1px solid var(--surface-3);
}
.msg:last-child { border-bottom: 0; }
.msg.due { background: var(--red-bg); }
.msg-when { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.msg-rel { font-size: 12px; }
.msg-meta { color: var(--text-2); }
.msg-text {
  margin-top: 2px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.msg-actions { display: flex; gap: 6px; }
.msg-more { padding: 10px 20px; text-align: center; }
.scheduled-block { padding: 4px 0 8px; border-bottom: 1px solid var(--border); }
.scheduled-block .msg { grid-template-columns: minmax(0, 1fr); padding: 10px 20px; }
.scheduled-block .msg-when { flex-direction: row; align-items: center; }
.block-title {
  display: flex; align-items: center; gap: 8px; margin: 12px 20px 4px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
}
#support-list .msg-list { margin: 0 -20px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: -8px; }
.quick-times { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }

/* ------------------------------------------------ team notes & mentions */

.notes-card { margin-bottom: 16px; }
.notes-card .card-head { border-bottom: 1px solid var(--border); }
.note-composer { display: flex; align-items: flex-end; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mention-wrap { position: relative; flex: 1; min-width: 0; }
.mention-wrap textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; resize: vertical;
}
.mention-wrap textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.mention-list {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; width: min(320px, 100%); max-height: 260px; overflow: auto;
  margin: 0; padding: 4px; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.mention-list li { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px; border-radius: 6px; cursor: pointer; color: var(--text-2); }
.mention-list li.active, .mention-list li:hover { background: var(--accent-soft); color: var(--text); }
.avatar.small { width: 26px; height: 26px; font-size: 11px; background: var(--surface-3); color: var(--text-2); }
.notes { margin: 0; padding: 4px 20px 8px; list-style: none; }
.note { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--surface-3); }
.note:last-child { border-bottom: 0; }
.note.focus { margin: 0 -20px; padding: 12px 20px; background: var(--amber-bg); }
.note-meta { color: var(--text-2); }
.note-meta time { margin-left: 6px; font-size: 12px; }
.note-text { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.mention { padding: 0 3px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.mention.me { background: var(--amber-bg); color: var(--amber); }
.note .icon-btn { width: 28px; height: 28px; opacity: .6; }
.note .icon-btn:hover { opacity: 1; }
.empty-inline { padding: 16px 20px; color: var(--text-3); }

.notif-list { margin: 0 -20px; padding: 0; list-style: none; }
.notif {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: start;
  padding: 12px 20px; border-bottom: 1px solid var(--surface-3); color: var(--text-2); text-decoration: none;
}
.notif:hover { background: var(--row-hover); }
.notif.unread { background: var(--accent-soft); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { color: var(--text); }
.notif.unread .notif-title { font-weight: 500; }
.notif-preview { color: var(--text-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif time { font-size: 12px; }
.unread-dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.notif-foot { margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--border); }

/* ------------------------------------------- products, areas, lists */

.form-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.form-hint { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.product-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.product-row {
  display: grid; grid-template-columns: minmax(120px, 42%) minmax(0, 1fr); gap: 6px 8px; align-items: center;
  grid-template-areas: "check brand" ". chips" ". note";
}
.product-row .product-check { grid-area: check; }
.product-row .product-brand { grid-area: brand; }
/* The brands already used for this product, to pick with one tap. */
.brand-chips { grid-area: chips; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.brand-chips:empty { display: none; }
.brand-chips-label { margin-right: 2px; font-size: 11px; color: var(--text-4); }
.brand-chip {
  min-height: 26px; padding: 0 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-size: 12px; font-weight: 500; transition: border-color var(--ease), background var(--ease), color var(--ease);
}
.brand-chip:hover { border-color: var(--border-strong); color: var(--text); }
.brand-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.brand-note { grid-area: note; margin: 0; font-size: 12px; color: var(--green); }
.brand-note:empty { display: none; }
.product-row.on + .product-row { margin-top: 2px; }
.product-check { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.product-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.product-brand {
  min-height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
.product-brand:disabled { background: var(--surface-3); border-color: var(--border); }
.product-brand:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.product-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.product-chip { padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: 12px; font-weight: 500; }
.product-chip .dim { font-weight: 400; }

/* Area, Dealer and search sit together on the right edge, on one line when there's room. */
.toolbar-right { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.toolbar-right .search { flex: 0 1 260px; width: auto; min-width: 200px; }
@media (min-width: 1101px) { .toolbar-right { flex-wrap: nowrap; } }

.lists-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 24px; }
.list-items { margin: 0 0 8px; padding: 0; list-style: none; }
.list-items li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding: 0 0 0 10px;
  border-bottom: 1px solid var(--surface-3); color: var(--text-2);
}
.list-add { display: flex; gap: 8px; }
.list-add input {
  flex: 1; min-width: 0; min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
.list-add input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

/* ---------------------------------------------------------------- map */

.map-areas { display: grid; gap: 8px; margin-bottom: 12px; }
.map-areas:empty { display: none; }
.area-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.area-label { width: 44px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-4); }
.area-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 6px 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-size: 13px; font-weight: 500; transition: border-color var(--ease), background var(--ease), color var(--ease);
}
.area-chip:hover { border-color: var(--border-strong); color: var(--text); }
.area-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.area-chip[aria-pressed="true"] .count-flag { background: var(--surface); color: var(--accent); }
.count-flag {
  display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.map-list { margin-top: 16px; }
.map-list .card-head { justify-content: flex-start; gap: 10px; }
.map-table td { padding-top: 8px; padding-bottom: 8px; }
.map-pin-cell { white-space: nowrap; }
.map-pin-cell .sub { display: inline; margin-left: 8px; }
.locate-btn svg { width: 14px; height: 14px; }
.map-card { overflow: hidden; }
/* Its own layer, so the map's panes never slide over the menu bar on phones. */
#map { position: relative; z-index: 0; height: min(62vh, 580px); min-height: 360px; background: var(--surface-3); }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.map-legend > span { display: inline-flex; align-items: center; gap: 6px; }
/* Map pins: a numbered flag with a point, coloured by tag. Filled = exact spot, outlined = town centre (approximate). */
.flag-icon { background: none; border: 0; }
.flag {
  --flag: #047857;
  position: relative; display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 7px;
  border: 2px solid #f8fafc; border-radius: 12px; background: var(--flag); box-shadow: 0 1px 4px rgba(15, 23, 42, .45);
  color: #f8fafc; font: 700 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.flag::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--flag); border-bottom: 0;
}
.flag.approx { background: #f8fafc; color: var(--flag); border-color: var(--flag); }
.flag-active { --flag: #047857; }
.flag-inactive { --flag: #ea580c; }
.flag-terminated { --flag: #475569; }
.flag-lead { --flag: #0369a1; }
.flag-mixed { --flag: #334155; }
.flag-icon .flag { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); }
.legend-flag { min-width: 22px; height: 18px; padding: 0 5px; font-size: 10px; border-width: 1.5px; margin-bottom: 6px; }
.legend-flag::after { border-width: 4px; bottom: -6px; }
.map-filters .count-flag { margin-left: 4px; }
.map-filters .count-flag.flag-active { background: var(--green-bg); color: var(--green); }
.map-filters .count-flag.flag-inactive { background: var(--orange-bg); color: var(--orange); }
.map-filters .count-flag.flag-terminated { background: var(--grey-bg); color: var(--grey); }
.map-filters .count-flag.flag-lead { background: var(--accent-soft); color: var(--accent); }
.map-popup-list { margin: 6px 0; padding-left: 16px; }
.leaflet-container { font: inherit; }
.leaflet-container a { color: var(--accent); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }

/* ----------------------------------------------------------- settings */

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-grid .span-2 { grid-column: 1 / -1; }
.settings-card { padding: 18px 20px 20px; }
.settings-card h2 { font-size: 16px; font-weight: 600; }
.settings-card-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px 16px; }
.settings-sub { margin: 18px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.settings-actions { margin-top: 12px; }
.staff-summary { margin-top: 10px; color: var(--text-2); }
.trash-table tr.restored td { color: var(--text-4); }
.trash-table tr.restored strong { font-weight: 500; }
.trash-table td .sub { max-width: 60ch; }
.idle-setting { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.idle-setting label { font-weight: 500; }
.idle-setting select {
  min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13px;
}
.usage-card { margin-top: 16px; }

.theme-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
/* Each choice is a small picture of the CRM in that theme, its name and a line under it. */
.theme-card { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: pointer; }
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-preview {
  position: relative; display: block; aspect-ratio: 16 / 7.5; margin-bottom: 8px; border-radius: 10px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--border-strong); transition: box-shadow var(--ease);
}
.theme-card:hover .theme-preview { box-shadow: 0 0 0 1px var(--border-hover); }
.theme-card:has(input:checked) .theme-preview { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft); }
.theme-card:has(input:focus-visible) .theme-preview { outline: 2px solid var(--accent); outline-offset: 5px; }
.theme-name { font-size: 14px; font-weight: 600; color: var(--text); }
.theme-desc { font-size: 12px; color: var(--text-3); }

/* The little CRM: sidebar with the active item and three menu lines; a page with a bar, a card and a button. */
.tp { position: absolute; inset: 0; display: grid; grid-template-columns: 30% 1fr; }
.tp i { display: block; border-radius: 3px; }
.tp-side { display: flex; flex-direction: column; gap: 6px; padding: 12% 12% 0; }
.tp-side i { height: 4px; width: 72%; background: var(--tp-line); }
.tp-side .tp-accent { width: 55%; background: #3b82f6; }
.tp-main { display: flex; flex-direction: column; gap: 9%; padding: 7% 8% 0; background: var(--tp-bg); }
.tp-main i { background: var(--tp-card); box-shadow: inset 0 0 0 1px var(--tp-edge); }
.tp-bar { height: 10%; }
.tp-box { height: 22%; }
.tp-btn { height: 17%; width: 52%; }
.tp-light { --tp-line: #94a3b8; --tp-bg: #f1f5f9; --tp-card: #ffffff; --tp-edge: #e2e8f0; }
.tp-light .tp-side { background: #0f172a; }
.tp-dark { --tp-line: #64748b; --tp-bg: #0b1120; --tp-card: #162033; --tp-edge: #243049; }
.tp-dark .tp-side { background: #121a2b; }
/* Auto: light over dark, split corner to corner. */
.theme-preview-auto .tp-light { clip-path: polygon(0 0, 100% 0, 100% 100%); }
@media (max-width: 560px) {
  .theme-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .theme-desc { font-size: 11px; line-height: 1.35; }
}

.my-permissions { margin-top: 14px; font-size: 13px; color: var(--text-2); }
.my-permissions summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.my-permissions ul { margin: 8px 0 0; padding-left: 20px; color: var(--text-3); }

.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 14px 0 0; }
.status-grid .kv { grid-template-columns: 120px minmax(0, 1fr); }
.status-grid .bad { color: var(--red); }
.problem-list {
  margin: 0; padding: 8px 12px 8px 32px; max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-3);
}
.problem-list .problem { color: var(--red); }
.help-list { margin: 0; padding-left: 20px; font-size: 13px; color: var(--text-2); }
.help-list li + li { margin-top: 4px; }
code { padding: 1px 5px; border-radius: 4px; background: var(--surface-3); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.report-fallback {
  width: 100%; margin-top: 12px; padding: 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ------------------------------------------------- hotel form extras */

.tag-field { display: flex; flex-direction: column; gap: 6px; padding: 0; }
.tag-field legend { float: left; width: 100%; margin: 0 0 6px; padding: 0; font-size: 13px; font-weight: 500; color: var(--text-2); }
.tag-field .form-hint { margin: 0; }
.segmented { display: inline-flex; align-self: flex-start; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.form-grid .segmented label { position: relative; flex-direction: row; gap: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-2); transition: background var(--ease), color var(--ease);
}
.segmented label + label span { border-left: 1px solid var(--border-strong); }
.segmented span:hover { background: var(--surface-2); }
.segmented input:checked + span { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.segmented input[value="terminated"]:checked + span { background: var(--grey-bg); color: var(--grey); font-weight: 600; }
.segmented input[value="active"]:checked + span { background: var(--green-bg); color: var(--green); font-weight: 600; }
.segmented input[value="inactive"]:checked + span { background: var(--grey-bg); color: var(--text); font-weight: 600; }
.segmented input[value="lead"]:checked + span { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.field-stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.link-btn { align-self: flex-start; padding: 2px 0; border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 500; text-align: left; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Products billed on their own dates (hotel form). */
.extra-line { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--surface-3); }
.extra-remove { justify-content: flex-end; align-items: flex-end; }
.extra-add { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 14px; }
.billing-total { margin-top: 10px; font-weight: 600; color: var(--text-2); }
.billing-total:empty { display: none; }

/* Several subscriptions: each one's due date, and its line on the Account tab. */
.due-lines { display: flex; flex-direction: column; gap: 4px; }
.due-line { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.due-name { min-width: 52px; font-size: 12px; color: var(--text-3); }
.sub-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }

/* Dealers: the contact strip above the directory, and the Settings card. */
.dealer-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 20px;
  border-top: 1px solid var(--border); background: var(--accent-soft); font-size: 13px;
}
.dealer-strip-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.dealer-strip .link { margin-left: auto; }
.dealer-contact { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.dealer-contact strong { color: var(--text); font-weight: 600; }
.dealers-wrap { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.dealers-table td { vertical-align: middle; }
.dealers-table .row-actions { display: inline-flex; align-items: center; gap: 8px; }
.dealer-form { margin-top: 6px; }
.dealer-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; margin-bottom: 12px; }
.dealer-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.dealer-fields input {
  min-height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px;
}
.dealer-fields input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.dealer-form .form-error { margin: 0 0 12px; }
@media (max-width: 1100px) { .dealer-fields { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .dealer-fields { grid-template-columns: 1fr; } .dealer-fields input { min-height: 44px; font-size: 16px; } }

/* Contract workers: no selecting text (except in boxes), a watermark with
   their name on every screen, and the screen hidden when the window isn't in front. */
.protected-view body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.protected-view :is(input, textarea, select, [contenteditable]) { -webkit-user-select: text; user-select: text; }
.watermark { position: fixed; inset: 0; z-index: 90; pointer-events: none; background-repeat: repeat; }
.privacy-shield {
  position: fixed; inset: 0; z-index: 95; display: none; place-items: center; padding: 24px;
  background: var(--bg); color: var(--text-3); font-weight: 600; text-align: center;
}
.protected-view.shielded .privacy-shield { display: grid; }
@media print {
  .protected-view body > * { display: none !important; }
  .protected-view body::after { content: "Printing is turned off for this login."; display: block; padding: 40px; font: 16px sans-serif; }
}
.tag-contract { background: var(--amber-bg); color: var(--amber); }

/* The message to send someone with their new login. */
.welcome-body { padding: 16px 20px 0; }
.welcome-body .form-note { margin-bottom: 10px; }
.welcome-text {
  width: 100%; padding: 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); resize: none;
  background: var(--surface-2); color: var(--text); font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Quotations & invoices (hotel page). */
.docs-card { position: relative; margin-bottom: 16px; }
.docs-list { border-top: 1px solid var(--border); }

/* Quotations, then invoices, each under a small label with a count. */
.doc-group + .doc-group { border-top: 1px solid var(--border); }
.doc-group-label {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 20px 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-4);
}
.doc-group-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--surface-3); color: var(--text-3); font-size: 11px; letter-spacing: 0;
}

/* One row per document: what it is, what it's worth now, its versions. */
.doc { border-top: 1px solid var(--surface-3); }
.doc-group-label + .doc { border-top: 0; }
.doc-summary {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 12px 20px; transition: background var(--ease);
}
.doc-summary:hover { background: var(--row-hover); }
.doc-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.doc-icon.invoice { background: var(--green-bg); color: var(--green); }
.doc-icon svg { width: 18px; height: 18px; }
.doc-main { min-width: 0; }
.doc-title { margin: 0; overflow: hidden; font-size: 14px; font-weight: 600; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin-top: 2px; font-size: 12px; color: var(--text-3); }
.doc-meta-group { display: inline-flex; align-items: center; white-space: nowrap; }
.doc-meta-group + .doc-meta-group::before { content: "·"; padding: 0 6px; color: var(--border-strong); }
.doc-dot { padding: 0 6px; color: var(--border-strong); }
.doc-kind { font-weight: 600; color: var(--text-2); }
.doc-for { display: inline-flex; align-items: center; gap: 4px; }
.doc-for svg { width: 11px; height: 11px; }

.doc-figs { display: flex; gap: 24px; }
.doc-fig { display: flex; flex-direction: column; align-items: flex-end; min-width: 92px; }
.doc-fig-label { font-size: 11px; color: var(--text-4); }
.doc-fig-value { font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-fig-value small, .doc-table small { margin-left: 1px; font-size: 11px; font-weight: 500; color: var(--text-4); }

.doc-side { display: flex; align-items: center; gap: 6px; }
.doc-toggle {
  display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 6px 0 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap;
  transition: border-color var(--ease), color var(--ease);
}
.doc-toggle:hover { border-color: var(--border-strong); color: var(--text); }
.doc-toggle svg { width: 14px; height: 14px; transition: transform 200ms cubic-bezier(.22, 1, .36, 1); }
.doc-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.doc-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.doc-quick { display: inline-flex; gap: 2px; }

/* The version history: a table on wide screens, stacked rows on phones. */
.doc-history { margin: 0 20px 14px 70px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-table th {
  padding: 7px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); text-align: left; white-space: nowrap;
}
.doc-table th.num { text-align: right; }
.doc-table td { padding: 9px 10px; border-bottom: 1px solid var(--surface-3); color: var(--text-2); vertical-align: top; }
.doc-table tbody tr:last-child td { border-bottom: 0; }
.doc-table tbody tr:hover td { background: var(--row-hover); }
.doc-table td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.doc-table .is-latest td { background: var(--surface-2); }
.doc-v { font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.is-latest .doc-v { color: var(--accent); }
.doc-latest-tag {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--accent-soft);
  color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px;
}
.doc-c-date, .doc-c-ref { white-space: nowrap; }
.doc-c-note { min-width: 160px; max-width: 320px; }
.doc-note-text { display: block; color: var(--text); overflow-wrap: anywhere; }
.doc-who { display: block; margin-top: 1px; font-size: 12px; color: var(--text-4); }
.doc-c-acts { width: 1%; white-space: nowrap; text-align: right; }
.doc-c-acts .icon-btn { display: inline-grid; vertical-align: middle; }
.doc-delta { display: block; margin-top: 1px; font-size: 11px; font-weight: 600; }
.doc-delta.up { color: var(--amber); }
.doc-delta.down { color: var(--green); }
.danger-hover:hover { color: var(--red); }
.doc-ref-inline { display: none; }
/* Up to 1000px wide, each version in the history is a small stacked row rather than a table. */
@media (max-width: 1000px) {
  .doc-table thead { display: none; }
  .doc-table, .doc-table tbody { display: block; }
  .doc-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "ver date" "sub once" "ref ref" "note note" "acts acts";
    gap: 6px 12px; padding: 10px 12px; border-bottom: 1px solid var(--border);
  }
  .doc-table tbody tr:last-child { border-bottom: 0; }
  .doc-table td { padding: 0; border: 0; background: none !important; }
  .doc-table td.num { text-align: left; }
  .doc-c-ver { grid-area: ver; align-self: center; }
  .doc-c-acts { grid-area: acts; width: auto; display: flex; gap: 4px; text-align: left; }
  .doc-c-date { grid-area: date; }
  .doc-c-ref { grid-area: ref; overflow: hidden; text-overflow: ellipsis; }
  .doc-c-sub { grid-area: sub; }
  .doc-c-once { grid-area: once; }
  .doc-c-note { grid-area: note; max-width: none; min-width: 0; }
  .doc-c-note:empty { display: none; }
  .doc-c-sub::before, .doc-c-once::before, .doc-c-date::before, .doc-c-ref::before {
    content: attr(data-label); display: block; font-size: 11px; color: var(--text-4);
  }
  .doc-table .doc-c-ref { display: block; }
  .doc-ref-inline { display: none !important; }
}
/* Mid-size screens: the reference moves under the date, and the history lines up with the card. */
@media (max-width: 1280px) and (min-width: 861px) {
  .doc-history { margin-left: 20px; }
  .doc-table .doc-c-ref { display: none; }
  .doc-ref-inline { display: block; margin-top: 1px; font-size: 12px; color: var(--text-4); }
  .doc-c-note { min-width: 120px; }
  .doc-table th, .doc-table td { padding-left: 8px; padding-right: 8px; }
}
.doc-history-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 13px;
}
.doc-history-foot .link { display: inline-flex; align-items: center; gap: 4px; }
.doc-history-foot .link svg { width: 13px; height: 13px; }
.doc-history-foot .link:only-child { margin-left: auto; }
.docs-empty { padding: 18px 20px 22px; border-top: 1px solid var(--border); text-align: center; }
.docs-drop {
  position: absolute; inset: 0; display: none; place-items: center; border: 2px dashed var(--accent); border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 88%, transparent); color: var(--accent); font-weight: 600; pointer-events: none;
}
.docs-card.dragging .docs-drop { display: grid; }
.dialog-doc { width: min(1120px, calc(100vw - 32px)); }
.doc-dialog-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); }
.doc-preview { border-right: 1px solid var(--border); background: var(--surface-3); }
.doc-preview iframe, .doc-view-frame { display: block; width: 100%; height: min(72vh, 760px); border: 0; background: var(--surface-3); }
.doc-fields { align-content: start; }
.doc-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.doc-view-facts { padding: 10px 20px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
@media (max-width: 860px) {
  /* Phones: the summary wraps under its title, and each version is a small stacked row. */
  .doc-summary { grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "icon main quick" "figs figs figs" "toggle toggle toggle"; gap: 10px 12px; padding: 12px 16px; }
  .doc-icon { grid-area: icon; }
  .doc-main { grid-area: main; }
  .doc-title { white-space: normal; }
  .doc-side { display: contents; }
  .doc-quick { grid-area: quick; align-self: start; }
  .doc-meta { flex-direction: column; align-items: flex-start; }
  .doc-meta-group + .doc-meta-group::before { content: none; }
  .docs-card .card-head .actions-inline { width: 100%; }
  .docs-card .card-head .actions-inline .btn { flex: 1 1 0; justify-content: center; min-height: 44px; }
  .doc-figs { grid-area: figs; justify-content: flex-start; gap: 12px; }
  .doc-fig { align-items: flex-start; min-width: 0; flex: 1 1 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
  .doc-toggle { grid-area: toggle; justify-self: start; min-height: 44px; padding: 0 10px 0 14px; }
  .doc-history { margin: 0 16px 14px; }
  .doc-dialog-body { grid-template-columns: 1fr; }
  .doc-preview { border-right: 0; border-bottom: 1px solid var(--border); }
  .doc-preview iframe { height: 45vh; }
  .doc-view-frame { height: 70vh; }
}

/* Client report: laid out like the office spreadsheet. */
.report-table { min-width: 900px; font-size: 13px; }
.report-table th.center, .report-table td.center { text-align: center; }
.report-table td:nth-child(2) { min-width: 150px; }
.report-table tbody tr.monthly td { background: var(--green-bg); }
.report-table .due-text { display: block; white-space: nowrap; }
.report-table .due-text.late { color: var(--red); font-weight: 600; }
.report-table .due-text.soon { color: var(--amber); font-weight: 600; }
.report-table .due-text.later { color: var(--green); font-weight: 600; }
.report-legend { padding: 10px 20px 14px; font-size: 12px; color: var(--text-3); }

/* Product and location colours (report.js HUES, also used in the PDF). Kept
   clear of the red, amber and green that mean overdue, soon and monthly. */
.hue-0 { --hue: 255; } .hue-1 { --hue: 305; } .hue-2 { --hue: 185; } .hue-3 { --hue: 55; }
.hue-4 { --hue: 275; } .hue-5 { --hue: 225; } .hue-6 { --hue: 115; } .hue-7 { --hue: 350; }
.ptag {
  display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px;
  border: 1px solid oklch(88% .05 var(--hue)); border-radius: 6px; background: oklch(95.5% .03 var(--hue));
  color: oklch(44% .11 var(--hue)); font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.ptags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.swatch { width: 8px; height: 8px; flex: none; border-radius: 3px; background: oklch(62% .14 var(--hue)); }
.th-tag { display: inline-flex; align-items: center; gap: 5px; }
:root[data-theme="dark"] .ptag { border-color: oklch(42% .07 var(--hue)); background: oklch(31% .05 var(--hue)); color: oklch(87% .08 var(--hue)); }
:root[data-theme="dark"] .swatch { background: oklch(70% .13 var(--hue)); }


/* Possible duplicates (dashboard) and the warning on the hotel form. */
.dup-panel { margin-bottom: 16px; }
.dup-list { margin: 0; padding: 0 20px 12px; list-style: none; }
.dup-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 44px; padding: 6px 0; border-top: 1px solid var(--surface-3); }
.dup-pair { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; flex: 1 1 320px; }
.dup-and { color: var(--text-4); font-size: 13px; }
.dup-warning a { color: inherit; font-weight: 600; }

/* Type-to-search hotel picker (Onboarding, Log contact). */
.picker-field { display: flex; flex-direction: column; gap: 6px; }
.picker-field > label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.picker { position: relative; }
.picker-input {
  width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px;
}
.picker-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.picker-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; max-height: 260px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.picker-list li { display: flex; flex-direction: column; min-height: 40px; justify-content: center; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.picker-list li:hover { background: var(--surface-3); }
.picker-list li.active { background: var(--accent-soft); }
.picker-list strong { font-weight: 600; color: var(--text); }
.picker-list .dim { font-size: 12px; }
.picker-list .picker-more { cursor: default; color: var(--text-4); font-size: 12px; }
.picker-list .picker-more:hover { background: none; }

/* ------------------------------------------------ dashboard search */

@media (min-width: 861px) { .page-head:has(.global-search) { align-items: center; } }
.global-search { position: relative; flex: 1 1 320px; max-width: 460px; }
.global-search .search { width: 100%; }
.global-search .search input { min-height: 38px; font-size: 14px; }
.global-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; max-height: min(440px, 60vh); overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.global-results li { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.global-results li:hover { background: var(--surface-3); }
.global-results li.active { background: var(--accent-soft); }
.global-results .gs-empty { cursor: default; color: var(--text-4); font-size: 13px; }
.global-results .gs-empty:hover { background: none; }
.gs-kind { flex: none; width: 52px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-4); }
.gs-text { display: flex; flex-direction: column; min-width: 0; }
.gs-text strong, .gs-text .dim { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-text strong { font-weight: 600; color: var(--text); }
.gs-text .dim { font-size: 12px; color: var(--text-3); }
.head-actions { display: flex; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------- Ask AI */

.btn-ai { border-color: transparent; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.btn-ai svg { color: var(--accent); }
.btn-ai:hover, .btn-ai[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.ai-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; display: flex; flex-direction: column;
  width: min(460px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.ai-panel[hidden] { display: none; }
.ai-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 12px 12px 20px; border-bottom: 1px solid var(--border); }
.ai-head h2 { font-size: 16px; font-weight: 600; }
.ai-head-actions { display: flex; align-items: center; gap: 4px; }
.ai-log { flex: 1; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; overscroll-behavior: contain; padding: 20px; }
.ai-intro h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.ai-intro p { margin-top: 4px; color: var(--text-3); }
.ai-intro a { color: var(--accent); font-weight: 500; }
.ai-suggestions { display: grid; gap: 6px; margin-top: 16px; }
.ai-suggestion {
  min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); font-size: 13px; text-align: left; cursor: pointer;
  transition: border-color var(--ease), background var(--ease), color var(--ease);
}
.ai-suggestion:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.ai-q {
  align-self: flex-end; max-width: 85%; padding: 8px 12px; border-radius: 12px 12px 4px 12px;
  background: var(--accent-soft); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere;
}
.ai-answer { color: var(--text-2); line-height: 1.6; overflow-wrap: anywhere; }
.ai-md > * + * { margin-top: 10px; }
.ai-md h4 { font-size: 14px; font-weight: 600; color: var(--text); }
.ai-md ul, .ai-md ol { padding-left: 20px; }
.ai-md li + li { margin-top: 3px; }
.ai-md strong { font-weight: 600; color: var(--text); }
.ai-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ai-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.4; }
.ai-table th, .ai-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.ai-table th { background: var(--surface-2); color: var(--text-3); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ai-table tbody tr:last-child td { border-bottom: 0; }
.ai-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-msg-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; margin-left: -10px; }
.ai-meta { font-size: 12px; color: var(--text-4); }
.ai-thinking { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; }
.ai-secs { margin-left: -4px; font-variant-numeric: tabular-nums; color: var(--text-4); }
.ai-dots { display: inline-flex; gap: 4px; }
.ai-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .3; animation: ai-pulse 1.2s cubic-bezier(.22, 1, .36, 1) infinite; }
.ai-dots span:nth-child(2) { animation-delay: .2s; }
.ai-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes ai-pulse { 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ai-dots span { animation: none; opacity: .7; } }
.ai-error { padding: 9px 12px; border-radius: var(--radius-sm); background: var(--red-bg); color: var(--red); font-size: 13px; }
.ai-compose { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px 8px; border-top: 1px solid var(--border); }
.ai-compose textarea {
  flex: 1; min-width: 0; min-height: 44px; max-height: 160px; resize: none; overflow-y: hidden; padding: 11px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; line-height: 1.45;
}
.ai-compose textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.ai-compose textarea:disabled { background: var(--surface-3); }
.ai-compose .btn { min-height: 44px; padding: 0 18px; }
.ai-foot { padding: 0 16px 14px; font-size: 12px; color: var(--text-4); }

.ai-key-form { margin-top: 14px; }
.ai-key-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.ai-key-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-key-row .password-field { flex: 1 1 280px; max-width: 460px; }
.ai-key-row input {
  width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ai-key-row input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.ai-key-form .form-error { margin: 10px 0 0; }

/* ---------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .form-cards { grid-template-columns: 1fr 1fr; }
  .form-cards > :last-child { grid-column: span 2; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis .kpi:last-child { grid-column: span 2; min-height: 0; }
}

@media (max-width: 860px) {
  .sidebar {
    position: static; width: auto; flex-direction: row; align-items: center; gap: 8px;
    padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  }
  /* The top bar keeps the logo with the name and subheading beside it. */
  .brand { padding: 0; font-size: 13px; letter-spacing: .05em; min-width: 0; }
  .sidebar .brand .brand-name { display: flex; min-width: 0; }
  .sidebar .brand-name small { font-size: 11px; }
  .nav-label, .sidebar-foot, .user-row { display: none; }
  /* Phones: the menu is a bar of icons fixed to the bottom of the screen,
     in thumb reach, that always fits without sideways scrolling. The names
     stay for screen readers; badges sit on the icon's corner. */
  nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px;
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    background: var(--side-bg); border-top: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 -6px 20px rgba(15, 23, 42, .18);
    transition: transform 200ms cubic-bezier(.22, 1, .36, 1);
  }
  .nav-item { justify-content: center; min-height: 48px; padding: 0; border-radius: 10px; }
  .nav-item svg { width: 22px; height: 22px; }
  .nav-item.active::after {
    content: ""; position: absolute; left: 50%; bottom: 4px; width: 16px; height: 3px; margin-left: -8px;
    border-radius: 2px; background: #f87171;
  }
  :is(.nav-item > span:not(.nav-badge), .side-link span) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .nav-item .nav-badge {
    position: absolute; top: 3px; left: calc(50% + 4px); min-width: 16px; margin: 0; padding: 0 4px; font-size: 10px; line-height: 16px;
  }
  .side-link { justify-content: center; min-width: 44px; padding: 0; }
  .sidebar-user { margin: 0 0 0 auto; padding: 0; border: 0; }
  .user-actions { flex-direction: row; margin: 0; }
  .side-link { min-height: 44px; }
  /* Room at the bottom for the menu bar, and for the notch when turned sideways. */
  .main {
    margin-left: 0;
    padding: 20px max(16px, env(safe-area-inset-right)) calc(88px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .page-head { flex-direction: column; align-items: flex-start; }
  .kpis { grid-template-columns: 1fr; }
  .kpis .kpi:last-child { grid-column: auto; }
  .kpi { min-height: 0; }
  .kpi-split, .kpi-link { margin-top: 12px; }
  .card-head { padding: 14px 16px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1 1 auto; min-height: 44px; }
  .toolbar { padding: 10px 16px; }
  .search { width: 100%; }
  .search input, .filters button { min-height: 40px; font-size: 16px; }
  .form-grid { grid-template-columns: 1fr; padding: 16px 16px 4px; }
  .form-grid .span-2 { grid-column: auto; }
  .form-grid input:not([type="checkbox"]), .form-grid select { min-height: 44px; font-size: 16px; }
  .dialog-head, .dialog-foot { padding-left: 16px; padding-right: 16px; }
  .dialog-foot { flex-wrap: wrap; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-head h1 { font-size: 24px; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .tab-panel, .timeline { padding-left: 16px; padding-right: 16px; }
  .form-grid.three { grid-template-columns: 1fr; }
  .form-grid textarea { font-size: 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .board { grid-template-columns: repeat(var(--columns), minmax(250px, 80vw)); }
  .icon-btn.small { width: 40px; height: 40px; }
  .total-due { justify-items: start; text-align: left; }
  .collapse-btn { display: none; }
  .form-cards { grid-template-columns: 1fr; }
  .form-cards > :last-child { grid-column: auto; }
  .form-page-head .actions-inline { width: 100%; }
  .form-page-head .actions-inline .btn { flex: 1 1 auto; min-height: 44px; }
  .support-search, .support-search .search { width: 100%; }
  .log-group, .support-count { padding-left: 16px; padding-right: 16px; }
  .roles-body { grid-template-columns: 1fr; padding: 16px; }
  /* minmax(0, …): a long email or a table can't stretch the column past the screen. */
  .settings-grid, .status-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-card { min-width: 0; }
  /* Dealers: one small card each instead of a table that scrolls sideways. */
  .dealers-wrap { overflow: visible; border: 0; }
  .dealers-table { min-width: 0; }
  .dealers-table thead { display: none; }
  .dealers-table, .dealers-table tbody { display: block; }
  .dealers-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name acts" "areas areas" "contact hotels" "mobile mobile" "email email";
    gap: 6px 12px; margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  }
  .dealers-table td { padding: 0 !important; border: 0; background: none !important; min-width: 0; overflow-wrap: anywhere; }
  .dealers-table .dl-name { grid-area: name; align-self: center; font-size: 15px; }
  .dealers-table .dl-acts { grid-area: acts; width: auto; }
  .dealers-table .dl-contact { grid-area: contact; }
  .dealers-table .dl-hotels { grid-area: hotels; text-align: right; }
  .dealers-table .dl-mobile { grid-area: mobile; }
  .dealers-table .dl-email { grid-area: email; }
  .dealers-table .dl-areas { grid-area: areas; }
  .dealers-table .dl-areas .blank { display: none; }
  .dealers-table :is(.dl-contact, .dl-hotels, .dl-mobile, .dl-email)::before {
    content: attr(data-label); display: block; font-size: 11px; color: var(--text-4);
  }
  .dealers-table .empty-row td { display: block; text-align: left; }

  /* Staff, Time in the app, permissions and Deleted items: small stacked
     cards instead of tables that scroll sideways. */
  :is(.staff-table, .usage-table, .permissions-table, .trash-table) { min-width: 0; }
  :is(.staff-table, .usage-table, .permissions-table, .trash-table) thead { display: none; }
  :is(.staff-table, .usage-table, .permissions-table, .trash-table), :is(.staff-table, .usage-table, .permissions-table, .trash-table) tbody { display: block; }
  :is(.staff-table, .usage-table, .permissions-table, .trash-table) tr { display: grid; gap: 6px 12px; padding: 12px 16px; border-bottom: 1px solid var(--surface-3); }
  :is(.staff-table, .usage-table, .permissions-table, .trash-table) :is(td, th) { padding: 0 !important; border: 0; background: none !important; min-width: 0; overflow-wrap: anywhere; text-align: left; }
  :is(.staff-table, .usage-table, .trash-table) tbody tr:hover td { background: none; }
  :is(.staff-table, .usage-table, .trash-table) .empty-row { display: block; }
  :is(.staff-table, .usage-table, .trash-table) .empty-row td { display: block; text-align: center; padding: 24px 0 !important; }
  [data-label]:is(.st-last, .tr-by)::before, .usage-table td[data-label]::before {
    content: attr(data-label); display: block; font-size: 11px; color: var(--text-4);
  }

  .staff-table tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name acts" "email email" "role status" "last last"; }
  .staff-table .st-name { grid-area: name; align-self: center; }
  .staff-table .st-acts { grid-area: acts; width: auto; }
  .staff-table .st-email { grid-area: email; color: var(--text-3); }
  .staff-table .st-role { grid-area: role; }
  .staff-table .st-status { grid-area: status; justify-self: end; }
  .staff-table .st-last { grid-area: last; }

  .usage-table tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .usage-table .us-name { grid-column: 1 / -1; }
  .usage-table td.num { text-align: left; }

  .permissions-table tr { display: flex; flex-wrap: wrap; gap: 6px; }
  .permissions-table th[scope="row"] { flex: 1 1 100%; font-weight: 600; color: var(--text); }
  .permissions-table .pm-no { display: none; }
  .permissions-table .pm-yes svg, .permissions-table .pm-yes .sr-only { display: none; }
  .permissions-table .pm-yes::before {
    content: "✓ " attr(data-label); display: inline-block; padding: 2px 8px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600;
  }
  .permissions-table .pm-assigns td { flex: 1 1 100%; font-size: 12px; }
  .permissions-table .pm-assigns td::before { content: attr(data-label) ": "; font-weight: 600; color: var(--text-2); }

  .trash-table tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "kind when" "what what" "by by" "acts acts"; }
  .trash-table .tr-kind { grid-area: kind; }
  .trash-table .tr-when { grid-area: when; text-align: right; }
  .trash-table .tr-when .sub { display: none; }
  .trash-table .tr-what { grid-area: what; }
  .trash-table .tr-by { grid-area: by; }
  .trash-table .tr-acts { grid-area: acts; width: auto; }
  .trash-table .tr-acts .row-actions { display: flex; gap: 8px; }
  .settings-grid .span-2 { grid-column: auto; }
  .msg { grid-template-columns: 1fr; padding: 12px 16px; }
  .msg-when { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .global-search { flex: none; width: 100%; max-width: none; }
  .filters { display: flex; flex-wrap: wrap; width: 100%; }
  .filters button { flex: 1 1 auto; padding: 0 8px; font-size: 14px; }
  .head-actions { width: 100%; justify-content: space-between; }
  .ai-compose textarea, .ai-key-row input { font-size: 16px; }
}

/* Phones and tablets: while typing, the menu bar steps aside so it doesn't
   ride up on top of the keyboard. */
@media (max-width: 860px) and (pointer: coarse) {
  body:has(:is(input:not([type="checkbox"], [type="radio"], [type="button"], [type="submit"], [type="file"]), textarea, [contenteditable]):focus) nav {
    transform: translateY(110%);
  }
}

/* ------------------------------------------------------- touch targets */
/* Last in the file so it wins: on phones and touch screens every control is
   at least 44px, as PRODUCT.md asks. Links inside sentences are exempt. */

@media (max-width: 860px), (pointer: coarse) {
  .btn, .btn-small, .chip, .kpi-link, .filters button, .search input, .back, .tabs [role="tab"],
  .select-inline select, .table th button, .idle-setting select,
  .form-grid input:not([type="checkbox"]), .form-grid select,
  .form-card .form-grid input:not([type="checkbox"]), .form-card .form-grid select { min-height: 44px; }
  .filters button { min-width: 44px; }
  .icon-btn, .icon-btn.small, .entry .icon-btn, .note .icon-btn, .eye { width: 44px; height: 44px; }
  .note-composer { flex-direction: column; align-items: stretch; padding: 12px 16px; }
  .notes { padding: 4px 16px 8px; }
  .mention-wrap textarea { font-size: 16px; }
  .mention-list li { min-height: 44px; }
  .icon-link, .icon-link.map { flex: none; width: 44px; height: 44px; }
  .contact-icons { gap: 4px; }
  .table .link, .table .row-title, .card-head .link, .kcard-title, .msg-actions .btn {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  }
  .table .row-title { justify-content: flex-start; }
  .my-permissions summary { padding: 13px 0; }
  .product-check, .product-brand, .list-add input, .area-chip, .brand-chip { min-height: 44px; }
  .product-brand, .list-add input { font-size: 16px; }
  .brand-name { display: none; }
  .global-search .search input, .ai-suggestion, .ai-key-row input, .segmented span, .link-btn, .picker-input, .picker-list li { min-height: 44px; }
  .picker-input { font-size: 16px; }
}

@media (max-width: 1100px) {
  #map { height: 55vh; }
  .lists-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------ sales tools and locks */

/* Sales page: lock quotation (Google), software quotation (in the CRM), add lead. */
.sales-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 10px; }
.sales-actions .btn .ext { width: 13px; height: 13px; color: var(--text-4); }
.sales-stock { flex-basis: 100%; text-align: right; font-size: 12px; font-weight: 500; text-decoration: none; }
.sales-stock:hover { text-decoration: underline; }


/* Our hotel locks: a small lock beside the name, a badge on the profile. */
.lock-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; vertical-align: -3px;
  border-radius: 5px; background: var(--accent-soft); color: var(--accent); }
.lock-mark svg { width: 12px; height: 12px; stroke-width: 2.4; }
.badge-lock { background: var(--accent-soft); color: var(--accent); }
.badge-lock::before { display: none; }
.badge-lock svg { width: 12px; height: 12px; }
.filters .lock-ico { width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; }

/* Settings → Sales tools. */
.sales-tools-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; margin: 10px 0 8px; }
.sales-tools-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.sales-tools-fields .wide { grid-column: span 2; }
.sales-tools-fields input {
  min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
.sales-tools-fields input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.sales-tools-form .form-note { margin-bottom: 12px; }
@media (max-width: 1100px) { .sales-tools-fields { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .sales-tools-fields { grid-template-columns: 1fr; }
  .sales-tools-fields .wide { grid-column: auto; }
  .sales-tools-fields input { min-height: 44px; font-size: 16px; }
  .sales-actions { justify-content: flex-start; width: 100%; }
  .sales-actions .btn { flex: 1 1 auto; min-height: 44px; }
  .sales-stock { text-align: left; }
}

/* ------------------------------------------ amounts, AS tags, lead pages */

/* Dashboard: the lock bubble, and one-time charges under the subscriptions. */
/* Total clients: the headline number, a button that shows them in the directory. */
.kpi-hero {
  align-self: flex-start; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--green);
  font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -.03em; cursor: pointer;
}
.kpi-hero:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.dot-slate { background: var(--text-3); }

/* Dashboard, four boxes: Total clients split by company, every tag in one box,
   Accounts, Client dues. Four across on wide screens, two by two below. */
.kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1.3fr) minmax(0, .9fr); }
:root:not([data-perms~="finance.view"]) .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi-cos { display: grid; gap: 6px; margin-top: auto; padding-top: 14px; }
.kpi-co {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 44px; padding: 6px 12px 6px 8px; border: 1px solid var(--surface-3); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}
.kpi-co:hover { border-color: var(--co-line); background: var(--co-bg); }
.kpi-co.is-on { border-color: var(--co); background: var(--co-bg); }
.kpi-co-name { display: flex; flex-direction: column; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.25; }
.kpi-co-name small { font-size: 12px; font-weight: 500; color: var(--text-3); }
.kpi-co strong { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-hero.is-on { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

.kpi-tags-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.kpi-all {
  min-height: 28px; padding: 0 2px; border: 0; background: none; color: var(--accent);
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
}
.kpi-all:hover { text-decoration: underline; }
.kpi-tag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; margin: 6px 0 12px; }
.kpi-tag {
  display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 36px; margin: 0 -6px; padding: 0 6px;
  border: 0; border-radius: 6px; background: none; color: var(--text-2); font-size: 13px; font-weight: 500;
  text-align: left; cursor: pointer; transition: background var(--ease);
}
.kpi-tag strong { margin-left: auto; color: var(--text); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-tag:hover { background: var(--surface-2); }
.kpi-tag.is-on { background: var(--accent-soft); color: var(--text); }
.kpi-tag-lines { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--surface-3); }
.kpi-tag-lines .chip { min-height: 28px; font-size: 12px; }
.chip.is-on { border-color: var(--accent); background: var(--accent-soft); }
.chip-line.line-soft svg { color: var(--accent); }
@media (max-width: 1360px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi:last-child { grid-column: auto; min-height: 140px; }
}
@media (max-width: 860px) {
  .kpis, :root:not([data-perms~="finance.view"]) .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpis .kpi:last-child { min-height: 0; }
}
@media (max-width: 860px), (pointer: coarse) {
  .kpi-tag, .kpi-all, .kpi-tag-lines .chip { min-height: 44px; }
}

/* Our lines: AS Lock System, AI Order POS, AngTech Scent, AngTech Website. */
.kpi-lines { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--surface-3); }
.kpi-lines-label { flex: 1 1 100%; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-4); }
.kpi-lines-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-line { gap: 5px; padding: 0 10px 0 8px; }
.chip-line svg { width: 13px; height: 13px; }
.chip-line strong { font-weight: 700; }
.chip-line.is-zero { color: var(--text-4); }
.chip-line.line-lock svg { color: var(--text); }
.chip-line.line-pos svg { color: #7c3aed; }
.chip-line.line-scent svg { color: #0d9488; }
.chip-line.line-web svg { color: #0284c7; }
:root[data-theme="dark"] .chip-line.line-pos svg { color: #c4b5fd; }
:root[data-theme="dark"] .chip-line.line-scent svg { color: #5eead4; }
:root[data-theme="dark"] .chip-line.line-web svg { color: #7dd3fc; }
.accounts .amt-once { display: block; font-size: 12px; font-weight: 500; color: var(--text-3); }

/* Account tab: subscriptions and one-time charges under their own headings. */
.kv-title { margin: 18px 0 2px; font-size: 13px; font-weight: 600; color: var(--text); }
.kv-title span { margin-left: 6px; font-weight: 400; color: var(--text-4); }
.kv-title + .kv-list .kv:first-child { border-top: 1px solid var(--surface-3); }

/* AS Lock System and AS Software, beside the tag on a hotel's page. */
.as-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle;
}
.as-tag svg { width: 12px; height: 12px; stroke-width: 2.4; }
.as-lock { background: #1e293b; color: #f8fafc; }
.as-pos { background: #f1ebfe; color: #6d28d9; box-shadow: inset 0 0 0 1px #ddd0fb; }
.as-scent { background: #e6f7f5; color: #0f766e; box-shadow: inset 0 0 0 1px #bfe8e2; }
.as-web { background: #e5f3fb; color: #0369a1; box-shadow: inset 0 0 0 1px #c3e2f4; }
:root[data-theme="dark"] .as-pos { background: rgba(139, 92, 246, .18); color: #c4b5fd; box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .4); }
:root[data-theme="dark"] .as-scent { background: rgba(20, 184, 166, .16); color: #5eead4; box-shadow: inset 0 0 0 1px rgba(20, 184, 166, .38); }
:root[data-theme="dark"] .as-web { background: rgba(14, 165, 233, .16); color: #7dd3fc; box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .38); }
.as-soft { background: #fdecea; color: #b42318; box-shadow: inset 0 0 0 1px #f6c7c1; }
:root[data-theme="dark"] .as-lock { background: #e2e8f0; color: #0f172a; }
:root[data-theme="dark"] .as-soft { background: rgba(224, 69, 58, .16); color: #fca5a5; box-shadow: inset 0 0 0 1px rgba(224, 69, 58, .35); }
.profile-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Hotel form: one-time charges. */
.once-block { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.once-block .form-hint { margin: 2px 0 10px; }
/* Stacked, as the Account card is a narrow column: name, then amount and date. */
.once-line {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 8px 10px;
  grid-template-areas: "name name remove" "amount date date" "paid paid paid";
  padding: 12px 0; border-bottom: 1px dashed var(--border);
}
.once-line label:nth-of-type(1) { grid-area: name; }
.once-line label:nth-of-type(2) { grid-area: amount; }
.once-line label:nth-of-type(3) { grid-area: date; }
.once-line [data-remove-once] { grid-area: remove; }
.once-line .once-paid { grid-area: paid; }
.once-line .once-paid:empty { display: none; }
.once-line label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.once-line input {
  min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
.once-line input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
#add-once { margin-top: 10px; }

/* A lead's page (and a prospect's) is tinted, with a banner; a Client's is the normal page. */
body:has([data-page="hotel"]:not([hidden]) #hotel-page[data-tone="lead"]) { --bg: var(--lead-tint); }
body:has([data-page="hotel"]:not([hidden]) #hotel-page[data-tone="inactive"]) { --bg: var(--prospect-tint); }
#hotel-page[data-tone="lead"] .eyebrow, #hotel-page[data-tone="inactive"] .eyebrow {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
}
#hotel-page[data-tone="lead"] .eyebrow { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--lead-line); }
#hotel-page[data-tone="inactive"] .eyebrow { background: var(--orange-bg); color: var(--orange); box-shadow: inset 0 0 0 1px var(--prospect-line); }
#hotel-page[data-tone="lead"] .card { border-color: var(--lead-line); }
#hotel-page[data-tone="inactive"] .card { border-color: var(--prospect-line); }

/* The Sales panel on a lead's page. */
.lead-panel { margin-bottom: 16px; }
.lead-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0 20px 14px; list-style: none; }
.lead-steps li { flex: 1 1 110px; }
.lead-steps :is(button, span) {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text-3); font: inherit; font-size: 13px; font-weight: 500;
}
.lead-steps button:not([disabled]):hover { border-color: var(--accent); color: var(--accent); }
.lead-steps .done :is(button, span) { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.lead-steps .current :is(button, span) { background: var(--accent); border-color: var(--accent); color: var(--on-primary); font-weight: 600; opacity: 1; }
.lead-steps .lost.current :is(button, span) { background: var(--red); border-color: var(--red); }
:root[data-theme="dark"] .lead-steps .current :is(button, span) { color: #0b1120; }
.lead-facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.lead-facts dt { font-size: 12px; color: var(--text-4); }
.lead-facts dd { margin: 2px 0 0; color: var(--text); }
.lead-facts .wide { flex: 1 1 320px; }

@media (max-width: 860px) {
  .once-line input { min-height: 44px; font-size: 16px; }
  .lead-steps { padding: 0 16px 14px; }
  .lead-steps li { flex-basis: calc(33% - 6px); }
  .lead-steps :is(button, span) { min-height: 44px; }
  .lead-facts { padding: 12px 16px 16px; }
}

/* Client report: a section for each of our lines under the table. */
.report-lines { padding: 14px 20px 4px; border-top: 1px solid var(--border); }
.report-lines-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.report-lines-title span { margin-left: 4px; font-weight: 400; color: var(--text-4); }
.report-lines-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.report-line { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.report-line header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.report-line-count { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.report-line ol { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.report-line li + li { margin-top: 2px; }
.report-line p { margin: 0; font-size: 13px; }
@media (max-width: 860px) {
  .report-lines { padding: 14px 16px 4px; }
  .report-lines-grid { grid-template-columns: 1fr; }
  .kpi-hero { font-size: 40px; min-height: 44px; }
}

/* Settings → Lists → Brand spellings. */
.tidy-list { margin: 0; padding: 0; list-style: none; }
.tidy-list li { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--surface-3); font-size: 13px; }
.tidy-list li:last-child { border-bottom: 0; }
.tidy-variants { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.tidy-variant { font-weight: 600; color: var(--text); }
.tidy-do { display: flex; gap: 6px; }
.tidy-do select { flex: 1; min-width: 0; min-height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
@media (max-width: 860px), (pointer: coarse) { .tidy-do select, .tidy-do .btn { min-height: 44px; } }

/* Client report: group rows and sortable headings. */
.report-table .group-row th {
  padding: 8px 20px !important; background: var(--surface-3); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text); text-align: left;
}
.report-table .group-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 18px; margin-left: 8px; padding: 0 6px; border-radius: 9px;
  background: var(--surface); color: var(--text-3); font-size: 11px; font-weight: 700; vertical-align: 1px;
}
.report-table tbody.report-group tr.group-row:hover th { background: var(--surface-3); }
.report-table th[aria-sort] button { font-weight: inherit; }

/* A terminated client's page is tinted grey, like a lead's is blue. */
body:has([data-page="hotel"]:not([hidden]) #hotel-page[data-tone="terminated"]) { --bg: var(--surface-3); }
#hotel-page[data-tone="terminated"] .eyebrow {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--grey-bg); color: var(--grey); box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* Ang Systems and Ang Tech: AS / AT pills, and product icons in each company's colour. */
.co-pill {
  display: inline-grid; place-items: center; min-width: 26px; height: 18px; padding: 0 5px; border-radius: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; white-space: nowrap;
}
.co-as { --co: #b42318; --co-bg: #fdecea; --co-line: #f6c7c1; }
.co-at { --co: #4338ca; --co-bg: #eef0ff; --co-line: #d4d8fb; }
:root[data-theme="dark"] .co-as { --co: #fca5a5; --co-bg: rgba(224, 69, 58, .16); --co-line: rgba(224, 69, 58, .35); }
:root[data-theme="dark"] .co-at { --co: #a5b4fc; --co-bg: rgba(99, 102, 241, .18); --co-line: rgba(99, 102, 241, .4); }
.co-pill.co-as, .co-pill.co-at { background: var(--co-bg); color: var(--co); box-shadow: inset 0 0 0 1px var(--co-line); }
.want-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--co-bg); color: var(--co); }
.want-ico svg { width: 13px; height: 13px; }
.want-icons { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* Sales cards: the hotel (with AS / AT), what it's worth, what it wants, how long since the deal. */
.kcard-lead { gap: 6px; }
.kcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kcard-cos { display: inline-flex; gap: 3px; flex: none; margin-top: 1px; }
.kcard-amount { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.kcard-amount strong { color: var(--text); font-size: 14px; }
.kcard-lead .kcard-foot { flex-wrap: wrap; margin-top: 2px; }
.kcard-lead .kcard-age { font-weight: 500; color: var(--text-3); white-space: nowrap; }
.kcard-lead .kcard-foot-acts { margin-left: auto; }
.kcard-foot-acts { display: inline-flex; align-items: center; gap: 2px; }
.kcard-quote svg { width: 14px; height: 14px; }

/* The lead form: what they're interested in, under each company. */
.want-field { border: 0; margin: 0; padding: 0; }
.want-field legend { margin-bottom: 6px; padding: 0; font-size: 13px; font-weight: 500; color: var(--text-2); }
.want-group + .want-group { margin-top: 10px; }
.want-co { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.want-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.want-pick {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px 0 8px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 13px; cursor: pointer;
  transition: border-color var(--ease), background var(--ease), color var(--ease);
}
.want-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.want-pick svg { width: 14px; height: 14px; color: var(--text-4); }
.want-pick:has(input:checked) { border-color: var(--co-line); background: var(--co-bg); color: var(--co); font-weight: 600; }
.want-pick:has(input:checked) svg { color: var(--co); }
.want-pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 860px), (pointer: coarse) { .want-pick { min-height: 44px; } }

/* Hotel page: the contact log with the team notes under it, beside the record. */
.profile-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.profile-side .notes-card { margin-bottom: 0; }

/* Products under the company that sells them (Ang Systems, then Ang Tech). */
.co-products { display: flex; flex-direction: column; gap: 6px; }
.co-row { display: flex; align-items: flex-start; gap: 8px; }
.co-row + .co-row { margin-top: 2px; }
.co-row .co-pill { margin-top: 2px; }
.product-chip.co-as, .product-chip.co-at { display: inline-flex; align-items: center; gap: 5px; background: var(--co-bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--co-line); }
.product-chip svg { width: 12px; height: 12px; color: var(--co); }
.lead-facts .co-row + .co-row { margin-top: 6px; }

/* Client report: company headings over the product columns. */
.report-table .co-head-row td { border-bottom: 0; background: none; }
.report-table .co-head { padding: 5px 8px; border-bottom: 2px solid var(--co); background: var(--co-bg); color: var(--co); text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* Settings → Lists → Who sells each product. */
.company-list { margin: 0; padding: 0; list-style: none; }
.company-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 4px 0; border-bottom: 1px solid var(--surface-3); font-size: 13px; }
.company-list li:last-child { border-bottom: 0; }
.company-product { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); }
.company-product svg { width: 14px; height: 14px; color: var(--text-4); flex: none; }
.segmented-mini { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.segmented-mini button { min-width: 36px; min-height: 26px; padding: 0 8px; border: 0; border-radius: 5px; background: none; color: var(--text-4); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.segmented-mini button[aria-pressed="true"] { background: var(--co-bg); color: var(--co); box-shadow: inset 0 0 0 1px var(--co-line); }
@media (max-width: 860px), (pointer: coarse) { .segmented-mini button { min-height: 40px; min-width: 44px; } }

/* Deals: the upsell note on a card, the history on a hotel's page, the Add lead choices. */
.kcard-deal { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; color: var(--text-2); }
.kcard-deal .tag-chip { padding: 0 7px 0 6px; font-size: 11px; }
.deal-hint { margin: 0; padding: 10px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); }
.deal-history { padding: 4px 20px 14px; border-top: 1px solid var(--border); }
.deal-history ul { margin: 0; padding: 0; list-style: none; }
.deal-history li {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px;
  padding: 8px 0; border-bottom: 1px solid var(--surface-3); font-size: 13px;
}
.deal-history li:last-child { border-bottom: 0; }
.deal-what { font-weight: 600; color: var(--text); }
.deal-worth { color: var(--text-2); font-variant-numeric: tabular-nums; }
.deal-when { font-size: 12px; white-space: nowrap; }
.lead-dup {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin: -4px 0 0; padding: 8px 10px;
  border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber); font-size: 13px;
}
.lead-upsell-note { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--green-bg); color: var(--green); font-size: 13px; }
@media (max-width: 860px) {
  .deal-history { padding: 4px 16px 14px; }
  .deal-history li { grid-template-columns: minmax(0, 1fr) auto; }
  .deal-history .deal-when { grid-column: 1 / -1; }
}

.tidy-arrow { color: var(--text-4); }
.tidy-variant s { color: var(--text-3); text-decoration-color: var(--red); }
.tidy-all { border-bottom: 0 !important; padding-bottom: 0 !important; }

/* Client form: hotel (Ang Systems) or another business (Ang Tech). */
.check.check-hotel {
  margin-top: 0; padding: 10px 12px; border: 1px solid var(--surface-3); border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: pointer;
}
.check-hotel input { width: 18px; height: 18px; margin-top: 1px; }
.check-hotel strong { display: block; color: var(--text); font-size: 13px; font-weight: 600; }
.check-hotel small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12px; line-height: 1.45; }

/* Add client (Sales): the client on the left, the deal on the right; one
   column on phones. The head and foot stay put while the body scrolls. */
.lead-dialog { width: min(940px, calc(100vw - 32px)); }
.lead-body { padding: 16px 20px 4px; }
.lead-for { margin: 0 0 14px; padding: 0; }
.lead-for .segmented label { position: relative; display: flex; }
.lead-halves { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); }
.lead-half { min-width: 0; }
.lead-half + .lead-half { padding-left: 24px; margin-left: 24px; border-left: 1px solid var(--surface-3); }
.lead-half-title { margin: 0 0 12px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-4); }
.lead-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 14px; }
.lead-grid .span-2 { grid-column: span 2; }
.lead-grid > label, .lead-notes { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; font-weight: 500; color: var(--text-2); }
.lead-half :is(input:not([type="checkbox"]), select, textarea) { width: 100%; min-width: 0; }
.lead-grid input:not([type="checkbox"]), .lead-grid select {
  min-height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 14px; font-weight: 400; color: var(--text); transition: border-color var(--ease);
}
.lead-notes { margin-top: 14px; }
.lead-half :is(.lead-grid, .lead-notes) textarea {
  padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  font: inherit; font-size: 14px; font-weight: 400; color: var(--text); resize: vertical;
}
.lead-half :is(input, select, textarea):hover { border-color: var(--border-hover); }
.lead-half :is(input, select, textarea):focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.lead-grid input[aria-invalid="true"] { border-color: var(--red); }
.lead-grid .form-note { margin: -6px 0 0; font-size: 12px; }
.lead-dialog .picker-field .form-note { margin: 2px 0 0; }
.req { color: var(--red); font-weight: 600; }
.check-hotel small .co-pill { margin-right: 4px; vertical-align: 1px; }
.lead-dialog .want-field legend { margin-bottom: 8px; }
.lead-dialog .want-group + .want-group { margin-top: 12px; }
.lead-dialog .lead-upsell-note { margin: 0; }
.lead-dialog .form-error { margin: 14px 0 0; }

/* An amount with its currency inside the box. */
.money { position: relative; display: flex; }
.money-unit {
  position: absolute; top: 1px; bottom: 1px; left: 1px; display: grid; place-items: center; padding: 0 9px;
  border-right: 1px solid var(--surface-3); border-radius: 7px 0 0 7px; background: var(--surface-2);
  color: var(--text-4); font-size: 12px; font-weight: 600; pointer-events: none;
}
.money input { padding-left: 48px !important; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .lead-dialog { max-height: calc(100dvh - 16px); }
  .lead-dialog form { max-height: calc(100dvh - 18px); }
  .lead-body { padding: 14px 16px 4px; }
  .lead-halves { grid-template-columns: minmax(0, 1fr); }
  .lead-half + .lead-half { margin: 18px 0 0; padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--surface-3); }
  .lead-for .segmented { display: flex; }
  .lead-for .segmented label { flex: 1; }
  .lead-for .segmented span { flex: 1; justify-content: center; min-height: 44px; padding: 0 10px; }
}
@media (max-width: 860px), (pointer: coarse) {
  .lead-grid input:not([type="checkbox"]), .lead-grid select { min-height: 44px; font-size: 16px; }
  .lead-half :is(.lead-grid, .lead-notes) textarea { font-size: 16px; }
}
@media (max-width: 480px) {
  .lead-grid { grid-template-columns: minmax(0, 1fr); }
  .lead-grid .span-2 { grid-column: auto; }
}

/* A client that isn't a hotel: its page is a Business profile, tinted in
   Ang Tech's colour (a hotel client's page stays the normal colour). */
:root { --business-tint: #efedfd; --business-line: #d6d1fa; }
:root[data-theme="dark"] { --business-tint: #15142c; --business-line: #34306a; }
#hotel-page[data-kind="business"] { --co: #4338ca; --co-bg: #eef0ff; --co-line: #d4d8fb; }
:root[data-theme="dark"] #hotel-page[data-kind="business"] { --co: #a5b4fc; --co-bg: rgba(99, 102, 241, .18); --co-line: rgba(99, 102, 241, .4); }
body:has([data-page="hotel"]:not([hidden]) #hotel-page[data-tone="active"][data-kind="business"]) { --bg: var(--business-tint); }
#hotel-page[data-tone="active"][data-kind="business"] .eyebrow {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--co-bg); color: var(--co); box-shadow: inset 0 0 0 1px var(--co-line);
}
#hotel-page[data-tone="active"][data-kind="business"] .card { border-color: var(--business-line); }

/* Super admin only: when the profile was made, and by whom. */
.profile-made { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.profile-made svg { flex: none; width: 14px; height: 14px; color: var(--text-4); }
.profile-made strong { font-weight: 600; color: var(--text-2); }
.profile-made .dim { font-size: 12px; }

.profile-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-head-actions:empty { display: none; }

/* Dealers: the areas each one covers, as small tags. */
.area-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.area-chip {
  display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.dealer-contact .area-chips { margin: 0 2px; }
.dealer-areas-field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.dealer-areas-field > label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.dealer-areas-field .form-hint { margin: 0; }
.area-picks { display: flex; flex-wrap: wrap; gap: 4px; }
.area-picks:empty { display: none; }
@media (max-width: 860px), (pointer: coarse) { .area-picks .brand-chip { min-height: 40px; } }
.dealer-field > label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.dealer-field { gap: 6px; }
.dealer-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 0; font-size: 12px; color: var(--text-3); }
.dealer-hint .link-btn { font-size: 12px; font-weight: 600; }
.strip-sep { width: 1px; height: 18px; background: var(--border); }

/* A client's status: Active, Due (within 30 days) or Overdue. */
.pay-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: inset 0 0 0 1px currentColor;
}
.pay-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pay-active { color: var(--green); background: var(--surface); }
.pay-due { color: var(--amber); background: var(--amber-bg); }
.pay-overdue { color: var(--red); background: var(--red-bg); }

/* All / Yearly / Monthly: which billing cycle the directory shows. */
.cycle-switch { display: inline-flex; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.cycle-switch button {
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 12px; border: 0; border-radius: 6px;
  background: none; color: var(--text-3); font-size: 13px; font-weight: 500; cursor: pointer; transition: background var(--ease), color var(--ease);
}
.cycle-switch button:hover { color: var(--text); }
.cycle-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cycle-count { color: var(--text-4); font-weight: 500; font-variant-numeric: tabular-nums; }
.cycle-switch button[aria-pressed="true"] .cycle-count { color: inherit; opacity: .75; }
@media (max-width: 860px), (pointer: coarse) { .cycle-switch button { min-height: 40px; } }

/* The super admin's and owner's totals for the list shown. */
.totals-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.totals-bar:empty { display: none; }
.tot-fig { display: flex; flex-direction: column; }
.tot-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-4); }
.tot-fig strong { font-size: 17px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tot-main strong { font-size: 22px; color: var(--green); }
.tot-note { flex: 1 1 240px; margin: 0; font-size: 12px; color: var(--text-3); }
@media (max-width: 860px) { .totals-bar { padding: 12px 16px; gap: 8px 20px; } }
.role-owner { background: rgba(124, 58, 237, .12); color: #6d28d9; }
:root[data-theme="dark"] .role-owner { background: rgba(167, 139, 250, .16); color: #c4b5fd; }
.role-accounts { background: rgba(5, 150, 105, .12); color: #047857; }
:root[data-theme="dark"] .role-accounts { background: rgba(52, 211, 153, .16); color: #6ee7b7; }

/* Client report: what each client is billed a year, group subtotals, and the total. */
.report-totals { margin: 0 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.report-table .report-amount { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.group-total { margin-left: 10px; font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }
.report-table .total-row th, .report-table .total-row td { padding-top: 10px; padding-bottom: 10px; border-top: 2px solid var(--border-strong); background: var(--surface-2); }
.report-table .total-row th { text-align: right; font-weight: 600; color: var(--text-2); }
.report-table .total-row td strong { display: block; font-size: 14px; color: var(--green); white-space: nowrap; }
.report-table .total-row .sub { display: block; font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* Ang Tech's workspace: nothing that's only about hotels. */
:root[data-workspace="at"] .ws-as-only { display: none !important; }

/* ------------------------------------------------ company switch
   Ang Systems (hotels) or Ang Tech (other businesses), under the logo. */
.workspace-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 18px 0 0; padding: 4px;
  border-radius: 10px; background: rgba(255, 255, 255, .06);
}
.workspace-switch button {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 34px; padding: 0 6px;
  border: 0; border-radius: 7px; background: none; color: var(--side-dim); font-size: 12px; font-weight: 600;
  white-space: nowrap; cursor: pointer; transition: background var(--ease), color var(--ease);
}
.workspace-switch button span { overflow: hidden; text-overflow: ellipsis; }
.workspace-switch img { flex: none; width: 18px; height: 18px; border-radius: 5px; opacity: .6; transition: opacity var(--ease); }
.workspace-switch button:hover { color: var(--side-text); }
.workspace-switch button:hover img { opacity: .9; }
.workspace-switch button[aria-pressed="true"] { background: rgba(255, 255, 255, .13); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.workspace-switch button[aria-pressed="true"] img { opacity: 1; }
.workspace-switch button:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 1px; }
@media (min-width: 861px) {
  :root[data-sidebar="collapsed"] .workspace-switch { grid-template-columns: 1fr; }
  :root[data-sidebar="collapsed"] .workspace-switch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 860px) {
  /* Phones: two logos in the top bar. */
  .workspace-switch { margin: 0 0 0 auto; grid-template-columns: auto auto; }
  .workspace-switch button { min-width: 44px; min-height: 40px; padding: 0 10px; }
  .workspace-switch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .workspace-switch img { width: 22px; height: 22px; }
  .sidebar-user { margin-left: 4px; }
}
.kpi-co.is-on { cursor: default; }

/* ======================================================= dashboard, v3.16
   One company at a time, and calm: a summary strip, then the list with its
   views as tabs and its filters in a row. */
.summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; overflow: hidden;
}
:root:not([data-perms~="finance.view"]) .summary { grid-template-columns: minmax(0, 1fr); }
.stat {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 14px 18px; border: 0; background: none;
  color: inherit; font: inherit; text-align: left;
}
.stat + .stat { border-left: 1px solid var(--surface-3); }
button.stat { cursor: pointer; transition: background var(--ease); }
button.stat:hover { background: var(--surface-2); }
button.stat.is-on { background: var(--accent-soft); }
button.stat:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--text-3); }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value.stat-clients { color: var(--green); }
.stat-value.late { color: var(--red); }
.stat-value.soon { color: var(--amber); }
.stat-note { font-size: 12px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The triangle: folds the strip to one line and back (remembered per device). */
.summary { position: relative; }
.summary-fold {
  position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-4); font: inherit; cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.summary-fold:hover { background: var(--surface-2); color: var(--text); }
.summary-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.summary-fold svg { width: 14px; height: 14px; fill: currentColor; stroke: none; transition: transform var(--ease); }
.summary-fold-label { display: none; font-size: 13px; font-weight: 500; color: var(--text-3); }
.summary.is-folded { display: block; }
.summary.is-folded .stat { display: none; }
.summary.is-folded .summary-fold { position: static; justify-content: flex-start; width: 100%; height: 40px; padding: 0 16px; border-radius: 0; }
.summary.is-folded .summary-fold svg { transform: rotate(-90deg); }
.summary.is-folded .summary-fold-label { display: inline; }
@media (max-width: 860px) { .summary:not(.is-folded) .summary-fold { width: 40px; height: 40px; top: 2px; right: 2px; } }

/* The list: title and actions, view tabs, one row of filters. */
.dir-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 14px 20px 8px; }
.dir-head h2 { font-size: 16px; font-weight: 600; }
.dir-head .actions { display: flex; align-items: center; gap: 8px; }
.dir-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.dir-tabs::-webkit-scrollbar { display: none; }
.dir-tabs button {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 10px; border: 0; background: none;
  color: var(--text-3); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: color var(--ease);
}
.dir-tabs button:hover { color: var(--text); }
.dir-tabs button[aria-pressed="true"] { color: var(--accent); font-weight: 600; }
.dir-tabs button[aria-pressed="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.dir-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.tab-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-3); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.dir-tabs button[aria-pressed="true"] .tab-count { background: var(--accent-soft); color: var(--accent); }
.dir-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.dir-filters .dir-search { flex: 1 1 220px; width: auto; }
.dir-filters .select-inline select { max-width: 220px; }
.cycle-wrap { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cycle-total { margin: 0; font-size: 13px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cycle-total strong { font-size: 15px; font-weight: 700; color: var(--green); }
.cycle-total:empty { display: none; }

/* A small menu (More: report, export, import). */
.menu-wrap { position: relative; }
.menu-wrap .btn svg { width: 14px; height: 14px; }
.menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 25; display: flex; flex-direction: column; min-width: 200px; padding: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-lg);
}
.menu-item {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: none;
  color: var(--text); font: inherit; font-size: 13px; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item svg { width: 16px; height: 16px; color: var(--text-4); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }

@media (max-width: 1100px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--surface-3); }
  .cycle-wrap { margin-left: 0; }
}
@media (max-width: 860px) {
  .dir-head { padding: 14px 16px 8px; }
  .dir-tabs { padding: 0 8px; }
  .dir-filters { padding: 10px 16px; }
  .dir-filters .dir-search { flex-basis: 100%; }
  .dir-filters .select-inline { flex: 1 1 140px; }
  .dir-filters .select-inline select { width: 100%; max-width: none; }
  .cycle-wrap { flex-wrap: wrap; width: 100%; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 20px; }
}
@media (max-width: 860px), (pointer: coarse) {
  .dir-tabs button { min-height: 44px; }
  .menu-item { min-height: 44px; }
}

/* ===================================================== client profile, v3.16
   Header (who, status, facts, quick actions), the Sales panel when there's a
   deal, then two columns: the work (account, contact log, quotations,
   payments) and the reference (people, products, details, notes). */
.profile-head { align-items: flex-start; margin: 4px 0 16px; }
.profile-id { flex: 1 1 420px; min-width: 0; }
.profile-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 22px; }
.profile-facts .fact-place svg, .profile-facts .fact-company svg { width: 14px; height: 14px; color: var(--text-4); }
.profile-facts .fact-place .link { font-size: 12px; font-weight: 600; }

.profile-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.profile-main, .profile-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.slot { min-width: 0; }
.slot > .card { margin-bottom: 0; }
.profile-wide { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.profile-wide > .card { margin-bottom: 0; }

/* Side cards: short headings, tight rows. */
.side-card { overflow: hidden; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--surface-3); }
.side-head h2 { font-size: 14px; font-weight: 600; }
.side-empty { margin: 0; padding: 12px 16px; font-size: 13px; color: var(--text-4); }

.people-list { margin: 0; padding: 2px 16px; list-style: none; }
.people-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--surface-3); }
.people-list li:last-child { border-bottom: 0; }
.person-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.person-role { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); }
.person-who strong { font-size: 14px; font-weight: 600; }
.person-email { font-size: 12px; overflow-wrap: anywhere; }

.product-group { padding: 10px 16px 12px; }
.product-group + .product-group { border-top: 1px solid var(--surface-3); }
.product-co { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.product-list-view { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.product-list-view li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; }
.product-name { color: var(--text); font-weight: 500; }
.product-brand-view { color: var(--text-2); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.product-note { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.product-group.is-past li { color: var(--text-3); }
.product-group.is-past .product-brand-view { color: var(--text-3); font-weight: 500; }

.details-list { padding: 2px 16px 6px; }
.details-list .kv { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 8px 0; font-size: 13px; }
.details-list .kv:last-child { border-bottom: 0; }
.details-list .icon-link.map { vertical-align: middle; }

/* Account: owed, per year, next due; the subscriptions and one-time charges. */
.money-card { overflow: hidden; }
.money-card .card-head { border-bottom: 1px solid var(--border); }
.money-note { margin: 0; padding: 10px 20px; border-bottom: 1px solid var(--surface-3); background: var(--surface-2); color: var(--text-3); font-size: 13px; }
.money-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--surface-3); }
.money-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 20px; }
.money-stat + .money-stat { border-left: 1px solid var(--surface-3); }
.money-stat strong { font-size: 20px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.money-stat.late strong { color: var(--red); }
.money-stat.soon strong { color: var(--amber); }
.money-stat .stat-note { white-space: normal; }
.money-block { padding: 10px 20px 12px; }
.money-block + .money-block { border-top: 1px solid var(--surface-3); }
.money-title { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.money-title span { margin-left: 6px; color: var(--text-4); font-size: 12px; font-weight: 400; }
.money-lines { margin: 0; padding: 0; list-style: none; }
.money-lines li {
  display: grid; grid-template-columns: minmax(90px, 1fr) minmax(120px, auto) minmax(0, 1.3fr) auto; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--surface-3); font-size: 13px;
}
.money-lines li:last-child { border-bottom: 0; }
.line-name { font-weight: 600; }
.line-amount strong { font-variant-numeric: tabular-nums; }
.line-when { color: var(--text-3); font-size: 12px; }
.line-due { justify-self: end; }
.money-block .side-empty { padding: 4px 0; }

/* One column when narrow, most-used first. */
@media (max-width: 1024px) {
  .profile-layout { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .profile-main, .profile-aside { display: contents; }
  .o-money { order: 1; } .o-people { order: 2; } .o-log { order: 3; } .o-products { order: 4; }
  .o-details { order: 5; } .o-notes { order: 6; }
}
@media (max-width: 860px) {
  .profile-actions { justify-content: stretch; width: 100%; padding-top: 4px; }
  .profile-actions > * { flex: 1 1 calc(50% - 4px); justify-content: center; min-height: 44px; }
  .money-stats { grid-template-columns: 1fr 1fr; }
  .money-stat:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--surface-3); }
  .money-stat:nth-child(2) { border-left: 0; }
  .money-stat { padding: 10px 16px; }
  .money-block { padding: 10px 16px 12px; }
  .money-lines li { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .money-lines .line-when { grid-column: 1; }
  .money-lines .line-due { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .money-card .card-head .actions-inline { width: 100%; }
  .money-card .card-head .actions-inline > * { flex: 1 1 0; justify-content: center; min-height: 44px; }
}

/* Correcting a payment: Edit / Ask to change, the list of changes, and a
   change waiting for the super admin under its payment. */
.row-actions { display: inline-flex; align-items: center; gap: 10px; }
.edit-log { margin-top: 4px; font-size: 12px; }
.edit-log summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; }
.edit-log summary::-webkit-details-marker { display: none; }
.edit-log summary::before { content: "✎ "; }
.edit-log ul { margin: 6px 0 0; padding: 0; list-style: none; }
.edit-log li { display: flex; flex-direction: column; gap: 1px; padding: 5px 0; border-top: 1px solid var(--surface-3); color: var(--text-2); }
.edit-what { color: var(--text); }
tr.has-pending td { border-bottom: 0; }
.pending-row td { padding-top: 0 !important; }
.pending-edit {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--amber-bg); font-size: 13px;
}
.pending-what { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; min-width: 0; }
.pending-acts { display: inline-flex; gap: 8px; margin-left: auto; }
.edit-rule { margin: 14px 20px 0; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--green-bg); color: var(--green); font-size: 13px; }
.edit-rule.needs-approval { background: var(--amber-bg); color: var(--amber); }
@media (max-width: 860px), (pointer: coarse) {
  .row-actions .link, .edit-log summary { display: inline-flex; align-items: center; min-height: 40px; }
  .pending-acts .btn { min-height: 44px; }
}

/* ======================================================= History (super admin)
   Filters on one row; each person's share of the period; then everything done,
   newest first, under hour / day / week / month headings. */
.history-card { overflow: hidden; }
.history-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.history-search { flex: 1 1 260px; width: auto; }
.history-dates { display: inline-flex; align-items: center; gap: 6px; }
.history-dates input { min-height: 34px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.history-group { margin-left: auto; }
.history-client { padding: 10px 20px 0; }
.history-client .chip { gap: 6px; }
.history-client .icon-btn { width: 22px; height: 22px; font-size: 16px; line-height: 1; }
.history-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; padding: 14px 20px 4px; }
.history-people:empty { display: none; }
.h-person {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer;
  overflow: hidden; transition: border-color var(--ease), background var(--ease);
}
.h-person:hover { border-color: var(--border-strong); }
.h-person.is-on { border-color: var(--accent); background: var(--accent-soft); }
.h-person-text { display: flex; flex-direction: column; min-width: 0; }
.h-person-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-person-text .dim { font-size: 11px; }
.h-person-count { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.h-person-bar { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 3px; border-radius: 999px; background: var(--surface-3); }
.h-person-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.history-count { margin: 0; padding: 10px 20px 0; font-size: 13px; color: var(--text-4); }
.history-count:empty { display: none; }
.history-list { padding: 4px 0 8px; }
.h-group-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 10px 20px;
  border-bottom: 1px solid var(--surface-3); background: var(--surface); font-size: 13px; font-weight: 600;
}
.h-group-head .count { color: var(--text-4); font-weight: 600; font-variant-numeric: tabular-nums; }
.h-group-who { margin-left: auto; color: var(--text-4); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-list { margin: 0; padding: 0; list-style: none; }
.h-entry { display: grid; grid-template-columns: 64px 28px minmax(0, 1fr); gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--surface-3); }
.h-entry:last-child { border-bottom: 0; }
.h-entry.refused { background: var(--red-bg); }
.h-time { padding-top: 2px; color: var(--text-4); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.h-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--surface-3); color: var(--text-3); }
.h-icon svg { width: 14px; height: 14px; }
.kind-client .h-icon { background: var(--accent-soft); color: var(--accent); }
.kind-money .h-icon { background: var(--green-bg); color: var(--green); }
.kind-sales .h-icon { background: rgba(124, 58, 237, .12); color: #7c3aed; }
.kind-contact .h-icon { background: rgba(13, 148, 136, .12); color: #0f766e; }
.kind-settings .h-icon { background: var(--amber-bg); color: var(--amber); }
.kind-delete .h-icon, .refused .h-icon { background: var(--red-bg); color: var(--red); }
.kind-ai .h-icon { background: rgba(79, 70, 229, .12); color: #4f46e5; }
.h-body { min-width: 0; }
.h-line { margin: 0; font-size: 13px; line-height: 1.45; }
.h-who { padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.h-who:hover { color: var(--accent); text-decoration: underline; }
.h-what { color: var(--text-2); }
.h-what a { font-weight: 600; }
.h-detail { margin: 2px 0 0; font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.h-meta { margin: 3px 0 0; font-size: 11px; color: var(--text-4); }
.h-changes { width: 100%; max-width: 640px; margin-top: 6px; border-collapse: collapse; font-size: 12px; }
.h-changes th, .h-changes td { padding: 4px 8px; border: 1px solid var(--surface-3); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.h-changes thead th { background: var(--surface-2); color: var(--text-4); font-weight: 600; }
.h-changes tbody th { width: 26%; color: var(--text-3); font-weight: 500; }
.h-changes td:nth-child(2) { color: var(--text-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 55%, transparent); }
.h-changes td:nth-child(3) { color: var(--text); font-weight: 600; }
.h-more summary { margin-top: 4px; cursor: pointer; color: var(--accent); font-size: 12px; font-weight: 600; }
@media (max-width: 860px) {
  .history-controls { padding: 12px 16px; }
  .history-controls .select-inline { flex: 1 1 140px; }
  .history-controls .select-inline select { width: 100%; }
  .history-group { margin-left: 0; }
  .history-people { padding: 12px 16px 4px; grid-template-columns: 1fr 1fr; }
  .h-entry { grid-template-columns: 26px minmax(0, 1fr); gap: 4px 10px; padding: 10px 16px; }
  .h-time { grid-column: 2; grid-row: 1; padding: 0; }
  .h-icon { grid-row: 1 / span 2; }
  .h-body { grid-column: 2; }
  .h-group-head { padding: 10px 16px; }
  .h-group-who { display: none; }
}
@media (max-width: 860px), (pointer: coarse) {
  .h-who { min-height: 32px; }
  .h-person { min-height: 52px; }
}

/* The PMS column on the client list (Ang Systems). */
.pms-cell { color: var(--text-2); font-weight: 500; white-space: nowrap; }

/* ============================================================ dropdowns
   Every dropdown the same: the app's border, height and radius, with one
   chevron. On a computer the list opens in the app's own style (select.js);
   on a phone the phone's picker is kept. */
select:not([multiple]):not([size]) {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 10px center !important; background-size: 14px 14px !important;
  padding-right: 32px !important; text-overflow: ellipsis;
}
select:not([multiple]):not([size]):disabled { cursor: not-allowed; opacity: .7; }
select.cselect-open { border-color: var(--accent) !important; outline: 2px solid var(--accent-soft); outline-offset: 0; }

.cselect-menu {
  position: fixed; z-index: 60; display: flex; flex-direction: column; max-width: min(420px, calc(100vw - 16px)); padding: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg); outline: none; overflow: hidden; animation: cselect-in 120ms cubic-bezier(.22, 1, .36, 1);
}
@keyframes cselect-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .cselect-menu { animation: none; } }
.cselect-filter { padding: 0 0 6px; }
.cselect-filter input {
  width: 100%; min-height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
.cselect-filter input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.cselect-list { overflow-y: auto; overscroll-behavior: contain; }
.cselect-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-4); }
.cselect-option {
  display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px 0 8px; border-radius: 6px;
  font-size: 13px; line-height: 1.3; cursor: pointer; white-space: nowrap;
}
.cselect-option svg { flex: none; width: 14px; height: 14px; color: var(--accent); visibility: hidden; }
.cselect-option span { overflow: hidden; text-overflow: ellipsis; }
.cselect-option[aria-selected="true"] { font-weight: 600; }
.cselect-option[aria-selected="true"] svg { visibility: visible; }
.cselect-option.is-active { background: var(--surface-2); }
.cselect-option[aria-selected="true"].is-active { background: var(--accent-soft); }
.cselect-option.is-disabled { color: var(--text-4); cursor: default; }

/* ------------------------------------------ people: notes and other people */
.person-note { display: flex; align-items: flex-start; gap: 4px; margin-top: 4px; font-size: 12px; line-height: 1.4; color: var(--text-2); }
.person-note span { padding: 2px 8px; border-radius: 6px; background: var(--surface-3); overflow-wrap: anywhere; }
.note-edit {
  display: grid; place-items: center; flex: none; width: 24px; height: 22px; border: 0; border-radius: 6px;
  background: none; color: var(--text-4); cursor: pointer;
}
.note-edit svg { width: 13px; height: 13px; }
.note-edit:hover { background: var(--surface-3); color: var(--text); }
.note-add {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-top: 4px; padding: 2px 6px 2px 2px;
  border: 0; border-radius: 6px; background: none; color: var(--text-4); font: inherit; font-size: 12px; cursor: pointer;
}
.note-add svg { width: 13px; height: 13px; }
.note-add:hover { color: var(--accent); background: var(--accent-soft); }
.note-inline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.note-inline input {
  flex: 1 1 100%; min-height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
.note-inline input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

.people-others { border-top: 1px solid var(--surface-3); }
.people-list + .people-others { margin-top: 0; }
.people-sub {
  margin: 0; padding: 10px 16px 0; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4);
}
.people-sub span { margin-left: 4px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.assign-role { margin-top: 6px; align-self: flex-start; }
.assign-role select {
  min-height: 28px; padding: 0 30px 0 8px; border: 1px dashed var(--border-strong); border-radius: 6px;
  background-color: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer;
}
.assign-role select:hover { border-style: solid; color: var(--text); }

.person-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 12px 16px 14px; border-top: 1px solid var(--surface-3); }
.person-add label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--text-2); min-width: 0; }
.person-add label:first-child, .person-add label:nth-of-type(4) { grid-column: 1 / -1; }
.person-add :is(input, select) {
  width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background-color: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
.person-add :is(input, select):focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.person-add-hint { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--amber); }
.person-add-acts { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.side-head .btn-small svg { width: 14px; height: 14px; }

/* The hotel form's Other people rows. */
.others-block { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--surface-3); }
.others-block .form-hint { margin: 2px 0 6px; }
.person-line {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 8px 10px;
  grid-template-areas: "name name remove" "mobile email email" "note note note";
  padding: 10px 0; border-bottom: 1px dashed var(--border);
}
.person-line label:nth-of-type(1) { grid-area: name; }
.person-line label:nth-of-type(2) { grid-area: mobile; }
.person-line label:nth-of-type(3) { grid-area: email; }
.person-line .person-line-note { grid-area: note; }
.person-line [data-remove-person] { grid-area: remove; }
.person-line label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); min-width: 0; }
.person-line input {
  width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.person-line input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
#add-person { margin-top: 10px; }

@media (max-width: 860px) {
  .person-line input, .person-add :is(input, select), .note-inline input { min-height: 44px; font-size: 16px; }
  .note-add, .note-edit { min-height: 36px; }
  .note-edit { width: 36px; }
  .assign-role select { min-height: 40px; font-size: 14px; }
  .person-line { grid-template-areas: "name remove" "mobile mobile" "email email" "note note"; grid-template-columns: minmax(0, 1fr) auto; }
}

/* ------------------------------------------ editing what a role can do */
.tag-edited { margin-left: 0; background: var(--amber-bg); color: var(--amber); }
.tree-title .tag-edited { margin-right: auto; }

.permissions-table td { position: relative; }
.pm-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 30px; border: 1px solid transparent; border-radius: 6px;
  background: none; color: inherit; cursor: pointer; transition: background-color .15s ease-out, border-color .15s ease-out;
}
.pm-toggle:hover { background: var(--surface-3); border-color: var(--border); }
.pm-toggle[aria-pressed="false"]:hover .blank { color: var(--accent); }
.pm-toggle[aria-pressed="false"]:hover .blank::after { content: "+"; }
.pm-toggle[aria-pressed="false"]:hover .blank { font-size: 0; }
.pm-toggle[aria-pressed="false"]:hover .blank::after { font-size: 16px; font-weight: 600; }
.pm-toggle:disabled { opacity: .5; cursor: progress; }
.pm-changed::after, .pm-dot {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--amber);
}
.pm-changed::after { position: absolute; top: 7px; right: calc(50% - 22px); pointer-events: none; }
.pm-locked { color: var(--text-4); }
.pm-legend { margin: 10px 2px 0; font-size: 12px; color: var(--text-3); max-width: 90ch; }
.pm-legend .pm-dot { margin: 0 2px 1px 0; vertical-align: middle; }

.rf-list.is-editable { gap: 0 20px; }
.rf-list.is-editable li { padding: 0; }
.rf-switch {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 4px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font: inherit; font-size: 13px; line-height: 1.45; text-align: left; cursor: pointer;
}
.rf-switch:hover { background: var(--surface-2); }
.rf-switch:disabled { opacity: .6; cursor: progress; }
.rf-track {
  position: relative; flex: none; width: 30px; height: 18px; margin-top: 1px; border-radius: 999px;
  background: var(--border-strong); transition: background-color .18s ease-out;
}
.rf-thumb {
  position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .25); transition: transform .18s cubic-bezier(.25, 1, .5, 1);
}
.rf-switch[aria-checked="true"] .rf-track { background: var(--green); }
.rf-switch[aria-checked="true"] .rf-thumb { transform: translateX(12px); }
.rf-switch[aria-checked="false"] .rf-label { color: var(--text-3); }
.rf-label { flex: 1 1 auto; min-width: 0; }
.rf-changed { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font-size: 11px; font-weight: 600; }
.rf-lock, .rf-off { display: grid; place-items: center; flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--text-4); }
.rf-lock svg { width: 14px; height: 14px; }
.rf-more { margin-top: 12px; border-top: 1px solid var(--surface-3); }
.rf-more summary { padding: 10px 0 2px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.rf-more summary:hover { color: var(--text); }
.rf-more .rf-list { margin-top: 4px; }
.rf-more li:has(.rf-lock) { color: var(--text-4); }
.rf-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.rf-foot .rf-hint { margin: 0; }
@media (prefers-reduced-motion: reduce) { .rf-track, .rf-thumb { transition: none; } }
@media (max-width: 860px) {
  .rf-switch { min-height: 44px; padding: 10px 4px; }
}
.rf-list.is-editable li:not(:has(.rf-switch)) { padding: 8px 4px; }
@media (max-width: 860px) {
  /* On a phone the table is a list of what each role has; changes are made from one role's view. */
  .permissions-table .pm-toggle { display: none; }
  .permissions-table .pm-changed::after { display: none; }
  .pm-legend { display: none; }
}

/* On a phone the More button sits at the left edge: open its menu rightwards so it stays on screen. */
@media (max-width: 860px) {
  .dir-head .menu { left: 0; right: auto; max-width: calc(100vw - 32px); }
  .dir-head .menu-item { min-height: 44px; font-size: 15px; }
}

/* ------------------------------------------ v3.22: Clients, boards, Support */

/* Phones: the Remark log is reached from Support, so the bottom bar keeps its room;
   its due badge shows on Support there instead. */
.nav-badge-phone { display: none; }
@media (max-width: 860px) {
  .nav-item.nav-wide-only { display: none; }
  .nav-item .nav-badge-phone:not([hidden]) { display: inline-block; }
}

/* A product's name on hover, or on tap (focus) on a phone. */
[data-tip] { cursor: default; }
[data-tip]:focus { outline: none; }
[data-tip]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The label itself (tips.js): one element on top of the page, so no board or table can cut it off. */
.tip {
  position: fixed; left: 0; top: 0; z-index: 1000; max-width: min(320px, calc(100vw - 16px)); padding: 5px 9px; border-radius: 6px;
  background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: 12px; font-weight: 500; line-height: 1.35;
  pointer-events: none; opacity: 0; transition: opacity .12s ease-out; white-space: pre-line;
}
.tip.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
.product-icons { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 160px; }
/* The top row's tips would sit on the column heads: show those below. */

/* Compact switch on each board. */
.board-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 10px; }
.board-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.board-search { min-width: 220px; }
.compact-toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.compact-toggle svg { width: 15px; height: 15px; }
.compact-toggle:hover { color: var(--text); background: var(--surface-2); }
.compact-toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.board.is-compact .column-cards { gap: 6px; }
.kcard-compact { gap: 4px; padding: 8px 10px 6px; }
.kcard-compact .kcard-title { font-size: 13px; line-height: 1.3; }
.kcard-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; min-height: 28px; }
.kcard-line .want-icons { flex: 1 1 52px; min-width: 0; }
.dup-dot {
  display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--amber-bg); color: var(--amber); font-size: 11px; font-weight: 800;
}
.kcard-line .kcard-moves { flex: none; margin-left: auto; }
.kcard-line .badge, .kcard-line .prio { flex: none; }
.kcard-icons { margin-top: 4px; }
.kcard-dup { font-size: 11px; }

/* Sales: possible duplicate deals, side by side with Close and Delete. */
.sales-dups { margin-bottom: 16px; }
.sales-dups .dup-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 12px; padding: 12px 0; }
.dup-why { grid-column: 1 / -1; justify-self: start; }
.dup-deal-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dup-deal { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.dup-deal-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dup-deal-meta { font-size: 12px; color: var(--text-3); }
.dup-deal-acts { display: flex; gap: 6px; margin-top: 4px; }

/* Support board. */
.column[data-stage="in_progress"] { --stage: #0284c7; }
.column[data-stage="waiting"] { --stage: #d97706; }
.column[data-stage="done"] { --stage: #059669; }
.kcard-ticket { gap: 4px; }
.kcard-ticket.prio-card-urgent { border-color: var(--red-dot); }
.prio { flex: none; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.prio-high { background: var(--amber-bg); color: var(--amber); }
.prio-urgent { background: var(--red-bg); color: var(--red); }
.kcard-note { font-size: 12px; line-height: 1.4; color: var(--text-2); overflow-wrap: anywhere; }
.kcard-meta a { color: inherit; }
.kcard-meta a:hover { color: var(--accent); }
.ticket-who { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; color: var(--text-2); }
.avatar-xs {
  display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700;
}
.kcard-ticket .kcard-foot { flex-wrap: wrap; }
.btn-count { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--red-dot); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

@media (max-width: 860px) {
  .board-actions { justify-content: flex-start; width: 100%; }
  .board-filter, .board-search { flex: 1 1 100%; min-width: 0; }
  .compact-toggle { min-height: 44px; }
  .dup-deal-pair { grid-template-columns: minmax(0, 1fr); }
  .sales-dups .dup-list li { grid-template-columns: minmax(0, 1fr); }
  .dup-deal-acts .btn { flex: 1 1 auto; min-height: 44px; }
}
.board-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: -6px 0 14px; }
.board-toolbar .compact-toggle { margin-left: auto; }
@media (max-width: 860px) {
  .board-toolbar .board-search { flex: 1 1 100%; }
  .board-toolbar .compact-toggle { margin-left: 0; }
}
.sales-dups .dup-list li.dup-more { display: block; padding: 10px 0 2px; }

/* ------------------------------------------ v3.23: account, renewals, notifications */

/* The name at the foot of the sidebar opens Account. */
a.user-row { color: inherit; text-decoration: none; border-radius: 8px; padding: 4px; margin: -4px; }
a.user-row:hover { background: var(--side-hover); }

/* Account */
.account-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 20px 22px; margin-bottom: 16px; }
.account-avatar { width: 56px; height: 56px; font-size: 20px; background: var(--accent-soft); color: var(--accent); }
.account-who { flex: 1 1 240px; min-width: 0; }
.account-who h2 { font-size: 20px; font-weight: 700; }
.account-email { margin-top: 2px; color: var(--text-2); overflow-wrap: anywhere; }
.account-role { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.account-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.my-permission-list { list-style: none; margin: 12px 0 0; padding: 0; }
.my-permission-list li { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; border-top: 1px solid var(--surface-3); font-size: 13px; line-height: 1.45; }
.tick-ico { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--green); stroke-width: 2.5; }
.my-day + .my-day { margin-top: 10px; }
.my-lines { list-style: none; margin: 0; padding: 0; }
.my-lines li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--surface-3); font-size: 13px; }
.my-lines li.is-refused .my-what { color: var(--red); }
.my-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--surface-3); color: var(--text-3); }
.my-ico svg { width: 14px; height: 14px; }
.my-ico.kind-money { background: var(--green-bg); color: var(--green); }
.my-ico.kind-contact { background: var(--accent-soft); color: var(--accent); }
.my-ico.kind-delete { background: var(--red-bg); color: var(--red); }
.my-what { overflow-wrap: anywhere; }

/* Dashboard → Renewals */
.renewals { margin-bottom: 16px; }
.renew-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--surface-3); border-bottom: 1px solid var(--surface-3); }
.renew-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; border: 0; border-left: 1px solid var(--surface-3);
  background: none; color: inherit; font: inherit; text-align: left;
}
.renew-stat:first-child { border-left: 0; }
button.renew-stat { cursor: pointer; transition: background-color .15s ease-out; }
button.renew-stat:hover { background: var(--surface-2); }
button.renew-stat[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.renew-value { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--text); }
.renew-amount { font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tone-red .renew-value { color: var(--red); }
.tone-amber .renew-value { color: var(--amber); }
.tone-green .renew-value { color: var(--green); }
.renew-lines { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 20px 0; }
.renew-lines:empty { display: none; }
.renew-lines-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); margin-right: 4px; }
.renew-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); font-size: 12px; color: var(--text-2); }
.renew-chip strong { color: var(--text); }
.renew-list { padding: 8px 20px 12px; }
.renew-list-head { margin: 4px 0 2px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.renew-rows { list-style: none; margin: 0; padding: 0; }
.renew-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 150px 96px; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--surface-3); }
.renew-who { display: flex; flex-direction: column; min-width: 0; }
.renew-who .sub, .renew-when .sub { font-size: 12px; color: var(--text-3); }
.renew-bell svg { width: 12px; height: 12px; vertical-align: -1px; color: var(--accent); }
.renew-fee { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.renew-when { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.renew-act { justify-self: end; }
.renew-more { margin-top: 8px; font-size: 13px; }

/* Notifications: one card per section */
.notif-sections { display: grid; gap: 16px; }
.notif-section .card-head h2 { display: flex; align-items: center; gap: 8px; }
.notif-section .notif-list { margin: 0; }

/* Send again, under a WhatsApp in a contact log */
.entry-resend { margin-top: 6px; align-self: flex-start; }

@media (max-width: 1100px) {
  .renew-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .renew-stat:nth-child(3) { border-left: 0; }
  .renew-stat:nth-child(n + 3) { border-top: 1px solid var(--surface-3); }
}
@media (max-width: 860px) {
  .renew-lines { padding: 10px 16px 0; }
  .renew-list { padding: 8px 16px 12px; }
  .renew-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who fee" "when act"; gap: 6px 10px; }
  .renew-who { grid-area: who; } .renew-fee { grid-area: fee; } .renew-when { grid-area: when; } .renew-act { grid-area: act; }
  .renew-act .btn { min-height: 44px; }
  .account-acts { width: 100%; }
  .account-acts .btn { flex: 1 1 auto; min-height: 44px; }
}

/* ------------------------------------------ v3.24: minimised columns, touch drag */
.board { grid-template-columns: repeat(var(--columns, 4), minmax(172px, 1fr)); }
.column-head h2 { flex: 1 1 auto; min-width: 0; }
.col-toggle {
  display: grid; place-items: center; flex: none; width: 26px; height: 26px; margin: -4px -4px -4px 0; border: 0; border-radius: 6px;
  background: none; color: var(--text-4); cursor: pointer; transition: background-color .15s ease-out, color .15s ease-out;
}
.col-toggle svg { width: 15px; height: 15px; }
.col-toggle:hover { background: var(--surface); color: var(--text); }

/* A minimised column: a narrow strip with its name running up it and its count; click to open. */
.column.is-min { padding: 8px 4px; cursor: pointer; }
.column.is-min:hover { background: var(--surface-2); }
.column.is-min .column-head { flex-direction: column-reverse; align-items: center; justify-content: flex-end; gap: 10px; padding: 0; }
.column.is-min .column-head h2 { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; flex: none; }
.column.is-min .column-head h2::before { margin: 0 0 7px; }
.column.is-min .col-toggle { margin: 0; }
.column.is-min :is(.column-sub, .column-cards) { display: none; }
.column.is-min.drop { background: var(--accent-soft); }

/* Touch: hold a card, then drag the copy that lifts off it. */
@media (pointer: coarse) {
  .kcard[draggable="true"] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .kcard[draggable="true"] a { -webkit-touch-callout: none; }
}
.kcard.holding { transform: scale(.98); transition: transform .3s ease-out; }
.kcard-ghost {
  position: fixed; left: 0; top: 0; z-index: 60; margin: 0; pointer-events: none; opacity: .96;
  box-shadow: var(--shadow-lg); border-color: var(--accent);
}
@media (prefers-reduced-motion: reduce) { .kcard.holding { transition: none; } }
.column-head { gap: 6px; }
.column:not(.is-min) .column-head h2 { display: flex; align-items: baseline; }
.column:not(.is-min) .column-head h2::before { flex: none; }

/* Sales figures: one slim line instead of four boxes. */
.sales-figures { display: flex; align-items: stretch; margin-bottom: 14px; padding: 0; }
.sales-fig { display: flex; align-items: baseline; gap: 8px; flex: 1 1 0; min-width: 0; padding: 9px 14px; border-left: 1px solid var(--surface-3); }
.sales-fig:first-child { border-left: 0; }
.sales-fig-label { font-size: 12px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.sales-fig-value { font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.sales-fig-note { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 860px) {
  .sales-figures { flex-wrap: wrap; }
  .sales-fig { flex: 1 1 45%; padding: 8px 12px; }
  .sales-fig:nth-child(3) { border-left: 0; }
  .sales-fig:nth-child(n + 3) { border-top: 1px solid var(--surface-3); }
  .sales-fig-note { display: none; }
}

/* Account: What you can do opens on request. */
.perm-card summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.perm-card summary::-webkit-details-marker { display: none; }
.perm-title { display: flex; flex-direction: column; gap: 2px; }
.perm-h { font-size: 15px; font-weight: 600; color: var(--text); }
.perm-open { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); }
.perm-open svg { width: 16px; height: 16px; transition: transform .2s ease-out; }
.perm-card[open] .perm-open svg { transform: rotate(180deg); }
.perm-card summary:hover .perm-open { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .perm-open svg { transition: none; } }

/* Notifications: Renewals and Mentions side by side; payment changes across the bottom. */
.notif-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.notif-sections .notif-payment { grid-column: 1 / -1; }
@media (max-width: 960px) { .notif-sections { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------ v3.25: onboarding traffic lights */
/* A product on an Onboarding card: green Complete, yellow Pending, red Not done, grey Not set. */
.ob-light {
  position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1.5px solid transparent; border-radius: 7px;
  font: inherit; cursor: default;
}
button.ob-light { cursor: pointer; }
.ob-light svg { width: 14px; height: 14px; }
.ob-light.st-done { background: var(--green-bg); color: var(--green); border-color: var(--green-dot); }
.ob-light.st-pending { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-dot); }
.ob-light.st-todo { background: var(--red-bg); color: var(--red); border-color: var(--red-dot); }
.ob-light.st-none { background: var(--surface-3); color: var(--text-4); border-color: var(--border); }
button.ob-light:hover { filter: brightness(.96); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--border-strong); }
.ob-mark {
  position: absolute; right: -5px; bottom: -5px; display: grid; place-items: center; min-width: 14px; height: 14px; padding: 0 2px; border-radius: 7px;
  background: currentColor; font-size: 9px; font-weight: 800; line-height: 1;
}
.ob-light.st-done .ob-mark { background: var(--green-dot); color: #fff; }
.ob-light.st-pending .ob-mark { background: var(--amber-dot); color: #fff; }
.ob-light.st-todo .ob-mark { background: var(--red-dot); color: #fff; }
.ob-note-dot { position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.ob-lights { gap: 6px; }
.ob-progress { font-size: 12px; color: var(--text-3); }
.ob-progress.is-done { color: var(--green); font-weight: 600; }

.ob-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: -8px 0 12px; font-size: 12px; color: var(--text-2); }
.ob-key { display: inline-block; width: 10px; height: 10px; margin-left: 6px; border-radius: 3px; }
.ob-key:first-child { margin-left: 0; }
.ob-key.st-done { background: var(--green-dot); }
.ob-key.st-pending { background: var(--amber-dot); }
.ob-key.st-todo { background: var(--red-dot); }
.ob-key.st-none { background: var(--border-strong); }

/* The panel to mark one product. */
.ob-pop {
  position: fixed; z-index: 70; width: min(340px, calc(100vw - 16px)); padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.ob-pop[hidden] { display: none; }
.ob-pop-title { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.ob-pop-title svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--text-3); }
.ob-pop-title .sub { display: block; font-size: 12px; color: var(--text-3); }
.ob-pop-states { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ob-state {
  display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer;
}
.ob-state:hover { background: var(--surface-2); color: var(--text); }
.ob-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ob-state.st-done .ob-dot { background: var(--green-dot); }
.ob-state.st-pending .ob-dot { background: var(--amber-dot); }
.ob-state.st-todo .ob-dot { background: var(--red-dot); }
.ob-state.st-none .ob-dot { background: var(--border-strong); }
.ob-state[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600; }
.ob-pop-note { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.ob-pop-note input {
  min-height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
.ob-pop-note input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.ob-pop-acts { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
@media (max-width: 860px) {
  .ob-light { width: 34px; height: 34px; }
  .ob-state, .ob-pop-note input { min-height: 44px; font-size: 16px; }
}
.notif-section { overflow: hidden; }

/* ------------------------------------------ v3.26: notifications in three, account in Settings */
.notif-sections { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .notif-sections { grid-template-columns: minmax(0, 1fr); } }
.notif-item { position: relative; }
.notif-item .notif { padding-right: 52px; }
.notif-reach { position: absolute; right: 16px; bottom: 12px; }

/* Compact rows: one line each. */
.notif-list.is-compact { margin: 0; }
.nrow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto 30px; align-items: center; gap: 10px;
  min-height: 46px; padding: 6px 16px; border-bottom: 1px solid var(--surface-3); font-size: 13px;
}
.nrow.unread { background: var(--accent-soft); }
.nrow-short { grid-template-columns: 26px minmax(0, 1fr) auto; }
.nrow-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; text-decoration: none; }
.nrow-short .nrow-name { font-weight: 400; }
.nrow-name:hover { color: var(--accent); }
.nrow-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nrow time, .nrow .dim { font-size: 12px; white-space: nowrap; }
.nrow .entry-icon { width: 26px; height: 26px; }

/* WhatsApp the client, or ! when there's no number. */
.reach { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; text-decoration: none; }
.reach svg { width: 16px; height: 16px; }
.reach-wa { background: var(--green-bg); color: var(--whatsapp, var(--green)); }
.reach-wa:hover { background: var(--whatsapp, var(--green)); color: #fff; }
.reach-missing { background: var(--red-bg); color: var(--red); font-size: 15px; font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--red-dot); }
.reach-missing:hover { background: var(--red-dot); color: #fff; }

/* The contact log column. */
.clog { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--surface-3); }
.clog-body { min-width: 0; }
.clog-meta { font-size: 13px; color: var(--text-2); }
.clog-note { margin-top: 2px; font-size: 13px; color: var(--text); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clog-when { margin-top: 2px; font-size: 12px; }
.clog-alerts { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--surface-3); }
.clog-alert { padding: 3px 10px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font-size: 12px; font-weight: 600; text-decoration: none; }
.clog-alert:hover { text-decoration: underline; }
.clog-more { padding: 10px 16px; font-size: 13px; }

/* Settings → your account, in one line; the whole of it opens Account. */
.account-mini { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; color: inherit; text-decoration: none; transition: border-color .15s ease-out, background-color .15s ease-out; }
.account-mini:hover { border-color: var(--border-strong); background: var(--surface-2); }
.account-mini-avatar { width: 40px; height: 40px; font-size: 14px; background: var(--accent-soft); color: var(--accent); }
.account-mini-who { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; }
.account-mini-email { font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }
.account-mini-open { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent); }
.account-mini-open svg { width: 16px; height: 16px; }

/* ------------------------------------------ v3.27: people colours, tasks, calendar, insights */

/* A person's avatar in their own colour. */
.pavatar {
  display: inline-grid; place-items: center; flex: none; width: var(--ps, 24px); height: var(--ps, 24px); border-radius: 50%;
  background: var(--pc, #64748b); color: #fff; font-size: calc(var(--ps, 24px) * .42); font-weight: 700; line-height: 1; letter-spacing: .01em;
}
.pavatars { display: inline-flex; align-items: center; }
.pavatars .pavatar { box-shadow: 0 0 0 2px var(--surface); }
.pavatars .pavatar + .pavatar { margin-left: -6px; }
.pavatar-more { background: var(--surface-3); color: var(--text-2); }
#user-initials { color: #fff; }

/* Your colour (Account). */
.colour-picks { display: grid; grid-template-columns: repeat(auto-fill, 34px); gap: 8px; margin-top: 12px; }
.colour-pick {
  position: relative; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--pc); color: #fff; cursor: pointer; transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.colour-pick svg { width: 16px; height: 16px; stroke-width: 3; }
.colour-pick:hover:not([disabled]) { transform: scale(1.08); }
.colour-pick.is-mine { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--pc); }
.colour-pick[disabled] { opacity: .3; cursor: not-allowed; }
.colour-pick[disabled]::after { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: #fff; transform: rotate(-45deg); }

/* Choosing people (tasks, onboarding). */
.people-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.people-picks-col { flex-direction: column; flex-wrap: nowrap; }
.person-pick {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 12px 4px 5px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; text-align: left;
}
.people-picks-col .person-pick { border-radius: var(--radius-sm); }
.person-pick:hover { border-color: var(--border-strong); color: var(--text); }
.person-pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600; }
.field-block { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text-2); padding: 0; }
.check-row { flex-direction: row !important; align-items: center; gap: 8px !important; }
.dialog-narrow { width: min(420px, calc(100vw - 24px)); }
.dialog-body { padding: 4px 20px 12px; }
.dialog-body .form-note { margin-bottom: 12px; }

/* Tasks */
.tasks-card { padding: 0; }
.tasks-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--surface-3); }
.tasks-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tasks-tabs [aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.task-quick { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--surface-3); background: var(--surface-2); }
.task-quick-plus { display: grid; place-items: center; width: 22px; height: 22px; color: var(--accent); }
.task-quick-plus svg { width: 18px; height: 18px; }
.task-quick input[name="title"] { flex: 1 1 auto; min-width: 0; min-height: 36px; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; }
.task-quick input[name="title"]:focus { outline: none; }
.task-quick:focus-within { background: var(--surface); box-shadow: inset 0 -2px 0 var(--accent); }
.task-quick-date input { min-height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; }
.task-group { padding: 4px 16px 8px; }
.task-group-overdue .log-group-head { color: var(--red); }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto 96px; align-items: center; gap: 10px;
  min-height: 48px; padding: 6px 0; border-top: 1px solid var(--surface-3);
}
.task-check {
  display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 2px solid var(--border-strong); border-radius: 50%;
  background: var(--surface); color: transparent; cursor: pointer; transition: background-color .15s ease-out, border-color .15s ease-out;
}
.task-check svg { width: 13px; height: 13px; stroke-width: 3; }
.task-check:hover { border-color: var(--green-dot); color: var(--green-dot); }
.task-check[aria-checked="true"] { background: var(--green-dot); border-color: var(--green-dot); color: #fff; }
.task-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 2px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.task-title { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.task-main:hover .task-title { color: var(--accent); }
.task-row.is-done .task-title { color: var(--text-3); text-decoration: line-through; }
.task-sub { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; }
.task-client { padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.task-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.task-prio { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.task-prio svg { width: 14px; height: 14px; }
.task-prio.prio-high { color: var(--red); }
.task-prio.prio-medium { color: var(--amber); }
.task-prio.prio-low { color: var(--text-3); }
.task-when { justify-self: end; }
.prio-pick { display: inline-flex; }

/* Calendar */
.cal-head { align-items: center; }
.cal-title { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cal-title h1 { min-width: 200px; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.cal-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.cal-people summary { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); cursor: pointer; padding: 4px 0; }
.cal-people-acts { font-size: 12px; margin: 2px 0 6px; color: var(--text-4); }
.cal-checks { list-style: none; margin: 0; padding: 0; }
.cal-check { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 2px 6px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.cal-check:hover { background: var(--surface-3); }
.cal-check input { position: absolute; opacity: 0; pointer-events: none; }
.cal-box { display: grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--pc, var(--text-3)); }
.cal-check input:checked + .cal-box { background: var(--pc, var(--text-3)); }
.cal-check input:checked + .cal-box::after { content: ""; width: 8px; height: 4px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.cal-check input:focus-visible + .cal-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-check.layer-tasks { --pc: var(--text-2); }
.cal-check.layer-renewals { --pc: var(--amber-dot); }
.cal-check.layer-followups { --pc: var(--accent); }
.cal-check.layer-whatsapp { --pc: var(--whatsapp); }

.mini-month { padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.mini-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 6px; font-size: 13px; }
.mini-head strong { flex: 1; text-align: center; }
.mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.mini-dow { text-align: center; font-size: 11px; color: var(--text-4); padding: 2px 0; }
.mini-day {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; min-height: 28px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.mini-day:hover { background: var(--surface-3); }
.mini-day.is-other { color: var(--text-4); }
.mini-day.is-today { color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--accent); }
.mini-day.is-picked { background: var(--accent); color: #fff; font-weight: 700; }
.mini-dots { position: absolute; left: 0; right: 0; bottom: 2px; display: flex; justify-content: center; gap: 2px; }
.mini-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--pc); }
.mini-day.is-picked .mini-dots i { background: #fff; }

.cal-main { padding: 0; overflow: hidden; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-dow span { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(116px, auto); }
.cal-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 4px 5px 6px; border-right: 1px solid var(--surface-3); border-bottom: 1px solid var(--surface-3); }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.is-weekend { background: var(--surface-2); }
.cal-cell.is-other { background: var(--surface-2); }
.cal-cell.is-other .cal-daynum { color: var(--text-4); }
.cal-daynum {
  align-self: flex-start; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border: 0; border-radius: 13px;
  background: none; color: var(--text-2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.cal-daynum:hover { background: var(--surface-3); }
.cal-cell.is-today .cal-daynum { background: var(--accent); color: #fff; }
.cal-cell-items { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-more { align-self: flex-start; padding: 1px 6px; border: 0; border-radius: 4px; background: none; color: var(--text-3); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.cal-more:hover { background: var(--surface-3); color: var(--text); }

.cal-chip {
  display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; min-height: 22px; padding: 2px 6px; border: 0; border-radius: 5px;
  background: color-mix(in srgb, var(--pc, var(--text-3)) 15%, var(--surface)); color: var(--text); font: inherit; font-size: 12px; text-align: left; cursor: pointer;
}
.cal-chip:hover { background: color-mix(in srgb, var(--pc, var(--text-3)) 26%, var(--surface)); }
.cal-chip svg { flex: none; width: 12px; height: 12px; color: var(--pc, var(--text-3)); }
.cal-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--pc, var(--text-3)); }
.cal-time { flex: none; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-sub { display: none; }
.cal-chip.kind-renewal { --pc: var(--amber-dot); }
.cal-chip.kind-whatsapp { --pc: var(--whatsapp); }
.cal-chip.kind-followup:not([style*="--pc"]) { --pc: var(--accent); }
.cal-chip.is-done .cal-label { text-decoration: line-through; color: var(--text-3); }

.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 420px; }
.cal-wcol { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--surface-3); }
.cal-wcol:last-child { border-right: 0; }
.cal-wcol.is-today { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.cal-whead { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--surface-3); background: none; color: var(--text-3); font: inherit; font-size: 12px; cursor: pointer; }
.cal-whead strong { font-size: 18px; color: var(--text); }
.cal-wcol.is-today .cal-whead strong { color: var(--accent); }
.cal-wlist { display: flex; flex-direction: column; gap: 4px; padding: 8px 6px; flex: 1; }
.cal-wlist .cal-chip { flex-wrap: wrap; align-items: flex-start; }
.cal-wlist .cal-label { white-space: normal; }
.cal-wlist .cal-sub { display: block; width: 100%; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-empty { font-size: 12px; color: var(--text-4); padding: 4px 2px; }

.cal-day { list-style: none; margin: 0; padding: 8px 16px 16px; min-height: 300px; }
.cal-dayrow { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--surface-3); }
.cal-daytime { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal-daytime .dim { font-weight: 400; font-size: 12px; }
.cal-day .cal-chip { min-height: 40px; padding: 6px 10px; font-size: 14px; flex-wrap: wrap; }
.cal-day .cal-label { white-space: normal; }
.cal-day .cal-sub { display: block; width: 100%; font-size: 12px; color: var(--text-3); }
.cal-daywho { display: inline-flex; gap: 4px; }

/* Dashboard: small calendar beside Renewals, and Software */
.renew-body { display: grid; grid-template-columns: minmax(0, 1fr) 270px; }
.renew-main { min-width: 0; }
.renew-cal { padding: 12px 16px 16px; border-left: 1px solid var(--surface-3); }
.renew-cal .mini-month { border: 0; padding: 0; }
.renew-cal-day { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--surface-3); }
.renew-cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.renew-cal-head .link { font-weight: 500; font-size: 12px; }
.renew-cal-items { display: flex; flex-direction: column; gap: 3px; }
.renew-cal-free { font-size: 12px; }

.software-card { margin-bottom: 16px; }
.software-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.software-spend, .software-best { padding: 14px 20px 18px; min-width: 0; }
.software-best { border-left: 1px solid var(--surface-3); }
.software-spend[hidden] + .software-best, html:not([data-perms~="finance.view"]) .software-best { border-left: 0; grid-column: 1 / -1; }
.sw-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); margin-bottom: 6px; }
.sw-big { font-size: 15px; color: var(--text-2); }
.sw-big strong { font-size: 26px; color: var(--text); font-variant-numeric: tabular-nums; }
.sw-note { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.sw-lines { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 13px; }
.sw-lines th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-4); padding: 4px 0; border-bottom: 1px solid var(--surface-3); }
.sw-lines td { padding: 6px 0; border-bottom: 1px solid var(--surface-3); }
.sw-lines .num { text-align: right; font-variant-numeric: tabular-nums; }
.sw-rank { list-style: none; margin: 0; padding: 0; }
.sw-rank li { border-bottom: 1px solid var(--surface-3); font-size: 13px; }
.sw-row { display: grid; grid-template-columns: 22px 26px minmax(90px, 1fr) minmax(60px, 1.2fr) auto auto 14px; align-items: center; gap: 10px; width: 100%; padding: 7px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sw-pos { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); font-size: 11px; font-weight: 700; color: var(--text-2); }
.sw-rank li.is-top .sw-pos { background: var(--amber-bg); color: var(--amber); box-shadow: inset 0 0 0 1.5px var(--amber-dot); }
.sw-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.sw-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.sw-rank li.is-top .sw-bar i { background: var(--amber-dot); }
.sw-count { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sw-count .dim { font-weight: 400; font-size: 12px; }
.sw-avg { font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Onboarding: who's on it */
.ob-team { display: inline-flex; align-items: center; gap: 4px; padding: 2px; border: 0; border-radius: 999px; background: none; color: var(--text-3); font: inherit; font-size: 12px; cursor: pointer; }
.ob-team:hover { background: var(--surface-3); }
.ob-team-none { padding: 3px 8px 3px 6px; border: 1px dashed var(--border-strong); }
.ob-team-none svg { width: 13px; height: 13px; }
.ob-team-none:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 1100px) {
  .renew-body { grid-template-columns: minmax(0, 1fr); }
  .renew-cal { border-left: 0; border-top: 1px solid var(--surface-3); display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 16px; }
  .renew-cal-day { margin-top: 0; padding-top: 0; border-top: 0; }
  .software-body { grid-template-columns: minmax(0, 1fr); }
  .software-best { border-left: 0; border-top: 1px solid var(--surface-3); }
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .cal-side { position: static; display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 860px) {
  .renew-cal { grid-template-columns: minmax(0, 1fr); }
  .cal-side { grid-template-columns: minmax(0, 1fr); }
  .cal-people:not([open]) { }
  .cal-grid { grid-auto-rows: minmax(64px, auto); }
  .cal-cell { padding: 2px; }
  .cal-cell .cal-chip { padding: 1px 3px; min-height: 16px; font-size: 10px; }
  .cal-cell .cal-chip svg, .cal-cell .cal-time { display: none; }
  .cal-dow span { padding: 6px 2px; text-align: center; }
  .cal-week { grid-template-columns: minmax(0, 1fr); }
  .cal-wcol { border-right: 0; border-bottom: 1px solid var(--surface-3); }
  .cal-whead { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 8px 12px; }
  .task-row { grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "check main when" "check people prio"; row-gap: 4px; }
  .task-check { grid-area: check; } .task-main { grid-area: main; } .task-when { grid-area: when; } .task-people { grid-area: people; } .task-prio { grid-area: prio; justify-self: end; }
  .task-quick { flex-wrap: wrap; }
  .sw-row { grid-template-columns: 22px 26px minmax(0, 1fr) auto 14px; }
  .sw-row .sw-bar, .sw-avg, .sw-row > span:empty { display: none; }
}
.cal-day .cal-time { display: none; }

/* ------------------------------------------ v3.28: client contacts layout, frozen heading */
/* The search sits in the list's heading; the filters and totals on one line beneath. */
.dir-head > .dir-search { flex: 1 1 320px; max-width: none; margin: 0 8px; }
.dir-head > .dir-search input { width: 100%; }
.dir-filters { flex-wrap: nowrap; }
.dir-filters .select-inline { flex: 1 1 150px; min-width: 0; }
.dir-filters .select-inline select { width: 100%; max-width: none; }
.dir-filters .cycle-wrap { flex: none; margin-left: 8px; }
.dir-filters .cycle-total { white-space: nowrap; }
@media (max-width: 1400px) {
  .dir-filters { flex-wrap: wrap; }
  .dir-filters .cycle-wrap { margin-left: auto; }
}
@media (max-width: 860px) {
  .dir-head > .dir-search { order: 3; flex-basis: 100%; margin: 0; }
}

/* The column headings stay on screen while you scroll the list. */
#directory { overflow: clip; }
#directory .table-wrap.fits { overflow: visible; }
#directory .table-wrap:not(.fits) { max-height: calc(100vh - 140px); overflow: auto; }
#directory .hotels thead th {
  position: sticky; top: 0; z-index: 5; background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--border);
}

/* ------------------------------------------ high contrast (Account → Appearance) */
/* Darker text and stronger lines in Light; brighter text and stronger lines in Dark. */
:root[data-contrast="high"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --surface-3: #e6eaf0;
  --border: #8a96a8;
  --border-strong: #4b5565;
  --border-hover: #1e293b;
  --text: #020617;
  --text-2: #0f172a;
  --text-3: #1e293b;
  --text-4: #334155;
  --accent: #00457c;
  --accent-hover: #00335c;
  --accent-soft: #d6e9fb;
  --primary: #00457c;
  --primary-hover: #00335c;
  --whatsapp: #065f32;
  --row-hover: #eef2f7;
  --side-text: #f8fafc;
  --side-dim: #e2e8f0;
  --green: #065f46;  --green-bg: #dff7ec;  --green-dot: #047857;
  --amber: #7c3a03;  --amber-bg: #fdf0d2;  --amber-dot: #b45309;
  --red: #8f1414;    --red-bg: #fde3e3;    --red-dot: #c81e1e;
  --grey: #1e293b;   --grey-bg: #e6eaf0;   --grey-dot: #475569;
  --orange: #8a2e05; --orange-bg: #fde8d7; --orange-dot: #c2410c;
  --shadow: 0 1px 3px rgba(2, 6, 23, .18);
}
:root[data-theme="dark"][data-contrast="high"] {
  --bg: #03060c;
  --surface: #0a0f1a;
  --surface-2: #0f1626;
  --surface-3: #18223a;
  --border: #5b6b84;
  --border-strong: #8494ad;
  --border-hover: #b8c4d6;
  --text: #f8fafc;
  --text-2: #f1f5f9;
  --text-3: #e2e8f0;
  --text-4: #cbd5e1;
  --accent: #b3e6ff;
  --accent-hover: #e0f4ff;
  --accent-soft: rgba(125, 211, 252, .24);
  --primary: #005a9c;
  --primary-hover: #0369a1;
  --whatsapp: #6ee7b7;
  --row-hover: #141e33;
  --side-bg: #000307;
  --green: #b5f5d8;  --green-bg: rgba(16, 185, 129, .24);  --green-dot: #5eead4;
  --amber: #fde68a;  --amber-bg: rgba(245, 158, 11, .24);  --amber-dot: #fcd34d;
  --red: #fecaca;    --red-bg: rgba(239, 68, 68, .26);     --red-dot: #fca5a5;
  --grey: #e2e8f0;   --grey-bg: rgba(148, 163, 184, .22); --grey-dot: #94a3b8;
  --orange: #fed7aa; --orange-bg: rgba(249, 115, 22, .24); --orange-dot: #fdba74;
}
:root[data-contrast="high"] :focus-visible { outline-width: 3px; }
:root[data-contrast="high"] .badge, :root[data-contrast="high"] .tag-chip, :root[data-contrast="high"] .pay-chip { box-shadow: inset 0 0 0 1px currentColor; }
:root[data-contrast="high"] a.link, :root[data-contrast="high"] .row-title { text-decoration: underline; text-underline-offset: 2px; }
:root[data-contrast="high"] .table td { border-bottom-color: var(--border); }
:root[data-contrast="high"] .card { border-width: 1.5px; }

.contrast-pick { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--surface-3); }
.contrast-pick .form-hint { margin: 0; }

/* The sun / moon in the sidebar. */
#theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] #theme-toggle .ico-sun { display: block; }
:root[data-theme="dark"] #theme-toggle .ico-moon { display: none; }

/* Archive a read mention, or bring it back. */
.notif-archive {
  position: absolute; right: 12px; top: 10px; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: none; color: var(--text-4); cursor: pointer;
}
.notif-archive svg { width: 16px; height: 16px; }
.notif-archive:hover { background: var(--surface-3); color: var(--text); }
.nrow .notif-archive { position: static; }
.nrow-short { grid-template-columns: 26px minmax(0, 1fr) auto 30px; }
.notif-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 16px; border-bottom: 1px solid var(--surface-3); font-size: 13px; }
.notif-tools:not(:has(*)) { display: none; }
.notif-tools .link { margin-left: auto; }

/* Calendar → Day: the day before, the day and the day after. */
.cal-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: 360px; }
.cal-dcol { min-width: 0; border-right: 1px solid var(--surface-3); }
.cal-dcol:last-child { border-right: 0; }
.cal-dcol.is-focus { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.cal-dhead {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 10px 16px; border: 0;
  border-bottom: 1px solid var(--surface-3); background: none; color: var(--text-3); font: inherit; font-size: 12px; text-align: left; cursor: pointer;
}
.cal-dhead strong { font-size: 18px; color: var(--text); }
.cal-dcol.is-today .cal-dhead strong { color: var(--accent); }
.cal-dcol.is-focus .cal-dhead { box-shadow: inset 0 -2px 0 var(--accent); }
.cal-three .cal-day { min-height: 0; padding: 4px 12px 12px; }
.cal-three .cal-dayrow { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; }
.cal-three .cal-day .cal-chip { min-height: 34px; font-size: 13px; }
.cal-dempty { padding: 14px 16px; }
@media (max-width: 860px) {
  .cal-three { grid-template-columns: minmax(0, 1fr); }
  .cal-dcol { border-right: 0; border-bottom: 1px solid var(--surface-3); }
}

/* ------------------------------------------ v3.29: Insights (the company report) */
.insights-page { max-width: 1100px; }
.ins-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ins-fig { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.ins-fig-label { font-size: 12px; font-weight: 500; color: var(--text-3); }
.ins-fig-value { font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-fig-note { font-size: 12px; color: var(--text-3); }
.ins-fig.tone-red .ins-fig-value { color: var(--red); }
.ins-fig.tone-amber .ins-fig-value { color: var(--amber); }
.ins-card { padding: 14px 18px 16px; margin-bottom: 16px; }
.ins-h { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.ins-sub { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); margin-bottom: 6px; }
.ins-software { padding: 0; }
.ins-software .ins-h { padding: 14px 20px 0; margin: 0; }
.ins-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ins-table td, .ins-table th { padding: 5px 0; border-bottom: 1px solid var(--surface-3); text-align: left; }
.ins-table .num { text-align: right; font-variant-numeric: tabular-nums; padding-left: 10px; white-space: nowrap; }
.ins-share { width: 40%; padding: 5px 10px !important; }
.ins-share .sw-bar { display: block; }
.ins-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ins-four { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }

/* Billing over 12 months: one hue, rounded tops on one baseline, 2px apart; amounts in the table below. */
.ins-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; align-items: end; height: 140px; margin-top: 10px; border-bottom: 1px solid var(--border-strong); }
.ins-bar { position: relative; display: flex; align-items: flex-end; height: 100%; padding: 0 3px; cursor: default; }
.ins-bar:hover .ins-bar-fill, .ins-bar:focus .ins-bar-fill { background: var(--accent-hover); }
.ins-bar-fill { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--accent); }
.ins-months { table-layout: fixed; margin-top: 4px; }
.ins-months th, .ins-months td { text-align: center; padding: 3px 0; font-size: 11px; border: 0; }
.ins-months th { font-weight: 500; color: var(--text-3); }
.ins-months td { font-weight: 600; font-variant-numeric: tabular-nums; }
.ins-footer { margin-top: 4px; font-size: 11px; color: var(--text-4); text-align: right; }

/* Activity heatmap (Account, History): one green, light to dark. */
.heatmap { --hm0: var(--surface-3); --hm1: #b9e7c4; --hm2: #6fcf88; --hm3: #2fa356; --hm4: #1a6b37; }
:root[data-theme="dark"] .heatmap { --hm1: #0e4429; --hm2: #006d32; --hm3: #26a641; --hm4: #39d353; }
.hm-scroll { overflow-x: auto; padding-bottom: 4px; }
.hm-grid { display: grid; grid-template-columns: 28px repeat(var(--weeks), 11px); grid-template-rows: 16px repeat(7, 11px); gap: 3px; width: max-content; font-size: 10px; color: var(--text-4); }
.hm-grid > span:not(.hm-cell) { line-height: 11px; white-space: nowrap; }
.hm-day { grid-column: 1; }
.hm-cell { width: 11px; height: 11px; border-radius: 2px; background: var(--hm0); outline: 1px solid color-mix(in srgb, var(--text) 6%, transparent); outline-offset: -1px; }
.hm-cell.l1 { background: var(--hm1); }
.hm-cell.l2 { background: var(--hm2); }
.hm-cell.l3 { background: var(--hm3); }
.hm-cell.l4 { background: var(--hm4); }
.hm-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.hm-legend { display: inline-flex; align-items: center; gap: 3px; }
.hm-legend .hm-cell { display: inline-block; }
.history-heatmap { padding: 14px 20px 10px; border-bottom: 1px solid var(--surface-3); }
.history-heatmap:empty { display: none; }

@media (max-width: 860px) {
  .ins-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ins-three { grid-template-columns: minmax(0, 1fr); }
  .ins-months th, .ins-months td { font-size: 10px; letter-spacing: -.02em; }
  .ins-months .k-long { display: none; }
}
.ins-months .k-short { display: none; }
@media (max-width: 860px) { .ins-months .k-short { display: inline; } }

/* Printing Insights: A4, the report alone, two pages. */
@page { size: A4; margin: 12mm; }
@media print {
  /* Only while Insights is printing (html.print-insights, set in insights.js). */
  html.print-insights { font-size: 11px; --shadow: none; }
  html.print-insights body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html.print-insights .sidebar, html.print-insights nav, html.print-insights .toast, html.print-insights #toast, html.print-insights .no-print, html.print-insights .tip, html.print-insights .global-search, html.print-insights .page:not([data-page="insights"]) { display: none !important; }
  html.print-insights .main { margin: 0 !important; padding: 0 !important; }
  html.print-insights .insights-page { max-width: none; }
  html.print-insights .insights-page .page-head { margin-bottom: 8px; }
  html.print-insights .ins-card, html.print-insights .ins-figs, html.print-insights .ins-fig, html.print-insights .ins-count, html.print-insights .ins-col { break-inside: avoid; }
  html.print-insights .ins-card { margin-bottom: 8px; padding: 8px 12px; box-shadow: none; }
  html.print-insights .ins-figs { gap: 6px; margin-bottom: 8px; }
  html.print-insights .ins-fig { padding: 6px 10px; }
  html.print-insights .ins-fig-value { font-size: 16px; }
  html.print-insights .ins-bars { height: 90px; }
  html.print-insights .ins-page-two { break-before: page; }
  html.print-insights .software-spend, html.print-insights .software-best { padding: 8px 12px; }
  html.print-insights .ins-software .ins-h { padding: 8px 12px 0; }
  html.print-insights .sw-row { padding: 3px 0; }
  html.print-insights a { color: inherit; text-decoration: none; }
  /* A4 is narrow enough to trigger the phone layout: keep the wide one on paper. */
  html.print-insights .ins-figs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  html.print-insights .software-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  html.print-insights .software-best { border-left: 1px solid var(--surface-3); border-top: 0; }
  html.print-insights .ins-three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  html.print-insights .ins-four { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; }
  html.print-insights .sw-row { grid-template-columns: 18px 22px minmax(118px, 1.6fr) minmax(30px, 1fr) auto auto; gap: 6px; }
  html.print-insights .sw-row .sw-bar, html.print-insights .sw-avg, html.print-insights .sw-row > span:empty { display: block; }
  html.print-insights .ins-chev { display: none; }
  html.print-insights .sw-big strong { font-size: 18px; }
  html.print-insights .sw-lines td, html.print-insights .ins-table td, html.print-insights .ins-table th { padding: 2px 0; font-size: 10px; }
  html.print-insights .ins-h { font-size: 12px; margin-bottom: 4px; }
  html.print-insights .sw-note { font-size: 9.5px; }
  html.print-insights .want-ico { width: 18px; height: 18px; }
  html.print-insights h1 { font-size: 18px; }
  html.print-insights .ins-months .k-long { display: inline; }
  html.print-insights .ins-months .k-short { display: none; }
}

/* ------------------------------------------ v3.30: Insights rows open to their clients; Account's 90 days */
.ins-open { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ins-open > span { min-width: 0; overflow-wrap: anywhere; }
.ins-open.sw-row { display: grid; gap: 10px; max-width: none; }
.ins-chev { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--text-4); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s cubic-bezier(.25, 1, .5, 1); }
.ins-open[aria-expanded="true"] .ins-chev { transform: rotate(90deg); stroke: var(--accent); }
.ins-row { cursor: pointer; }
.ins-row:hover td, .sw-row:hover { background: var(--surface-2); }
.ins-row:hover .ins-chev, .sw-row:hover .ins-chev { stroke: var(--accent); }
.ins-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ins-who-row > td { padding: 4px 0 10px 18px !important; background: none; }
.ins-who { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 3px 16px; font-size: 12px; line-height: 1.45; }
.ins-who li { min-width: 0; }
.ins-who .dim { display: block; font-size: 11.5px; }
.ins-who-none { font-size: 12px; }
.sw-who { padding: 0 0 12px 32px; }
.ins-kinds { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ins-kinds span { padding: 2px 8px; border-radius: 999px; background: var(--surface-3); font-size: 12px; color: var(--text-2); }
.ins-kinds strong { font-variant-numeric: tabular-nums; }
.ins-more { font-size: 12px; font-weight: 600; color: var(--accent); }
.ins-more .ins-chev { transform: rotate(90deg); stroke: var(--accent); }
.ins-more[aria-expanded="true"] .ins-chev { transform: rotate(-90deg); }
.ins-more[aria-expanded="true"] .when-shut, .ins-more[aria-expanded="false"] .when-open { display: none; }
@media (prefers-reduced-motion: reduce) { .ins-chev { transition: none; } }
@media print { html.print-insights .ins-who { font-size: 9px; grid-template-columns: repeat(3, minmax(0, 1fr)); } html.print-insights .ins-more { display: none; } }

/* Account: your colour on top, your last 90 days at the bottom of the same card,
   which runs down beside Appearance and What you can do. */
.colour-card { display: flex; flex-direction: column; align-self: stretch; grid-row: span 2; }
@media (max-width: 860px) { .colour-card { grid-row: auto; } }
.colour-card .account-heatmap { margin-top: auto; padding-top: 14px; }
.colour-card .colour-picks { margin-bottom: 16px; }
.account-heatmap .ins-sub { margin-bottom: 8px; }
.hm-fit .hm-scroll { overflow: visible; padding-bottom: 0; }
.hm-fit .hm-grid { width: 100%; max-width: calc(28px + var(--weeks) * 23px); grid-template-columns: 28px repeat(var(--weeks), minmax(0, 1fr)); grid-template-rows: 16px repeat(7, auto); }
.hm-fit .hm-cell { width: auto; height: auto; aspect-ratio: 1 / 1; border-radius: 3px; }
.hm-fit .hm-day { align-self: center; }

/* ------------------------------------------ v3.32: previewing a role (super admin) */
.preview-bar {
  position: sticky; top: 0; z-index: 25; margin: -28px -32px 20px; padding: 10px 32px;
  background: color-mix(in srgb, var(--amber-dot) 16%, var(--surface)); border-bottom: 1px solid var(--amber-dot);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}
.pv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pv-eye { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--amber-dot); }
.pv-eye svg { width: 17px; height: 17px; fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pv-who { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.pv-who select, .role-preview-pick select {
  min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer;
}
.pv-who select { min-height: 34px; font-weight: 600; }
.pv-who select:focus-visible, .role-preview-pick select:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.pv-note { font-size: 13px; color: var(--text-2); }
.pv-perms-btn strong { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); font-variant-numeric: tabular-nums; }
.pv-panel { margin-top: 10px; max-height: min(60vh, 560px); overflow: auto; padding: 4px 14px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pv-panel-note { margin: 10px 0 0; font-size: 12px; color: var(--text-3); }
.pv-list { margin-top: 8px; }
.pv-perm.is-locked { align-items: center; color: var(--text-3); }
.pv-perm.is-locked .dim { margin-left: auto; font-size: 11px; }
.pv-off { width: 26px; text-align: center; color: var(--text-4); }
.pv-panel-foot { margin-top: 10px; }
.role-preview-pick { display: flex; flex-direction: column; gap: 4px; min-width: 220px; max-width: 280px; }
.role-preview-pick[hidden] { display: none; }
.rf-foot [data-role-preview] svg { width: 15px; height: 15px; }
@media (max-width: 860px) {
  .preview-bar { margin: -20px calc(-1 * max(16px, env(safe-area-inset-right))) 16px calc(-1 * max(16px, env(safe-area-inset-left))); padding: 8px 16px; }
  .pv-note { display: none; }
  .role-preview-pick { max-width: none; width: 100%; }
}

/* Insights: money figures open to show how they add up. */
.ins-fig.is-openable { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color var(--ease), background var(--ease); }
.ins-fig.is-openable:hover { border-color: var(--accent); }
.ins-fig.is-openable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ins-fig.is-openable[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
.ins-fig-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ins-fig-label .ins-chev { transform: rotate(90deg); }
.ins-fig[aria-expanded="true"] .ins-chev { transform: rotate(-90deg); stroke: var(--accent); }
.ins-fig-panel { margin-top: -4px; }
.ins-fig-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.ins-fig-panel-head .ins-h { margin: 0; }
.ins-explain { max-width: 80ch; margin: 0 0 8px; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.ins-fig-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; margin-top: 12px; }
.ins-scroll { max-height: 380px; overflow: auto; border-top: 1px solid var(--surface-3); }
.ins-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); font-size: 11px; font-weight: 600; color: var(--text-4); }
.ins-scroll tfoot th, .ins-scroll tfoot td { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border-strong); }
.ins-scroll td.dim { font-size: 12px; }
.ins-check-h { margin-top: 16px; }
.ins-checks { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.ins-checks li + li { margin-top: 6px; }
@media (max-width: 860px) { .ins-fig-cols { grid-template-columns: minmax(0, 1fr); } }
@media print {
  html.print-insights .ins-scroll { max-height: none; overflow: visible; }
  html.print-insights .ins-fig-panel-head .icon-btn, html.print-insights .ins-fig .ins-chev { display: none; }
}

/* Log contact: dates written in the note, offered for the follow-up and your calendar. */
.log-dates { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.log-dates[hidden] { display: none; }
.log-dates-head { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.log-dates-head svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.log-date { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 0; border-top: 1px solid var(--surface-3); font-size: 13px; }
.log-date:first-of-type { border-top: 0; }
.log-date-what .dim { font-size: 12px; }
.log-date-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle {
  display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; transition: background var(--ease), border-color var(--ease);
}
.chip-toggle:hover { border-color: var(--accent); color: var(--text); }
.chip-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chip-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.log-dates-note { margin: 6px 0 0; font-size: 12px; color: var(--text-3); }
#contact-dialog .mention-wrap textarea { min-height: 96px; }
@media (max-width: 860px) { .chip-toggle { min-height: 40px; padding: 0 12px; } }

/* The CRM can't be reached (core.js): a bar until it answers again. */
.conn-bar {
  position: fixed; left: 50%; bottom: 20px; z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px);
  padding: 10px 16px; border: 1px solid var(--red-dot, #ef4444); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 13px; line-height: 1.45; box-shadow: var(--shadow-lg);
}
.conn-bar[hidden] { display: none; }
.conn-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--red, #dc2626); animation: conn-pulse 1.4s ease-in-out infinite; }
@keyframes conn-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .conn-dot { animation: none; } }
@media (max-width: 860px) { .conn-bar { bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* ------------------------------------------ v3.35: edit your own note or contact entry for an hour */
.entry-acts, .note-acts { display: flex; align-items: flex-start; gap: 2px; }
.note { grid-template-columns: 26px minmax(0, 1fr) auto; }
.note .note-acts .icon-btn svg, .entry-acts .icon-btn svg { width: 15px; height: 15px; }
.edited-mark { font-size: 12px; }
.tn-edit { margin-top: 6px; }
.tn-edit .mention-wrap textarea { min-height: 72px; }
.tn-edit-acts { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.note.is-editing .note-acts { visibility: hidden; }

/* ------------------------------------------ v3.35: sign-off letters (Onboarding, Settings) */
.ob-signoff {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: 8px 0 0; min-height: 30px; padding: 0 10px;
  border: 1px solid var(--accent); border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.ob-signoff svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ob-signoff:hover { background: var(--accent); color: #fff; }
.ob-signoff.is-sent { border-color: var(--green-dot, #22c55e); background: var(--green-bg, #ecfdf5); color: var(--green, #047857); }
.ob-signoff.is-sent:hover { background: var(--green-bg, #ecfdf5); filter: brightness(.97); color: var(--green, #047857); }
.kcard-compact .ob-signoff { margin: 0 0 0 auto; min-height: 26px; padding: 0 8px; }
.kcard-compact .ob-signoff span { display: none; }
span.ob-signoff { cursor: default; }

/* The letter: an A4 page shrunk into its box (signoff.js sets the scale). */
.so-frame { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow); }
.so-frame iframe { position: absolute; top: 0; left: 0; width: 794px; height: 1123px; border: 0; transform-origin: 0 0; background: #fff; }

.signoff-dialog { width: min(1060px, calc(100vw - 32px)); }
.so-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; padding: 18px 20px 4px; align-items: start; }
.so-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.so-side label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.so-side :is(input:not([type="radio"]):not([type="checkbox"]), select, textarea) {
  width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.so-side textarea { resize: vertical; line-height: 1.5; }
.so-side :is(input:not([type="radio"]):not([type="checkbox"]), select, textarea):focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.so-how { align-self: flex-start; }
.so-panel { display: flex; flex-direction: column; gap: 12px; }
.so-panel[hidden] { display: none; }
.so-warn { margin: 0; padding: 9px 12px; border: 1px solid var(--amber-dot); border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--text); font-size: 13px; line-height: 1.5; }
.so-history { padding-top: 10px; border-top: 1px solid var(--surface-3); }
.so-history-h { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); }
.so-history ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.so-history li { display: flex; justify-content: space-between; gap: 10px; }
.so-history .dim { font-size: 12px; }

/* Settings → Sign-off letter */
.so-set { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 24px; align-items: start; margin-top: 14px; }
.so-set-form { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.so-set-form label, .so-preview-pick, .email-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.so-set-form :is(input:not([type="radio"]), textarea), .so-preview-pick select, .email-form :is(input, select) {
  width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.so-set-form textarea { resize: vertical; line-height: 1.5; }
.so-set-form :is(input, textarea):focus, .so-preview-pick select:focus, .email-form :is(input, select):focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.so-set-form .settings-sub:not(:first-child) { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--surface-3); }
.so-two, .so-company { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.so-company .so-wide { grid-column: 1 / -1; }
.so-co-pick { align-self: flex-start; }
.so-set-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.so-preview-head { display: flex; align-items: flex-end; gap: 8px; }
.so-preview-pick { flex: 1; min-width: 0; }
.so-auto { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.so-auto .settings-sub { margin-top: 0; }
.so-auto-on { margin: 0 0 8px; font-size: 13px; line-height: 1.55; }
.so-steps { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.5; }
.so-steps li.is-ok::marker { color: var(--green); }
.so-steps li.is-todo { color: var(--text-3); }
.so-check { display: inline-flex !important; flex-direction: row !important; align-items: flex-start; gap: 8px; font-weight: 500; color: var(--text) !important; cursor: pointer; }
.so-check input { margin-top: 3px; }
.so-auto .form-hint { margin-top: 8px; }

/* Settings → Email for sending */
.email-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 14px; }
.email-form .email-wide { grid-column: 1 / -1; }
.email-form [hidden] { display: none !important; }

@media (max-width: 960px) {
  .so-body { grid-template-columns: minmax(0, 1fr); }
}
/* Settings: the preview beside the form needs room (the menu takes the left). */
@media (max-width: 1280px) {
  .so-set { grid-template-columns: minmax(0, 1fr); }
  .so-set-side { position: static; max-width: 520px; }
}
@media (max-width: 860px) {
  .so-two, .so-company, .email-form { grid-template-columns: minmax(0, 1fr); }
  .so-side :is(input:not([type="radio"]):not([type="checkbox"]), select, textarea), .so-set-form :is(input:not([type="radio"]), textarea), .email-form :is(input, select) { font-size: 16px; min-height: 44px; }
}

/* ------------------------------------------ v3.36: signing sign-offs */
.so-group { margin: 0; padding: 12px 14px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.so-group legend { padding: 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); }
.so-side .so-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.so-side input[readonly] { background: var(--surface-2); color: var(--text-2); }
.so-sig-saved { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.so-sig-saved[hidden], .so-sig-pad[hidden] { display: none; }
.so-sig-saved img { max-height: 64px; max-width: 70%; object-fit: contain; }
.so-sig-pad canvas { display: block; width: 100%; height: 140px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: #fff; cursor: crosshair; }
.so-sig-pad-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.so-also .so-check { flex-direction: row; align-items: center; font-weight: 500; color: var(--text); }
.so-also .so-check input { width: auto; min-height: 0; margin: 0; }
.so-wa[hidden] { display: none; }
.sig-card-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 12px; }
.sig-card-title { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.sig-card-title input { min-height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.sig-card .so-sig-pad-foot { justify-content: flex-end; }
@media (max-width: 860px) {
  .sig-card-body, .so-side .so-two { grid-template-columns: minmax(0, 1fr); }
}
.ob-signoff.is-waiting { border-color: var(--amber-dot); background: var(--amber-bg); color: var(--amber); cursor: default; }

/* ------------------------------------------ v3.38: people on calendar events */
.ev-people { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ev-people legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.ev-people .person-pick[disabled] { cursor: default; opacity: .75; }
.ev-people .person-pick[disabled][aria-pressed="false"] { display: none; }

/* ------------------------------------------ v3.39: people looking after several properties */
.shared-ico {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; padding: 0; border: 0; border-radius: 6px;
  background: #ede9fe; color: #5b21b6; vertical-align: -4px; cursor: pointer; transition: background var(--ease);
}
.shared-ico:hover { background: #ddd6fe; }
.shared-ico svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shared-ico.small { width: 20px; height: 20px; margin-left: 0; vertical-align: middle; }
.shared-ico.small svg { width: 13px; height: 13px; }
:root[data-theme="dark"] .shared-ico { background: rgba(167, 139, 250, .18); color: #c4b5fd; }
:root[data-theme="dark"] .shared-ico:hover { background: rgba(167, 139, 250, .3); }
h1 .shared-ico { width: 26px; height: 26px; margin-left: 8px; vertical-align: 3px; }
h1 .shared-ico svg { width: 16px; height: 16px; }
@media (pointer: coarse) { .shared-ico { width: 30px; height: 30px; vertical-align: -8px; } }

/* What the icon opens: who, and their other properties. */
.shared-pop {
  position: fixed; z-index: 900; width: min(320px, calc(100vw - 16px)); max-height: min(420px, calc(100vh - 16px)); overflow: auto;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg);
  font-size: 13px; color: var(--text-2);
}
.shared-pop[hidden] { display: none; }
.shared-pop-title { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 8px; }
.shared-pop-title svg { flex: none; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: #7c3aed; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shared-pop-title .sub { display: block; font-size: 12px; color: var(--text-3); }
.shared-pop-title strong { color: var(--text); }
.shared-pop-group { padding: 8px 0; border-top: 1px solid var(--surface-3); }
.shared-pop-who { margin: 0 0 4px; }
.shared-pop-who strong { color: var(--text); font-weight: 600; }
.shared-pop ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.shared-pop li a { font-weight: 500; color: var(--accent); }
.shared-pop .dim { font-size: 12px; }
.shared-pop-all { display: inline-block; margin-top: 6px; font-size: 12px; }

/* ------------------------------------ Add / Edit client: the 2×2 grid */
/* Information | Contacts over Products & services | Subscriptions, with the
   next due date under the title. The top row folds to a short summary. */

#hotel-form.is-grid .form-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "info contacts" "products subs"; }
#hotel-form.is-grid.no-subs .form-cards { grid-template-areas: "info contacts" "products products"; }
#hotel-form.is-grid .form-stack { display: contents; }
#hotel-form.is-grid [data-area="contacts"] { grid-area: contacts; }
#hotel-form.is-grid [data-area="info"] { grid-area: info; }
#hotel-form.is-grid [data-area="products"] { grid-area: products; }
#hotel-form.is-grid [data-area="subs"] { grid-area: subs; }
@media (max-width: 860px) {
  #hotel-form.is-grid .form-cards, #hotel-form.is-grid.no-subs .form-cards { grid-template-columns: 1fr; grid-template-areas: "info" "contacts" "products" "subs"; }
}
/* Wide screens: the short Information boxes three to a row, so the top row isn't so tall. */
@media (min-width: 1280px) {
  #hotel-form.is-grid [data-area="info"] .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #hotel-form.is-grid [data-area="info"] .form-grid > .span-2 { grid-column: 1 / -1; }
}

/* The top row: Collapse / Expand on both cards, a summary while folded. */
#hotel-form.is-grid [data-area="info"], #hotel-form.is-grid [data-area="contacts"] { position: relative; }
/* A card's heading row: title, then (Information) the tag, "This is a hotel" and its info icon,
   (Contacts) the pencil, and the triangle that folds the top row. */
.fc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 30px; }
.fc-head h2 { margin: 0; }
.tag-inline { margin: 0; padding: 0; border: 0; min-width: 0; }
.tag-inline .segmented label { position: relative; }
.segmented-sm span { min-height: 28px; padding: 0 10px; font-size: 12px; }
.hotel-tick { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.hotel-tick input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.info-tip { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: -6px; border-radius: 50%; color: var(--text-4); cursor: help; }
.info-tip:hover, .info-tip:focus-visible { color: var(--accent); }
.info-tip svg { width: 16px; height: 16px; }
.pv-fold { color: var(--text-4); }
.pv-fold svg { width: 11px; height: 11px; }
.pv-fold[hidden], .fc-edit[hidden] { display: none; }
.fc-edit svg { width: 15px; height: 15px; }
.fc-edit.is-on { background: var(--accent); color: var(--on-primary); }
.fc-edit.is-on:hover { background: var(--accent-hover); color: var(--on-primary); }
#hotel-form.pv-top-folded [data-area="info"] > :not(.fc-head):not(.pv-top-summary),
#hotel-form.pv-top-folded [data-area="contacts"] > :not(.fc-head):not(.pv-top-summary) { display: none; }
#hotel-form.pv-top-folded .fc-head :is(.tag-inline, .hotel-tick, .info-tip, .fc-edit) { display: none; }
/* Contacts, not being edited: other people one line each, without their boxes. */
.pv-people-view .others-block > :not(.form-section):not(.pv-others) { display: none; }
.pv-others[hidden] { display: none; }
.pv-others .pv-person-row { min-height: 30px; }
#hotel-form.pv-top-folded [data-area="info"], #hotel-form.pv-top-folded [data-area="contacts"] { padding-bottom: 14px; }
.pv-top-summary { display: grid; gap: 4px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.pv-top-summary:empty { display: none; }
.pv-top-summary p { margin: 0; }
.pv-top-summary .dim { font-size: 12px; }
.pv-sum-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pv-sum-name strong { font-size: 14px; font-weight: 600; color: var(--text); }

.pv-due { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: 13px; color: var(--text-2); }
.pv-due[hidden] { display: none; }
.pv-due svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--text-4); stroke-width: 2; }
.pv-due-label { color: var(--text-3); }
.pv-due-date { font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pv-due-what { font-weight: 500; }
.pv-due-then { color: var(--text-4); }
.pv-due-none { color: var(--amber); font-weight: 500; }
.pv-due-none svg { stroke: var(--amber); }

/* Subscriptions: every due date box stands out and says how far off it is. */
#hotel-form .pv-due-field > label, #hotel-form .pv-due-field > label:first-child { font-weight: 600; color: var(--text); }
#hotel-form .pv-due-field input[type="date"] { font-weight: 600; border-color: var(--accent); }
.pv-due-badge { justify-self: start; width: fit-content; margin-top: 2px; }
.pv-pays { grid-column: 1 / -1; margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.pv-pays strong { font-weight: 600; color: var(--text); }
.pv-pays.none { color: var(--amber); }
.pv-unbilled { display: grid; gap: 2px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.pv-unbilled:empty { display: none; }
.pv-unbilled p { margin: 0; }
.pv-unbilled span { color: var(--text-4); }

/* Contacts: each person one line (role, name, mobile, email), an icon when something's missing. */
.pv-person { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pv-person[hidden] { display: none; }
.pv-person:empty { display: none; }
#hotel-form .pv-folded > :not(.pv-person) { display: none; }
#hotel-form fieldset.pv-folded { padding-top: 4px; }
#hotel-form [data-area="contacts"] fieldset.pv-folded + fieldset.pv-folded { margin-top: 0; border-top: 1px solid var(--surface-3); }
.pv-person-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; }
.pv-role { flex: none; width: 128px; white-space: nowrap; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); }
.pv-person-line { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-width: 0; font-size: 13px; color: var(--text-2); }
.pv-person-line strong { font-weight: 600; color: var(--text); }
.pv-email { overflow-wrap: anywhere; }
.pv-flag { display: inline-flex; color: var(--text-4); }
.pv-flag.serious { color: var(--amber); }
.pv-flag svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.pv-person-row .btn { flex: none; }
.pv-top-summary .pv-person-row { min-height: 26px; }

/* Products: a little table. Tick and name | Paid through | brand, with what
   it brings in and its history on a slim line underneath. */
#hotel-form.is-grid { --pcols: minmax(112px, .8fr) minmax(0, 1fr) minmax(0, 1.15fr); }
#hotel-form.is-grid.no-subs { --pcols: minmax(112px, .8fr) minmax(0, 2fr); }
.product-head {
  display: grid; grid-template-columns: var(--pcols); gap: 8px; margin-top: 10px; padding: 0 0 6px; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4);
}
#hotel-form.is-grid .product-list { gap: 0; margin-top: 0; }
#hotel-form.is-grid .product-row {
  grid-template-columns: var(--pcols); gap: 4px 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--surface-3);
  grid-template-areas: "check paid brand" ". meta chips" ". meta note";
}
#hotel-form.is-grid.no-subs .product-row { grid-template-areas: "check brand" ". chips" ". note" ". meta"; }
#hotel-form.is-grid .product-row.on + .product-row { margin-top: 0; }
#hotel-form.is-grid .product-row:last-child { border-bottom: 0; }
/* Not ticked: just the tick and name (and anything worth saying about it). */
#hotel-form.is-grid .product-row:not(.on) { grid-template-areas: "check meta meta"; padding: 3px 0; }
#hotel-form.is-grid.no-subs .product-row:not(.on) { grid-template-areas: "check meta"; }
#hotel-form.is-grid .product-row:not(.on) .product-brand,
#hotel-form.is-grid .product-row:not(.on) .brand-chips { display: none; }
#hotel-form.is-grid .product-row:not(.on) .product-check { color: var(--text-3); font-weight: 400; }
/* The brands used before show while you're in the brand box, or while it's empty. */
#hotel-form.is-grid .product-row.on:not(:focus-within):not(:has(.product-brand:placeholder-shown)) .brand-chips { display: none; }
#hotel-form.is-grid .product-check { min-height: 34px; }
#hotel-form.is-grid #product-list ~ p.form-hint { display: none; }
.pv-paid { grid-area: paid; min-width: 0; }
.pv-paid[hidden] { display: none; }
.pv-paid select {
  width: 100%; min-height: 34px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer;
}
.pv-paid select:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.pv-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; padding-top: 1px; font-size: 12px; }
.pv-meta[hidden], .pv-amount[hidden], .pv-history[hidden] { display: none; }
.pv-amount { font-size: 12px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.pv-amount .dim { font-size: 12px; font-weight: 400; }
.pv-amount.none { font-weight: 500; color: var(--amber); }
.pv-guess { margin-left: 2px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-4); font-size: 11px; font-weight: 500; }
.pv-was, .pv-plan { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--text-3); }
.pv-was:empty, .pv-plan:empty { display: none; }
.pv-plan a { color: var(--accent); }
.pv-history summary { width: fit-content; font-size: 12px; font-weight: 500; color: var(--accent); cursor: pointer; }
.pv-history[open] { flex-basis: 100%; }
.pv-history ol { display: grid; gap: 3px; margin: 4px 0 2px; padding: 0; list-style: none; font-size: 12px; color: var(--text-2); }
.pv-history time { display: inline-block; min-width: 92px; color: var(--text-4); font-variant-numeric: tabular-nums; }
/* Narrow: each product stacks: name, Paid through, brand. */
@media (max-width: 600px) {
  .product-head { display: none; }
  #hotel-form.is-grid .product-row, #hotel-form.is-grid.no-subs .product-row {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "check" "paid" "brand" "chips" "note" "meta"; padding: 8px 0;
  }
  #hotel-form.is-grid .product-row:not(.on), #hotel-form.is-grid.no-subs .product-row:not(.on) { grid-template-areas: "check" "meta"; }
}
#product-list.pv-hide-spare .pv-spare { display: none; }
.pv-more { margin-top: 8px; font-size: 13px; }
.pv-more[hidden] { display: none; }
@media (max-width: 860px) {
  .pv-paid select, #hotel-form.is-grid .product-brand { min-height: 44px; font-size: 16px; }
  #hotel-form.is-grid .product-check { min-height: 44px; }
  .pv-person-row { flex-wrap: wrap; }
  .pv-role { width: 100%; }
  .pv-fold, .fc-edit, .info-tip { width: 40px; height: 40px; }
}
/* Phones: the sticky header stays short — the date and how far off it is, nothing more. */
@media (max-width: 560px) {
  .pv-due { margin-top: 2px; font-size: 12px; }
  .pv-due-date { font-size: 16px; }
  .pv-due-what, .pv-due-then { display: none; }
}

/* Onboarding: who marked what, and when. */
.ob-dot.st-done { background: var(--green-dot); }
.ob-dot.st-pending { background: var(--amber-dot); }
.ob-dot.st-todo { background: var(--red-dot); }
.ob-dot.st-none { background: var(--grey-dot); }
.ob-last { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 0; font-size: 12px; line-height: 1.35; color: var(--text-3); width: fit-content; max-width: 100%; }
.ob-last .ob-dot { width: 8px; height: 8px; transform: translateY(-1px); }
.ob-pop-log { display: grid; gap: 3px; margin: -4px 0 10px; padding: 0; list-style: none; font-size: 12px; color: var(--text-2); }
.ob-pop-log li { display: flex; align-items: center; gap: 6px; }
.ob-pop-log .ob-dot { width: 8px; height: 8px; }
.ob-pop-log li:first-child { font-weight: 600; color: var(--text); }

/* A hotel listed under Ang Tech for its POS or website: "Also AS" by its name. */
.row-title + .co-pill, .lock-mark + .co-pill { margin-left: 6px; vertical-align: 1px; cursor: default; }

/* Calendar: out of town. */
.cal-main-wrap { display: grid; gap: 10px; min-width: 0; }
.cal-away {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 13px;
}
.cal-away[hidden] { display: none; }
.cal-away > svg { width: 16px; height: 16px; color: var(--accent); }
.cal-away-label { font-weight: 600; color: var(--text); }
.cal-away-who {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 10px 2px 3px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer;
}
.cal-away-who:hover { border-color: var(--border-strong); color: var(--text); }
.cal-away-who strong { font-weight: 600; color: var(--text); }
.cal-chip.type-outstation { font-weight: 600; background: color-mix(in srgb, var(--pc, var(--text-3)) 22%, var(--surface)); }
.ev-kind span { display: inline-flex; align-items: center; gap: 6px; }
.ev-kind svg { width: 14px; height: 14px; }

/* Sales: the quick note pop-up. */
.note-pop { width: min(340px, calc(100vw - 16px)); }
.note-pop .ob-pop-title svg { color: var(--accent); }
.note-pop textarea {
  width: 100%; min-height: 72px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 400; resize: vertical;
}
.note-pop textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.note-pop .form-error { margin: 8px 0 0; }
.note-pop .ob-pop-acts .grow { flex: 1; }
.kcard-note svg { width: 15px; height: 15px; }

/* ------------------------------- Add / Edit client: compact layout */
/* Information in two columns with Contacts beside it, all on one row, so the
   products and subscriptions are in view below. Wide screens only. */
@media (min-width: 1200px) {
  #hotel-form.is-grid.is-compact .form-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-areas: "info info info info contacts contacts" "products products products subs subs subs";
  }
  #hotel-form.is-grid.is-compact.no-subs .form-cards {
    grid-template-areas: "info info info info contacts contacts" "products products products products products products";
  }
  /* Information: who they are on the left, where and how to reach them on the right. */
  #hotel-form.is-grid.is-compact [data-area="info"] .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 8px 12px; }
  #hotel-form.is-grid.is-compact [data-area="info"] .form-grid > * { grid-column: 1 / 3; }
  #hotel-form.is-grid.is-compact [data-area="info"] label:has([name="hotel_code"]),
  #hotel-form.is-grid.is-compact [data-area="info"] .type-field { grid-column: 1 / 2; }
  #hotel-form.is-grid.is-compact [data-area="info"] label:has([name="rooms"]),
  #hotel-form.is-grid.is-compact [data-area="info"] .dealer-field { grid-column: 2 / 3; }
  #hotel-form.is-grid.is-compact [data-area="info"] label:has([name="state"]),
  #hotel-form.is-grid.is-compact [data-area="info"] label:has([name="country"]),
  #hotel-form.is-grid.is-compact [data-area="info"] label:has([name="phone"]),
  #hotel-form.is-grid.is-compact [data-area="info"] label:has([name="website"]) { grid-column: 3 / 4; }
  #hotel-form.is-grid.is-compact [data-area="info"] label:has([name="city"]),
  #hotel-form.is-grid.is-compact [data-area="info"] label:has([name="region"]),
  #hotel-form.is-grid.is-compact [data-area="info"] label:has([name="email"]),
  #hotel-form.is-grid.is-compact [data-area="info"] label:has([name="map_link"]) { grid-column: 4 / 5; }
  #hotel-form.is-grid.is-compact [data-area="info"] label:has([name="address"]) { grid-column: 3 / 5; }
  #hotel-form.is-grid.is-compact [data-area="info"] label:has([name="notes"]) { grid-column: 1 / 3; }
  /* Shorter: explanations go; remarks and address are the same size, side by side on the last row. */
  #hotel-form.is-compact [data-area="contacts"] .others-block .form-hint { display: none; }
  #hotel-form.is-grid.is-compact [data-area="info"] textarea { height: 64px; min-height: 64px; padding-top: 8px; resize: vertical; }
  /* Contacts in a narrower column: the role above each person. */
  #hotel-form.is-compact [data-area="contacts"] .pv-person-row { flex-wrap: wrap; gap: 2px 8px; padding: 4px 0; }
  #hotel-form.is-compact [data-area="contacts"] .pv-role { order: -2; width: auto; flex: 1 1 100%; }
  #hotel-form.is-compact [data-area="contacts"] .pv-person-line { flex: 1 1 0; }
  #hotel-form.is-compact .form-card { padding: 14px 16px 14px; }
}

/* Type of hotel: the star rating sits on its label line. */
.type-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 18px; }
.type-head label { font-size: 12px; }
.stars { display: inline-flex; align-items: center; margin-right: -3px; }
.star {
  display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px;
  background: none; color: var(--border-strong); cursor: pointer; transition: color var(--ease);
}
.star svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.star.on, .stars:hover .star { color: var(--amber-dot); }
.stars .star:hover ~ .star { color: var(--border-strong); }
.star:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (pointer: coarse) { .star { width: 34px; height: 34px; } .star svg { width: 20px; height: 20px; } }
/* Town, state and country: menus; "Other…" swaps in a box to type one. */
.place-other[hidden], #hotel-form select[name="city"][hidden], #hotel-form select[name="state"][hidden], #hotel-form select[name="country"][hidden] { display: none; }
/* The client's page: the stars beside the rooms. */
.fact-stars { color: var(--amber); letter-spacing: 1px; }

/* Calendar: each kind of event in its own colour, with its own icon. */
:root { --ev-meeting: #2563eb; --ev-training: #c026d3; --ev-outstation: #0d9488; --ev-other: #64748b; }
:root[data-theme="dark"] { --ev-meeting: #60a5fa; --ev-training: #e879f9; --ev-outstation: #2dd4bf; --ev-other: #94a3b8; }
.cal-chip[class*="type-"] svg { color: var(--pc); }
.cal-owner { flex: none; width: 6px; height: 6px; margin-left: -2px; border-radius: 50%; background: var(--owner, var(--text-4)); }
.cal-check.type-meeting { --pc: var(--ev-meeting); }
.cal-check.type-training { --pc: var(--ev-training); }
.cal-check.type-outstation { --pc: var(--ev-outstation); }
.cal-check.type-other { --pc: var(--ev-other); }
.cal-type-ico { display: inline-grid; place-items: center; color: var(--pc); }
.cal-type-ico svg { width: 14px; height: 14px; }
.ev-kind span { gap: 6px; }
.ev-kind .ev-meeting { --ek: var(--ev-meeting); }
.ev-kind .ev-training { --ek: var(--ev-training); }
.ev-kind .ev-outstation { --ek: var(--ev-outstation); }
.ev-kind .ev-other { --ek: var(--ev-other); }
.ev-kind label span svg { color: var(--ek); }
.ev-kind input:checked + span { background: color-mix(in srgb, var(--ek) 14%, var(--surface)); color: var(--text); font-weight: 600; }
/* A phone: the four kinds two by two. */
@media (max-width: 560px) {
  .segmented.ev-kind { display: grid; grid-template-columns: 1fr 1fr; }
  .segmented.ev-kind label span { justify-content: center; min-height: 44px; }
  .segmented.ev-kind label:nth-child(odd) span { border-left: 0; }
  .segmented.ev-kind label:nth-child(n+3) span { border-top: 1px solid var(--border-strong); }
}

/* --------------- Demo: products and subscriptions in one card (preview) */
.merged-card[hidden], .merged-card .once-block[hidden] { display: none; }
#hotel-form.is-merged [data-area="products"], #hotel-form.is-merged [data-area="subs"] { display: none; }
#hotel-form.is-grid [data-area="merged"] { grid-area: merged; }
#hotel-form.is-grid.is-merged .form-cards { grid-template-areas: "info contacts" "merged merged"; }
@media (min-width: 1200px) {
  #hotel-form.is-grid.is-compact.is-merged .form-cards { grid-template-areas: "info info info info contacts contacts" "merged merged merged merged merged merged"; }
}
@media (max-width: 860px) {
  #hotel-form.is-grid.is-merged .form-cards { grid-template-areas: "info" "contacts" "merged"; }
}
.m-total { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.m-total strong { color: var(--text); font-size: 15px; }
.m-note { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--grey-bg); color: var(--text-2); font-size: 12.5px; }
/* One row per subscription. */
.m-table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 13px; }
.m-table thead th {
  padding: 0 10px 6px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4);
}
.m-table thead th:first-child, .m-table .m-sub { padding-left: 0; }
.m-table thead th:nth-child(3) { text-align: right; }
.m-row > * { padding: 10px; border-bottom: 1px solid var(--surface-3); vertical-align: top; }
.m-row.is-open > * { border-bottom-color: transparent; }
.m-row.is-drop > * { background: var(--accent-soft); }
.m-sub { width: 17%; min-width: 130px; text-align: left; font-weight: 400; }
.m-sub strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.m-sub .dim { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.m-sub .dim svg { width: 12px; height: 12px; }
.m-chips { display: table-cell; }
.m-chips > * { margin: 0 4px 4px 0; vertical-align: middle; }
.m-amt { width: 15%; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-amt strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.m-amt .dim { font-size: 12px; }
.m-since { width: 11%; white-space: nowrap; color: var(--text-2); font-variant-numeric: tabular-nums; }
.m-due { width: 17%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-due strong { display: block; font-weight: 600; color: var(--text); }
.m-due .badge { margin-top: 3px; }
.m-act { width: 40px; padding-right: 0 !important; text-align: right; }
.m-edit.is-on { background: var(--accent); color: var(--on-primary); }
.m-loose .m-sub strong { color: var(--text-2); }
.m-none { display: inline-block; padding: 4px 0; font-size: 12px; }
/* A product: icon, name, brand; click for its menu, or drag it to another row. */
.m-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 28px; padding: 0 10px 0 8px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 12.5px; cursor: pointer; transition: border-color var(--ease), background var(--ease);
}
.m-chip:hover, .m-chip.is-open { border-color: var(--accent); background: var(--accent-soft); }
.m-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.m-chip svg { flex: none; width: 14px; height: 14px; color: var(--text-4); }
.m-chip-name { font-weight: 600; white-space: nowrap; }
.m-chip-brand { overflow: hidden; color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }
.m-chip-tag { padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-3); font-size: 11px; white-space: nowrap; }
.m-chip-tag.m-warn { background: var(--amber-bg); color: var(--amber); }
.m-chip.is-guess { border-style: dashed; }
.m-chip.is-dragging { opacity: .5; }
/* Used before: quieter, a note of what they had. */
.m-past .m-sub strong { color: var(--text-3); }
.m-chip.is-past { border-style: dashed; background: transparent; color: var(--text-3); }
.m-chip.is-past .m-chip-name { font-weight: 500; }
.m-chip.is-past:hover, .m-chip.is-past.is-open { border-style: solid; color: var(--text); }
.m-chip-tag { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.m-table.is-plain { margin-top: 4px; }
.m-table.is-plain .m-row:last-child > * { border-bottom: 0; }
.merged-card .once-block { margin-top: 14px; padding-top: 12px; }
.merged-card .once-block .form-hint { font-size: 12px; }
/* One line each in the wide card: name | amount | charged on | paid | remove. */
@media (min-width: 720px) {
  .merged-card .once-line {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto auto; grid-template-areas: "name amount date paid remove";
    padding: 8px 0; border-bottom-style: solid; border-bottom-color: var(--surface-3);
  }
  .merged-card .once-line label { gap: 4px; font-size: 12px; }
  .merged-card .once-line .once-paid { align-self: center; }
  .merged-card #add-once { margin-top: 8px; }
}
.m-add select {
  min-height: 28px; padding: 0 8px; border: 1px dashed var(--border-strong); border-radius: 999px;
  background: none; color: var(--accent); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
}
/* Editing a subscription: its details in a row underneath. */
.m-edit-row > td { padding: 0 0 12px; border-bottom: 1px solid var(--surface-3); }
.m-fields {
  display: grid; grid-template-columns: 2fr repeat(4, minmax(0, 1fr)); gap: 8px 10px; align-items: end; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.m-fields label { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; font-weight: 500; color: var(--text-2); }
.m-fields :is(input:not([type="checkbox"]), select) {
  width: 100%; min-width: 0; min-height: 34px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
.m-fields .m-f-renew { grid-column: 1 / 3; flex-direction: row; align-items: center; gap: 6px; }
.m-fields .m-f-renew input { width: 16px; height: 16px; accent-color: var(--accent); }
.m-fields .m-f-remove { grid-column: 4 / 6; justify-self: end; }
/* A chip's menu. */
.m-chip-menu {
  position: fixed; z-index: 900; display: grid; gap: 8px; width: min(340px, calc(100vw - 16px)); padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg);
}
.m-chip-menu[hidden] { display: none; }
.m-cm-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; color: var(--text); }
.m-cm-title svg { width: 16px; height: 16px; color: var(--text-4); }
.m-chip-menu label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.m-chip-menu :is(input, select) {
  min-height: 34px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
.m-cm-hist { display: grid; gap: 2px; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--surface-3); list-style: none; font-size: 12px; color: var(--text-2); }
.m-cm-hist time { display: inline-block; min-width: 88px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.m-cm-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.m-cm-acts [data-m-close] { margin-left: auto; }
.m-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; }
.m-once { margin: 0; font-size: 12.5px; color: var(--text-2); }
.m-hint { margin: 0 0 0 auto; font-size: 12px; }
/* Narrow: each subscription stacks, its parts labelled. */
@media (max-width: 760px) {
  .m-table thead { display: none; }
  .m-table, .m-table tbody, .m-row, .m-edit-row, .m-edit-row > td { display: block; width: 100%; }
  .m-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--surface-3); }
  .m-row > * { display: block; width: auto; padding: 0; border: 0; }
  .m-row .m-chips, .m-row .m-amt, .m-row .m-since, .m-row .m-due { grid-column: 1 / -1; text-align: left; }
  .m-row .m-act { grid-row: 1; grid-column: 2; }
  .m-row [data-label]:not(.m-chips)::before { content: attr(data-label); display: inline-block; min-width: 76px; color: var(--text-4); font-size: 12px; }
  .m-amt strong, .m-due strong { display: inline; margin-right: 6px; }
  .m-fields { grid-template-columns: 1fr 1fr; }
  .m-fields .m-f-name, .m-fields .m-f-renew, .m-fields .m-f-remove { grid-column: 1 / -1; justify-self: start; }
  .m-fields :is(input:not([type="checkbox"]), select), .m-chip-menu :is(input, select) { min-height: 44px; font-size: 16px; }
  .m-chip, .m-add select { min-height: 36px; }
  .m-hint { margin-left: 0; }
}

/* Who's online: the green dot in the sidebar, and the list it opens. */
.online-btn .online-dot, .op-head .online-dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--side-dim);
}
.online-btn.has-online .online-dot { background: var(--green-dot); box-shadow: 0 0 0 3px rgba(16, 185, 129, .25); }
.op-head .online-dot { background: var(--green-dot); }
/* Even where the sidebar hides its labels (a phone, the narrow sidebar), the dot stays. */
.side-link.online-btn .online-dot { position: static; width: 8px; height: 8px; overflow: visible; clip: auto; }
.online-pop {
  position: fixed; z-index: 900; width: min(320px, calc(100vw - 16px)); max-height: min(480px, calc(100vh - 16px)); overflow: auto;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg);
}
.online-pop[hidden] { display: none; }
.op-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; color: var(--text); }
.op-head .dim { margin-left: auto; font-variant-numeric: tabular-nums; }
.op-sub { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--surface-3); }
.op-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.op-person {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.op-avatar { position: relative; display: inline-grid; }
.op-dot { position: absolute; top: -2px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--grey-dot); border: 2px solid var(--surface); }
.op-person.is-online .op-dot { background: var(--green-dot); }
.op-text { display: flex; flex-direction: column; min-width: 0; }
.op-text strong { overflow: hidden; font-size: 13.5px; font-weight: 600; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.op-text .dim { font-size: 12px; }
.op-time { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.op-empty { padding: 4px 0; font-size: 12px; color: var(--text-4); }
.op-foot { margin: 10px 0 0; font-size: 11px; }

/* Sales and Onboarding: the archive (won or lost, or signed off, over a week ago). */
.kcard-archive { margin: 6px 0 0; font-size: 11.5px; color: var(--text-4); }
.col-archive {
  display: block; width: calc(100% - 16px); margin: 0 8px 6px; padding: 4px 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: none; color: var(--text-3); font: inherit; font-size: 12px; font-weight: 500; text-align: left; cursor: pointer;
}
.col-archive:hover { border-color: var(--accent); color: var(--accent); }
#sales-archive-btn .archive-count, #onboarding-archive-btn .archive-count {
  min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 600; text-align: center;
}
#sales-archive-btn[aria-pressed="true"], #onboarding-archive-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.archive-card { padding: 0; overflow: hidden; }
.archive-card .card-head { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.archive-card .side-empty { padding: 16px; }
.archive-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.archive-table th { padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); white-space: nowrap; }
.archive-table td { padding: 10px 12px; border-bottom: 1px solid var(--surface-3); vertical-align: top; }
.archive-table tr:last-child td { border-bottom: 0; }
.archive-table .num { text-align: right; white-space: nowrap; }
.archive-table .sub { display: block; font-size: 12px; color: var(--text-3); }
.archive-table .dim { font-size: 12px; }
.archive-acts { text-align: right; }
@media (max-width: 760px) {
  .archive-table thead { display: none; }
  .archive-table, .archive-table tbody, .archive-table tr, .archive-table td { display: block; width: 100%; }
  .archive-table tr { padding: 10px 16px; border-bottom: 1px solid var(--surface-3); }
  .archive-table td { padding: 2px 0; border: 0; }
  .archive-table .num, .archive-acts { text-align: left; }
}

/* ------------------------------------------- Create / Add to client check */
.convert-dialog { width: min(640px, calc(100vw - 16px)); }
.convert-dialog .cv-has { margin-left: 4px; font-size: 11px; }
.convert-dialog .cv-sum { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--grey-bg); color: var(--text-2); }
.convert-dialog .cv-sum strong { color: var(--text); }

/* Settings: the three renewal reminder days, on one line. */
.renew-days { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.renew-days label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.renew-days input { width: 72px; min-height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.renew-days-unit { align-self: center; padding-top: 18px; font-size: 13px; }

/* Click-to-fill chips under a box (brands, names and notes used before). */
.m-picks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.m-cm-field { display: grid; gap: 0; }
.m-fields .m-f-name { display: grid; align-content: start; min-width: 0; }
.m-fields { align-items: start; }
.m-fields .m-f-name { justify-self: stretch; }
.m-fields .m-f-renew, .m-fields .m-f-remove { align-self: center; }

/* Sales: filters above the board. */
.sales-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.sales-filters .search { width: min(300px, 100%); }
.sales-filters [hidden] { display: none; }
.sales-filter-note { font-size: 12.5px; }

/* Brand of each product on a deal and on the Create client check. */
.bp-list { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.bp-list[hidden] { display: none; }
.bp-head { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.bp-head .dim { font-weight: 400; }
.bp-rows { display: grid; gap: 6px; }
.bp-row { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); align-items: center; gap: 10px; }
.bp-name { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.bp-name svg { width: 14px; height: 14px; color: var(--text-4); }
.bp-select, .bp-input { width: 100%; min-height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
@media (max-width: 860px), (pointer: coarse) { .bp-select, .bp-input { min-height: 44px; font-size: 16px; } .bp-row { grid-template-columns: 1fr; gap: 4px; } }
.cv-where { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text-2); font-size: 13px; }
.cv-where strong { color: var(--text); }

/* Whose a product name is: ours, one we sell, someone else's (or not marked yet). */
.whose { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; vertical-align: 1px; }
.whose-own { background: var(--green-bg); color: var(--green); }
.whose-resell { background: var(--accent-soft); color: var(--accent); }
.whose-other { background: var(--orange-bg); color: var(--orange); }
.whose-none { border: 1px dashed var(--border-strong); color: var(--text-4); }
.m-sub .whose { margin: 2px 0 0; }
.m-sub strong + .whose { display: table; }
.m-chip.is-theirs { border-style: dashed; }
.m-chip.is-theirs .m-chip-tag { background: var(--orange-bg); color: var(--orange); }
.m-suggest { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border: 1px dashed var(--accent); border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.m-suggest svg { width: 13px; height: 13px; }
.m-suggest:hover { border-style: solid; }
.m-cm-whose { margin: 6px 0 0; font-size: 12px; }
.m-cm-whose .whose { margin-left: 0; }
.m-cm-field .dim { font-weight: 400; }
.line-pays { display: block; color: var(--text-4); font-size: 12px; font-weight: 400; }
.names-wrap { overflow-x: auto; }
.names-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.names-table th, .names-table td { padding: 7px 8px; border-bottom: 1px solid var(--surface-3); text-align: left; vertical-align: middle; }
.names-table thead th { color: var(--text-4); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.names-table tbody th { font-weight: 600; color: var(--text); white-space: nowrap; }
.names-table td { color: var(--text-3); }
.names-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.whose-select { min-height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; }
.whose-select.whose-own { border-color: var(--green); }
.whose-select.whose-resell { border-color: var(--accent); }
.whose-select.whose-other { border-color: var(--orange); }
/* "+ Add" keeps its size whatever its longest choice ("PMS (eZee Absolute): now on …"). */
.m-add select { width: 150px; max-width: 100%; }

/* Sales: deals clipped together (several hotels, one owner). */
.kgroup { padding: 8px; border: 1.5px dashed var(--accent); background: var(--accent-soft); cursor: grab; }
.kgroup-head { display: flex; align-items: flex-start; gap: 8px; padding: 2px 4px 8px; color: var(--accent); }
.kgroup-head svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.kgroup-head strong { display: block; color: var(--text); font-size: 13.5px; }
.kgroup-head .dim { display: block; font-size: 12px; }
.kgroup-cards { display: grid; gap: 6px; }
.kgroup-cards .kcard { margin: 0; box-shadow: none; }
.clip-chip { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.clip-chip svg { width: 12px; height: 12px; }
.lead-group-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; color: var(--text-3); font-size: 12.5px; }
.lead-group-note svg { width: 14px; height: 14px; color: var(--accent); }
.lead-group-note[hidden] { display: none; }

/* Insights: Websites. */
.web-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.web-stat { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.web-table td { vertical-align: top; }
@media print { .ins-web { break-inside: avoid-page; } }
.kgroup { min-width: 0; }
.kgroup-item { display: grid; gap: 4px; min-width: 0; padding: 8px 10px; }
.kgroup-item .kcard-title { font-size: 13px; overflow-wrap: anywhere; }
.kgroup-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kgroup-amt { font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.kgroup-item .want-icons { display: inline-flex; gap: 3px; }
.kgroup-item .btn { justify-self: start; }
.web-table th, .web-table td { padding-right: 14px; }
.web-table th:last-child, .web-table td:last-child { padding-right: 0; white-space: nowrap; }

/* Settings → Lists: four tabs, each a grid of list editors. */
.list-tabs { display: flex; gap: 2px; margin: 14px 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.list-tabs::-webkit-scrollbar { display: none; }
.list-tabs [role="tab"] {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 40px; padding: 0 14px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-3); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.list-tabs [role="tab"]:hover { color: var(--text); }
.list-tabs [role="tab"][aria-selected="true"] { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.list-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px 6px 0 0; }
.list-tab-badge { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.list-tab-badge[hidden] { display: none; }
.list-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px 32px; align-items: start; }
.list-panel[hidden] { display: none; }
.list-panel .span-all { grid-column: 1 / -1; }
.list-panel .list-editor { min-width: 0; }
.list-panel .list-editor + .list-editor { margin-top: 0; }
@media (max-width: 700px) { .list-panel { grid-template-columns: 1fr; } .list-tabs [role="tab"] { min-height: 44px; } }
.list-panel .settings-sub { margin-top: 0; }

/* Edit card: "Add or move products" button and its tick list. */
.m-addbtn { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 12px; border: 1px dashed var(--accent); border-radius: 999px; background: none; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; vertical-align: middle; }
.m-addbtn svg { width: 13px; height: 13px; }
.m-addbtn:hover, .m-addbtn[aria-expanded="true"] { border-style: solid; background: var(--accent-soft); }
.m-add-menu { width: min(360px, calc(100vw - 16px)); }
.m-pick-hint { margin: 0; color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.m-pick-list { display: grid; gap: 2px; max-height: min(52vh, 420px); margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.m-pick-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.m-pick-row:hover { background: var(--surface-2); }
.m-pick-row.is-on { background: var(--accent-soft); }
.m-pick-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.m-pick-row svg { width: 16px; height: 16px; color: var(--text-4); }
.m-pick-text { min-width: 0; font-size: 13px; }
.m-pick-text strong { color: var(--text); font-weight: 600; }
.m-pick-text small { display: block; color: var(--text-4); font-size: 11.5px; }
.m-cm-addnote { display: inline-flex; align-items: center; gap: 4px; justify-self: start; font-size: 12.5px; }
.m-cm-addnote svg { width: 13px; height: 13px; }
.m-cm-note[hidden] { display: none; }
@media (pointer: coarse) { .m-pick-row { min-height: 48px; } .m-addbtn { min-height: 40px; } }
.m-chip-menu .m-pick-row { display: grid; flex-direction: row; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; font-weight: 400; color: var(--text-2); }

/* Client page: set the day they went live (subscriptions without dates start then). */
.live-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 12px 20px 4px; padding: 12px 14px; border: 1px solid var(--amber-dot); border-radius: var(--radius-sm); background: var(--amber-bg); }
.live-box > div { flex: 1 1 260px; display: grid; gap: 2px; font-size: 13px; color: var(--text-2); }
.live-box strong { color: var(--amber); }
.live-date input { min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }

/* Boards that keep an order (Onboarding): where a dragged card will land. */
.kcard.drop-before { box-shadow: 0 -3px 0 0 var(--accent); }
.column-cards.drop-end::after { content: ""; display: block; height: 3px; margin-top: 2px; border-radius: 2px; background: var(--accent); }
/* Compact Onboarding: the one hotel opened in full. */
.kcard.is-opened { position: relative; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.kcard.is-opened .kcard-title { padding-right: 28px; }
.kcard-close { position: absolute; top: 6px; right: 6px; }
.kcard-compact [data-open-card] { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }

/* ------------------------------------------------ Passwords & links (#/vault) */
.vault { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.vault-tree { position: sticky; top: 16px; padding: 10px 8px; max-height: calc(100vh - 140px); overflow: auto; }
.vault-tree-head { padding: 4px 10px 8px; font-size: 12px; font-weight: 600; color: var(--text-4); text-transform: uppercase; letter-spacing: .04em; }
.vt-list, .vt-list ul { list-style: none; margin: 0; padding: 0; }
.vt-row {
  display: flex; align-items: center; gap: 2px; padding-left: calc(var(--depth, 0) * 16px);
  border-radius: var(--radius-sm); transition: background var(--ease);
}
.vt-row:hover { background: var(--row-hover); }
.vt-row.on { background: var(--accent-soft); }
.vt-row.on .vt-name { color: var(--accent); font-weight: 600; }
.vt-row.drop-on { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.vt-row.dragging { opacity: .45; }
.vt-twist {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 30px;
  padding: 0; border: 0; background: none; color: var(--text-4);
}
.vt-twist svg { width: 14px; height: 14px; }
.vt-name {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px 0 2px;
  border: 0; background: none; text-align: left; font-size: 13px; color: var(--text-2);
}
.vt-name svg { flex: none; width: 15px; height: 15px; color: var(--text-4); }
.vt-name span:not(.vt-count) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-count { margin-left: auto; font-size: 12px; color: var(--text-4); font-variant-numeric: tabular-nums; }

.vault-main { overflow: hidden; }
.vault-main .toolbar { border-top: 0; border-bottom: 1px solid var(--border); }
.vault-search { width: min(420px, 100%); }
.vault-crumb {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px;
  min-height: 46px; padding: 8px 20px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.v-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.v-crumbs .link { padding: 0; border: 0; background: none; color: var(--accent); font-size: 13px; }
.v-sep { color: var(--text-4); }
.v-folder-acts { display: flex; flex-wrap: wrap; gap: 6px; }

.vault-list { list-style: none; margin: 0; padding: 0; }
.v-item {
  display: grid; grid-template-columns: 32px minmax(160px, 1fr) minmax(0, 2.2fr); align-items: center; gap: 4px 12px;
  padding: 10px 20px; border-bottom: 1px solid var(--border); transition: background var(--ease);
}
.v-item:last-child { border-bottom: 0; }
.v-item:hover { background: var(--row-hover); }
.v-item.dragging { opacity: .45; }
.v-item[draggable="true"] { cursor: grab; }
.v-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-3);
}
.v-ico svg { width: 16px; height: 16px; }
.v-password .v-ico { background: var(--accent-soft); color: var(--accent); }
.v-head { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.v-title {
  align-self: flex-start; max-width: 100%; padding: 0; border: 0; background: none; text-align: left;
  font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v-title:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.v-path { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-4); min-width: 0; }
.v-path svg { flex: none; width: 12px; height: 12px; }
.v-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; min-width: 0; }
.v-field { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: 13px; }
.v-label { font-size: 12px; color: var(--text-4); margin-right: 2px; }
.v-val { min-width: 0; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.v-secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; user-select: all; }
.v-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); text-decoration: none; }
.v-link:hover { text-decoration: underline; }
.v-link svg { flex: none; width: 12px; height: 12px; }
.v-note .v-val { max-width: 520px; color: var(--text-3); }
.v-copy.copied, .vault-input .copied { color: var(--green); }
.v-empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 14px; }

.vault-input { position: relative; display: flex; align-items: center; gap: 4px; }
.vault-input > input, .vault-input > .password-field { flex: 1; min-width: 0; }
.vault-secret-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#vault-form textarea { font-family: inherit; resize: vertical; }
#vault-form input[name="secret"] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* The spreadsheet: sticky header row and Name column, a crosshair on the picked cell. */
.vg-wrap {
  position: relative; overflow: auto; max-height: calc(100vh - 290px); min-height: 160px;
  scroll-padding: 38px 0 0 22%; outline: none;
}
.vg-wrap:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.vg { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: fixed; }
.vg col, .vg th, .vg td { box-sizing: border-box; }
.vg th {
  position: sticky; top: 0; z-index: 2; height: 36px; padding: 0 10px; text-align: left; white-space: nowrap;
  background: var(--surface-2); color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .02em;
  border-bottom: 1px solid var(--border-strong); border-right: 1px solid var(--border);
}
.vg td {
  height: 40px; padding: 0 6px 0 10px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  background: var(--surface); white-space: nowrap; overflow: hidden; vertical-align: middle;
}
.vg th:last-child, .vg td:last-child { border-right: 0; }
.vg [data-col="0"] { position: sticky; left: 0; z-index: 1; border-right-color: var(--border-strong); }
.vg th[data-col="0"] { width: 22%; z-index: 3; }
.vg th[data-col="1"] { width: 18%; }
.vg th[data-col="2"] { width: 18%; }
.vg th[data-col="3"] { width: 16%; }
.vg th[data-col="5"] { width: 13%; }
.vg-cell { display: flex; align-items: center; gap: 2px; min-width: 0; height: 100%; }
.vg-cell > .vg-val, .vg-cell > .vg-none { flex: 0 1 auto; min-width: 0; max-width: none; margin-right: 4px; }
.vg-cell > .vg-ico, .vg-cell > .icon-btn { flex: none; }
.vg td { cursor: cell; }
.vg tr[draggable="true"] td:first-child { cursor: grab; }
.vg tr.dragging td { opacity: .45; }
.vg tbody tr:hover td { background: var(--row-hover); }
.vg-val { display: inline-block; max-width: calc(100% - 64px); overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.vg-name { max-width: calc(100% - 64px); font-weight: 600; color: var(--text); }
.vg-dim { color: var(--text-3); }
.vg-none { color: var(--text-4); }
.vg-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 8px;
  border-radius: 6px; background: var(--surface-2); color: var(--text-3);
}
.vg-ico svg { width: 13px; height: 13px; }
.vg-ico.v-password { background: var(--accent-soft); color: var(--accent); }
.vg-access { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.vg-access svg { flex: none; width: 12px; height: 12px; color: var(--amber, #b45309); }
.vg .icon-btn.small { width: 26px; height: 26px; opacity: 0; transition: opacity var(--ease); }
.vg .icon-btn.small svg { width: 14px; height: 14px; }
.vg tr:hover .icon-btn.small, .vg tr.x-row .icon-btn.small, .vg .icon-btn.small:focus-visible, .vg .copied { opacity: 1; }
.vg .v-link { display: inline-flex; align-items: center; gap: 4px; }
.vg .v-link svg { flex: none; width: 12px; height: 12px; }

/* Crosshair: the picked row and column tinted, the cell itself outlined. */
.vg tr.x-row td,
.vg[data-xcol="0"] [data-col="0"],
.vg[data-xcol="1"] [data-col="1"],
.vg[data-xcol="2"] [data-col="2"],
.vg[data-xcol="3"] [data-col="3"],
.vg[data-xcol="4"] [data-col="4"],
.vg[data-xcol="5"] [data-col="5"],
.vg[data-xcol="6"] [data-col="6"] {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.vg[data-xcol="0"] th[data-col="0"],
.vg[data-xcol="1"] th[data-col="1"],
.vg[data-xcol="2"] th[data-col="2"],
.vg[data-xcol="3"] th[data-col="3"],
.vg[data-xcol="4"] th[data-col="4"],
.vg[data-xcol="5"] th[data-col="5"],
.vg[data-xcol="6"] th[data-col="6"] {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); color: var(--accent);
}
.vg tr.x-row td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.vg td.x-cell {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)) !important;
  outline: 2px solid var(--accent); outline-offset: -2px;
}
.vg-wrap:not(:focus-within) td.x-cell { outline-style: dashed; }
.vg .v-empty { text-align: center; white-space: normal; height: auto; padding: 40px 20px; cursor: default; }
@media (hover: none) { .vg .icon-btn.small { opacity: 1; } }
.vg-cols { position: relative; margin-left: auto; }
.vg-cols summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.vg-cols summary::-webkit-details-marker { display: none; }
.vg-cols summary svg { width: 14px; height: 14px; }
.vg-cols[open] summary { border-color: var(--accent); color: var(--accent); }
.vg-cols-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 180px; padding: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-lg, 0 8px 24px rgba(15, 23, 42, .14));
}
.vg-col-opt { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 8px; border-radius: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.vg-col-opt:hover { background: var(--row-hover); }
.vg-col-opt input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
@media (max-width: 860px) { .vg-col-opt { min-height: 44px; } }
.vt-lock { display: inline-flex; color: var(--text-4); }
.vt-lock svg { width: 12px !important; height: 12px !important; }

/* "Who can see it" in the dialogs. */
.vault-access { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--border); min-width: 0; }
.vault-access legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); float: left; width: 100%; }
.vault-access .segmented label { position: relative; display: flex; }
.va-pick { display: flex; flex-direction: column; gap: 6px; }
.va-pick[hidden] { display: none; }
.va-group { margin: 4px 0 0; font-size: 12px; color: var(--text-4); }
.va-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.form-grid label.va-chip { flex-direction: row; gap: 6px; font-weight: 500; }
.va-chip input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.va-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.va-off { color: var(--text-3); }
.va-flag { font-size: 11px; color: var(--text-4); }
.va-note:empty { display: none; }

@media (max-width: 1100px) {
  .v-item { grid-template-columns: 32px minmax(0, 1fr); }
  .v-fields { grid-column: 2; }
}
@media (max-width: 860px) {
  .vault { grid-template-columns: minmax(0, 1fr); }
  .vault-tree { position: static; max-height: 240px; }
  .vault-crumb, .v-item { padding-left: 14px; padding-right: 14px; }
  .vt-name, .vt-twist { min-height: 44px; }
  .v-field .icon-btn { width: 40px; height: 40px; }
  .v-val { max-width: 180px; }
  .vg-wrap { max-height: 70vh; scroll-padding-left: 150px; }
  .vg { min-width: 720px; }
  .vg tr:not(.x-row) .vg-open { display: none; } /* tap a row first, then its open button shows */
  .vg th[data-col="0"] { width: 150px; }
  .vg td { height: 48px; }
  .vg .icon-btn.small { width: 36px; height: 36px; }
  .va-chip { min-height: 44px; }
}

/* ======================================================= Support, v3.57
   The board with its four filters, compact cards that say how long a ticket
   has been open and since its last update, and one ticket's own page: the
   task, who's responsible, three times, and its activity history. */
.column[data-stage="waiting"] { --stage: var(--orange-dot); }
.tk-bar { display: flex; flex-wrap: wrap; min-width: 0; align-items: center; justify-content: space-between; gap: 10px 16px; margin: -6px 0 14px; border-bottom: 1px solid var(--border); }
.tk-tabs { display: flex; gap: 2px; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tk-tabs::-webkit-scrollbar { display: none; }
.tk-tabs button {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; border: 0; background: none;
  color: var(--text-3); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: color var(--ease);
}
.tk-tabs button:hover { color: var(--text); }
.tk-tabs button[aria-pressed="true"] { color: var(--accent); font-weight: 600; }
.tk-tabs button[aria-pressed="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tk-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.tk-tabs button[aria-pressed="true"] .tab-count { background: var(--accent-soft); color: var(--accent); }
.tk-tabs .tab-count-warn.has-some { background: var(--red-bg); color: var(--red); }
.tk-tools { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 8px; }

/* Cards */
.kcard-ticket { gap: 5px; cursor: pointer; }
.kcard-ticket[draggable="true"] { cursor: grab; }
.kcard-ticket .kcard-top { align-items: flex-start; }
.kcard-ticket .kcard-title { font-size: 13.5px; line-height: 1.35; }
.kcard-ticket .kcard-meta { display: flex; align-items: center; gap: 5px; }
.kcard-ticket .kcard-meta svg { flex: none; width: 13px; height: 13px; color: var(--text-4); }
.kcard-ticket .kcard-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-3); }
.kcard-ticket.needs-attention { border-color: color-mix(in srgb, var(--red-dot) 45%, var(--border)); }
.kcard-ticket.prio-card-urgent { border-color: var(--red-dot); }
.prio-low { background: var(--grey-bg); color: var(--text-4); }
.prio-normal { background: var(--accent-soft); color: var(--accent); }
.tk-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.tk-flag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px 1px 6px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.tk-flag svg { width: 12px; height: 12px; }
.tk-flag-red { background: var(--red-bg); color: var(--red); }
.tk-flag-amber { background: var(--amber-bg); color: var(--amber); }
.tk-flag-quiet { padding-left: 0; color: var(--text-3); font-weight: 500; }
.tk-foot { flex-wrap: wrap; gap: 4px 8px; padding-top: 6px; border-top: 1px solid var(--surface-3); }
.ticket-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-unassigned { color: var(--text-4); font-style: italic; }
.tk-times { display: inline-flex; flex-wrap: wrap; gap: 0 5px; margin-left: auto; font-size: 11.5px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.tk-times .is-quiet { color: var(--amber); font-weight: 600; }
.tk-dot { background: var(--red-bg); color: var(--red); }

/* One ticket */
.tk-loading { padding: 24px 0; color: var(--text-4); }
#ticket-view .back { margin-bottom: 8px; }
.tk-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 20px; margin-bottom: 14px; }
.tk-head-main { min-width: 0; flex: 1 1 420px; }
.tk-head h1 { margin: 6px 0 4px; overflow-wrap: anywhere; }
.tk-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tk-chips .prio { font-size: 12px; padding: 2px 9px; }
.tk-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--text-3); }
.tk-sub svg { width: 15px; height: 15px; color: var(--text-4); }
.tk-sub a { color: var(--text-2); font-weight: 500; }
.tk-sub a:hover { color: var(--accent); }
.tk-head-acts { display: flex; gap: 8px; }
.tk-stage { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; }
.tk-stage::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--grey-dot); }
.tk-stage-in_progress { background: var(--accent-soft); color: var(--accent); }
.tk-stage-in_progress::before { background: #0284c7; }
.tk-stage-waiting { background: var(--orange-bg); color: var(--orange); }
.tk-stage-waiting::before { background: var(--orange-dot); }
.tk-stage-done { background: var(--green-bg); color: var(--green); }
.tk-stage-done::before { background: var(--green-dot); }

.tk-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; overflow: hidden; }
.tk-fig { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 16px; }
.tk-fig + .tk-fig { border-left: 1px solid var(--surface-3); }
.tk-fig-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.tk-fig-label svg { width: 14px; height: 14px; color: var(--text-4); }
.tk-fig-value { font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--text); font-variant-numeric: tabular-nums; }
.tk-fig-sub { font-size: 12px; color: var(--text-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-fig.is-quiet .tk-fig-value { color: var(--amber); }

.tk-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tk-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tk-sec { padding: 14px 18px 16px; }
.tk-sec h2, .tk-act-head h2 { font-size: 15px; font-weight: 600; }
.tk-sec h3 { margin: 12px 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-4); }
.tk-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.tk-text.dim { font-size: 14px; }
.tk-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 12px; }
.tk-fields label, .tk-field-static { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 12px; font-weight: 500; color: var(--text-3); }
.tk-fields label > span, .tk-field-static > span + span { font-size: 14px; font-weight: 400; color: var(--text); }
.tk-fields select, .tk-fields input {
  width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.tk-fields select:focus, .tk-fields input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.tk-sec .form-hint { margin-top: 12px; }

.tk-activity { overflow: hidden; }
.tk-act-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 14px 18px 10px; }
.tk-compose { padding: 12px 18px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tk-compose textarea {
  width: 100%; min-height: 72px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; resize: vertical;
}
.tk-compose textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.tk-compose-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.tk-attach { cursor: pointer; }
.tk-attach svg { width: 14px; height: 14px; }
#tk-update-file:focus-visible + .tk-attach { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-chosen { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; color: var(--text-2); }
.tk-chosen:empty { display: none; }
.tk-chosen > span { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-chosen svg { width: 14px; height: 14px; color: var(--text-4); }
.tk-compose .form-error { margin: 8px 0 0; }
.tk-latest { display: flex; align-items: center; gap: 8px; margin: 12px 18px 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text-2); font-size: 13px; }
.tk-latest svg { width: 15px; height: 15px; color: var(--accent); flex: none; }

.tk-timeline { position: relative; margin: 0; padding: 12px 18px 16px; list-style: none; }
.tk-entry { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
.tk-entry:not(:last-child)::before { content: ""; position: absolute; left: 13.5px; top: 36px; bottom: -8px; width: 1px; background: var(--border); }
.tk-entry-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); color: var(--text-3); }
.tk-entry-ico svg { width: 14px; height: 14px; }
.tk-entry-comment .tk-entry-ico { background: var(--accent-soft); color: var(--accent); }
.tk-entry-stage .tk-entry-ico { background: var(--green-bg); color: var(--green); }
.tk-entry-assignee .tk-entry-ico { background: var(--orange-bg); color: var(--orange); }
.tk-entry-created .tk-entry-ico { background: var(--grey-bg); color: var(--text-2); }
.tk-entry-head { display: flex; align-items: flex-start; gap: 6px; color: var(--text-2); line-height: 1.4; }
.tk-entry-head .pavatar { margin-top: 1px; }
.tk-entry-head strong { color: var(--text); }
.tk-entry-when { margin-top: 1px; font-size: 12px; color: var(--text-4); }
.tk-entry-text { margin-top: 6px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--surface-3); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.tk-entry-sub { margin-top: 4px; font-size: 13px; color: var(--text-3); }
.tk-pic { display: inline-block; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; line-height: 0; }
.tk-pic img { max-width: min(240px, 100%); max-height: 180px; object-fit: cover; }
.tk-file { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 13px; }
.tk-file svg { width: 15px; height: 15px; color: var(--text-4); }
.tk-file a { color: var(--accent); font-weight: 500; overflow-wrap: anywhere; }
.tk-file-dl { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; }
.tk-file-dl:hover { background: var(--surface-3); }
.tk-edit { margin-top: 6px; font-size: 13px; }
.tk-edit summary { color: var(--accent); font-weight: 500; cursor: pointer; }
.tk-edit dl { margin: 6px 0 0; display: grid; gap: 6px; }
.tk-edit dt { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-4); }
.tk-edit dd { margin: 0; display: grid; gap: 4px; }
.tk-was, .tk-now { padding: 4px 8px; border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-was { background: var(--red-bg); color: var(--text-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 50%, transparent); }
.tk-now { background: var(--green-bg); color: var(--text); }

/* The form */
.dialog-body-scroll { overflow-y: auto; }
.label-opt { font-weight: 400; color: var(--text-4); }

@media (max-width: 1100px) {
  .tk-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .tk-bar { flex-direction: column; align-items: stretch; }
  .tk-tabs button { min-height: 44px; }
  .tk-tools .board-search { flex: 1 1 100%; width: auto; min-width: 0; }
  .tk-figs { grid-template-columns: minmax(0, 1fr); }
  .tk-fig + .tk-fig { border-left: 0; border-top: 1px solid var(--surface-3); }
  .tk-fields { grid-template-columns: minmax(0, 1fr); }
  .tk-fields select, .tk-fields input, .tk-compose textarea { min-height: 44px; font-size: 16px; }
  .tk-head-acts { width: 100%; }
  .tk-head-acts .btn, .tk-compose-row .btn { min-height: 44px; }
  .tk-file-dl { width: 44px; height: 44px; }
}

/* ===================================================== Onboarding, v3.57
   The implementation tracker: cards with each product's status, progress and
   times; a hotel's page and a product's page with their history. Status
   colours: Complete green, In Progress blue, Pending orange, Not Done red,
   Not Set grey. */
.st-done { --st: var(--green-dot); --st-bg: var(--green-bg); --st-ink: var(--green); }
.st-progress { --st: #0284c7; --st-bg: var(--accent-soft); --st-ink: var(--accent); }
.st-pending { --st: var(--orange-dot); --st-bg: var(--orange-bg); --st-ink: var(--orange); }
.st-todo { --st: var(--red-dot); --st-bg: var(--red-bg); --st-ink: var(--red); }
.st-none { --st: var(--border-strong); --st-bg: var(--surface-3); --st-ink: var(--text-3); }
.ob-key.st-pending, .ob-key.st-progress { background: var(--st); }
.ob-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--st, var(--grey-dot)); flex: none; }

.kcard-ob { gap: 6px; cursor: pointer; }
.kcard-ob[draggable="true"] { cursor: grab; }
.kcard-ob .kcard-top { align-items: center; }
.ob-title-wrap { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.kcard-ob.needs-attention { border-color: color-mix(in srgb, var(--amber-dot) 55%, var(--border)); }
.ob-prods { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; margin: 2px -6px 0; padding: 0; list-style: none; }
.ob-prods li { min-width: 0; }
.ob-prod { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 24px; padding: 2px 6px; border-radius: 6px; color: var(--text-2); font-size: 12px; text-decoration: none; }
.ob-prod:hover { background: var(--surface-2); color: var(--text); }
.ob-prod-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-prod-st { flex: none; font-weight: 600; color: var(--st-ink); }
.ob-prod.is-late .ob-prod-st::after { content: " · late"; color: var(--red); }
.ob-more, .ob-noprod { font-size: 12px; color: var(--text-4); padding: 0 6px; }
.ob-meter { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ob-meter.is-done { color: var(--green); }
.ob-bar { position: relative; flex: 1 1 auto; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ob-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--green-dot); }
.ob-bar-wide { display: block; flex: none; width: 100%; margin-top: 6px; }
.ob-dots { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.ob-dotlink { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; }
.ob-dotlink .ob-dot { width: 10px; height: 10px; }
.ob-dotlink:hover { background: var(--surface-3); }

/* A hotel's page and a product's page */
#onboard-view .back { margin-bottom: 8px; }
.ob-stage { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.ob-st { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 2px 9px; border-radius: 999px; background: var(--st-bg); color: var(--st-ink); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ob-stage-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.ob-stage-pick select { min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.tk-head-acts { flex-wrap: wrap; align-items: center; }
.ob-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ob-figs .tk-fig-value small { font-size: 13px; font-weight: 500; color: var(--text-3); }
.ob-fig-person { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; }

.ob-plist { margin: 8px -8px 0; padding: 0; list-style: none; }
.ob-prow { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 16px; align-items: center; gap: 10px; padding: 10px 8px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.ob-plist li + li .ob-prow { border-top: 1px solid var(--surface-3); }
.ob-prow:hover { background: var(--surface-2); }
.ob-prow-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--surface-3); color: var(--text-3); }
.ob-prow-ico svg { width: 15px; height: 15px; }
.ob-prow-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.ob-prow-main .dim { font-size: 12px; }
.ob-prow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; width: 100%; font-size: 12px; color: var(--text-3); }
.ob-prow-meta .is-quiet { color: var(--amber); font-weight: 600; }
.ob-prow-out { width: 100%; font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.ob-prow-go svg { width: 16px; height: 16px; color: var(--text-4); }
.ob-over { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.ob-outstanding { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ob-pending textarea, .ob-details textarea {
  width: 100%; min-height: 64px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; resize: vertical;
}
.ob-pending textarea:focus, .ob-details textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.ob-pending { margin-top: 4px; }
.ob-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 12px 0 0; }
.ob-info dt { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-4); }
.ob-info dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 0; overflow-wrap: anywhere; }
.ob-info-wide { grid-column: 1 / -1; }
.ob-team-line { gap: 6px 12px !important; }
.ob-person { display: inline-flex; align-items: center; gap: 6px; }
.ob-about { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.ob-about select { min-height: 30px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.ob-latest { align-items: flex-start; }
.ob-latest p { margin-top: 2px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.ob-ptag { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; padding: 0 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); font-weight: 600; text-decoration: none; }
.ob-ptag svg { width: 11px; height: 11px; }
.ob-ptag:hover { color: var(--accent); }
.tk-entry-head .ob-st { margin: 0 2px; padding: 0 7px; font-size: 11.5px; vertical-align: 1px; }

.ob-ptitle { display: flex; align-items: center; gap: 10px; }
.ob-ptitle svg { width: 22px; height: 22px; color: var(--text-3); flex: none; }
.ob-ptitle .dim { font-size: 16px; font-weight: 500; }
.ob-status-card { margin-bottom: 16px; padding: 12px 14px; }
.ob-statuses { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ob-sbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.ob-sbtn .ob-dot { width: 10px; height: 10px; }
.ob-sbtn:hover:not(:disabled) { border-color: var(--st); background: var(--st-bg); }
.ob-sbtn[aria-checked="true"] { border-color: var(--st); background: var(--st-bg); color: var(--st-ink); box-shadow: inset 0 0 0 1px var(--st); }
.ob-sbtn:disabled { cursor: default; }
.ob-sbtn:disabled:not([aria-checked="true"]) { opacity: .55; }
.ob-sbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ob-status-card .form-hint { margin-top: 8px; }
.ob-details { display: grid; gap: 12px; margin-top: 14px; }
.ob-details label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--text-3); }

@media (max-width: 1100px) {
  .ob-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ob-figs .tk-fig:nth-child(3) { border-left: 0; }
  .ob-figs .tk-fig:nth-child(n + 3) { border-top: 1px solid var(--surface-3); }
}
@media (max-width: 860px) {
  .ob-figs { grid-template-columns: minmax(0, 1fr); }
  .ob-figs .tk-fig { border-left: 0 !important; }
  .ob-figs .tk-fig + .tk-fig { border-top: 1px solid var(--surface-3); }
  .ob-statuses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ob-statuses .ob-sbtn:last-child { grid-column: 1 / -1; }
  .ob-sbtn { min-height: 48px; font-size: 14px; }
  .ob-info, .ob-over { grid-template-columns: minmax(0, 1fr); }
  .ob-stage-pick { width: 100%; }
  .ob-stage-pick select { flex: 1; min-height: 44px; font-size: 16px; }
  .ob-pending textarea, .ob-details textarea, .ob-about select { font-size: 16px; }
  .ob-about { width: 100%; }
  .ob-about select { flex: 1; min-height: 44px; }
  .ob-prod { min-height: 32px; }
  .ob-dotlink { width: 32px; height: 32px; }
}

/* Onboarding, v3.57.1: products as traffic lights. Each product's icon sits
   in its status colour with a small mark; the hotel page shows each product as
   a tile with icons (who, last update, due, requirements, outstanding). */
.ob-lts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ob-lt {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border: 1.5px solid var(--st);
  border-radius: 8px; background: var(--st-bg); color: var(--st-ink); text-decoration: none;
}
.ob-lt svg { width: 16px; height: 16px; }
.ob-lt.st-none { border-style: dashed; color: var(--text-4); }
a.ob-lt:hover { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--st); }
a.ob-lt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ob-lt-mark {
  position: absolute; right: -5px; bottom: -5px; display: grid; place-items: center; min-width: 15px; height: 15px; padding: 0 2px;
  border: 2px solid var(--surface); border-radius: 999px; background: var(--st); color: #fff; font-size: 9px; font-weight: 800; line-height: 1;
}
.ob-lt.is-late { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--red-dot); }
.ob-lt-sm { width: 24px; height: 24px; border-radius: 6px; }
.ob-lt-sm svg { width: 13px; height: 13px; }
.ob-lt-sm .ob-lt-mark { min-width: 12px; height: 12px; right: -4px; bottom: -4px; font-size: 7.5px; border-width: 1.5px; }
.ob-lts-sm { gap: 5px; }
.ob-lt-md { width: 30px; height: 30px; }
.ob-lt-lg { width: 40px; height: 40px; border-radius: 10px; border-width: 2px; }
.ob-lt-lg svg { width: 20px; height: 20px; }
.ob-lt-lg .ob-lt-mark { min-width: 18px; height: 18px; font-size: 11px; }
.ob-ptitle .ob-lt svg { width: 20px; height: 20px; color: var(--st-ink); }
.ob-key { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: var(--st); color: #fff; font-size: 10px; font-weight: 800; }
.ob-key.st-none { background: var(--surface-3); border: 1.5px dashed var(--border-strong); }

.ob-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.ob-tile {
  display: flex; align-items: flex-start; gap: 12px; height: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); text-decoration: none; transition: border-color var(--ease), background var(--ease);
}
.ob-tile:hover { border-color: var(--border-strong); background: var(--surface-2); }
.ob-tile-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ob-tile-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; line-height: 1.3; }
.ob-tile-name .dim { font-size: 12px; }
.ob-tile-st { font-size: 12px; font-weight: 600; color: var(--st-ink); }
.ob-tile-icons { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; }
.ob-ic { display: inline-flex; align-items: center; gap: 3px; min-height: 22px; font-size: 12px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ob-ic svg { width: 14px; height: 14px; color: var(--text-4); }
.ob-ic.is-off svg { opacity: .5; }
.ob-ic.is-warn, .ob-ic.is-warn svg { color: var(--amber); }
.ob-ic.is-late, .ob-ic.is-late svg { color: var(--red); font-weight: 700; }
.ob-outstanding { gap: 8px; }
@media (max-width: 860px) {
  .ob-lt { width: 36px; height: 36px; }
  .ob-lt-sm { width: 30px; height: 30px; }
  .ob-tiles { grid-template-columns: minmax(0, 1fr); }
  .ob-ic { min-height: 32px; }
}

/* Client report: the website and lock columns show an icon, not a brand. */
.ptag.ptag-icon { display: inline-grid; place-items: center; width: 24px; height: 22px; padding: 0; }
.ptag.ptag-icon svg { width: 14px; height: 14px; }
/* The list fits the width like the A4 landscape PDF does: tighter cells, dates and brands wrap. */
.report-table { min-width: 0; font-size: 11.5px; }
.report-table th, .report-table td { padding: 5px 4px; }
.report-table td:nth-child(2) { min-width: 0; }
.report-table tbody td:nth-child(2) { min-width: 96px; }
.report-table .due-text.is-long { white-space: normal; min-width: 92px; }
.report-table .report-amount { white-space: nowrap; }
.report-table .ptags { gap: 3px; }
.report-table .ptags { flex-wrap: wrap; max-width: 104px; }
.report-table .status-chip, .report-table .tag-chip { font-size: 11px; padding-left: 6px; padding-right: 7px; }
.report-table .ptag { padding: 0 5px; font-size: 11px; }
.report-table thead th { font-size: 11px; }
.report-table th[aria-sort] button { white-space: nowrap; }
.report-table td:nth-child(3) .ptag { white-space: normal; }
.report-table .co-head { padding: 4px 4px; letter-spacing: .02em; font-size: 10px; }
.report-table td.num:first-child, .report-table th.num:first-child { width: 1%; }
.report-table .total-row td .sub { display: block; white-space: normal; font-weight: 400; }
.report-table .total-row td strong { font-size: 12px; }
.report-table thead th { padding-left: 3px; padding-right: 3px; }
.report-table .th-tag { gap: 3px; }
.report-table .pay-chip { padding-left: 5px; padding-right: 6px; }
.report-table .total-row td.num { white-space: normal; }
@media (max-width: 860px) { .report-table { min-width: 900px; } }

/* Client report: the filters in one row. "Show" picks the list; each
   filter is a small button opening a short list to tick, with how many each
   choice would show; the order and grouping sit on the right. */
.report-card { overflow: visible; }
.report-bar-wrap {
  position: relative; border-bottom: 1px solid var(--border); background: var(--surface-2);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.report-bar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 10px 20px; }
.rb-sep { flex: none; width: 1px; height: 22px; margin: 6px 2px 0; background: var(--border-strong); }
/* The filters take the room left and wrap among themselves, so the order and grouping stay put on the right. */
.rb-filters { display: flex; flex: 1 1 0; flex-wrap: wrap; align-items: center; gap: 6px; min-width: min(100%, 360px); }
.rb-view { display: flex; flex: none; align-items: center; gap: 6px; margin-left: auto; }
.rb-show select { font-weight: 600; color: var(--text); }
.rb-ico { position: relative; }
.rb-ico svg { position: absolute; top: 50%; left: 9px; width: 14px; height: 14px; transform: translateY(-50%); color: var(--text-4); pointer-events: none; }
.rb-ico select { padding-left: 29px; }
/* As wide as the choice showing, where the browser can (not as wide as the longest choice). */
.rb-show select, .rb-ico select { field-sizing: content; }

/* A filter's button: its name, then what's ticked. */
.rf { position: relative; }
.rf-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 9px 0 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap; list-style: none; cursor: pointer;
  -webkit-user-select: none; user-select: none; transition: border-color var(--ease), background var(--ease), color var(--ease);
}
.rf-btn::-webkit-details-marker { display: none; }
.rf-btn::marker { content: ''; }
.rf-btn svg { width: 14px; height: 14px; flex: none; color: var(--text-4); transition: transform var(--ease); }
.rf-btn:hover { border-color: var(--border-hover); color: var(--text); }
.rf[open] > .rf-btn { border-color: var(--accent); }
.rf[open] > .rf-btn svg { transform: rotate(180deg); }
.rf-btn.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.rf-btn.is-on svg { color: currentColor; }
.rf-value { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; font-weight: 650; }
.rf-clear-all { align-self: center; margin-left: 2px; font-size: 13px; }

/* Its list. */
.rf-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 26;
  display: flex; flex-direction: column; width: max-content; min-width: 240px; max-width: min(340px, calc(100vw - 32px)); max-height: min(440px, 62vh, var(--room, 440px));
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-lg);
}
.rf-panel.to-left { left: auto; right: 0; }
.rf-list { overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.rf-opt {
  display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 0 8px; border-radius: 6px;
  color: var(--text-2); font-size: 13px; cursor: pointer;
}
.rf-opt:hover { background: var(--surface-2); color: var(--text); }
.rf-opt input { width: 15px; height: 15px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.rf-opt input:focus-visible { outline: none; }
.rf-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.rf-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-note { color: var(--text-4); font-size: 12px; }
.rf-n { margin-left: 14px; color: var(--text-4); font-size: 12px; font-variant-numeric: tabular-nums; }
.rf-opt.is-empty .rf-text { color: var(--text-4); }
.rf-opt.is-sub { padding-left: 32px; }
.rf-head { font-weight: 600; color: var(--text); }
.rf-head:not(:first-child) { margin-top: 4px; }
.rf-ico { display: inline-grid; place-items: center; width: 14px; height: 14px; flex: none; color: var(--text-3); }
.rf-ico svg { width: 13px; height: 13px; }
.rf-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--grey-dot); }
.rf-dot.due-overdue { background: var(--red-dot); }
.rf-dot.due-30 { background: var(--amber-dot); }
.rf-dot.due-90, .rf-dot.due-later { background: var(--green-dot); }
.rf-none { margin: 0; padding: 8px; font-size: 13px; color: var(--text-4); }
.rf-foot { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-top: 1px solid var(--border); }
.rf-foot .link-btn { margin-left: auto; align-self: center; font-size: 13px; }
.rf-mode { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.rf-mode button { min-height: 26px; padding: 0 9px; border: 0; border-radius: 6px; background: none; color: var(--text-3); font-size: 12px; font-weight: 500; }
.rf-mode button[aria-pressed="true"] { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }

/* The totals sit under the row, as part of the same header. */
.report-card .report-totals { margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }

/* Phones: the row scrolls sideways, and a list opens across the width under it. */
@media (max-width: 860px) {
  .report-bar { flex-wrap: nowrap; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
  .report-bar::-webkit-scrollbar { display: none; }
  .report-bar > *, .rb-filters > *, .rb-view > * { flex: none; }
  .rb-filters { min-width: 0; }
  .rb-filters, .rb-view { flex-wrap: nowrap; }
  .rf { position: static; }
  .rf-panel, .rf-panel.to-left { top: calc(100% + 4px); left: 12px; right: 12px; width: auto; max-width: none; max-height: min(60vh, var(--room, 60vh)); }
}
@media (max-width: 860px), (pointer: coarse) {
  .rf-btn, .rf-opt { min-height: 44px; }
  .rf-mode button { min-height: 36px; }
}
