/* =====================================================================
   CRM mtik.pl — v4.0 design system
   Desktop-only. One stylesheet, no build step. Screens reuse these
   classes; anything screen-specific lives in the "Screens" section at the
   bottom, grouped by screen.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #F6F6F3; --surface: #FFFFFF; --sunken: #EFEFEA; --ink: #17171A; --muted: #6A6A73; --faint: #A3A3AA;
  --line: #E6E5DF; --line-strong: #D6D5CE; --hover: #F1F1EC; --sel: #EAF0FF;
  --accent: #2C5BE8; --on-ink: #FFFFFF;
  --new: #5B6472; --new-bg: #ECEEF1;
  --pro: #A4560A; --pro-bg: #FBEEDC;
  --paid: #137A43; --paid-bg: #DFF3E7;
  --info: #2C5BE8; --info-bg: #E4EBFE;
  --bad: #B42318; --bad-bg: #FBE5E3;
  --star: #E0A100;
  --scrim: rgba(10,10,10,.18);
  --shadow: 0 1px 2px rgba(20,20,15,.05), 0 12px 32px -12px rgba(20,20,15,.22);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F0F11; --surface: #17171A; --sunken: #121214; --ink: #ECECEE; --muted: #9B9BA4; --faint: #5E5E66;
  --line: #26262B; --line-strong: #34343A; --hover: #1E1E22; --sel: #18223D;
  --accent: #7F9CFF; --on-ink: #0F0F11;
  --new: #A6ADBA; --new-bg: #23262C; --pro: #F0B060; --pro-bg: #33260F;
  --paid: #5DD39A; --paid-bg: #12301F; --info: #8EA8FF; --info-bg: #1A2445;
  --bad: #FF8A80; --bad-bg: #3A1614; --star: #F0C040;
  --scrim: rgba(0,0,0,.45);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -12px rgba(0,0,0,.7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0F11; --surface: #17171A; --sunken: #121214; --ink: #ECECEE; --muted: #9B9BA4; --faint: #5E5E66;
    --line: #26262B; --line-strong: #34343A; --hover: #1E1E22; --sel: #18223D;
    --accent: #7F9CFF; --on-ink: #0F0F11;
    --new: #A6ADBA; --new-bg: #23262C; --pro: #F0B060; --pro-bg: #33260F;
    --paid: #5DD39A; --paid-bg: #12301F; --info: #8EA8FF; --info-bg: #1A2445;
    --bad: #FF8A80; --bad-bg: #3A1614; --star: #F0C040;
    --scrim: rgba(0,0,0,.45);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -12px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13.5px/1.45 var(--sans); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; min-width: 1100px; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
h1 { font-size: 22px; letter-spacing: -.02em; margin: 0; font-weight: 650; }
h2 { font-size: 13px; font-weight: 600; margin: 0; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .danger-text { color: var(--bad); }
.small { font-size: 12px; } .nowrap { white-space: nowrap; }
.right { text-align: right; }
.lnk { color: var(--accent); cursor: pointer; text-decoration: none; background: none; border: 0; padding: 0; }
.lnk:hover { text-decoration: underline; }
.grow { flex: 1; }
.flex { display: flex; align-items: center; gap: 8px; }
.stack > * + * { margin-top: 12px; }
svg.lucide, .ico { width: 16px; height: 16px; flex: none; stroke-width: 1.8; }
.ico-sm svg.lucide, svg.lucide.ico-sm { width: 14px; height: 14px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 14px; font-weight: 650; letter-spacing: -.01em; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font: 700 10.5px var(--mono); }
.brand .ver { margin-left: auto; font: 500 11px var(--mono); color: var(--faint); }
.search-btn { display: flex; align-items: center; gap: 8px; margin: 0 2px 12px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); text-align: left; }
.search-btn:hover { border-color: var(--line-strong); }
kbd { margin-left: auto; font: 11px var(--mono); color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; background: var(--bg); }
.grp { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 12px 10px 4px; }
.nav { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 7px; border: 0; background: none; text-align: left; color: var(--muted); text-decoration: none; }
.nav:hover { background: var(--hover); color: var(--ink); }
.nav.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); font-weight: 550; }
.nav .n { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.nav .n.hot { color: var(--on-ink); background: var(--ink); border-radius: 9px; padding: 0 6px; font-weight: 600; }
.side .foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding: 8px 4px 0 10px; color: var(--muted); font-size: 12.5px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--sunken); border: 1px solid var(--line); display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 600; color: var(--muted); flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }

.main { overflow: auto; position: relative; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.crumb { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb a { color: var(--muted); text-decoration: none; } .crumb a:hover { color: var(--ink); }
.top .sp { flex: 1; }
.page { padding: 26px 28px 96px; max-width: 1240px; }
.page.wide { max-width: none; }
.sub { color: var(--muted); margin-top: 3px; }
.head { display: flex; align-items: center; gap: 14px; }
.head .acts { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 500; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.pri { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.pri:hover { opacity: .88; background: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.icon { padding: 0; width: 30px; justify-content: center; }
.btn.sm.icon { width: 26px; }
.btn.block { width: 100%; justify-content: center; height: 36px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 0 11px; color: var(--muted); height: 28px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--on-ink); }
.seg button .c { opacity: .6; margin-left: 3px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px dashed var(--line-strong); border-radius: 7px; color: var(--muted); background: none; }
.chip.on { border-style: solid; color: var(--ink); background: var(--surface); }
.toolbar { display: flex; align-items: center; gap: 8px; margin: 20px 0 14px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.input, .select, .textarea, .search { height: 32px; width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; padding: 0 10px; background: var(--surface); color: var(--ink); font: inherit; outline: none; }
.textarea { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.select { padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus, .search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.input[readonly] { background: var(--sunken); }
.search { width: 300px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label, .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--faint); }
.field .err { font-size: 12px; color: var(--bad); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input, table.t input[type=checkbox] { accent-color: var(--ink); width: 14px; height: 14px; margin: 0; }
.input-group { display: flex; gap: 6px; } .input-group .input { flex: 1; }
.form-error { background: var(--bad-bg); color: var(--bad); border-radius: 7px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 12px; }

/* Combobox (searchable select) */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; }
.combo-item { padding: 6px 9px; border-radius: 6px; cursor: pointer; }
.combo-item:hover, .combo-item.on { background: var(--hover); }
.combo-item .s { color: var(--muted); font-size: 12px; }

/* ---------- Data display ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.row { display: grid; align-items: center; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row.click { cursor: pointer; } .row.click:hover { background: var(--hover); }
.empty { padding: 22px; text-align: center; color: var(--muted); }
.loading { padding: 22px; text-align: center; color: var(--faint); }
.who b { font-weight: 560; } .who .s { color: var(--muted); font-size: 12.5px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.box > h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.box > h3 .acts { margin-left: auto; display: flex; gap: 6px; font-weight: 400; }
.sh { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; }
.sh h2 .c, .sh .c { color: var(--faint); font-weight: 500; }
.sh .acts { margin-left: auto; display: flex; gap: 6px; }
.two { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 24px; margin-top: 22px; align-items: start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
.note { background: var(--sunken); border-radius: 8px; padding: 10px 12px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
pre.note { font-family: var(--mono); font-size: 12px; margin: 0; overflow: auto; }

.kpis { display: flex; margin-top: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.kpi { flex: 1; padding: 12px 16px; border-right: 1px solid var(--line); min-width: 0; }
.kpi:last-child { border: 0; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 20px; font-weight: 620; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; }
.kpi .d { font-size: 11.5px; color: var(--faint); }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11.5px; font-weight: 550; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.s-new { color: var(--new); background: var(--new-bg); } .s-pro { color: var(--pro); background: var(--pro-bg); }
.s-paid { color: var(--paid); background: var(--paid-bg); } .s-info { color: var(--info); background: var(--info-bg); }
.s-bad { color: var(--bad); background: var(--bad-bg); }
.code { font: 600 11.5px var(--mono); padding: 1px 6px; border-radius: 5px; background: var(--sunken); border: 1px solid var(--line); white-space: nowrap; }
.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; } .stars span { color: var(--line-strong); }
.bar { display: block; height: 6px; background: var(--sunken); border-radius: 3px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }

/* Seats strip: one cell per place, coloured by stage */
.seats { display: flex; gap: 2px; margin: 9px 0 5px; }
.seats i { flex: 1; height: 6px; border-radius: 2px; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); min-width: 3px; }
.seats i.paid { background: var(--paid); box-shadow: none; }
.seats i.proforma { background: var(--pro); box-shadow: none; opacity: .85; }
.seats i.new { background: var(--new); box-shadow: none; opacity: .55; }
.seats i.over { background: var(--bad); box-shadow: none; }
.seatlbl { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); gap: 8px; }

/* Stage steps: n of 3 */
.steps { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.steps i { width: 18px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.steps i.on { background: var(--ink); }
.steps + span { margin-left: 8px; font-size: 12px; color: var(--muted); }

/* Tables */
table.t { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.t th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg); white-space: nowrap; }
.t td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.t tbody tr:first-child td { border-top: 0; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: var(--hover); }
.t tbody tr.sel td { background: var(--sel); }
.t td.num, .t th.num, .num { text-align: right; font-weight: 550; white-space: nowrap; }
.num .s, .t td .s { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.t td.w-check, .t th.w-check { width: 34px; padding-right: 0; }
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.pager .flex { gap: 6px; }

/* Definition list */
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 7px 12px; font-size: 13px; margin: 0 0 18px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; word-break: break-word; }
.sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.sec .acts { margin-left: auto; text-transform: none; letter-spacing: 0; display: flex; gap: 6px; }

/* Timeline */
.tl { list-style: none; margin: 0 0 0 4px; padding: 0; border-left: 1px solid var(--line-strong); }
.tl li { position: relative; padding: 0 0 12px 16px; font-size: 13px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before { content: ""; position: absolute; left: -4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--muted); }
.tl li .w { color: var(--faint); font-size: 12px; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 8px 10px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-color: var(--ink); font-weight: 550; }

/* Price breakdown */
.price { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.price div { display: flex; justify-content: space-between; padding: 2px 0; gap: 12px; }
.price .tot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 7px; font-weight: 600; }

/* ---------- Overlays ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 30; }
.scrim.show { opacity: 1; pointer-events: auto; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 92vw; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow); transform: translateX(102%); transition: transform .2s ease; z-index: 31; display: flex; flex-direction: column; }
.panel.show { transform: none; }
.panel.wide { width: 620px; }
.ph { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); position: relative; }
.ph .x { position: absolute; top: 12px; right: 12px; }
.ph .kicker { font-size: 12px; color: var(--faint); margin-bottom: 4px; }
.ph h2 { font-size: 17px; letter-spacing: -.01em; font-weight: 650; padding-right: 32px; }
.ph .meta { margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pb { padding: 16px 20px; overflow: auto; flex: 1; }
.pb > .sec:first-child { margin-top: 0; }
.pf { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.pf .sp { flex: 1; }

.modal-wrap { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: var(--scrim); }
.modal { width: 560px; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.modal.lg { width: 760px; }
.modal.sm { width: 400px; }
.dialog-wrap { z-index: 60; }
.dialog .pb { padding: 20px; }
.dialog .msg { line-height: 1.5; }

/* Menu (dropdown) */
.menu { position: fixed; z-index: 50; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); padding: 4px; }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 6px; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* Command palette */
.pal { position: fixed; top: 14vh; left: 50%; transform: translateX(-50%) scale(.98); width: 620px; max-width: 92vw; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 41; opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; overflow: hidden; }
.pal.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) scale(1); }
.pal input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; font: 15px var(--sans); background: none; color: var(--ink); outline: none; }
.pal .res { max-height: 400px; overflow: auto; padding: 6px; }
.pal .g { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px 4px; }
.pal .it { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.pal .it.on { background: var(--hover); }
.pal .it .s { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal .hint { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); }
#pal-scrim { z-index: 40; }

/* Bulk actions bar */
.bulk { position: fixed; left: calc(50% + 116px); bottom: 22px; transform: translateX(-50%) translateY(calc(100% + 40px)); visibility: hidden; display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; border-radius: 11px; background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow); transition: transform .18s ease; z-index: 20; }
.bulk.show { transform: translateX(-50%) translateY(0); visibility: visible; }
.bulk .btn { background: transparent; color: var(--on-ink); border-color: color-mix(in srgb, var(--on-ink) 25%, transparent); }
.bulk .btn:hover { background: color-mix(in srgb, var(--on-ink) 12%, transparent); }

/* Toast */
.toast { position: fixed; left: calc(50% + 116px); bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--on-ink); padding: 9px 14px; border-radius: 9px; box-shadow: var(--shadow); font-size: 13px; z-index: 70; max-width: 560px; display: flex; gap: 12px; align-items: center; }
.toast.error { background: var(--bad); color: #fff; }
.toast button { background: none; border: 0; color: inherit; opacity: .7; padding: 0; text-decoration: underline; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 360px; }
.login-card .brand { justify-content: center; padding: 0 0 6px; font-size: 18px; }
.login-card .brand .mark { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
.login-card .tag { text-align: center; color: var(--muted); margin-bottom: 26px; }
.login-card .box { padding: 22px; }
.login-card .or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; margin: 16px 0; }
.login-card .or::before, .login-card .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login-card .links { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12.5px; }
.login-card .links button { background: none; border: 0; color: var(--muted); padding: 0; }
.login-card .links button:hover { color: var(--ink); }
#totp-code { font: 600 20px var(--mono); letter-spacing: .25em; text-align: center; height: 44px; }

/* =====================================================================
   Screens
   ===================================================================== */

/* ---------- Dziś + Rejestracje ---------- */
/* Screens: Dziś (today-*) and Rejestracje (reg-*) */

/* ---------- Dziś ---------- */
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; margin-top: 22px; align-items: start; }
.today-group { margin-bottom: 22px; }
.today-group h2, .today-h h2 { font-size: 13px; font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.today-group h2 .c { color: var(--faint); font-weight: 500; }
.today-why { font-size: 12px; color: var(--muted); margin: -6px 0 8px; }
.today-task { grid-template-columns: minmax(0, 1fr) 170px 120px auto; }
.today-task .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-task > div:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-more { display: block; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: center; color: var(--muted); font-size: 12.5px; }
.today-age { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.today-age.late { color: var(--bad); font-weight: 550; }
.today-acts { display: flex; gap: 6px; justify-content: flex-end; opacity: .6; }
.today-task:hover .today-acts { opacity: 1; }
.today-h { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 0; }
.today-h:first-child { margin-top: 0; }
.today-h .lnk { margin-left: auto; }
.today-counts { margin: -4px 0 8px; }
.today-run { display: block; padding: 12px 14px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.today-run:first-child { border-top: 0; }
.today-run:hover { background: var(--hover); }
.today-run-t { display: flex; align-items: center; gap: 8px; }
.today-run-when { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.today-recent { grid-template-columns: minmax(0, 1fr) auto; }
.today-recent .s { margin-top: 2px; }

/* ---------- Rejestracje: board ---------- */
.reg-filter { width: auto; max-width: 220px; height: 28px; font-size: 12.5px; }
.reg-board { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 12px; align-items: start; }
.reg-board.four { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
.reg-lane { background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 120px; }
.reg-lane.dim { opacity: .65; }
.reg-lane h3 { margin: 2px 4px 8px; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.reg-lane h3 .c { color: var(--faint); font-weight: 500; }
.reg-lane h3 .sum { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 12px; }
.reg-lane-empty { padding: 14px 6px; text-align: center; color: var(--faint); font-size: 12px; }
.reg-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-bottom: 6px; cursor: pointer; }
.reg-card:hover { border-color: var(--line-strong); box-shadow: 0 2px 8px -4px rgba(0, 0, 0, .15); }
.reg-card-a b { font-weight: 560; }
.reg-card-b { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reg-card-c { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.reg-card-amt { margin-left: auto; color: var(--ink); font-weight: 550; white-space: nowrap; }

/* ---------- Rejestracje: list ---------- */
.t tbody tr.reg-dim td { color: var(--faint); }

/* ---------- Registration panel / form ---------- */
.reg-docs { border: 1px solid var(--line); border-radius: 8px; }
.reg-docrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 90px; gap: 10px; align-items: center; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.reg-docrow:first-child { border-top: 0; }
.reg-adv { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.reg-adv summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }

/* ---------- Szkolenia ---------- */
/* Screen: course-runs (Szkolenia) */
.crun-filter { width: auto; min-width: 220px; }
.crun-month { font-size: 12px; font-weight: 600; color: var(--muted); margin: 18px 0 8px; }
.crun-row { grid-template-columns: 58px minmax(0, 1fr) 110px 200px 120px 100px; }
.crun-row .seats { margin-top: 0; }
.crun-date { text-align: center; line-height: 1.1; }
.crun-date .d { font-size: 17px; font-weight: 640; letter-spacing: -.02em; }
.crun-date .m { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.crun-name { min-width: 0; }
.crun-name b { font-weight: 560; }
.crun-name .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crun-dim { color: var(--muted); background: var(--sunken); }

/* Detail */
.crun-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.crun-code { font-size: 15px; vertical-align: 3px; }
.crun-stats { margin: 20px 0 6px; }
.crun-stats .seats { margin: 8px 0 4px; }
.t td.crun-act, .t th.crun-act { width: 36px; padding-left: 0; text-align: right; }
.t tr.crun-cancelled td { color: var(--muted); }

/* Form */
.crun-check { align-items: flex-start; }
.crun-check input { margin-top: 2px; }
.crun-check .hint { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }

/* Import modal */
.crun-imp { grid-template-columns: minmax(0, 1fr) auto; }
.crun-imp-done { opacity: .6; }

/* ---------- Kontakty + Firmy ---------- */
/* Screens: Kontakty + Firmy (js/screens/contacts.js, organizations.js) */
.ppl-head { display: flex; gap: 14px; align-items: center; }
.ppl-person { display: flex; gap: 10px; align-items: center; }
.ppl-person b, .ppl-name { font-weight: 560; }
.ppl-cert { grid-template-columns: 84px minmax(0, 1fr) minmax(0, auto) auto 26px; }
.ppl-src { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.ppl-mt { grid-template-columns: minmax(0, 1fr) auto; }
.ppl-dim { opacity: .6; }
.ppl-click { cursor: pointer; }

/* ---------- Ankiety, Historia, Ustawienia ---------- */
/* Screens: Ankiety, Historia, Ustawienia */

/* ---------- Ankiety ---------- */
.ank-row { grid-template-columns: 56px 220px 150px 80px minmax(0,1fr) 110px; }
.ank-ell { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ank-snip { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.ank-stat { display: grid; grid-template-columns: 150px 1fr 40px; gap: 12px; align-items: center; padding: 5px 0; font-size: 13px; }
.ank-stat b { text-align: right; font-weight: 600; }
.ank-stat-run { grid-template-columns: minmax(0,1fr) 60px 60px; }
.ank-bigstars .stars { font-size: 17px; }
.ank-link-list { margin-top: 8px; max-height: 280px; overflow: auto; }
.ank-link-row { grid-template-columns: minmax(0,1fr) 170px auto; }

/* ---------- Historia ---------- */
.hist-day { font-size: 12px; font-weight: 600; color: var(--muted); margin: 18px 0 8px; }
.hist-row { grid-template-columns: 48px 8px minmax(0,1fr) 140px; }
.hist-desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-desc b { font-weight: 560; }
.hist-ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.hist-dot.c-sales { background: var(--pro); }
.hist-dot.c-base { background: var(--info); }
.hist-dot.c-runs { background: var(--paid); }
.hist-dot.c-auth { background: var(--faint); }
.hist-dot.c-fail { background: var(--bad); }
.hist-more { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- Ustawienia ---------- */
.set-grid { display: grid; grid-template-columns: 170px minmax(0, 760px); gap: 28px; margin-top: 22px; align-items: start; }
.set-nav { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 2px; }
.set-nav a { padding: 6px 10px; border-radius: 7px; color: var(--muted); cursor: pointer; }
.set-nav a:hover { background: var(--hover); color: var(--ink); }
.set-page section.box { scroll-margin-top: 72px; }
.set-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.box > h3 + .set-row { border-top: 0; padding-top: 4px; }
.set-row .muted { font-size: 12.5px; margin-top: 2px; }
.set-key { display: flex; gap: 6px; margin-top: 10px; align-items: center; }
.set-key .input { width: 320px; font-size: 12px; }
.set-sub { margin-top: 10px; }
.set-pk { grid-template-columns: minmax(0,1fr) auto auto; }
.set-ell { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-totp { display: grid; grid-template-columns: 148px minmax(0,1fr); gap: 18px; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.set-totp p { margin: 0 0 8px; font-size: 13px; }
.set-qr { width: 148px; height: 148px; padding: 8px; background: #fff; border-radius: 6px; display: grid; place-items: center; font-size: 12px; color: #555; text-align: center; }
.set-qr svg { width: 100%; height: 100%; }
.set-secret { display: inline-block; margin-bottom: 12px; font-size: 12.5px; letter-spacing: .04em; user-select: all; }
.set-codes { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.set-codes p { margin: 0 0 8px; font-size: 13px; }
