/* Panel mioduszewsky (Sławek, prototyp 05.11.2026, przeniesiony 1:1). Narzędzie pracy. Z marki: krój (GeneralSans, Nohemi), kolor akcji (niebieski), żółć znaku.
   Reszta: szare tło, białe powierzchnie, kolor tylko ze znaczeniem (etap, termin, stan systemu). */
@font-face { font-family: 'GeneralSansV'; src: url('fonts/GeneralSans-Variable.woff2') format('woff2'); font-weight: 200 700; font-display: swap; }
@font-face { font-family: 'NohemiV'; src: url('fonts/Nohemi-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JBMono'; src: url('fonts/JetBrainsMono-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --bg: #ebebe4;          /* szarość pochodna kości słoniowej marki #f8f9f2 */
  --bg-2: #f4f4ef;
  --surface: #ffffff;
  --ink: #000000;
  --text: #1a1915;
  --text-2: #4c483c;
  --dim: #777265;
  --line: #d9d8cf;
  --line-2: #c6c5bb;
  --blue: #0522ff;        /* kolor akcji marki */
  --blue-soft: #e8ebff;
  --brand: #ffcc33;       /* żółć znaku: wyłącznie „wymaga uwagi” i focus na czerni */
  --ok: #2f7d5c;  --ok-soft: #e3f1ea;
  --warn: #d98910; --warn-soft: #fbefd9;
  --bad: #c43a25;  --bad-soft: #f9e3df;
  --nodata: #928a78; --nodata-soft: #ecebe6;
  --won: #2f7d5c; --lost: #777265;
  --r: 8px; --r-sm: 5px;
  --side: 224px;
  --disp: 'NohemiV', sans-serif;
  --body: 'GeneralSansV', system-ui, sans-serif;
  --mono: 'JBMono', ui-monospace, Menlo, monospace;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04);
  --shadow-lift: 0 10px 24px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.08);
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--body); -webkit-font-smoothing: antialiased; min-height: 100dvh; overflow-x: clip; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; max-width: 100%; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: .93em; letter-spacing: -.01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }


/* ---- powłoka: boczne menu (komputer) ---- */
.side { position: fixed; top: 0; bottom: 0; left: 0; width: var(--side); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px 14px; }
.side-logo { display: block; width: 128px; margin: 0 0 22px 4px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .tabbar a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--text-2); font-weight: 500; position: relative; }
.side-nav a i, .tabbar a i { font-style: normal; width: 18px; text-align: center; color: var(--dim); font-size: 15px; }
.side-nav a:hover { background: var(--bg-2); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.side-nav a[aria-current="page"] i { color: var(--brand); }
.side-count { margin-left: auto; font: 11px/1 var(--mono); background: var(--blue-soft); color: var(--blue); padding: 4px 7px; border-radius: 999px; }
.side-count:empty { display: none; }
.side-nav a[aria-current="page"] .side-count { background: var(--brand); color: var(--ink); }
.side-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-left: auto; display: none; }
.side-dot.on { display: block; }
.tabbar .side-dot.on { position: absolute; top: 6px; right: calc(50% - 16px); margin: 0; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; color: var(--dim); }
.side-sync { display: flex; align-items: center; gap: 6px; }
.side-links { display: flex; gap: 10px; flex-wrap: wrap; }
.side-links a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.side-user { text-decoration: none; display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; color: var(--text-2); }
.side-user span { color: var(--dim); }

/* ---- dolny pasek (telefon) ---- */
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); grid-template-columns: repeat(5, 1fr); }
.tabbar a { flex-direction: column; gap: 3px; padding: 4px 2px; font-size: 10.5px; font-weight: 500; text-align: center; }
.tabbar a i { font-size: 18px; width: auto; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] i { color: var(--blue); }

/* ---- główny obszar ---- */
.app { margin-left: var(--side); padding: 22px 28px 60px; min-height: 100dvh; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-h h1 { font: 520 28px/1.1 var(--disp); letter-spacing: -.02em; color: var(--ink); }
.page-h .sub { color: var(--dim); font-size: 13px; margin-top: 4px; }
.page-h .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 12.5px; color: var(--dim); margin-bottom: 8px; }
.crumb a { color: var(--dim); }

/* ---- przyciski: pigułka marki, ale w skali narzędzia ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.btn:hover { background: var(--ink); color: #fff; }
.btn:active { scale: .97; }
.btn.pri { background: var(--ink); color: #fff; }
.btn.pri:hover { background: var(--blue); border-color: var(--blue); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 10.5px; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.btn.quiet { border-color: var(--line-2); color: var(--text-2); letter-spacing: .04em; text-transform: none; font-size: 13px; font-weight: 500; }
.btn.quiet:hover { background: var(--bg-2); color: var(--ink); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; background: var(--surface); }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; font-size: 12.5px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---- powierzchnie ---- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.panel { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; }
.panel h2 { font: 600 13px/1.3 var(--body); letter-spacing: .02em; color: var(--text-2); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.g-rec { grid-template-columns: 1.6fr 1fr; }
.grid.g-ceny { grid-template-columns: 1fr 1.2fr; }

/* ---- stan pusty ---- */
.empty { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h2 { font: 520 20px/1.2 var(--disp); color: var(--ink); letter-spacing: -.01em; }
.empty p { color: var(--dim); max-width: 42ch; }
.empty .btn { margin-top: 8px; }
.empty.inline { padding: 22px 16px; }
.empty.inline h2 { font-size: 15px; font-family: var(--body); font-weight: 600; }

/* ---- etykiety stanów: tekst + kształt, kolor dodatkowo ---- */
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; background: var(--nodata-soft); color: var(--text-2); }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.tag.OPEN { background: var(--blue-soft); color: var(--blue); }
.tag.OFFER_SENT { background: #ece6ff; color: #4a2fb3; }
.tag.WAITING_CLIENT { background: var(--warn-soft); color: #9a5f05; }
.tag.CLIENT_REPLIED { background: #e0f1f7; color: #0b6283; }
.tag.WON { background: var(--ok-soft); color: var(--ok); }
.tag.LOST { background: var(--nodata-soft); color: var(--dim); }
.tag.WON::before { border-radius: 1px; } .tag.LOST::before { width: 8px; height: 2px; border-radius: 0; }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--dim); white-space: nowrap; }
.src i { font-style: normal; width: 16px; height: 16px; border-radius: 4px; background: var(--bg); color: var(--text-2); font-size: 9.5px; font-weight: 700; display: inline-grid; place-items: center; letter-spacing: 0; }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.due.late { color: var(--bad); font-weight: 600; }
.due.late::before { content: "!"; width: 14px; height: 14px; border-radius: 50%; background: var(--bad); color: #fff; font-size: 10px; display: inline-grid; place-items: center; }
.due.soon { color: #9a5f05; }
.due.soon::before { content: "◔"; }
.amt { font-family: var(--mono); font-size: 13px; color: var(--ink); white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-bad { background: var(--bad); } .dot-nodata { background: var(--nodata); }

/* ---- Start: tablica lejka ---- */
.board-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.board-tools .hint { color: var(--dim); font-size: 12.5px; }
.kpi-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.kpi { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 150px; text-decoration: none; }
.kpi b { font: 520 22px/1 var(--disp); color: var(--ink); }
.kpi span { font-size: 12px; color: var(--dim); }
.kpi.alert b { color: var(--bad); }
.kpi.alert { border-left: 3px solid var(--bad); }
.board { display: grid; grid-template-columns: repeat(6, minmax(172px, 1fr)); gap: 10px; align-items: start; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; min-height: 160px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; transition: background .12s, border-color .12s; }
.col.over { background: var(--blue-soft); border-color: var(--blue); }
.col-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 4px 6px; font-size: 12px; font-weight: 600; color: var(--text-2); border-bottom: 2px solid var(--line-2); }
.col[data-stage="OPEN"] .col-h { border-color: var(--blue); } .col[data-stage="OFFER_SENT"] .col-h { border-color: #4a2fb3; } .col[data-stage="WAITING_CLIENT"] .col-h { border-color: var(--warn); } .col[data-stage="CLIENT_REPLIED"] .col-h { border-color: #0b6283; } .col[data-stage="WON"] .col-h { border-color: var(--ok); } .col[data-stage="LOST"] .col-h { border-color: var(--dim); }
.col-h .n { font-family: var(--mono); font-weight: 400; color: var(--dim); }
.col-h .sum { font-family: var(--mono); font-weight: 400; color: var(--dim); font-size: 11px; }
.col-empty { color: var(--dim); font-size: 12px; text-align: center; padding: 18px 6px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); }
.deal { background: var(--surface); border-radius: var(--r-sm); box-shadow: var(--shadow); padding: 10px 10px 9px; display: flex; flex-direction: column; gap: 6px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; border-left: 3px solid transparent; }
.deal:hover { box-shadow: var(--shadow-lift); }
.deal.late { border-left-color: var(--bad); }
.deal.soon { border-left-color: var(--warn); }
.deal.dragging { opacity: .35; }
.deal-name { font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.25; }
.deal-name:hover { color: var(--blue); }
.deal-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.deal-next { font-size: 12.5px; color: var(--text-2); }
.deal-next.none { color: var(--dim); font-style: italic; }
.ghost { position: fixed; z-index: 100; pointer-events: none; width: 190px; box-shadow: var(--shadow-lift); rotate: 2deg; }
.stage-tabs { display: none; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; scrollbar-width: none; }
.stage-tabs button { flex: none; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.stage-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.stage-tabs b { font-family: var(--mono); font-weight: 400; margin-left: 4px; opacity: .75; }

/* ---- tabele / listy ---- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); font-weight: 600; background: var(--bg-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-2); }
.table a.name { font-weight: 600; text-decoration: none; color: var(--ink); }
.table a.name:hover { color: var(--blue); }
.table .sub { display: block; color: var(--dim); font-size: 12px; }
.table .num { text-align: right; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 240px; max-width: 420px; }
.search input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); }
.search::before { content: "⌕"; position: absolute; left: 12px; top: 7px; font-size: 17px; color: var(--dim); }
select.sel { height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23777265'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; -webkit-appearance: none; font-size: 13px; color: var(--text-2); }
.rowlist { display: flex; flex-direction: column; gap: 8px; }
.row { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.row .t { font-weight: 600; color: var(--ink); }
.row .m { color: var(--dim); font-size: 12.5px; display: flex; gap: 10px; flex-wrap: wrap; }
.row .acts { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: flex; gap: 6px; }

/* ---- karta klienta ---- */
.rec-h { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; display: grid; grid-template-columns: 1fr auto; gap: 14px 20px; margin-bottom: 14px; }
.rec-h h1 { font: 520 26px/1.1 var(--disp); letter-spacing: -.02em; color: var(--ink); }
.rec-h .meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; color: var(--text-2); font-size: 13px; }
.rec-h .meta a { color: var(--blue); text-decoration: none; }
.rec-h .meta a:hover { text-decoration: underline; }
.rec-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; text-align: right; }
.rec-side .amt { font: 520 22px/1 var(--disp); }
.rec-side small { color: var(--dim); font-size: 12px; }
.stages { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.stages button { height: 32px; border: 0; border-radius: 3px; background: var(--bg); color: var(--dim); font-size: 11.5px; font-weight: 600; cursor: pointer; position: relative; }
.stages button.done { background: var(--line); color: var(--text-2); }
.stages button[aria-current="step"] { background: var(--ink); color: #fff; }
.stages button[aria-current="step"]::after { content: "◆"; position: absolute; bottom: -8px; left: 50%; translate: -50%; font-size: 9px; color: var(--ink); }
.stages button:hover:not([aria-current]) { background: var(--line-2); color: var(--ink); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.warnbox { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-soft); border-left: 3px solid var(--warn); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; color: #6b4303; margin-bottom: 14px; }
.warnbox b { color: #6b4303; }
.warnbox .btn { margin-left: auto; flex: none; }
.timeline { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 76px 20px 1fr; gap: 0 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev .d { font-family: var(--mono); font-size: 12px; color: var(--dim); padding-top: 2px; }
.ev .i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--bg); color: var(--text-2); }
.ev.objection .i { background: var(--bad-soft); color: var(--bad); }
.ev.agreement .i { background: var(--ok-soft); color: var(--ok); }
.ev.stage_change .i { background: var(--blue-soft); color: var(--blue); }
.ev.lead_received .i { background: #ece6ff; color: #4a2fb3; }
.ev .t { font-weight: 600; font-size: 13px; }
.ev .b { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.ev .b .amt { font-size: 12.5px; }
.money { display: flex; flex-direction: column; gap: 8px; }
.money .ln { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.money .ln span:first-child { color: var(--text-2); }
.money .tot { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 600; }
.pay-bar { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.pay-bar i { display: block; height: 100%; background: var(--ok); }

/* ---- formularz ---- */
.form { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; max-width: 720px; display: grid; gap: 16px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea { height: 38px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); width: 100%; }
.field textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); outline: 2px solid var(--blue-soft); }
.field .err { font-size: 12px; color: var(--bad); display: none; }
.field.bad input { border-color: var(--bad); } .field.bad .err { display: block; }
.field .hint { font-size: 12px; color: var(--dim); }
.radios { display: flex; gap: 6px; flex-wrap: wrap; }
.radios label { height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; font-size: 13px; }
.radios input { accent-color: var(--blue); margin: 0; }
.radios label:has(:checked) { border-color: var(--ink); background: var(--ink); color: #fff; }
.form-acts { display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 14px; }
.span2 { grid-column: 1 / -1; }

/* ---- systemy ---- */
.lamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.lamp { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; text-decoration: none; color: inherit; border-left: 3px solid var(--ok); }
.lamp .dot { grid-row: 1 / span 2; align-self: center; width: 11px; height: 11px; }
.lamp b { font-weight: 600; color: var(--ink); }
.lamp span { font-size: 12px; color: var(--dim); }
.lamp.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.lamp.bad { border-left-color: var(--bad); }
.lamp.nodata { border-left-color: var(--nodata); }
.lamp.warn span { color: #6b4303; }
.pulse { display: flex; flex-direction: column; gap: 10px; }
.pulse .big { font: 520 20px/1.2 var(--disp); color: var(--ink); }
.pulse ol { margin: 0; padding-left: 18px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.stop { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.stop p { color: var(--text-2); font-size: 13px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--dim); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* ---- decyzje, ceny ---- */
.dec { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; font-size: 13px; }
.dec dt { color: var(--dim); font-weight: 600; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; padding-top: 2px; }
.dec dd { margin: 0; color: var(--text); }
.dec .head { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 4px; }
.dec .head b { font-size: 15px; }
.case { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; }
.case .t { font-weight: 600; font-size: 15px; color: var(--ink); }
.case .w { font-size: 13px; color: var(--text-2); }
.case .acts { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; }
.case.locked { border-left: 3px solid var(--nodata); }
.case.locked .acts .btn { border-color: var(--line-2); color: var(--dim); }
.confirm { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; }
.confirm .box { background: var(--surface); border-radius: var(--r); padding: 20px; width: min(420px, 100%); display: grid; gap: 12px; box-shadow: var(--shadow-lift); }
.confirm h2 { font: 520 20px/1.2 var(--disp); color: var(--ink); }
.confirm p { color: var(--text-2); }
.confirm .acts { display: flex; gap: 8px; justify-content: flex-end; }

/* ---- rzadko używane ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.tile b { color: var(--ink); }
.tile p { color: var(--text-2); font-size: 13px; }
.tile small { color: var(--dim); font-family: var(--mono); font-size: 11.5px; margin-top: auto; padding-top: 6px; }
.tile:hover { box-shadow: var(--shadow-lift); }
.menu-list { display: none; }

/* ---- logowanie ---- */
body.auth .side, body.auth .tabbar { display: none !important; }
body.auth .app { margin-left: 0; display: grid; place-items: center; padding: 20px 16px; }
.login { width: min(380px, 100%); display: grid; gap: 18px; }
.login .lg { width: 150px; margin: 0 auto 6px; }
.login .panel { padding: 22px; display: grid; gap: 14px; }
.login h1 { font: 520 22px/1.15 var(--disp); color: var(--ink); letter-spacing: -.015em; }
.login p { color: var(--dim); font-size: 13px; }
.login .code { font-family: var(--mono); font-size: 24px; letter-spacing: .4em; text-align: center; height: 52px; }
.login .btn { width: 100%; justify-content: center; height: 42px; }
.login .foot { text-align: center; color: var(--dim); font-size: 12px; }
.login .steps { display: flex; justify-content: center; gap: 6px; }
.login .steps i { width: 24px; height: 4px; border-radius: 2px; background: var(--line-2); }
.login .steps i.on { background: var(--ink); }

/* ---- toast ---- */
.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 20px; opacity: 0; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; z-index: 90; transition: .2s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.on { translate: -50% 0; opacity: 1; }

/* ---- responsywność ---- */
@media (max-width: 1100px) { .board { grid-template-columns: repeat(6, 210px); } .grid.c3 { grid-template-columns: 1fr 1fr; } .grid.g-rec, .grid.g-ceny { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .side { display: none; }
  .tabbar { display: grid; }
  .app { margin-left: 0; padding: 14px 16px calc(100px + env(safe-area-inset-bottom)); }
  .page-h h1 { font-size: 24px; }
  .grid.c2, .grid.c3, .grid.g-rec, .grid.g-ceny { grid-template-columns: 1fr; }
  .rec-h { grid-template-columns: 1fr; }
  .rec-side { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
  .stages { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stages button[aria-current="step"]::after { display: none; }
  .fgrid { grid-template-columns: 1fr; }
  .stage-tabs { display: flex; }
  .board { grid-template-columns: repeat(6, calc(100vw - 32px)); gap: 12px; scroll-snap-type: x mandatory; }
  .col { min-height: 220px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { border: 0; padding: 3px 14px; }
  .table td.num { text-align: left; }
  .table td[data-l]::before { content: attr(data-l) ": "; color: var(--dim); font-size: 12px; }
  .row { grid-template-columns: 1fr; }
  .row .acts { grid-column: 1; grid-row: auto; margin-top: 6px; }
  .case { grid-template-columns: 1fr; }
  .case .acts { grid-column: 1; grid-row: auto; margin-top: 4px; }
  .dec { grid-template-columns: 1fr; gap: 2px; }
  .dec dt { margin-top: 8px; }
  .ev { grid-template-columns: 56px 20px 1fr; }
  .menu-list { display: grid; gap: 6px; margin-bottom: 18px; }
  .menu-list a { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; text-decoration: none; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; }
  .menu-list a span { color: var(--dim); font-weight: 400; font-size: 12.5px; }
}
@media (max-width: 380px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .board { grid-template-columns: repeat(6, calc(100vw - 24px)); }
  .page-h h1 { font-size: 22px; }
  .btn { padding: 0 13px; font-size: 11px; }
  .kpi { min-width: 0; flex: 1 1 120px; }
  .stages { grid-template-columns: repeat(2, 1fr); }
}

/* ---- panel: formularze szybkich akcji (okno), ladowanie, bledy ---- */
.confirm .box.wide { width: min(520px, 100%); }
.confirm form { display: grid; gap: 12px; }
.confirm .fgrid { grid-template-columns: 1fr 1fr; }
.loading { color: var(--dim); font-size: 13px; padding: 24px 0; display: flex; gap: 8px; align-items: center; }
.loading::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.errbox { background: var(--bad-soft); border-left: 3px solid var(--bad); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; color: #7a2315; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.errbox .btn { margin-left: auto; }
.login .err { color: var(--bad); font-size: 13px; }
.login .qr { font-family: var(--mono); font-size: 13px; word-break: break-all; background: var(--bg-2); padding: 10px; border-radius: var(--r-sm); }
.ev .b a { color: var(--blue); }
.lamp.ok { border-left-color: var(--ok); }
.lamp.stale { border-left-color: var(--nodata); }
.dot-stale { background: var(--nodata); }
@media (max-width: 860px) { .confirm .fgrid { grid-template-columns: 1fr; } }
