﻿/* EZData / EZDash base styles */
:root {
    --bg: #f6f4ef;
    --panel: #ffffff;
    --ink: #1f2328;
    --muted: #616a73;
    --line: #e2ddd3;
    --accent: #2f5d8a;
    --accent-ink: #ffffff;
    --good: #2e7d4f;
    --warn: #b26b00;
    --bad: #b3261e;
    --radius: 10px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16181b;
        --panel: #1f2226;
        --ink: #e8e6e1;
        --muted: #a0a7ae;
        --line: #33373c;
        --accent: #7fb0e0;
        --accent-ink: #10161c;
        --good: #6cc48e;
        --warn: #e0a64b;
        --bad: #f08a80;
    }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    overflow-x: clip;
}
a { color: var(--accent); }
h1 { font-size: 24px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 18px; margin: 24px 0 8px; font-weight: 650; }
p.lead { color: var(--muted); margin: 0 0 20px; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 1100px; margin: 0 auto; padding: 8px 16px; min-height: 60px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand img { height: 32px; width: auto; }
.brand > span { display: flex; flex-direction: column; line-height: 1.2; }
.brand .name { font-weight: 700; font-size: 16px; }
.brand .title { color: var(--muted); font-size: 12px; }

.nav { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.nav-main { display: flex; gap: 2px; }
.nav-link, .nav-top { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: none;
                      color: var(--ink); font: inherit; font-size: 14px; font-weight: 550; text-decoration: none; cursor: pointer; white-space: nowrap; }
.nav-link:hover, .nav-top:hover, .nav-group.open > .nav-top { background: var(--cal-hover); }
.nav-link.active, .nav-group.active > .nav-top { color: var(--accent); background: var(--accent-soft); }
.nav-top .chev { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.nav-group.open > .nav-top .chev { transform: rotate(180deg); }
.nav-group { position: relative; }
.nav-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 290px; padding: 6px;
            background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.06); }
.nav-group.open > .nav-menu { display: block; animation: cal-in .12s ease-out; }
.nav-menu a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.nav-menu a:hover { background: var(--cal-hover); }
.nav-menu a.active { background: var(--accent-soft); }
.nav-menu a.active b { color: var(--accent); }
.nav-menu b { display: block; font-size: 14px; font-weight: 600; }
.nav-menu small { display: block; font-size: 12px; color: var(--muted); }
.nav-user { margin-left: auto; }
.nav-user .nav-menu { left: auto; right: 0; min-width: 200px; }
.nav-user-name { font-weight: 500; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
          background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.nav-link:focus-visible, .nav-top:focus-visible, .nav-menu a:focus-visible, .menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-btn { display: none; }

@media (max-width: 860px) {
    .topbar .inner { min-height: 56px; gap: 12px; }
    .menu-btn { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; width: 44px; height: 44px;
                border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); cursor: pointer; }
    .menu-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
    .menu-btn .i-close, html.nav-open .menu-btn .i-open { display: none; }
    html.nav-open .menu-btn .i-close { display: inline; }
    /* the menu opens as a panel under the header, everything listed, groups as headings */
    .nav { display: none; position: fixed; z-index: 55; top: 56px; left: 0; right: 0; bottom: 0; overflow-y: auto;
           flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px calc(24px + env(safe-area-inset-bottom));
           background: var(--panel); border-top: 1px solid var(--line); }
    html.nav-open { overflow: hidden; }
    html.nav-open .nav { display: flex; animation: nav-down .16s ease-out; }
    .nav-main { flex-direction: column; gap: 2px; padding-bottom: 8px; }
    .nav-link { height: 48px; font-size: 16px; padding: 0 12px; }
    .nav-group { border-top: 1px solid var(--line); padding: 10px 0 8px; }
    .nav-top { height: auto; padding: 4px 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
               color: var(--muted); background: none !important; cursor: default; pointer-events: none; }
    .nav-group.active > .nav-top { color: var(--muted); }
    .nav-top .chev { display: none; }
    .nav-menu, .nav-group.open > .nav-menu { display: block; position: static; min-width: 0; padding: 0; border: 0; box-shadow: none; animation: none; }
    .nav-menu a { padding: 10px 12px; }
    .nav-menu b { font-size: 16px; }
    .nav-user { margin-left: 0; }
    .nav-user .nav-top { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); gap: 10px; padding: 6px 12px 8px; }
    .nav-user .nav-menu { min-width: 0; }
}
@keyframes nav-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html.nav-open .nav, .nav-group.open > .nav-menu { animation: none; } }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
.footer { color: var(--muted); font-size: 12px; text-align: center; padding: 16px; }

/* Panels and forms */
.panel {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; margin-bottom: 16px;
}
.panel h2:first-child { margin-top: 0; }
.narrow { max-width: 440px; margin: 40px auto; }
@media (max-width: 720px) {
    /* single-form pages (sign in, change password): the card fills the screen, a full-width button that is easy to tap */
    .narrow { margin: 16px auto; }
    .narrow input[type=text], .narrow input[type=password] { min-height: 46px; }
    .narrow .actions .btn, .narrow .actions input[type=submit] { width: 100%; min-height: 48px; font-size: 16px; }
}
.field { margin-bottom: 14px; }
.field label, .field .label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 3px; }
.field .meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
/* fields side by side on wide screens (product page), one column on phones */
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.field-grid .wide { grid-column: 1 / -1; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time], input[type=url],
select, textarea {
    width: 100%; max-width: 520px; padding: 8px 10px; font: inherit; color: var(--ink);
    background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
}
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.checklist label { font-weight: 400; }
.checklist td { padding: 2px 16px 2px 0; }

.btn, input[type=submit].btn {
    display: inline-block; padding: 8px 16px; font: inherit; font-weight: 600; font-size: 14px;
    border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
    cursor: pointer; text-decoration: none;
}
.btn.secondary { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* Messages */
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.msg.ok { color: var(--good); border-color: var(--good); }
.msg.warn { color: var(--warn); border-color: var(--warn); }
.msg.err { color: var(--bad); border-color: var(--bad); }
.msg pre { white-space: pre-wrap; margin: 6px 0 0; font-size: 12px; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
table.grid tr:hover td { background: var(--bg); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); margin: 0 4px 2px 0; }
.tag.good { color: var(--good); border-color: var(--good); }
.tag.bad { color: var(--bad); border-color: var(--bad); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Settings layout */
.settings { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
.groups { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 12px; }
.groups a { text-decoration: none; color: var(--ink); padding: 7px 10px; border-radius: 8px; font-size: 14px; }
.groups a.active { background: var(--panel); border: 1px solid var(--line); font-weight: 600; }
@media (max-width: 720px) {
    .settings { grid-template-columns: 1fr; }
    .groups { position: static; flex-direction: row; flex-wrap: wrap; }
}

/* iOS-style switches (Settings: every on/off setting, and the card tables of Dashboard / End of day) */
input.switch { -webkit-appearance: none; appearance: none; width: 42px; height: 24px; flex: 0 0 42px; margin: 0 8px 0 0; padding: 0;
               border-radius: 999px; background: color-mix(in srgb, var(--muted) 55%, transparent); position: relative; cursor: pointer;
               vertical-align: middle; transition: background .15s; }
input.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
                       background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .15s; }
input.switch:checked { background: var(--good); }
input.switch:checked::before { transform: translateX(18px); }
input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { input.switch, input.switch::before { transition: none; } }
@media (forced-colors: active) {
    input.switch { -webkit-appearance: auto; appearance: auto; width: auto; height: auto; flex: none; }
    input.switch::before { display: none; }
}
table.card-switches { width: auto; min-width: min(100%, 560px); }
table.card-switches th.sw, table.card-switches td.sw { text-align: center; width: 130px; vertical-align: middle; }
table.card-switches td.sw input.switch { margin: 0; }
table.card-switches .card-name { font-weight: 600; }
table.card-switches td:first-child { min-width: 200px; }
table.card-switches th.role-head { border-bottom: 2px solid var(--line); }
table.card-switches td.dim input.switch { opacity: .35; }

/* Home cards and checklist */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card .t { font-weight: 650; margin-bottom: 4px; }
.card .d { color: var(--muted); font-size: 13px; }
ul.todo { list-style: none; padding: 0; margin: 0; }
ul.todo li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
ul.todo li:last-child { border-bottom: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--good); }
.dot.no { background: var(--warn); }
table.grid td.nowrap { white-space: nowrap; }
table.grid .w-name { min-width: 180px; }
table.grid .w-short { min-width: 120px; }
table.grid .w-sel { min-width: 130px; }
table.grid .w-num { width: 90px; min-width: 90px; }
table.grid td.src { min-width: 260px; }
/* a panel title with a button on its right (Log), and the Log button under a row's name */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.title-row h2 { margin-right: auto; }
.row-log { margin-top: 4px; }
.badge.kind { border-color: var(--accent); color: var(--accent); }
/* a TP product that is not Public in TP; the "Only public TP products" chip at the end of the tabs / list line */
.tp-hidden { color: var(--warn); font-weight: 600; }
.tabs .tabs-end { margin-left: auto; align-self: center; }
.tabs .tabs-end a.fchip { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 13px; }
.tabs .tabs-end a.fchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
/* yes / no as a green tick or a red cross (product page roles) */
.yn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; vertical-align: middle; }
.yn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.yn.yes { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.yn.no { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.yn .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* page links under and over long lists (Products) */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0; }
/* Locations: name and short name side by side, the source IDs under them */
.loc-main { min-width: 300px; }
.loc-names { display: flex; gap: 8px; flex-wrap: wrap; }
.loc-names label { display: flex; flex-direction: column; font-size: 11px; line-height: 16px; font-weight: 600; color: var(--muted); gap: 2px; }
.loc-names label:first-child { flex: 2 1 170px; }
.loc-names label:last-child { flex: 1 1 110px; }
.loc-names input { font-weight: 400; font-size: 14px; line-height: normal; color: var(--ink); }
.loc-src { margin-top: 6px; line-height: 1.5; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* the other cells line up with the name boxes (8px cell padding + 16px label + 2px gap); the checkbox centred on that line */
@media (min-width: 721px) {
    table.grid.loc-table td { vertical-align: top; padding-top: 26px; }
    table.grid.loc-table td.loc-main { padding-top: 8px; }
    table.grid.loc-table td.loc-check { padding-top: 35px; }
}
/* a factor box with its unit list beside it (product page, Costed by) */
table.grid .factor-unit { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
table.grid .factor-unit select { width: auto; min-width: 90px; max-width: 160px; }
/* Tabs and toolbars (Mapping) */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 12px; }
.tabs a { text-decoration: none; color: var(--ink); padding: 7px 12px; border-radius: 8px; border: 1px solid transparent; font-size: 14px; }
.tabs a.active { background: var(--panel); border-color: var(--line); font-weight: 600; }
.tabs .count { color: var(--muted); font-size: 12px; margin-left: 4px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=text] { flex: 1 1 260px; }
.toolbar .spacer { flex: 1 1 auto; }
.btn.small-btn, input[type=submit].small-btn { padding: 4px 10px; font-size: 12.5px; }
input[type=submit].btn.secondary { background: transparent; color: var(--accent); }
input[type=submit].btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }

/* ===== Dashboard ===== */
:root {
    --series-1: #2a78d6; --series-1-strong: #1c5cab; --series-2: #eb6834;
    --chart-grid: #e1e0d9; --chart-axis: #c3c2b7; --chart-muted: #898781;
    --good-text: #006300; --bad-text: #b3261e; --warn-text: #9a5b00;
}
@media (prefers-color-scheme: dark) {
    :root {
        --series-1: #3987e5; --series-1-strong: #86b6ef; --series-2: #d95926;
        --chart-grid: #2c2c2a; --chart-axis: #383835; --chart-muted: #898781;
        --good-text: #0ca30c; --bad-text: #f08a80; --warn-text: #e0a64b;
    }
}
.dash h1 { margin-bottom: 12px; }
.crumb { margin: 0 0 6px; font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Dashboard filter: period, calendar, store ---- */
:root { --accent-soft: #e4edf6; --cal-hover: #f1efe9; }
@media (prefers-color-scheme: dark) { :root { --accent-soft: #233548; --cal-hover: #2a2e33; } }
.dash-filter { position: relative; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 18px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.seg a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 550; transition: background .15s, color .15s; }
.seg a:hover { color: var(--ink); background: var(--cal-hover); }
.seg a.on { background: var(--accent); color: var(--accent-ink); }
.pp { display: inline-flex; align-items: stretch; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pp-arrow { display: inline-flex; align-items: center; justify-content: center; width: 40px; color: var(--ink); text-decoration: none; }
.pp-arrow:hover { background: var(--cal-hover); }
.pp-arrow.off { color: var(--line); }
.pp-label { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; min-width: 210px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
            background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pp-label:hover, .pp-label[aria-expanded=true] { background: var(--cal-hover); }
.pp-label svg { color: var(--accent); flex: none; }
.pp-text { display: flex; flex-direction: column; line-height: 1.2; }
.pp-text b { font-size: 15px; font-weight: 650; }
.pp-text small { font-size: 12px; color: var(--muted); }
.store-pick select { width: auto; max-width: 240px; height: 44px; border-radius: 12px; }

.cal-back { position: fixed; inset: 0; z-index: 40; background: transparent; }
/* after a click on the period, arrows, calendar or store: a moving bar on top and the page dimmed until the next one arrives */
html.dash-loading main { opacity: .5; transition: opacity .15s .1s; }
html.dash-loading body::before { content: ""; position: fixed; z-index: 60; top: 0; left: 0; height: 3px; width: 40%;
                                 background: var(--accent); animation: dash-bar 1.1s ease-in-out infinite; }
@keyframes dash-bar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { html.dash-loading body::before { animation: none; width: 100%; opacity: .6; } }
.cal-pop { position: absolute; z-index: 41; top: calc(100% + 8px); left: 0; width: 340px; padding: 12px 14px 14px;
           background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.06);
           animation: cal-in .14s ease-out; }
.cal-pop[hidden], .cal-back[hidden] { display: none; }
.cal-pop.busy { opacity: .6; pointer-events: none; }
@keyframes cal-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cal-grab { display: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-weight: 650; font-size: 16px; }
.cal-nav { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.cal-nav:hover:not(:disabled) { background: var(--cal-hover); }
.cal-nav:disabled { color: var(--line); cursor: default; }
.cal-grid { display: flex; flex-direction: column; gap: 2px; }
.cal-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow span { text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 4px 0 6px; }
.cal-day { position: relative; height: 40px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums;
           border-radius: 10px; cursor: pointer; }
.cal-day:hover:not(:disabled) { background: var(--cal-hover); }
.cal-day.out { color: var(--muted); }
.cal-day:disabled { color: var(--line); cursor: default; }
.cal-day.last::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.cal-day.sel { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.cal-day.sel.last::after { background: var(--accent-ink); }
.cal-day.sel:hover:not(:disabled) { background: var(--accent); }
.ranges .cal-day.in:hover:not(:disabled) { background: var(--accent-soft); }
/* week mode: the whole row is one pill */
.weeks .cal-day { border-radius: 0; }
.weeks .cal-row.hot .cal-day, .weeks .cal-row:focus-within .cal-day { background: var(--cal-hover); }
.weeks .cal-row.sel .cal-day { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.weeks .cal-row:not(.cal-dow) .cal-day:first-child { border-radius: 10px 0 0 10px; }
.weeks .cal-row:not(.cal-dow) .cal-day:last-child { border-radius: 0 10px 10px 0; }
.weeks .cal-row.sel .cal-day:first-child, .weeks .cal-row.sel .cal-day:last-child { background: var(--accent); color: var(--accent-ink); }
/* range mode: ends solid, days between soft, joined into one band */
.ranges .cal-day.in { background: var(--accent-soft); border-radius: 0; }
.ranges .cal-day.r-start { border-radius: 10px 0 0 10px; }
.ranges .cal-day.r-end { border-radius: 0 10px 10px 0; }
.cal-hint { margin: -2px 0 8px; font-size: 13px; color: var(--muted); text-align: center; }
.cal-hint[hidden] { display: none; }
.cal-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cal-month { height: 52px; border: 0; border-radius: 12px; background: none; color: var(--ink); font: inherit; font-weight: 550; cursor: pointer; }
.cal-month:hover:not(:disabled) { background: var(--cal-hover); }
.cal-month:disabled { color: var(--line); cursor: default; }
.cal-month.sel { background: var(--accent); color: var(--accent-ink); }
.cal-day:focus-visible, .cal-month:focus-visible, .cal-nav:focus-visible, .chip:focus-visible, .pp-label:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 720px) {
    .dash-filter { gap: 8px; }
    .seg { display: flex; width: 100%; }
    .seg a { flex: 1; text-align: center; padding: 9px 0; font-size: 15px; }
    .pp { width: 100%; }
    .pp-arrow { width: 48px; }
    .pp-label { flex: 1; min-width: 0; justify-content: center; padding: 8px 10px; }
    .store-pick { width: 100%; }
    .store-pick select { width: 100%; max-width: none; height: 46px; }
    /* the calendar becomes a bottom sheet */
    .cal-back { background: rgba(0,0,0,.35); animation: cal-fade .18s ease-out; }
    .cal-pop { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 88vh; overflow: auto;
               padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; border-bottom: 0;
               animation: cal-up .22s cubic-bezier(.2,.8,.2,1); }
    .cal-grab { display: block; width: 40px; height: 4px; margin: 2px auto 10px; border-radius: 2px; background: var(--line); }
    .cal-title { font-size: 18px; }
    .cal-nav { width: 44px; height: 44px; }
    .cal-day { height: 46px; font-size: 16px; }
    .cal-month { height: 60px; font-size: 16px; }
    .seg a { padding: 9px 0; font-size: 14px; }
    .chip { flex: 1 1 28%; padding: 10px 6px; font-size: 14px; text-align: center; }
    html.cal-open { overflow: hidden; }
}
@keyframes cal-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes cal-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cal-pop, .cal-back { animation: none; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile-extra { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile.wide { grid-column: 1 / -1; }   /* Sales: the full width of the tile row */
/* Sales tile: numbers left, day-by-day chart right; "More" folds by store, dayparts, discounts / voids / refunds, checks */
.sales-tile .st-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }   /* 60 / 40 */
@media (max-width: 760px) { .sales-tile .st-top { grid-template-columns: minmax(0, 1fr); } }
.lines-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.lines-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tile-more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.tile-more summary { cursor: pointer; color: var(--accent); font-size: 14px; width: fit-content; padding: 2px 0; }
.tile-more summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.st-more { display: flex; flex-direction: column; gap: 26px; margin-top: 16px; }
.st-h { font-size: 15px; font-weight: 650; margin: 0 0 10px; color: var(--ink); }
/* by store: a table of rows (store, bar, sales, share, vs last year); on phones without the bar */
.st-th, .st-tr { display: grid; grid-template-columns: 130px minmax(0, 1fr) 80px 64px 96px; gap: 14px; align-items: center; }
.st-th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 0 0 6px; border-bottom: 1px solid var(--line); }
.st-tr { font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.st-th > span:nth-child(n+3), .st-tr > span:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.st-tr.st-part { font-size: 12.5px; color: var(--muted); padding: 0 0 8px; margin-top: -6px; }
.st-tr.st-part > span:first-child { padding-left: 12px; grid-column: 1 / -1; text-align: left; }
.st-bar { display: block; height: 8px; border-radius: 0 4px 4px 0; background: #2a78d6; }
@media (max-width: 560px) {
    .st-th, .st-tr { grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; }
    .st-th > span:nth-child(2), .st-tr > span:nth-child(2) { display: none; }
}
/* checks, voids, discounts: small number tiles */
.st-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.st-num { background: color-mix(in srgb, var(--muted) 8%, transparent); border-radius: 10px; padding: 12px 14px; }
.st-num-l { font-size: 12px; color: var(--muted); }
.st-num-v { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.st-num-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
/* dayparts: one stacked bar, then each daypart with its hours */
.st-stack { display: flex; gap: 2px; height: 12px; margin: 2px 0 14px; }
.st-stack span:first-child { border-radius: 4px 0 0 4px; }
.st-stack span:last-child { border-radius: 0 4px 4px 0; }
.st-parts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 22px; }
.st-dp-n { font-weight: 600; font-size: 14px; }
.st-dp-n i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; }
.st-dp-h { font-size: 12px; color: var(--muted); margin: 1px 0 3px 17px; }
.st-dp-v { font-size: 14px; margin-left: 17px; font-variant-numeric: tabular-nums; }
.st-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
/* holidays: a flag under the tile's changes, and a block under More (each holiday day against a usual day, how it skews the changes) */
.st-holflag { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 8px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45;
              background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.st-holflag a { color: var(--accent); white-space: nowrap; }
.st-hol-ic { color: var(--warn-text); font-size: 14px; line-height: 1.3; }
.st-hol-intro { font-size: 13px; color: var(--muted); margin: 0 0 12px; max-width: 75ch; }
.st-hol-th, .st-hol-tr { display: grid; grid-template-columns: 90px minmax(0, 1fr) 80px 80px 130px; gap: 14px; align-items: baseline; }
.st-hol-th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 0 0 6px; border-bottom: 1px solid var(--line); }
.st-hol-tr { font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.st-hol-th > span:nth-child(n+3), .st-hol-tr > span:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.st-hol-tr > .st-hol-wide { grid-column: 3 / -1; font-size: 13px; }
.st-hol-closed { display: block; font-size: 12px; color: var(--warn-text); margin-top: 2px; }
.st-hol-sum { font-size: 14px; margin: 12px 0 0; }
.st-hol-h { font-size: 13px; font-weight: 650; margin: 16px 0 6px; }
.st-hol-skew { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.55; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 560px) {
    .st-hol-th, .st-hol-tr { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; }
    .st-hol-th > span:nth-child(4), .st-hol-tr > span:nth-child(4), .st-hol-th > span:nth-child(3), .st-hol-tr > span:nth-child(3) { display: none; }
    .st-hol-tr > .st-hol-wide { display: block; grid-column: 3; }
}
/* number tiles that open details (Voided items, Discounts) */
button.st-num-btn { font: inherit; color: inherit; text-align: left; border: 1px solid transparent; cursor: pointer; width: 100%; transition: border-color .15s, background .15s; }
button.st-num-btn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
button.st-num-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.st-num-l { display: flex; justify-content: space-between; gap: 6px; }
.st-num-go { color: var(--accent); font-size: 12px; white-space: nowrap; }

/* details popup (Dashboard home: Discounts, Voided items) */
dialog.sd-dlg { width: min(900px, calc(100% - 32px)); max-height: min(88vh, 900px); padding: 0; border: 1px solid var(--line); border-radius: 16px;
                background: var(--panel); color: var(--ink); box-shadow: 0 24px 64px rgba(0,0,0,.22); overflow: hidden; }
dialog.sd-dlg::backdrop { background: rgba(20, 22, 26, .45); }
dialog.sd-dlg[open] { display: flex; flex-direction: column; }
#sdContent { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.sd { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.sd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.sd-head h2 { margin: 0; font-size: 20px; }
.sd-sub { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.sd-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; flex: 0 0 36px; }
.sd-close:hover { border-color: var(--accent); color: var(--accent); }
.sd-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sd-body { overflow: auto; padding: 18px 22px 22px; }
.sd-loading { padding: 40px 22px; text-align: center; color: var(--muted); }
.sd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.sd-kpi { background: color-mix(in srgb, var(--muted) 8%, transparent); border-radius: 12px; padding: 12px 14px; }
.sd-kpi-l { font-size: 12px; color: var(--muted); }
.sd-kpi-v { font-size: 24px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.sd-kpi-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sd-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px 28px; margin-bottom: 26px; }
.sd-rank h3, .sd-list-head h3 { font-size: 15px; font-weight: 650; margin: 0 0 10px; }
.sd-rank ol { list-style: none; margin: 0; padding: 0; }
.sd-rank li { margin: 0 0 9px; }
.sd-rank-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.sd-rank-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-rank-v { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sd-rank-bar { display: block; height: 5px; margin-top: 4px; border-radius: 0 3px 3px 0; background: #2a78d6; }
.sd-rank-more { font-size: 12px; color: var(--muted); }
.sd-list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; margin-bottom: 8px; }
.sd-list-head h3 { margin: 0; }
.sd-table { overflow-x: auto; }
.sd-table td.nowrap { white-space: nowrap; }
.sd-tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad-text); white-space: nowrap; }
@media (max-width: 640px) {
    dialog.sd-dlg { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; border: 0; }
    .sd-head, .sd-body { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
    dialog.sd-dlg[open] { animation: sd-in .16s ease-out; }
    @keyframes sd-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
.good-text { color: var(--good-text); }
.tile-label { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.tile-value { font-size: 30px; font-weight: 650; margin: 4px 0 2px; }
.tile-sub { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.tile-deltas { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.delta { font-size: 12.5px; color: var(--muted); }
.delta.good { color: var(--good-text); }
.delta.bad { color: var(--bad-text); }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid currentColor; }
.badge.bad { color: var(--bad-text); }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 16px; }
/* minmax(0, 1fr): a wide chart or table must not push the column past the screen */
@media (max-width: 520px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sec-head h2 { margin: 0 0 8px; }
.sec-head a { font-size: 13px; }
.mini-stats { display: flex; gap: 24px; flex-wrap: wrap; margin: 4px 0 8px; }
.mini-stats span { display: block; font-size: 12px; color: var(--muted); }
.mini-stats b { font-size: 20px; font-weight: 650; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid tr.total td { font-weight: 650; border-top: 2px solid var(--line); }
.bad-text { color: var(--bad-text); }
.warn-text { color: var(--warn-text); }

svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
svg.chart .axis { stroke: var(--chart-axis); stroke-width: 1; }
svg.chart .tick { fill: var(--chart-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg.chart .rowlabel { fill: var(--ink); font-size: 13px; }
svg.chart .val { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
svg.chart .bar { fill: var(--series-1); }
svg.chart .bar.peak { fill: var(--series-1-strong); }
svg.chart .bar.s2 { fill: var(--series-2); }
svg.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
svg.chart .dot { fill: var(--series-1); stroke: var(--panel); stroke-width: 2; }
svg.chart .target { stroke: var(--chart-muted); stroke-width: 1; stroke-dasharray: 4 4; }
svg.chart .hitbox { fill: transparent; }
svg.chart .hit:hover .bar, svg.chart .hit:hover .dot { opacity: .8; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--series-1); }
.legend .sw.s2 { background: var(--series-2); }

a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { border-color: var(--accent); }

/* a button waiting for its second click (ezConfirm) */
.btn.armed, input.armed { background: var(--bad, #b42318); border-color: var(--bad, #b42318); color: #fff; }

/* filter links above a list (Links to check > All products) */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 8px; }
.filter-row .small { min-width: 64px; }
.fchip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink); text-decoration: none; }
.fchip:hover { border-color: var(--accent); color: var(--accent); }
.fchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* tables with class "rowcards": on phones each row is a card, cells stacked under the first one with their column name (data-label) */
@media (max-width: 720px) {
    .rowcards thead { display: none; }
    .rowcards, .rowcards tbody, .rowcards tr, .rowcards td { display: block; width: 100%; }
    .rowcards tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
    .grid.rowcards td, .grid.rowcards td.num { padding: 3px 0; border: 0; white-space: normal; text-align: left; }
    .rowcards td:first-child { font-size: 15px; padding-bottom: 6px; }
    .rowcards td:empty { display: none; }
    .rowcards td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
    .rowcards td.card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
    .rowcards td.card-actions .btn, .rowcards td.card-actions input { flex: 1 1 120px; text-align: center; min-height: 40px; }
    .rowcards td.card-actions a:not(.btn) { display: inline-block; padding: 8px 0; }
    .rowcards td input.w-num { max-width: 160px; }
    .rowcards td select { width: auto; min-width: 110px; max-width: calc(100% - 2px); }
    /* "compact" (dashboard figures): two figures side by side under the name */
    .rowcards.compact tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
    .rowcards.compact td:first-child, .rowcards.compact td.card-actions { grid-column: 1 / -1; }
    .rowcards td.card-actions:empty, .rowcards td.card-actions:not(:has(*)) { display: none; }
}

/* 2019 vs now (Dashboard/Compare2019.aspx) and Report categories */
.cmp-bar label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.cmp-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.cmp-quick a.chip { text-decoration: none; display: inline-block; }
.cmp-quick a.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cmp-period { margin: 0 0 12px; font-size: 14px; }
table.grid tr.unmapped td { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.rc-list td input { width: 100%; max-width: 320px; }

/* End of day report (Dashboard/EndOfDay.aspx) */
.eod-day { margin: -8px 0 14px; color: var(--muted); font-style: italic; }
/* End of day header: the dashboard's day picker and store list (Filter.ascx, day only), print / email on the right */
.eod-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 0 0 18px; }
.eod-head .dash-filter { margin: 0; }
.dash-filter .seg[hidden] { display: none; }
.eod-actions { display: flex; gap: 8px; flex-wrap: wrap; }
table.grid.eod { width: auto; min-width: min(100%, 640px); }
table.grid.eod th.num { white-space: nowrap; }
table.grid.eod td:first-child { font-weight: 600; padding-right: 32px; }
table.grid.eod td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.eod-date { font-weight: 400; font-size: 12px; color: var(--muted); }
.eod-find { margin: 0 0 8px; line-height: 1.5; }
/* Ordering: the delivery day picked (Filter.ascx, day only) with its holiday, holiday note, department rows */
.ord-day { margin: 0 0 12px; }
.ord-day .hol-name { color: var(--warn-text); font-weight: 600; }
/* day picker: a marked day (holiday, the day before one) has a dot under its number */
.cal-day.mark { position: relative; }
.cal-day.mark::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--warn); }
.cal-day.mark.sel::after { background: currentColor; }
.ord-hol { background: color-mix(in srgb, var(--warn) 10%, transparent); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; }
.ord-hol ul { margin: 0; padding-left: 18px; }
.ord-hol li { margin: 2px 0; }
table.ord-items tr.grp th { text-align: left; background: color-mix(in srgb, var(--muted) 10%, transparent); font-size: 13px; padding: 6px 10px; }
h2.ord-week { margin: 28px 0 4px; font-size: 18px; }
/* legend under the findings: folded until clicked (native details/summary: keyboard and screen readers work) */
.eod-legend { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.eod-legend summary { cursor: pointer; color: var(--accent); font-size: 14px; width: fit-content; padding: 2px 0; }
.eod-legend summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.eod-legend[open] summary { margin-bottom: 8px; }
.eod-legend p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.eod-trends { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.eod-trend { background: color-mix(in srgb, var(--muted) 8%, transparent); border-radius: 8px; padding: 8px 10px; }
.eod-trend .t { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.eod-trend .v { font-size: 15px; font-weight: 600; }
.eod-trend .v span { font-size: 12px; font-weight: 400; color: var(--muted); }
.eod-trend img { width: 100%; }
@media print {
    .topbar, .no-print, footer { display: none !important; }
    body { background: #fff; color: #000; }
    .eod-page .panel { box-shadow: none; border: none; padding: 0; break-inside: avoid; }
    table.grid.eod th, table.grid.eod td { padding: 2px 10px; }
    .eod-legend:not([open]) { display: none; }
}

/* phones zoom the page into a box whose text is under 16px: keep form text at 16px (last, so it wins over the general input rule) */
@media (max-width: 720px) {
    input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time], input[type=url], select, textarea { font-size: 16px; }
}
/* a folded block under More (Holidays): its header is the toggle */
.st-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; width: fit-content; }
.st-fold > summary::-webkit-details-marker { display: none; }
.st-fold > summary::before { content: "\25B8"; color: var(--accent); font-size: 13px; transition: transform .15s; }
.st-fold[open] > summary::before { transform: rotate(90deg); }
.st-fold > summary .st-h { margin: 0; }
.st-fold[open] > summary { margin-bottom: 10px; }
.st-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .st-fold > summary::before { transition: none; } }
/* Settings > Holidays: a holiday the stores were closed on */
.hol-switches .hol-closed { color: var(--warn-text); }
/* End of day: holiday note at the top */
.eod-hol { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; font-size: 14px; line-height: 1.5;
           background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.eod-hol p { margin: 0 0 4px; }
.eod-hol p:last-child { margin: 0; }
/* Settings > Holidays: a holiday's days, one row each (opened with "8 days") */
.hol-days-btn { background: none; border: 0; padding: 2px 0; font: inherit; color: var(--accent); cursor: pointer; white-space: nowrap; }
.hol-days-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.hol-days-btn span { display: inline-block; transition: transform .15s; }
.hol-days-btn[aria-expanded="true"] span { transform: rotate(180deg); }
.hol-switches tr.hol-day td { padding-top: 4px; padding-bottom: 4px; font-size: 13px; background: color-mix(in srgb, var(--muted) 5%, transparent); }
.hol-switches tr.hol-day .hol-day-name { padding-left: 18px; }
@media (prefers-reduced-motion: reduce) { .hol-days-btn span { transition: none; } }
/* Dashboard: holidays in the next 30 days, after the store list; each opens its popup (HolidayDetail.aspx) */
/* next to the page title: "Holidays ahead" above the first holiday, the holidays in a row under it (they wrap when the row is short) */
.dash-title { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 28px; margin-bottom: 48px; }
.dash .dash-title h1 { margin: 0; }
.hol-ahead { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; margin-left: auto; }   /* on the right side of the page */
.hol-ahead-l { font-size: 12px; font-weight: 600; color: var(--muted); padding-left: 2px; }
.hol-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hol-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink);
            background: color-mix(in srgb, var(--warn) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.hol-chip span { color: var(--muted); font-size: 12px; }
.hol-chip:hover { background: color-mix(in srgb, var(--warn) 22%, var(--panel)); }
.hol-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hd-table th { vertical-align: bottom; }
.hd-table td { vertical-align: top; }
.hd-th-sub { font-size: 11px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.hd-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.hd-pill.open { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-text); }
.hd-pill.shut { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad-text); }
.hd-pill.part { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn-text); }
.hd-amt { font-variant-numeric: tabular-nums; font-size: 13px; }
.hd-note { font-size: 12px; color: var(--warn-text); margin-top: 3px; }
/* Dashboard: the stores as pills, a row of their own under the period and date (Filter.ascx StorePills) */
.dash-filter .store-pick[hidden] { display: none; }
.store-pills { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.store-pill { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 14px; font-weight: 550;
              text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.store-pill:hover { color: var(--ink); background: var(--cal-hover); }
.store-pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.store-pill.only { cursor: default; }
.store-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .store-pill { transition: none; } }

/* Best and worst sellers (Dashboard home, ProductMovers.aspx): full width, tabs, comparison chips */
.dash-grid > .pm { grid-column: 1 / -1; }
.pm-head { flex-wrap: wrap; align-items: center; }
.pm-cmp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pm-cmp .fchip { font: inherit; font-size: 13px; background: transparent; cursor: pointer; }
.pm-cmp .fchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pm-cmp .fchip:focus-visible, .pm-tab:focus-visible, .pm-show:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pm-scope { margin: 0 0 10px; }
.pm-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 8px; }
.pm-tab { font: inherit; font-size: 14px; padding: 8px 14px; background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); cursor: pointer; }
.pm-tab:hover { color: var(--ink); }
.pm-tab[aria-selected="true"] { color: var(--ink); font-weight: 650; border-bottom-color: var(--accent); }
.pm-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-size: 11.5px; font-weight: 600; color: var(--muted); }
.pm-table { width: 100%; }
.pm-rank { width: 32px; color: var(--muted); }
.pm-name { min-width: 220px; }
.pm-nm { display: block; font-weight: 550; }
.pm-nm a { color: inherit; text-decoration: none; }
.pm-nm a:hover { color: var(--accent); text-decoration: underline; }
.pm-cat { display: block; font-size: 12px; color: var(--muted); }
.pm-pct { font-size: 12px; opacity: .85; }
.pm-show { margin-top: 10px; }
.pm-loading { padding: 18px 0; }
@media (max-width: 720px) {
    .pm-rank { display: none !important; }
    .rowcards.compact.pm-table td.pm-name { grid-column: 1 / -1; }
    .pm-tab { flex: 1 1 45%; padding: 10px 6px; }
}/* Best and worst sellers: "This period" and the comparison as column groups over their Sales and Qty */
.pm-table th.pm-grp { text-align: center; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.pm-table tr.pm-sub th { padding-top: 4px; }
.pm-table td.pm-base { color: var(--muted); }
.pm-table th.pm-grp + th.pm-grp, .pm-table .pm-base:not(.pm-base + .pm-base) { border-left: 1px solid var(--line); }
@media (max-width: 720px) { .pm-table td.pm-base:not(.pm-base + .pm-base) { border-left: 0; } }/* Best and worst sellers: the Stores column, + / - of an item and its store rows, the link to the stores page */
.pm-details { font-size: 13px; margin-left: 6px; white-space: nowrap; }
.pm-table td.pm-has-exp { position: relative; padding-left: 40px; }
.pm-exp { position: absolute; left: 6px; top: 12px; width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--accent); cursor: pointer; padding: 0; }
.pm-exp::before, .pm-exp::after { content: ""; position: absolute; left: 50%; top: 50%; background: currentColor; border-radius: 1px; transform: translate(-50%, -50%); }
.pm-exp::before { width: 11px; height: 2px; }
.pm-exp::after { width: 2px; height: 11px; }
.pm-exp[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pm-exp[aria-expanded="true"]::after { display: none; }
.pm-exp:hover { border-color: var(--accent); }
.pm-exp:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pm-table td.pm-stores, .pm-table th.pm-stores { font-size: 12.5px; min-width: 150px; }
.pm-table tr.pm-open td { border-bottom-color: transparent; }
.pm-table tr.pm-store td { background: var(--bg); font-size: 13px; padding-top: 5px; padding-bottom: 5px; border-bottom: 1px dashed var(--line); }
.pm-table tr.pm-store.pm-store-last td { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.pm-st-name { font-weight: 600; }
@media (max-width: 720px) {
    .grid.rowcards.pm-table td.pm-has-exp { padding-left: 34px; }
    .pm-exp { left: 0; top: 14px; }
    .rowcards.compact.pm-table td.pm-stores { grid-column: 1 / -1; }
    .rowcards.compact.pm-table tr.pm-store { padding: 8px 10px; }
    .rowcards.compact.pm-table td.pm-empty { display: none; }
    .pm-details { margin-left: 0; }
}

/* Best and worst sellers by store (Dashboard/ProductMoversDetail.aspx) */
.pmd-bar { padding: 12px 16px; }
.pmd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.pmd-row .small { min-width: 96px; }
.pmd-export { margin-left: auto; }
.pmd-wrap { padding: 0; }
.pmd-scroll { overflow: auto; max-height: calc(100vh - 140px); }
.pmd-table { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.pmd-table th, .pmd-table td { white-space: nowrap; }
.pmd-table thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); }
.pmd-table thead tr.pm-sub th { top: 31px; box-shadow: inset 0 -1px 0 var(--line); }
.pmd-table .pmd-item { position: sticky; left: 0; z-index: 1; background: var(--panel); text-align: left; min-width: 220px; max-width: 320px; white-space: normal; font-weight: 400; box-shadow: inset -1px 0 0 var(--line); }
.pmd-table thead .pmd-item { z-index: 3; }
.pmd-table th.pmd-grp { text-align: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.pmd-table .pmd-first, .pmd-table tr.pm-sub th.pmd-total:first-child { border-left: 1px solid var(--line); }
.pmd-table td.pmd-total, .pmd-table th.pmd-total { background: var(--bg); }
.pmd-table td.pm-base { color: var(--muted); }
.pmd-table .zero { color: var(--muted); opacity: .6; }
.pmd-table tbody tr:hover td, .pmd-table tbody tr:hover th { background: var(--cal-hover, var(--bg)); }
@media (max-width: 700px) { .pmd-export { margin-left: 0; } .pmd-table .pmd-item { min-width: 150px; } }
@media print { .pmd-scroll { max-height: none; overflow: visible; } .pmd-table thead th, .pmd-table .pmd-item { position: static; } }.pmd-table tbody th.pmd-item { text-transform: none; letter-spacing: normal; font-size: 13px; color: var(--ink); padding-top: 7px; padding-bottom: 7px; }
.pmd-table tbody th.pmd-item .pm-cat { text-transform: none; }@media (max-width: 720px) {
    .rowcards.compact.pm-table tr.pm-store { background: var(--bg); border-radius: 8px; margin: 4px 0; border-bottom: 0; }
    .rowcards.compact.pm-table tr.pm-store td, .pm-table tr.pm-store.pm-store-last td { background: transparent; border-bottom: 0; }
    .grid.rowcards.pm-table tr.pm-store td.pm-has-exp { padding-left: 0; }
}
/* Replace Toast GUIDs (Admin/ReplaceToastGuids.aspx) */
.rtg-rules { margin: 6px 0 12px; padding-left: 18px; }
.rtg-rules li { margin: 3px 0; }
.rtg-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rtg-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.rtg-fold { margin: 12px 0; }
.rtg-fold summary { cursor: pointer; }
.rtg-scroll { max-height: 420px; overflow: auto; margin-top: 8px; }
.rtg-guid { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.rtg-errors { color: var(--bad-text); }
.rtg-hidden { display: none; }
form.rtg-busy { cursor: progress; }
form.rtg-busy .btn { pointer-events: none; opacity: .6; }

/* Toast price history (Admin/ReplaceToastPrices.aspx) */
.rtp-options { display: grid; gap: 8px; margin: 4px 0 14px; font-size: 13.5px; }
.rtp-options select { margin-left: 6px; }
.rtp-check { display: block; }
.rtp-num { width: 48px; text-align: right; }
.rtp-item { margin: 0 0 14px; }
.rtp-item h3 { margin: 0 0 8px; font-size: 15px; }

/* Settings > Cards and order (Admin/CardsAndOrder.aspx, Content/cards-order.js) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.co-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.co-head h2 { margin: 0; }
.co-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.co-status { font-size: 13px; color: var(--muted); }
.co-actions [hidden] { display: none; }
.co-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 14px 0 12px; }
.co-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 2px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.co-tab.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.co-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.co-chip { background: none; font: inherit; font-size: 13px; cursor: pointer; }
.co-dot { font-weight: 700; }
.co-hint { margin: 8px 0 0; }
.co-group { font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 0 8px; }
.co-note { font-weight: 400; }
.co-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.co-grid.top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.co-grid.fixed { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .co-grid.top, .co-grid.fixed { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .co-grid, .co-grid.top, .co-grid.fixed { grid-template-columns: minmax(0, 1fr); } }
.co-tile { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 64px; user-select: none; -webkit-user-select: none; }
.co-grid.cards .co-tile { min-height: 74px; }
.co-name { font-weight: 600; font-size: 14px; }
.co-sub { font-size: 12px; color: var(--muted); }
.co-tile.off { border-style: dashed; }
.co-tile.off .co-name, .co-tile.off .co-sub { color: var(--muted); }
.co-flag { font-size: 11px; color: var(--warn); margin-top: 4px; }
.co-editing .co-tile[data-move] { cursor: grab; touch-action: none; animation: co-jig .28s infinite alternate ease-in-out; }
.co-editing .co-tile[data-move]:nth-child(2n) { animation-delay: .14s; }
.co-editing .co-tile.co-drag { cursor: grabbing; animation: none; border-color: var(--accent); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); z-index: 2; }
.co-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; animation: none; }
@keyframes co-jig { from { transform: rotate(-1deg); } to { transform: rotate(1deg); } }
.co-minus, .co-plus { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 15px; line-height: 20px; padding: 0; cursor: pointer; }
.co-minus { position: absolute; top: -9px; left: -9px; }
.co-minus:hover, .co-plus:hover { border-color: var(--bad); color: var(--bad); }
.co-plus:hover { border-color: var(--good); color: var(--good); }
.co-shelf { display: flex; gap: 8px; flex-wrap: wrap; min-height: 40px; padding: 8px; border: 1px dashed var(--line); border-radius: 12px; align-items: center; }
.co-hid { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; padding: 4px 10px; border-radius: 8px; background: var(--cal-hover); color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .co-editing .co-tile[data-move] { animation: none; } }

/* Dashboard: Data loads line under the title (Dashboard/Default.aspx DataLoads, App_Code/EZ/LoadStatus.cs) */
.loads { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.loads-t { font-weight: 600; }
.ld { display: inline-flex; gap: 5px; align-items: center; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); }
.ld b { font-weight: 600; }
.ld-mark { font-weight: 700; }
.ld-ok .ld-mark { color: var(--good); }
.ld-warn { border-color: var(--warn); } .ld-warn .ld-mark { color: var(--warn); }
.ld-bad { border-color: var(--bad); color: var(--bad); } .ld-bad .ld-mark { color: var(--bad); }
.ld-run .ld-mark, .ld-none .ld-mark { color: var(--accent); }
.loads-more { font-size: 12.5px; }