/* ==========================================================================
   Interpelacje BiZU — arkusz stylów (wygląd jak rejestry-ursus)
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* Paleta BiZU: czarny, biały, zielony #12964b (plus odcienie bieli/czerni). */
:root {
  --bg: #f6f8f7;
  --panel: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #424a45;
  --ink-3: #6f7a74;
  --line: #e3e8e5;
  --line-soft: #eef3f0;
  --accent: #12964b;
  --accent-2: #0c6e38;
  --accent-soft: #e6f4ec;
  --accent-on-dark: #3ecf8e;   /* jaśniejszy odcień zieleni do tekstu na czarnym */
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 11, 11, .05);
  --shadow: 0 1px 3px rgba(11, 11, 11, .06), 0 14px 34px -18px rgba(11, 11, 11, .22);
  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1240px, 100% - 40px); margin-inline: auto; }

a { color: var(--accent-2); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- hero --- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 46px 0 40px;
  color: #fff;
  background:
    radial-gradient(900px 320px at 12% -20%, #0d2f1e 0%, rgba(13, 47, 30, 0) 70%),
    linear-gradient(160deg, #070707 0%, #000000 60%, #000000 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 55%, rgba(18, 150, 75, 0) 85%);
}

.hero .eyebrow {
  margin: 0 0 14px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #9fb3a8;
}

.hero .eyebrow a { color: inherit; text-decoration: none; }
.hero .eyebrow a:hover { color: #fff; }

.hero h1 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-weight: 700;
}

.hero h1 .year {
  color: var(--accent-on-dark);
  font-variant-numeric: tabular-nums;
}

.hero .lede {
  margin: 14px 0 0;
  max-width: 62ch;
  color: rgba(255, 255, 255, .72);
  font-size: 15.5px;
}

.hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 24px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .55);
}

.hero .meta b { color: #ffffff; font-weight: 600; }

.hero .meta a { color: var(--accent-on-dark); text-decoration: none; border-bottom: 1px solid rgba(62, 207, 142, .35); }
.hero .meta a:hover { border-bottom-color: var(--accent-on-dark); }

/* Logo i nagłówek w jednym wierszu flex; --h1 trzyma rozmiar nagłówka,
   żeby odstęp logo od wierzchołków liter skalował się razem z nim. */
.hero-head {
  --h1: clamp(28px, 4.2vw, 44px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.hero-head h1 { flex: 1 1 auto; min-width: 0; font-size: var(--h1); }

.hero .brand {
  flex: 0 0 auto;
  display: block;
  margin-top: calc(var(--h1) * .205);
  line-height: 0;
  opacity: .92;
  transition: opacity .15s;
}

.hero .brand:hover { opacity: 1; }

.hero .brand img { display: block; height: 84px; width: auto; }

/* podstrona dokumentu: niższy nagłówek */
.hero.is-compact { padding: 30px 0 28px; }
.hero.is-compact .hero-head { --h1: clamp(24px, 3.2vw, 34px); }
.hero.is-compact .brand img { height: 58px; }

/* -------------------------------------------------------- pigułki w hero --- */

.years {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}

.years .yr {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 99px;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .75);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.years .yr:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.years .yr .c {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .55);
}

.years .yr[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.years .yr[aria-selected="true"] .c { background: rgba(0, 0, 0, .18); color: #ffffff; }

/* --------------------------------------------------------------- layout --- */

main { padding: 26px 0 64px; }

/* ---------------------------------------------------------------- kpis --- */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 17px;
  box-shadow: var(--shadow-sm);
}

.kpi .n {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.kpi .l {
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.kpi.is-accent .n { color: var(--accent); }

/* ---------------------------------------------------------------- tabs --- */

.tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
  margin-bottom: 14px;
  background: linear-gradient(var(--bg) 72%, rgba(246, 248, 247, 0));
  scrollbar-width: thin;
}

.tabs::-webkit-scrollbar { height: 5px; }
.tabs::-webkit-scrollbar-thumb { background: #cfd8e3; border-radius: 99px; }

.tab, .chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}

.chip { padding: 5px 12px; font-size: 13px; }

.tab:hover, .chip:hover { border-color: var(--accent); color: var(--ink); }

.tab .c, .chip .c {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--line-soft);
  color: var(--ink-3);
}

.tab[aria-selected="true"], .chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(18, 150, 75, .55);
}

.tab[aria-selected="true"] .c, .chip[aria-pressed="true"] .c { background: rgba(255, 255, 255, .18); color: #fff; }

.tab.is-empty, .chip.is-empty { opacity: .55; }

/* -------------------------------------------------------------- toolbar --- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.search {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}

.search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.search input::placeholder { color: #9aa6b6; }

.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 150, 75, .14);
}

.search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: #9aa6b6;
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, color .15s, background .15s;
}

.btn:hover { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }
.btn svg { width: 14px; height: 14px; }
.btn[hidden] { display: none; }

.spacer { flex: 1 1 auto; }

/* --------------------------------------------------------------- panels --- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  padding: 18px 22px 15px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head h2 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.panel-head .sub { font-size: 12.5px; color: var(--ink-3); }

.panel-head .count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 99px;
}

.panel-body { padding: 18px 22px 20px; }

/* filtry: wiersze pigułek z etykietą */

.filters { padding: 6px 22px 14px; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.filter-row:last-child { border-bottom: 0; }

.filter-label {
  flex: 0 0 96px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ------------------------------------------------------------ statystyki --- */

.stats-panel { position: relative; }
.stats-panel .panel-head .more { margin: 0 0 0 auto; }
.stats-panel.is-collapsed .stats-grid { display: none; }
.stats-panel.is-collapsed .panel-head { border-bottom: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.chart {
  margin: 0;
  padding: 16px 22px 18px;
  border-bottom: 1px solid var(--line-soft);
  min-width: 0;
}

.chart:nth-child(even) { border-left: 1px solid var(--line-soft); }
.chart-wide { grid-column: 1 / -1; }
.chart-wide ~ .chart:nth-child(even) { border-left: 0; }
.chart-wide ~ .chart:nth-child(odd) { border-left: 1px solid var(--line-soft); }

.chart figcaption {
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.chart figcaption .sub { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* poziome słupki: etykieta | tor | wartość - cały wiersz jest przyciskiem filtra */
.bars { display: flex; flex-direction: column; gap: 2px; }

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 38%) minmax(0, 1fr) 3.2em;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 5px 6px;
  margin: 0 -6px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
}

.bar-row:hover { background: var(--line-soft); color: var(--ink); }
.bar-row[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { height: 12px; }
.bar-row .fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 0 4px 4px 0;   /* zaokrąglony koniec, prosto przy osi */
  background: var(--accent);
}
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.bars .none { font-size: 13px; color: var(--ink-3); }

/* kolumny miesięczne */
.cols {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  border-bottom: 1px solid var(--line);
}

.col {
  flex: 1 1 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  min-width: 0;
  cursor: default;
}

.col span {
  display: block;
  width: 100%;
  max-width: 24px;
  min-height: 1px;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
}

.col:hover span, .col:focus-visible span { background: var(--accent-2); }
.col.is-zero span { background: var(--line); }

.cols-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.tip {
  position: absolute;
  z-index: 40;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.tip b { font-weight: 650; }

/* ---------------------------------------------------------------- table --- */

.tbl-wrap { overflow-x: auto; }

table.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

.tbl thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 14px;
  background: #f7faf8;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.tbl tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--ink-2);
}

.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: #f4faf6; }

.tbl td.date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
  width: 1%;
}

.tbl td.nr { white-space: nowrap; width: 1%; }
.tbl td.nr a { color: var(--ink); font-weight: 600; text-decoration: none; }
.tbl td.nr .typ { display: block; font-size: 11.5px; color: var(--ink-3); }
.tbl td.wide { min-width: 280px; color: var(--ink); }
.tbl td.mid { min-width: 140px; }
.tbl td.st { width: 1%; white-space: nowrap; }

.tbl .muted { color: #a9b4c4; }

.more {
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.more:hover { text-decoration: underline; }

.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag {
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--line-soft);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
}

.summary-line { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }

/* badges */

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge.ok { background: var(--accent-soft); color: var(--accent-2); border-color: #c4e6d3; }
.badge.no { background: var(--ink); color: #ffffff; border-color: var(--ink); }
.badge.neutral { background: var(--line-soft); color: var(--ink-2); border-color: var(--line); }

/* --------------------------------------------------------------- states --- */

.empty {
  padding: 46px 22px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }

.notice {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 11px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 13.5px;
}

/* ------------------------------------------------------ strona dokumentu --- */

.crumb { margin: 0 0 16px; font-size: 13.5px; }
.crumb a { color: var(--ink-2); text-decoration: none; font-weight: 550; }
.crumb a:hover { color: var(--accent-2); }

.doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.facts { margin: 0; }
.facts div { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.facts div:first-child { padding-top: 0; }
.facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.facts dd { margin: 2px 0 0; font-weight: 550; }

.links { display: flex; flex-direction: column; gap: 8px; }
.links .btn { justify-content: flex-start; }

.summary p { margin: 0 0 10px; }
.summary .fine { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }

.doc-text {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- footer --- */

footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 40px;
  font-size: 12.5px;
  color: var(--ink-3);
}

footer a { color: var(--ink-2); }
footer p { margin: 0 0 6px; }

/* ------------------------------------------------------------ responsive --- */

@media (max-width: 900px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .chart, .chart-wide ~ .chart:nth-child(odd) { border-left: 0; }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 24px); }
  .hero { padding: 32px 0 28px; }
  .hero-head { gap: 14px; }
  .hero .brand img, .hero.is-compact .brand img { height: 58px; }
  .hero .lede { font-size: 14.5px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi .n { font-size: 22px; }
  .panel-head { padding: 15px 16px 13px; }
  .panel-body { padding: 15px 16px 16px; }
  .filters { padding: 4px 16px 10px; }
  .filter-label { flex-basis: 100%; }
  .tbl thead th, .tbl tbody td { padding: 9px 11px; }
}

@media print {
  .tabs, .toolbar, .years, .filters-panel, .hero .brand, .hero::after { display: none; }
  body { background: #fff; }
  .panel { box-shadow: none; break-inside: avoid; }
  .hero { background: #fff; color: #000; padding: 0 0 12px; }
  .hero .lede, .hero .meta { color: #444; }
  .hero h1 .year { color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
