/* ==========================================================================
   VIM — wspólny system wizualny (wersja 2.4, Etap 24: identyfikacja „VIM — Open Arena”)

   Kierunek: spokojna, nowoczesna aplikacja webowa. Jasne tło, białe karty z delikatną ramką
   i cieniem, jeden kolor akcentu (Arena Blue #5B8FC6), panel boczny w kolorze marki Navy #14243B.

   Kolory a czytelność (WCAG AA, PLAN.md pkt 35): każdy tekst ≥ 4,5:1, elementy interfejsu ≥ 3:1.
   Biały na Arena Blue ma tylko 3,4:1, dlatego:
     * tekst i ikony NA wypełnieniu --c-primary / --c-info  → --c-on-primary (Navy, 4,6:1),
     * odnośniki i tekst „w kolorze primary” na jasnym tle   → --c-primary-text (#2F6399, ≥ 5,3:1),
     * sam --c-primary (Arena Blue)                          → wypełnienia, obramowania, paski
       aktywnej pozycji, fokus, wykresy (≥ 3:1 na bieli i tle strony).
   Nazwy dotychczasowych tokenów i klas zostają (aplikacje z nich korzystają).
   Mobile-first: styl bazowy dla telefonu (od 360 px), rozszerzenia od 768 px i 1100 px.

   Spis:  1. Zmienne  2. Podstawy  3. Rama aplikacji i nawigacja  4. Układ strony
          5. Karty i kafelki  6. Tabele  7. Przyciski  8. Formularze  9. Statusy
          10. Komunikaty i puste stany  11. Listy, zakładki, filtry  12. Nowe komponenty 2.1
          13. Narzędzia  14. Logowanie i strony błędów  15. Ruch  16. Druk

   Podgląd wszystkich komponentów: /styl/ (konto managera). Opis klas: core/README.md.
   Własny CSS aplikacji tylko w <app>/static/<app>/ i tylko dla rzeczy specyficznych —
   zawsze przez zmienne z :root (nie wpisuj kolorów na sztywno).
   ========================================================================== */

/* ---------- 1. Zmienne ----------------------------------------------------- */

:root {
  /* Powierzchnie i tekst */
  --c-bg: #f3f5f9;              /* tło strony */
  --c-surface: #ffffff;         /* karty, tabele, pola */
  --c-surface-2: #f7f8fb;       /* lekko wyróżnione tło: nagłówki tabel, stopki kart */
  --c-surface-3: #eef1f6;       /* mocniej wyróżnione tło: pasek grup, nieaktywne */
  --c-border: #e2e6ed;
  --c-border-strong: #c9d0db;
  --c-text: #14243b;            /* Navy — 15,6:1 na białym */
  --c-text-muted: #52607a;      /* ≥ 5,4:1 na białym i jasnych tłach */
  --c-text-subtle: #5f6b80;     /* pomocnicze teksty — nadal ≥ 4,6:1 na jasnych tłach */

  /* Akcent (jeden) — Arena Blue. Tekst NA nim: --c-on-primary; tekst W tym kolorze: --c-primary-text */
  --c-primary: #5b8fc6;         /* wypełnienia, obramowania, wskaźniki aktywnej pozycji, wykresy */
  --c-primary-hover: #284c77;   /* ciemny odcień: tekst i odnośnik po najechaniu (≥ 6,8:1) */
  --c-primary-soft: #e6eef7;    /* jasne tło akcentu (przycisk drugorzędny, ikony w kafelkach) */
  --c-primary-softer: #f3f7fb;  /* najjaśniejsze tło akcentu (podświetlenie wiersza) */
  --c-primary-text: #2f6399;    /* NOWY 2.4: odnośniki i tekst „w kolorze primary” na jasnym tle (≥ 5,3:1) */
  --c-on-primary: #14243b;      /* NOWY 2.4: tekst i ikony na wypełnieniu --c-primary / --c-info (4,6:1) */
  --c-primary-fill-hover: #74a0cf; /* NOWY 2.4: wypełnienie przycisku głównego po najechaniu (Navy 5,7:1) */
  --c-primary-border: #c3d6ea;  /* NOWY 2.4: delikatna ramka w odcieniu akcentu (karty, komunikaty) */
  --c-focus: #f5a524;           /* wyróżnienie „uwaga, tu się coś zmieniło” (nie fokus klawiatury) */
  --c-focus-ring: #5b8fc6;      /* obrys fokusu klawiatury — Arena Blue (≥ 3,1:1 na tłach jasnych) */

  /* Statusy — zawsze razem z tekstem */
  --c-ok: #157a45;
  --c-ok-soft: #e5f5ec;
  --c-shortage: #c0341d;
  --c-shortage-soft: #fdeeeb;
  --c-surplus: #9a5800;
  --c-surplus-soft: #fff3dc;
  --c-info: #5b8fc6;            /* wypełnienie / znacznik „info” — tekst na nim: --c-on-primary */
  --c-info-soft: #e6eef7;
  --c-info-text: #2f6399;       /* NOWY 2.4: tekst „info” na jasnym tle (≥ 5,3:1) */
  --c-muted-soft: #eef1f5;

  /* Panel boczny — Navy */
  --c-sidebar: #14243b;
  --c-sidebar-2: #1d314c;       /* pole konta, wyróżnienia na Navy */
  --c-sidebar-text: #b9c5d6;    /* 8,9:1 na Navy, 7,5:1 na --c-sidebar-2 */
  --c-sidebar-text-strong: #ffffff;
  --c-sidebar-accent: #5b8fc6;  /* Arena Blue na Navy (4,6:1): pasek i ikona aktywnej pozycji, fokus */
  --c-sidebar-active-bg: rgba(91, 143, 198, .18); /* NOWY 2.4: tło aktywnej pozycji (biały tekst 12:1) */

  /* Kształt i głębia */
  --radius: 14px;               /* karty, tabele */
  --radius-sm: 10px;            /* przyciski, pola, komunikaty */
  --radius-xs: 6px;             /* drobne elementy */
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, .10), 0 2px 4px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 16px 40px -8px rgba(16, 24, 40, .18);

  /* Odstępy (skala 4 px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --gap: 16px;                  /* odstęp między blokami strony */
  --tap: 48px;                  /* minimalna wysokość elementu klikanego na telefonie */

  /* Typografia (tylko czcionki systemowe) */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;

  /* Rama aplikacji */
  --sidebar-w: 0px;             /* szerokość panelu bocznego (ustawiana w media queries) */
  --topbar-h: 56px;
  --bottomnav-h: 0px;           /* wysokość dolnego paska (telefon) */
  --sticky-top: 0px;            /* ile zajmują przyklejone paski u góry */
  --sticky-bottom: 0px;         /* ile zajmuje dolny pasek — użyj w position: sticky; bottom */
  --content-max: 1240px;

  --ease: cubic-bezier(.2, .7, .3, 1);
  color-scheme: light;
}

/* ---------- 2. Podstawy ---------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--sticky-top) + 16px); }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; color: var(--c-text); }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.1875rem; }
h3 { font-size: 1.0625rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
a { color: var(--c-primary-text); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--c-primary-hover); }
small, .small { font-size: var(--fs-sm); }
strong, b { font-weight: 650; }
code, kbd { font-family: var(--font-mono); font-size: .875em; background: var(--c-surface-3);
  padding: .1em .4em; border-radius: var(--radius-xs); }
hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--gap) 0; }
img, svg { vertical-align: middle; }
::selection { background: #cfe0f1; }

/* Fokus klawiatury: zawsze widoczny, nigdy przy kliknięciu myszą */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--c-focus-ring); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible, .nav__link:focus-visible, .subnav__link:focus-visible, .bottomnav__link:focus-visible,
.tabs__link:focus-visible, .list__link:focus-visible, a.card:focus-visible, .segmented__item:focus-visible {
  outline: 2px solid var(--c-focus-ring); outline-offset: 2px;
}

/* Ikona (core/icon.html) */
.icon { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: -4px; }
.icon--sm { width: 16px; height: 16px; vertical-align: -3px; }
.icon--lg { width: 28px; height: 28px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--c-primary); color: var(--c-on-primary); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--c-on-primary); }

/* ---------- 3. Rama aplikacji i nawigacja ---------------------------------- */
/*
   Telefon (< 768 px):  .topbar u góry, .bottomnav na dole (pod kciuk), .subnav jako przewijane pigułki.
   768–1099 px:          .sidebar jako wąski pasek ikon z podpisami.
   ≥ 1100 px:            .sidebar pełny (ikony + nazwy), na dole Panel, Ściąga, konto i „Wyloguj”.
*/

.app-main { min-width: 0; }

/* Znak marki „VIM — Open Arena” (core/_brand.html, PLAN.md pkt 35) i nazwa obiektu.
   Pliki: core/static/core/brand/. Skalowanie wyłącznie proporcjonalne (width + height: auto);
   pole ochronne jest częścią pliku — nie przycinamy go. Jeden znak na ekran. */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em;
  color: var(--c-text); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--c-text); }
.brand__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand__venue { font-size: var(--fs-xs); font-weight: 500; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__name { overflow: hidden; text-overflow: ellipsis; }
/* Znak bez podpisu (panel boczny): 150 px szerokości (pakiet: min. 120 px) */
.brand__logo { display: block; width: 150px; min-width: 120px; height: auto; flex: 0 0 auto; }
/* Symbol (paski na telefonie, nagłówek pracownika): 36 px (pakiet: min. 24 px) */
.brand__symbol { display: block; width: 36px; height: auto; flex: 0 0 36px; }
.brand__symbol--rail { display: none; width: 48px; flex-basis: 48px; }

/* Górny pasek (telefon) i nagłówek pracownika — klasa site-header zostaje (druk ją ukrywa) */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.site-header__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--topbar-h); max-width: var(--content-max); margin: 0 auto;
  padding: 6px 12px 6px 16px;
}
.site-header form, .user-box form, .topbar__actions form { margin: 0; }
.topbar__actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
/* 2.10 (dogrywka): pasek telefonu mieści się od 320 px — znak z nazwą obiektu skraca się wielokropkiem */
.topbar .brand { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.topbar .brand__text, .topbar .brand__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar .site-header__bar { gap: 8px; padding-right: 8px; }

/* Menu konta w górnym pasku telefonu (2.10): imię i rola, „Zmień hasło”, „Wyloguj” — <details>, bez skryptu */
.account-menu { position: relative; }
.account-menu > summary { list-style: none; cursor: pointer; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu[open] > summary { background: var(--c-surface-3); color: var(--c-text); }
.account-menu__panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 220px; max-width: calc(100vw - 16px); padding: 6px;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.account-menu__who { display: flex; flex-direction: column; margin: 0 0 4px; padding: 8px 12px 10px;
  border-bottom: 1px solid var(--c-border); line-height: 1.3; overflow-wrap: anywhere; }
.account-menu__who span { font-size: var(--fs-xs); color: var(--c-text-muted); }
.account-menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--c-text);
  font: inherit; font-size: var(--fs-sm); text-align: left; text-decoration: none; cursor: pointer;
}
.account-menu__item:hover { background: var(--c-surface-3); color: var(--c-text); }
.account-menu__item .icon { color: var(--c-text-muted); }
.role-chip {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px;
  border-radius: var(--radius-pill); background: var(--c-surface-3);
  font-size: var(--fs-xs); font-weight: 650; color: var(--c-text-muted); margin-right: 4px;
}

/* Pracownik z kodem: punkt i wydarzenie zamiast zakładek */
.site-header--worker .site-header__bar { min-height: 64px; gap: 12px; }
.worker-context { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.worker-context__location { font-weight: 700; font-size: 1.125rem; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worker-context__event { font-size: var(--fs-sm); color: var(--c-text-muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

/* Panel boczny — domyślnie ukryty (telefon) */
.sidebar { display: none; }

/* Główna nawigacja (w panelu bocznym) */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__link {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 42px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--c-sidebar-text); text-decoration: none; font-weight: 550; font-size: .9375rem;
  white-space: nowrap; transition: background .15s var(--ease), color .15s var(--ease);
}
.nav__link:hover { color: var(--c-sidebar-text-strong); background: rgba(255, 255, 255, .06); }
.nav__link.is-active, .nav__link[aria-current="page"] {
  color: var(--c-sidebar-text-strong); background: var(--c-sidebar-active-bg);
}
.nav__link.is-active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--c-sidebar-accent);
}
.nav__link.is-active .icon { color: var(--c-sidebar-accent); }
.nav__link:focus-visible { outline-color: var(--c-sidebar-accent); }
.nav__link--right { margin-left: 0; }   /* zgodność wsteczna (wersja 2) */
.nav--tools .nav__link { min-height: 38px; font-size: var(--fs-sm); }

.sidebar__brand { color: #fff; padding: 4px 6px 20px; border-radius: var(--radius-sm); }
.sidebar__brand:hover { color: #fff; }
.sidebar__brand:focus-visible { outline: 2px solid var(--c-sidebar-accent); outline-offset: 2px; }
.sidebar__brand .brand__venue { color: var(--c-sidebar-text); opacity: 1; font-size: var(--fs-sm); font-weight: 550; }
.sidebar__footer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

/* Konto w panelu bocznym */
.user-box {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: var(--radius-sm); background: var(--c-sidebar-2);
  font-size: var(--fs-sm); color: var(--c-sidebar-text);
}
.avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-primary); color: var(--c-on-primary); font-weight: 700; font-size: .9375rem;
}
.user-box__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.user-box__name { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12em; }
.user-box__role { font-size: var(--fs-xs); color: var(--c-sidebar-text); }
.user-box .user-box__logout { color: var(--c-sidebar-text); background: transparent; border-color: transparent; box-shadow: none; }
.user-box .user-box__logout:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.user-box .user-box__logout:focus-visible { outline-color: var(--c-sidebar-accent); }
/* Wersja 2.5 (PLAN.md pkt 41): pierwsza linia pola = nazwa obiektu (mały, wyraźny nagłówek; długie nazwy
   zawijają się do 2 linii, potem wielokropek), pod nią osoba: inicjał, imię, rola, „Wyloguj”. */
.user-box--venue { flex-direction: column; align-items: stretch; gap: 8px; }
.user-box__venue {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  overflow-wrap: anywhere; padding: 0 2px;
  color: var(--c-sidebar-text-strong); font-size: var(--fs-xs); font-weight: 700; line-height: 1.3;
  letter-spacing: .06em; text-transform: uppercase;
}
.user-box__person { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* 2.10 (dogrywka): „Zmień hasło” i „Wyloguj” jedno pod drugim — imię i rola mają miejsce („Właściciel systemu”) */
.user-box__actions { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 0 0 auto; }
.user-box__role { overflow-wrap: anywhere; }
.user-box--venue .user-box__person { padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .1); }

/* Podmenu zakładki (Lokalizacje): pigułki nad treścią strony */
.subnav-bar {
  position: sticky; top: var(--topbar-h); z-index: 20;
  display: flex; align-items: center; gap: 12px;
  background: rgba(243, 245, 249, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--c-border);
  padding: 8px 12px;
}
.subnav-bar__title { display: none; align-items: center; gap: 6px; font-weight: 650; font-size: var(--fs-sm);
  color: var(--c-text-muted); white-space: nowrap; }
.subnav {
  position: relative;   /* 2.7: blok zawierający dla elementów wewnątrz (przewijanie, app.js) */
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0;
  padding: 3px; border-radius: var(--radius-pill); background: var(--c-surface-3);
}
.subnav::-webkit-scrollbar { display: none; }
.subnav__link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 14px; border-radius: var(--radius-pill);
  color: var(--c-text-muted); text-decoration: none; font-size: .9375rem; font-weight: 600; white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.subnav__link:hover { color: var(--c-text); background: rgba(255, 255, 255, .7); }
.subnav__link.is-active, .subnav__link[aria-current="page"] {
  color: var(--c-primary-text); background: var(--c-surface); box-shadow: var(--shadow);
}

/* Dolny pasek zakładek (telefon) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 4px env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -4px 16px -8px rgba(16, 24, 40, .12);
}
.bottomnav__link {
  flex: 1 1 0; min-width: 0; max-width: 120px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--c-text-muted); text-decoration: none; font-size: .6875rem; font-weight: 600;
  letter-spacing: .01em; border-radius: var(--radius-sm); position: relative;
  -webkit-tap-highlight-color: transparent;
}
.bottomnav__link .icon { width: 24px; height: 24px; padding: 0; transition: transform .15s var(--ease); }
.bottomnav__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
/* 2.10 (dogrywka): 320–359 px — pięć zakładek managera mieści pełne podpisy („Wydarzenia”) */
@media (max-width: 359px) {
  .bottomnav { padding-left: 2px; padding-right: 2px; }
  .bottomnav__link { letter-spacing: 0; font-size: .65rem; }
  .bottomnav__label { padding: 0; }
}
.bottomnav__link:hover { color: var(--c-text); }
.bottomnav__link.is-active { color: var(--c-primary-text); }
.bottomnav__link.is-active::before {
  content: ""; position: absolute; top: 6px; left: 50%; width: 52px; height: 30px; margin-left: -26px;
  border-radius: var(--radius-pill); background: var(--c-primary-soft); z-index: -1;
}
.bottomnav__link:active .icon { transform: scale(.92); }

/* Telefon: miejsce na dolny pasek */
@media (max-width: 767px) {
  .app--nav { --bottomnav-h: 64px; --sticky-top: var(--topbar-h);
    --sticky-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px)); }
  .app--nav .app-main { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px)); }
  /* Koordynator i magazynier mają pozycje podmenu w dolnym pasku — pigułki zbędne */
  .app--flat-mobile .subnav-bar { display: none; }
  /* …ale pigułki Produkty · Urządzenia (tylko telefon) zostają — w dolnym pasku jest tylko „Produkty” (2.11) */
  .app--flat-mobile .subnav-bar.only-mobile { display: flex; }
  .subnav { flex: 1; }
  .subnav__link { flex: 1 0 auto; }
}

/* Tablet: wąski pasek ikon z podpisami */
@media (min-width: 768px) {
  .app--nav { --sidebar-w: 88px; }
  .bottomnav, .topbar { display: none; }
  .app--nav .app-main { margin-left: var(--sidebar-w); }
  .sidebar {
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: var(--sidebar-w);
    padding: 14px 10px; overflow-y: auto; scrollbar-width: thin;
    background: var(--c-sidebar); color: var(--c-sidebar-text);
    border-right: 1px solid rgba(255, 255, 255, .04);
  }
  .sidebar__brand { justify-content: center; padding: 2px 0 14px; }
  .sidebar__brand .brand__name, .sidebar__brand .brand__venue, .sidebar__brand .brand__text { display: none; }
  /* wąski pasek ikon (88 px): znak bez podpisu (min. 120 px) się nie mieści — sam symbol w bieli */
  .sidebar__brand .brand__logo { display: none; }
  .sidebar__brand .brand__symbol--rail { display: block; }
  .sidebar .nav__link { flex-direction: column; justify-content: center; gap: 4px; min-height: 60px;
    padding: 6px 4px; font-size: .6875rem; font-weight: 600; text-align: center; }
  .sidebar .nav__link .icon { width: 22px; height: 22px; }
  .sidebar .nav__link.is-active::before { left: -10px; top: 14px; bottom: 14px; }
  .sidebar .nav__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .sidebar .nav--tools .nav__link { min-height: 48px; }
  .sidebar .nav--tools .nav__label { display: none; }
  .sidebar .user-box { flex-direction: column; padding: 8px 4px; gap: 6px; background: transparent; }
  .sidebar .user-box__text { display: none; }
  /* wąski pasek ikon: nazwa obiektu tylko w podpowiedzi (title) — 88 px to za mało na czytelny tekst */
  .sidebar .user-box__venue { display: none; }
  .sidebar .user-box__person { flex-direction: column; gap: 6px; padding-top: 0; border-top: 0; }
  .subnav-bar { top: 0; padding: 10px 24px; }
}

/* Laptop: pełny panel boczny */
@media (min-width: 1100px) {
  .app--nav { --sidebar-w: 248px; }
  .sidebar { padding: 18px 14px; }
  /* pełny panel: znak bez podpisu (150 px), wyśrodkowany — link do strony startowej roli (wersja 2.5:
     nazwa obiektu przeniesiona do pola osoby na dole panelu) */
  .sidebar__brand { flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 2px 4px 18px; }
  .sidebar__brand .brand__logo { display: block; }
  .sidebar__brand .brand__symbol--rail { display: none; }
  .sidebar__brand .brand__name { display: inline; }
  .sidebar__brand .brand__venue { display: block; max-width: 100%; padding-left: 10px; }
  .sidebar__brand .brand__text { display: flex; max-width: 100%; }
  .sidebar .nav__link { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 42px;
    padding: 0 12px; font-size: .9375rem; font-weight: 550; text-align: left; }
  .sidebar .nav__link .icon { width: 20px; height: 20px; }
  .sidebar .nav__link.is-active::before { left: -14px; top: 10px; bottom: 10px; }
  .sidebar .nav--tools .nav__link { min-height: 38px; }
  .sidebar .nav--tools .nav__label { display: inline; }
  .sidebar .user-box { flex-direction: row; padding: 10px; gap: 10px; background: var(--c-sidebar-2); }
  .sidebar .user-box--venue { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 10px 8px; }
  .sidebar .user-box__venue { display: -webkit-box; }
  .sidebar .user-box__person { flex-direction: row; gap: 10px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .1); }
  .sidebar .user-box__text { display: flex; }
  /* 2.7: pole bez linii z nazwą obiektu (nazwa obiektu = nazwa systemu) — osoba bez kreski nad sobą */
  .sidebar .user-box:not(.user-box--venue) .user-box__person { flex: 1; min-width: 0; padding-top: 0; border-top: 0; }
  .subnav-bar { padding: 12px 32px; }
  .subnav-bar__title { display: inline-flex; }
}

/* ---------- 4. Układ strony ------------------------------------------------ */

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 16px 16px 40px;
}
.container:focus { outline: none; }
.container--narrow { max-width: 680px; }
.container--wide { max-width: none; }

/* Nagłówek strony: [okruszki] tytuł + podtytuł, akcje po prawej (na telefonie pod spodem) */
.page-header {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px 16px; margin-bottom: 20px;
}
.page-header > div:first-child { min-width: 0; }
.page-header h1 { margin: 0; overflow-wrap: anywhere; }
.page-header__eyebrow { display: block; margin: 0 0 4px; font-size: var(--fs-xs); font-weight: 650;
  text-transform: uppercase; letter-spacing: .06em; color: var(--c-text-subtle); }
.page-header__subtitle { margin: 6px 0 0; color: var(--c-text-muted); font-size: .9375rem; }
.page-header__subtitle + .page-header__subtitle { margin-top: 2px; }
.page-header__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Okruszki: <nav class="breadcrumbs"><a>Przegląd</a> › Kiosk 1</nav> */
.breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px;
  font-size: var(--fs-sm); color: var(--c-text-subtle); margin-bottom: 10px;
}
.breadcrumbs a { color: var(--c-text-muted); text-decoration: none; font-weight: 550; }
.breadcrumbs a:hover { color: var(--c-primary-text); text-decoration: underline; }

.site-footer { max-width: var(--content-max); margin: 0 auto; padding: 16px; font-size: .8125rem; color: var(--c-text-muted); }

/* Odstępy i siatki */
.stack > * + * { margin-top: var(--gap); }
.stack--sm > * + * { margin-top: 8px; }
.stack--lg > * + * { margin-top: 32px; }
.grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
.grid > * { min-width: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px;
  margin-bottom: var(--gap);
}
.section { margin-top: 32px; }
.section__header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 4px 12px; margin-bottom: 12px; }
.section__title { font-size: 1.125rem; margin: 0; }
.section__meta { font-size: var(--fs-sm); color: var(--c-text-muted); }

@media (min-width: 560px) and (max-width: 767px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  :root { --gap: 20px; }
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .grid--sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  h1 { font-size: var(--fs-2xl); }
  .container { padding: 28px 24px 56px; }
  .page-header { margin-bottom: 24px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .container { padding: 32px 32px 64px; }
}

/* ---------- 5. Karty i kafelki --------------------------------------------- */

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
@media (min-width: 768px) { .card { padding: 20px; } }
.card__header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 14px;
}
.card__title { font-size: 1.0625rem; font-weight: 650; margin: 0; letter-spacing: -.01em; }
.card__meta { font-size: var(--fs-sm); color: var(--c-text-muted); }
.card__footer {
  margin: 16px -16px -16px; padding: 12px 16px;
  border-top: 1px solid var(--c-border); background: var(--c-surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
@media (min-width: 768px) { .card__footer { margin: 20px -20px -20px; padding: 12px 20px; } }
.card--flush { padding: 0; overflow: hidden; }
.card--flush > .card__header { padding: 16px 16px 0; }
@media (min-width: 768px) { .card--flush > .card__header { padding: 18px 20px 0; } }
.card--flush > .card__footer { margin: 0; }
.card--muted { background: var(--c-surface-2); box-shadow: none; }
/* :where — zerowa waga, żeby klasy aplikacji (np. display: flex) wygrywały z tym ustawieniem */
:where(a.card, .card--link) {
  display: block; color: inherit; text-decoration: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
a.card:hover, .card--link:hover {
  border-color: var(--c-primary-border); box-shadow: var(--shadow-md); transform: translateY(-1px); color: inherit;
}
/* Pasek statusu po lewej (kolor) — tekst statusu zawsze w środku karty */
.card--shortage { box-shadow: inset 4px 0 0 var(--c-shortage), var(--shadow); }
.card--surplus { box-shadow: inset 4px 0 0 var(--c-surplus), var(--shadow); }
.card--ok { box-shadow: inset 4px 0 0 var(--c-ok), var(--shadow); }
a.card--shortage:hover { box-shadow: inset 4px 0 0 var(--c-shortage), var(--shadow-md); }
a.card--surplus:hover { box-shadow: inset 4px 0 0 var(--c-surplus), var(--shadow-md); }
a.card--ok:hover { box-shadow: inset 4px 0 0 var(--c-ok), var(--shadow-md); }

/* Kafelek z liczbą: <div class="card stat stat--shortage"><span class="stat__value">3</span><span class="stat__label">Braki</span></div>
   Etykieta wyświetla się NAD liczbą (order), kolejność w HTML bez zmian. */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat__value {
  font-size: 1.875rem; font-weight: 700; line-height: 1.05; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--c-text);
}
.stat__label { order: -1; font-size: var(--fs-sm); font-weight: 550; color: var(--c-text-muted); }
.stat__hint { font-size: var(--fs-xs); color: var(--c-text-muted); }
.stat--shortage .stat__value { color: var(--c-shortage); }
.stat--surplus .stat__value { color: var(--c-surplus); }
.stat--ok .stat__value { color: var(--c-ok); }
.card.stat { position: relative; }
.card.stat--shortage .stat__label, .card.stat--surplus .stat__label, .card.stat--ok .stat__label { padding-right: 18px; }
.card.stat--shortage::after, .card.stat--surplus::after, .card.stat--ok::after {
  content: ""; position: absolute; top: 18px; right: 18px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-ok);
}
.card.stat--shortage::after { background: var(--c-shortage); box-shadow: 0 0 0 4px var(--c-shortage-soft); }
.card.stat--surplus::after { background: var(--c-surplus); box-shadow: 0 0 0 4px var(--c-surplus-soft); }
.card.stat--ok::after { box-shadow: 0 0 0 4px var(--c-ok-soft); }
/* Rząd kafelków na telefonie: obok siebie zamiast jeden pod drugim (.grid--stats albo grid z kafelkami) */
.grid--stats { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 767px) {
  .grid--3:has(> .stat), .grid--4:has(> .stat), .grid--stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid--3:has(> .stat:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
  .card.stat { padding: 12px 14px; }
  .stat__value { font-size: 1.5rem; }
  .stat__label { font-size: .8125rem; }
  .card.stat--shortage::after, .card.stat--surplus::after, .card.stat--ok::after { top: 14px; right: 12px; }
}
@media (min-width: 768px) { .grid--stats { grid-template-columns: repeat(4, 1fr); } }

/* ---------- 6. Tabele ------------------------------------------------------ */

/* position: relative (wersja 2.7, U-10): kontener przewijany jest blokiem zawierającym dla elementów
   pozycjonowanych w tabeli (np. .sr-only w nagłówku kolumny akcji) — inaczej „uciekają” z przewijania
   i poszerzają całą stronę. Wskazówka przewijania w bok — sekcja 6a niżej (app.js, bez zmian w aplikacjach). */
.table-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* Tabela z przewijaniem w pionie i przyklejonym nagłówkiem: .table-wrap.table-wrap--scroll > .table.table--sticky */
.table-wrap--scroll { max-height: min(70vh, 720px); overflow: auto; }
.card > .table-wrap, .card--flush .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
  background: var(--c-surface);
}
.table th, .table td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--c-border);
}
.table thead th {
  background: var(--c-surface-2);
  font-size: var(--fs-xs);
  font-weight: 650;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  padding-top: 10px; padding-bottom: 10px;
}
.table--sticky thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--c-border); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--c-primary-softer); }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .nowrap { white-space: nowrap; }
.table td > a:not(.btn) { font-weight: 600; text-decoration: none; }
.table td > a:not(.btn):hover { text-decoration: underline; }
.table tr.group-row th, .table tr.group-row td {
  background: var(--c-surface-3); color: var(--c-text); font-weight: 650;
  font-size: .8125rem; text-transform: none; letter-spacing: .01em; padding-top: 8px; padding-bottom: 8px;
}
.table tr.group-row:hover { background: transparent; }
.table tfoot td, .table tfoot th { font-weight: 650; background: var(--c-surface-2); border-top: 1px solid var(--c-border-strong); border-bottom: 0; }
.table--compact th, .table--compact td { padding: 7px 10px; }
.table--compact { font-size: var(--fs-sm); }
.table tr.row--shortage > :first-child { box-shadow: inset 3px 0 0 var(--c-shortage); }
.table tr.row--surplus > :first-child { box-shadow: inset 3px 0 0 var(--c-surplus); }
.table tr.row--muted td { color: var(--c-text-muted); }
.table tr.row--highlight { background: var(--c-primary-softer); }

/* Tabela układana w karty na telefonie: <table class="table table--stack"> + <td data-label="Stan">.
   Pierwsza komórka wiersza = tytuł karty; reszta: etykieta po lewej, wartość po prawej. */
@media (max-width: 599px) {
  .table-wrap:has(> .table--stack) { background: transparent; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
  .card .table-wrap:has(> .table--stack) { padding: 0 12px 12px; }
  .table--stack { background: transparent; }
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tbody tr {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs); padding: 6px 0; margin-bottom: 8px; overflow: hidden;
  }
  .table--stack tbody tr:hover { background: var(--c-surface); }
  .table--stack td {
    border: 0; padding: 5px 14px; display: flex; justify-content: space-between; align-items: baseline;
    gap: 12px; text-align: right; min-height: 0;
  }
  .table--stack td::before {
    content: attr(data-label); flex: 0 0 auto; color: var(--c-text-muted); font-size: .8125rem;
    font-weight: 550; text-align: left;
  }
  .table--stack td:first-child {
    font-weight: 650; font-size: 1rem; text-align: left; display: block;
    padding-top: 8px; padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px solid var(--c-border);
  }
  .table--stack td:first-child::before { content: none; }
  .table--stack td:empty { display: none; }
  .table--stack tr.row--shortage > :first-child, .table--stack tr.row--surplus > :first-child { box-shadow: none; }
  .table--stack tr.row--shortage { box-shadow: inset 4px 0 0 var(--c-shortage), var(--shadow-xs); background: var(--c-surface); }
  .table--stack tr.row--surplus { box-shadow: inset 4px 0 0 var(--c-surplus), var(--shadow-xs); background: var(--c-surface); }
  .table--stack tr.group-row {
    background: transparent; border: 0; box-shadow: none; padding: 0; margin: 16px 0 6px; border-radius: 0;
  }
  .table--stack tr.group-row th, .table--stack tr.group-row td {
    display: block; text-align: left; padding: 0 4px; background: transparent; border: 0;
    font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--c-text-muted);
  }
  .table--stack tr.group-row td::before { content: none; }
  .table--stack tbody tr.group-row:first-child { margin-top: 0; }
  .table--stack tfoot { display: block; }
  .table--stack tfoot tr {
    display: block; background: var(--c-surface-3); border-radius: var(--radius-sm); padding: 6px 0;
  }
  .table--stack tfoot td, .table--stack tfoot th { display: flex; justify-content: space-between; gap: 12px;
    background: transparent; border: 0; padding: 4px 14px; }
  .table--stack tfoot td::before { content: attr(data-label); color: var(--c-text-muted); font-weight: 550; }
  .table--stack tfoot td:first-child::before, .table--stack tfoot th::before { content: none; }
}

/* ---------- 6a. Wskazówka przewijania w bok (wersja 2.7, U-11 i U-25) ----------
   Dotyczy SAMO z siebie: .table-wrap, .tabs, .subnav, .segmented — aplikacje nic nie dopisują.
   core/app.js mierzy każdy taki kontener (także dodany później i po zmianie rozmiaru) i ustawia klasy:
     .is-scrollable   — treść jest szersza niż kontener (przewija się w bok),
     .has-more-left   — po lewej jest ukryta treść (przewinięto),
     .has-more-right  — po prawej jest ukryta treść.
   Krawędź, za którą jest jeszcze treść, płynnie zanika (maska) — widać, że tabela / pasek „idzie dalej”.
   Pasek przewijania (Windows) zostaje w pełni widoczny: dolny pas o wysokości --scroll-hint-bar (mierzonej
   przez app.js) nie jest maskowany. Tabela z przyklejoną pierwszą kolumną (position: sticky; left) dostaje
   tylko zanik z prawej (app.js wykrywa to sam). Przewijana tabela jest też dostępna z klawiatury:
   app.js nadaje jej tabindex="0", role="region" i opis („… — tabela przewijana w bok”) — tylko na czas,
   gdy naprawdę się przewija. Bez JS wszystko działa jak dawniej (zwykłe przewijanie, bez zaniku). */
@media screen {
  .is-scrollable.has-more-left, .is-scrollable.has-more-right {
    --scroll-hint-l: 0px;
    --scroll-hint-r: 0px;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--scroll-hint-l), #000 calc(100% - var(--scroll-hint-r)), transparent 100%),
      linear-gradient(#000, #000);
    mask-image: linear-gradient(to right, transparent 0, #000 var(--scroll-hint-l), #000 calc(100% - var(--scroll-hint-r)), transparent 100%),
      linear-gradient(#000, #000);
    -webkit-mask-size: 100% 100%, 100% var(--scroll-hint-bar, 0px);
    mask-size: 100% 100%, 100% var(--scroll-hint-bar, 0px);
    -webkit-mask-position: 0 0, 0 100%;
    mask-position: 0 0, 0 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
  }
  .is-scrollable.has-more-left { --scroll-hint-l: 48px; }
  .is-scrollable.has-more-right { --scroll-hint-r: 48px; }
  /* paski zakładek / pigułek są niskie — węższy zanik */
  .tabs.has-more-left, .subnav.has-more-left, .segmented.has-more-left { --scroll-hint-l: 32px; }
  .tabs.has-more-right, .subnav.has-more-right, .segmented.has-more-right { --scroll-hint-r: 32px; }
  /* przewijana tabela osiągalna fokusem: obrys do środka (maska ścina to, co poza ramką) */
  .table-wrap[data-scroll-hint]:focus-visible { outline: 2px solid var(--c-focus-ring); outline-offset: -2px; border-radius: inherit; }
}

/* ---------- 7. Przyciski --------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-xs);
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease),
    box-shadow .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { background: var(--c-surface-2); border-color: #b6bfcd; color: var(--c-text); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn .icon { width: 18px; height: 18px; }
/* Główny: wypełnienie Arena Blue, tekst i ikona Navy (biały miałby tylko 3,4:1) */
.btn--primary { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary);
  box-shadow: 0 1px 2px rgba(20, 36, 59, .18), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn--primary:hover { background: var(--c-primary-fill-hover); border-color: var(--c-primary-fill-hover); color: var(--c-on-primary); }
.btn--secondary { background: var(--c-primary-soft); border-color: transparent; color: var(--c-primary-text); box-shadow: none; }
.btn--secondary:hover { background: #d6e4f2; border-color: transparent; color: var(--c-primary-hover); }
.btn--danger { background: var(--c-shortage); border-color: var(--c-shortage); color: #fff; }
.btn--danger:hover { background: #9e2914; border-color: #9e2914; color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--c-primary-text); box-shadow: none; }
.btn--ghost:hover { background: var(--c-primary-soft); border-color: transparent; color: var(--c-primary-hover); }
/* btn--small: na telefonie i ekranie dotykowym 44 px (README: przyciski ≥ 44 px — wersja 2.7, U-25);
   mysz od 768 px — 32 px (blok pointer: fine niżej) */
.btn--small { min-height: 44px; padding: 4px 12px; font-size: var(--fs-sm); border-radius: 8px; gap: 6px; }
.btn--small .icon { width: 16px; height: 16px; }
.btn--large { min-height: 54px; padding: 12px 24px; font-size: 1.0625rem; border-radius: 12px; }
.btn--block { display: flex; width: 100%; }
.btn--icon { min-width: 44px; padding: 0; }
.btn--icon.btn--small { min-width: 44px; }
.btn--ghost.btn--icon { color: var(--c-text-muted); }
.btn--ghost.btn--icon:hover { color: var(--c-text); background: var(--c-surface-3); }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

@media (pointer: fine) and (min-width: 768px) {
  .btn { min-height: 40px; }
  .btn--small { min-height: 32px; }
  .btn--icon { min-width: 40px; }
  .btn--icon.btn--small { min-width: 34px; }
  .btn--large { min-height: 52px; }
}
/* ---------- 8. Formularze -------------------------------------------------- */

.form { max-width: 580px; }
.form--wide { max-width: none; }
.field { margin-bottom: 18px; }
.field__label, .form label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: 6px; color: var(--c-text); }
.field__help, .form .helptext { display: block; font-size: var(--fs-sm); color: var(--c-text-muted); margin-top: 6px; }
.field__error, .errorlist { color: var(--c-shortage); font-size: var(--fs-sm); margin: 6px 0 0; padding: 0; list-style: none; font-weight: 600; }
.field--error .input, .field--error input, .field--error select, .field--error textarea {
  border-color: var(--c-shortage); box-shadow: 0 0 0 3px rgba(192, 52, 29, .12);
}
.field--inline { display: flex; align-items: center; gap: 10px; }
.field--inline .field__label { margin: 0; }

.input,
.form input[type="text"], .form input[type="password"], .form input[type="number"],
.form input[type="email"], .form input[type="date"], .form input[type="datetime-local"],
.form input[type="search"], .form input[type="tel"], .form select, .form textarea {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 10px 14px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: 16px;          /* 16 px — iOS nie powiększa strony przy fokusie */
  box-shadow: var(--shadow-xs);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder, .form input::placeholder, .form textarea::placeholder { color: var(--c-text-subtle); }
.input:hover, .form input:hover, .form select:hover, .form textarea:hover { border-color: #b3bccb; }
.form textarea, textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
select.input, .form select {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2352607a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px 18px;
}
select[multiple].input, .form select[multiple] { background-image: none; padding-right: 14px; }
.input:focus, .form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(91, 143, 198, .3);
}
.input:disabled, .form input:disabled, .form select:disabled, .form textarea:disabled {
  background: var(--c-surface-2); color: var(--c-text-muted); cursor: not-allowed;
}
/* Pole z błędem (wersja 2.12): PO regułach bazowych i z wyższą szczegółowością niż `.form input[type="…"]`,
   `:hover` i `:focus` — czerwona ramka dla każdego typu pola (tekst, e-mail, liczba, data, lista, pole tekstowe),
   także `aria-invalid="true"` bez opakowania `.field--error`. Pola wyboru i opcje bez zmian. */
.field.field--error .input,
.field.field--error input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]),
.field.field--error select, .field.field--error textarea,
.input.input[aria-invalid="true"], .form input[aria-invalid="true"]:not([type="checkbox"]):not([type="radio"]),
.form select[aria-invalid="true"], .form textarea[aria-invalid="true"] {
  border-color: var(--c-shortage); box-shadow: 0 0 0 3px rgba(192, 52, 29, .12);
}
.field.field--error .input:focus,
.field.field--error input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):focus,
.field.field--error select:focus, .field.field--error textarea:focus,
.input.input[aria-invalid="true"]:focus, .form input[aria-invalid="true"]:focus {
  border-color: var(--c-shortage); box-shadow: 0 0 0 3px rgba(192, 52, 29, .12), 0 0 0 1px var(--c-shortage);
}
.input--inline { display: inline-block; width: auto; }
.input--sm { min-height: 36px; padding: 6px 10px; font-size: .9375rem; }
.form input[type="checkbox"], .form input[type="radio"], .checkbox {
  width: 22px; height: 22px; accent-color: var(--c-primary); vertical-align: middle; cursor: pointer;
}

/* Duże pole ilości (liczenie, ruchy na telefonie) */
.input--qty {
  font-size: 1.375rem;
  font-weight: 650;
  text-align: center;
  min-height: 56px;
  font-variant-numeric: tabular-nums;
  max-width: 140px;
}
/* Krokomierz −/+: <div class="qty-stepper"><button class="btn">−</button><input class="input input--qty"><button class="btn">+</button></div> */
.qty-stepper { display: inline-flex; align-items: stretch; gap: 6px; }
.qty-stepper .btn { min-width: 56px; min-height: 56px; font-size: 1.5rem; font-weight: 500; padding: 0;
  background: var(--c-surface-2); border-color: var(--c-border); border-radius: 12px; }
.qty-stepper .btn:hover { background: var(--c-surface-3); }
.qty-stepper .btn:active { background: var(--c-primary-soft); color: var(--c-primary-text); }
.qty-stepper .input--qty { border-radius: 12px; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
/* Przyklejony pasek akcji u dołu ekranu (nad dolnym paskiem zakładek na telefonie) */
.form-actions--sticky {
  position: sticky; bottom: var(--sticky-bottom); z-index: 15;
  background: rgba(243, 245, 249, .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding: 12px 0; margin-top: 16px; border-top: 1px solid var(--c-border);
}
@media (max-width: 767px) {
  .form-actions--sticky { margin-left: -16px; margin-right: -16px; padding: 10px 16px; }
}

/* Wskaźnik autozapisu: <span class="save-state save-state--saved">Zapisano</span> */
.save-state { display: inline-flex; align-items: center; gap: 5px; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.save-state--saving { color: var(--c-text-muted); }
.save-state--saving:not(:empty)::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite;
}
.save-state--saved { color: var(--c-ok); }
.save-state--saved:not(:empty)::before { content: "✓"; font-weight: 800; }
.save-state--error { color: var(--c-shortage); }
.save-state--error:not(:empty)::before { content: "!"; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: var(--c-shortage); color: #fff; font-size: 11px; font-weight: 800; }

/* ---------- 9. Statusy (ZAWSZE z etykietą tekstową) ------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 9px;
  border-radius: var(--radius-pill);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  background: var(--c-muted-soft);
  color: var(--c-text-muted);
  vertical-align: middle;
}
.badge::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: currentColor; }
.badge--plain { padding-left: 10px; }
.badge--plain::before { content: none; }
.badge--ok { background: var(--c-ok-soft); color: var(--c-ok); }
.badge--shortage { background: var(--c-shortage-soft); color: var(--c-shortage); }
.badge--surplus { background: var(--c-surplus-soft); color: var(--c-surplus); }
.badge--info { background: var(--c-info-soft); color: var(--c-info-text); }
.badge--muted { background: var(--c-muted-soft); color: var(--c-text-muted); }
.badge--outline { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }

/* Wartość z kolorem statusu: <span class="qty qty--shortage">−12</span> */
.qty { font-variant-numeric: tabular-nums; font-weight: 600; }
.qty--shortage { color: var(--c-shortage); }
.qty--surplus { color: var(--c-surplus); }
.qty--ok { color: var(--c-ok); }

/* Etykieta „do jakich celów” (np. „Cele: Mecz siatkówki 21.11” / „Cele bazowe”) */
.targets-label {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: var(--fs-sm); color: var(--c-text-muted);
}
.targets-label::before {
  content: ""; width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%;
  border: 2px solid var(--c-primary); box-shadow: inset 0 0 0 2.5px var(--c-surface), inset 0 0 0 6px var(--c-primary);
}
.targets-label strong { color: var(--c-text); font-weight: 650; }

/* ---------- 10. Komunikaty i puste stany ----------------------------------- */

.messages { list-style: none; margin: 0 0 var(--gap); padding: 0; }
.messages > li + li { margin-top: 8px; }
.alert {
  position: relative;
  padding: 12px 16px 12px 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-primary-border);
  background: var(--c-info-soft);
  color: var(--c-text);
  font-size: .9375rem;
}
.alert::before {
  content: "i"; position: absolute; left: 14px; top: 13px;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 800 12px/1 var(--font); color: var(--c-on-primary); background: var(--c-info);
}
.alert__title { font-weight: 650; display: block; margin-bottom: 2px; }
.alert > :last-child { margin-bottom: 0; }
.alert--success { background: var(--c-ok-soft); border-color: #bfe3cd; }
.alert--success::before { content: "✓"; background: var(--c-ok); color: #fff; }
.alert--error { background: var(--c-shortage-soft); border-color: #f3c6bd; }
.alert--error::before { content: "!"; background: var(--c-shortage); color: #fff; }
.alert--warning { background: var(--c-surplus-soft); border-color: #f2d9a6; }
.alert--warning::before { content: "!"; background: var(--c-surplus); color: #fff; }
.alert--info { background: var(--c-info-soft); border-color: var(--c-primary-border); }
.alert--info::before { background: var(--c-info); }

/* Wersja 2.10: pasek „Instalacja wyłączona” — tylko właściciel systemu, na każdej stronie (base.html) */
.instance-banner {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: var(--c-surplus-soft); color: var(--c-text); border-bottom: 2px solid var(--c-surplus);
  font-size: var(--fs-sm); line-height: 1.35;
}
.instance-banner .icon { color: var(--c-surplus); flex: 0 0 auto; }

/* Pusty stan: <div class="empty"><p class="empty__title">…</p><p>…</p><a class="btn">…</a></div> */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
  padding: 36px 20px;
  color: var(--c-text-muted);
  border: 1px dashed var(--c-border-strong);
  border-radius: var(--radius);
  background: var(--c-surface);
}
.empty > p { max-width: 52ch; }
.empty__icon {
  width: 48px; height: 48px; border-radius: 14px; margin-bottom: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-primary-soft); color: var(--c-primary-text);
}
.empty__icon .icon { width: 24px; height: 24px; }
.empty__title { font-weight: 650; color: var(--c-text); font-size: 1.0625rem; margin: 0; }
.empty .btn { margin-top: 10px; }

/* ---------- 11. Listy, zakładki, filtry ------------------------------------ */

.list { list-style: none; margin: 0; padding: 0; background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list__item { border-bottom: 1px solid var(--c-border); }
.list__item:last-child { border-bottom: 0; }
.list__link, .list__content {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: 10px 16px; color: inherit; text-decoration: none;
}
.list__link { transition: background .12s var(--ease); }
.list__link:hover { background: var(--c-primary-softer); color: inherit; }
.list__link:active { background: var(--c-primary-soft); }
.list__title { font-weight: 600; }
.list__meta { font-size: var(--fs-sm); color: var(--c-text-muted); }
.card > .list, .card--flush > .list { border: 0; border-radius: 0; box-shadow: none; }

/* Zakładki WEWNĄTRZ strony (filtr widoku) — nie mylić z .subnav */
.tabs {
  position: relative;   /* 2.7: blok zawierający dla elementów wewnątrz (przewijanie, app.js) */
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--c-border); margin-bottom: var(--gap);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__link {
  position: relative; padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px;
  color: var(--c-text-muted); text-decoration: none; font-weight: 600; font-size: .9375rem; white-space: nowrap;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}
.tabs__link:hover { color: var(--c-text); background: rgba(16, 24, 40, .03); }
.tabs__link.is-active, .tabs__link[aria-current="page"] { color: var(--c-primary-text); }
.tabs__link.is-active::after, .tabs__link[aria-current="page"]::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  border-radius: 2px 2px 0 0; background: var(--c-primary);
}
.tabs__count { display: inline-flex; min-width: 22px; justify-content: center; padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--c-surface-3); color: var(--c-text-muted); font-size: var(--fs-xs); font-weight: 650; line-height: 1.6; }
.tabs__link.is-active .tabs__count { background: var(--c-primary-soft); color: var(--c-primary-text); }

/* Przełącznik segmentowy (np. „wg ilości / wg wartości”) — linki albo przyciski */
.segmented { position: relative; display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: var(--c-surface-3); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented__item {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent;
  color: var(--c-text-muted); font: inherit; font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
  white-space: nowrap; cursor: pointer;
}
.segmented__item:hover { color: var(--c-text); }
.segmented__item.is-active, .segmented__item[aria-current="page"], .segmented__item[aria-pressed="true"] {
  background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow);
}

/* Pasek filtrów (panel nad tabelą): pola obok siebie, na telefonie jedno pod drugim */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
  padding: 14px 16px; margin-bottom: var(--gap);
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.filter-bar .field { margin: 0; flex: 1 1 180px; min-width: 0; }
.filter-bar .field__label { font-size: var(--fs-sm); color: var(--c-text-muted); margin-bottom: 4px; }
.filter-bar__actions { display: flex; gap: 8px; align-items: center; }

/* ---------- 12. Nowe komponenty wersji 2.1 (dla Etapów 11–14) -------------- */

/* Lista faktów „etykieta: wartość”: <dl class="kv"><div><dt>Typ</dt><dd>Kiosk</dd></div></dl> */
.kv { margin: 0; display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--c-border); }
.kv > div:first-child { border-top: 0; padding-top: 0; }
.kv dt { color: var(--c-text-muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* Strumień zdarzeń (Pulpit: zgłoszenia z punktów) */
.feed { list-style: none; margin: 0; padding: 0; }
.feed__item { position: relative; display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--c-border); }
.feed__item:first-child { border-top: 0; padding-top: 0; }
.feed__icon {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-surface-3); color: var(--c-text-muted);
}
.feed__icon .icon { width: 18px; height: 18px; }
.feed__icon--ok { background: var(--c-ok-soft); color: var(--c-ok); }
.feed__icon--shortage { background: var(--c-shortage-soft); color: var(--c-shortage); }
.feed__icon--surplus { background: var(--c-surplus-soft); color: var(--c-surplus); }
.feed__icon--info { background: var(--c-info-soft); color: var(--c-info-text); }
.feed__body { flex: 1; min-width: 0; }
.feed__title { font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.feed__meta { font-size: .8125rem; color: var(--c-text-muted); margin: 2px 0 0; }
.feed__time { flex: 0 0 auto; font-size: .8125rem; color: var(--c-text-subtle); white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed__item.is-new .feed__title::after {
  content: "nowe"; margin-left: 8px; padding: 1px 7px; border-radius: var(--radius-pill);
  background: var(--c-primary); color: var(--c-on-primary); font-size: .6875rem; font-weight: 700; vertical-align: 2px;
}
.feed__item.is-new { animation: feed-in .5s var(--ease); }

/* Notatka (np. z liczenia) — wyróżniona */
.note {
  position: relative; padding: 10px 14px 10px 40px; border-radius: var(--radius-sm);
  background: #fff8e6; border: 1px solid #f3dfa8; color: var(--c-text); font-size: .9375rem;
}
.note::before {
  content: ""; position: absolute; left: 14px; top: 13px; width: 14px; height: 16px; border-radius: 2px 6px 2px 2px;
  border: 2px solid var(--c-surplus); border-top-right-radius: 6px;
}
.note__meta { display: block; font-size: .8125rem; color: var(--c-text-muted); margin-top: 2px; }

/* Pasek postępu: <div class="progress"><span class="progress__bar" style="width: 40%"></span></div> */
.progress { height: 8px; border-radius: var(--radius-pill); background: var(--c-surface-3); overflow: hidden; }
.progress__bar { display: block; height: 100%; border-radius: inherit; background: var(--c-primary); transition: width .3s var(--ease); }
.progress--ok .progress__bar { background: var(--c-ok); }

/* Karta akcji (duży kafelek-link z ikoną): <a class="card action-card">…</a> */
.action-card { display: flex !important; align-items: center; gap: 14px; min-height: 84px; }
.action-card__icon {
  flex: 0 0 48px; width: 48px; height: 48px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-primary-soft); color: var(--c-primary-text);
}
.action-card__icon .icon { width: 24px; height: 24px; }
.action-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.action-card__title { font-weight: 650; font-size: 1.0625rem; }
.action-card__text { font-size: var(--fs-sm); color: var(--c-text-muted); }
.action-card__chevron { color: var(--c-text-subtle); }

/* Liczba w kółku obok tytułu (np. liczba pozycji) */
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px;
  padding: 0 7px; border-radius: var(--radius-pill); background: var(--c-surface-3); color: var(--c-text-muted);
  font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; vertical-align: 2px; }
.count-pill--shortage { background: var(--c-shortage-soft); color: var(--c-shortage); }

/* Rozwijany blok <details class="disclosure"><summary>Pokaż szczegóły</summary>…</details> */
.disclosure > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; color: var(--c-primary-text); font-weight: 600; font-size: var(--fs-sm); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s var(--ease); margin-right: 2px; }
.disclosure[open] > summary::before { transform: rotate(45deg); }

/* Separator z napisem („albo”) */
.divider { display: flex; align-items: center; gap: 12px; color: var(--c-text-subtle); font-size: var(--fs-sm); margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }

/* Cele dotyku ≥ 44 px na telefonie i ekranach dotykowych (README „Wygląd” pkt 4; wersja 2.7, U-25):
   pigułki podmenu, przełącznik segmentowy, rozwijane „szczegóły”, znak w górnym pasku, okruszki
   (btn--small — sekcja 7). Wygląd na laptopie z myszą bez zmian. Blok stoi PO definicjach tych klas. */
@media (max-width: 767px), (pointer: coarse) {
  .subnav__link, .segmented__item, .disclosure > summary { min-height: 44px; }
  .topbar .brand { min-height: 44px; }
  /* okruszki: pole dotyku 44 px, ale wiersz okruszków zostaje niski (ujemny margines w pionie) */
  .breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; margin: -11px 0; }
}
@media (max-width: 767px) {
  .subnav-bar { padding-top: 6px; padding-bottom: 6px; }   /* wyższe pigułki — pasek prawie tej samej wysokości */
}

/* ---------- 13. Narzędzia -------------------------------------------------- */

.muted { color: var(--c-text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.hidden, [hidden] { display: none !important; }
/* only-desktop / only-mobile tylko UKRYWAJĄ — nie nadają własnego display, więc element
   zachowuje swój układ (np. .page-header__actions z display: flex). */
@media (max-width: 767px) {
  .only-desktop { display: none !important; }
}
@media (min-width: 768px) {
  .only-mobile { display: none !important; }
}
/* sr-only: tekst tylko dla czytnika ekranu. position: absolute — dlatego kontenery przewijane w bok
   (.table-wrap, .tabs, .subnav, .segmented) mają od 2.7 position: relative (U-10). Własny kontener
   z overflow-x: auto w aplikacji, w którym jest .sr-only, też potrzebuje position: relative. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* print-only: ukryte na ekranie (!important — wygrywa np. z .table--stack td na telefonie);
   w druku element wraca do SWOJEGO display (komórka tabeli zostaje komórką, flex — flexem). */
@media screen { .print-only { display: none !important; } }
.print-brand { font-size: 10pt; color: #555; margin: 0 0 6px; }

/* Wspólny nagłówek wydruku (core/_print_header.html, PLAN.md pkt 35): znak bez podpisu w granacie,
   mały, w lewym górnym rogu (ekran 120 px, papier 28 mm — minimum pakietu), obok tytuł i obiekt. */
.print-header { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; color: var(--c-text); }
.print-header__logo { display: block; width: 120px; height: auto; flex: 0 0 auto; }
.print-header__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.print-header__title { font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
.print-header__meta { font-size: var(--fs-sm); color: var(--c-text-muted); }

/* ---------- 14. Logowanie i strony błędów ---------------------------------- */

.auth-page {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--c-bg);
}
/* Znak nad formularzem (PLAN.md pkt 35): pełny znak z podpisem, granat na jasnym tle,
   szerokość clamp(300px, 36vw, 440px); < 360 px — znak bez podpisu (<picture> w login.html). */
.auth-brand { display: flex; flex-direction: column; align-items: center; padding: 20px 16px 0; text-align: center; }
.auth-brand__heading { margin: 0; line-height: 0; }
.auth-brand__logo { display: block; width: clamp(300px, 36vw, 440px); max-width: 100%; height: auto; }
.auth-brand__venue { margin: 2px 0 0; font-size: 1rem; font-weight: 600; color: var(--c-text-muted); }
@media (max-width: 359px) { .auth-brand__logo { width: 100%; min-width: 120px; } }
.auth-main { display: flex; align-items: flex-start; justify-content: center; padding: 12px 16px 40px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card__title { font-size: 1.25rem; margin: 4px 0 16px; }
.auth-section { padding: 20px; background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-section + .auth-section { margin-top: 0; }
.auth-section--primary { border-color: var(--c-primary-border); box-shadow: 0 0 0 4px var(--c-primary-softer), var(--shadow); }
.auth-section__title { display: flex; align-items: center; gap: 10px; font-size: 1.0625rem; margin: 0 0 4px; }
.auth-section__title .icon { color: var(--c-primary-text); }
.auth-section__lead { color: var(--c-text-muted); font-size: var(--fs-sm); margin: 0 0 14px; }
.auth-section .field:last-of-type { margin-bottom: 16px; }
/* Wersja 2.8: „Nie pamiętasz hasła?”, „Wróć do logowania” (strony logowania i resetu hasła). */
.auth-section__extra { margin: 12px 0 0; font-size: var(--fs-sm); color: var(--c-text-muted); }
.auth-back { margin: 16px 0 0; text-align: center; }
.auth-link { display: inline-flex; align-items: center; gap: 6px; color: var(--c-primary-text); font-weight: 600;
  font-size: var(--fs-sm); text-decoration: underline; text-underline-offset: 2px; }
.auth-link:hover { text-decoration-thickness: 2px; }
@media (max-width: 767px), (pointer: coarse) {
  .auth-link { min-height: 44px; }
}
.input--code {
  font-family: var(--font-mono);
  font-size: 2.125rem;
  font-weight: 700;
  letter-spacing: .5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  min-height: 72px;
  padding-left: .5em;       /* wyrównanie wizualne przy letter-spacing */
  border-radius: 12px;
}
.input--code::placeholder { color: #c3c9d4; letter-spacing: .5em; }
@media (min-width: 900px) {
  .auth-brand { padding-top: 16px; }
  .auth-main { padding: 16px 32px 48px; }
}

/* Wersja 2.5 (PLAN.md pkt 39.5 i 41): panel informacyjny po lewej + formularz po prawej.
   Telefon / wąski ekran: panel = pas Navy ze znakiem nad formularzem (tekst ukryty — pole kodu bez
   przewijania). Znak: pełny z podpisem na ciemne tło, min. 300 px; < 360 px — znak bez podpisu. */
.auth-panel { background: var(--c-sidebar); color: var(--c-sidebar-text); }
.auth-panel__inner { display: flex; flex-direction: column; align-items: center; padding: 6px 16px; }
.auth-panel__heading { margin: 0; line-height: 0; }
.auth-panel__logo { display: block; width: 300px; max-width: 100%; height: auto; }
.auth-panel__about { display: none; }
.auth-card__venue {
  display: flex; align-items: center; gap: 6px; margin: 0 0 2px; min-width: 0;
  font-size: var(--fs-sm); font-weight: 650; color: var(--c-text-muted);
}
.auth-card__venue span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-card__venue .icon { flex: 0 0 auto; color: var(--c-primary-text); }
.auth-page--split .auth-main { padding-top: 16px; }
.auth-page--split .auth-card__title { margin-top: 0; }
@media (max-width: 359px) {
  .auth-panel__logo { width: 180px; min-width: 120px; }   /* znak bez podpisu (<picture>) */
}
@media (min-width: 900px) {
  .auth-page--split { flex-direction: row; }
  .auth-panel {
    flex: 0 0 clamp(400px, 44vw, 600px); display: flex; align-items: center;
    min-height: 100vh; min-height: 100dvh;
  }
  .auth-panel__inner { align-items: flex-start; width: 100%; max-width: 520px; margin: 0 auto;
    padding: 48px clamp(32px, 4vw, 56px); }
  .auth-panel__logo { width: clamp(300px, 26vw, 380px); margin-left: -2px; }
  .auth-panel__about { display: block; margin-top: 8px; }
  .auth-panel__lead { margin: 0 0 24px; font-size: 1.125rem; line-height: 1.5; font-weight: 500;
    color: var(--c-sidebar-text-strong); max-width: 32em; }
  .auth-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
  .auth-features__item { display: flex; align-items: flex-start; gap: 14px; font-size: .9375rem; line-height: 1.5; }
  .auth-features__icon {
    flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--c-sidebar-2); color: var(--c-sidebar-accent);
  }
  .auth-features__text strong { color: var(--c-sidebar-text-strong); font-weight: 650; }
  .auth-page--split .auth-main { flex: 1 1 auto; align-items: center; padding: 40px 32px; }
}

/* Strony błędów (403, 404) i „W budowie” */
.status-page { max-width: 560px; margin: 4vh auto 0; text-align: center; }
.status-page__code { font-size: 4.5rem; font-weight: 800; letter-spacing: -.04em; line-height: 1;
  color: var(--c-primary-text); margin: 0 0 12px; }
/* Symbol marki nad komunikatem (PLAN.md pkt 35) — dyskretnie, 56 px */
.status-page__symbol { display: block; width: 56px; height: auto; margin: 0 auto 8px; }
.status-page__icon { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; background: var(--c-primary-soft); color: var(--c-primary-text); }
.status-page__icon .icon { width: 30px; height: 30px; }
.status-page h1 { margin-bottom: 8px; }
.status-page p { color: var(--c-text-muted); }
.status-page .btn-group { justify-content: center; margin-top: 20px; }

/* ---------- 15. Ruch ------------------------------------------------------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes feed-in { from { background: var(--c-primary-soft); } to { background: transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  a.card:hover, .card--link:hover, .btn:active { transform: none; }
}

/* ---------- 16. Druk ------------------------------------------------------- */

@media print {
  /* nawigacja nie trafia na papier: rama aplikacji, okruszki, zakładki i przełączniki widoku
     (wersja 2.7, U-24: .breadcrumbs, .tabs, .subnav, .segmented) */
  .site-header, .sidebar, .topbar, .bottomnav, .subnav-bar, .skip-link, .site-footer,
  .breadcrumbs, .tabs, .subnav, .segmented,
  .btn, .form-actions, .no-print { display: none !important; }
  /* wskazówka przewijania (6a) tylko na ekranie; na papierze tabela bez zaniku i bez przewijania */
  .is-scrollable { -webkit-mask-image: none !important; mask-image: none !important; }
  .app--nav .app-main { margin-left: 0 !important; padding-bottom: 0 !important; }
  html, body { background: #fff !important; }
  .container { max-width: none; padding: 0; }
  .card, .table-wrap, .list, .stat, .filter-bar { box-shadow: none !important; border-color: #999; }
  .table thead th { background: #fff; color: #000; }
  .table tbody tr:hover { background: transparent; }
  a.card { transform: none; }
  /* wspólny nagłówek wydruku: znak 28 mm (minimum pakietu), tekst obok — jedna zwarta linia */
  .print-header { gap: 4mm; margin: 0 0 3mm; color: #000; }
  .print-header__logo { width: 28mm; }
  .print-header__title { font-size: 12pt; }
  .print-header__meta { font-size: 9pt; color: #000; }
}

/* ---------- 17. Stan urządzenia: symbol i legenda (wersja 2.13, Etapy 57 i 59) -------
   Na listach i w tabelach urządzeń stan = sam symbol (core/_device_dot.html): nazwa stanu w title i .sr-only,
   pod listą jedna linijka legendy (core/_device_legend.html).
   Decyzja właściciela (U-61): KSZTAŁT rozróżnia stan także bez koloru — Sprawne: zielone KÓŁKO (--c-ok),
   W serwisie: żółty TRÓJKĄT (--c-surplus), Niesprawne: czerwony KWADRAT (--c-shortage).
   Symbole rysuje sama RAMKA (border) elementu o zerowym wnętrzu — ramka drukuje się zawsze (także bez „grafiki
   tła” i na drukarce czarno-białej), jest ostra przy każdym powiększeniu i nie zależy od SVG ani obrazków.
   Wspólne „gniazdo” 14 × 14 px (symbol wyśrodkowany marginesem): kółko Ø 12, kwadrat 11 × 11, trójkąt 14 × 12 —
   zbliżona wielkość optyczna. Klasy dev-dot* zostają jako nazwy techniczne (szablony aplikacji bez zmian). */
.dev-dot {
  position: relative;            /* zawiera .sr-only (nie ucieka z przewijanej tabeli) */
  display: inline-block; flex: 0 0 auto; box-sizing: content-box;
  width: 0; height: 0; margin: 1px; vertical-align: middle;
  border: 6px solid var(--c-text-muted); border-radius: 50%;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
/* Sprawne — kółko */
.dev-dot--ok { border-color: var(--c-ok); }
/* W serwisie — trójkąt (wierzchołkiem do góry): podstawa 14 px, wysokość 12 px */
.dev-dot--service {
  border-radius: 0; margin: 1px 0;
  border-width: 0 7px 12px 7px; border-color: transparent transparent var(--c-surplus) transparent;
}
/* Niesprawne — kwadrat 11 × 11 px (wnętrze 1 px + ramka 5 px — całe piksele, ostre krawędzie) */
.dev-dot--faulty { width: 1px; height: 1px; border-radius: 0; border-width: 5px; margin: 1.5px;
  border-color: var(--c-shortage); background: var(--c-shortage); }
/* symbol z widocznym podpisem (legenda) */
.dev-dot-label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
/* legenda: jedna cienka linijka drobnym drukiem; na wąskim ekranie zawija się całymi pozycjami */
.dev-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px;
  margin: var(--space-2) 0 0; font-size: var(--fs-xs); line-height: 1.5; color: var(--c-text-muted);
}
.dev-legend__title { font-weight: 600; }
@media print {
  /* te same kształty co na ekranie (ramka drukuje się zawsze); na papierze czarno-białym różni je sam kształt */
  .dev-legend { margin-top: 2mm; font-size: 8pt; color: #000; }
}
