/* Staff app shell + component polish for the four back-office doors (admin, TAPS, employer, partner).
   Loaded after app.css and taps.css. Everything is scoped to body.staff-app so the public site is untouched.
   Same dark, single-gold-accent language as the public site, but laid out as a working tool:
   persistent sidebar, quiet top bar, full-width content, consistent cards/tables/forms/pills. */

.staff-app {
    --s-bg: #0A0A0B;
    --s-side: #0E0F11;
    --s-card: #131417;
    --s-card-2: #17181D;
    --s-line: rgba(255, 255, 255, 0.09);
    --s-line-2: rgba(255, 255, 255, 0.16);
    --s-ok: #5FD3A0;
    --s-warn: #D6A24A;
    --s-bad: #E8806E;
    --s-info: #4FC3D6;
    --s-radius: 10px;
    --side-w: 252px;
    background: var(--s-bg);
    font-size: 15px;
    line-height: 1.55;
}

/* ---------- Shell ---------- */

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }

.shell__side {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    background: var(--s-side);
    border-right: 1px solid var(--s-line);
    z-index: 40;
}

.shell__brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.shell__brand .brand { font-size: 15px; }
.shell__brand .taps-header__tag { margin: 0; font-size: 10px; }

.shell__nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; scrollbar-color: var(--s-line-2) transparent; }

.shell__link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 10px; min-height: 40px;
    border-radius: var(--radius-md);
    color: var(--muted); font-size: 14px; font-weight: 500;
    text-decoration: none; cursor: pointer;
    transition: background .15s, color .15s;
}
.shell__link .ico { flex: none; opacity: .85; }
.shell__link:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); }
.shell__link.is-current { background: rgba(214, 162, 74, 0.13); color: var(--accent); }
.shell__link.is-current .ico { opacity: 1; }

.shell__group { margin: 0; }
.shell__summary { list-style: none; }
.shell__summary::-webkit-details-marker { display: none; }
.shell__summary span { flex: 1; }
.shell__summary .ico:last-child { width: 14px; height: 14px; transition: transform .2s; opacity: .6; }
.shell__group[open] > .shell__summary .ico:last-child { transform: rotate(180deg); }
.shell__summary.is-section { color: var(--ink); }
.shell__summary.is-section .ico:first-child { color: var(--accent); opacity: 1; }

.shell__sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 20px; padding-left: 14px; border-left: 1px solid var(--s-line); }
.shell__sub a {
    padding: 7px 10px; min-height: 34px; display: flex; align-items: center;
    border-radius: 6px; color: var(--muted); font-size: 13.5px; text-decoration: none;
}
.shell__sub a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.shell__sub a.is-current { color: var(--accent); background: rgba(214, 162, 74, 0.1); font-weight: 600; }

.shell__foot { display: flex; align-items: center; gap: 6px; padding: 12px; border-top: 1px solid var(--s-line); }
.shell__me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-md); text-decoration: none; color: var(--ink); }
.shell__me:hover { background: rgba(255, 255, 255, 0.05); }
.shell__avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-family: var(--font-display); }
.shell__who { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.shell__who strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell__who small { font-size: 11.5px; color: var(--muted); }
.shell__logout { background: none; border: 1px solid var(--s-line); color: var(--muted); border-radius: var(--radius-md); width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }
.shell__logout:hover { color: var(--s-bad); border-color: var(--s-bad); }

.shell__body { min-width: 0; display: flex; flex-direction: column; }

.shell__top {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 32px; min-height: 60px;
    background: rgba(10, 10, 11, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--s-line);
}
.shell__top-spacer { flex: 1; }
.shell__search { flex: 1; max-width: 520px; position: relative; }
.shell__search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.shell__search input {
    width: 100%; height: 38px; padding: 0 14px 0 38px;
    background: var(--s-card); border: 1px solid var(--s-line); border-radius: 9px;
    color: var(--ink); font: inherit; font-size: 14px;
}
.shell__search input::placeholder { color: var(--muted-dim); }
.shell__search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(214, 162, 74, 0.15); }
.shell__palette {
    margin-left: auto; height: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 10px;
    background: transparent; border: 1px solid var(--s-line); border-radius: 9px; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
}
.shell__palette:hover { color: var(--ink); border-color: var(--s-line-2); }
.shell__palette kbd { font: inherit; font-size: 11px; padding: 2px 6px; border: 1px solid var(--s-line-2); border-radius: 5px; color: var(--muted); }
.shell__burger { display: none; background: none; border: 1px solid var(--s-line); border-radius: 9px; width: 42px; height: 42px; place-items: center; color: var(--ink); cursor: pointer; }
.shell__scrim { display: none; }

.staff-app main { flex: 1; outline: none; }
.staff-app .container.taps-main,
.staff-app .taps-main { max-width: 1400px; width: 100%; margin: 0; padding: 32px 32px 80px; }

/* ---------- Page header ---------- */

.staff-app .taps-main > .eyebrow { display: block; margin: 0 0 6px; font-size: 11.5px; letter-spacing: .12em; color: var(--accent); }
.staff-app .taps-main h1 {
    font-size: clamp(24px, 2.2vw, 32px); line-height: 1.15; text-transform: none; letter-spacing: -0.02em;
    margin: 0 0 8px; font-weight: 800;
}
.staff-app .taps-main > .lede,
.staff-app .taps-main > h1 + p { max-width: 74ch; font-size: 14.5px; color: var(--muted); margin: 0 0 24px; }
.staff-app .back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.staff-app .back-link:hover { color: var(--accent); }

.staff-app .taps-toolbar { margin-bottom: 20px; align-items: flex-start; }

/* ---------- Cards ---------- */

.staff-app .dashboard-card {
    background: var(--s-card); border: 1px solid var(--s-line); border-radius: var(--s-radius);
    padding: 22px 24px; margin-bottom: 18px;
}
.staff-app .dashboard-card > h2,
.staff-app .dashboard-card > summary h2 {
    font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); margin: 0 0 16px; font-family: var(--font-body);
}
.staff-app .dashboard-card h3 { font-size: 14px; text-transform: none; letter-spacing: 0; margin: 18px 0 8px; color: var(--ink); }
.staff-app .dashboard-card > p:last-child { margin-bottom: 0; }
.staff-app .dashboard-card.attention { border-color: rgba(214, 162, 74, 0.35); background: linear-gradient(180deg, rgba(214, 162, 74, 0.06), var(--s-card) 120px); }
.staff-app .taps-sub { color: var(--muted); }
.staff-app .taps-hint { color: var(--muted); font-size: 13.5px; }

.staff-app .empty-state, .staff-app .dashboard-card.empty-state {
    text-align: center; color: var(--muted); border-style: dashed; padding: 36px 24px;
}

/* ---------- Buttons ---------- */

.staff-app .button { min-height: 38px; padding: 8px 16px; border-radius: var(--radius-md); font-size: 13.5px; letter-spacing: 0; font-weight: 600; transition: background .15s, border-color .15s, color .15s; }
.staff-app .button--large { min-height: 42px; padding: 10px 20px; font-size: 14px; }
.staff-app .button--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.staff-app .button--primary:hover { background: #E3B15E; border-color: #E3B15E; }
.staff-app .button--outline, .staff-app .button--secondary { background: transparent; border-color: var(--s-line-2); color: var(--ink); }
.staff-app .button--outline:hover, .staff-app .button--secondary:hover { border-color: var(--accent); color: var(--accent); background: rgba(214, 162, 74, .06); }
.staff-app .button--danger { border-color: rgba(232, 128, 110, .5); }
.staff-app .link-button { color: var(--accent-2); }

/* ---------- Tables ---------- */

.staff-app .taps-table-wrap, .staff-app .table-wrap {
    border: 1px solid var(--s-line); border-radius: var(--s-radius); background: var(--s-card); overflow-x: auto;
}
.staff-app .taps-table { border: 0; border-radius: 0; background: transparent; font-size: 14px; }
.staff-app .taps-table th {
    background: var(--s-card-2); font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--muted);
    padding: 11px 16px; border-bottom: 1px solid var(--s-line-2); white-space: nowrap;
}
.staff-app .taps-table td { padding: 13px 16px; border-bottom: 1px solid var(--s-line); vertical-align: middle; }
.staff-app .taps-table tbody tr { transition: background .12s; }
.staff-app .taps-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.staff-app .taps-table td a { color: var(--ink); font-weight: 600; }
.staff-app .taps-table td a:hover { color: var(--accent); }
.staff-app .taps-table .taps-sub { margin-top: 2px; }
.staff-app .taps-table-wrap .taps-table { min-width: 760px; }
/* A table directly in a card shouldn't double the border */
.staff-app .dashboard-card .taps-table-wrap { border: 0; background: transparent; }

/* ---------- Tabs, filters, bulk ---------- */

.staff-app .taps-tabs { gap: 2px; margin-bottom: 18px; border-bottom: 1px solid var(--s-line); }
.staff-app .taps-tab { padding: 10px 14px; font-size: 14px; border-radius: var(--radius-md) 8px 0 0; }
.staff-app .taps-tab:hover { background: rgba(255, 255, 255, .04); }
.staff-app .taps-tab--active { color: var(--accent); }
.staff-app .taps-tab__count { background: rgba(255, 255, 255, .08); font-size: 11.5px; font-weight: 700; }
.staff-app .taps-tab--active .taps-tab__count { background: rgba(214, 162, 74, .18); color: var(--accent); }

.staff-app .taps-filters, .staff-app .taps-bulk, .staff-app .taps-saved {
    padding: 12px; background: var(--s-card); border: 1px solid var(--s-line); border-radius: var(--s-radius); margin-bottom: 14px; gap: 8px;
}
.staff-app .taps-saved { background: transparent; border: 0; padding: 0; }
.staff-app .taps-saved__chip { background: var(--s-card); border-color: var(--s-line); }
.staff-app .taps-pager { padding-top: 6px; }

/* ---------- Form controls (everything in the staff UI) ---------- */

.staff-app input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]),
.staff-app select,
.staff-app textarea {
    background: var(--s-card-2); border: 1px solid var(--s-line-2); border-radius: var(--radius-md); color: var(--ink);
    font: inherit; font-size: 14px; padding: 9px 12px; min-height: 38px;
    transition: border-color .15s, box-shadow .15s;
}
.staff-app textarea { min-height: 96px; line-height: 1.5; }
.staff-app input::placeholder, .staff-app textarea::placeholder { color: var(--muted-dim); }
.staff-app input:not([type="checkbox"]):not([type="radio"]):focus,
.staff-app select:focus, .staff-app textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(214, 162, 74, .16);
}
.staff-app input[type="checkbox"], .staff-app input[type="radio"] { accent-color: var(--accent); }
.staff-app select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239A9A9F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }

.staff-app .stack-form { max-width: 880px; }
.staff-app .stack-form label { font-size: 13px; color: var(--ink); font-weight: 600; margin: 16px 0 6px; }
.staff-app .stack-form label:first-child { margin-top: 0; }
.staff-app .stack-form label > small, .staff-app .stack-form .taps-sub { font-weight: 400; }
.staff-app .stack-form input:not([type="checkbox"]):not([type="radio"]),
.staff-app .stack-form select, .staff-app .stack-form textarea { min-height: 40px; font-size: 14px; }
.staff-app .stack-form .dashboard-card + .dashboard-card { margin-top: 0; }
.staff-app .checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; color: var(--ink); }
.staff-app .field-error { color: var(--s-bad); font-size: 12.5px; margin-top: 4px; display: block; font-weight: 500; }
.staff-app .stack-form > .button, .staff-app .stack-form > .hero__ctas { margin-top: 8px; }

/* ---------- Alerts ---------- */

.staff-app .form-success, .staff-app .form-error, .staff-app .form-errors {
    position: relative; margin: 0 0 20px; padding: 12px 16px 12px 18px; border-radius: 9px; font-size: 14px; border: 1px solid;
}
.staff-app .form-success { background: rgba(95, 211, 160, .08); border-color: rgba(95, 211, 160, .35); color: var(--s-ok); }
.staff-app .form-error, .staff-app .form-errors { background: rgba(232, 128, 110, .09); border-color: rgba(232, 128, 110, .4); color: var(--s-bad); }
.staff-app .form-success::before, .staff-app .form-error::before, .staff-app .form-errors::before {
    content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: currentColor;
}

/* ---------- Pills & status ---------- */

.staff-app .pay-pill, .staff-app .role-pill, .staff-app .deadline-pill, .staff-app .status-pill, .staff-app .stuck-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill);
    font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; border: 1px solid transparent;
}
.staff-app .pay-pill::before, .staff-app .deadline-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.staff-app .pay-pill--paid, .staff-app .deadline-pill--ok { background: rgba(95, 211, 160, .12); color: var(--s-ok); }
.staff-app .pay-pill--pending, .staff-app .deadline-pill--soon { background: rgba(214, 162, 74, .14); color: var(--s-warn); }
.staff-app .pay-pill--failed, .staff-app .deadline-pill--overdue { background: rgba(232, 128, 110, .13); color: var(--s-bad); }
.staff-app .pay-pill--refunded { background: rgba(154, 154, 159, .15); color: var(--muted); }
.staff-app .stuck-pill { margin-left: 6px; background: rgba(232, 128, 110, .1); color: #F0A070; border-color: rgba(240, 160, 112, .35); }

/* ---------- Dashboard components ---------- */

.staff-app .stat-strip { gap: 14px; background: none; border: 0; border-radius: 0; overflow: visible; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 22px; }
.staff-app .stat-strip > div {
    background: var(--s-card); border: 1px solid var(--s-line); border-radius: var(--s-radius); padding: 18px 20px;
    font-size: 12.5px; letter-spacing: .02em; transition: border-color .15s, transform .15s;
}
.staff-app .stat-strip > div:hover { border-color: var(--s-line-2); }
.staff-app .stat-strip__n { font-size: 32px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.staff-app .kpi { border-radius: var(--s-radius); background: var(--s-card); border-color: var(--s-line); padding: 18px 20px; }
.staff-app .kpi dd { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

.staff-app .taps-grid { gap: 22px; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }


.staff-app .attention__list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.staff-app .attention__item {
    position: relative; padding: 14px 16px 14px 18px; border-radius: 9px; background: var(--s-card); border-color: var(--s-line);
    transition: border-color .15s, background .15s, transform .15s; overflow: hidden;
}
.staff-app .attention__item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--s-warn); }
.staff-app .attention__item--money::before { background: var(--s-ok); }
.staff-app .attention__item--info::before { background: var(--s-info); }
.staff-app .attention__item:hover { border-color: var(--s-line-2); background: var(--s-card-2); transform: translateY(-1px); }
.staff-app .attention__count { font-size: 24px; min-width: 40px; font-variant-numeric: tabular-nums; }
.staff-app .attention__item--info .attention__count { color: var(--s-info); }
.staff-app .attention__text { font-size: 14px; font-weight: 500; line-height: 1.35; }
.staff-app .attention__text small { margin-top: 3px; font-weight: 400; }

.staff-app .feed li { padding: 12px 0; }
.staff-app .feed strong { font-size: 13.5px; }

/* Funnel bars (admin dashboard) */
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.funnel li { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 12px; font-size: 13.5px; }
.funnel a { color: var(--ink); text-decoration: none; font-weight: 500; }
.funnel a:hover { color: var(--accent); }
.funnel__bar { height: 8px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .06); overflow: hidden; }
.funnel__bar i { display: block; height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--accent), #E8C07A); min-width: 3px; }
.funnel li.is-muted .funnel__bar i { background: rgba(154, 154, 159, .5); }
.funnel__n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.money-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.money-tiles > div { background: var(--s-card-2); border: 1px solid var(--s-line); border-radius: 9px; padding: 12px 14px; }
.money-tiles dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.money-tiles dd { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.money-tiles .is-paid dd { color: var(--s-ok); }
.money-tiles .is-pending dd { color: var(--s-warn); }

.mini-facts { margin: 0; display: grid; gap: 0; }
.mini-facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--s-line); font-size: 14px; }
.mini-facts > div:last-child { border-bottom: 0; }
.mini-facts dt { color: var(--muted); }
.mini-facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.staff-app .locator__facts { grid-template-columns: 1fr; gap: 0; }
.staff-app .locator__facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--s-line); }
.staff-app .locator__facts > div:last-child { border-bottom: 0; }
.staff-app .locator__facts dt { margin: 0; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.staff-app .locator__facts dt a { color: var(--ink); text-decoration: none; }
.staff-app .locator__facts dt a:hover { color: var(--accent); }
.staff-app .locator__facts dd { font-family: var(--font-body); font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.staff-app .payment-card__head strong a { color: var(--ink); }
.staff-app .pipeline__col { border-radius: var(--s-radius); background: var(--s-card); border-color: var(--s-line); }
.staff-app .pipeline__card { border-radius: var(--radius-md); background: var(--s-card-2); border-color: var(--s-line); }
.staff-app .pipeline__card:hover { border-color: var(--s-line-2); }
.staff-app .manage__panel { border-radius: var(--s-radius); }

/* ---------- Login screens (no sidebar) ---------- */

.staff-app > .taps-header { background: var(--s-side); }
.staff-app > main .container { max-width: 480px; margin: 0 auto; }
.staff-app > main .taps-main { max-width: 520px; margin: 6vh auto 0; padding: 32px 24px; }

/* ---------- Palette dialog polish ---------- */

.staff-app .palette { border-radius: 14px; background: var(--s-card-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }

/* ---------- Narrow screens: sidebar becomes a drawer ---------- */

@media (max-width: 960px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .shell__side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s var(--ease-out); box-shadow: none; }
    body.shell-open .shell__side { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .7); }
    .shell__scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 35; }
    body.shell-open .shell__scrim { opacity: 1; pointer-events: auto; }
    body.shell-open { overflow: hidden; }
    .shell__burger { display: inline-grid; }
    .shell__top { padding: 10px 16px; }
    .shell__palette { display: none; }
    .staff-app .taps-main { padding: 22px 16px 64px; }
    .shell__search { max-width: none; }
    .staff-app .attention__list { grid-template-columns: minmax(0, 1fr); }
    .funnel li { grid-template-columns: 104px 1fr 34px; }
}

@media (max-width: 700px) {
    .staff-app .shell__link, .staff-app .shell__sub a { min-height: 44px; }
    .staff-app input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .staff-app select { font-size: 16px; }
    .money-tiles { grid-template-columns: minmax(0, 1fr); }
    .staff-app .dashboard-card { padding: 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .shell__side, .shell__scrim, .attention__item, .shell__summary .ico { transition: none; }
}

/* Specificity: the generic control rule above must not flatten the search field's icon gutter. */
.staff-app .shell__search input[type="search"] { padding: 0 14px 0 40px; min-height: 38px; height: 38px; }

/* Labels that wrap a control (settings, most admin forms): stack label text, control, hint. */
.staff-app .stack-form label:has(> input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])),
.staff-app .stack-form label:has(> select),
.staff-app .stack-form label:has(> textarea) { display: grid; gap: 6px; justify-items: start; }
.staff-app .stack-form label:has(> input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])):not(:has(> [style*="max-width"])) input,
.staff-app .stack-form label:has(> select) select,
.staff-app .stack-form label:has(> textarea) textarea { width: 100%; }
.staff-app .shell__search input[type="search"]:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]) { padding: 0 14px 0 40px; min-height: 38px; }

/* ---------- Sidebar count badges ---------- */

.shell__badge {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill);
    display: inline-grid; place-items: center;
    background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
}
.shell__sub a { gap: 8px; }
.shell__sub a > span:first-child { flex: 1; }
.shell__summary .shell__badge { margin-left: 0; }

/* ---------- Candidate file: header + stepper ---------- */

.cand-hero {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 20px; align-items: center;
    padding: 22px 24px; margin-bottom: 22px;
    background: linear-gradient(135deg, rgba(214, 162, 74, 0.07), var(--s-card) 45%);
    border: 1px solid var(--s-line); border-radius: 14px;
}
.cand-hero__avatar {
    width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink); font: 800 28px var(--font-display);
}
.cand-hero h1 { margin: 2px 0 6px; font-size: clamp(22px, 2.4vw, 30px); }
.cand-hero .eyebrow { display: block; margin: 0; font-size: 11px; letter-spacing: .12em; color: var(--accent); }
.cand-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; font-size: 13.5px; color: var(--muted); }
.cand-hero__note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.cand-hero__note.is-mine { color: var(--s-ok); }
.status-pill--solid { background: rgba(79, 195, 214, 0.14); color: var(--s-info); border: 1px solid rgba(79, 195, 214, 0.3); }
.status-pill--warn { background: rgba(214, 162, 74, .14); color: var(--s-warn); border: 1px solid rgba(214, 162, 74, .35); }
.cand-hero__clock { text-align: right; line-height: 1.2; }
.cand-hero__clock strong { display: block; font: 800 34px var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cand-hero__clock span { font-size: 12px; color: var(--muted); max-width: 14ch; display: inline-block; }
.cand-hero__clock.is-soon strong { color: var(--s-warn); }
.cand-hero__clock.is-late strong { color: var(--s-bad); }

.stepper { grid-column: 1 / -1; list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; counter-reset: st; }
.stepper li { position: relative; padding-top: 16px; font-size: 12px; color: var(--muted-dim); font-weight: 600; letter-spacing: .02em; }
.stepper li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); }
.stepper li.is-done::before { background: rgba(214, 162, 74, .55); }
.stepper li.is-now::before { background: var(--accent); }
.stepper li.is-done { color: var(--muted); }
.stepper li.is-now { color: var(--accent); }

/* Two-column file pages: main flow + a sticky rail that scrolls on its own if it is long */
.staff-app .taps-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); align-items: start; }
.staff-app .taps-grid > div:last-child:not(:only-child) {
    position: sticky; top: 78px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: var(--s-line-2) transparent; padding-right: 2px;
}
@media (max-width: 1180px) {
    .staff-app .taps-grid { grid-template-columns: minmax(0, 1fr); }
    .staff-app .taps-grid > div:last-child:not(:only-child) { position: static; max-height: none; overflow: visible; }
    .cand-hero { grid-template-columns: auto minmax(0, 1fr); }
    .cand-hero__clock { grid-column: 1 / -1; text-align: left; display: flex; align-items: baseline; gap: 10px; }
    .cand-hero__clock strong { display: inline; font-size: 26px; }
}
@media (max-width: 560px) {
    .cand-hero { padding: 18px 16px; }
    .cand-hero__avatar { width: 48px; height: 48px; font-size: 22px; border-radius: var(--radius-lg); }
    .stepper li span { display: none; }
    .stepper li.is-now span { display: block; position: absolute; top: 16px; left: 0; white-space: nowrap; }
    .stepper { margin-bottom: 18px; }
}

/* Staff tags row on the admin candidate page */
.staff-app .taps-tags { padding: 10px 14px; background: var(--s-card); border: 1px solid var(--s-line); border-radius: var(--s-radius); }
.staff-app .taps-tags .status-pill { background: rgba(255, 255, 255, .06); color: var(--ink); border: 1px solid var(--s-line); padding: 2px 4px 2px 10px; }
.staff-app .taps-tags input[type="text"] { min-height: 34px; padding: 5px 10px; }
.staff-app .taps-tags .button { min-height: 34px; padding: 4px 12px; }
.staff-app .status-pill { border-radius: var(--radius-pill); padding: 3px 10px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; }

/* Document checklist & notes inside file cards */
.staff-app .doc-checklist li { padding: 12px 0; }
.staff-app .note-list li { padding: 14px 0; }
.staff-app .note-meta { color: var(--muted); letter-spacing: .06em; }

/* ---------- Pipeline board ---------- */

.staff-app .pipeline { grid-auto-columns: minmax(260px, 1fr); gap: 14px; padding-bottom: 16px; scrollbar-width: thin; scrollbar-color: var(--s-line-2) transparent; }
.staff-app .pipeline__col { padding: 14px; background: var(--s-card); }
.staff-app .pipeline__head { padding-bottom: 10px; border-bottom: 1px solid var(--s-line); margin-bottom: 4px; }
.staff-app .pipeline__head h2 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-family: var(--font-body); }
.staff-app .pipeline__count { background: rgba(214, 162, 74, .14); border-radius: var(--radius-pill); padding: 1px 9px; font-size: 12px; }
.staff-app .pipeline__card { padding: 12px; gap: 6px; transition: border-color .15s, transform .15s; }
.staff-app .pipeline__card:hover { transform: translateY(-1px); }
.staff-app .pipeline__card a { color: var(--ink); font-weight: 600; }
.staff-app .pipeline__tag { border-radius: var(--radius-pill); padding: 1px 8px; }

/* ---------- Employer and partner dashboards ---------- */

.staff-app .kpi-grid { gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.staff-app .dashboard-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.staff-app .timeline li { grid-template-columns: 10em 1fr; padding: 12px 0; }
.staff-app .timeline time { color: var(--muted); }

/* ---------- Misc controls ---------- */

.staff-app details.manage > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--s-line-2); border-radius: var(--radius-md); color: var(--accent); }
.staff-app details.manage > summary::-webkit-details-marker { display: none; }
.staff-app details.manage[open] > summary { background: rgba(214, 162, 74, .08); }
.staff-app hr { border: 0; border-top: 1px solid var(--s-line); margin: 20px 0; }
.staff-app code, .staff-app kbd { font-size: .9em; }
.staff-app ::selection { background: rgba(214, 162, 74, .35); }
.shell__summary .shell__badge, .shell__sub .shell__badge { flex: none; }

/* Tables that don't use .taps-table (roles-table) get the same treatment */
.staff-app .roles-table { margin: 0 0 20px; background: var(--s-card); border: 1px solid var(--s-line); border-radius: var(--s-radius); overflow: hidden; }
.staff-app .roles-table th { font-family: var(--font-body); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--s-card-2); padding: 11px 16px; }
.staff-app .roles-table td { padding: 13px 16px; border-bottom-color: var(--s-line); }
.staff-app .roles-table tbody tr:hover { background: rgba(255, 255, 255, .03); }
.staff-app .roles-table td a { color: var(--ink); font-weight: 600; text-decoration-color: var(--s-line-2); }
.staff-app .roles-table td a:hover { color: var(--accent); }
.staff-app .taps-table-wrap--auto { margin-bottom: 18px; }

@media (min-width: 961px) { .shell__top--bare { display: none; } }

/* Checklist ("getting started") used on the employer dashboard */
.staff-app .wait-hub__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.staff-app .wait-hub__item { display: flex; gap: 14px; align-items: flex-start; padding: 10px 12px; border: 1px solid transparent; border-radius: 9px; }
.staff-app .wait-hub__item:hover { background: rgba(255, 255, 255, .03); }
.staff-app .wait-hub__item p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.staff-app .wait-hub__check { flex: none; width: 24px; height: 24px; margin-top: 1px; display: grid; place-items: center; border: 1.5px solid var(--s-line-2); border-radius: 50%; font-size: 13px; color: transparent; }
.staff-app .wait-hub__item.is-done .wait-hub__check { background: var(--s-ok); border-color: var(--s-ok); color: #06140D; font-weight: 800; }
.staff-app .wait-hub__item.is-done strong { color: var(--muted); font-weight: 500; }
.staff-app .wait-hub__item a { text-decoration: none; }
.staff-app .wait-hub__item a:hover strong { color: var(--accent); }

.staff-app .linkbox { margin: 0 0 12px; }
.staff-app .linkbox code { display: block; padding: 14px 16px; background: var(--s-card-2); border: 1px dashed var(--s-line-2); border-radius: 9px; color: var(--accent); font-size: 14px; overflow-wrap: anywhere; user-select: all; }
.staff-app .kpi dt { text-transform: none; letter-spacing: 0; font-size: 13px; }
.staff-app .kpi dd { font-size: 28px; line-height: 1.15; }

/* ---------- Form grid (fields grouped by staff.js) ---------- */

.staff-app form.stack-form.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 22px; max-width: 980px; align-items: start; }
.staff-app form.stack-form.is-grid > * { grid-column: 1 / -1; margin-top: 0; }
.staff-app form.stack-form.is-grid > .field { grid-column: auto; min-width: 0; margin-bottom: 14px; }
.staff-app form.stack-form.is-grid > .field--wide { grid-column: 1 / -1; }
.staff-app form.stack-form .field > label { margin: 0 0 6px; }
.staff-app form.stack-form .field > input,
.staff-app form.stack-form .field > select,
.staff-app form.stack-form .field > textarea { width: 100%; }
.staff-app form.stack-form .field > small,
.staff-app form.stack-form .field > .taps-sub { display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.45; }
.staff-app form.stack-form.is-grid > .button, .staff-app form.stack-form.is-grid > .hero__ctas { justify-self: start; margin-top: 6px; }
/* forms inside narrow side rails stay one column */
.staff-app .taps-grid > div:last-child form.stack-form.is-grid { grid-template-columns: minmax(0, 1fr); }

/* ---------- Filter bars ---------- */

.staff-app .taps-filters { align-items: flex-end; }
.staff-app .taps-filters > label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.staff-app .taps-filters > label br { display: none; }
.staff-app .taps-filters > label select,
.staff-app .taps-filters > label input { font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink); min-height: 38px; }
.staff-app .taps-filters > .button, .staff-app .taps-filters > a.button { align-self: flex-end; }
.staff-app .taps-filters > label:has(> input[type="checkbox"]) { flex-direction: row; align-items: center; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--ink); min-height: 38px; }
.staff-app .taps-filters > label input[type="search"] { flex: none; width: min(260px, 100%); }
.staff-app .taps-table td code { white-space: nowrap; font-size: 12.5px; }

/* Section headings that sit directly on the page (not inside a card) */
.staff-app .taps-main > h2,
.staff-app .taps-main > section > h2 {
    display: flex; align-items: center; gap: 12px;
    margin: 30px 0 14px; font: 700 12px var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.staff-app .taps-main > h2::after,
.staff-app .taps-main > section > h2::after { content: ""; flex: 1; height: 1px; background: var(--s-line); }
.staff-app .taps-main > p:not([class]) { color: var(--muted); font-size: 14px; }

/* Row actions: buttons in the last column of a table stay compact */
.staff-app .taps-table td:last-child .button, .staff-app .taps-table td:last-child .link-button { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.staff-app .taps-table td:last-child:has(> .button, > form, > details, > a.button) { white-space: nowrap; }
.staff-app .empty-state p { color: var(--muted); }
.staff-app .taps-filters > label select, .staff-app .taps-filters > label input { flex: none; }
@media (max-width: 700px) {
    .staff-app .taps-filters > label { flex: 1 1 100%; }
    .staff-app .taps-filters > label select, .staff-app .taps-filters > label input { width: 100%; min-height: 44px; }
    .staff-app .taps-filters > label input[type="search"] { width: 100%; }
}

/* ---------- Style guide page ---------- */

.styleguide code { font-size: 12px; color: var(--accent-2); }
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 12px; }
.sg-swatch { display: grid; gap: 2px; }
.sg-swatch__chip { height: 44px; border-radius: var(--radius-md); border: 1px solid var(--s-line-2); margin-bottom: 4px; }
.sg-swatch small { color: var(--muted); font-size: 12.5px; }
.sg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin: 0 0 16px; }
.sg-row small { color: var(--muted); font-size: 12px; margin-left: 6px; }
.sg-space { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.sg-space i { display: block; height: 14px; background: var(--accent); border-radius: 2px; }
.sg-radius { display: inline-grid; place-items: center; min-width: 120px; height: 52px; padding: 0 12px; background: var(--s-card-2); border: 1px solid var(--s-line-2); font-size: 12.5px; color: var(--muted); }
.sg-shadow { display: inline-grid; place-items: center; min-width: 140px; height: 64px; background: var(--s-card-2); border-radius: var(--radius-lg); }

/* ---------- Admin "What's new" bell ---------- */

.shell__news { position: relative; margin-left: auto; }
.shell__top .shell__palette { margin-left: 0; }
.shell__news-btn {
    position: relative; width: 38px; height: 38px; display: grid; place-items: center;
    background: transparent; border: 1px solid var(--s-line); border-radius: var(--radius-md); color: var(--muted); cursor: pointer;
}
.shell__news-btn:hover, .shell__news-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--s-line-2); }
.shell__news-badge {
    position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-pill);
    display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; line-height: 1;
}
.shell__news-badge[hidden] { display: none; }
.shell__news-panel {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow-y: auto;
    background: var(--s-card-2); border: 1px solid var(--s-line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-3); padding: 14px 16px 12px;
}
.shell__news-panel[hidden] { display: none; }
.shell__news-head { margin: 0 0 8px; font: 700 11.5px var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.shell__news-empty { margin: 8px 0 12px; font-size: 14px; color: var(--muted); }
.shell__news-list { list-style: none; margin: 0 0 8px; padding: 0; }
.shell__news-list li { display: grid; gap: 2px; padding: 10px 0 10px 12px; border-top: 1px solid var(--s-line); border-left: 3px solid transparent; font-size: 14px; }
.shell__news-list li:first-child { border-top: 0; }
.shell__news-list li.is-new { border-left-color: var(--accent); background: linear-gradient(90deg, rgba(214, 162, 74, .08), transparent 70%); }
.shell__news-list strong { font-weight: 600; color: var(--ink); }
.shell__news-list span { color: var(--muted); overflow-wrap: anywhere; }
.shell__news-list small { color: var(--muted-dim); font-size: 12px; }
.shell__news-more { display: inline-block; padding: 6px 0; font-size: 13px; }
@media (max-width: 960px) { .shell__news { margin-left: auto; } }

/* ---------- Employer: compare candidates side by side ---------- */

.compare-select__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; }
.compare-select__bar .button[disabled] { opacity: .5; cursor: not-allowed; }
.compare-wrap { overflow-x: auto; border: 1px solid var(--s-line); border-radius: var(--s-radius); background: var(--s-card); }
.compare { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.compare th, .compare td { padding: 14px 16px; border-bottom: 1px solid var(--s-line); vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.compare thead th { background: var(--s-card-2); border-bottom: 1px solid var(--s-line-2); }
.compare thead th:first-child, .compare tbody th { width: 150px; }
.compare tbody th { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; background: rgba(255, 255, 255, .02); }
.compare__name { display: block; margin-bottom: 6px; font: 800 17px var(--font-display); color: var(--ink); text-decoration: none; }
.compare__name:hover { color: var(--accent); }
.compare__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.compare__none { color: var(--muted-dim); }
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
.compare thead th:not(:first-child), .compare tbody td { border-left: 1px solid var(--s-line); }
@media (max-width: 700px) { .compare { min-width: 560px; } .compare thead th:first-child, .compare tbody th { width: 110px; } }
.compare tbody th { overflow-wrap: normal; word-break: normal; hyphens: none; letter-spacing: .04em; }
@media (max-width: 700px) { .compare thead th:first-child, .compare tbody th { width: 118px; font-size: 10.5px; padding-left: 12px; padding-right: 8px; } }

/* ---------- Dashboard trends: four tiles, 14 daily bars each ---------- */
.staff-app .trend-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0 0 22px; }
.staff-app .trend { display: grid; gap: 2px; padding: 16px 18px; background: var(--s-card); border: 1px solid var(--s-line); border-radius: var(--s-radius); }
.staff-app .trend__label { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.staff-app .trend__n { font-size: 28px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.staff-app .trend__delta { font-size: 12px; color: var(--muted); }
.staff-app .trend__delta.is-up { color: var(--s-ok); }
.staff-app .trend__delta.is-down { color: var(--s-warn); }
.staff-app .trend__bars { width: 100%; height: 34px; margin-top: 8px; fill: var(--accent); opacity: .85; }

/* Capacity bar under a specialist's load figure */
.staff-app .load-bar { display: block; width: 110px; height: 5px; margin-top: 6px; border-radius: 3px; background: var(--s-line); overflow: hidden; }
.staff-app .load-bar i { display: block; height: 100%; background: var(--s-ok); }
.staff-app .load-bar.is-high i { background: var(--s-warn); }
.staff-app .load-bar.is-over i { background: var(--s-bad); }

/* Back link plus previous / next on a candidate file opened from a list */
.staff-app .file-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.staff-app .file-nav__steps { display: inline-flex; align-items: center; gap: 14px; }
.staff-app .file-nav__steps a { color: var(--accent); text-decoration: none; }
.staff-app .file-nav__steps a:hover { text-decoration: underline; }

/* Stock sentences above a note box */
.staff-app .quick-fill { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 2px 0 6px; font-size: 13px; }
.staff-app .quick-fill .link-button { display: inline; width: auto; min-height: 0; margin: 0; padding: 0; color: var(--accent); text-align: left; font-size: 13px; line-height: 1.4; }
.staff-app .quick-fill .link-button:hover { text-decoration: underline; }
