:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1d232b;
  --muted: #667085;
  --line: #e2e5ea;
  --accent: #0f6e5f;
  --accent-soft: #e5f3f0;
  --warn: #9a5b00;
  --warn-soft: #fff4dd;
  --error: #b42318;
  --error-soft: #fdecea;
  --ok-soft: #e8f5ec;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .75rem; }
h2 { font-size: 1.15rem; margin: 1.25rem 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
p { margin: .4rem 0; }
small, .muted { color: var(--muted); }
code { font-size: .9em; background: #eef0f3; padding: 1px 5px; border-radius: 4px; }

.topbar {
  background: #14202b;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { font-weight: 700; white-space: nowrap; padding: 12px 0; color: #fff; }
.topbar .main-nav { display: flex; gap: 2px; flex: 1; min-width: 0; }
.nav-item { position: relative; }
.nav-top {
  display: block;
  color: #c9d3dd;
  padding: 14px 10px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.nav-item.on > .nav-top, .nav-top:hover { color: #fff; text-decoration: none; border-bottom-color: #3fbfa6; }
.nav-drop {
  display: none; position: absolute; top: 100%; left: 0; min-width: 230px; padding: 6px; z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(20, 32, 43, .18);
}
.nav-item:hover > .nav-drop, .nav-item:focus-within > .nav-drop { display: block; }
.nav-drop a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); white-space: nowrap; }
.nav-drop a small { display: block; max-width: 300px; white-space: normal; color: var(--muted); font-size: .78rem; line-height: 1.25; font-weight: 400; }
.nav-drop a:hover { background: #eef5f3; text-decoration: none; }
.nav-drop a.on { color: var(--accent); font-weight: 600; }
.section-tabs { background: #fff; border-bottom: 1px solid var(--line); }
.section-tabs .wrap { display: flex; gap: 2px; max-width: 1180px; margin: 0 auto; padding: 0 8px; overflow-x: auto;
  scrollbar-width: none; }
.section-tabs a { padding: 10px 10px 8px; white-space: nowrap; color: var(--muted); border-bottom: 3px solid transparent; }
.section-tabs a:hover { color: var(--text); text-decoration: none; }
.section-tabs a.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.bottom-bar { display: none; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.menu-group h2 { margin: 0 0 6px; font-size: 1.05rem; }
.menu-link { display: grid; padding: 10px 4px; border-top: 1px solid var(--line); color: var(--text); }
.menu-link:hover { text-decoration: none; background: #f6f9f8; }
.menu-link small { color: var(--muted); }
.menu-logout { margin-top: 16px; }
.menu-single { display: grid; color: var(--text); }
.menu-single:hover { text-decoration: none; border-color: var(--accent); }
.menu-single h2 { margin: 0; }
.menu-single small { color: var(--muted); }
.topbar form { margin: 0; }
.topbar .who { color: #c9d3dd; font-size: .85rem; white-space: nowrap; }
.topbar .who button { background: none; border: 0; color: #c9d3dd; cursor: pointer; padding: 0 0 0 6px; font: inherit; text-decoration: underline; }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.stat { display: block; color: var(--text); }
.stat .num { font-size: 1.7rem; font-weight: 700; }
.stat .label { color: var(--muted); font-size: .9rem; }
a.stat:hover { text-decoration: none; border-color: var(--accent); }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 10px; background: var(--ok-soft); border: 1px solid #b7e1c4; }
.flash.error { background: var(--error-soft); border-color: #f4b9b2; color: var(--error); }
.flash.warn, .note-warn { background: var(--warn-soft); border: 1px solid #f1d39a; color: var(--warn); padding: 10px 14px; border-radius: var(--radius); }
.note-info { background: #eef4fb; border: 1px solid #c9dcf2; color: #24476b; padding: 10px 14px; border-radius: var(--radius); }

.btn, button.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 500; }
.btn.danger { background: #fff; color: var(--error); border-color: #f4b9b2; }
.btn.small { padding: 4px 10px; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: default; }

input, select, textarea {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid #cfd4db;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9fd8cc; border-color: var(--accent); }
input[type=number] { width: 90px; }
label { display: inline-flex; flex-direction: column; gap: 3px; font-size: .88rem; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row.center { align-items: center; }
.spacer { flex: 1; }
.inline { display: inline; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.tabs a { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); }
.tabs a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.tabs a:hover { text-decoration: none; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap table { border: 0; }

.badge { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 999px; background: #eef0f3; color: #3d4652; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: #1f6b3a; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--error-soft); color: var(--error); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }

.thumb { width: 64px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; flex: none; }
.thumb.big { width: 120px; height: 120px; }
.thumb.empty { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: .75rem; }

.offer-line { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.offer-line:first-of-type { border-top: 0; }
.card.offer-line { padding: 10px 14px; border-top: 1px solid var(--line); }
.offer-line .info { flex: 1; min-width: 0; }
.offer-line .name { font-weight: 500; overflow-wrap: anywhere; }
.offer-line .meta { color: var(--muted); font-size: .85rem; display: flex; gap: 8px; flex-wrap: wrap; }

.proposal.confident { border-left: 4px solid #3fbfa6; }
.proposal.check { border-left: 4px solid #e9b44c; }
.proposal .head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.proposal .reasons { font-size: .86rem; color: var(--muted); }
.units { width: 64px !important; }
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.pager { display: flex; gap: 6px; align-items: center; margin: 14px 0; flex-wrap: wrap; }

/* Liczenie */
.count-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.count-card { display: flex; flex-direction: column; gap: 8px; }
.count-card .top { display: flex; gap: 12px; }
.count-card img.thumb { width: 110px; height: 110px; }
.count-card .name { font-weight: 600; overflow-wrap: anywhere; }
.count-card .entry { display: flex; gap: 8px; align-items: center; }
.count-card .entry input { width: 110px; font-size: 1.25rem; padding: 8px 10px; }
.count-card.saved { border-color: #8fd3b0; background: #f6fcf8; }
.count-card .msg { font-size: .85rem; }
.count-card .msg.err { color: var(--error); }
.progress { height: 8px; background: #e6e9ee; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: #3fbfa6; }

.login { max-width: 380px; margin: 8vh auto; }
.login label { display: flex; margin-bottom: 10px; }
.login input { width: 100%; }

@media (max-width: 760px) {
  .topbar .main-nav { visibility: hidden; overflow: hidden; }
  .section-tabs .wrap { padding: 0 4px; }
  .bottom-bar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #14202b; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0, 0, 0, .2);
  }
  .bottom-bar a { position: relative; display: grid; justify-items: center; gap: 1px; padding: 7px 2px 6px; color: #c9d3dd;
    font-size: .72rem; border-top: 3px solid transparent; }
  .bottom-bar a.on { color: #fff; border-top-color: #3fbfa6; }
  .bottom-bar a:hover { text-decoration: none; }
  .bottom-bar .bb-icon { font-size: 1.3rem; line-height: 1.1; }
  .bottom-bar .nav-count { position: absolute; top: 3px; left: 54%; margin: 0; }
  main { padding-bottom: 96px; }
}
@media (max-width: 640px) {
  main { padding: 12px 12px 96px; }
  .topbar { gap: .5rem; padding: 0 12px; }
  .topbar .who span { display: none; }
  .count-list { grid-template-columns: 1fr; }
  th, td { padding: 6px 8px; }
}

/* Pulpit: kroki */
.how { margin: 6px 0 0; padding-left: 18px; }
.how li { margin: 4px 0; }
.steps { padding: 4px 16px; }
.step { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step .mark { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; background: #eef0f3; color: var(--muted); }
.step.ok .mark { background: var(--ok-soft); color: #1f6b3a; }
.step.warn .mark { background: var(--error-soft); color: var(--error); }
.step.wait .mark { background: #eef4fb; color: #24476b; } /* wersja 42: czeka na połączenie z Allegro */
.step .body { flex: 1; min-width: 0; }
.step small { color: var(--muted); }

/* Szybkie liczenie */
.quick input[type=search] { width: 100%; font-size: 1.2rem; padding: 12px 14px; }
.quick-card { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.quick-card:first-child { margin-top: 10px; }
.quick-card .info { flex: 1; min-width: 0; }
.quick-card .name { font-weight: 600; overflow-wrap: anywhere; }
.quick-card .entry { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.quick-card .entry input { width: 100px; font-size: 1.15rem; padding: 7px 9px; }
.quick-card .entry input.grow { flex: 1; min-width: 180px; width: auto; font-size: 1rem; }
.quick-card.saved { background: #f6fcf8; }
.quick-card.offer .name::after { content: " · brak w panelu"; color: var(--warn); font-weight: 500; }
.quick-card .msg { font-size: .85rem; margin-top: 4px; }
.quick-card .msg.ok { color: #1f6b3a; }
.quick-card .msg.err { color: var(--error); }
.stepper { display: inline-flex; gap: 4px; align-items: center; }
.stepper .btn { padding: 6px 12px; font-size: 1.1rem; line-height: 1; }

/* Statystyki */
.kpis { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 12px; }
.kpis .card { margin-bottom: 0; }
.kpis .stat .num { font-size: 1.45rem; }
.delta { font-weight: 600; font-size: .88rem; white-space: nowrap; }
.delta.up { color: #1f6b3a; }
.delta.down { color: var(--error); }
.delta.none { color: var(--muted); }
.filters { padding: 10px 14px; }
.chart { margin: 6px 0 0; position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gridline { stroke: #edf0f3; stroke-width: 1; }
.chart .axis { stroke: #c4c9d1; stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .hit { cursor: default; }
.chart .hit:hover rect[fill="transparent"] { fill: rgba(20, 32, 43, .05); }
.chart .dot circle { opacity: 0; }
.chart .dot:hover circle { opacity: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .88rem; color: var(--text); margin-bottom: 4px; }
.legend i, i.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: #14202b; color: #fff; font-size: .82rem;
  padding: 6px 9px; border-radius: 6px; max-width: 320px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.thumb.sm { width: 40px; height: 40px; border-radius: 6px; }
.table-wrap td .thumb.sm { display: block; }
tr.dim td { color: var(--muted); }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; }
.subnav a { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: .9rem; color: var(--text); }
.subnav a.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.subnav a:hover { text-decoration: none; border-color: var(--accent); }
input.qty { width: 80px; }
.status-pill { font-size: .78rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 640px) {
  /* Na telefonie wykres przewija się w bok, żeby opisy osi były czytelne. */
  .chart { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .chart svg { min-width: 620px; }
}
input.stock-edit { width: 84px; text-align: right; }
input.stock-edit.neg { border-color: #f4b9b2; color: var(--error); }
.stock-msg { font-size: .78rem; min-height: 1em; }
.stock-msg.ok { color: #1f6b3a; }
.stock-msg.err { color: var(--error); }
.copy-defaults { padding: 10px 0; border-top: 1px solid var(--line); }
.copy-defaults:first-of-type { border-top: 0; }

/* Treść produktu */
.content-card .gallery { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.content-card .gallery img { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.content-title { font-weight: 600; margin-bottom: 6px; }
.content-card details { margin-top: 6px; }
.content-card summary { cursor: pointer; color: var(--accent); }
.description { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; max-height: 520px; overflow: auto; }
.desc-section { display: flex; gap: 14px; align-items: flex-start; padding: 8px 0; border-top: 1px dashed var(--line); }
.desc-section:first-child { border-top: 0; }
.desc-section > * { flex: 1; min-width: 0; }
.desc-section img { max-width: 100%; max-height: 260px; object-fit: contain; }
.desc-text h1 { font-size: 1.15rem; } .desc-text h2 { font-size: 1rem; }
table.params { margin-top: 6px; }
table.params th { width: 40%; text-transform: none; letter-spacing: 0; font-size: .88rem; }
@media (max-width: 640px) { .desc-section { flex-direction: column; } }
.ed-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-img { width: 110px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; text-align: center; font-size: .78rem; }
.ed-img img { width: 100px; height: 100px; object-fit: contain; display: block; margin: 0 auto 4px; }
.ed-img.main { border-color: var(--accent); }
.ed-img .tools button, .ed-section .tools button { padding: 2px 7px; font-size: .85rem; }
.ed-section { border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; background: #fbfcfd; }
.ed-section .items { display: flex; gap: 10px; }
.ed-section .items > * { flex: 1; min-width: 0; }
.ed-text { min-height: 90px; border: 1px solid #cfd4db; border-radius: 6px; padding: 6px 10px; background: #fff; }
.ed-text:focus { outline: 2px solid #9fd8cc; }
.ed-toolbar { display: flex; gap: 4px; margin-bottom: 4px; flex-wrap: wrap; }
.ed-toolbar button { padding: 2px 8px; font-size: .82rem; }
.ed-pick img { max-width: 100%; max-height: 180px; object-fit: contain; display: block; margin-top: 4px; }
label.check { display: flex; flex-direction: row; gap: 8px; align-items: flex-start; color: var(--text); font-size: .95rem; padding: 4px 0; }
@media (max-width: 640px) { .ed-section .items { flex-direction: column; } }

/* Skaner */
.search-scan { display: flex; gap: 8px; }
.search-scan input { flex: 1; min-width: 0; }
.scan-btn { white-space: nowrap; }
.scanner { position: fixed; inset: 0; z-index: 100; background: rgba(10, 16, 22, .88); display: flex; align-items: center; justify-content: center; padding: 12px; }
.scanner-box { background: #fff; border-radius: 12px; width: min(560px, 100%); padding: 10px; }
.scanner-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.scanner-view { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; }
.scanner-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-frame { position: absolute; left: 12%; right: 12%; top: 35%; bottom: 35%; border: 3px solid #3fbfa6; border-radius: 8px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
.scanner-msg { padding: 8px 2px 2px; font-size: .95rem; }
.scanner-ocr { padding-top: 8px; }
.scanner-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.scanner-picks .btn { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1rem; }
tr.scanned td { background: #f0faf6; }
.msg.ok { color: #1f6b3a; } .msg.err { color: var(--error); }
.notify-channel { border-top: 1px solid var(--line); padding: 8px 0; }
.notify-channel summary { cursor: pointer; }
.notify-channel ol { margin: 6px 0; }
.push-box.off { border-color: #f1d39a; background: var(--warn-soft); }
.week h3 { margin-bottom: 8px; }
.cal-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 5px 0; border-top: 1px dashed var(--line); }
.cal-row:first-of-type { border-top: 0; }
.cal-day { width: 46px; font-weight: 600; flex: none; }
.cal-row.delivery { background: #f6fcf8; }
details.split { flex-basis: 100%; margin-top: 4px; }
details.split summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.card.offer-line:has(details.split) { flex-wrap: wrap; }
details.split form { margin-top: 6px; }
.similar-offers { margin-top: 8px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 8px; }
.similar-offers .offer-line { opacity: .92; }
.product-preview { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; margin: 6px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.product-preview .info { flex: 1; min-width: 0; }
.product-preview .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .88rem; margin-top: 2px; }
.similar-products { margin-top: 8px; }
.target-label { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.tabs .count { font-size: .8rem; color: var(--muted); margin-left: 2px; }
.bulk-bar { margin: 8px 0; flex-wrap: wrap; }
.order-item { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 4px; }
.thumb.small { width: 34px; height: 34px; }
table.orders td { vertical-align: top; }
.picklist .tick { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--text); border-radius: 3px; }
@media print { .topbar, .section-tabs, .bottom-bar, .no-print, .flash { display: none !important; } main { padding: 0; } .thumb.small { width: 28px; height: 28px; } }
.danger-zone { border-color: var(--error-soft); }
.danger-zone summary { cursor: pointer; }
/* Zamówienia: wiek (jak w Apilo), kopiowanie, szybkie filtry, powiększanie zdjęć, pasek etykiet */
.age { display: inline-block; font-size: .75rem; padding: 0 6px; border-radius: 9px; font-weight: 600; }
.age-g { background: #e3f6e8; color: #1e7a3c; }
.age-y { background: #fff5cc; color: #8a6400; }
.age-o { background: #ffe7d1; color: #a24a00; }
.age-r { background: #fde2e1; color: #b42318; }
.age-done { background: #eef0f3; color: var(--muted); }
button.copy { border: 0; background: none; cursor: pointer; padding: 0 2px; color: var(--muted); font-size: .9rem; }
button.copy:hover { color: var(--accent); }
.chip { display: inline-block; padding: 3px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); text-decoration: none; font-size: .9rem; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.quick-filters { margin: 4px 0 8px; gap: 6px; flex-wrap: wrap; }
.order-item img.thumb.small { transition: transform .12s; position: relative; }
.order-item img.thumb.small:hover { transform: scale(4.5); transform-origin: left top; z-index: 20; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.label-bar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.queue-summary summary { cursor: pointer; }
.copy-toast { position: fixed; left: 16px; bottom: 16px; background: #14202b; color: #fff; padding: 6px 12px; border-radius: 8px; z-index: 200; font-size: .9rem; }
/* Pakowanie ze skanerem */
.pack-head .stat { text-align: center; min-width: 90px; }
.pack-msg { margin-top: 8px; font-size: 1.05rem; }
.pack-msg.ok { color: #1e7a3c; font-weight: 600; }
.pack-msg.err { color: var(--error); font-weight: 700; }
.pack-msg.warn { color: var(--warn); font-weight: 700; }
.pack-actions [data-o-done] { margin-left: auto; }  /* wersja 36: z dala od głównego przycisku */
.pack-order.flash-err { animation: packerr .6s; }
@keyframes packerr { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px var(--error); } }
.pack-lines { margin: 10px 0; }
.pack-line { display: flex; gap: 10px; align-items: center; padding: 8px; border: 2px solid var(--line); border-radius: 10px; margin-bottom: 6px; }
.pack-line.done { border-color: #39a96b; background: #eef9f1; }
.pack-line .count { font-size: 1.5rem; font-weight: 700; min-width: 70px; text-align: center; }
.pack-line img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 6px; }
.pack-actions { flex-wrap: wrap; gap: 8px; }
.pack-choice { display: flex; gap: 8px; flex-wrap: wrap; }
/* Możliwe duplikaty produktów */
.dup-pair { margin-bottom: 12px; }
.dup-head { gap: 6px; flex-wrap: wrap; }
.dup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dup-grid > div { display: flex; flex-direction: column; }
.dup-grid .product-preview { flex: 1; }
.tabs a.on .count { color: inherit; opacity: .85; }
.dup-lock { font-size: .85rem; margin: 0 0 6px 10px; color: var(--warn); }
.dup-actions { gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.dup-qty input { width: 7em; }
.dup-hint { font-size: .85rem; flex-basis: 100%; }
.dup-sep { margin-left: 12px; }
@media (max-width: 800px) { .dup-grid { grid-template-columns: 1fr; } .dup-sep { margin-left: 0; } }
/* Masowa edycja produktów */
.bulk-edit summary { cursor: pointer; }
.bulk-fields { flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.bulk-fields input.short { width: 6em; }
.bulk-fields input.mid { width: 10.5em; }
.bulk-fields input[name=supplier] { width: 13em; }
.bulk-edit { position: sticky; bottom: 0; z-index: 5; margin: 10px 0 0; box-shadow: 0 -4px 14px rgba(0, 0, 0, .12); }
/* Termin wysyłki na liście zamówień */
.deadline { display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 10px; font-size: .8rem; white-space: nowrap; }
.dl-late, .dl-soon { background: var(--error); color: #fff; font-weight: 600; }
.dl-today { background: var(--warn-soft); color: var(--warn); font-weight: 600; border: 1px solid #f0c36d; }
.dl-tomorrow { background: #fffbe6; color: #7a6200; border: 1px solid #efe0a0; }
.dl-later { color: var(--muted); padding-left: 0; }
tr.row-late td:first-child { box-shadow: inset 4px 0 0 var(--error); }
.tabs .count.hot { background: var(--error); color: #fff; border-radius: 9px; padding: 0 6px; }
.pack-choice .btn.urgent { border-color: var(--error); color: var(--error); font-weight: 600; }
[hidden] { display: none !important; }
/* Produkty z hurtowni */
.ws-item { display: flex; gap: 8px; align-items: flex-start; }
.ws-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ws-actions .ws-suggest { white-space: normal; text-align: left; max-width: 100%; }
.ws-actions .ws-suggest small { opacity: .8; }
.ws-code { display: inline-flex; gap: 4px; align-items: center; }
.ws-code input { width: 10.5em; }
.ws-columns label { min-width: 170px; }
.ws-table td:first-child { width: 28px; }
.missing-box { border-left: 4px solid #e9b44c; }
.missing-box .missing-item { padding: 8px 0; border-top: 1px solid var(--line); }
.missing-box .missing-item:first-of-type { border-top: 0; }
.btn.ghost.danger-text { color: var(--error); }
.merge-candidate { margin-bottom: 8px; }
.merge-actions { gap: 8px; flex-wrap: wrap; margin: -2px 0 6px 10px; }
.danger-zone h4 { margin: 12px 0 4px; }
.bulk-delete { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; gap: 8px; flex-wrap: wrap; }
/* Nadpisz ofertę lepszą ofertą */
.ow-candidates { display: grid; gap: 6px; }
.ow-candidate { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--bg); }
.ow-candidate:hover { border-color: var(--accent); }
.ow-candidate.on { border: 2px solid var(--accent); background: var(--accent-soft); }
.ow-target .thumb.sm { vertical-align: middle; margin-right: 4px; }
.offer-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
/* Scal zaznaczone */
label.merge-option { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; cursor: pointer; color: var(--text); font-size: .95rem; margin-bottom: 8px; }
.merge-option > input { margin-top: 18px; }
.merge-option > div { flex: 1; min-width: 0; }
.merge-group { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.merge-offer { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.merge-offer .info { flex: 1; min-width: 0; }
.merge-choice { gap: 4px 14px; flex-wrap: wrap; }
.merge-offer .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .88rem; }
.end-tools { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.merge-offer:has(input[type=radio]:checked) .end-tools { display: none; }
/* Przypisywanie pozycji z hurtowni: karty produktów ze zdjęciem i wyszukiwarka */
.ws-actions { display: grid; gap: 6px; margin-top: 6px; }
.pick-label { font-size: .85rem; color: var(--muted); }
.pick-card { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.pick-card .pick-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick-card .pick-info a { color: var(--text); }
.pick-search input { width: 100%; max-width: 520px; }
.pick-results { display: grid; gap: 6px; }
.pick-results:empty { display: none; }
.ws-item .thumb { width: 64px; height: 64px; }
/* Przyjęcie dostawy: zdjęcia i duże pola na telefonie */
.line-product { display: flex; gap: 8px; align-items: flex-start; }
.line-product .thumb { flex: none; }
input.qty.big { width: 5.5em; font-size: 1.05rem; padding: 8px; }
tr.done td { opacity: .55; }
@media (max-width: 560px) {  /* przyjęcie na telefonie: pole "Przyszło" bez przewijania w bok */
  table.receive th, table.receive td { padding: 6px; }
  table.receive th { letter-spacing: 0; }
  table.receive .thumb { width: 44px; height: 44px; }
  table.receive input.qty.big { width: 4.2em; }
}
/* Dostawa z faktury hurtowni */
.inv-line { display: grid; grid-template-columns: minmax(260px, 2fr) 3fr; gap: 12px; }
.inv-line:has(input[value="skip"]:checked) { opacity: .55; }
.inv-head { display: flex; gap: 10px; align-items: flex-start; }
.inv-no { font-weight: 700; color: var(--muted); min-width: 1.8em; padding-top: 4px; }
.inv-fields { flex: 1; min-width: 0; display: grid; gap: 6px; }
.inv-fields .row { gap: 8px; flex-wrap: wrap; }
.inv-fields input.qty { width: 6em; }
.inv-fields input.price { width: 8em; }
.inv-pick { display: grid; gap: 6px; align-content: start; }
.inv-pick input[type=search] { width: 100%; }
label.pick-option { display: flex; flex-direction: row; align-items: center; cursor: pointer; color: var(--text); font-size: .95rem; }
.pick-option > input { flex: none; margin: 0; }
.pick-option > a { flex: none; padding: 4px 6px; }
.pick-option:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-soft); }
.inv-other { gap: 4px 18px; flex-wrap: wrap; }
.ok-text { color: #1f6b3a; }
.warn-text { color: var(--warn); }
pre.pdf-text { white-space: pre; overflow: auto; max-height: 420px; font-size: .72rem; }
@media (max-width: 760px) { .inv-line { grid-template-columns: 1fr; } }
/* Kody kreskowe z opakowań */
.code-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.code-tools form, form.inline { display: inline; margin: 0; }
.code-unknown { border-left: 4px solid var(--accent); }
.code-pending { margin-bottom: 10px; gap: 8px; }
.scanner-manual { display: flex; gap: 6px; margin-top: 8px; }
.scanner-manual input { flex: 1; min-width: 0; }
/* Półki: gdzie leży towar */
.shelf-info { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.shelf-form { gap: 6px; }
.shelf-history ul { margin: 4px 0 0; padding-left: 18px; font-size: .88rem; }
.shelf-tag { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 0 6px; }
.quick-shelf { margin-top: 8px; gap: 8px; }
.shelf-current-box { text-align: center; }
.shelf-current { font-size: 2.6rem; font-weight: 800; letter-spacing: .02em; line-height: 1.2; }
.big-scan { width: 100%; font-size: 1.15rem; padding: 14px; }
.shelf-log { display: grid; gap: 6px; margin-top: 10px; }
.shelf-log .item { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.shelf-log .item.err { border-color: #f1b5b5; background: var(--error-soft); }
.shelf-log .item .thumb { width: 44px; height: 44px; }
.shelf-labels.a4 { display: grid; grid-template-columns: repeat(2, 1fr); }
.shelf-label { border: 1px dashed #bbb; padding: 8px; text-align: center; break-inside: avoid; page-break-inside: avoid; background: #fff; color: #000; }
.shelf-labels.a4 .shelf-label { height: 45mm; display: flex; flex-direction: column; justify-content: center; }
.shelf-label-name { font-size: 34px; font-weight: 800; line-height: 1.1; }
.shelf-label-code svg { max-width: 100%; height: auto; }
.shelf-label-hint { font-size: 10px; color: #555; letter-spacing: .12em; }
.shelf-labels.label .shelf-label { width: 94mm; height: 140mm; margin: 0 auto 6mm; display: flex; flex-direction: column; justify-content: center; page-break-after: always; break-after: page; }
.shelf-labels.label .shelf-label-name { font-size: 60px; }
@media print { .shelf-label { border-color: #ddd; } main { max-width: none !important; padding: 0 !important; } }

/* Liczenie w trakcie pakowania */
.count-info { border-left: 4px solid var(--accent); }
.unpacked-note { font-size: .85rem; margin-top: 4px; padding: 4px 8px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); }
/* Przyjęcie ze zdjęciem */
.intake-form { display: grid; gap: 10px; max-width: 760px; }
.intake-form .row { flex-wrap: wrap; gap: 8px; }
.photo-btn { position: relative; overflow: hidden; }
.photo-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-list { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-list:empty { display: none; }
.photo-item { position: relative; }
.photo-item img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.photo-item button { position: absolute; top: 2px; right: 2px; padding: 2px 6px; background: #fff; }
fieldset.choice { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 0; display: grid; gap: 4px; }
fieldset.choice legend { font-weight: 600; padding: 0 4px; }
fieldset.choice label { display: flex; flex-direction: row; gap: 8px; align-items: center; color: var(--text); font-size: .95rem; }
.intake-chosen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); border: 2px solid var(--accent); }
.intake-chosen[hidden], .intake-suggest:empty { display: none; }
.intake-suggest { display: grid; gap: 6px; }
.intake-option { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.intake-option .thumb { width: 56px; height: 56px; flex: none; }
.intake-option .info { flex: 1; min-width: 0; }
.intake-option .name { font-weight: 600; overflow-wrap: anywhere; }
.small { font-size: .85rem; }
.intake-list { display: grid; gap: 8px; }
.intake-row { display: flex; gap: 12px; align-items: flex-start; }
.intake-row:target { border: 2px solid var(--accent); }
.intake-pics { display: flex; gap: 4px; flex: none; flex-wrap: wrap; max-width: 210px; }
.intake-pics img { width: 100px; height: 100px; object-fit: cover; border-radius: 6px; display: block; }
.intake-pics .thumb.empty { width: 100px; height: 100px; }
.intake-info { min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .intake-row { flex-direction: column; }
  .intake-pics { max-width: none; }
  .intake-pics img, .intake-pics .thumb.empty { width: 76px; height: 76px; }
}
/* Lista produktów na telefonie: karty zamiast szerokiej tabeli - pole „Na półce” pod nazwą */
@media (max-width: 700px) {
  .table-wrap:has(table.products-table) { overflow-x: visible; }
  table.products-table thead { display: none; }
  table.products-table, table.products-table tbody { display: block; width: 100%; }
  table.products-table tr { display: grid; grid-template-columns: auto 64px minmax(0, 1fr) auto; gap: 6px 10px;
    grid-template-areas: "check img name name" "check img stock avail" "check img offers counted";
    padding: 10px 8px; border-bottom: 1px solid var(--line); align-items: center; }
  table.products-table td { display: block; padding: 0; border: 0; text-align: left; }
  table.products-table td[colspan] { grid-column: 1 / -1; }
  table.products-table td.c-check { grid-area: check; align-self: start; }
  table.products-table td.c-img { grid-area: img; align-self: start; width: auto !important; }
  table.products-table td.c-img .thumb { width: 64px; height: 64px; }
  table.products-table td.c-name { grid-area: name; overflow-wrap: anywhere; }
  table.products-table td.c-stock { grid-area: stock; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  table.products-table td.c-stock input.stock-edit { width: 5.5em; font-size: 1.15rem; padding: 6px 8px; }
  table.products-table td.c-stock .stock-msg { flex-basis: 100%; }
  table.products-table td.c-avail { grid-area: avail; text-align: right; }
  table.products-table td.c-offers { grid-area: offers; }
  table.products-table td.c-counted { grid-area: counted; text-align: right; }
  table.products-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
  table.products-table td.c-avail::before { display: block; }
}
/* Policzony niedawno: dolicz (kolejna półka) czy popraw */
.recount-ask { margin-top: 8px; padding: 10px; border-radius: 8px; background: var(--warn-soft); border: 1px solid #f0d9a8;
  display: grid; gap: 8px; font-size: .95rem; text-align: left; }
.recount-ask .row { flex-wrap: wrap; gap: 6px; }
td .recount-ask { flex-basis: 100%; }
/* Ekran startowy pracownika (telefon): duże kafelki */
.start-hello { margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { display: grid; gap: 4px; align-content: start; padding: 16px; min-height: 120px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.tile:hover, .tile:active { border-color: var(--accent); text-decoration: none; }
.tile.wide { grid-column: 1 / -1; min-height: 0; border-left: 5px solid var(--accent); }
.tile-icon { font-size: 2rem; line-height: 1; }
.tile strong { font-size: 1.1rem; }
.tile-sub { color: var(--muted); font-size: .9rem; }
.tile .progress { display: block; margin-top: 6px; }
.tile .progress > span { display: block; height: 100%; background: #3fbfa6; }
.start-more { margin-top: 16px; }
@media (max-width: 420px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 14px; min-height: 110px; }
}
/* Dziś policzone */
.today-list { display: grid; gap: 8px; }
.today-row { display: flex; gap: 12px; align-items: flex-start; }
.today-row .thumb { width: 64px; height: 64px; flex: none; }
.today-row .info { min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
.today-row ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .88rem; }
/* Lista produktów na telefonie: przycisk szukania zawsze pod kciukiem */
.fab-search { display: none; }
@media (max-width: 700px) {
  .fab-search { display: flex; align-items: center; justify-content: center; position: fixed; right: 16px; bottom: 96px;
    width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1.5rem; z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
  .fab-search:hover { text-decoration: none; }
}
@media (max-width: 700px) {
  /* Na telefonie pytanie "dolicz czy popraw" wysuwa się na dole ekranu, nad wszystkim */
  .recount-ask { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 40; font-size: 1rem;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .28); }
  .recount-ask .btn { flex: 1 1 auto; }
}
.recount-ask { white-space: normal; }
.recount-ask .row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.recount-ask .row .btn:first-child { grid-column: 1 / -1; }
/* Oferta na Allegro jednym kliknięciem (mały przycisk z nazwą konta) */
a.badge.offer-link { color: var(--text); border: 1px solid var(--line); }
a.badge.offer-link:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); text-decoration: none; }
.badge.offer-on, a.badge.offer-link.offer-on { background: var(--ok-soft); color: #1f6b3a; border: 1px solid #b7dfc4; }
.badge.offer-ended, a.badge.offer-link.offer-ended { background: var(--error-soft); color: var(--error); border: 1px solid #f4c4be; }
.badge.offer-draft { background: var(--warn-soft); color: var(--warn); border: 1px dashed #e9c27a; }
.badge.offer-gone { background: #eef0f3; color: var(--muted); border: 1px solid var(--line); text-decoration: line-through; }
a.badge.offer-link.offer-on:hover, a.badge.offer-link.offer-ended:hover { filter: brightness(.95); border-color: currentColor; }
.offer-legend { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-left: 12px; }
/* Pomyłka w paczce */
.wrong-item { margin: 12px 0; }
.wrong-item summary { cursor: pointer; }
.wrong-form { display: grid; gap: 10px; margin-top: 10px; max-width: 640px; }
.pick-results { display: grid; gap: 4px; }
.pick-row { display: flex; gap: 8px; align-items: center; text-align: left; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; font: inherit; }
.pick-row:hover { border-color: var(--accent); }
.pick-row .thumb { width: 40px; height: 40px; flex: none; }
.pick-chosen { padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); border: 2px solid var(--accent); }
/* Naklejki z kodem produktu */
.product-labels { background: #fff; }
.product-label { background: #fff; color: #000; text-align: center; overflow: hidden; display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 1mm; break-inside: avoid; page-break-inside: avoid; border: 1px dashed #ccc; }
.product-label .pl-name { font-size: 9pt; line-height: 1.15; max-height: 2.4em; overflow: hidden; }
.product-label .pl-code svg { max-width: 100%; height: auto; display: block; }
.product-label .pl-text { font-size: 9pt; }
.product-labels.a4 { display: grid; grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37mm; width: 210mm; }
.product-labels.a4 .product-label { padding: 2mm 3mm; }
.product-labels.small .product-label { width: 50mm; height: 30mm; padding: 1mm 2mm; break-after: page; page-break-after: always; }
.product-labels.small .pl-name { font-size: 7pt; }
.product-labels.big .product-label { width: 92mm; height: 140mm; margin: 0 auto; padding: 4mm; break-after: page; page-break-after: always; }
.product-labels.big .pl-name { font-size: 18pt; max-height: 4.8em; }
.product-labels.big .pl-text { font-size: 22pt; }
@media print { .product-label { border: 0; } main { max-width: none !important; padding: 0 !important; margin: 0 !important; } }
/* Sortowanie listy produktów */
.sort-form { margin-left: 12px; }
.sort-form select { padding: 4px 8px; font-size: .9rem; }
.inline-label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); }
a.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
a.sort-link:hover { color: var(--accent); }
/* FEST Profit (zakładka testowa) */
.fp-head p { margin: 6px 0; }
.fp-settings { gap: 8px; flex-wrap: wrap; }
.fp-list { display: grid; gap: 10px; }
.fp-row { display: grid; grid-template-columns: 1fr auto 1.2fr; gap: 12px; align-items: start; }
.fp-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fp-arrow { font-size: 1.4rem; color: var(--muted); align-self: center; }
.fp-product { gap: 8px; flex-wrap: nowrap; }
.fp-product a { overflow-wrap: anywhere; }
.fp-actions { gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.fp-suggest { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 8px; background: var(--accent-soft); }
.fp-other summary { cursor: pointer; color: var(--accent); }
.fp-other form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.fp-changes { display: grid; gap: 8px; }
.fp-change { display: flex; flex-direction: column; gap: 4px; }
.price-info { margin-top: 6px; }
table.fp-offers td { vertical-align: top; }
@media (max-width: 700px) {
  .fp-row { grid-template-columns: 1fr; }
  .fp-arrow { transform: rotate(90deg); justify-self: center; }
}
/* Bestsellery, Od wczoraj, Bez sprzedaży */
.best-list { display: grid; gap: 8px; }
.best-row { display: grid; grid-template-columns: 2.2em 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; }
.best-row .thumb { width: 64px; height: 64px; }
.best-rank { font-size: 1.3rem; font-weight: 700; color: var(--muted); text-align: center; }
.best-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.best-num { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.best-num .num { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.changes-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-bottom: 12px; }
.changes-grid .card h3 { margin-top: 0; }
.change-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 8px;
  padding: 5px 0; border-bottom: 1px solid var(--line); }
.change-row .cr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.change-row .cr-reason { grid-column: 2 / -1; }
.change-row:last-child { border-bottom: 0; }
.best-top { margin: 8px 0 0; display: grid; gap: 6px; }
.best-top .row { gap: 8px; flex-wrap: nowrap; }
.best-top .row > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 700px) {
  .best-row { grid-template-columns: 1.6em 52px minmax(0, 1fr); }
  .best-row .thumb { width: 52px; height: 52px; }
  .best-num { grid-column: 3; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; }
  .best-num .num { font-size: 1.3rem; }
}
/* Plan zakupów (Dokup) na telefonie: karty */
@media (max-width: 700px) {
  .table-wrap:has(table.plan-table) { overflow-x: visible; }
  table.plan-table thead { display: none; }
  table.plan-table, table.plan-table tbody { display: block; width: 100%; }
  table.plan-table tr { display: grid; grid-template-columns: 24px 48px repeat(3, minmax(0, 1fr)); gap: 6px 10px;
    padding: 10px 6px; border-bottom: 1px solid var(--line); align-items: center; }
  table.plan-table td { display: block; padding: 0; border: 0; text-align: left; }
  table.plan-table td[colspan] { grid-column: 1 / -1; }
  table.plan-table td.c-check { grid-row: span 3; align-self: start; }
  table.plan-table td.c-img { grid-row: span 3; align-self: start; }
  table.plan-table td.c-img .thumb { width: 48px; height: 48px; }
  table.plan-table td.c-name { grid-column: 3 / -1; overflow-wrap: anywhere; }
  table.plan-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .75rem; }
  table.plan-table td.c-ordered:empty, table.plan-table td.c-pack:empty { display: none; }
  table.plan-table td.c-check, table.plan-table td.c-img { grid-row: 1 / span 4; }
  table.plan-table td.c-qty { grid-column: 3 / -1; }
  table.plan-table td.c-qty input.qty { width: 5em; font-size: 1.1rem; }
}
/* Tabele pracownika na telefonie jako karty (zamówienia, historia, dostawy, półki) - nic nie ucieka w bok */
td.c-delta.plus { color: #1f6b3a; font-weight: 600; }
td.c-delta.minus { color: var(--error); font-weight: 600; }
@media (max-width: 700px) {
  .table-wrap:has(table.mcards) { overflow-x: visible; border: 0; border-radius: 0; }
  table.mcards { background: transparent; }
  table.mcards thead { display: none; }
  table.mcards, table.mcards tbody { display: block; width: 100%; }
  table.mcards tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
  table.mcards td { display: block; padding: 0; border: 0; text-align: left; white-space: normal; min-width: 0; }
  table.mcards td[colspan] { flex-basis: 100%; }
  table.mcards td.c-full { flex-basis: 100%; }
  table.mcards td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: .8rem; }
  /* Zamówienia: pole wyboru z lewej, termin i status u góry, produkty duże */
  /* Historia: produkt i zmiana w pierwszej linii, reszta drobniej */
  table.moves.mcards td.c-prod { order: 1; flex: 1 1 calc(100% - 5em); overflow-wrap: anywhere; }
  table.moves.mcards td.c-delta { order: 2; margin-left: auto; font-size: 1.2rem; }
  table.moves.mcards td.c-kind { order: 3; font-weight: 600; }
  table.moves.mcards.no-prod td.c-kind { order: 1; flex: 1 1 calc(100% - 5em); }
  table.moves.mcards td.c-loc { order: 4; color: var(--muted); }
  table.moves.mcards td.c-after { order: 5; color: var(--muted); }
  table.moves.mcards td.c-when { order: 6; flex-basis: 100%; font-size: .85rem; color: var(--muted); }
  table.moves.mcards td.c-who { order: 7; flex-basis: 100%; font-size: .85rem; overflow-wrap: anywhere; }
  /* Dostawy: numer i stan u góry */
  table.supply-list.mcards td[data-label] { order: 4; }
  table.supply-list.mcards td.c-num { order: 1; font-size: 1.05rem; }
  table.supply-list.mcards td.c-state { order: 2; margin-left: auto; }
  table.supply-list.mcards td.c-sup { order: 3; flex-basis: 100%; }
  table.supply-list.mcards td.c-go { order: 10; flex-basis: 100%; }
  table.supply-list.mcards td.c-go:empty { display: none; }
  /* Półki */
  table.shelves-table.mcards td.c-name { flex: 1 1 70%; font-size: 1.1rem; white-space: nowrap; }
  table.shelves-table.mcards td.c-go { flex-basis: 100%; }
  table.shelves-table.mcards td.c-go .btn { width: 100%; text-align: center; padding: 8px; }
}
/* Zgłoszenia z magazynu */
.issue-list { display: grid; gap: 8px; }
.issue-row { display: flex; gap: 12px; align-items: flex-start; border-left: 5px solid #e9b44c; }
.issue-row.issue-missing, .issue-row.issue-damaged { border-left-color: var(--error); }
.issue-row.done { border-left-color: #8fd3b0; opacity: .85; }
.issue-row:target { box-shadow: 0 0 0 2px var(--accent); }
.issue-row .thumb { width: 64px; height: 64px; flex: none; }
.issue-icon { font-size: 1.8rem; }
.issue-info { flex: 1; min-width: 0; display: grid; gap: 4px; overflow-wrap: anywhere; }
.issue-actions { gap: 8px; margin-top: 4px; }
.inline-form { gap: 6px; flex-wrap: wrap; margin: 0; }
.issue-form { display: grid; gap: 10px; margin-top: 10px; max-width: 640px; }
.issue-box { margin-top: 10px; }
.issue-box summary { cursor: pointer; color: var(--warn); font-weight: 600; }
.issue-note { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--error-soft); border: 1px solid #f4c4be;
  color: var(--error); display: grid; gap: 2px; }
.issue-note a { color: inherit; text-decoration: underline; }
@media (max-width: 600px) {
  .issue-row .thumb { width: 52px; height: 52px; }
  .inline-form input.mid { flex: 1; min-width: 140px; }
}
/* Zbieranie z półek (lista do kompletowania): dotknij, gdy zebrane */
.pick-progress { position: sticky; top: 52px; z-index: 6; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 12px; margin-bottom: 8px; display: grid; gap: 6px; }
.pick-list { display: grid; gap: 8px; }
.pick-card { display: grid; grid-template-columns: 30px 64px minmax(0, 1fr) auto; gap: 10px; align-items: start;
  margin: 0; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.pick-card .thumb { width: 64px; height: 64px; }
.pick-tick { width: 26px; height: 26px; border: 2px solid #9aa3ae; border-radius: 6px; margin-top: 18px; position: relative; }
.pick-info { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.pick-name { font-size: 1.02rem; }
.pick-qty { text-align: center; min-width: 54px; }
.pick-qty span { display: block; font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.pick-qty small { color: var(--muted); }
.shelf-tag.big { font-size: 1.15rem; padding: 1px 8px; margin-right: 6px; }
.pick-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.pick-card.picked { background: #eef9f1; border-color: #8fd3b0; }
.pick-card.picked .pick-tick { background: #39a96b; border-color: #39a96b; }
.pick-card.picked .pick-tick::after { content: "✓"; color: #fff; font-weight: 700; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.pick-card.picked .pick-name, .pick-card.picked .pick-qty span { text-decoration: line-through; color: var(--muted); }
.pick-card.short { border-color: #f4b9b2; background: var(--error-soft); }
.pick-list.hide-picked .pick-card.picked { display: none; }
.pick-done { font-size: 1.1rem; font-weight: 600; color: #1f6b3a; margin-top: 12px; }
@media (max-width: 600px) {
  .pick-card { grid-template-columns: 26px 52px minmax(0, 1fr) auto; gap: 8px; padding: 10px; }
  .pick-card .thumb { width: 52px; height: 52px; }
  .pick-qty span { font-size: 1.6rem; }
}
@media print {
  .pick-card { break-inside: avoid; border: 1px solid #ccc; }
  .pick-card.picked { background: #fff; }
}
.pick-partial { color: var(--warn); font-weight: 600; }
.pick-card:has(.pick-partial:not([hidden])) { border-color: #f0c36d; background: var(--warn-soft); }
/* Ekran startowy: Skanuj cokolwiek, pilne kafelki, Twoje dziś */
.tile.scan-tile { background: var(--accent); color: #fff; border-color: var(--accent); border-left-color: #0b5247; }
.tile.scan-tile .tile-sub { color: #d7efe9; }
.tile.scan-tile .tile-icon { font-size: 1.6rem; }
.tile.hot { border-color: #f4b9b2; box-shadow: inset 0 -4px 0 var(--error); }
.hot-text { color: var(--error); }
.my-day { margin-top: 12px; }
.intake-order { display: grid; gap: 6px; padding: 8px 10px; border: 1px dashed var(--accent); border-radius: 8px; background: var(--accent-soft); }
.intake-order label { color: var(--text); font-weight: 600; }
.intake-order-card { display: grid; gap: 6px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.chip-group { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* Zwroty do przyjęcia (FEST Zwroty) */
.returns-box summary { cursor: pointer; }
.returns-list { display: grid; gap: 12px; margin-top: 10px; }
.return-row { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.return-row:first-child { border-top: 0; padding-top: 0; }
.return-row.focus { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 4px; }
.returns-box, .return-row { scroll-margin-top: 72px; }  /* link do karty: nie chowa się pod górnym menu */
.return-note { color: var(--warn); font-weight: 600; }
.accept-line { display: grid; gap: 6px; justify-items: start; }
.accept-line .intake-option { justify-self: stretch; }
.accept-part { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.accept-qty { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-weight: 600; }
.accept-qty input { width: 64px; }
.accept-states { display: flex; flex-wrap: wrap; gap: 6px; }
.state-chip { position: relative; flex-direction: row; }
.state-chip input { position: absolute; opacity: 0; pointer-events: none; }
.state-chip span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); font-size: .92rem; cursor: pointer; }
.state-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.state-chip.state-damaged input:checked + span, .state-chip.state-complaint input:checked + span { background: var(--warn); border-color: var(--warn); }
.state-chip.state-missing input:checked + span { background: var(--error); border-color: var(--error); }
.state-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-hint.need { color: var(--error); font-weight: 600; }
@media (max-width: 700px) { .filters .f-account { display: none; } }  /* konto wybierasz chipami wyżej */
.pack-line { flex-wrap: wrap; }
@media (max-width: 600px) {
  .pack-line img { width: 52px; height: 52px; }
  .pack-line .count { min-width: 56px; font-size: 1.3rem; }
}
/* Zwroty z FEST Zwroty */
.fp-returns { display: grid; gap: 8px; }
.fp-return { display: grid; gap: 6px; border-left: 5px solid var(--line); }
.fp-return-accepted { border-left-color: #39a96b; }
.fp-return-accept { border-left-color: #e9b44c; }
.fp-return-errors { border-left-color: var(--error); }
.fp-return-items { display: grid; gap: 4px; }
.fp-return-item { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.unlisted-why { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.unlisted-why .badge { white-space: normal; text-align: left; }
.bundle-rows { display: grid; gap: 10px; margin-bottom: 10px; }
.bundle-row { align-items: flex-end; }
.bundle-row .product-pick { flex: 1; min-width: 240px; display: grid; gap: 6px; }
.badge.offer-channel { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
@media (max-width: 640px) {  /* telefon bez przewijania w bok: Łączenie ofert, etykiety, zgłoszenia, długie przyciski */
  .offer-line { flex-wrap: wrap; }
  .offer-line .info { flex-basis: calc(100% - 100px); }
  .row > .btn, form > .btn { white-space: normal; }
  .issues-card .best-top .row { flex-wrap: wrap; }
}
.grid.wide > * { min-width: 0; }  /* wykres nie rozpycha karty */
.best-top { grid-template-columns: minmax(0, 1fr); }
.issues-card .badge, .issue-info .badge { white-space: normal; }
select, .row > label { max-width: 100%; }  /* długie opcje (np. „Gdy towaru zabraknie”) nie poszerzają strony */

/* Zadania i ogłoszenia */
.bell { position: relative; color: #fff; text-decoration: none; font-size: 1.15rem; padding: 6px 4px; white-space: nowrap; }
.bell:hover { text-decoration: none; }
.bell-count { position: absolute; top: -2px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--error); color: #fff; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; }
.team-toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px);
  background: #14202b; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.team-toast:hover { text-decoration: none; }
.team-form { display: grid; gap: 10px; align-content: start; }
.team-form h3 { margin: 0; }
.team-form textarea, .team-form input:not([type=date]) { width: 100%; }
.announce-row { border-left-color: #6aa7e6; }
.announce-row.unread { box-shadow: 0 0 0 2px #6aa7e6; }
.announce-text, .task-details { white-space: pre-line; }
.announce-card { border-left: 5px solid #6aa7e6; display: grid; gap: 8px; margin-bottom: 10px; }
.announce-card .announce-text { font-size: 1.05rem; font-weight: 600; }
.task-row { border-left-color: #8a7be0; }
.task-row.late, .start-task.late { border-left-color: var(--error); }
.task-finished { opacity: .6; }
.start-tasks { display: grid; gap: 10px; margin-bottom: 10px; border-left: 5px solid #8a7be0; }
.start-task { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); border-left: 3px solid transparent; padding-left: 6px; }
.task-done { gap: 8px; }
.task-done .mid { flex: 1; min-width: 140px; }
.file-btn { cursor: pointer; }
.upcoming-row { color: inherit; border-left-color: #8fd3b0; }
.upcoming-row:hover { text-decoration: none; border-color: var(--accent); }
.upcoming-row.late { border-left-color: var(--error); }
.doc-pics { max-width: none; }
.doc-photos { gap: 12px; }
.doc-photo-form h3 { font-size: 1.05rem; }
.wh-card { display: grid; gap: 8px; align-content: start; }
.wh-card label small { display: block; margin-top: 2px; }

/* Dostawy MAXY w drodze (stan paczki DPD z programu MAXY 9.1) */
.arriving-item { padding: 10px 0; border-top: 1px solid var(--line); }
.arriving-item:first-of-type { border-top: 0; }
.arriving-item.arrived { border-left: 4px solid #2f9a5f; padding-left: 10px; }
.arriving-item.today { border-left: 4px solid #e0a72e; padding-left: 10px; }
.arriving-lines { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 14px; }
.arriving-lines li { display: flex; align-items: center; gap: 8px; }
.arriving-lines .thumb { width: 36px; height: 36px; }
.tracking-box { margin-bottom: 10px; }

/* Zakładka „Zwroty” (zwroty z FEST Profit) */
.nav-count { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--error);
  color: #fff; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; }
.order-number { word-break: break-all; }
.order-search { margin-top: 8px; gap: 8px; }
.order-search input { flex: 1 1 220px; min-width: 0; }
.returns-link { display: block; margin-bottom: 10px; border-left: 5px solid #6aa7e6; color: inherit; }
.returns-link:hover { text-decoration: none; border-color: var(--accent); }
.returns-done { display: grid; gap: 6px; }
.returns-done .card { flex-wrap: wrap; min-width: 0; }
.returns-done .badge { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }

/* Zamówienia (wersja 19): etapy pracy, karty zamówień, grupy według terminu wysyłki */
.order-flow { display: flex; align-items: stretch; gap: 8px; margin: 10px 0 6px; flex-wrap: wrap; }
.flow-step { flex: 1 1 180px; display: grid; gap: 2px; padding: 12px 14px; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; }
.flow-step:hover { text-decoration: none; border-color: var(--accent); }
.flow-step.on { border: 2px solid var(--accent); background: #eef7f4; }
.flow-label { font-weight: 600; }
.flow-num { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.flow-sub { font-size: .85rem; color: var(--muted); }
.flow-sub .count { border-radius: 9px; padding: 0 6px; font-weight: 600; }
.flow-sub .count.hot { background: var(--error); color: #fff; }
.flow-sub .count.warm { background: #ffe7d1; color: #a24a00; }
.flow-arrow { align-self: center; color: var(--muted); font-size: 1.3rem; }
.order-tabs { margin: 6px 0 10px; }
.order-tabs a { padding: 4px 11px; font-size: .92rem; }
.order-actions { gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.order-filters .grow { flex: 1 1 220px; min-width: 0; }
.order-filters .quick-filters { margin: 8px 0 0; }
.more-filters { margin-left: auto; }
.more-filters summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.more-filters .row { gap: 10px; margin-top: 8px; flex-wrap: wrap; align-items: end; }
.order-filters > .more-filters { margin: 10px 0 0; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 12px; margin-top: 8px; }
.filter-grid label { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; color: var(--muted); min-width: 0; }
.filter-grid input, .filter-grid select { width: 100%; min-width: 0; }
.filter-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 0; }
.check-all { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; margin: 0; }
.check-all input { width: 20px; height: 20px; }
.status-menu { position: relative; }
.status-menu summary { list-style: none; }
.status-menu summary::-webkit-details-marker { display: none; }
.status-drop { position: absolute; right: 0; top: 100%; z-index: 6; display: grid; gap: 4px; padding: 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 24px rgba(20, 32, 43, .15); }
.group-head { display: flex; gap: 6px; align-items: baseline; margin: 18px 0 8px; font-size: 1.02rem; }
.group-head.group-late { color: var(--error); }
.group-head.group-today { color: #a24a00; }
.order-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.order-card.row-late { border-left: 5px solid var(--error); }
.oc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.oc-head input[type=checkbox] { width: 20px; height: 20px; }
.oc-head .deadline { margin-top: 0; }
.oc-buyer { font-size: 1.02rem; }
.oc-total { font-weight: 600; }
.oc-items { margin: 8px 0 6px 28px; }
.oc-items .order-item { gap: 10px; }
.oc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-left: 28px; font-size: .9rem;
  padding-top: 6px; border-top: 1px dashed var(--line); }
.oc-label { white-space: nowrap; }
@media (max-width: 640px) {
  .flow-arrow { display: none; }
  .order-flow { gap: 6px; }
  .flow-step { flex: 1 1 0; min-width: 0; padding: 8px 9px; }
  .flow-label { font-size: .85rem; line-height: 1.2; }
  .flow-num { font-size: 1.45rem; }
  .flow-sub { font-size: .76rem; }
  .oc-items, .oc-foot { margin-left: 0; }
  .oc-items .order-item img.thumb.small { width: 52px; height: 52px; }
  .oc-items .order-item img.thumb.small:hover { transform: none; box-shadow: none; }
  .more-filters { margin-left: 0; flex-basis: 100%; }
}
.stage-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 12px; }
.stage { padding: 3px 10px; border-radius: 12px; background: #eef0f3; color: var(--muted); font-size: .9rem; }
.stage.on { background: var(--accent); color: #fff; font-weight: 600; }
.stage.done { background: #e3f6e8; color: #1e7a3c; }
.stage-arrow { color: var(--muted); }

/* Plan pracy (wersja 19) */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.plan-card h2 { margin: 0 0 6px; }
.plan-big { font-size: 1.7rem; font-weight: 700; line-height: 1.2; margin: 2px 0 6px; }
.plan-big small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.plan-next { border: 2px solid var(--accent); background: #eef7f4; }
.plan-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.plan-day { display: grid; gap: 2px; }
.plan-day.busy { border-color: var(--error); }
.plan-num { font-size: 1.6rem; font-weight: 700; }
.plan-how { margin-top: 14px; }
.plan-how summary { cursor: pointer; }
.plan-settings { margin-top: 14px; }
.plan-settings .row { gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 10px; }
.plan-days { align-items: center !important; }
.inline-check { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; margin: 0; }
.plan-mini { display: grid; gap: 6px; margin: 0 0 14px; color: var(--text); border-left: 5px solid var(--accent); }
.plan-mini:hover { text-decoration: none; border-color: var(--accent); }
.plan-mini-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.plan-mini-label { min-width: 92px; font-weight: 700; }
.plan-come { color: var(--accent); font-size: 1.05rem; }
.plan-mini-more { color: var(--accent); }

/* Programy FEST (wersja 19.1) */
.program-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.program-tile { display: grid; gap: 4px; align-content: start; color: var(--text); }
a.program-tile:hover { text-decoration: none; border-color: var(--accent); }
.program-tile strong { font-size: 1.05rem; }
.program-tile small { color: var(--muted); }
.program-tile.here { border-color: var(--accent); background: #f3faf8; }
.program-tile.here .badge { justify-self: start; }
.program-tile.missing { opacity: .55; }
.programs-edit input { width: 100%; min-width: 120px; }
.programs-edit form + form { margin-top: 8px; }
.ext { font-size: .8em; color: var(--muted); }

/* Plan pracy z licznika pakowania (wersja 19.1) */
.plan-counter { margin-top: 14px; }
.plan-counter h2 { margin-top: 0; }
.plan-counter h3 { margin: 14px 0 6px; font-size: 1rem; }
.plan-workers tr.me td { background: #eef7f4; font-weight: 600; }
.plan-import { margin-top: 10px; }
.plan-import form { gap: 12px; }
@media (max-width: 760px) {
  table.plan-workers thead { display: none; }
  table.plan-workers, table.plan-workers tbody { display: block; }
  table.plan-workers tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px;
    padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.plan-workers td { display: block; padding: 0; border: 0; text-align: left; }
  table.plan-workers td:first-child { grid-column: 1 / -1; font-weight: 600; }
  table.plan-workers td[data-label]:not(:first-child)::before { content: attr(data-label); display: block;
    color: var(--muted); font-size: .75rem; }
  table.plan-usual .c-days { display: none; }
  table.plan-usual th, table.plan-usual td { padding-left: 6px; padding-right: 6px; }
}

/* Plan pracy: zmiany i „przyjdź wcześniej” (wersja 20) */
.plan-day.early { border-color: #d4a017; }
.plan-shifts td, .plan-shifts th { padding: 4px 10px 4px 0; }
.plan-shifts input[type="time"] { width: 110px; }

/* Akcje na ofertach (wersja 20) */
.offer-actions { gap: 8px; margin: 6px 0; }
.offer-actions .inline-price { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; font-size: .9rem; }
.offer-actions .inline-price input { width: 90px; }
.bulk-offers { gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }

/* Na stanie bez oferty i wystawianie (wersja 20) */
.prod-cell { display: flex; gap: 10px; align-items: center; }
.prod-cell .thumb { width: 48px; height: 48px; }
.unlisted-table td.acc-state { min-width: 140px; }
.unlisted-table td.acc-state .btn { margin-top: 4px; }
.bulk-unlisted { gap: 10px; margin-bottom: 10px; position: sticky; top: 0; z-index: 2; }
.search-row { margin-bottom: 10px; }
.listing-common h2 { margin-top: 0; }
.listing-common .row { gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 10px; }
.listing-common select { max-width: 280px; }
.listing-common textarea { width: 100%; min-width: 260px; }
.listing-table .title-input { width: 100%; min-width: 240px; }
.listing-table .price-input { width: 90px; }
.listing-table tr.row-off td { opacity: .6; }
.listing-submit { gap: 14px; margin-top: 12px; }
ul.plain { list-style: none; padding: 0; }
ul.plain li { padding: 4px 0; border-bottom: 1px solid var(--line); }

/* Zamówienia - tabela jak w Apilo (wersja 20) */
.view-switch { display: inline-flex; gap: 6px; margin-right: 8px; }
.apilo-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 10px; }
.status-side { position: sticky; top: 64px; padding: 10px; }
.status-side h3 { margin: 0 0 8px; font-size: 1rem; }
.side-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 8px; color: var(--text); }
.side-item:hover { background: var(--accent-soft); text-decoration: none; }
.side-item.on { background: var(--accent); color: #fff; }
.side-item.sub { padding-left: 22px; font-size: .9rem; }
.side-count { min-width: 34px; text-align: center; border-radius: 6px; padding: 1px 6px; font-size: .8rem; font-weight: 600;
  background: #e9eef0; color: var(--text); }
.side-count.hot { background: var(--error); color: #fff; }
.side-count.warm { background: #e8a33d; color: #fff; }
.side-count.err { background: #4a4f55; color: #fff; }
.side-item.on .side-count { background: #fff; color: var(--accent); }
.side-note { margin: 10px 4px 0; }
.apilo-bar { position: sticky; top: 52px; z-index: 3; background: var(--bg); padding: 6px 0; gap: 8px; }
.apilo-table td { vertical-align: top; }
.apilo-table .c-items { min-width: 260px; }
.apilo-table .order-item { display: flex; gap: 8px; margin-bottom: 6px; }
.apilo-table .order-no { font-weight: 600; word-break: break-all; }
.apilo-table .c-actions { min-width: 180px; }
.apilo-table .c-total { white-space: nowrap; font-weight: 600; }
.ship-btn, a.ship-btn { display: block; text-align: center; margin-bottom: 6px; background: #1e8e5a; border-color: #1e8e5a;
  color: #fff; }
.ship-btn:hover { background: #17734a; text-decoration: none; }
.action-links { gap: 4px; flex-wrap: wrap; }
.order-icons { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
@media (max-width: 900px) {
  .apilo-layout { grid-template-columns: 1fr; }
  .status-side { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .status-side h3, .status-side .side-note { display: none; }
  .side-item.sub { padding-left: 8px; }
}
@media (max-width: 760px) {
  table.apilo-table thead { display: none; }
  table.apilo-table, table.apilo-table tbody { display: block; width: 100%; }
  table.apilo-table tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr); gap: 6px 10px;
    padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); }
  table.apilo-table td { display: block; border: 0; padding: 0; }
  table.apilo-table td.c-items, table.apilo-table td.c-actions, table.apilo-table td.c-delivery { grid-column: 2 / -1; }
  table.apilo-table td.c-buyer { grid-column: 2; }
  table.apilo-table td.c-total { grid-column: 3; text-align: right; }
  .apilo-bar { position: static; }  /* na telefonie pasek nie zasłania listy */
}
main.wide { max-width: 1680px; }
.apilo-table .c-order { min-width: 120px; }
.apilo-table .c-date { min-width: 140px; }

/* Dostawy w etapach i trasa paczki (wersja 21) */
.stage-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; }
.stage-col { background: #eef1f4; border-radius: 12px; padding: 10px; min-height: 120px; }
.stage-col h2 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 6px; }
.stage-col h2 .count { background: #fff; border-radius: 10px; padding: 0 8px; font-size: .85rem; }
.stage-col.stage-arrived { background: #e3f3ea; }
.stage-col.stage-today { background: #fdf3df; }
.stage-hint { margin: 2px 0 8px; }
.stage-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  margin-bottom: 8px; box-shadow: 0 1px 2px rgba(20, 32, 43, .05); }
.stage-card.late { border-left: 4px solid var(--error); }
.stage-card.problem { border-left: 4px solid var(--error); background: #fff6f6; }
.stage-card .track-line { margin-top: 4px; }
.stage-actions { gap: 8px; margin-top: 6px; }
.stage-empty { margin: 4px 2px; }
@media (max-width: 1100px) { .stage-board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .stage-board { grid-template-columns: 1fr; }
  .stage-col { min-height: 0; }
  .stage-col:has(.stage-empty) .stage-hint { display: none; }
}
.trasa h3 { margin: 12px 0 6px; font-size: 1rem; }
/* etapy dostawy (lista) - tylko ol.steps; .card.steps na Pulpicie to lista kroków jedna pod drugą */
ol.steps { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 10px 0; counter-reset: step; }
.steps li { flex: 1 1 90px; text-align: center; padding: 6px 4px; border-radius: 8px; background: #eef1f4;
  color: var(--muted); font-size: .85rem; }
.steps li.done { background: var(--accent-soft); color: var(--accent); }
.steps li.now { background: var(--accent); color: #fff; font-weight: 600; }
.parcels li { gap: 8px; padding: 6px 0; }
.timeline { list-style: none; padding: 0 0 0 14px; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 4px 0 6px 6px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 9px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--line); }
.timeline li:first-child::before { background: var(--accent); }
.timeline li.ev-delivered::before { background: #2f9a5f; }
.timeline li.ev-problem::before { background: var(--error); }
.timeline time { min-width: 86px; color: var(--muted); font-variant-numeric: tabular-nums; }
.add-parcel { gap: 10px; align-items: end; flex-wrap: wrap; margin-top: 12px; }
.add-parcel .grow { flex: 1 1 220px; }

/* Użytkownicy: edycja konta (wersja 22) */
.users-table .user-actions { white-space: nowrap; }
.user-edit { display: inline-block; vertical-align: top; }
.user-edit[open] { display: block; white-space: normal; margin-bottom: 6px; }
.user-edit summary { list-style: none; cursor: pointer; }
.user-edit summary::-webkit-details-marker { display: none; }
.user-edit form { gap: 8px; align-items: end; margin-top: 6px; }

/* Przygotuj przesyłkę - jak „Wyślij przesyłkę” w Apilo (wersja 22) */
.ship-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.ship-cols h2 { margin-top: 0; }
.ship-head { display: grid; gap: 4px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.ship-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.ship-fields label { display: flex; }
.ship-fields .wide { grid-column: 1 / -1; }
.ship-fields input, .ship-fields select { width: 100%; }
.ship-point { margin: 8px 0 0; }
.ship-limits { margin: 12px 0; padding: 8px 12px; border-radius: 8px; background: #f6f7f9; }
.ship-limits ul { margin: 4px 0; padding-left: 18px; }
.ship-limits p { margin: 2px 0; }
.ship-parcels input { width: 62px; text-align: right; }
.ship-parcels .btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.ship-parcels td[data-fit] { min-width: 96px; }
.ship-parcels .parcel-no { white-space: nowrap; }
.ship-actions { margin-top: 12px; gap: 10px; }
.ship-done { gap: 10px; margin-bottom: 12px; border-left: 4px solid #2f9a5f; }
.nowrap { white-space: nowrap; }
@media (max-width: 900px) {
  .ship-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {  /* paczki jako karty na telefonie */
  .table-wrap:has(table.ship-parcels) { overflow-x: visible; border: 0; border-radius: 0; }
  table.ship-parcels thead { display: none; }
  table.ship-parcels tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 8px; padding: 10px;
    margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; }
  table.ship-parcels tr[hidden] { display: none; }
  table.ship-parcels td { border: 0; padding: 0; }
  table.ship-parcels .parcel-no { grid-column: 1 / 2; font-weight: 600; align-self: center; }
  table.ship-parcels td.nowrap { grid-column: 2 / -1; }
  table.ship-parcels td[data-label]::before { content: attr(data-label); display: block; color: var(--muted);
    font-size: .75rem; text-align: left; }
  table.ship-parcels input { width: 100%; }
  table.ship-parcels td[data-volume] { grid-column: span 2; text-align: left; }
  table.ship-parcels td[data-fit] { grid-column: span 2; align-self: end; min-width: 0; }
}
@media (max-width: 520px) {
  .ship-fields { grid-template-columns: minmax(0, 1fr); }
  .ship-actions .spacer { display: none; }
  .ship-actions button.btn { flex: 1 1 100%; }
}

/* Nowa dostawa: wyraźne drogi (Ramiz, faktura, zdjęcie, same z hurtowni) - wersja 22 */
.new-delivery h2 { margin: 0 0 8px; font-size: 1.1rem; }
.new-delivery-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px; }
.new-delivery-options .option { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; color: var(--text); text-decoration: none; background: #fff; }
.new-delivery-options .option:hover { border-color: var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.new-delivery-options .option span { color: var(--muted); font-size: .85rem; }
.new-delivery-manual { margin-top: 10px; gap: 10px; align-items: end; }
.doc-steps { margin: 0 0 10px; padding-left: 20px; }
.doc-steps li { margin: 3px 0; }
.doc-card:target { outline: 2px solid var(--accent); outline-offset: 2px; }
.wh-since { margin-top: 8px; gap: 8px; align-items: end; }
.plan-counter .table-wrap + .table-wrap { margin-top: 12px; }

/* Dropshipping (wersja 23) */
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.form-grid > h3 { grid-column: 1 / -1; margin: 8px 0 0; }
.form-grid label input, .form-grid label select { width: 100%; }
.error-text { color: var(--error); }
.drop-line { display: flex; gap: 10px; align-items: flex-start; }
.drop-line img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: #fff; }
.drop-change { white-space: nowrap; }
.filters .row > .grow { flex: 1 1 220px; min-width: 0; }
.form-grid label.check { align-self: center; }
.form-grid label.check input { width: auto; flex: none; margin-top: 3px; }

/* Co jest w paczce (wersja 24) */
.parcel-contents { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.parcel-contents .pc-title { font-size: .95rem; }
.pc-line { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border: 1px solid var(--line, #e3e6ea); border-radius: 8px; background: #fff; }
.pc-line .thumb { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; flex: none; }
.pc-line .pc-empty { display: inline-block; background: #f1f3f5; }
.pc-line .pc-body { flex: 1; min-width: 0; }
.pc-line .pc-qty { font-size: 1.05rem; }
.ship-done .parcel-contents { flex-basis: 100%; }

/* Anulowane w Allegro - nie wysyłaj (wersja 24) */
/* Wersja 25: anulowane zamówienia na liście - czerwony wiersz zamiast dużego komunikatu */
tr.row-cancelled > td { background: #fdecea; }
tr.row-cancelled > td:first-child { box-shadow: inset 4px 0 0 var(--error, #c0392b); }
.order-card.row-cancelled { border: 2px solid var(--error, #c0392b); background: #fdecea; }
.cancel-note { color: var(--error, #c0392b); margin-bottom: 6px; gap: 8px; }
.group-head.group-cancelled { color: var(--error, #c0392b); }

/* Wiadomości Allegro (wersja 25) */
.inbox-filters { margin-bottom: 10px; gap: 6px; flex-wrap: wrap; }
.inbox-list { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.inbox-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; min-height: 52px; }
.inbox-row:last-child { border-bottom: 0; }
.inbox-row:hover { background: #f8f9fb; text-decoration: none; }
.inbox-row .inbox-who { flex: 1; min-width: 0; }
.inbox-row .inbox-when { white-space: nowrap; }
.inbox-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: transparent; }
.inbox-row.unread { background: #f3faf8; }
.inbox-row.unread .inbox-dot { background: var(--accent); }
.inbox-orders { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; }
.chat { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.bubble { max-width: min(560px, 86%); padding: 8px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.bubble.theirs { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.mine { align-self: flex-end; background: var(--accent-soft); border-color: #cfe7e1; border-bottom-right-radius: 4px; }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-meta { font-size: .78rem; color: var(--muted); margin-top: 3px; text-align: right; }
.chat-reply { margin-bottom: 12px; }
.chat-end { display: block; height: 1px; scroll-margin-bottom: 70px; }  /* nad dolnym paskiem telefonu */
.chat-reply textarea { width: 100%; font-size: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 760px) {
  .bubble { max-width: 92%; }
}

/* Scalanie produktów (wersja 26) */
.merge-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: .9rem; }
.merge-summary { border: 2px solid var(--accent); background: var(--accent-soft); }
.merge-summary ul { margin: 0; padding-left: 4px; list-style: none; }
.merge-summary li { margin: 4px 0; }
.merge-summary ul ul { padding-left: 22px; list-style: disc; }

/* Funkcje programu (wersja 26) */
.features .feature-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.features .feature-row:first-of-type { border-top: 0; }
.features .feature-text { flex: 1; min-width: 0; }
.features .feature-ctl { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.switch { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }
@media (max-width: 640px) { .features .feature-row { flex-direction: column; align-items: flex-start; } }

/* Mały licznik pakowania (wersja 27) - prawy dolny róg, tylko komputer */
.mini-counter { position: fixed; right: 14px; bottom: 14px; z-index: 40; width: 250px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 6px 24px rgba(20, 32, 43, .18); font-size: .9rem; }
.mini-counter[hidden] { display: none; }
.mini-counter .mc-toggle { display: flex; gap: 6px; align-items: center; width: 100%; padding: 8px 10px; background: var(--accent); color: #fff;
  border: 0; border-radius: var(--radius) var(--radius) 0 0; cursor: pointer; font: inherit; text-align: left; }
.mini-counter .mc-toggle b { font-size: 1.05rem; }
.mini-counter .mc-who { opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-counter .mc-body { padding: 8px 10px 10px; }
.mini-counter .mc-row { display: flex; gap: 6px; align-items: center; margin: 0 0 8px; }
.mini-counter .mc-row select { flex: 1; min-width: 0; padding: 4px 6px; }
.mini-counter .mc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mini-counter .mc-grid div { background: var(--bg, #f4f6f8); border-radius: 6px; padding: 6px; text-align: center; }
.mini-counter .mc-grid b { display: block; font-size: 1.2rem; }
.mini-counter .mc-grid small { color: var(--muted); }
.mini-counter .mc-foot { margin-top: 8px; color: var(--muted); }
.mini-counter.closed { width: auto; }
.mini-counter.closed .mc-body { display: none; }
.mini-counter.closed .mc-toggle { border-radius: var(--radius); }
.mini-counter:not(.closed) .mc-toggle .mc-who, .mini-counter:not(.closed) .mc-toggle b { display: none; }
.mini-counter:not(.closed) .mc-toggle::after { content: 'Licznik pakowania'; }
@media (max-width: 760px) { .mini-counter { display: none !important; } }
@media print { .mini-counter { display: none !important; } }
body:has(.mini-counter:not([hidden]):not(.closed)) main { padding-bottom: 190px; }
/* Wszystkie przesyłki (wersja 27): trasa paczki pod stanem */
details.track summary { cursor: pointer; color: var(--muted); max-width: 340px; }
.track-events { margin: 4px 0 0; padding-left: 18px; font-size: .85rem; max-height: 220px; overflow: auto; }
.track-events li { margin: 2px 0; }
/* Kiedy ludzie kupują (wersja 27): siatka dzień × godzina */
.heatmap { font-size: .8rem; }
.heatmap th, .heatmap td { padding: 4px 3px; text-align: center; min-width: 26px; }
.heatmap td.hm-0 { background: transparent; }
.heatmap td.hm-1 { background: #e6f0fa; }
.heatmap td.hm-2 { background: #c3daf2; }
.heatmap td.hm-3 { background: #8fbbe6; }
.heatmap td.hm-4 { background: #4f92d4; color: #fff; }
.heatmap td.hm-5 { background: #1f6bb8; color: #fff; }
/* Kalendarz wydarzeń (wersja 27) */
.event-card.event-now { border-color: var(--ok, #1f6b3a); box-shadow: inset 4px 0 0 #2e9d5b; }
.text-err { color: var(--error); }
.note-ok { background: var(--ok-soft); border: 1px solid #b7e1c4; color: #1f6b3a; padding: 10px 14px; border-radius: var(--radius); }
/* Wymiary produktu (wersja 28) */
.dims-box { margin: 8px 0; }
.dims-box summary { cursor: pointer; }

/* Wersja 29: dopłaty przewoźników */
tr.row-attention td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
.text-ok { color: var(--accent); }
.appeal-group { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.appeal-group:first-of-type { border-top: 0; margin-top: 0; }
.appeal-group textarea { font: inherit; font-size: 13px; margin: 6px 0; }
.surcharge-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; }
.surcharge-facts div span { display: block; }

/* Wersja 30: przenoszenie hurtowni, łączenie ofert, wystawianie z hurtowni */
.match-card .drop-line img, .match-row img, .list-item img { width: 56px; height: 56px; object-fit: contain; border-radius: 6px; background: #fff; flex: none; }
.match-list { margin-top: 8px; }
.match-row { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding: 8px 0; flex-wrap: wrap; }
.match-row .grow { flex: 1 1 260px; min-width: 0; }
.chip.warn { background: var(--warn-soft); }
.chip.ok { background: var(--ok-soft); }
.list-item { display: flex; gap: 10px; align-items: center; }
.label-comment { width: 100%; min-width: 150px; margin-top: 4px; font-size: .85rem; padding: 3px 6px; }
.units-label { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; } .units-help { flex-basis: 100%; }
/* autoresponder (wersja 32): stan teraz, tydzień pracy, dni wolne */
.auto-state.ok { border-left: 4px solid var(--ok, #1f9a46); }
.auto-state.off { border-left: 4px solid var(--warn, #b7791f); }
.auto-week { display: grid; grid-template-columns: max-content max-content auto max-content; justify-content: start; gap: 4px 8px; align-items: center; }
.auto-week .auto-day { margin: 0; }
.form-stack h3 { margin: 16px 0 6px; font-size: 1rem; }
.form-stack > label { display: flex; flex-direction: column; margin-top: 6px; }
.form-stack > label.check { flex-direction: row; align-items: center; gap: 6px; }
@media (max-width: 640px) { .auto-week { grid-template-columns: max-content auto max-content; } .auto-week .auto-day { grid-column: 1 / -1; } }
/* asystent zbierania (wersja 32) */
.pick-count { display: grid; justify-items: center; gap: 6px; min-width: 96px; }
.pick-bring { display: grid; justify-items: center; font-size: .75rem; color: var(--muted); }
.pick-bring strong { font-size: 1.9rem; line-height: 1; color: var(--text); }
.pick-got { min-width: 30px; text-align: center; font-weight: 700; font-size: 1.1rem; }
.pick-card.done { opacity: .6; }
.pick-card.done .pick-got { color: #1f6b3a; }
.pick-card.flash-hit { box-shadow: 0 0 0 3px var(--accent); }
.pick-new label { display: flex; flex-direction: column; font-size: .9rem; }
.steps-help { margin: 0 0 12px; padding-left: 20px; }
.ok-text { color: #1f6b3a; }
/* wygląd listy zamówień (wersja 32) */
.layout-form { display: grid; gap: 4px; min-width: 260px; padding: 10px 12px; }
.layout-form strong { margin-top: 6px; }
.layout-form label { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.layout-form label.check { justify-content: flex-start; }
.apilo-layout.no-side { grid-template-columns: 1fr; }
.side-tabs { margin-bottom: 8px; }
.apilo-layout.compact .apilo-table td, .apilo-layout.compact .apilo-table th { padding: 4px 6px; font-size: .86rem; }
.apilo-layout.compact .apilo-table .thumb.small { width: 30px; height: 30px; }
.apilo-layout.compact .order-item { gap: 6px; }
.apilo-layout.compact .action-links .btn { padding: 2px 6px; }
.product-focus { gap: 10px; }

/* Wersja 32: Erli i Empik przez API */
.channel-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 10px 0; }
.channel-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.channel-stats strong { font-size: 1.3em; }

/* Wersja 32: karta „Zbieraj i pakuj” - zdjęcie, opis, licznik (bez kratki do odhaczania z listy zbierania) */
.pick-card.batch-card { grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; }
.pick-card.batch-card .thumb.empty { display: grid; place-items: center; width: 64px; height: 64px; font-size: .75rem; color: var(--muted); }
@media (max-width: 600px) {
  .pick-card.batch-card { grid-template-columns: 52px minmax(0, 1fr); }
  .pick-card.batch-card .thumb.empty { width: 52px; height: 52px; }
  .pick-card.batch-card .pick-count { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
  .pick-card.batch-card .pick-bring { display: flex; gap: 6px; align-items: baseline; }
}

/* Wersja 34: „Przygotuj przesyłkę” na jednym ekranie - nagłówek ze strzałkami, trzy kolumny, przycisk zawsze widoczny */
.ship-top, .order-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; }
.ship-top h1 { margin: 0; font-size: 1.25rem; }
.ship-top .order-no { font-size: 1.05rem; }
.order-nav { display: inline-flex; align-items: center; gap: 6px; }
.order-nav [aria-disabled="true"] { opacity: .45; pointer-events: none; }
.ship-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.ship-grid > .card { margin: 0; padding: 12px 14px; }
.ship-grid h2 { margin: 0 0 8px; font-size: 1.05rem; }
.ship-grid h3 { margin: 10px 0 6px; font-size: .98rem; }
.ship-grid .parcel-contents { margin: 0; }
.ship-grid .ship-fields { gap: 6px 10px; }
.ship-what .note-warn, .ship-what .ship-point { margin: 8px 0 0; }
@media (min-width: 901px) {
  .ship-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .ship-grid .ship-what { grid-column: 1 / -1; }
}
@media (min-width: 1280px) {
  .ship-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1.05fr); }
  .ship-grid .ship-what { grid-column: auto; }
}
details.ship-limits { margin: 8px 0 0; padding: 6px 10px; }
details.ship-limits summary { cursor: pointer; font-weight: 600; }
.ship-sticky { position: sticky; bottom: 0; z-index: 30; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0; padding: 10px 14px; margin-top: 12px; box-shadow: 0 -6px 16px rgba(16, 24, 40, .08); }
.btn.big { padding: 11px 26px; font-size: 1.08rem; font-weight: 700; }
.ship-create { min-width: 220px; }
@media (min-width: 761px) { body:has(.mini-counter:not([hidden])) .ship-sticky { padding-right: 280px; } }
.ship-again { margin: 4px 0 10px; }
.ship-again[open] > summary { margin-bottom: 8px; }

/* Znaczek platformy zamówienia (wersja 34) */
.plat { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-weight: 700;
  font-size: .78rem; line-height: 1.55; color: #fff; white-space: nowrap; vertical-align: middle; }
.plat b { background: rgba(255, 255, 255, .28); border-radius: 4px; padding: 0 4px; font-size: .72rem; }
.plat-allegro { background: #ff5a00; }
.plat-erli { background: #6b2fd1; }
.plat-empik { background: #d4161d; }
.plat-other { background: #5b6470; }
.plat-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 2px 0; }
h1 .plat { font-size: .85rem; }

/* v34: Księgowość */
.ks-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.ks-head h1 { margin: 0; }
.ks-monthnav { display: inline-flex; align-items: center; gap: 4px; }
.ks-monthnav input[type=month] { width: auto; padding: 4px 8px; }
.ks-monthnav .btn { padding: 4px 10px; }
.ks-cols { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 12px; }
.ks-cols > .card { margin-bottom: 0; min-width: 0; overflow-x: auto; }
@media (min-width: 1000px) { .ks-cols { grid-template-columns: 1fr 1fr; } }
.ks-checks { list-style: none; margin: 0; padding: 0; }
.ks-checks li { padding: 6px 8px; border-radius: 6px; margin-bottom: 4px; }
.ks-checks li.lvl-error { background: var(--error-soft); color: var(--error); }
.ks-checks li.lvl-warn { background: var(--warn-soft); color: var(--warn); }
.ks-checks li.lvl-info { background: var(--accent-soft); }
.ks-checks li.lvl-ok { color: #1f6b3a; }
.ks-checks li.lvl-wait { background: var(--line); } /* v42: miesiąc trwa - zwykły stan, bez czerwieni */
.ks-bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin: 6px 0; }
.ks-bar span { display: block; height: 100%; background: var(--accent); }
.ks-bar span.warn { background: #e0a030; }
.ks-bar span.err { background: var(--error); }
.ks-table td { vertical-align: top; }
.ks-table tr.muted td { color: var(--muted); }
.ks-table tr.row-check td { background: var(--warn-soft); }
.ks-ksef { padding: 10px 14px; }
.ks-bulk { position: sticky; bottom: 0; z-index: 20; box-shadow: 0 -2px 10px rgba(0, 0, 0, .08); }
.ks-expert { margin-top: 16px; }
.ks-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.ks-steps a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); }
.ks-steps a:hover { text-decoration: none; border-color: var(--accent); }
.ks-steps a span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line); font-size: .8rem; font-weight: 700; }
.ks-steps a.done span { background: var(--ok-soft); color: #1f6b3a; }
.ks-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.ks-choice { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; flex: 1 1 260px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-weight: normal; cursor: pointer; }
.ks-choice input { width: auto; margin: 0; }
.ks-choice small { flex-basis: 100%; }
.ks-choice:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-soft); padding: 7px 11px; }


/* Wersja 35: centrum powiadomień - dzwonek z listą i strona „Powiadomienia” */
.bell-wrap { position: relative; display: flex; align-items: center; }
.notice-drop { position: absolute; right: -60px; top: calc(100% + 8px); width: 380px; max-height: 70vh; overflow: auto; z-index: 60;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 25, 35, .22); }
.notice-drop .nd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); }
.notice-drop .nd-read { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: .85rem; padding: 0; }
.notice-drop .nd-item { display: flex; gap: 10px; padding: 9px 14px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.notice-drop .nd-item:hover { background: #f5f7f9; text-decoration: none; }
.notice-drop .nd-item.unread { background: #f1f7ff; }
.notice-drop .nd-item.unread .nd-title { font-weight: 700; }
.notice-drop .nd-icon { font-size: 1.1rem; line-height: 1.3; flex: none; }
.notice-drop .nd-main { display: grid; gap: 1px; min-width: 0; }
.notice-drop .nd-title { overflow-wrap: anywhere; }
.notice-drop .nd-at { color: var(--muted); font-size: .8rem; }
.notice-drop .nd-empty { padding: 16px 14px; color: var(--muted); }
.notice-drop .nd-all { display: block; padding: 10px 14px; text-align: center; font-weight: 600; }
.notice-team { display: flex; gap: 10px; align-items: center; justify-content: space-between; text-decoration: none; color: var(--text); margin-bottom: 12px; }
.notice-team:hover { text-decoration: none; border-color: var(--accent); }
.notice-filters { justify-content: space-between; margin: 6px 0 12px; }
.notice-list { display: grid; gap: 8px; }
.notice-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; }
.notice-row.unread { border-left: 4px solid var(--accent); background: #f8fbff; }
.notice-row.unread .notice-title { font-weight: 700; }
.notice-icon { font-size: 1.35rem; line-height: 1.2; flex: none; }
.notice-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.notice-text summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.notice-text div { white-space: pre-line; font-size: .92rem; margin-top: 4px; overflow-wrap: anywhere; }
.notice-actions { gap: 6px; margin-top: 2px; }
.notice-group { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; padding: 6px 12px 8px; }
.notice-group legend { font-weight: 600; padding: 0 4px; }
.notice-matrix th.c, .notice-matrix td.c { text-align: center; width: 92px; }
.notice-matrix tr.group th { background: #f5f7f9; text-align: left; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head-row h1 { margin-bottom: 4px; }
@media (max-width: 760px) { .notice-drop { display: none; } }

/* Wersja 35: zakładki sekcji - „Więcej ▾” dla rzadziej używanych stron i główny przycisk sekcji */
.section-tabs .wrap { align-items: center; }
.section-tabs.wide .wrap { max-width: 1680px; }
.tabs-more { position: relative; }
.tabs-more summary { list-style: none; cursor: pointer; padding: 10px 10px 8px; white-space: nowrap; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs-more summary::-webkit-details-marker { display: none; }
.tabs-more summary:hover { color: var(--text); }
.tabs-more.on summary { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs-more-list { position: fixed; left: 8px; top: 100px; z-index: 40; width: 300px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 25, 35, .18); padding: 6px; display: grid; }
.tabs-more-list a { display: grid; padding: 8px 10px; border-radius: 8px; border-bottom: 0; white-space: normal; color: var(--text); }
.tabs-more-list a:hover { background: #f5f7f9; text-decoration: none; }
.tabs-more-list a.on { background: var(--accent-soft); font-weight: 600; }
.tabs-more-list small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.section-tabs a.tabs-action { margin-left: auto; align-self: center; padding: 6px 14px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; }
.section-tabs a.tabs-action:hover { filter: brightness(1.08); color: #fff; }
.section-tabs a.tabs-action.on { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }

/* Wersja 35: Integracje - kafelki połączeń w grupach */
.integ-worker { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: #eef0f3; font-size: .9rem; }
.integ-worker.ok { background: var(--ok-soft); color: #1f6b3a; }
.integ-worker.err { background: var(--error-soft); color: var(--error); }
.integ-worker .dot, .integ-lines .dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa5b1; flex: none; display: inline-block; }
.integ-worker.ok .dot, .integ-lines .dot.ok { background: #2f9e5b; }
.integ-worker.err .dot, .integ-lines .dot.err { background: var(--error); }
.integ-lines .dot.warn { background: #e0a100; }
.integ-problems { border-left: 4px solid var(--warn); }
.integ-problems ul { margin: 6px 0 0; padding-left: 18px; }
.integ-problems li { margin: 3px 0; }
.integ-group { margin-top: 22px; }
.integ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.integ-tile { display: grid; gap: 6px; align-content: start; border-top: 3px solid var(--line); }
.integ-tile.ok { border-top-color: #2f9e5b; }
.integ-tile.warn { border-top-color: #e0a100; }
.integ-tile.err { border-top-color: var(--error); }
.integ-tile.info { border-top-color: var(--accent); }
.integ-tile.wait { border-top-color: #c9dcf2; }
.integ-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.integ-head strong { flex: 1; min-width: 0; }
.integ-icon { font-size: 1.3rem; }
.integ-tile p { margin: 0; }
.integ-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.integ-lines li { display: grid; grid-template-columns: 12px auto; column-gap: 8px; align-items: center; }
.integ-lines li small { grid-column: 2; overflow-wrap: anywhere; }
.integ-foot { margin-top: 4px; }

/* Wersja 35: lista produktów - liczby przy zakładkach, drugi rząd „Do poprawy”, menu „⋯ Więcej” */
.tab-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #eef0f3; color: var(--muted); font-size: .78rem; font-weight: 600; text-align: center; }
.tab-count.warn { background: var(--warn-soft); color: var(--warn); }
.tabs a.on .tab-count { background: rgba(255, 255, 255, .25); color: inherit; }
.sub-tabs { margin-top: -4px; padding-left: 12px; border-left: 3px solid var(--warn-soft); }
.menu-more { position: relative; }
.menu-more > summary { list-style: none; cursor: pointer; }
.menu-more > summary::-webkit-details-marker { display: none; }
.menu-more-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 45; width: 320px; max-width: 86vw; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 25, 35, .18); padding: 6px; display: grid; }
.menu-more-list a { display: grid; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.menu-more-list a:hover { background: #f5f7f9; }
.menu-more-list small { color: var(--muted); font-size: .8rem; }
.products-panel { border-left: 4px solid var(--accent); margin-bottom: 12px; }

/* Wersja 35: „+ konto” - wystaw ofertę także na drugim koncie jednym kliknięciem */
button.badge.add-account { cursor: pointer; border: 1px dashed var(--accent); background: var(--card); color: var(--accent); font: inherit; font-size: .78rem; line-height: 1.5; }
button.badge.add-account:hover { background: var(--accent-soft); }

/* Zamówienia (wersja 35): nagłówek w jednej linii, filtry rozwijane, konto i kolejka w jednym wierszu, niższe wiersze */
.orders-head { gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.orders-head h1 { margin: 0 6px 0 0; }
.orders-head .head-search { flex: 1 1 260px; max-width: 560px; min-width: 0; }
.orders-head .view-switch { margin-right: 0; }
.filters-menu .filter-drop { left: 0; right: auto; width: min(760px, 92vw); padding: 12px; gap: 10px; }
.filters-menu .filter-drop .filter-grid { margin-top: 0; }
.layout-form a.small { margin-top: 6px; }
.orders-quick { gap: 6px; flex-wrap: wrap; margin: 0 0 6px; min-height: 34px; }
.orders-quick .queue-summary { margin-left: auto; }
.orders-quick .queue-summary > summary { cursor: pointer; list-style: none; padding: 5px 12px; border: 1px solid var(--line);
  border-radius: 18px; background: var(--card); font-size: .9rem; white-space: nowrap; }
.orders-quick .queue-summary > summary::-webkit-details-marker { display: none; }
.orders-quick .queue-summary[open] { flex: 1 1 100%; margin-left: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 10px; }
.orders-quick .queue-summary[open] > summary { border: 0; padding: 0 0 6px; background: none; }
.order-line { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.order-line .copy { padding: 0 3px; }
.ext-link { padding: 0 4px; font-weight: 600; text-decoration: none; }
.ext-link:hover { text-decoration: none; background: var(--accent-soft); border-radius: 4px; }
.apilo-table .c-delivery { min-width: 140px; }
.apilo-table .c-actions { min-width: 150px; }
.apilo-table .c-date { min-width: 110px; }
.apilo-table .plat-line .badge { margin-left: 2px; }
.apilo-layout { margin-top: 4px; }
@media (max-width: 760px) {
  .orders-head h1 { order: 1; font-size: 1.35rem; }
  .orders-head > .spacer { order: 2; }
  .orders-head .view-switch { order: 3; }
  .orders-head .layout-menu { order: 4; }
  .orders-head .head-search { order: 5; flex: 1 1 150px; max-width: none; }
  .orders-head > button[form] { order: 6; }
  .orders-head .filters-menu { order: 7; }
  .filters-menu[open] { flex-basis: 100%; }
  .orders-head .layout-menu .status-drop { right: 0; }
  .filters-menu .filter-drop { position: static; width: auto; box-shadow: none; margin-top: 6px; }
  .orders-quick .queue-summary { margin-left: 0; }
  .orders-quick .queue-summary > summary { white-space: normal; }
}

@media (max-width: 760px) { .hide-phone { display: none; } }
@media (max-width: 900px) {
  /* wersja 35: statusy zamówień w jednym przewijanym wierszu zamiast bloku na pół ekranu */
  .status-side { flex-wrap: nowrap; overflow-x: auto; padding: 6px; -webkit-overflow-scrolling: touch; }
  .status-side .side-item { flex: 0 0 auto; white-space: nowrap; }
}
@media (max-width: 900px) { .apilo-layout { gap: 8px; } .apilo-layout > .status-side { margin-bottom: 0; } }

/* Wtyczka FEST Profit (wersja 35) */
.ext-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.ext-feature h3 { margin: 0 0 6px; font-size: 1.02rem; }
.ext-feature p { margin: 0; color: var(--muted); font-size: .92rem; }
.ext-steps { margin: 14px 0 10px; padding-left: 22px; }
.ext-steps li { margin: 6px 0; }

/* --- wersja 36: telefon (test „jak zwykły użytkownik”) ------------------------------------------------- */
.chip.warn.on { background: var(--warn); border-color: var(--warn); color: #fff; }  /* aktywny filtr był nieczytelny */
.chip.ok.on { background: #1f6b3a; border-color: #1f6b3a; color: #fff; }
.notice-filter { max-width: min(100%, 320px); }
@media (pointer: coarse) {
  /* wersja 42: przyciski, listy wyboru, pola i rozwijane „▸” co najmniej 44 px wysokości (wcześniej 22-40 px) */
  .btn, button.btn { min-height: 44px; padding-top: 11px; padding-bottom: 11px; }
  .btn.small { padding: 11px 12px; }
  select, input:where(:not([type=checkbox], [type=radio], [type=file], [type=range], [type=hidden])) { min-height: 44px; }
  summary:where(:not(.btn)) { min-height: 44px; padding-top: 11px; padding-bottom: 11px; }
  .orders-quick .queue-summary:not([open]) > summary { padding-top: 11px; padding-bottom: 11px; }
  input[type=radio], input[type=checkbox] { width: 20px; height: 20px; }
  .desk-only { display: none; }  /* „(Enter)”, „(Esc)” - skróty klawiatury, nie na telefon */
}
@media (max-width: 760px) {
  .topbar .who { display: none; }  /* wylogowanie jest w Menu - nie obok dzwonka */
  .desk-only { display: none; }
  .pack-head { padding: 8px 10px; gap: 6px; }
  .pack-head h1 { font-size: 1.1rem; }
  .pack-head .stat { min-width: 56px; }
  .pack-head .stat .num { font-size: 1.15rem; }
  .pack-head .stat .label { font-size: .72rem; }
  .pack-head .pack-more { display: none; }
}
@media (max-width: 760px) and (pointer: coarse) {
  /* iPhone powiększa stronę przy polach z czcionką mniejszą niż 16 px */
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; }
}
@media (max-width: 700px) {
  .fab-search { width: 48px; height: 48px; font-size: 1.3rem; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .fab-search.away { opacity: .92; pointer-events: auto; }  /* lupa dopiero, gdy pole szukania zniknie z ekranu */
}
.features-save { position: sticky; bottom: 0; background: var(--card); padding: 10px 0; border-top: 1px solid var(--line); z-index: 5; align-items: center; gap: 10px; }
@media (max-width: 760px) { .features-save { bottom: 64px; } }  /* nad dolnym paskiem telefonu */
.attention-card { border-left: 4px solid var(--warn); }
.attention-card ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.attention-card li.err a { color: var(--error); font-weight: 600; }
.setup-done > summary, details.card > summary { cursor: pointer; }
.nav-count.nav-messages::before { content: "✉ "; }  /* wersja 36: wiadomości widać w górnym menu */

/* Wersja 36: Księgowość - pełny numer zamówienia (UUID Allegro) z wielokropkiem i podpowiedzią zamiast ucięcia */
a.ks-no { display: inline-block; max-width: 20ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.iban { overflow-wrap: anywhere; word-break: break-all; }  /* wersja 36: długi numer konta nie wychodzi poza kartę */
/* wersja 36: pływający licznik pakowania nie zasłania końca strony (przyciski „Zapisz” w Ustawieniach wysyłki) */
body:has(.mini-counter:not([hidden])) main { padding-bottom: 72px; }
/* wersja 38: administracja platformy i Pakiet na telefonie - szerokie pola i tabele bez wychodzenia poza ekran */
@media (max-width: 640px) {
  .admin-wrap input:not([type=checkbox]):not([type=radio]), .admin-wrap select, .admin-wrap textarea { min-width: 0 !important; max-width: 100%; }
  .admin-wrap label { max-width: 100%; }
  .admin-wrap code { overflow-wrap: anywhere; }
}
/* wersja 39: poczekalnia firmy zapisanej na testy */
.waiting-steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.waiting-steps li { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.waiting-steps li > div { flex: 1; min-width: 0; }
.waiting-steps .mark { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #eef2f6; color: var(--muted); font-weight: 700; flex: none; }
.waiting-steps li.done .mark { background: #e3f4ec; color: #177d4f; }
@media (max-width: 640px) { .waiting-steps li { flex-wrap: wrap; } }
/* wersja 39: zapis firmy na testy */
.signup .signup-part { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 12px; margin: 0 0 14px; }
.signup .signup-part legend { font-weight: 700; padding: 0 6px; color: var(--text); }
.signup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; align-items: end; }
.signup-grid .wide { grid-column: 1 / -1; }
.signup-grid .signup-nip { padding-bottom: 12px; }
.signup .signup-label { margin: 6px 0 4px; font-size: .88rem; color: var(--muted); }
.signup .check-line { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }
.signup .check-line label.check { margin: 0; align-items: center; white-space: nowrap; }
.signup .check-line label.check input { width: auto; flex: none; margin: 0; }
.signup .signup-invite { margin: 0 0 12px; }
.signup .signup-invite summary { cursor: pointer; color: var(--accent); }
@media (max-width: 640px) { .signup-grid { grid-template-columns: 1fr; } .signup-grid .signup-nip { padding-bottom: 8px; } }
/* wersja 39: lista zapisów do akceptacji w administracji */
.signup-list { display: grid; gap: 10px; margin-bottom: 18px; }
.signup-row { display: flex; gap: 16px; align-items: flex-start; margin: 0; }
.signup-row .signup-main { flex: 1; min-width: 0; }
.signup-row .signup-actions { width: 280px; flex: none; }
@media (max-width: 760px) { .signup-row { flex-direction: column; } .signup-row .signup-actions { width: 100%; } }

/* Wersja 40: Pakiet w czasie testów - jasno, że testy są za darmo, bez cennika i formularza zamówienia. */
.tests-card { border-left: 4px solid #177d4f; }
.tests-card h2 { margin: 10px 0 6px; font-size: 1.45rem; }
.tests-badge { font-size: .9rem; padding: 4px 12px; }
.tests-lead { font-size: 1.05rem; margin: 0 0 10px; }
.tests-points { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.tests-points li { position: relative; padding-left: 26px; }
.tests-points li::before { content: "✓"; position: absolute; left: 4px; top: 0; color: #177d4f; font-weight: 700; }

/* Wersja 40: przy węższych oknach (laptopy 1100-1280 px) menu nie wchodzi pod dzwonek i nazwisko.
   Najpierw mniejsze odstępy, potem bez nazwiska (jest w podpowiedzi), a gdy i tak brakuje miejsca - drugi wiersz menu. */
.topbar .bell-wrap, .topbar .who, .topbar .brand { flex-shrink: 0; }
@media (min-width: 761px) { .topbar .main-nav { flex-wrap: wrap; } }
@media (max-width: 1280px) { .nav-top { padding-left: 7px; padding-right: 7px; } }
@media (max-width: 1240px) {
  .nav-top { font-size: .94rem; }
  .topbar .who span { display: none; }
}
@media (max-width: 1120px) { .nav-top { padding-left: 5px; padding-right: 5px; } }

/* Wersja 40: długie ostrzeżenie o paczce (np. „nie mieści się w największej skrytce…”) zawija się w kolumnie Dostawa
   na stronie Etykiety, zamiast rozpychać tabelę poza ekran. */
.badge.badge-wrap { white-space: normal; text-align: left; border-radius: 10px; }
.labels-delivery { min-width: 150px; max-width: 220px; }
/* Wersja 40: na komputerze za długi pasek zakładek (np. „Więcej: Ustawienia księgowości”) przechodzi do drugiego
   wiersza zamiast przewijać się w bok i ucinać pierwszą zakładkę; na telefonie zostaje przewijanie. */
@media (min-width: 761px) { .section-tabs .wrap { flex-wrap: wrap; } }
/* Wersja 41: Diagnostyka i „Do zrobienia” w administracji platformy, wykresy zasobów i zużycie firm */
.diag-list { display: grid; gap: 10px; margin: 12px 0 24px; }
.diag { margin: 0; border-left: 4px solid var(--line); }
.diag-error { border-left-color: var(--error); }
.diag-warn { border-left-color: var(--warn); }
.diag-ok { border-left-color: #2f8f55; }
.diag-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.diag-summary { margin: 6px 0 0; }
.diag-steps { margin: 8px 0 0; padding-left: 22px; }
.diag-steps li { margin: 4px 0; }
.diag-details { margin: 6px 0 0; padding-left: 18px; }
.diag-trace { white-space: pre-wrap; word-break: break-word; font-size: .78rem; max-height: 280px; overflow: auto; background: var(--bg); padding: 8px 10px; border-radius: 6px; }
.diag-errors td { vertical-align: top; }
.todo-list { display: grid; gap: 8px; margin: 10px 0 18px; }
.todo-item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.todo-item p { margin: 4px 0 0; }
.usage-bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--accent); vertical-align: middle; min-width: 2px; }
.range-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.range-tabs a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .9rem; }
.range-tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
tr.row-warn td { background: var(--warn-soft, #fff7e6); }
.qr { display: block; max-width: 100%; height: auto; }
.danger-text { color: var(--error); }

/* Wersja 42: wycieczka po programie - przyciemnienie, podświetlony element i dymek z krokami */
.tour-layer { position: fixed; inset: 0; z-index: 2000; }
.tour-layer.no-spot { background: rgba(15, 23, 32, .55); }
.tour-spot { position: fixed; border-radius: var(--radius); box-shadow: 0 0 0 9999px rgba(15, 23, 32, .55);
  outline: 3px solid #36b39a; pointer-events: none; transition: left .2s, top .2s, width .2s, height .2s; }
.tour-box { position: fixed; width: min(360px, calc(100vw - 16px)); background: var(--card); color: var(--text);
  border-radius: 12px; padding: 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.tour-box h3 { margin: 2px 0 6px; font-size: 1.1rem; }
.tour-box p { margin: 0 0 14px; line-height: 1.45; }
.tour-count { font-size: .8rem; color: var(--muted); }
.tour-actions { display: flex; gap: 8px; align-items: center; }
.tour-actions .spacer { flex: 1; }

/* Wersja 42: wskazówki na stronach (_tip.html), pomoc i Moje konto w górnym pasku, Użytkownicy na telefonie */
.tip { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 12px;
  border: 1px solid var(--accent); border-left-width: 4px; border-radius: var(--radius); background: var(--accent-soft); }
.tip[hidden] { display: none; }
.tip .tip-text { flex: 1 1 260px; line-height: 1.45; }
.topbar .help-link { color: #fff; text-decoration: none; font-weight: 700; width: 26px; height: 26px; line-height: 24px;
  text-align: center; border: 1px solid rgba(255, 255, 255, .45); border-radius: 50%; flex-shrink: 0; font-size: .9rem; }
.topbar .help-link:hover { background: rgba(255, 255, 255, .12); }
.topbar .who a { color: #c9d3dd; text-decoration: none; }
.topbar .who a:hover { text-decoration: underline; }
@media (max-width: 700px) {
  .users-table thead { display: none; }
  .users-table, .users-table tbody, .users-table tr, .users-table td { display: block; width: 100%; }
  .users-table tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 10px;
    background: var(--card); }
  .users-table td { border: 0; padding: 3px 0; }
  .users-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .85rem; }
  .users-table td.user-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
  .users-table details.user-edit { flex-basis: 100%; }
}

/* Wersja 42: telefon pracownika - nic nie wychodzi poza ekran, pełne nazwy, widać, że zakładki przewijają się w bok */
@media (max-width: 600px) {
  /* długie znaczniki i przyciski zawijają się zamiast poszerzać stronę (Funkcje programu, Hurtownie i ceny) */
  .badge { white-space: normal; max-width: 100%; overflow-wrap: anywhere; border-radius: 10px; }
  .btn { white-space: normal; max-width: 100%; }
  .scan-btn { white-space: nowrap; }
  /* filtr rodzajów powiadomień w osobnym wierszu, na szerokość ekranu (długie nazwy rodzajów) */
  .notice-filters > form { flex: 1 1 100%; min-width: 0; }
  .notice-filter { width: 100%; max-width: 100%; }
  /* „Popraw” / „Dolicz +5 (razem 17)” / „Anuluj” jeden pod drugim - napisy w jednej linii */
  .recount-ask .row { grid-template-columns: 1fr; }
}
/* zakładki sekcji przewijane w bok: „‹” / „›” z cieniem przy krawędzi, za którą są kolejne zakładki */
.section-tabs { position: relative; }
.section-tabs::before, .section-tabs::after { content: "‹"; position: absolute; top: 0; bottom: 1px; z-index: 1; width: 44px;
  display: flex; align-items: center; padding: 0 6px; font-size: 1.6rem; font-weight: 700; color: var(--accent);
  pointer-events: none; opacity: 0; transition: opacity .15s; }
.section-tabs::before { left: 0; background: linear-gradient(to right, #fff 35%, rgba(255, 255, 255, 0)); }
.section-tabs::after { content: "›"; right: 0; justify-content: flex-end;
  background: linear-gradient(to left, #fff 35%, rgba(255, 255, 255, 0)); }
.section-tabs.more-left::before, .section-tabs.more-right::after { opacity: 1; }
/* Pakowanie: kto pakuje - całe imię i nazwisko na telefonie (wcześniej „Kasia Magazy”) */
.pack-title { flex: 1; min-width: 200px; }
.pack-who { margin-top: 4px; }
.pack-who input[name=worker] { width: 140px; }
@media (max-width: 760px) {
  .pack-title { flex-basis: 100%; }
  .pack-who { flex-wrap: nowrap; }
  .pack-who input[name=worker] { flex: 1; min-width: 0; width: auto; }
}
/* błąd przy polu, do którego wraca kursor (Przyjmij: „Co to jest?”), a nie przy przycisku poza ekranem */
.field-err { margin-top: 4px; font-weight: 600; }
/* Przyjmij: „Kod z opakowania” z przyciskiem „Skanuj” nie poszerza strony telefonu (było 405 px) */
.search-scan > label { min-width: 0; }
.search-scan > label input { width: 100%; }
/* ekran startowy pracownika: od czego zacząć */
.start-hint { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.start-hint > span { flex: 1; min-width: 0; }
.start-hint form { margin: 0; flex: none; }
/* lista produktów w firmie z kilkoma miejscami: gdzie leży to, co się liczy */
.count-place { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 0 0 8px; padding: 8px 12px;
  border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--card); }
.count-place select { max-width: 100%; }
.count-place.need { border-left-color: var(--warn); background: var(--warn-soft); }
@media (max-width: 600px) {
  .count-place .inline-label { flex: 1 1 100%; min-width: 0; white-space: nowrap; }
  .count-place select { flex: 1; min-width: 0; }
}
.recount-ask small { display: block; }
.place-ask .row { grid-template-columns: 1fr; }
@media (max-width: 700px) {  /* pytanie na dole ekranu przy wielu miejscach przewija się, nie ucieka w górę */
  .recount-ask { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; }
}

/* Wersja 42: poprawki z testów (formularze, telefon pracownika) */
fieldset.choice .choice-link { display: block; padding: 6px 8px; margin: 2px 0 4px; border: 1px dashed var(--line); border-radius: 6px; color: var(--text); font-size: .95rem; }
fieldset.choice .choice-link strong { color: var(--accent); }
fieldset.choice .choice-link small { display: block; }
.product-photo { display: grid; gap: 6px; justify-items: start; }
.photo-upload { display: grid; gap: 4px; max-width: 220px; }
.photo-upload input[type=file] { font-size: .8rem; max-width: 100%; }
.chart-box > summary { cursor: pointer; }
@media (max-width: 700px) {
  table.products-table td.c-offers::before, table.products-table td.c-counted::before { margin-right: 6px; }
  /* masowa edycja na telefonie dopiero po zaznaczeniu produktu - wcześniej zasłaniała ćwierć ekranu */
  .bulk-edit { display: none; }
  body:has(input[form="bulk-form"]:checked) .bulk-edit, .bulk-edit[open] { display: block; }
  .bulk-edit > summary .muted { display: none; }
}

/* Wersja 43: Plan dnia - sprzedaż dziś na tle planu, strefy i prognoza */
.plan-day-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.plan-day-head h1 { margin: 0; }
.plan-zone { border-left: 6px solid #c9ced6; }
.plan-zone-name { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.plan-zone p { margin: .3rem 0 0; }
.plan-tiles .num { font-variant-numeric: tabular-nums; }
.plan-hour { margin: 0 0 14px; }
.plan-chart svg { margin-top: 6px; }
.legend i.plan-dash { width: 16px; height: 0; border-top: 2px dashed #333; border-radius: 0; vertical-align: 3px; }
.plan-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; color: #fff; font-weight: 600; font-size: .8rem; }
.plan-day-tile { margin-top: 4px; color: var(--text); }
.plan-accuracy td, .plan-accuracy th { font-variant-numeric: tabular-nums; }

/* Wersja 43: Stany z pliku - podgląd przed zapisem */
.stock-file-kpis { margin: 14px 0 6px; }
.stock-file-more { margin: 10px 0; }
.stock-file-more summary { cursor: pointer; }
@media (max-width: 640px) { .stock-file-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
