/* LETWA — system wizualny. Kolory i fonty wg księgi znaku: Granat #0F2340, Złoty #C99A2E, Morski #0E7C86, Jasny szary #EEF1F5; Sora + Manrope. */
:root {
  --navy: #0F2340; --navy-2: #1B3358; --navy-3: #2A4670;
  --gold: #C99A2E; --gold-2: #E2B64B; --gold-soft: #F7EED8;
  --teal: #0E7C86; --teal-soft: #E1F2F3;
  --bg: #F4F6F9; --surface: #FFFFFF; --line: #E3E8EF; --line-2: #D3DAE4;
  --ink: #0F2340; --ink-2: #44546B; --ink-3: #7A889C;
  --ok: #138A5B; --ok-soft: #E3F5EC; --warn: #B7791F; --warn-soft: #FDF3E1; --bad: #C2413B; --bad-soft: #FBE9E8;
  --r: 14px; --r-sm: 10px; --shadow: 0 1px 2px rgba(15,35,64,.06), 0 4px 16px rgba(15,35,64,.06); --shadow-lg: 0 12px 40px rgba(15,35,64,.18);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --display: 'Sora', 'Manrope', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.01em; margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: clamp(26px, 4.6vw, 44px); font-weight: 800; }
h2 { font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 .8em; }
.ic { flex: none; vertical-align: middle; }
.muted { color: var(--ink-3); } .small { font-size: 13px; } .tiny { font-size: 12px; } .b { font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.price { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.row { display: flex; gap: 12px; align-items: center; } .row.wrap-it { flex-wrap: wrap; } .row.top { align-items: flex-start; } .row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: var(--navy); color: #fff; font-weight: 700; cursor: pointer; transition: transform .06s, background .15s, box-shadow .15s; white-space: nowrap; text-align: center; }
.btn:hover { background: var(--navy-2); } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.gold { background: var(--gold); color: var(--navy); } .btn.gold:hover { background: var(--gold-2); }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line-2); } .btn.ghost:hover { background: #fff; border-color: var(--navy-3); }
.btn.soft { background: var(--bg); color: var(--navy); } .btn.soft:hover { background: var(--line); }
.btn.teal { background: var(--teal); } .btn.ok { background: var(--ok); } .btn.bad { background: var(--bad); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; } .btn.lg { height: 54px; font-size: 16px; padding: 0 24px; border-radius: 14px; }
.btn.block { width: 100%; } .btn.icon { width: 44px; padding: 0; } .btn.sm.icon { width: 34px; }
.link { color: var(--teal); font-weight: 700; cursor: pointer; background: none; border: 0; padding: 0; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; outline: none; transition: border .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(14,124,134,.15); }
.input.err { border-color: var(--bad); }
.err-text { color: var(--bad); font-size: 12px; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; line-height: 1.45; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--navy); flex: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* Cards & chips */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad { padding: 18px; } .card.pad-lg { padding: 24px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.gold { background: var(--gold-soft); color: #8A6512; } .chip.teal { background: var(--teal-soft); color: var(--teal); } .chip.navy { background: var(--navy); color: #fff; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--gold); color: var(--navy); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--teal-soft); color: #0B5C63; font-size: 14px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); color: #7A5113; } .notice.bad { background: var(--bad-soft); color: #8E2A25; } .notice.ok { background: var(--ok-soft); color: #0E6644; } .notice.gold { background: var(--gold-soft); color: #6E500E; }

/* Product tile visual */
.pimg { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.pimg .ic { width: 42%; height: 42%; stroke-width: 1.5; }
.pimg img { width: 100%; height: 100%; object-fit: cover; }
.pimg .tag { position: absolute; left: 8px; top: 8px; }

/* Toast & modal */
#toasts { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; animation: up .25s ease; display: flex; gap: 10px; align-items: center; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; background: rgba(10,22,40,.5); z-index: 90; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal.wide { width: min(880px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-b { padding: 20px; } .modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }

/* Timeline */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl li { position: relative; padding: 0 0 16px 30px; }
.tl li::before { content: ''; position: absolute; left: 9px; top: 20px; bottom: -2px; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl .dot { position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--line); display: grid; place-items: center; color: #fff; }
.tl li.done .dot { background: var(--ok); } .tl li.done::before { background: var(--ok); }
.tl li.now .dot { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.tl li.todo { color: var(--ink-3); }
.tl .t { font-weight: 700; font-size: 14px; } .tl .d { font-size: 12px; color: var(--ink-3); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; } .table tr.click:hover td { background: #FAFBFD; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #EEF1F5 25%, #F7F9FB 50%, #EEF1F5 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-3); }
.empty .ic { width: 48px; height: 48px; color: var(--line-2); margin-bottom: 10px; }
.kbd { font-family: ui-monospace, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.seg { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 700; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 13px; }
