/* Styl marki czekoladkinaokazje.pl (Chocolate Hills): Montserrat, biel + róż, śliwkowy akcent, ciemne przyciski-pigułki. */
:root {
  --bg: #ffffff; --band: #fceef5; --panel: #ffffff; --soft: #fcf5f8;
  --ink: #4a3b3e; --head: #140610; --muted: #6b5961; --line: #ead2db;
  --rose: #d7a5ad; --accent: #8c3d4f; --btn: #2c1a1e; --btn-ink: #ffffff;
  --ok: #2f7a3f; --warn: #a15c07; --bad: #b42335;
  --radius: 16px; --radius-sm: 10px;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1514; --band: #261d1b; --panel: #221a19; --soft: #2b2121;
    --ink: #f1e6e8; --head: #fff7fa; --muted: #bba6aa; --line: #433436;
    --rose: #d7a5ad; --accent: #e3a3b2; --btn: #f1e6e8; --btn-ink: #2c1a1e;
    --ok: #7fcf8c; --warn: #f0b35a; --bad: #ff8a95; color-scheme: dark;
  }
}
/* Tryb wybrany ręcznie przełącznikiem w menu (data-theme na <html>) ma pierwszeństwo przed ustawieniem systemu. */
:root[data-theme="dark"] {
  --bg: #1c1514; --band: #261d1b; --panel: #221a19; --soft: #2b2121;
  --ink: #f1e6e8; --head: #fff7fa; --muted: #bba6aa; --line: #433436;
  --rose: #d7a5ad; --accent: #e3a3b2; --btn: #f1e6e8; --btn-ink: #2c1a1e;
  --ok: #7fcf8c; --warn: #f0b35a; --bad: #ff8a95; color-scheme: dark;
  --s-woo: #b0609e; --s-allegro: #c0843a; --s-manual: #4a8fd0; --s-one: #b0609e; --grid: #2f2526; --axis: #4a3b3d;
}
:root[data-theme="dark"] nav.side .logo .k, :root[data-theme="dark"] .public-band .k { display: none; }
:root[data-theme="dark"] nav.side .logo .w { display: block; }
:root[data-theme="dark"] .public-band .w { display: inline; }
.theme-toggle { display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; color: var(--ink); border: 0; border-radius: 999px;
  padding: 8px 14px; font-weight: 500; text-align: left; min-height: 0; font-size: 15px; }
.theme-toggle:hover { background: rgba(140, 61, 79, .08); filter: none; }
.theme-toggle .ico { width: 16px; text-align: center; }
* { box-sizing: border-box; }
/* Typografia: 15 px w treści, 14 px w tabelach; większe odstępy w kartach i wierszach, nagłówki tabel z wyraźniejszą linią. */
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
nav.side { background: var(--band); padding: 20px 14px; border-right: 1px solid var(--line); }
nav.side .logo { display: block; margin: 0 8px 22px; }
nav.side .logo img { height: 58px; width: auto; display: block; }
nav.side .logo .w { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) nav.side .logo .k { display: none; } :root:not([data-theme="light"]) nav.side .logo .w { display: block; } }
nav.side a { display: block; color: var(--ink); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 500; margin-bottom: 2px; }
nav.side a:hover { background: rgba(140, 61, 79, .08); }
nav.side a.on { background: var(--panel); color: var(--accent); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
nav.side .sep { height: 1px; background: var(--line); margin: 12px 8px; }
main { padding: 28px 36px 64px; min-width: 0; }
.banner { background: var(--band); color: var(--ink); border: 1px solid var(--line); padding: 10px 16px; border-radius: var(--radius); margin-bottom: 18px; }
/* Tryb bez wysyłki: stały pasek u góry każdej strony (także logowania). */
.sync-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #fff3d6; color: #5a3a00; border: 1px solid #e3b65a; border-left: 6px solid #d9961b; padding: 10px 16px; border-radius: var(--radius); margin-bottom: 14px; font-size: 14px; }
.sync-bar .ico { font-size: 16px; }
.sync-bar a { color: #7a4f00; font-weight: 600; }
:root[data-theme="dark"] .sync-bar { background: #3a2a08; color: #ffe2a8; border-color: #8a6a2a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sync-bar { background: #3a2a08; color: #ffe2a8; border-color: #8a6a2a; } }
@media print { .sync-bar { display: none !important; } }
h1 { font-size: 28px; font-weight: 500; color: var(--head); margin: 0 0 20px; letter-spacing: -.01em; line-height: 1.25; }
h2 { font-size: 17px; font-weight: 600; color: var(--head); margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; color: var(--head); margin: 0 0 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kpi { font-size: 30px; font-weight: 600; color: var(--head); }
.kpi a { text-decoration: none; }
.muted { color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; border-bottom-width: 2px; }
tr:hover td { background: var(--soft); }
.tbl-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: #fff; white-space: nowrap; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; border: 1px solid var(--line); color: var(--muted); background: var(--soft); }
.tag.allegro { border-color: #ff5a00; color: #c94400; background: transparent; }
.tag.woo { border-color: var(--accent); color: var(--accent); background: transparent; }
form.inline { display: inline; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 11px; max-width: 100%; font-size: 14px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select { min-height: 38px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(215, 165, 173, .3); }
input[type="checkbox"] { accent-color: var(--accent); width: 17px; height: 17px; }
/* Przyciski: wysokość ≥ 38 px (na telefonie 40 px), żeby dało się trafić palcem. */
button, .btn { background: var(--btn); color: var(--btn-ink); border: 1px solid var(--btn); border-radius: 999px; padding: 8px 18px; cursor: pointer; text-decoration: none; display: inline-block; font-weight: 600; font-size: 14px; line-height: 1.3; min-height: 38px; }
button:hover, .btn:hover { filter: brightness(1.15); }
button.secondary, .btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.secondary:hover, .btn.secondary:hover { border-color: var(--rose); filter: none; }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button:disabled { opacity: .45; cursor: default; filter: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; }
.filters label { display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); gap: 4px; }
.status-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.status-tabs a { text-decoration: none; padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); background: var(--panel); font-weight: 500; }
.status-tabs a.on { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
dl.kv { display: grid; grid-template-columns: minmax(96px, 140px) 1fr; gap: 7px 16px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 6px 0 8px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--rose); position: absolute; left: -6px; top: 12px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.flash { padding: 10px 16px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid var(--line); background: var(--band); }
.flash.err { border-color: var(--bad); color: var(--bad); background: var(--panel); }
.pager { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
code, pre { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); padding: 10px; border-radius: var(--radius-sm); max-height: 320px; overflow: auto; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
details summary { cursor: pointer; color: var(--accent); }
/* Wykresy pulpitu w barwach marki: sklep = śliwka marki, Allegro = karmel, inne = niebieski.
   Paleta sprawdzona walidatorem (rozróżnialność przy daltonizmie, kontrast) dla jasnego i ciemnego tła. */
:root { --s-woo: #8c3d4f; --s-allegro: #c8873f; --s-manual: #3b7fb8; --s-one: #8c3d4f; --grid: #f1e4e9; --axis: #d9c3cb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s-woo: #b0609e; --s-allegro: #c0843a; --s-manual: #4a8fd0; --s-one: #b0609e; --grid: #2f2526; --axis: #4a3b3d; } }
.filters-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 5px 12px; font-weight: 500; min-height: 0; }
.seg button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.seg button:hover { filter: none; color: var(--ink); }
.seg button[aria-pressed="true"]:hover { color: var(--btn-ink); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.chart { width: 100%; min-height: 60px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .lbl { fill: var(--ink); font-size: 12px; }
.chart .val { fill: var(--head); font-size: 12px; font-weight: 600; }
.chart .mark { transition: opacity .12s; }
.mark.s-woo, .swatch.s-woo { fill: var(--s-woo); background: var(--s-woo); }
.mark.s-allegro, .swatch.s-allegro { fill: var(--s-allegro); background: var(--s-allegro); }
.mark.s-manual, .swatch.s-manual { fill: var(--s-manual); background: var(--s-manual); }
.mark.s-one { fill: var(--s-one); }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit.on, .chart .hit:focus-visible { fill: rgba(140, 61, 79, .06); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(20, 6, 16, .12); padding: 8px 12px; font-size: 12px; min-width: 150px; }
.tip-title { color: var(--muted); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row b { color: var(--head); font-variant-numeric: tabular-nums; }
.tip-key { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
#kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line.s-woo, .key-line.s-woo { stroke: var(--s-woo); background: var(--s-woo); }
.line.s-allegro, .key-line.s-allegro { stroke: var(--s-allegro); background: var(--s-allegro); }
.line.s-manual, .key-line.s-manual { stroke: var(--s-manual); background: var(--s-manual); }
.chart .area { opacity: .1; }
.area.s-woo, .dot.s-woo { fill: var(--s-woo); } .area.s-allegro, .dot.s-allegro { fill: var(--s-allegro); } .area.s-manual, .dot.s-manual { fill: var(--s-manual); }
.chart .dot { stroke: var(--panel); stroke-width: 2; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; }
.key-line { width: 16px; height: 2px; border-radius: 2px; display: inline-block; }
.mark.s-muted { fill: var(--line); }
.chart .lbl.small { font-size: 11.5px; }
.chart .bar-row, .chart .pt, .chart .heat-row { transition: opacity .12s; }
.chart .dim { opacity: .28; }
.chart .bar-row { cursor: pointer; }
.chart .bar-row.hl .mark { fill: var(--accent); }
.chart .pt { fill: var(--s-one); fill-opacity: .55; stroke: var(--panel); stroke-width: 2; }
.chart .pt.hl { fill-opacity: 1; stroke: var(--head); }
.chart .heat-row { cursor: pointer; outline: none; }
.chart .heat-row .cell { transition: opacity .12s; }
.chart .heat-row:hover .lbl, .chart .heat-row:focus-visible .lbl { fill: var(--accent); font-weight: 600; }
.chart .row-outline { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.ramp { width: 22px; height: 10px; border-radius: 3px; display: inline-block; }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.spark { display: block; margin-top: 8px; height: 34px; }
.spark-line { fill: none; stroke: var(--rose); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-dot { fill: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--band); color: var(--accent); border: 1px solid var(--rose); padding: 5px 12px; min-height: 0; }
.chip .x { font-size: 15px; line-height: 1; }
.chip:hover { filter: none; border-color: var(--accent); }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 12px; }
.section-title h2 { font-size: 21px; font-weight: 500; margin: 0; }
.status-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.status-tile { display: block; text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; transition: border-color .15s, transform .15s; }
.status-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, var(--accent)); }
.status-tile:hover { border-color: var(--rose); transform: translateY(-1px); }
.status-tile .n { font-size: 34px; font-weight: 600; color: var(--head); line-height: 1.1; }
.status-tile .muted { font-size: 12px; }
.attention { display: flex; flex-wrap: wrap; gap: 8px; }
.attention a { text-decoration: none; }
.layout-trend { display: grid; gap: 16px; grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1fr); }
@media (max-width: 1000px) { .layout-trend { grid-template-columns: 1fr; } }
.donut-box { display: flex; justify-content: center; padding: 6px 0 10px; }
.chart .donut-seg { stroke: var(--panel); stroke-width: 2; cursor: pointer; outline: none; transition: opacity .12s, transform .12s; }
.chart .donut-seg:hover, .chart .donut-seg:focus-visible { opacity: .85; }
.chart .donut-ring { fill: none; }
.donut-ring.s-woo { stroke: var(--s-woo); } .donut-ring.s-allegro { stroke: var(--s-allegro); } .donut-ring.s-manual { stroke: var(--s-manual); }
.chart .donut-total { fill: var(--head); font-size: 22px; font-weight: 600; }
.share-legend { display: grid; gap: 6px; }
.share-row { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; }
.share-row .swatch { width: 12px; height: 12px; }
.share-row b { color: var(--head); font-variant-numeric: tabular-nums; }
.share-row .muted { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 80px; text-align: right; }
.chart .tick.strong { fill: var(--accent); font-weight: 600; }
.chart .stem { stroke: var(--line); stroke-width: 2; stroke-linecap: round; }
.chart .stem.peak { stroke: var(--s-one); }
.chart .lolli { fill: var(--rose); stroke: var(--panel); stroke-width: 2; }
.chart .lolli.peak { fill: var(--s-one); }
.layout-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .layout-2 { grid-template-columns: 1fr; } }
.stat .kpi { font-size: 26px; }
.stat.hero .kpi { font-size: 34px; }
.delta { font-size: 12px; margin-top: 2px; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
#dash.loading .chart, #dash.loading .stat { opacity: .45; transition: opacity .15s; }
.chart-table { margin-top: 8px; font-size: 12px; }
.chart-table table { margin-top: 6px; }
.nw { white-space: nowrap; }
details.more-filters { display: contents; }
details.more-filters > summary { display: none; }
@media (max-width: 760px) {
  details.more-filters { display: block; width: 100%; }
  details.more-filters > summary { display: list-item; margin: 4px 0; font-size: 13px; }
  details.more-filters[open] > .filters { margin-top: 8px; }
}
.num { font-variant-numeric: tabular-nums; }
td.items div { line-height: 1.35; }
td.empty { text-align: center; padding: 28px; color: var(--muted); }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--band); }
.bulk-bar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--band);
  border: 1px solid var(--rose); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 10px; }
.bulk-bar label { display: inline-flex; gap: 6px; align-items: center; }
.bulk-bar[hidden] { display: none; }
@media (max-width: 760px) {
  /* Zamówienia jako karty na telefonie — bez przewijania tabeli w bok. */
  table.orders thead { display: none; }
  table.orders, table.orders tbody { display: block; }
  table.orders tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.orders td { border: 0; padding: 0; min-width: 0; overflow-wrap: anywhere; }
  .card:has(table.orders) { padding: 10px 12px; }
  .status-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .status-tabs a { white-space: nowrap; }
  .banner { font-size: 13px; padding: 8px 12px; }
  .banner.mode-bar { align-items: flex-start; }
  .status-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .status-tile { padding: 12px 14px; }
  .status-tile .n { font-size: 26px; }
  #kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #kpis .stat { padding: 12px 14px; }
  #kpis .stat .kpi, #kpis .stat.hero .kpi { font-size: 20px; }
  .filters-row .seg { overflow-x: auto; max-width: 100%; }
  table.orders td:nth-child(1) { grid-row: 1 / span 3; }
  table.orders td:nth-child(2) { grid-column: 2; }
  table.orders td:nth-child(5) { grid-column: 3; grid-row: 1; text-align: right; }
  table.orders td:nth-child(7) { grid-column: 3; grid-row: 2; text-align: right; }
  table.orders td:nth-child(3), table.orders td:nth-child(4) { grid-column: 2 / span 2; }
  table.orders td:nth-child(6) { display: none; }
  table.orders td:nth-child(8) { grid-column: 2 / span 2; color: var(--muted); font-size: 12px; }
}
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.thumb { margin: 0; display: flex; flex-direction: column; gap: 6px; position: relative; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--soft); }
.thumb figcaption { font-size: 11px; }
.thumb .row-actions button { padding: 3px 10px; min-height: 0; }
.thumb.pick { cursor: pointer; }
.thumb.pick input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; z-index: 1; }
.thumb.pick:has(input:checked) img { outline: 3px solid var(--accent); outline-offset: -3px; }
.tag.ok-tag { border-color: var(--ok); color: var(--ok); background: transparent; }
.tag.bad-tag { border-color: var(--bad); color: var(--bad); background: transparent; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  nav.side { padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  nav.side .nav-top { display: flex; align-items: center; justify-content: space-between; }
  nav.side .logo { margin: 0; }
  nav.side .logo img { height: 40px; }
  .nav-toggle { display: inline-block; }
  nav.side > .nav-group, nav.side > .nav-head, nav.side > a.nav-user, nav.side > .theme-toggle, nav.side > .sep { display: none; }
  nav.side.open > .nav-group, nav.side.open > .nav-head, nav.side.open > a.nav-user, nav.side.open > .theme-toggle { display: block; }
  nav.side.open { padding-bottom: 14px; max-height: 100vh; overflow-y: auto; }
  nav.side .sep { display: none; }
  main { padding: 18px 16px 48px; }
  h1 { font-size: 22px; }
  dl.kv { grid-template-columns: 1fr; }
}
/* Strona statusu dla klienta */
.public-band { background: var(--band); border-bottom: 1px solid var(--line); padding: 18px 16px; text-align: center; }
.public-band img { height: 64px; width: auto; }
.public-band .w { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .public-band .k { display: none; } :root:not([data-theme="light"]) .public-band .w { display: inline; } }
.public { max-width: 640px; margin: 0 auto; padding: 24px 16px 60px; }
.public .status-big { font-size: 24px; font-weight: 600; color: var(--head); margin: 6px 0 2px; }
.steps { display: flex; gap: 6px; margin: 16px 0 4px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--accent); }
.public-foot { text-align: center; color: var(--muted); font-size: 13px; }
.public-foot a { color: var(--accent); }

/* ---- Menu: wylogowanie jako formularz + wskaźnik zapisów do kanałów ---- */
.nav-form { margin: 0; }
.nav-btn { display: block; width: 100%; text-align: left; background: transparent; color: var(--ink); border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 500; font-size: 15px; min-height: 0; }
.nav-btn:hover { background: rgba(140, 61, 79, .08); filter: none; }
.nav-mode { margin: 18px 14px 0; font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.mode-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); border: 1px solid var(--muted); vertical-align: middle; margin-right: 4px; }
.mode-dot.on { background: var(--ok); border-color: var(--ok); }
/* Pasek podglądu: jedna linia, dyskretny */
.banner { display: flex; gap: 10px; align-items: flex-start; background: var(--band); color: var(--ink); border: 1px solid var(--line); padding: 8px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; }
.banner .ico { color: var(--accent); font-size: 15px; line-height: 1.3; }
.small { font-size: 12.5px; }
.empty { text-align: center; padding: 28px; color: var(--muted); }
.notice { border-color: var(--rose); background: var(--band); }
.notice .row-actions label { display: inline-flex; gap: 8px; align-items: center; }
.state { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.state.ok { color: var(--ok); } .state.off, .state.muted { color: var(--muted); } .state.bad { color: var(--bad); } .state.warn { color: var(--warn); }
.status-tabs.small a { padding: 4px 11px; font-size: 12px; }
.status-tabs.small { margin-bottom: 0; }
/* Karta zamówienia: wybór statusu jako pigułki */
.status-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.status-pick button { background: var(--panel); color: var(--ink); border: 1px solid var(--line); padding: 6px 14px 6px 10px; font-weight: 500; }
.status-pick button::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--line)); margin-right: 7px; vertical-align: 0; }
.status-pick button:hover { border-color: var(--rose); filter: none; }
.status-pick button.on { background: var(--c, var(--btn)); color: #fff; border-color: var(--c, var(--btn)); opacity: 1; cursor: default; }
.ship { border-bottom: 1px solid var(--line); padding: 8px 0; }
.ship.dry { opacity: .75; }
.ship-form summary { font-weight: 600; color: var(--head); }
.timeline li.note { color: var(--ink); }
/* Produkty */
.noimg { display: inline-block; width: 44px; height: 44px; border-radius: 8px; background: var(--soft); border: 1px dashed var(--line); }
table.products td:nth-child(2) { min-width: 220px; }
table.variants input[type="number"].bad { border-color: var(--bad); }
table.variants th, table.variants td { padding: 8px 6px; }
table.variants input:not([type="checkbox"]) { padding: 6px 8px; }
tr.variant-links td { padding-top: 4px; padding-bottom: 14px; background: transparent; }
tr.variant-links:hover td { background: transparent; }
.links-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 12.5px; }
.link-chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 4px; background: var(--soft); }
.inline-details { display: inline-block; }
.inline-details summary { font-size: 12.5px; }
.inline-details[open] { display: block; width: 100%; margin-top: 6px; }
.inline-details form.filters { margin-top: 6px; }
.desc-preview summary { font-size: 13px; }
.desc-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; background: var(--soft); margin-top: 8px; max-height: 320px; overflow: auto; font-size: 13px; }
.desc-box img { max-width: 100%; height: auto; }
/* Synchronizacja */
table.queue td { vertical-align: top; }
table.queue pre { max-height: 260px; }
tr.dimmed td { color: var(--muted); }
.danger-text { color: var(--bad) !important; }
.danger-text:hover { border-color: var(--bad) !important; }
/* Ustawienia */
.settings-groups { display: grid; gap: 14px; }
.settings-group { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px 14px; margin: 0; }
.settings-group legend { font-weight: 600; color: var(--head); padding: 0 6px; }
.settings-group .filters label { min-width: 160px; }
table.statuses input[type="color"] { width: 42px; height: 34px; padding: 2px; }
/* ---- Lista zamówień: nagłówek z akcją, szybkie akcje w wierszu, skróty ---- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.page-head form.row-actions label { display: inline-flex; align-items: center; gap: 8px; }
button.mini, .btn.mini { padding: 5px 11px; font-size: 12.5px; min-height: 30px; }
.row-quick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.row-quick button, .row-quick .btn { opacity: .55; transition: opacity .12s; }
tr:hover .row-quick button, tr:hover .row-quick .btn, tr:focus-within .row-quick button, tr:focus-within .row-quick .btn { opacity: 1; }
tr.row-link:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.tag.warn-tag { border-color: var(--warn); color: var(--warn); background: transparent; }
kbd { font: inherit; font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--soft); }
@media print {
  nav.side, .banner, .page-head form, .flash, details > summary { display: none !important; }
  .shell { display: block; } main { padding: 0; } .card { border: 0; padding: 0; } details { display: block; } details > * { display: block; }
}
/* Karta zamówienia: praca po lewej, dane klienta i historia po prawej */
.order-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
  grid-template-areas: "status info" "products info" "ship history" "x history"; align-items: start; }
.order-layout > .card { margin: 0; min-width: 0; }
.a-status { grid-area: status; } .a-info { grid-area: info; } .a-products { grid-area: products; } .a-ship { grid-area: ship; } .a-history { grid-area: history; }
@media (max-width: 1000px) { .order-layout { grid-template-columns: 1fr; grid-template-areas: "status" "products" "ship" "info" "history"; } }
.note-box { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--band); border: 1px solid var(--rose); }
.desc-edit { margin: 10px 0 4px; }
.desc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.desc-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.desc-tools button { padding: 3px 10px; font-size: 12.5px; min-height: 0; background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.desc-tools button:hover { border-color: var(--rose); filter: none; }
.seg.small button { padding: 3px 10px; font-size: 12px; }
.status-tile.ghost { border-style: dashed; }
.status-tile.ghost::before { background: var(--line); }
/* Menu: grupy „praca codzienna” i „technika” oraz sekcja Narzędzia */
.nav-head { margin: 16px 14px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.nav-group { display: block; }
.nav-tools summary { padding: 8px 14px; border-radius: 999px; font-weight: 500; color: var(--muted); cursor: pointer; list-style: none; }
.nav-tools summary::after { content: " ›"; display: inline-block; transition: transform .15s; }
.nav-tools[open] summary::after { transform: rotate(90deg); }
.nav-tools summary::-webkit-details-marker { display: none; }
.nav-tools a { padding-left: 24px; font-size: 13px; }
.card.dimmed { opacity: .7; }
@media (max-width: 860px) { nav.side > .nav-tools { display: none; } nav.side.open > .nav-tools { display: block; } }
/* Tabela zamówień: nazwy produktów mogą się łamać, numer i data nie */
table.orders td.items { max-width: 360px; }
@media (max-width: 760px) {
  .nav-mode { display: none; }
  nav.side.open .nav-form { display: block; }
  nav.side > .nav-form { display: none; }
  .status-pick button { padding: 6px 10px 6px 8px; font-size: 12.5px; }
  .settings-group .filters label { width: 100%; }
}
/* Zamówienia ręczne i pliki w pozycjach */
.tag.manual { border-color: var(--s-manual); color: var(--s-manual); background: transparent; }
img.opt-thumb { display: inline-block; vertical-align: middle; max-height: 64px; max-width: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; margin: 4px 4px 0 0; background: #fff; }
.new-order .item-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); }
.new-order .item-row:first-child { border-top: 0; padding-top: 4px; }
.new-order .item-row label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.new-order .item-row label.grow { flex: 1 1 240px; }
.new-order .item-row label.grow input, .new-order .item-row label.grow textarea { width: 100%; }
.new-order .item-row input[type="file"] { max-width: 220px; padding: 5px; }
.new-order .i-thumbs img { max-height: 48px; max-width: 72px; margin: 4px 4px 0 0; border: 1px solid var(--line); border-radius: 4px; }
.new-order textarea { font: inherit; }
.new-order label.check-inline > span { display: inline-flex; gap: 6px; align-items: center; color: var(--ink); font-size: 13px; padding: 8px 0; }
.order-sum { margin: 14px 0 0; font-size: 15px; }
/* Konta */
nav.side a.nav-user { margin-top: 6px; font-size: 13px; line-height: 1.3; }
nav.side a.nav-user .ico { color: var(--ok); font-size: 9px; vertical-align: middle; }
.nav-role { display: block; padding-left: 15px; font-size: 11px; font-weight: 400; color: var(--muted); }
.auth-card { max-width: 400px; margin: 24px auto; }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.auth-form input { width: 100%; font-size: 15px; }
.auth-form button { justify-self: start; }
.temp-pass { font-size: 15px; line-height: 1.8; }
/* Logowanie dwuskładnikowe: kod QR, sekret do przepisania, kody zapasowe. */
.qr-box { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.qr-box svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.secret-code { font-family: ui-monospace, Consolas, monospace; font-size: 15px; letter-spacing: .08em; word-break: break-all; user-select: all; }
.backup-codes { columns: 2; font-family: ui-monospace, Consolas, monospace; font-size: 16px; line-height: 2; margin: 8px 0 12px; padding-left: 0; list-style: none; }
.backup-codes li { break-inside: avoid; }
input.otp { font-size: 22px; letter-spacing: .3em; text-align: center; max-width: 220px; font-family: ui-monospace, Consolas, monospace; }
@media (max-width: 520px) { .backup-codes { columns: 1; } }
.temp-pass code { font-size: 17px; padding: 2px 8px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; user-select: all; }
table.users td { vertical-align: top; }
details.user-edit > summary { list-style: none; cursor: pointer; }
details.user-edit > summary::-webkit-details-marker { display: none; }
details.user-edit[open] { min-width: 300px; }
details.user-edit form { margin-top: 8px; }
fieldset.bare { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.bare[disabled] input, fieldset.bare[disabled] select, fieldset.bare[disabled] textarea { background: var(--soft); color: var(--muted); }
.admin-tabs { margin: -6px 0 16px; }
table.perm-matrix td, table.perm-matrix th { vertical-align: middle; }
table.perm-matrix tr.group th { text-align: left; padding-top: 16px; color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.perm-matrix select { min-width: 132px; }
table.perm-matrix select.mode-direct { border-color: var(--ok); color: var(--ok); font-weight: 600; }
table.perm-matrix select.mode-suggest { border-color: var(--warn); color: var(--warn); font-weight: 600; }
table.perm-matrix select.mode-none { color: var(--muted); }
table.audit td { vertical-align: top; }
table.audit .chg + .chg { margin-top: 6px; }
table.audit .chg-what { font-weight: 600; color: var(--head); }
table.audit .chg-f { color: var(--muted); }
table.audit del { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
table.audit ins { color: var(--ok); text-decoration: none; font-weight: 600; }
table.audit dl.kv { margin: 4px 0 0; }
/* Sugestie */
.nav-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.chg + .chg, .chg-list .chg + .chg { margin-top: 6px; }
.chg-what { font-weight: 600; color: var(--head); }
.chg-f { color: var(--muted); }
.chg-list del, .sug del { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.chg-list ins, .sug ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.card.sug { border-left: 4px solid var(--warn); }
.card.sug-accepted { border-left-color: var(--ok); }
.card.sug-rejected, .card.sug-withdrawn { border-left-color: var(--line); opacity: .85; }
.card.sug-failed { border-left-color: var(--bad); }
.sug-state.pending { border-color: var(--warn); color: var(--warn); background: transparent; }
.sug-state.accepted { border-color: var(--ok); color: var(--ok); background: transparent; }
.sug-state.failed { border-color: var(--bad); color: var(--bad); background: transparent; }
.sug-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sug-actions form.filters { display: inline-flex; }
.sug-files img { max-height: 140px; max-width: 220px; margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.sug-stale .chg-list { margin: 6px 0; }
.sug-pending ul { margin: 6px 0 0; padding-left: 18px; }
/* Historia zmian z dziennika na kartach (administrator) */
details.audit-block { margin-top: 14px; }
details.audit-block > summary { cursor: pointer; }
details.audit-block table.audit { width: 100%; margin-top: 8px; }
details.audit-block table.audit td { padding: 6px 8px; border-top: 1px solid var(--line); }
.check-inline > span { display: inline-flex; gap: 6px; align-items: center; color: var(--ink); font-size: 13px; padding: 8px 0; }
/* Tryb panelu: jedna pigułka (Podgląd / Cień / Praca) w menu, pasku nad treścią, Synchronizacji i Ustawieniach */
.mode-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; border: 1px solid currentColor; white-space: nowrap; vertical-align: middle; }
.mode-pill.mode-podglad { color: var(--accent); background: var(--band); }
.mode-pill.mode-cien { color: var(--warn); }
.mode-pill.mode-praca { color: var(--ok); }
.banner.mode-bar { align-items: center; gap: 12px; }
.banner.mode-bar .mode-pill { flex: none; }
.nav-mode .mode-pill { font-size: 11px; padding: 1px 8px; }
/* Pulpit: kafle „do zrobienia dziś” z podpowiedzią i lista zamówień w toku */
.todo-tiles .status-tile .n { font-size: 38px; }
.todo-tiles .status-tile .small { margin-top: 2px; }
.card-head > a { font-weight: 500; }
table.todo td.items { max-width: 420px; }
@media (max-width: 760px) {
  table.todo thead { display: none; }
  table.todo, table.todo tbody { display: block; }
  table.todo tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.todo td { border: 0; padding: 0; min-width: 0; overflow-wrap: anywhere; }
  table.todo td:nth-child(4), table.todo td:nth-child(5) { text-align: right; }
  table.todo td:nth-child(3), table.todo td:nth-child(6) { grid-column: 1 / span 2; }
  table.todo td:nth-child(3) { color: var(--muted); font-size: 13px; }
}
/* Lista zamówień: sortowanie po kolumnach, zamówienia z historii przygaszone i oznaczone */
th a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
th a.sort .arr { margin-left: 4px; font-size: 9px; opacity: .45; }
th a.sort.on { color: var(--accent); }
th a.sort.on .arr { opacity: 1; }
th a.sort:hover { color: var(--accent); }
tr.hist td { color: var(--muted); }
tr.hist td a, tr.hist td b { font-weight: 500; }
tr.hist .pill { opacity: .7; }
.tag.hist-tag { border-style: dashed; }
@media (max-width: 760px) { th a.sort .arr { display: none; } }
/* Lista produktów: na telefonie karty zamiast tabeli przewijanej w bok */
table.products td .lbl { display: none; }
@media (max-width: 760px) {
  table.products thead { display: none; }
  table.products, table.products tbody { display: block; }
  table.products tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
  table.products td { border: 0; padding: 0; min-width: 0; overflow-wrap: anywhere; }
  table.products td.pic { grid-row: 1 / span 2; }
  table.products td.name { grid-column: 2 / span 2; min-width: 0; }
  table.products td.sku { grid-column: 2 / span 2; font-size: 13px; }
  table.products td.stock, table.products td.price, table.products td.chans { grid-column: 2 / span 2; display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; }
  table.products td .lbl { display: inline-block; min-width: 68px; color: var(--muted); font-size: 12px; }
  table.products td.chans { margin-top: 2px; }
  .card:has(table.products) { padding: 10px 14px; }
}
/* Ustawienia: jeden rząd zakładek (ogólne, statusy, połączenia, konta, typy kont, dziennik) */
.settings-tabs { margin: -4px 0 18px; }
/* Synchronizacja: kolejka opisana słownie, dane techniczne zwinięte */
.payload-list { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
td.payload { max-width: 420px; }
td.payload details { margin-top: 4px; }
td.payload pre { max-height: 240px; font-size: 11.5px; }
details.admin-notes { margin-top: 10px; }
details.admin-notes summary { font-size: 13px; }
details.admin-notes p { margin: 8px 0 0; }
table.jobs td { vertical-align: top; }
/* Stan ładowania przycisku po wysłaniu formularza (skrypt w layout.js) */
button.busy, .btn.busy { position: relative; padding-left: 34px; opacity: .8; cursor: progress; }
button.busy::before, .btn.busy::before { content: ""; position: absolute; left: 13px; top: 50%; width: 13px; height: 13px; margin-top: -7px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: busy-spin .7s linear infinite; }
button.mini.busy { padding-left: 26px; } button.mini.busy::before { left: 8px; width: 11px; height: 11px; margin-top: -6px; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button.busy::before, .btn.busy::before { animation: none; border-right-color: currentColor; opacity: .5; } }
/* Strony błędów 403 / 404 / 500 — jedna karta w stylu panelu */
.error-card { max-width: 560px; margin: 24px auto; text-align: center; padding: 32px 28px; }
.error-card .error-code { font-size: 44px; font-weight: 600; color: var(--rose); line-height: 1; margin-bottom: 10px; letter-spacing: .02em; }
.error-card h1 { margin-bottom: 10px; }
.error-card .row-actions { justify-content: center; margin: 18px 0 0; }
.public .error-card { margin-top: 0; }
/* Telefon: przyciski i pola co najmniej 40 px, zakładki przewijane z zanikającą krawędzią (podpowiedź, że jest więcej) */
@media (max-width: 760px) {
  button, .btn, button.mini, .btn.mini, .status-tabs a, .status-pick button, .seg button { min-height: 40px; }
  button.mini, .btn.mini { padding: 6px 12px; }
  .seg button { padding: 6px 12px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select { min-height: 40px; }
  nav.side .nav-group a, .nav-tools a, .nav-tools summary, .theme-toggle, .nav-btn { padding-top: 10px; padding-bottom: 10px; }
  .status-tabs.scrolls { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); padding-right: 40px; scroll-snap-type: x proximity; }
  .status-tabs.scrolls a { scroll-snap-align: start; }
  .status-tabs.scrolls.at-end { -webkit-mask-image: none; mask-image: none; }
  .status-tabs.small a { min-height: 36px; }
  .thumb .row-actions button { min-height: 36px; }
  .desc-tools button { min-height: 40px; padding: 6px 12px; }
  .row-quick { gap: 6px; }
  .pager { flex-wrap: wrap; }
  .filters > button, .filters > .btn { margin-top: 4px; }
}
/* Karta produktu (U5): nagłówek ze zdjęciem, kompaktowe dane, jedna tabela wariantów z jednym „Zapisz”, zakładki na resztę */
.product-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.product-head h1 { margin: 0 0 4px; }
.product-pic { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--line); background: var(--soft); flex: none; display: block; }
.product-facts { margin: 0; overflow-wrap: anywhere; }
.product-title { min-width: 0; }
.filters label.grow { flex: 1 1 220px; }
.filters label.grow input { width: 100%; }
.product-basics .card-head { margin-bottom: 10px; }
.product-basics .filters > button { margin-bottom: 1px; }
.product-tabs { margin: 4px 0 14px; }
.tab-panel[hidden] { display: none; }
.tab-panel h2.sub-head { margin-top: 20px; }
table.variants .lbl { display: none; }
table.variants thead th { white-space: nowrap; }
table.variants input[name$="_name"] { width: 150px; }
table.variants input[name$="_sku"] { width: 104px; } table.variants input[name$="_ean"] { width: 118px; }
table.variants input[name$="_stock_qty"] { width: 78px; }
table.variants input[name$="_base_price"], table.variants input[name$="_price_allegro"], table.variants input[name$="_price_woo"] { width: 96px; }
table.variants td.v-mto { white-space: nowrap; }
table.variants td.v-mto .check-inline > span { padding: 6px 0; }
tr.variant-row td { padding-bottom: 4px; }
tr.variant-row:hover td { background: transparent; }
tr.variant-links td { padding-top: 0; }
tr.variant-links .links-row b { color: var(--head); }
.link-form { margin-top: 6px; }
.link-form summary { font-size: 13px; }
.link-form form.filters { margin-top: 8px; }
table.moves td { vertical-align: middle; }
@media (max-width: 760px) {
  /* Warianty jako karty: dwie kolumny pól z podpisami, powiązania pod spodem. */
  .product-head { gap: 12px; align-items: flex-start; }
  .product-pic { width: 52px; height: 52px; }
  table.variants thead { display: none; }
  table.variants, table.variants tbody { display: block; }
  table.variants tr.variant-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; padding: 12px 0 8px; border-top: 1px solid var(--line); }
  table.variants tr.variant-row:first-child { border-top: 0; padding-top: 4px; }
  table.variants tr.variant-row td { display: flex; flex-direction: column; gap: 3px; border: 0; padding: 0; min-width: 0; }
  table.variants .lbl { display: block; font-size: 12px; color: var(--muted); }
  table.variants td.v-name, table.variants td.v-mto { grid-column: 1 / span 2; }
  table.variants input:not([type="checkbox"]) { width: 100%; }
  table.variants tr.variant-links { display: block; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
  table.variants tr.variant-links td { display: block; border: 0; padding: 0; }
  table.variants tbody tr.variant-links:last-child { border-bottom: 0; }
  .product-basics .filters > button { width: 100%; }
}
/* Karta zamówienia: „Do produkcji” na górze — personalizacja z pozycji, uwagi klienta, wizualizator z kontekstem */
.make-strip { border-left: 5px solid var(--accent); }
.make-list { margin: 0 0 8px; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.make-list li { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--soft); border: 1px solid var(--line); }
.make-list li > b { font-size: 16px; margin-right: 4px; }
.make-opt { margin-top: 4px; font-size: 15px; }
.make-opt b { color: var(--head); font-size: 17px; }
.make-strip .note-box { margin-top: 6px; }
/* Ostrzeżenie o ilości poniżej minimum produktu (services/minimums.js) — czerwona ramka, bez blokowania. */
.note-box.below-min { border-color: var(--bad); margin-bottom: 10px; }
.nav-version { display: block; margin-top: 4px; opacity: .7; }
/* Wiadomości z Allegro: wątki i rozmowa. */
table.threads tr.unread td { font-weight: 600; }
.chat { display: grid; gap: 10px; margin-bottom: 14px; }
.msg { max-width: 85%; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--soft); border: 1px solid var(--line); justify-self: start; }
.msg.mine { justify-self: end; background: var(--band); border-color: var(--rose); }
.msg-head { margin-bottom: 4px; } .msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply textarea { width: 100%; }
/* Statystyki: własny zakres dat obok gotowych przedziałów. */
.range-pick { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.range-pick label { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; color: var(--muted); }
.range-pick input[type="date"] { padding: 4px 8px; min-height: 0; }
.note-box.below-min > div { margin: 4px 0; }
@media (max-width: 760px) {
  /* Karta produktu na telefonie: chip powiązania może się łamać, formularz „zdjęcie z adresu URL” mieści się w karcie. */
  .link-chip { flex-wrap: wrap; border-radius: var(--radius-sm); padding: 4px 10px; }
  .inline-details .filters label { flex: 1 1 100%; min-width: 0; }
  .inline-details .filters input { width: 100%; }
}

/* Baza klientów (/klienci): kafelki z liczbami nad listą i na karcie klienta. */
.customer-kpis { margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.customer-kpis .stat { padding: 14px 16px; }
.customer-kpis .kpi { font-size: 26px; }
table.customers td.num, table.customers th.num { text-align: right; }
@media (max-width: 640px) { .customer-kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .customer-kpis .kpi { font-size: 20px; } }
