/* Auta PRL-u: panel administratora. */
:root {
  --bg: #f3f0ea; --card: #fff; --line: #e3ddd2; --ink: #17140f; --ink2: #4a4338; --muted: #6f675b;
  --red: #d7141a; --red2: #a30d12; --green: #1d7a46; --yellow: #f4b400; --blue: #2a6db0;
  --side: #16171b; --side2: #23252b; --sidetext: #c9c6bf;
  --ok-bg: #e2f4e9; --bad-bg: #fde6e6; --wait-bg: #fff3cc; --info-bg: #e3eefa;
  --r: 14px;
  --font-display: 'APRL Display', 'Arial Black', system-ui, sans-serif;
  --font-text: 'APRL Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font-text); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .6em; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
a { color: var(--blue); }
code { background: #f1ede5; padding: 2px 6px; border-radius: 6px; font-size: .92em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.muted { color: var(--muted); font-size: .9rem; }
.good { color: var(--green); font-weight: 600; } .bad { color: var(--red2); font-weight: 600; }
.mt { margin-top: 18px; }
.empty { color: var(--muted); text-align: center; padding: 18px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* przyciski */
.b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); border-radius: 10px;
  padding: 9px 15px; font: 600 .92rem/1.1 var(--font-text); cursor: pointer; text-decoration: none; min-height: 40px; transition: background .15s, transform .1s; }
.b:hover { background: #f4f1ea; } .b:active { transform: translateY(1px); }
.b--red { background: var(--red); border-color: var(--red); color: #fff; } .b--red:hover { background: var(--red2); }
.b--green { background: var(--green); border-color: var(--green); color: #fff; } .b--green:hover { background: #135c34; }
.b--danger { color: var(--red2); border-color: #e9b4b4; background: #fff; } .b--danger:hover { background: var(--bad-bg); }
.b--ghost { border-color: var(--line); background: #fff; }
.b--sm { padding: 6px 11px; min-height: 34px; font-size: .85rem; }
.b--block { width: 100%; }
.b[disabled] { opacity: .5; cursor: not-allowed; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.linkbtn { background: none; border: 0; color: var(--blue); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.x { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; flex: none; }

/* logowanie */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #3a1214, var(--side) 60%); }
.login__card { width: min(400px, 100%); background: #fff; border-radius: 22px; padding: 34px 30px; text-align: center; position: relative; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.login__card img { margin: 0 auto 10px; width: 110px; height: 110px; }
.login__card h1 { font-size: 1.8rem; margin-bottom: 2px; }
.login__card p { color: var(--muted); margin: 0 0 20px; }
.login__card label { display: block; text-align: left; font-weight: 600; margin-bottom: 6px; }
.login__card input { width: 100%; font-size: 1.05rem; padding: 12px 14px; border: 1.5px solid #cfc7b9; border-radius: 10px; margin-bottom: 14px; min-height: 48px; }
.login__card .b { min-height: 48px; font-size: 1rem; }
.login__err { color: var(--red2) !important; font-weight: 600; min-height: 1.4em; margin: 10px 0 0 !important; }
.login__back { display: inline-block; margin-top: 8px; font-size: .9rem; }
.login__ver { position: absolute; left: 12px; bottom: 8px; font-size: 11px; color: #a39d92; }

/* układ */
.app { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: 262px; height: 100vh; height: 100dvh; background: var(--side); color: var(--sidetext); display: flex; flex-direction: column; z-index: 40; }
.side__brand { position: relative; display: flex; gap: 12px; align-items: center; padding: 26px 18px 16px; border-bottom: 1px solid #2c2e35; }
.side__brand img { width: 46px; height: 46px; background: #fff; border-radius: 50%; padding: 2px; }
.side__brand strong { display: block; color: #fff; font: 800 1.12rem/1.1 var(--font-display); }
.side__brand small { color: #9b978f; font-size: .78rem; }
.side__ver { position: absolute; left: 10px; top: 6px; font-size: 10.5px; color: #77746d; letter-spacing: .02em; }
.side__nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; overscroll-behavior: contain; }
.side__group { margin: 16px 10px 6px; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: #77746d; font-weight: 700; }
.side__nav a { display: flex; align-items: center; gap: 11px; color: var(--sidetext); text-decoration: none; padding: 9px 12px; border-radius: 10px; font-weight: 500; position: relative; margin-bottom: 1px; }
.side__nav a i { width: 22px; text-align: center; font-style: normal; opacity: .85; }
.side__nav a:hover { background: var(--side2); color: #fff; }
.side__nav a.is-active { background: #fff; color: var(--ink); font-weight: 700; box-shadow: inset 4px 0 0 var(--red); }
.side__nav a.is-active i { color: var(--red); opacity: 1; }
.side__nav a b { margin-left: auto; background: var(--red); color: #fff; font-size: .72rem; border-radius: 999px; padding: 1px 8px; min-width: 22px; text-align: center; }
.side__nav a b:empty { display: none; }
.side__nav a.is-active b { background: var(--ink); }
.side__foot { border-top: 1px solid #2c2e35; padding: 12px; display: grid; gap: 6px; }
.side__foot a, .side__foot button { display: block; text-align: left; color: var(--sidetext); background: transparent; border: 1px solid #34363e; border-radius: 10px; padding: 9px 12px; font: 500 .9rem var(--font-text); cursor: pointer; text-decoration: none; }
.side__foot a:hover, .side__foot button:hover { background: var(--side2); color: #fff; }
.main { flex: 1; margin-left: 262px; min-width: 0; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(243, 240, 234, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar__title h1 { font-size: 1.5rem; margin: 0; }
.bar__title p { margin: 0; color: var(--muted); font-size: .88rem; }
.bar__actions { margin-left: auto; display: flex; gap: 8px; }
.bar__menu { display: none; width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; position: relative; }
.bar__menu span:first-child, .bar__menu span:first-child::before, .bar__menu span:first-child::after { position: absolute; left: 11px; width: 20px; height: 2px; background: var(--ink); content: ''; }
.bar__menu span:first-child { top: 21px; } .bar__menu span:first-child::before { top: -6px; left: 0; } .bar__menu span:first-child::after { top: 6px; left: 0; }
.view { padding: 24px 28px 60px; outline: none; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 35; }

/* karty i siatki */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cols > .card { margin-bottom: 0; }
.cols + .card, .cols + section { margin-top: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; text-decoration: none; color: var(--ink); border-top: 4px solid #d8d1c4; transition: transform .12s, box-shadow .12s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .06); }
.kpi--hot { border-top-color: var(--red); } .kpi--good { border-top-color: var(--green); }
.kpi__l { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi strong { display: block; font: 800 1.9rem/1.15 var(--font-display); margin: 4px 0 2px; }
.kpi small { color: var(--muted); font-size: .82rem; }
.alerts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.alert { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 11px 13px; border-radius: 10px; border-left: 4px solid; }
.alert--warn { background: var(--wait-bg); border-color: var(--yellow); } .alert--info { background: var(--info-bg); border-color: var(--blue); } .alert--todo { background: var(--bad-bg); border-color: var(--red); }
.meter { height: 14px; background: #eee8dd; border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--yellow)); border-radius: 999px; }
.secbox { margin-top: 16px; padding: 11px 13px; border-radius: 10px; background: #f4f1ea; font-size: .9rem; }
.secbox.is-ok { background: var(--ok-bg); } .secbox.is-bad { background: var(--bad-bg); color: var(--red2); } .secbox.is-warn { background: var(--wait-bg); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0; }
.kv div { border-bottom: 1px dashed var(--line); padding-bottom: 7px; min-width: 0; }
.kv dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kv dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.kv--wide { grid-column: 1 / -1; }
.notice { background: var(--info-bg); border: 1px solid #c4d8ef; border-radius: 12px; padding: 12px 15px; margin-bottom: 16px; font-size: .92rem; }
.notice--warn { background: var(--wait-bg); border-color: #f0d688; } .notice--ok { background: var(--ok-bg); border-color: #b5ddc4; }

/* etykiety */
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.tag--ok { background: var(--ok-bg); color: #135c34; } .tag--bad { background: var(--bad-bg); color: var(--red2); } .tag--wait { background: var(--wait-bg); color: #7a5600; }
.tag--info { background: var(--info-bg); color: #1d4f85; } .tag--mute { background: #eee9df; color: #5f584c; } .tag--club { background: #2b2d33; color: #fff; }
.pchip { display: inline-block; font: 700 1.05rem/1 'APRL Plate Condensed', 'Arial Narrow', sans-serif; letter-spacing: .1em; background: #fff; border: 2px solid var(--ink); border-radius: 6px; padding: 5px 9px; white-space: pre; box-shadow: inset 0 -3px 0 #f1e3e3; min-width: 40px; text-align: center; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: #bbb; }
.dot--approved { background: var(--green); } .dot--pending { background: var(--yellow); } .dot--rejected { background: var(--red); } .dot--missing { background: #9a9389; }
.ref { display: block; color: var(--muted); font-size: .75rem; margin-top: 4px; }

/* narzędzia i filtry */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search { flex: 1 1 320px; }
.search input, .card input[type=search], .inline input, .fld input, .fld select, .fld textarea {
  width: 100%; font: 400 .95rem/1.4 var(--font-text); padding: 9px 11px; border: 1.5px solid #d3cbbd; border-radius: 9px; background: #fff; color: var(--ink); min-height: 40px; }
.search input { min-height: 44px; padding-left: 14px; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .search input:focus, .inline input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42, 109, 176, .2); }
.fld input[readonly] { background: #f5f2ec; color: var(--ink2); }
.toolbar__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.flt { display: flex; flex-direction: column; gap: 3px; font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.flt select { font: 500 .9rem var(--font-text); padding: 7px 9px; border: 1.5px solid #d3cbbd; border-radius: 8px; background: #fff; min-height: 38px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.resultcount { margin: 0 0 8px; color: var(--muted); font-size: .88rem; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.card .table-wrap { border: 0; }
.otable { width: 100%; border-collapse: collapse; }
.otable th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 11px 12px; border-bottom: 1px solid var(--line); background: #faf8f4; white-space: nowrap; }
.otable td { padding: 11px 12px; border-bottom: 1px solid #efeae1; vertical-align: middle; }
.otable td small { display: block; color: var(--muted); font-size: .8rem; }
.otable tr[data-open] { cursor: pointer; }
.otable tbody tr:hover { background: #fbf8f2; }
.otable tbody tr:last-child td { border-bottom: 0; }
.mini-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 8px; }
.mini-table th, .mini-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #eee8de; vertical-align: top; }
.mini-table th { font-size: .74rem; color: var(--muted); text-transform: uppercase; }
.mini-table small { display: block; }
.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list button { display: flex; gap: 12px; align-items: center; width: 100%; background: none; border: 0; border-bottom: 1px solid #f0ebe2; padding: 10px 4px; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.mini-list button:hover { background: #faf8f3; }
.mini-list span { flex: 1; min-width: 0; } .mini-list small { display: block; color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { border: 1.5px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 999px; font: 600 .88rem var(--font-text); cursor: pointer; color: var(--ink2); }
.tabs button[aria-selected=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs button b { background: #eee8dd; color: var(--ink); border-radius: 999px; padding: 0 7px; margin-left: 4px; font-size: .78rem; }
.inline { display: flex; gap: 8px; } .inline input { flex: 1; }
.chk { display: flex; gap: 9px; align-items: flex-start; margin: 10px 0; cursor: pointer; font-size: .92rem; }
.chk input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--red); flex: none; }
.switch { display: flex; align-items: center; gap: 10px; margin: 10px 0; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 44px; height: 24px; border-radius: 999px; background: #cfc7b9; position: relative; flex: none; transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.fld label { font-weight: 600; font-size: .86rem; }
.fld small { color: var(--muted); font-size: .8rem; }
.fld--full { grid-column: 1 / -1; }
.rng output { color: var(--red2); font-weight: 700; margin-left: 4px; }
.rng input { padding: 0; min-height: 30px; border: 0; accent-color: var(--red); }
.colorrow { display: flex; gap: 8px; } .colorrow input[type=color] { width: 56px; padding: 2px; } .colorrow input:last-child { flex: 1; }
.savebar { position: sticky; bottom: 0; background: rgba(243, 240, 234, .96); padding: 12px 0; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 16px; z-index: 5; }
.dirty { background: var(--wait-bg); border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: .88rem; }
.adv { margin: 8px 0; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; }
.adv summary { cursor: pointer; font-weight: 600; }

/* płatności, dokumenty */
.paylist, .doclist { display: grid; gap: 10px; }
.payitem, .doccard { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.doccard { grid-template-columns: auto 1fr auto auto; }
.payitem small, .doccard small { display: block; color: var(--muted); }
.paysum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.paysum div { background: #f7f4ee; border-radius: 10px; padding: 10px 12px; }
.paysum span { display: block; font-size: .78rem; color: var(--muted); text-transform: uppercase; }
.payform { background: #f2faf5; border: 1px solid #bfe2cc; border-radius: 12px; padding: 14px; margin: 12px 0; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; } .inline-form .fld { flex: 1 1 260px; margin: 0; }
.memo { font-size: 1rem; background: #fff7d6; }
.docview { background: #eee8dd; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.docview iframe { width: 100%; height: 420px; border: 0; display: block; background: #fff; }
.docview img { max-width: 100%; max-height: 520px; display: block; margin: 0 auto; }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { display: grid; grid-template-columns: 170px 1fr; gap: 2px 14px; padding: 9px 0; border-bottom: 1px solid #eee8de; }
.hist time { color: var(--muted); font-size: .84rem; grid-row: span 2; }
.hist span { color: var(--ink2); font-size: .9rem; }
.bres { margin-top: 10px; max-height: 260px; overflow: auto; }
.errs { margin: 4px 0 10px; padding-left: 18px; color: var(--red2); }

/* edytor tablicy */
.editor { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.editor__preview { position: sticky; top: 90px; grid-row: span 2; }
.editor > .card { margin-bottom: 0; }
.plate { position: relative; width: 100%; aspect-ratio: 2048 / 1059; border-radius: 3.2% / 6.4%; overflow: hidden; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .18), 0 0 0 1px #ccc; }
.plate__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.plate__logo { position: absolute; left: 2.5%; top: 27%; width: 24%; height: auto; }
.plate__text { position: absolute; inset: 0; width: 100%; height: 100%; }
.editor__phone { margin: 16px 0 6px; }
.editor__phone span { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.plate--sm { width: 320px; max-width: 100%; }

/* przykłady */
.sample-add { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; } .sample-add form { flex: 1 1 300px; }
.samples { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.samples li { display: flex; gap: 12px; align-items: center; background: #faf8f4; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.samples li[draggable=true] { cursor: grab; }
.grip { color: #aaa29a; letter-spacing: -3px; }
.sample-btns { margin-left: auto; display: flex; gap: 6px; }

/* niespodzianki */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.mcard { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.mcard.is-off { opacity: .6; }
.mcard__thumb { position: relative; display: block; width: 100%; aspect-ratio: 1; background: #1b1b1d; border: 0; padding: 0; cursor: pointer; }
.mcard__thumb img, .mcard__thumb video { width: 100%; height: 100%; object-fit: contain; display: block; }
.play-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(215, 20, 26, .9); color: #fff; display: grid; place-items: center; font-size: 1.2rem; }
.nothumb { color: #ddd; display: grid; place-items: center; height: 100%; text-align: center; }
.mcard__body { padding: 12px; }
.mcard__body .fld label { font-size: .8rem; }
.fun-prev { background: #111; border-radius: 10px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
.fun-prev img, .fun-prev video { width: 100%; height: 100%; object-fit: contain; }
progress { width: 100%; height: 10px; margin-top: 10px; accent-color: var(--red); }

/* zdjęcie */
.photo-prev { max-width: 360px; border-radius: 14px; overflow: hidden; border: 8px solid #fff; box-shadow: 0 0 0 1px var(--line), 0 10px 26px rgba(0, 0, 0, .1); }
.photo-prev img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }

/* Black List */
.rules { display: flex; flex-wrap: wrap; gap: 6px; max-height: 340px; overflow-y: auto; padding: 10px 2px; margin-top: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rule { display: inline-flex; align-items: center; gap: 2px; font: 600 .82rem ui-monospace, Menlo, Consolas, monospace; background: #f5f1ea; border: 1px solid #e0d8ca; border-radius: 6px; padding: 2px 2px 2px 8px; }
.rule button { border: 0; background: transparent; cursor: pointer; font-size: 1.05rem; line-height: 1; width: 26px; height: 26px; border-radius: 5px; color: var(--muted); }
.rule button:hover { background: var(--bad-bg); color: var(--red2); }
.testres { margin-top: 10px; padding: 12px; border-radius: 10px; background: #f4f1ea; }
.testres.is-bad { background: var(--bad-bg); } .testres.is-ok { background: var(--ok-bg); }
.rules-help { padding-left: 18px; } .rules-help li { margin-bottom: 6px; }

/* okna */
.dlg { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.dlg--wide { width: min(820px, calc(100vw - 24px)); }
.dlg::backdrop, .drawer::backdrop { background: rgba(15, 14, 12, .55); }
.dlg__form { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.dlg__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dlg__head h2 { margin: 0; }
.dlg__body { padding: 16px 20px; overflow-y: auto; }
.dlg__err { color: var(--red2); font-weight: 600; margin: 0 20px; min-height: 0; }
.dlg__err:not(:empty) { margin-bottom: 8px; }
.dlg__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: #faf8f4; border-radius: 0 0 18px 18px; }
.drawer { border: 0; padding: 0; margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(780px, 100vw); max-width: 100vw; box-shadow: -20px 0 60px rgba(0, 0, 0, .25); }
.drawer__in { display: flex; flex-direction: column; height: 100%; }
.drawer__head { display: flex; gap: 14px; align-items: flex-start; padding: 18px 22px 12px; border-bottom: 1px solid var(--line); }
.drawer__head > div { flex: 1; min-width: 0; }
.drawer__head h2 { font-size: 1.4rem; margin: 8px 0 2px; }
.drawer__head p { color: var(--muted); margin: 0; font-size: .88rem; }
.drawer__head .pchip { font-size: 1.6rem; }
.drawer__actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 22px; background: #faf8f4; border-bottom: 1px solid var(--line); }
.tabs--drawer { padding: 12px 22px 0; margin: 0; }
.drawer__body { padding: 16px 22px 40px; overflow-y: auto; flex: 1; }

/* komunikaty */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 1000; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-weight: 500; transition: opacity .3s, transform .3s; border-left: 5px solid var(--blue); }
.toast--ok { border-color: #3ccf7f; } .toast--bad { border-color: var(--red); background: #3a0f11; }
.toast.is-out { opacity: 0; transform: translateY(8px); }

/* telefon i tablet */
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, 1fr); } .editor { grid-template-columns: 1fr; } .editor__preview { position: static; grid-row: auto; } }
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s; width: min(290px, 86vw); }
  .side.is-open { transform: none; box-shadow: 10px 0 40px rgba(0, 0, 0, .4); }
  .main { margin-left: 0; }
  .bar { padding: 10px 14px; }
  .bar__menu { display: block; }
  .bar__title h1 { font-size: 1.2rem; }
  .bar__title p { display: none; }
  .view { padding: 16px 14px 60px; }
  .cols { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; } .kpi strong { font-size: 1.5rem; }
  .grid2, .kv { grid-template-columns: 1fr; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .otable thead { display: none; }
  .otable, .otable tbody, .otable tr, .otable td { display: block; width: 100%; }
  .otable tr { border-bottom: 1px solid var(--line); padding: 10px 6px; }
  .otable td { border: 0; padding: 4px 8px; display: flex; gap: 10px; justify-content: space-between; align-items: center; text-align: right; }
  .otable td::before { content: attr(data-l); font-size: .74rem; color: var(--muted); text-transform: uppercase; font-weight: 600; text-align: left; flex: none; }
  .otable td small { display: block; }
  .otable td > b, .otable td > small { text-align: right; }
  .otable td[data-l=Klient] { flex-wrap: wrap; }
  .payitem, .doccard { grid-template-columns: auto 1fr; }
  .payitem .b, .doccard .b, .doccard > span:nth-child(3) { grid-column: 1 / -1; }
  .paysum { grid-template-columns: 1fr; }
  .hist li { grid-template-columns: 1fr; } .hist time { grid-row: auto; }
  .drawer__actions .b { flex: 1 1 auto; }
  .alert { flex-direction: column; align-items: flex-start; }
}

/* pole pliku: przeciągnij i upuść */
.dropzone { position: relative; border: 2px dashed #bdb3a2; border-radius: 12px; background: #faf8f4; padding: 14px; transition: background .15s, border-color .15s; }
.dropzone.is-over { background: #fff3cc; border-color: var(--ink); }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: #f0faf4; }
.dropzone__face { display: flex; align-items: center; gap: 10px; pointer-events: none; font-size: .9rem; }
.dropzone__icon { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--yellow); display: grid; place-items: center; flex: none; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; }
.dropzone:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }
.dropzone__msg { margin: 8px 0 0; font-size: .85rem; font-weight: 600; }
.dropzone__msg:empty { display: none; }
.dropzone__msg.is-error { color: var(--red2); } .dropzone__msg.is-ok { color: var(--green); }
.dropzone__preview { max-height: 120px; width: auto; margin-top: 8px; border-radius: 8px; border: 1px solid #ddd; }

/* teksty strony i pytania */
.ctext { padding: 14px 16px; margin-bottom: 10px; }
.ctext header, .faqitem header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ctext header .b, .faqitem header .sample-btns { margin-left: auto; }
.ctext.is-custom { border-left: 4px solid var(--blue); }
.ctext textarea, .faqitem textarea { resize: vertical; }
.wordcheck { margin-top: 8px; padding: 9px 11px; border-radius: 9px; background: #f4f1ea; font-size: .9rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wordcheck.is-ok { background: var(--ok-bg); color: #135c34; font-weight: 600; }
.wordcheck.is-bad { background: var(--bad-bg); color: var(--red2); font-weight: 600; }
