/* ==========================================================================================
   ATS V4 design system
   Pine (primary action, progress) · Saffron (needs attention) · stage colours carry pipeline meaning.
   Light and dark themes are driven entirely by the tokens below.
   ========================================================================================== */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../lib/inter/inter-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../lib/inter/inter-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
    --ink: #17212b;
    --ink-2: #3a4754;
    --muted: #66727f;
    --subtle: #98a3ae;
    --bg: #f3f5f4;
    --surface: #ffffff;
    --surface-2: #f7f9f8;
    --surface-hover: #f1f5f3;
    --border: #e1e7e4;
    --border-strong: #cbd5d0;

    --pine: #0f6e5c;
    --pine-600: #0b5a4b;
    --pine-700: #084438;
    --pine-50: #e8f3f0;
    --pine-100: #d0e8e1;
    --pine-rgb: 15, 110, 92;
    --saffron: #c98a0b;
    --saffron-bg: #fdf4e1;
    --danger: #bf3a28;
    --danger-bg: #fbeae7;
    --success: #1d7f47;
    --success-bg: #e5f3eb;
    --info: #2a64c0;
    --info-bg: #e8effa;
    --violet: #6a4cbf;
    --violet-bg: #f0ecfa;
    --neutral-bg: #eef1f3;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(16, 33, 28, .05);
    --shadow: 0 4px 16px -4px rgba(16, 33, 28, .12), 0 1px 3px rgba(16, 33, 28, .06);
    --shadow-lg: 0 18px 48px -12px rgba(16, 33, 28, .28);
    --sidebar-w: 252px;
    --topbar-h: 60px;
    --focus: 0 0 0 3px rgba(var(--pine-rgb), .22);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
    --ink: #e6ecea;
    --ink-2: #c4cec9;
    --muted: #93a19b;
    --subtle: #6d7a75;
    --bg: #0f1513;
    --surface: #161e1b;
    --surface-2: #1b2421;
    --surface-hover: #1f2a26;
    --border: #26322e;
    --border-strong: #34433d;
    --pine: #3fb59a;
    --pine-600: #5cc6ad;
    --pine-700: #8edbc8;
    --pine-50: #15302a;
    --pine-100: #1d3f37;
    --pine-rgb: 63, 181, 154;
    --saffron: #e8b23f;
    --saffron-bg: #33290f;
    --danger: #f07a66;
    --danger-bg: #3a1c17;
    --success: #5fcf8e;
    --success-bg: #14301f;
    --info: #79a6f0;
    --info-bg: #17253d;
    --violet: #b29cf0;
    --violet-bg: #251e3b;
    --neutral-bg: #222c29;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 6px 18px -6px rgba(0, 0, 0, .6);
    color-scheme: dark;
}

/* ------------------------------------------------------------------ Base */
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--pine); text-decoration: none; }
a:hover { color: var(--pine-600); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 650; letter-spacing: -.012em; }
hr { border-color: var(--border); opacity: 1; }
.text-muted { color: var(--muted) !important; }
.text-subtle { color: var(--subtle) !important; }
.tabular, .num { font-variant-numeric: tabular-nums; }
.small, small { font-size: .857rem; }
.xsmall { font-size: .786rem; }
.fw-600 { font-weight: 600; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
::selection { background: rgba(var(--pine-rgb), .2); }
:focus-visible { outline: none; box-shadow: var(--focus); }
.visually-hidden-focusable:focus { position: fixed; top: 8px; left: 8px; z-index: 2000; background: var(--surface); padding: .5rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ------------------------------------------------------------------ App shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 1030; }
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; gap: .65rem; padding: 0 1.1rem; border-bottom: 1px solid var(--border); color: var(--ink); }
.sidebar-brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--pine); color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: -.04em; flex-shrink: 0; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; background: #fff; }
.brand-name { font-weight: 700; font-size: 1rem; line-height: 1.1; }
.brand-org { font-size: .75rem; color: var(--muted); line-height: 1.2; max-width: 170px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem .6rem 1rem; scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: .35rem; }
.nav-group-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; background: none; color: var(--muted); font-size: .78rem; font-weight: 600; padding: .55rem .6rem .3rem; border-radius: var(--radius-sm); }
.nav-group-toggle:hover { color: var(--ink); }
.nav-group-toggle .bi { font-size: .7rem; transition: transform .15s; }
.nav-group.collapsed .nav-group-toggle .bi { transform: rotate(-90deg); }
.nav-group.collapsed .nav-items { display: none; }
.nav-link-app { display: flex; align-items: center; gap: .65rem; padding: .48rem .65rem; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; position: relative; }
.nav-link-app .bi { font-size: 1.05rem; color: var(--muted); width: 18px; text-align: center; }
.nav-link-app:hover { background: var(--surface-hover); color: var(--ink); text-decoration: none; }
.nav-link-app.active { background: var(--pine-50); color: var(--pine-700); font-weight: 600; }
.nav-link-app.active .bi { color: var(--pine); }
.nav-link-app.active::before { content: ""; position: absolute; left: -.6rem; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pine); }
.nav-link-app .count { margin-left: auto; font-size: .72rem; font-weight: 700; color: var(--saffron); background: var(--saffron-bg); border-radius: 999px; padding: 0 .45rem; }
.sidebar-foot { border-top: 1px solid var(--border); padding: .75rem 1rem; font-size: .78rem; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; height: var(--topbar-h); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem; }
.topbar .menu-btn { display: none; }
.search-trigger { flex: 1; max-width: 520px; display: flex; align-items: center; gap: .6rem; height: 38px; padding: 0 .8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); cursor: text; }
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger kbd { margin-left: auto; font-family: var(--font); font-size: .72rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: .05rem .4rem; box-shadow: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid transparent; background: none; color: var(--ink-2); display: inline-grid; place-items: center; position: relative; font-size: 1.1rem; }
.icon-btn:hover { background: var(--surface-hover); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 700; display: grid; place-items: center; padding: 0 3px; border: 2px solid var(--surface); }
.org-switch { display: flex; align-items: center; gap: .5rem; height: 38px; border: 1px solid var(--border); border-radius: var(--radius); padding: 0 .7rem; background: var(--surface); color: var(--ink); font-weight: 600; max-width: 240px; }
.org-switch:hover { border-color: var(--border-strong); }
.user-chip { display: flex; align-items: center; gap: .55rem; border: 0; background: none; padding: .25rem .4rem .25rem .25rem; border-radius: 999px; color: var(--ink); }
.user-chip:hover { background: var(--surface-hover); }
.user-chip .who { text-align: left; line-height: 1.15; }
.user-chip .who b { display: block; font-size: .86rem; font-weight: 600; }
.user-chip .who span { font-size: .74rem; color: var(--muted); }
.content { padding: 1.5rem 1.75rem 3rem; width: 100%; max-width: 1560px; margin: 0 auto; }

/* ------------------------------------------------------------------ Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: .3rem; display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--pine); }
.crumbs .sep { color: var(--subtle); }
.page-title { font-size: 1.6rem; margin: 0; line-height: 1.2; }
.page-subtitle { color: var(--muted); margin: .3rem 0 0; max-width: 72ch; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.page-actions form { display: inline-flex; margin: 0; }

/* ------------------------------------------------------------------ Panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .95rem 1.2rem; border-bottom: 1px solid var(--border); }
.panel-title { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: .5rem; }
.panel-title .bi { color: var(--muted); }
.panel-sub { font-size: .82rem; color: var(--muted); margin: .15rem 0 0; }
.panel-body { padding: 1.2rem; }
.panel-body.tight { padding: 0; }
.panel-foot { padding: .8rem 1.2rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.section-gap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }

/* Stat tiles: a quiet row, the number carries the weight */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1.25rem; }
.stat { background: var(--surface); padding: 1rem 1.15rem; min-width: 0; }
.stat .label { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.stat .value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: .15rem; line-height: 1.15; }
.stat .meta { font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.stat .meta .up { color: var(--success); font-weight: 600; }
.stat .meta .down { color: var(--danger); font-weight: 600; }
.stat.attention .value { color: var(--saffron); }
a.stat:hover { background: var(--surface-hover); text-decoration: none; }
a.stat { color: inherit; }

/* ------------------------------------------------------------------ Buttons */
.btn { --bs-btn-font-weight: 600; --bs-btn-padding-y: .45rem; --bs-btn-padding-x: .9rem; --bs-btn-font-size: .9rem; border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: .4rem; }
.btn-sm { --bs-btn-padding-y: .28rem; --bs-btn-padding-x: .6rem; --bs-btn-font-size: .82rem; }
.btn-lg { --bs-btn-padding-y: .65rem; --bs-btn-padding-x: 1.2rem; --bs-btn-font-size: 1rem; }
.btn-primary { --bs-btn-bg: var(--pine); --bs-btn-border-color: var(--pine); --bs-btn-hover-bg: var(--pine-600); --bs-btn-hover-border-color: var(--pine-600); --bs-btn-active-bg: var(--pine-700); --bs-btn-active-border-color: var(--pine-700); --bs-btn-disabled-bg: var(--pine); --bs-btn-disabled-border-color: var(--pine); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; }
[data-theme="dark"] .btn-primary { --bs-btn-color: #062a22; --bs-btn-hover-color: #062a22; }
.btn-secondary, .btn-light { --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border-strong); --bs-btn-color: var(--ink); --bs-btn-hover-bg: var(--surface-hover); --bs-btn-hover-border-color: var(--border-strong); --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: var(--surface-hover); --bs-btn-active-border-color: var(--border-strong); --bs-btn-active-color: var(--ink); }
.btn-ghost { --bs-btn-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-color: var(--ink-2); --bs-btn-hover-bg: var(--surface-hover); --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: var(--surface-hover); }
.btn-danger { --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger); --bs-btn-hover-bg: #a43020; --bs-btn-hover-border-color: #a43020; }
.btn-soft-danger { --bs-btn-bg: var(--danger-bg); --bs-btn-border-color: transparent; --bs-btn-color: var(--danger); --bs-btn-hover-bg: var(--danger); --bs-btn-hover-color: #fff; }
.btn-soft { --bs-btn-bg: var(--pine-50); --bs-btn-border-color: transparent; --bs-btn-color: var(--pine-700); --bs-btn-hover-bg: var(--pine-100); --bs-btn-hover-color: var(--pine-700); }
.btn-attention { --bs-btn-bg: var(--saffron-bg); --bs-btn-border-color: transparent; --bs-btn-color: #7a5303; --bs-btn-hover-bg: var(--saffron); --bs-btn-hover-color: #fff; }
.btn-icon { --bs-btn-padding-x: 0; width: 34px; height: 34px; justify-content: center; }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn-link { --bs-btn-color: var(--pine); --bs-btn-hover-color: var(--pine-600); }

/* ------------------------------------------------------------------ Forms */
.form-label { font-weight: 600; font-size: .86rem; color: var(--ink-2); margin-bottom: .3rem; }
.form-label .req { color: var(--danger); margin-left: .1rem; }
.form-control, .form-select { background-color: var(--surface); border: 1px solid var(--border-strong); color: var(--ink); border-radius: var(--radius-sm); font-size: .92rem; padding: .48rem .7rem; }
.form-control::placeholder { color: var(--subtle); }
.form-control:focus, .form-select:focus { border-color: var(--pine); box-shadow: var(--focus); background-color: var(--surface); color: var(--ink); }
.form-control-sm, .form-select-sm { font-size: .84rem; padding: .3rem .55rem; }
.form-text { color: var(--muted); font-size: .8rem; }
.form-check-input:checked { background-color: var(--pine); border-color: var(--pine); }
.form-check-input:focus { box-shadow: var(--focus); border-color: var(--pine); }
.form-switch .form-check-input { width: 2.2em; }
.input-group-text { background: var(--surface-2); border-color: var(--border-strong); color: var(--muted); }
.field-validation-error, .text-danger { color: var(--danger) !important; font-size: .82rem; }
.input-validation-error { border-color: var(--danger) !important; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.validation-summary-valid { display: none; }
[data-theme="dark"] .form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23c4cec9' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }

.form-section { padding: 1.35rem 1.4rem; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 1.25rem 2rem; }
.form-section:last-of-type { border-bottom: 0; }
.form-section > header h2 { font-size: .98rem; margin: 0 0 .25rem; }
.form-section > header p { color: var(--muted); font-size: .84rem; margin: 0; }
.form-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 1.4rem; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(6px); border-radius: 0 0 var(--radius-lg) var(--radius-lg); z-index: 5; }
.switch-tile { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .85rem; background: var(--surface); }
.switch-tile .form-check-input { float: none; margin: .15rem 0 0 !important; flex-shrink: 0; }
.switch-tile.form-switch { padding-left: .85rem; }
.switch-tile.form-switch .form-check-input { width: 2.2em; height: 1.2em; }
.switch-tile b { display: block; font-weight: 600; font-size: .88rem; }
.switch-tile span { font-size: .8rem; color: var(--muted); }
.switch-tile:has(input:checked) { border-color: rgba(var(--pine-rgb), .45); background: var(--pine-50); }

/* Rich text */
.rte { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.rte:focus-within { border-color: var(--pine); box-shadow: var(--focus); }
.rte-toolbar { display: flex; gap: .15rem; padding: .3rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rte-toolbar button { border: 0; background: none; width: 30px; height: 28px; border-radius: 5px; color: var(--ink-2); }
.rte-toolbar button:hover { background: var(--surface-hover); }
.rte-area { min-height: 140px; padding: .65rem .8rem; outline: none; max-height: 480px; overflow: auto; }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--subtle); }
.rte-area ul, .rte-area ol { padding-left: 1.3rem; margin-bottom: .5rem; }

.drop-zone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 1.6rem 1rem; text-align: center; background: var(--surface-2); color: var(--muted); transition: border-color .15s, background .15s; position: relative; }
.drop-zone.over { border-color: var(--pine); background: var(--pine-50); }
.drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-zone .bi { font-size: 1.6rem; color: var(--pine); display: block; margin-bottom: .25rem; }
.drop-zone .file-name { color: var(--ink); font-weight: 600; margin-top: .35rem; }

/* Tom Select: the wrapper carries the field border (Bootstrap 5 theme), the inner control stays borderless */
.ts-wrapper.form-select, .ts-wrapper.form-control { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background-color: var(--surface); min-height: 38px; }
.ts-wrapper.form-select.focus, .ts-wrapper.form-control.focus { border-color: var(--pine); box-shadow: var(--focus); }
.ts-wrapper .ts-control { color: var(--ink) !important; min-height: 36px; padding: .38rem .6rem; font-size: .92rem; }
.ts-wrapper .ts-control input { color: var(--ink) !important; }
.ts-wrapper .ts-control input::placeholder { color: var(--subtle); }
.ts-dropdown { background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); z-index: 1060; }
.ts-dropdown .active { background: var(--pine-50); color: var(--pine-700); }
.ts-dropdown .optgroup-header { color: var(--muted); background: var(--surface-2); font-weight: 600; }
.ts-wrapper.multi .ts-control > .item { background: var(--pine-50) !important; color: var(--pine-700) !important; border: 0 !important; border-radius: 4px !important; }
.ts-wrapper.single .ts-control > .item { color: var(--ink); }

/* ------------------------------------------------------------------ Data grid */
.grid-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.grid-search { position: relative; flex: 1 1 240px; max-width: 360px; }
.grid-search .bi { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--subtle); }
.grid-search input { padding-left: 2rem; }
.grid-toolbar .form-select { width: auto; min-width: 150px; }
.view-tabs { display: flex; gap: .25rem; padding: .5rem 1rem 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.view-tab { padding: .55rem .8rem; color: var(--muted); font-weight: 600; font-size: .88rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; }
.view-tab:hover { color: var(--ink); text-decoration: none; }
.view-tab.active { color: var(--pine-700); border-bottom-color: var(--pine); }
.view-tab .count { font-size: .72rem; background: var(--neutral-bg); color: var(--muted); border-radius: 999px; padding: 0 .45rem; font-weight: 700; }
.view-tab.active .count { background: var(--pine-50); color: var(--pine-700); }

.table-wrap { overflow-x: auto; }
.table-app { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; color: var(--ink); }
.table-app th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: .78rem; text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; }
.table-app th a { color: var(--muted); display: inline-flex; align-items: center; gap: .25rem; }
.table-app th a:hover { color: var(--ink); text-decoration: none; }
.table-app th.sorted a { color: var(--ink); }
.table-app td { padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-app tbody tr:last-child td { border-bottom: 0; }
.table-app tbody tr:hover td { background: var(--surface-hover); }
.table-app tr[data-href] { cursor: pointer; }
.table-app .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table-app .col-check { width: 36px; }
.table-app .num { text-align: right; }
.cell-title { font-weight: 600; color: var(--ink); }
a.cell-title:hover { color: var(--pine); }
.cell-sub { font-size: .8rem; color: var(--muted); }
.row-actions { display: inline-flex; gap: .15rem; }
.grid-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-top: 1px solid var(--border); font-size: .84rem; color: var(--muted); flex-wrap: wrap; }
.pagination { --bs-pagination-color: var(--ink-2); --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--border); --bs-pagination-hover-bg: var(--surface-hover); --bs-pagination-hover-color: var(--ink); --bs-pagination-active-bg: var(--pine); --bs-pagination-active-border-color: var(--pine); --bs-pagination-disabled-bg: var(--surface-2); --bs-pagination-disabled-color: var(--subtle); --bs-pagination-font-size: .84rem; margin: 0; }
.bulk-bar { display: none; align-items: center; gap: .6rem; padding: .55rem 1rem; background: var(--pine-50); border-bottom: 1px solid var(--pine-100); font-size: .86rem; }
.bulk-bar.show { display: flex; }

@media (max-width: 767.98px) {
    .table-stack thead { display: none; }
    .table-stack tr { display: block; border-bottom: 1px solid var(--border); padding: .5rem 0; }
    .table-stack td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem 1rem; text-align: right; }
    .table-stack td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 600; text-align: left; }
    .table-stack td.col-actions { justify-content: flex-end; }
    .table-stack td.col-actions::before, .table-stack td.col-check::before { content: none; }
}

/* ------------------------------------------------------------------ Badges & chips */
.badge-s { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 600; padding: .16rem .55rem; border-radius: 999px; line-height: 1.4; white-space: nowrap; background: var(--neutral-bg); color: var(--ink-2); }
.badge-s.pine { background: var(--pine-50); color: var(--pine-700); }
.badge-s.success { background: var(--success-bg); color: var(--success); }
.badge-s.attention { background: var(--saffron-bg); color: #8a5e04; }
[data-theme="dark"] .badge-s.attention { color: var(--saffron); }
.badge-s.danger { background: var(--danger-bg); color: var(--danger); }
.badge-s.info { background: var(--info-bg); color: var(--info); }
.badge-s.violet { background: var(--violet-bg); color: var(--violet); }
.badge-s.outline { background: transparent; border: 1px solid var(--border-strong); color: var(--ink-2); }
.badge-s .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stage-badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; padding: .16rem .6rem .16rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--stage) 13%, transparent); color: color-mix(in srgb, var(--stage) 78%, var(--ink)); white-space: nowrap; }
.stage-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--stage); }
.chip-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.skill-chip { font-size: .78rem; padding: .14rem .55rem; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap; }
.skill-chip.match { background: var(--pine-50); border-color: var(--pine-100); color: var(--pine-700); }
.skill-chip.missing { background: var(--surface); border-style: dashed; color: var(--muted); }
.filter-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; padding: .2rem .35rem .2rem .6rem; border-radius: 999px; background: var(--pine-50); color: var(--pine-700); font-weight: 600; }
.filter-chip a { color: inherit; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; }
.filter-chip a:hover { background: var(--pine-100); text-decoration: none; }
.tag-dot { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; }
.tag-dot::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--tag, var(--subtle)); }

/* Avatars */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; color: #fff; flex-shrink: 0; letter-spacing: .02em; overflow: hidden; background: var(--avatar, var(--pine)); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 26px; height: 26px; font-size: .68rem; }
.avatar.lg { width: 48px; height: 48px; font-size: 1rem; }
.avatar.xl { width: 68px; height: 68px; font-size: 1.35rem; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.person { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.person .meta { min-width: 0; }

/* ------------------------------------------------------------------ Stage rail (signature element) */
.stage-rail { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--neutral-bg); gap: 2px; }
.stage-rail span { background: var(--stage); min-width: 4px; }
.stage-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .65rem; font-size: .8rem; color: var(--muted); }
.stage-legend b { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: .25rem; }
.stage-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--stage); margin-right: .35rem; }
.stepper { display: flex; gap: 0; overflow-x: auto; padding-bottom: .25rem; }
.stepper .step { flex: 1 1 0; min-width: 86px; text-align: center; position: relative; font-size: .74rem; color: var(--muted); padding-top: 22px; }
.stepper .step::before { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 3px; background: var(--border); }
.stepper .step:first-child::before { left: 50%; }
.stepper .step:last-child::before { right: 50%; }
.stepper .step::after { content: ""; position: absolute; top: 2px; left: calc(50% - 7px); width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--border-strong); }
.stepper .step.done { color: var(--ink-2); }
.stepper .step.done::before { background: var(--pine); }
.stepper .step.done::after { background: var(--pine); border-color: var(--pine); }
.stepper .step.current { color: var(--pine-700); font-weight: 700; }
.stepper .step.current::before { background: linear-gradient(90deg, var(--pine) 50%, var(--border) 50%); }
.stepper .step.current::after { border-color: var(--pine); box-shadow: 0 0 0 4px rgba(var(--pine-rgb), .18); }
.stepper.closed .step.current::after { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); }

/* ------------------------------------------------------------------ Kanban */
.board-wrap { overflow-x: auto; padding-bottom: .75rem; }
.board { display: flex; gap: .85rem; align-items: flex-start; min-height: 60vh; }
.board-col { flex: 0 0 286px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.board-col-head { padding: .75rem .85rem .6rem; border-top: 3px solid var(--stage); border-radius: var(--radius-lg) var(--radius-lg) 0 0; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.board-col-head h3 { font-size: .9rem; margin: 0; }
.board-col-head .count { font-size: .76rem; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 .5rem; }
.board-list { padding: .35rem .55rem .7rem; overflow-y: auto; flex: 1; min-height: 80px; display: flex; flex-direction: column; gap: .5rem; }
.board-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .75rem; box-shadow: var(--shadow-sm); cursor: grab; }
.board-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.board-card .name { font-weight: 600; color: var(--ink); }
.board-card .sub { font-size: .78rem; color: var(--muted); }
.board-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; font-size: .76rem; color: var(--muted); }
.board-card.stale { border-left: 3px solid var(--saffron); }
.board-card.sortable-ghost { opacity: .35; }
.board-card.sortable-drag { box-shadow: var(--shadow-lg); transform: rotate(1.5deg); }
.board-empty { font-size: .8rem; color: var(--subtle); text-align: center; padding: 1rem .5rem; border: 1px dashed var(--border); border-radius: var(--radius); }

/* ------------------------------------------------------------------ Record pages */
.record-head { display: flex; gap: 1rem; align-items: flex-start; padding: 1.3rem 1.4rem; flex-wrap: wrap; }
.record-head .titles { flex: 1; min-width: 0; }
.record-code { font-size: .78rem; color: var(--muted); font-weight: 600; }
.record-title { font-size: 1.45rem; margin: .1rem 0 .35rem; line-height: 1.2; }
.record-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; color: var(--muted); font-size: .84rem; margin-top: .45rem; }
.record-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.record-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--pine-50); color: var(--pine); display: grid; place-items: center; font-size: 1.4rem; flex-shrink: 0; }
.record-logo { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; border: 1px solid var(--border); background: #fff; flex-shrink: 0; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.layout-2 > aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; position: sticky; top: calc(var(--topbar-h) + 1rem); }
@media (max-width: 1199.98px) { .layout-2 { grid-template-columns: 1fr; } .layout-2 > aside { position: static; } }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); padding: 0 1.2rem; overflow-x: auto; }
.tabs .tab { padding: .7rem .75rem; font-weight: 600; font-size: .88rem; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: none; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: .4rem; align-items: center; }
.tabs .tab:hover { color: var(--ink); }
.tabs .tab.active { color: var(--pine-700); border-bottom-color: var(--pine); }
.tabs .tab .count { font-size: .7rem; background: var(--neutral-bg); color: var(--muted); border-radius: 999px; padding: 0 .4rem; }
.tab-pane-app { display: none; }
.tab-pane-app.active { display: block; }

.props { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem 1.5rem; }
.prop .k { font-size: .78rem; color: var(--muted); margin-bottom: .1rem; }
.prop .v { font-weight: 500; color: var(--ink); word-break: break-word; }
.prop .v:empty::after { content: "—"; color: var(--subtle); }
dl.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; margin: 0; font-size: .88rem; }
dl.kv dt { font-weight: 400; color: var(--muted); padding: .45rem 1rem .45rem 0; border-bottom: 1px dashed var(--border); }
dl.kv dd { margin: 0; padding: .45rem 0; border-bottom: 1px dashed var(--border); text-align: right; font-weight: 500; word-break: break-word; }
dl.kv dt:last-of-type, dl.kv dd:last-of-type { border-bottom: 0; }
.prose { line-height: 1.7; color: var(--ink-2); max-width: 78ch; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose h3, .prose h4 { font-size: 1rem; margin-top: 1rem; }
.text-pre { white-space: pre-line; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.05rem 1.9rem; }
.timeline li::before { content: ""; position: absolute; left: 10px; top: 24px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .t-dot { position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--stage, var(--border-strong)); color: var(--stage, var(--muted)); font-size: .68rem; }
.timeline .t-title { font-weight: 600; font-size: .88rem; }
.timeline .t-meta { font-size: .78rem; color: var(--muted); }
.timeline .t-body { font-size: .85rem; color: var(--ink-2); margin-top: .2rem; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: .8rem; padding: .75rem 1.2rem; border-bottom: 1px solid var(--border); color: var(--ink); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--surface-hover); text-decoration: none; color: var(--ink); }
.list-row .when { min-width: 56px; text-align: center; border-radius: 9px; padding: .3rem .2rem; background: var(--pine-50); color: var(--pine-700); line-height: 1.1; }
.list-row .when b { display: block; font-size: 1.05rem; }
.list-row .when span { font-size: .66rem; font-weight: 700; }
.list-row .when.today { background: var(--saffron-bg); color: #8a5e04; }

/* Empty, loading, error */
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty .bi { font-size: 2rem; color: var(--pine); display: block; margin-bottom: .6rem; }
.empty h3 { font-size: 1.05rem; color: var(--ink); margin-bottom: .25rem; }
.empty p { max-width: 46ch; margin: 0 auto .9rem; }
.empty-inline { color: var(--muted); font-size: .86rem; padding: 1rem 1.2rem; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 6px; min-height: 1rem; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.alert { border-radius: var(--radius); border: 1px solid transparent; font-size: .9rem; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 20%, transparent); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }
.alert-warning { background: var(--saffron-bg); color: #7a5303; border-color: color-mix(in srgb, var(--saffron) 25%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
[data-theme="dark"] .alert-warning { color: var(--saffron); }

/* Toasts */
.toast-stack { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 2000; display: grid; gap: .5rem; }
.toast-app { min-width: 280px; max-width: 420px; background: var(--ink); color: #fff; border-radius: var(--radius); padding: .75rem .9rem; box-shadow: var(--shadow-lg); display: flex; gap: .65rem; align-items: flex-start; font-size: .9rem; animation: toastIn .2s ease; }
[data-theme="dark"] .toast-app { background: #e6ecea; color: #0f1513; }
.toast-app .bi { font-size: 1.05rem; margin-top: .05rem; }
.toast-app.success .bi { color: #5fcf8e; }
.toast-app.error .bi { color: #ff8b78; }
.toast-app button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Dropdowns, modals */
.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-color: var(--ink); --bs-dropdown-border-color: var(--border); --bs-dropdown-link-color: var(--ink-2); --bs-dropdown-link-hover-bg: var(--surface-hover); --bs-dropdown-link-hover-color: var(--ink); --bs-dropdown-link-active-bg: var(--pine-50); --bs-dropdown-link-active-color: var(--pine-700); --bs-dropdown-header-color: var(--muted); --bs-dropdown-divider-bg: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); font-size: .9rem; padding: .35rem; }
.dropdown-item { border-radius: 6px; padding: .42rem .7rem; display: flex; align-items: center; gap: .55rem; }
.dropdown-item .bi { color: var(--muted); width: 16px; }
.dropdown-item.text-danger .bi { color: var(--danger); }
.modal-content { background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--border); }
.modal-title { font-size: 1.05rem; }
.btn-close { filter: var(--btn-close-filter, none); }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

.notif-menu { width: 380px; padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: .6rem; padding: .7rem .9rem; border-bottom: 1px solid var(--border); color: var(--ink); }
.notif-item:hover { background: var(--surface-hover); text-decoration: none; color: var(--ink); }
.notif-item.unread { background: color-mix(in srgb, var(--pine-50) 60%, transparent); }
.notif-item .t { font-weight: 600; font-size: .86rem; }
.notif-item .m { font-size: .8rem; color: var(--muted); }

/* Command palette */
.palette .modal-dialog { max-width: 640px; margin-top: 10vh; }
.palette input { border: 0; font-size: 1.05rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.palette input:focus { box-shadow: none; }
.palette-results { max-height: 420px; overflow-y: auto; padding: .4rem; }
.palette-group { font-size: .74rem; font-weight: 600; color: var(--muted); padding: .5rem .6rem .25rem; }
.palette-item { display: flex; gap: .65rem; align-items: center; padding: .5rem .6rem; border-radius: 8px; color: var(--ink); }
.palette-item:hover, .palette-item.active { background: var(--pine-50); text-decoration: none; color: var(--ink); }
.palette-item .bi { color: var(--muted); }
.palette-item small { color: var(--muted); margin-left: auto; }

/* Charts */
.chart { min-height: 260px; }
.chart.sm { min-height: 200px; }
.apexcharts-text, .apexcharts-legend-text { fill: var(--muted) !important; color: var(--muted) !important; }
.apexcharts-tooltip { background: var(--surface) !important; border-color: var(--border) !important; color: var(--ink) !important; box-shadow: var(--shadow) !important; }
.apexcharts-gridline { stroke: var(--border); }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 60px; gap: .75rem; align-items: center; font-size: .86rem; margin-bottom: .45rem; }
.funnel-bar { height: 22px; border-radius: 6px; background: var(--neutral-bg); overflow: hidden; }
.funnel-bar span { display: block; height: 100%; background: var(--stage, var(--pine)); border-radius: 6px; min-width: 2px; }

/* Score ring */
.score { --v: 0; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--score-color, var(--pine)) calc(var(--v) * 1%), var(--neutral-bg) 0); position: relative; font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.score::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.score span { position: relative; }
.rating { color: var(--saffron); letter-spacing: 1px; white-space: nowrap; }
.rating .off { color: var(--border-strong); }

/* File viewer */
.viewer-frame { width: 100%; height: 72vh; border: 0; background: var(--surface-2); border-radius: var(--radius); }
.viewer-paper { background: #fff; color: #111; padding: 2rem; border-radius: var(--radius); max-height: 72vh; overflow: auto; }

/* Settings matrix */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
.matrix .group-row td { background: var(--surface-2) !important; font-weight: 700; font-size: .8rem; color: var(--muted); text-align: left; }
.matrix .na { color: var(--border-strong); }

/* ------------------------------------------------------------------ Public site (careers, auth, portal) */
.public-body { background: var(--surface); }
.public-top { height: 64px; display: flex; align-items: center; gap: 1rem; padding: 0 clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.public-top .brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--ink); }
.public-top nav { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.public-main { min-height: calc(100vh - 64px - 64px); }
.public-foot { height: 64px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--border); }
.career-hero { padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem) 2rem; background: linear-gradient(180deg, var(--pine-50), var(--surface)); border-bottom: 1px solid var(--border); }
.career-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.03em; max-width: 22ch; }
.career-hero p { color: var(--ink-2); font-size: 1.05rem; max-width: 60ch; }
.career-wrap { max-width: 1120px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 3rem) 3rem; }
.job-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; padding: 1.1rem 1.2rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); }
.job-card + .job-card { margin-top: .75rem; }
.job-card:hover { border-color: var(--pine); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.job-card h3 { font-size: 1.1rem; margin: 0; }
.job-card .facts { display: flex; flex-wrap: wrap; gap: .3rem 1rem; color: var(--muted); font-size: .86rem; }
.job-card .facts span { display: inline-flex; gap: .3rem; align-items: center; }
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); }
.auth-aside { background: var(--pine-700); color: #e6f3ef; padding: clamp(2rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; }
[data-theme="dark"] .auth-aside { background: #0b2a23; }
.auth-aside h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -.03em; max-width: 18ch; line-height: 1.15; }
.auth-aside .pipeline-art { display: grid; gap: .5rem; max-width: 420px; }
.auth-aside .pipeline-art div { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); position: relative; overflow: hidden; }
.auth-aside .pipeline-art div span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: #8edbc8; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.6rem; }
@media (max-width: 991.98px) { .auth-page { grid-template-columns: 1fr; } .auth-aside { display: none; } }

.portal-wrap { max-width: 1040px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem; }

/* ------------------------------------------------------------------ Responsive shell */
@media (max-width: 991.98px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(10, 20, 17, .4); z-index: 1025; }
    .topbar { padding: 0 1rem; }
    .topbar .menu-btn { display: inline-grid; }
    .search-trigger kbd, .user-chip .who { display: none; }
    .content { padding: 1rem 1rem 3rem; }
    .form-section { grid-template-columns: 1fr; gap: .75rem; }
}
@media (max-width: 575.98px) { .page-title { font-size: 1.35rem; } .org-switch span { display: none; } }

@media print {
    .sidebar, .topbar, .page-actions, .form-actions, .no-print { display: none !important; }
    .shell { display: block; }
    .panel { box-shadow: none; border-color: #ccc; }
    body { background: #fff; }
}

/* ---------------------------------------------------------------- v4 additions: communication */
.list-plain { list-style: none; margin: 0; padding: 0; }
.email-paper { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.4rem; background: var(--surface); max-width: 720px; }
.template-preview { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 1rem; background: var(--surface-2); }
.template-preview .subject { font-weight: 600; margin-bottom: .5rem; }
.notif-row { display: flex; gap: .75rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); color: inherit; }
.notif-row:hover { background: var(--surface-2); }
.notif-row.unread { background: color-mix(in srgb, var(--pine) 5%, var(--surface)); }
.notif-row.unread .title { font-weight: 600; }
.notif-row .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--pine); margin-top: .45rem; flex: none; }
.notif-row:not(.unread) .dot { background: transparent; }
.table-app .group-row td { background: var(--surface-2); font-weight: 700; font-size: .78rem; color: var(--muted); padding-top: .5rem; padding-bottom: .5rem; }
.bulk-bar { flex-wrap: wrap; }
.bulk-bar form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.bulk-bar .form-select-sm { width: auto; min-width: 150px; }
.star-btn { color: var(--subtle); }
.star-btn.on, .star-btn.on i { color: var(--saffron); }
.star-btn.on i::before { content: "\F586"; }
.match-meter { display: flex; align-items: center; gap: .6rem; }
.match-meter .ring { --v: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; color: var(--ink);
  background: radial-gradient(closest-side, var(--surface) 76%, transparent 78% 100%), conic-gradient(var(--pine) calc(var(--v) * 1%), var(--border) 0); }
.ai-out { border: 1px solid var(--violet-100, var(--border)); background: color-mix(in srgb, var(--violet, #7c3aed) 5%, var(--surface)); border-radius: var(--radius); padding: .85rem 1rem; font-size: .88rem; }
.rule-list li { display: flex; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); font-size: .87rem; }
.rule-list li:last-child { border-bottom: 0; }
.skill-chip.miss { background: var(--danger-bg, #fdecec); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.text-violet { color: var(--violet); }
.stage-pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.stage-option { position: relative; cursor: pointer; }
.stage-option input { position: absolute; opacity: 0; pointer-events: none; }
.stage-option span { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; font-weight: 500; background: var(--surface); }
.stage-option span::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--stage, var(--border-strong)); }
.stage-option input:checked + span { border-color: var(--stage, var(--pine)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--stage, var(--pine)) 25%, transparent); font-weight: 600; }
.stage-option input:focus-visible + span { outline: 2px solid var(--pine); outline-offset: 2px; }
.qa dt { font-size: .82rem; color: var(--muted); font-weight: 500; margin-top: .6rem; }
.qa dd { margin: 0; font-size: .9rem; }
.avatar.xs { width: 20px; height: 20px; font-size: .58rem; }

/* ---------------------------------------------------------------- Public pages (career site, candidate links, portal) */
body.public { --brand: var(--pine); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.public-wrap { max-width: 1080px; margin: 0 auto; padding: 0 1rem; width: 100%; }
.public-top { background: var(--surface); border-bottom: 1px solid var(--border); padding: .7rem 0; position: sticky; top: 0; z-index: 20; }
.public-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--ink); font-size: 1.02rem; }
.public-brand:hover { text-decoration: none; color: var(--ink); }
.public-brand .brand-mark { background: var(--brand); }
.public-main { flex: 1; padding: 2rem 0 3rem; }
.public-foot { border-top: 1px solid var(--border); padding: 1.1rem 0; font-size: .82rem; color: var(--muted); background: var(--surface); }
body.public .btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: color-mix(in srgb, var(--brand) 86%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--brand) 86%, #000); --bs-btn-active-bg: color-mix(in srgb, var(--brand) 78%, #000); }
body.public a:where(:not(.btn):not(.public-brand)) { color: color-mix(in srgb, var(--brand) 85%, var(--ink)); }
.public-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.1rem, 3vw, 2rem); box-shadow: var(--shadow-sm); }
.public-narrow { max-width: 720px; margin: 0 auto; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; }
.fact-grid > div { border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .85rem; background: var(--surface-2); }
.fact-grid dt { font-size: .76rem; color: var(--muted); font-weight: 500; }
.fact-grid dd { margin: 0; font-weight: 600; }
.choice-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice-row .stage-option span { padding: .55rem .95rem; }

/* ---------------------------------------------------------------- Interviews */
.list-day { padding: .55rem 1.2rem; font-size: .76rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { padding: .5rem .6rem; font-size: .75rem; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--border); }
.cal-day { min-height: 118px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .35rem .4rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-num { color: var(--subtle); }
.cal-num { font-size: .78rem; font-weight: 600; color: var(--ink-2); width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--pine); color: #fff; }
.cal-ev { display: block; font-size: .74rem; padding: .15rem .4rem; border-radius: 5px; background: var(--pine-50); color: var(--pine-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--pine); }
.cal-ev:hover { text-decoration: none; filter: brightness(.97); }
.cal-ev.cancelled { background: var(--surface-2); color: var(--subtle); text-decoration: line-through; border-left-color: var(--border-strong); }
.cal-ev.due { border-left-color: var(--saffron); background: var(--saffron-bg); color: var(--ink); }
.cal-more { font-size: .72rem; color: var(--muted); }
@media (max-width: 760px) { .cal-day { min-height: 70px; } .cal-ev b { display: none; } .cal-ev { font-size: .66rem; padding: .1rem .25rem; } }
.score-pick { display: inline-flex; gap: .25rem; }
.score-pick label { cursor: pointer; }
.score-pick input { position: absolute; opacity: 0; pointer-events: none; }
.score-pick span { width: 2rem; height: 2rem; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; font-weight: 600; font-size: .85rem; background: var(--surface); }
.score-pick input:checked + span { background: var(--pine); border-color: var(--pine); color: #fff; }
.score-pick input:focus-visible + span { outline: 2px solid var(--pine); outline-offset: 2px; }
.feedback-card { border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .75rem; }
.criteria-table td { vertical-align: middle; }

/* ---------------------------------------------------------------- Assessments */
.timer { position: sticky; top: 64px; z-index: 10; display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .35rem .85rem; box-shadow: var(--shadow-sm); }
.timer .low, .timer.low { color: var(--danger); }
.q-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: .9rem; background: var(--surface); }
.q-card .q-num { font-size: .76rem; color: var(--muted); font-weight: 600; }
.q-card .q-text { font-weight: 600; margin: .2rem 0 .7rem; white-space: pre-line; }
.q-card .form-check { padding: .45rem .6rem .45rem 2rem; border: 1px solid var(--border); border-radius: 8px; margin-bottom: .4rem; }
.q-card .form-check:has(input:checked) { border-color: var(--brand, var(--pine)); background: color-mix(in srgb, var(--brand, var(--pine)) 6%, var(--surface)); }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.answer-review { border-left: 3px solid var(--border); padding: .6rem .9rem; margin-bottom: .9rem; background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; }
.answer-review.right { border-left-color: var(--success); }
.answer-review.wrong { border-left-color: var(--danger); }
.answer-review.manual { border-left-color: var(--saffron); }
.q-editor { border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem; background: var(--surface-2); }
.stat-inline { font-size: .9rem; color: var(--muted); } .stat-inline b { font-size: 1.25rem; color: var(--ink); margin: 0 .3rem; font-variant-numeric: tabular-nums; }
.letter table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; font-size: .88rem; }
.letter th, .letter td { border-bottom: 1px solid var(--border); padding: .4rem .5rem; text-align: left; }
.letter th { background: var(--surface-2); font-weight: 600; }
.progress-thin { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-thin span { display: block; height: 100%; background: var(--pine); border-radius: 999px; }
.check-row { display: flex; align-items: flex-start; gap: .7rem; padding: .55rem 0; border-bottom: 1px dashed var(--border); }
.check-row:last-child { border-bottom: 0; }
.check-row .check-box { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; padding: 0; color: #fff; margin-top: 1px; }
.check-row.done .check-box { background: var(--pine); border-color: var(--pine); }
.check-row.done .title { text-decoration: line-through; color: var(--muted); }
.panel-head h2 { font-size: 1rem; font-weight: 650; margin: 0; }
.role-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; }
.role-option { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .8rem; cursor: pointer; background: var(--surface); }
.role-option:has(input:checked) { border-color: var(--pine); background: var(--pine-50); }
.role-option input { margin-top: .25rem; }
.role-option em { font-style: normal; }
.layout-2-left { grid-template-columns: 240px minmax(0, 1fr); }
@media (max-width: 991px) { .layout-2-left { grid-template-columns: minmax(0, 1fr); } }
.list-row.active { background: var(--pine-50); color: var(--pine-700); font-weight: 600; }
.setting-list { display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); margin: 0; cursor: default; }
.setting-row:last-child { border-bottom: 0; }
.setting-row label { margin: 0; }
.timeline .timeline-day { padding-left: 0; padding-bottom: .6rem; font-size: .8rem; color: var(--muted); } .timeline .timeline-day::before { display: none; }
.matrix th, .matrix td { padding: .45rem .4rem; } .matrix thead th { font-size: .7rem; white-space: nowrap; } .matrix td:first-child { min-width: 150px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.report-grid > .panel { margin: 0; }
.report-grid .span-2 { grid-column: span 2; }
@media (max-width: 991px) { .report-grid { grid-template-columns: minmax(0, 1fr); } .report-grid .span-2 { grid-column: auto; } }
.report-filters { flex-wrap: wrap; }
.report-filters input[type=date] { max-width: 165px; }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.report-card { display: flex; gap: .9rem; align-items: flex-start; padding: 1.1rem 1.2rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); }
.report-card:hover { border-color: var(--pine); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); }
.report-card > i { font-size: 1.4rem; color: var(--pine); }

/* ---------------------------------------------------------------- Career site & portal */
.career-hero { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 9%, var(--surface)) 0%, var(--bg) 100%); border-bottom: 1px solid var(--border); padding: 3rem 0 2.25rem; margin: -2rem 0 2rem; }
.career-hero h1 { font-size: clamp(1.8rem, 4.2vw, 2.9rem); letter-spacing: -.035em; line-height: 1.08; max-width: 20ch; margin: .2rem 0 .8rem; }
.career-kicker { font-weight: 600; color: color-mix(in srgb, var(--brand) 80%, var(--ink)); margin: 0; }
.career-about { color: var(--ink-2); max-width: 62ch; font-size: 1.02rem; }
.career-search { display: flex; align-items: center; gap: .5rem; max-width: 560px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: .3rem .3rem .3rem 1rem; margin-top: 1.2rem; box-shadow: var(--shadow-sm); }
.career-search input { border: 0; outline: 0; flex: 1; background: transparent; min-width: 0; font-size: 1rem; color: var(--ink); }
.career-search .btn { border-radius: 999px; }
.career-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.career-count { margin-top: .8rem; color: var(--muted); font-size: .88rem; }
.career-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.career-filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; }
.career-side-note { margin-top: 1rem; padding: 1rem; border-radius: var(--radius-lg); border: 1px dashed var(--border-strong); }
.job-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.job-card { display: flex; justify-content: space-between; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; color: var(--ink); }
.job-card:hover { text-decoration: none; color: var(--ink); border-color: var(--brand); box-shadow: var(--shadow); }
.job-card h2 { font-size: 1.1rem; margin: 0 0 .35rem; }
.job-card-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; flex-shrink: 0; }
.job-go { margin-top: auto; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand); transition: transform .15s ease; }
.job-card:hover .job-go { transform: translateX(3px); }
.job-meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; color: var(--muted); font-size: .88rem; }
.career-job { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.sticky-apply { position: sticky; top: 80px; }
.auth-narrow { max-width: 460px; margin: 0 auto; }
.applied-mark { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 2rem; color: #fff; background: var(--brand); }
.portal-actions { display: grid; gap: .6rem; }
.portal-action { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: var(--radius); color: var(--ink); }
.portal-action:hover { text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); }
.portal-action > i:first-child { font-size: 1.3rem; color: var(--brand); }
.portal-action.tone-attention { border-left-color: var(--saffron); }
.portal-action.tone-attention > i:first-child { color: var(--saffron); }
.portal-action.tone-success { border-left-color: var(--success); }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.portal-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; }
.portal-steps span { font-size: .72rem; color: var(--subtle); padding-top: .45rem; border-top: 4px solid var(--border); }
.portal-steps span.done { border-top-color: var(--brand); color: var(--muted); }
.portal-steps span.current { border-top-color: var(--brand); color: var(--ink); font-weight: 600; }
@media (max-width: 860px) {
  .career-layout, .career-job, .portal-grid { grid-template-columns: minmax(0, 1fr); }
  .job-card { flex-direction: column; }
  .job-card-side { align-items: flex-start; text-align: left; }
  .job-go { display: none; }
  .sticky-apply { position: static; }
}
.badge-s { white-space: nowrap; align-self: flex-start; }
@media (max-width: 575.98px) {
  .topbar { gap: .35rem; padding-left: .6rem; padding-right: .6rem; }
  .org-switch { padding: 0 .5rem; }
  .org-switch::after { display: none; }
  .topbar-actions { gap: .15rem; }
  .user-chip .bi-chevron-down { display: none; }
  .topbar-actions .theme-toggle, .topbar-actions [data-theme-toggle] { display: none; }
}
.layout-2 > *, .report-grid > *, .career-layout > *, .portal-grid > * { min-width: 0; }
.badge-s { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tabs { overflow-x: auto; scrollbar-width: thin; }
.tabs .tab { white-space: nowrap; }
@media (max-width: 767.98px) {
  .stepper { overflow-x: auto; padding-bottom: .4rem; }
  .stepper .step { min-width: 76px; }
  .email-paper { padding: .9rem; }
}
.prose, .email-paper, .text-pre { overflow-wrap: anywhere; }

/* ==========================================================================================
   Job portal (public marketplace + candidate account). Same tokens as the ATS; pine carries
   actions, saffron marks "new" and things waiting for the candidate.
   ========================================================================================== */
body.portal { --brand: var(--pine); }
.pt-top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.pt-top-row { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; }
.pt-brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 750; letter-spacing: -.02em; color: var(--ink) !important; font-size: 1.08rem; white-space: nowrap; }
.pt-brand:hover { text-decoration: none; }
.pt-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--pine); color: #fff; display: grid; place-items: center; font-size: .88rem; flex-shrink: 0; }
.pt-nav { display: flex; gap: .15rem; }
.pt-nav a { padding: .45rem .7rem; border-radius: 8px; color: var(--ink-2) !important; font-weight: 550; font-size: .95rem; }
.pt-nav a:hover { background: var(--surface-2); text-decoration: none; }
.pt-nav a.active { color: var(--pine-700) !important; background: var(--pine-50); }
.pt-account { margin-left: auto; display: flex; align-items: center; gap: .45rem; }
.pt-bell { position: relative; }
.pt-dot { position: absolute; top: 1px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--saffron); color: #fff; font-size: .62rem; font-weight: 700; display: grid; place-items: center; }
.pt-me { display: inline-flex; align-items: center; gap: .4rem; }
.pt-main { flex: 1; padding-bottom: 3rem; }
.pt-foot { background: var(--surface); border-top: 1px solid var(--border); padding: 2rem 0 1.1rem; }
.pt-foot-row { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.pt-foot-row > div:first-child { max-width: 320px; }
.pt-foot-links { display: flex; gap: 2.5rem; flex-wrap: wrap; font-size: .88rem; }
.pt-foot-links div { display: flex; flex-direction: column; gap: .35rem; }
.pt-foot-links b { font-size: .8rem; color: var(--muted); font-weight: 600; }
.pt-copy { margin-top: 1.5rem; }
@media (max-width: 575.98px) { .pt-nav a { padding: .4rem .45rem; font-size: .88rem; } .pt-top-row { gap: .6rem; } .pt-brand span:last-child { display: none; } }

/* ---- Hero & search */
.pt-hero { background: var(--pine-700); color: #fff; padding: clamp(2.4rem, 7vw, 4.6rem) 0 clamp(2rem, 5vw, 3.1rem); }
[data-theme="dark"] .pt-hero { background: #0b3a31; }
.pt-hero h1 { color: #fff; font-size: clamp(2rem, 5.2vw, 3.45rem); letter-spacing: -.045em; line-height: 1.03; max-width: 16ch; margin: 0 0 .9rem; font-weight: 760; }
.pt-hero .lead { color: rgba(255, 255, 255, .84); max-width: 56ch; font-size: 1.08rem; margin: 0; }
.pt-hero .lead b { color: #fff; }
.pt-search { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) auto; background: var(--surface); border-radius: 14px; padding: .4rem; gap: .4rem; box-shadow: 0 22px 44px -22px rgba(0, 0, 0, .55); max-width: 880px; margin-top: 1.6rem; }
.pt-search label { display: flex; align-items: center; gap: .6rem; padding: .3rem .8rem; border-radius: 10px; margin: 0; color: var(--muted); }
.pt-search label + label { border-left: 1px solid var(--border); }
.pt-search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 1.02rem; color: var(--ink); padding: .5rem 0; min-width: 0; }
.pt-search label:focus-within { background: var(--surface-2); }
.pt-search .btn { padding-left: 1.4rem; padding-right: 1.4rem; border-radius: 10px; }
.pt-popular { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .88rem; color: rgba(255, 255, 255, .75); }
.pt-hero .pt-popular a, body.public .pt-popular a { color: #fff; border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; padding: .2rem .7rem; }
.pt-hero .pt-popular a:hover, body.public .pt-popular a:hover { background: rgba(255, 255, 255, .12); text-decoration: none; }
.pt-searchbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem 0; }
.pt-searchbar .pt-search { margin-top: 0; box-shadow: none; border: 1px solid var(--border-strong); max-width: none; }
@media (max-width: 640px) {
  .pt-search { grid-template-columns: minmax(0, 1fr); }
  .pt-search label + label { border-left: 0; border-top: 1px solid var(--border); border-radius: 0; }
}

/* ---- Sections on the home page */
.pt-section { padding-top: 2.6rem; }
.pt-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pt-section-head h2 { font-size: 1.35rem; letter-spacing: -.025em; margin: 0; }
.pt-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .6rem; }
.pt-cat { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink) !important; font-weight: 550; }
.pt-cat i { font-size: 1.15rem; color: var(--pine); }
.pt-cat small { margin-left: auto; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.pt-cat:hover { border-color: var(--pine); text-decoration: none; }
.pt-home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.pt-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; counter-reset: step; }
.pt-steps li { list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.2rem; counter-increment: step; }
.pt-steps li::before { content: counter(step); display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--pine-50); color: var(--pine-700); font-weight: 700; margin-bottom: .6rem; }
.pt-steps b { display: block; margin-bottom: .2rem; }
.pt-steps p { margin: 0; color: var(--muted); font-size: .92rem; }
@media (max-width: 991px) { .pt-home-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .pt-steps { grid-template-columns: minmax(0, 1fr); } }

/* ---- Job cards */
.pt-jobs { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.pt-job { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: .35rem 1rem; padding: 1.05rem 1.15rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.pt-job:hover { border-color: var(--pine-100); box-shadow: var(--shadow); }
.pt-job h3 { font-size: 1.06rem; margin: 0; letter-spacing: -.01em; line-height: 1.3; }
body.public .pt-job h3 a { color: var(--ink); }
.pt-job h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.pt-job h3 a:hover { text-decoration: none; }
.pt-job h3 a:focus-visible { outline: none; }
.pt-job:has(h3 a:focus-visible) { box-shadow: var(--focus); border-color: var(--pine); }
.pt-employer { font-size: .9rem; color: var(--ink-2); }
.pt-logo { width: 48px; height: 48px; border-radius: 12px; background: var(--pine-50); color: var(--pine-700); display: grid; place-items: center; font-weight: 700; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; }
.pt-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pt-logo.lg { width: 72px; height: 72px; border-radius: 16px; font-size: 1.45rem; }
.pt-logo.sm { width: 36px; height: 36px; border-radius: 9px; font-size: .8rem; }
.pt-facts { display: flex; flex-wrap: wrap; gap: .3rem 1rem; color: var(--muted); font-size: .86rem; margin-top: .35rem; }
.pt-facts span { display: inline-flex; gap: .3rem; align-items: center; }
.pt-job .chip-row { margin-top: .55rem; }
.pt-job-side { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; text-align: right; }
.pt-salary { font-weight: 650; color: var(--ink); white-space: nowrap; }
.pt-save { position: relative; z-index: 2; margin: 0; }
.pt-save .btn[aria-pressed="true"] i { color: var(--pine); }
.pt-new { background: var(--saffron-bg); color: #8a5e04; font-size: .72rem; font-weight: 700; padding: .08rem .45rem; border-radius: 999px; }
[data-theme="dark"] .pt-new { color: var(--saffron); }
.pt-fitline { font-size: .8rem; color: var(--pine-700); }
@media (max-width: 640px) {
  .pt-job { grid-template-columns: 40px minmax(0, 1fr); }
  .pt-job-side { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; text-align: left; gap: .25rem .8rem; }
  .pt-logo { width: 40px; height: 40px; border-radius: 10px; }
}

/* ---- Search results */
.pt-layout { display: grid; grid-template-columns: 255px minmax(0, 1fr); gap: 1.5rem; align-items: start; padding-top: 1.5rem; }
.pt-filters { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1rem; }
@media (min-width: 992px) { .pt-filters { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow-y: auto; } }
.pt-filter { margin-bottom: .85rem; }
.pt-filter .form-label { font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: .3rem; }
.pt-filter .form-select, .pt-filter .form-control { font-size: .9rem; }
.pt-results-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .8rem; flex-wrap: wrap; }
.pt-results-head h1 { font-size: 1.15rem; margin: 0; }
.pt-active { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; }
.pt-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .35rem .2rem .65rem; border-radius: 999px; background: var(--pine-50); color: var(--pine-700); font-size: .8rem; }
body.public .pt-chip a { color: inherit; display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; border-radius: 50%; }
body.public .pt-chip a:hover { background: var(--pine-100); text-decoration: none; }
.pt-pager { display: flex; justify-content: center; gap: .35rem; margin-top: 1.4rem; flex-wrap: wrap; }
@media (max-width: 991px) { .pt-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---- Job page */
.pt-jobhead { background: var(--surface); border-bottom: 1px solid var(--border); padding: 1.6rem 0 1.4rem; }
.pt-jobhead-row { display: flex; gap: 1.1rem; align-items: flex-start; }
.pt-jobhead h1 { font-size: clamp(1.5rem, 3.2vw, 2.15rem); letter-spacing: -.03em; margin: 0 0 .25rem; line-height: 1.12; }
.pt-detail { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.5rem; align-items: start; padding-top: 1.5rem; }
.pt-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: clamp(1.1rem, 3vw, 1.6rem); }
.pt-panel + .pt-panel { margin-top: 1rem; }
.pt-panel > h2 { font-size: 1.05rem; margin: 0 0 .75rem; letter-spacing: -.01em; }
.pt-panel .prose h2 { font-size: 1.02rem; margin-top: 1.4rem; }
@media (min-width: 992px) { .pt-apply { position: sticky; top: 80px; } }
.pt-fit { border-radius: 12px; background: var(--pine-50); padding: .8rem .9rem; margin-top: .9rem; }
.pt-fit-score { font-size: 1.45rem; font-weight: 750; color: var(--pine-700); line-height: 1; }
.pt-keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin: 0 0 1.2rem; }
.pt-keyfacts div { padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.pt-keyfacts dt { font-size: .74rem; color: var(--muted); font-weight: 500; }
.pt-keyfacts dd { margin: 0; font-weight: 600; font-size: .92rem; }
.pt-mini { display: block; padding: .65rem 0; border-top: 1px solid var(--border); color: var(--ink) !important; }
.pt-mini:first-of-type { border-top: 0; }
.pt-mini:hover { text-decoration: none; }
.pt-mini b { display: block; }
.pt-mini:hover b { color: var(--pine-700); }
@media (max-width: 991px) { .pt-detail { grid-template-columns: minmax(0, 1fr); } }

/* ---- Employers */
.pt-employers { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: .8rem; }
.pt-employer-card { position: relative; display: flex; flex-direction: column; gap: .55rem; padding: 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.pt-employer-card:hover { border-color: var(--pine-100); box-shadow: var(--shadow); }
.pt-employer-card h3 { font-size: 1.02rem; margin: 0; }
body.public .pt-employer-card h3 a { color: var(--ink); }
.pt-employer-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.pt-employer-card p { color: var(--muted); font-size: .88rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pt-employer-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: .84rem; color: var(--muted); }
.pt-employer-foot b { color: var(--pine-700); }
.pt-cohead { background: var(--surface); border-bottom: 1px solid var(--border); padding: 2rem 0 1.5rem; }

/* ---- Candidate account */
.acct { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 1.6rem; align-items: start; padding-top: 1.75rem; }
.acct-nav { display: flex; flex-direction: column; gap: .1rem; }
@media (min-width: 992px) { .acct-nav { position: sticky; top: 80px; } }
body.public .acct-nav a { display: flex; align-items: center; gap: .6rem; padding: .48rem .7rem; border-radius: 9px; color: var(--ink-2); font-weight: 520; font-size: .93rem; }
body.public .acct-nav a:hover { background: var(--surface); text-decoration: none; color: var(--ink); }
body.public .acct-nav a.active { background: var(--surface); color: var(--pine-700); font-weight: 650; box-shadow: var(--shadow-sm); }
.acct-nav .count { margin-left: auto; font-size: .75rem; color: var(--muted); font-weight: 500; }
.acct-nav hr { margin: .5rem .7rem; color: var(--border-strong); }
.acct-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.acct-head h1 { font-size: 1.55rem; letter-spacing: -.025em; margin: 0; }
.acct-head p { margin: .2rem 0 0; color: var(--muted); }
@media (max-width: 991px) {
  .acct { grid-template-columns: minmax(0, 1fr); padding-top: 1rem; }
  .acct-nav { flex-direction: row; overflow-x: auto; padding-bottom: .35rem; scrollbar-width: thin; }
  body.public .acct-nav a { white-space: nowrap; }
  .acct-nav hr, .acct-nav .count { display: none; }
}
.pt-counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
body.public .pt-counters a { padding: 1rem 1.1rem; color: var(--ink); border-right: 1px solid var(--border); }
.pt-counters a:last-child { border-right: 0; }
body.public .pt-counters a:hover { background: var(--surface-2); text-decoration: none; }
.pt-counters b { display: block; font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pt-counters span { color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) {
  .pt-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-counters a:nth-child(2) { border-right: 0; }
  .pt-counters a:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
.meter { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--pine); border-radius: 999px; }
.pt-complete { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem 1rem; align-items: center; }
.pt-notice { display: flex; gap: .8rem; align-items: center; padding: .8rem 1rem; border-radius: 12px; background: var(--saffron-bg); border: 1px solid color-mix(in srgb, var(--saffron) 35%, transparent); margin-bottom: 1rem; }
.pt-notice > i { color: var(--saffron); font-size: 1.2rem; }
.pt-table td, .pt-table th { vertical-align: middle; }

/* ---- Application journey */
.journey { list-style: none; margin: 0; padding: 0; display: flex; }
.journey li { flex: 1 1 0; position: relative; padding-top: 1.95rem; text-align: center; font-size: .82rem; color: var(--muted); min-width: 0; padding-inline: .2rem; }
.journey li::before { content: ""; position: absolute; top: .58rem; left: 0; right: 0; height: 3px; background: var(--border); }
.journey li:first-child::before { left: 50%; }
.journey li:last-child::before { right: 50%; }
.journey .dot { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: .72rem; color: #fff; z-index: 1; }
.journey li.done { color: var(--ink-2); }
.journey li.done::before { background: var(--pine); }
.journey li.done .dot { background: var(--pine); border-color: var(--pine); }
.journey li.current { color: var(--ink); font-weight: 650; }
.journey li.current .dot { border-color: var(--pine); box-shadow: 0 0 0 4px var(--pine-50); }
.journey li.current .dot::after { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--pine); }
.journey li.current::before { background: linear-gradient(90deg, var(--pine) 50%, var(--border) 50%); }
.journey li.stopped { color: var(--danger); font-weight: 600; }
.journey li.stopped .dot { background: var(--danger); border-color: var(--danger); }
.journey small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; margin-top: .1rem; }
@media (max-width: 760px) {
  .journey { flex-direction: column; }
  .journey li { text-align: left; padding: 0 0 1rem 2.2rem; }
  .journey li::before { top: 0; bottom: 0; left: .62rem; right: auto; width: 3px; height: auto; }
  .journey li:first-child::before { top: .62rem; left: .62rem; }
  .journey li:last-child::before { bottom: auto; height: .62rem; right: auto; }
  .journey .dot { left: .7rem; top: .02rem; }
  .journey li.current::before { background: linear-gradient(180deg, var(--pine) 50%, var(--border) 50%); }
}

/* ---- Profile & resumes */
.pt-profile-head { display: flex; gap: 1rem; align-items: center; }
.pt-photo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--pine-50); display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; color: var(--pine-700); flex-shrink: 0; overflow: hidden; }
.pt-photo img { width: 100%; height: 100%; object-fit: cover; }
.pt-sec { scroll-margin-top: 84px; }
.pt-sec-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.pt-sec-head h2 { font-size: 1.02rem; margin: 0; }
.pt-item { padding: .7rem 0; border-top: 1px dashed var(--border); }
.pt-item:first-child { border-top: 0; padding-top: 0; }
.pt-empty { color: var(--muted); font-size: .9rem; margin: 0; }
.pt-resume { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); flex-wrap: wrap; }
.pt-resume + .pt-resume { margin-top: .6rem; }
.pt-resume > i { font-size: 1.6rem; color: var(--pine); }
.pt-resume.default { border-color: var(--pine-100); }
.pt-resume-actions { margin-left: auto; display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.pt-resume-pick { display: grid; gap: .5rem; }
.pt-resume-pick label { display: flex; gap: .7rem; align-items: center; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); margin: 0; }
.pt-resume-pick label:has(input:checked) { border-color: var(--pine); background: var(--pine-50); }
.pt-check-grid { display: flex; flex-wrap: wrap; gap: .4rem; }
.pt-check-grid label { display: inline-flex; gap: .45rem; align-items: center; padding: .4rem .75rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: .9rem; margin: 0; background: var(--surface); }
.pt-check-grid label:has(input:checked) { border-color: var(--pine); background: var(--pine-50); color: var(--pine-700); }

/* ---- Sign in / register */
.pt-auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 3rem; align-items: center; padding: 3rem 0 1rem; }
.pt-auth-pitch h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); letter-spacing: -.035em; line-height: 1.1; max-width: 18ch; }
.pt-auth-pitch ul { list-style: none; padding: 0; display: grid; gap: .75rem; margin-top: 1.3rem; }
.pt-auth-pitch li { display: flex; gap: .7rem; color: var(--ink-2); }
.pt-auth-pitch li i { color: var(--pine); font-size: 1.1rem; }
@media (max-width: 860px) { .pt-auth { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding-top: 1.5rem; } .pt-auth-pitch { display: none; } }

/* Job portal: single-column grids never grow past their container (long, truncated file names on phones) */
.pt-main .d-grid { grid-template-columns: minmax(0, 1fr); }
.pt-resume-pick label { min-width: 0; }

/* HireDesk brand */
.hd-mark { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: block; }
.hd-word { font-weight: 760; letter-spacing: -.03em; color: var(--ink); }
.hd-word span { color: var(--pine); }
.pt-brand .hd-word { font-size: 1.12rem; }
.small-brand .hd-mark { width: 26px; height: 26px; }
.hd-powered { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; color: var(--muted) !important; }
.hd-powered:hover { color: var(--ink) !important; text-decoration: none; }
.hd-powered img { border-radius: 4px; }
.hd-auth-logo { height: 40px; width: auto; align-self: flex-start; }
@media (max-width: 575.98px) { .pt-top .pt-brand .hd-word { display: none; } }
