/* Preferences in the top bar */
/* Provi's quarter mark leads; the partner names stay legible beside it. */
.sidebar .brand-lockup{gap:9px;letter-spacing:.04em}
.sidebar .brand-mark{width:53px;height:53px;filter:drop-shadow(0 2px 3px rgba(0,0,0,.18))}
.sidebar .brand-name{display:grid;gap:3px;min-width:0;line-height:1.1}
.sidebar .brand-name strong{font-size:1.12rem;letter-spacing:.04em;color:#fff}
.sidebar .brand-name small{font-size:.62rem;letter-spacing:.025em;color:#D5E4EF}
.sidebar .brand-name i{padding-left:0;color:#56C857}
.auth-card .brand-mark{display:block;width:48px;height:48px;background:transparent;border-radius:0;object-fit:contain;flex:none}
.auth-card .brand-name{display:grid;gap:3px;line-height:1.1}
.auth-card .brand-name strong{font-size:1.12rem;letter-spacing:.04em;color:var(--ink)}
.auth-card .brand-name small{font-size:.62rem;letter-spacing:.025em;color:var(--muted)}
.ui-icon{display:inline-block;vertical-align:middle;width:1.18em;height:1.18em;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.main-nav a{gap:9px}
.main-nav .ui-icon{width:17px;height:17px}
.logout .ui-icon{width:17px;height:17px}
.text-link .ui-icon{margin-inline-end:2px}
/* Totals follow the visible filter and include every matching page. */
.order-total-row th,.order-total-row td{background:#EAF4EF;border-top:2px solid #56C857;border-bottom:0;font-weight:800;color:#0E3755}
.order-total-row th{text-transform:none;letter-spacing:0;font-size:.8rem;white-space:nowrap}
.order-total-row td{font-size:.83rem}
.inline-order-table .order-total-row>:last-child{background:#EAF4EF!important}
.tabs{flex-wrap:wrap}
.settings-tabs{margin-bottom:20px}
.statement-actions{display:flex;flex-wrap:wrap;align-items:center;align-content:center;justify-content:flex-end;gap:8px}
.statement-actions form{min-width:0}
.quarter-process-dialog,.quarter-process-content{color:var(--ink);background:var(--white)}
.quarter-process-dialog{width:min(720px,calc(100% - 28px));max-height:calc(100dvh - 28px);overflow:auto;border:1px solid var(--line);border-radius:16px;padding:clamp(14px,3vw,24px);box-shadow:var(--shadow)}
.quarter-process-dialog::backdrop{background:#0e3755a8}
.quarter-process-dialog>header,.quarter-process-dialog>footer{display:flex;align-items:center;justify-content:space-between;gap:10px}
.quarter-process-dialog>footer{justify-content:flex-end;margin-top:12px;border-top:1px solid var(--line);padding-top:12px}
.quarter-process-content{padding:8px 0;overflow-wrap:anywhere}
.quarter-process-steps{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;list-style-position:inside;padding:0;margin:12px 0 16px}
.quarter-process-steps li{border:1px solid var(--line);border-radius:8px;padding:8px;font-size:.83rem;color:var(--muted)}
.quarter-process-steps [aria-current=step]{border-color:#56c857;color:var(--ink)}
.quarter-process-links{display:flex;flex-wrap:wrap;gap:8px}
.quarter-process-action{margin-top:16px}
.quarter-corrections{padding-inline-start:1.3em}
.quarter-corrections li{padding:5px 0}
@media(max-width:550px){.quarter-process-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.quarter-process-dialog .button{white-space:normal;text-align:center}}
.quarter-run{border-top:1px solid var(--line);padding:9px 0}
.quarter-run > summary{cursor:pointer;line-height:1.5}
.quarter-run strong{margin-inline-start:.75rem}
@media(max-width:800px){.statement-actions{justify-content:flex-start}}
[hidden]{display:none!important}
.audit-event .section-head{align-items:flex-start}
.audit-event .section-head p{margin:8px 0;overflow-wrap:anywhere}
.audit-changes{table-layout:fixed;white-space:normal}
.audit-changes td{vertical-align:top;overflow-wrap:anywhere;white-space:pre-wrap}
.audit-changes th:first-child{width:24%}
html[data-theme=dark] .order-total-row th,
html[data-theme=dark] .order-total-row td,
html[data-theme=dark] .inline-order-table .order-total-row>:last-child{background:#1D413E!important;color:#D3F1D5;border-top-color:#56C857}
html{color-scheme:light}
.topbar{position:sticky;top:0;z-index:20;flex-shrink:0;height:auto;min-height:70px;padding:11px 42px;gap:16px}
.topbar-brand{white-space:nowrap}
.topbar-options{display:flex;align-items:center;gap:12px;margin-left:auto}
.topbar-select{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:.69rem;letter-spacing:0;text-transform:none;white-space:nowrap}
.topbar-select select{min-height:35px;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:var(--white);color:var(--ink);font-family:'DM Sans',Arial,sans-serif;font-size:.76rem;font-weight:700;letter-spacing:0;cursor:pointer}
#theme-select{min-width:126px}
#density-select{min-width:98px}
.topbar-select select:focus-visible{outline:3px solid var(--primary-green);outline-offset:2px}
.topbar-right{margin-left:9px}

.idle-reload{width:min(440px,calc(100% - 32px));padding:clamp(20px,5vw,32px);border:1px solid var(--line);border-radius:16px;background:var(--white);color:var(--ink);box-shadow:var(--shadow)}
.idle-reload::backdrop{background:rgba(9,30,45,.66)}
.idle-reload h2{font-size:1.4rem;margin:0 0 12px}
.idle-reload p{font-size:.9rem;line-height:1.5;color:var(--muted);margin:0 0 18px}
.idle-reload .idle-reload-warning{color:var(--ink);font-weight:700}
html:has(.idle-reload[open]){overflow:hidden}

/* Compact and minimal table rows */
html[data-density=compact] table th{padding:9px 12px}
html[data-density=compact] table td{padding:8px 12px;font-size:.78rem}
html[data-density=compact] .inline-order-table th,
html[data-density=compact] .inline-order-table td{padding:7px 8px}
html[data-density=compact] .inline-order-table input:not([type=hidden]),
html[data-density=compact] .inline-order-table textarea,
html[data-density=compact] .inline-order-table select{min-height:34px;padding:6px 7px;font-size:var(--order-entry-size)}
html[data-density=compact] .inline-order-table textarea{height:42px;min-height:42px}
html[data-density=compact] .inline-actions .button{min-height:30px;padding:5px 7px}
html[data-density=compact] .inline-status:empty{display:none}
html[data-density=compact] .inline-extra-row td{padding:12px 16px}

html[data-density=minimal] table th{padding:6px 10px;font-size:.6rem}
html[data-density=minimal] table td{padding:5px 10px;font-size:.75rem;line-height:1.25}
html[data-density=minimal] .description-cell{min-width:180px;max-width:260px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-density=minimal] .inline-order-table th,
html[data-density=minimal] .inline-order-table td{padding:5px 7px}
html[data-density=minimal] .inline-order-table input:not([type=hidden]),
html[data-density=minimal] .inline-order-table textarea,
html[data-density=minimal] .inline-order-table select{min-height:29px;padding:4px 6px;font-size:var(--order-entry-size)}
html[data-density=minimal] .inline-order-table textarea{height:29px;min-height:29px;resize:none;white-space:nowrap;overflow:hidden}
html[data-density=minimal] .inline-order-table textarea:focus{height:74px;white-space:normal;resize:vertical;overflow:auto}
html[data-density=minimal] .inline-actions .button{min-height:27px;padding:4px 6px;font-size:.68rem}
html[data-density=minimal] .inline-actions .row-link{width:25px;height:25px}
html[data-density=minimal] .inline-status:empty{display:none}
html[data-density=minimal] .inline-extra-row td{padding:9px 12px}

/* Keep the same page gutters as the other sections while the table remains scrollable. */
.stats-grid-with-export{grid-template-columns:repeat(4,minmax(0,1fr))}
.orders-toolbar{justify-content:space-between;flex-wrap:wrap}
.orders-toolbar .tabs{max-width:100%}
.stat-export-card{display:flex;flex-direction:column;align-items:flex-start;gap:7px}
.stat-export-card .button{min-height:36px;margin-top:auto;padding:8px 11px}
.stat-export-card small{line-height:1.35}
.quarter-export-actions{display:flex;flex-wrap:wrap;gap:8px}
@media(max-width:1200px){.stats-grid-with-export{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.stats-grid-with-export{grid-template-columns:1fr}}
.inline-order-table th{white-space:normal;line-height:1.2;overflow-wrap:normal}
.inline-order-table{--order-entry-size:.933333rem}
html[data-density=compact] .inline-order-table{--order-entry-size:.866667rem}
html[data-density=minimal] .inline-order-table{--order-entry-size:.8rem}
.inline-order-table tr:not(.inline-extra-row)>td{font-size:var(--order-entry-size)}
.inline-order-table input:not([type=hidden]),
.inline-order-table select{padding-left:5px;padding-right:5px;font-size:var(--order-entry-size)}
.inline-order-table select[name=category]{font-size:var(--order-entry-size);padding-left:3px;padding-right:0}
.inline-order-table tr:not(.inline-extra-row)>td:last-child,
.inline-order-table th:last-child{padding-left:3px;padding-right:0}
.inline-order-table .inline-actions{gap:2px;justify-content:flex-end;flex-wrap:nowrap}
.inline-order-table .inline-actions .button{padding-left:4px;padding-right:4px;font-size:.66rem}
.inline-order-table .inline-actions .row-link{width:22px;height:27px}
.inline-order-table .inline-readonly-row>td:first-child,
.inline-order-table .inline-readonly-row>.description-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.inline-order-table .inline-readonly-row>td:last-child .row-link{margin-left:auto;margin-right:3px}
.inline-order-table tr.order-group-row:not(.inline-extra-row)>th:last-child{position:static;padding:8px 12px;background:#E9F0F5;box-shadow:none;border-top:1px solid var(--line);border-bottom:1px solid var(--line);color:#365A72;font-size:.69rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase}
.inline-order-table .order-group-row .type-dot{width:9px;height:9px;margin-right:8px}
html[data-theme=dark] .inline-order-table tr.order-group-row:not(.inline-extra-row)>th:last-child{background:#1C3B51;color:#D0E2ED}
html[data-density=compact] .inline-order-table th,
html[data-density=compact] .inline-order-table td{padding-left:4px;padding-right:4px}
html[data-density=minimal] .inline-order-table th,
html[data-density=minimal] .inline-order-table td{padding-left:3px;padding-right:3px}
.inline-order-table th:last-child,
html[data-density=compact] .inline-order-table th:last-child,
html[data-density=minimal] .inline-order-table th:last-child{padding-right:0}
@media(max-width:700px){
  .inline-order-table .inline-actions{display:grid;justify-content:stretch}
  .inline-order-table .inline-actions .row-link{width:100%;height:30px}
}

/* Dark theme: navy surfaces, light text, green actions */
html[data-theme=dark]{
  color-scheme:dark;
  --ink:#EAF2F8;
  --muted:#B5C4CF;
  --line:#2B4B61;
  --canvas:#091E2D;
  --white:#123249;
  --teal:#9BD5F2;
  --shadow:0 12px 35px rgba(0,9,17,.24);
}
html[data-theme=dark] .topbar{background:var(--white);color:var(--muted)}
html[data-theme=dark] .topbar-select select{background:#193C53;color:var(--ink);border-color:#3A5B70}
html[data-theme=dark] .stat-card,
html[data-theme=dark] .panel,
html[data-theme=dark] .quarter-card{background:var(--white)}
html[data-theme=dark] th{background:#1A3B52;color:#C4D3DF}
html[data-theme=dark] td{border-bottom-color:#29485C}
html[data-theme=dark] td small,
html[data-theme=dark] .stat-card small,
html[data-theme=dark] .quarter-meta,
html[data-theme=dark] .form-help,
html[data-theme=dark] .form-grid em,
html[data-theme=dark] .form-stack em{color:var(--muted)}
html[data-theme=dark] .emphasis,
html[data-theme=dark] .calculation-total{color:#89D890}
html[data-theme=dark] .quarter-summary{background:var(--white)}
html[data-theme=dark] .tabs{background:#102B40}
html[data-theme=dark] .tabs a{color:var(--muted)}
html[data-theme=dark] .tabs a.selected{background:#28516B;color:#ffffff}
html[data-theme=dark] .button.secondary{background:#1A3D54;border-color:#3B6075;color:var(--ink)}
html[data-theme=dark] .button.secondary:hover{background:#24516A}
html[data-theme=dark] .row-link:hover{background:#24516A}
html[data-theme=dark] .search-bar input,
html[data-theme=dark] .form-grid input,
html[data-theme=dark] .form-grid select,
html[data-theme=dark] .form-grid textarea,
html[data-theme=dark] .form-stack input,
html[data-theme=dark] .form-stack select,
html[data-theme=dark] .form-stack textarea,
html[data-theme=dark] .workflow-panel textarea,
html[data-theme=dark] .inline-order-table input:not([type=hidden]),
html[data-theme=dark] .inline-order-table textarea,
html[data-theme=dark] .inline-order-table select{background:#193C53;color:var(--ink);border-color:#3A5B70}
html[data-theme=dark] input::placeholder,
html[data-theme=dark] textarea::placeholder{color:#A4B8C7}
html[data-theme=dark] .form-grid label,
html[data-theme=dark] .form-stack label,
html[data-theme=dark] .inline-extra-grid label{color:#D1DFE9}
html[data-theme=dark] .inline-order-table tr:not(.inline-extra-row)>:last-child{background:var(--white)}
html[data-theme=dark] .inline-order-table thead th:last-child{background:#1A3B52}
html[data-theme=dark] .inline-edit-row:hover td,
html[data-theme=dark] .inline-edit-row:focus-within td,
html[data-theme=dark] .inline-edit-row:hover td:last-child,
html[data-theme=dark] .inline-edit-row:focus-within td:last-child{background:#1B414D}
html[data-theme=dark] .inline-extra-row td{background:#102B3D!important;border-bottom-color:#34566A}
html[data-theme=dark] .inline-quarter{color:#BBD0DE}
html[data-theme=dark] .inline-status{color:#91DF9B}
html[data-theme=dark] .inline-edit-row.is-dirty .inline-status{color:#E5BC72}
html[data-theme=dark] .inline-edit-row.has-error .inline-status{color:#FFA5AE}
html[data-theme=dark] .calculation{background:#0C293B}
html[data-theme=dark] .calculation>div{border-bottom-color:#2B4B61}
html[data-theme=dark] .badge{background:#234A5E;color:#D8E9F4}
html[data-theme=dark] .status-draft{background:#29475A;color:#D1DFE9}
html[data-theme=dark] .status-in_review{background:#254C6C;color:#C6E3F5}
html[data-theme=dark] .status-approved{background:#225B38;color:#C5F2C8}
html[data-theme=dark] .status-closed{background:#29516A;color:#D1E7F4}
html[data-theme=dark] .alert.error{background:#4D2636;color:#FFD5DA;border-color:#774153}
html[data-theme=dark] .alert.success{background:#225439;color:#D1F4D4;border-color:#3C7551}
html[data-theme=dark] .alert.info{background:#21465F;color:#D7EAF6;border-color:#38617B}
html[data-theme=dark] .auth-card{background:var(--white)}
html[data-theme=dark] .auth-card .brand-lockup{color:var(--ink)}

/* Gentle category color across the full row, including the sticky action cell. */
.type-photo{background:#4D89B5}
.type-print{background:#56C857}
.order-category-photo{--order-row-bg:#EDF5FB;--order-row-hover:#E1EFFA}
.order-category-print{--order-row-bg:#EFF9F0;--order-row-hover:#E3F4E5}
.order-category-purchase{--order-row-bg:#FAEFF0;--order-row-hover:#F6E1E3}
html[data-theme=dark] .order-category-photo{--order-row-bg:#17374B;--order-row-hover:#214A63}
html[data-theme=dark] .order-category-print{--order-row-bg:#1B3D38;--order-row-hover:#245348}
html[data-theme=dark] .order-category-purchase{--order-row-bg:#3C2C39;--order-row-hover:#503542}
.order-category-photo>td,
.order-category-print>td,
.order-category-purchase>td{background:var(--order-row-bg)}
.inline-order-table tr.order-category-photo>td:last-child,
.inline-order-table tr.order-category-print>td:last-child,
.inline-order-table tr.order-category-purchase>td:last-child{background:var(--order-row-bg)}
.order-category-photo:hover>td,
.order-category-photo:focus-within>td,
.order-category-print:hover>td,
.order-category-print:focus-within>td,
.order-category-purchase:hover>td,
.order-category-purchase:focus-within>td{background:var(--order-row-hover)}
.inline-order-table tr.order-category-photo:hover>td:last-child,
.inline-order-table tr.order-category-photo:focus-within>td:last-child,
.inline-order-table tr.order-category-print:hover>td:last-child,
.inline-order-table tr.order-category-print:focus-within>td:last-child,
.inline-order-table tr.order-category-purchase:hover>td:last-child,
.inline-order-table tr.order-category-purchase:focus-within>td:last-child{background:var(--order-row-hover)}

/* Compact page overviews */
.compact-page-heading{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:3px 16px;margin-bottom:12px}
.compact-page-heading h1{font-size:clamp(1.7rem,2.4vw,2.25rem);margin:0}
.compact-page-heading p{margin:0;font-size:.78rem}
.statistics-overview{border:1px solid var(--line);border-radius:13px;overflow:hidden;background:var(--white);margin-bottom:12px}
.statistics-hero{display:flex;align-items:center;justify-content:space-between;gap:5px 20px;flex-wrap:wrap;padding:9px 14px;background:linear-gradient(100deg,#194b68,#0e3755 72%);color:#fff}
.statistics-hero h2{font-size:1.25rem}
.statistics-hero p{margin:2px 0 0;color:#d2e3ef;font-size:.78rem;line-height:1.35}
.statistics-hero>strong{font-size:1.45rem;line-height:1.15;white-space:nowrap;font-variant-numeric:tabular-nums}
.statistics-kpis,.statistics-status-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;margin:0;background:var(--line)}
.statistics-kpis>div,.statistics-status-card{background:var(--white);padding:8px 14px;min-width:0}
.statistics-kpis dt,.statistics-status-heading h3{font-size:.8rem;font-weight:700;color:var(--muted);margin:0}
.statistics-kpis dd{margin:2px 0 0;font-size:1.2rem;font-weight:800;line-height:1.15;font-variant-numeric:tabular-nums}
.statistics-status-grid{grid-template-columns:repeat(3,minmax(0,1fr));border-top:1px solid var(--line)}
.statistics-status-heading{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:2px 8px}
.statistics-status-heading strong{font-size:.97rem;line-height:1.2;white-space:nowrap;font-variant-numeric:tabular-nums}
.statistics-status-card p{font-size:.75rem;color:var(--muted);line-height:1.4;margin:4px 0 0}
.statistics-status-card a,.statistics-quarter-link{color:var(--teal);font-weight:800}
.statistics-status-card a:hover,.statistics-quarter-link:hover{text-decoration:underline}
.statistics-average-note{padding:8px 12px 10px;margin:0;color:var(--muted);font-size:.76rem;line-height:1.4}
.statistics-average-table th:first-child,.statistics-average-table td:first-child{white-space:normal}
.statistics-average-table tbody tr:last-child td{font-weight:800;color:var(--ink)}
.statistics-layout,.statistics-breakdown{display:grid;gap:12px;align-items:start}
.statistics-layout{grid-template-columns:minmax(290px,.8fr) minmax(0,1.7fr);margin-bottom:12px}
.statistics-breakdown,.statistics-panel{min-width:0}
.statistics-panel{margin:0;border-radius:13px}
.statistics-panel .section-head{padding:9px 12px}
.statistics-panel .section-head h2{font-size:1.07rem}
.statistics-category-list{padding:0 12px 4px}
.statistics-category{padding:7px 0;border-top:1px solid var(--line)}
.statistics-category-line,.statistics-category-amount{display:flex;justify-content:space-between;gap:10px;align-items:baseline;font-size:.8rem}
.statistics-category-line span,.statistics-category-amount{color:var(--muted)}
.statistics-category-amount{font-size:.72rem;margin-top:4px}
.statistics-category-amount strong{font-size:.8rem;color:var(--ink);font-variant-numeric:tabular-nums}
.statistics-bar{height:5px;border-radius:99px;background:var(--canvas);overflow:hidden;margin-top:4px}
.statistics-bar span{display:block;height:100%;border-radius:99px;background:#4D89B5}
.statistics-category-print .statistics-bar span{background:#56C857}
.statistics-category-purchase .statistics-bar span{background:#D86D70}
.statistics-category-adjustment .statistics-bar span{background:#91A6B5}
.statistics-quarter-table{min-width:700px}
.statistics-quarter-table td,.statistics-quarter-table th{padding-left:13px;padding-right:13px}
.statistics-panel .statistics-quarter-table{min-width:540px}
.statistics-panel th,.statistics-panel td{padding:6px 9px}
.statistics-panel th{white-space:normal}
.statistics-panel .badge{padding-block:3px}
.statistics-panel .table-scroll:focus-visible{outline:2px solid #56c857;outline-offset:-2px}
.statistics-note{font-size:.75rem;color:var(--muted);line-height:1.5;margin:0 3px 20px}
.archive-period-heading{margin:36px 0 17px}
.archive-period-heading .eyebrow{margin-bottom:7px}
.archive-period-heading p{color:var(--muted);font-size:.83rem;margin:7px 0 0}
.quarter-year-section{display:grid;grid-template-columns:66px minmax(0,1fr);margin:0 0 10px;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.quarter-year-heading{display:grid;place-items:center;margin:0;padding:6px 12px;background:linear-gradient(100deg,#194b68,#0e3755);color:#fff;font-size:1rem}
.quarter-year-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;background:var(--line)}
.quarter-year-grid .quarter-card{display:flex;flex-direction:column;gap:3px;min-height:0;padding:8px 10px;border:0;border-radius:0;box-shadow:none}
.quarter-year-grid .quarter-card:focus-visible{outline:2px solid #56c857;outline-offset:-2px}
.quarter-year-grid .quarter-card:hover{transform:none}
.quarter-year-grid a.quarter-card:hover{background:color-mix(in srgb,var(--white) 90%,#56c857)}
.quarter-year-grid a[aria-current=date]{box-shadow:inset 0 3px #56c857}
.quarter-year-grid .quarter-top{gap:2px 5px;flex-wrap:wrap}
.quarter-year-grid .quarter-top h3{margin:0;font-size:.95rem;color:var(--ink);line-height:1.2}
.quarter-card-year{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.quarter-year-grid .badge{padding:3px 6px}
.quarter-year-grid .quarter-amount{display:flex;justify-content:space-between;gap:3px;margin:0;font-size:1.1rem;line-height:1.2;font-variant-numeric:tabular-nums}
.quarter-year-grid .quarter-amount span{color:var(--teal);font-size:.84rem}
.quarter-year-grid .quarter-meta{color:var(--muted);font-size:.74rem;line-height:1.35}
.quarter-year-grid .quarter-card.quarter-card-empty{background:var(--canvas);justify-content:space-between}
.quarter-card-empty .badge{background:var(--line);color:var(--muted)}
.main-nav a:only-child{color:#fff;background:#1E506F;box-shadow:inset 3px 0 0 var(--lime)}
@media(max-width:1150px){.statistics-layout{grid-template-columns:1fr}.statistics-breakdown{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:960px){
  .quarter-year-section{grid-template-columns:minmax(0,1fr)}
  .quarter-year-heading{justify-items:start}
  .quarter-year-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .statistics-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;padding-inline:10px}
  .statistics-hero>div{display:contents}
  .statistics-hero h2{grid-column:1;grid-row:1;font-size:1.1rem}
  .statistics-hero p{grid-column:1/-1;grid-row:2;margin:0}
  .statistics-hero>strong{grid-column:2;grid-row:1;font-size:1.23rem}
  .statistics-breakdown{grid-template-columns:1fr}
  .statistics-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .statistics-status-grid{grid-template-columns:1fr}
  .statistics-kpis>div,.statistics-status-card{padding-inline:10px}
}
@media(max-width:1100px){.topbar{padding-left:25px;padding-right:25px}}
@media(min-width:701px) and (max-width:940px){
  .topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 16px}
  .topbar-brand{grid-column:1;grid-row:1}
  .topbar-right{grid-column:2;grid-row:1;margin:0}
  .topbar-options{grid-column:1/-1;grid-row:2;flex-wrap:wrap;margin:0}
}
@media(max-width:700px){
  .sidebar .brand-mark{width:47px;height:47px}
  .topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;min-height:0;padding:10px 18px}
  .topbar-brand{grid-column:1;grid-row:1}
  .topbar-right{grid-column:2;grid-row:1;margin:0}
  .topbar-options{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0;width:100%}
  .topbar-select{display:grid;gap:3px;min-width:0}
  .topbar-select select{width:100%;min-width:0}
  html[data-density=compact] .inline-actions .button,
  html[data-density=minimal] .inline-actions .button{min-height:30px}
}

/* The order list scrolls below its column headings within the viewport. */
.inline-order-table{border-collapse:separate;border-spacing:0}
.inline-table-scroll{max-height:calc(100vh - 140px);max-height:calc(100dvh - 140px);isolation:isolate}
.inline-order-table thead th{position:sticky;top:0;z-index:3;box-shadow:0 1px 0 var(--line)}
.inline-order-table thead tr:not(.inline-extra-row)>th:last-child{z-index:4;background:#F7F9FB;box-shadow:-7px 0 13px rgba(14,55,85,.045),0 1px 0 var(--line)}
html[data-theme=dark] .inline-order-table thead tr:not(.inline-extra-row)>th:last-child{background:#1A3B52}
@media(max-width:700px){.inline-table-scroll{max-height:calc(100vh - 100px);max-height:calc(100dvh - 100px)}}

/* Icon actions keep the editable order table narrow and keyboard accessible. */
.inline-order-table .inline-actions .icon-button{display:inline-grid;place-items:center;flex:none;width:30px;height:30px;min-width:30px;min-height:30px;padding:0}
.inline-order-table .inline-actions .icon-button svg{display:block;width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.inline-order-table .inline-actions .inline-more svg circle{fill:currentColor;stroke:none}
.inline-order-table .inline-actions .inline-more[aria-expanded=true]{background:#EAF8EB;border-color:#56C857;color:#0E3755}
.inline-order-table .inline-actions .icon-button:focus-visible{outline:3px solid #56C857;outline-offset:2px}
html[data-density=compact] .inline-order-table .inline-actions .icon-button{width:29px;height:29px;min-width:29px;min-height:29px}
html[data-density=minimal] .inline-order-table .inline-actions .icon-button{width:27px;height:27px;min-width:27px;min-height:27px}
html[data-theme=dark] .inline-order-table .inline-actions .inline-more[aria-expanded=true]{background:#21483D;color:#D3F1D5}
@media(max-width:700px){.inline-order-table .inline-actions{display:flex;align-items:center;justify-content:flex-end}.inline-order-table .inline-actions .inline-save{grid-column:auto}.inline-order-table .inline-actions .row-link{width:22px;height:30px}}

/* An open-state clock leaves room for the full quarter on one line. */
.inline-order-table .inline-quarter{white-space:nowrap;line-height:1.25}
.inline-order-table .inline-quarter[data-open="1"]::before{content:'';display:inline-block;width:12px;height:12px;margin-right:4px;vertical-align:-2px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.25' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M8 4v4l2.5 1.5' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat}
.inline-order-table .inline-quarter[data-open="0"]::before{content:'';display:inline-block;width:12px;height:12px;margin-right:4px;vertical-align:-2px;background:#23813A;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cmask id='check'%3E%3Ccircle cx='8' cy='8' r='7' fill='white'/%3E%3Cpath d='m4.5 8 2.25 2.25 4.75-4.75' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3Crect width='16' height='16' mask='url(%23check)'/%3E%3C/svg%3E") center/contain no-repeat}
html[data-theme=dark] .inline-order-table .inline-quarter[data-open="0"]::before{background:#72DC76}

/* Saved and unsaved states sit beside the action icons without adding row height. */
.inline-order-table .inline-action-cell form{display:flex;align-items:center;justify-content:flex-start;gap:4px;min-width:0}
.inline-order-table .inline-actions{flex:none;justify-content:flex-start}
.inline-order-table thead>tr>th:last-child,
.inline-order-table tr:not(.inline-extra-row)>td.inline-action-cell,
html[data-density=compact] .inline-order-table thead>tr>th:last-child,
html[data-density=compact] .inline-order-table tr:not(.inline-extra-row)>td.inline-action-cell,
html[data-density=minimal] .inline-order-table thead>tr>th:last-child,
html[data-density=minimal] .inline-order-table tr:not(.inline-extra-row)>td.inline-action-cell{padding-left:4px;padding-right:8px}
.inline-order-table .inline-actions .icon-button{width:26px;min-width:26px;height:28px;min-height:28px}
html[data-density=compact] .inline-order-table .inline-actions .icon-button{width:26px;min-width:26px;height:28px;min-height:28px}
html[data-density=minimal] .inline-order-table .inline-actions .icon-button{width:24px;min-width:24px;height:26px;min-height:26px}
.inline-order-table .inline-status{display:none;flex:none;width:16px;height:16px;min-height:0;margin:0;border-radius:50%;font-size:0;line-height:16px;text-align:center;color:#fff;white-space:nowrap}
.inline-order-table .inline-status[data-state=saved],
.inline-order-table .inline-status[data-state=dirty],
.inline-order-table .inline-status[data-state=saving],
.inline-order-table .inline-status[data-state=error]{display:inline-block}
.inline-order-table .inline-status[data-state=saved]{background:#23813A;color:#fff}
.inline-order-table .inline-status[data-state=dirty],
.inline-order-table .inline-status[data-state=error]{background:#C93E4D;color:#fff}
.inline-order-table .inline-status[data-state=saving]{background:#697888;color:#fff}
.inline-order-table .inline-status[data-state=saved]::before{content:'✓';font-size:12px;font-weight:800}
.inline-order-table .inline-status[data-state=dirty]::before,
.inline-order-table .inline-status[data-state=error]::before{content:'!';font-size:12px;font-weight:800}
.inline-order-table .inline-status[data-state=saving]::before{content:'…';font-size:13px;font-weight:800}
html[data-theme=dark] .inline-order-table .inline-status[data-state=saved]{background:#277F3B;color:#fff}
html[data-theme=dark] .inline-order-table .inline-status[data-state=dirty],
html[data-theme=dark] .inline-order-table .inline-status[data-state=error]{background:#C93E4D;color:#fff}

/* Editable cells read like table content until the user interacts with them. */
.inline-order-table .inline-edit-row input:not([type=hidden]),
.inline-order-table .inline-edit-row select{background:transparent;border-color:transparent;box-shadow:none;border-radius:5px;transition:background-color .15s,border-color .15s,box-shadow .15s}
.inline-order-table .inline-edit-row input:not([type=hidden]):hover,
.inline-order-table .inline-edit-row select:hover{background:rgba(255,255,255,.55);border-color:rgba(14,55,85,.16)}
.inline-order-table .inline-edit-row input:not([type=hidden]):focus,
.inline-order-table .inline-edit-row select:focus{background:var(--white);border-color:#56C857;box-shadow:0 0 0 2px rgba(86,200,87,.2);outline:none}
.inline-order-table .inline-edit-row input::placeholder{color:#697888;opacity:.8}
html[data-theme=dark] .inline-order-table .inline-edit-row input:not([type=hidden]),
html[data-theme=dark] .inline-order-table .inline-edit-row select{background:transparent;border-color:transparent}
html[data-theme=dark] .inline-order-table .inline-edit-row input:not([type=hidden]):hover,
html[data-theme=dark] .inline-order-table .inline-edit-row select:hover{background:rgba(255,255,255,.08);border-color:rgba(206,230,242,.18)}
html[data-theme=dark] .inline-order-table .inline-edit-row input:not([type=hidden]):focus,
html[data-theme=dark] .inline-order-table .inline-edit-row select:focus{background:#193C53;border-color:#56C857;box-shadow:0 0 0 2px rgba(86,200,87,.25)}
html[data-theme=dark] .inline-order-table .inline-edit-row input::placeholder{color:#B5C4CF;opacity:.72}

/* Order actions are plain icons; native title attributes supply tooltips. */
.inline-order-table .inline-actions .icon-button,
.inline-order-table .inline-actions .icon-button:hover,
.inline-order-table .inline-actions .inline-more[aria-expanded=true],
html[data-theme=dark] .inline-order-table .inline-actions .icon-button,
html[data-theme=dark] .inline-order-table .inline-actions .icon-button:hover,
html[data-theme=dark] .inline-order-table .inline-actions .inline-more[aria-expanded=true],
.inline-order-table .row-link,
.inline-order-table .row-link:hover,
html[data-theme=dark] .inline-order-table .row-link:hover{background:transparent;border:0;box-shadow:none}
.inline-order-table .inline-actions .inline-save{color:#237A36}
.inline-order-table .inline-actions .inline-delete,.delete-order-confirm{color:#a52c40}
.inline-order-table .inline-actions .inline-delete[aria-disabled=true]{opacity:.45}
.inline-order-table .inline-actions .inline-more,
.inline-order-table .row-link{color:#0E3755}
.inline-order-table .inline-actions .icon-button:hover,
.inline-order-table .row-link:hover{opacity:.7}
.inline-order-table .inline-actions .icon-button:disabled{opacity:.45}
html[data-theme=dark] .inline-order-table .inline-actions .inline-save{color:#72DC76}
html[data-theme=dark] .inline-order-table .inline-actions .inline-delete,html[data-theme=dark] .delete-order-confirm{color:#ffb8c2}
html[data-theme=dark] .inline-order-table .inline-actions .inline-more,
html[data-theme=dark] .inline-order-table .row-link{color:#D1E7F4}

