:root {
    /* speed-and-look (2026-10-22): these names stay for the existing rules, but every colour, size and radius now
       comes from core/css/tokens.css -- one set for light and dark (the dark values switch there, not here). */
    --accent: var(--theme-accent);   /* personalisation: the theme's own; core/css/themes/ sets it per data-accent */
    --border: var(--c-border);
    --text: var(--c-text);
    --text-muted: var(--c-muted);
    --bg: var(--c-bg);
    --bg-panel: var(--c-surface);
    --row-hover: var(--c-row-hover);
    --sidebar-width: 220px;
    --topbar-height: 56px;
    --radius: 8px;

    /* ui_redesign_brief_1.md item 4: one spacing scale (tokens.css --sp-*) */
    --space-1: var(--sp-1);
    --space-2: var(--sp-2);
    --space-3: var(--sp-3);
    --space-4: var(--sp-4);

    /* Every form control and button shares this height so rows of
       mixed inputs/buttons (filter bars, inline forms) line up. */
    --control-height: 36px;
    /* Stage 6 (2026-10-01): the dense form style's control height --
       between the grid's 24px and the 36px default. */
    --control-height-dense: 30px;
    --field-max: 320px;
    --font-data: var(--fs-sm);
    --font-label: var(--fs-2xs);
    --font-header: var(--fs-md);

    --badge-amber-bg: var(--c-warn-bg);    --badge-amber-fg: var(--c-warn);
    --badge-green-bg: var(--c-ok-bg);      --badge-green-fg: var(--c-ok);
    --badge-red-bg: var(--c-bad-bg);       --badge-red-fg: var(--c-bad);
    --badge-blue-bg: var(--c-info-bg);     --badge-blue-fg: var(--c-info);
    --badge-gray-bg: var(--c-neutral-bg);  --badge-gray-fg: var(--c-neutral);
    --badge-teal-bg: var(--c-teal-bg);     --badge-teal-fg: var(--c-teal);
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); }

/* ---------- App shell ---------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.sidebar-brand {
    padding: 16px;
    font-weight: 700;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-brand-mark {
    width: 28px; height: 28px;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-contrast);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-nav { padding: 8px; flex: 1; }

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: none;
    border-top: 1px solid var(--border);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
}

.sidebar-collapse-btn:hover { background: var(--bg); }

.sidebar-collapse-btn .icon { width: 18px; text-align: center; flex-shrink: 0; }

/* ---------- Collapsed sidebar (icon-only rail) ---------- */

body.sidebar-collapsed .sidebar { width: 56px; }
body.sidebar-collapsed .sidebar-brand-name,
body.sidebar-collapsed .sidebar-link-label,
body.sidebar-collapsed .sidebar-brand span:not(.sidebar-brand-mark) {
    display: none;
}
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 16px 8px; }
body.sidebar-collapsed .sidebar-link { justify-content: center; padding: 9px; }
body.sidebar-collapsed .sidebar-collapse-btn { justify-content: center; }

.sidebar-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 12px 12px 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.sidebar-link:hover { background: var(--bg); color: var(--text); text-decoration: none; }

/* A count of things stuck that this person can clear (e.g. handovers
   waiting for a location). Amber, not red: it needs doing, it isn't an
   error. Same pill metrics as .notif-badge. Collapsed sidebar: a dot. */
.sidebar-count {
    margin-left: auto;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--badge-amber-bg);
    color: var(--badge-amber-fg);
    font-size: var(--font-label); font-weight: 700; line-height: 18px;
    text-align: center;
}
body.sidebar-collapsed .sidebar-link { position: relative; }
body.sidebar-collapsed .sidebar-count {
    position: absolute; top: 4px; right: 6px;
    min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0;
}

.sidebar-link.active {
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 600;
}

.sidebar-link .icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.main-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-title {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    /* A long title (e.g. "Marketing › CD-00001 — <name>") is shortened with
       an ellipsis instead of pushing the bell/avatar off a phone screen. */
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-search {
    flex: 1;
    max-width: 420px;
}

.topbar-search input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
    font-size: 0.85rem;
    background: var(--bg);
}

.topbar-spacer { flex: 1; }

.topbar-icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
}

.topbar-icon-btn:hover { background: var(--bg); }

.badge-dot {
    position: absolute;
    top: 2px; right: 2px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--badge-red-fg);
}

/* item 8: larger bell + a prominent numeric unread badge (was a bare
   8px dot). */
.topbar-bell { font-size: 1.4rem; line-height: 1; }
.notif-badge {
    position: absolute;
    top: -1px; right: -1px;
    min-width: 16px; height: 16px;
    padding: 0 3px;
    border-radius: 999px;
    background: var(--badge-red-fg);
    color: var(--accent-contrast);
    font-size: 10px; font-weight: 700; line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg-panel);
}

/* item 8: toast stack for a new notification / due reminder. */
#crmToastStack {
    position: fixed;
    right: 16px; bottom: 16px;
    z-index: 3500;
    display: flex; flex-direction: column; gap: 8px;
    max-width: min(360px, calc(100vw - 32px));
}
.crm-toast {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 10px 30px 10px 12px;
    font-size: 0.9rem;
    box-shadow: var(--shadow-pop);
    animation: crmToastIn 0.2s ease-out;
}
.crm-toast.leaving { opacity: 0; transition: opacity 0.3s ease; }
.crm-toast-x {
    position: absolute;
    top: 4px; right: 6px;
    background: none; border: none;
    font-size: 16px; line-height: 1;
    color: var(--text-muted); cursor: pointer;
}
@keyframes crmToastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* marketing-batch-2 item 2: "Dismiss all" for currently-shown reminder
   toasts — sits above the stack (first child, flex column) only while
   at least one reminder toast is open. */
.crm-toast-dismiss-all {
    align-self: flex-end;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    cursor: pointer;
    box-shadow: var(--shadow);
}
.crm-toast-dismiss-all:hover { background: var(--bg); }

.avatar-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-contrast);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
}

.dropdown-menu-custom {
    position: absolute;
    right: 0; top: calc(var(--topbar-height) - 4px);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    min-width: 240px;
    display: none;
    z-index: 30;
}

.dropdown-menu-custom.open { display: block; }

.dropdown-menu-custom a, .dropdown-menu-custom button.linklike {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text);
    text-decoration: none;
    border: none;
    background: none;
}

.dropdown-menu-custom a:hover, .dropdown-menu-custom button.linklike:hover { background: var(--bg); }

.notif-menu-clear { border-bottom: 1px solid var(--border); text-align: right; }
.notif-menu-clear button.linklike {
    width: auto;
    display: inline-block;
    padding: 8px 14px;
    color: var(--accent);
}

.content { padding: var(--space-4) var(--space-4) var(--space-3); }

h3, .h3 { font-size: 1.25rem; }
h5, .h5 { font-size: var(--font-header); }

/* ---------- Stat chips ---------- */
/* docs/archive/ui_redesign_brief_1.md item 1/4: one compact row, not a grid of
   oversized cards — reserve visual weight for the table below. */

.stat-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.stat-chip {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-1);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-1) var(--space-3);
    line-height: 1.3;
}

.stat-chip-value { font-size: 15px; font-weight: 700; }
.stat-chip-label { font-size: var(--font-label); color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.stat-chip-accent .stat-chip-value { color: var(--accent); }
.stat-chip-green .stat-chip-value { color: var(--badge-green-fg); }
.stat-chip-amber .stat-chip-value { color: var(--badge-amber-fg); }
.stat-chip-red .stat-chip-value { color: var(--badge-red-fg); }

/* ---------- Filter bar ---------- */
/* docs/archive/ui_redesign_brief_1.md item 1: filters collapse into one row, every
   control (dropdowns, the Filter button) sharing --control-height so
   nothing looks mismatched. */

.filter-bar {
    display: flex;
    align-items: end;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-3);
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-field label {
    font-size: var(--font-label);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.filter-field select,
.filter-field input {
    min-width: 140px;
}

/* "Export Visible Columns" toolbar control — two labeled date fields
   grouped with their button in one bordered pill (same bordered-group
   treatment as .bulk-bar), so it reads as one cohesive control sitting
   in the icon-btn row instead of two bare, unlabeled date inputs that
   look like broken/placeholder elements next to real buttons. */
.export-visible-columns-form {
    display: flex;
    align-items: end;
    gap: var(--space-2);
    padding: 3px var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
}
.export-visible-columns-form .filter-field input {
    min-width: 120px;
    height: var(--control-height);
}

/* ---------- List toolbar ---------- */
/* docs/archive/ui_redesign_brief.md correction: replaces the stat-card row that
   used to sit above every list view. Stat/metric cards now live only
   on Dashboard/Analytics. Slim single row: view tabs on the left,
   search + filter/columns icons + primary action on the right —
   everything at --control-height so it reads as one strip, not a
   stack of separate widgets. */

.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-2);
}

.list-toolbar-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

.list-tab {
    display: inline-flex;
    align-items: center;
    height: var(--control-height);
    padding: 0 var(--space-3);
    border-radius: var(--radius);
    font-size: var(--font-data);
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
}

.list-tab:hover { background: var(--bg); color: var(--text); text-decoration: none; }

/* Divider between the scope tabs (My Leads / My Team / All) and the
   status quick tabs on the Leads list — a faint separator, not a tab. */
.list-tab-sep {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space-1);
    color: var(--text-muted);
    opacity: 0.5;
    user-select: none;
}

.list-tab.active {
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 600;
}

/* UI polish batch (2026-09) item 3: the Calling Pending / Calling Done
   pair as a bordered segmented control — one related unit, set apart
   from the scope tabs. Active segment filled (inherits .list-tab.active),
   inactive plain. Theme tokens carry it into dark mode. */
.tab-segment {
    display: inline-flex;
    align-items: stretch;
    margin-left: var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-panel);
}
.tab-segment .list-tab { border-radius: 0; }
.tab-segment .list-tab + .list-tab { border-left: 1px solid var(--border); }

.list-toolbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.list-search {
    height: var(--control-height);
    font-size: var(--font-data);
    width: 200px;
    max-width: 100%;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: var(--control-height);
    padding: 0 var(--space-2);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: var(--font-data);
    cursor: pointer;
    line-height: 1;
    text-decoration: none;
}

.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn.active { background: var(--bg); color: var(--text); border-color: var(--accent); }

/* Extra filters (Technology/Visa etc.) collapsed behind the toolbar's
   Filter icon instead of always occupying a row of their own. */
.filter-panel {
    display: none;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: end;
    padding: var(--space-2);
    margin-bottom: var(--space-2);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.filter-panel.open { display: flex; }

/* Bulk-action bar (Bulk Approve/Reassign/Assign Selected, etc.) — same
   bordered-panel treatment as .filter-panel above, so a row of controls
   that only appears once you've selected something reads as part of the
   interface instead of floating unstyled below the table. Visibility
   itself stays inline (style="display:none", toggled by
   crmUpdateBulkBar in base.html) rather than a class, so this only
   needs to supply the "flex + border" layout, not the show/hide state.
   flex-wrap is load-bearing: a multi-field bar (select + textarea +
   button) has to drop extra controls to their own line rather than
   squeezing everything onto one, which is what made a button's label
   wrap/overlap illegibly before this existed. */
.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: var(--space-3);
    padding: var(--space-3);
    margin-top: var(--space-2);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.bulk-bar .btn { white-space: nowrap; }

/* ---------- Data table ---------- */
/* docs/archive/ui_redesign_brief.md correction: Zoho-style dense data grid, not a
   rounded card around a lightly-padded table. Bordered flat grid
   (no radius/shadow on the wrapper — that treatment is reserved for
   single-record .detail-card views), ~32-34px rows, tight cell
   padding, sticky header, frozen first column, zebra striping. Show
   every column the data has and let the wrapper's overflow-x handle
   width instead of curating columns down. */

.data-table-wrap {
    /* The containing block for anything absolutely positioned inside the
       table (e.g. Bootstrap's .visually-hidden spans in the Sales email and
       LinkedIn cells). Without it those escaped the wrapper's overflow
       clipping and widened the whole page (Sales list: 1719px at 1280px,
       1499px at 390px), so the page -- not the table -- scrolled sideways. */
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    overflow-x: auto;
    /* Bug fix: leaving overflow-y at its default `visible` here doesn't
       actually stay `visible` — per the CSS overflow spec, when one axis
       is `auto`/non-visible and the other is `visible`, the UA is
       required to force the `visible` one to `auto` too. That silently
       made this wrapper (not the page) the sticky positioning container
       for the <thead> below, even though it never grows tall enough to
       need its own vertical scrollbar — so the header's `top` offset was
       being applied against a container that doesn't scroll, painting it
       shifted down over the first data row instead of at the table's
       top edge. Setting overflow-y explicitly (not `visible`) avoids
       relying on that forced-auto behavior. */
    overflow-y: hidden;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-data);
}

table.data-table th {
    text-align: left;
    font-size: var(--font-label);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 6px var(--space-2);
    white-space: nowrap;
    position: sticky;
    /* Sticky positioning is relative to .data-table-wrap (the nearest
       scrolling ancestor, see the fix note above), not the page — so
       var(--topbar-height) was never the right offset here; it was
       overlapping the wrapper's own top edge (and the first data row
       under it) by that same 56px on every render, not just on scroll. */
    top: 0;
    z-index: 2;
}

table.data-table th a { color: var(--text-muted); text-decoration: none; }
table.data-table th a:hover { color: var(--text); }

table.data-table td {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 5px var(--space-2);
    vertical-align: middle;
    height: 32px;
    white-space: nowrap;
}

table.data-table td:last-child { border-right: none; }
/* A full-width row under a record holding its edit forms (Interviews,
   2026-10-01). Unlike ordinary cells it wraps, so labels read in full. */
table.data-table tr.row-panel > td {
    white-space: normal;
    height: auto;
    padding: var(--space-3);
    background: var(--bg);
}
/* A table whose cells may wrap, so it fits its card at laptop widths
   instead of scrolling sideways (Interviews: the time column alone was
   395px on one line and pushed the actions off-screen at 1280px). */
table.data-table.data-table--wrap td { white-space: normal; }
.row-panel-title { font-size: var(--font-label); font-weight: 600; color: var(--text-muted); margin-bottom: var(--space-2); }

table.data-table tbody tr[data-href] { cursor: pointer; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:nth-child(even) td { background: var(--bg); }
table.data-table tbody tr:hover td { background: var(--row-hover); }

/* Freeze the first column during horizontal scroll (Lead # etc.) */
table.data-table .freeze-col {
    position: sticky;
    left: 0;
    background: var(--bg-panel);
    box-shadow: 2px 0 4px rgba(20, 24, 33, 0.06);
}
table.data-table thead .freeze-col { z-index: 3; }
table.data-table tbody tr:nth-child(even) .freeze-col { background: var(--bg); }
table.data-table tbody tr:hover .freeze-col { background: var(--row-hover); }

/* The list grids (Leads / Sales / Marketing) scroll inside a
   fixed-height `.grid-scroll` region: sticky headers on vertical
   scroll, frozen leading columns, drag-scroll — see core/_data_grid.html
   and the `.grid-scroll` rules further down. `position: sticky` is a
   positioned value, so it also anchors the absolutely-positioned
   .col-resize-handle the same way `position: relative` did.

   `data-grid-fixed` grids (Leads / Sales) additionally get
   table-layout:fixed from the JS and clip each cell with an ellipsis;
   Marketing keeps auto-layout so its multi-line Payment Schedule cell
   isn't mangled. */
.grid-scroll .data-table th { position: sticky; top: 0; }
.grid-scroll .data-table[data-grid-fixed] th { overflow: hidden; }
.grid-scroll .data-table[data-grid-fixed] td { overflow: hidden; text-overflow: ellipsis; }
.col-resize-handle {
    position: absolute; top: 0; right: 0;
    width: 8px; height: 100%;
    cursor: col-resize;
    user-select: none;
}
.col-resize-handle:hover { background: var(--accent); opacity: 0.35; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }

/* Sales-view change (2026-09-08):
   - LinkedIn column trimmed: the header is now the icon itself (the
     body was already icon-only), so the column measures far narrower
     than the 8-char word did.
   - New Notes column: a fixed narrow width showing a short preview of
     the most recent note, clipped with an ellipsis; the fuller thread
     is the existing row-hover popup (data-notes-hover). The drag-resize
     JS measures these widths on load and pins them, so they hold. */
#salesTable .col-linkedin, #salesTable .col-email { width: 34px; text-align: center; }
#salesTable .col-notes { width: 148px; }
#salesTable td.col-notes { white-space: nowrap; }
.note-preview { color: var(--text-muted); font-size: 12px; }

/* Real-usage follow-up (2026-09-08): quick-add-note straight from the
   Sales list's Notes column. A small "+" next to the preview opens a
   lightweight fixed-position popover (no modal, no navigating away);
   it POSTs to sales:quick_add_note, which reuses core.services.add_note
   (shared thread + calling-status auto-Done trigger both still fire). */
.quick-note-btn {
    margin-left: 4px; padding: 0;
    width: 18px; height: 18px; line-height: 1;
    border: 1px solid var(--border); border-radius: 4px;
    background-color: var(--bg-panel); color: var(--text-muted);
    font-size: 13px; cursor: pointer; vertical-align: middle;
}
.quick-note-btn:hover { border-color: var(--accent); color: var(--text); }
.quick-note-pop {
    position: fixed; z-index: 4100; width: 260px;
    background-color: var(--bg-panel); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    padding: 8px;
}
.quick-note-pop textarea {
    width: 100%; box-sizing: border-box; resize: vertical;
    min-height: 52px; font: inherit; font-size: 12px;
    border: 1px solid var(--border); border-radius: 4px;
    padding: 4px 6px;
    background-color: var(--bg); color: var(--text);
}
.quick-note-pop-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.quick-note-pop-err { color: var(--badge-red-fg); font-size: 11px; margin-top: 4px; }

/* item 2 (Sept batch): admin-configurable stage row colour on the Sales
   list. `data-stage-tint="<token>"` on the <tr> (green/amber/red/purple/
   blue/grey) selects a palette entry that is painted DIRECTLY onto the
   cells — no intermediate custom property. (The previous build routed
   the colour through `--stage-tint-bg: var(--stage-tint)` declared on
   :root, where `--stage-tint` is undefined, so the value was invalid at
   computed-value time and nothing ever painted — in either theme. That
   indirection, not selector specificity, was the real bug.)

   Every token has an explicit LIGHT and DARK value. UI polish batch
   (2026-09) item 1: deepened well past the old near-white pastels so a
   full screen of rows reads at a glance, while --text stays legible on
   top (light values stay high-L*, dark values stay low-L*). The
   `#salesTable` id in the selectors is what makes these win over the
   zebra / hover backgrounds defined earlier (which carry no id). */
/* sales-row-colours (owner, 14 Nov 2026): each stage colour is ONE set -- row tint, its hover, the left edge bar and
   the stage chip (background + text) -- for light mode, and again for dark mode. The theme only decides light or dark
   (every theme keeps dark text in light mode and light text in dark mode), so one pair covers Classic, Cloud, Forest,
   Tech and Midnight. Checked: text on the row and on hover >= 6:1 in every theme, chip text >= 6.3:1, edge bar vs
   row >= 3.2:1. The six older colours keep their exact row and hover values. Teal, Pink and Lime are new. */
[data-stage-tint="green"]  { --st-row: #bfe6cd; --st-row-hover: #a9dcbb; --st-edge: #0d8a54; --st-chip-bg: #d2f3de; --st-chip-fg: #005e33; }
[data-stage-tint="amber"]  { --st-row: #f8e0b4; --st-row-hover: #f4d29a; --st-edge: #996b00; --st-chip-bg: #f9e7c8; --st-chip-fg: #6a4500; }
[data-stage-tint="red"]    { --st-row: #f8cfcf; --st-row-hover: #f3b9b9; --st-edge: #b45057; --st-chip-bg: #ffdede; --st-chip-fg: #7e2f36; }
[data-stage-tint="purple"] { --st-row: #ddccf4; --st-row-hover: #cfbaee; --st-edge: #865eb1; --st-chip-bg: #f0e3ff; --st-chip-fg: #5b3b7d; }
[data-stage-tint="blue"]   { --st-row: #c9ddf9; --st-row-hover: #b4d0f6; --st-edge: #3e75bf; --st-chip-bg: #d7ebff; --st-chip-fg: #204c88; }
[data-stage-tint="grey"]   { --st-row: #d5dbe2; --st-row-hover: #c5ccd6; --st-edge: #6c7580; --st-chip-bg: #e5eaf0; --st-chip-fg: #454e58; }
[data-stage-tint="teal"]   { --st-row: #afedee; --st-row-hover: #a5e3e4; --st-edge: #008a8f; --st-chip-bg: #c8f3f4; --st-chip-fg: #005e62; }
[data-stage-tint="pink"]   { --st-row: #fcd0ee; --st-row-hover: #f2c6e4; --st-edge: #a4538f; --st-chip-bg: #ffdff4; --st-chip-fg: #723262; }
[data-stage-tint="lime"]   { --st-row: #dbe6b8; --st-row-hover: #d1dcae; --st-edge: #6e7e01; --st-chip-bg: #e6eecd; --st-chip-fg: #485400; }
:root[data-mode="dark"] [data-stage-tint="green"]  { --st-row: #1f4e2e; --st-row-hover: #276139; --st-edge: #63c18c; --st-chip-bg: #083d24; --st-chip-fg: #b2e6c5; }
:root[data-mode="dark"] [data-stage-tint="amber"]  { --st-row: #5a441c; --st-row-hover: #6e5426; --st-edge: #d0a348; --st-chip-bg: #442f00; --st-chip-fg: #eed4a3; }
:root[data-mode="dark"] [data-stage-tint="red"]    { --st-row: #5f2b2b; --st-row-hover: #743636; --st-edge: #ed8a8e; --st-chip-bg: #512225; --st-chip-fg: #ffc6c6; }
:root[data-mode="dark"] [data-stage-tint="purple"] { --st-row: #402f66; --st-row-hover: #4d3b7d; --st-edge: #bc97e8; --st-chip-bg: #3b294f; --st-chip-fg: #e2cdfe; }
:root[data-mode="dark"] [data-stage-tint="blue"]   { --st-row: #25406d; --st-row-hover: #2e4d83; --st-edge: #78adf6; --st-chip-bg: #1a3356; --st-chip-fg: #badaff; }
:root[data-mode="dark"] [data-stage-tint="grey"]   { --st-row: #383e47; --st-row-hover: #434a54; --st-edge: #a2acb7; --st-chip-bg: #2d333a; --st-chip-fg: #d1d8e1; }
:root[data-mode="dark"] [data-stage-tint="teal"]   { --st-row: #004b4d; --st-row-hover: #155759; --st-edge: #24c2c5; --st-chip-bg: #003d3f; --st-chip-fg: #a0e6e7; }
:root[data-mode="dark"] [data-stage-tint="pink"]   { --st-row: #58304d; --st-row-hover: #653c59; --st-edge: #dc8cc5; --st-chip-bg: #49233f; --st-chip-fg: #f7c6e8; }
:root[data-mode="dark"] [data-stage-tint="lime"]   { --st-row: #3c4513; --st-row-hover: #485120; --st-edge: #a4b558; --st-chip-bg: #303705; --st-chip-fg: #d3deaa; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) [data-stage-tint="green"]  { --st-row: #1f4e2e; --st-row-hover: #276139; --st-edge: #63c18c; --st-chip-bg: #083d24; --st-chip-fg: #b2e6c5; }
    :root:not([data-theme]) [data-stage-tint="amber"]  { --st-row: #5a441c; --st-row-hover: #6e5426; --st-edge: #d0a348; --st-chip-bg: #442f00; --st-chip-fg: #eed4a3; }
    :root:not([data-theme]) [data-stage-tint="red"]    { --st-row: #5f2b2b; --st-row-hover: #743636; --st-edge: #ed8a8e; --st-chip-bg: #512225; --st-chip-fg: #ffc6c6; }
    :root:not([data-theme]) [data-stage-tint="purple"] { --st-row: #402f66; --st-row-hover: #4d3b7d; --st-edge: #bc97e8; --st-chip-bg: #3b294f; --st-chip-fg: #e2cdfe; }
    :root:not([data-theme]) [data-stage-tint="blue"]   { --st-row: #25406d; --st-row-hover: #2e4d83; --st-edge: #78adf6; --st-chip-bg: #1a3356; --st-chip-fg: #badaff; }
    :root:not([data-theme]) [data-stage-tint="grey"]   { --st-row: #383e47; --st-row-hover: #434a54; --st-edge: #a2acb7; --st-chip-bg: #2d333a; --st-chip-fg: #d1d8e1; }
    :root:not([data-theme]) [data-stage-tint="teal"]   { --st-row: #004b4d; --st-row-hover: #155759; --st-edge: #24c2c5; --st-chip-bg: #003d3f; --st-chip-fg: #a0e6e7; }
    :root:not([data-theme]) [data-stage-tint="pink"]   { --st-row: #58304d; --st-row-hover: #653c59; --st-edge: #dc8cc5; --st-chip-bg: #49233f; --st-chip-fg: #f7c6e8; }
    :root:not([data-theme]) [data-stage-tint="lime"]   { --st-row: #3c4513; --st-row-hover: #485120; --st-edge: #a4b558; --st-chip-bg: #303705; --st-chip-fg: #d3deaa; }
}
#salesTable tbody tr[data-stage-tint] > td { background-color: var(--st-row); }
#salesTable tbody tr[data-stage-tint]:hover > td { background-color: var(--st-row-hover); }
#salesTable tbody tr[data-stage-tint] > td:first-child { box-shadow: inset 3px 0 0 var(--st-edge); }
/* grey "muted" text was 2.5-3.3:1 on a tinted row: inside one, muted text uses the normal text colour */
#salesTable tbody tr[data-stage-tint] { --text-muted: var(--text); }
/* the lead number is in the accent colour (a button colour): 1.1-2.9:1 on some tints -- on a tinted row it takes the
   text colour (still bold, underlined on hover) */
#salesTable tbody tr[data-stage-tint] .lead-id-link { color: var(--text); }
/* the stage chip: the colour's name on its own colour, wherever a stage colour is picked or shown */
.stage-chip[data-stage-tint] { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
    font-weight: 600; line-height: 1.5; background: var(--st-chip-bg); color: var(--st-chip-fg);
    box-shadow: inset 3px 0 0 var(--st-edge); }

/* CALLING column on the Sales list. The green tick means exactly "a
   Sales-department user has added a note to this lead" — nothing else
   lights it (see _calling_status_inline.html). A row without a sales
   note keeps a small always-visible Pending / Done <select> so the
   cell is never an empty, click-through target. */
.calling-cell {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%;
}
.calling-tick {
    display: none;
    font-size: 20px;
    line-height: 1;
    font-weight: 900;
    color: var(--badge-green-fg);
}
.calling-cell.is-done .calling-tick { display: inline-block; }
select.calling-select { font-size: 12px; }
select.calling-select:hover { border-color: var(--accent); }
.calling-static-label {
    padding: 1px 6px; border-radius: 999px;
    border: 1px solid var(--border); background-color: var(--bg-panel);
    color: var(--text-muted); font-size: 12px; white-space: nowrap;
}

/* Follow-up (2026-09-08): explicit widths for a few columns shared by
   the Leads and Sales grids. On the Sales list (table-layout: fixed,
   cells clipped with an ellipsis) Created / Modified / Number were
   truncating the value; Technology was far wider than its short
   labels need. The Leads/Sales grid script does NOT read these: its own
   CLASS_W map (templates/core/_data_grid.html) sets them inline, so
   change both together (Part 7B changed only this one at first). */
.grid-scroll th.col-date  { width: 104px; }  /* Part 7B keeps it: one short line, "28 Oct, 23:40" + moon */
.grid-scroll th.col-phone { width: 170px; }  /* + the call button (voip-click-to-call) */
.grid-scroll th.col-tech  { width: 96px; }
/* CALLING: fits "Pending", or the tick + caret-only select when Done. */
#salesTable th.col-calling { width: 106px; text-align: center; }
/* Stage <select> needs room for its labels ("Looking for C2C" etc.). */
#salesTable th.col-stage { width: 140px; }

/* The Lead ID is the link that opens a lead (real <a>, so middle-click
   opens a new tab) — there's no separate "Open" column any more. */
.data-table td .lead-id-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.data-table td .lead-id-link:hover { text-decoration: underline; }

/* ============================================================
   List grids — shared density + scroll behaviour (Leads / Sales /
   Marketing). See core/_data_grid.html for the matching JS.
   ============================================================ */

/* Compact rows + inline controls so more rows fit and the wide
   columns aren't pushed off. Always compact: the "Comfortable rows"
   option was removed (owner, 2026-10-25). */
.grid-scroll .data-table td {
    height: 30px;
    padding-top: 2px;
    padding-bottom: 2px;
}
.grid-scroll .data-table th {
    padding-top: 3px;
    padding-bottom: 3px;
}
.grid-scroll .form-select, .grid-scroll .form-control {
    height: 24px;
    min-height: 24px;
    line-height: 22px;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 6px;
    font-size: 12px;
}

/* The fixed-height scroll region: one always-visible compact
   scrollbar, sticky headers, room for frozen columns, and — crucially
   — the grid fills the pane so pagination sits right under it instead
   of leaving a big void below a short list. Where :has() is supported
   the grid flex-grows to the exact available height; the calc() is the
   fallback. */
.grid-scroll {
    overflow-x: auto;
    overflow-y: auto;
    height: calc(100vh - 210px);
    min-height: 180px;
    overscroll-behavior-x: contain;
}
.content:has(.list-toolbar) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.content:has(.list-toolbar) .grid-scroll {
    height: auto;
    flex: 1 1 auto;
    /* let the flex chain size it exactly; internal scroll takes the
       overflow. Without this the intrinsic table height keeps the pane
       tall and the column overshoots the viewport (void / page scroll). */
    min-height: 120px;
}
/* Pin the list-page column to the viewport so the grid shrinks to the
   exact available height and the footer sits right under the pagination
   — .app-shell's `min-height: 100vh` otherwise lets the whole column
   grow past the viewport, leaving a void below short lists and a
   double scroll on tall ones. */
.main-col:has(.content .list-toolbar) {
    height: 100vh;
    min-height: 0;
}
.grid-scroll.is-drag-scrolling { cursor: grabbing; }
.grid-scroll.is-drag-scrolling * { cursor: grabbing !important; user-select: none !important; }

/* Compact CRM-coloured scrollbars — NB do NOT also set
   `scrollbar-color` / `scrollbar-width` here: Chromium ignores every
   ::-webkit-scrollbar-* rule the moment one of those standard props is
   present. Firefox falls back to its own bar. */
.grid-scroll::-webkit-scrollbar { width: 9px; height: 9px; }
.grid-scroll::-webkit-scrollbar-track {
    background: var(--bg);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
}
.grid-scroll::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius);
    border: 2px solid var(--bg);
}
.grid-scroll::-webkit-scrollbar-thumb:hover { background: var(--text); }
.grid-scroll::-webkit-scrollbar-corner { background: var(--bg); }

/* Frozen leading columns. The single-column `.freeze-col` shadow (its
   base rule) is dropped here and put only on the LAST frozen column
   (.freeze-col-edge, toggled by JS); JS sets each cell's `left` from
   the real column widths. Row colour (zebra / hover / stage tint)
   still shows on the frozen cells via the earlier rules. */
.grid-scroll .data-table .freeze-col { box-shadow: none; }
.grid-scroll .data-table tbody td.freeze-col { z-index: 1; }
.grid-scroll .data-table thead th.freeze-col { z-index: 3; }
.grid-scroll .data-table .freeze-col-edge { box-shadow: 8px 0 10px -6px rgba(20, 24, 33, 0.22); }

/* List pages on phones (Marketing list mobile fix, 2026-09-28). At 390px the
   page itself was 523px wide: the toolbar's Export Visible Columns form
   (three labelled fields with fixed 120-140px minimums) and the 200px
   search box could not shrink or wrap, so the whole page scrolled
   sideways. Here the toolbar controls wrap and shrink to the screen; only
   the data table scrolls sideways, inside its own .data-table-wrap.
   Frozen leading columns are released on narrow screens: four frozen
   columns (checkbox, code, created, name) filled almost the whole table
   view on a phone and covered the row-actions button, so it could not be
   tapped. Header cells stay sticky at the top. */
@media (max-width: 700px) {
    .list-toolbar { align-items: stretch; }
    .list-toolbar-actions { width: 100%; min-width: 0; }
    .list-search { flex: 1 1 100%; width: auto; min-width: 0; }
    .export-visible-columns-form { flex-wrap: wrap; width: 100%; min-width: 0; }
    .export-visible-columns-form .filter-field { flex: 1 1 120px; min-width: 0; }
    .export-visible-columns-form .filter-field input,
    .export-visible-columns-form .filter-field select { min-width: 0; width: 100%; }
    .filter-field { min-width: 0; max-width: 100%; }
    .filter-field select,
    .filter-field input,
    .filter-field textarea { min-width: 0; max-width: 100%; }
    .filter-panel .filter-field, .bulk-bar .filter-field { flex: 1 1 100%; }
    .bulk-bar .filter-field[style*="max-width"] { max-width: 100% !important; }
    .pagination { flex-wrap: wrap; }
    .dropdown-menu-custom.row-menu { max-width: calc(100vw - 16px); }
    /* The wrapped toolbar is taller on a phone; with the list column pinned
       to the screen height the table was left ~170px tall. Let the page
       scroll vertically here and give the table its own usable height. */
    .main-col:has(.content .list-toolbar) { height: auto; }
    .content:has(.list-toolbar) .grid-scroll { flex: none; height: 70vh; min-height: 280px; }
    .grid-scroll .data-table td.freeze-col { position: static; }
    .grid-scroll .data-table th.freeze-col { left: auto !important; }
    .grid-scroll .data-table .freeze-col-edge { box-shadow: none; }
}
:root[data-mode="dark"] .grid-scroll .data-table .freeze-col-edge { box-shadow: 8px 0 10px -6px rgba(0, 0, 0, 0.55); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .grid-scroll .data-table .freeze-col-edge { box-shadow: 8px 0 10px -6px rgba(0, 0, 0, 0.55); }
}

/* Lower-priority columns, hidden by default behind the "⋯ Columns"
   toggle (see base.html's crmToggleColumns) so the always-visible set
   (Lead #, Candidate, Number, Status, Sales Person, Technology, ...)
   never needs a scroll. */
table.data-table.cols-collapsed .col-secondary { display: none; }

/* LinkedIn column: a small brand-colored icon instead of the full URL. A click copies the link (owner, 17 Nov
   2026); Ctrl+click opens the profile. The separate hover copy button next to it is gone (owner, 17 Nov 2026). */
.linkedin-icon-link {
    display: inline-flex;
    color: #0a66c2;
}
.linkedin-icon-link:hover { color: #004182; }

/* marketing-batch-2 item 3: email column is icon-instead-of-text same
   as LinkedIn. Plain <button>s (a click performs a copy, not
   navigation) styled to match the LinkedIn link's size/spacing; the
   full value shows on hover via the native title tooltip and lives in
   a visually-hidden sibling span so crmTableSearch (which reads
   row.textContent) still matches on it even though nothing is painted
   on screen. position:relative so .copy-confirm (also used standalone
   on the email button) has a positioning parent without needing an
   inline style set from JS. */
.icon-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
}
.icon-copy-btn:hover { color: var(--accent); }
.linkedin-cell { position: relative; display: inline-flex; align-items: center; }
.copy-confirm {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 4px;
    background: var(--text);
    color: var(--bg-panel);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

/* ---------- Detail page: cards, key/value grid, empty states ---------- */

.detail-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: var(--space-3);
}

.detail-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border);
    font-size: var(--font-label);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-muted);
}

.detail-card-body { padding: var(--space-3); }

/* item 3 (Sept batch): Employee page laid out as cards in a responsive
   grid — two columns on a laptop, one on narrow — so it's no longer one
   long vertical scroll. Wide cards (the document tables, Admin Actions)
   span the full width. `align-items: start` keeps a short card from
   stretching to match a tall neighbour. */
.detail-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: var(--space-3);
    align-items: start;
}
.detail-grid-2 > .detail-card { margin-bottom: 0; }
.detail-grid-2 > .detail-card--wide { grid-column: 1 / -1; }
@media (max-width: 900px) {
    /* minmax(0, 1fr), not 1fr: a plain 1fr column can't shrink below its
       widest card's content, which pushed every card past a phone screen. */
    .detail-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* Admin Actions card on the Employee page — the guarded/destructive
   stuff (department change), set apart from the rest with a warning
   accent so it doesn't read as a routine section. */
.detail-card--admin { border-color: var(--badge-amber-fg); }
.detail-card--admin > .detail-card-header {
    color: var(--badge-amber-fg);
    background: var(--badge-amber-bg);
    border-bottom-color: var(--badge-amber-fg);
}

/* A section-level status badge sitting in a .detail-card-header —
   right-aligned by the header's flex/space-between. The header
   uppercases its text; the badge opts out so "Not submitted" doesn't
   shout. */
.detail-card-header .badge-pill { font-size: 11px; padding: 2px 8px; text-transform: none; letter-spacing: 0; }

/* Upload row inside a card: file input + type/title selects on one
   aligned line, the format/size hint directly beneath. */
.upload-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-end; margin-top: var(--space-2); }
.upload-hint { color: var(--text-muted); font-size: 11px; margin-top: var(--space-1); }

/* Small payment-due-dates calendar on the Deal and Payment tab —
   current month only, compact cells, no navigation chrome (that's the
   full Marketing Calendar page's job, this is deliberately "small"). */
.payment-mini-calendar th { font-size: var(--font-label); color: var(--text-muted); font-weight: 600; }
.payment-mini-calendar td { height: 44px; vertical-align: top; padding: 2px 4px; font-size: var(--font-data); }

/* ---------- docs/archive/ui_redesign_brief.md "Interaction Conventions" ---------- */

/* 1. View-mode-by-default, edit-on-click. .edit-field-edit stays out of
   the flow until .editing is toggled on the wrapper, so a detail page
   reads as text by default (no permanently-open input boxes) and
   nothing is editable until the pencil is deliberately clicked. */
.edit-field-edit { display: none; }
.edit-field.editing .edit-field-edit { display: inline-block; margin-top: var(--space-2); }
.edit-field.editing .edit-field-view { display: none; }
.edit-pencil-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    font-size: var(--font-label);
    line-height: 1;
}
.edit-pencil-btn:hover { color: var(--accent); }

/* 3. Row-actions kebab menu — reuses .dropdown-menu-custom's look, but
   positioned via JS (position: fixed, coordinates set on open) instead
   of the topbar's `position: absolute; right: 0`, since a menu
   absolutely-positioned inside .data-table-wrap would get clipped by
   that wrapper's overflow-x/y (needed for sticky columns — see that
   rule's own comment). Fixed positioning escapes the clip entirely. */
.dropdown-menu-custom.row-menu {
    position: fixed;
    top: auto; right: auto; left: auto;
    min-width: 160px;
}
.row-actions-kebab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: none;
    border: none;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}
.row-actions-kebab:hover { background: var(--bg); color: var(--text); }

/* 4. Inline reassign confirmation — replaces a persistent "Reassign"
   button. Hidden until the dropdown's value actually changes (see
   crmShowReassignConfirm in base.html), so reassigning a lead is still
   one deliberate confirm step, just not a button sitting there doing
   nothing until then. */
.reassign-confirm {
    display: none;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    padding: var(--space-2);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--font-data);
}
.payment-mini-calendar-today { background: var(--bg); font-weight: 700; }

.detail-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
}

.detail-header-bar h3 { margin: 0; font-size: var(--font-header); }
.detail-header-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

/* ---------- Detail page tabs ---------- */
/* docs/archive/ui_redesign_brief.md: tabbed detail pages (Sales lead/deal detail
   first) so a long stacked-card page doesn't scroll forever and
   low-frequency sections (Deal & Payment) don't dominate every record's
   page by default. Plain CSS/JS, no framework — server-renders the
   default tab's panel as .active so there's no flash of the wrong
   panel before JS runs. */
.detail-tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}
.detail-tab {
    padding: var(--space-2) var(--space-3);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: var(--font-data);
    cursor: pointer;
}
.detail-tab:hover { color: var(--text); }
.detail-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.kv-grid {
    display: grid;
    grid-template-columns: max-content 1fr max-content 1fr;
    gap: var(--space-2) var(--space-3);
    font-size: var(--font-data);
    align-items: baseline;
}
.kv-grid dt { color: var(--text-muted); white-space: nowrap; grid-column: auto; }
.kv-grid dd { margin: 0; }

@media (max-width: 700px) {
    .kv-grid { grid-template-columns: max-content 1fr; }
}

.empty-state {
    color: var(--text-muted);
    font-size: var(--font-data);
    padding: var(--space-2) 0;
}

/* ---------- Badge pills ---------- */

.badge-pill {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.5;
}

.badge-amber { background: var(--badge-amber-bg); color: var(--badge-amber-fg); }
.badge-green { background: var(--badge-green-bg); color: var(--badge-green-fg); }
.badge-red   { background: var(--badge-red-bg);   color: var(--badge-red-fg); }
.badge-blue  { background: var(--badge-blue-bg);  color: var(--badge-blue-fg); }
.badge-gray  { background: var(--badge-gray-bg);  color: var(--badge-gray-fg); }

/* docs/archive/schema_1.sql "COLOR CODING": replaces tags as the categorize-at-a-
   glance mechanism for stage/remark/call-outcome text specifically —
   colored text only, no pill background, restrained by design (this is
   deliberately NOT .badge-pill). Same tone tokens as the badges above
   so "green always means the same thing" holds across both styles. */
.status-text { font-weight: 600; }
.status-text-amber { color: var(--badge-amber-fg); }
.status-text-green { color: var(--badge-green-fg); }
.status-text-red   { color: var(--badge-red-fg); }
.status-text-blue  { color: var(--badge-blue-fg); }
.status-text-gray  { color: var(--text-muted); }

/* ---------- Focus states ---------- */

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, .sidebar-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- item 6c/6d (Sept batch): Activity Log + shared filter bits ---------- */

/* Quick date-range presets (shared: Reports + Activity Log). */
.date-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.date-presets .btn-sm { height: auto; }

/* One-click filter chips on the Activity Log. */
.act-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.act-chip {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--bg-panel);
    color: var(--text-muted); font-size: 12px; text-decoration: none;
}
.act-chip:hover { color: var(--text); border-color: var(--accent); }
.act-chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

/* Day header + sentence list. */
.act-day-header {
    margin: var(--space-4) 0 var(--space-2); font-size: var(--font-label);
    text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted);
    border-bottom: 1px solid var(--border); padding-bottom: 4px;
}
.act-list { list-style: none; margin: 0; padding: 0; }
.act-row { display: flex; gap: var(--space-2); padding: 6px 0; border-top: 1px solid var(--border); }
.act-row:first-child { border-top: none; }
.act-body { flex: 1; min-width: 0; }
.act-sentence { font-size: var(--font-data); line-height: 1.4; }
.act-time { margin-top: 1px; }
.act-detail summary { cursor: pointer; }
.act-detail[open] summary { margin-bottom: 4px; }

/* item 6b: Analytics dashboard — KPI tiles + inline-SVG chart cards. */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.kpi-tile {
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: var(--space-3);
}
.kpi-tile--soon { opacity: .6; }
.kpi-value { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-label { color: var(--text-muted); font-size: 11px; margin-top: 4px; }
.kpi-delta { font-size: 11px; margin-top: 6px; color: var(--text-muted); }
.kpi-delta.up { color: var(--badge-green-fg); }
.kpi-delta.down { color: var(--badge-red-fg); }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: var(--space-3); align-items: start; }
.chart-grid > .detail-card { margin-bottom: 0; }
.chart-grid > .chart-grid-wide { grid-column: 1 / -1; }
.crm-chart { display: block; width: 100%; height: auto; overflow: visible; }
@media (max-width: 780px) { .chart-grid { grid-template-columns: 1fr; } }

/* item 6c: Reports — team-totals band, inline bar next to each person's
   total, greyed zero-activity rows, sortable headers. */
.report-table thead th { cursor: pointer; user-select: none; }
.report-table thead th[data-sort="asc"]::after { content: " \25B4"; }
.report-table thead th[data-sort="desc"]::after { content: " \25BE"; }
.report-band td { background: var(--bg); border-bottom: 2px solid var(--border); }
.report-total-wrap { position: relative; display: inline-flex; align-items: center; min-width: 90px; }
.report-bar {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    height: 14px; border-radius: 3px; background: var(--accent); opacity: .22;
}
.report-total-num { position: relative; padding: 0 4px; font-variant-numeric: tabular-nums; }
table.data-table tbody tr.row-muted td { color: var(--text-muted); }
/* a data-table sitting flush inside a detail-card doesn't need its own frame */
.detail-card-body.p-0 > .data-table-wrap { border: none; }

/* Coloured dot per action type. */
.act-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--text-muted); }
.act-green { background: var(--badge-green-fg); }
.act-blue  { background: var(--badge-blue-fg); }
.act-red   { background: var(--badge-red-fg); }
.act-grey  { background: var(--text-muted); }

/* ---------- Forms / buttons kept close to Bootstrap but flatter ---------- */
/* docs/archive/ui_redesign_brief_1.md item 4: consistent ~36px control height so
   filter bars, inline rows (leave request form) and table rows line
   up. Overrides Bootstrap's own .form-control/.form-select/.btn sizing
   — relies on app.css loading after the Bootstrap CDN link in
   base.html for cascade priority. Left untouched: .btn-lg/.btn-sm,
   textarea (needs its own height), and select[multiple] (fixed height
   would clip the option list). */

.form-control, .form-select, .btn,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"] {
    min-height: var(--control-height);
    font-size: var(--font-data);
}

.form-control:not(textarea), .form-select {
    height: var(--control-height);
    padding-top: 0;
    padding-bottom: 0;
    line-height: var(--control-height);
}

.btn {
    height: var(--control-height);
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

select[multiple].form-select { height: auto; line-height: normal; }
.btn-lg, .btn-sm { height: auto; display: inline-block; }

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
}

.btn-accent:hover { filter: brightness(0.88); color: var(--accent-contrast); }

.sidebar-brand-logo {
    max-height: 28px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.login-brand-logo {
    max-width: 280px;
    height: auto;
}

/* Login pages (staff + candidate portal, 2026-09-25): one centred card that
   is the whole width on a phone (16px gutters), labels above full-width
   44px inputs, the button full width on phones. Existing tokens only, so
   it follows the device theme when nobody is logged in. */
.login-wrap { max-width: 420px; margin: 0 auto; padding: 48px 16px 24px; }
.login-card { background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; }
.login-brand { margin-bottom: 18px; }
.login-brand-banner { display: block; width: 100%; max-width: 280px; height: auto;
    border-radius: var(--radius); }
.login-brand-row { display: flex; align-items: center; gap: 12px; }
.login-brand-tile { display: inline-flex; align-items: center; justify-content: center;
    background: #000; border-radius: var(--radius); padding: 6px 8px; flex-shrink: 0; }  /* fixed colour: behind the light company logo */
.login-brand-tile img { height: 30px; width: auto; display: block; }
.login-brand-name { font-size: 18px; font-weight: 600; color: var(--text); }
.login-title { font-size: 15px; font-weight: 600; color: var(--text-muted);
    margin: 0 0 16px; text-transform: none; }
.login-field { margin-bottom: 14px; }
.login-field .form-label { font-size: 14px; margin-bottom: 6px; color: var(--text); }
.login-field .form-control { min-height: 44px; font-size: 16px; }  /* 16px stops iOS zooming in */
.login-submit { min-height: 44px; padding-left: 28px; padding-right: 28px; }
.login-muted { color: var(--text-muted); font-size: 13px; }
.login-wrap .login-notice { margin-top: 20px; }
/* The staff page sits inside Bootstrap's .container-fluid (12px padding):
   trim ours so both login pages have the same 16px phone gutter. */
@media (max-width: 575px) {
    .container-fluid > .login-wrap { padding-left: 4px; padding-right: 4px; }
}

@media (max-width: 575px) {
    .login-wrap { padding-top: 24px; }
    .login-card { padding: 20px 16px; }
    .login-submit { width: 100%; }
}

/* ---------- Footer / legal notices ---------- */
/* Internal pages: one quiet line, pinned to the bottom of the content
   column. Colours come from theme tokens so it reads correctly in both
   light and dark. */
.app-footer {
    margin-top: auto;
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--bg-panel);
    font-size: 11px;
    text-align: center;
}

.app-footer-anon {
    margin-top: 40px;
    border-top: none;
    background: transparent;
}

/* Login page: the full confidentiality notice, sized to the form column. */
.login-notice {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}

.login-notice p { margin-bottom: var(--space-2); }
.login-notice-lead { font-weight: 600; color: var(--text); }

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

.sidebar-toggle-btn { display: none; }

@media (max-width: 900px) {
    .sidebar-toggle-btn { display: inline-flex; }

    .sidebar {
        position: fixed;
        left: 0; top: 0;
        transform: translateX(-100%);
        transition: transform 0.15s ease;
        box-shadow: 0 0 0 9999px rgba(0,0,0,0);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 0 0 0 9999px rgba(20,24,33,0.35);
    }

    .topbar-search { display: none; }
}

/* ============================================================
   Payments module — plan progress bar + timeline (Stage 5).
   Theme-aware via the shared --border / --badge-* / --accent vars.
   ============================================================ */
.pay-progress {
    height: 10px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}
.pay-progress-fill {
    height: 100%;
    background: var(--badge-green-fg);
    border-radius: 999px;
    transition: width 0.2s ease;
}

.pay-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--border);
}
.pay-timeline li {
    position: relative;
    padding: 3px 0 3px 16px;
    font-size: 13px;
}
.pay-timeline li::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}
.pay-timeline-paid::before,
.pay-timeline-done::before { background: var(--badge-green-fg); }
.pay-timeline-due::before  { background: var(--badge-amber-fg); }
.pay-timeline-refund::before { background: var(--badge-red-fg); }

summary.linklike { color: var(--accent); cursor: pointer; font-size: 13px; }

/* =====================================================================
   Payments -- "Enrolments" page (Stage 6b): money strip, board, table.
   Built on the CRM theme tokens so light / dark both work. The board
   owns a small edge palette (like --stage-row-*); everything else
   reuses --badge-* / --border / --bg-panel / --text*.
   ===================================================================== */
:root {
    --enrol-edge-waiting:   var(--c-bad-solid);
    --enrol-edge-awaiting:  var(--badge-blue-fg);
    --enrol-edge-paying:    var(--badge-gray-fg);
    --enrol-edge-overdue:   var(--badge-red-fg);
    --enrol-edge-fullypaid: var(--badge-green-fg);
    --enrol-edge-placed:    var(--badge-amber-fg);
    /* speed-and-look: money in the UI font with equal-width digits (theme.css), not a monospace font */
    --enrol-mono: var(--font-sans);
}

.enrol-mast { display: flex; flex-wrap: wrap; align-items: flex-start;
    justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.enrol-mast .sub { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.enrol-mast-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.enrol-toggle { display: inline-flex; border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; }
.enrol-toggle a { font-size: 12px; font-weight: 600; padding: 6px 14px;
    color: var(--text-muted); text-decoration: none; background: var(--bg-panel); }
.enrol-toggle a[aria-current="true"] { background: var(--text); color: var(--bg-panel); }

/* ---- money strip ---- */
.enrol-strip { display: flex; flex-wrap: wrap; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--bg-panel); overflow: hidden;
    margin-bottom: 16px; }
.enrol-stat { flex: 1 1 150px; padding: 10px 14px; border-right: 1px solid var(--border); }
.enrol-stat:last-child { border-right: 0; }
.enrol-stat .k { font-size: 10px; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-muted); }
.enrol-stat .v { font-family: var(--enrol-mono); font-variant-numeric: tabular-nums;
    font-size: 17px; font-weight: 600; margin-top: 2px; }
.enrol-stat .v.bad { color: var(--badge-red-fg); }
.enrol-stat .cur { font-size: 11px; color: var(--text-muted); font-weight: 400; }

/* ---- board ---- */
.enrol-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px;
    align-items: flex-start; }
.enrol-col { flex: 0 0 262px; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); display: flex; flex-direction: column; }
.enrol-col-head { padding: 10px 12px; border-bottom: 1px solid var(--border);
    position: relative; }
.enrol-col-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; border-radius: var(--radius) 0 0 0; background: var(--border); }
.enrol-col.edge-waiting   .enrol-col-head::before { background: var(--enrol-edge-waiting); }
.enrol-col.edge-awaiting  .enrol-col-head::before { background: var(--enrol-edge-awaiting); }
.enrol-col.edge-paying    .enrol-col-head::before { background: var(--enrol-edge-paying); }
.enrol-col.edge-overdue   .enrol-col-head::before { background: var(--enrol-edge-overdue); }
.enrol-col.edge-fullypaid .enrol-col-head::before { background: var(--enrol-edge-fullypaid); }
.enrol-col.edge-placed    .enrol-col-head::before { background: var(--enrol-edge-placed); }
.enrol-col-head .t { font-weight: 600; font-size: 12.5px; display: flex;
    align-items: center; justify-content: space-between; gap: 8px; }
.enrol-col-head .n { font-family: var(--enrol-mono); font-size: 11px;
    color: var(--text-muted); background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0 7px; }
.enrol-col-head .m { font-family: var(--enrol-mono); font-variant-numeric: tabular-nums;
    font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.enrol-col-head .m.bad { color: var(--badge-red-fg); }
.enrol-col-body { padding: 10px; display: flex; flex-direction: column; gap: 9px; }

.enrol-card { background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 11px 12px; text-decoration: none;
    color: inherit; display: block; }
.enrol-card:hover { border-color: var(--text-muted); }
.enrol-card .nm { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.enrol-card .meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
    margin-top: 6px; }
.enrol-card .money { font-family: var(--enrol-mono); font-variant-numeric: tabular-nums;
    font-size: 12.5px; margin-top: 9px; display: flex; justify-content: space-between;
    align-items: baseline; gap: 8px; }
.enrol-card .money .of { color: var(--text-muted); font-size: 11px; }
.enrol-card .other { font-family: var(--enrol-mono); font-size: 10.5px;
    color: var(--text-muted); margin-top: 2px; }
.enrol-bar { height: 4px; border-radius: 2px; background: var(--badge-gray-bg);
    margin-top: 6px; overflow: hidden; }
.enrol-bar i { display: block; height: 100%; border-radius: 2px;
    background: var(--badge-green-fg); }
.enrol-bar.warn i { background: var(--badge-amber-fg); }
.enrol-bar.bad i  { background: var(--badge-red-fg); }
.enrol-card .foot { display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--border);
    font-size: 11.5px; color: var(--text-muted); }
.enrol-who { display: inline-flex; align-items: center; gap: 6px; }
.enrol-av { width: 19px; height: 19px; border-radius: 50%; background: var(--badge-blue-bg);
    color: var(--badge-blue-fg); font-size: 9px; font-weight: 700; display: inline-flex;
    align-items: center; justify-content: center; flex: none; }
.enrol-when { font-family: var(--enrol-mono); font-size: 11px; white-space: nowrap; }
.enrol-when.warn { color: var(--badge-amber-fg); font-weight: 600; }
.enrol-when.bad  { color: var(--badge-red-fg); font-weight: 600; }
.enrol-act { margin-top: 9px; display: flex; gap: 6px; }
.enrol-act .btn { font-size: 11px; padding: 4px 9px; }

.enrol-tag { display: inline-block; font-size: 9.5px; font-weight: 600;
    letter-spacing: .04em; padding: 2px 6px; border-radius: 2px; white-space: nowrap;
    text-transform: uppercase; background: var(--badge-gray-bg); color: var(--badge-gray-fg); }
.enrol-tag.t-elite  { background: var(--badge-blue-bg);  color: var(--badge-blue-fg); }
.enrol-tag.t-prem   { background: var(--badge-amber-bg); color: var(--badge-amber-fg); }
.enrol-tag.t-one    { background: var(--badge-green-bg); color: var(--badge-green-fg); }
.enrol-tag.t-flag   { background: var(--badge-red-bg);   color: var(--badge-red-fg); }
.enrol-tag.t-wait   { background: var(--badge-blue-bg);  color: var(--badge-blue-fg); }
.enrol-tag.t-custom { background: transparent; color: var(--text-muted);
    border: 1px dashed var(--border); font-weight: 500; text-transform: none;
    letter-spacing: 0; }

.enrol-col-empty { color: var(--text-muted); font-size: 11.5px; text-align: center;
    padding: 14px 8px; border: 1px dashed var(--border); border-radius: 4px; }
.enrol-more { text-align: center; font-size: 11.5px; padding: 4px; }
.enrol-more a { color: var(--accent); text-decoration: none; }

.enrol-legend { color: var(--text-muted); font-size: 11.5px; margin-top: 12px;
    display: flex; flex-wrap: wrap; gap: 14px; }
.enrol-legend span { display: inline-flex; align-items: center; gap: 6px; }
.enrol-sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---- table view ---- */
.enrol-tablebar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
    align-items: center; margin-bottom: 12px; }
.enrol-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.enrol-chip { font-size: 12px; font-weight: 500; border: 1px solid var(--border);
    background: var(--bg-panel); color: var(--text-muted); border-radius: 3px;
    padding: 5px 10px; text-decoration: none; }
.enrol-chip[aria-current="true"] { background: var(--text); color: var(--bg-panel);
    border-color: var(--text); }
/* margin: 0 -- "alert" also matches Bootstrap's .alert (margin-bottom: 1rem),
   which made this one chip shorter than its siblings in the stretched row. */
.enrol-chip.alert { border-color: var(--badge-red-fg); color: var(--badge-red-fg); margin: 0; }
/* Selected + alert: the plain aria-current rule would lose to .alert's red
   text (same specificity, later rule), leaving red on the dark fill. */
.enrol-chip.alert[aria-current="true"] { background: var(--badge-red-fg);
    border-color: var(--badge-red-fg); color: var(--bg-panel); }
.enrol-chip .n { font-family: var(--enrol-mono); font-size: 11px; opacity: .7; margin-left: 5px; }

.enrol-grid .num { font-family: var(--enrol-mono); font-variant-numeric: tabular-nums;
    white-space: nowrap; }
.enrol-grid .cd { display: block; font-family: var(--enrol-mono); font-size: 10.5px;
    color: var(--text-muted); font-weight: 400; }
.enrol-grid .dim { color: var(--text-muted); }
.enrol-cell { border-radius: 3px; padding: 3px 7px; display: inline-block;
    font-family: var(--enrol-mono); font-variant-numeric: tabular-nums; font-size: 12px;
    font-weight: 500; white-space: nowrap; }
.enrol-cell.c-ok   { background: var(--badge-green-bg); color: var(--badge-green-fg); }
.enrol-cell.c-warn { background: var(--badge-amber-bg); color: var(--badge-amber-fg); }
.enrol-cell.c-bad  { background: var(--badge-red-bg);   color: var(--badge-red-fg); }
.enrol-cell.c-wait { background: var(--badge-blue-bg);  color: var(--badge-blue-fg); }
.enrol-cell.c-idle { background: var(--badge-gray-bg);  color: var(--badge-gray-fg); }

.enrol-cols { position: relative; }
.enrol-cols > summary { list-style: none; }
.enrol-cols > summary::-webkit-details-marker { display: none; }
.enrol-cols-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20;
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 170px;
    box-shadow: var(--shadow-pop); }
.enrol-cols-menu label { font-size: 12px; display: flex; align-items: center; gap: 6px; }

.enrol-grid tbody tr.dim td { color: var(--text-muted); }

@media (max-width: 640px) {
    .enrol-strip { flex-direction: column; }
    /* flex-basis auto: stacked in a column, the desktop 150px basis would
       become each tile's HEIGHT. */
    .enrol-stat { flex-basis: auto; border-right: 0; border-bottom: 1px solid var(--border); }
}

/* Backfill schedule table (fix 2026-09-12: was cramped inside the old
   720px-capped create form — amounts you'd typed weren't readable).
   Its own wider container; explicit column minimums so a 5-digit
   amount, a full date and a method name are never squeezed. The
   .data-table-wrap it sits in already scrolls horizontally if a narrow
   screen still can't fit it. */
.pay-prepaid-wrap { max-width: 980px; }
table.pay-prepaid { min-width: 820px; }
table.pay-prepaid th, table.pay-prepaid td { padding: 6px 10px; }
table.pay-prepaid .col-amt { min-width: 130px; }
table.pay-prepaid .col-amt input { width: 100%; min-width: 110px; }
table.pay-prepaid .col-date { min-width: 160px; }
table.pay-prepaid .col-date input { width: 100%; min-width: 150px; }
table.pay-prepaid .col-method { min-width: 160px; }
table.pay-prepaid .col-method select { width: 100%; min-width: 150px; }
table.pay-prepaid .col-ref { min-width: 130px; }
table.pay-prepaid .col-ref input { width: 100%; min-width: 120px; }

/* marketing-batch-3 item 4: shared drag-and-drop upload widget (portal +
   Marketing + Payments agreement forms). Reuses the existing theme
   tokens so it matches light/dark everywhere it's dropped in. */
.upload-widget .upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13.5px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.upload-widget .upload-dropzone:hover,
.upload-widget .upload-dropzone:focus-visible {
    border-color: var(--accent);
    outline: none;
}
.upload-widget .upload-dropzone.upload-dropzone-active {
    border-color: var(--accent);
    background: var(--bg-panel);
}
.upload-widget .upload-dropzone-filename {
    color: var(--text);
    font-weight: 500;
    word-break: break-all;
}
.upload-widget input[type=file] {
    display: block;
    margin-top: 8px;
    font-size: 12.5px;
}
.upload-widget .upload-widget-error { margin-top: 6px; }
/* Part 4 (4-5): multi-file mode -- one row per file */
.upload-widget .upload-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.upload-widget .upload-item {
    display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(140px, 1fr) minmax(0, 1fr) auto; gap: 6px 10px;
    align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel);
}
.upload-widget .upload-item-name { min-width: 0; word-break: break-all; font-size: 13px; }
.upload-widget .upload-item-progress { width: 100%; height: 8px; grid-column: 1 / -1; accent-color: var(--accent); }
.upload-widget .upload-item-status { grid-column: 1 / -1; }
.upload-widget .upload-item-status:empty { display: none; }
.upload-widget .upload-item[data-state="invalid"] .upload-item-progress { display: none; }
.upload-widget .upload-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
@media (max-width: 640px) {
    .upload-widget .upload-item { grid-template-columns: minmax(0, 1fr) auto; }
    .upload-widget .upload-item select, .upload-widget .upload-item input[type=text] { grid-column: 1 / -1; }
}

/* Stage 1 (interview timezones): secondary text on the interviews page --
   the event-local label, the IST equivalent, and the "as it reads in
   the timezone you pick" hints. Uses the themed --text-muted token, so
   it stays readable in dark mode (Bootstrap's .text-muted/.form-text are
   not themed by this app and render dark-on-dark there). */
.tz-meta { color: var(--text-muted); font-size: 0.8125rem; }

/* ============================================================
   Candidate portal (layout stage, 2026-09-24): header + section nav +
   content, one URL per section. Existing tokens only, so light/dark
   follow the same :root variables as the staff app (the portal has no
   theme switch -- it follows the device via prefers-color-scheme).
   Muted text is .portal-muted (themed --text-muted), never Bootstrap's
   .text-muted / .form-text, which stay light-theme grey on the dark
   background.
   ============================================================ */
.portal-muted { color: var(--text-muted); }
.portal-strong { font-weight: 600; }
.portal-break { overflow-wrap: anywhere; }
.portal-nowrap { white-space: nowrap; }
.portal-help { font-size: 12px; margin-top: 3px; }
.portal-error { color: var(--badge-red-fg); font-size: 12.5px; margin-top: 3px; }

.portal-top { background: var(--bg-panel); border-bottom: 1px solid var(--border); }
.portal-top-inner { max-width: 1140px; margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 15px; }
.portal-brand .portal-muted { font-weight: 400; }
.portal-top-right { display: flex; align-items: center; gap: 12px; }
.portal-who { font-size: 13px; color: var(--text-muted); }

.portal-shell { max-width: 1140px; margin: 0 auto; padding: 20px;
    display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.portal-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.portal-nav a { display: block; padding: 8px 12px; border-radius: var(--radius);
    color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.portal-nav a:hover { background: var(--row-hover); color: var(--text); }
.portal-nav a[aria-current="page"] { background: var(--bg-panel); color: var(--text);
    font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); border: 1px solid var(--border); }
.portal-main { min-width: 0; }
.portal-h1 { font-size: 20px; font-weight: 600; margin: 0 0 16px; }
.portal-h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); margin: 12px 16px 6px; }

.portal-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px; align-items: start; }
.portal-cards > .detail-card { margin-bottom: 0; }
.portal-cards--2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); margin-top: 16px; }
.portal-main > .detail-card + .detail-card { margin-top: 16px; }
.portal-pad-0 { padding: 0 0 8px; }

.portal-amount { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.portal-money { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.portal-progress { height: 6px; background: var(--badge-gray-bg); border-radius: 3px;
    overflow: hidden; margin: 8px 0; }
.portal-progress > span { display: block; height: 100%; background: var(--accent); }

.portal-kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 6px 12px;
    margin: 0; font-size: 14px; }
.portal-kv dt { font-weight: 400; color: var(--text-muted); }
.portal-kv dd { margin: 0; overflow-wrap: anywhere; }

.portal-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.portal-field--check { align-self: end; }
.portal-check { display: flex; gap: 8px; align-items: center; font-size: 14px; }

.portal-checklist { list-style: none; margin: 0; padding: 6px 0; }
.portal-checklist li { display: flex; align-items: center; gap: 10px; padding: 6px 16px; font-size: 14px; }
.portal-checklist-label { flex: 1; }
.portal-tick { width: 18px; text-align: center; color: var(--text-muted); }
.portal-tick.is-done { color: var(--badge-green-fg); font-weight: 700; }
.portal-fix { font-size: 13px; white-space: nowrap; }
/* Portal Overview "Your next steps" + checklist sections (Marketing redesign) */
.portal-next { margin-bottom: 14px; }
.portal-steps { list-style: none; margin: 0; padding: 0; }
.portal-step { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 0;
    border-bottom: 1px solid var(--border); font-size: 14px; }
.portal-step:last-child { border-bottom: 0; }
.portal-step-text { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.portal-step-link { white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.portal-checklist-section { margin-top: 14px; }
.portal-checklist-section--missing .detail-card-header { color: var(--badge-amber-fg); }
.portal-checklist-label { min-width: 0; overflow-wrap: anywhere; }

.portal-table-wrap { overflow-x: auto; }
.portal-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.portal-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); text-align: left; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.portal-table td { padding: 9px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.portal-table tr:last-child td { border-bottom: 0; }
.portal-table tr.is-cancelled td { color: var(--text-muted); }
.portal-empty { color: var(--text-muted); margin: 0; padding: 18px 16px; }
.portal-past { border-top: 1px solid var(--border); margin-top: 8px; }
.portal-past > summary { cursor: pointer; padding: 10px 16px; color: var(--text-muted); font-size: 13px; }
.portal-upload { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; gap: 12px; align-items: end; }
.portal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.portal-chip { font-size: 12.5px; border: 1px solid var(--border); background: var(--bg-panel);
    border-radius: 999px; padding: 3px 10px; color: var(--text-muted); }
.portal-chip b { color: var(--text); margin-left: 4px; }

/* Phone: the nav becomes a scrolling tab strip under the header. */
@media (max-width: 760px) {
    .portal-top-inner { padding: 10px 16px; }
    .portal-brand .portal-muted, .portal-who { display: none; }
    .portal-shell { grid-template-columns: minmax(0, 1fr); padding: 0 16px 20px; gap: 12px; }
    .portal-nav { flex-direction: row; overflow-x: auto; position: static; gap: 4px;
        margin: 0 -16px; padding: 10px 16px; border-bottom: 1px solid var(--border);
        scrollbar-width: none; }
    .portal-nav::-webkit-scrollbar { display: none; }
    .portal-nav a { white-space: nowrap; padding: 6px 12px; font-size: 13px;
        border: 1px solid var(--border); border-radius: 999px; background: var(--bg-panel); }
    .portal-nav a[aria-current="page"] { box-shadow: none; background: var(--text); color: var(--bg-panel);
        border-color: var(--text); }
    .portal-cards, .portal-cards--2 { grid-template-columns: minmax(0, 1fr); }
    .portal-form-grid { grid-template-columns: minmax(0, 1fr); }
    .portal-upload { grid-template-columns: minmax(0, 1fr); }
    .portal-kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .portal-kv dd { margin-bottom: 8px; }
    .portal-h1 { font-size: 18px; margin-bottom: 12px; }
}
.portal-main .detail-card-header .btn { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* Portal contrast (measured at 390/1280 px in both schemes, 2026-09-24):
   the shared --accent blue is 3.5:1 on the dark panels and Bootstrap's
   outline-secondary grey is 3.4:1 -- both below WCAG AA. Portal-scoped
   so the staff app is unchanged (its own dark-mode pass is an open item). */
/* Links: the badge-blue text token is already themed (#1a56c4 light,
   #8fb4f5 dark) and clears 4.5:1 on both the page and card backgrounds. */
.portal-top a:not(.btn):not(.portal-brand), .portal-main a:not(.btn) { color: var(--badge-blue-fg); }
.portal-top .btn-outline-secondary, .portal-main .btn-outline-secondary {
    color: var(--text); border-color: var(--border); background: var(--bg-panel); }
.portal-top .btn-outline-secondary:hover, .portal-main .btn-outline-secondary:hover {
    background: var(--row-hover); color: var(--text); border-color: var(--text-muted); }
/* Compact like the staff app (Bootstrap's 16px default read as a form);
   long values such as an email address wrap inside their card. */
.portal-main { font-size: 14px; }
.portal-main .detail-card-body { overflow-wrap: anywhere; line-height: 1.5; }
/* Tables keep normal word wrapping (an email or file name opts in with
   .portal-break) -- "anywhere" split ordinary words letter by letter. */
.portal-main .portal-table { overflow-wrap: normal; }

/* Phone: each record row becomes a small stacked block of label/value
   lines (the cell's data-label), instead of five columns squeezed into
   390px. */
@media (max-width: 760px) {
    .portal-table thead { display: none; }
    .portal-table, .portal-table tbody, .portal-table tr, .portal-table td { display: block; width: 100%; }
    .portal-table tr { padding: 10px 16px; border-bottom: 1px solid var(--border); }
    .portal-table tr:last-child { border-bottom: 0; }
    .portal-table td { border: 0; padding: 2px 0; display: grid;
        grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
    .portal-table td::before { content: attr(data-label); color: var(--text-muted); font-size: 12px;
        padding-top: 1px; }
    .portal-table td > div { overflow-wrap: anywhere; }
}
.portal-main .portal-amount { font-size: 17px; }
.portal-main .detail-card-header .btn { height: auto; min-height: 0; padding: 2px 12px; font-size: 12px; line-height: 1.5; }

/* ============================================================
   Marketing -> Applications log (2026-09-25): day-grouped list, like
   browser history. Existing tokens only (light + dark follow the app).
   On phones each row stacks into label/value lines.
   ============================================================ */
.applog-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 12px; max-width: 900px; }
.applog-muted { color: var(--text-muted); font-size: 12px; }
.applog-note { display: block; color: var(--text-muted); font-size: 11.5px; }
.applog-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end;
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 12px; margin-bottom: 12px; }
.applog-filters label { display: flex; flex-direction: column; gap: 3px; font-size: 12px;
    color: var(--text-muted); min-width: 140px; }
.applog-filter-actions { display: flex; gap: 8px; align-items: center; }
.applog-people { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.applog-people-label { font-size: 12px; color: var(--text-muted); margin-right: 4px; }
.applog-chip { font-size: 12.5px; border: 1px solid var(--border); background: var(--bg-panel);
    color: var(--text); border-radius: 999px; padding: 3px 10px; text-decoration: none; }
.applog-chip b { font-weight: 600; margin-left: 4px; color: var(--text-muted); }
.applog-chip.is-current { background: var(--text); color: var(--bg-panel); border-color: var(--text); }
.applog-chip.is-current b { color: var(--bg-panel); }
.applog-range { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
    font-size: 13px; color: var(--text-muted); }
.applog-day { margin-bottom: 16px; }
.applog-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
    font-size: 14px; font-weight: 600; margin: 0 0 6px; color: var(--text); }
.applog-count { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.applog-table-wrap { background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--radius); overflow-x: auto; }
.applog-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
/* Same column widths in every day's table, so the days line up to scan. */
.applog-table .c-time { width: 12%; } .applog-table .c-cand { width: 14%; } .applog-table .c-comp { width: 14%; }
.applog-table .c-role { width: 19%; } .applog-table .c-status { width: 10%; } .applog-table .c-link { width: 17%; }
.applog-table .c-by { width: 14%; }
.applog-table td { overflow-wrap: anywhere; }
.applog-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--border);
    white-space: nowrap; }
.applog-table td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.applog-table tr:last-child td { border-bottom: 0; }
.applog-table td:first-child { white-space: nowrap; }
.applog-table a { color: var(--badge-blue-fg); }
.applog-empty { padding: 18px 0; }
@media (max-width: 760px) {
    .applog-filters label { min-width: 0; flex: 1 1 140px; }
    .applog-table thead, .applog-table colgroup { display: none; }
    .applog-table { table-layout: auto; }
    .applog-table, .applog-table tbody, .applog-table tr, .applog-table td { display: block; width: 100%; }
    .applog-table tr { padding: 8px 12px; border-bottom: 1px solid var(--border); }
    .applog-table tr:last-child { border-bottom: 0; }
    .applog-table td { border: 0; padding: 2px 0; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px;
        white-space: normal !important; }
    .applog-table td::before { content: attr(data-label); color: var(--text-muted); font-size: 12px; }
    .applog-table td > div { overflow-wrap: anywhere; }
}

/* Quick entry: log one job link at a time (Applications log + candidate page) */
.quick-entry { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 14px; }
.quick-entry-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.quick-entry-title { font-weight: 600; font-size: 14px; }
.quick-entry-for { font-size: 13px; color: var(--text-muted); }
.quick-entry-resume { white-space: nowrap; align-self: flex-end; }
.quick-entry-noresume { font-size: 13px; color: var(--text-muted); align-self: center; white-space: nowrap; }
.quick-entry-for strong { color: var(--text); }
.quick-entry-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.quick-entry-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-muted); margin: 0; }
.quick-entry-link { flex: 1 1 320px; min-width: 0; }
.quick-entry-cand { flex: 0 1 240px; min-width: 0; }
.quick-entry-save { flex: 0 0 auto; }
.quick-entry-error { color: var(--badge-red-fg); font-size: 12px; }
.quick-entry-more { margin-top: 8px; font-size: 12.5px; }
.quick-entry-more summary { cursor: pointer; color: var(--text-muted); }
.quick-entry-more .quick-entry-row { margin-top: 6px; }
.quick-entry-defaults { color: var(--text-muted); }
.quick-entry-help { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }
.quick-entry-msg { font-size: 13px; margin: 8px 0 0; padding: 6px 10px; border-radius: var(--radius); }
.quick-entry-msg.is-success { background: var(--badge-green-bg); color: var(--badge-green-fg); }
.quick-entry-msg.is-error { background: var(--badge-red-bg); color: var(--badge-red-fg); }
.quick-entry-msg.is-warning { background: var(--badge-amber-bg); color: var(--badge-amber-fg); }
.quick-entry-msg[hidden] { display: none; }
.quick-entry-url { overflow-wrap: anywhere; }
/* 2026-10-24 (owner): details filled from the link, "Paste links" and its review table */
.quick-entry-details { margin-top: 8px; }
.quick-entry-details[hidden] { display: none; }
.quick-entry-detail { flex: 1 1 150px; min-width: 0; }
.quick-entry-paste { margin-left: auto; }
.quick-entry-paste[hidden] { display: none; }
.quick-entry-read { font-size: 12.5px; color: var(--text-muted); margin: 6px 0 0; }
.quick-entry-read[hidden] { display: none; }
.linkbatch-box textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.linkbatch-progress { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 13px; }
.linkbatch-progress .enrol-bar { flex: 1 1 auto; max-width: 320px; margin: 0; height: 6px; }
.linkbatch-table td { vertical-align: top; }
.linkbatch-table td .form-control { min-width: 120px; font-size: 12.5px; padding: 2px 6px; height: auto; }
.linkbatch-url { max-width: 260px; overflow-wrap: anywhere; font-size: 12px; }
.linkbatch-note { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.linkbatch-warning td { background: var(--badge-amber-bg) !important; }
.linkbatch-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
tr.is-new-row td { background: var(--badge-green-bg); }

/* Marketing candidate page (redesign 2026-09-28): compact header, Overview
   with next actions, checklist grouped by what still needs doing. */
.cand-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px;
    flex-wrap: wrap; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 14px; margin-bottom: 10px; }
.cand-header-main { min-width: 0; flex: 1 1 360px; }
.cand-name { font-size: 17px; font-weight: 600; margin: 0 0 2px; overflow-wrap: anywhere; }
.cand-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 13px; }
.cand-meta-sep { color: var(--text-muted); }
.cand-contact { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.cand-header-facts { display: flex; gap: 8px; flex-wrap: wrap; }
.cand-fact { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border: 1px solid var(--border);
    border-radius: var(--radius); text-decoration: none; color: var(--text); min-width: 110px; }
.cand-fact:hover, .cand-fact:focus-visible { border-color: var(--text-muted); }
.cand-fact-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.cand-fact-value { font-size: 16px; font-weight: 600; }
.detail-tab--secondary { margin-left: auto; }

.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.overview-grid > .detail-card { margin: 0; }
.overview-next { grid-column: 1 / -1; }
.next-actions { list-style: none; margin: 0; padding: 0; }
.next-action { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 7px 0;
    border-bottom: 1px solid var(--border); font-size: 13.5px; }
.next-action:last-child { border-bottom: 0; }
.next-action-text { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.next-action-link { white-space: nowrap; font-size: 13px; }
.next-action--none { color: var(--text-muted); }
.overview-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.overview-list { list-style: none; margin: 0 0 6px; padding: 0; font-size: 13px; }
.overview-list li { padding: 5px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.overview-list li:last-child { border-bottom: 0; }
.overview-reminder-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.overview-field { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text-muted); margin: 0; }
.overview-field--grow { flex: 1 1 160px; min-width: 0; }

.checklist-status { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.checklist-lead { font-size: 13.5px; }
.checklist-heading { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); margin: 14px 0 6px; }
.checklist-heading--missing { color: var(--badge-amber-fg); }
.checklist-kv--missing dt { color: var(--text); font-weight: 600; }
.checklist-group { display: inline-block; font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.checklist-kv dt { white-space: normal; }
.checklist-kv dd { overflow-wrap: anywhere; min-width: 0; }
.detail-card--danger .detail-card-header { color: var(--badge-red-fg); }

@media (max-width: 720px) {
    .overview-grid { grid-template-columns: minmax(0, 1fr); }
    .cand-header-facts { width: 100%; }
    .cand-fact { flex: 1 1 0; min-width: 0; }
    .detail-tab--secondary { margin-left: 0; }
    .checklist-kv { grid-template-columns: minmax(0, 45%) minmax(0, 1fr); }
}


/* ---------- One shared dense-form style (Stage 6, 2026-10-01) ----------
   Applied with class="form-dense" on the forms of the Interviews page,
   Log an application (quick entry) and the Documents filter -- which
   used full-width 36px controls with large gaps. Tokens only: the dense
   control height, the spacing scale, the font sizes. Fields size to their
   content up to --field-max instead of stretching across the card. The
   Leads/Sales/Marketing grid is deliberately NOT touched (owner's call). */
.form-dense .form-control:not(textarea),
.form-dense .form-select,
.form-dense .btn:not(.btn-link) {
    height: var(--control-height-dense);
    min-height: var(--control-height-dense);
    line-height: var(--control-height-dense);
    font-size: var(--font-data);
}
.form-dense textarea.form-control { min-height: calc(var(--control-height-dense) * 2); font-size: var(--font-data); }
.form-dense label:not(.form-check-label), .form-dense .form-label, .form-dense .tz-meta,
.form-dense legend { font-size: var(--font-label); margin-bottom: 2px; }
/* a choice is content, not a caption: it reads at the data size (the
   "Whose time is this?" provenance must stay legible) */
.form-dense .form-check-label { font-size: var(--font-data); }
.form-dense.row { --bs-gutter-x: var(--space-3); --bs-gutter-y: var(--space-2); }
.form-dense.row > [class*="col-md-"],
.form-dense.row > .col-12:not(.col-wide) {
    flex: 0 0 auto;
    width: auto;
    min-width: 180px;
    max-width: var(--field-max);
}
.form-dense.row > .col-wide,
.form-dense.row > .col-12:has(textarea) { flex: 0 0 auto; width: auto; max-width: calc(var(--field-max) * 2 + var(--space-3)); }
.form-dense.row > [class*="col-md-"] > .form-control,
.form-dense.row > [class*="col-md-"] > .form-select,
.form-dense.row > .col-12 > .form-control,
.form-dense.row > .col-wide > .form-control { width: 100%; }
.form-dense .btn.w-100 { width: auto !important; min-width: 120px; }
.form-dense.row > .col-12:has(> .btn) { max-width: none; }
.form-dense .quick-entry-row { gap: var(--space-2); }
.form-dense .quick-entry-link { flex: 0 1 calc(var(--field-max) * 2); }
.form-dense .quick-entry-cand { flex: 0 1 var(--field-max); }

/* Sales Potential tab count (2026-10-03) */
/* 2026-10-04: a small badge with its own space -- the old negative margin
   tucked it under the active pill, so the count looked clipped. */
.list-tab-count { font-size: 0.75rem; align-self: center; margin: 0 0.5rem 0 0.25rem; padding: 0 0.45rem;
    border-radius: 999px; line-height: 1.6; background: var(--badge-gray-bg); color: var(--badge-gray-fg); }
.potential-table td { vertical-align: top; }
.potential-table .money div { white-space: nowrap; }

/* 2026-10-04: Sales > Potential -- the opened "Reopen to calling list" form
   wraps inside its cell instead of widening the table (the grid's cells are
   nowrap), so the Candidate column never scrolls out of view. */
.potential-reopen[open] { white-space: normal; max-width: 16rem; }
.potential-reopen input[name="reason"] { min-width: 0; flex: 1 1 9rem; }
/* 2026-10-04: the Potential table fits the page at 1280+ -- its cells and
   header labels wrap (table.data-table cells are nowrap by default, so these
   need the same specificity), money stays on one line. */
table.data-table.potential-table th,
table.data-table.potential-table td { white-space: normal; }
table.data-table.potential-table td.money { white-space: nowrap; }
table.data-table.potential-table td:first-child { min-width: 10rem; }
table.data-table.potential-table td:nth-child(3) { min-width: 8rem; }
table.data-table.potential-table td:last-child { min-width: 10rem; max-width: 14rem; }
table.data-table.potential-table .badge-pill { white-space: normal; display: inline-block; border-radius: var(--radius); line-height: 1.3; }
/* 2026-10-04: Placed list fits at 1280+ (text wraps, money on one line). */
table.data-table.placed-table th,
table.data-table.placed-table td { white-space: normal; vertical-align: top; }
table.data-table.placed-table td.money { white-space: nowrap; }
table.data-table.placed-table td:first-child { min-width: 11rem; }
table.data-table.placed-table td:last-child { min-width: 9rem; max-width: 13rem; }
/* 2026-10-04: Marketing › Pending -- cells wrap, the action forms stay inside their cell. */
table.data-table.pending-table th,
table.data-table.pending-table td { white-space: normal; vertical-align: top; }
table.data-table.pending-table td:first-child { min-width: 11rem; }
table.data-table.pending-table td:last-child { min-width: 14rem; max-width: 18rem; }

/* 2026-10-06 (Part 5 C): the Marketing "More" menu -- a <details> holding the less-used links */
.more-menu > summary { list-style: none; cursor: pointer; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > .dropdown-menu-custom { position: absolute; top: 100%; z-index: 30; min-width: 220px; }

/* 2026-10-06 (Part 5 B): on the fixed-height list pages the tiles must never be squashed by the table
   region below -- they keep their full height (every tile says what it counts). */
.enrol-strip, .enrol-mast { flex-shrink: 0; }
.enrol-stat .small { line-height: 1.25; }

/* 2026-10-06 (Part 5B) Enrolments: one colour per status, small caps, nothing oversized. */
.es-badge { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 10.5px; font-weight: 600;
    font-variant: small-caps; text-transform: lowercase; letter-spacing: .04em; white-space: nowrap; line-height: 1.5; }
.es-waiting   { background: var(--badge-blue-bg);  color: var(--badge-blue-fg); }
.es-first     { background: var(--badge-amber-bg); color: var(--badge-amber-fg); }
.es-paying    { background: var(--badge-teal-bg);  color: var(--badge-teal-fg); }
.es-confirm   { background: var(--badge-amber-bg); color: var(--badge-amber-fg); }   /* payment stage 1 */
.es-overdue   { background: var(--badge-red-bg);   color: var(--badge-red-fg); }
.es-paid      { background: var(--badge-green-bg); color: var(--badge-green-fg); }
.es-cancelled { background: var(--badge-gray-bg);  color: var(--badge-gray-fg); }
.enrol-grid tr.is-cancelled > td { color: var(--text-muted); }
.enrol-grid tr.is-cancelled a { color: var(--text-muted); }
.enrol-grid .cancel-note { display: block; font-size: 11px; color: var(--text-muted); white-space: normal; max-width: 260px; }
.enrol-grid .due-amt { display: block; font-family: var(--enrol-mono); font-size: 11px; }
.enrol-grid .over { color: var(--badge-red-fg); }
.sched-toggle { border: 0; background: none; color: var(--text-muted); padding: 0 4px 0 0; font-size: 11px;
    cursor: pointer; line-height: 1; }
.sched-toggle[aria-expanded="true"] { color: var(--text); }
.sched-toggle:focus-visible { outline: 2px solid var(--badge-blue-fg); outline-offset: 1px; }
.enrol-grid tr.sched-row > td { background: var(--bg-subtle, var(--bg-panel)); padding: 6px 10px 10px 34px; }
.sched-table { width: auto; min-width: 560px; border-collapse: collapse; font-size: 12px; }
.sched-table th { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); padding: 2px 12px 2px 0; text-align: left; position: static; background: none; }
.sched-table td { padding: 2px 12px 2px 0; border: 0; }
.sched-table .num { text-align: right; }
.enrol-switches { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--text-muted); }
.enrol-switches label { display: inline-flex; gap: 5px; align-items: center; margin: 0; cursor: pointer; }

/* 2026-10-06 (Part 5B) the plan page: one screen top to bottom -- header, money strip, schedule, history.
   No board, no cards: the old boxes inside .plan-page render as plain sections. */
.plan-page .plan-head { display: block; margin-bottom: 12px; }
.plan-page .plan-head-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 1.15rem; font-weight: 600; }
.plan-page .plan-code { font-family: var(--enrol-mono); font-size: 12px; color: var(--text-muted); font-weight: 400; }
.plan-page .plan-facts { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 6px 0; font-size: 13px; }
.plan-page .plan-facts dt { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.plan-page .plan-facts dd { margin: 0; }
.plan-page .plan-section { margin-top: 18px; }
.plan-page .plan-section-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-muted); margin: 0 0 6px; }
.plan-page details.plan-more > summary { cursor: pointer; }
.plan-page .plan-sub { font-size: 12px; font-weight: 600; margin: 12px 0 4px; }
.plan-page .detail-card { border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none;
    background: transparent; margin: 14px 0 0; }
.plan-page .detail-card-header { background: transparent; padding: 8px 0 4px; border: 0; font-size: 11px; font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase; color: var(--badge-amber-fg); }
.plan-page .detail-card-body { padding: 4px 0 0; }
.plan-page .plan-editor > summary { list-style: none; display: inline-block; }
.plan-page .plan-editor > summary::-webkit-details-marker { display: none; }
.plan-page .plan-editor-body { border-left: 3px solid var(--border); padding: 8px 0 4px 12px; margin-top: 8px; }
.plan-page .plan-edit-table input[type=date], .plan-page .plan-edit-table input[type=number] { min-width: 110px; }
.plan-page .plan-admin > summary { list-style: none; }
.plan-page .plan-admin > summary::-webkit-details-marker { display: none; }
.plan-page .plan-edit-table td:last-child label { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.plan-page .plan-edit-table td:last-child input[type=checkbox] { width: auto; margin: 0; }

/* 2026-10-06 (Part 5B, A): quick-view tabs + the fixed-width, one-line grid (Enrolments, Other Services). */
.enrol-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.enrol-tab { font-size: 12.5px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 3px; color: var(--text-muted);
    text-decoration: none; background: var(--bg-panel); white-space: nowrap; }
.enrol-tab .n { font-family: var(--enrol-mono); font-size: 11px; opacity: .75; margin-left: 4px; }
.enrol-tab.on { background: var(--text); color: var(--bg-panel); border-color: var(--text); }
.enrol-tab:focus-visible { outline: 2px solid var(--badge-blue-fg); outline-offset: 1px; }
/* fits the 1280 layout (about 1020 px for the table) without sideways scrolling */
table.enrol-fixed { table-layout: fixed; width: 1020px; min-width: 100%; }
.enrol-fixed col.w-code { width: 88px; } .enrol-fixed col.w-name { width: 160px; } .enrol-fixed col.w-person { width: 108px; }
.enrol-fixed col.w-plan { width: 100px; } .enrol-fixed col.w-money { width: 80px; } .enrol-fixed col.w-due { width: 124px; }
.enrol-fixed col.w-status { width: 116px; } .enrol-fixed col.w-date { width: 84px; }
.enrol-fixed > thead > tr > th, .enrol-fixed > tbody > tr:not(.sched-row) > td {
    font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 5px; padding-bottom: 5px; }
.enrol-fixed th.num { text-align: right; }
.enrol-fixed td.num { text-align: right; font-family: var(--enrol-mono); font-variant-numeric: tabular-nums; }
.enrol-fixed td.due, .enrol-fixed td .cd { font-family: var(--enrol-mono); font-variant-numeric: tabular-nums; font-size: 12px; }
.enrol-fixed td.due .amt { color: var(--text-muted); }
.enrol-fixed td.due.over, .enrol-fixed td.due.over .amt { color: var(--badge-red-fg); }
.enrol-fixed .cut { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.enrol-fixed .cell-flex { display: flex; gap: 4px; align-items: center; min-width: 0; }
.enrol-fixed .cell-flex .cut { flex: 1 1 auto; }
.enrol-fixed .cell-flex .es-badge, .enrol-fixed .cell-flex .badge-pill { flex: none; }
.enrol-fixed .cur { font-size: 10px; color: var(--text-muted); }
.enrol-fixed .plus { color: var(--badge-amber-fg); margin-left: 1px; }
.enrol-fixed .cd { display: inline; }
.enrol-fixed th .sort-h { color: inherit; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; }
.enrol-fixed th .sort-h:hover { text-decoration: underline; }
.enrol-fixed th .sort-h:focus-visible { outline: 2px solid var(--badge-blue-fg); outline-offset: -2px; }
.sched-who { font-size: 12.5px; margin: 0 0 6px; white-space: normal; }

/* Placed: the same fixed widths and one line per row */
table.placed-fixed { table-layout: fixed; width: 1000px; min-width: 100%; }   /* fits the 1280 layout */
.placed-fixed col.p-name { width: 160px; } .placed-fixed col.p-del { width: 110px; } .placed-fixed col.p-person { width: 92px; }
.placed-fixed col.p-money { width: 88px; } .placed-fixed col.p-due { width: 104px; } .placed-fixed col.p-next { width: 112px; }
.placed-fixed col.p-acts { width: 86px; }
.placed-fixed td.money { font-size: 12px; }
.placed-fixed > thead > tr > th, .placed-fixed > tbody > tr > td { font-size: 13px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; padding-top: 5px; padding-bottom: 5px; }
.placed-fixed td.money, .placed-fixed th.money { text-align: right; font-family: var(--enrol-mono); font-variant-numeric: tabular-nums; }
.placed-fixed .cut { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.placed-fixed td.acts { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.placed-fixed td.acts:has(details[open]) { overflow: visible; }
.placed-fixed td.acts details { display: inline; }
.placed-fixed td.acts details[open] { display: block; white-space: normal; }
.placed-fixed td.acts summary.btn { padding: 0; font-size: 12.5px; line-height: 1.3; border: 0; vertical-align: baseline;
    min-height: 0; height: auto; display: inline; }

/* Part 7B: lead times -- IST first, the lead's own clock after it, a moon on the night shift */
.lt { font-variant-numeric: tabular-nums; }
.lt-us { color: var(--text-muted); }
.lt-sep { color: var(--text-muted); }
.lt--cell { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* list cell: one line, hover = US time */
.lt--cell .lt-moon { font-size: 10px; margin-left: 1px; }
/* The Leads / Sales date columns keep their pre-7B 104px (owner, 2026-10-08: lists stay short). Tighter side
   padding, 12px text and no header letter-spacing fit "28 Oct, 23:40" + moon and "CREATED (IST)" + the sort
   arrow -- measured in Chromium. */
body .grid-scroll table.data-table td.col-date { padding-left: 6px; padding-right: 4px; font-size: 12px; }
body .grid-scroll table.data-table th.col-date { padding-left: 6px; padding-right: 4px; letter-spacing: 0; }
.lt-add { font-size: 12px; color: var(--badge-amber-fg); }
.lt-moon { font-size: 12px; margin-left: 2px; cursor: help; }
/* the follow-up row stays one line like before (time, IST preview, title, button); it wraps only when narrow */
.lt-followup .form-control { flex: 1 1 200px; width: auto; min-width: 0; }
.lt-followup [data-ist-preview] { white-space: nowrap; }
.lt-followup [data-ist-preview]:empty { display: none; }

/* 2026-10-08: Django's error messages carry "alert-error", which Bootstrap doesn't style -- a refusal
   ("Not assigned — add the US state first") read as plain text. Same look as .alert-danger, light and dark. */
.alert-error { --bs-alert-color: var(--bs-danger-text-emphasis); --bs-alert-bg: var(--bs-danger-bg-subtle);
    --bs-alert-border-color: var(--bs-danger-border-subtle); --bs-alert-link-color: var(--bs-danger-text-emphasis); }

/* Click-to-call (docs/voip_integration.md Release 1): a `tel:` link next to a phone number that gloCOM dials.
   Rendered by {% call_button %} (voip/templatetags/voip_tags.py); the lead card / work-mode variants are styled in
   their own page CSS. This is the base + the Leads grid's small round icon. */
.call-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; flex: none; }
.call-btn:hover { text-decoration: none; }
.call-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.grid-dial { width: 22px; height: 22px; margin-left: 6px; border-radius: 50%; vertical-align: middle;
    color: var(--badge-green-fg); background: var(--badge-green-bg); }
.grid-dial:hover { color: var(--badge-green-fg); filter: brightness(0.95); }

/* sales-whatsapp-button (owner, 15 Nov 2026): Dropdown Options in two panels -- the lists on the left (the open
   one in the theme's navy sidebar colour), one list's rows on the right. Theme colours only; one column on a phone. */
.dd { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.dd-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--bg-panel); position: sticky; top: 12px; }
.dd-nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px;
    border-radius: 6px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.dd-nav-item:hover { background: var(--c-row-hover, var(--bg)); color: var(--text); text-decoration: none; }
.dd-nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dd-nav-item.is-on { background: var(--c-sidebar); color: var(--c-nav-strong); font-weight: 600; }
.dd-count { font-size: 12px; min-width: 24px; text-align: center; padding: 0 6px; border-radius: 999px;
    background: var(--bg); color: var(--text-muted); }
.dd-nav-item.is-on .dd-count { background: var(--c-nav-active); color: var(--c-nav-strong); }
.dd-main { min-width: 0; }
.dd-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); padding: 14px; }
.dd-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px;
    margin-bottom: 8px; }
.dd-title { font-size: 16px; font-weight: 700; margin: 0; padding-top: 3px; }
.dd-readonly { font-size: 12px; color: var(--text-muted); padding-top: 5px; }
.dd-note { font-size: 12.5px; color: var(--text-muted); margin: 0 0 10px; }
.dd-add, .dd-edit { flex: none; }
.dd-add > summary, .dd-edit > summary { list-style: none; cursor: pointer; }
.dd-add > summary::-webkit-details-marker, .dd-edit > summary::-webkit-details-marker { display: none; }
.dd-add[open] { flex-basis: 100%; }
.dd-add[open] > summary { margin-bottom: 8px; }
.dd-form { display: flex; flex-direction: column; gap: 6px; }
.dd-form--inline { flex-direction: row; flex-wrap: wrap; align-items: center; }
.dd-form .form-control, .dd-form .form-select { max-width: 100%; }
.dd-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 0; }
.dd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dd-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.dd-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 2px; border-bottom: 1px solid var(--border); }
.dd-row-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; flex: 1 1 260px; }
.dd-name { font-weight: 600; }
.dd-sub { flex-basis: 100%; font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; }
.dd-edit[open] { flex-basis: 100%; }
.dd-edit[open] > summary { display: none; }
.dd-edit-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 6px; background: var(--bg); }
.dd-edit-note { font-size: 12.5px; color: var(--text-muted); margin: 0; }
.dd-remove { display: inline; margin: 0; }
.dd-reassign { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; }
.dd-empty { color: var(--text-muted); justify-content: flex-start; }
@media (max-width: 720px) {
    .dd { grid-template-columns: minmax(0, 1fr); }
    .dd-nav { flex-direction: row; overflow-x: auto; position: static; }
    .dd-nav-item { flex: none; }
}

/* sales-whatsapp-button (owner, 15 Nov 2026): the WhatsApp icon beside the call icon (Sales list), the button on the
   lead page and its box (sales/templates/sales/_whatsapp_*.html). Theme colours only. */
.wa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: none; cursor: pointer;
    border: 0; color: var(--badge-green-fg); background: var(--badge-green-bg); font: inherit; }
.wa-btn:hover { filter: brightness(0.95); }
.wa-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wa-btn[disabled] { cursor: not-allowed; color: var(--text-muted); background: var(--bg); filter: none; }
.wa-btn--icon { width: 22px; height: 22px; margin-left: 4px; padding: 0; border-radius: 50%; vertical-align: middle; }
.wa-btn--button { height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.wa-reason { font-size: 12px; color: var(--text-muted); margin-left: 6px; }
.wa-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--bg-panel); color: var(--text); }
.wa-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.wa-dialog-body { display: flex; flex-direction: column; gap: 10px; padding: 16px; margin: 0; }
.wa-dialog-title { font-size: 16px; font-weight: 700; margin: 0; }
.wa-picks { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; border: 0; }
.wa-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 0; }
.wa-pick { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.wa-dialog textarea { font-size: 13.5px; resize: vertical; }
.wa-hint { font-size: 12px; color: var(--text-muted); margin: 0; }
.wa-error { font-size: 12.5px; color: var(--badge-red-fg); margin: 0; }
/* owner, 17 Nov 2026: Open WhatsApp in the contact buttons' green (not the company accent, red by default); red stays
   only for the messages above */
.wa-dialog .wa-go { background: var(--c-green); border-color: var(--c-green); color: var(--c-on-dark); font-weight: 700; }
.wa-dialog .wa-go:hover, .wa-dialog .wa-go:focus-visible { background: var(--c-green); color: var(--c-on-dark); filter: brightness(1.12); }
.wa-dialog .wa-go:disabled { background: var(--c-green); color: var(--c-on-dark); opacity: .6; }
/* owner, 17 Nov 2026: a LinkedIn link copies on a click (Ctrl+click opens it) -- the same small tick as the lead
   page's number and email (sales lead_page.css .lp-copied) */
.crm-copied { position: fixed; transform: translateX(-50%); padding: 2px 8px; border-radius: 999px;
    background: var(--c-ok-solid, #1E7A46); color: #fff; font-size: 11.5px; font-weight: 700; white-space: nowrap;
    pointer-events: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); z-index: 2000; }
.wa-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Calling Release 2: one gloCOM call in an Activities list (voip/templates/voip/_call_entry.html). */
.call-entry { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.call-entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.call-entry-icon { color: var(--badge-green-fg); flex: none; }
.call-entry-dir { font-weight: 700; }
.call-entry-outcome { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
    background: var(--badge-gray-bg); color: var(--badge-gray-fg); }
.call-entry-outcome.is-answered { background: var(--badge-green-bg); color: var(--badge-green-fg); }
.call-entry-outcome.is-missed { background: var(--badge-red-bg); color: var(--badge-red-fg); }
.call-entry-outcome.is-busy { background: var(--badge-amber-bg); color: var(--badge-amber-fg); }
.call-entry-dur { font-size: 12px; font-variant-numeric: tabular-nums; }
.call-entry-sub { font-size: 12px; opacity: .8; }
.call-entry-audio { height: 30px; width: 100%; max-width: 280px; margin-top: 4px; }

/* Payments made simple (owner, 2026-10-14): tabs, four numbers, one list with a chip and one button per row.
   Colours come from the badge tokens, so light and dark both follow the theme. */
.ps-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 4px 0 14px; flex-wrap: wrap; }
.ps-tabs a, .ps-tabs span { padding: 8px 14px; border-bottom: 2px solid transparent; color: var(--text-muted); font-weight: 500; text-decoration: none; }
.ps-tabs .is-on { border-bottom-color: var(--accent); color: var(--text); }
.ps-tabs .ps-tab-all { margin-left: auto; font-size: 13px; }
.ps-nums--tight { margin-bottom: 10px; }
.ps-nums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.ps-num--wait { border-color: var(--badge-amber-fg); }
.ps-wait-v { font-size: 1.05rem !important; color: var(--badge-amber-fg); }
.ps-num { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.ps-num .k { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.ps-num .v { font-size: 1.35rem; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.ps-num .s { font-size: 12px; color: var(--text-muted); }
.ps-num--next { border-color: var(--border); }
.ps-bad { color: var(--badge-red-fg); }
.ps-table td { vertical-align: middle; height: auto; line-height: 1.4; white-space: normal; }
.ps-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 6px 0 8px; }
.ps-amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ps-sub { display: block; font-size: 12px; color: var(--text-muted); font-weight: 400; }
.ps-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ps-chip--blue { background: var(--badge-blue-bg); color: var(--badge-blue-fg); }
.ps-chip--red { background: var(--badge-red-bg); color: var(--badge-red-fg); }
.ps-chip--amber { background: var(--badge-amber-bg); color: var(--badge-amber-fg); }
.ps-chip--green { background: var(--badge-green-bg); color: var(--badge-green-fg); }
.ps-chip--gray { background: var(--badge-gray-bg); color: var(--badge-gray-fg); }
.ps-act { text-align: right; white-space: nowrap; }
.ps-wait { font-size: 12px; color: var(--text-muted); }
.ps-row--refund td { color: var(--text-muted); }
.ps-more { display: inline-block; position: relative; margin-left: 6px; }
.ps-more > summary { list-style: none; cursor: pointer; padding: 2px 8px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.ps-more > summary::-webkit-details-marker { display: none; }
.ps-menu { position: absolute; right: 0; z-index: 20; min-width: 190px; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px; box-shadow: var(--shadow-pop); text-align: left; }
.ps-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: var(--radius); color: var(--text); font: inherit; font-size: 13px; }
.ps-menu button:hover { background: var(--row-hover); }
.ps-menu .ps-danger { color: var(--badge-red-fg); }
@media (max-width: 700px) {
  .ps-nums { grid-template-columns: 1fr 1fr; }
  .ps-num--next { grid-column: 1 / -1; }
  .ps-table thead { display: none; }
  .ps-table, .ps-table tbody, .ps-table tr, .ps-table td { display: block; width: 100%; }
  .ps-table tr.ps-row { border-bottom: 1px solid var(--border); padding: 8px 0; }
  .ps-table td { border: 0 !important; padding: 2px 12px; }
  .ps-table { border: 0; }
  .ps-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
  .ps-table tr.ps-row:last-child { border-bottom: 0; }
  .ps-act { text-align: left; padding-top: 6px; }
  .ps-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
}

/* My profile (owner, 2026-10-14): header card, three cards, tabs, documents. Colours from the frame --db-* tokens,
   so light and dark follow the theme (the header card is the dashboard navy card, light in dark mode). */
.mp-page { max-width: 1400px; }
.mp-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--db-border, var(--border)); margin: 0 0 16px; flex-wrap: wrap; }
.mp-tabs a { padding: 9px 14px; color: var(--db-muted, var(--text-muted)); font-weight: 500; text-decoration: none; border-bottom: 2px solid transparent; }
.mp-tabs a.is-on { color: var(--db-text, var(--text)); border-bottom-color: var(--db-accent, var(--accent)); }
.mp-head { background: var(--c-hero); color: var(--c-on-hero); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.mp-head-top { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.mp-avatar-wrap { position: relative; flex: none; }
.mp-avatar { width: 72px; height: 72px; border-radius: var(--radius); object-fit: cover; display: block; }
.mp-avatar--initials { display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 700;
  background: var(--c-hero-track); color: inherit; }
.mp-avatar-form { position: absolute; right: -6px; bottom: -6px; margin: 0; }
.mp-avatar-edit { display: flex; width: 26px; height: 26px; border-radius: 50%; background: var(--c-on-dark); color: var(--c-navy); align-items: center;
  justify-content: center; cursor: pointer; box-shadow: var(--shadow); margin: 0; }
.mp-avatar-msg { margin: 4px 0 0; font-size: 13px; color: var(--c-on-hero-bad); }
.mp-head-main { flex: 1 1 260px; min-width: 0; }
.mp-name-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mp-name { font-size: 1.5rem; font-weight: 700; margin: 0; color: inherit; }
.mp-sub { margin: 2px 0 0; opacity: .85; }
.mp-chip { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--c-hero-chip); color: var(--c-on-hero-ok); }
.mp-chip--break { background: var(--c-hero-chip); color: var(--c-on-hero-warn); }
:root[data-mode="dark"] .mp-chip { background: var(--c-ok-solid); color: var(--c-on-dark); }
:root[data-mode="dark"] .mp-chip--break { background: var(--c-warn); color: var(--c-on-dark); }
.mp-facts { display: flex; gap: 22px; margin: 0; flex-wrap: wrap; }
.mp-facts dt { font-size: 12px; font-weight: 400; opacity: .75; }
.mp-facts dd { margin: 2px 0 0; font-weight: 600; }
.mp-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.mp-head-bottom { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--c-hero-chip); margin-top: 14px; padding-top: 14px; }
.mp-contacts { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-contact { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--c-hero-line);
  border-radius: var(--radius); padding: 6px 10px; font-size: 13px; }
.mp-contact { flex-wrap: wrap; max-width: 100%; }
.mp-contact strong { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.mp-copy { background: none; border: 0; color: inherit; opacity: .75; font-size: 12px; text-decoration: underline; padding: 0 0 0 4px; cursor: pointer; }
.mp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-btn { display: inline-block; border: 1px solid var(--c-hero-line); background: transparent; color: inherit;
  border-radius: var(--radius); padding: 7px 14px; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; }
.mp-btn:hover { color: inherit; background: var(--c-hero-chip); }
.mp-btn--light { background: var(--c-on-hero); color: var(--c-hero); border-color: var(--c-on-hero); }
.mp-btn--light:hover { filter: brightness(0.94); color: var(--c-hero); }
.mp-edit { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--c-hero-chip); }
.mp-edit[hidden] { display: none; }
.mp-edit-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mp-edit label { font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.mp-edit-foot { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; font-size: 13px; opacity: .95; }
.mp-edit-foot span { flex: 1 1 260px; }
.mp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; }
.mp-grid--two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.mp-side { display: flex; flex-direction: column; gap: 16px; }
.mp-card { background: var(--db-surface, var(--bg-panel)); border: 1px solid var(--db-border, var(--border)); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--db-card-shadow, none); margin-bottom: 16px; }
.mp-grid .mp-card, .mp-side .mp-card { margin-bottom: 0; }
.mp-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.mp-card-head h2 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--db-muted, var(--text-muted)); margin: 0; }
.mp-link { background: none; border: 0; padding: 0; color: var(--db-link, var(--accent)); font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; }
.mp-rows { margin: 0; }
.mp-rows[hidden] { display: none; }
.mp-rows > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--db-border, var(--border)); }
.mp-rows dt { font-weight: 400; color: var(--db-muted, var(--text-muted)); }
.mp-rows dd { margin: 0; font-weight: 600; color: var(--db-text, var(--text)); overflow-wrap: anywhere; }
.mp-muted { color: var(--db-muted, var(--text-muted)); font-weight: 400; }
.mp-note { font-size: 12px; color: var(--db-muted, var(--text-muted)); margin: 8px 0 0; }
.mp-form { display: flex; flex-direction: column; gap: 8px; }
.mp-form[hidden] { display: none; }
.mp-form label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--db-muted, var(--text-muted)); }
/* helper-card: the Helper card inline on My profile (saves at once; not part of the form's Save) */
.mp-helper { display: flex; flex-direction: column; gap: 6px; }
.mp-helper-title { font-size: 13px; color: var(--db-muted, var(--text-muted)); }
.mp-helper .nc-card { box-shadow: none; width: 100%; max-width: 340px; }
.mp-form-foot { display: flex; gap: 8px; align-items: center; }
.mp-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.mp-pill--ok { background: var(--db-pill-ok-bg); color: var(--db-pill-ok); }
.mp-pill--warn { background: var(--db-pill-warn-bg); color: var(--db-pill-warn); }
.mp-pill--bad { background: var(--db-pill-bad-bg); color: var(--db-pill-bad); }
.mp-pill--grey { background: var(--db-pill-grey-bg); color: var(--db-pill-grey); }
.mp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mp-tile { background: var(--db-inset, var(--bg)); border-radius: var(--radius); padding: 8px 10px; border-top: 3px solid var(--db-pill-grey); }
.mp-tile b { display: block; font-size: 1.35rem; color: var(--db-text, var(--text)); }
.mp-tile span { font-size: 12px; color: var(--db-muted, var(--text-muted)); }
.mp-tile--ok { border-top-color: var(--db-green); } .mp-tile--warn { border-top-color: var(--db-amber); }
.mp-tile--info { border-top-color: var(--db-info); } .mp-tile--navy { border-top-color: var(--db-navy); }
:root[data-mode="dark"] .mp-tile--navy { border-top-color: var(--db-clock-track); }
.mp-bars { list-style: none; margin: 0; padding: 0; }
.mp-bars li { display: grid; grid-template-columns: minmax(0, 1fr) 84px 34px; gap: 10px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--db-border, var(--border)); color: var(--db-text, var(--text)); }
.mp-bars li:last-child { border-bottom: 0; }
.mp-bars b { text-align: right; }
.mp-bar, .mp-progress { display: block; height: 6px; background: var(--db-inset, var(--bg)); border-radius: 3px; overflow: hidden; }
.mp-bar i, .mp-progress i { display: block; height: 100%; background: var(--db-info); border-radius: 3px; }
.mp-progress i { background: var(--db-green); }
.mp-doc-line { margin: 0 0 8px; color: var(--db-text, var(--text)); }
.mp-docs { list-style: none; margin: 0; padding: 0; }
.mp-doc { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px 14px; align-items: center; padding: 10px 0;
  border-bottom: 1px solid var(--db-border, var(--border)); }
.mp-doc:last-child { border-bottom: 0; }
.mp-doc-main { display: flex; flex-direction: column; min-width: 0; }
.mp-doc-main b { color: var(--db-text, var(--text)); }
.mp-doc-main .mp-muted { font-size: 12px; overflow-wrap: anywhere; }
.mp-doc-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mp-doc-actions form { margin: 0; }
.mp-doc-actions .btn { display: inline-flex; align-items: center; line-height: 1.2; }
.mp-card-head > .mp-muted { font-size: 12px; }
.mp-doc-panel, .mp-history { grid-column: 1 / -1; }
.mp-doc-panel { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; background: var(--db-inset, var(--bg)); border-radius: var(--radius); padding: 10px; }
.mp-doc-panel[hidden] { display: none; }
.mp-doc-panel label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; flex: 1 1 240px; color: var(--db-text, var(--text)); }
.mp-history { font-size: 13px; color: var(--db-muted, var(--text-muted)); }
.mp-history ul { margin: 4px 0 0; padding-left: 18px; }
.mp-bad-text { font-size: 12px; color: var(--db-bad); }
/* extension-connect (2026-11-11): one-click Connect for the Apply Assistant (My profile, /extension/connect/) */
.mp-good-text { font-size: 14px; font-weight: 600; color: var(--db-ok, var(--c-ok)); margin: 4px 0; }
.mp-ext-connect { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.mp-ext-connect .mp-note { flex-basis: 100%; margin: 0; }
.mp-empty { color: var(--db-muted, var(--text-muted)); margin: 4px 0; }
.mp-adddoc-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.mp-adddoc-form label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--db-muted, var(--text-muted)); flex: 1 1 180px; }
.mp-toggles { border: 0; padding: 0; margin: 6px 0 0; }
.mp-toggles legend { font-size: 13px; color: var(--db-muted, var(--text-muted)); margin-bottom: 4px; }
.mp-form .mp-toggle { flex-direction: row; align-items: center; gap: 10px; color: var(--db-text, var(--text)); font-size: 14px; padding: 4px 0; }
.mp-toggle input { width: 18px; height: 18px; accent-color: var(--db-green); flex: none; }
.mp-signins { list-style: none; margin: 0 0 12px; padding: 0; }
.mp-signins li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--db-border, var(--border));
  color: var(--db-text, var(--text)); font-size: 14px; flex-wrap: wrap; }
@media (max-width: 1100px) { .mp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .mp-side { grid-column: 1 / -1; } }
@media (max-width: 700px) {
  .mp-grid { grid-template-columns: minmax(0, 1fr); }
  .mp-edit-fields { grid-template-columns: minmax(0, 1fr); }
  .mp-rows > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .mp-doc { grid-template-columns: minmax(0, 1fr) auto; }
  .mp-doc-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .mp-facts { gap: 14px; }
}

/* Payment stage 2 (2026-10-14): Record payment (one receipt, split, checked before saving) and receipt cards */
.rp-page { max-width: 1100px; }
.rp-card, .rp-check { padding: 14px 16px; margin-bottom: 14px; background: var(--bg-panel); border-radius: var(--radius); }
.rp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.rp-grid label, .rp-check label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--text-muted); }
.rp-wide { grid-column: 1 / -1; }
.rp-alloc { max-width: 140px; }
.rp-sum { margin: 8px 0 0; font-weight: 600; }
.rp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rp-facts { display: flex; gap: 22px; flex-wrap: wrap; margin: 6px 0 10px; }
.rp-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; }
.rp-facts dd { margin: 0; font-weight: 600; }
.rp-total td { border-top: 2px solid var(--border); }
.rp-save { margin-top: 12px; }
.rp-different { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; color: var(--badge-red-fg); }
.rc-card { padding: 12px 14px; margin-bottom: 12px; background: var(--bg-panel); border-radius: var(--radius); }
.rc-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.rc-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.rc-form { display: flex; flex-direction: column; gap: 6px; min-width: 260px; }
.rc-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-muted); }
.rc-apply { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.rc-apply label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-muted); }
@media (max-width: 700px) { .rp-grid { grid-template-columns: minmax(0, 1fr); } .rc-head { flex-direction: column; } }
/* ---------------------------------------------------------------- Employees (owner, 2026-10-15): list + employee page.
   Same db-* tokens as the dashboard / My profile, so light and dark follow the theme. */
.em-page { max-width: 1600px; }
.em-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.em-tile { display: block; background: var(--db-surface); border: 1px solid var(--db-border); border-top: 3px solid var(--db-navy);
  border-radius: var(--radius); padding: 10px 12px; text-decoration: none; color: var(--db-text); }
.em-tile:hover { color: var(--db-text); background: var(--db-inset); }
.em-tile b { display: block; font-size: 1.4rem; line-height: 1.2; }
.em-tile span { font-size: 12px; color: var(--db-muted); }
.em-tile--ok { border-top-color: var(--db-green); } .em-tile--warn { border-top-color: var(--db-amber); }
.em-tile--info { border-top-color: var(--db-link); } .em-tile--bad { border-top-color: var(--db-accent); }
:root[data-mode="dark"] .em-tile { border-top-color: var(--db-muted); }
:root[data-mode="dark"] .em-tile--ok { border-top-color: var(--db-ok); } :root[data-mode="dark"] .em-tile--warn { border-top-color: var(--db-amber); }
:root[data-mode="dark"] .em-tile--info { border-top-color: var(--db-link); } :root[data-mode="dark"] .em-tile--bad { border-top-color: var(--db-accent); }
.em-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.em-filters .form-select { width: auto; max-width: 190px; }
.em-search { width: 240px; max-width: 100%; }
.em-check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--db-text); white-space: nowrap; }
.em-spacer { flex: 1 1 auto; }
.em-wrap { display: flex; gap: 12px; align-items: flex-start; }
.em-table-wrap { flex: 1 1 auto; min-width: 0; }
.em-table td { vertical-align: middle; padding-top: 6px; padding-bottom: 6px; }
.em-row { cursor: pointer; }
.em-row.is-on td { background: var(--db-inset); }
.em-row:focus-visible { outline: 2px solid var(--db-link); outline-offset: -2px; }
.em-person { display: flex; gap: 10px; align-items: center; min-width: 0; }
.em-person > span { display: flex; flex-direction: column; min-width: 0; }
.em-av { width: 32px; height: 32px; border-radius: var(--radius); object-fit: cover; flex: none; }
.em-av--i { display: inline-flex; align-items: center; justify-content: center; background: var(--c-navy); color: var(--c-on-dark); font-size: 12px; font-weight: 700; }
:root[data-mode="dark"] .em-av--i { background: var(--db-inset); color: var(--db-text); border: 1px solid var(--db-border); }
.em-av--lg { width: 48px; height: 48px; border-radius: var(--radius); font-size: 16px; }
.em-name { font-weight: 600; color: var(--db-text); text-decoration: none; }
.em-name:hover { color: var(--db-link); }
.em-sub { display: block; font-size: 12px; color: var(--db-muted); overflow-wrap: anywhere; }
.em-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.em-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.em-pill--ok { background: var(--db-pill-ok-bg); color: var(--db-pill-ok); }
.em-pill--warn { background: var(--db-pill-warn-bg); color: var(--db-pill-warn); }
.em-pill--bad { background: var(--db-pill-bad-bg); color: var(--db-pill-bad); }
.em-pill--grey { background: var(--db-pill-grey-bg); color: var(--db-pill-grey); }
.em-pill--info { background: var(--db-inset); color: var(--db-info); border: 1px solid var(--db-border); }
.em-bar { display: inline-block; vertical-align: middle; width: 70px; height: 6px; background: var(--db-inset); border-radius: 3px; overflow: hidden; }
.em-bar i { display: block; height: 100%; background: var(--db-green); border-radius: 3px; }
:root[data-mode="dark"] .em-bar i { background: var(--db-ok); }
.em-panel { flex: 0 0 320px; position: sticky; top: 12px; background: var(--db-surface); border: 1px solid var(--db-border); border-radius: var(--radius); padding: 14px; color: var(--db-text); }
.em-panel[hidden], .em-panel-body[hidden] { display: none; }
.em-panel-x { float: right; background: none; border: 0; font-size: 20px; line-height: 1; color: var(--db-muted); cursor: pointer; }
.em-panel-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.em-panel-head b { display: block; }
.em-facts { margin: 0 0 12px; }
.em-facts > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--db-border); font-size: 13px; }
.em-facts dt { font-weight: 400; color: var(--db-muted); }
.em-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.em-panel-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* the employee page header */
.em-progress { margin-top: 8px; font-size: 13px; }
.em-progress summary { cursor: pointer; list-style: none; display: inline-flex; gap: 8px; align-items: center; opacity: .9; }
.em-progress summary::-webkit-details-marker { display: none; }
.em-bar--head { width: 120px; background: var(--c-hero-chip); }
.em-missing { margin: 6px 0 0; padding-left: 18px; columns: 2; font-size: 13px; }
.em-btn-danger { border-color: var(--c-on-hero-bad); color: var(--c-on-hero-bad); }
.em-btn-danger:hover { background: var(--c-hero-chip); color: var(--c-on-hero-bad); }
.em-bank-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.em-bank-actions form { margin: 0; }
.em-activity { list-style: none; margin: 0; padding: 0; }
.em-activity li { padding: 8px 0; border-bottom: 1px solid var(--db-border); color: var(--db-text); font-size: 14px; }
.em-activity li:last-child { border-bottom: 0; }
.em-detail .mp-tabs a { white-space: nowrap; }
@media (max-width: 1100px) { .em-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .em-panel { flex-basis: 280px; } }
@media (max-width: 760px) {
  .em-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em-wrap { flex-direction: column; }
  .em-panel { position: static; width: 100%; flex-basis: auto; }
  .em-filters .form-select, .em-search { max-width: none; flex: 1 1 140px; }
  .em-missing { columns: 1; }
  .em-detail .mp-tabs { flex-wrap: nowrap; overflow-x: auto; }
}
.em-export { margin: -4px 0 8px; }
.em-export > summary { list-style: none; padding-left: 0; }
.em-export > summary::-webkit-details-marker { display: none; }
.em-export .export-visible-columns-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.em-table-wrap { overflow-x: auto; max-width: 100%; }
.em-filters .form-select { flex: 0 1 170px; }
.em-filters .btn-link { padding-left: 4px; padding-right: 4px; }
.em-panel-actions .btn, .em-panel-actions form { margin: 0; }
.em-pbtn { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  border: 1px solid var(--db-border); background: var(--db-inset); color: var(--db-text); text-decoration: none; cursor: pointer; }
.em-pbtn:hover { color: var(--db-text); border-color: var(--db-muted); }
.em-pbtn--main { background: var(--c-hero); border-color: var(--c-hero); color: var(--c-on-hero); }
.em-pbtn--main:hover { color: var(--c-on-dark); }
:root[data-mode="dark"] .em-pbtn--main { background: var(--c-ice); border-color: var(--c-ice); color: var(--c-on-light); }
.em-reject { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.em-reject input { width: 240px; max-width: 100%; }
.em-progress summary { flex-wrap: wrap; }
.em-wrap > * { min-width: 0; }
@media (max-width: 760px) { .em-table-wrap { width: 100%; } }

/* Night check (15 Oct): a block-stacked payments table cell on a phone was held at the data-table's 32px, so a
   two-line cell ran into the next label ("AMOUNT" over "due ... owed"). Its own height wins now. */
table.data-table.ps-table td { height: auto; }
/* Employees list: the filter row, then a second even row -- checkboxes left, actions right; every control one
   height, text centred (the link-buttons stood taller with their text at the top). */
.em-filters { flex-wrap: nowrap; }
.em-filters .form-select { flex: 1 1 140px; max-width: 200px; min-width: 0; }
.em-filters .em-search { flex: 1 1 220px; }
.em-filters .btn, .em-bar2 .btn, .em-bar2 .em-export > summary { display: inline-flex; align-items: center; justify-content: center;
  height: 31px; padding-top: 0; padding-bottom: 0; line-height: 1; white-space: nowrap; margin: 0; }
.em-bar2 { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.em-bar2 .em-export { position: relative; margin: 0; }
.em-bar2 .em-export[open] .export-visible-columns-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: max-content;
  max-width: calc(100vw - 32px); padding: 10px; background: var(--db-surface); border: 1px solid var(--db-border); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); }
@media (max-width: 1100px) { .em-filters { flex-wrap: wrap; } }
@media (max-width: 760px) {
  .em-filters .form-select, .em-filters .em-search { max-width: none; flex: 1 1 140px; }
  .em-bar2 .em-spacer { display: none; }
  .em-bar2 .em-export[open] .export-visible-columns-form { left: 0; right: auto; }
}
.em-bar2 .em-export > summary { padding-left: 10px; padding-right: 10px; }

/* reports-redesign (2026-10-23): the one-page Reports -- built from the existing list tabs, detail cards, KPI tiles,
   badge pills and data tables; only spacing is new here. Theme tokens carry it into dark mode. */
.rh-title { font-size: 20px; font-weight: 700; margin: 0 0 var(--space-2); }
.rh-question { color: var(--text-muted); margin: 0 0 var(--space-2); font-size: var(--font-data); }
.rh-quick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin-bottom: var(--space-3); }
.rh-pill { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 999px; }
.rh-filters { margin-bottom: var(--space-3); }
.rh-period { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.rh-seg { margin-left: 0; position: relative; }   /* holds its hidden radios (else they widen a phone page) */
.rh-seg .list-tab { cursor: pointer; margin: 0; }
/* ui-audit-oct26: on a phone the Period buttons scroll inside their own row instead of widening the page */
@media (max-width: 640px) {
  .rh-period { flex-wrap: wrap; }
  .rh-seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
  .rh-seg .list-tab { flex: 0 0 auto; }
}
.rh-custom { display: inline-flex; align-items: center; gap: var(--space-1); }
.rh-custom .form-control { width: auto; }
.rh-compare { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.rh-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.rh-showing { margin-top: var(--space-2); color: var(--text-muted); }
.rh-kpis { margin-bottom: var(--space-3); }
.rh-kpi-label { font-size: 12px; font-weight: 600; color: var(--text); margin: 0 0 4px; }
.rh-delta { display: inline-block; margin-top: 6px; }
.rh-now { display: inline-block; margin-top: 6px; }
.rh-counts { margin-top: 6px; line-height: 1.35; }
.rh-chart { margin-bottom: var(--space-3); }
.rh-chart svg { width: 100%; height: auto; max-height: 220px; }
.rh-table-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.rh-table-head > span:first-child { flex: 1 1 auto; }
.rh-search .list-search { width: 200px; }
.rh-downloads { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); max-width: 100%; }   /* ui-audit-oct26: wraps on a phone */
.rh-downloads .btn { white-space: normal; text-align: left; }
.rh-table-head .btn, .rh-table-head .list-search { text-transform: none; letter-spacing: normal; font-weight: 500; }
.rh-grid th.num, .rh-grid td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rh-grid th a.rh-sort { color: inherit; text-decoration: none; }
.rh-grid th a.rh-sort.on { color: var(--accent); }
.rh-grid tfoot .rh-total td { font-weight: 700; border-top: 2px solid var(--border); }
.rh-grid tr.rh-restricted td { color: var(--text-muted); font-style: italic; }
.rh-notes { margin: var(--space-2) 0; padding-left: 18px; }
/* reports-v2 (2026-10-24): one layout for every report page -- header with the Reports menu, the table's Break down
   by sub-rows, the chart at the bottom (a <details>, remembered per person), the "All reports" cards */
.rh-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2);
  margin-bottom: var(--space-2); }
.rh-head .rh-title { margin: 0; }
.rh-back { display: inline-block; margin-bottom: 2px; color: var(--text-muted); text-decoration: none; }
.rh-back:hover { color: var(--accent); }
.rh-head-actions { display: flex; align-items: center; gap: var(--space-1); }
.rh-head-actions .btn { text-transform: none; letter-spacing: normal; font-weight: 500; }
.rh-menu { position: relative; }
.rh-menu[open] > .dropdown-menu-custom { display: block; }
.rh-menu > .rh-menu-list { right: 0; left: auto; max-height: 70vh; overflow-y: auto; min-width: 260px; }
.rh-menu-list a { padding: 7px 14px; }
.rh-menu-list a.on { color: var(--accent); font-weight: 600; }
.rh-menu-section { padding: 8px 14px 2px; font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; border-top: 1px solid var(--border); }
.rh-panel { margin: var(--space-3) 0; }
.rh-banner { margin: calc(-1 * var(--space-1)) 0 var(--space-2); }
.rh-hidden-note { margin: calc(-1 * var(--space-2)) 0 var(--space-2); }
.rh-expand { display: inline-flex; gap: var(--space-1); }
.rh-grid .rh-toggle { border: 0; background: none; color: var(--text-muted); padding: 0 6px 0 0; font-size: 12px;
  line-height: 1; cursor: pointer; }
.rh-grid .rh-toggle:hover { color: var(--accent); }
.rh-grid--tree tr.rh-parent td { font-weight: 600; }
.rh-grid tr.rh-sub td { background: var(--bg); color: var(--text); font-size: 12px; }
.rh-grid tr.rh-sub td.rh-sub-label { padding-left: 28px; color: var(--text-muted); }
.rh-grid .rh-dash { cursor: help; border-bottom: 1px dotted var(--text-muted); }
.rh-chart { margin: var(--space-3) 0; }
.rh-chart > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline;
  gap: var(--space-1); }
.rh-chart > summary::-webkit-details-marker { display: none; }
.rh-chart-toggle { margin-left: auto; }
.rh-chart-toggle::after { content: "Hide chart ▴"; }
.rh-chart:not([open]) .rh-chart-toggle::after { content: "Show chart ▾"; }
.rh-chart:not([open]) > summary { border-bottom: 0; }
.rh-bars .rh-bar:hover path { opacity: .85; }
.rh-chart svg.rh-hbars { max-height: none; }
.rh-library { margin-top: var(--space-4, 24px); }
.rh-library-title { font-size: 16px; font-weight: 700; margin: 0 0 var(--space-2); }
.rh-library-section { margin-bottom: var(--space-3); }
.rh-library-section-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em; margin: 0 0 var(--space-1); }
.rh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-2); }
.rh-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; margin: 0; text-decoration: none;
  color: var(--text); }
.rh-card:hover { border-color: var(--accent); }
.rh-card-title { font-weight: 600; color: var(--text); }
.rh-card-desc { line-height: 1.35; }
@media (max-width: 640px) {
  .rh-search .list-search { width: 100%; }
  .rh-table-head > span:first-child { flex-basis: 100%; }
  .rh-head-actions { width: 100%; }
}
/* reports-polish (2026-10-31): heading row with the star, ONE filter bar, ONE Report settings panel, the Favourites
   strip, cards with a star, the chart's table view and the empty state. Theme tokens only (any theme, light or dark). */
.rh-title-row { display: flex; align-items: center; gap: var(--space-1); }
.rh-head-main .rh-question { margin: 2px 0 0; }
.rh-pin-form { display: inline; margin: 0; position: relative; z-index: 1; }
.rh-pin { border: 0; background: none; padding: 0 4px; font-size: 20px; line-height: 1; color: var(--text-muted);
  cursor: pointer; border-radius: var(--radius); }
.rh-pin:hover, .rh-pin:focus-visible { color: var(--accent); }
.rh-pin.on { color: var(--c-warn-solid); }
.rh-card .rh-pin { font-size: 17px; }
.rh-section-title { font-size: var(--fs-md); font-weight: 700; margin: 0 0 var(--space-2); display: flex;
  flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.rh-jump { margin-left: auto; color: var(--text-muted); font-weight: 500; }
.rh-favs { margin-bottom: var(--space-3); }
.rh-card { position: relative; }
.rh-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-1); }
.rh-card-top .rh-card-title { text-decoration: none; }
.rh-card-top .rh-card-title::after { content: ""; position: absolute; inset: 0; }   /* the whole card opens it */
.rh-card:focus-within { border-color: var(--accent); }
.rh-card--fav { border-left: 3px solid var(--accent); }
.rh-filters { padding: var(--space-3); }
.rh-filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); }
.rh-field { flex: 0 1 180px; min-width: 140px; }
.rh-field .form-label { margin-bottom: 2px; }
.rh-field .form-select.rh-on { border-color: var(--accent); }
.rh-nofilters { align-self: center; }
.rh-filterbar-end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-left: auto; }
.rh-active-count { color: var(--text-muted); }
.rh-active-count.on { color: var(--c-accent-text); font-weight: 600; }
.rh-settings { margin-top: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--c-surface-2); }
.rh-settings-head { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline;
  gap: var(--space-2); padding: var(--space-2) var(--space-3); }
.rh-settings-head::-webkit-details-marker { display: none; }
.rh-settings-title { font-weight: 600; font-size: var(--fs-sm); }
.rh-settings-toggle { margin-left: auto; }
.rh-settings-toggle::after { content: "Hide ▴"; }
.rh-settings:not([open]) .rh-settings-toggle::after { content: "Change ▾"; }
.rh-settings-body { padding: 0 var(--space-3) var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.rh-settings-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); }
.rh-show-all { align-self: center; padding-top: 18px; }
.rh-filters .rh-showing { margin-top: var(--space-2); }
.rh-chart-table { margin-top: var(--space-2); }
.rh-chart-table > summary { cursor: pointer; color: var(--text-muted); }
.rh-chart-table .data-table-wrap { max-height: 320px; overflow-y: auto; margin-top: var(--space-1); }
.rh-bars .rh-bar:hover text, .rh-hbars .rh-bar:hover text { fill: var(--text); }
.rh-bars .rh-bar:hover > rect:first-of-type, .rh-hbars .rh-bar:hover > rect:first-of-type { fill: var(--row-hover); }
.rh-empty .detail-card-body { padding: var(--space-4); text-align: center; }
.rh-empty-title { font-size: var(--fs-md); font-weight: 700; margin: 0 0 var(--space-1); }
.rh-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
@media (max-width: 640px) {
  .rh-field { flex: 1 1 calc(50% - var(--space-2)); min-width: 0; }
  .rh-filterbar-end { width: 100%; margin-left: 0; }
  .rh-filterbar-end .rh-active-count { flex-basis: 100%; }
  .rh-show-all { padding-top: 0; }
  .rh-head-actions { flex-wrap: wrap; }
  .rh-menu > .rh-menu-list { left: 0; right: auto; min-width: 0; width: max-content; max-width: calc(100vw - 32px); }
}

/* delete-user (2026-10-23): "Previously with <name>" on a lead / profile whose owner was deleted permanently */
.prev-chip { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
  white-space: nowrap; background: var(--badge-gray-bg); color: var(--badge-gray-fg); vertical-align: middle; }

/* interview support (owner, 2026-10-24) */
.is-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.is-summary > div { flex-basis: 100%; }
.is-feedback { flex-basis: 100%; border-left: 3px solid var(--border); padding: 2px 0 2px 8px; margin-top: 4px; }
.is-stars { color: #b7791f; letter-spacing: 1px; }
.is-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 9rem; }
.is-actions details[open] { width: 100%; }
.is-assign { max-width: 760px; }
.is-item + .is-item { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.is-row td { background: transparent; }
.is-kpis { margin-bottom: 12px; }
.mp-form label.is-tick { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }

/* pause-profile (2026-10-25): the red "Paused — payment" chip (templates/core/_paused_chip.html), wherever a
   candidate paused for non-payment shows */
.paused-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
               line-height: 1.5; white-space: nowrap; background: var(--badge-red-bg); color: var(--badge-red-fg);
               border: 1px solid var(--badge-red-fg); vertical-align: middle; }
.paused-banner { background: var(--badge-red-bg); color: var(--badge-red-fg); border: 1px solid var(--badge-red-fg);
                 border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }


/* ---- settings-hub (2026-10-26): Settings -- the tab list on the left, the tab on the right ---- */
.st-shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.st-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 72px; }
.st-tab { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.st-tab:hover { background: var(--bg-hover, rgba(47, 111, 237, .08)); color: var(--text); }
.st-tab.is-active { background: var(--accent); color: #fff; font-weight: 600; }
.st-main { min-width: 0; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.st-h { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.st-h3 { font-size: 15px; font-weight: 700; margin: 18px 0 6px; }
.st-intro { color: var(--text-muted); max-width: 760px; margin-bottom: 14px; }
.st-help, .st-source { font-size: 12px; color: var(--text-muted); }
.st-label { font-weight: 600; font-size: 14px; }
.st-form { max-width: 820px; }
.st-field { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: center; padding: 10px 0;
            border-bottom: 1px solid var(--border); }
.st-save { display: flex; gap: 8px; align-items: center; margin-top: 14px; max-width: 560px; }
.st-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 240px; }
.st-inline input { flex: 1 1 140px; min-width: 0; }
.st-links { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.st-link-card { display: flex; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
                color: var(--text); text-decoration: none; font-weight: 600; }
.st-link-card:hover { border-color: var(--accent); color: var(--text); }
.st-readonly { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; max-width: 620px; }
.st-plain { padding-left: 18px; }
.st-changes summary { cursor: pointer; font-weight: 600; }
@media (max-width: 900px) {
  .st-shell { grid-template-columns: 1fr; }
  .st-nav { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; }
  .st-tab { white-space: nowrap; }
  .st-field { grid-template-columns: 1fr; }
  .st-inline { min-width: 0; flex-wrap: wrap; }
}


/* ---- stay-signed-in (2026-10-26): the lock over an open page (core/_lock_screen.html) ---- */
.crm-lock { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 16px;
            background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.crm-lock[hidden] { display: none; }
body.crm-is-locked { overflow: hidden; }
body.crm-is-locked > *:not(.crm-lock):not(script) { visibility: hidden; }
.crm-lock-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px; padding: 26px 28px;
                 width: 100%; max-width: 380px; text-align: center; box-shadow: var(--shadow-pop, 0 12px 40px rgba(0,0,0,.18)); }
.crm-lock-card .form-label { display: block; text-align: left; }
.crm-lock-avatar { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px;
                   background: var(--accent); color: #fff; font-size: 22px; font-weight: 700; }
.crm-lock-name { font-size: 19px; margin: 0; }
.crm-lock-email { color: var(--text-muted); margin: 2px 0 12px; word-break: break-all; }
.crm-lock-note { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.crm-lock-pin { letter-spacing: .5em; text-align: center; font-size: 20px; }
.crm-lock-error { color: var(--danger, #b42318); font-size: 14px; margin: 10px 0 0; }
.crm-lock-links { display: flex; gap: 12px; margin-top: 14px; }
.login-remember { margin: 4px 0 14px; }
.login-remember .form-text { font-size: 12px; }
.mp-subhead { font-size: 14px; font-weight: 700; margin: 14px 0 6px; }

/* lead-copy (owner, 2026-11-02): the small COPY button beside a lead's name, email, phone and LinkedIn id -- the
   Marketing checklist's COPY (marketing/work_mode.css .wm-ck-copy); "Copied" in green for 2 seconds. */
.copy-chip { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 6px; font-size: 10px;
    font-weight: 800; letter-spacing: .04em; line-height: 1.4; padding: 2px 7px; border-radius: var(--radius); border: 0;
    background: var(--c-info-bg); color: var(--c-info); cursor: pointer; white-space: nowrap; }
.copy-chip:hover { filter: brightness(0.96); }
.copy-chip.is-copied { background: var(--c-ok-bg); color: var(--c-ok); }
.copy-chip:focus-visible { outline: 2px solid var(--c-info-solid, var(--c-info)); outline-offset: 2px; }
.lead-field-copy { display: flex; gap: 6px; align-items: center; }
.lead-field-copy > :first-child { flex: 1 1 auto; min-width: 0; }
.lp-copy-row { display: inline-flex; align-items: center; }

/* daily-work (owner, 2026-11-10): Reports › Daily work -- a sheet-style grid: white, thin lines, compact, the first
   column and the header frozen. Boxes are shaded in ONE hue light -> dark (the info blue, never the company accent:
   that is red by default and red here means "a working day with nothing done"); text keeps the text colours. */
.dw { --dw-ink: var(--c-info-solid); --dw-p1: 9%; --dw-p2: 18%; --dw-p3: 28%; --dw-p4: 40%; --dw-p5: 54%; }
:root[data-mode="dark"] .dw { --dw-p1: 14%; --dw-p2: 21%; --dw-p3: 28%; --dw-p4: 36%; --dw-p5: 44%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .dw { --dw-p1: 14%; --dw-p2: 21%; --dw-p3: 28%; --dw-p4: 36%; --dw-p5: 44%; } }
.dw-preview { vertical-align: middle; }
.dw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 var(--space-3); }
.dw-bar .tab-segment { margin-left: 0; flex-wrap: wrap; }
.dw-period { display: contents; }
.dw-custom { display: inline-flex; }
.dw-custom > summary { list-style: none; cursor: pointer; }
.dw-custom > summary::-webkit-details-marker { display: none; }
.dw-custom[open] .dw-custom-body { display: inline-flex; }
.dw-custom-body { display: none; align-items: center; gap: 6px; padding: 0 8px; flex-wrap: wrap; }
.dw-custom-body .form-control { width: auto; }
.dw-team { display: inline-flex; align-items: center; gap: 6px; }
.dw-team .form-select { width: auto; max-width: 240px; }
.dw-strip { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); margin-bottom: var(--space-3); }
@media (min-width: 1100px) { .dw-strip { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, .8fr); align-items: start; } }
.dw-bigs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.dw-big .kpi-value { font-variant-numeric: tabular-nums; }
.dw-change { font-weight: 600; }
.dw-change .dw-vs, .dw-vs { font-weight: 400; margin-left: 4px; }
.dw-good { background: var(--c-ok-bg); color: var(--c-ok); }
.dw-bad { background: var(--c-bad-bg); color: var(--c-bad); }
.dw-flat { background: var(--c-neutral-bg); color: var(--c-neutral); }
.dw-chart svg { max-width: 100%; height: auto; }
.dw-person-chart svg { max-width: 720px; display: block; }
.dw-rank .detail-card-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-2); }
.dw-rank ol { margin: 4px 0 0; padding-left: 20px; }
.dw-rank li { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); }
.dw-rank li strong { font-variant-numeric: tabular-nums; }
.dw-showbar { margin-bottom: var(--space-2); }
.dw-show { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.dw-show .tab-segment { margin-left: 0; flex-wrap: wrap; }
.dw-says { margin: 6px 0 0; color: var(--text-muted); }
.dw-sheet-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--c-border-strong); background: var(--c-surface); }
.dw-sheet { border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); background: var(--c-surface); color: var(--c-text); }
.dw-sheet th, .dw-sheet td { border-right: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); padding: 3px 8px; line-height: 1.35; white-space: nowrap; }
.dw-sheet td.num, .dw-sheet th.num { text-align: right; font-variant-numeric: tabular-nums; min-width: 46px; }
.dw-sheet thead th { position: sticky; top: 0; z-index: 2; background: var(--c-surface-2); font-weight: 600; font-size: var(--fs-xs); vertical-align: bottom; }
.dw-sheet .dw-name { position: sticky; left: 0; z-index: 1; background: var(--c-surface); text-align: left; font-weight: 500; min-width: 170px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--c-border-strong); }
.dw-sheet thead .dw-name { z-index: 3; background: var(--c-surface-2); }
.dw-sheet thead .dw-today { color: var(--c-info); box-shadow: inset 0 -2px 0 var(--c-info-solid); }
.dw-sheet .dw-tot { background: var(--c-surface-2); font-weight: 600; }
.dw-sheet thead .dw-tot { background: var(--c-surface-2); }
.dw-sheet td a { color: inherit; text-decoration: none; display: block; }
.dw-sheet td a:hover, .dw-sheet td a:focus-visible { text-decoration: underline; }
.dw-sheet .dw-name a { color: var(--c-text); text-decoration: none; }
.dw-sheet .dw-name a:hover, .dw-sheet .dw-name a:focus-visible { color: var(--c-link); text-decoration: underline; }
.dw-chart { --accent: var(--dw-ink); }        /* the strip's bars in the grid's one hue */
.dw-sheet tbody tr:hover > td:not([class*="dw-s"]):not(.dw-mark):not(.dw-red) { background: var(--c-row-hover); }
.dw-s1 { background: color-mix(in srgb, var(--dw-ink) var(--dw-p1), var(--c-surface)); }
.dw-s2 { background: color-mix(in srgb, var(--dw-ink) var(--dw-p2), var(--c-surface)); }
.dw-s3 { background: color-mix(in srgb, var(--dw-ink) var(--dw-p3), var(--c-surface)); }
.dw-s4 { background: color-mix(in srgb, var(--dw-ink) var(--dw-p4), var(--c-surface)); }
.dw-s5 { background: color-mix(in srgb, var(--dw-ink) var(--dw-p5), var(--c-surface)); font-weight: 600; }
.dw-sheet td.dw-mark, .dw-key-box.dw-mark { background: var(--c-neutral-bg); color: var(--c-muted); }
.dw-sheet td.dw-red, .dw-key-box.dw-red { color: var(--c-bad); font-weight: 700; background: var(--c-bad-bg); }
.dw-sheet td.dw-future { background: var(--c-surface-2); }
.dw-sheet tr.dw-group > * { background: var(--c-surface-2); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted); }
.dw-sheet tr.dw-subtotal > *, .dw-sheet tr.dw-teamtotal > * { font-weight: 600; background: var(--c-surface-2); }
.dw-sheet tr.dw-total > * { font-weight: 700; background: var(--c-selected); border-top: 2px solid var(--c-border-strong); position: sticky; bottom: 0; }
.dw-key { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.dw-key-box { display: inline-block; min-width: 22px; height: 18px; padding: 0 4px; text-align: center; vertical-align: middle; border: 1px solid var(--c-border); font-size: var(--fs-2xs); line-height: 16px; }
/* reports-by-person (owner, 2026-11-18): Reports -- people down the left, numbers across (reports/people.html) */
.rp-head { align-items: center; }
.rp-head .rh-head-actions { display: flex; align-items: center; gap: var(--space-2); }
.rp-tabs { margin: var(--space-2) 0 0; flex-wrap: wrap; }
.rp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-2) 0; }
.rp-date { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.rp-date .form-select { width: auto; }
.rp-bar .form-select-sm, .rp-bar .btn-sm, .rp-filters > summary { height: 32px; }
.rp-filters > summary { display: inline-flex; align-items: center; }
.rp-dates { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rp-dates[hidden] { display: none; }
.rp-dates .form-control { width: auto; }
.rp-filters { position: relative; }
.rp-filters > summary { list-style: none; }
.rp-filters > summary::-webkit-details-marker { display: none; }
.rp-panel { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 240px; display: grid; gap: 8px; padding: 10px 12px; background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border-strong); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.rp-panel label { display: grid; gap: 2px; font-weight: 600; }
.rp-panel-actions { display: flex; align-items: center; gap: 4px; }
.rp-switch { display: inline-flex; align-items: center; gap: 6px; padding-left: 2.5em; }
.rp-on { font-weight: 500; }
.rp-wrap { max-height: 72vh; width: fit-content; max-width: 100%; }
.rp-table td, .rp-table th { padding: 4px 10px; }
.rp-table .rp-att { background: var(--c-info-bg); }
.rp-table thead th.rp-att { background: var(--c-info-bg); color: var(--c-info); }
.rp-table td.rp-warn { color: var(--c-warn); font-weight: 600; }
.rp-table tbody tr:hover > td:not(.rp-att) { background: var(--c-row-hover); }
.rp-table tfoot th, .rp-table tfoot td { position: sticky; bottom: 0; z-index: 1; background: var(--c-surface-2); font-weight: 700; border-top: 2px solid var(--c-border-strong); }
.rp-table tfoot .dw-name { z-index: 2; }
.rp-table tfoot td.rp-att { background: var(--c-info-bg); }
.rp-line { margin: 6px 0 0; color: var(--text-muted); }
.rp-table thead a.rp-sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
.rp-table thead a.rp-sort:hover, .rp-table thead a.rp-sort:focus-visible { text-decoration: underline; }
.rp-table thead th.num a.rp-sort { display: flex; justify-content: flex-end; }
.rp-arrow { font-size: 0.8em; color: var(--c-info); }
.rp-view { margin-left: 0; }

/* notes-mentions (owner, 19 Nov 2026): the @ list, a mentioned name, the writer's Seen line, the note a link opened */
.mention-list { position: absolute; z-index: 1080; margin: 0; padding: 4px 0; list-style: none; max-height: 260px; overflow-y: auto;
  background: var(--bs-body-bg, #fff); color: var(--bs-body-color, #1f2937); border: 1px solid var(--bs-border-color, #d1d5db);
  border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); font-size: .875rem; }
.mention-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; cursor: pointer; }
.mention-list li[aria-selected="true"], .mention-list li:hover { background: var(--bs-secondary-bg, #eef2f7); }
.mention-role { color: var(--bs-secondary-color, #6b7280); font-size: .8rem; }
mark.mention { background: rgba(31, 95, 191, .14); color: inherit; padding: 0 2px; border-radius: 3px; font-weight: 600; }
[data-bs-theme="dark"] mark.mention { background: rgba(120, 170, 255, .22); }
.mention-seen { display: block; margin-top: 2px; color: var(--bs-secondary-color, #6b7280); font-size: .78rem; }
[id^="note-"]:target { outline: 2px solid rgba(31, 95, 191, .55); outline-offset: 2px; border-radius: 4px;
  animation: mention-flash 2s ease-out 1; }
@keyframes mention-flash { from { background: rgba(31, 95, 191, .18); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { [id^="note-"]:target { animation: none; } }
.notif-menu-all { display: block; padding: 8px 12px; text-align: center; border-top: 1px solid var(--bs-border-color, #e5e7eb); }

