:root { color-scheme: light dark; --bg:#f6f7f9; --card:#fff; --ink:#1b2430; --muted:#5b6676; --line:#cfd6e0; --acc:#0f766e; --on-acc:#fff; --warn:#b45309; --ok:#15803d; --err:#b91c1c; --wy:#a16207; --wr:#b91c1c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg:#12161c; --card:#1b212a; --ink:#e7ebf1; --muted:#98a3b3; --line:#2b3441; --acc:#2dd4bf; --on-acc:#04201d; --warn:#fbbf24; --ok:#4ade80; --err:#f87171; --wy:#fbbf24; --wr:#f87171; } }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; --bg:#12161c; --card:#1b212a; --ink:#e7ebf1; --muted:#98a3b3; --line:#2b3441; --acc:#2dd4bf; --on-acc:#04201d; --warn:#fbbf24; --ok:#4ade80; --err:#f87171; --wy:#fbbf24; --wr:#f87171; }
* { box-sizing: border-box; }
body { margin:0; font:14px/1.45 -apple-system, system-ui, "Segoe UI", sans-serif; background:var(--bg); color:var(--ink); }
header { display:flex; gap:12px; align-items:center; padding:10px 16px; background:var(--card); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:2; flex-wrap:wrap; }
h1 { font-size:17px; margin:0 8px 0 0; }
input, select, textarea, button { font:inherit; color:inherit; }
input[type=search], select { padding:7px 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); min-width:240px; }
.muted { color:var(--muted); }
.pad { padding:24px; }
main { display:grid; grid-template-columns: minmax(320px, 440px) 1fr; gap:16px; padding:16px; align-items:start; }
@media (max-width: 800px) { main { grid-template-columns: 1fr; } }
#list { background:var(--card); border:1px solid var(--line); border-radius:12px; max-height: calc(100vh - 90px); overflow:auto; }
.row { display:grid; grid-template-columns:56px 1fr auto; gap:10px; padding:8px 10px; border-bottom:1px solid var(--line); cursor:pointer; align-items:center; }
.row:hover, .row.sel { background:color-mix(in srgb, var(--acc) 10%, transparent); }
.row img, .row .thumb-empty { width:56px; height:56px; object-fit:cover; border-radius:8px; background:var(--line); }
.row .t { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.row .m { color:var(--muted); font-size:12px; }
.badge { font-size:11px; padding:2px 7px; border-radius:99px; border:1px solid var(--line); white-space:nowrap; }
.badge.opublikowany { color:var(--ok); border-color:var(--ok); }
.badge.wypełniony { color:var(--warn); border-color:var(--warn); }
.badge.przygotowany { color:var(--muted); }
#detail { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; }
#detail h2 { margin:0 0 4px; font-size:16px; }
.facts { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:6px 14px; margin:12px 0; }
.facts div span { display:block; font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
label { display:block; margin:12px 0 4px; font-weight:600; }
#f-title, #f-desc { width:100%; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); }
#f-desc { min-height:230px; resize:vertical; }
.actions { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; align-items:center; }
button { padding:8px 14px; border-radius:8px; border:1px solid var(--line); background:var(--card); cursor:pointer; }
button.primary { background:var(--acc); color:var(--on-acc); border-color:var(--acc); font-weight:600; }
button:disabled { opacity:.55; cursor:wait; }
.photos { display:flex; gap:8px; overflow-x:auto; padding:6px 0; }
.photos img { height:150px; border-radius:8px; cursor:zoom-in; }
#lightbox { position:fixed; inset:0; background:rgba(0,0,0,.85); display:none; align-items:center; justify-content:center; z-index:9; cursor:zoom-out; }
#lightbox.on { display:flex; }
#lightbox img { max-width:94vw; max-height:94vh; }
.msg { font-size:13px; }
.msg.err { color:var(--err); }
.msg.ok { color:var(--ok); }

/* ---- etap 2: nawigacja, formularz, kolejka, ustawienia ---- */
nav { display:flex; gap:4px; }
nav a { padding:6px 12px; border-radius:8px; color:var(--ink); text-decoration:none; }
nav a:hover { background:color-mix(in srgb, var(--acc) 10%, transparent); }
nav a.on { background:var(--acc); color:var(--on-acc); font-weight:600; }
.toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:10px 16px; }
.toolbar input[type=search] { min-width:220px; }
.filters { display:flex; gap:4px; flex-wrap:wrap; }
.filt { padding:5px 10px; font-size:13px; }
.filt.on { background:var(--acc); color:var(--on-acc); border-color:var(--acc); font-weight:600; }
.btn { display:inline-block; padding:8px 14px; border-radius:8px; border:1px solid var(--line); text-decoration:none; color:inherit; }
.btn.primary { background:var(--acc); color:var(--on-acc); border-color:var(--acc); font-weight:600; }
.row { grid-template-columns:22px 56px 1fr auto; }
.row .bs { display:flex; gap:4px; flex-wrap:wrap; justify-content:flex-end; max-width:170px; }
.qbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:8px 16px; background:color-mix(in srgb, var(--acc) 12%, transparent); border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.badge.st-ready { color:var(--acc); border-color:var(--acc); }
.badge.st-queued { color:var(--warn); border-color:var(--warn); }
.badge.st-ok { color:var(--ok); border-color:var(--ok); }
.badge.st-sold { color:var(--muted); text-decoration:line-through; }
.badge.st-arch { color:var(--muted); font-style:italic; }
.badge.wersja-robocza { color:var(--warn); border-color:var(--warn); }
.warnline { color:var(--warn); font-weight:600; margin:6px 0; }
.page { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; margin:16px; max-width:900px; }
.page h2 { margin-top:0; }
.card { border:1px solid var(--line); border-radius:10px; padding:12px; margin:12px 0; }
.card h3 { margin:0 0 4px; font-size:15px; }
.form h3 { margin:18px 0 6px; font-size:14px; border-bottom:1px solid var(--line); padding-bottom:4px; }
.fld { display:block; margin:8px 0; }
.fld > span { display:block; font-size:12px; color:var(--muted); margin-bottom:3px; font-weight:600; }
.fld input[type=text], .fld input[type=number], .fld input[type=password], .fld select, .fld textarea, #pf-desc, #pf-catq { width:100%; padding:7px 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); }
#pf-desc { min-height:180px; }
.g2 { display:grid; grid-template-columns:1fr 2fr; gap:12px; }
.g3 { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
@media (max-width: 800px) { .g2, .g3 { grid-template-columns:1fr; } }
.chips { display:flex; flex-wrap:wrap; gap:6px; }
.chip { padding:4px 10px; border-radius:99px; font-size:13px; }
.chip.on { background:var(--acc); color:var(--on-acc); border-color:var(--acc); font-weight:600; }
.cat-shown { margin:6px 0; }
.cat-res { max-height:220px; overflow:auto; }
.cat-item { display:block; width:100%; text-align:left; border-radius:0; border-width:0 0 1px 0; }
button.link { border:none; background:none; color:var(--acc); padding:0 4px; text-decoration:underline; }
.pgrid { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0; }
.pcell { position:relative; width:110px; height:110px; border:2px solid var(--line); border-radius:8px; overflow:hidden; cursor:grab; background:var(--bg); }
.pcell.main { border-color:var(--acc); }
.pcell.over { outline:3px dashed var(--acc); }
.pcell img { width:100%; height:100%; object-fit:cover; }
.pmain { position:absolute; left:0; bottom:0; right:0; background:var(--acc); color:var(--on-acc); font-size:11px; font-weight:700; text-align:center; }
.pdel { position:absolute; top:2px; right:2px; padding:0 6px; line-height:18px; border-radius:99px; background:rgba(0,0,0,.65); color:#fff; border:none; margin:0; }
.drop { border:2px dashed var(--line); border-radius:10px; padding:18px; text-align:center; color:var(--muted); cursor:pointer; }
.drop.over { border-color:var(--acc); background:color-mix(in srgb, var(--acc) 10%, transparent); }
.keystate.ok { color:var(--ok); font-weight:600; }
.keystate.warn { color:var(--warn); font-weight:600; }
.riskbox { border:2px solid var(--warn); color:var(--warn); border-radius:8px; padding:8px 10px; margin:8px 0; font-size:13px; }
.chk { display:block; margin:8px 0; font-size:13px; }
.qt { width:100%; border-collapse:collapse; margin-top:10px; }
.qt th, .qt td { text-align:left; padding:6px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
.qt button { padding:2px 8px; margin-right:4px; }
#detail .actions { margin:8px 0; }
.vm-voice { background:var(--card); }

[hidden] { display:none !important; }

a { color:var(--acc); }
nav a { color:var(--ink); }
nav a.on { color:var(--on-acc); }
.btn { color:var(--ink); }
.btn.primary { color:var(--on-acc); }

/* ---- etap 3: podglad przed-po, hurt, harmonogram ---- */
.page.wide { max-width:1200px; }
.cmp { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:10px 0; }
@media (max-width: 800px) { .cmp { grid-template-columns:1fr; } }
.cmp-col { border:1px solid var(--line); border-radius:10px; padding:10px; background:var(--bg); }
.cmp-col h4 { margin:0 0 6px; font-size:13px; color:var(--muted); }
.cmp-label { font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); margin-top:6px; }
.cmp-text { white-space:pre-wrap; word-break:break-word; }
.cmp-field:first-of-type .cmp-text { font-weight:600; }
mark.del { background:color-mix(in srgb, #dc2626 25%, transparent); color:inherit; text-decoration:line-through; border-radius:3px; }
mark.add { background:color-mix(in srgb, #16a34a 28%, transparent); color:inherit; border-radius:3px; }
.small { font-size:12px; }
.bulk { padding:10px 16px; border-bottom:1px solid var(--line); background:var(--card); }
.bulk progress { width:100%; height:14px; margin-top:8px; }
#bulkLog { max-height:140px; overflow:auto; margin-top:6px; }
.proposal { background:var(--card); }
.warn-yellow { border:2px solid var(--wy); color:var(--wy); border-radius:8px; padding:6px 10px; margin:6px 0; font-size:13px; }
.warn-red { border:2px solid var(--wr); color:var(--wr); border-radius:8px; padding:6px 10px; margin:6px 0; font-size:13px; font-weight:600; }
.warn-info { border:1px solid var(--line); color:var(--muted); border-radius:8px; padding:6px 10px; margin:6px 0; font-size:13px; }
.days { display:flex; gap:6px; flex-wrap:wrap; }
.days label { margin:0; font-weight:400; border:1px solid var(--line); border-radius:8px; padding:4px 10px; cursor:pointer; }
.days label.on { background:var(--acc); color:var(--on-acc); border-color:var(--acc); font-weight:600; }
.days input { display:none; }
.upc { margin:6px 0 0 18px; padding:0; }
.upc li { margin:2px 0; }
.sched-row { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; }
.sched-row .fld { margin:6px 0; }
.sched-row .fld { flex:0 1 220px; }
.sched-row .fld select, .sched-row .fld input { width:100%; }
.sched-row .fld select { min-width:0; padding:7px 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); }
.row > div { min-width:0; } .row .bs .badge { white-space:normal; text-align:center; }

.login-box { max-width:420px; }

.theme-sw { padding:5px 8px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--ink); font-size:12px; min-width:0; }
header .theme-sw { margin-left:auto; }

/* ---- widok „Do przegladu” ---- */
.navbadge { display:inline-block; min-width:18px; padding:0 6px; border-radius:99px; background:var(--warn); color:#fff; font-size:11px; font-weight:700; text-align:center; line-height:18px; }
.rv { margin:12px 0; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--card); }
.rv-head { display:flex; gap:10px; align-items:center; }
.rv-head img, .rv-head .thumb-empty { width:56px; height:56px; object-fit:cover; border-radius:8px; background:var(--line); flex:none; }
.rv-miss { margin:8px 0; display:grid; gap:4px; }
.rv-miss .badge { margin-right:4px; }
.rv-fields { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:4px 14px; margin:6px 0; }
.rv-two { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.rv input[type=text], .rv input[type=search], .rv select, .rv textarea { width:100%; padding:7px 9px; border:1px solid var(--line); border-radius:8px; background:var(--bg); }
.rv-card { margin:8px 0; padding:8px 10px; border:1px solid var(--warn); border-radius:10px; background:var(--card); }
.rv .ok { color:var(--ok); }
.rv-two > *, .rv .fld { min-width:0; } .rv-fields > * { min-width:0; }
