/* Obieg CTX — style wg design systemu HDtranS (snow/ink, czerwień #ED1C24,
   kanciaste CTA, Inter 400/600/700, subtelny ruch). */

:root {
  /* marka */
  --red-950: #4A0508; --red-900: #881418; --red-800: #A41016; --red-700: #C70E15;
  --red-600: #ED1C24; --red-500: #FE353D; --red-400: #FF656B; --red-300: #FF9DA1;
  --red-200: #FFC5C7; --red-100: #FFDFE0; --red-50: #FFF1F2;

  /* neutralne */
  --snow: #FAF6F6; --ink-black: #04080F; --night: #02050A;
  --alabaster-grey: #E0E1E0; --white: #fff;
  --baltic-blue: #1A659E; --steel-azure: #004E89; --black-50: rgba(0,0,0,.5);

  /* tekst */
  --text-strong: #04080F; --text-body: #2b3440; --text-muted: #4a525c;
  --text-faint: #5a6470; --text-on-dark: #e7e9ee;

  /* semantyczne */
  --surface-app: #FAF6F6; --surface-card: #fff; --surface-sunken: #F2EDED;
  --surface-inverse: #04080F;
  --border-default: #E0E1E0; --border-strong: rgba(0,0,0,.5); --border-focus: #ED1C24;
  --accent: #ED1C24; --accent-hover: #C70E15; --accent-soft: #FFF1F2;
  --focus-ring: rgba(237,28,36,.12);

  /* statusy */
  --success-bg: #e7f6ec; --success-fg: #1c6b39; --success-border: #b7e3c5;
  --error-bg: #FFF1F2;   --error-fg: #A41016;   --error-border: #FFC5C7;
  --warning-bg: #FFF6E6; --warning-fg: #8A5A00; --warning-border: #FFE0A3;
  --info-bg: #EAF2F8;    --info-fg: #004E89;    --info-border: #BBD6E8;

  /* typografia */
  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  /* layout / kształt / ruch */
  --topbar-height: 64px;
  --radius: 4px; --btn-radius: 0;
  --shadow-card: 0 12px 30px rgba(4,8,15,.10);
  --shadow-nav: 0 2px 16px rgba(4,8,15,.08);
  --shadow-cta: 0 8px 18px rgba(237,28,36,.32);
  --transition: .25s ease;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 400 14px/1.6 var(--font-base);
  background: var(--surface-app); color: var(--text-strong);
  min-height: 100vh; display: flex; flex-direction: column;
}
main { padding: 24px 24px 48px; max-width: 1440px; margin: 0 auto; width: 100%; flex: 1; }
h1, h2, h3 { margin: 8px 0 14px; color: var(--text-strong); }
h2 { font-size: 28px; font-weight: 400; line-height: 1.2; letter-spacing: -.3px; }
h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
a { color: var(--text-strong); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
main a { text-decoration: underline; text-decoration-color: var(--red-200); text-underline-offset: 3px; }
main a:hover { text-decoration-color: var(--accent); }
main a.btn, main a.btn-sec, main a.chip, main .settings-nav a, main .pagination a { text-decoration: none; }
small, .muted { color: var(--text-muted); }
.center { text-align: center; }
.mono { font-family: Consolas, 'Cascadia Mono', monospace; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--error-fg); }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; }
.req { color: var(--accent); }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 18px; font-weight: 600;
}
.skip-link:focus { left: 8px; color: #fff; }

:focus-visible {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: var(--snow); color: var(--text-strong);
  min-height: var(--topbar-height); padding: 8px 24px;
  border-bottom: 1px solid var(--black-50);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 40px; width: auto; display: block; }
.brand .appname {
  font-size: 15px; font-weight: 700; letter-spacing: -.3px; white-space: nowrap;
  border-left: 1px solid var(--alabaster-grey); padding-left: 14px;
}
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.topbar nav a {
  position: relative; color: var(--text-strong); font-weight: 600; font-size: 14px;
  padding: 8px 12px; text-decoration: none;
}
.topbar nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform var(--transition);
}
.topbar nav a:hover { color: var(--accent); }
.topbar nav a:hover::after, .topbar nav a.active::after { transform: scaleX(1); }
.topbar .badge {
  background: var(--accent); color: #fff; border-radius: var(--radius);
  padding: 1px 7px; font-size: 12px; font-weight: 700;
}

.top-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.btn-upload {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
  padding: 10px 20px; border-radius: var(--btn-radius); text-decoration: none;
  white-space: nowrap; transition: all var(--transition);
}
.btn-upload:hover {
  background: var(--accent-hover); color: #fff;
  transform: translateY(-2px); box-shadow: var(--shadow-cta);
}
.usermenu { position: relative; }
.usermenu summary {
  list-style: none; cursor: pointer; color: var(--text-strong); display: flex;
  align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius);
  border: 1px solid var(--border-default); background: var(--surface-card);
  font-weight: 600; white-space: nowrap; user-select: none;
  transition: border-color var(--transition), color var(--transition);
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { color: var(--accent); border-color: var(--accent); }
.usermenu .caret { font-size: 10px; color: var(--text-faint); }
.usermenu .menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  background: var(--snow); border-radius: var(--radius);
  min-width: 220px; padding: 8px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  animation: menuIn var(--transition);
}
@keyframes menuIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.usermenu .menu a, .usermenu .menu button {
  display: block; width: 100%; text-align: left; padding: 10px 14px;
  border: none; background: none; color: var(--text-strong); border-radius: var(--radius);
  font: 600 14px var(--font-base); cursor: pointer; text-decoration: none;
  transition: color var(--transition), background var(--transition);
}
.usermenu .menu a:hover, .usermenu .menu button:hover { color: var(--accent); background: var(--accent-soft); }

/* ---------- przyciski ---------- */
button, .btn { font: 600 14px var(--font-base); cursor: pointer; }
button.primary, .btn.primary, .filters button.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); border: none; color: #fff;
  padding: 11px 24px; border-radius: var(--btn-radius);
  transition: all var(--transition);
}
button.primary:hover, .btn.primary:hover {
  background: var(--accent-hover); color: #fff;
  transform: translateY(-2px); box-shadow: var(--shadow-cta);
}
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-sec, button.btn-sec {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-card); border: 1px solid var(--border-default);
  color: var(--text-strong); padding: 10px 20px; border-radius: var(--btn-radius);
  font: 600 14px var(--font-base); text-decoration: none;
  transition: all var(--transition);
}
.btn-sec:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
button.linklike {
  background: none; border: none; color: var(--text-muted); padding: 0;
  text-decoration: underline; font: 400 14px var(--font-base);
}
button.mini {
  font: 600 13px var(--font-base); padding: 5px 12px;
  border: 1px solid var(--border-default); background: var(--surface-card);
  color: var(--text-muted); border-radius: var(--btn-radius);
  transition: all var(--transition);
}
button.mini:hover { color: var(--accent); border-color: var(--accent); background: var(--surface-card); }
button.mini.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.mini.primary:hover { background: var(--accent-hover); }
button.mini.danger, .btn-sec.danger { color: var(--error-fg); border-color: var(--error-border); }
button.mini.danger:hover { background: var(--error-bg); color: var(--error-fg); border-color: var(--error-fg); }
form.inline { display: inline; }

/* ---------- pola formularzy ---------- */
input, select, textarea {
  font: 400 14px var(--font-base); padding: 9px 12px;
  border: 1px solid var(--border-default); border-radius: var(--radius);
  background: #fff; color: var(--text-strong);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring);
}
input.missing { border-color: var(--error-fg); background: var(--error-bg); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; padding: 0; }
textarea { resize: vertical; min-height: 110px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: block; font-size: 13px; font-weight: 600; }
.stack label input, .stack label select, .stack label textarea { display: block; width: 100%; margin-top: 6px; font-weight: 400; }
.row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
fieldset { border: 1px solid var(--border-default); border-radius: var(--radius); }
legend { font-size: 13px; font-weight: 600; }
label.radio { display: inline-flex; gap: 8px; align-items: center; margin-right: 18px; font-weight: 600; font-size: 14px; }

.card {
  background: var(--surface-card); border: 1px solid var(--border-default);
  border-radius: var(--radius); padding: 22px;
}
.center-card {
  max-width: 430px; margin: 8vh auto; background: var(--surface-card);
  border: 1px solid var(--border-default); border-radius: var(--radius);
  padding: 32px 36px;
}
.center-card .logo-login { width: 240px; max-width: 100%; height: auto; display: block; margin: 0 auto 6px; }
.center-card h1 { font-size: 22px; font-weight: 400; text-align: center; margin: 6px 0 2px; }
.eyebrow {
  color: var(--accent); font-size: 12px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; display: block; text-align: center;
}

/* ---------- bannery / toast ---------- */
.banner {
  border-radius: var(--radius); padding: 14px 18px; margin: 12px 0; font-size: 14px;
}
.banner.error { background: var(--error-bg); border-left: 4px solid var(--error-fg); color: var(--error-fg); }
.banner.warn { background: var(--warning-bg); border-left: 4px solid var(--warning-fg); color: var(--warning-fg); }
.banner ul { margin: 6px 0 0 18px; padding: 0; }
.banner .btn-sec { padding: 6px 14px; margin-left: 8px; }

.toast {
  position: fixed; top: 76px; right: 24px; z-index: 70;
  background: var(--surface-card); color: var(--text-strong);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: 14px 18px; font-weight: 600; box-shadow: var(--shadow-card);
  animation: toastIn var(--transition), fadeout .4s ease 4s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeout { to { opacity: 0; visibility: hidden; } }

/* ---------- filtry + tabele ---------- */
.page-head { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--surface-card); border: 1px solid var(--border-default);
  border-radius: var(--radius); padding: 12px 14px; margin: 12px 0 18px;
}
.filters label { display: inline-flex; gap: 6px; align-items: center; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.filters button.primary { padding: 9px 20px; }

table.data {
  width: 100%; border-collapse: collapse; background: var(--surface-card);
  border: 1px solid var(--border-default); font-size: 14px;
}
table.data th, table.data td { padding: 11px 14px; vertical-align: top; }
table.data thead th {
  background: var(--snow); text-align: left;
  font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 2px solid var(--border-default); white-space: nowrap;
}
table.data thead th.num { text-align: right; }
table.data thead a { color: var(--text-muted); text-decoration: none; }
table.data thead a:hover { color: var(--accent); }
table.data tbody td { border-bottom: 1px solid var(--border-default); color: var(--text-body); }
table.data tbody tr:hover { background: var(--accent-soft); }

/* statusy — lewy pasek 3px (sygnatura) + delikatne tinty */
tr.st-red    { box-shadow: inset 3px 0 0 var(--error-fg); }
tr.st-green  { box-shadow: inset 3px 0 0 var(--success-fg); }
tr.st-yellow { box-shadow: inset 3px 0 0 var(--warning-fg); background: #FFFBF2; }
tr.st-neutral{ box-shadow: inset 3px 0 0 var(--text-faint); }
tr.st-purple { box-shadow: inset 3px 0 0 var(--info-fg); background: #F5F9FC; }
tr.st-explained { box-shadow: inset 3px 0 0 var(--baltic-blue); background: var(--info-bg); }

.status {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius);
  font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase;
  white-space: nowrap;
}
.status.st-red    { background: var(--error-bg); color: var(--error-fg); }
.status.st-green  { background: var(--success-bg); color: var(--success-fg); }
.status.st-yellow { background: var(--warning-bg); color: var(--warning-fg); }
.status.st-neutral{ background: var(--surface-sunken); color: var(--text-muted); }
.status.st-purple { background: var(--info-bg); color: var(--info-fg); }
.expl { font-size: 13px; color: var(--info-fg); margin-top: 4px; }

.chip {
  display: inline-block; background: var(--surface-sunken); border: 1px solid var(--border-default);
  border-radius: var(--radius); padding: 2px 9px; font-size: 12px; font-weight: 600;
  margin: 1px 3px 1px 0; color: var(--text-muted); white-space: nowrap; text-decoration: none;
}
a.chip:hover { color: var(--accent); border-color: var(--accent); }
.chip.warn { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-fg); }
.chip.ok-chip { background: var(--success-bg); border-color: var(--success-border); color: var(--success-fg); }
.queue-chip { background: var(--info-bg); border-color: var(--info-border); color: var(--info-fg); vertical-align: middle; }
.ok { color: var(--success-fg); font-weight: 600; }
.bad { color: var(--error-fg); font-weight: 600; }
.hint { color: var(--text-faint); font-size: 12px; }
.pend { margin-left: 4px; cursor: help; }

/* edycja inline — aktywna dopiero po włączeniu trybu edycji (przycisk „Edycja") */
td.editable { cursor: default; }
body.edit-on td.editable { cursor: pointer; }
body.edit-on td.editable:hover { outline: 2px dashed var(--red-200); outline-offset: -2px; }
td.editable input, td.editable select { width: 100%; min-width: 90px; padding: 4px 8px; }
body:not(.edit-on) .edit-only { display: none !important; }
#editToggle[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
#editToggle[aria-pressed="true"]:hover { background: var(--accent-hover); color: #fff; }

.table-wrap { overflow-x: auto; }
.warn-text { color: var(--warning-fg); font-weight: 600; }

.pagination { margin: 16px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination a, .pagination .cur {
  min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; border: 1px solid var(--border-default); border-radius: var(--radius);
  background: var(--surface-card); font-weight: 600; text-decoration: none;
  transition: all var(--transition);
}
.pagination a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .cur { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- filtr typów (lista rozwijana z checkboxami) ---------- */
.multi { position: relative; }
.multi summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 12px; border: 1px solid var(--border-default); border-radius: var(--radius);
  background: #fff; font-size: 14px; font-weight: 400; color: var(--text-strong);
  user-select: none; transition: border-color var(--transition);
}
.multi summary::-webkit-details-marker { display: none; }
.multi summary:hover { border-color: var(--accent); }
.multi summary .caret { font-size: 10px; color: var(--text-faint); }
.multi-menu {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 50;
  background: var(--snow); border-radius: var(--radius); box-shadow: var(--shadow-card);
  min-width: 220px; padding: 8px; max-height: 320px; overflow: auto;
  animation: menuIn var(--transition);
}
.multi-menu label.check {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  font-size: 14px; font-weight: 600; color: var(--text-strong); cursor: pointer;
  border-radius: var(--radius);
}
.multi-menu label.check:hover { background: var(--accent-soft); color: var(--accent); }
.multi-menu label.check.all { border-bottom: 1px solid var(--border-default); border-radius: 0; margin-bottom: 4px; }

/* ---------- upload ---------- */
.dropzone {
  margin-top: 18px; border: 2px dashed var(--alabaster-grey); border-radius: var(--radius);
  background: var(--surface-card); min-height: 260px; display: flex;
  align-items: center; justify-content: center; text-align: center;
  transition: border-color var(--transition), background var(--transition);
}
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dz-inner { display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 32px; }
.dz-icon {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 26px; border-radius: var(--radius);
}
.dz-pick { cursor: pointer; }
.dz-status { min-height: 20px; font-weight: 600; }
.dz-status.error { color: var(--error-fg); }

.upload-list { list-style: none; margin: 16px 0 10px; padding: 0; max-width: 760px; }
.upload-list li {
  display: flex; align-items: center; gap: 12px; background: var(--surface-card);
  border: 1px solid var(--border-default); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 6px;
}
.upload-list .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-list .u-ok { color: var(--success-fg); font-weight: 600; }
.upload-list .u-err { color: var(--error-fg); font-weight: 600; }
.upload-list .u-dup { color: var(--warning-fg); font-weight: 600; }

dialog.modal {
  border: none; border-radius: var(--radius); padding: 26px 30px;
  max-width: 560px; box-shadow: var(--shadow-card); background: var(--surface-card);
}
dialog.modal::backdrop { background: rgba(4,8,15,.5); }
dialog.modal h3 { margin-top: 0; }
.dialog-actions { display: flex; gap: 12px; align-items: center; margin-top: 14px; flex-wrap: wrap; }

/* ---------- weryfikacja ---------- */
.verify-grid {
  display: grid; grid-template-columns: minmax(380px, 540px) 1fr; gap: 20px; align-items: start;
}
@media (max-width: 1024px) { .verify-grid { grid-template-columns: 1fr; } }

/* szczegóły faktury: lewa kolumna elastyczna (minmax(0,1fr) zapobiega
   rozpychaniu siatki przez tabelę pozycji), PDF po prawej */
.detail-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 42vw, 720px);
  gap: 20px; align-items: start;
}
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr; } }
.pdfpane { position: sticky; top: calc(var(--topbar-height) + 12px); height: 80vh; }
.pdfpane iframe {
  width: 100%; height: 100%; border: 1px solid var(--border-default);
  border-radius: var(--radius); background: #fff;
}
table.lines-edit { width: 100%; border-collapse: collapse; }
table.lines-edit th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-muted); padding: 6px;
}
table.lines-edit td { padding: 4px 6px; }
table.lines-edit input { width: 100%; }
.sum-check { font-weight: 600; margin: 10px 0; min-height: 20px; }
.sum-check.ok { color: var(--success-fg); }
.sum-check.bad { color: var(--error-fg); }

.kv { display: grid; grid-template-columns: 190px 1fr; gap: 8px 16px; }
.kv > div:nth-child(odd) { color: var(--text-muted); font-size: 13px; font-weight: 600; }

/* ---------- ustawienia (panel opcji po prawej) ---------- */
.settings-grid {
  display: grid; grid-template-columns: 1fr 250px; gap: 22px; align-items: start;
}
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-nav {
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: calc(var(--topbar-height) + 12px);
  background: var(--surface-card); border: 1px solid var(--border-default);
  border-radius: var(--radius); padding: 10px;
}
.settings-nav a {
  padding: 10px 14px; color: var(--text-muted); text-decoration: none;
  font-size: 14px; font-weight: 600; border-left: 3px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.settings-nav a:hover { color: var(--accent); }
.settings-nav a.active {
  border-left-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}
@media (max-width: 900px) { .settings-nav { order: -1; position: static; } }

/* ---------- stopka (zawsze przy dolnej krawędzi) ---------- */
.footer {
  margin-top: auto;
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  flex-wrap: wrap; padding: 18px 24px;
  background: var(--snow); color: var(--text-strong);
  border-top: 1px solid var(--border-default);
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand .logo-tile {
  background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius); padding: 6px 10px; display: flex; align-items: center;
}
.footer-brand img { height: 34px; width: auto; display: block; }
.footer-brand .appname { font-weight: 600; color: var(--text-strong); }
.footer .muted { color: var(--text-muted); }
.fontsize { display: inline-flex; align-items: center; gap: 8px; }
.fontsize button {
  border: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-strong);
  border-radius: var(--btn-radius); padding: 5px 12px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.fontsize button:hover { border-color: var(--red-400); color: var(--red-400); }
.fontsize button[aria-pressed="true"] {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* ---------- pulpit (bento grid) ---------- */
.bento {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; margin-top: 4px;
}
.bento .card { padding: 18px 20px; }
.b-line { grid-column: span 2; grid-row: span 2; }
.b-bars { grid-column: span 3; }
.chart-box { position: relative; height: 280px; }
.b-line .chart-box { height: 398px; }
.b-bars .chart-box { height: 300px; }
@media (max-width: 1024px) {
  .bento { grid-template-columns: 1fr; }
  .b-line, .b-bars { grid-column: auto; grid-row: auto; }
  .b-line .chart-box { height: 300px; }
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.card-title {
  font-size: 12px; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-muted);
}
.b-stat { display: flex; flex-direction: column; gap: 6px; }
.stat-num {
  font-size: 46px; font-weight: 700; line-height: 1.1; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.seg { display: inline-flex; border: 1px solid var(--border-default); }
.seg button {
  border: none; background: var(--surface-card); color: var(--text-muted);
  padding: 5px 14px; font: 600 12px var(--font-base); letter-spacing: .5px;
  text-transform: uppercase; cursor: pointer; transition: all var(--transition);
}
.seg button + button { border-left: 1px solid var(--border-default); }
.seg button:hover { color: var(--accent); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* tick „Etykiety" w nagłówku wykresu */
.lbl-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer;
  white-space: nowrap;
}
.lbl-toggle input { width: 15px; height: 15px; margin: 0; }

/* wybór referenta w weryfikacji: pole „nowa osoba" pod listą */
label.referent-pick .ref-new { margin-top: 6px; }

/* ---------- dostępność / ruch ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
