/* Department of Justice | San Andreas
   Kolorystyka z logo Departamentu: granat, złoto, bordo, kość słoniowa. */

:root {
  /* Barwy z logo */
  --navy: #032248;
  --brand-navy: #032248;
  --navy-2: #0a2f5c;
  --navy-3: #12407a;
  --burgundy: #6b1929;
  --burgundy-2: #8a2236;
  --gold: #c9a24a;
  --gold-light: #e5c56b;
  --bronze: #9b6d27;

  /* Powierzchnie i tekst */
  --bg: #f5f2ea;
  --bg-2: #fbfaf6;
  --panel: #ffffff;
  --panel-2: #f8f6f0;
  --panel-3: #efebe1;
  --border: #e4ddcd;
  --border-2: #d5ccb8;
  --text: #13213a;
  --text-2: #33415a;
  --muted: #687389;
  --faint: #9aa2b1;
  --gold-2: #8a5f1c;
  --gold-soft: rgba(201, 162, 74, 0.16);
  --navy-soft: rgba(3, 34, 72, 0.07);
  --ok: #1f7a4d;
  --ok-soft: #e6f3ec;
  --warn: #9a6200;
  --warn-soft: #fbf1dc;
  --bad: #a3233a;
  --bad-soft: #f8e6e9;
  --info: #1d4f91;
  --info-soft: #e8eff9;
  --accent-ink: var(--navy);
  --link: var(--navy-3);
  --field: #ffffff;
  --hover: #faf7ef;
  --desk: #e7e2d6;
  --guide-bg: #fffaf0;
  --guide-bg-2: #fdf6e5;
  --guide-border: #e9d9ae;
  --info-border: #c9d8ef; --info-ink: #17396b;
  --warn-border: #ecd6a6; --warn-ink: #6e4700;
  --bad-border: #ecc3cb;  --bad-ink: #7d1a2c;
  --ok-border: #bfdfcd;   --ok-ink: #165c3a;
  color-scheme: light;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(19, 33, 58, 0.06);
  --shadow: 0 1px 3px rgba(19, 33, 58, 0.06), 0 8px 24px rgba(19, 33, 58, 0.06);
  --shadow-lg: 0 20px 50px rgba(3, 34, 72, 0.22);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-doc: 'Courier Prime', 'Courier New', Courier, monospace;
  --font-sign: 'Great Vibes', 'Segoe Script', cursive;
  --sidebar: 272px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #0b1424;
  --bg-2: #0e1a2e;
  --panel: #131f33;
  --panel-2: #18263d;
  --panel-3: #1f2e47;
  --border: #26364f;
  --border-2: #344764;
  --text: #e6ebf3;
  --text-2: #c3cddc;
  --muted: #8e9bb0;
  --faint: #66748a;
  --gold-2: #e5c56b;
  --gold-soft: rgba(229, 197, 107, 0.14);
  --navy-soft: rgba(156, 195, 245, 0.10);
  --ok: #3fae78;  --ok-soft: rgba(63, 174, 120, 0.14);  --ok-border: rgba(63, 174, 120, 0.4);  --ok-ink: #8fe0b7;
  --warn: #e0a43a; --warn-soft: rgba(224, 164, 58, 0.14); --warn-border: rgba(224, 164, 58, 0.4); --warn-ink: #f4cf8a;
  --bad: #e5566f;  --bad-soft: rgba(229, 86, 111, 0.14);  --bad-border: rgba(229, 86, 111, 0.4);  --bad-ink: #f6a3b2;
  --info: #6ea8f0; --info-soft: rgba(110, 168, 240, 0.13); --info-border: rgba(110, 168, 240, 0.4); --info-ink: #b4d2f8;
  --accent-ink: #9cc3f5;
  --navy: #1d4782;
  --navy-2: #275798;
  --navy-3: #3a6db3;
  --link: #8fb8ee;
  --field: #0f1a2c;
  --hover: #1a2a43;
  --desk: #0a111e;
  --guide-bg: #1a2233;
  --guide-bg-2: #1c2436;
  --guide-border: #4a4128;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1424;
  --bg-2: #0e1a2e;
  --panel: #131f33;
  --panel-2: #18263d;
  --panel-3: #1f2e47;
  --border: #26364f;
  --border-2: #344764;
  --text: #e6ebf3;
  --text-2: #c3cddc;
  --muted: #8e9bb0;
  --faint: #66748a;
  --gold-2: #e5c56b;
  --gold-soft: rgba(229, 197, 107, 0.14);
  --navy-soft: rgba(156, 195, 245, 0.10);
  --ok: #3fae78;  --ok-soft: rgba(63, 174, 120, 0.14);  --ok-border: rgba(63, 174, 120, 0.4);  --ok-ink: #8fe0b7;
  --warn: #e0a43a; --warn-soft: rgba(224, 164, 58, 0.14); --warn-border: rgba(224, 164, 58, 0.4); --warn-ink: #f4cf8a;
  --bad: #e5566f;  --bad-soft: rgba(229, 86, 111, 0.14);  --bad-border: rgba(229, 86, 111, 0.4);  --bad-ink: #f6a3b2;
  --info: #6ea8f0; --info-soft: rgba(110, 168, 240, 0.13); --info-border: rgba(110, 168, 240, 0.4); --info-ink: #b4d2f8;
  --accent-ink: #9cc3f5;
  --navy: #1d4782;
  --navy-2: #275798;
  --navy-3: #3a6db3;
  --link: #8fb8ee;
  --field: #0f1a2c;
  --hover: #1a2a43;
  --desk: #0a111e;
  --guide-bg: #1a2233;
  --guide-bg-2: #1c2436;
  --guide-border: #4a4128;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; color: var(--text); }
h1 { font-size: 26px; letter-spacing: -0.015em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
code, .mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
::selection { background: rgba(201, 162, 74, 0.35); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.boot { display: grid; place-items: center; min-height: 100vh; background: var(--brand-navy); }
.boot-spinner, .spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(201, 162, 74, 0.25); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
.spinner { width: 18px; height: 18px; border-width: 2px; display: inline-block; vertical-align: middle; border-color: var(--border); border-top-color: var(--navy); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── Układ aplikacji ───────── */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, #04295a 0%, var(--brand-navy) 45%, #021a38 100%);
  color: #d7deea; display: flex; flex-direction: column; padding: 18px 14px;
  border-right: 1px solid rgba(201, 162, 74, 0.25);
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 8px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 16px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; letter-spacing: 0.08em; color: var(--gold-light); line-height: 1.2; }
.brand-sub { font-size: 11px; color: #9fb0c9; letter-spacing: 0.04em; margin-top: 2px; }
.side-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 2px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 8px; }
.side-cta a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 10px; font-size: 12px; font-weight: 700; text-align: center; color: var(--navy); background: linear-gradient(180deg, var(--gold-light), var(--gold)); }
.side-cta a.alt { background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid rgba(255, 255, 255, 0.14); }
.side-cta a:hover { text-decoration: none; filter: brightness(1.05); }
.side-cta .ico { width: 18px; height: 18px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; color: #7f93b3; padding: 14px 10px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: #d7deea; font-weight: 500; position: relative; }
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(229, 197, 107, 0.15); color: var(--gold-light); }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-light); }
.nav .count { margin-left: auto; background: var(--burgundy-2); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: #fff; }
.user-card:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; }
.user-card .who { min-width: 0; }
.user-card .name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .rank { font-size: 11.5px; color: #9fb0c9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .btn.ghost { color: #c5cfdf; }
.sidebar .btn.ghost:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }

.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--navy-3); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; box-shadow: none; }

.main { min-width: 0; }
.scrim { display: none; }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 32px 64px; }
.page.wide { max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 6px; max-width: 760px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40; padding: 10px 32px; min-height: 60px; background: rgba(245, 242, 234, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar .menu-btn, .topbar .topbar-brand, .topbar .search-mobile { display: none; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 290px; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(3, 20, 45, 0.55); z-index: 50; }
  .topbar { padding: 8px 12px; min-height: 0; background: var(--brand-navy); color: #fff; box-shadow: var(--shadow); border-bottom: 0; }
  .topbar .menu-btn, .topbar .search-mobile { display: inline-flex; }
  .topbar .topbar-brand { display: flex; }
  .topbar .appbar-search { display: none; }
  .topbar .bell-wrap { margin-left: 0; }
  .topbar .btn.ghost { color: #fff; }
  .page { padding: 20px 16px 50px; }
}

/* ───────── Komponenty ───────── */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .grid-2 > .card + .card, .grid-3 > .card + .card, .grid-4 > .card + .card, .stack > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 9px; }
.card-head .ico { color: var(--bronze); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 16px 20px 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.split.wide-side { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .split, .split.wide-side { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
a.stat:hover { border-color: var(--gold); text-decoration: none; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat .label .ico { color: var(--bronze); }
.stat .value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.stat.accent .value { color: var(--gold-2); }
.stat.alert { border-color: rgba(163, 35, 58, 0.35); background: linear-gradient(180deg, var(--panel), var(--bad-soft)); }
.stat.alert .value { color: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--panel); color: var(--text); font: 600 13.5px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.05s; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--panel-2); border-color: var(--navy-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.gold { background: linear-gradient(180deg, var(--gold-light), var(--gold)); border-color: var(--gold); color: var(--accent-ink); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.success:hover { background: #196640; }
.btn.danger { background: var(--panel); border-color: rgba(163, 35, 58, 0.45); color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover { background: var(--navy-soft); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 31px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; }

/* Formularze */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.field .req { color: var(--burgundy-2); margin-left: 2px; }
.field .help { font-size: 12px; color: var(--muted); }
.field.error .input, .field.error .select, .field.error .textarea { border-color: var(--bad); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.input, .select, .textarea { width: 100%; background: var(--field); color: var(--text); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 10px 12px; font: 14px/1.4 var(--font); transition: border-color 0.12s, box-shadow 0.12s; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(18, 64, 122, 0.14); }
.textarea { resize: vertical; min-height: 84px; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23687389' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.12em; text-transform: uppercase; font-size: 18px; text-align: center; }
.search { position: relative; }
.search .input { padding-left: 36px; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--panel-3); border: 1px solid var(--border-2); position: relative; transition: background 0.15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch input:checked + .track { background: var(--navy); border-color: var(--navy); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Plakietki */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; font-weight: 500; }
.chip .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--panel-3); color: var(--text-2); }
.tag .ico { width: 13px; height: 13px; }
.tag.gold { background: var(--gold-soft); color: var(--gold-2); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }

/* Tabele */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--panel-2); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; transition: background 0.1s; }
.table tbody tr.click:hover { background: var(--hover); }
.table .num { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--gold-2); white-space: nowrap; font-weight: 600; }
.table .title-cell { font-weight: 600; }
.table .title-cell a { color: var(--text); }
.table .title-cell .muted { font-weight: 400; font-size: 12.5px; }
@media (max-width: 760px) {
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table.responsive td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a, .tabs button { background: none; border: 0; color: var(--muted); font: 600 13.5px var(--font); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .active { color: var(--accent-ink); border-bottom-color: var(--gold); }
.tabs .count { background: var(--burgundy-2); color: #fff; font-size: 11px; padding: 0 7px; border-radius: 99px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .search { flex: 1 1 240px; }
.filters .select { width: auto; min-width: 170px; }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ico { width: 34px; height: 34px; color: var(--border-2); margin-bottom: 8px; }
.empty h3 { color: var(--text-2); margin-bottom: 4px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 8px; margin: 0 -8px; border-radius: 10px; color: var(--text); }
.list-item + .list-item { border-top: 1px solid var(--border); border-radius: 0; }
a.list-item:hover { text-decoration: none; background: var(--hover); border-radius: 10px; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emoji-box { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; background: var(--panel-3); }

.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: 13.5px; align-items: flex-start; }
.alert .ico { margin-top: 1px; }
.alert.info { background: var(--info-soft); border-color: var(--info-border); color: var(--info-ink); }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn-ink); }
.alert.bad { background: var(--bad-soft); border-color: var(--bad-border); color: var(--bad-ink); }
.alert.ok { background: var(--ok-soft); border-color: var(--ok-border); color: var(--ok-ink); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* Instrukcje (przewodnik przed działaniem) */
.guide { position: relative; border: 1px solid var(--guide-border); background: linear-gradient(180deg, var(--guide-bg), var(--guide-bg-2)); border-radius: var(--radius); padding: 16px 18px 14px; margin-bottom: 18px; }
.guide-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-right: 34px; }
.guide-head .gi { width: 30px; height: 30px; border-radius: 9px; background: var(--navy); color: var(--gold-light); display: grid; place-items: center; flex: none; }
.guide-head .gi .ico { width: 16px; height: 16px; }
.guide-head h3 { font-size: 14.5px; }
.guide-head .small { color: var(--muted); }
.guide ol { margin: 0; padding: 0; list-style: none; counter-reset: g; display: grid; gap: 8px; }
.guide li { counter-increment: g; position: relative; padding-left: 34px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.guide li::before { content: counter(g); position: absolute; left: 0; top: -1px; width: 23px; height: 23px; border-radius: 50%; background: var(--field); border: 1.5px solid var(--gold); color: var(--gold-2); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.guide li b { color: var(--text); }
.guide .tips { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--guide-border); font-size: 12.5px; color: var(--muted); }
.guide .close { position: absolute; top: 10px; right: 10px; }
.modal .guide { margin-bottom: 0; }

/* Kroki obiegu dokumentu */
.steps { display: flex; align-items: center; margin: 0 0 18px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow-sm); }
.step { display: flex; align-items: center; gap: 9px; white-space: nowrap; color: var(--muted); font-size: 13px; font-weight: 600; }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--panel-3); color: var(--muted); flex: none; }
.step .n .ico { width: 14px; height: 14px; }
.step.done .n { background: var(--ok); color: #fff; }
.step.done { color: var(--ok); }
.step.now .n { background: var(--navy); color: var(--gold-light); box-shadow: 0 0 0 4px rgba(3, 34, 72, 0.12); }
.step.now { color: var(--accent-ink); }
.step.bad .n { background: var(--bad); color: #fff; }
.step.bad { color: var(--bad); }
.step-line { flex: 1; min-width: 24px; height: 2px; background: var(--border); margin: 0 12px; }
.step-line.done { background: var(--ok); }

/* Pulpit */
.welcome { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: var(--radius); margin-bottom: 18px; color: #fff; background: radial-gradient(600px 200px at 85% 0%, rgba(229, 197, 107, 0.25), transparent 60%), linear-gradient(135deg, var(--brand-navy) 0%, #0a356b 60%, var(--burgundy) 140%); box-shadow: var(--shadow); flex-wrap: wrap; }
.welcome h1 { color: #fff; font-size: 24px; }
.welcome .sub { color: #c9d4e6; margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.welcome .chip { color: #e7ecf5; }
.welcome .tag.gold { background: rgba(229, 197, 107, 0.2); color: var(--gold-light); }
.welcome .logo { filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35)); }
.welcome .grow { flex: 1; min-width: 220px; }
.welcome .btn { box-shadow: none; }
.welcome .btn.ghost { color: #fff; border: 1px solid rgba(255, 255, 255, 0.25); }
.welcome .btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.quick a { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s; }
.quick a:hover { text-decoration: none; border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); }
.quick .qi { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--navy); color: var(--gold-light); }
.quick .qi .ico { width: 20px; height: 20px; }
.quick a.burgundy .qi { background: var(--burgundy); color: #f6dfe3; }
.quick a.gold .qi { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--navy); }
.quick b { font-size: 14.5px; }
.quick span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
@media (max-width: 1100px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Oś czasu */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ''; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--border-2); }
.tl-item.gold::before { border-color: var(--gold); background: var(--gold); }
.tl-item.ok::before { border-color: var(--ok); background: var(--ok); }
.tl-item.bad::before { border-color: var(--bad); background: var(--bad); }
.tl-item.note::before { border-color: var(--navy-3); }
.tl-head { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tl-head b { color: var(--text-2); font-weight: 700; }
.tl-text { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-note { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Modal i powiadomienia */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(3, 20, 45, 0.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade 0.12s ease; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop 0.14s ease; }
.modal.lg { width: min(760px, 100%); }
.modal.xl { width: min(940px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--panel-2); border-radius: 16px 16px 0 0; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--panel-2); flex-wrap: wrap; border-radius: 0 0 16px 16px; }
.modal .paper { min-height: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(6px) scale(0.98); opacity: 0; } }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--brand-navy); color: #fff; border-left: 4px solid var(--gold-light); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: pop 0.15s ease; }
.toast.ok { border-left-color: #5fd29a; }
.toast.bad { border-left-color: #ff8a9b; background: #4a0f1b; }

.copy-field { display: flex; gap: 6px; }
.secret-box { background: var(--panel-2); border: 1.5px dashed var(--gold); border-radius: var(--radius-sm); padding: 14px; text-align: center; font-family: ui-monospace, Consolas, monospace; font-size: 20px; letter-spacing: 0.08em; color: var(--accent-ink); font-weight: 700; user-select: all; }

/* ───────── Strona publiczna ───────── */
.public { min-height: 100vh; display: flex; flex-direction: column; }
.public-header { background: var(--brand-navy); position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 12px rgba(3, 34, 72, 0.25); border-bottom: 2px solid var(--gold); }
.public-header .inner { max-width: 1180px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 18px; }
.public-nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.public-nav a { color: #d7deea; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.public-nav a:hover, .public-nav a.active { background: rgba(255, 255, 255, 0.08); color: #fff; text-decoration: none; }
.public-nav a.btn { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--navy); border: 0; margin-left: 8px; }
.public-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 24px 60px; }
.public-footer { background: var(--brand-navy); color: #9fb0c9; font-size: 12.5px; }
.public-footer .inner { max-width: 1180px; margin: 0 auto; padding: 18px 24px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
@media (max-width: 760px) { .public-header .inner { flex-wrap: wrap; padding: 10px 16px; } .public-nav { margin-left: 0; width: 100%; } .public-main { padding: 22px 16px 50px; } }
.brand-banner img { display: block; height: 46px; width: auto; }
@media (max-width: 760px) { .brand-banner img { height: 36px; } }

.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 34px 38px; margin-bottom: 24px; border-radius: 20px; color: #fff; background: radial-gradient(700px 300px at 90% 10%, rgba(229, 197, 107, 0.22), transparent 60%), linear-gradient(135deg, var(--brand-navy) 0%, #0a356b 55%, var(--burgundy) 130%); box-shadow: var(--shadow); }
.hero h1 { font-family: var(--font-display); font-size: 40px; letter-spacing: 0.04em; color: var(--gold-light); line-height: 1.1; }
.hero .lead { font-size: 16px; color: #d7deea; margin: 14px 0 22px; max-width: 560px; }
.hero .tag.gold { background: rgba(229, 197, 107, 0.18); color: var(--gold-light); }
.hero .card { background: var(--panel); color: var(--text); border: 0; }
.hero-logo { display: grid; place-items: center; }
.hero-logo img { width: min(300px, 70vw); height: auto; filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.35)); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding: 24px 20px; } .hero-logo { order: -1; } .hero-logo img { width: min(180px, 50vw); } .hero h1 { font-size: 30px; } }
.feature { display: flex; gap: 14px; align-items: flex-start; color: var(--text); }
a.feature:hover { text-decoration: none; border-color: var(--gold); }
.feature .ico-box { width: 44px; height: 44px; border-radius: 12px; background: var(--navy); color: var(--gold-light); display: grid; place-items: center; flex: none; }
.feature .ico-box .ico { width: 20px; height: 20px; }
.feature h3 { margin-bottom: 4px; }
.feature p { color: var(--muted); margin: 0; font-size: 13.5px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(700px 400px at 70% 0%, rgba(229, 197, 107, 0.18), transparent 60%), linear-gradient(160deg, var(--brand-navy) 0%, #062c5c 60%, var(--burgundy) 140%); }
.login-card { width: min(410px, 100%); }
.login-card .seal-head { text-align: center; margin-bottom: 18px; }
.login-card .seal-head h1 { font-family: var(--font-display); color: var(--gold-light); font-size: 18px; letter-spacing: 0.12em; margin-top: 14px; }
.login-card .card { box-shadow: var(--shadow-lg); border: 0; }
.login-card > p a { color: #c9d4e6; }
.login-banner { display: block; width: 100%; max-width: 360px; margin: 0 auto; }

/* Weryfikacja */
.verify-banner { display: flex; gap: 16px; align-items: center; padding: 20px 22px; border-radius: var(--radius); border: 1px solid; margin-bottom: 18px; }
.verify-banner .big-ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.verify-banner .big-ico .ico { width: 28px; height: 28px; }
.verify-banner h2 { font-size: 20px; letter-spacing: 0.02em; }
.verify-banner .muted { color: var(--text-2) !important; }
.verify-banner.ok { background: var(--ok-soft); border-color: var(--ok-border); }
.verify-banner.ok .big-ico { background: var(--ok); color: #fff; }
.verify-banner.ok h2 { color: var(--ok); }
.verify-banner.warn { background: var(--warn-soft); border-color: var(--warn-border); }
.verify-banner.warn .big-ico { background: #c98a12; color: #fff; }
.verify-banner.warn h2 { color: var(--warn); }
.verify-banner.bad { background: var(--bad-soft); border-color: var(--bad-border); }
.verify-banner.bad .big-ico { background: var(--bad); color: #fff; }
.verify-banner.bad h2 { color: var(--bad); }
.sig-check { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sig-check:last-child { border-bottom: 0; }
.sig-check .okmark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; flex: none; }
.sig-check .okmark.bad { background: var(--bad); }
.sig-check .okmark .ico { width: 15px; height: 15px; }
details.tech { margin-top: 12px; }
details.tech summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.tech pre { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; overflow-x: auto; font-size: 11.5px; color: var(--text-2); white-space: pre-wrap; word-break: break-all; }

/* ───────── Szablony dokumentów ───────── */
.tpl-group { margin-bottom: 26px; }
.tpl-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tpl-group-head .bar { width: 4px; height: 20px; border-radius: 2px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tpl-card { display: flex; gap: 12px; padding: 15px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); color: var(--text); cursor: pointer; text-align: left; font: inherit; box-shadow: var(--shadow-sm); transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s; }
.tpl-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); }
.tpl-card.disabled { opacity: 0.45; cursor: not-allowed; }
.tpl-card.disabled:hover { border-color: var(--border); transform: none; box-shadow: var(--shadow-sm); }
.tpl-card h3 { font-size: 14px; margin-bottom: 3px; }
.tpl-card p { font-size: 12.5px; color: var(--muted); margin: 0; }
.tpl-card .who { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.tpl-preview { margin-top: 8px; padding-left: 0; }

.picker { border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--field); }
.picker-selected { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.picker-selected:empty { display: none; }
.picker-pill { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px 6px 10px; font-size: 13px; }
.picker-pill .grow { flex: 1; min-width: 0; }
.picker-pill small { color: var(--muted); display: block; font-size: 11.5px; }
.picker-pill button, .picker-pill a { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; display: grid; place-items: center; }
.picker-pill button:hover { color: var(--bad); }
.picker-pill a:hover { color: var(--navy-3); }
.picker-search { border-top: 1px solid var(--border); padding: 8px; }
.picker-selected:empty + .picker-search { border-top: 0; }
.picker-results { max-height: 260px; overflow-y: auto; margin-top: 6px; }
.picker-results button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 7px 9px; border-radius: 6px; cursor: pointer; font: 13px var(--font); }
.picker-results button:hover { background: var(--panel-2); }
.picker-results small { color: var(--muted); }
.picker-results .grp { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 8px 9px 4px; font-weight: 700; }

.editor { display: grid; grid-template-columns: minmax(380px, 0.9fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
.editor-preview { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: auto; border-radius: var(--radius); background: var(--desk); padding: 18px; border: 1px solid var(--border); }
.editor-preview-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }
@media (max-width: 1200px) { .editor { grid-template-columns: 1fr; } .editor-preview { position: static; max-height: none; } }
.side-actions { display: flex; flex-direction: column; gap: 8px; }
.next-step { background: linear-gradient(180deg, var(--panel), var(--guide-bg-2)); border-color: var(--guide-border); }
.next-step h3 { margin-bottom: 6px; }
.next-step p { color: var(--text-2); font-size: 13.5px; }
.signer-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.signer-row:last-child { border-bottom: 0; }
.signer-row .state { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--panel-3); color: var(--muted); }
.signer-row .state.ok { background: var(--ok); color: #fff; }
.signer-row .state .ico { width: 15px; height: 15px; }

/* ───────── Dokument (papier firmowy DOJ) ───────── */
.paper-wrap { background: var(--desk); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border); overflow-x: auto; }
.paper {
  --ink: #1d1d1f; --ink-2: #55565c; --rule: #a9a9ad; --pgold: #c9a54b;
  position: relative; width: 100%; max-width: 794px; min-height: 1060px; margin: 0 auto; background: #fffffd; color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 14px 40px rgba(3, 34, 72, 0.14);
  padding: 48px 62px 30px; font: 13px/1.6 var(--font-doc); overflow: hidden; display: flex; flex-direction: column;
}
.lh { text-align: left; }
.lh-banner { display: block; width: 78%; max-width: 560px; margin: 0 auto 18px; }
.lh-place { font-size: 13px; }
.lh-addr { margin-top: 10px; font-size: 12.5px; line-height: 1.35; }
.lh-prok { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.lh-prok .lh-place { padding-top: 26px; }
.lh-seal { width: 122px; height: 122px; flex: none; }
.p-title { text-align: center; font-size: 18px; margin: 24px 0 12px; letter-spacing: 0.01em; }
.p-signature { text-align: right; font-size: 12.5px; }
.p-small { font-size: 10.5px; color: var(--ink-2); }
.p-rule { border: 0; border-top: 1.4px solid var(--rule); margin: 14px 0; }
.p-body { flex: 1; }
.p-block, .p-sec { margin: 0 0 12px; }
.p-label { margin-bottom: 4px; }
.p-p { margin: 0; white-space: pre-wrap; text-align: justify; overflow-wrap: anywhere; }
.p-label + .p-p { margin-top: 2px; }
.p-dash { list-style: none; margin: 4px 0 0; padding-left: 52px; }
.p-dash li { position: relative; padding-left: 18px; text-align: justify; overflow-wrap: anywhere; }
.p-dash li::before { content: '-'; position: absolute; left: 0; }
.p-ol { margin: 4px 0 0; padding-left: 70px; }
.p-ol li { padding-left: 4px; text-align: justify; }
.p-ind { padding-left: 34px; }
.p-h { text-align: center; font-weight: 700; margin: 6px 0 12px; }
.p-extras { margin: 14px 0; padding: 8px 12px; border-left: 3px solid var(--pgold); background: rgba(201, 165, 75, 0.08); font-size: 12px; }
.p-extras div + div { margin-top: 3px; }
.p-hidden { text-align: center; padding: 60px 10px; color: var(--ink-2); font-style: italic; }
.p-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 40px; margin-top: 34px; }
.p-sigs.single .p-sig { grid-column: 2; }
.p-sigs.pair .p-sig:nth-child(1) { grid-column: 2; grid-row: 1; }
.p-sigs.pair .p-sig:nth-child(2) { grid-column: 1; grid-row: 2; margin-top: -26px; }
.p-sig { text-align: center; min-width: 0; }
.p-sig .ink { height: 58px; display: flex; align-items: flex-end; justify-content: center; }
.p-sig .ink img { max-height: 58px; max-width: 220px; }
.p-sig .ink .script { font-family: var(--font-sign); font-size: 32px; line-height: 1; color: #1b2a63; white-space: nowrap; }
.p-sig.pending .ink { font-family: var(--font-sign); font-size: 30px; color: #c4c4c8; }
.p-sig.party .ink { color: var(--ink-2); font-size: 12px; align-items: center; }
.p-sig .cap { font-size: 9.5px; color: var(--ink-2); margin-top: 2px; }
.p-sig .who { font-size: 10.5px; margin-top: 4px; }
.p-sig .when { font-size: 9.5px; color: var(--ink-2); }
.p-foot { text-align: center; font-style: italic; font-size: 10.5px; margin: 26px 0 0; }
.p-foot b { font-weight: 700; }
.p-gold { height: 8px; width: 46%; margin: 22px auto 0; border-top: 2px solid var(--pgold); border-bottom: 2px solid var(--pgold); }
.p-verify { margin-top: 18px; padding-top: 10px; border-top: 1px dashed #d6d6d9; display: flex; gap: 14px; align-items: center; font-size: 9.5px; color: var(--ink-2); line-height: 1.5; }
.p-verify .qr { width: 74px; height: 74px; flex: none; background: #fff; padding: 3px; border: 1px solid #ddd; }
.p-verify .qr svg { width: 100%; height: 100%; display: block; }
.p-verify b { color: var(--ink); }
.p-verify .code { font-size: 12px; letter-spacing: 0.08em; color: var(--ink); font-weight: 700; }
.paper-watermark { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%) rotate(-28deg); font-family: var(--font-display); font-weight: 700; font-size: 96px; letter-spacing: 0.1em; color: rgba(150, 150, 160, 0.12); pointer-events: none; white-space: nowrap; z-index: 2; }
.paper-watermark.bad { color: rgba(200, 40, 40, 0.16); border: 8px solid rgba(200, 40, 40, 0.16); padding: 0 30px; border-radius: 12px; font-size: 80px; }
.paper-conf { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font-family: var(--font-display); font-size: 11px; letter-spacing: 0.18em; color: #9b2c2c; border: 1.5px solid #9b2c2c; padding: 1px 8px; z-index: 3; }
@media (max-width: 700px) {
  .paper { padding: 30px 22px 24px; font-size: 12px; min-height: 0; }
  .p-dash { padding-left: 18px; }
  .p-ol { padding-left: 34px; }
  .lh-seal { width: 84px; height: 84px; }
  .p-sigs { grid-template-columns: 1fr; }
  .p-sigs .p-sig, .p-sigs.pair .p-sig:nth-child(1), .p-sigs.pair .p-sig:nth-child(2) { grid-column: 1; grid-row: auto; margin-top: 0; }
  .paper-watermark { font-size: 56px; }
  .paper-wrap { padding: 10px; }
}

/* ───────── Podgląd Discorda (kolory Discorda) ───────── */
.discord { background: #313338; border-radius: var(--radius); padding: 6px 0; font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #dbdee1; }
.dmsg { display: flex; gap: 14px; padding: 10px 16px; position: relative; }
.dmsg:hover { background: #2e3035; }
.dmsg .dav { width: 40px; height: 40px; border-radius: 50%; flex: none; background: #1e1f22; display: grid; place-items: center; overflow: hidden; }
.dmsg .dav svg, .dmsg .dav img { width: 40px; height: 40px; }
.dmsg .dbody { min-width: 0; flex: 1; }
.dmsg .dhead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dmsg .dname { color: #f2f3f5; font-weight: 600; font-size: 15px; }
.dmsg .dapp { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; letter-spacing: 0.02em; }
.dmsg .dtime { color: #949ba4; font-size: 12px; margin-left: 2px; }
.dmsg .dstatus { margin-left: auto; }
.dmsg .dcontent { margin-top: 2px; font-size: 15px; }
.dmention { background: rgba(88, 101, 242, 0.3); color: #c9cdfb; padding: 0 2px; border-radius: 3px; font-weight: 500; }
.dembed { margin-top: 6px; max-width: 520px; background: #2b2d31; border-left: 4px solid #c9a54b; border-radius: 4px; padding: 10px 16px 14px 12px; display: grid; gap: 6px; }
.dembed .dauthor { font-size: 13px; font-weight: 600; color: #f2f3f5; }
.dembed .dtitle { font-size: 15.5px; font-weight: 700; color: #f2f3f5; }
.dembed .dtitle a { color: #00a8fc; }
.dembed .ddesc { font-size: 14px; color: #dbdee1; white-space: pre-wrap; overflow-wrap: anywhere; }
.dembed .ddesc code, .dembed .dfield code { background: #1e1f22; padding: 1px 4px; border-radius: 4px; font-size: 12.5px; }
.dembed .dfields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin-top: 2px; }
.dembed .dfield { min-width: 0; font-size: 14px; }
.dembed .dfield.block { grid-column: 1 / -1; }
.dembed .dfield .fn { font-weight: 700; color: #f2f3f5; font-size: 13.5px; margin-bottom: 1px; }
.dembed .dfield .fv { white-space: pre-wrap; overflow-wrap: anywhere; color: #dbdee1; }
.dembed .dfoot { font-size: 12px; color: #b5bac1; margin-top: 4px; }
@media (max-width: 600px) { .dembed .dfields { grid-template-columns: 1fr 1fr; } .dmsg { padding: 10px; gap: 10px; } }

/* Podpis odręczny */
.sigpad-wrap { background: #fffffd; border-radius: var(--radius-sm); border: 1px solid var(--border-2); position: relative; }
.sigpad-wrap canvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
.sigpad-wrap .baseline { position: absolute; left: 24px; right: 24px; bottom: 44px; border-bottom: 1px dashed #b9b1a0; pointer-events: none; }
.sigpad-wrap .hint { position: absolute; left: 24px; bottom: 18px; font-size: 11px; color: #9a927f; pointer-events: none; }
.sig-preview { background: #fffffd; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; display: grid; place-items: center; min-height: 90px; }
.sig-preview img { max-height: 70px; max-width: 260px; }
.sig-preview .script { font-family: var(--font-sign); font-size: 36px; color: #1b2a63; }

/* Struktura */
.division-block { border-left: 4px solid var(--border-2); }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; color: var(--muted); }
.rank-row .count { margin-left: auto; font-variant-numeric: tabular-nums; }
.member { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border); }
.member + .member { margin-top: 6px; }
.member .grow { flex: 1; min-width: 0; }
.member .n { font-weight: 600; font-size: 13.5px; }
.member .r { font-size: 12px; color: var(--muted); }
.member.inactive { opacity: 0.5; }
.fee-table td:last-child { text-align: right; font-weight: 700; white-space: nowrap; color: var(--gold-2); }

/* Biblioteka i czytnik przepisów */
.logo { display: block; flex: none; object-fit: contain; }
.logo.center { margin: 0 auto; }
.act-card { display: flex; gap: 14px; align-items: flex-start; color: var(--text); }
a.act-card:hover { text-decoration: none; border-color: var(--gold); }
.act-card h3 { margin-bottom: 2px; }
.act-ico { width: 42px; height: 42px; border-radius: 11px; background: var(--navy); color: var(--gold-light); display: grid; place-items: center; flex: none; }
.act-ico .ico { width: 20px; height: 20px; }
.law-hit { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--border); color: var(--text); border-radius: 8px; }
.law-hit:hover { background: var(--hover); text-decoration: none; }
.law-hit .ref { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--gold-2); font-weight: 700; }
.law-hit .t { font-weight: 600; }
.law-hit .c { font-size: 12.5px; color: var(--muted); }
.law-chapter { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 16px 8px 6px; font-weight: 700; }
@media (max-width: 640px) { .law-hit { grid-template-columns: 1fr; gap: 2px; } }
.law-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.law-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 10px; }
.law-jump { display: none; }
.law-toc { overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 8px; }
.law-toc-ch + .law-toc-ch { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.law-toc a { display: block; color: var(--text-2); padding: 4px 8px; border-radius: 6px; font-size: 12.5px; line-height: 1.35; }
.law-toc a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.law-toc-head { font-weight: 800; color: var(--bronze) !important; font-size: 11px !important; text-transform: uppercase; letter-spacing: 0.06em; }
.law-toc-head span { display: block; text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--text); font-size: 12.5px; }
.law-toc-arts a { padding-left: 16px; }
.law-content { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 34px 28px; min-width: 0; box-shadow: var(--shadow-sm); }
.law-ch { scroll-margin-top: 70px; }
.law-ch > h2 { font-family: var(--font-display); color: var(--bronze); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; margin: 28px 0 6px; padding-bottom: 8px; border-bottom: 2px solid var(--gold-soft); }
.law-ch > h2 span { display: block; font-family: var(--font); text-transform: none; letter-spacing: 0; color: var(--accent-ink); font-size: 20px; margin-top: 4px; }
.law-art { scroll-margin-top: 70px; padding: 14px 12px; margin: 0 -12px; border-radius: 10px; transition: background 0.6s; }
.law-art.flash, .law-prec.flash { background: var(--gold-soft); }
.law-art h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15.5px; margin-bottom: 8px; color: var(--accent-ink); }
.law-art h3 .btn { opacity: 0; }
.law-art:hover h3 .btn, .law-art h3 .btn:focus-visible { opacity: 1; }
.law-p { margin: 0 0 8px; color: var(--text-2); line-height: 1.75; overflow-wrap: anywhere; }
.law-p b { color: var(--burgundy); }
.law-p.item { padding-left: 26px; text-indent: -20px; }
.law-prec { margin: 18px 0 6px; font-size: 14.5px; color: var(--accent-ink); scroll-margin-top: 70px; }
.law-copy { margin-top: 30px; font-size: 11.5px; color: var(--faint); border-top: 1px solid var(--border); padding-top: 12px; }
mark { background: rgba(229, 197, 107, 0.55); color: inherit; border-radius: 3px; padding: 0 1px; }
@media (max-width: 960px) {
  .law-layout { grid-template-columns: 1fr; }
  .law-side { position: static; max-height: none; }
  .law-toc { display: none; }
  .law-jump { display: block; }
  .law-content { padding: 4px 16px 20px; }
}

/* Kalkulatory */
.calc-out { display: grid; gap: 6px; margin-top: 12px; }
.calc-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.calc-row b { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.calc-row.big { background: var(--brand-navy); border-color: var(--brand-navy); color: #d7deea; }
.calc-row.big b { color: var(--gold-light); font-size: 18px; }
.calc-note { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Instrukcja */
.manual { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.manual-toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.manual-toc a { color: var(--text-2); padding: 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.manual-toc a:hover { background: var(--panel-2); text-decoration: none; }
.manual-toc .ico { color: var(--bronze); width: 16px; height: 16px; }
.manual section { scroll-margin-top: 70px; }
.manual section + section { margin-top: 18px; }
.manual h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 19px; }
.manual h2 .ico { color: var(--bronze); }
.manual h4 { margin: 14px 0 6px; font-size: 14px; color: var(--accent-ink); }
.manual p, .manual li { color: var(--text-2); }
.manual ul { padding-left: 20px; margin: 6px 0; }
@media (max-width: 960px) { .manual { grid-template-columns: 1fr; } .manual-toc { position: static; } }

/* ───────── Druk ───────── */
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff !important; }
  .sidebar, .topbar, .page-head, .no-print, .toast-wrap, .public-header, .public-footer, .side-col, .guide, .steps { display: none !important; }
  .app { display: block; }
  .page, .public-main { padding: 0 !important; max-width: none !important; }
  .split { display: block; }
  .paper-wrap { background: none; padding: 0; border: 0; }
  .paper { box-shadow: none; max-width: none; width: 210mm; min-height: 297mm; margin: 0; }
  .law-layout { display: block; }
  .law-content { border: 0; box-shadow: none; padding: 0; }
}
/* Na węższych ekranach karta „Co teraz?” i akcje są nad dokumentem */
@media (max-width: 1100px) { .split > .side-col { order: -1; } }

/* ───────── Pasek górny: wyszukiwarka i powiadomienia ───────── */
.topbar-brand { align-items: center; gap: 8px; color: #fff; margin-right: auto; }
.topbar-brand b { font-family: var(--font-display); color: var(--gold-light); letter-spacing: 0.06em; }
.topbar-brand:hover { text-decoration: none; }
.appbar-search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--field); color: var(--muted); font: 13.5px var(--font); cursor: pointer; text-align: left; box-shadow: var(--shadow-sm); }
.appbar-search:hover { border-color: var(--navy-3); color: var(--text-2); }
.appbar-search span:not(.ico) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font: 600 11px ui-monospace, Consolas, monospace; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.bell-wrap { position: relative; margin-left: auto; }
.btn.bell { position: relative; }
.bell-count { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--burgundy-2); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.bell-count[hidden] { display: none; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(400px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 90px)); overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 80; color: var(--text); }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); }
.bell-all { display: block; text-align: center; padding: 10px; font-weight: 600; border-top: 1px solid var(--border); }
.notif { display: flex; gap: 11px; padding: 11px 14px; color: var(--text); border-bottom: 1px solid var(--border); }
.notif:hover { background: var(--hover); text-decoration: none; }
.notif .ni { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-3); color: var(--muted); flex: none; }
.notif .ni .ico { width: 16px; height: 16px; }
.notif.unread { background: var(--guide-bg); }
.notif.unread .ni { background: var(--navy); color: var(--gold-light); }
.notif .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif b { font-size: 13.5px; }
.notif .nb { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.notif .nt { font-size: 11.5px; color: var(--faint); }
.notif-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); padding-right: 16px; }
.notif-row .notif { flex: 1; border-bottom: 0; }

/* Wyszukiwarka (Ctrl+K) */
.palette-backdrop { place-items: start center; padding-top: 10vh; }
.palette { width: min(680px, 100%); background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.12s ease; }
.palette-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-input { flex: 1; border: 0; outline: none; font: 16px var(--font); color: var(--text); background: transparent; min-width: 0; }
.palette-list { max-height: min(460px, 60vh); overflow-y: auto; padding: 6px; }
.palette-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--text); }
.palette-item:hover { text-decoration: none; }
.palette-item.active { background: var(--navy); color: #fff; }
.palette-item.active small { color: #c9d4e6; }
.palette-item .pi { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-3); color: var(--bronze); flex: none; font-size: 16px; }
.palette-item.active .pi { background: rgba(255, 255, 255, 0.12); color: var(--gold-light); }
.palette-item .grow { display: flex; flex-direction: column; min-width: 0; }
.palette-item b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-empty { padding: 26px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--border); background: var(--panel-2); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.palette-foot kbd { margin-right: 3px; }

/* Wspólne drobiazgi */
.guide.compact { padding: 10px 14px; margin-bottom: 0; }
.guide.compact ol { gap: 4px; }
.guide.compact li { font-size: 13px; }
button.list-item { background: none; border: 0; width: calc(100% + 16px); text-align: left; font: inherit; cursor: pointer; }
button.list-item:hover { background: var(--hover); border-radius: 10px; }
.seg { display: inline-flex; background: var(--panel-3); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; font: 600 13px var(--font); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.active { background: var(--panel); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.seg .ico { width: 15px; height: 15px; }
.grid-4 .feature { flex-direction: column; }

/* Kartoteka */
.person-alerts { display: grid; gap: 10px; margin-bottom: 18px; }
.person-alert { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius); border: 1px solid; }
.person-alert .big { font-size: 26px; line-height: 1; }
.person-alert b { display: block; margin-bottom: 2px; }
.person-alert.bad { background: var(--bad-soft); border-color: var(--bad-border); color: var(--bad-ink); }
.person-alert.warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn-ink); }
.person-alert.ok { background: var(--ok-soft); border-color: var(--ok-border); color: var(--ok-ink); }

/* Terminy i dowody */
.deadline-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.deadline-chip .ico { width: 13px; height: 13px; }
.deadline-chip.ok { background: var(--info-soft); color: var(--info); }
.deadline-chip.warn { background: var(--warn-soft); color: var(--warn); }
.deadline-chip.bad { background: var(--bad-soft); color: var(--bad); }
.deadline-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); }
.deadline-row input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--ok); flex: none; }
.deadline-row .t { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.deadline-row.done { opacity: 0.65; }
.deadline-row.done .t { text-decoration: line-through; }
.evidence-list { display: flex; flex-direction: column; gap: 10px; }
.evidence { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.evidence .t { font-weight: 600; }
.evidence-thumb { width: 88px; height: 66px; border-radius: 8px; overflow: hidden; flex: none; background: var(--panel-3); border: 1px solid var(--border); }
.evidence-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.evidence-ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--navy); color: var(--gold-light); flex: none; }
.evidence-desc { font-size: 13px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; margin: 2px 0; }
.evidence-link { display: inline-flex; align-items: center; gap: 4px; overflow-wrap: anywhere; }
.evidence-link .ico { width: 13px; height: 13px; }

/* Wokanda */
.week-label { font-size: 15px; color: var(--accent-ink); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); min-height: 220px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.week-day.today { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.week-day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 6px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.week-day-head b { font-size: 18px; color: var(--accent-ink); }
.week-day.today .week-day-head b { color: var(--gold-2); }
.week-empty { flex: 1; display: grid; place-items: center; opacity: 0; transition: opacity 0.15s; }
.week-day:hover .week-empty { opacity: 1; }
.hearing-chip { text-align: left; border: 0; border-left: 3px solid var(--info); background: var(--info-soft); border-radius: 7px; padding: 6px 8px; cursor: pointer; font: 12px/1.35 var(--font); color: var(--text); display: flex; flex-direction: column; gap: 1px; }
.hearing-chip:hover { filter: brightness(0.97); }
.hearing-chip .time { font-weight: 800; color: var(--accent-ink); }
.hearing-chip b { font-weight: 600; overflow-wrap: anywhere; }
.hearing-chip .kind { color: var(--muted); font-size: 11px; }
.hearing-chip.st-odbyta { border-left-color: var(--ok); background: var(--ok-soft); }
.hearing-chip.st-odroczona { border-left-color: var(--warn); background: var(--warn-soft); }
.hearing-chip.st-odwolana { border-left-color: var(--bad); background: var(--bad-soft); text-decoration: line-through; opacity: 0.7; }
@media (max-width: 1100px) { .week { grid-template-columns: 1fr; } .week-day { min-height: 0; } .week-empty { display: none; } }

/* Tablica ogłoszeń */
.announcement.pinned { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.announcement-body { white-space: pre-wrap; color: var(--text-2); overflow-wrap: anywhere; }
.wanted-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.wanted { background: #fffdf6; border: 2px solid #3b2a14; border-radius: 6px; padding: 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); font-size: 13.5px; }
.wanted-head { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.2em; text-align: center; font-size: 20px; color: #7d1a2c; border-bottom: 2px solid #3b2a14; padding-bottom: 6px; }
.wanted-name { font-family: var(--font-display); font-size: 19px; text-align: center; color: #1b1b1b; font-weight: 700; }
/* List gończy wygląda jak papierowy plakat także w ciemnym motywie. */
.wanted { color: #2b2620; }
.wanted .muted { color: #6b6253; }
.wanted .btn.ghost { color: #3b2a14; }
.wanted .btn.ghost:hover { background: rgba(59, 42, 20, 0.08); }
.wanted a { color: #7d1a2c; }
.wanted.faint { opacity: 0.6; }
.wanted ul { margin: 2px 0 0; padding-left: 18px; }
.wanted p { margin: 0; }
.wanted-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding-top: 8px; border-top: 1px dashed #c9b994; flex-wrap: wrap; }
.lawyer { display: flex; gap: 14px; align-items: flex-start; }
.lawyer-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--navy); display: grid; place-items: center; font-size: 22px; flex: none; }

/* Statystyki */
.stats-table th.sortable { cursor: pointer; user-select: none; }
.stats-table th.sorted { color: var(--accent-ink); }
.stats-table .num-cell { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar { position: relative; display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar span { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--bronze)); min-width: 4px; }
.bar b { font-variant-numeric: tabular-nums; }

/* Edytor wzorów */
.tpl-toggle-group + .tpl-toggle-group { margin-top: 14px; }
.tpl-toggle-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.tpl-toggle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 16px; }
.tpl-toggle { font-size: 13px; }
.field-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--panel-2); }
.field-row-head { display: flex; gap: 10px; align-items: flex-start; }
.field-row-head .n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: var(--gold-light); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; margin-top: 24px; }
.field-row-head .form-grid { grid-template-columns: 1.4fr 1fr 1fr; }
.field-row-tools { display: flex; gap: 2px; margin-top: 22px; }
.field-more summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip-btn { border: 1px dashed var(--gold); background: var(--gold-soft); color: var(--gold-2); border-radius: 7px; padding: 3px 8px; font: 600 12px ui-monospace, Consolas, monospace; cursor: pointer; }
.chip-btn:hover { background: var(--gold); color: var(--navy); }
@media (max-width: 760px) { .field-row-head .form-grid { grid-template-columns: 1fr; } .field-row-head .n { display: none; } }

/* Testy i egzaminy */
.quiz-card { display: flex; flex-direction: column; gap: 8px; min-height: 250px; }
.quiz-emoji { font-size: 34px; }
.question-card.inactive { opacity: 0.55; }
.answers-preview { margin: 8px 0 4px; padding-left: 22px; font-size: 13.5px; }
.answers-preview li.correct { color: var(--ok); font-weight: 700; }
.radio { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text-2); }
.quiz-run { padding-bottom: 80px; }
.question .q-num { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.question h3 { font-size: 16px; margin-bottom: 12px; line-height: 1.4; }
.answers { display: grid; gap: 8px; }
.answer { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--field); transition: border-color 0.1s, background 0.1s; }
.answer:hover { border-color: var(--navy-3); }
.answer input { position: absolute; opacity: 0; pointer-events: none; }
.answer .letter { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-3); font-weight: 800; color: var(--muted); flex: none; }
.answer:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); }
.answer:has(input:checked) .letter { background: var(--navy); color: var(--gold-light); }
.answer:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.answer.static { cursor: default; }
.answer.correct { border-color: var(--ok); background: var(--ok-soft); }
.answer.correct .letter { background: var(--ok); color: #fff; }
.answer.wrong { border-color: var(--bad); background: var(--bad-soft); }
.answer.wrong .letter { background: var(--bad); color: #fff; }
.question.q-bad { border-left: 4px solid var(--bad); }
.question.q-ok { border-left: 4px solid var(--ok); }
.quiz-bar { position: sticky; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.manual-list { margin: 0; padding-left: 20px; color: var(--text-2); display: grid; gap: 4px; }

/* Nawigacja publiczna: więcej pozycji, mieści się w jednej linii na komputerze */
.public-nav a { padding: 7px 8px; font-size: 14px; }
.public-nav { flex-wrap: nowrap; }
.brand-banner img { height: 40px; }
@media (max-width: 1220px) { .public-header .inner { flex-wrap: wrap; row-gap: 6px; } .public-nav { margin-left: 0; width: 100%; flex-wrap: wrap; } }
.public-footer a { color: #d7deea; }
.public-footer a:hover { color: #fff; }
.grow { flex: 1 1 auto; min-width: 0; }
.editor.tpl-editor { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
@media (max-width: 1200px) { .editor.tpl-editor { grid-template-columns: 1fr; } }
.field-row-head .form-grid { grid-template-columns: 1fr 1fr; }
.field-row-head .form-grid > .field:first-child { grid-column: 1 / -1; }
@media (max-width: 760px) { .field-row-head .form-grid { grid-template-columns: 1fr; } }
.stats-table .title-cell { min-width: 200px; }
.stats-table th { white-space: normal; }

/* Rekrutacja: pasek kierownictwa i edytor formularza */
.recruit-admin { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; border-left: 4px solid var(--ok); }
.recruit-admin.off { border-left-color: var(--bad); }
.recruit-admin .ico { color: var(--bronze); }
.recruit-check { padding: 4px 0; }
.recruit-check .help { margin: 4px 0 0 48px; }
.recruit-switch { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border); }
.recruit-switch .switch { font-weight: 700; color: var(--text); font-size: 15px; }
.recruit-field.off { opacity: 0.6; background: var(--panel-3); }
.recruit-field .tag .ico { color: var(--bronze); }
.select.sm-select { width: auto; padding: 5px 30px 5px 10px; font-size: 13px; }
.answer-block { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); }
.answer-block .label { margin-bottom: 4px; }
.btn.pulse { box-shadow: 0 0 0 0 rgba(229, 197, 107, 0.7); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(229, 197, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 197, 107, 0); } }
.topbar-title { font-family: var(--font-display); color: var(--gold-light); font-size: 11px; font-weight: 700; line-height: 1.15; letter-spacing: 0.08em; }

/* ───────── Motyw, tablice rejestracyjne, integracje ───────── */
.theme-btn.on-navy { color: #d7deea; box-shadow: none; }
.theme-btn.on-navy:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.plate { display: inline-flex; align-items: center; padding: 2px 10px; border: 2px solid #1d1d1f; border-radius: 6px; background: #f6f6f2; color: #1d1d1f; font: 700 13px ui-monospace, Consolas, monospace; letter-spacing: 0.08em; white-space: nowrap; }
.code-block { background: #0f1a2c; color: #d7e3f4; border-radius: var(--radius-sm); padding: 12px 14px; font: 12px/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; margin: 0; }
.role-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.role-map-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--panel-2); }
.role-map-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.role-map-head .dot { width: 9px; height: 9px; border-radius: 3px; }
.role-map-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.role-map-row .input { padding: 6px 8px; font-size: 12.5px; }
.exam-slot.off { opacity: 0.7; }
.exam-card .list-item .btn { flex: none; }
tr.faint td { color: var(--faint); }
.import-preview { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--panel-2); }
.import-preview ol { margin: 0; padding-left: 20px; }
.import-preview li + li { margin-top: 8px; }
.import-preview .correct { color: var(--ok); font-weight: 700; }
.login-alt { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 4px 0; }
.login-alt::before, .login-alt::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.discord:hover { background: #4752c4; }

/* ───────── Teczka sprawy (wydruk i PDF) ───────── */
.dossier { max-width: 900px; margin: 0 auto; padding: 24px 16px 60px; }
.dossier-bar { display: flex; gap: 12px; align-items: center; position: sticky; top: 70px; z-index: 5; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; box-shadow: var(--shadow); flex-wrap: wrap; }
.dossier-sheet { background: #fffffd; color: #1d1d1f; max-width: 794px; margin: 0 auto 24px; padding: 44px 52px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 14px 40px rgba(3, 34, 72, 0.14); font: 13px/1.55 var(--font); }
.dossier-sheet h2 { font-family: var(--font-display); color: #032248; font-size: 18px; margin: 6px 0 14px; letter-spacing: 0.04em; }
.dossier-sheet h3 { color: #032248; font-size: 14px; margin: 18px 0 8px; }
.ds-head { display: flex; justify-content: space-between; gap: 12px; font-size: 10.5px; color: #77787d; border-bottom: 1px solid #ddd; padding-bottom: 6px; margin-bottom: 14px; }
.ds-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ds-table th, .ds-table td { border: 1px solid #d6d6d9; padding: 6px 8px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.ds-table th { background: #f3f1ea; color: #1d1d1f; }
.ds-kv th { width: 170px; }
.ds-empty { color: #77787d; font-style: italic; }
.dossier-sheet.cover { text-align: center; }
.cover .lh-banner { width: 70%; margin: 6px auto 30px; display: block; }
.ds-cover-title { font-family: var(--font-display); font-size: 28px; letter-spacing: 0.2em; color: #032248; }
.ds-cover-number { font-family: ui-monospace, Consolas, monospace; font-size: 20px; color: #8a5f1c; margin: 8px 0; font-weight: 700; }
.ds-cover-case { font-size: 18px; font-weight: 700; margin-bottom: 24px; }
.cover .ds-table { text-align: left; }
.ds-desc, .ds-toc { text-align: left; margin-top: 20px; }
.ds-desc p { white-space: pre-wrap; margin: 4px 0 0; }
.ds-toc ol { margin: 6px 0 0; padding-left: 20px; }
.ds-foot { margin-top: 30px; font-size: 10.5px; color: #77787d; }
.ds-evidence { border: 1px solid #d6d6d9; padding: 10px; margin-bottom: 10px; border-radius: 6px; page-break-inside: avoid; }
.ds-evidence p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ds-ev-title { font-weight: 700; }
.ds-ev-title span { font-weight: 400; color: #77787d; font-size: 11px; }
.ds-evidence img { max-width: 100%; max-height: 420px; display: block; margin-top: 8px; }
.dossier-doc { margin: 0 auto 24px; }
@media (max-width: 700px) { .dossier-sheet { padding: 24px 18px; } .dossier-bar { top: 56px; } }
@media print {
  .dossier { padding: 0; max-width: none; }
  .dossier-sheet { box-shadow: none; margin: 0; max-width: none; width: 210mm; min-height: 297mm; page-break-after: always; padding: 16mm 16mm; }
  .dossier-doc { page-break-before: always; margin: 0; }
}

/* ── Kompendium: czytnik pełnej treści ─────────────────────────────── */
.komp-intro { font-style: italic; color: var(--muted); margin: 6px 0 4px; }
.komp-h { margin: 16px 0 6px; font-size: 14.5px; color: var(--accent-ink); }
.komp-note { margin: 4px 0 10px; padding: 8px 12px; border-left: 3px solid var(--gold-2); background: var(--gold-soft); border-radius: 0 8px 8px 0; color: var(--text-2); font-weight: 600; font-size: 13.5px; }
.komp-list { margin: 0 0 10px; padding-left: 26px; color: var(--text-2); line-height: 1.7; }
.komp-list li { margin-bottom: 4px; overflow-wrap: anywhere; }
.komp-list.nested { padding-left: 46px; }
.komp-list li b { color: var(--burgundy); }
.komp-quote { margin: 8px 0 10px; padding: 14px 16px; border-left: 3px solid var(--gold-2); background: var(--panel-2); border-radius: 0 10px 10px 0; font-style: italic; color: var(--text-2); line-height: 1.7; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.komp-quote .btn { font-style: normal; }
.komp-script { margin: 10px 0; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); padding: 12px 16px; line-height: 1.65; }
.komp-script-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 700; color: var(--accent-ink); font-size: 13px; }
.komp-script-head span { display: inline-flex; align-items: center; gap: 6px; }
.komp-script .say { font-style: italic; color: var(--text-2); margin: 2px 0; }
.komp-script .dir { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--bronze); margin: 2px 0 6px; }
.komp-sms { margin: 10px 0 14px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; background: var(--panel-2); }
.komp-sms-tag { display: inline-block; font-size: 11.5px; font-weight: 800; color: #4b3a8c; background: #ddd6fb; border-radius: 4px; padding: 1px 6px; margin-bottom: 6px; }
.komp-sms-text { font-style: italic; color: var(--text-2); line-height: 1.65; }
.komp-roles { display: grid; gap: 10px; margin-top: 6px; }
.komp-role { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; background: var(--panel); }
.komp-role.mine { border-color: var(--gold-2); box-shadow: 0 0 0 2px var(--gold-soft); }
.komp-role h4 { margin: 0 0 6px; font-size: 15px; color: var(--accent-ink); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.komp-role .law-p { margin-bottom: 4px; }
.komp-tasks ul { margin: 4px 0 0; padding-left: 22px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.komp-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }

/* Schemat struktury */
.org { margin: 14px 0 18px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
.org-box { position: relative; background: var(--panel); border: 1.5px solid var(--border-2); border-radius: 9px; padding: 8px 10px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.org-box.lead { background: var(--brand-navy, #032248); color: #fff; border-color: var(--brand-navy, #032248); max-width: 260px; margin: 0 auto; }
.org-box.head { border-color: var(--gold-2); background: var(--gold-soft); }
.org-box.base { max-width: 200px; margin: 0 auto; }
.org-top { padding-bottom: 14px; position: relative; }
.org-top::after { content: ''; position: absolute; left: 50%; bottom: 0; height: 14px; border-left: 2px solid var(--gold-2); }
.org-cols { display: grid; grid-template-columns: 1fr 2fr 1fr 1fr; gap: 12px; border-top: 2px solid var(--gold-2); padding-top: 14px; align-items: start; }
.org-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.org-col > .org-box + .org-box::before, .org-branches .org-col > .org-box + .org-box::before { content: ''; position: absolute; left: 50%; top: -13px; height: 12px; border-left: 2px solid var(--border); }
.org-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.org-bottom { margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--gold-2); }
@media (max-width: 900px) {
  .org-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .org-col.wide { grid-column: 1 / -1; order: 2; }
}
@media (max-width: 520px) {
  .org-cols, .org-branches { grid-template-columns: 1fr; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .komp-sms-tag { color: #d9d2ff; background: #3b2f78; } }
:root[data-theme="dark"] .komp-sms-tag { color: #d9d2ff; background: #3b2f78; }
@media print {
  .komp-role, .komp-script, .komp-sms, .org { break-inside: avoid; }
}
