:root {
    --nav: #123c45;
    --nav-deep: #0e3038;
    --teal: #087e78;
    --teal-dark: #05635e;
    --ink: #17343d;
    --muted: #60747b;
    --line: #dce5e7;
    --canvas: #f3f6f6;
    --surface: #ffffff;
    --danger: #aa3636;
    --radius: 13px;
    --shadow: 0 2px 10px rgb(22 52 61 / 3%);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 25px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.55 "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
button, select, summary { cursor: pointer; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #54b8ac; outline-offset: 3px; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(25px, 2.6vw, 33px); line-height: 1.18; letter-spacing: -.035em; margin-bottom: 8px; font-weight: 700; }
h2 { font-size: 19px; line-height: 1.35; letter-spacing: -.02em; margin-bottom: 14px; }
h3 { font-size: 16px; line-height: 1.4; margin-bottom: 12px; }
p { margin-bottom: 14px; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 650; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.eyebrow { color: var(--teal-dark); font-size: 10px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 9px; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.wrap { min-width: 170px; max-width: 480px; overflow-wrap: anywhere; }
.pre-wrap, .preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.danger-text { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -100px; padding: 12px 20px; background: white; border-radius: 6px; }
.skip-link:focus { top: 12px; }

/* Navigation and shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--nav); color: #e9f3f3; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; overflow-y: auto; z-index: 30; }
.brand { display: block; padding: 24px 21px 18px; color: white; }
.brand:hover { text-decoration: none; }
.brand-logo { display: flex; align-items: center; justify-content: center; width: 190px; max-width: 100%; min-height: 68px; padding: 12px; border-radius: 9px; background: white; margin-bottom: 10px; }
.brand-logo img { display: block; width: 100%; height: auto; max-height: 44px; object-fit: contain; }
.brand-name { display: block; font-size: 20px; letter-spacing: -.025em; font-weight: 700; }
.brand-sub { display: block; color: #afc8cc; font-size: 10px; font-weight: 400; margin-top: 3px; letter-spacing: .025em; }
.sidebar nav { padding: 0 13px 22px; }
.nav-section { color: #92b3b9; font-size: 10px; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; margin: 24px 12px 7px; }
.nav-link { display: flex; gap: 10px; align-items: center; min-height: 42px; margin: 3px 0; padding: 9px 12px; border-radius: 7px; color: #dbeaec; font-size: 13px; border: 1px solid transparent; }
.nav-link:hover { background: rgb(255 255 255 / 7%); color: white; text-decoration: none; }
.nav-link.active { background: #225761; color: white; border-color: #3b6f76; box-shadow: inset 3px 0 #9fd1a1; font-weight: 650; }
.nav-icon { width: 19px; font-size: 18px; line-height: 1; text-align: center; color: #a8c6c9; }
.nav-link.active .nav-icon { color: #c4e3c1; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #2d535c; padding: 17px 24px; color: #a5bec2; font-size: 11px; display: flex; gap: 11px; align-items: center; }
.build-tag { display: inline-block; color: #dcebea; background: #274f58; border: 1px solid #3a626b; padding: 2px 6px; border-radius: 4px; font-size: 10px; }
.workspace { margin-left: 248px; width: calc(100% - 248px); min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 79px; padding: 16px 33px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; }
.topbar .eyebrow { display: block; color: #788b90; font-size: 9px; margin: 0 0 3px; }
.topbar-title { font-weight: 600; font-size: 13px; }
.topbar-brand { display: none; }
.topbar-brand img { display: block; width: 100%; height: auto; max-height: 40px; object-fit: contain; }
.account-menu { position: relative; margin-left: auto; }
.account-menu summary { font-size: 12px; color: var(--ink); padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfc; max-width: 220px; overflow-wrap: anywhere; }
.account-dropdown { position: absolute; z-index: 35; top: calc(100% + 10px); right: 0; min-width: 200px; padding: 10px; background: white; box-shadow: 0 8px 28px #17343d20; border: 1px solid var(--line); border-radius: 9px; }
.account-dropdown > a, .account-dropdown button { display: block; text-align: left; width: 100%; padding: 9px 12px; font-size: 12px; }
.page-content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 30px 33px 36px; flex: 1; }
.page-footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; color: #73858b; font-size: 10px; padding: 15px 33px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-header > div:first-child { min-width: 0; }
.page-header h1 { overflow-wrap: anywhere; }
.page-header .muted { max-width: 790px; font-size: 13px; }
.page-header > .actions, .page-header > .btn { flex-shrink: 0; margin-top: 9px; }
.menu-toggle { display: none !important; }
.nav-close { display: none; }

/* Buttons, notices, and reusable panels */
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 39px; padding: 9px 15px; border: 1px solid var(--teal); border-radius: 7px; color: #fff; background: var(--teal); font-weight: 600; font-size: 12px; text-decoration: none; line-height: 1.4; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: white; text-decoration: none; }
.btn-secondary { background: #fff; border-color: #ccd9dc; color: var(--ink); }
.btn-secondary:hover { background: #edf4f3; border-color: #adc4c5; color: var(--teal-dark); }
.btn-quiet { color: var(--ink); background: transparent; border-color: transparent; }
.btn-quiet:hover { color: var(--teal-dark); background: #edf4f3; border-color: transparent; }
.btn-danger { background: #a63838; border-color: #a63838; }
.btn-danger:hover { background: #862a2a; border-color: #862a2a; }
.btn-small { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.btn:disabled, button:disabled { opacity: .55; cursor: not-allowed; }
.actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.form-actions { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 23px; margin-bottom: 21px; min-width: 0; box-shadow: var(--shadow); }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.card-heading h2, .card-heading h3 { margin: 0; }
.card-heading .small { margin: 4px 0 0; }
.card-heading > a { font-size: 12px; white-space: nowrap; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 16px; }
.section-heading h2, .section-heading h3, .section-heading p { margin: 0; }
.grid-two, .grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 21px; }
.grid-two > .card, .grid-2 > .card { margin-bottom: 0; }
.grid-two, .grid-2 { margin-bottom: 21px; }
.alert, .notice { padding: 13px 16px; border: 1px solid #c9dfe0; border-left-width: 4px; border-radius: 8px; margin-bottom: 20px; background: #edf6f7; color: #254f5d; font-size: 13px; }
.alert-success { background: #edf7f0; border-color: #b5d8c2; color: #235c3d; }
.alert-warning, .notice.warning { background: #fff8e9; border-color: #ead6a2; color: #75561e; }
.alert-danger { background: #fdf0ef; border-color: #edc1bd; color: #8c3434; }
.alert-info { background: #edf5fa; border-color: #c4dae8; color: #315c75; }
.badge { display: inline-block; width: fit-content; vertical-align: middle; padding: 3px 8px; border-radius: 5px; border: 1px solid #dbe5e7; color: #526e76; background: #f0f5f5; font-size: 10px; line-height: 1.4; font-weight: 650; white-space: nowrap; }
.badge-success, .status-approved, .status-received, .status-posted { color: #236445; background: #eaf5ee; border-color: #c9e4d3; }
.badge-warning, .badge.warning, .status-submitted, .status-partiallyreceived { color: #885e19; background: #fff5df; border-color: #f1dfb4; }
.badge-info, .status-issued, .status-ordered { color: #23637b; background: #eaf4f9; border-color: #cbdfe9; }
.badge-danger, .status-rejected { color: #9b3b3b; background: #fceeee; border-color: #eecaca; }
.badge-muted, .status-draft, .status-cancelled, .status-voided { color: #64767b; background: #f0f3f4; border-color: #e0e6e8; }
.badge-list, .assignment-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.assignment-line + .assignment-line { margin-top: 5px; }
.empty-state { text-align: center; padding: 42px 22px; color: var(--muted); }
.empty-state h2, .empty-state h3 { color: var(--ink); }
.empty-state p { max-width: 560px; margin: 0 auto 20px; }
.empty-state .actions { justify-content: center; }
.empty-inline { padding: 22px 0; color: var(--muted); font-size: 13px; }
.scope-line { font-size: 12px; color: var(--muted); margin: -3px 0 21px; line-height: 1.8; }
.scope-line strong { color: var(--ink); font-weight: 600; }

/* Accessible form controls */
.form-card { max-width: 1020px; }
.form-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 17px 23px; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; min-width: 0; gap: 6px; margin-bottom: 17px; }
.form-grid > .field { margin-bottom: 0; }
.span-2 { grid-column: 1 / -1; }
label, .field > label { font-size: 12px; font-weight: 650; color: #34545d; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { display: block; width: 100%; max-width: 100%; padding: 10px 11px; border: 1px solid #c9d6d9; border-radius: 6px; background: white; color: #24444d; min-height: 40px; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: #8b9da2; }
input[readonly], .readonly { background: #f2f6f6; color: #526b74; }
.readonly { padding: 11px; min-height: 40px; margin-bottom: 0; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
textarea { resize: vertical; min-height: 75px; }
select { padding-right: 29px; }
input[type="file"] { font-size: 12px; padding: 8px !important; background: #f8fafb !important; }
input[type="file"]::file-selector-button { padding: 7px 10px; border: 0; border-radius: 4px; color: #24505a; background: #e4eeee; margin-right: 12px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--teal); width: 17px; height: 17px; flex: 0 0 auto; vertical-align: middle; margin: 0; }
input[type="number"] { font-variant-numeric: tabular-nums; }
form > label:not(.check):not(.choice-card), .auth-card label { display: block; margin: 14px 0 6px; }
.check, .checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12px; font-weight: 500; }
.field small, .field > .small { font-size: 11px; color: var(--muted); line-height: 1.5; }
.field-validation-error, [data-valmsg-for].field-validation-error { color: #a23a35; font-size: 11px; }
.input-validation-error { border-color: #d38d86 !important; background: #fffbfa !important; }
.validation-summary-errors, .validation-summary:not(.validation-summary-valid) { color: #8a3232; background: #fff1ef; border: 1px solid #efc7c1; border-left: 4px solid #b94b45; border-radius: 7px; padding: 14px 17px; margin: 0 0 20px; font-size: 12px; }
.validation-summary-errors ul, .validation-summary ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
.section-fieldset { border: 0; border-top: 1px solid var(--line); margin: 28px 0 0; padding: 17px 0 0; min-width: 0; }
.section-fieldset legend { font-size: 17px; font-weight: 650; padding: 0 10px 0 0; }
.choice-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.choice-card { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; background: #fcfdfd; font-weight: 400; }
.choice-card:hover { border-color: #8fb8b4; }
.choice-card:has(input:checked) { background: #edf6f3; border-color: #9bc4b6; }
.choice-card input { margin-top: 3px; }
.choice-card strong { display: block; font-size: 12px; }
.choice-card small { display: block; color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 4px; }
.filter-bar, .filters { display: flex; flex-wrap: wrap; gap: 13px; align-items: flex-end; }
.filter-bar { padding: 17px 19px; }
.filters { padding: 17px 19px; background: white; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 21px; }
.card > .filters { border: 0; border-radius: 0; padding: 0; margin: 0; background: transparent; }
.filter-bar > .field, .filters > .field { margin: 0; min-width: 135px; flex: 1 1 145px; }
.filter-bar > .field:first-child { flex: 1.5 1 210px; }
.filter-bar .filter-grow { flex: 2 1 220px; }
.filter-bar label, .filters label { font-size: 10px; }
.filter-bar input, .filter-bar select, .filters input, .filters select { font-size: 12px; min-height: 38px; padding: 9px 10px; }
.filter-check { align-self: flex-end; min-height: 38px; }
.filter-actions { display: flex; gap: 8px; }
.no-border { padding: 0; border: 0; box-shadow: none; }
.attachments > form { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; }
.attachments input[type="file"] { max-width: 600px; }
.workflow-editor .table-wrap input { min-width: 90px; }
.table-wrap input[type="number"], .table-scroll input[type="number"] { min-width: 96px; }
.workflow-editor .table-wrap td:first-child { min-width: 240px; }
.workflow-editor .actions { margin-top: 20px; }

/* Data tables */
.table-scroll, .table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { font-size: 10px; letter-spacing: .025em; line-height: 1.5; color: #57717a; font-weight: 700; text-align: left; background: #f6f9f9; border-bottom: 1px solid #d7e2e4; padding: 12px 13px; }
td { padding: 13px; border-bottom: 1px solid #e6edef; vertical-align: top; }
td, th { overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfc; }
td a { font-weight: 600; }
td p { margin: 7px 0; }
tfoot td, tfoot th { background: #eef5f4; font-weight: 650; border-top: 1px solid #d2e1df; padding: 13px; }
.cell-sub { display: block; font-size: 10px; color: var(--muted); font-weight: 400; margin-top: 4px; line-height: 1.6; overflow-wrap: anywhere; }
td details { margin-top: 8px; min-width: 190px; }
details > summary { color: #365e68; font-weight: 600; font-size: 12px; padding: 7px 0; }
details[open] > summary { margin-bottom: 10px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 21px; margin: 0; }
dt { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; color: #71868b; }
dd { margin: 5px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.detail-list dt:not(:first-child) { margin-top: 17px; }
.pagination { justify-content: flex-end; padding-top: 18px; }

/* Dashboard and reports */
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; margin-bottom: 19px; }
.metric-grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.metric-card { border: 1px solid var(--line); border-radius: var(--radius); background: white; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.metric-label { font-size: 11px; color: #58747d; font-weight: 600; margin: 0 0 11px; }
.metric-value { font-size: 35px; font-weight: 650; letter-spacing: -.04em; line-height: 1.2; color: #1c454e; margin-bottom: 11px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-value.money { font-size: clamp(20px, 2vw, 29px); letter-spacing: -.035em; }
.metric-value.money > span { color: #6b858a; font-size: 10px; font-weight: 700; letter-spacing: .05em; display: block; margin-bottom: 4px; }
.metric-detail { font-size: 11px; color: #556f77; margin: 0 0 5px; }
.metric-basis { font-size: 10px; color: #7a8e93; margin: 0; }
.metric-accent { background: #164b52; border-color: #164b52; }
.metric-accent .metric-label { color: #bad6d3; }
.metric-accent .metric-value { color: #fff; }
.metric-accent .metric-value.money > span { color: #aecdc8; }
.metric-accent .metric-detail, .metric-accent .metric-basis { color: #c2d9d7; }
.metric-warning { border-color: #e8d7bb; background: #fffdf7; }
.metric-warning .metric-value { color: #886126; }
.data-note { margin-bottom: 23px; font-size: 10px; line-height: 1.7; }
.bar-chart { list-style: none; margin: 4px 0 0; padding: 0; }
.bar-chart li { margin: 0 0 18px; }
.bar-chart li:last-child { margin-bottom: 0; }
.bar-label { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; font-size: 11px; margin-bottom: 8px; }
.bar-label > span { min-width: 0; overflow-wrap: anywhere; }
.bar-label strong { font-variant-numeric: tabular-nums; font-size: 11px; white-space: nowrap; }
.bar-track { height: 9px; border-radius: 3px; background: #edf3f3; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 3px; background: #328c83; min-width: 0; }
.bar-chart li:nth-child(2n) .bar-fill { background: #6da99e; }
.bar-caption { display: block; font-size: 9px; color: #7b9297; margin-top: 4px; }
.empty-chart { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #7c9298; text-align: center; }
.empty-chart > span { font-size: 37px; line-height: 1; opacity: .4; margin-bottom: 14px; }
.empty-chart p { font-size: 12px; max-width: 260px; }
.report-note { background: #eaf1f1; border-radius: 9px; padding: 16px 20px; margin: 21px 0; }
.report-note p { font-size: 11px; line-height: 1.8; color: #526d75; }
.small-heading { font-size: 12px; margin-bottom: 7px; }
.section-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.section-links a { border: 1px solid #d2e2df; background: #edf6f3; font-size: 11px; padding: 6px 11px; border-radius: 5px; }
.callout { display: flex; justify-content: space-between; align-items: center; gap: 25px; background: #edf4f1; border-color: #d3e3da; }
.callout h2 { font-size: 15px; margin-bottom: 6px; }
.callout p { color: #527069; font-size: 12px; max-width: 800px; }

/* Account screens */
.auth-shell { min-height: 100vh; background: radial-gradient(ellipse at top left, #dbece4, transparent 60%), #eef4f3; }
.auth-content { width: min(470px, calc(100% - 36px)); margin: 0 auto; padding: 60px 0 30px; }
.auth-brand { display: none; }
.auth-card { max-width: 460px; padding: 33px; }
.auth-content .auth-card { border-color: #d3e1df; box-shadow: 0 12px 50px #123c450d; margin: 0 auto; }
.auth-card h1 { font-size: 28px; }
.login-logo { display: block; width: 210px; max-width: 100%; height: auto; max-height: 76px; object-fit: contain; margin: 0 auto 26px; }
.auth-card form { margin: 21px 0; }
.auth-card form .btn { width: 100%; margin-top: 20px; }
.auth-card .field-validation-error { display: block; margin-top: 5px; }
.auth-footer { text-align: center; font-size: 10px; color: #81948e; margin-top: 23px; }

@media (max-width: 1450px) {
    .metric-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .page-header { flex-wrap: wrap; }
    .page-header > .actions, .page-header > .btn { margin-top: 0; }
}
@media (max-width: 1150px) {
    .sidebar { width: 221px; flex-basis: 221px; }
    .workspace { margin-left: 221px; width: calc(100% - 221px); }
    .brand { padding-left: 19px; padding-right: 19px; }
    .brand-logo { width: 178px; }
    .brand-name { font-size: 19px; }
    .page-content { padding: 25px 24px; }
    .topbar, .page-footer { padding-left: 24px; padding-right: 24px; }
    .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .grid-two, .grid-2 { grid-template-columns: minmax(0,1fr); }
    .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .card { padding: 20px; }
}
@media (max-width: 800px) {
    .sidebar { transform: translateX(-100%); transition: transform .18s ease; width: 248px; box-shadow: 0 0 35px #102f3d25; }
    .nav-open .sidebar { transform: translateX(0); }
    .nav-close { display: inline-flex; align-items: center; justify-content: center; position: absolute; right: 9px; top: 19px; width: 30px; height: 30px; padding: 0; border: 1px solid #5d7b83; border-radius: 5px; color: white; background: #22545e; font-size: 23px; line-height: 1; }
    .workspace { margin-left: 0; width: 100%; }
    .menu-toggle { display: inline-flex !important; font-size: 19px; min-width: 36px; padding: 5px; }
    .topbar { padding: 12px 18px; height: 70px; gap: 9px; }
    .topbar .menu-toggle { flex-shrink: 0; }
    .topbar-brand { display: block; flex: 0 1 144px; width: 144px; min-width: 84px; }
    .topbar-context { display: none; }
    .topbar .account-menu { min-width: 0; flex: 0 1 auto; }
    .topbar-title { font-size: 11px; }
    .topbar .eyebrow { font-size: 8px; }
    .account-menu summary { padding: 7px; font-size: 10px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; list-style-position: inside; }
    .page-content { padding: 24px 18px; }
    .page-header { gap: 14px; margin-bottom: 21px; }
    .page-header .actions { width: 100%; }
    .page-footer { padding: 14px 18px; }
    .choice-grid { grid-template-columns: minmax(0,1fr); }
    .callout { align-items: flex-start; flex-direction: column; gap: 16px; }
}
@media (max-width: 520px) {
    .page-content { padding: 20px 13px; }
    .topbar-title { display: none; }
    .topbar-brand { flex-basis: 110px; width: 110px; }
    .topbar .account-menu summary { max-width: 120px; }
    .topbar .eyebrow { max-width: 110px; line-height: 1.5; }
    .card { padding: 17px; border-radius: 10px; }
    .metric-grid, .metric-grid.four { grid-template-columns: minmax(0,1fr); gap: 12px; }
    .metric-card { padding: 18px; }
    .metric-value.money { font-size: 28px; }
    .form-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
    .detail-grid { grid-template-columns: minmax(0,1fr); }
    .filter-bar > .field, .filter-bar > .field:first-child, .filters > .field { flex: 1 1 100%; }
    .filter-actions { width: 100%; }
    .filter-actions > .btn { flex: 1; }
    .btn { white-space: normal; }
    .card-heading { flex-wrap: wrap; gap: 10px; }
    .bar-label { gap: 9px; }
    .bar-label strong { font-size: 10px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .auth-content { padding-top: 30px; }
    .auth-card { padding: 25px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
@media print {
    @page { margin: 12mm; }
    body { background: white; font-size: 10px; color: #111; }
    .sidebar, .topbar, .page-footer, .no-print, .skip-link, .section-links, .filter-bar, .filters, .pagination, .account-menu { display: none !important; }
    .workspace, .page-content { display: block; width: 100%; margin: 0; padding: 0; max-width: none; }
    .app-shell { display: block; }
    .page-header { display: block; margin: 0 0 14px; }
    .page-header .actions, .page-header > .btn { display: none; }
    h1 { font-size: 23px; } h2 { font-size: 14px; } h3 { font-size: 12px; }
    .card { border: 1px solid #ccc; border-radius: 3px; box-shadow: none; padding: 11px; margin-bottom: 13px; }
    .grid-two, .grid-2 { display: block; }
    .grid-two > .card, .grid-2 > .card { margin-bottom: 13px; }
    .metric-grid, .metric-grid.four { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    .metric-card { background: white !important; color: #111; box-shadow: none; padding: 12px; border: 1px solid #bbb; break-inside: avoid; }
    .metric-card p, .metric-value.money > span { color: #111 !important; }
    .metric-value, .metric-value.money { font-size: 23px; }
    .metric-label, .metric-detail, .metric-basis { font-size: 9px; }
    .table-scroll, .table-wrap { overflow: visible; }
    table { font-size: 9px; width: 100%; }
    th { font-size: 8px; } td, th { padding: 7px 5px; }
    tr { break-inside: avoid; } thead { display: table-header-group; } tfoot { display: table-row-group; }
    .numeric { white-space: normal; }
    a { color: inherit; text-decoration: none; }
    .bar-track, .bar-fill, .badge, th, .report-note { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .bar-chart li { break-inside: avoid; }
    .callout { display: block; background: white; }
    form:not(.no-print) .form-actions, form button { display: none; }
    .auth-content { padding: 0; }
}

/* Expense capture and explainable vendor suggestions */
.capture-panel { padding: 1.2rem; margin: 1.4rem 0; border: 1px solid #cddfe1; border-radius: 12px; background: #f3f9f8; }
.source-suggestions:empty { display: none; }
.source-suggestions { margin: 1rem 0 1.5rem; }
.source-candidate { padding: .9rem 1rem; margin: .6rem 0; border: 1px solid #d6e3e5; border-radius: 10px; background: #fafdfd; }
.source-candidate p { margin: .35rem 0 .7rem; }
.expense-links { margin: 1.5rem 0; padding: 1rem; border: 1px solid #d6e3e5; border-radius: 10px; }
.expense-links summary { cursor: pointer; font-weight: 650; }
.check-row { display: flex; gap: .6rem; align-items: center; font-weight: 500; }
.check-row input[type=checkbox] { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
