/* Magazyn biżuterii — style aplikacji */

:root {
  color-scheme: light;
  --font: "Gamay", "Gamay Variable", Jost, "Segoe UI", Arial, sans-serif;
  --ink: #1d1d1b;
  --mute: #6b6a66;
  --line: #eceae5;
  --line2: #d6d2c8;
  --soft: #f7f5f0;
  --gold: #c8ae77;
  --gold-h: #bda265;
  --gold-d: #7d6431;
  --gold-l: #fbf8f1;
  --gold-m: #e8dcc2;
  --ok: #0f7a35;
  --bad: #b3261e;
  --repair: #2453a6;
  --dw: 300; /* grubość wpisywanych wartości i nazw */
}

/* ---------- podstawy ---------- */
* { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: 120px; }
body {
  margin: 0; background: #fff; color: var(--ink);
  font: 16px/1.5 var(--font); letter-spacing: .01em;
  overflow-x: clip; -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
b, strong, .b { font-weight: 700; }
[hidden] { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 max(4vw, 14px); }
main.wrap { padding-top: 28px; padding-bottom: 140px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.nowrap { flex-wrap: nowrap; }
.row.end { justify-content: flex-end; }
.note { font-size: 14px; color: var(--mute); margin: 10px 0 0; }
.muted { color: var(--mute); }
.light { font-weight: var(--dw); }

/* ---------- nagłówek ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .97);
  border-top: 3px solid var(--gold); border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 8px; margin-right: 8px; font-size: 19px; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand span { font-weight: 300; color: var(--mute); }
.brand svg { width: 26px; height: 26px; fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linejoin: round; }
.views { display: flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: 999px; }
.views a { padding: 9px 18px; border-radius: 999px; color: var(--mute); font-weight: 500; text-decoration: none; white-space: nowrap; }
.views a.on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.who { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 14px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a { flex: none; padding: 12px 14px; border-bottom: 3px solid transparent; color: var(--mute); font-weight: 500; text-decoration: none; white-space: nowrap; }
.tabs a.on { color: var(--ink); font-weight: 700; border-color: var(--gold); }

/* ---------- sekcje i pola ---------- */
.sec {
  margin-bottom: 16px; padding: 24px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}
.sec h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 17px; font-weight: 700; }
.sec h2 .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--ink); font-size: 13px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 16px; }
.grid .full { grid-column: 1 / -1; }
.mt { margin-top: 14px; }

.fld label, .fld .flbl { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 700; }
.fld .flbl { margin-bottom: 8px; }
.fld label i, .fld .flbl i { margin-left: 2px; color: var(--bad); font-style: normal; }
.fld .msg { display: block; color: var(--bad); font-size: 13px; }
.fld .hint { display: block; margin-top: 6px; font-size: 14px; color: var(--mute); }
.inp { position: relative; display: flex; align-items: center; }
.inp.short { max-width: 260px; }
.inp.xshort { max-width: 160px; }
.inp input, .inp select {
  width: 100%; min-height: 50px; padding: 10px 12px;
  border: 1px solid var(--line2); border-radius: 12px; background: #fff; color: #000;
  font-family: var(--font); font-size: 17px; font-weight: var(--dw);
}
.inp input[type=number] { padding-right: 46px; }
.inp select {
  appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #111 50%), linear-gradient(135deg, #111 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.inp .unit { position: absolute; right: 12px; font-size: 14px; font-weight: 700; color: var(--mute); pointer-events: none; }
.inp input:hover, .inp select:hover { border-color: #a9a9a9; }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(138, 106, 30, .18); }
button:focus-visible, a:focus-visible, tr:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.fld.err input, .fld.err select { border-color: var(--bad); background: #fff7f6; }
.fld.err .chips .cb { border-color: var(--bad); }

/* ---------- przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 26px; border: 1px solid var(--gold); border-radius: 999px;
  background: linear-gradient(180deg, #d4bd8a 0%, var(--gold) 55%, #bfa36a 100%); color: var(--ink);
  font-size: 14px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(29, 29, 27, .08), 0 6px 16px -6px rgba(160, 128, 60, .55), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover {
  background: linear-gradient(180deg, #cdb47d 0%, var(--gold-h) 60%, #b39858 100%); transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(29, 29, 27, .08), 0 10px 22px -8px rgba(160, 128, 60, .65), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn:active { transform: none; box-shadow: 0 1px 2px rgba(29, 29, 27, .12), inset 0 1px 3px rgba(0, 0, 0, .12); }
.btn svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.ghost { background: #fff; border-color: var(--line2); box-shadow: 0 1px 2px rgba(29, 29, 27, .04); }
.btn.ghost:hover { border-color: var(--ink); box-shadow: 0 4px 12px -6px rgba(29, 29, 27, .25); }
.btn.sm { min-height: 38px; padding: 0 16px; font-size: 12px; letter-spacing: .08em; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .35; cursor: not-allowed; transform: none; }
.x { width: 44px; height: 44px; border: 0; border-radius: 10px; background: #fff; font-size: 20px; cursor: pointer; }
.x:hover { background: var(--soft); }
.lnk { padding: 0; border: 0; background: none; color: var(--bad); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* przełącznik dwóch opcji */
.seg { display: inline-flex; flex-wrap: wrap; overflow: hidden; border: 1.5px solid var(--line2); border-radius: 10px; }
.seg button { min-height: 40px; padding: 0 14px; border: 0; background: #fff; font-weight: 500; cursor: pointer; }
.seg button + button { border-left: 1.5px solid var(--line2); }
.seg button.on { background: var(--ink); color: #fff; font-weight: 600; }

/* opcje do kliknięcia */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.sm { margin-top: 8px; gap: 6px; }
.chips.filter { margin-bottom: 10px; }
.chips.filter.last { margin-bottom: 16px; }
.cb {
  min-height: 44px; padding: 0 18px; border: 1px solid var(--line2); border-radius: 999px; background: #fff;
  font-size: 15.5px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: border-color .12s;
}
.chips.sm .cb { min-height: 36px; padding: 0 12px; font-size: 14px; }
.cb:hover { border-color: var(--ink); }
.cb.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; box-shadow: inset 0 -2px 0 var(--gold); }
.cb .c { margin-left: 4px; font-weight: 400; opacity: .7; }

/* ---------- logowanie ---------- */
.login { display: grid; place-items: center; min-height: calc(100vh - 220px); padding: 3vh 0; }
.lgcard {
  position: relative; display: grid; gap: 14px; width: min(440px, 100%); padding: 34px 32px 30px;
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 1px 2px rgba(29, 29, 27, .04), 0 24px 60px -28px rgba(120, 96, 40, .35);
}
.lgcard::before { content: ""; position: absolute; top: 0; left: 32px; right: 32px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
.lgcard h1 { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.1; }
.lgcard p { margin: 0 0 4px; color: var(--mute); font-size: 15px; }
.kicker { color: var(--gold-d); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.accs { display: grid; gap: 10px; }
.acc {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 26px; gap: 14px; align-items: center;
  width: 100%; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 16px; background: #fff;
  text-align: left; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.acc:hover { border-color: var(--ink); }
.acc.on { border-color: var(--gold); background: var(--gold-l); box-shadow: 0 0 0 3px rgba(200, 174, 119, .22); }
.acc .av { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--gold-m); border-radius: 50%; background: #fff; color: var(--gold-d); font-size: 17px; font-weight: 700; }
.acc.on .av { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.acc b { display: block; font-size: 17px; font-weight: 600; }
.acc small { display: block; font-size: 14px; color: var(--mute); }
.tick { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line2); border-radius: 50%; background: #fff; }
.tick svg { width: 15px; height: 15px; fill: none; stroke: transparent; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.acc.on .tick { background: var(--ink); border-color: var(--ink); }
.acc.on .tick svg { stroke: var(--gold); }
.access { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.access span { padding: 5px 10px; border-radius: 999px; background: var(--soft); color: #3b3a36; font-size: 12.5px; font-weight: 600; }
.lgerr { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fdf1f0; color: var(--bad); font-size: 14px; font-weight: 600; }

/* ---------- dodawanie ---------- */
.editbar { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--gold-m); border-radius: 12px; background: var(--gold-l); color: var(--gold-d); font-weight: 600; }
.addgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.addside { position: sticky; top: 150px; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.types button {
  display: grid; place-items: center; align-content: center; gap: 8px; min-height: 96px;
  border: 1px solid var(--line2); border-radius: 16px; background: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
  transition: border-color .15s;
}
.types button:hover { border-color: var(--ink); }
.types button.on { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: inset 0 -3px 0 var(--gold); }
.types svg { width: 32px; height: 32px; fill: none; stroke: var(--gold-d); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.types button.on svg { stroke: var(--gold); }
.photo { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.photo .pv { display: grid; place-items: center; width: 140px; height: 140px; overflow: hidden; border: 1.5px dashed var(--line2); border-radius: 12px; background: #fff; color: var(--mute); font-size: 13px; text-align: center; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.pricebox { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; margin-top: 14px; padding: 16px 18px; border: 1px solid var(--gold-m); border-radius: 12px; background: var(--gold-l); }
.pricebox .big { font-size: 30px; font-weight: 700; white-space: nowrap; }
.pricebox small { color: var(--mute); font-size: 14px; }
details.sec > summary { display: flex; justify-content: space-between; align-items: center; min-height: 28px; font-size: 17px; font-weight: 700; list-style: none; cursor: pointer; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary small { margin-left: 8px; color: var(--mute); font-size: 14px; font-weight: 400; }
details.sec > summary::after { content: "+"; color: var(--mute); font-size: 24px; font-weight: 300; }
details.sec[open] > summary { margin-bottom: 16px; }
details.sec[open] > summary::after { content: "–"; }

.side { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--gold-m); border-radius: 18px; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .05); }
.side .label { margin: 0; }
.slbl { color: var(--mute); font-size: 12.5px; font-weight: 700; }
.sprev { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; }
.sprev .nm { font-size: 18px; font-weight: var(--dw); line-height: 1.25; }
.sprev .meta { color: #333; font-size: 13.5px; font-weight: 700; }
.sprev .meta + .meta { font-weight: 500; }
.sprice { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--gold-m); border-radius: 12px; background: var(--gold-l); }
.sprice b { font-size: 30px; line-height: 1.15; white-space: nowrap; }
.sprice small { color: var(--mute); font-size: 13.5px; }
.miss { font-size: 14.5px; line-height: 1.6; }
.miss > span { color: var(--bad); font-weight: 700; }
.ready { color: var(--ok); font-size: 14.5px; font-weight: 700; }
.mbar { display: none; }

.done { margin-bottom: 16px; padding: 22px; border: 1.5px solid var(--gold-m); border-radius: 16px; background: var(--gold-l); }
.done h2 { margin: 0 0 6px; color: var(--gold-d); font-size: 20px; }
.done p { margin: 0; }
.done .nm { font-size: 20px; font-weight: var(--dw); }
.label { max-width: 460px; margin: 14px 0; }
.label svg { display: block; width: 100%; height: auto; background: #fff; border-radius: 10px; }
.label .tagimg { display: block; width: 100%; height: auto; image-rendering: auto; }

/* ---------- sprzedaż ---------- */
.scanrow { display: flex; flex-wrap: wrap; gap: 10px; }
.scanrow .inp { flex: 1 1 260px; }
.scanrow input { min-height: 58px; font-size: 20px; }
.res { display: grid; gap: 8px; margin-top: 12px; }
.res.flush { margin-top: 0; }
.item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.item.click { cursor: pointer; }
.item.click:hover { border-color: var(--gold); }
.item .nm { font-size: 17px; font-weight: var(--dw); line-height: 1.25; }
.item .meta { color: #333; font-size: 13.5px; font-weight: 700; }
.item .pr { font-size: 18px; font-weight: 700; text-align: right; white-space: nowrap; }
.sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; margin-top: 16px; }
.total { font-size: 34px; font-weight: 700; white-space: nowrap; }
.total-lbl { color: var(--mute); font-size: 13px; font-weight: 700; }
.empty { padding: 22px; border: 1.5px dashed var(--line2); border-radius: 12px; color: var(--mute); text-align: center; }

/* miniatury */
.th { display: grid; place-items: center; width: 56px; height: 56px; overflow: hidden; border-radius: 8px; background: var(--soft); }
.th.s { width: 40px; height: 40px; }
.th img, .mphoto img { width: 100%; height: 100%; object-fit: cover; }
.th svg, .mphoto svg { width: 58%; height: 58%; fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* statusy */
.chip { display: inline-block; padding: 3px 9px; border: 1.5px solid currentColor; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.st-na_stanie { color: var(--ok); }
.st-sprzedany { color: #777; }
.st-naprawa { color: var(--repair); }
.st-wycofany, .st-zwrot { color: var(--bad); }

/* ---------- tabele ---------- */
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { position: sticky; top: 0; padding: 12px; border-bottom: 1.5px solid var(--line2); background: #fff; font-size: 13px; font-weight: 700; text-align: left; white-space: nowrap; }
th[data-act] { cursor: pointer; user-select: none; }
th .ar { color: var(--mute); font-weight: 400; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th.r, td.r { text-align: right; }
td.nm { min-width: 180px; font-size: 16px; font-weight: var(--dw); white-space: normal; }
td.pm { min-width: 180px; color: #333; font-size: 13.5px; font-weight: 500; white-space: normal; }
td small { color: var(--mute); }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--gold-l); }
tr.sold td { color: #999; }
tr.sold td.nm { text-decoration: line-through; text-decoration-thickness: 1px; }

/* ---------- lista ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.stat:first-child { border-color: var(--gold-m); background: var(--gold-l); }
.stat .k { color: var(--mute); font-size: 13px; font-weight: 700; }
.stat .v { font-size: 26px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.stat .d { color: #333; font-size: 14px; font-weight: 500; }
.ltools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.ltools .inp { flex: 1 1 auto; min-width: 0; }
.livebar { margin: -2px 0 12px; color: var(--mute); font-size: 13px; }
.live { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; color: var(--ok); font-weight: 700; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(15, 122, 53, .15); }
.cnt { margin: 10px 2px; color: var(--mute); font-size: 14px; }

/* ---------- karta produktu ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding: 24px 12px; overflow-y: auto; background: rgba(0, 0, 0, .35); }
.mbox { width: 100%; max-width: 860px; padding: 22px; border-radius: 16px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.mhead { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.mhead .lbl { color: var(--mute); font-size: 13px; font-weight: 700; }
.mhead h3 { margin: 4px 0 0; font-size: 26px; font-weight: var(--dw); line-height: 1.15; }
.mgrid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
.mphoto { display: grid; place-items: center; width: 220px; height: 220px; overflow: hidden; border-radius: 12px; background: var(--soft); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; margin: 0; }
.kv div { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--mute); font-size: 12.5px; font-weight: 700; }
.kv dd { margin: 0; font-size: 16px; font-weight: 700; }
.mactions { align-items: flex-end; gap: 12px; }
.mactions .fld { max-width: 280px; }
.hist-h { margin: 20px 0 4px; font-size: 16px; }
.hist { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.hist li { display: flex; flex-wrap: wrap; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hist time { font-weight: 700; white-space: nowrap; }
.hist b { margin-left: auto; }

/* ---------- cennik ---------- */
.rates input { width: 110px; min-height: 42px; padding: 6px 10px; border: 1.5px solid var(--line2); border-radius: 8px; font-size: 16px; font-weight: var(--dw); text-align: right; }

/* ---------- komunikaty ---------- */
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 60; transform: translateX(-50%);
  max-width: min(92vw, 520px); padding: 14px 20px; border-radius: 12px; background: var(--ink); color: #fff;
  font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.toast.bad { background: var(--bad); }
.netb { position: fixed; top: 10px; left: 50%; z-index: 70; transform: translateX(-50%); max-width: 92vw; padding: 10px 16px; border-radius: 12px; background: var(--bad); color: #fff; font-size: 14px; font-weight: 600; }

/* ---------- model i wagi ---------- */
.inp.short2 { max-width: 420px; }
.wlist { display: grid; gap: 8px; }
.wrow { display: grid; grid-template-columns: 28px minmax(0, 220px) 92px 44px; gap: 10px; align-items: center; justify-content: start; }
.wrow .wn { color: var(--mute); font-weight: 700; text-align: right; }
.wrow .wp { color: var(--gold-d); font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.fld .btn.mt { margin-top: 10px; }

/* lista rozwijana modeli */
.combo { position: relative; max-width: 420px; }
.combo .inp input { padding-right: 88px; }
.cbtn { position: absolute; right: 6px; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--mute); cursor: pointer; }
.cbtn:hover { background: var(--soft); color: var(--ink); }
.cbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cbtn.clr { right: 46px; font-size: 15px; }
.clist { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 15; max-height: 300px; overflow-y: auto; padding: 6px;
  border: 1px solid var(--gold-m); border-radius: 14px; background: #fff; box-shadow: 0 16px 40px -12px rgba(29, 29, 27, .3); }
.copt { display: grid; gap: 1px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.copt b { font-weight: 600; }
.copt small { color: var(--mute); font-size: 13px; }
.copt:hover, .copt.act { background: var(--gold-l); }
.copt.act { box-shadow: inset 3px 0 0 var(--gold); }
.copt.add { display: flex; align-items: center; gap: 8px; color: var(--gold-d); font-weight: 600; }
.copt.add svg, .item .pl { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.cempty { padding: 12px; color: var(--mute); font-size: 14px; }
.mtag { display: inline-block; padding: 3px 10px; border: 1px solid var(--gold-m); border-radius: 999px; background: var(--gold-l); color: var(--gold-d); font-size: 13px; font-weight: 600; white-space: nowrap; }
.addw { display: grid; place-items: center; width: 46px; height: 46px; margin: 10px 0 0 38px; border: 1.5px dashed var(--gold); border-radius: 50%; background: #fff; color: var(--gold-d); cursor: pointer; transition: background .15s; }
.addw:hover { background: var(--gold-l); border-style: solid; }
.addw svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* metki */
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 14px; }
.lgrid .label { margin: 0; }
table.lq td { padding-block: 6px; }
.copies { width: 72px; min-height: 40px; padding: 4px 8px; border: 1px solid var(--line2); border-radius: 8px; font: inherit; text-align: right; }
.cb[disabled] { opacity: .45; cursor: default; }
#lQuick .bsel { flex: 0 1 220px; }
#lQuick select { min-height: 44px; border-radius: 999px; }

/* przełącznik z przyciskami radio */
.segopt { position: relative; display: inline-flex; }
.segopt input { position: absolute; opacity: 0; }
.segopt span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; background: #fff; font-weight: 500; cursor: pointer; }
.segopt + .segopt span { border-left: 1.5px solid var(--line2); }
.segopt input:checked + span { background: var(--ink); color: #fff; font-weight: 600; }
.segopt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: -3px; }

/* ---------- zaznaczanie i akcje zbiorcze ---------- */
th.ck, td.ck { width: 44px; padding: 0; }
.ck label { display: grid; place-items: center; min-height: 52px; cursor: pointer; }
.ck input { width: 20px; height: 20px; accent-color: var(--ink); cursor: pointer; }
tr.sel td { background: var(--gold-l); }
.bulk {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  border-top: 2px solid var(--gold); background: rgba(255, 255, 255, .98); box-shadow: 0 -8px 24px rgba(0, 0, 0, .08);
}
.bulkin { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-block: 12px; }
.bulkin > b { margin-right: 4px; }
.bulkin .bsel { flex: 0 1 230px; }
.bulkin .bsel select { min-height: 50px; }
.btn.danger { color: var(--bad); }
body:has(#bulk:not([hidden])) .toast { bottom: 96px; }
.btn.danger:hover { border-color: var(--bad); }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; }
.badge.ink { background: var(--ink); color: var(--gold); }

/* ---------- statystyki ---------- */
a.stat { color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--gold); }
.stat.warn { border-color: #f1c8c4; background: #fdf3f2; }
.stat.warn .v { color: var(--bad); }
.cb.check.on::before { content: "✓ "; color: var(--gold); }
td.wbar, th.wbar { width: 32%; min-width: 120px; }
.hbar { display: block; height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold-h), var(--gold)); }
tr.tot td { border-top: 1.5px solid var(--line2); border-bottom: 0; font-weight: 700; }
.note.nomt { margin-top: 0; }

/* ---------- wydruk (metki, dokument MM) ---------- */
#printArea { display: none; }
.pstatus { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 14.5px; color: var(--mute); }
.pstatus::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #b9b5ac; }
.pstatus.on { color: var(--ok); font-weight: 600; }
.pstatus.on::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(15, 122, 53, .15); }
.pstatus.off::before { background: var(--bad); }
.tabs a.ext { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--gold-d); }
.tabs a.ext svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* ---------- skanowanie aparatem ---------- */
.camb { padding: 0 18px; }
.camb svg { width: 20px; height: 20px; }
html.camopen, html.camopen body { overflow: hidden; }
.cam { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom)); background: #111; color: #fff; }
.cam[hidden] { display: none; }
.camtop { display: flex; align-items: center; justify-content: space-between; font-size: 17px; letter-spacing: .04em; }
.camx { width: 46px; height: 46px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; background: transparent; color: #fff; font-size: 20px; cursor: pointer; }
.camview { position: relative; width: 100%; max-height: 66vh; margin: 0 auto; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 14px; background: #000; }
.camview video { display: block; width: 100%; height: 100%; object-fit: contain; }
.camguide { position: absolute; left: 4%; right: 4%; top: 30%; height: 40%; border: 2px solid var(--gold); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .38); pointer-events: none; }
.camguide i { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #e5484d; box-shadow: 0 0 8px #e5484d; animation: camline 1.6s ease-in-out infinite alternate; }
@keyframes camline { from { transform: translateY(-34px); } to { transform: translateY(34px); } }
.camtip { margin: 0; text-align: center; font-size: 15px; line-height: 1.4; color: rgba(255, 255, 255, .85); }
.camtip.bad { color: #ffb4ab; }
.camtools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: auto; }
.camtools .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); box-shadow: none; }
.camtools .btn.ghost.on { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.camask { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 460px; margin: auto; padding: 8px 6px; text-align: center; }
.camask[hidden], .camview[hidden], .camtools[hidden], .camtip[hidden] { display: none; }
.camask h3 { margin: 0; font-size: 22px; font-weight: 600; }
.camask p { margin: 0; color: rgba(255, 255, 255, .85); font-size: 16px; line-height: 1.5; }
.camask .camsmall { font-size: 14px; color: rgba(255, 255, 255, .6); }
.camicon { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 50%; background: rgba(200, 174, 119, .18); }
.camicon svg { width: 36px; height: 36px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linejoin: round; }
.camaskbtns { display: flex; gap: 10px; width: 100%; margin-top: 6px; }
.camaskbtns .btn { flex: 1; }
.camask .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); box-shadow: none; }
.camrevoke { flex-basis: 100%; margin-top: 4px; padding: 8px; border: 0; background: none; color: rgba(255, 255, 255, .6); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .camguide i { animation: none; } }

@media print {
  body > *:not(#printArea) { display: none !important; }
  body { background: #fff; }
  html, body { margin: 0; padding: 0; }
  #printArea { display: block; }
  #printArea * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .plabel { overflow: hidden; break-after: page; page-break-after: always; }
  .plabel:last-child, .sheet:last-child { break-after: auto; page-break-after: auto; } /* bez pustej metki na końcu */
  .plabel svg, .cell svg { display: block; }
  .sheet { display: grid; grid-template-columns: repeat(4, 48.5mm); grid-auto-rows: 25.4mm; width: 210mm; height: 297mm; padding: 8.8mm 8mm 0; overflow: hidden; break-after: page; page-break-after: always; }
  .doc { color: #000; font: 11pt/1.45 Jost, Arial, sans-serif; }
  .doc h1 { margin: 0 0 6pt; font-size: 16pt; }
  .doc table { width: 100%; margin-top: 10pt; border-collapse: collapse; font-size: 10pt; }
  .doc th, .doc td { position: static; padding: 4pt 6pt; border: 1px solid #999; text-align: left; white-space: normal; }
  .doc .sign { display: flex; justify-content: space-between; margin-top: 40pt; }
  .doc .sign span { width: 40%; padding-top: 4pt; border-top: 1px solid #000; text-align: center; font-size: 9pt; }
}

/* ---------- mniejsze ekrany ---------- */
@media (max-width: 999px) {
  .addgrid { grid-template-columns: 1fr; }
  .addside { display: none; }
  .mbar {
    position: sticky; bottom: 0; z-index: 6; display: flex; gap: 12px; align-items: center; justify-content: space-between;
    padding: 10px 0; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .97);
  }
  .mbar small { display: block; font-size: 13px; font-weight: 700; line-height: 1.3; }
  .mbar small.bad { color: var(--bad); }
  .mbar small.ok { color: var(--ok); }
  .mbar b { font-size: 22px; white-space: nowrap; }
}
@media (min-width: 1000px) { .pricebox { display: none; } }
@media (max-width: 760px) {
  .mgrid { grid-template-columns: 1fr; }
  .mphoto { width: 100%; height: 240px; }
}
@media (max-width: 600px) {
  .sec { padding: 16px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .types { grid-template-columns: 1fr 1fr; }
  .brand { font-size: 18px; }
  .bar { row-gap: 10px; }
  .views { order: 3; width: 100%; }
  .views a { flex: 1; padding: 9px 8px; font-size: 14.5px; text-align: center; }
  .total { font-size: 28px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .wrow { grid-template-columns: 24px minmax(0, 1fr) auto 44px; }
  .bulkin .bsel { flex: 1 1 100%; }
  td.wbar, th.wbar { display: none; }
  .stat { padding: 10px 12px; }
  .stat .v { font-size: 20px; }
  td.nm { min-width: 140px; }
  .scanrow .inp, .ltools .inp { flex: 1 1 100%; }
  .scanrow .btn, .ltools .btn { flex: 1 1 0; padding: 0 14px; }
}
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .btn:hover { transform: none; } }

/* etap 4–5: statusy korekt, konta, dziennik ruchów */
.st-kontrola { color: var(--repair); }
.st-uszkodzony, .st-brak { color: var(--bad); }
#usersBox select, #usersBox input { min-width: 0; }
#usersBox td .inp { min-width: 130px; }
#usersBox .row.nowrap { gap: 6px; }
#movesBox tr[data-act] { cursor: pointer; }
.who .btn + .btn { margin-left: 6px; }

/* ---------- wersja 5: kruszec, modele ze zdjęciem, sztuki z długością ---------- */
.dot { display: inline-block; flex: none; width: 15px; height: 15px; margin: -2px 7px 0 0; vertical-align: middle; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), inset 0 1px 1px rgba(255, 255, 255, .7); }
.cb .dot { width: 17px; height: 17px; margin-left: -4px; }
.cb.on .dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(0, 0, 0, .18); }
.fld.lock .cb[disabled], .fld.lock select[disabled], .fld.lock input[disabled] { cursor: not-allowed; }
.fld.lock .cb[disabled]:not(.on) { opacity: .4; }
.fld.lock .cb.on[disabled] { opacity: 1; }
.fld.lock select[disabled], .fld.lock input[disabled] { background: var(--soft); color: var(--ink); opacity: 1; }
.fld label .opt { color: var(--mute); font-weight: 400; }
#modelHint .lnk { color: var(--gold-d); }
.inp.withth input { padding-left: 54px; }
.inp.withth .cth { position: absolute; left: 6px; }
.cth { display: grid; place-items: center; flex: none; width: 40px; height: 40px; overflow: hidden; border-radius: 8px; background: var(--soft); }
.cth img { width: 100%; height: 100%; object-fit: cover; }
.cth svg { width: 60%; height: 60%; fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.copt:not(.add) { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 10px; }
.copt .ctx { display: grid; gap: 1px; min-width: 0; }
.copt .ctx small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo .clist { max-height: 360px; }
.wrow.two { grid-template-columns: 28px minmax(0, 170px) minmax(0, 130px) 92px 44px; }
.wrow .xin select { padding-right: 8px; }
.chips.qx { align-items: center; margin: 10px 0 0 38px; }
.chips.qx .ql { color: var(--mute); font-size: 13.5px; font-weight: 700; margin-right: 2px; }
.photo .pv { position: relative; }
.pvtag { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(29, 29, 27, .78); color: #fff; font-size: 11.5px; font-weight: 600; }
.mphoto { position: relative; }
.plist { display: grid; gap: 2px; margin: 0; padding: 10px 12px 10px 30px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; max-height: 220px; overflow-y: auto; }
.plist li { display: flex; justify-content: space-between; gap: 10px; }
.plist b { white-space: nowrap; }
.mtbl td { vertical-align: middle; }
th.gcol { white-space: nowrap; }
@media (max-width: 600px) {
  .wrow.two { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .wrow.two .wp { grid-row: 2; grid-column: 2 / 4; margin-top: -4px; }
  .wrow.two .x { grid-row: 1; grid-column: 4; }
  .chips.qx { margin-left: 0; }
}

/* v6: instalacja jako aplikacja */
.inst { width: min(440px, 100%); margin-top: 14px; text-align: center; }
.inst .hint { font-size: 13px; color: var(--mute); margin: 8px 0 0; }
@media (display-mode: standalone) { .inst { display: none; } }
