:root {
    --ink: #14223a;
    --ink-2: #243451;
    --paper: #f5f7fb;
    --surface: #ffffff;
    --line: #d8dfeb;
    --line-strong: #aeb9ca;
    --blue: #315bd6;
    --blue-soft: #e8edff;
    --green: #237a64;
    --green-soft: #e4f3ed;
    --red: #d4514b;
    --red-soft: #fde9e7;
    --amber: #c48a21;
    --amber-soft: #fff2d6;
    --slate: #6d7789;
    --slate-soft: #edf0f4;
    --violet: #6952a3;
    --violet-soft: #eee9fb;
    --shadow: 0 14px 40px rgba(20, 34, 58, .08);
    --display: "Avenir Next", "Segoe UI", sans-serif;
    --body: "Avenir Next", "Segoe UI", sans-serif;
    --utility: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--body); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, select, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(49, 91, 214, .34); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 30; width: 238px; padding: 26px 18px 20px;
    display: flex; flex-direction: column; background: var(--ink); color: #fff;
    border-right: 1px solid rgba(255,255,255,.07);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand > span:last-child { display: grid; }
.brand strong { font-size: 14px; letter-spacing: .02em; }
.brand small { color: rgba(255,255,255,.54); font: 10px/1.4 var(--utility); text-transform: uppercase; letter-spacing: .11em; }
.brand-mark { width: 40px; height: 40px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid rgba(255,255,255,.42); }
.brand-mark i { display: grid; place-items: center; font: 700 10px var(--utility); font-style: normal; border-right: 1px solid rgba(255,255,255,.25); }
.brand-mark i:last-child { border-right: 0; background: var(--blue); }

.primary-nav { display: grid; gap: 6px; margin-top: 48px; }
.primary-nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 7px; color: rgba(255,255,255,.68); font-size: 14px; transition: .18s ease; }
.primary-nav a span { width: 18px; text-align: center; font: 16px var(--utility); }
.primary-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.primary-nav a.active { color: #fff; background: rgba(49,91,214,.34); }
.primary-nav a.active::before { content: ""; position: absolute; left: -18px; width: 3px; height: 25px; background: #88a4ff; }
.sidebar-foot { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.11); }
.user-chip { display: flex; gap: 10px; align-items: center; min-width: 0; }
.user-chip > span:last-child { display: grid; min-width: 0; }
.user-chip strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { color: rgba(255,255,255,.5); font: 10px var(--utility); text-transform: uppercase; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: #dce5ff; color: var(--blue); font-weight: 800; }
.quiet-button { margin: 14px 0 0 44px; padding: 0; border: 0; background: transparent; color: rgba(255,255,255,.52); font-size: 11px; cursor: pointer; }
.quiet-button:hover { color: #fff; }

.workspace { min-height: 100vh; margin-left: 238px; }
.main-content { width: min(1560px, 100%); margin: 0 auto; padding: 36px 40px 60px; }
.mobile-bar { display: none; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading.compact { align-items: center; }
.page-heading h1 { margin: 3px 0 3px; font: 750 clamp(28px, 3vw, 43px)/1.08 var(--display); letter-spacing: -.04em; }
.page-heading p:not(.eyebrow) { margin: 0; max-width: 670px; color: var(--slate); }
.eyebrow { margin: 0; color: var(--blue); font: 700 10px/1.4 var(--utility); text-transform: uppercase; letter-spacing: .16em; }
.eyebrow.light { color: #a9bfff; }

.primary-button, .secondary-button, .button-on-dark {
    display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 16px; border-radius: 7px;
    border: 1px solid var(--blue); background: var(--blue); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer;
}
.primary-button:hover { background: #264ab3; }
.secondary-button { background: var(--surface); color: var(--ink); border-color: var(--line); }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.button-on-dark { border-color: #fff; background: #fff; color: var(--ink); }
.button-on-dark:hover { background: #dfe7ff; border-color: #dfe7ff; }
.primary-button.full { width: 100%; }
.text-link { color: var(--blue); font-weight: 700; font-size: 12px; }
.text-link.light { color: #cbd7ff; }
.text-link.centered { display: block; text-align: center; }
.back-link { display: block; margin-bottom: 12px; color: var(--slate); font-size: 12px; }
.heading-actions { display: flex; gap: 10px; align-items: flex-end; }

.month-rail { display: grid; grid-template-columns: repeat(12, minmax(50px, 1fr)); gap: 2px; margin-bottom: 14px; overflow-x: auto; }
.month-tab { min-width: 62px; padding: 9px 8px 8px; background: var(--surface); border-top: 2px solid transparent; text-align: center; }
.month-tab span { display: block; color: var(--slate); font: 9px var(--utility); text-transform: uppercase; letter-spacing: .1em; }
.month-tab strong { font-size: 13px; }
.month-tab:hover { background: var(--blue-soft); }
.month-tab.active { border-top-color: var(--blue); background: var(--ink); color: #fff; }
.month-tab.active span { color: #aebfff; }
.month-tab.empty strong { color: #a7afbb; }

.cutoff-hero { position: relative; min-height: 260px; display: grid; grid-template-columns: 1fr 220px; align-items: center; gap: 30px; padding: 38px 84px 38px 42px; overflow: hidden; background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.cutoff-hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(90deg, black, transparent 85%); }
.cutoff-copy { position: relative; z-index: 1; }
.cutoff-copy h2 { margin: 4px 0; font: 760 clamp(46px, 7vw, 78px)/1 var(--display); letter-spacing: -.055em; }
.cutoff-copy h2 span { color: #8ba8ff; font-weight: 450; }
.cutoff-copy > p:not(.eyebrow) { margin: 12px 0 0; color: #b6c0d0; }
.hero-actions { display: flex; align-items: center; gap: 18px; margin-top: 28px; }
.progress-seal { position: relative; z-index: 1; width: 178px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(#82a2ff var(--progress), rgba(255,255,255,.1) 0); display: grid; place-items: center; }
.progress-seal::before { content: ""; position: absolute; width: 142px; aspect-ratio: 1; border-radius: 50%; background: var(--ink); border: 1px dashed rgba(255,255,255,.28); }
.progress-seal div { position: relative; display: grid; text-align: center; }
.progress-seal strong { font: 760 32px var(--display); }
.progress-seal span { color: #aeb8c9; font: 9px var(--utility); text-transform: uppercase; letter-spacing: .12em; }
.folio-tab { position: absolute; right: 0; top: 0; bottom: 0; width: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--blue); border-left: 1px dashed rgba(255,255,255,.45); }
.folio-tab span { writing-mode: vertical-rl; transform: rotate(180deg); font: 700 9px var(--utility); letter-spacing: .2em; }
.folio-tab strong { margin-top: 15px; font: 800 24px var(--display); }
.folio-tab small { font: 9px var(--utility); }

.control-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.control-strip > div { padding: 20px 24px; border-right: 1px solid var(--line); }
.control-strip > div:last-child { border-right: 0; }
.control-strip span { display: block; color: var(--slate); font-size: 11px; }
.control-strip strong { display: inline-block; margin: 2px 8px 0 0; font: 750 28px var(--display); }
.control-strip small { color: var(--slate); font-size: 10px; }
.control-strip .danger strong { color: var(--red); }
.control-strip .warning strong { color: var(--amber); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, .7fr); gap: 18px; margin-top: 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(20,34,58,.04); }
.attention-panel, .recent-panel, .history-panel, .audit-panel { padding: 24px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 4px 0 0; font: 730 20px var(--display); letter-spacing: -.02em; }
.attention-list { margin-top: 18px; border-top: 1px solid var(--line); }
.attention-list > a { display: grid; grid-template-columns: 5px minmax(210px, 1fr) auto 80px 38px; align-items: center; gap: 14px; min-height: 63px; padding: 8px 5px; border-bottom: 1px solid var(--line); }
.attention-list > a:hover { background: #f8faff; }
.signal { width: 4px; height: 28px; border-radius: 3px; }
.signal.red { background: var(--red); }
.signal.amber { background: var(--amber); }
.attention-name { display: grid; min-width: 0; }
.attention-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.attention-name small { color: var(--slate); font: 10px var(--utility); }
.attention-reason { display: grid; justify-items: end; }
.attention-reason b { color: var(--red); font-size: 10px; }
.attention-reason em { color: var(--amber); font-size: 10px; font-style: normal; }
.mini-progress { height: 5px; overflow: hidden; background: var(--slate-soft); }
.mini-progress i { display: block; height: 100%; background: var(--blue); }
.percentage { font: 11px var(--utility); text-align: right; }
.activity-feed { list-style: none; padding: 0; margin: 20px 0 0; }
.activity-feed li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; min-height: 54px; }
.activity-feed li > span { position: relative; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--blue); }
.activity-feed li > span::after { content: ""; position: absolute; top: 12px; left: 3px; width: 1px; height: 36px; background: var(--line); }
.activity-feed li:last-child > span::after { display: none; }
.activity-feed div { display: grid; align-content: start; }
.activity-feed strong { font-size: 11px; font-weight: 650; }
.activity-feed small { color: var(--slate); font-size: 10px; }
.empty-state { min-height: 230px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--slate); }
.empty-state span { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 10px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 21px; }
.empty-state strong { color: var(--ink); }
.empty-state p { max-width: 310px; margin: 3px 0; font-size: 12px; }

.matrix-toolbar { display: flex; gap: 18px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; }
.search-field { display: flex; align-items: center; gap: 8px; min-width: 280px; padding: 0 11px; border: 1px solid var(--line); background: #fff; border-radius: 6px; }
.search-field span { color: var(--slate); font-size: 18px; }
.search-field input { width: 100%; height: 38px; border: 0; outline: none; background: transparent; }
.status-legend { display: flex; flex-wrap: wrap; gap: 13px; color: var(--slate); font-size: 10px; }
.status-legend span { display: flex; gap: 5px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.completed { background: var(--green); }.dot.pending { background: var(--amber); }.dot.overdue { background: var(--red); }.dot.waiting { background: var(--violet); }.dot.na { background: var(--slate); }
.matrix-total { margin-left: auto; display: grid; justify-items: end; }
.matrix-total strong { font: 750 22px var(--display); }
.matrix-total span { color: var(--slate); font: 9px var(--utility); text-transform: uppercase; }
.view-switcher { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 16px; border: 1px solid var(--line); background: #f8faff; }
.view-switcher > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.view-switcher > div > span { margin-right: 3px; color: var(--slate); font: 700 9px var(--utility); text-transform: uppercase; letter-spacing: .09em; }
.view-switcher small { color: var(--slate); font-size: 10px; white-space: nowrap; }
.view-mode { min-height: 32px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--slate); font-size: 10px; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease; }
.view-mode:hover { border-color: var(--line-strong); color: var(--ink); }
.view-mode.active { border-color: var(--ink-2); background: var(--ink-2); color: #fff; }
.tracking-sections { display: grid; gap: 14px; margin-top: 16px; }
.tracking-section { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.tracking-section[hidden] { display: none; }
.tracking-section > summary { display: grid; grid-template-columns: 42px minmax(180px, 1fr) auto auto auto; gap: 14px; align-items: center; min-height: 70px; padding: 11px 16px; list-style: none; background: #fff; cursor: pointer; user-select: none; }
.tracking-section > summary::-webkit-details-marker { display: none; }
.tracking-section > summary:hover { background: #f9faff; }
.section-number { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 7px; background: var(--blue-soft); color: var(--blue); font: 800 12px var(--utility); }
.category-tax .section-number { background: var(--green-soft); color: var(--green); }
.section-title { display: grid; line-height: 1.25; }
.section-title small { color: var(--slate); font: 700 8px var(--utility); text-transform: uppercase; letter-spacing: .1em; }
.section-title strong { margin-top: 3px; font-size: 14px; }
.section-kpi { display: grid; min-width: 58px; padding-left: 14px; border-left: 1px solid var(--line); text-align: right; }
.section-kpi small { color: var(--slate); font: 8px var(--utility); text-transform: uppercase; letter-spacing: .08em; }
.section-kpi strong { font: 750 15px var(--display); }
.section-kpi.danger strong { color: var(--red); }
.collapse-label { display: flex; align-items: center; gap: 8px; margin-left: 4px; color: var(--slate); }
.collapse-label b { font: 700 8px var(--utility); text-transform: uppercase; letter-spacing: .08em; }
.collapse-label i { width: 9px; height: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .18s ease; }
.collapse-label .when-closed { display: none; }
.tracking-section[open] .collapse-label i { transform: rotate(225deg); }
.tracking-section:not([open]) .collapse-label .when-open { display: none; }
.tracking-section:not([open]) .collapse-label .when-closed { display: inline; }
.tracking-section .matrix-wrap { max-height: min(560px, calc(100vh - 245px)); border-width: 1px 0 0; box-shadow: none; }
.category-accounting .tracking-matrix thead .group-row th { background: var(--ink-2); }
.category-tax .tracking-matrix thead .group-row th { background: #276957; }
.matrix-wrap { max-width: 100%; overflow: auto; max-height: calc(100vh - 245px); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.tracking-matrix { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.tracking-matrix th, .tracking-matrix td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tracking-matrix thead th { position: sticky; top: 0; z-index: 8; height: 58px; padding: 6px; background: #eef2f8; text-align: center; font-size: 9px; vertical-align: bottom; }
.tracking-matrix thead .group-row th { top: 0; height: 28px; vertical-align: middle; background: var(--ink-2); color: #fff; font: 700 9px var(--utility); text-transform: uppercase; letter-spacing: .08em; }
.tracking-matrix thead tr:nth-child(2) th { top: 28px; }
.tracking-matrix thead th span { display: block; width: 54px; white-space: normal; line-height: 1.15; }
.tracking-matrix .sticky-client { position: sticky; left: 0; z-index: 10; min-width: 260px; max-width: 260px; text-align: left; }
.tracking-matrix thead .sticky-client { z-index: 14; padding-left: 14px; }
.tracking-matrix tbody .sticky-client { padding: 9px 12px; background: #fff; box-shadow: 4px 0 8px rgba(20,34,58,.05); }
.tracking-matrix tbody tr:hover .sticky-client { background: #f8faff; }
.tracking-matrix tbody th a { display: grid; }
.tracking-matrix tbody th strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.tracking-matrix tbody th small { color: var(--slate); font: 8px var(--utility); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-cell { position: relative; width: 58px; min-width: 58px; height: 48px; text-align: center; }
.status-cell.completed { background: var(--green-soft); color: var(--green); }
.status-cell.late { background: var(--amber-soft); color: #8b5f0d; }
.status-cell.pending { background: #fffaf0; color: var(--amber); }
.status-cell.overdue { background: var(--red-soft); color: var(--red); }
.status-cell.waiting { background: var(--violet-soft); color: var(--violet); }
.status-cell.na { background: var(--slate-soft); color: var(--slate); }
.status-cell.zero { background: #edf2f8; color: #4c5e78; }
.status-control { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.status-control:focus-visible { opacity: 1; background: #fff; color: var(--ink); }
.status-glyph { font: 800 12px var(--utility); }
.progress-column { position: sticky; right: 0; z-index: 9; min-width: 98px; background: #f4f6fa !important; }
.tracking-matrix thead .progress-column { z-index: 14; }
.row-progress { display: grid; grid-template-columns: 52px 30px; align-items: center; gap: 6px; padding: 0 8px; }
.row-progress > span { height: 5px; background: #dfe4ec; }
.row-progress i { display: block; height: 100%; background: var(--blue); transition: width .25s ease; }
.row-progress strong { font: 9px var(--utility); }
.matrix-note { color: var(--slate); font-size: 10px; }
.month-picker { display: grid; gap: 4px; color: var(--slate); font: 9px var(--utility); text-transform: uppercase; letter-spacing: .09em; }
.month-picker input, .month-picker select { height: 42px; min-width: 190px; padding: 0 34px 0 10px; border: 1px solid var(--line); border-radius: 6px; background-color: #fff; color: var(--ink); text-transform: none; letter-spacing: normal; cursor: pointer; }

.directory-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.directory-layout.read-only { grid-template-columns: minmax(0, 1fr); }
.directory-tools { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px; border-bottom: 1px solid var(--line); }
.record-count { color: var(--slate); font-size: 11px; white-space: nowrap; }
.record-count strong { color: var(--ink); }
.directory-table-wrap { overflow: auto; }
.directory-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.directory-table th { padding: 11px 13px; background: #eef2f8; color: var(--slate); text-align: left; font: 700 9px var(--utility); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.directory-table td { padding: 12px 13px; border-top: 1px solid var(--line); vertical-align: top; }
.directory-table tbody tr:hover { background: #f8faff; }
.directory-table td strong { font-weight: 700; }
.data-warning { display: inline-block; margin-left: 6px; padding: 2px 5px; background: var(--red-soft); color: var(--red); border-radius: 3px; font: 8px var(--utility); text-transform: uppercase; }
.record-state { display: inline-flex; padding: 3px 7px; border-radius: 999px; font: 8px var(--utility); text-transform: uppercase; letter-spacing: .07em; }
.record-state.active { background: var(--green-soft); color: var(--green); }
.record-state.inactive { background: var(--slate-soft); color: var(--slate); }
.row-action { color: var(--blue); font-weight: 700; font-size: 11px; }
.form-panel { position: sticky; top: 22px; padding: 22px; }
.stacked-form { display: grid; gap: 14px; margin-top: 20px; }
.stacked-form label { display: grid; gap: 5px; color: var(--slate); font-size: 11px; }
.stacked-form input, .stacked-form textarea, .stacked-form select, .task-row input, .task-row select { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); padding: 9px 10px; }
.stacked-form input:focus, .stacked-form textarea:focus, .stacked-form select:focus, .task-row input:focus, .task-row select:focus { border-color: var(--blue); outline: 2px solid rgba(49,91,214,.12); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stacked-form .check-field { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.check-field input { width: auto; }
.permission-note { display: flex; align-items: center; gap: 12px; margin: -8px 0 18px; padding: 12px 15px; border: 1px solid #cfd9f5; background: var(--blue-soft); color: var(--blue); }
.permission-note > span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; }
.permission-note > div { display: grid; }
.permission-note strong { font-size: 11px; }
.permission-note small { color: #546587; font-size: 10px; }
.role-ledger { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; border: 1px solid var(--line); background: #fff; }
.role-ledger > div { display: grid; grid-template-columns: 54px 1fr; align-items: center; min-height: 74px; padding: 12px 18px; }
.role-ledger > div + div { border-left: 1px solid var(--line); }
.role-ledger > div > span { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--blue); color: var(--blue); font: 800 9px var(--utility); letter-spacing: .08em; }
.role-ledger > div:last-child > span { border-color: var(--green); color: var(--green); }
.role-ledger p { display: grid; margin: 0; }
.role-ledger strong { font-size: 12px; }
.role-ledger small { color: var(--slate); font-size: 10px; }
.user-role { display: inline-flex; padding: 4px 7px; border-left: 3px solid; background: var(--slate-soft); font: 700 8px var(--utility); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.user-role.admin { border-color: var(--blue); color: var(--blue); }
.user-role.operator { border-color: var(--green); color: var(--green); }
.access-denied { min-height: 68vh; display: grid; place-content: center; justify-items: start; padding: clamp(28px, 6vw, 76px); background: linear-gradient(135deg, #fff 0 78%, var(--blue-soft) 78%); }
.access-denied > span { color: #d7deea; font: 850 clamp(58px, 9vw, 106px)/1 var(--utility); letter-spacing: -.08em; }
.access-denied h1 { margin: 4px 0; font-size: clamp(28px, 4vw, 46px); }
.access-denied > p:not(.eyebrow) { max-width: 520px; margin: 0 0 22px; color: var(--slate); }

.taxpayer-summary { display: grid; grid-template-columns: 2fr 1fr 1.3fr auto; align-items: center; gap: 20px; margin-bottom: 26px; padding: 20px 24px; background: var(--ink); color: #fff; border-left: 5px solid var(--blue); }
.taxpayer-summary > div { display: grid; gap: 3px; }
.taxpayer-summary span { color: #aeb8c9; font: 9px var(--utility); text-transform: uppercase; letter-spacing: .08em; }
.taxpayer-summary strong { font-size: 13px; }
.taxpayer-summary .row-action { color: #b9c9ff; }
.profile-progress i { width: 100%; height: 5px; margin-top: 5px; background: rgba(255,255,255,.14); }
.profile-progress b { display: block; height: 100%; background: #8ba8ff; }
.task-section { margin-top: 28px; }
.task-list { margin-top: 13px; border-top: 1px solid var(--line-strong); }
.task-row { display: grid; grid-template-columns: 38px minmax(180px, 1.1fr) 125px 130px 170px minmax(180px, 1fr) 65px; align-items: end; gap: 10px; padding: 12px 8px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; background: #fff; }
.task-row.completed { border-left-color: var(--green); }.task-row.overdue { border-left-color: var(--red); }.task-row.waiting { border-left-color: var(--violet); }.task-row.pending { border-left-color: var(--amber); }.task-row.na { border-left-color: var(--slate); }.task-row.zero { border-left-color: #60728d; }
.task-index { align-self: center; color: #a3adbc; font: 10px var(--utility); }
.task-name { display: grid; align-self: center; }
.task-name strong { font-size: 12px; }
.task-name small { color: var(--slate); font-size: 10px; }
.task-row label { display: grid; gap: 4px; color: var(--slate); font-size: 9px; }
.task-row input, .task-row select { height: 35px; padding: 6px 8px; font-size: 10px; }
.save-row { height: 35px; border: 1px solid var(--line); background: #fff; color: var(--blue); border-radius: 5px; font-size: 10px; font-weight: 750; cursor: pointer; }
.save-row:hover { border-color: var(--blue); }
.history-panel { margin-top: 28px; }
.history-bars { display: flex; align-items: end; gap: 12px; height: 175px; margin-top: 20px; overflow-x: auto; }
.history-bars a { display: grid; grid-template-rows: 18px 110px 18px; gap: 5px; justify-items: center; min-width: 44px; }
.history-bars span { color: var(--slate); font: 9px var(--utility); text-transform: uppercase; }
.history-bars i { position: relative; width: 22px; height: 110px; background: #edf0f5; }
.history-bars b { position: absolute; bottom: 0; width: 100%; background: var(--blue); }
.history-bars strong { font: 9px var(--utility); }

.action-code { display: inline-flex; padding: 3px 6px; background: var(--blue-soft); color: var(--blue); border-radius: 3px; font: 8px var(--utility); text-transform: uppercase; }
.profile-layout { display: grid; grid-template-columns: 300px minmax(0, 520px); gap: 18px; }
.account-card { display: grid; justify-items: center; align-content: center; min-height: 280px; padding: 30px; text-align: center; }
.avatar.large { width: 72px; height: 72px; font-size: 28px; }
.account-card h2 { margin: 15px 0 2px; }
.account-card p { margin: 0 0 10px; color: var(--slate); }
.password-form { margin: 0; padding: 26px; }
.stacked-form label small { font-size: 9px; }

.flash { margin-bottom: 18px; padding: 11px 14px; border-left: 4px solid; background: #fff; box-shadow: var(--shadow); font-size: 12px; }
.flash-success { border-color: var(--green); color: var(--green); }
.flash-error { border-color: var(--red); color: var(--red); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; transform: translateY(120px); max-width: 380px; padding: 12px 16px; border-left: 4px solid var(--green); background: var(--ink); color: #fff; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transition: .22s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-color: var(--red); }
.empty-page { min-height: 70vh; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-page > span { font: 800 72px var(--utility); color: #d7deea; }
.empty-page h1 { margin: 0; }
.empty-page p { color: var(--slate); }

.login-page { min-height: 100vh; background: var(--ink); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 1.2fr) minmax(400px, .8fr); }
.login-story { position: relative; display: grid; align-items: center; padding: 7vw; overflow: hidden; color: #fff; background: var(--ink); }
.login-story::before { content: ""; position: absolute; width: 70%; aspect-ratio: 1; right: -22%; top: -28%; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018); }
.login-story h1 { position: relative; margin: 8px 0 22px; font: 760 clamp(48px, 6vw, 86px)/.98 var(--display); letter-spacing: -.06em; }
.login-story p:not(.eyebrow) { max-width: 500px; color: #b8c2d2; font-size: 17px; }
.login-ledger { position: absolute; left: 0; bottom: 0; display: grid; grid-template-columns: repeat(6, 72px); }
.login-ledger span { height: 64px; display: grid; place-items: center; border-top: 1px solid rgba(255,255,255,.12); border-right: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.38); font: 10px var(--utility); }
.login-ledger span:nth-child(5) { background: var(--blue); color: #fff; }
.login-stamp { position: absolute; right: 7vw; bottom: 6vw; width: 92px; height: 92px; display: grid; place-content: center; border: 2px solid #829fff; border-radius: 50%; color: #9db3ff; text-align: center; font: 800 21px/1 var(--utility); transform: rotate(-8deg); }
.login-stamp small { font-size: 9px; letter-spacing: .16em; }
.login-form-panel { display: grid; place-items: center; padding: 40px; background: #fff; }
.login-form { width: min(390px, 100%); display: grid; gap: 20px; }
.login-brand { margin-bottom: 32px; color: var(--ink); }
.login-brand .brand-mark { border-color: var(--line-strong); }
.login-brand .brand-mark i { border-color: var(--line); }
.login-brand .brand-mark i:last-child { color: #fff; }
.login-brand small { color: var(--slate); }
.login-form h2 { margin: 3px 0 0; font: 750 28px var(--display); letter-spacing: -.03em; }
.login-form label { display: grid; gap: 6px; color: var(--slate); font-size: 11px; }
.login-form input { height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.form-error { padding: 10px 12px; background: var(--red-soft); color: var(--red); border-left: 3px solid var(--red); font-size: 11px; }
.login-hint { margin: 0; color: var(--slate); font-size: 10px; text-align: center; }

@media (max-width: 1120px) {
    .main-content { padding: 28px 24px 50px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .directory-layout { grid-template-columns: 1fr; }
    .form-panel { position: static; }
    .task-row { grid-template-columns: 32px 1fr 120px 120px; }
    .task-row .task-notes { grid-column: 2 / 4; }
    .task-row .save-row { grid-column: 4; }
}

@media (max-width: 820px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); box-shadow: 20px 0 60px rgba(0,0,0,.22); }
    .workspace { margin-left: 0; }
    .mobile-bar { position: sticky; top: 0; z-index: 25; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--ink); color: #fff; font-size: 12px; }
    .icon-button { border: 0; background: transparent; color: #fff; font-size: 20px; cursor: pointer; }
    .main-content { padding: 22px 15px 44px; }
    .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
    .page-heading .primary-button, .page-heading .secondary-button { width: 100%; }
    .heading-actions { width: 100%; flex-wrap: wrap; }
    .month-picker { flex: 1; }
    .cutoff-hero { grid-template-columns: 1fr; padding: 30px 76px 30px 26px; }
    .progress-seal { width: 138px; }
    .progress-seal::before { width: 110px; }
    .control-strip { grid-template-columns: 1fr 1fr; }
    .control-strip > div:nth-child(2) { border-right: 0; }
    .control-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .attention-list > a { grid-template-columns: 5px 1fr auto; }
    .attention-reason { grid-column: 2; justify-items: start; }
    .mini-progress { display: none; }
    .matrix-toolbar { align-items: stretch; flex-direction: column; }
    .search-field { min-width: 0; width: 100%; }
    .matrix-total { position: static; margin-left: 0; display: flex; align-items: baseline; gap: 7px; justify-items: start; }
    .view-switcher { align-items: flex-start; flex-direction: column; }
    .view-switcher small { white-space: normal; }
    .view-mode { flex: 1 1 auto; }
    .tracking-section > summary { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
    .section-kpi { grid-row: 2; min-width: 0; padding: 7px 0 0; border-top: 1px solid var(--line); border-left: 0; text-align: left; }
    .section-kpi.danger { grid-column: 2; }
    .section-kpi:not(.danger) { grid-column: 3; }
    .collapse-label { grid-column: 3; grid-row: 1; }
    .collapse-label b { display: none; }
    .tracking-matrix .sticky-client { min-width: 190px; max-width: 190px; }
    .tracking-matrix .progress-column { position: static; }
    .directory-tools { align-items: stretch; flex-direction: column; }
    .role-ledger { grid-template-columns: 1fr; }
    .role-ledger > div + div { border-top: 1px solid var(--line); border-left: 0; }
    .taxpayer-summary { grid-template-columns: 1fr 1fr; }
    .taxpayer-summary .profile-data { grid-column: 1 / -1; }
    .task-row { grid-template-columns: 28px 1fr 110px; align-items: end; }
    .task-row label { grid-column: auto; }
    .task-row label:nth-of-type(2), .task-row label:nth-of-type(3), .task-row .task-notes { grid-column: 2 / -1; }
    .task-row .save-row { grid-column: 3; }
    .profile-layout { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 1fr; }
    .login-story { min-height: 38vh; padding: 45px 32px; }
    .login-story h1 { font-size: 44px; }
    .login-story p:not(.eyebrow) { font-size: 14px; }
    .login-ledger, .login-stamp { display: none; }
    .login-form-panel { min-height: 62vh; padding: 32px 24px; }
    .login-brand { display: none; }
}

@media (max-width: 520px) {
    .control-strip { grid-template-columns: 1fr; }
    .control-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
    .control-strip > div:last-child { border-bottom: 0; }
    .cutoff-copy h2 { font-size: 42px; }
    .hero-actions { align-items: flex-start; flex-direction: column; }
    .progress-seal { display: none; }
    .directory-table { min-width: 760px; }
    .taxpayer-summary { grid-template-columns: 1fr; }
    .profile-data { grid-column: auto; }
    .field-pair { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
