/* The fonts are served locally; the application needs no font CDN. */
@font-face {
    font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url("./fonts/public-sans-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap;
    src: url("./fonts/source-sans-3-latin.woff2") format("woff2");
}
:root {
    --ink: #263746; --muted: #607180; --line: #dce2e7; --surface: #fff;
    --canvas: #f3f5f7; --brand: #285f7a; --brand-2: #34728f; --brand-soft: #eaf1f5;
    --nav: #233f50; --accent: #a36b13; --danger: #b13f3f; --danger-soft: #fcEEEE; --success: #276a50;
    --shadow: 0 8px 24px rgb(35 63 80 / 12%); --radius: 8px;
    --heading-font: "Public Sans", "Segoe UI", sans-serif;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--ink); background: var(--canvas); font-synthesis: none;
    line-height: 1.5; color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); text-underline-offset: 3px; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
:where(button, a, summary, [tabindex]):focus-visible { outline: 2px solid var(--brand-2); outline-offset: 4px; }
h1, h2, h3, .brand { font-family: var(--heading-font); }
h3 { font-size: 1rem; font-weight: 650; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 110; padding: 10px 16px; background: var(--surface); border: 1px solid var(--brand); border-radius: 4px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.focused-row > td {
    animation: focused-row-fade 2.8s ease-out;
}
.focused-row { scroll-margin-block: 120px; }
@keyframes focused-row-fade {
    0%, 22% {
        background-color: #fff3c4;
        box-shadow: inset 4px 0 0 #d79516;
    }
    100% {
        background-color: transparent;
        box-shadow: inset 4px 0 0 transparent;
    }
}
@media (prefers-reduced-motion: reduce) {
    .focused-row > td { animation-duration: .01ms; }
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 650; letter-spacing: -.035em; }
.brand-mark { width: 36px; height: 36px; border-radius: 5px; display: grid; place-items: center; color: #fff;
    background: var(--brand); font: 650 .88rem var(--heading-font); letter-spacing: -.04em; flex-shrink: 0; }

.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(330px, .95fr) minmax(360px, 1.05fr); background: var(--surface); }
.auth-intro { padding: 48px clamp(32px, 6vw, 90px); color: #fff; background: var(--nav);
    display: flex; flex-direction: column; align-items: flex-start; }
.auth-intro .brand { font-size: 1.3rem; }
.auth-intro .brand-mark { background: #fff; color: var(--nav); }
.auth-intro-copy { margin: auto 0; padding: 80px 0; }
.auth-intro h1 { font-size: clamp(2rem, 3.6vw, 3.4rem); font-weight: 550; line-height: 1.16; letter-spacing: -.045em; margin: 0 0 24px; }
.auth-intro p { font-size: 1.08rem; line-height: 1.6; color: #c8d7e0; max-width: 390px; }
.auth-features { display: grid; gap: 0; margin-top: 36px; max-width: 390px; }
.auth-features > div { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid #476170; color: #e2eaf0; font-size: .94rem; }
.auth-features .icon { color: #a8c6d7; }
.trust-note { padding-top: 20px; color: #bbccd7; font-size: .84rem; }
.auth-card { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 32px; }
.auth-card form { width: min(380px, 100%); }
.auth-card h2 { font-size: 1.8rem; font-weight: 600; margin: 0 0 10px; letter-spacing: -.035em; }
.auth-card .auth-description { margin: 0 0 8px; color: var(--muted); }
.auth-mobile-brand { display: none; }
.eyebrow { color: var(--muted); font-size: .83rem; font-weight: 600; }
.stack { display: grid; gap: 19px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #8696a2; border-radius: 5px; padding: 9px 11px; background: var(--surface); color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgb(52 114 143 / 14%); }
input:disabled, select:disabled { background: var(--canvas); color: var(--muted); }
input::placeholder, textarea::placeholder { color: #74818d; font-weight: 400; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
textarea { min-height: 85px; resize: vertical; }
.form-error { min-height: 20px; margin: 0; color: var(--danger); font-size: .88rem; }
.dev-quick-login { display: grid; gap: 7px; margin-top: 4px; padding-top: 20px; border-top: 1px solid var(--line); }
.dev-quick-login > div { display: grid; gap: 2px; margin-bottom: 5px; color: var(--ink); font-size: .86rem; }
.dev-quick-login > div span { color: var(--muted); font-size: .8rem; }
.dev-quick-login .button { background: var(--canvas); padding: 8px 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--nav); color: #dbe5eb; display: flex; flex-direction: column; padding: 26px 12px 18px; z-index: 20; }
.sidebar-brand { padding: 0 12px 28px; color: #fff; font-size: 1.03rem; }
.sidebar-brand .brand-mark { width: 30px; height: 32px; background: #dce9f0; color: var(--nav); font-size: .76rem; }
#main-nav { overflow-y: auto; min-height: 0; flex: 1; padding-bottom: 20px; scrollbar-width: thin; scrollbar-color: #627b8a transparent; }
.sidebar .nav-group { display: grid; gap: 2px; }
.sidebar .nav-group + .nav-group { margin-top: 20px; }
.sidebar .nav-group-title { margin: 0 12px 7px; color: #aac0ce; font-size: .73rem; font-weight: 500; line-height: 1.3; }
.sidebar nav a { display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 4px;
    color: #d0dce4; text-decoration: none; font-size: .92rem; font-weight: 500; border-left: 2px solid transparent; }
.sidebar nav a .icon { width: 18px; height: 18px; color: #afc4d1; }
.sidebar nav a:hover { background: #304f61; color: #fff; }
.sidebar nav a.active { background: #3b5b6e; border-left-color: #b3d5e6; color: #fff; font-weight: 650; }
.sidebar nav a.active .icon { color: #fff; }
.sidebar nav a:focus-visible { outline-color: #b3d5e6; outline-offset: -2px; }
.sidebar nav a.history-only { border-right: 1px dashed #738e9e; }
.sidebar-foot { padding: 16px 12px 0; border-top: 1px solid #476170; color: #bbced9; font-size: .8rem; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #9bd5b7; }
.status-dot.offline { background: var(--accent); }
.sidebar-backdrop { display: none; }
.workspace { min-width: 0; }
.topbar { min-height: 72px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 16px; padding: 12px clamp(20px, 3vw, 42px);
    background: var(--surface); border-bottom: 1px solid var(--line); }
.company-picker { display: grid; gap: 1px; min-width: 0; font-weight: 400; color: var(--muted); }
.company-picker > span { font-size: .74rem; }
.company-picker select { max-width: min(390px, 32vw); min-width: 210px; padding: 0 24px 0 0; border: 0; border-radius: 2px; font-weight: 600; font-size: .97rem; color: var(--ink); background-color: transparent; cursor: pointer; }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.user-button { border: 1px solid var(--line); background: var(--canvas); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; font-size: .79rem; font-weight: 650; cursor: pointer; }
.menu-button { display: none; }
.page { padding: 32px clamp(20px, 3vw, 42px) 55px; max-width: 1540px; margin: 0 auto; outline: none; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.page-header h1 { margin: 0; font-size: clamp(1.5rem, 2.3vw, 1.9rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.25; }
.page-header p { margin: 8px 0 0; color: var(--muted); font-size: .95rem; max-width: 75ch; }
.header-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; border: 1px solid #c1ccd5; border-radius: 5px; padding: 8px 14px; background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 600; font-size: .88rem; line-height: 1.4; text-decoration: none; }
.button:hover { border-color: #8299a9; background: #f5f8fa; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.button.primary:hover { background: var(--nav); border-color: var(--nav); }
.button.danger { color: var(--danger); border-color: #efcccc; }
.button.ghost { border-color: transparent; background: transparent; }
.button.small { min-height: 32px; padding: 6px 10px; font-size: .82rem; }
.button.wide { width: 100%; padding: 12px; }
.icon-button { border: 0; border-radius: 4px; background: transparent; color: var(--ink); min-width: 36px; min-height: 36px; padding: 6px; cursor: pointer; font-size: 1.25rem; }
.icon-button:hover { background: var(--brand-soft); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 0; margin-bottom: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.stat-card { min-width: 0; padding: 20px 22px; }
.stat-card + .stat-card { border-left: 1px solid var(--line); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat-label { color: var(--muted); font-size: .85rem; font-weight: 500; }
.stat-value { display: block; margin-top: 10px; font-family: var(--heading-font); font-size: clamp(1.15rem, 1.8vw, 1.65rem); font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-note { display: block; margin-top: 6px; color: var(--muted); font-size: .79rem; }
.overview-balances { border-top: 3px solid var(--brand); margin-bottom: 30px; }
.overview-balances .stat-card:first-child { background: #edf3f7; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.overview-tasks .quick-grid { grid-template-columns: 1fr; padding: 4px 20px; gap: 0; }
.overview-tasks .quick-action { padding: 15px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.overview-tasks .quick-action:last-child { border-bottom: 0; }
.overview-tasks .quick-action:hover { background: #f5f8fa; }
.overview-tasks .quick-action strong { font-weight: 600; }
.overview-side { display: grid; gap: 24px; }
.year-summary { margin: 0; }
.year-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.year-summary > div:first-child { padding-top: 0; }
.year-summary > div:last-child { padding-bottom: 0; border-bottom: 0; }
.year-summary dt { font-weight: 400; color: var(--muted); }
.year-summary dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.card { overflow: hidden; }
.card-header { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.card-header h2, .card-header h3 { margin: 0; font-size: .91rem; font-weight: 600; letter-spacing: -.02em; }
.card-header > div > .muted { margin: 3px 0 0; font-size: .8rem; }
.card-body { padding: 20px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.quick-action { display: grid; grid-template-columns: 22px 1fr auto; gap: 14px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); text-decoration: none; color: var(--ink); cursor: pointer; text-align: left; }
.quick-action:hover { border-color: #9fb8c8; background: var(--brand-soft); }
.quick-action > .icon { color: var(--brand); }
.quick-action strong { display: block; margin-bottom: 3px; font-size: .95rem; }
.quick-action small { display: block; color: var(--muted); font-size: .83rem; font-weight: 400; }
.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty strong { color: var(--ink); display: block; margin-bottom: 5px; }
.callout { padding: 13px 16px; border-left: 3px solid #8daebf; border-radius: 3px; background: var(--brand-soft); color: #34586c; font-size: .9rem; }
.callout.warning { background: #fbf4e8; border-left-color: #bb8a3b; color: #78531d; }
.callout.danger { background: var(--danger-soft); border-left-color: var(--danger); color: var(--danger); }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 11px; margin-bottom: 16px; }
.toolbar label { min-width: 150px; }
.toolbar .grow { flex: 1; }
.filter-bar { display: grid; grid-template-columns: minmax(155px, 1.2fr) minmax(130px, 1fr) repeat(2, minmax(140px, .85fr)) minmax(115px, .8fr) auto; gap: 12px; align-items: end; }
.pagination { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .9rem; }
.pagination > div { display: flex; align-items: center; gap: 10px; }
.reconcile-check-cell { width: 62px; text-align: center; }
.checking-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 18px 14px; }
.tabs { display: flex; gap: 20px; padding: 0; border-bottom: 1px solid var(--line); width: 100%; margin-bottom: 22px; overflow-x: auto; }
.tabs button { min-height: 42px; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 8px 2px 11px; color: var(--muted); cursor: pointer; font-size: .93rem; font-weight: 500; white-space: nowrap; }
.tabs button:hover { color: var(--ink); border-bottom-color: #aabfcb; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
.tabs button:focus-visible { outline-offset: -2px; }
.table-wrap { overflow-x: auto; }
.operations-register { min-width: 850px; }
.operations-register td:nth-child(2) { min-width: 180px; }
table { width: 100%; border-collapse: collapse; font-size: .91rem; }
th { padding: 11px 16px; text-align: left; color: var(--muted); font-size: .8rem; font-weight: 600; border-bottom: 1px solid var(--line); }
thead { background: #f7f9fa; }
td { padding: 13px 16px; border-bottom: 1px solid #e9eef1; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f5f8fa; }
tfoot { background: #f7f9fa; border-top: 1px solid var(--line); }
.number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-grand-total { margin-top: 18px; border-top: 2px solid var(--ink); }
.report-grand-total th { font-size: 1rem; }
.report-group { margin: 14px 0 22px; }
.report-group h4 { margin: 0 0 5px; color: var(--muted); font-size: .87rem; font-weight: 600; }
.report-group td, .report-group th { padding-top: 9px; padding-bottom: 9px; }
.balance-equation { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; padding: 14px; border-radius: 5px; background: var(--canvas); font-variant-numeric: tabular-nums; }
.trace-links { display: grid; gap: 8px; }
.trace-row { display: flex; gap: 10px; align-items: baseline; }
.trace-row > span { min-width: 92px; color: var(--muted); }
.trace-row a { font-weight: 750; }
.positive { color: var(--success); } .negative { color: var(--danger); }
.badge { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 4px; font-size: .73rem; font-weight: 600; line-height: 1.4; background: #edf1f4; color: #526370; white-space: nowrap; }
.badge.success { background: #e9f3ed; color: #276a50; } .badge.warning { background: #fbf1df; color: #80591e; }
.badge.danger { background: var(--danger-soft); color: var(--danger); } .badge.info { background: var(--brand-soft); color: var(--brand); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.review-list { display: grid; gap: 9px; }
.review-item { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; padding: 11px 12px;
    border: 1px solid var(--line); border-radius: 5px; color: var(--ink); text-decoration: none; }
.review-item:hover { background: var(--brand-soft); border-color: #a7bdcb; }
.review-item strong { display: grid; place-items: center; min-height: 34px; border-radius: 4px; background: #fbf1df; color: #80591e; }
.review-item span { color: var(--muted); font-size: .86rem; }
.reconcile-paths { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.reconcile-path { min-height: 205px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px; }
.reconcile-path.recommended { border-color: #8daebf; border-top: 3px solid var(--brand); background: var(--surface); }
.reconcile-path h2 { margin: 7px 0 8px; font-size: 1.22rem; }
.reconcile-path p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.reconcile-buckets { padding: 12px; display: grid; gap: 10px; }
.reconcile-bucket { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.reconcile-bucket > summary, .technical-details > summary { list-style: none; cursor: pointer; padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.reconcile-bucket > summary::-webkit-details-marker, .technical-details > summary::-webkit-details-marker { display: none; }
.reconcile-bucket > summary::before, .technical-details > summary::before {
    content: "›"; color: var(--muted); font-size: 1.25rem; transition: transform .15s ease; }
.reconcile-bucket[open] > summary::before, .technical-details[open] > summary::before { transform: rotate(90deg); }
.reconcile-bucket > summary > span:first-of-type { margin-right: auto; }
.reconcile-bucket summary strong { display: block; }
.reconcile-bucket summary small { display: block; margin-top: 3px; color: var(--muted); font-size: .76rem; font-weight: 500; }
.form-details { margin-top: 16px; border: 1px solid var(--line); border-radius: 6px; background: #f7f9fa; }
.form-details > summary { cursor: pointer; padding: 13px 15px; font-weight: 700; color: var(--ink); }
.form-details[open] > summary { border-bottom: 1px solid var(--line); }
.form-details > .form-grid { padding: 15px; }
.bucket-count { min-width: 30px; height: 30px; padding: 0 8px; display: inline-grid; place-items: center;
    border-radius: 4px; background: var(--brand-soft); color: var(--brand); font-size: .8rem; font-weight: 650; }
.bucket-empty { padding: 20px 16px; color: var(--muted); font-size: .84rem; border-top: 1px solid var(--line); }
.technical-details { margin-top: 18px; }
.technical-details > summary { font-weight: 750; }
.technical-details > summary .muted { margin-left: auto; font-size: .78rem; font-weight: 500; }
.candidate-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 18px 0 12px; }
.candidate-toolbar .grow { flex: 1; min-width: 240px; }
.candidate-list { display: grid; gap: 12px; margin-top: 12px; }
.candidate-section { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.candidate-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; }
.candidate-heading h3 { margin: 0; font-size: .94rem; }
.candidate-heading p { margin: 3px 0 0; color: var(--muted); font-size: .76rem; }
.earlier-items { background: #f7f9fa; }
.audit-json { padding: 12px; max-height: 230px; overflow: auto; border: 1px solid var(--line); border-radius: 5px;
    background: var(--canvas); color: var(--ink); font: .75rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
code { font: .78rem ui-monospace, SFMono-Regular, Consolas, monospace; }

.modal { --modal-height: min(90dvh, 900px); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0; width: min(680px, calc(100vw - 28px)); max-height: var(--modal-height); overflow: hidden; box-shadow: 0 20px 60px rgb(22 42 57 / 22%); }
#modal-content, #modal-form { display: flex; flex-direction: column; min-height: 0; max-height: calc(var(--modal-height) - 2px); }
.modal.wide { width: min(980px, calc(100vw - 28px)); }
.modal::backdrop { background: rgb(22 42 57 / 42%); }
.modal-head { display: flex; flex-shrink: 0; justify-content: space-between; align-items: flex-start; padding: 20px 22px 15px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.2rem; font-weight: 600; letter-spacing: -.025em; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: .84rem; }
.modal-body { min-height: 0; padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; flex-shrink: 0; justify-content: flex-end; gap: 9px; padding: 15px 22px; border-top: 1px solid var(--line); background: #f7f9fa; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.check-label { display: flex; align-items: center; gap: 9px; font-weight: 550; }
.check-label input { width: auto; }
.line-editor { display: grid; gap: 10px; }
.line-row { display: grid; grid-template-columns: minmax(150px,1.4fr) minmax(130px,1fr) minmax(95px,.7fr) minmax(105px,.75fr) 38px; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
.pay-adjustments { display: grid; gap: 12px; }
.pay-adjustment { padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #f7f9fa; }
.pay-adjustment > strong { margin-right: 8px; }
.pay-adjustment .form-grid { margin-top: 12px; grid-template-columns: repeat(5, minmax(110px,1fr)); gap: 10px; }
.pay-review-list { display: grid; gap: 10px; margin: 18px 0; }
.pay-review-row { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.pay-review-row.skipped { background: var(--canvas); opacity: .82; }
.pay-review-main { display: grid; grid-template-columns: minmax(180px,1.5fr) auto repeat(5,minmax(85px,.7fr));
    align-items: center; gap: 11px; padding: 13px 14px; }
.pay-review-main .check-label span { display: grid; gap: 2px; }
.pay-review-main small { display: block; color: var(--muted); font-size: .7rem; font-weight: 600; }
.pay-review-main .number strong { display: block; margin-top: 3px; }
.pay-review-row > .form-details { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.pay-review-row > .form-details > summary { padding: 10px 14px; font-size: .8rem; }
.pay-review-row > .form-details > .form-grid { grid-template-columns: repeat(4,minmax(110px,1fr)); }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 9px; width: min(360px, calc(100vw - 40px)); }
.toast { background: var(--nav); color: #fff; padding: 13px 15px; border-radius: 6px; box-shadow: var(--shadow); animation: toast-in .2s ease-out; font-size: .88rem; }
.toast.error { background: #8c3434; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.skeleton { height: 16px; border-radius: 4px; background: linear-gradient(90deg,#e9eef1 25%,#f7f9fa 50%,#e9eef1 75%); background-size: 200% 100%; animation: shine 1.2s infinite; }
@keyframes shine { to { background-position: -200% 0; } }

.admin-action-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0; }
.card.inset { box-shadow: none; border: 1px solid var(--line); margin-top: 16px; }
.feature-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.feature-chip { display: inline-flex; padding: 5px 8px; border-radius: 4px; color: var(--muted);
    background: var(--canvas); border: 1px solid var(--line); font-size: .78rem; font-weight: 600; }
.feature-chip.enabled { color: var(--brand); background: var(--brand-soft); border-color: #b7ccd9; }
.feature-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.feature-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px;
    padding: 14px 16px; background: #fff; }
.feature-row + .feature-row { border-top: 1px solid var(--line); }
.feature-row p { margin: 4px 0; color: var(--muted); font-size: .85rem; }
.feature-row > div:last-child { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.compact-field { display: flex; align-items: center; gap: 8px; font-size: .78rem; }
.compact-field input { min-width: 220px; }
.admin-pager { display: flex; justify-content: flex-end; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.managed-user-row td:first-child { padding-left: 27px; background: #f7f9fa; }
.admin-user-identity { display: flex; align-items: flex-start; gap: 8px; }
.admin-user-identity > div { display: grid; gap: 3px; }
.user-branch { color: var(--brand-2); font-size: 1.05rem; font-weight: 800; line-height: 1.15; }
.owner-toggle { width: fit-content; display: inline-flex; align-items: center; gap: 5px; padding: 2px 0;
    border: 0; background: transparent; color: var(--brand-2); cursor: pointer; font: inherit; font-size: .78rem; font-weight: 700; }
.owner-toggle:hover { color: var(--brand); text-decoration: underline; }
.owner-toggle-icon { display: inline-block; font-size: 1rem; line-height: .8; transition: transform .15s ease; }
.owner-toggle[aria-expanded="true"] .owner-toggle-icon { transform: rotate(90deg); }

@media (max-width: 1250px) {
    .filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .stat-card + .stat-card { border-left: 0; }
    .stat-card:nth-child(even) { border-left: 1px solid var(--line); }
    .stat-card:nth-child(n+3) { border-top: 1px solid var(--line); }
    .stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .overview-grid { gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .overview-side { gap: 18px; }
    .header-actions { gap: 7px; }
    .grid-3 { grid-template-columns: 1fr; }
    .pay-review-main { grid-template-columns: minmax(180px,1fr) auto repeat(3,minmax(80px,.7fr)); }
    .pay-review-main > :nth-last-child(-n+2) { grid-column: auto; }
}
@media (max-width: 780px) {
    .auth-screen { grid-template-columns: 1fr; }
    .auth-intro { display: none; }
    .auth-mobile-brand { display: flex; width: min(380px, 100%); font-size: 1.1rem; margin-bottom: 42px; }
    .auth-card { padding: 32px 24px; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: -244px; width: 224px; transition: left .18s ease; }
    .sidebar.open { left: 0; }
    .sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 18; background: rgb(22 42 57 / 30%); border: 0; }
    .menu-button { display: inline-block; }
    .company-picker span { display: none; }
    .company-picker select { min-width: 0; max-width: 42vw; padding-right: 16px; font-size: .91rem; }
    .page { padding-top: 20px; }
    .grid-2, .overview-grid, .form-grid, .pay-adjustment .form-grid, .reconcile-paths { grid-template-columns: 1fr; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 1.3rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
    .line-row { grid-template-columns: 1fr; }
    .line-row button { justify-self: end; }
    .filter-bar { grid-template-columns: 1fr; }
    .pagination, .checking-banner { align-items: stretch; flex-direction: column; }
    .feature-row { grid-template-columns: 1fr; }
    .feature-row > div:last-child { justify-content: flex-start; }
    .check-grid { grid-template-columns: 1fr; }
    .compact-field input { min-width: 0; width: 150px; }
    .pay-review-main { grid-template-columns: 1fr 1fr; }
    .pay-review-main > .check-label { grid-column: 1 / -1; }
    .pay-review-row > .form-details > .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 470px) {
    .stat-card { padding: 14px; }
    .stat-value { font-size: 1.12rem; }
    .quick-grid { grid-template-columns: 1fr; }
    .topbar { gap: 7px; padding: 0 11px; }
    .topbar .button { width: 36px; height: 36px; padding: 0; }
    .topbar .button-label { display: none; }
    .topbar-actions { gap: 7px; }
    .page { padding-right: 16px; padding-left: 16px; }
    .header-actions { width: 100%; }
    .header-actions .button { flex: 1 1 auto; }
    .card-header, .card-body { padding: 16px; }
    .toolbar label { min-width: 0; flex: 1 1 130px; }
    .toolbar input, .toolbar select { font-size: 1rem; }
    .candidate-toolbar .grow { min-width: 0; flex-basis: 100%; }
    .modal-head, .modal-body, .modal-foot { padding: 16px; }
    .modal-foot { flex-wrap: wrap; }
    .modal input, .modal select, .modal textarea, .auth-card input { font-size: 1rem; }
    .trace-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .focused-row > td { background: #fff3c4; }
}
@media print {
    .sidebar, .sidebar-backdrop, .skip-link, .topbar, .header-actions, .button, .tabs, .toast-region { display: none !important; }
    body { background: #fff; color: #000; }
    .app-shell { display: block; } .page { padding: 0; max-width: none; }
    .card { box-shadow: none; break-inside: avoid; }
    .table-wrap { overflow: visible; }
    .operations-register { min-width: 0; }
    .stats-grid { break-inside: avoid; }
}
