:root {
    /* Same brand system as the pricing dashboard — pulled from blulight.com */
    --brand-blue: #1211f8;
    --brand-blue-dark: #0b0ab0;
    --mint: #00fda2;
    --mint-dark: #00b876;
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --border: #e0e4e8;
    --text: #1c1c1c;
    --muted: #686f7d;
    --green: #1f7a3d;
    --red: #b3261e;
    --highlight: #eef0ff;
    --surface-2: #f4f5fd;         /* table headers, subtle fills */
    --surface-hover: #fafbff;
    --input-bg: #ffffff;
    --faint: #c2c9d1;
    --red-hover: #7a180f;
    --disabled-bg: #e0e4e8;

    --header-from: #0b0ab0;
    --header-to: #1211f8;
    --header-ink: #dce0ff;

    --shadow: 0 1px 3px rgba(18, 17, 248, 0.06);

    --ok-bg: #e3fbf1;
    --ok-fg: #00794d;
    --ok-border: #a6f2d3;
    --err-bg: #fbe9e7;
    --err-fg: #b3261e;
    --err-border: #f0c4bf;
    --warn-bg: #fff7e0;
    --warn-fg: #7a6000;
    --warn-border: #ecd98a;
    --neutral-bg: #eef2f6;
    --neutral-fg: #4b5563;

    color-scheme: light;
}

/* ============================ BLULIGHT SHARED CORE ============================
   IDENTICAL IN ALL 13 APPS. Treat it like theme.js: edit it in one app, copy it
   to every other, and rebuild all the containers. Never fork it per app.

   It sits immediately after :root so it can use the tokens, and BEFORE each
   app's own rules so those still win on a tie - this block only fills gaps,
   it never overrides a deliberate app decision.

   Why buttons are here: shape used to come only from the bare `button {}`
   element rule, so <button class="btn-primary"> looked right but
   <a class="btn"> rendered as a plain blue link. `.btn` was used 143 times
   across the estate and defined in only two apps.
   ========================================================================== */

/* Shape for anything acting as a button, whatever tag it is on. Blue is the
   default action; mint .btn-primary is the emphasised one and is layered on
   by each app's own sheet further down. */
.btn,
a.btn,
button.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    background: var(--brand-blue);
    color: #fff;
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover,
a.btn:hover,
button.btn:hover { background: var(--brand-blue-dark); color: #fff; }

/* An anchor carrying only a colour variant still needs the shape. .btn-ghost
   is deliberately excluded - it is meant to read as bare text. */
a.btn-primary,
a.btn-secondary {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

/* The two colour variants, so an app that never declared them still matches
   the rest of the estate. Apps that do declare them override this harmlessly. */
.btn-secondary {
    background: var(--card-bg);
    color: var(--brand-blue);
    border: 1px solid var(--brand-blue);
}
.btn-secondary:hover { background: var(--highlight); }

.btn-ghost {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

/* Used 51 times in apps whose sheet never gave it a colour, so "quiet" text
   rendered at full strength. */
.muted { color: var(--muted); }

/* ========================= END BLULIGHT SHARED CORE ========================= */


* { box-sizing: border-box; }

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

header {
    background: linear-gradient(120deg, var(--header-from), var(--header-to));
    color: #fff;
    padding: 14px 32px 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--header-ink);
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    flex-wrap: wrap;
}
.user-bar a, .user-bar .light-link { color: var(--header-ink); }
.user-bar a:hover, .user-bar .light-link:hover { color: #fff; }

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
}

.brand-logo { height: 60px; width: auto; flex: none; }

.bear-deco {
    height: 150px;
    width: auto;
    margin-left: auto;
    flex: none;
    pointer-events: none;
}

.header-text { border-left: 1px solid rgba(255, 255, 255, 0.3); padding-left: 18px; }

header h1 { margin: 0 0 5px 0; font-size: 26px; font-weight: 600; letter-spacing: 0.2px; }
.subtitle { margin: 0; color: var(--header-ink); font-size: 14px; }

main {
    max-width: 1240px;
    margin: 24px auto;
    padding: 0 16px 48px 16px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card h2 { margin-top: 0; font-size: 16px; font-weight: 600; color: var(--brand-blue-dark); }

/* Scrolls both ways: wide tables pan sideways, long ones scroll under a
   sticky header. The max-height is what makes the sticky header WORK — th's
   sticky is relative to the nearest scroll container, so without a vertical
   scrollbar on the wrap it never sticks. */
.table-wrap {
    overflow: auto;
    max-height: 70vh;
    border: 1px solid var(--border);
    border-radius: 8px;
    scrollbar-width: thin;
}
/* Overlay scrollbars hide until you drag — keep a slim one visible so a
   clipped table doesn't just look truncated. */
.table-wrap::-webkit-scrollbar { height: 10px; width: 10px; }
.table-wrap::-webkit-scrollbar-track { background: var(--surface-2); }
.table-wrap::-webkit-scrollbar-thumb { background: var(--faint, #c2c9d1); border-radius: 5px; border: 2px solid var(--surface-2); }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* separate, not collapse: collapsed borders detach from a sticky header and
   scroll away with the body, leaving the stuck row edgeless. */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }

th, td {
    text-align: left;
    padding: 9px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}
td.num, th.num { text-align: right; }
/* The wrap's own border already closes the box. */
tbody tr:last-child td { border-bottom: none; }
td.wrap { white-space: normal; min-width: 160px; }

th {
    background: var(--surface-2);
    color: var(--brand-blue-dark);
    font-weight: 600;
}
/* thead only — a bare `th` here would also pin tfoot totals rows to the top. */
/* theme.js adds .th-sort with position:relative to every heading; the extra
   selector outweighs it so stickiness survives the sort feature. */
thead th,
thead th.th-sort {
    position: sticky;
    top: 0;
    z-index: 2;
}

tr.voided-row td { color: var(--muted); text-decoration: line-through; }
tr:hover td { background: var(--surface-hover); }

.mini { color: var(--muted); font-weight: 400; font-size: 11px; }
.empty { color: var(--muted); font-style: italic; white-space: normal; }
.note { color: var(--muted); font-size: 12px; margin: 6px 0 0 0; }

/* ---------------- required / optional field pills ---------------- */
/* Required is now the norm on the intake form, so the pills mark BOTH states
   — an unmarked field would otherwise read as "probably optional". */
.req, .opt {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border-radius: 8px;
    padding: 1px 7px;
    margin-left: 6px;
    vertical-align: middle;
}
.req { background: var(--err-bg); color: var(--err-fg); }
.opt { background: var(--neutral-bg); color: var(--neutral-fg, #4b5563); }

/* ---------------- record type picker ---------------- */
.type-picker {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px 14px 14px;
    margin: 0;
    width: 100%;
    background: var(--surface-2);
}
.type-picker legend {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-blue-dark);
    padding: 0 6px;
}
.type-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    margin-top: 8px;
}
.type-option:hover { border-color: var(--brand-blue); }
.type-option input { accent-color: var(--brand-blue); margin-top: 3px; flex: none; }
.type-option span { display: flex; flex-direction: column; gap: 2px; }
.type-option strong { font-size: 14px; font-weight: 600; }
.type-option em { font-style: normal; font-size: 12px; color: var(--muted); }
/* :has lets the whole row light up from the radio inside it; browsers without
   it simply keep the default border, which is a cosmetic loss only. */
.type-picker:has(input[value="delivery"]:checked) .type-option:first-of-type,
.type-picker:has(input[value="bill"]:checked) .type-option:last-of-type {
    border-color: var(--brand-blue);
    background: var(--highlight);
}

/* [hidden] needs to beat the display:flex rules above it. */
[hidden] { display: none !important; }

/* ---------------- upload sections (invoice / manifest) ---------------- */
.upload-section {
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand-blue);
    border-radius: 10px;
    padding: 14px 16px 16px 16px;
    background: var(--surface-hover);
    width: 100%;
}
.upload-section[data-doc="manifest"] { border-left-color: var(--mint-dark); }
.upload-title {
    margin: 0 0 2px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-blue-dark);
}
.upload-section .note { margin: 0 0 10px 0; }

/* ---------------- filters ---------------- */
.filters {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.filter-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}
.filters select, .filters input[type=date] {
    padding: 7px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
}

.export-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: -4px 0 12px 0;
}
.export-row a {
    font-size: 12px;
    font-weight: 500;
    color: var(--brand-blue);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3px 10px;
    text-decoration: none;
}
.export-row a:hover { background: var(--highlight); border-color: var(--brand-blue); }

/* ---------------- status badges ---------------- */
.status-badge {
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    padding: 2px 9px;
    display: inline-block;
}
.status-badge.synced   { background: var(--ok-bg); color: var(--ok-fg); }
.status-badge.pending  { background: var(--warn-bg); color: var(--warn-fg); }
.status-badge.failed   { background: var(--err-bg); color: var(--err-fg); }
.status-badge.disabled { background: var(--neutral-bg); color: var(--neutral-fg, #4b5563); }

/* ---------------- actions / forms ---------------- */
.action-row {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.action-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.action-row .note { flex-basis: 100%; }

.picker-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.stacked-form { flex-direction: column; align-items: stretch; gap: 16px; width: 100%; max-width: 480px; }

.link-btn {
    background: none;
    border: none;
    color: var(--brand-blue);
    font-size: 12px;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}
.link-btn:hover { color: var(--brand-blue-dark); background: none; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}
.checkbox-label input[type=checkbox] { accent-color: var(--brand-blue); }

button {
    background: var(--brand-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
}
button:hover { background: var(--brand-blue-dark); }
button:disabled, button:disabled:hover { background: var(--disabled-bg); color: var(--muted); cursor: default; }
.btn-primary { background: var(--mint); color: #04321f; font-weight: 700; }
.btn-primary:hover { background: var(--mint-dark); color: #fff; }
.btn-secondary { background: var(--card-bg); color: var(--brand-blue); border: 1px solid var(--brand-blue); }
.btn-secondary:hover { background: var(--highlight); }
.btn-large { padding: 14px 20px; font-size: 16px; width: 100%; }

select, input[type=file] { font-size: 14px; font-family: inherit; padding: 8px; color: var(--text); }

select, input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], textarea {
    font-size: 15px;
    font-family: inherit;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 100%;
    background: var(--input-bg);
    color: var(--text);
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--brand-blue); }

.stacked-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    width: 100%;
}
.stacked-label .note { margin-top: 2px; }

.inline-form { display: inline-flex; }
.danger-link { color: var(--red); text-decoration: underline; }
.danger-link:hover { color: var(--red-hover); }

.back-link { margin: 0 0 4px 0; }
.back-link a { color: var(--brand-blue); font-size: 13px; text-decoration: none; }
.back-link a:hover { text-decoration: underline; }

/* ---------------- photo picker (new intake) ---------------- */
.photo-picker { display: flex; flex-direction: column; gap: 10px; }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-thumb { position: relative; width: 96px; height: 96px; }
.photo-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 8px; border: 1px solid var(--border);
}
.photo-thumb .page-num {
    position: absolute; top: -6px; left: -6px;
    background: var(--brand-blue); color: #fff;
    font-size: 11px; font-weight: 700;
    border-radius: 10px; padding: 1px 7px;
}
.photo-thumb .remove-btn {
    position: absolute; top: -8px; right: -8px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--red); color: #fff; border: 2px solid var(--card-bg);
    font-size: 13px; line-height: 1; padding: 0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.add-photo-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 96px; height: 96px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    background: var(--surface-hover);
    color: var(--brand-blue);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    gap: 4px;
}
.add-photo-btn:hover { border-color: var(--brand-blue); background: var(--highlight); }
.add-photo-btn .plus { font-size: 26px; line-height: 1; }

/* ---------------- totals ---------------- */
.totals-box {
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.adjusted-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-weight: 700;
    font-size: 18px;
    color: var(--brand-blue-dark);
}
.adjusted-total-row .amount { font-size: 22px; }

/* ---------------- intake detail photo gallery ---------------- */
.intake-photos { display: flex; flex-wrap: wrap; gap: 12px; }
.intake-photos a img {
    width: 160px; height: 160px; object-fit: cover;
    border-radius: 8px; border: 1px solid var(--border);
}

.stat-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 4px; }
.stat-box { text-align: left; }
.stat-box .stat-label { font-size: 12px; color: var(--muted); }
.stat-box .stat-value { font-size: 22px; font-weight: 700; color: var(--brand-blue-dark); }

/* ---------------- login page ---------------- */
.login-main { max-width: 420px; margin: 60px auto; padding: 0 16px; }
.login-card form { flex-direction: column; align-items: stretch; gap: 14px; }
.login-card .btn-primary { align-self: flex-start; }

.flash { padding: 10px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.flash-success { background: var(--ok-bg); color: var(--ok-fg); border: 1px solid var(--ok-border); }
.flash-error { background: var(--err-bg); color: var(--err-fg); border: 1px solid var(--err-border); }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }

@media (max-width: 700px) {
    main { margin-top: 12px; }
    .card { padding: 16px; }
    .bear-deco { display: none; }
    .header-inner { flex-wrap: wrap; }
    .header-text { border-left: none; padding-left: 0; }
    .stacked-form { max-width: 100%; }
    table { font-size: 12px; }
}


/* ======================= dark theme =======================
   Keyed only on [data-theme="dark"], with no prefers-color-scheme copy of
   this block: theme.js resolves the OS preference itself and stamps the
   attribute before first paint, so "follow my system" and "I picked dark"
   arrive here as the same selector and the tokens are written once. */
:root[data-theme="dark"] {
    color-scheme: dark;

    /* brand-blue-dark carries the "heading ink" role throughout this sheet,
       so on dark it has to become the LIGHTEST blue, not the darkest. */
    --brand-blue: #6f6eff;
    --brand-blue-dark: #a9a8ff;
    --mint: #00fda2;
    --mint-dark: #2fd9a0;
    --bg: #0d0f17;
    --card-bg: #151827;
    --surface-2: #1b1f31;
    --surface-hover: #1e2236;
    --input-bg: #0f1220;
    --border: #2b3049;
    --text: #e9ebf5;
    --muted: #9aa2bd;
    --faint: #4a5170;
    --green: #4ade80;
    --red: #ff7166;
    --red-hover: #ff9d95;
    --highlight: #232a4d;
    --disabled-bg: #262b41;

    --header-from: #0a0a52;
    --header-to: #2a29d6;
    --header-ink: #c8ccff;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);

    --ok-bg: #103028;
    --ok-fg: #5fe3b1;
    --ok-border: #1d5546;
    --err-bg: #3a1613;
    --err-fg: #ff9c92;
    --err-border: #6b2620;
    --warn-bg: #3a2f0c;
    --warn-fg: #ecc94b;
    --warn-border: #5c4a12;
    --neutral-bg: #232842;
    --neutral-fg: #9aa2bd;
}

/* btn-primary is mint in both themes, so its ink stays the dark green. */
:root[data-theme="dark"] .btn-primary { color: #04321f; }

/* ---------------- header menu ----------------
   Replaces the old row of links in the top-right corner. The trigger sits in
   the same place the links used to, so muscle memory survives; everything that
   was in that row is now inside the panel, plus a way back to the portal. */
.user-bar { position: relative; }

.nav-menu { position: relative; }

.nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 8px;
    padding: 7px 13px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.26); }
.nav-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Three bars drawn with a gradient rather than three elements, so the button
   markup stays a single span. */
.nav-bars {
    width: 17px;
    height: 11px;
    background: linear-gradient(to bottom,
        currentColor 0 2px, transparent 2px 4.5px,
        currentColor 4.5px 6.5px, transparent 6.5px 9px,
        currentColor 9px 11px);
}

.nav-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    min-width: 244px;
    display: flex;
    flex-direction: column;
    padding: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
    text-align: left;
}
.nav-panel[hidden] { display: none; }

.nav-who {
    padding: 9px 12px 10px 12px;
    font-size: 12px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 5px;
    white-space: normal;
    word-break: break-word;
}
.nav-who strong { color: var(--text); font-weight: 600; }

/* One rule for links, the theme button and the logout button so they can't
   drift apart visually — they're different elements doing the same job. */
.nav-panel .nav-item,
.nav-panel .nav-form button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border: none;
    border-radius: 7px;
    background: none;
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.35;
}
.nav-panel .nav-item:hover,
.nav-panel .nav-form button:hover {
    background: var(--highlight);
    color: var(--brand-blue-dark);
}
.nav-panel .nav-item:focus-visible,
.nav-panel .nav-form button:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: -2px;
}

.nav-panel .nav-home {
    font-weight: 700;
    color: var(--brand-blue);
}

.nav-sep {
    height: 1px;
    background: var(--border);
    margin: 5px 4px;
}

.nav-panel .nav-form { display: block; width: 100%; margin: 0; padding: 0; gap: 0; }
.nav-panel .nav-form button { color: var(--red); font-weight: 600; }
.nav-panel .nav-form button:hover { background: var(--err-bg); color: var(--red); }

/* The theme control keeps its own class for the login pages, where it floats
   on its own instead of living in a panel — so its panel styling has to win. */
.nav-panel .theme-toggle {
    background: none;
    border: none;
    border-radius: 7px;
}
.nav-panel .theme-toggle:hover { background: var(--highlight); color: var(--brand-blue-dark); }

.theme-toggle.floating {
    position: absolute;
    top: 14px;
    right: 20px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 20px;
    padding: 5px 13px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
}
.theme-toggle.floating:hover { background: rgba(255, 255, 255, 0.26); }

header { position: relative; }

@media (max-width: 700px) {
    /* On a phone the word is redundant next to the icon, and the panel should
       reach nearly edge to edge rather than hug the right margin. */
    .nav-toggle-text { display: none; }
    .nav-toggle { padding: 8px 10px; }
    .nav-panel { min-width: 0; width: min(84vw, 300px); }
}


/* ==================================================================
   HIRING APP ADDITIONS
   ------------------------------------------------------------------
   Everything above this line is the shared BluLight system, identical to
   intake, AP and pricing. The internal pages are meant to be
   indistinguishable from those apps, so they use it untouched.

   Below is only what this app adds: the public careers site, which has no
   equivalent elsewhere, and the handful of pipeline widgets. All of it is
   written in the tokens above, so the dark theme already covers it.
   ================================================================== */

/* ---------------- prose tables ----------------
   The SOP tables on /help hold paragraphs, and the shared `td` rule is
   `nowrap`, so each paragraph printed as ONE line: 2,500 px wide on a desktop
   and 3,100 on a phone. Only these tables wrap; data tables keep nowrap and
   sit in a .table-wrap that pans sideways instead. */
.prose-table th, .prose-table td { white-space: normal; overflow-wrap: anywhere; }
.prose-table td:first-child { vertical-align: top; }
@media (max-width: 700px) { .prose-table th[style*="width"] { width: 34% !important; } }

/* ---------------- layout helper ---------------- */
.wrap { max-width: 940px; margin: 0 auto; padding: 0 20px 48px; width: 100%; }
.wrap.narrow { max-width: 620px; }
.wrap.wide { max-width: 1240px; }

/* ---------------- public careers site ----------------
   The wordmark is mint and white, drawn to sit on a blue field, so this
   masthead is always the brand gradient, never a light-theme white bar. */
.masthead { background: linear-gradient(105deg, var(--header-from), var(--header-to));
    color: #fff; padding: 0; margin: 0; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between;
    gap: 16px; min-height: 76px; padding-bottom: 0; }
.masthead a { color: #fff; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; }
.masthead .tagline { font-size: 13px; color: var(--header-ink); letter-spacing: .02em; }
.masthead .brand-logo { height: 34px; width: auto; display: block; }

/* The bear is a whole character holding a sign, so it needs real vertical
   room. In a slim masthead it gets clipped and reads as a broken image. */
.hero { padding: 56px 0 40px; display: flex; align-items: center; gap: 32px; }
.hero-copy { flex: 1 1 auto; min-width: 0; }
.hero h1 { font-size: 34px; margin: 0 0 8px; letter-spacing: -.02em; color: var(--text); }
.hero p.sub { color: var(--muted); margin: 0 0 24px; font-size: 17px; }
.hero p:last-child { margin-bottom: 0; }
.hero .bear-deco { flex: 0 0 auto; height: 190px; width: auto; margin: 0; }
@media (max-width: 760px) { .hero { display: block; } .hero .bear-deco { display: none; } }

.role { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 22px; margin: 0 0 16px; box-shadow: var(--shadow); }
.role h2 { margin: .2rem 0 .4rem; font-size: 20px; color: var(--brand-blue-dark); }
.role ul { margin: .6rem 0 1rem; padding-left: 1.1rem; color: var(--muted); }
.role li { margin: .25rem 0; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tag { background: var(--highlight); color: var(--brand-blue); border-radius: 999px;
    padding: 3px 10px; font-size: 12px; font-weight: 600; }

.site-footer { padding: 36px 20px; color: var(--muted); font-size: 13px;
    border-top: 1px solid var(--border); margin-top: 40px; }
.site-footer a { color: var(--brand-blue); }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0; }
.steps li { counter-increment: s; padding: 0 0 0 38px; position: relative; margin: 0 0 14px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px;
    border-radius: 50%; background: var(--highlight); color: var(--brand-blue); font-weight: 700;
    display: flex; align-items: center; justify-content: center; font-size: 13px; }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 21px; font-weight: 700;
    letter-spacing: .06em; background: var(--highlight); color: var(--brand-blue);
    padding: 10px 16px; border-radius: 8px; display: inline-block; }
.legal { color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ---------------- application form ---------------- */
.field { margin: 0 0 18px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choice { flex: 1 1 150px; border: 1px solid var(--border); border-radius: 8px; padding: 12px;
    background: var(--card-bg); cursor: pointer; display: flex; gap: 9px; align-items: flex-start; }
.choice input { margin-top: 3px; width: auto; }
.choice.sel { border-color: var(--brand-blue); background: var(--highlight); }

/* ---------------- buttons ----------------
   This app's markup uses .btn; it has to look like the shared .btn-primary,
   which is mint in both themes. */
.btn { display: inline-block; background: var(--mint); color: #04321f; text-decoration: none;
    border: 0; padding: 11px 18px; border-radius: 6px; font-weight: 700; font-size: 15px;
    font-family: inherit; cursor: pointer; line-height: 1.2; }
.btn:hover { background: var(--mint-dark); color: #fff; }
.btn.ghost { background: var(--card-bg); color: var(--brand-blue);
    border: 1px solid var(--brand-blue); font-weight: 600; }
.btn.ghost:hover { background: var(--highlight); color: var(--brand-blue); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { background: var(--red-hover); color: #fff; }

/* ---------------- pipeline widgets ---------------- */
.h-sub { color: var(--muted); margin: .2rem 0 18px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.stagebar { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.stagebar a { flex: 1 1 120px; text-decoration: none; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; color: var(--text); }
.stagebar a:hover { border-color: var(--brand-blue); }
.stagebar a.on { border-color: var(--brand-blue); background: var(--highlight); }
.stagebar .n { font-size: 25px; font-weight: 700; line-height: 1.1; }
.stagebar .l { color: var(--muted); font-size: 13px; }

.pill { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.pill.new       { background: var(--highlight);  color: var(--brand-blue); }
.pill.screening { background: var(--warn-bg);    color: var(--warn-fg); }
.pill.interview { background: var(--highlight);  color: var(--brand-blue); }
.pill.offer     { background: var(--ok-bg);      color: var(--ok-fg); }
.pill.badging   { background: var(--warn-bg);    color: var(--warn-fg); }
.pill.badged    { background: var(--ok-bg);      color: var(--ok-fg); }
.pill.rejected  { background: var(--neutral-bg); color: var(--neutral-fg, #4b5563); }
.pill.yes       { background: var(--ok-bg);      color: var(--ok-fg); }
.pill.not_sure  { background: var(--warn-bg);    color: var(--warn-fg); }
.pill.no        { background: var(--err-bg);     color: var(--err-fg); }

.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.bar input[type=text], .bar select { width: auto; min-width: 150px; }
.selbar { background: var(--highlight); border: 1px solid var(--brand-blue); border-radius: 8px;
    padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0;
    position: sticky; top: 8px; z-index: 5; }
/* The 4b rule: a class that sets display defeats the hidden attribute. */
.selbar[hidden] { display: none; }
.quickpick { display: inline-flex; gap: 6px; align-items: center; }
.quickpick input[type=number] { width: 64px; min-width: 64px; padding: 4px 6px; }

.cols { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
/* A grid item's min-width defaults to its content, so one nowrap table or a
   row of stage buttons inside a column widened the whole page on a phone
   (/leavers/<id> +281px, /applicant/<id> +187px at 375). min-width: 0 lets the
   column shrink and the .table-wrap inside it pan instead. */
.cols > * { min-width: 0; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

.kv { margin: 0; }
.kv dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; margin-top: 12px; }
.kv dd { margin: 2px 0 0; font-weight: 500; }

.track { list-style: none; padding: 0; margin: 0; }
.track li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0;
    border-bottom: 1px solid var(--border); }
.track li:last-child { border-bottom: 0; }
.track .mark { width: 22px; height: 22px; border-radius: 50%; flex: 0 0 22px;
    border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
    font-size: 11px; margin-top: 2px; }
.track .mark.done { background: var(--green); border-color: var(--green); color: #fff; }
.track .t { font-weight: 600; }
.track .h { color: var(--muted); font-size: 13px; }

.timeline { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed var(--border); color: var(--muted); }
.timeline li:last-child { border-bottom: 0; }
.timeline b { color: var(--text); }

/* theme.js wraps the header logo in this so it returns to the portal. */
.brand-logo-link { display: inline-flex; text-decoration: none; }
.brand-logo-link:hover { opacity: .85; }

/* theme.js drops this in at the top of <main> on any sub-page, so there is
   always a visible way back to the app's own main screen — never buried in the
   menu. It is a link styled as a button: middle-click and "open in new tab"
   keep working, which they would not on a <button> with a click handler. */
.app-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 16px 0;
    padding: 8px 15px;
    border: 1px solid var(--border, #dde5ea);
    border-radius: 8px;
    background: var(--card-bg, #fff);
    color: var(--brand-blue, #1211f8);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
}
.app-back:hover {
    border-color: var(--brand-blue, #1211f8);
    background: var(--highlight, #eef0ff);
}

/* theme.js makes every table heading clickable to sort. The arrow only appears
   on the active column — showing a hint on all of them turns the header row
   into noise. */
th.th-sort { cursor: pointer; user-select: none; position: relative; padding-right: 20px; }
th.th-sort:hover { color: var(--brand-blue, #1211f8); }
th.th-sort:focus-visible { outline: 2px solid var(--brand-blue, #1211f8); outline-offset: -2px; }
th.th-sort::after {
    content: "";
    position: absolute;
    right: 7px;
    top: 50%;
    margin-top: -2px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0;
}
th.th-sort-asc::after  { border-bottom: 5px solid currentColor; opacity: .8; }
th.th-sort-desc::after { border-top: 5px solid currentColor; opacity: .8; }

/* ---- collapsible cards (theme.js) ---- */
.card-head { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 9px; }
.card-toggle {
    flex: none;
    width: 20px; height: 20px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    color: inherit;
    position: relative;
}
/* A chevron drawn from a rotated border, so there is no icon font to load. */
.card-toggle::before {
    content: "";
    position: absolute;
    left: 5px; top: 5px;
    width: 7px; height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .15s ease;
}
.card-closed .card-toggle::before { transform: rotate(-45deg); }
.card-closed > h2 { margin-bottom: 0; }
.card-toggle:focus-visible { outline: 2px solid var(--brand-blue, #1211f8); outline-offset: 2px; border-radius: 4px; }


/* ------------------------------------------------------------ help bot
   A quiet corner assistant, not a panel that sits on top of the page.

   Sized deliberately: 19rem wide and capped at 60% of the viewport height, so
   on a laptop it occupies a corner and leaves the tiles and tables readable
   behind it. The first version was 23rem x 30rem and covered half the
   dashboard, which is why nobody would have used it twice. */
.bl-ai-launcher {
    position: fixed; right: 1.15rem; bottom: 1.15rem; z-index: 60;
    width: 2.6rem; height: 2.6rem; border-radius: 50%; border: none;
    display: grid; place-items: center; cursor: pointer; padding: 0;
    background: var(--accent, #1668dc); color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.2), 0 8px 22px rgba(22,104,220,.28);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.bl-ai-launcher svg { width: 1.15rem; height: 1.15rem; display: block; }
.bl-ai-launcher:hover { transform: translateY(-1px); }
.bl-ai-launcher:active { transform: translateY(0); }
.bl-ai-launcher:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
/* While the panel is open the launcher would just be a second close button. */
.bl-ai-launcher[aria-expanded="true"] { opacity: 0; pointer-events: none; }

.bl-ai-panel {
    position: fixed; right: 1.15rem; bottom: 1.15rem; z-index: 61;
    width: min(19rem, calc(100vw - 2.3rem));
    max-height: min(24rem, 60vh);
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: 14px;
    background: var(--card-bg, #fff);
    color: var(--text, #1a1a1a);
    border: 1px solid var(--border, rgba(127,127,127,.22));
    box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 12px 34px rgba(0,0,0,.30);
    transform-origin: bottom right;
    animation: bl-ai-in .16s ease-out;
}
@keyframes bl-ai-in {
    from { opacity: 0; transform: translateY(6px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .bl-ai-panel { animation: none; } }

.bl-ai-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .5rem; padding: .55rem .5rem .55rem .8rem;
    border-bottom: 1px solid var(--border, rgba(127,127,127,.16));
    font: 600 .7rem/1 Poppins, system-ui, sans-serif;
    letter-spacing: .09em; text-transform: uppercase; opacity: .75;
}
.bl-ai-close {
    background: none; border: none; color: inherit; cursor: pointer;
    width: 1.6rem; height: 1.6rem; border-radius: 6px; display: grid;
    place-items: center; font-size: 1.05rem; line-height: 1; opacity: .7;
}
.bl-ai-close:hover { opacity: 1; background: rgba(127,127,127,.14); }

.bl-ai-log {
    flex: 1; overflow-y: auto; padding: .7rem .8rem;
    display: flex; flex-direction: column; gap: .45rem;
    scrollbar-width: thin;
}
.bl-ai-msg {
    margin: 0; font-size: .82rem; line-height: 1.45; white-space: pre-wrap;
    padding: .45rem .6rem; border-radius: 10px; max-width: 92%;
    overflow-wrap: anywhere;
}
.bl-ai-bot {
    align-self: flex-start;
    background: rgba(127,127,127,.13);
    border-bottom-left-radius: 4px;
}
.bl-ai-you {
    align-self: flex-end; color: #fff;
    background: var(--accent, #1668dc);
    border-bottom-right-radius: 4px;
}
.bl-ai-you::before { content: none; }      /* the alignment says who spoke */
.bl-ai-err {
    align-self: flex-start;
    background: rgba(192,57,43,.14);
    color: var(--danger, #c0392b);
    border-bottom-left-radius: 4px;
}
.bl-ai-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.bl-ai-you a { color: #fff; }

.bl-ai-form {
    display: flex; align-items: center; gap: .4rem;
    padding: .55rem .6rem .65rem;
    border-top: 1px solid var(--border, rgba(127,127,127,.16));
}
.bl-ai-input {
    flex: 1; min-width: 0; padding: .42rem .6rem; border-radius: 999px;
    border: 1px solid var(--border, rgba(127,127,127,.3));
    background: var(--input-bg, rgba(127,127,127,.08));
    color: inherit; font: 400 .82rem Poppins, system-ui, sans-serif;
}
.bl-ai-input:focus { outline: none; border-color: var(--accent, #1668dc); }
.bl-ai-send {
    flex: none; width: 1.9rem; height: 1.9rem; border: none; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer; padding: 0;
    background: var(--accent, #1668dc); color: #fff;
}
.bl-ai-send svg { width: .85rem; height: .85rem; display: block; }
.bl-ai-send:disabled { opacity: .45; cursor: default; }

/* Phones: full width with a margin, and shorter so the keyboard fits. */
@media (max-width: 30rem) {
    .bl-ai-panel { right: .6rem; left: .6rem; bottom: .6rem;
                   width: auto; max-height: 62vh; }
    .bl-ai-launcher { right: .8rem; bottom: .8rem; }
}
@media print { .bl-ai-launcher, .bl-ai-panel { display: none !important; } }

/* The `hidden` attribute only hides an element via the browser's own
   `[hidden] { display: none }` rule, which ANY author rule that sets `display`
   outranks. `.bl-ai-panel` sets `display: flex`, so `panel.hidden = true` set
   the attribute and changed nothing on screen: the assistant could be opened
   and never closed, and was in fact showing on every page from load. Same
   one-line fix `.nav-panel[hidden]` already carries above. */
.bl-ai-panel[hidden] { display: none !important; }


/* ---------------------------------------------------------------- notes box
   The rich-text notes on an applicant. Formatting tags only - the server
   allowlist (richtext.py) drops every attribute, so anything styled inline
   would be thrown away on save. Style the TAGS here instead. */
/* This app styles every <form> as a flex row, which laid the toolbar, the
   editor and the Save button out side by side. The notes form is a normal
   block; say so rather than fighting it child by child. */
#note-form { display: block; }
#note-form > * { width: auto; }

.note-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 6px; margin-bottom: 8px;
  border: 1px solid var(--line, rgba(255,255,255,.14));
  border-radius: 8px 8px 0 0;
  background: rgba(255,255,255,.04);
}
.note-tools button {
  min-width: 34px; height: 30px; padding: 0 8px;
  font: inherit; font-size: .9rem; line-height: 1;
  color: inherit; cursor: pointer;
  background: transparent;
  border: 1px solid transparent; border-radius: 6px;
}
.note-tools button:hover { background: rgba(255,255,255,.10); }
.note-tools button:active { transform: translateY(1px); }
.note-tools button:focus-visible { outline: 2px solid var(--accent, #7c8cff); outline-offset: 1px; }
.note-tools mark { padding: 0 3px; border-radius: 3px; }
.note-sep {
  width: 1px; height: 20px; margin: 0 4px;
  background: var(--line, rgba(255,255,255,.18));
}

.note-editor {
  width: 100%; box-sizing: border-box;
  min-height: 150px; max-height: 460px; overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--line, rgba(255,255,255,.14));
  border-radius: 0 0 8px 8px;
  background: rgba(0,0,0,.18);
  line-height: 1.55;
  /* A long pasted URL must not push the card wider than the page. */
  overflow-wrap: anywhere;
}
.note-editor:focus { outline: none; border-color: var(--accent, #7c8cff); }
/* :empty alone fails - an empty contenteditable still holds a <br>. */
.note-editor:empty::before {
  content: attr(data-placeholder);
  opacity: .45;
}
.note-editor mark {
  /* Fixed colours on purpose: highlight has to stay legible in both themes,
     and the tag carries no attribute to theme it with. */
  background: #ffe066; color: #1a1a1a; padding: 0 2px; border-radius: 2px;
}
.note-editor ul, .note-editor ol { margin: .4rem 0 .4rem 1.4rem; }
.note-editor li { margin: .15rem 0; }
.note-editor p { margin: 0 0 .5rem; }
.note-editor blockquote {
  margin: .5rem 0; padding-left: .75rem;
  border-left: 3px solid var(--line, rgba(255,255,255,.2)); opacity: .9;
}

.note-foot {
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px; flex-wrap: wrap;
}
.note-status { font-size: .85rem; opacity: .75; }
.note-status.ok   { color: var(--good, #35d07f); opacity: 1; }
.note-status.warn { color: #ffc53d; opacity: 1; }
.note-status.bad  { color: var(--bad, #ff6b6b); opacity: 1; }
#note-save[disabled] { opacity: .45; cursor: default; }

/* ------------------------------------------------------- floating notes
   The notes editor rides in a fixed bubble instead of sitting in the page
   flow, so it can be opened from anywhere on a long record. Bottom-LEFT:
   the help bot already owns the bottom-right corner. */
.notes-launcher {
  position: fixed; left: 1.15rem; bottom: 1.15rem; z-index: 60;
  width: 2.6rem; height: 2.6rem; border-radius: 50%; border: none;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  background: var(--mint); color: #04321f;
  box-shadow: 0 2px 6px rgba(0,0,0,.2), 0 8px 22px rgba(0,0,0,.22);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.notes-launcher svg { width: 1.15rem; height: 1.15rem; display: block; }
.notes-launcher:hover { transform: translateY(-1px); }
.notes-launcher:active { transform: translateY(0); }
.notes-launcher:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
/* While the panel is open the launcher would just be a second close button. */
.notes-launcher[aria-expanded="true"] { opacity: 0; pointer-events: none; }

/* The dot on the bubble. Blue means "this record has notes — open before the
   interview"; the .unsaved amber overrides it while anything typed here has
   not reached the server, because the panel may be closed while dirty and the
   bubble is then the only thing on screen that can say so. */
.notes-dot {
  position: absolute; top: -1px; right: -1px;
  width: .7rem; height: .7rem; border-radius: 50%;
  background: var(--brand-blue, #1211f8); border: 2px solid var(--card-bg, #fff);
}
.notes-dot.unsaved { background: #ffc53d; }

.notes-panel {
  position: fixed; left: 1.15rem; bottom: 1.15rem; z-index: 61;
  width: min(27rem, calc(100vw - 2.3rem));
  max-height: min(36rem, 76vh);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 14px;
  background: var(--card-bg, #fff);
  color: var(--text, #1a1a1a);
  border: 1px solid var(--border, rgba(127,127,127,.22));
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 12px 34px rgba(0,0,0,.30);
  transform-origin: bottom left;
  animation: bl-ai-in .16s ease-out;
}
@media (prefers-reduced-motion: reduce) { .notes-panel { animation: none; } }

.notes-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding: .55rem .5rem .55rem .8rem;
  border-bottom: 1px solid var(--border, rgba(127,127,127,.16));
  font: 600 .7rem/1 Poppins, system-ui, sans-serif;
  letter-spacing: .09em; text-transform: uppercase; opacity: .75;
}
.notes-close {
  background: none; border: none; color: inherit; cursor: pointer;
  width: 1.6rem; height: 1.6rem; border-radius: 6px; display: grid;
  place-items: center; font-size: 1.05rem; line-height: 1; opacity: .7;
}
.notes-close:hover { opacity: 1; background: rgba(127,127,127,.14); }

.notes-body { flex: 1; overflow-y: auto; padding: .8rem; }
/* Starts compact so the toolbar and Save stay reachable, and resizes: the
   corner grip lets a long note be pulled taller, up to most of the screen.
   Vertical only - the panel's width is fixed, so widening would overflow it. */
.notes-panel .note-editor {
  min-height: 110px; height: 200px; max-height: 60vh;
  resize: vertical;
}

/* Phones: full width with a margin, same treatment as the help bot. */
@media (max-width: 30rem) {
  .notes-panel { left: .6rem; right: .6rem; bottom: .6rem;
                 width: auto; max-height: 70vh; }
  .notes-launcher { left: .8rem; bottom: .8rem; }
}
@media print { .notes-launcher, .notes-panel { display: none !important; } }

/* Same trap as .bl-ai-panel below the help-bot styles: this panel sets
   `display: flex`, which outranks the browser's own `[hidden]` rule, so the
   attribute alone would not hide it. Every floating panel needs this line. */
.notes-panel[hidden] { display: none !important; }

/* ------------------------------------------------------------------------
   AI SCREENING (screen.py). The match pills, the read card on the applicant
   record, and the prev/next walk. Tier colors reuse the estate tokens so the
   dark theme needs nothing extra. */
.pill.ai-strong   { background: var(--ok-bg);      color: var(--ok-fg); }
.pill.ai-possible { background: var(--warn-bg);    color: var(--warn-fg); }
.pill.ai-weak     { background: var(--neutral-bg); color: var(--neutral-fg, #4b5563); }

.ai-bar { align-items: center; font-size: .9rem; }

.ai-flags { margin-top: 10px; padding: 8px 12px; border-radius: 8px;
            background: var(--err-bg); color: var(--err-fg); font-size: .9rem; }
.ai-flags div + div { margin-top: 4px; }

.ai-quals { list-style: none; margin: 8px 0 0; padding: 0; }
.ai-quals li { display: flex; gap: 8px; padding: 4px 0; align-items: baseline; }
.q-mark { flex: 0 0 1.2em; text-align: center; font-weight: 700; }
.q-yes .q-mark     { color: var(--ok-fg); }
.q-no .q-mark      { color: var(--err-fg); }
.q-unclear .q-mark { color: var(--muted); }

.ai-cols { display: flex; gap: 24px; flex-wrap: wrap; }
.ai-cols > div { flex: 1 1 220px; }

/* The record-to-record walk. A dead end renders as a disabled-looking span
   rather than vanishing, so the buttons stay where the thumb learnt they are. */
.rec-nav { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; flex-wrap: wrap; }
.rec-nav .isoff { opacity: .45; cursor: default; }

/* ------------------------------------------------------------------------
   THE CANDIDATE JOURNEY (onboard_done.html). The gamified "road to the sales
   floor": a progress bar the bear walks along, animated check-ins per step,
   and the fingerprinting codes as one-tap copy chips. All tokens, so it
   holds in both themes; all motion behind prefers-reduced-motion. */
.j-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.j-count { font-size: .85rem; color: var(--muted); font-weight: 600; }

.j-bar { position: relative; height: 12px; border-radius: 999px;
         background: var(--neutral-bg, rgba(128,128,128,.18));
         margin: 26px 0 22px; overflow: visible; }
.j-fill { height: 100%; border-radius: 999px; background: var(--green, #19c37d);
          transition: width .9s cubic-bezier(.22, 1, .36, 1); }
.j-bear { position: absolute; bottom: 3px; width: 46px; height: auto;
          filter: drop-shadow(0 2px 3px rgba(0,0,0,.35));
          transition: left .9s cubic-bezier(.22, 1, .36, 1); }

.j-steps { list-style: none; margin: 0; padding: 0; }
.j-step { display: flex; gap: 14px; position: relative; padding: 0 0 22px; }
.j-step:last-child { padding-bottom: 0; }
.j-step::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px;
                  width: 2px; background: var(--line); }
.j-step:last-child::before { display: none; }
.j-step.is-done::before { background: var(--green, #19c37d); }

.j-dot { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
         display: flex; align-items: center; justify-content: center;
         border: 2px solid var(--line); background: var(--card-bg, transparent);
         position: relative; z-index: 1; }
.is-done .j-dot { background: var(--green, #19c37d); border-color: var(--green, #19c37d);
                  color: #fff; }
.is-current .j-dot { border-color: var(--green, #19c37d); }
.is-todo .j-dot, .is-todo .j-label { opacity: .55; }
.j-dot svg { width: 15px; height: 15px; }
.j-check { stroke-dasharray: 20; stroke-dashoffset: 20;
           animation: j-draw .5s ease-out forwards; }
@keyframes j-draw { to { stroke-dashoffset: 0; } }
.j-pulse { width: 10px; height: 10px; border-radius: 50%;
           background: var(--green, #19c37d); animation: j-beat 1.6s ease-in-out infinite; }
@keyframes j-beat {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(25, 195, 125, .45); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 7px rgba(25, 195, 125, 0); }
}

.j-body { flex: 1; min-width: 0; }
.j-label { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.j-tag { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
         padding: 2px 8px; border-radius: 999px; }
.j-tag.done-tag { background: var(--ok-bg, rgba(25,195,125,.15)); color: var(--ok-fg, #19c37d); }
.j-tag.now-tag { background: var(--highlight, rgba(90,110,255,.18)); color: var(--brand-blue, #7f8dff);
                 animation: j-beat 1.6s ease-in-out infinite; }
.j-note { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.j-cta { display: inline-block; margin-top: 10px; text-decoration: none; }
.j-hint { font-size: .8rem; color: var(--muted); margin-top: 7px; }

.j-codes { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.code-chip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
             border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.code-k { font-size: .72rem; font-weight: 700; letter-spacing: .06em;
          text-transform: uppercase; color: var(--muted); flex: 0 0 auto; }
.code-v { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem;
          font-weight: 700; letter-spacing: .08em; flex: 1 1 auto; user-select: all; }
.copy-btn { border: 1px solid var(--line); background: transparent; color: inherit;
            border-radius: 8px; padding: 6px 14px; font-weight: 600; cursor: pointer;
            font-size: .85rem; }
.copy-btn:hover { border-color: var(--green, #19c37d); }
.copy-btn.copied { background: var(--green, #19c37d); border-color: var(--green, #19c37d);
                   color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .j-fill, .j-bear { transition: none; }
  .j-check { animation: none; stroke-dashoffset: 0; }
  .j-pulse, .j-tag.now-tag { animation: none; }
}

/* The reimbursement banner on the candidate journey: the one money fact that
   must never be missed — everything is reimbursed, keep every receipt. */
.j-money { border-left: 3px solid var(--green, #19c37d);
           background: var(--ok-bg, rgba(25,195,125,.12));
           border-radius: 0 10px 10px 0; padding: 10px 14px;
           font-size: .9rem; margin: 0 0 20px; }

/* Two-location fingerprints on the candidate portal — each shop its own
   sub-card in the fingerprints step. */
.fp-loc { border:1px solid var(--line,#2b3049); border-radius:10px; padding:12px 14px; margin:10px 0; }
.fp-loc.fp-done { border-color: var(--green,#19c37d); }
.fp-loc.fp-here { border-color: var(--brand-blue,#6f6eff); }
.fp-loc.fp-lock { opacity:.6; }
.fp-loc-head { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:4px; }


/* New-hire checklist (checklist.py, _checklist.html, new_hires.html) */
.cl-plan { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0 4px; }
.cl-plan > div { flex: 1 1 140px; min-width: 0; }
.cl-plan > div:last-child { flex: 0 0 auto; }
.cl-phase { font-size: .95rem; margin: 18px 0 6px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cl-phase .muted { font-weight: 400; font-size: .82rem; }
.cl-items li { align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.cl-overdue { color: var(--err-fg); }
.cl-ticks { display: inline-flex; gap: 6px; margin: 0; flex: 0 0 auto; }
.cl-act { margin: 6px 0 0; display: inline-flex; }
.cl-auto { font-size: .8rem; flex: 0 0 auto; }
.cl-note { font-size: .8rem; }
.given-note { font-size: .8rem; color: var(--ok-fg); margin-top: 2px; }
.nh-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.nh-form input, .nh-form select { width: auto; min-width: 0; }
.nh-table td { white-space: normal; vertical-align: middle; }
.nh-table th:first-child { width: 28%; }
@media (max-width: 760px) {
    .nh-form input, .nh-form select { flex: 1 1 130px; }
    .cl-ticks { flex-basis: 100%; padding-left: 32px; }
    /* One card per person on a phone: the checklist column was off the edge. */
    .nh-table thead { display: none; }
    .nh-table tr, .nh-table td { display: block; width: auto; }
    .nh-table td { border: 0; padding: 6px 12px; }
    .nh-table tr { border-bottom: 1px solid rgba(127, 127, 127, .25); padding: 6px 0; }
}

/* ============================== EDGE LAYOUT (shared frame) ==============================
   2026-10-12. Mihir asked for the Guest Reviews frame on this app too: a top
   bar (logo, app name, the account avatar) and a left sidebar holding the
   pages. The rules below are COPIED from blulight-reviews-app's EDGE LAYOUT
   block; change the look there first and copy it here. Class selectors only,
   so the element rules above (header, main, footer) keep serving the
   signed-out pages. Every colour is a token, so dark mode needs nothing.
   The pages themselves are untouched: <main> still carries this app's own
   width and padding inside .rv-body. */
body.rv-app { background: var(--bg); }
.rv-top {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 14px;
    height: 64px; padding: 0 20px;
    background: var(--card-bg); border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.rv-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.rv-brand .brand-logo-link { display: flex; }
.rv-logo { height: 34px; width: auto; }
.logo-when-dark { display: none; }
:root[data-theme="dark"] .logo-when-light { display: none; }
:root[data-theme="dark"] .logo-when-dark { display: block; }
.rv-tag { color: var(--brand-blue); font-weight: 600; font-size: 15px; white-space: nowrap; }
:root[data-theme="dark"] .rv-tag { color: #c9ccff; }
.rv-search, .rv-loc { display: flex; align-items: center; margin: 0; }
.rv-search { margin-left: auto; position: relative; }
.rv-field { position: relative; display: block; margin: 0; }
.rv-field > span {
    position: absolute; top: -8px; left: 10px; padding: 0 4px;
    font-size: 11px; color: var(--muted); background: var(--card-bg); line-height: 1;
    pointer-events: none;
}
.rv-field input, .rv-field select {
    height: 40px; border: 1px solid var(--border); border-radius: 6px;
    padding: 0 12px; font: inherit; font-size: 14px; background: var(--card-bg); color: var(--text);
}
.rv-search input { width: 220px; padding-right: 38px; }
.rv-loc select { width: 230px; }
.rv-icon-btn {
    position: absolute; right: 4px; top: 4px; height: 32px; width: 32px;
    padding: 0; display: flex; align-items: center; justify-content: center;
    background: none; color: var(--muted); border: 0;
}
.rv-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.rv-top .user-bar { width: auto; margin: 0; flex: none; max-width: none; color: var(--muted); }
.rv-top .user-bar a, .rv-top .user-bar .light-link { color: var(--brand-blue); }
.rv-burger {
    display: none; background: none; border: 0; color: var(--text); padding: 6px;
    height: 40px; width: 40px; align-items: center; justify-content: center;
}
.rv-burger:hover { background: var(--surface-2); }
.rv-shell { display: flex; min-height: calc(100vh - 64px); }
.rv-side {
    width: 272px; flex: none; padding: 12px 10px 40px; overflow-y: auto;
    background: var(--card-bg); border-right: 1px solid var(--border);
    position: sticky; top: 64px; height: calc(100vh - 64px);
}
.rv-item, .rv-group > summary {
    display: flex; align-items: center; gap: 14px; padding: 11px 14px;
    border-radius: 8px; color: var(--text); text-decoration: none;
    font-weight: 600; font-size: 15px; cursor: pointer; list-style: none;
}
.rv-group > summary::-webkit-details-marker { display: none; }
.rv-item:hover, .rv-group > summary:hover { background: var(--surface-2); }
.rv-item.rv-on { background: var(--highlight); color: var(--brand-blue); }
.rv-ic { display: flex; color: var(--muted); }
.rv-on .rv-ic { color: var(--brand-blue); }
.rv-label { flex: 1; }
.rv-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
    background: #e53935; color: #fff; font-size: 12px; font-weight: 600; margin-left: 6px;
}
.rv-chev { display: flex; color: var(--muted); transition: transform .15s; }
.rv-group[open] > summary .rv-chev { transform: rotate(180deg); }
.rv-subs { display: flex; flex-direction: column; padding: 2px 0 8px 48px; }
.rv-sub {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 12px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 14px;
}
.rv-sub:hover { background: var(--surface-2); }
.rv-sub.rv-on { background: var(--highlight); color: var(--brand-blue); font-weight: 600; }
.rv-send {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 10px 4px; padding: 9px 12px; border-radius: 8px;
    background: var(--brand-blue); color: #fff !important; text-decoration: none;
    font-weight: 600; font-size: 14px; letter-spacing: .5px;
    box-shadow: 0 2px 6px rgba(18, 17, 248, .25);
}
.rv-send:hover, .rv-send.rv-on { background: var(--brand-blue-dark); }
.rv-rule { height: 1px; background: var(--border); margin: 12px 8px; }
.rv-scrim { display: none; }
.rv-main { flex: 1; min-width: 0; max-width: none; margin: 0; padding: 18px 28px 60px; }
.rv-crumbs { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.rv-crumbs a { color: var(--muted); text-decoration: none; }
.rv-crumbs a:hover { color: var(--brand-blue); }
.rv-crumbs b { color: var(--text); font-weight: 500; }
.rv-h1 { font-size: 28px; font-weight: 500; margin: 0 0 4px; color: var(--text); }
.rv-lede { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.rv-more { color: var(--brand-blue); font-weight: 600; font-size: 13px; letter-spacing: .5px; text-decoration: none; }
.rv-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rv-grid-2 > * { min-width: 0; }
@media (max-width: 1100px) {
    .rv-search input { width: 160px; }
    .rv-loc select { width: 170px; }
}
@media (max-width: 900px) {
    .rv-burger { display: flex; }
    .rv-tag { display: none; }
    .rv-search, .rv-loc { display: none; }
    .rv-top .user-bar { margin-left: auto; }
    .rv-side {
        position: fixed; left: 0; top: 64px; z-index: 60; height: calc(100vh - 64px);
        transform: translateX(-100%); transition: transform .18s ease;
        box-shadow: none; visibility: hidden;
        transition: transform .18s ease, visibility 0s linear .18s;
    }
    body.rv-side-open .rv-side {
        transform: none; visibility: visible; transition: transform .18s ease;
        box-shadow: 4px 0 16px rgba(0, 0, 0, .12);
    }
    .rv-scrim:not([hidden]) {
        display: block; position: fixed; inset: 64px 0 0 0; z-index: 55;
        background: rgba(0, 0, 0, .3);
    }
    .rv-main { padding: 12px 14px 60px; }
    .rv-grid-2 { grid-template-columns: 1fr; }
    /* The two filters live in the drawer on a phone. */
    body.rv-side-open .rv-search, body.rv-side-open .rv-loc { display: none; }
}

/* ---- this app's pages inside the frame (not in Reviews) ---- */
.rv-gap { flex: 1; }
.rv-gap ~ .rv-search { margin-left: 0; }
a.rv-tag { text-decoration: none; }
a.rv-tag:hover { text-decoration: underline; }
.rv-brand .brand-logo-link { display: flex; align-items: center; }
.rv-body { flex: 1; min-width: 0; }
.rv-pagehead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin: 0 0 12px; }
.rv-pagehead .rv-crumbs, .rv-pagehead .rv-lede, .rv-pagehead .rv-h1 { margin: 0; }
.rv-pagehead .rv-crumbs { font-size: 15px; color: var(--text); font-weight: 500; }
.rv-foot { margin: 0; padding: 0 16px 28px; text-align: center; font-size: 12px; color: var(--muted); }
.rv-side form { margin: 0; }
@media (max-width: 900px) {
    .rv-gap ~ .user-bar { margin-left: 0; }
}
/* ============================ END EDGE LAYOUT (shared frame) ============================ */
