/* Layout: app shell with a left sidebar (collapsible to icons, slide-out on phones); the quote editor is a two-column workbench — form on the left, catalog picker + live totals on the right — with an A4 paper preview tab. */
:root {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --ink: #0f1216;
  --muted: #5a616c;
  --line: #e1e4e9;
  --line-strong: #c5cad2;
  --accent: #2f49d1;
  --accent-ink: #ffffff;
  --accent-soft: #e9ecfc;
  --focus: #2f49d1;
  --ok: #1b7a4b; --ok-soft: #e2f3e9;
  --warn: #9a6200; --warn-soft: #fcf1d6;
  --bad: #c0352e; --bad-soft: #fbe6e4;
  --info: #0a6c85; --info-soft: #e0f1f5;
  --shadow: 0 1px 0 rgba(15,18,22,.03);
  /* ciemny pasek menu – w obu motywach */
  --side-bg: #12151a; --side-ink: #eef0f3; --side-muted: #959dab; --side-hover: rgba(255,255,255,.06); --side-act: rgba(255,255,255,.1); --side-line: rgba(255,255,255,.08); --side-accent: #a3b0ff;
  /* paper is always paper: fixed print colors, deliberately theme-independent */
  --paper: #ffffff; --paper-ink: #1c2226; --paper-muted: #66717a; --paper-line: #dfe3e6; --paper-soft: #f4f6f7;
  --f-display: "Geologica", "Segoe UI", Roboto, Arial, sans-serif;
  --f-body: "Golos Text", "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: "Golos Text", "Segoe UI", Roboto, Arial, sans-serif;
  --r: 4px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e1013; --surface: #16191e; --surface-2: #1c2026; --ink: #e9ebef; --muted: #9ba3ae; --line: #282d35; --line-strong: #3b424c;
  --accent: #8c9cff; --accent-ink: #0b0f2a; --accent-soft: #1e2444; --focus: #a3b0ff;
  --ok: #5fcf92; --ok-soft: #16301f; --warn: #e8c15a; --warn-soft: #362d14; --bad: #f08a84; --bad-soft: #3a1f1d; --info: #6ccbe0; --info-soft: #132c33;
  --shadow: 0 1px 0 rgba(0,0,0,.2);
  --side-bg: #0a0c0f;
  color-scheme: dark;
} }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  --bg: #0e1013; --surface: #16191e; --surface-2: #1c2026; --ink: #e9ebef; --muted: #9ba3ae; --line: #282d35; --line-strong: #3b424c;
  --accent: #8c9cff; --accent-ink: #0b0f2a; --accent-soft: #1e2444; --focus: #a3b0ff;
  --ok: #5fcf92; --ok-soft: #16301f; --warn: #e8c15a; --warn-soft: #362d14; --bad: #f08a84; --bad-soft: #3a1f1d; --info: #6ccbe0; --info-soft: #132c33;
  --shadow: 0 1px 0 rgba(0,0,0,.2);
  --side-bg: #0a0c0f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--f-body); }

h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 15px; font-weight: 600; }
.wrap { max-width: 1320px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 56px; flex-wrap: wrap; padding-block: 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 700; font-size: 16px; }
.brand-mark { width: 28px; height: 28px; border-radius: 5px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-family: var(--f-mono); font-size: 12px; font-weight: 500; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { padding: 7px 12px; border-radius: var(--r); color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 500; white-space: nowrap; }

main { padding-block: 22px 60px; }
.banner { margin-bottom: 16px; padding: 10px 14px; border-radius: var(--r); background: var(--warn-soft); color: var(--ink); border: 1px solid var(--line); }
.banner.info { background: var(--info-soft); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 65ch; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn.icon { padding: 4px 8px; min-width: 30px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label.f, div.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
label.f > span, div.f > span { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
input[type=text], input[type=email], input[type=date], input[type=search], input[type=tel], input[type=password], input[type=time], input[type=number], input[type=url], input:not([type]), select, textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); min-width: 0;
}
textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
input:disabled, textarea:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
input.r { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 720px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } .span2 { grid-column: auto; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card > .body { padding: 16px; }
.eyebrow { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* tables */
.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--surface-2); }
.sub { color: var(--muted); font-size: 12px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-family: var(--f-display); font-size: 16px; margin-bottom: 4px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-draft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.st-sent { background: var(--info-soft); color: var(--info); }
.st-accepted { background: var(--ok-soft); color: var(--ok); }
.st-rejected { background: var(--bad-soft); color: var(--bad); }
.tag-ex { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); font-weight: 500; margin-left: 6px; }

/* stats strip */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.stats > div { background: var(--surface); padding: 12px 16px; }
.stats b { display: block; font-family: var(--f-mono); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { width: 260px; max-width: 100%; }
.toolbar select { width: auto; }

/* editor */
.ed-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ed-head .ttl { display: flex; flex-direction: column; min-width: 0; }
.ed-head .ttl .mono { font-size: 13px; color: var(--muted); }
.ed-head .grow { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 13px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.save-state { font-size: 12px; color: var(--muted); min-width: 92px; }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.ed-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ed-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); min-width: 0; }
@media (max-width: 1000px) { .ed-grid { grid-template-columns: minmax(0, 1fr); } .ed-side { position: static; } }

table.lines td { padding: 6px 8px; vertical-align: top; }
table.lines th { padding: 8px; }
table.lines input { padding: 5px 7px; }
table.lines .c-name { min-width: 230px; }
table.cab .c-len { width: 120px; } table.cab .c-qty { width: 84px; }
table.cab select { min-width: 210px; }
table.cab td .sub { margin-top: 3px; }
.sub.bad, .hint.bad { color: var(--bad); }
table.cab-prices td input { min-width: 64px; }
table.cab-prices th[colspan] { text-align: right; border-bottom: 1px solid var(--line); }
table.lines .c-name input + input { margin-top: 4px; font-size: 12px; color: var(--muted); }
table.lines .c-qty { width: 78px; } table.lines .c-unit { width: 64px; } table.lines .c-price { width: 112px; } table.lines .c-disc { width: 70px; }
table.lines .c-tot { width: 120px; text-align: right; padding-top: 11px; white-space: nowrap; }
table.lines .c-act { width: 1%; white-space: nowrap; padding-top: 8px; }
table.lines tr.grp td { background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; letter-spacing: .03em; }
.line-actions { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.picker-list { max-height: 340px; overflow-y: auto; border-top: 1px solid var(--line); }
/* katalog pozycji w edytorze wyceny – wyróżniony akcentem marki */
.ic-cat { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; vertical-align: -3px; }
.pick-card { border-top: 3px solid var(--accent); scroll-margin-top: 84px; }
.pick-card header { align-items: flex-start; background: var(--accent-soft); }
.pick-card h2 { display: flex; align-items: center; gap: 8px; }
.pick-card h2 .ic-cat { color: var(--accent); width: 18px; height: 18px; }
.pick-card h2 .cnt { font-family: var(--f-mono); font-size: 11px; font-weight: 500; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.pick-card h2 .cnt:empty { display: none; }
.pick-hint { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.pick-hint b { color: var(--accent); }
.pick-q { padding: 12px 14px 10px; }
.pick .btn[data-add] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; min-width: 32px; }
.pick .btn[data-add]:hover { background: var(--accent); color: var(--accent-ink); }
.pick:hover { background: var(--surface-2); }
.btn.cat-go { border-color: var(--accent); color: var(--accent); gap: 6px; }
.btn.cat-go:hover { background: var(--accent-soft); }
.pick-card.flash { animation: pickFlash 1.2s ease-out; }
@keyframes pickFlash { 0% { box-shadow: 0 0 0 0 var(--accent); } 30% { box-shadow: 0 0 0 4px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pick-card.flash { animation: none; outline: 3px solid var(--accent); } }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.pick:last-child { border-bottom: 0; }
.pick .nm { flex: 1; min-width: 0; }
.pick .nm div { overflow: hidden; text-overflow: ellipsis; }
.pick .pr { font-family: var(--f-mono); font-size: 12px; white-space: nowrap; color: var(--muted); }
.cats { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.cats button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer; color: var(--muted); }
.cats button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); background: var(--surface-2); }

.sum { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13px; }
.sum dt { color: var(--muted); }
.sum dd { margin: 0; text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.sum .big { font-size: 20px; color: var(--ink); font-weight: 500; }
.sum hr { grid-column: 1 / -1; border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.monthly { margin-top: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--line); }
.t.lines tr.grp-sub td { color: var(--accent); }
.of-subhead { margin-top: 6px; }
.internal { margin-top: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px dashed var(--line-strong); }
.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--ok); }

/* preview */
.preview { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 24px 16px; overflow: hidden; }
.preview .pages { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.preview .pages > .sheet { box-shadow: 0 2px 12px rgba(0,0,0,.18); }
#measure { position: absolute; left: -12000px; top: 0; width: 794px; }

/* A4 sheet (96 dpi: 794 × 1123) */
.sheet { width: 794px; height: 1123px; background: var(--paper); color: var(--paper-ink); padding: 52px 58px 34px; display: flex; flex-direction: column; font: 10.5pt/1.45 var(--f-body); flex: none; }
.sheet .sb { flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 0; }
.sheet .sb > * + * { margin-top: 14px; }
.sheet .sf { border-top: 1px solid var(--paper-line); padding-top: 8px; display: flex; justify-content: space-between; gap: 12px; color: var(--paper-muted); font-size: 7.5pt; }
.of-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 14px; border-bottom: 3px solid var(--brand, #1f3a5f); }
.of-head img { max-height: 64px; max-width: 220px; display: block; }
.of-head .co-name { font-family: var(--f-display); font-weight: 700; font-size: 15pt; color: var(--brand, #1f3a5f); }
.of-head .co { text-align: right; font-size: 8.5pt; color: var(--paper-muted); white-space: pre-line; }
.of-head .co b { color: var(--paper-ink); font-size: 9.5pt; }
.of-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.of-title h1 { font-size: 21pt; color: var(--paper-ink); letter-spacing: .01em; }
.of-title .meta { text-align: right; font-size: 9pt; color: var(--paper-muted); }
.of-title .meta b { color: var(--paper-ink); font-family: var(--f-mono); font-weight: 500; }
.of-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.of-parties > div { background: var(--paper-soft); padding: 10px 12px; border-radius: 4px; font-size: 9.5pt; white-space: pre-line; }
.of-lbl { display: block; font-size: 7.5pt; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-muted); margin-bottom: 3px; font-weight: 600; }
.of-subject { font-family: var(--f-display); font-weight: 600; font-size: 12.5pt; }
.of-intro { white-space: pre-line; }
table.of-t { width: 100%; border-collapse: collapse; font-size: 9pt; }
table.of-t th { background: var(--brand, #1f3a5f); color: #fff; font-weight: 600; text-align: left; padding: 6px 7px; font-size: 8pt; letter-spacing: .02em; }
table.of-t td { padding: 6px 7px; border-bottom: 1px solid var(--paper-line); vertical-align: top; }
table.of-t .r { text-align: right; white-space: nowrap; font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 8.5pt; }
table.of-t .lp { width: 26px; color: var(--paper-muted); }
table.of-t tr.grp td { background: var(--paper-soft); font-weight: 600; font-size: 8.5pt; letter-spacing: .04em; text-transform: uppercase; color: var(--paper-muted); }
table.of-t .d { color: var(--paper-muted); font-size: 8pt; }
.of-sum { margin-left: auto; width: 290px; font-size: 9.5pt; }
.of-sum div { display: flex; justify-content: space-between; padding: 3px 0; }
.of-sum div span:last-child { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.of-sum .tot { border-top: 2px solid var(--brand, #1f3a5f); margin-top: 4px; padding-top: 6px; font-weight: 600; font-size: 11.5pt; }
.of-terms { display: grid; grid-template-columns: 150px 1fr; gap: 4px 14px; font-size: 9.5pt; }
.of-terms dt { color: var(--paper-muted); }
.of-terms dd { margin: 0; white-space: pre-line; }
.of-small { font-size: 8.5pt; color: var(--paper-muted); white-space: pre-line; }
.of-sign { display: flex; justify-content: flex-end; }
.of-sign > div { width: 230px; text-align: center; font-size: 9pt; padding-top: 40px; border-bottom: 1px dotted var(--paper-muted); padding-bottom: 4px; }
.of-sign small { display: block; color: var(--paper-muted); font-size: 7.5pt; margin-top: 4px; }

/* catalog & settings */
.two { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .two { grid-template-columns: minmax(0, 1fr); } }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.hint code { font-family: var(--f-mono); background: var(--surface-2); padding: 0 4px; border-radius: 3px; }
.logo-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-box img { max-height: 56px; max-width: 200px; background: #fff; padding: 4px; border: 1px solid var(--line); border-radius: 4px; }
details.imp summary { cursor: pointer; font-weight: 500; }
.toast { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r); box-shadow: var(--shadow); z-index: 20; max-width: min(420px, calc(100vw - 32px)); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: tin .18s ease-out; } @keyframes tin { from { transform: translateY(6px); opacity: .4; } } }

/* standalone version: login and account */
html, body { margin: 0; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); }
.login .card { width: 100%; max-width: 380px; }
.login h1 { font-size: 20px; margin-bottom: 4px; }
.login .err { color: var(--bad); font-size: 13px; min-height: 1.2em; margin: 0; }
.who a, .who button { color: var(--muted); }
.who .btn { padding: 4px 10px; font-size: 13px; }
/* client / partner type */
.tp { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tp-client { background: var(--info-soft); color: var(--info); }
.tp-partner { background: var(--accent-soft); color: var(--accent); }
.seg .cnt { font-family: var(--f-mono); font-size: 11px; opacity: .7; margin-left: 2px; }
#kfType { align-self: flex-start; }
/* theme switch */
.logo img { display: block; height: 30px; width: auto; }
.login-logo img { height: 40px; }
.logo .logo-d { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo .logo-l { display: none; } :root:not([data-theme="light"]) .logo .logo-d { display: block; } }
:root[data-theme="dark"] .logo .logo-l { display: none; }
:root[data-theme="dark"] .logo .logo-d { display: block; }
.theme-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.theme-btn .ic { font-size: 14px; line-height: 1; }
.login-theme { position: fixed; top: 14px; right: 16px; color: var(--muted); }
@media (max-width: 720px) { .who .theme-btn .lbl { display: none; } }
.top { top: 0; }
.warn-t { color: var(--warn); font-size: 12px; }
.pre { white-space: pre-line; }
/* ===== app shell: left sidebar ===== */
.shell { --side-w: 248px; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side-mini .shell { --side-w: 68px; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); z-index: 15; min-width: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 14px 16px; min-height: 60px; border-bottom: 1px solid var(--line); }
.side-logo img { height: 26px; }
.side-logo .logo-m { display: none; }
.side-tgl { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--r); background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.side-tgl:hover { background: var(--surface-2); color: var(--ink); }
.ni { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.snav { flex: 1; overflow-y: auto; padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.snav-lbl { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; white-space: nowrap; overflow: hidden; }
.snav a, .snav-btn, .side-user { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r); color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; min-width: 0; border: 0; background: transparent; cursor: pointer; width: 100%; text-align: left; font-size: 14px; }
.snav a:hover, .snav-btn:hover, .side-user:hover { background: var(--surface-2); color: var(--ink); }
.snav a[aria-current="page"], .side-user[aria-current="page"] { background: var(--accent-soft); color: var(--ink); }
.snav a[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.snav a[aria-current="page"] .ni { color: var(--accent); }
.lbl { overflow: hidden; text-overflow: ellipsis; }
.side-foot { border-top: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.snav-btn .ic { width: 19px; text-align: center; font-size: 15px; line-height: 1; flex: none; }
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-family: var(--f-mono); font-size: 11.5px; font-weight: 500; flex: none; margin-left: -5px; }
.su-t { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.su-t b { color: var(--ink); font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.su-t small { font-size: 12px; color: var(--muted); }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.main-col main.wrap { width: 100%; }
.mbar { display: none; }
.side-scrim { position: fixed; inset: 0; background: rgba(10,15,18,.45); z-index: 14; }
.ed-side { top: 16px; }

/* collapsed (icons only) – desktop only */
@media (min-width: 901px) {
  .side-mini .side-head { flex-direction: column; padding: 12px 8px; gap: 8px; }
  .side-mini .side-logo .logo-l, .side-mini .side-logo .logo-d { display: none !important; }
  .side-mini .side-logo .logo-m { display: block; height: 30px; }
  .side-mini .snav-lbl { font-size: 0; padding: 10px 0 4px; }
  .side-mini .snav-lbl::after { content: ""; display: block; height: 1px; background: var(--line); margin: 0 6px; }
  .side-mini .snav a, .side-mini .snav-btn, .side-mini .side-user { justify-content: center; padding: 9px 0; }
  .side-mini .lbl { display: none; }
  .side-mini .av { margin-left: 0; }
}

/* phones & tablets: slide-out menu */
@media (max-width: 900px) {
  .shell, .side-mini .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); height: auto; transform: translateX(-102%); box-shadow: 0 0 40px rgba(0,0,0,.25); visibility: hidden; }
  .side.open { transform: none; visibility: visible; }
  #sideTgl { display: none; }
  .mbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); padding: calc(8px + env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 8px max(10px, env(safe-area-inset-left, 0px)); min-height: 52px; }
  .side-tgl#menuBtn { color: var(--ink); }
  .mbar-t { flex: 1; font-family: var(--f-display); font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mbar-logo img { height: 28px; width: auto; display: block; }
  .ed-side { top: 64px; }
}
@media (max-width: 900px) and (prefers-reduced-motion: no-preference) { .side { transition: transform .2s ease, visibility .2s; } }
/* ===== dashboard ===== */
.dash-head { align-items: flex-end; }
.dash-head .seg button { white-space: nowrap; }
@media (max-width: 620px) { .dash-head .seg button { padding: 6px 9px; font-size: 13px; } .kpi b { font-size: 18px; } .bars { padding-left: 70px; } .bars-grid span { margin-left: 70px; } .bars-cols { gap: 3px; } }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1250px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 12px 14px; min-width: 0; color: inherit; text-decoration: none; position: relative; overflow: hidden; }
.kpi b { font-family: var(--f-mono); font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.3; overflow-wrap: anywhere; }
.kpi .sub { overflow-wrap: anywhere; }
.kpi.k-info::before, .kpi.k-ok::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--info); }
.kpi.k-ok::before { background: var(--ok); }
a.kpi:hover { border-color: var(--line-strong); }
.dash-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.dash-row.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .dash-row, .dash-row.even { grid-template-columns: minmax(0, 1fr); } }
.dash-rank { margin-bottom: 16px; }
.card > .body.flush { padding: 0; }
/* status colours shared by chart, legend, bars */
.b-accepted { background: var(--ok); } .b-sent { background: var(--info); } .b-rejected { background: var(--bad); } .b-draft { background: var(--line-strong); }
/* monthly stacked bars */
.bars { position: relative; height: 220px; padding-left: 86px; }
.bars-grid { position: absolute; left: 0; right: 0; top: 0; bottom: 22px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.bars-grid span { display: block; height: 0; border-top: 1px solid var(--line); margin-left: 86px; position: relative; }
.bars-grid em { position: absolute; right: calc(100% + 8px); top: -8px; font-style: normal; font-family: var(--f-mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.bars-cols { position: relative; height: 100%; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.bcol { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; padding-bottom: 22px; position: relative; outline-offset: 2px; border-radius: 4px; }
.bcol:hover, .bcol:focus-visible { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.bstack { width: min(100%, 30px); display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.bstack i { display: block; min-height: 2px; }
.bstack i:first-child { border-radius: 4px 4px 0 0; }
.blbl { position: absolute; bottom: 2px; font-size: 11px; color: var(--muted); }
.blbl.cur { color: var(--ink); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 12px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
/* status bars */
.sbars { display: flex; flex-direction: column; gap: 4px; }
.sbar { display: grid; grid-template-columns: 118px minmax(0, 1fr) 28px auto; align-items: center; gap: 10px; padding: 6px 6px; border-radius: var(--r); color: inherit; text-decoration: none; }
.sbar:hover { background: var(--surface-2); }
.sbar .st { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.sbar .st i { display: block; height: 100%; border-radius: 4px; min-width: 2px; }
.sbar .sv { text-align: right; font-weight: 500; }
.sbar .sm { font-size: 12px; color: var(--muted); text-align: right; min-width: 92px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.mini-stats a { display: flex; flex-direction: column; color: inherit; text-decoration: none; padding: 6px 8px; border-radius: var(--r); min-width: 0; }
.mini-stats a:hover { background: var(--surface-2); }
.mini-stats b { font-size: 18px; font-weight: 500; }
.mini-stats span { font-size: 12px; color: var(--muted); }
/* ranking */
table.rank tr.me td { background: var(--accent-soft); }
.who-c { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.av.sm { width: 26px; height: 26px; font-size: 10.5px; margin: 0; }
.rbar { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.rbar .rt { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.rbar .rt i { display: block; height: 100%; background: var(--ok); border-radius: 4px; min-width: 2px; }
.rbar .num { font-size: 13px; min-width: 96px; text-align: right; }
/* lists */
.alist { list-style: none; margin: 0; padding: 0; }
.alist li + li { border-top: 1px solid var(--line); }
.alist a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: inherit; text-decoration: none; }
.alist a:hover { background: var(--surface-2); }
.alist .at { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.alist .a1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alist .at b { font-family: var(--f-mono); font-weight: 500; font-size: 13px; }
.alist .ar { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.d-bad { background: var(--bad); } .d-warn { background: var(--warn); } .d-muted { background: var(--line-strong); }
.sm-empty { padding: 26px 16px; }
.alist + .hint { padding: 0 16px 12px; }
/* organizations */
.checks { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.checks label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; cursor: pointer; }
.row-check { flex-direction: row !important; align-items: center; gap: 8px; }
.row-check > span { color: var(--ink) !important; font-size: 13px !important; letter-spacing: 0 !important; }
.fs { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 12px; margin: 4px 0 0; display: grid; gap: 10px; min-width: 0; }
.fs legend { font-size: 12px; color: var(--muted); font-weight: 500; padding: 0 4px; }
.inline { display: flex; gap: 6px; align-items: center; }
.inline input { flex: 1; min-width: 0; }
.org-extra { border-top: 1px solid var(--line); }
table.t tr.sel td { background: var(--accent-soft); }
#orgTable td:first-child { min-width: 180px; }
/* role tags */
.role { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.r-super { background: var(--accent-soft); color: var(--accent); }
.r-admin { background: var(--info-soft); color: var(--info); }
.r-sales { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
/* product attributes */
.attr-rows { display: flex; flex-direction: column; gap: 6px; }
.attr-rows:empty { display: none; }
.attr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 6px; align-items: center; }
.attr-add { align-self: flex-start; margin-top: 2px; }
#catTable td:first-child { min-width: 240px; }
.attrs, .ln-attrs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.attrs .at, .ln-attrs .at { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 1px 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.attrs .ak, .ln-attrs .ak { color: var(--muted); }
.attrs b, .ln-attrs b { font-weight: 500; }
.at-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; font-size: 13px; line-height: 1; }
.at-x:hover { color: var(--bad); }
/* editor save bar */
.ed-bar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; padding: 8px 10px 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
@media (max-width: 900px) { .ed-bar { top: 52px; } }
.ed-bar .grow { flex: 1; }
.save-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.ss-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.ss-ok { color: var(--ok); }
.ss-busy { color: var(--warn); }
.ss-new { color: var(--info); }
.ss-err { color: var(--bad); }
@media (prefers-reduced-motion: no-preference) { .ss-busy .ss-dot { animation: ssp 1s ease-in-out infinite; } @keyframes ssp { 50% { opacity: .35; } } }
/* status select (list + editor) */
.st-sel { width: auto; padding: 3px 26px 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; cursor: pointer; border: 1px solid transparent; }
.st-sel.st-draft { background-color: var(--surface-2); color: var(--muted); border-color: var(--line); }
.st-sel.st-sent { background-color: var(--info-soft); color: var(--info); }
.st-sel.st-accepted { background-color: var(--ok-soft); color: var(--ok); }
.st-sel.st-rejected { background-color: var(--bad-soft); color: var(--bad); }
.st-sel option { background: var(--surface); color: var(--ink); }
.ed-head .st-sel { padding-block: 6px; font-size: 13px; }
/* offer type */
.mode-card { margin-bottom: 16px; }
.mode-row { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.mode-pick { display: flex; flex-direction: column; gap: 6px; }
.mode-desc { margin: 0; flex: 1 1 280px; font-size: 13px; color: var(--muted); }
.mode-desc b { color: var(--ink); font-weight: 600; }
.mode-single { border-top: 1px solid var(--line); padding-top: 14px; }
/* purchasing */
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }
.sec-h h2 { font-size: 15px; }
.ptn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 12px; margin-bottom: 18px; }
.ptn-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ptn-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.ptn-top { display: flex; flex-direction: column; min-width: 0; }
.ptn-top b { font-family: var(--f-display); font-size: 15px; overflow-wrap: anywhere; }
.ptn-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.ptn-stats b { color: var(--ink); font-weight: 500; }
.ptn-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.banner.warn-b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.banner .grow { flex: 1; }
.tag-low { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); font-weight: 500; white-space: nowrap; }
table.t tr.low td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.o-contact { font-size: 13px; padding-top: 7px; overflow-wrap: anywhere; }
.o-only { padding: 0 14px 8px; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.st-sel.os-draft { background-color: var(--surface-2); color: var(--muted); border-color: var(--line); }
.st-sel.os-sent { background-color: var(--info-soft); color: var(--info); }
.st-sel.os-confirmed { background-color: var(--accent-soft); color: var(--accent); }
.st-sel.os-delivered { background-color: var(--ok-soft); color: var(--ok); }
.st-sel.os-cancelled { background-color: var(--bad-soft); color: var(--bad); }
/* client card */
.kc-grid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .kc-grid { grid-template-columns: minmax(0, 1fr); } }
.kc-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kc-main { min-width: 0; }
.kc-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1250px) { .kc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kvs { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.kv { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.people li { display: flex; gap: 10px; align-items: flex-start; }
.people .pp { min-width: 0; }
.people .pc { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.av { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tag-main { font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--info-soft); color: var(--info); font-weight: 500; }
.stars { color: var(--line-strong); letter-spacing: 1px; white-space: nowrap; font-size: 13px; }
.stars .on { color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; font-size: 14px; line-height: 1; }
.chips .chip button:hover { color: var(--bad); }
.kc-hint { margin: 0; padding: 0 16px 14px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.st-sel.pill { display: inline-block; cursor: default; padding-right: 10px; background-image: none; white-space: nowrap; }
a.cli-name { color: inherit; font-weight: 500; text-decoration: none; }
a.cli-name:hover { color: var(--accent); text-decoration: underline; }
.kc-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kc-edit > .card:first-child { grid-row: span 2; }
@media (max-width: 1000px) { .kc-edit { grid-template-columns: minmax(0, 1fr); } .kc-edit > .card:first-child { grid-row: auto; } }
.kc-edit > .card { min-width: 0; }
.rep { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 10px; }
.rep:empty { margin: 4px 0 6px; }
.rep-row.addr { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 8px; align-items: end; }
@media (max-width: 620px) { .rep-row.addr { grid-template-columns: minmax(0, 1fr) auto; } .rep-row.addr > :first-child { grid-column: 1 / -1; } }
.rep-row.person { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 12px; }
.rep-row.person .ph { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.rep-row.person .ph .grow { flex: 1; }
.rep-row.person:first-child { border-color: var(--info); }
.star-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-height: 36px; min-width: 0; }
.star-pick button[data-r]:not(.btn) { border: 0; background: none; font-size: 24px; line-height: 1; color: var(--line-strong); cursor: pointer; padding: 0 2px; }
.star-pick button[data-r]:not(.btn).on { color: var(--warn); }
@media (hover: hover) {
  .star-pick:has(button[data-r]:not(.btn):hover) button[data-r]:not(.btn) { color: var(--warn); }
  .star-pick button[data-r]:not(.btn):hover ~ button[data-r]:not(.btn) { color: var(--line-strong); }
}
.star-pick .btn { margin-left: 8px; }
/* jobs (Zlecenia) */
.st-sel.js-new { background-color: var(--surface-2); color: var(--muted); border-color: var(--line); }
.st-sel.js-planned { background-color: var(--info-soft); color: var(--info); }
.st-sel.js-progress { background-color: var(--accent-soft); color: var(--accent); }
.st-sel.js-paused { background-color: var(--warn-soft); color: var(--warn); }
.st-sel.js-done { background-color: var(--ok-soft); color: var(--ok); }
.st-sel.js-cancelled { background-color: var(--bad-soft); color: var(--bad); }
.prog { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.prog-bar { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.prog-bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.job-todo { display: flex; flex-direction: column; gap: 8px; }
.job-todo .jt-h { display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: baseline; }
.job-todo ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.job-todo li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-todo .jt-c { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.job-todo .hint { margin: 0; }
.jboard { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 10px; padding: 12px; overflow-x: auto; }
.jcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; min-height: 140px; min-width: 0; }
.jcol.over { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.jcol-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; }
.jcol-b { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 8px; flex: 1; }
.jcol-e { text-align: center; padding: 12px 0; }
.jcard { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; box-shadow: var(--shadow); min-width: 0; overflow-wrap: anywhere; }
.jcard:hover, .jcard:focus-visible { border-color: var(--line-strong); }
.jcard.hi { border-left: 3px solid var(--warn); }
.jcard.drag { opacity: .5; }
.jcard b { font-weight: 500; font-size: 13.5px; }
.jc-t { display: flex; justify-content: space-between; gap: 6px; }
.jc-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.jc-f .av { margin-left: auto; }
.av.sm { width: 24px; height: 24px; font-size: 10px; }
.stages { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.stage input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ok); margin: 0; }
.stage.done .s-name { text-decoration: line-through; color: var(--muted); }
.stage .s-act { display: flex; gap: 2px; }
.stage-empty { padding: 4px 0 8px; }
.stage-add { display: flex; gap: 8px; }
.stage-add input { flex: 1; min-width: 0; }
.jb-done { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.jb-done span { flex: 1; }
#jSide:empty { display: none; }
.card > header .toolbar { min-width: 0; max-width: 100%; }
#jobStF { max-width: 100%; overflow-x: auto; }
#jobStF button { white-space: nowrap; flex: none; }
#edJob:empty { display: none; }
[hidden] { display: none !important; }
img { max-width: 100%; }

/* ---------- Produkcja ---------- */
.kpi.k-warn::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--warn); }
@media (prefers-reduced-motion: no-preference) { .live-dot { animation: livePulse 2s ease-out infinite; } }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
.st-card.busy { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); background: var(--surface); box-shadow: inset 3px 0 0 var(--ok); }
.st-card.busy .st-state { color: var(--ok); font-weight: 500; }
@media (max-width: 1100px) { .prod-two { grid-template-columns: minmax(0, 1fr); } }
.wn-notes .pre { white-space: pre-wrap; margin-top: 6px; font-size: 13.5px; }
.chk { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.chk input { width: 20px; height: 20px; accent-color: var(--ok); margin: 0; }
/* stanowisko etapu: druga linia pod nazwą etapu, żeby nazwa nie była ściśnięta */
.stage:has(.s-meta) { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 4px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.stage .s-meta { grid-column: 2 / -1; grid-row: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.stage .s-st { width: auto; max-width: 100%; font-size: 12.5px; padding-top: 3px; padding-bottom: 3px; color: var(--muted); }
.stage:has(.s-meta) > input[type=checkbox] { grid-row: 1; }
.stage:has(.s-meta) .s-act { grid-column: 3; grid-row: 1; }
.pb.we i { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
@media (max-width: 620px) { .pb-v { display: none; } .work-clock { font-size: 22px; } .prod-tabs { width: 100%; } .prod-tabs button { flex: 1; padding: 7px 6px; } }
/* przy niskim oknie menu przewija się zamiast ściskać etykiety grup */
.snav > * { flex-shrink: 0; }

/* ---------- Produkcja v2: zespół, rejestracja, raporty, dane ---------- */
@media (max-width: 1100px) { .hala-grid { grid-template-columns: minmax(0, 1fr); } }
.chip { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.on { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); color: var(--ok); font-weight: 500; }
@media (max-width: 900px) { .reg-two { grid-template-columns: minmax(0, 1fr); } .reg-list .roster { max-height: 260px; overflow-y: auto; } }
.prod-tb .grow { flex: 1; }
.kpi b small { font-size: 13px; }
.legend { display: flex; gap: 14px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.t td.c-code { white-space: nowrap; font-size: 12.5px; }
.ln-code { margin-top: 3px; font-size: 12px; }

/* login: zakładanie konta z kodem */
.login-alt { text-align: center; margin: 2px 0 0; }
.login .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* płatności i plany */
.bill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 16px; align-items: start; }
.plan-now { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plan-name { font-family: var(--f-display); font-size: 26px; font-weight: 700; }
.promo-redeem { margin-top: 14px; }
.promo-redeem input { flex: 1; min-width: 0; }
.bill-h { font-size: 13px; margin: 18px 0 6px; color: var(--muted); font-weight: 600; }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.plan-card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.plan-card.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pc-name { font-family: var(--f-display); font-size: 18px; font-weight: 700; }
.pc-price b { font-size: 22px; font-family: var(--f-display); }
.pc-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }
.seat-line { padding: 10px 14px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.seat-line b { color: var(--ink); }
.pc-base { font-size: 12.5px; font-weight: 600; margin-top: 10px; }
.pc-base + .pc-list { margin-top: 4px; }
.pc-limits { list-style: none; padding-left: 0; }

/* pakiet Pro */
.plan-tag { display: inline-block; font-family: var(--f-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .06em; padding: 1px 5px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); vertical-align: 1px; margin-left: 6px; line-height: 1.4; }
.snav a .plan-tag { margin-left: auto; }
.side-mini .plan-tag { display: none; }
.upsell ul { margin: 10px 0 16px; padding-left: 18px; display: grid; gap: 4px; }
.ln-note { max-width: 260px; white-space: normal; font-style: italic; }
/* układy oferty: wybór w ustawieniach */
.lay-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.lay-opt { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; gap: 2px 10px; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; cursor: pointer; align-items: start; }
.lay-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.lay-opt.locked { opacity: .65; cursor: not-allowed; }
.lay-opt input { grid-row: 1; margin-top: 3px; }
.lay-opt .lay-thumb { grid-column: 1 / -1; grid-row: 2; }
.lay-opt .lay-name { grid-row: 1; grid-column: 2; font-weight: 600; }
.lay-opt .sub { grid-column: 1 / -1; grid-row: 3; font-size: 12px; }
.lay-thumb { display: flex; flex-direction: column; gap: 5px; height: 92px; margin: 8px 0; padding: 9px 10px; background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.lay-thumb i { display: block; height: 10px; border-bottom: 2px solid var(--brand); }
.lay-thumb b { display: block; height: 7px; width: 55%; background: #1c2226; border-radius: 2px; }
.lay-thumb em { display: block; height: 6px; background: #e7eaec; border-radius: 1px; }
.lay-thumb em:first-of-type { background: var(--brand); }
.lt-modern i { height: 18px; margin: -9px -10px 0; background: var(--brand); border: 0; }
.lt-modern b { background: var(--brand); }
.lt-minimal i { border-bottom: 1px solid #1c2226; }
.lt-minimal b { height: 6px; background: #1c2226; width: 40%; }
.lt-minimal em:first-of-type { background: transparent; border-bottom: 1px solid #1c2226; height: 5px; }
/* układ: Nowoczesny */
.sheet.lay-modern .of-head { margin: -52px -58px 0; padding: 30px 58px 24px; background: var(--brand, #1f3a5f); border-bottom: 0; }
.sheet.lay-modern .of-head .co, .sheet.lay-modern .of-head .co b, .sheet.lay-modern .of-head .co-name { color: #fff; }
.sheet.lay-modern .of-head .co { opacity: .92; }
.sheet.lay-modern .of-head img { background: #fff; padding: 6px 8px; border-radius: 6px; }
.sheet.lay-modern .of-title h1 { color: var(--brand, #1f3a5f); font-size: 24pt; }
.sheet.lay-modern .of-parties > div { background: transparent; border: 1px solid var(--paper-line); border-left: 4px solid var(--brand, #1f3a5f); }
.sheet.lay-modern table.of-t th:first-child { border-top-left-radius: 4px; }
.sheet.lay-modern table.of-t th:last-child { border-top-right-radius: 4px; }
.sheet.lay-modern .of-sum .tot { background: var(--brand, #1f3a5f); color: #fff; border-top: 0; padding: 7px 9px; border-radius: 4px; }
/* układ: Minimalistyczny */
.sheet.lay-minimal .of-head { border-bottom: 1px solid var(--paper-ink); }
.sheet.lay-minimal .of-head .co-name { color: var(--paper-ink); }
.sheet.lay-minimal .of-title h1 { font-weight: 500; font-size: 19pt; letter-spacing: .02em; }
.sheet.lay-minimal .of-parties > div { background: transparent; border-top: 1px solid var(--paper-line); border-radius: 0; padding: 8px 0 0; }
.sheet.lay-minimal table.of-t th { background: transparent; color: var(--paper-ink); border-bottom: 1.5px solid var(--paper-ink); padding-left: 4px; }
.sheet.lay-minimal table.of-t td { padding-left: 4px; }
.sheet.lay-minimal table.of-t tr.grp td { background: transparent; border-bottom: 1px solid var(--paper-ink); }
.sheet.lay-minimal .of-sum .tot { border-top: 1px solid var(--paper-ink); }
/* publiczna strona oferty */
.pub { min-height: 100vh; background: var(--bg); }
.pub-wrap { max-width: 900px; margin: 0 auto; padding: 20px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.pub-bar { display: flex; align-items: center; gap: 16px; padding: 14px 16px; flex-wrap: wrap; position: sticky; top: 8px; z-index: 5; }
.pub-co img { max-height: 40px; max-width: 160px; display: block; }
.pub-ttl { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.pub-ttl b { font-size: 16px; }
.pub-amt { font-family: var(--f-mono); font-weight: 600; }
.pub-act { display: flex; gap: 8px; flex-wrap: wrap; }
.pub-st { padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pub-st.ok { background: var(--ok-soft); color: var(--ok); }
.pub-st.bad { background: var(--bad-soft); color: var(--bad); }
.pub-dec .err { color: var(--bad); font-size: 13px; min-height: 1.2em; margin: 0; }
.pub-pages { padding: 0; background: transparent; }
.pub-pages .pages { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pub-pages .sheet { box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.pub-msg { max-width: 460px; margin: 60px auto; }
.pub-foot { text-align: center; }
.plan-tag[hidden] { display: none; }

/* okno dialogowe */
.dlg { border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--surface); color: var(--ink); width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.dlg::backdrop { background: rgba(10, 14, 18, .55); }
.dlg-in { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 17px; margin: 0 0 2px; }
.dlg-body { padding: 14px 18px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.dlg-body .banner { margin: 0; }
.dlg-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ch-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.ch-opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; cursor: pointer; }
.ch-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.ch-opt > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ch-opt .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }
.dlg .fs { display: flex; flex-direction: column; gap: 10px; }
.dlg .fs[hidden] { display: none; }
.soon-tag { background: var(--surface-2); color: var(--muted); }
@media (max-width: 640px) {
  .pub-bar { position: static; }
  .pub-act { width: 100%; }
  .pub-act .btn { flex: 1 1 auto; justify-content: center; }
  .pub-act #pubAcc { order: -1; flex-basis: 100%; }
  .dlg-foot .grow { display: none; }
  .dlg-foot #sendGo { margin-left: auto; }
}

/* ---------- POS: lejek sprzedażowy i planner ---------- */
:root { --c-event: #c2570c; --c-deal: #2c5d8f; --c-quote: #7a4a9e; --c-job: #2e7d4f; --c-order: #17767e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-event: #f0a43a; --c-deal: #8dbbea; --c-quote: #c9a2e6; --c-job: #6fcf97; --c-order: #5cc4cc; } }
:root[data-theme="dark"] { --c-event: #f0a43a; --c-deal: #8dbbea; --c-quote: #c9a2e6; --c-job: #6fcf97; --c-order: #5cc4cc; }
.src-event { --c: var(--c-event); } .src-deal { --c: var(--c-deal); } .src-quote { --c: var(--c-quote); } .src-job { --c: var(--c-job); } .src-order { --c: var(--c-order); }
.plan-tag + .plan-tag { margin-left: 4px; }
.fn-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1250px) { .fn-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .fn-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi.bad b { color: var(--bad); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 10px; padding: 12px; overflow-x: auto; align-items: start; }
.board-empty { grid-column: 1 / -1; }
.board-empty .btn { margin-top: 12px; }
.bcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; min-height: 220px; min-width: 0; border-top: 3px solid var(--line-strong); }
.bc-won { border-top-color: var(--ok); } .bc-lost { border-top-color: var(--bad); } .bc-negotiation, .bc-offer { border-top-color: var(--accent); }
.bcol.over { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.bcol-h { display: flex; align-items: baseline; gap: 6px; padding: 9px 10px 7px; flex-wrap: wrap; }
.bcol-h .cnt { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.bcol-h .sub { margin-left: auto; font-size: 12px; }
.bcol-b { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; flex: 1; }
.bcol-empty { text-align: center; padding: 18px 6px; border: 1px dashed var(--line-strong); border-radius: var(--r); font-size: 12px; }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 10px; cursor: grab; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); min-width: 0; }
.deal:hover { border-color: var(--line-strong); }
.deal:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.deal.drag { opacity: .45; }
.deal-t { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.deal-c { overflow-wrap: anywhere; }
.deal-m { display: flex; align-items: center; gap: 6px; }
.deal-m .av { margin: 0; }
.deal-n { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.deal-n.late { color: var(--bad); font-weight: 500; }
.deal-f { display: flex; gap: 5px; flex-wrap: wrap; }
.tag-size, .tag-pros, .tag-q { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; font-weight: 500; }
.tag-pros { background: var(--info-soft); color: var(--info); border-color: transparent; }
.tag-q.q-accepted { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag-q.q-rejected { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.dst-lead, .dst-qualified { background: var(--surface-2); color: var(--muted); }
.dst-offer, .dst-negotiation { background: var(--accent-soft); color: var(--accent); }
.dst-won { background: var(--ok-soft); color: var(--ok); } .dst-lost { background: var(--bad-soft); color: var(--bad); }
.toolbar .chk { padding: 5px 10px; font-size: 13px; }
.toolbar .chk input { width: 16px; height: 16px; }
.cli-box { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.cli-box .cb-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cli-box .kv { grid-template-columns: 118px minmax(0, 1fr); }
.cb-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dl-next { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, .8fr); }
@media (max-width: 640px) { .dl-next { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .dl-next > :first-child { grid-column: 1 / -1; } }
.dl-ev { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.dl-ev ul { margin: 0; padding-left: 18px; font-size: 13px; }
.dl-ev li.done { text-decoration: line-through; color: var(--muted); }
.dl-ev .sub { margin: 0; }
.ev-types { flex-wrap: wrap; }
.kc-deals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.linkish { border: 0; background: none; padding: 0; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.linkish:hover { text-decoration-color: currentColor; }

.cal-head { flex-wrap: wrap; gap: 10px; }
.cal-head h2 { min-width: 9.5em; }
.cal-nav { display: inline-flex; align-items: center; gap: 4px; }
.cal-src { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; }
.src-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.src-chip i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.src-chip[aria-pressed="false"] { color: var(--muted); text-decoration: line-through; }
.src-chip[aria-pressed="false"] i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 12px 14px 14px; border-radius: 6px; overflow: hidden; }
.cal-wd { background: var(--surface-2); padding: 6px 8px; font-size: 12px; color: var(--muted); font-weight: 500; }
.cal-day { background: var(--surface); min-height: 112px; padding: 4px 4px 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.we { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.cal-day.out { background: var(--surface-2); }
.cal-day.out .cal-dn { opacity: .5; }
.cal-dn { display: flex; justify-content: flex-end; font-size: 12.5px; padding: 2px 4px; }
.cal-day.today .cal-dn span { background: var(--accent); color: var(--accent-ink); border-radius: 999px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; font-weight: 600; }
.cal-it { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--ink); border-radius: 3px; padding: 2px 5px; font: inherit; font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-it:hover { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.cal-it .mono { font-size: 11px; color: var(--muted); }
.cal-it.done { text-decoration: line-through; color: var(--muted); }
.cal-it.late { box-shadow: inset 0 0 0 1px var(--bad); }
.cal-more { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; text-align: left; padding: 1px 5px; cursor: pointer; text-decoration: underline; }
@media (max-width: 760px) {
  .cal-grid { margin: 10px 8px 12px; }
  .cal-day { min-height: 64px; padding: 2px; }
  .cal-wd { padding: 4px; text-align: center; }
  .cal-dn { justify-content: center; }
  .cal-it { font-size: 0; height: 6px; padding: 0; border-left: 0; background: var(--c); }
  .cal-it .mono { display: none; }
  .cal-more { font-size: 10.5px; padding: 0; text-align: center; }
}
.agenda { display: flex; flex-direction: column; padding: 6px 14px 14px; }
.ag-day { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ag-day:first-child { border-top: 0; }
.ag-date { display: flex; flex-direction: column; line-height: 1.2; }
.ag-date b { font-family: var(--f-display); font-size: 22px; }
.ag-date span { font-size: 12px; color: var(--muted); }
.ag-date.today b { color: var(--accent); }
.ag-late .ag-date b { color: var(--bad); }
.ag-day ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ag-it { display: flex; align-items: flex-start; gap: 10px; border-left: 3px solid var(--c); padding: 4px 0 4px 10px; }
.ag-it input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ok); flex: none; }
.ag-dot { width: 18px; flex: none; }
.ag-main { border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ag-main b { font-weight: 600; overflow-wrap: anywhere; }
.ag-main:hover b { text-decoration: underline; }
.ag-src { font-size: 11.5px; color: var(--muted); }
.ag-it.done b { text-decoration: line-through; color: var(--muted); }
.ag-it.late .ag-src { color: var(--bad); }
@media (max-width: 640px) { .ag-day { grid-template-columns: 58px minmax(0, 1fr); gap: 8px; } .agenda { padding: 4px 10px 10px; } }

/* CRM: okno szansy, telefon, dashboard */
.deal-n.none { color: var(--warn); font-style: italic; }
.dl-step-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.dl-step-foot .hint { margin: 0; flex: 1 1 220px; }
.dl-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.dl-acts[hidden] { display: none; }
.dl-more { border: 1px solid var(--line); border-radius: var(--r); }
.dl-more > summary { cursor: pointer; padding: 9px 12px; font-weight: 500; list-style-position: inside; }
.dl-more > summary .sub { font-weight: 400; margin-left: 4px; }
.dl-more-b { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 12px; }
input[readonly] { background: var(--surface-2); color: var(--muted); }
.fs[hidden], .f[hidden] { display: none; }
.fn-mob { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.fn-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.fn-tabs button { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.fn-tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fn-tabs .cnt { font-family: var(--f-mono); font-size: 11px; opacity: .75; margin-left: 2px; }
.fn-list { display: flex; flex-direction: column; gap: 8px; }
.fn-list .deal { cursor: pointer; }
.deal-mv { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.dash-today { margin-bottom: 16px; }
.dash-today header { flex-wrap: wrap; gap: 8px; }
.dt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bad-t { color: var(--bad); font-weight: 600; }

/* Regulamin i Polityka prywatności */
.legal .body { max-width: 860px; line-height: 1.6; }
.legal h2 { font-size: 16px; margin: 22px 0 8px; }
.legal section:first-of-type h2 { margin-top: 10px; }
.legal ol, .legal ul { padding-left: 22px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.legal ul { margin-top: 6px; }
.legal p { margin: 8px 0; }
.legal-lead { color: var(--muted); }
.legal-t td { vertical-align: top; min-width: 140px; }
.legal-todo { background: var(--warn-soft); color: var(--warn); padding: 0 4px; border-radius: 3px; font-weight: 500; }
.legal-pub h1 { margin: 4px 0 0; }
.legal-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.legal-top .logo img { height: 28px; width: auto; }
.legal-back { margin-top: 4px; }
.login-legal { text-align: center; margin: 0; font-size: 12.5px; }
.su-terms { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; cursor: pointer; }
.su-terms input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
@media print {
  .legal-top, .legal-back { display: none !important; }
  .legal-pub { padding: 0; max-width: none; }
  .legal.card { border: 0; box-shadow: none; }
  .legal-todo { background: none; }
}
.legal-top .grow { flex: 1; }
@media (max-width: 640px) {
  .legal-t thead { display: none; }
  .legal-t, .legal-t tbody, .legal-t tr, .legal-t td { display: block; width: 100%; }
  .legal-t tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .legal-t td { border: 0; padding: 2px 0; min-width: 0; }
  .legal-t td:nth-child(1) { font-weight: 600; }
  .legal-t td:nth-child(2)::before { content: "Podstawa: "; color: var(--muted); }
  .legal-t td:nth-child(3)::before { content: "Jak długo: "; color: var(--muted); }
}

/* =====================================================================
   Styl v2: grafitowe menu, płaskie karty, Geologica + Golos Text.
   Nadpisuje wygląd, nie zmienia układu. Powrót: git checkout styl-v1 -- style.css index.html
   ===================================================================== */
body { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "tnum" 0; }
h1, h2, h3 { letter-spacing: -.02em; }
h1 { font-size: 25px; font-weight: 600; }
h2 { font-size: 15px; font-weight: 600; }
.num, .mono, input.r { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.page-head { margin-bottom: 18px; }
.page-head p { font-size: 13.5px; }

/* karty: płaskie, wyraźna krawędź */
.card, .kpi, .ptn-card, .ed-bar { border-radius: 6px; box-shadow: none; }
.card > header { padding: 13px 16px; background: transparent; }
.card > header h2 { font-size: 14.5px; }
.eyebrow, .dept-h { font-family: var(--f-body); font-size: 11px; font-weight: 600; letter-spacing: .07em; color: var(--muted); }

/* przyciski */
.btn { border-radius: var(--r); padding: 7px 14px; font-weight: 600; font-size: 13.5px; letter-spacing: -.005em; border-color: var(--line-strong); }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.primary:hover { filter: none; background: color-mix(in srgb, var(--accent) 86%, var(--ink)); border-color: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.btn.ghost:hover { border-color: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }

/* pola formularzy */
input[type=text], input[type=email], input[type=date], input[type=search], input[type=tel], input[type=password], input[type=time], input[type=number], input[type=url], input:not([type]), select, textarea { border-radius: var(--r); padding: 7px 10px; transition: border-color .12s, box-shadow .12s; }
input:hover:not(:disabled):not([readonly]), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
label.f > span, div.f > span { font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--muted); }

/* tabele */
table.t th { background: transparent; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line-strong); padding-top: 10px; padding-bottom: 8px; }
table.t tbody tr.click:hover td { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }

/* etykiety statusów: prostokątne, bez kropki */
.pill { border-radius: 4px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; }
.pill::before { display: none; }
.st-sel { border-radius: 4px; font-size: 12px; font-weight: 600; }
.chip, .tp, .role, .tag-ex, .tag-low, .tag-main, .tag-size, .tag-pros, .tag-q, .attrs .at, .ln-attrs .at, .src-chip, .cats button, .fn-tabs button { border-radius: 4px; }
.plan-tag { font-family: var(--f-body); border-radius: 3px; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; }

/* segmenty */
.seg { border-radius: var(--r); background: var(--surface-2); padding: 2px; gap: 2px; border-color: var(--line); }
.seg button { border-radius: 3px; background: transparent; padding: 5px 12px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.seg .cnt { font-family: var(--f-body); }

/* liczby: KPI i podsumowania */
.kpi { padding: 14px 16px; }
.kpi b, .stats b { font-family: var(--f-display); font-weight: 600; font-size: 24px; letter-spacing: -.02em; }
.kpi .sub:first-child, .kpi > span:first-child { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi.k-info::before, .kpi.k-ok::before, .kpi.k-warn::before { top: 14px; bottom: auto; left: 0; right: auto; width: 3px; height: 18px; border-radius: 0 2px 2px 0; }
a.kpi:hover { border-color: var(--muted); }
.sum .big { font-family: var(--f-display); font-weight: 600; font-size: 22px; letter-spacing: -.02em; }
.mini-stats b { font-family: var(--f-display); font-weight: 600; }
.plan-name, .pc-name, .pc-price b, .ag-date b { letter-spacing: -.02em; font-weight: 600; }
.stats { border-radius: 6px; }

/* menu boczne: grafit */
.side { background: var(--side-bg); border-right: 0; color: var(--side-ink); }
.side-head { border-bottom-color: var(--side-line); }
.side .logo-l { display: none !important; }
.side .logo-d { display: block; }
.side-mini .side .logo-d { display: none !important; }
.side-tgl { color: var(--side-muted); }
.side-tgl:hover { background: var(--side-hover); color: var(--side-ink); }
.snav { padding: 6px 10px 12px; scrollbar-color: rgba(255,255,255,.15) transparent; }
.snav-lbl { font-family: var(--f-body); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; color: rgba(238,240,243,.42); padding: 16px 10px 6px; }
.side-mini .snav-lbl::after { background: var(--side-line); }
.snav a, .snav-btn, .side-user { color: var(--side-muted); font-weight: 500; font-size: 13.5px; border-radius: 5px; padding: 7px 10px; }
.snav a:hover, .snav-btn:hover, .side-user:hover { background: var(--side-hover); color: var(--side-ink); }
.snav a[aria-current="page"], .side-user[aria-current="page"] { background: var(--side-act); color: #fff; }
.snav a[aria-current="page"]::before { left: -10px; top: 8px; bottom: 8px; width: 3px; background: var(--side-accent); }
.snav a[aria-current="page"] .ni { color: var(--side-accent); }
.side .plan-tag { background: rgba(163,176,255,.16); color: var(--side-accent); }
.side-foot { border-top-color: var(--side-line); }
.side .av { background: rgba(255,255,255,.1); color: var(--side-ink); border: 0; }
.side .su-t b { color: var(--side-ink); }
.side .su-t small { color: var(--side-muted); }
.side :focus-visible { outline-color: var(--side-accent); }

/* pasek telefonu */
.mbar { background: var(--side-bg); border-bottom: 0; color: var(--side-ink); }
.mbar .side-tgl#menuBtn { color: var(--side-ink); }
.mbar-t { font-weight: 500; }

/* zakładki i listy wyboru */
.fn-tabs button[aria-selected="true"], .cats button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: none; }

/* katalog w edytorze */
.pick-card { border-top: 0; box-shadow: inset 0 3px 0 var(--accent); }
.pick-card header { background: transparent; }
.pick .btn[data-add] { background: transparent; }

/* tablica (lejek, zlecenia) */
.bcol, .jcol { border-radius: 6px; background: color-mix(in srgb, var(--surface-2) 70%, var(--bg)); }
.bcol { border-top-width: 2px; }
.deal, .jcard { box-shadow: none; border-radius: 5px; }
.deal:hover, .jcard:hover { border-color: var(--muted); }
.bcol-h .cnt, .fn-tabs .cnt, .pick-card h2 .cnt, .pb-v, .pb-l, .bars-grid em { font-family: var(--f-body); }

/* kalendarz */
.cal-grid { border-radius: 6px; }
.cal-wd { background: transparent; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.cal-it { border-radius: 3px; }

/* okna i komunikaty */
.dlg { border-radius: 10px; box-shadow: 0 24px 64px rgba(10,12,16,.35); }
.dlg-head h2 { font-size: 18px; }
.banner { border-radius: 6px; border-color: transparent; }
.toast { border-radius: 6px; font-weight: 500; }
.pick-dd-b { border-radius: 6px; box-shadow: 0 12px 32px rgba(10,12,16,.16); }
.av { font-family: var(--f-body); }

/* logowanie */
.login { background: radial-gradient(1200px 600px at 100% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%), var(--bg); }
.login .card { border-radius: 10px; box-shadow: 0 1px 2px rgba(15,18,22,.04), 0 12px 40px rgba(15,18,22,.07); }
.login h1 { font-size: 22px; }
/* słupki wykresu dzielą klasę .bcol z kolumnami tablicy – tu bez tła kolumny */
.bars-cols .bcol { background: none; border: 0; min-height: 0; border-radius: 4px; }
.snav { scrollbar-width: thin; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side, :root:not([data-theme="light"]) .mbar { border-right: 1px solid var(--line); } }
:root[data-theme="dark"] .side { border-right: 1px solid var(--line); }
/* kolumny lejka: karty na pełną szerokość (reguły słupków wykresu ich nie dotyczą) */
.board .bcol { align-items: stretch; justify-content: flex-start; height: auto; padding-bottom: 0; }
.board .bcol-h { padding: 10px 10px 8px; }
.board .bcol-h b, .jcol-h b { font-size: 13px; }
.cal-wd { background: var(--surface); }
@media (max-width: 620px) { .kpi b, .stats b { font-size: 19px; overflow-wrap: normal; } .kpi { padding: 12px 13px; } h1 { font-size: 22px; } }

/* Faktury */
.inv-ksef { display: block; }
.inv-ksef a { margin-left: 4px; font-weight: 600; }
.inv-file { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 500; text-decoration: none; max-width: 260px; }
.inv-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-file svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--bad); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.inv-file:hover span { text-decoration: underline; color: var(--accent); }
.tag-none { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.inv-act { white-space: nowrap; }

/* Zespół i współdzielone zadania */
.av-c { background: hsl(var(--avh, 220) 55% 92%); color: hsl(var(--avh, 220) 50% 30%); border: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .av-c { background: hsl(var(--avh, 220) 35% 26%); color: hsl(var(--avh, 220) 70% 85%); } }
:root[data-theme="dark"] .av-c { background: hsl(var(--avh, 220) 35% 26%); color: hsl(var(--avh, 220) 70% 85%); }
.av-stack { display: inline-flex; margin-left: auto; padding-left: 8px; align-self: center; flex: none; }
.av-stack .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); width: 24px; height: 24px; font-size: 10px; }
.av-stack .av:first-child { margin-left: 0; }
.ev-mem { display: flex; flex-wrap: wrap; gap: 6px; }
.mem-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 4px; cursor: pointer; font-size: 13px; background: var(--surface); }
.mem-chip input { width: 15px; height: 15px; margin: 0 0 0 4px; accent-color: var(--accent); }
.mem-chip small { color: var(--muted); }
.mem-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mem-chip .av { margin: 0; }
.ev-clash { margin: -4px 0 0; }
.tm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; margin-bottom: 16px; }
.tm-card { padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tm-card.me { border-color: var(--accent); }
.tm-top { display: flex; gap: 12px; align-items: flex-start; }
.tm-av { width: 44px; height: 44px; font-size: 15px; font-weight: 600; margin: 0; }
.tm-id { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.tm-id b { font-family: var(--f-display); font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.tm-pos { font-size: 13px; }
.tm-contact { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.tm-contact a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-contact a:hover { color: var(--accent); text-decoration: underline; }
.tm-contact:empty { display: none; }
.tm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); }
.tm-stats div { display: flex; flex-direction: column; min-width: 0; }
.tm-stats dt { font-size: 11px; color: var(--muted); }
.tm-stats dd { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 18px; display: flex; flex-direction: column; line-height: 1.2; }
.tm-stats dd small { font-family: var(--f-body); font-weight: 500; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-stats .bad dd { color: var(--bad); }
.tm-act { display: flex; gap: 8px; flex-wrap: wrap; }
.tm-form { gap: 10px; }
.tm-form .form-actions { margin-top: 0; }
.tm-week header { flex-wrap: wrap; gap: 8px; }
.tw-t { table-layout: fixed; min-width: 860px; }
.tw-t th:first-child { width: 180px; }
.tw-t thead th.today { color: var(--accent); }
.tw-t tbody th { text-align: left; font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tw-who { display: flex; gap: 8px; align-items: center; min-width: 0; }
.tw-who .av { margin: 0; }
.tw-who > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; overflow: hidden; }
.tw-who small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-cell { vertical-align: top; padding: 4px !important; cursor: pointer; height: 64px; }
.tw-cell:hover { background: var(--surface-2); }
.tw-cell.today { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.tw-cell.we { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.tw-cell.busy { box-shadow: inset 0 -2px 0 var(--warn); }
.tw-cell .cal-it + .cal-it { margin-top: 3px; }
.tw-t tbody th { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); background: transparent; }
#calWho { width: auto; max-width: 260px; }
