:root {
  color-scheme: light;
  --bg: #F3F5FA; --surface: #FFFFFF; --surface-2: #EEF1F8; --ink: #172036; --muted: #586179; --line: #D9DEEA;
  --brand: #30478D; --brand-strong: #22356F; --brand-tint: #E8ECF7; --on-brand: #FFFFFF;
  --up: #006300; --down: #B3261E; --warn-bg: #FFF4DC; --warn-ink: #6B4A00;
  --st-open-bg: #FFF4DC; --st-open: #6B4A00; --st-part-bg: #E8ECF7; --st-part: #22356F; --st-done-bg: #E3F4E3; --st-done: #006300; --st-un-bg: #FCE8E6; --st-un: #B3261E;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948; --s0: #9AA1B2;
  --grid: #E4E7F0; --axis: #AEB5C6;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0E1322; --surface: #161D31; --surface-2: #1C2642; --ink: #E9ECF5; --muted: #A0A8BE; --line: #2A3350;
    --brand: #9DB0EE; --brand-strong: #C3CEF5; --brand-tint: #1C2642; --on-brand: #0E1322;
    --up: #4CC94C; --down: #F2857E; --warn-bg: #3A2E10; --warn-ink: #F5D88A;
    --st-open-bg: #3A2E10; --st-open: #F5D88A; --st-part-bg: #1C2642; --st-part: #C3CEF5; --st-done-bg: #123018; --st-done: #7FD87F; --st-un-bg: #3A1614; --st-un: #F2857E;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --s0: #6E768A;
    --grid: #232B44; --axis: #3C4665;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1322; --surface: #161D31; --surface-2: #1C2642; --ink: #E9ECF5; --muted: #A0A8BE; --line: #2A3350;
  --brand: #9DB0EE; --brand-strong: #C3CEF5; --brand-tint: #1C2642; --on-brand: #0E1322;
  --up: #4CC94C; --down: #F2857E; --warn-bg: #3A2E10; --warn-ink: #F5D88A;
  --st-open-bg: #3A2E10; --st-open: #F5D88A; --st-part-bg: #1C2642; --st-part: #C3CEF5; --st-done-bg: #123018; --st-done: #7FD87F; --st-un-bg: #3A1614; --st-un: #F2857E;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --s0: #6E768A;
  --grid: #232B44; --axis: #3C4665;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.4 var(--font); }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Login und Zugänge */
.login-body { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 16px; }
.admin-card { max-width: 520px; }
.admin-card h2 { font-size: 15px; margin-top: 8px; }
.wordmark { font-size: 20px; font-weight: 700; color: var(--brand); letter-spacing: -.01em; }
.wordmark span { font-weight: 400; color: var(--muted); }
.login-card form { display: grid; gap: 14px; }
.login-card label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.login-card input:not([type=hidden]) { height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; font-weight: 400; width: 100%; }
.btn-primary { height: 46px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--brand); color: var(--on-brand); font-weight: 600; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-quiet { min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; }
.notice { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.notice-error { background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.notice-ok { background: var(--st-done-bg); color: var(--st-done); }
.token { display: block; word-break: break-all; padding: 8px; margin-top: 4px; background: var(--surface-2); border-radius: 8px; user-select: all; }
.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.user-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }

/* Kopf */
.top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; }
.top .wordmark { font-size: 17px; margin-right: auto; white-space: nowrap; }
.stand { font-size: 13px; color: var(--muted); white-space: nowrap; }
.stand.old { color: var(--warn-ink); background: var(--warn-bg); padding: 2px 8px; border-radius: 8px; font-weight: 600; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: transparent; flex: none; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--surface-2); }

/* Filter */
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px 48px; }
.filters { background: var(--bg); margin: 0 -16px; padding: 10px 16px 8px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); white-space: nowrap; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.range input { flex: 1 1 130px; min-width: 0; height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; }
.selects { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.selects.open { display: grid; }
.filter-toggle { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 0; min-height: 32px; color: var(--muted); font-size: 14px; text-align: left; }
.filter-toggle b { color: var(--brand); }
.filter-toggle .chev { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .12s; }
.filter-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.selects select, .selects input { width: 100%; min-width: 0; height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; }
.selects select.active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.flags { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; align-items: center; }
.flags::-webkit-scrollbar { display: none; }
.flag-btn { flex: none; width: 46px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0; }
.flag-btn.all { width: auto; padding: 0 12px; font-weight: 500; }
.flag-btn[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-tint); }
.flag { width: 27px; height: 18px; border-radius: 3px; display: block; flex: none; box-shadow: 0 0 0 1px rgba(23,32,54,.16); }
.flag-unknown { display: grid; place-items: center; width: 27px; height: 18px; border-radius: 3px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; flex: none; }
.reset { justify-self: start; border: 0; background: none; padding: 2px 0; color: var(--brand); font-weight: 600; font-size: 14px; }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.kpi.main { grid-column: 1 / -1; }
.kpi-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin-top: 2px; overflow-wrap: anywhere; }
.kpi.main .kpi-value { font-size: 34px; }
.delta { font-size: 13px; margin-top: 2px; color: var(--muted); }
.delta b { font-weight: 700; }
.delta .up { color: var(--up); } .delta .down { color: var(--down); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.seg button { border: 0; background: transparent; padding: 3px 9px; min-height: 28px; font-size: 13px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }

/* Tage und Versandstatus */
.days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.days::-webkit-scrollbar { display: none; }
.day-btn { flex: none; min-width: 104px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; font-variant-numeric: tabular-nums; }
.day-btn b { display: block; font-size: 13px; }
.day-btn span { display: block; font-size: 15px; font-weight: 700; }
.day-btn small { display: block; font-size: 12px; color: var(--muted); }
.day-btn[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-tint); }
.stboxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stbox { padding: 9px 10px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; background: var(--surface); text-align: left; min-width: 0; font-variant-numeric: tabular-nums; }
.stbox.a { border-left-color: var(--st-open); } .stbox.n { border-left-color: var(--st-un); } .stbox.v { border-left-color: var(--st-done); }
.stbox[aria-pressed="true"] { background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.stbox b { display: block; font-size: 13px; font-weight: 600; }
.stbox span { display: block; font-size: 24px; font-weight: 700; line-height: 1.2; }
.stbox small { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.open-link { display: block; width: 100%; margin-top: 6px; border: 0; background: none; padding: 4px 0; color: var(--brand); font-weight: 600; font-size: 14px; text-align: left; }

/* Bereiche */
.tabrow { position: sticky; top: 0; z-index: 20; display: flex; gap: 8px; align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px; }
.tabs { flex: 1 1 auto; max-width: 560px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface-2); border-radius: 10px; padding: 3px; }
.tabs button { min-height: 38px; border: 0; background: transparent; border-radius: 8px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(23,32,54,.14); }
.arrange { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; min-width: 44px; justify-content: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: transparent; font-weight: 600; }
.arrange svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.800; }
.arrange span { display: none; }
.arrange[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.widgets { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
.w { min-width: 0; }
.w-body { min-width: 0; }
.sales-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.widgets.edit .w { background: var(--surface); border: 1px dashed var(--axis); border-radius: var(--radius); padding: 8px; }
.widgets.edit .w-body { max-height: 150px; overflow: hidden; pointer-events: none; opacity: .75; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.widgets.edit .days { margin: 0; padding: 0; }
.w.dragging { border-color: var(--brand) !important; border-style: solid !important; box-shadow: 0 8px 24px rgba(23,32,54,.25); position: relative; z-index: 5; }
body.is-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
.w-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.w-grip { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: grab; touch-action: none; padding: 0; }
.w-grip svg { width: 20px; height: 20px; fill: currentColor; pointer-events: none; }
.w-name { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 14px; padding-left: 4px; overflow-wrap: anywhere; }
.w-act { flex: none; min-width: 34px; height: 34px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; background: transparent; font-size: 13px; }
.w-act:disabled { opacity: .35; }
.w-size { display: none; }
.w-size[aria-pressed="true"] { background: var(--brand-tint); border-color: var(--brand); }
.edit-foot { display: grid; gap: 10px; padding: 12px 0; }
.edit-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.edit-btns { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.row-btn.land .flag, .row-btn.land .flag-unknown { margin-right: 2px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.card h2 { font-size: 15px; margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }

/* Tabellen */
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl.dense td { padding-left: 6px; font-size: 14px; } .tbl.dense th { padding-left: 6px; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 500; text-align: right; padding: 0 0 6px 8px; }
.tbl th:first-child { text-align: left; padding-left: 0; }
.tbl td { padding: 8px 0 8px 8px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tbl td:first-child { padding-left: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.tbl .sum td { font-weight: 700; border-top: 2px solid var(--axis); }
.row-btn { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; text-align: left; font-weight: 600; min-height: 26px; }
.row-btn.sub { font-weight: 400; padding-left: 22px; color: var(--muted); }
.row-btn.plain { font-weight: 500; }
.row-btn.nochev { padding-left: 22px; }
.row-btn:hover { color: var(--brand); }
.row-btn .chev { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .12s; }
.row-btn[aria-expanded="true"] .chev { transform: rotate(90deg); }
.tr-active td { background: var(--brand-tint); }
.more { margin-top: 10px; border: 0; background: none; color: var(--brand); font-weight: 600; padding: 4px 0; }

/* Aufträge */
.day { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 4px 2px 0; font-size: 13px; }
.day b { font-weight: 700; }
.day span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sale { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.sale-main { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; align-items: center; width: 100%; padding: 3px 8px 3px 3px; border: 0; background: none; text-align: left; border-radius: 10px; }
.sale-main:hover { background: var(--surface-2); }
.thumb { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 7px; border: 1px solid var(--line); display: block; }
.thumb-none { display: grid; place-items: center; color: var(--muted); background: var(--surface-2); font-size: 10px; text-align: center; line-height: 1.1; }
.thumb.small { width: 44px; height: 44px; }
.sale-body { display: grid; gap: 4px; min-width: 0; }
.sale-title { font-weight: 500; font-size: 12.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sale-line { display: flex; align-items: center; gap: 5px; font-size: 11.5px; line-height: 1.3; color: var(--muted); min-width: 0; white-space: nowrap; }
.sale-line .flag, .sale-line .flag-unknown { width: 20px; height: 14px; font-size: 9px; border-radius: 2px; }
.sale-line .pf { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sale-line .tm { flex: none; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 0 5px; border-radius: 5px; font-size: 11px; line-height: 16px; font-weight: 600; white-space: nowrap; flex: none; }
.badge.sa { background: var(--st-open-bg); color: var(--st-open); }
.badge.sn { background: var(--st-un-bg); color: var(--st-un); }
.badge.sv { background: var(--st-done-bg); color: var(--st-done); }
.sale-price { margin-left: auto; flex: none; font-size: 13.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.sale-qty { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.pos-pill { flex: none; background: var(--brand-tint); color: var(--brand-strong); border-radius: 5px; padding: 0 5px; font-size: 11px; line-height: 16px; font-weight: 600; }
.sale-more { border-top: 1px solid var(--line); padding: 7px 8px; display: grid; gap: 6px; font-size: 12px; }
.sale-full { font-weight: 500; overflow-wrap: anywhere; line-height: 1.3; }
.sale-sub { color: var(--muted); overflow-wrap: anywhere; }
.pos { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.pos-name { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
.pos-val { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.more-big { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; color: var(--brand); }

/* Top-Artikel */
.top-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.top-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.top-name { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.top-val { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.top-val b { display: block; font-size: 14px; }

/* Diagramme */
.chart-wrap { position: relative; }
.pie-grid { display: grid; gap: 14px; align-items: center; }
.pie { width: min(240px, 100%); margin: 0 auto; display: block; }
.pie path, .pie circle { stroke: var(--surface); stroke-width: 2; cursor: pointer; }
.pie path:hover { opacity: .85; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.legend .nm { overflow-wrap: anywhere; }
.legend .pc { color: var(--muted); min-width: 40px; text-align: right; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: block; }
.c1 { fill: var(--s1); } .c2 { fill: var(--s2); } .c3 { fill: var(--s3); } .c4 { fill: var(--s4); } .c5 { fill: var(--s5); } .c6 { fill: var(--s6); } .c7 { fill: var(--s7); } .c8 { fill: var(--s8); } .c0 { fill: var(--s0); }
.sw.c1 { background: var(--s1); } .sw.c2 { background: var(--s2); } .sw.c3 { background: var(--s3); } .sw.c4 { background: var(--s4); } .sw.c5 { background: var(--s5); } .sw.c6 { background: var(--s6); } .sw.c7 { background: var(--s7); } .sw.c8 { background: var(--s8); } .sw.c0 { background: var(--s0); }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; gap: 3px; font-size: 13px; }
.bar-head { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.bar-head span:first-child { overflow-wrap: anywhere; }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--s1); border-radius: 4px; }
.line-svg { width: 100%; display: block; touch-action: pan-y; }
.line-svg text { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.line-svg .gridline { stroke: var(--grid); stroke-width: 1; }
.line-svg .base { stroke: var(--axis); stroke-width: 1; }
.line-svg .ln { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-svg .ar { fill: var(--s1); opacity: .1; }
.line-svg .cross { stroke: var(--axis); stroke-width: 1; }
.line-svg .dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
#tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--surface); padding: 6px 9px; border-radius: 8px; font-size: 13px; max-width: 240px; font-variant-numeric: tabular-nums; }

/* Einstellungen */
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 18px; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); }
dialog::backdrop { background: rgba(14, 19, 34, .45); }
.set-grid { display: grid; gap: 14px; }
.set-grid h2 { font-size: 17px; }
.set-row { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.set-row select { height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0 8px; font-size: 16px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; min-height: 30px; }
.check input { width: 20px; height: 20px; }
.set-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.loading { color: var(--muted); padding: 24px; text-align: center; }
.hint { font-size: 13px; color: var(--warn-ink); background: var(--warn-bg); border-radius: 10px; padding: 8px 10px; }

@media (max-width: 359px) { .badge .bt { display: none; } .top .wordmark span { display: none; } .kpi.main .kpi-value { font-size: 28px; } }
@media (min-width: 640px) {
  .selects, .selects.open { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filter-toggle { display: none; }
  .kpis { grid-template-columns: 2fr 1fr 1fr; }
  .kpi.main { grid-column: auto; }
  .pie-grid { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (min-width: 560px) { .arrange span { display: inline; } }
@media (min-width: 860px) {
  .widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w.wide, .wide-all { grid-column: 1 / -1; }
  .widgets:not(.edit) { align-items: stretch; }
  .widgets:not(.edit) .w, .widgets:not(.edit) .w-body { display: flex; flex-direction: column; }
  .widgets:not(.edit) .w-body { flex: 1 1 auto; }
  .widgets:not(.edit) .w-body > .card { flex: 1 1 auto; }
  .w-size { display: block; }
  .w.wide .sales-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w.wide .sales-list .day, .w.wide .sales-list .more-big { grid-column: 1 / -1; }
  .days { margin: 0; padding: 0; }
  .day-btn { flex: 1 1 0; min-width: 0; }
}
@media (min-width: 1240px) {
  .w.wide .sales-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1500px) {
  .widgets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .w.wide .sales-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (hover: none) { .pie path:hover { opacity: 1; } }
@media print { .filters, .top button, .tabrow { display: none; } }
