:root {
  --paper: #F5F5F1;
  --panel: #FFFFFF;
  --ink: #202923;
  --ink-2: #58625C;
  --ink-3: #5F6A63;
  --rule: #E1E5DE;
  --rule-2: #EDF0EA;
  --red: #BE2026;
  --red-soft: #FCEEEF;
  --basil: #26724B;
  --basil-soft: #EAF4ED;
  --mustard: #A77615;
  --mustard-soft: #FBF5E7;
  --slate: #5B6B7F;
  --sky: #356C95;
  --radius: 12px;
  --rail-w: 244px;
  --shadow: 0 2px 5px rgba(32, 41, 35, .025);
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1, "kern" 1;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.environment-banner { position: sticky; top: 0; z-index: 100; min-height: 30px; padding: 6px 16px; background: #77570E; color: #fff; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.staging-environment .rail { top: 30px; height: calc(100vh - 30px); height: calc(100dvh - 30px); }
.staging-environment .controls { top: 30px; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, a, input, select { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.025em; }
h1 { font-size: clamp(26px, 2.2vw, 34px); line-height: 1.18; }
h2 { font-size: 18px; }
h3 { font-size: 15px; color: var(--ink-2); }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 30; padding: 10px 18px; border-radius: 8px; background: var(--ink); color: #fff; }
.skip-link:focus { top: 12px; }
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }

/* Brand and navigation */
.rail { background: var(--panel); border-right: 1px solid var(--rule); padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; height: 100dvh; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 7px; padding-bottom: 16px; border-bottom: 1px solid var(--rule-2); flex: none; }
.brand-home { display: inline-flex; border-radius: 8px; }
.brand-logo { display: block; width: 93px; height: auto; }
.brand-sub { color: var(--ink-3); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.nav { list-style: none; margin: 0; padding: 0 1px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.nav-label { padding: 16px 12px 5px; color: var(--ink-3); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.nav-label:first-child { padding-top: 0; }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: 13px; font-weight: 500; line-height: 1.4; transition: background .15s, color .15s; }
.nav a svg { width: 18px; height: 18px; opacity: .8; }
.nav a:hover { background: #F5F7F2; color: var(--ink); }
.nav a.on { background: var(--red-soft); color: var(--red); font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: -1px; height: 17px; width: 3px; border-radius: 3px; background: var(--red); }
.nav a.on svg { opacity: 1; }
.nav-toggle { display: none; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 7px; padding: 13px 10px 0; border-top: 1px solid var(--rule-2); flex: none; }
.rail-note { color: var(--ink-3); font-size: 11px; padding-left: 28px; }
.mode-badge { align-self: flex-start; background: var(--mustard-soft); color: #654805; border: 1px solid #E9D7A7; border-radius: 6px; padding: 5px 8px; font-size: 11px; font-weight: 600; }
.link { background: none; border: 0; padding: 0; color: var(--basil); cursor: pointer; text-align: left; font-weight: 600; }
.link:hover { text-decoration: underline; }
.refresh-button { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; }
.refresh-button svg { width: 18px; height: 18px; }
.refresh-button[aria-busy="true"] svg { animation: spin 1s linear infinite; }

/* Compact report filters */
.main { min-width: 0; display: flex; flex-direction: column; }
.controls { background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--rule); padding: 17px 30px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; position: sticky; top: 0; z-index: 10; }
.control-group { display: flex; flex-direction: column; gap: 6px; max-width: 100%; min-width: 0; }
.control-label { color: var(--ink-3); font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.boundary-control { margin-left: auto; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { border: 1px solid var(--rule); background-color: var(--panel); border-radius: 7px; padding: 9px 11px; min-height: 40px; min-width: 0; max-width: 100%; font-size: 13px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--basil); }
select { cursor: pointer; }
#day-boundary { font-size: 12px; max-width: 248px; }
.filter-menu { position: relative; }
.filter-menu > summary { display: flex; align-items: center; gap: 10px; min-height: 40px; min-width: 184px; max-width: 300px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 7px; background: var(--panel); list-style: none; cursor: pointer; font-size: 13px; font-weight: 500; }
.filter-menu > summary::-webkit-details-marker { display: none; }
.filter-menu > summary svg { width: 17px; height: 17px; color: var(--ink-3); }
.filter-menu > summary:hover, .filter-menu[open] > summary { border-color: #9AA99F; background: #FCFDFB; }
#store-selection-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { margin-left: auto; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); flex: none; position: relative; top: -2px; }
.filter-menu[open] .chevron { transform: rotate(225deg); top: 2px; }
.filter-popover { position: absolute; left: 0; top: calc(100% + 10px); z-index: 12; width: 380px; max-width: calc(100vw - 32px); max-height: min(560px, 70dvh); overflow-y: auto; padding: 20px; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 14px 40px rgba(27, 42, 32, .14), 0 2px 8px rgba(27, 42, 32, .04); }
.popover-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 14px; }
.popover-heading .link { font-size: 12px; padding: 5px 0 5px 10px; }
.filter-hint { color: var(--ink-3); font-size: 12px; margin-bottom: 15px; }
.chips { display: grid; gap: 6px; }
.chip { width: 100%; border: 1px solid transparent; border-radius: 7px; padding: 9px 11px; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--ink-2); background: #F6F7F4; font-size: 13px; text-align: left; }
.chip::after { content: ""; margin-left: auto; width: 14px; height: 14px; border: 1px solid #ADB8AF; border-radius: 4px; flex: none; }
.chip.on { color: #205D3E; background: var(--basil-soft); border-color: #D9E9DD; }
.chip.on::after { content: ""; border-color: var(--basil); border-radius: 50%; background: var(--basil); box-shadow: inset 0 0 0 3px var(--basil-soft); }
.chip:hover { border-color: #99B4A3; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: none; }
.chip .dot.online { background: var(--basil); }
.chip .dot.offline { background: var(--red); }
.chip.all { font-weight: 600; margin-bottom: 4px; }
.segmented { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid var(--rule); border-radius: 9px; background: #EFF2EC; }
.segmented button { border: 0; border-radius: 6px; background: transparent; padding: 8px 13px; cursor: pointer; color: var(--ink-2); font-size: 13px; line-height: 1.4; font-weight: 500; }
.segmented button:hover:not(:disabled) { background: rgba(255, 255, 255, .7); color: var(--ink); }
.segmented button.on { background: var(--panel); color: var(--basil); box-shadow: 0 1px 4px rgba(25, 43, 32, .1); font-weight: 600; }
#range-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: transparent; border: 0; padding: 4px 0 0; gap: 7px; }
#range-presets button { text-align: left; background: #F5F7F2; min-height: 39px; border: 1px solid transparent; }
#range-presets button.on { color: var(--basil); background: var(--basil-soft); border-color: #CBDFD1; box-shadow: none; }
.custom-range { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--rule); }
.custom-range label { display: flex; flex: 1 1 130px; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-2); }
.custom-range input { width: 100%; }
.custom-range .btn { width: 100%; }
.btn { border: 1px solid var(--red); background: var(--red); color: #fff; border-radius: 7px; padding: 9px 16px; min-height: 40px; cursor: pointer; font-size: 13px; font-weight: 600; box-shadow: 0 1px 2px rgba(98, 11, 16, .08); transition: background .15s, border-color .15s; }
.btn:hover { background: #A71C22; border-color: #A71C22; }
.btn.secondary { background: var(--panel); border-color: var(--rule); color: var(--ink); box-shadow: none; }
.btn.secondary:hover { background: var(--rule-2); }
.btn:disabled, .link:disabled { cursor: wait; opacity: .55; }
.status { margin: 16px 30px 0; padding: 12px 16px; border-radius: 8px; background: var(--mustard-soft); color: #76551B; font-size: 13px; border: 1px solid #EEDFB9; }
.status.error { background: var(--red-soft); color: #921B21; border-color: #F0D0D2; }
.status.info { background: var(--rule-2); color: var(--ink-2); border-color: var(--rule); }

/* Report hierarchy */
.view { padding: 24px 30px 56px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.view-head > div:first-child { flex: 1 1 440px; }
.view-head p { color: var(--ink-2); max-width: 84ch; font-size: 13px; line-height: 1.65; margin-top: 9px; }
.view-head > .muted { font-size: 12px; margin-top: 6px; }
.view > p:not(.scope-callout) { font-size: 12px; line-height: 1.65; color: var(--ink-2); }
.loading { color: var(--ink-3); padding: 35px 0; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.loading::before { content: ""; display: block; flex: none; width: 18px; height: 18px; border: 2px solid #D5DDD3; border-top-color: var(--basil); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reporting-banner { order: -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 18px; padding: 0 0 14px; margin: 0; border-bottom: 1px solid var(--rule); color: var(--ink-3); font-size: 11px; }
.reporting-banner > span:first-child { display: flex; align-items: center; gap: 7px; }
.reporting-banner > span:first-child::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--basil); flex: none; }
.reporting-banner.partial > span:first-child::before { background: var(--mustard); }
.reporting-banner.demo > span:first-child::before { background: var(--slate); }
.reporting-banner a { color: var(--ink-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { position: relative; min-width: 0; padding: 19px 20px 18px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi:first-child { border-top: 3px solid var(--red); padding-top: 17px; }
.kpi .label { color: var(--ink-2); font-size: 12px; font-weight: 500; }
.kpi .value { font-size: clamp(24px, 2vw, 32px); font-weight: 600; letter-spacing: -.035em; line-height: 1.2; margin-top: 8px; overflow-wrap: anywhere; }
.kpi .delta { font-size: 11px; line-height: 1.5; margin-top: 9px; color: var(--ink-3); }
.kpi .delta.up { color: var(--basil); }
.kpi .delta.down { color: var(--red); }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; min-width: 0; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.panel h2 { font-size: 17px; }
.panel .sub { color: var(--ink-3); font-size: 12px; line-height: 1.65; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.chart-wrap { position: relative; height: 275px; min-width: 0; margin-top: 5px; }
.chart-wrap.tall { height: 350px; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.tile { border-radius: 9px; padding: 15px; border: 1px solid var(--rule); background: var(--panel); min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.tile .name { font-weight: 500; font-size: 12px; line-height: 1.4; display: flex; justify-content: space-between; gap: 6px; }
.tile .name .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; margin-top: 5px; }
.tile .num { font-size: 25px; font-weight: 600; letter-spacing: -.025em; }
.tile .foot { font-size: 11px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.tile.h1 { background: #FFF6F4; border-color: #F1E5DF; } .tile.h2 { background: #FCEBE7; border-color: #F0DBD5; } .tile.h3 { background: #F8DFDC; border-color: #EBCDC8; }
.tile.g1 { background: #F4F8F1; border-color: #E1EBDD; } .tile.g2 { background: #EAF3E7; border-color: #D8E6D4; } .tile.g3 { background: #DDEDD9; border-color: #CBDFC5; }
.tile.err { background: var(--rule-2); color: var(--ink-3); }
.heat { display: grid; grid-template-columns: 52px repeat(7, 1fr); gap: 4px; font-size: 12px; }
.heat .hd { color: var(--ink-3); text-align: center; padding-bottom: 5px; }
.heat .rl { color: var(--ink-3); text-align: right; padding-right: 8px; line-height: 25px; }
.heat .c { height: 25px; border-radius: 4px; background: var(--rule-2); position: relative; }
.heat .c span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--ink-2); }
.heat .c.l1 { background: #F7E0E1; } .heat .c.l2 { background: #F0C1C3; } .heat .c.l3 { background: #E79A9D; } .heat .c.l4 { background: #CE5D64; } .heat .c.l5 { background: var(--red); }
.heat .c.l4 span, .heat .c.l5 span { color: #fff; }

/* Tables and supporting detail */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 1.5; }
th, td { text-align: left; padding: 12px 13px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
th { color: var(--ink-2); font-weight: 600; font-size: 11px; border-bottom-color: var(--rule); position: sticky; top: 0; z-index: 2; background: #F6F8F3; white-space: nowrap; }
th:first-child { border-top-left-radius: 7px; }
th:last-child { border-top-right-radius: 7px; }
td.num, th.num { text-align: right; }
td.num { white-space: nowrap; font-weight: 500; }
.table-sort { width: 100%; min-height: 24px; display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; text-align: inherit; white-space: nowrap; cursor: pointer; }
th.num .table-sort { justify-content: flex-end; }
.table-sort::after { content: "↕"; color: #99A39B; font-size: 12px; line-height: 1; }
th[aria-sort="ascending"] .table-sort::after { content: "↑"; color: var(--red); }
th[aria-sort="descending"] .table-sort::after { content: "↓"; color: var(--red); }
.table-sort:hover { color: var(--ink); }
.table-sort:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #FCFDFB; }
tbody tr:hover { background: #F3F7EF; }
tfoot td { position: sticky; bottom: 0; z-index: 1; background: #EEF2EA; border-top: 1px solid var(--rule); border-bottom: 0; color: var(--ink); font-weight: 700; }
tfoot td:first-child { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
td:first-child { font-weight: 500; min-width: 120px; }
.table-scroll { overflow: auto; max-height: 420px; max-width: 100%; min-width: 0; border: 1px solid var(--rule-2); border-radius: 8px; scrollbar-width: thin; scrollbar-color: #BBC5B9 #F4F6F0; }
.table-group { min-width: 0; }
.table-mobile-toggle, .board-toggle { display: none; }
.export-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 28px; margin: 8px 0 5px; color: var(--ink-3); font-size: 11px; }
.export-actions span { margin-right: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.export-actions button { min-height: 28px; padding: 4px 9px; border: 1px solid var(--rule-2); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.export-actions button:hover { border-color: #8D998F; background: #F7F8F5; }
.export-actions button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.table-scroll:focus-visible { outline-offset: 2px; }
.bar { height: 5px; background: var(--rule-2); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--red); border-radius: 4px; }
.muted { color: var(--ink-3); }
.pos { color: var(--basil); } .neg { color: var(--red); }
.search { width: 260px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11px; color: var(--ink-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.empty { color: var(--ink-3); padding: 26px 14px; font-size: 13px; }
.count-notes { display: grid; gap: 14px; color: var(--ink-2); font-size: 13px; }
.count-notes b { color: var(--ink); }
.scope-callout { padding: 12px 16px; border: 1px solid #EADFBC; border-left: 3px solid #B39242; border-radius: 8px; background: var(--mustard-soft); color: #75613A; font-size: 12px; line-height: 1.7; }
.scope-callout b { color: #655022; }
.mini-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.mini-totals div { display: flex; flex-direction: column; gap: 4px; padding: 13px 15px; border-radius: 8px; background: #F3F6EF; }
.mini-totals span { color: var(--ink-2); font-size: 11px; }
.mini-totals b { font-size: 22px; font-weight: 600; }
details.panel { display: block; }
details.panel > summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details.panel[open] > summary { margin-bottom: 18px; }
details.panel[open] > p { margin-bottom: 16px; font-size: 13px; color: var(--ink-2); }
.details-panel { padding: 0; }
.details-panel > summary { padding: 18px 22px; list-style-position: inside; }
.details-panel[open] > summary { border-bottom: 1px solid var(--rule); margin-bottom: 0; }
.details-panel > .count-notes, .details-body { padding: 20px 22px; }
.panel-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-toolbar label { color: var(--ink-2); font-size: 12px; }
.panel-toolbar .sub { margin: 0; }
.menu-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pizza-tabs { align-self: flex-start; flex-wrap: wrap; }
.pizza-tabs button:disabled { opacity: .45; cursor: not-allowed; }
#pizza-flavour { align-self: flex-start; }
.menu-category-nav { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); }
.menu-category-nav label { font-weight: 600; font-size: 13px; }
.menu-category-nav select { min-width: 220px; }
.menu-measure { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-measure > span { color: var(--ink-2); font-size: 12px; font-weight: 600; }

/* Forecasts and local planning */
.forecast-view #period-controls, .royalties-view #period-controls, .scorecard-view #period-controls { display: none; }
/* Agreements cover every location and no sales period, so the report filters do not apply. */
.agreements-view #period-controls, .agreements-view .stores-control, .agreements-view .boundary-control { display: none; }
.agreement-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; margin: 14px 0; }
.agreement-form label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--ink-2); font-weight: 500; }
.agreement-form label.wide { grid-column: 1 / -1; }
.agreement-form h3 { grid-column: 1 / -1; margin: 6px 0 0; font-size: 13px; }
.standing-past { color: var(--red); font-weight: 600; }
.standing-soon { font-weight: 600; }
.nav [data-admin-nav][hidden] { display: none; }
.owner-groups { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
.owner-groups[hidden] { display: none; }
.owner-groups b { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.owner-groups .chip small { color: var(--ink-3); font-weight: 400; }
.terms-editor { overflow-x: auto; }
.terms-editor table { width: 100%; border-collapse: collapse; }
.terms-editor th, .terms-editor td { padding: 7px 10px 7px 0; text-align: left; font-size: 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.terms-editor thead th { color: var(--ink-2); font-weight: 600; }
.terms-editor tbody th { font-weight: 600; text-transform: none; letter-spacing: 0; }
.terms-editor select { min-width: 150px; }
.terms-editor input { width: 110px; }
.terms-actions { justify-content: flex-start; margin-top: 16px; }
.terms-notice { font-size: 12px; }
.terms-notice.error { color: var(--red, #C7202B); }
.forecast-controls { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: flex-end; gap: 14px; padding: 17px 20px; }
.forecast-controls > div { display: flex; flex-direction: column; gap: 6px; }
.forecast-controls label { font-size: 11px; color: var(--ink-2); font-weight: 500; }
.forecast-controls input { min-width: 156px; }
.forecast-controls select { min-width: 130px; }
.forecast-store-panel td:first-child { min-width: 180px; }
.forecast-store-panel td:nth-child(7) { min-width: 185px; }
.forecast-store-panel td:nth-child(9) { min-width: 170px; }
.forecast-store-panel td:nth-child(10) { min-width: 190px; }
.forecast-store-panel th:first-child, .forecast-store-panel td:first-child { position: sticky; left: 0; background: var(--panel); box-shadow: 1px 0 0 var(--rule); z-index: 1; }
.forecast-store-panel th:first-child { z-index: 3; background: #F6F8F3; }
.forecast-store-panel tr:hover td:first-child { background: #F3F7EF; }
#forecast-detail { min-width: 0; }
#forecast-detail > h2 { margin: 7px 0 8px; }
#forecast-detail > .table-scroll td:last-child { min-width: 240px; }
#forecast-detail > .table-scroll td:first-child { white-space: nowrap; }
.entry-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin: 20px 0; padding: 18px; background: #F6F8F3; border-radius: 9px; }
.entry-form label { display: flex; flex-direction: column; gap: 6px; flex: 1 1 160px; min-width: 0; font-size: 12px; color: var(--ink-2); }
.entry-form input, .entry-form select { width: 100%; }
.forecast-calendar { display: grid; grid-template-columns: repeat(7, minmax(112px, 1fr)); gap: 8px; margin: 18px 0 24px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: #BBC5B9 #F4F6F0; }
.calendar-heading { color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; padding: 6px 10px; }
.calendar-day { display: flex; flex-direction: column; gap: 7px; padding: 13px 11px; border: 1px solid #DEE8D9; border-radius: 8px; min-height: 144px; background: #F3F8EF; }
.calendar-day strong { font-size: 10px; font-weight: 600; color: var(--ink-2); }
.calendar-day b { font-size: 23px; letter-spacing: -.035em; color: #255637; font-weight: 600; }
.calendar-day > span { font-size: 11px; color: var(--ink-2); }
.calendar-day small { font-size: 10px; color: var(--ink-3); overflow-wrap: anywhere; }
.calendar-day .calendar-event { color: #82611D; background: #F8EDCE; padding: 3px 6px; border-radius: 4px; align-self: flex-start; }
.calendar-closed { background: var(--red-soft); border-color: #EED5D5; }
.calendar-closed b { color: var(--red); }
.forecast-subpanel { border-top: 1px solid var(--rule); padding: 17px 0; margin-top: 6px; }
.forecast-subpanel summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.forecast-subpanel[open] summary { margin-bottom: 14px; }
.forecast-subpanel .table-scroll { margin: 16px 0; }
.forecast-subpanel > label { font-size: 12px; margin-left: 12px; }

@media (min-width: 1500px) { .menu-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1200px) {
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .controls { gap: 12px; }
  .boundary-control { margin-left: 0; }
  .filter-menu > summary { min-width: 168px; }
}
@media (max-width: 1000px) {
  :root { --rail-w: 222px; }
  .rail { padding-left: 10px; padding-right: 10px; }
  .nav a { font-size: 12px; gap: 9px; }
  .controls { padding: 14px 22px; }
  .view { padding: 20px 22px 40px; gap: 20px; }
  .status { margin-left: 22px; margin-right: 22px; }
  .panel { padding: 18px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 28px; }
  .period-popover { left: auto; right: 0; }
}
@media (min-width: 761px) and (max-height: 850px) {
  .rail { padding-top: 14px; padding-bottom: 14px; gap: 10px; }
  .brand { padding-bottom: 12px; gap: 5px; }
  .brand-logo { width: 78px; }
  .nav { gap: 2px; }
  .nav a { padding-top: 7px; padding-bottom: 7px; }
  .nav-label { padding-top: 11px; padding-bottom: 4px; }
  .rail-foot { padding-top: 10px; gap: 4px; }
}
@media (max-width: 760px), (max-height: 520px) and (max-width: 950px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: relative; height: auto; padding: 10px 20px; gap: 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .staging-environment .rail { height: auto; }
  .brand { flex-direction: row; padding: 0; border: 0; gap: 14px; }
  .brand-logo { width: 48px; }
  .brand-sub { font-size: 10px; letter-spacing: .06em; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin-left: auto; padding: 9px 14px; min-height: 44px; border: 1px solid var(--rule); background: var(--panel); border-radius: 7px; font-size: 13px; cursor: pointer; }
  .nav-toggle svg { width: 16px; height: 16px; }
  .rail .nav, .rail-foot { display: none; }
  .nav-open .rail .nav { display: flex; margin-top: 18px; max-height: 62dvh; }
  .nav-open .rail-foot { display: flex; margin-top: 12px; padding-bottom: 7px; }
  .nav a { font-size: 14px; padding: 11px 12px; min-height: 44px; gap: 0; }
  .nav a svg, .nav-toggle svg, .filter-menu > summary svg, .refresh-button svg { display: none; }
  .nav-label { padding-top: 18px; }
  .controls { position: relative; padding: 12px 20px; gap: 10px 12px; }
  .control-group { flex: 1 1 140px; }
  .boundary-control { flex: 0 1 auto; }
  .filter-menu > summary { min-width: 0; max-width: none; min-height: 44px; font-size: 12px; }
  .filter-popover { max-width: calc(100vw - 40px); }
  .filter-menu { position: static; }
  .filter-popover { left: 20px; right: auto; top: 80px; width: calc(100vw - 40px); }
  .view { padding: 20px; }
  .view-head > div:first-child { flex-basis: 100%; }
  .view-head > .muted { margin-top: 0; }
  .reporting-banner { align-items: flex-start; font-size: 10px; }
  .panel { padding: 17px; }
  .status { margin-left: 20px; margin-right: 20px; }
  .menu-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea, .btn, .segmented button, #range-presets button, .account-popover a, .account-popover button { min-height: 44px; }
  .chip, .popover-heading .link { min-height: 44px; }
  .popover-heading .link { min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .trend-panel { order: 1; }
  .store-board-panel { order: 2; }
  .store-ranking-panel { order: 3; }
  .store-board-panel:not(.mobile-expanded) .tile:nth-child(n+4) { display: none; }
  .board-toggle, .table-mobile-toggle { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; min-height: 44px; padding: 9px 13px; border: 1px solid var(--rule); border-radius: 7px; background: var(--panel); color: var(--basil); font-size: 13px; font-weight: 600; cursor: pointer; }
  .table-scroll { max-height: none !important; overflow: visible; border: 0; border-radius: 0; }
  .table-scroll table { display: block; font-size: 13px; }
  .table-scroll thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .table-scroll tbody, .table-scroll tfoot { display: grid; gap: 10px; }
  .table-scroll tfoot { margin-top: 10px; }
  .table-scroll tbody tr, .table-scroll tfoot tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--rule); border-radius: 9px; background: var(--panel); }
  .table-scroll tbody tr:nth-child(even) { background: var(--panel); }
  .table-scroll tbody tr:hover { background: var(--panel); }
  .table-scroll td, .table-scroll tfoot td { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 12px; border-bottom: 1px solid var(--rule-2); background: transparent; white-space: normal; text-align: left; overflow-wrap: anywhere; }
  .table-scroll td::before { content: attr(data-label); color: var(--ink-3); font-size: 10px; font-weight: 600; letter-spacing: .06em; line-height: 1.35; text-transform: uppercase; }
  .table-scroll td:first-child, .table-scroll tfoot td:first-child { grid-column: 1 / -1; display: block; min-width: 0; padding: 11px 12px; border-bottom: 1px solid var(--rule); background: #F6F8F3; font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; }
  .table-scroll td:first-child::before, .table-scroll td[data-label=""]::before { display: none; }
  .table-scroll tr > td:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .table-scroll tfoot td { position: static; }
  .table-scroll.mobile-collapsible:not(.mobile-expanded) tbody tr:nth-child(n+6) { display: none; }
  .export-actions { min-height: 44px; margin-top: 2px; }
  .export-actions span { margin-right: auto; }
  .export-actions button { min-width: 44px; min-height: 44px; padding: 8px 10px; }
  details.panel > summary { display: flex; align-items: center; min-height: 44px; }
}
@media (max-width: 440px) {
  .rail { padding-left: 16px; padding-right: 16px; }
  .brand-sub { max-width: 105px; }
  .controls, .view { padding-left: 16px; padding-right: 16px; }
  .filter-popover { left: 16px; max-width: calc(100vw - 32px); width: calc(100vw - 32px); }
  .boundary-control { flex-basis: 100%; flex-direction: row; align-items: center; gap: 12px; }
  #day-boundary { flex: 1; width: 100%; max-width: none; min-height: 44px; font-size: 11px; }
  .boundary-control .control-label { flex: none; }
  .forecast-view .stores-control { flex-basis: 100%; }
  .kpis { gap: 9px; }
  .kpi { padding: 15px; }
  .kpi:first-child { padding-top: 13px; }
  .kpi .value { font-size: 25px; }
  .kpi .label { font-size: 11px; }
  .kpi .delta { font-size: 10px; }
  .scope-callout { font-size: 11px; padding: 10px 12px; }
  .menu-category-nav { flex-direction: column; align-items: stretch; gap: 7px; padding: 14px; }
  .menu-category-nav select { min-width: 0; width: 100%; }
  .menu-measure { margin-left: 0; justify-content: space-between; }
  .forecast-controls { gap: 12px; }
  .forecast-controls > div { flex: 1 1 120px; }
  .forecast-controls input, .forecast-controls select { width: 100%; min-width: 0; }
  .forecast-controls .btn { width: 100%; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .forecast-subpanel > label { display: block; margin: 12px 0 0; }
}

@media (max-width: 760px) {
  .controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls .stores-control { grid-column: 1; }
  .controls #period-controls { grid-column: 2; }
  .controls .boundary-control { grid-column: 1 / -1; padding-right: 66px; margin: 0; }
  .controls .account-menu { position: absolute; right: 20px; bottom: 11px; margin: 0; }
}

@media (max-height: 520px) and (min-width: 500px) and (max-width: 950px) {
  .controls { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, .9fr) minmax(0, 1.2fr); padding-right: 82px; }
  .controls .boundary-control { margin: 0; }
  .controls .account-menu { position: absolute; right: 20px; bottom: 11px; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print {
  .rail, .controls, .btn, .skip-link, .environment-banner, .export-actions { display: none; }
  .app { display: block; }
  .view { padding: 0; }
  .table-scroll { max-height: none !important; overflow: visible; }
  .panel, .kpi { box-shadow: none; break-inside: avoid; }
}

/* Account menu, shared by the dashboard and account pages */
.account-menu { position: relative; flex: none; }
.account-menu > summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; padding: 5px 8px; border: 1px solid transparent; border-radius: 9px; min-height: 44px; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover, .account-menu[open] > summary { background: var(--paper); border-color: var(--rule); }
.account-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--red-soft); color: var(--red); font-size: 12px; font-weight: 700; flex: none; }
.account-trigger-copy { display: grid; gap: 1px; max-width: 145px; }
.account-trigger-copy b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; font-weight: 600; }
.account-trigger-copy small { font-size: 10px; color: var(--ink-3); }
.account-menu .chevron { margin-left: 8px; }
.account-popover { position: absolute; right: 0; top: calc(100% + 9px); z-index: 25; width: 265px; max-width: calc(100vw - 32px); border: 1px solid var(--rule); border-radius: 12px; padding: 7px; background: var(--panel); box-shadow: 0 12px 36px rgba(27, 42, 32, .14); }
.account-popover-heading { display: grid; gap: 3px; padding: 10px 10px 13px; margin-bottom: 4px; border-bottom: 1px solid var(--rule-2); font-size: 13px; }
.account-popover-heading span { color: var(--ink-3); font-size: 11px; overflow-wrap: anywhere; }
.account-popover a, .account-popover button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; background: transparent; border-radius: 7px; text-decoration: none; text-align: left; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.account-popover svg { width: 17px; height: 17px; }
.account-popover a:hover { background: var(--paper); color: var(--ink); }
.account-popover button { color: var(--red); border-top: 1px solid var(--rule-2); border-radius: 0 0 7px 7px; margin-top: 4px; }
.account-popover button:hover { background: var(--red-soft); }
#range-presets button small { display: block; font-size: 10px; margin-top: 2px; opacity: .8; }
@media (max-width: 1150px) { .controls .account-trigger-copy { display: none; } }
@media (max-width: 600px) { .controls .account-menu { margin-left: auto; } }

/* 2026 interface system — operational, warm, and deliberately asymmetric. */
:root {
  --paper: #F3F2EE;
  --panel: #FCFBF8;
  --ink: #242321;
  --ink-2: #5F5C56;
  --ink-3: #77746E;
  --rule: #DDDAD3;
  --rule-2: #E9E6DF;
  --red: #B7242C;
  --red-soft: #F8E8E8;
  --basil: #2F6B4D;
  --basil-soft: #E6F0EA;
  --mustard: #967323;
  --mustard-soft: #F6EEDB;
  --slate: #666F78;
  --sky: #3E6480;
  --radius: 24px;
  --rail-w: 266px;
  --shadow: 0 16px 42px rgba(36, 35, 33, .055), 0 2px 8px rgba(36, 35, 33, .025);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}
body { background: var(--paper); font-size: 14px; }
h1, h2, h3 { letter-spacing: -.04em; }
h1 { font-size: clamp(30px, 3.2vw, 48px); font-weight: 700; line-height: 1.04; }
h2 { font-size: 18px; font-weight: 700; }
:focus-visible { outline-color: var(--red); }
.app { background: var(--paper); }

/* Navigation becomes the strongest spatial anchor. */
.rail {
  overflow: hidden;
  padding: 20px 14px 16px;
  gap: 18px;
  border: 0;
  background: #242321;
  color: #F7F5EF;
}
.brand { align-items: stretch; gap: 0; padding: 0 6px 19px; border-bottom-color: rgba(255,255,255,.1); }
.brand-home { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 13px; background: #fff; box-shadow: 0 7px 20px rgba(0,0,0,.16); }
.brand-logo { width: 32px; }
.brand-copy { display: grid; gap: 2px; min-width: 0; }
.brand-copy b { font-size: 19px; letter-spacing: -.045em; }
.brand-copy small { color: #A9A69F; font-size: 9px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; }
.nav { scrollbar-color: #57544F transparent; }
.nav-label { color: #78756F; padding: 16px 12px 6px; font-size: 9px; letter-spacing: .16em; }
.nav a { padding: 10px 11px; border-radius: 10px; color: #BEBBB4; font-size: 12px; transition: transform .18s ease, background-color .18s ease, color .18s ease; }
.nav a svg { opacity: .66; }
.nav a:hover { transform: translateX(2px); background: rgba(255,255,255,.065); color: #fff; }
.nav a.on { background: #F6F3ED; color: #242321; font-weight: 700; }
.nav a.on::before { left: 0; width: 3px; height: 20px; background: var(--red); }
.nav a.on svg { color: var(--red); }
.rail-foot { border-top-color: rgba(255,255,255,.1); }
.rail-note { color: #77746E; }
.refresh-button { color: #D8D4CB; }
.mode-badge { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.08); color: #E9D7A7; }

/* Controls stay quiet so the reports command attention. */
.controls {
  min-height: 88px;
  padding: 15px clamp(24px, 3vw, 44px);
  gap: 12px 18px;
  border-bottom-color: rgba(36,35,33,.1);
  background: rgba(243,242,238,.9);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}
.control-label { color: #85817A; font-size: 9px; letter-spacing: .14em; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea,
.filter-menu > summary { min-height: 42px; border-color: transparent; border-radius: 11px; background: rgba(255,255,255,.76); box-shadow: inset 0 0 0 1px rgba(36,35,33,.09); }
.filter-menu > summary { padding: 9px 13px; }
.filter-menu > summary:hover, .filter-menu[open] > summary { border-color: transparent; background: #fff; box-shadow: inset 0 0 0 1px rgba(36,35,33,.22); }
.filter-popover, .account-popover { border: 0; border-radius: 18px; box-shadow: 0 24px 64px rgba(36,35,33,.17), 0 3px 10px rgba(36,35,33,.06); }
.chip { border-radius: 10px; background: #F3F1EC; }
.chip.on { color: var(--red); background: var(--red-soft); border-color: #EBCDCF; }
.chip.on::after { border-color: var(--red); background: var(--red); }
.segmented, #range-presets button { border-radius: 10px; }
.segmented button.on, #range-presets button.on { color: var(--red); background: #fff; border-color: #E7C7C9; }
.btn { border-radius: 10px; box-shadow: 0 7px 18px rgba(183,36,44,.16); transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease; }
.btn:hover { background: #9E1E25; border-color: #9E1E25; box-shadow: 0 9px 22px rgba(183,36,44,.2); }
.btn:active, .nav-toggle:active, .export-actions button:active { transform: translateY(1px) scale(.985); }
.account-menu > summary { border-radius: 12px; }
.account-menu > summary:hover, .account-menu[open] > summary { background: rgba(255,255,255,.65); }
.account-avatar { width: 38px; height: 38px; border-radius: 12px; background: #242321; color: #fff; }

/* Report canvas and hierarchy. */
.view { width: 100%; max-width: 1500px; margin: 0 auto; padding: 38px clamp(24px, 3vw, 44px) 76px; gap: 26px; }
.view-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(180px, 3fr); align-items: end; gap: 24px; }
.view-head > div:first-child { min-width: 0; }
.view-head p { max-width: 70ch; margin-top: 12px; color: var(--ink-2); font-size: 13px; }
.view-head > .muted { justify-self: end; align-self: end; margin-bottom: 3px; padding: 7px 10px; border: 1px solid var(--rule); border-radius: 9px; background: rgba(255,255,255,.48); color: var(--ink-2); font-size: 11px; }
.reporting-banner { padding: 11px 14px; border: 1px solid var(--rule); border-radius: 12px; background: rgba(255,255,255,.5); }
.status { margin: 18px clamp(24px, 3vw, 44px) 0; border-radius: 12px; }

.kpis { grid-template-columns: minmax(240px, 1.35fr) repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { isolation: isolate; overflow: hidden; padding: 22px 22px 20px; border-color: transparent; border-radius: 20px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); }
.kpi:first-child { min-height: 148px; padding-top: 22px; border-top: 0; background: #242321; color: #fff; }
.kpi:first-child::after { content: ""; position: absolute; z-index: -1; right: -42px; bottom: -70px; width: 160px; height: 160px; border: 26px solid var(--red); border-radius: 50%; opacity: .9; }
.kpi .label { color: var(--ink-2); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.kpi:first-child .label { color: #B9B5AE; }
.kpi .value { margin-top: 13px; font-size: clamp(26px, 2.5vw, 38px); font-weight: 700; letter-spacing: -.055em; overflow-wrap: normal; word-break: normal; }
.kpi .delta { max-width: 26ch; margin-top: 11px; }
.kpi:first-child .delta { color: #AAA69F; }
.kpi:first-child .delta.up { color: #A5D1B5; }
.kpi:first-child .delta.down { color: #F4A5A9; }

.grid { gap: 22px; }
.panel { padding: 25px; border-color: transparent; border-radius: var(--radius); background: rgba(255,255,255,.84); box-shadow: var(--shadow); }
.panel h2 { font-size: 18px; }
.panel .sub { color: var(--ink-2); }
.chart-wrap { height: 300px; }
.chart-wrap.tall { height: 380px; }
.tile { min-height: 124px; padding: 17px; border-color: transparent; border-radius: 16px; background: #F5F3EE; }
.tile.h1, .tile.h2, .tile.h3 { background: #F7EAE9; border-color: transparent; }
.tile.g1, .tile.g2, .tile.g3 { background: #EAF1EC; border-color: transparent; }
.tile .num { font-weight: 700; letter-spacing: -.045em; }
.menu-category-nav { padding: 18px 21px; border: 0; border-radius: 17px; background: rgba(255,255,255,.76); box-shadow: var(--shadow); }
.scope-callout { border: 0; border-left: 3px solid #A07B2C; border-radius: 10px; }
.mini-totals div, .entry-form { border-radius: 14px; background: #F4F2ED; }
.calendar-day { border: 0; border-radius: 14px; background: #EDF2ED; }
.calendar-closed { background: var(--red-soft); }

/* Data density remains high, but the rows are easier to track. */
.table-scroll { border-color: var(--rule); border-radius: 13px; }
th { padding: 13px 14px; background: #F1EFEA; color: #68645E; font-size: 10px; letter-spacing: .035em; text-transform: uppercase; }
td { padding: 13px 14px; }
tbody tr:nth-child(even) { background: rgba(243,242,238,.54); }
tbody tr:hover { background: #F1EEE8; }
tfoot td { background: #EAE7E0; }
.bar { height: 6px; background: #E6E2DB; }
.export-actions button { border-radius: 8px; }

/* Content-shaped loading, empty, and failure states. */
.loading {
  position: relative;
  overflow: hidden;
  min-height: 246px;
  padding: 24px;
  align-items: flex-start;
  border-radius: 22px;
  background:
    linear-gradient(#E5E2DC 0 0) 24px 64px / min(34%, 270px) 17px no-repeat,
    linear-gradient(#ECE9E3 0 0) 24px 96px / calc(100% - 48px) 58px no-repeat,
    linear-gradient(#ECE9E3 0 0) 24px 168px / calc(62% - 30px) 50px no-repeat,
    linear-gradient(#ECE9E3 0 0) calc(62% + 8px) 168px / calc(38% - 32px) 50px no-repeat,
    rgba(255,255,255,.68);
  color: var(--ink-3);
  box-shadow: var(--shadow);
}
.loading::before { display: none; }
.loading::after { content: ""; position: absolute; inset: 0; transform: translate3d(-100%,0,0); background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.75) 48%, transparent 66%); animation: skeleton-sweep 1.45s ease-in-out infinite; }
@keyframes skeleton-sweep { to { transform: translate3d(100%,0,0); } }
.empty { color: var(--ink-3); }
.state-card { width: min(100%, 620px); margin: min(12vh, 120px) auto 0; padding: 52px 46px; border-radius: 26px; background: rgba(255,255,255,.78); box-shadow: var(--shadow); text-align: center; }
.state-card .state-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 20px; border-radius: 15px; background: #242321; color: #fff; font-size: 18px; font-weight: 800; }
.state-card h1 { font-size: 28px; }
.state-card p { max-width: 45ch; margin: 12px auto 0; color: var(--ink-2); }
.error-state .state-icon { background: var(--red); }

/* Restrained entrance motion; chart and table interactions remain immediate. */
.view > * { animation: report-enter .42s cubic-bezier(.2,.75,.25,1) both; }
.view > *:nth-child(2) { animation-delay: .035s; }
.view > *:nth-child(3) { animation-delay: .07s; }
.view > *:nth-child(4) { animation-delay: .105s; }
@keyframes report-enter { from { opacity: 0; transform: translate3d(0,10px,0); } to { opacity: 1; transform: translate3d(0,0,0); } }

@media (max-width: 1180px) {
  :root { --rail-w: 236px; }
  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kpi:first-child { grid-column: span 2; }
}
@media (max-width: 760px) {
  .rail { padding: 11px 16px; border-bottom: 0; }
  .brand { flex-direction: row; align-items: center; padding: 0; }
  .brand-home { gap: 10px; }
  .brand-mark { width: 42px; height: 42px; border-radius: 11px; }
  .brand-logo { width: 28px; }
  .brand-copy b { font-size: 17px; }
  .brand-copy small { font-size: 8px; }
  .nav-toggle { border-color: rgba(255,255,255,.14); border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; }
  .nav-open .rail .nav { max-height: 58dvh; overflow-y: auto; }
  .nav-open .rail-foot { border-top-color: rgba(255,255,255,.1); }
  .controls { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; min-height: 0; padding: 12px 16px 13px; gap: 10px; }
  .stores-control { grid-column: 1; grid-row: 1; }
  #period-controls { grid-column: 2; grid-row: 1; }
  .boundary-control { grid-column: 1 / -1; grid-row: 2; }
  .controls .account-menu { grid-column: 3; grid-row: 1; align-self: end; margin-left: 0; }
  .control-group { min-width: 0; }
  .filter-menu > summary { min-height: 40px; }
  .account-menu > summary { min-height: 40px; padding: 1px; }
  .account-avatar { width: 40px; height: 40px; }
  .filter-popover { top: 67px; }
  .view { padding: 27px 16px 52px; gap: 20px; }
  .view-head { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .view-head > .muted { justify-self: start; }
  .panel { padding: 20px; border-radius: 20px; }
  .chart-wrap { height: 270px; }
}
@media (max-width: 600px) {
  h1 { font-size: 32px; }
  .controls .filter-menu > summary svg, .controls .chevron { display: none; }
  .filter-menu > summary { padding-inline: 10px; font-size: 11px; }
  .control-label { font-size: 8px; }
  #day-boundary { min-height: 38px; }
  .kpis { grid-template-columns: minmax(0,1fr); }
  .kpi:first-child { grid-column: auto; }
  .kpi { min-height: 0; }
  .view-head p { font-size: 12px; }
  .reporting-banner { display: grid; }
  .state-card { padding: 38px 24px; }
}

/* Impeccable x JCP — graphic editorial system using the official brand book. */
:root {
  --brand-red: #D52329;
  --brand-green: #0A904F;
  --primary: var(--brand-red);
  --primary-strong: #9F171E;
  --secondary: var(--brand-green);
  --success: #087A43;
  --warning: #B45309;
  --danger: #B91C1C;
  --paper: #F7F1E6;
  --panel: #FFFDF8;
  --ink: #111827;
  --ink-2: #374151;
  --ink-3: #5B6472;
  --rule: #CDBFA9;
  --rule-2: #E4D8C6;
  --red: var(--brand-red);
  --red-soft: #FBE7E8;
  --basil: var(--success);
  --basil-soft: #E7F5EB;
  --mustard: var(--warning);
  --mustard-soft: #FFF0CF;
  --radius: 8px;
  --rail-w: 280px;
  --shadow: 4px 4px 0 rgba(17, 24, 39, .1);
  font-family: "Chakra Petch", system-ui, sans-serif;
}
body { color: var(--ink); font-size: 14px; }
h1, h2, h3 { font-family: "Chakra Petch", system-ui, sans-serif; letter-spacing: -.025em; }
h1 { font-size: 32px; line-height: 1; text-transform: uppercase; }
h2 { font-size: 20px; line-height: 1.2; }
h3 { font-size: 16px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--primary); }
.environment-banner { background: var(--ink); border-bottom: 4px solid var(--primary); color: #fff; font-size: 12px; }

.rail { padding: 24px 16px 16px; gap: 16px; background: var(--secondary); color: #fff; }
.brand { padding: 0 4px 24px; border-bottom: 2px solid rgba(255,255,255,.28); }
.brand-home { gap: 12px; }
.brand-mark { width: 52px; height: 52px; border: 2px solid var(--ink); border-radius: 4px; box-shadow: 4px 4px 0 rgba(17,24,39,.22); }
.brand-logo { width: 36px; }
.brand-copy b { font-size: 24px; letter-spacing: -.03em; }
.brand-copy small { color: #D9F7E8; font-size: 12px; letter-spacing: .08em; }
.nav { gap: 4px; scrollbar-color: #D9F7E8 transparent; }
.nav-label { padding: 16px 12px 8px; color: #D9F7E8; font-size: 12px; letter-spacing: .1em; }
.nav a { padding: 12px; border: 1px solid transparent; border-radius: 4px; color: #FFF8F0; font-size: 14px; }
.nav a:hover { transform: translateX(4px); border-color: rgba(255,255,255,.35); background: rgba(17,24,39,.1); color: #fff; }
.nav a.on { border-color: var(--ink); background: var(--paper); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.nav a.on::before { display: none; }
.nav a.on svg { color: var(--primary); }
.rail-foot { border-top: 2px solid rgba(255,255,255,.28); }
.rail-note { color: #D9F7E8; font-size: 12px; }
.refresh-button { color: #fff; font-size: 14px; }
.mode-badge { border: 1px solid #fff; border-radius: 4px; background: var(--primary); color: #fff; font-size: 12px; }

.controls { min-height: 96px; padding: 16px clamp(24px, 3vw, 48px); gap: 12px 24px; border-bottom: 4px solid var(--primary); background: rgba(255,253,248,.96); backdrop-filter: none; -webkit-backdrop-filter: none; }
.control-label { color: var(--ink-2); font-size: 12px; letter-spacing: .08em; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea,
.filter-menu > summary { min-height: 44px; border: 2px solid var(--ink); border-radius: 4px; background: var(--panel); box-shadow: 3px 3px 0 var(--rule); font-size: 14px; }
.filter-menu > summary { padding: 8px 12px; }
.filter-menu > summary:hover, .filter-menu[open] > summary { border-color: var(--secondary); background: #FFF7E7; box-shadow: 3px 3px 0 var(--primary); }
.filter-popover, .account-popover { border: 2px solid var(--ink); border-radius: 4px; box-shadow: 8px 8px 0 rgba(17,24,39,.18); }
.popover-heading, .filter-hint { font-size: 14px; }
.chip { border-radius: 4px; background: #F7EEDC; font-size: 14px; }
.chip.on { border-color: var(--secondary); background: #E7F5ED; color: #075E35; }
.chip.on::after { border-color: var(--secondary); background: var(--secondary); }
.segmented, .segmented button, #range-presets button { border-radius: 4px; }
.segmented button.on, #range-presets button.on { border-color: var(--secondary); color: #075E35; }
.btn { min-height: 44px; border: 2px solid var(--ink); border-radius: 4px; background: var(--primary); box-shadow: 4px 4px 0 var(--ink); color: #fff; font-size: 14px; }
.btn:hover { border-color: var(--ink); background: var(--primary-strong); box-shadow: 6px 6px 0 var(--ink); }
.btn.secondary { border-color: var(--ink); background: var(--panel); color: var(--ink); }
.btn:disabled, .link:disabled { opacity: .48; }
.account-menu > summary { border: 2px solid transparent; border-radius: 4px; }
.account-menu > summary:hover, .account-menu[open] > summary { border-color: var(--ink); background: var(--paper); }
.account-avatar { width: 40px; height: 40px; border: 2px solid var(--ink); border-radius: 4px; background: var(--primary); color: #fff; }

.view { max-width: 1480px; padding: 40px clamp(24px, 3vw, 48px) 80px; gap: 32px; }
.view-head { grid-template-columns: minmax(0, 7fr) minmax(240px, 3fr); gap: 32px; padding-left: 24px; border-left: 8px solid var(--primary); }
.view-head p { margin-top: 12px; color: var(--ink-2); font-size: 14px; }
.view-head > .muted { margin: 0; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 4px; background: #E7F5ED; color: var(--ink); font-family: "JetBrains Mono", monospace; font-size: 12px; }
.reporting-banner { padding: 12px 16px; border: 2px solid var(--ink); border-radius: 4px; background: var(--primary); color: #fff; font-size: 12px; box-shadow: 4px 4px 0 var(--ink); }
.reporting-banner a { color: #fff; font-weight: 700; }
.reporting-banner > span:first-child::before { background: #fff; }
.status { border: 2px solid var(--ink); border-radius: 4px; color: var(--ink); }
.status.error { border-color: var(--danger); background: #FEE2E2; color: #991B1B; }

.kpis { grid-template-columns: minmax(260px, 1.4fr) repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { padding: 24px; border: 2px solid var(--ink); border-radius: 4px; background: var(--panel); box-shadow: var(--shadow); }
.kpi:first-child { min-height: 160px; padding-top: 24px; background: var(--secondary); }
.kpi:first-child::after { right: -52px; bottom: -88px; width: 184px; height: 184px; border: 32px solid var(--primary); opacity: 1; }
.kpi .label { color: var(--ink-2); font-size: 12px; letter-spacing: .08em; }
.kpi:first-child .label, .kpi:first-child .delta { color: #FFF4E9; }
.kpi .value { margin-top: 12px; font-family: "JetBrains Mono", monospace; font-size: 20px; font-weight: 700; letter-spacing: -.045em; }
.kpi:first-child .value { font-size: 32px; }
.kpi .delta { margin-top: 12px; color: var(--ink-3); font-size: 12px; }
.kpi .delta.up, .pos { color: var(--success); }
.kpi .delta.down, .neg { color: var(--danger); }
.kpi:first-child .delta.up { color: #D1FAE5; }
.kpi:first-child .delta.down { color: #FEE2E2; }

.grid { gap: 24px; }
.panel { padding: 24px; border: 2px solid var(--ink); border-radius: 4px; background: var(--panel); box-shadow: var(--shadow); }
.panel:nth-child(3n + 2) { border-top: 8px solid var(--secondary); }
.panel h2 { font-size: 20px; text-transform: uppercase; }
.panel .sub { font-size: 14px; }
.tile { min-height: 128px; padding: 16px; border: 2px solid var(--ink); border-radius: 4px; background: #FFF8E9; }
.tile .name, .tile .foot { font-size: 12px; }
.tile .num, td.num, th.num { font-family: "JetBrains Mono", monospace; }
.tile.h1, .tile.h2, .tile.h3 { border-color: var(--danger); background: #FEE2E2; }
.tile.g1, .tile.g2, .tile.g3 { border-color: var(--success); background: #E7F5EB; }
.menu-category-nav { padding: 16px 24px; border: 2px solid var(--ink); border-radius: 4px; background: var(--primary); box-shadow: var(--shadow); }
.scope-callout { border: 2px solid var(--ink); border-left: 8px solid var(--warning); border-radius: 4px; background: #FFF0CF; color: var(--ink-2); font-size: 14px; }
.mini-totals div, .entry-form, .calendar-day { border: 1px solid var(--rule); border-radius: 4px; background: #F8EFDF; }
.calendar-closed { border-color: var(--danger); background: #FEE2E2; }

.table-scroll { border: 2px solid var(--ink); border-radius: 4px; }
table { font-size: 14px; }
th { padding: 12px 16px; background: var(--secondary); color: #fff; font-size: 12px; letter-spacing: .06em; }
.forecast-store-panel th:first-child { background: var(--secondary); }
.forecast-store-panel tr:hover td:first-child { background: #FFE8B7; }
td { padding: 12px 16px; }
tbody tr:nth-child(even) { background: #F7EEDC; }
tbody tr:hover { background: #FFE8B7; }
tfoot td { background: var(--primary); color: #fff; }
.table-sort::after { color: #D9F7E8; }
th[aria-sort="ascending"] .table-sort::after, th[aria-sort="descending"] .table-sort::after { color: #fff; }
.export-actions { font-size: 12px; }
.export-actions button { border: 1px solid var(--ink); border-radius: 4px; background: var(--paper); }
.bar { height: 8px; border-radius: 0; background: #E5D7C0; }
.bar i { border-radius: 0; background: var(--secondary); }

.loading { border: 2px solid var(--ink); border-radius: 4px; background-color: var(--panel); box-shadow: var(--shadow); font-size: 14px; }
.state-card { padding: 48px; border: 2px solid var(--ink); border-radius: 4px; background: var(--panel); box-shadow: 8px 8px 0 var(--primary); }
.state-card .state-icon { border: 2px solid var(--ink); border-radius: 4px; background: var(--primary); color: #fff; }
.state-card h1 { font-size: 24px; }
.error-state .state-icon { background: var(--danger); color: #fff; }

@media (max-width: 1180px) {
  :root { --rail-w: 248px; }
}
@media (min-width: 1400px) {
  .kpi:not(:first-child) .value { font-size: 24px; }
}
@media (max-width: 760px) {
  .rail { padding: 12px 16px; }
  .brand-mark { width: 44px; height: 44px; border-radius: 4px; }
  .brand-copy b { font-size: 20px; }
  .brand-copy small { font-size: 12px; }
  .nav-toggle { min-height: 44px; border: 2px solid var(--ink); border-radius: 4px; background: var(--paper); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
  .controls { padding: 12px 16px 16px; gap: 12px; }
  .view { padding: 32px 16px 56px; gap: 24px; }
  .view-head { gap: 16px; padding-left: 16px; }
  .panel { padding: 20px; border-radius: 4px; }
}
@media (max-width: 600px) {
  h1 { font-size: 28px; }
  .control-label { font-size: 12px; }
  .filter-menu > summary { font-size: 12px; }
  .kpi { padding: 20px; }
  .kpi .value { font-size: 24px; }
  .view-head p, .panel .sub, .scope-callout { font-size: 14px; }
  .state-card { padding: 32px 24px; }
}

/* Impeccable, refined: editorial hierarchy with quiet JCP brand accents. */
:root,
:root[data-style-preview="calm"] {
  --brand-red: #D52329;
  --brand-green: #0A904F;
  --primary: #A4484C;
  --primary-strong: #8D383D;
  --secondary: #4F715E;
  --success: #47735B;
  --warning: #9B762D;
  --danger: #A4484C;
  --paper: #F2F0EA;
  --panel: #FFFEFA;
  --ink: #292C28;
  --ink-2: #535A52;
  --ink-3: #727970;
  --rule: #D7D5CE;
  --rule-2: #E9E6DF;
  --red: var(--primary);
  --red-soft: #F3E8E6;
  --basil: var(--secondary);
  --basil-soft: #E8EFEA;
  --mustard: var(--warning);
  --mustard-soft: #F6F0E2;
  --rail-bg: #292D29;
  --rail-text: #F8F6F0;
  --rail-muted: #A9AFA7;
  --rail-rule: rgba(255,255,255,.1);
  --rail-hover: rgba(255,255,255,.06);
  --rail-active: rgba(255,255,255,.1);
  --radius: 16px;
  --rail-w: 264px;
  --shadow: 0 10px 32px rgba(36, 39, 35, .045);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1, "kern" 1;
}
:root[data-style-preview="warm"] {
  --primary: #9B4B46;
  --primary-strong: #813C38;
  --secondary: #66745E;
  --success: #58725D;
  --paper: #F4EFE8;
  --panel: #FFFCF7;
  --ink: #302B28;
  --ink-2: #5E5550;
  --ink-3: #7A716B;
  --rule: #DDD5CC;
  --rule-2: #ECE5DC;
  --red-soft: #F1E5E1;
  --basil-soft: #EAEDE5;
  --rail-bg: #553D39;
  --rail-text: #FFF9F3;
  --rail-muted: #D1C0B8;
  --rail-rule: rgba(255,255,255,.12);
  --rail-hover: rgba(255,255,255,.065);
  --rail-active: rgba(255,255,255,.11);
}
:root[data-style-preview="mono"] {
  --primary: #92474C;
  --primary-strong: #78383D;
  --secondary: #5D6D62;
  --success: #506D5A;
  --paper: #F3F2EE;
  --panel: #FFFFFF;
  --ink: #292C28;
  --ink-2: #555A54;
  --ink-3: #767B74;
  --rule: #D9D8D2;
  --rule-2: #EAE9E4;
  --red-soft: #F1E8E7;
  --basil-soft: #EAEEEB;
  --rail-bg: #FAF9F5;
  --rail-text: #292C28;
  --rail-muted: #747A73;
  --rail-rule: #E2E0D9;
  --rail-hover: #F0EEE8;
  --rail-active: #EDEAE3;
}

body { background: var(--paper); color: var(--ink); font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; }
h1, h2, h3 { font-family: inherit; text-transform: none; letter-spacing: -.035em; }
h1 { font-size: clamp(30px, 3vw, 42px); line-height: 1.08; }
h2 { font-size: 18px; line-height: 1.3; }
h3 { font-size: 15px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; box-shadow: none; }
.environment-banner { min-height: 30px; padding: 7px 16px; border: 0; background: #20231F; color: #E8EAE5; font-size: 10px; letter-spacing: .12em; }

.rail { padding: 22px 16px 16px; gap: 14px; border-right: 1px solid var(--rail-rule); background: var(--rail-bg); color: var(--rail-text); }
.brand { align-items: stretch; padding: 0 5px 19px; border-bottom: 1px solid var(--rail-rule); }
.brand-home { gap: 12px; border-radius: 12px; }
.brand-mark { width: 48px; height: 48px; border: 0; border-radius: 12px; background: #fff; box-shadow: none; }
.brand-logo { width: 34px; }
.brand-copy b { color: var(--rail-text); font-size: 20px; letter-spacing: -.035em; }
.brand-copy small { color: var(--rail-muted); font-size: 10px; letter-spacing: .08em; }
.nav { gap: 2px; scrollbar-color: var(--rail-muted) transparent; }
.nav-label { padding: 17px 12px 6px; color: var(--rail-muted); font-size: 9px; letter-spacing: .12em; }
.nav a { padding: 10px 11px; border: 0; border-radius: 9px; color: var(--rail-muted); font-size: 12px; }
.nav a:hover { transform: none; border: 0; background: var(--rail-hover); color: var(--rail-text); }
.nav a.on { border: 0; background: var(--rail-active); color: var(--rail-text); box-shadow: none; }
.nav a.on::before { display: block; left: 0; width: 3px; height: 18px; border-radius: 4px; background: var(--primary); }
.nav a.on svg { color: var(--rail-text); }
.rail-foot { border-top: 1px solid var(--rail-rule); }
.rail-note { color: var(--rail-muted); font-size: 10px; }
.refresh-button { color: var(--rail-text); font-size: 12px; }
.mode-badge { border: 1px solid var(--rail-rule); border-radius: 7px; background: var(--rail-hover); color: var(--rail-text); font-size: 10px; }
:root[data-style-preview="mono"] .brand-mark { border: 1px solid var(--rail-rule); }

.controls { min-height: 78px; padding: 14px clamp(24px, 3vw, 44px); gap: 12px 20px; border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.control-label { color: var(--ink-3); font-size: 9px; letter-spacing: .11em; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea,
.filter-menu > summary { min-height: 40px; border: 1px solid var(--rule); border-radius: 9px; background: var(--panel); box-shadow: none; font-size: 12px; }
.filter-menu > summary { padding: 8px 11px; }
.filter-menu > summary:hover, .filter-menu[open] > summary { border-color: #A5A79F; background: var(--panel); box-shadow: none; }
.filter-popover, .account-popover { border: 1px solid var(--rule); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 50px rgba(36,39,35,.14); }
.popover-heading, .filter-hint { font-size: 12px; }
.chip { border-radius: 8px; background: #F4F3EE; font-size: 12px; }
.chip.on { border-color: #CEDAD1; background: var(--basil-soft); color: #365A47; }
.chip.on::after { border-color: var(--secondary); background: var(--secondary); }
.segmented, .segmented button, #range-presets button { border-radius: 8px; }
.segmented button.on, #range-presets button.on { border-color: #CBD8CE; color: #365A47; }
.btn { min-height: 40px; border: 1px solid var(--primary); border-radius: 9px; background: var(--primary); box-shadow: none; color: #fff; font-size: 12px; }
.btn:hover { border-color: var(--primary-strong); background: var(--primary-strong); box-shadow: none; }
.btn.secondary { border-color: var(--rule); background: var(--panel); color: var(--ink); }
.account-menu > summary { border: 1px solid transparent; border-radius: 10px; }
.account-menu > summary:hover, .account-menu[open] > summary { border-color: var(--rule); background: var(--panel); }
.account-avatar { width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; }

.view { max-width: 1540px; padding: 34px clamp(24px, 3vw, 44px) 80px; gap: 24px; }
.view-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 0; border: 0; }
.view-head p { margin-top: 10px; color: var(--ink-2); font-size: 13px; line-height: 1.65; }
.view-head > .muted { align-self: start; max-width: 290px; margin: 3px 0 0; padding: 8px 11px; border: 1px solid var(--rule); border-radius: 9px; background: rgba(255,255,255,.48); color: var(--ink-2); font-family: inherit; font-size: 10px; line-height: 1.5; }
.reporting-banner { padding: 0 0 13px; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: transparent; color: var(--ink-3); font-size: 10px; box-shadow: none; }
.reporting-banner a { color: var(--ink-2); font-weight: 700; }
.reporting-banner > span:first-child::before { background: var(--secondary); }
.status { border: 1px solid #DED4B9; border-radius: 10px; color: #6E5A2F; }
.status.error { border-color: #E4C8C5; background: #F5E7E5; color: #83383C; }

.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 13px; }
.kpi { min-height: 132px; padding: 20px; border: 1px solid var(--rule); border-radius: 15px; background: color-mix(in srgb, var(--panel) 94%, var(--paper)); box-shadow: var(--shadow); }
.kpi:first-child { min-height: 132px; padding: 20px; border: 1px solid #363A35; background: #30342F; color: #fff; }
.kpi:first-child::after { right: -48px; bottom: -68px; width: 142px; height: 142px; border: 24px solid var(--primary); opacity: .44; }
.kpi .label { color: var(--ink-2); font-size: 10px; letter-spacing: .08em; }
.kpi:first-child .label, .kpi:first-child .delta { color: #C9CEC7; }
.kpi .value { margin-top: 12px; font-family: inherit; font-size: clamp(24px, 2.2vw, 32px); font-weight: 700; letter-spacing: -.045em; }
.kpi:first-child .value { font-size: clamp(28px, 2.5vw, 36px); }
.kpi .delta { margin-top: 10px; color: var(--ink-3); font-size: 10px; }
.kpi .delta.up, .pos { color: var(--success); }
.kpi .delta.down, .neg { color: var(--danger); }
.kpi:first-child .delta.up { color: #B7D5C1; }
.kpi:first-child .delta.down { color: #E8B5B4; }

.grid { gap: 18px; }
.panel { padding: 22px; border: 1px solid var(--rule); border-radius: 17px; background: color-mix(in srgb, var(--panel) 95%, var(--paper)); box-shadow: var(--shadow); }
.panel:nth-child(3n + 2) { border-top: 1px solid var(--rule); }
.panel h2 { font-size: 17px; text-transform: none; }
.panel .sub { font-size: 12px; }
.tile { min-height: 118px; padding: 15px; border: 1px solid var(--rule); border-radius: 11px; background: var(--panel); }
.tile .name, .tile .foot { font-size: 11px; }
.tile .num, td.num, th.num { font-family: inherit; }
.tile.h1, .tile.h2, .tile.h3 { border-color: #E6CECA; background: #F4E8E5; }
.tile.g1, .tile.g2, .tile.g3 { border-color: #D2DED5; background: #EAF0EB; }
.menu-category-nav { padding: 14px 20px; border: 0; border-radius: 14px; background: #30342F; box-shadow: none; }
.scope-callout { border: 1px solid #E4D9BD; border-left: 3px solid var(--warning); border-radius: 10px; background: var(--mustard-soft); color: #6A5C3D; font-size: 12px; }
.mini-totals div, .entry-form, .calendar-day { border: 1px solid var(--rule); border-radius: 10px; background: #F5F3ED; }
.calendar-closed { border-color: #E4C8C5; background: #F5E7E5; }

.table-scroll { border: 1px solid var(--rule); border-radius: 11px; }
table { font-size: 12px; }
th { padding: 11px 13px; background: #F2F1EC; color: var(--ink-2); font-size: 10px; letter-spacing: .04em; }
.forecast-store-panel th:first-child { background: #F2F1EC; }
.forecast-store-panel tr:hover td:first-child { background: #F2F3EE; }
td { padding: 11px 13px; }
tbody tr:nth-child(even) { background: #FAF9F6; }
tbody tr:hover { background: #F2F3EE; }
tfoot td { background: #EAE9E3; color: var(--ink); }
.table-sort::after { color: #989E96; }
th[aria-sort="ascending"] .table-sort::after, th[aria-sort="descending"] .table-sort::after { color: var(--primary); }
.export-actions { font-size: 10px; }
.export-actions button { border: 1px solid var(--rule); border-radius: 7px; background: var(--panel); }
.bar { height: 6px; border-radius: 6px; background: #E4E3DD; }
.bar i { border-radius: 6px; background: var(--secondary); }

.loading { border: 1px solid var(--rule); border-radius: 14px; background-color: var(--panel); box-shadow: var(--shadow); font-size: 12px; }
.state-card { padding: 48px; border: 1px solid var(--rule); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.state-card .state-icon { border: 0; border-radius: 12px; background: var(--ink); color: #fff; }
.state-card h1 { font-size: 24px; }
.error-state .state-icon { background: var(--danger); color: #fff; }

/* The chooser is injected only when the server reports local-preview. */
.style-lab { position: fixed; right: 18px; bottom: 18px; z-index: 130; width: min(360px, calc(100vw - 36px)); color: #272A26; filter: drop-shadow(0 18px 34px rgba(26,29,25,.18)); }
.style-lab > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: max-content; min-height: 40px; margin-left: auto; padding: 9px 13px; border: 1px solid #D5D3CC; border-radius: 11px; background: #FFFEFA; list-style: none; cursor: pointer; font-size: 11px; font-weight: 700; }
.style-lab > summary::-webkit-details-marker { display: none; }
.style-lab-chevron { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(225deg); }
.style-lab:not([open]) .style-lab-chevron { transform: rotate(45deg); }
.style-lab-panel { margin-top: 8px; padding: 16px; border: 1px solid #D5D3CC; border-radius: 16px; background: #FFFEFA; }
.style-lab-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.style-lab-heading b { font-size: 13px; }
.style-lab-heading span { color: #777C74; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.style-lab-options { display: grid; gap: 7px; }
.style-lab-options button { display: grid; grid-template-columns: 56px minmax(0,1fr); align-items: center; gap: 11px; width: 100%; min-height: 62px; padding: 8px; border: 1px solid #E3E1DB; border-radius: 11px; background: #FAF9F5; color: #272A26; text-align: left; cursor: pointer; }
.style-lab-options button:hover { border-color: #B7BAB2; background: #F6F4EF; }
.style-lab-options button[aria-pressed="true"] { border-color: #858B82; box-shadow: 0 0 0 2px rgba(79,113,94,.12); }
.style-lab-options button > span:last-child { display: grid; gap: 2px; }
.style-lab-options button b { font-size: 11px; }
.style-lab-options button small { color: #70766E; font-size: 9px; line-height: 1.45; }
.style-swatch { display: grid; grid-template-columns: 18px 1fr; grid-template-rows: repeat(2, 1fr); width: 56px; height: 42px; overflow: hidden; border: 1px solid rgba(20,24,20,.1); border-radius: 8px; background: #F2F0EA; }
.style-swatch i:first-child { grid-row: 1 / 3; background: #292D29; }
.style-swatch i:nth-child(2) { background: #FFFEFA; }
.style-swatch i:nth-child(3) { background: linear-gradient(90deg, #A4484C 0 50%, #4F715E 50%); }
.style-swatch.warm { background: #F4EFE8; }
.style-swatch.warm i:first-child { background: #553D39; }
.style-swatch.warm i:nth-child(2) { background: #FFFCF7; }
.style-swatch.warm i:nth-child(3) { background: linear-gradient(90deg, #9B4B46 0 50%, #66745E 50%); }
.style-swatch.mono { background: #F3F2EE; }
.style-swatch.mono i:first-child { background: #FAF9F5; }
.style-swatch.mono i:nth-child(2) { background: #FFFFFF; }
.style-swatch.mono i:nth-child(3) { background: linear-gradient(90deg, #92474C 0 50%, #5D6D62 50%); }

@media (max-width: 1180px) {
  :root { --rail-w: 244px; }
}
@media (max-width: 760px) {
  .rail { padding: 11px 16px; }
  .brand { padding: 0; border: 0; }
  .brand-mark { width: 42px; height: 42px; border-radius: 10px; }
  .brand-copy b { font-size: 18px; }
  .brand-copy small { font-size: 9px; }
  .nav-toggle { min-height: 40px; border: 1px solid var(--rail-rule); border-radius: 9px; background: var(--rail-hover); color: var(--rail-text); box-shadow: none; }
  .controls { padding: 12px 16px; gap: 10px 12px; }
  .view { padding: 28px 16px 68px; gap: 20px; }
  .view-head { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .view-head > .muted { max-width: none; }
  .panel { padding: 18px; border-radius: 14px; }
  .style-lab { right: 12px; bottom: 12px; width: min(344px, calc(100vw - 24px)); }
}
@media (max-width: 600px) {
  h1 { font-size: 30px; }
  .control-label { font-size: 9px; }
  .filter-menu > summary { font-size: 11px; }
  .filter-popover, .period-popover { left: 16px; right: auto; width: calc(100vw - 32px); max-width: calc(100vw - 32px); }
  details:not([open]) > .filter-popover { display: none; }
  .view-head { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi, .kpi:first-child { min-height: 120px; padding: 18px; }
  .kpi .value { font-size: 27px; }
  .view-head p, .panel .sub, .scope-callout { font-size: 12px; }
  .state-card { padding: 32px 24px; }
}

/* Data craft: insight-led charts and tables that reveal magnitude at a glance. */
.chart-reading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 2px 0 0;
  padding: 9px 12px;
  border-left: 3px solid var(--primary);
  border-radius: 0 9px 9px 0;
  background: color-mix(in srgb, var(--red-soft) 58%, transparent);
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.5;
}
.chart-reading > span {
  flex: none;
  color: var(--primary);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.chart-wrap {
  min-height: 280px;
  margin-top: 1px;
  padding-top: 5px;
}
.chart-wrap canvas { filter: saturate(.9); }

.table-visual { background: var(--panel); }
.table-visual table { font-variant-numeric: tabular-nums lining-nums; }
.table-visual th {
  border-bottom: 1px solid #C9CBC4;
  background: #EFEEE8;
  color: #555C54;
  font-weight: 700;
}
.table-visual tbody td { vertical-align: middle; }
.table-visual tbody tr { transition: background-color .12s ease; }
.table-visual tfoot td {
  border-top: 1px solid #BFC2BA;
  background: #E8E7E1;
  box-shadow: 0 -4px 12px rgba(41,44,40,.025);
}
.cell-measure {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  width: 100%;
  min-width: 104px;
  font-variant-numeric: tabular-nums lining-nums;
}
.cell-value { position: relative; z-index: 1; white-space: nowrap; }
.cell-track {
  display: inline-block;
  flex: 0 0 42px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #E3E4DF;
}
.cell-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--secondary);
}
.cell-measure.negative .cell-track i { background: var(--primary); }
.cell-measure.neutral .cell-track i { background: #A7AAA3; }
.cell-shade {
  display: block;
  min-width: 0;
  margin: -6px -8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgb(79 113 94 / var(--shade));
}
.cell-shade.negative { background: rgb(164 72 76 / var(--shade)); }
.cell-shade.neutral { background: rgb(114 121 112 / var(--shade)); }
.dense-data td.num { min-width: 82px; }

@media (max-width: 900px) {
  .cell-measure:not(.cell-shade) { min-width: 0; }
  .cell-measure:not(.cell-shade) .cell-track { display: none; }
}
@media (max-width: 600px) {
  .chart-reading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .chart-wrap { min-height: 260px; }
}

/* Responsive audit overrides live last so every visual theme keeps the same mobile behavior. */
@media (max-width: 760px), (max-height: 520px) and (max-width: 950px) {
  .nav-toggle, .filter-menu > summary, #day-boundary, .account-menu > summary,
  input:not([type="checkbox"]):not([type="radio"]), select, textarea, .btn,
  .segmented button, #range-presets button, .account-popover a, .account-popover button { min-height: 44px; }
  .nav a svg, .nav-toggle svg, .filter-menu > summary svg, .refresh-button svg { display: none; }
  .table-hint { display: none; }
  .table-scroll { max-height: none !important; overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .table-scroll tfoot td { position: static; }
}

/* Payment timing follows the established report spacing and mobile tables. */
.payment-timing { display: grid; gap: 20px; margin-top: 12px; min-width: 0; }

/* Franchisee fee statements: shown as a preview on screen, printed one store per page. */
.statement-pages { display: grid; gap: 18px; margin-top: 16px; }
.statement-page { max-width: 780px; padding: 28px 32px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; color: #1D1F1E; font-size: 13px; line-height: 1.5; }
.statement-page header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--red); font-size: 16px; }
.statement-page header img { width: 44px; height: auto; }
.statement-block + .statement-block { margin-top: 22px; padding-top: 18px; border-top: 1px dashed #C9CEC8; }
.statement-block h2 { margin: 0 0 10px; font-size: 17px; }
.statement-block dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin: 0 0 12px; }
.statement-block dt { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #6B736E; }
.statement-block dd { margin: 2px 0 0; font-weight: 600; }
.statement-block dd span { font-weight: 400; color: #58625C; }
.statement-block table { width: 100%; border-collapse: collapse; }
.statement-block th, .statement-block td { padding: 7px 12px 7px 0; border: 0; border-bottom: 1px solid #E1E5DE; background: none; text-align: left; font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: inherit; }
.statement-block thead th { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #6B736E; }
.statement-block .num { padding-right: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.statement-block .statement-total th, .statement-block .statement-total td { border-top: 2px solid #1D1F1E; border-bottom: 0; font-weight: 700; }
.statement-notes, .statement-progress { margin: 10px 0 0; font-size: 11px; color: #58625C; }
.statement-progress { margin: 0 0 10px; font-weight: 600; }
#print-root { display: none; }
@media (max-width: 640px) { .statement-page { padding: 18px 16px; } .statement-block dl { grid-template-columns: 1fr; } }
@media print {
  @page { margin: 16mm; }
  body.print-statements { background: #fff; }
  body.print-statements > :not(#print-root) { display: none !important; }
  body.print-statements #print-root { display: block; }
  body.print-statements .statement-page { max-width: none; padding: 0; border: 0; border-radius: 0; break-after: page; page-break-after: always; }
  body.print-statements .statement-page:last-child { break-after: auto; page-break-after: auto; }
}
