/* CSS custom properties ("CSS variables") live here. `--name: value;` inside a selector declares
   one; `var(--name)` anywhere else reads it. Declared on :root (the <html> element), every rule
   in this file can read them - that's the entire reason a color only needs to change in ONE
   place here to affect every button/cell/badge that uses it.
   The admin-editable colors below (--color-status-*) go one step further: StatusColorState.cs
   overrides them at RUNTIME via JavaScript - `document.documentElement.style.setProperty(...)`
   sets an INLINE style on <html>, and an inline style always wins over a plain stylesheet rule
   like this one (higher specificity), so the browser instantly repaints with the new value with
   no page reload and no Blazor re-render. See StatusColorState.cs's class comment for the full
   walkthrough of that mechanism. */
:root {
    /* Shared/TopBar.razor's height - also read by MainLayout.razor.css (sidebar/page offset) and
       the .cw-banners sticky rule below, so it only needs to change in one place. */
    /* ui-shell-theme-nav: follows the new top bar (--cw-topbar-height, 64px). */
    --topbar-height: var(--cw-topbar-height);

    /* calendar-redesign: kolory dnia (dziś, święto, weekend, poniżej normy, statusy Jiry) ustawia motyw - tokeny --cw-day-* i --cw-jira-*
       (grupa „Kalendarz” w Panel admina > Kolory i motywy). Tu tylko pochodne, liczone z nich: ramki i tła, których edytor nie ma jako osobnych pól,
       żeby Kalendarz, Nieobecności, pasek dnia w Rejestracji i Dashboard miały ten sam wygląd. Kolory widżetów Dashboardu zostają w Kolory (niżej). */
    --cw-day-holiday-border: color-mix(in srgb, var(--cw-day-holiday-bg) 60%, var(--cw-day-holiday-text));
    --cw-day-weekend-border: var(--cw-border-strong);
    --cw-day-today-bg: color-mix(in srgb, var(--cw-day-today) 14%, var(--cw-surface));
    --cw-day-under-bg: color-mix(in srgb, var(--cw-day-under) 22%, var(--cw-surface));

    /* Dashboard widgets (donut ring / hours progress bar) - only *-border is read, no background
       (see StatusColorSeeder's WidgetNormal/WidgetWarning/WidgetDanger comment). Static defaults
       here match today's literal the brand accent, the orange and the danger color, so
       this becomes admin-configurable with zero visual change until the site owner edits it. */
    --color-status-widget-normal-border: #2563eb;
    --color-status-widget-warning-border: #f97316;
    --color-status-widget-danger-border: #dc2626;
    /* Przysługuje (outer ring/track border) and Zostało (unfilled track/progress-bar track) - the
       other two legend labels next to Wykorzystano above, also admin-configurable. */
    --color-status-widget-total-border: #94a3b8;
    --color-status-widget-remaining-border: #e2e8f0;

    /* Inline code (the <code> rule): a magenta that reads on the light sheet; Noc swaps it for a lighter one. */
    --cw-code: #c02d76;

}

/* ==========================================================================================
   e-ClockWork design system — warstwa tokenów --cw-* (visual-design-system, 2026-10-16).
   Źródło prawdy: context/foundation/design-system.md (+ makiety context/changes/visual-design-system/mockups,
   themes.css ma te same wartości kolorów). Stare tokeny --color-* (poza --color-status-*) / --radius-* / --shadow-* / --font-sans
   zostały usunięte w fazie 17 migracji (design-system.md → Migration Plan); wszystko czyta --cw-*. Brak
   data-theme na <html> = motyw domyślny.
   Motyw: atrybut data-theme na <html> (morski | blekit | las | noc | mosiadz | granat); brak = morski (domyślny; 18.10 przez dwa dni był nim blekit, od 19.10 znów morski).
   --color-status-* (StatusColorState, edytowalne przez admina) NIE są częścią motywów.
   ========================================================================================== */

/* Inter (SIL OFL 1.1, fonts/inter/OFL.txt) — self-host, zmienna oś wagi 100–900, latin + latin-ext (polskie znaki).
   @font-face nic nie pobiera, dopóki żaden element nie użyje font-family z Inter. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/inter-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/inter-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokeny niezależne od motywu */
:root {
    /* Typografia — px celowo: html ma dziś font-size 93.75% (stare ekrany); usunięcie tego to ostatnia faza migracji. */
    --cw-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --cw-letter-spacing: -0.005em;
    --cw-letter-spacing-tight: -0.03em;    /* nagłówki ≥ 22px */
    --cw-leading-body: 1.5;
    --cw-leading-tight: 1.2;
    --cw-text-2xs: 11px;   /* podpisy pod osią, wersja, drobne metki */
    --cw-text-xs: 12px;    /* komórki i nagłówki tabel, opisy kart, meta wierszy, etykiety sekcji */
    --cw-text-sm: 13px;    /* etykiety pól, podstrony menu, przyciski drugorzędne */
    --cw-text-md: 14px;    /* pola, przyciski, pozycje menu */
    --cw-text-lg: 15px;    /* tytuł karty, nagłówek panelu/dropdownu */
    --cw-text-xl: 18px;    /* tytuł modala, tytuł sekcji */
    --cw-text-2xl: 22px;   /* wartość liczbowa (czas stopera, kafel) */
    --cw-text-3xl: 26px;   /* tytuł strony (tylko strony ustawień) */
    --cw-text-4xl: 30px;   /* wiodąca liczba na Dashboardzie */
    --cw-text-display: 32px; /* AuthShell */
    --cw-weight-regular: 400;
    --cw-weight-medium: 500;
    --cw-weight-semibold: 600;
    --cw-weight-bold: 700;

    /* Tabele (decyzja użytkownika 2026-11-13): nagłówek każdej tabeli na mocniejszym tle niż wiersze i rozwinięcia,
       wiersz rozwinięcia (pozycje pod pozycją) w delikatnym odcieniu akcentu - nie w kolorze nagłówka ani zaznaczenia (--cw-primary-tint).
       Liczone z tokenów motywu, więc działają w każdym motywie. */
    --cw-table-head: var(--cw-surface-3);
    --cw-row-expand: color-mix(in srgb, var(--cw-primary) 7%, var(--cw-surface));

    /* Odstępy — siatka 4 px */
    --cw-space-0-5: 2px;
    --cw-space-1: 4px;
    --cw-space-1-5: 6px;
    --cw-space-2: 8px;
    --cw-space-2-5: 10px;
    --cw-space-3: 12px;
    --cw-space-4: 16px;
    --cw-space-5: 20px;
    --cw-space-6: 24px;
    --cw-space-7: 28px;
    --cw-space-8: 32px;
    --cw-space-10: 40px;

    /* Kształt — jedna rodzina zaokrągleń (zastępuje „ostre krawędzie” --radius-*: 0) */
    --cw-radius-xs: 3px;     /* paski wykresów, drobne znaczniki */
    --cw-radius-sm: 6px;     /* małe przyciski ikonowe, pola w tabelach */
    --cw-radius-md: 8px;     /* przyciski, pola formularzy, ikony-chipy */
    --cw-radius-lg: 10px;    /* wiersze menu (zakładka aktywnej pozycji), przyciski 42px+ */
    --cw-radius-xl: 12px;    /* dropdowny, popovery, karta stopera */
    --cw-radius-card: 14px;  /* karty, modale */
    --cw-radius-sheet: 18px; /* lewy górny róg arkusza treści przy menu */
    --cw-radius-pill: 999px; /* pigułki, kółka (medaliony osi, avatar, przyciski Start/Stop) */

    /* Cienie (poza motywem: --cw-shadow i --cw-glow są per motyw) */
    --cw-shadow-popover: 0 14px 36px rgba(0, 0, 0, 0.22);
    --cw-shadow-floating: 0 16px 40px rgba(10, 20, 40, 0.32);
    --cw-shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.30);
    --cw-backdrop: rgba(10, 20, 40, 0.45);

    /* Warstwy — zgodne ze skalą Bootstrapa 5, żeby nie walczyć z jego dropdownami/modalami */
    --cw-z-raised: 1;
    --cw-z-dropdown: 1000;
    --cw-z-sticky: 1020;
    --cw-z-floating: 1030;    /* stoper pływający */
    --cw-z-popover-backdrop: 1040; /* przezroczyste tło zamykające panel daty / listę projektów (nad stoperem) */
    --cw-z-popover: 1050;     /* panel daty, lista projektów */
    --cw-z-backdrop: 1050;
    --cw-z-modal: 1055;
    --cw-check-size: 18px;   /* pole wyboru / radio: jeden rozmiar w całej aplikacji */
    --cw-z-toast: 1090;

    /* Ruch */
    --cw-duration-fast: 150ms;   /* hover/kolor */
    --cw-duration-base: 180ms;   /* stan węzła osi, zwijanie */
    --cw-duration-slow: 250ms;   /* szerokość menu (transform/flex-basis) */
    --cw-ease: cubic-bezier(0.2, 0, 0, 1);

    /* Wymiary układu */
    --cw-topbar-height: 64px;
    --cw-rail-width: 264px;
    --cw-rail-width-collapsed: 72px;
    --cw-rail-axis-x: 36px;      /* środek osi czasu od lewej krawędzi menu */
    --cw-node-size: 32px;        /* medalion pozycji głównej */
    --cw-node-sub: 7px;          /* kropka podstrony */
    --cw-node-sub-active: 12px;
    --cw-target-min: 44px;       /* minimalny cel dotyku */

    /* Kolory marki — stałe, poza motywami (design-decisions.md → „Kolory marki stałe”, 17.10; od 19.10 znów Morski turkus, po krótkim
       epizodzie z Błękitem i mosiądzem 18.10). Na ciemnym tle biel + bursztyn, na jasnym turkus + ciemny bursztyn; ósmy kafel
       logo zawsze bursztyn. Tło ekranów przed logowaniem: ink → bg-2. */
    --cw-brand-teal: #0e7c86;
    --cw-brand-amber: #f2b84b;
    --cw-brand-amber-dark: #b5790f;
    --cw-brand-ink: #07343a;
    --cw-brand-bg-2: #0c4a52;
    --cw-brand-backdrop: linear-gradient(160deg, var(--cw-brand-ink), var(--cw-brand-bg-2));
    /* Podświetlenie elementu pod kursorem: przyciski i ikony akcji. Wyraźniejsze niż --cw-hover (podświetlenie wiersza tabeli),
       żeby ikona w wierszu było widać na tle podświetlonego wiersza. Liczone z koloru motywu, więc działa w każdym motywie. */
    --cw-hover-strong: color-mix(in srgb, var(--cw-primary-mid) 24%, var(--cw-surface));
    /* White on the brand backdrop (text, logo, dial) - fixed like the backdrop itself. */
    --cw-brand-white: #ffffff;
    /* Text and rules on the fixed white card of the legal pages (never the theme, as the card itself). */
    --cw-brand-text: #30484c;
    --cw-brand-text-2: #4f6669;
    --cw-brand-rule: #dbe5e6;
}

/* Motywy — kolory. Nazwy 1:1 z makietami (bez prefiksu tam, z --cw- tutaj).
   Zasady użycia (design-system.md → Color Palette): tekst w kolorze marki = --cw-primary-strong (nie --cw-primary);
   --cw-muted i --cw-border-strong tylko dla ikon/dekoracji (< 4.5:1 na tle); obrys pól = --cw-input (≥ 3:1);
   tekst w akcencie na ciemnym menu tylko na --cw-rail-1 / --cw-rail-2. */
/* Morski turkus — motyw domyślny i schemat przewodni marki (od 19.10; wcześniej do 18.10); kolory logo 163/164 */
:root,
:root[data-theme="morski"] {
    --cw-bg: #eef6f7;
    --cw-surface: #ffffff;
    --cw-surface-2: #f3f9fa;
    --cw-surface-3: #dcecee;
    --cw-hover: #edf6f7;
    --cw-border: #cfe2e4;
    --cw-border-soft: #e1edee;
    --cw-border-strong: #b6d0d3;
    --cw-input: #6d868a;
    --cw-text: #071f22;
    --cw-text-2: #1c3d41;
    --cw-text-3: #3a5a5e;
    --cw-muted: #6f858a;
    --cw-primary: #23808a;
    --cw-primary-strong: #1d6b74;
    --cw-primary-tint: #dff1f2;
    --cw-primary-soft: #a9d9dd;
    --cw-primary-mid: #4fa3ac;
    --cw-cta: #f2b84b;
    --cw-on-cta: #07343a;
    --cw-on-primary: #ffffff;
    --cw-sea: #2a9fd6;
    --cw-sea-strong: #1b6f99;
    --cw-sea-tint: #dff1fa;
    --cw-sea-soft: #a9d8ef;
    --cw-sea-mid: #63bde6;
    --cw-earth: #c98a1b;
    --cw-earth-strong: #8a5c0e;
    --cw-earth-tint: #fbf0d9;
    --cw-earth-soft: #f2d79a;
    --cw-rail-1: #0c4a52;
    --cw-rail-2: #0f565f;
    --cw-rail-3: #12616b;
    --cw-rail-text: #cde7ea;
    --cw-rail-strong: #ffffff;
    --cw-rail-muted: #9cc7cc;
    --cw-rail-hover: rgba(255,255,255,0.07);
    --cw-rail-card: #ffffff;
    --cw-rail-chip: rgba(255,255,255,0.10);
    --cw-danger: #c63d3d;
    --cw-danger-tint: #fdeeee;
    --cw-danger-strong: #a82e2e;
    --cw-warn: #d99a16;
    --cw-warn-tint: #fdf3dc;
    --cw-warn-strong: #8a5400;
    --cw-warnbox: #fdf6e6;
    --cw-warnbox-text: #6b4a00;
    --cw-ok: #1f7a4a;
    --cw-ok-tint: #e8f5ee;
    /* Paski komunikatów (NotificationBanner) - edytowalne w „Kolory i motywy” (poprawki-po-visual-design-system). */
    --cw-notice-ok-bg: #b3e2c3;
    --cw-notice-ok-text: #0f4a28;
    --cw-notice-info-bg: #c0d6f0;
    --cw-notice-info-text: #1a365d;
    --cw-notice-warn-bg: #f6d27f;
    --cw-notice-warn-text: #5c3800;
    --cw-notice-err-bg: #f4bfbf;
    --cw-notice-err-text: #7f1d1d;
    --cw-shadow: 0 1px 2px rgba(7,52,58,0.06);
    --cw-glow: 0 4px 14px rgba(242,184,75,0.45);
    --cw-accent: #ffd27a;

    /* Kalendarz (calendar-redesign): kolory dnia - edytowalne w Panelu admina > Kolory i motywy; ramki i tła pochodne liczy CSS (color-mix) */
    --cw-day-today: #23808a;
    --cw-day-holiday-bg: #fdeeee;
    --cw-day-holiday-text: #a82e2e;
    --cw-day-weekend-bg: #e9edf2;
    --cw-day-under: #c2410c;
    --cw-jira-none: #6f858a;
    --cw-jira-not-synced: #c63d3d;
    --cw-jira-synced: #1f7a4a;
    --cw-jira-changed: #b8770f;
}

/* Błękit i mosiądz — do wyboru w menu motywów (18.10 był domyślny i schematem przewodnim marki) */
:root[data-theme="blekit"] {
    --cw-bg: #f3f7fb;
    --cw-surface: #ffffff;
    --cw-surface-2: #f5f9fd;
    --cw-surface-3: #e8f0f8;
    --cw-hover: #f2f7fc;
    --cw-border: #dbe5ef;
    --cw-border-soft: #e8eef5;
    --cw-border-strong: #c5d3e2;
    --cw-input: #7a8ba1;
    --cw-text: #0f1f33;
    --cw-text-2: #2c3e55;
    --cw-text-3: #4f6178;
    --cw-muted: #7d8ca0;
    --cw-primary: #1d4f91;
    --cw-primary-strong: #163d70;
    --cw-primary-tint: #e3eefa;
    --cw-primary-soft: #b5cdea;
    --cw-primary-mid: #5a8bc9;
    --cw-cta: #b08d57;
    --cw-on-cta: #0f1f33;
    --cw-on-primary: #ffffff;
    --cw-sea: #2a9fd6;
    --cw-sea-strong: #1b6f99;
    --cw-sea-tint: #dff1fa;
    --cw-sea-soft: #a9d8ef;
    --cw-sea-mid: #63bde6;
    --cw-earth: #b08d57;
    --cw-earth-strong: #7a5f33;
    --cw-earth-tint: #f5eedf;
    --cw-earth-soft: #e2cfa9;
    --cw-rail-1: #0f2a4d;
    --cw-rail-2: #123461;
    --cw-rail-3: #163f73;
    --cw-rail-text: #c3d4ea;
    --cw-rail-strong: #ffffff;
    --cw-rail-muted: #9fb5d3;
    --cw-rail-hover: rgba(255,255,255,0.07);
    --cw-rail-card: #ffffff;
    --cw-rail-chip: rgba(255,255,255,0.09);
    --cw-danger: #c63d3d;
    --cw-danger-tint: #fdeeee;
    --cw-danger-strong: #a82e2e;
    --cw-warn: #d99a16;
    --cw-warn-tint: #fdf3dc;
    --cw-warn-strong: #8a5400;
    --cw-warnbox: #fdf6e6;
    --cw-warnbox-text: #6b4a00;
    --cw-ok: #1f7a4a;
    --cw-ok-tint: #e8f5ee;
    /* Paski komunikatów (NotificationBanner) - edytowalne w „Kolory i motywy” (poprawki-po-visual-design-system). */
    --cw-notice-ok-bg: #b3e2c3;
    --cw-notice-ok-text: #0f4a28;
    --cw-notice-info-bg: #c0d6f0;
    --cw-notice-info-text: #1a365d;
    --cw-notice-warn-bg: #f6d27f;
    --cw-notice-warn-text: #5c3800;
    --cw-notice-err-bg: #f4bfbf;
    --cw-notice-err-text: #7f1d1d;
    --cw-shadow: 0 1px 2px rgba(15,31,51,0.05);
    --cw-glow: 0 4px 14px rgba(176,141,87,0.40);
    --cw-accent: #d4b07a;

    /* Kalendarz (calendar-redesign): kolory dnia - edytowalne w Panelu admina > Kolory i motywy; ramki i tła pochodne liczy CSS (color-mix) */
    --cw-day-today: #1d4f91;
    --cw-day-holiday-bg: #fdeeee;
    --cw-day-holiday-text: #a82e2e;
    --cw-day-weekend-bg: #e9edf2;
    --cw-day-under: #c2410c;
    --cw-jira-none: #6f858a;
    --cw-jira-not-synced: #c63d3d;
    --cw-jira-synced: #1f7a4a;
    --cw-jira-changed: #b8770f;
}

/* Las */
:root[data-theme="las"] {
    --cw-bg: #f2f5ef;
    --cw-surface: #ffffff;
    --cw-surface-2: #f4f7f1;
    --cw-surface-3: #e9f0e6;
    --cw-hover: #f6f9f4;
    --cw-border: #dde5d8;
    --cw-border-soft: #e9efe5;
    --cw-border-strong: #c9d5c3;
    --cw-input: #7d8a7e;
    --cw-text: #15241b;
    --cw-text-2: #324238;
    --cw-text-3: #4b5c51;
    --cw-muted: #74837a;
    --cw-primary: #1e7a4c;
    --cw-primary-strong: #135c37;
    --cw-primary-tint: #dcefe2;
    --cw-primary-soft: #a8d3b7;
    --cw-primary-mid: #5fa57d;
    --cw-cta: #1e7a4c;
    --cw-on-cta: #ffffff;
    --cw-on-primary: #ffffff;
    --cw-sea: #1f78b4;
    --cw-sea-strong: #165d8c;
    --cw-sea-tint: #ddebf5;
    --cw-sea-soft: #b7d4ea;
    --cw-sea-mid: #6aa8d6;
    --cw-earth: #b5562a;
    --cw-earth-strong: #9a4a20;
    --cw-earth-tint: #f5e3d7;
    --cw-earth-soft: #e7b99d;
    --cw-rail-1: #17402c;
    --cw-rail-2: #1b4b33;
    --cw-rail-3: #1e5539;
    --cw-rail-text: #cfe3d5;
    --cw-rail-strong: #ffffff;
    --cw-rail-muted: #a9c6b3;
    --cw-rail-hover: rgba(255,255,255,0.08);
    --cw-rail-card: #ffffff;
    --cw-rail-chip: rgba(255,255,255,0.10);
    --cw-danger: #c23b3b;
    --cw-danger-tint: #fdeeee;
    --cw-danger-strong: #a82e2e;
    --cw-warn: #d99a16;
    --cw-warn-tint: #fdf3dc;
    --cw-warn-strong: #8a5400;
    --cw-warnbox: #fdf6e6;
    --cw-warnbox-text: #6b4a00;
    --cw-ok: #1f7a4a;
    --cw-ok-tint: #e8f5ee;
    /* Paski komunikatów (NotificationBanner) - edytowalne w „Kolory i motywy” (poprawki-po-visual-design-system). */
    --cw-notice-ok-bg: #b3e2c3;
    --cw-notice-ok-text: #0f4a28;
    --cw-notice-info-bg: #c0d6f0;
    --cw-notice-info-text: #1a365d;
    --cw-notice-warn-bg: #f6d27f;
    --cw-notice-warn-text: #5c3800;
    --cw-notice-err-bg: #f4bfbf;
    --cw-notice-err-text: #7f1d1d;
    --cw-shadow: 0 1px 2px rgba(20,40,28,0.05);
    --cw-glow: 0 4px 14px rgba(30,122,76,0.30);
    --cw-accent: #8fd1a8;

    /* Kalendarz (calendar-redesign): kolory dnia - edytowalne w Panelu admina > Kolory i motywy; ramki i tła pochodne liczy CSS (color-mix) */
    --cw-day-today: #1e7a4c;
    --cw-day-holiday-bg: #fdeeee;
    --cw-day-holiday-text: #a82e2e;
    --cw-day-weekend-bg: #e9edf2;
    --cw-day-under: #c2410c;
    --cw-jira-none: #6f858a;
    --cw-jira-not-synced: #c63d3d;
    --cw-jira-synced: #1f7a4a;
    --cw-jira-changed: #b8770f;
}

/* Noc */
:root[data-theme="noc"] {
    --cw-bg: #0b0f19;
    --cw-surface: #151c2f;
    --cw-surface-2: #1a2238;
    --cw-surface-3: #212b45;
    --cw-hover: #1c2540;
    --cw-border: #26304a;
    --cw-border-soft: #1f2840;
    --cw-border-strong: #334160;
    --cw-input: #64748b;
    --cw-text: #f1f5f9;
    --cw-text-2: #cbd5e1;
    --cw-text-3: #94a3b8;
    --cw-muted: #7c8ba3;
    --cw-primary: #3b82f6;
    --cw-primary-strong: #93c5fd;
    --cw-primary-tint: rgba(59,130,246,0.16);
    --cw-primary-soft: #1e3a8a;
    --cw-primary-mid: #60a5fa;
    --cw-cta: #2563eb;
    --cw-on-cta: #ffffff;
    --cw-on-primary: #0b0f19;
    --cw-sea: #10b981;
    --cw-sea-strong: #6ee7b7;
    --cw-sea-tint: rgba(16,185,129,0.15);
    --cw-sea-soft: #065f46;
    --cw-sea-mid: #34d399;
    --cw-earth: #fb923c;
    --cw-earth-strong: #fdba74;
    --cw-earth-tint: rgba(251,146,60,0.15);
    --cw-earth-soft: #7c2d12;
    --cw-rail-1: #111727;
    --cw-rail-2: #121a2c;
    --cw-rail-3: #131b2e;
    --cw-rail-text: #94a3b8;
    --cw-rail-strong: #f1f5f9;
    --cw-rail-muted: #8a97ad;
    --cw-rail-hover: rgba(255,255,255,0.05);
    --cw-rail-card: #1a2238;
    --cw-rail-chip: rgba(255,255,255,0.06);
    --cw-danger: #f87171;
    --cw-danger-tint: rgba(248,113,113,0.14);
    --cw-danger-strong: #fca5a5;
    --cw-warn: #fbbf24;
    --cw-warn-tint: rgba(251,191,36,0.14);
    --cw-warn-strong: #fcd34d;
    --cw-warnbox: rgba(251,191,36,0.10);
    --cw-warnbox-text: #fcd34d;
    --cw-ok: #10b981;
    --cw-ok-tint: rgba(16,185,129,0.14);
    /* Paski komunikatów (NotificationBanner) - edytowalne w „Kolory i motywy” (poprawki-po-visual-design-system). */
    --cw-notice-ok-bg: #123d2a;
    --cw-notice-ok-text: #a7f3c7;
    --cw-notice-info-bg: #16305a;
    --cw-notice-info-text: #bfdbfe;
    --cw-notice-warn-bg: #4a3410;
    --cw-notice-warn-text: #fde68a;
    --cw-notice-err-bg: #4c1d1d;
    --cw-notice-err-text: #fecaca;
    --cw-shadow: 0 1px 2px rgba(0,0,0,0.3);
    --cw-glow: 0 0 24px rgba(59,130,246,0.45);
    --cw-accent: #10b981;

    /* Kalendarz (calendar-redesign): kolory dnia - edytowalne w Panelu admina > Kolory i motywy; ramki i tła pochodne liczy CSS (color-mix) */
    --cw-day-today: #3b82f6;
    --cw-day-holiday-bg: #3f1d26;
    --cw-day-holiday-text: #fca5a5;
    --cw-day-weekend-bg: #1a2238;
    --cw-day-under: #fb923c;
    --cw-jira-none: #7c8ba3;
    --cw-jira-not-synced: #f87171;
    --cw-jira-synced: #10b981;
    --cw-jira-changed: #fbbf24;
}

/* Mosiądz */
:root[data-theme="mosiadz"] {
    --cw-bg: #fcfbf9;
    --cw-surface: #ffffff;
    --cw-surface-2: #f7f5f1;
    --cw-surface-3: #f0ede7;
    --cw-hover: #f9f7f3;
    --cw-border: #e4e4e7;
    --cw-border-soft: #efeeec;
    --cw-border-strong: #d4d4d8;
    --cw-input: #8a8a93;
    --cw-text: #18181b;
    --cw-text-2: #3f3f46;
    --cw-text-3: #6e6e76;
    --cw-muted: #8f8f98;
    --cw-primary: #c5a880;
    --cw-primary-strong: #7d6236;
    --cw-primary-tint: #f4eee4;
    --cw-primary-soft: #e3d3bb;
    --cw-primary-mid: #d4be9e;
    --cw-cta: #18181b;
    --cw-on-cta: #fcfbf9;
    --cw-on-primary: #18181b;
    --cw-sea: #4f7a8c;
    --cw-sea-strong: #355866;
    --cw-sea-tint: #e7eff2;
    --cw-sea-soft: #bcd1da;
    --cw-sea-mid: #82a6b5;
    --cw-earth: #a0643e;
    --cw-earth-strong: #7e4c2d;
    --cw-earth-tint: #f3e6dc;
    --cw-earth-soft: #d9b79f;
    --cw-rail-1: #18181b;
    --cw-rail-2: #1c1c1f;
    --cw-rail-3: #202023;
    --cw-rail-text: #d4d4d8;
    --cw-rail-strong: #fcfbf9;
    --cw-rail-muted: #8f8f98;
    --cw-rail-hover: rgba(255,255,255,0.06);
    --cw-rail-card: #26262a;
    --cw-rail-chip: rgba(197,168,128,0.16);
    --cw-danger: #b4423a;
    --cw-danger-tint: #fbeeec;
    --cw-danger-strong: #92332c;
    --cw-warn: #c58b1c;
    --cw-warn-tint: #faf1de;
    --cw-warn-strong: #7a5410;
    --cw-warnbox: #faf4e6;
    --cw-warnbox-text: #6b4a00;
    --cw-ok: #36694a;
    --cw-ok-tint: #e9f3ec;
    /* Paski komunikatów (NotificationBanner) - edytowalne w „Kolory i motywy” (poprawki-po-visual-design-system). */
    --cw-notice-ok-bg: #b3e2c3;
    --cw-notice-ok-text: #0f4a28;
    --cw-notice-info-bg: #c0d6f0;
    --cw-notice-info-text: #1a365d;
    --cw-notice-warn-bg: #f6d27f;
    --cw-notice-warn-text: #5c3800;
    --cw-notice-err-bg: #f4bfbf;
    --cw-notice-err-text: #7f1d1d;
    --cw-shadow: 0 1px 2px rgba(24,24,27,0.05);
    --cw-glow: 0 4px 14px rgba(24,24,27,0.20);
    --cw-accent: #c5a880;

    /* Kalendarz (calendar-redesign): kolory dnia - edytowalne w Panelu admina > Kolory i motywy; ramki i tła pochodne liczy CSS (color-mix) */
    --cw-day-today: #8a6d3b;
    --cw-day-holiday-bg: #fdeeee;
    --cw-day-holiday-text: #a82e2e;
    --cw-day-weekend-bg: #e9edf2;
    --cw-day-under: #c2410c;
    --cw-jira-none: #6f858a;
    --cw-jira-not-synced: #c63d3d;
    --cw-jira-synced: #1f7a4a;
    --cw-jira-changed: #b8770f;
}

/* Granat i pomarańcz */
:root[data-theme="granat"] {
    --cw-bg: #f9fafb;
    --cw-surface: #ffffff;
    --cw-surface-2: #f3f6fb;
    --cw-surface-3: #eaf1fb;
    --cw-hover: #f5f8fd;
    --cw-border: #e5e7eb;
    --cw-border-soft: #eef0f3;
    --cw-border-strong: #d1d5db;
    --cw-input: #8a93a3;
    --cw-text: #111827;
    --cw-text-2: #374151;
    --cw-text-3: #5b6472;
    --cw-muted: #8a93a3;
    --cw-primary: #1e3a8a;
    --cw-primary-strong: #1e3a8a;
    --cw-primary-tint: #eaf1fb;
    --cw-primary-soft: #bfd3f2;
    --cw-primary-mid: #5b7fc9;
    --cw-cta: #f97316;
    --cw-on-cta: #111827;
    --cw-on-primary: #ffffff;
    --cw-sea: #10b981;
    --cw-sea-strong: #047857;
    --cw-sea-tint: #d1fae5;
    --cw-sea-soft: #a7f3d0;
    --cw-sea-mid: #34d399;
    --cw-earth: #f97316;
    --cw-earth-strong: #c2410c;
    --cw-earth-tint: #ffedd5;
    --cw-earth-soft: #fdba74;
    --cw-rail-1: #172554;
    --cw-rail-2: #1b2d66;
    --cw-rail-3: #1e3a8a;
    --cw-rail-text: #c7d6f5;
    --cw-rail-strong: #ffffff;
    --cw-rail-muted: #a3b5dc;
    --cw-rail-hover: rgba(255,255,255,0.08);
    --cw-rail-card: #ffffff;
    --cw-rail-chip: rgba(255,255,255,0.10);
    --cw-danger: #dc2626;
    --cw-danger-tint: #fdeeee;
    --cw-danger-strong: #b91c1c;
    --cw-warn: #d99a16;
    --cw-warn-tint: #fdf3dc;
    --cw-warn-strong: #8a5400;
    --cw-warnbox: #fff7e6;
    --cw-warnbox-text: #6b4a00;
    --cw-ok: #047857;
    --cw-ok-tint: #d1fae5;
    /* Paski komunikatów (NotificationBanner) - edytowalne w „Kolory i motywy” (poprawki-po-visual-design-system). */
    --cw-notice-ok-bg: #b3e2c3;
    --cw-notice-ok-text: #0f4a28;
    --cw-notice-info-bg: #c0d6f0;
    --cw-notice-info-text: #1a365d;
    --cw-notice-warn-bg: #f6d27f;
    --cw-notice-warn-text: #5c3800;
    --cw-notice-err-bg: #f4bfbf;
    --cw-notice-err-text: #7f1d1d;
    --cw-shadow: 0 1px 2px rgba(17,24,39,0.05);
    --cw-glow: 0 4px 14px rgba(249,115,22,0.35);
    --cw-accent: #f97316;

    /* Kalendarz (calendar-redesign): kolory dnia - edytowalne w Panelu admina > Kolory i motywy; ramki i tła pochodne liczy CSS (color-mix) */
    --cw-day-today: #1e3a8a;
    --cw-day-holiday-bg: #fdeeee;
    --cw-day-holiday-text: #a82e2e;
    --cw-day-weekend-bg: #e9edf2;
    --cw-day-under: #c2410c;
    --cw-jira-none: #6f858a;
    --cw-jira-not-synced: #c63d3d;
    --cw-jira-synced: #1f7a4a;
    --cw-jira-changed: #b8770f;
}

/* Focus — jeden styl dla całej aplikacji na nowych komponentach (F01/F27 z audytu) */
:root {
    --cw-focus-ring: 2px solid var(--cw-primary-strong);
    --cw-focus-ring-on-rail: 2px solid var(--cw-accent);
    --cw-focus-offset: 2px;
    --cw-link: var(--cw-primary-strong);
}

/* Arkusz treści i aktywna zakładka menu czytają tokeny motywu (faza 17 migracji; wcześniej przejściowo stare --color-bg / --color-text). */
:root {
    --cw-sheet-bg: var(--cw-bg);
    --cw-sheet-text: var(--cw-text);
}

/* Text on a red (danger) count badge: white everywhere except Noc, where the danger red is light. */
:root {
    --cw-on-danger: #ffffff;
}

:root[data-theme="noc"] {
    --cw-on-danger: #0b0f19;
}

/* Noc: ciemny arkusz w całej aplikacji dzięki tokenom --cw-*. Tu tylko to, co nie jest tokenem motywu: jaśniejszy kolor kodu. */
:root[data-theme="noc"] {
    --cw-code: #f9a8d4;
}

/* The rules that use the primary accent as a background: on Noc's light-blue text variant they would carry white text on
   light blue, so they take the solid primary with the on-primary text. (.btn-primary is no longer one of them: since
   ui-data-grid-and-tabs Faza 2 it looks like a secondary button.) */
:root[data-theme="noc"] .feedback-comment-admin {
    background-color: var(--cw-primary);
    border-color: var(--cw-primary);
    color: var(--cw-on-primary);
}

:root[data-theme="noc"] .feedback-unread-dot {
    background-color: var(--cw-primary);
}

/* Banners stick over scrolled content and Noc's tints are translucent - an opaque layer under the sticky banners. */
:root[data-theme="noc"] .cw-banners {
    background: var(--cw-surface);
}

/* ui-shell-theme-nav: one visible keyboard focus for the shell. :focus-visible, so a mouse click leaves no ring;
   on the dark menu and top bar the ring is the accent (those components set --cw-focus-ring-on-rail themselves). */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
/* tabindex="-1" is how Blazor's FocusOnNavigate parks the focus on the page heading (and MainLayout's h1/main targets):
   that is not a control, so it gets no ring. */
[tabindex]:not([tabindex="-1"]):focus-visible {
    outline: var(--cw-focus-ring);
    outline-offset: var(--cw-focus-offset);
}

/* No motion at all for users who ask for none - the shell's own transitions are already guarded where they are
   defined; this catches Bootstrap's and the leftovers. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    /* Normal text is never larger than a table cell (12 px, decided 18.10); headings, titles and figures set their own size. */
    --bs-body-font-size: var(--cw-text-xs);
    font-size: var(--cw-text-xs);
}

html, body {
    /* ui-shell-theme-nav: Inter (self-hosted, see the @font-face above) replaces the system stack. */
    font-family: var(--cw-font-sans);
    color: var(--cw-text);
    background-color: var(--cw-bg);
}

h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

h1:focus {
    outline: none;
}

/* Nagłówek strony (h1 w obszarze treści) - cichy, w stylu okruszków (decyzja 18.10): mały, przygaszony, nie rzuca się w oczy; pierwszy plan
   zajmuje treść ekranu. Strony prawne i przed logowaniem mają własne h1 (.legal-content h1, AuthShell). */
.content h1 {
    margin: 0 0 var(--cw-space-2);
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--cw-text-3);
}

/* Okruszki: „Czas pracy \ Rejestracja” (Shared/PageHeading) - sekcja i separator przygaszone, nazwa strony wyraźniejsza. */
.cw-crumb-sep {
    margin: 0 var(--cw-space-1-5);
    color: var(--cw-border-strong);
}

.cw-crumb-last {
    color: var(--cw-text-2);
}

a, .btn-link {
    color: var(--cw-primary-strong);
}

/* --- ui-data-grid-and-tabs (Faza 2): the legacy Bootstrap classes on the --cw-* tokens, so that every screen not yet
   migrated to cw-btn / cw-input looks like the standard (design-system.md -> Akcja główna i drugorzędna, Pole
   formularza, Karta, Kanały komunikatów, Stan regionu) without touching its markup. Same values as .cw-btn / .cw-input
   below, set through Bootstrap's own --bs-* variables: no !important, the variant classes keep their cascade.
   Decision of 17.10: btn-primary looks like a secondary button - the accent CTA is only .cw-btn--cta. --- */

.btn {
    --bs-btn-padding-x: var(--cw-space-4);
    --bs-btn-padding-y: 0;
    --bs-btn-font-size: var(--cw-text-xs);
    --bs-btn-font-weight: var(--cw-weight-semibold);
    --bs-btn-line-height: 1.2;
    --bs-btn-border-radius: var(--cw-radius-md);
    --bs-btn-disabled-opacity: 0.45;
    /* Every button gets the same height whatever its label (horizontal padding stays, so width follows the text). */
    height: 36px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--cw-space-2);
    transition: color var(--cw-duration-fast) var(--cw-ease), background-color var(--cw-duration-fast) var(--cw-ease), border-color var(--cw-duration-fast) var(--cw-ease);
}

.btn-sm {
    --bs-btn-padding-x: var(--cw-space-3);
    --bs-btn-font-size: var(--cw-text-xs);
    --bs-btn-border-radius: var(--cw-radius-sm);
    height: 32px;
}

/* A row action that is only an icon: a 32 x 32 square. */
td .btn-sm:has(> svg:only-child) {
    width: 32px;
    padding: 0;
}

/* Secondary look: surface, a strong outline, body text. */
.btn-primary,
.btn-secondary,
.btn-outline-primary,
.btn-outline-secondary {
    --bs-btn-color: var(--cw-text);
    --bs-btn-bg: var(--cw-surface);
    --bs-btn-border-color: var(--cw-border-strong);
    --bs-btn-hover-color: var(--cw-primary-strong);
    --bs-btn-hover-bg: var(--cw-hover-strong);
    --bs-btn-hover-border-color: var(--cw-primary-mid);
    --bs-btn-active-color: var(--cw-primary-strong);
    --bs-btn-active-bg: var(--cw-hover-strong);
    --bs-btn-active-border-color: var(--cw-primary-mid);
    --bs-btn-disabled-color: var(--cw-text);
    --bs-btn-disabled-bg: var(--cw-surface);
    --bs-btn-disabled-border-color: var(--cw-border-strong);
}

.btn-outline-danger {
    --bs-btn-color: var(--cw-danger-strong);
    --bs-btn-bg: var(--cw-danger-tint);
    --bs-btn-border-color: color-mix(in srgb, var(--cw-danger) 40%, transparent);
    --bs-btn-hover-color: var(--cw-on-danger);
    --bs-btn-hover-bg: var(--cw-danger);
    --bs-btn-hover-border-color: var(--cw-danger);
    --bs-btn-active-color: var(--cw-on-danger);
    --bs-btn-active-bg: var(--cw-danger-strong);
    --bs-btn-active-border-color: var(--cw-danger-strong);
    --bs-btn-disabled-color: var(--cw-danger-strong);
    --bs-btn-disabled-bg: var(--cw-danger-tint);
    --bs-btn-disabled-border-color: color-mix(in srgb, var(--cw-danger) 40%, transparent);
}

.btn-danger {
    --bs-btn-color: var(--cw-on-danger);
    --bs-btn-bg: var(--cw-danger);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--cw-on-danger);
    --bs-btn-hover-bg: var(--cw-danger-strong);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--cw-on-danger);
    --bs-btn-active-bg: var(--cw-danger-strong);
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-color: var(--cw-on-danger);
    --bs-btn-disabled-bg: var(--cw-danger);
    --bs-btn-disabled-border-color: transparent;
}

.btn-link {
    --bs-btn-color: var(--cw-link);
    --bs-btn-hover-color: var(--cw-link);
    --bs-btn-active-color: var(--cw-link);
    --bs-btn-disabled-color: var(--cw-link);
}

/* One keyboard focus for the whole app (the ring of the shell), instead of Bootstrap's blue glow. */
.btn:focus-visible,
.btn-check:focus-visible + .btn {
    outline: var(--cw-focus-ring);
    outline-offset: var(--cw-focus-offset);
    box-shadow: none;
}

.form-control,
.form-select {
    min-height: 36px;
    padding-top: 0.4375rem;
    padding-bottom: 0.4375rem;
    border: 1px solid var(--cw-input);
    border-radius: var(--cw-radius-md);
    background-color: var(--cw-surface);
    color: var(--cw-text);
    font-size: var(--cw-text-xs);
    /* background-image stays: it is the select's arrow. */
}

.form-control {
    font-size: var(--cw-text-xs);
    padding-left: var(--cw-space-3);
    padding-right: var(--cw-space-3);
}

.form-control-sm,
.form-select-sm {
    min-height: 32px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: var(--cw-text-xs);
    border-radius: var(--cw-radius-sm);
}

.form-control::placeholder {
    color: var(--cw-text-3);
}

.form-control:hover:not(:disabled):not([readonly]),
.form-select:hover:not(:disabled) {
    border-color: var(--cw-text-3);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--cw-surface);
    color: var(--cw-text);
    border-color: var(--cw-primary-strong);
    outline: var(--cw-focus-ring);
    outline-offset: 0;
    box-shadow: none;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background-color: var(--cw-surface-2);
    color: var(--cw-text-2);
}

/* UI-check 2026-11-01 (wzorzec „Pole formularza”): etykieta nad polem także przed wyborem daty. Liniowa etykieta Bootstrapa
   stawała obok PolishDatePicker (inline-block), gdy w kolumnie było miejsce - np. okno faktury, Edytor projektu. */
.form-label:has(+ .pl-date-picker) {
    display: block;
}

.form-label {
    margin-bottom: var(--cw-space-1-5);
    font-weight: var(--cw-weight-semibold);
    font-size: var(--cw-text-xs);
    color: var(--cw-text-2);
}

/* Jeden rozmiar pola wyboru i pola radio w całej aplikacji (--cw-check-size, 18 px = tekst pól 14 px + 4 px): wystarczająco duże, żeby
   łatwo w nie trafić. Dotyczy każdego input checkbox / radio, także tych bez klasy Bootstrapa (kolumny zaznaczania w tabelach, Uprawnienia,
   Kalendarz); wyjątek to radio w grupie przycisków (.btn-check - to ukryty element przycisku) i przełączniki (.form-switch). */
input[type="checkbox"]:not(.btn-check),
input[type="radio"]:not(.btn-check) {
    width: var(--cw-check-size);
    height: var(--cw-check-size);
    flex: none;
    accent-color: var(--cw-primary);
    vertical-align: middle;
}

.form-switch .form-check-input[type="checkbox"] {
    width: 2em;
}

.form-check-input {
    border-color: var(--cw-input);
    background-color: var(--cw-surface);
}

/* Pole wyboru z łapką na polu i na podpisie. */
.form-check:not(.form-switch) {
    padding-left: calc(var(--cw-check-size) + var(--cw-space-2));
    margin-bottom: var(--cw-space-3);
}

    .form-check:not(.form-switch) .form-check-input {
        margin-top: 1px;
        margin-left: calc(-1 * (var(--cw-check-size) + var(--cw-space-2)));
    }

.form-check-input,
.form-check-label,
.form-check-input:not(:disabled) ~ .form-check-label {
    cursor: pointer;
}

    .form-check-input:disabled,
    .form-check-input:disabled ~ .form-check-label {
        cursor: default;
    }

.form-check-input:checked,
.form-check-input[type="checkbox"]:indeterminate {
    background-color: var(--cw-primary);
    border-color: var(--cw-primary);
}

.form-check-input:focus {
    border-color: var(--cw-primary-strong);
    outline: var(--cw-focus-ring);
    outline-offset: 1px;
    box-shadow: none;
}

.form-text {
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

.invalid-feedback {
    font-size: var(--cw-text-xs);
    color: var(--cw-danger-strong);
}

.content {
    flex: 1 0 auto;
    padding-top: var(--cw-space-4);
    padding-bottom: 2rem;
    max-width: none;
}

/* --- Form components --cw-* (ui-auth-shell; design-system.md -> Pole formularza, Akcja główna i drugorzędna,
   Kanały komunikatów, Stan regionu). Global on purpose: a page's form markup is its own ChildContent and keeps
   that page's CSS-isolation scope (see AuthShell.razor's comment), and later screens reuse these classes (etap 7).
   Base sizes follow the inventory (field and button 40 px); --lg is the larger auth variant (44 / 46 px). --- */

.cw-field {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-1-5);
}

.cw-label {
    margin: 0;
    font-size: var(--cw-text-sm);
    font-weight: var(--cw-weight-bold);
    color: var(--cw-text);
}

.cw-input {
    display: block;
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    padding: 0 var(--cw-space-3);
    border: 1px solid var(--cw-input);
    border-radius: var(--cw-radius-md);
    background: var(--cw-surface);
    color: var(--cw-text);
    font: inherit;
    font-size: var(--cw-text-xs);
    transition: border-color var(--cw-duration-fast) var(--cw-ease);
}

    .cw-input:hover {
        border-color: var(--cw-text-3);
    }

    .cw-input:focus,
    .cw-input:focus-visible {
        outline: var(--cw-focus-ring);
        outline-offset: 0;
        border-color: var(--cw-primary-strong);
    }

    /* EditForm marks a field that failed validation with .invalid. */
    .cw-input.invalid {
        border-color: var(--cw-danger);
        background: var(--cw-danger-tint);
    }

.cw-input--lg {
    height: 44px;
    font-size: var(--cw-text-lg);
}

/* An input with a leading icon and, for passwords, a trailing "Pokaż/Ukryj" text button. */
.cw-input-wrap {
    position: relative;
}

    .cw-input-wrap .cw-input {
        padding-left: 40px;
    }

    .cw-input-wrap .cw-input-with-toggle {
        padding-right: 64px;
    }

.cw-input-icon {
    position: absolute;
    left: var(--cw-space-3);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: var(--cw-text-3);
    pointer-events: none;
}

.cw-input-toggle {
    position: absolute;
    right: var(--cw-space-1);
    top: 50%;
    transform: translateY(-50%);
    height: 36px;
    padding: 0 var(--cw-space-2);
    border: 0;
    border-radius: var(--cw-radius-sm);
    background: transparent;
    color: var(--cw-text-2);
    font: inherit;
    font-size: var(--cw-text-sm);
    font-weight: var(--cw-weight-semibold);
    cursor: pointer;
}

    .cw-input-toggle:hover {
        background: var(--cw-hover-strong);
        color: var(--cw-text);
    }

.cw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--cw-space-2);
    min-height: 40px;
    box-sizing: border-box;
    padding: var(--cw-space-1-5) var(--cw-space-4);
    text-align: center;
    line-height: 1.25;
    border: 1px solid var(--cw-border-strong);
    border-radius: var(--cw-radius-md);
    background: var(--cw-surface);
    color: var(--cw-text);
    font: inherit;
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--cw-duration-fast) var(--cw-ease), box-shadow var(--cw-duration-fast) var(--cw-ease);
}

    .cw-btn:hover {
        background: var(--cw-hover-strong);
        border-color: var(--cw-primary-mid);
    }

    .cw-btn:active:not(:disabled) {
        transform: translateY(1px);
    }

    .cw-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.cw-btn--cta {
    border-color: transparent;
    background: var(--cw-cta);
    color: var(--cw-on-cta);
    box-shadow: var(--cw-glow);
}

    .cw-btn--cta:hover:not(:disabled) {
        background: var(--cw-cta);
        filter: brightness(0.96);
    }

.cw-btn--danger {
    border-color: transparent;
    background: var(--cw-danger);
    color: var(--cw-on-danger);
}

    .cw-btn--danger:hover:not(:disabled) {
        background: var(--cw-danger-strong);
    }

/* Tertiary: text only, for an in-line action ("Wyślij ponownie"). */
.cw-btn--link {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cw-link);
}

    .cw-btn--link:hover:not(:disabled) {
        background: transparent;
        text-decoration: underline;
    }

.cw-btn--lg {
    min-height: 46px;
    border-radius: var(--cw-radius-lg);
    font-size: var(--cw-text-lg);
}

.cw-btn--block {
    width: 100%;
}

.cw-alert {
    margin: 0;
    padding: var(--cw-space-2-5) var(--cw-space-3);
    border-radius: var(--cw-radius-md);
    font-size: var(--cw-text-md);
    line-height: var(--cw-leading-body);
}

.cw-alert--err {
    background: var(--cw-danger-tint);
    color: var(--cw-danger-strong);
}

.cw-alert--ok {
    background: var(--cw-ok-tint);
    color: var(--cw-ok);
}

.cw-alert--info {
    background: var(--cw-primary-tint);
    color: var(--cw-primary-strong);
}

/* A native checkbox + its label, side by side; the box takes the theme color. */
.cw-check {
    display: flex;
    align-items: flex-start;
    gap: var(--cw-space-2);
    font-size: var(--cw-text-sm);
    font-weight: var(--cw-weight-medium);
    line-height: 1.4;
    color: var(--cw-text);
}

    .cw-check input {
        margin: 0;
    }

    .cw-check label {
        margin: 0;
    }

/* Loading: bars in the shape of the content (design-system.md -> Stan regionu); the text stays for screen readers. */
.cw-skeleton {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-2-5);
}

    .cw-skeleton span {
        display: block;
        height: 14px;
        border-radius: var(--cw-radius-pill);
        background: var(--cw-surface-3);
        animation: cw-skeleton-pulse 1.4s ease-in-out infinite;
    }

        .cw-skeleton span:first-child {
            width: 60%;
            height: 22px;
        }

        .cw-skeleton span:last-child {
            width: 80%;
        }

@keyframes cw-skeleton-pulse {
    50% {
        opacity: 0.55;
    }
}

/* --- Layout helpers inside AuthShell's panel (global for the same scope reason as above) --- */

/* Used both by AuthShell's own Subtitle parameter (AuthShell's scope) and inline by pages whose
   subtitle needs embedded markup a plain string parameter can't carry, e.g. AcceptInvitation's
   "Dołączasz do zespołu <strong>@Name</strong>" (that page's own scope) - global is the only
   stylesheet both can reach. */
.login-subtitle {
    margin: 0;
    font-size: var(--cw-text-md);
    font-weight: var(--cw-weight-medium);
    color: var(--cw-text-2);
}

    .login-subtitle strong {
        color: var(--cw-text);
    }

/* The form column: one gap between every field, row, alert and the button. */
.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-4);
}

.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--cw-space-2) var(--cw-space-4);
}

.login-forgot {
    font-size: var(--cw-text-sm);
    font-weight: var(--cw-weight-medium);
}

/* "Wyślij ponownie" under the "e-mail not confirmed" error. */
.login-resend {
    margin-top: var(--cw-space-2);
}

.login-switch {
    margin: 0;
    text-align: center;
    color: var(--cw-text-2);
    font-size: var(--cw-text-md);
}

    .login-switch a {
        font-weight: var(--cw-weight-semibold);
    }

.field-error {
    display: block;
    color: var(--cw-danger-strong);
    font-size: var(--cw-text-xs);
    margin-top: 0.25rem;
}

/* Marks a required field's <label> - appended after the label text, e.g.
   <label class="form-label">Nazwa<span class="required-marker">*</span></label>. */
.required-marker {
    color: var(--cw-danger-strong);
    margin-left: 0.2rem;
}

/* ui-data-grid-and-tabs (Faza 2): .alert-* look like .cw-alert--err / --ok / --warn / --info (tint, strong text, no
   outline), through Bootstrap's --bs-alert-* variables. */
.alert {
    --bs-alert-padding-x: var(--cw-space-3);
    --bs-alert-padding-y: var(--cw-space-2-5);
    --bs-alert-border: 0;
    --bs-alert-border-radius: var(--cw-radius-lg);
    font-size: var(--cw-text-xs);
    line-height: var(--cw-leading-body);
}

.alert-danger {
    --bs-alert-bg: var(--cw-danger-tint);
    --bs-alert-color: var(--cw-danger-strong);
    --bs-alert-link-color: var(--cw-danger-strong);
}

.alert-success {
    --bs-alert-bg: var(--cw-ok-tint);
    --bs-alert-color: var(--cw-ok);
    --bs-alert-link-color: var(--cw-ok);
}

.alert-warning {
    --bs-alert-bg: var(--cw-warnbox);
    --bs-alert-color: var(--cw-warnbox-text);
    --bs-alert-link-color: var(--cw-warnbox-text);
}

.alert-info {
    --bs-alert-bg: var(--cw-primary-tint);
    --bs-alert-color: var(--cw-primary-strong);
    --bs-alert-link-color: var(--cw-primary-strong);
}

/* Zmiany (Changelog.razor) - an item's type pill, sized as an inline table badge, not a full-width
   box. The set of types is admin-defined and open-ended (ChangelogItemType), so this is a single
   neutral style rather than a per-type color pairing. */
.changelog-type-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: var(--cw-radius-pill);
    font-size: var(--cw-text-2xs);
    font-weight: 600;
    white-space: nowrap;
    background-color: var(--cw-bg);
    border: 1px solid var(--cw-border);
    color: var(--cw-text-3);
}

/* Znacznik typu zmiany: kolor typu przychodzi ze strony jako --badge-color (tło 10%, ramka i tekst w pełnym kolorze). */
.changelog-type-badge[style] {
    background-color: color-mix(in srgb, var(--badge-color) 10%, transparent);
    border-color: var(--badge-color);
    color: var(--badge-color);
}

.changelog-item-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.changelog-item-row:last-child {
    margin-bottom: 0;
}

.settings-card {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-card);
    box-shadow: var(--cw-shadow);
    padding: var(--cw-space-6);
    max-width: 40rem;
}

.settings-card-wide {
    max-width: none;
}

.settings-card-narrow {
    max-width: 22rem;
}

/* Same grid as .dashboard-stats but with a smaller column floor, for stat rows that must fit
   3+ tiles across a single settings-card (40rem cap) instead of the full page width. */
.dashboard-stats-compact {
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.75rem;
}

    .dashboard-stats-compact .stat-card {
        padding: 1rem 1.1rem;
    }

    .dashboard-stats-compact .stat-card-value {
        font-size: var(--cw-text-xl);
    }

.settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: start;
    gap: 1.5rem;
}

    .settings-row > .settings-card,
    .settings-row > div > .settings-card {
        max-width: none;
    }

/* Equal-height variant - unlike the default top-aligned .settings-row (used where card heights
   genuinely differ and forcing them equal would just add odd blank space), Integracje's two
   Jira cards read as one connected unit and look better matched in height. */
.settings-row-stretch {
    align-items: stretch;
}

/* FeedbackSettings.razor (poprawki-p1 korekta): Statusy+Typy sit in one .settings-row, Priorytety
   in a second one below it, so the two rows need their own vertical gap - a single .settings-row
   never needed this since nothing followed it directly. */
.settings-row + .settings-row {
    margin-top: 1.5rem;
}

/* Tighter vertical gap when cards wrap to a stack - for a .settings-row whose item count can grow
   arbitrarily long (Dictionaries.razor's list of słowniki), not just the fixed 2-card layouts
   elsewhere. Grid's two-value gap shorthand is row-gap column-gap - only the stacked (row) gap
   shrinks, the side-by-side (column) gap is unchanged. Poprawka na wyraźną prośbę: capped at max
   3 cards per row - minmax()'s lower bound is whichever is bigger, 320px or "the width one card
   would have if there were exactly 3", so auto-fit can never squeeze in a 4th no matter how wide
   the screen (it can still show fewer than 3 on a narrower one). Later in the file than
   .settings-row, so this wins the grid-template-columns tie (same specificity, same class combo). */
.settings-row-compact {
    gap: 7px 1rem;
    grid-template-columns: repeat(auto-fit, minmax(max(320px, calc((100% - 2rem) / 3)), 1fr));
}

/* Feedback.razor's grid - a subtle full-row tint plus a small dot next to the ticket number for
   any report with unread activity (new report, edit, or comment) for the current viewer, same
   "unread" definition as FeedbackUnreadBadge's count. Opening the report's details (which also
   marks it viewed) removes both, no reload needed - see OpenDetailAsync's optimistic update. */
.feedback-row-unread {
    background-color: var(--cw-primary-tint);
}

/* Podświetlenie nie może zjadać linii rozdzielających wiersze: komórki dostają wyraźniejszy dolny obrys. */
.table > tbody > tr.feedback-row-unread > td {
    border-bottom-color: var(--cw-border-strong);
}

.feedback-unread-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--cw-primary);
    margin-right: 0.35rem;
    vertical-align: middle;
}

/* Feedback.razor's private comment thread - a left/right-aligned bubble list distinguishing the
   submitter's messages from the admin's, same idea as a typical two-party chat log. */
.feedback-comment-thread {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 18rem;
    overflow-y: auto;
}

.feedback-comment {
    max-width: 85%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--cw-radius-lg);
    background: var(--cw-surface-2);
    border: 1px solid var(--cw-border);
}

.feedback-comment-admin {
    align-self: flex-end;
    background: var(--cw-primary);
    color: var(--cw-on-primary);
    border-color: var(--cw-primary);
}

.feedback-comment-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: var(--cw-text-2xs);
    opacity: 0.8;
    margin-bottom: 0.2rem;
}

.feedback-comment-text {
    margin: 0;
    white-space: pre-wrap;
}

.settings-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

    .settings-card-header h2 {
        margin: 0;
        font-size: var(--cw-text-lg);
        font-weight: var(--cw-weight-semibold);
        color: var(--cw-text);
    }

.settings-card-action {
    background: none;
    border: none;
    padding: 0;
    color: var(--cw-link);
    font-weight: var(--cw-weight-semibold);
    font-size: var(--cw-text-xs);
    cursor: pointer;
    white-space: nowrap;
    /* Same height as .btn (see above) even though this is a bare icon button with no
       border/background of its own - keeps every clickable action the same height app-wide. */
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .settings-card-action:hover {
        color: var(--cw-primary-strong);
        text-decoration: underline;
    }

.settings-summary {
    margin: 0;
}

.settings-summary-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--cw-border);
}

    .settings-summary-row:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .settings-summary-row dt {
        color: var(--cw-text);
        font-weight: 700;
        font-size: var(--cw-text-xs);
    }

    .settings-summary-row dd {
        margin: 0;
        font-weight: 400;
        text-align: left;
    }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ui-dialogs-and-notices (Faza 1): the "Modal" pattern of design-system.md - darkened backdrop (no blur), a 520 px
   panel on --cw-* with a short entry, an icon X. Widths: default 520 px, "modal-panel-wide" 768 px for forms in two
   columns and tables, 1024 px when the window pairs a form with a live preview (.modal-split, EmailTemplates). */
.modal-overlay {
    /* Okno nigdy nie wchodzi na górny pasek z zegarem: od góry zostaje --modal-top (wysokość paska, a gdy widać komunikat
       NotificationBanner - także jego miejsce, bo ten leży tuż pod paskiem nad oknem). Tło nadal przykrywa cały ekran. */
    --modal-top: 0px;
    position: fixed;
    inset: 0;
    background: var(--cw-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--modal-top) + var(--cw-space-4)) var(--cw-space-4) var(--cw-space-4);
    z-index: var(--cw-z-backdrop);
}

body:has(.top-bar) .modal-overlay {
    --modal-top: var(--cw-topbar-height);
}

/* Komunikat (zapis, błąd) wisi pod paskiem nad oknem - okno schodzi niżej o jego wysokość (jedna linia ~ 46 px, dwie ~ 66 px), żeby go nie zasłaniał. */
body:has(.top-bar):has(.notification-banner) .modal-overlay {
    --modal-top: calc(var(--cw-topbar-height) + 72px);
}

.modal-panel {
    background: var(--cw-surface);
    color: var(--cw-text);
    border-radius: var(--cw-radius-card);
    box-shadow: var(--cw-shadow-modal);
    width: min(520px, 100%);
    max-height: calc(100vh - var(--modal-top, 0px) - 2 * var(--cw-space-4));
    /* Panel jest zaokrąglony i przycina (overflow: hidden); przewija się tylko treść okna (.modal-panel-body), więc suwak nie zjada rogów. */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cw-modal-in var(--cw-duration-fast) var(--cw-ease);
}

    /* tabindex="-1" makes the panel the fallback focus target - a programmatic stop, not a control, so no ring. */
    .modal-panel:focus {
        outline: none;
    }

@keyframes cw-modal-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
}

.modal-panel-wide {
    width: min(768px, 100%);
}

    .modal-panel-wide:has(.modal-split) {
        width: min(1024px, 100%);
    }

    /* Karta klienta w Rozliczeniach: płaska lista z siedmioma kolumnami potrzebuje więcej miejsca niż zwykłe szerokie okno (uwaga użytkownika 2026-11-05).
       Rośnie z ekranem (uwaga użytkownika 2026-11-07: na HD i większych była ściśnięta): 85% okna przeglądarki, nie mniej niż 960 px, nie więcej niż 1440 px. */
    .modal-panel-wide.client-dialog-window {
        width: min(max(960px, 85vw), 1440px, 100%);
    }

.modal-panel-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--cw-space-4);
    padding: var(--cw-space-5) var(--cw-space-6) var(--cw-space-4);
    border-bottom: 1px solid var(--cw-border-soft);
}

.modal-title {
    margin: 0;
    font-size: var(--cw-text-xl);
    font-weight: var(--cw-weight-semibold);
    line-height: var(--cw-leading-tight);
    color: var(--cw-text);
}

/* Tytuł okna z przyciskami po bokach: [<] tytuł [>]. Stała minimalna szerokość tytułu, żeby strzałki nie skakały
   między dniami o różnej długości nazwy. */
.modal-title-nav {
    display: flex;
    align-items: center;
    gap: var(--cw-space-2);
    min-width: 0;
}

.modal-title-nav .modal-title {
    min-width: 24ch;
    text-align: center;
}

@media (max-width: 575.98px) {
    .modal-title-nav .modal-title {
        min-width: 0;
        font-size: var(--cw-text-lg);
    }
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--cw-radius-sm);
    background: transparent;
    color: var(--cw-muted);
    cursor: pointer;
    transition: background-color var(--cw-duration-fast) var(--cw-ease), color var(--cw-duration-fast) var(--cw-ease);
}

    .modal-close:hover {
        background: var(--cw-hover-strong);
        color: var(--cw-text);
    }

.modal-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: var(--cw-space-5) var(--cw-space-6) var(--cw-space-6);
}

/* Footer of the shared windows (ConfirmDialog, MustChangePasswordGate): actions on the right, the main one last. */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--cw-space-2);
    margin-top: var(--cw-space-5);
}

/* A message that keeps the line breaks it was written with (ConfirmDialog). */
.cw-pre-line {
    white-space: pre-line;
}

    .modal-panel-body > .cw-pre-line {
        margin: 0;
    }

    .modal-panel-body > .cw-pre-line + .cw-field {
        margin-top: var(--cw-space-4);
    }

    /* Intro line under the title of a shared window (MustChangePasswordGate). */
    .modal-panel-body > .modal-lead {
        margin: 0 0 var(--cw-space-4);
        color: var(--cw-text-2);
        font-size: var(--cw-text-xs);
    }

/* A form in a shared window: fields one under another (MustChangePasswordGate). */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-4);
}

.modal-split {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

    .modal-split-form,
    .modal-split-preview {
        flex: 1 1 50%;
        min-width: 0;
    }

    /* Sticks to the top of the modal's own scroll area while the (usually longer) form scrolls
       past it - same position:sticky idiom as .table-scroll's header, just vertical instead of
       within a table. */
    .modal-split-preview {
        position: sticky;
        top: 0;
    }

.modal-split-preview-frame {
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-md);
    padding: 1rem;
    background: var(--cw-bg);
    max-height: 32rem;
    overflow-y: auto;
    font-size: var(--cw-text-sm);
}

    /* The previewed HTML is arbitrary admin-authored content (email body/footer) - reset its
       own margins so it doesn't inherit spacing meant for this app's own UI text. */
    .modal-split-preview-frame img {
        max-width: 100%;
    }

/* Previews of an email (body, footer) show arbitrary admin-authored HTML with its own inline colours, as in a mail
   client - so on Noc's dark sheet they sit on a light "sheet of paper" instead of being recoloured. The two literals
   are deliberate: they stand for the mail client's white page, not for a theme colour. Other themes are unchanged. */
:root[data-theme="noc"] .email-preview-paper {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

    :root[data-theme="noc"] .email-preview-paper .page-subtitle {
        color: #475569;
    }

@media (max-width: 900px) {
    .modal-split {
        flex-direction: column;
    }

    .modal-split-preview {
        position: static;
        width: 100%;
    }
}

.day-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* poprawki-p1, Faza 2 (korekta, generalized in the second korekta for per-type inline absence
   colors): when a holiday/weekend class OR an inline absence background tints an entire
   settings-card (Registration.razor's day header) rather than a small calendar cell, the day-nav
   buttons and their icons must keep their normal look - Bootstrap's outline buttons are
   background:transparent by default, so the card's tint would otherwise bleed through and make
   them look colored too. Scoped to .day-nav (not every .btn in the card, e.g. table row actions
   further down) since only this row sits directly on the tinted card background.
   :not(:hover):not(:focus) matters: without it this always-on background sits later in the
   cascade than .btn-outline-primary/.btn-outline-secondary's own :hover fill (same specificity,
   later source order wins) and silently cancels it - "Dodaj wpis" stopped changing color on
   hover/focus while the same button elsewhere (outside .day-nav) still did. */
.day-nav .btn:not(:hover):not(:focus) {
    background-color: var(--cw-surface);
}

/* The arrows and "Dodaj wpis" stand in one row with the date field (36 px), so they are the full button height, not the
   32 px of .btn-sm that is meant for rows of a table (ui-data-grid-and-tabs, Faza 2). */
.day-nav .btn-sm {
    height: 36px;
}

.day-nav-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Poprawki P2, Faza 3: holiday/weekend/absence used to tint the WHOLE day card's background,
   which read as "tandetne" (cheap-looking) per explicit feedback. Only the day-nav bar itself is
   colored, with the day-off message centered in it and the absence label pinned to its right
   edge. 2026-09-30 (explicit request): the bar's background now matches the day's colour in the
   Absences/Calendar grids for every day-kind - holiday/weekend through the same shared
   .calendar-cell-holiday/.calendar-cell-weekend classes, absence via an inline per-type colour
   (see Registration.razor's DayStatusBarStyle), all at 50% opacity (explicit request) - mixed
   into transparent rather than `opacity`, so only the fill fades, not the text or border.
   Poprawka na wyraźną prośbę: the border stays a constant 1px, matching every other section's own
   border, on every day alike - only its COLOR changes, never its width. */
.registration-day-status-bar {
    position: relative;
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-md);
    padding: 0.4rem 0.75rem;
}

/* Dzień z nieobecnością: kolory typu przychodzą ze strony jako zmienne (--day-bg, --day-border). */
.registration-day-status-bar--absence {
    background: color-mix(in srgb, var(--day-bg) 50%, transparent);
    border-color: var(--day-border);
}

.registration-day-status-bar.calendar-cell-holiday {
    background: color-mix(in srgb, var(--cw-day-holiday-bg) 50%, transparent);
    border-color: var(--cw-day-holiday-border);
}

.registration-day-status-bar.calendar-cell-weekend {
    background: color-mix(in srgb, var(--cw-day-weekend-bg) 50%, transparent);
    border-color: var(--cw-day-weekend-border);
}

.registration-day-off-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--cw-text-2xs);
    font-style: italic;
    color: var(--cw-text);
    white-space: nowrap;
    pointer-events: none;
    padding: 0 0.5rem;
}

.registration-absence-label {
    color: var(--absence-label-color, inherit);
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--cw-text-2xs);
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border: 1.5px solid currentColor;
    border-radius: var(--cw-radius-pill);
    white-space: nowrap;
    background: var(--cw-surface);
    pointer-events: none;
}

    

/* The absence short label as a WATERMARK: large text filling the cell, faint, behind everything
   else. This is the third attempt at placing it and the first that doesn't have to steal space
   from something - as a badge it collided with the Jira checkbox in the top-right, and moving it
   to the bottom-right forced the duration off-centre to fit beside it. Sitting behind the content
   it competes with nothing, so the cell keeps its natural height and the duration stays centred.
   z-index 0 against z-index 1 on the date/duration is what guarantees it never covers them (an
   absolutely positioned element otherwise paints over static siblings regardless of DOM order).
   Colour comes inline from the absence type; opacity is fixed here so an admin can't accidentally
   pick something opaque enough to bury the numbers. */

    

/* A still-Pending absence request, on top of its type's own background color (set inline) -
   the color alone no longer distinguishes pending from approved, so this dashed outline is the
   one remaining "not decided yet" signal. */
.calendar-cell-absence-pending-outline {
    outline: 2px dashed var(--cw-primary);
    outline-offset: -2px;
}

.calendar-cell-holiday {
    background: var(--cw-day-holiday-bg);
    border-color: var(--cw-day-holiday-border);
}

.calendar-cell-weekend {
    background: var(--cw-day-weekend-bg);
    border-color: var(--cw-day-weekend-border);
}

/* A future Approved day the user has clicked, staged for revocation on the next "Odwołaj
   zaznaczone" click - a dashed override ring so it stays legible against the per-type color
   applied inline underneath (Absences.razor's DayStyle/Calendar.razor's AbsenceCellStyle). */
.calendar-cell-absence-revoke-selected {
    outline: 2px dashed var(--cw-danger);
    outline-offset: -2px;
}

/* A day already submitted for revocation and awaiting Owner/Admin's decision - a distinct
   (blue-ish) dashed ring from the red one above, which means "locally selected, not yet sent". */
.calendar-cell-absence-revoke-pending {
    outline: 2px dashed var(--cw-primary);
    outline-offset: -2px;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-legend-swatch {
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: var(--cw-radius-xs);
    background: var(--cw-day-under-bg);
    border: 1px solid var(--cw-day-under);
    flex-shrink: 0;
}

.calendar-legend-swatch--type {
    background-color: var(--swatch-bg);
    border-color: var(--swatch-border);
}

.calendar-legend-swatch.calendar-cell-absence-pending-outline {
    background: transparent;
}

.calendar-legend-swatch-holiday {
    background: var(--cw-day-holiday-bg);
    border-color: var(--cw-day-holiday-border);
}

.calendar-legend-swatch-weekend {
    background: var(--cw-day-weekend-bg);
    border-color: var(--cw-day-weekend-border);
}

.calendar-legend-swatch-today {
    background: var(--cw-day-today-bg);
    border-color: var(--cw-day-today);
}

/* Jira statuses render as a dot (Kalendarz: .cd-jira, Rejestracja: pasek dnia) - the legend swatch matches that shape, a small filled
   circle in the marker's own color, rather than the square bg+border swatch used above. */
.calendar-legend-swatch-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    border: none;
}

.calendar-legend-swatch-jira-not-synced {
    background: var(--cw-jira-not-synced);
}

.calendar-legend-swatch-jira-synced {
    background: var(--cw-jira-synced);
}

.calendar-legend-swatch-jira-changed {
    background: var(--cw-jira-changed);
}

/* Neutral "nothing to sync today" state (Rejestracja, when the viewed day has no ticket-bearing
   entry) - deliberately NOT one of the admin-editable StatusColorCategory colors, since it isn't
   a sync outcome at all, just an absence of anything to sync. */
.calendar-legend-swatch-jira-none {
    background: var(--cw-jira-none);
}

/* ===== absences-redesign (Faza 2): ekran Nieobecności - pas „Twój rok”, karty miesięcy, czytnik dnia, legenda, wiersz akcji (klasy .abs-*) =====
   Wzorce z design-system.md: „Karta z ikoną-chipem” (Shared/Ui/Card), „Pierścień i pasek postępu” (Ring, Bar), „Pigułka statusu”, „Kalendarz”
   (siatka miesiąca). Kolory dnia (dziś, święto, weekend) z tokenów motywu --cw-day-*, kolor typu nieobecności z konfiguracji przez --abs-tc/--abs-tt
   (ustawia je strona w style jako zmienne, nigdy szerokość). W motywie Noc kolor typu jest mieszany z powierzchnią (--abs-type-mix 42%), żeby jasne
   pastele nie świeciły, a numer dnia ma kolor tekstu motywu. */
:root {
    --abs-type-mix: 100%;
    --abs-hatch: rgba(7, 31, 34, 0.28);
    --abs-shadow-bar: 0 -6px 18px rgba(7, 52, 58, 0.10);
}

:root[data-theme="noc"] {
    --abs-type-mix: 42%;
    --abs-hatch: rgba(241, 245, 249, 0.35);
    --abs-shadow-bar: 0 -6px 18px rgba(0, 0, 0, 0.45);
}

.abs-card {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-4);
}

/* Rok na środku karty (uwaga użytkownika 2026-11-08, jak miesiąc w Kalendarzu - .cal-head): „‹ 2026 ›” w środkowej kolumnie, „Dziś” w prawej tuż za strzałką.
   Na telefonie wszystko w jednej kolumnie, wyśrodkowane. */
.abs-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--cw-space-2) var(--cw-space-4);
}

.abs-nav .day-nav-current {
    grid-column: 2;
}

.abs-nav > .btn {
    grid-column: 3;
    justify-self: start;
}

@media (max-width: 480px) {
    .abs-nav {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .abs-nav .day-nav-current,
    .abs-nav > .btn {
        grid-column: 1;
        justify-self: center;
    }
}

.abs-year {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--cw-text);
}

/* Pas „Twój rok”: 3 karty; przy średniej szerokości dwie obok siebie, a „Pozostałe limity” pod nimi na całą szerokość. */
.abs-yy-w {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    container-type: inline-size;
    container-name: abs-yy;
}

.abs-yy {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 12px;
}

@container abs-yy (min-width: 560px) and (max-width: 860px) {
    .abs-yy {
        grid-template-columns: 1fr 1fr;
    }

    .abs-yy > :last-child {
        grid-column: 1 / -1;
    }
}

.abs-yc {
    min-width: 0;
}

.cw-card.abs-yc--accent {
    background: linear-gradient(135deg, var(--cw-primary-tint), var(--cw-surface) 70%);
    border-color: color-mix(in srgb, var(--cw-primary-mid) 45%, var(--cw-border));
}

.abs-yc-txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    font-size: 12px;
    color: var(--cw-text-3);
}

.abs-yc-big {
    font-size: var(--cw-text-2xl, 22px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--cw-text);
}

.abs-cd {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.abs-cd-pre,
.abs-cd-u {
    font-size: 12px;
    color: var(--cw-text-3);
}

.abs-cd-n {
    font-size: var(--cw-text-2xl, 22px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cw-primary-strong);
}

.abs-yc-p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--cw-text-2);
}

.abs-yc-empty {
    font-weight: 400;
    color: var(--cw-text-3);
}

.abs-yl {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.abs-yl li {
    display: grid;
    grid-template-columns: auto minmax(0, 1.5fr) minmax(6.5rem, 1fr);
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.abs-yl-n {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cw-text-2);
}

.abs-yl-free {
    text-align: right;
    font-size: 11px;
    color: var(--cw-text-3);
}

.abs-yy-note {
    margin: 0;
    font-size: 11px;
    color: var(--cw-text-3);
}

/* Próbka typu (skrót w kolorze typu): pas „Pozostałe limity”, „Najbliższe wolne” i legenda. */
.abs-sw {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 18px;
    padding: 0 4px;
    border-radius: var(--cw-radius-xs);
    background: color-mix(in srgb, var(--abs-tc) var(--abs-type-mix), var(--cw-surface));
    color: var(--abs-tt);
    font-size: 10px;
    font-weight: 700;
    flex: none;
}

:root[data-theme="noc"] .abs-sw {
    color: var(--cw-text);
}

/* Szkielet ładowania: te same wymiary co dane, żeby po wczytaniu nic nie skakało. */
.abs-skel {
    background: var(--cw-surface-3);
    border-radius: var(--cw-radius-lg);
    animation: abs-pulse 1.4s ease-in-out infinite;
}

.abs-skel--nav {
    height: 36px;
    max-width: 14rem;
}

.abs-skel--card {
    height: 160px;
}

.abs-skel--month {
    height: 268px;
}

.abs-skel--team {
    height: 160px;
}

@keyframes abs-pulse {
    50% {
        opacity: 0.55;
    }
}

@media (prefers-reduced-motion: reduce) {
    .abs-skel {
        animation: none;
    }
}

.abs-empty {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--cw-radius-md);
    background: var(--cw-surface-2);
    font-size: 12px;
    color: var(--cw-text-2);
}

/* 12 miesięcy zawsze wypełnia całe rzędy: 1, 2, 3, 4 albo 6 w rzędzie, nigdy 5. Liczba kolumn wynika z szerokości kontenera (nie okna: menu zabiera część). */
.abs-yr {
    container-type: inline-size;
    container-name: abs-yr;
}

.abs-ygrid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}

@container abs-yr (min-width: 29rem) {
    .abs-ygrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container abs-yr (min-width: 44rem) {
    .abs-ygrid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@container abs-yr (min-width: 59rem) {
    .abs-ygrid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@container abs-yr (min-width: 89rem) {
    .abs-ygrid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.abs-mm {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 10px 10px 8px;
    border: 1px solid var(--cw-border-soft);
    border-radius: var(--cw-radius-lg);
}

.abs-mm--cur {
    border-color: var(--cw-primary-mid);
    box-shadow: inset 0 0 0 1px var(--cw-primary-mid);
}

.abs-mm-h {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.abs-mm-h h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.abs-mm-h small {
    font-size: 11px;
    font-weight: 500;
    color: var(--cw-text-3);
}

.abs-mg {
    display: grid;
    gap: 2px;
}

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

.abs-wh {
    padding: 2px 0;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--cw-text-3);
}

.abs-wh abbr {
    text-decoration: none;
}

.abs-wh--we {
    color: var(--cw-muted);
}

/* Dzień: komórka gridcell (stan i kolor) z <button> w środku (klikalny) albo samym tekstem (nieklikalny). Dni sąsiednich miesięcy nie są rysowane. */
.abs-d {
    position: relative;
    display: flex;
    height: 30px;
    min-width: 0;
    border-radius: var(--cw-radius-sm);
    color: var(--cw-text-2);
    font-size: 12px;
    font-weight: 500;
}

.abs-d--blank {
    visibility: hidden;
}

.abs-d-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    font: inherit;
}

button.abs-d-btn {
    cursor: pointer;
}

button.abs-d-btn:hover {
    box-shadow: inset 0 0 0 1px var(--cw-primary-mid);
}

button.abs-d-btn:focus-visible {
    outline: 2px solid var(--cw-primary);
    outline-offset: -2px;
}

.abs-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: var(--cw-radius-pill);
    font-variant-numeric: tabular-nums;
}

.abs-d--we {
    background: var(--cw-day-weekend-bg);
    color: var(--cw-text-3);
}

.abs-d--hol {
    background: var(--cw-day-holiday-bg);
    color: var(--cw-day-holiday-text);
    font-weight: 600;
}

/* Zatwierdzony: pełny kolor typu. Oczekujący: kolor rozjaśniony + przerywany obrys (ten sam sygnał „czeka” co w Kalendarzu).
   Odwołanie czeka: ukośne kreskowanie. Do odwołania (zaznaczone lokalnie): czerwony obrys i przekreślony numer. */
.abs-d--abs {
    background: color-mix(in srgb, var(--abs-tc) var(--abs-type-mix), var(--cw-surface));
    color: var(--abs-tt);
    font-weight: 600;
}

:root[data-theme="noc"] .abs-d--abs {
    color: var(--cw-text);
}

.abs-d--pend {
    background: color-mix(in srgb, var(--abs-tc) calc(var(--abs-type-mix) * 0.55), var(--cw-surface));
    outline: 2px dashed var(--cw-primary-strong);
    outline-offset: -2px;
}

.abs-d--rvp {
    background-image: repeating-linear-gradient(135deg, transparent 0 4px, var(--abs-hatch) 4px 5px);
}

.abs-d--rvs {
    outline: 2px solid var(--cw-danger);
    outline-offset: -2px;
}

.abs-d--rvs .abs-n {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--cw-danger);
}

/* Zakres nowego wniosku: tło -tint z obrysem, dzień początku i końca pełny kolor główny. */
.abs-d--pick {
    background: var(--cw-primary-tint);
    color: var(--cw-primary-strong);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--cw-primary);
}

.abs-d--edge {
    background: var(--cw-primary);
    color: var(--cw-on-primary);
    box-shadow: none;
}

.abs-d--today .abs-n {
    background: var(--cw-day-today);
    color: var(--cw-on-primary);
    font-weight: 700;
}

.abs-d--edge.abs-d--today .abs-n {
    background: var(--cw-on-primary);
    color: var(--cw-primary);
}

/* Podgląd dnia: tekst wpisuje abs-day-reader.js (najechanie i fokus). */
.abs-reader {
    display: flex;
    align-items: center;
    min-height: 34px;
    margin: 0;
    padding: 6px 12px;
    border-radius: var(--cw-radius-md);
    background: var(--cw-surface-2);
    font-size: 12px;
    font-weight: 600;
    color: var(--cw-text-2);
}

.abs-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    font-size: 12px;
    color: var(--cw-text-3);
}

.abs-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.abs-lg {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: var(--cw-radius-xs);
}

.abs-lg--today {
    border-radius: 50%;
    background: var(--cw-day-today);
}

.abs-lg--hol {
    background: var(--cw-day-holiday-bg);
    box-shadow: inset 0 0 0 1px var(--cw-day-holiday-border);
}

.abs-lg--we {
    background: var(--cw-day-weekend-bg);
    box-shadow: inset 0 0 0 1px var(--cw-day-weekend-border);
}

.abs-lg--pend {
    outline: 2px dashed var(--cw-primary-strong);
    outline-offset: -2px;
}

.abs-lg--rvp {
    background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--abs-hatch) 3px 4px);
    box-shadow: inset 0 0 0 1px var(--cw-border);
}

/* Wiersz akcji przy kalendarzu; gdy coś jest zaznaczone, przykleja się do dołu ekranu, więc „Złóż wniosek” jest pod ręką przy każdym miesiącu. */
.abs-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 calc(-1 * var(--cw-space-6)) calc(-1 * var(--cw-space-6));
    padding: 12px var(--cw-space-6) 16px;
    border-radius: 0 0 var(--cw-radius-card) var(--cw-radius-card);
}

.abs-actions--stuck {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: var(--cw-surface);
    border-top: 1px solid var(--cw-border);
    box-shadow: var(--abs-shadow-bar);
}

.abs-seltxt {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    font-size: 12px;
    color: var(--cw-text-2);
}

.abs-seltxt b {
    font-weight: 600;
    color: var(--cw-text);
}

/* Przełącznik widoku roku (Karty miesięcy / Planer roczny): w lewej kolumnie nawigacji roku, aktywny = -tint z obrysem (kolor nie jest jedynym sygnałem: aria-pressed). */
.abs-seg {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    display: inline-flex;
}

.abs-seg .btn {
    border-radius: 0;
}

.abs-seg .btn + .btn {
    margin-left: -1px;
}

.abs-seg .btn:first-child {
    border-radius: var(--cw-radius-md) 0 0 var(--cw-radius-md);
}

.abs-seg .btn:last-child {
    border-radius: 0 var(--cw-radius-md) var(--cw-radius-md) 0;
}

.abs-seg .btn.active {
    background: var(--cw-primary-tint);
    border-color: var(--cw-primary-mid);
    color: var(--cw-primary-strong);
    font-weight: 600;
    z-index: 1;
}

@media (max-width: 480px) {
    .abs-seg {
        grid-column: 1;
        grid-row: auto;
        justify-self: center;
    }
}

/* Planer roczny: miesiąc = wiersz, 37 kolumn dni wyrównanych do dni tygodnia + stała kolumna „W miesiącu”; przewija się poziomo we własnym kontenerze.
   Poniżej 40 rem szerokości karty strona renderuje karty miesięcy zamiast planera (Absences.razor, _yearNarrow z absence-day-reader.js). */
.abs-pl {
    overflow-x: auto;
    border: 1px solid var(--cw-border-soft);
    border-radius: var(--cw-radius-lg);
}

.abs-plg {
    display: flex;
    flex-direction: column;
    min-width: 980px;
}

.abs-pl-row {
    display: grid;
    grid-template-columns: 56px repeat(37, minmax(20px, 1fr)) 150px;
    gap: 2px;
    align-items: center;
    padding: 2px 6px;
    border-top: 1px solid var(--cw-border-soft);
}

.abs-pl-row:first-child {
    border-top: 0;
}

.abs-pl-row--cur {
    background: color-mix(in srgb, var(--cw-primary-tint) 60%, transparent);
}

.abs-pl-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--cw-surface-2);
}

.abs-pl-m {
    position: sticky;
    left: 0;
    z-index: 1;
    align-self: stretch;
    display: flex;
    align-items: center;
    margin-left: -6px;
    padding-left: 8px;
    background: var(--cw-surface);
    font-size: 12px;
    font-weight: 600;
    color: var(--cw-text-2);
}

.abs-pl-head .abs-pl-m,
.abs-pl-head .abs-pl-sum {
    background: var(--cw-surface-2);
    font-size: 11px;
    color: var(--cw-text-3);
}

.abs-pl-row--cur .abs-pl-m {
    background: color-mix(in srgb, var(--cw-primary-tint) 60%, var(--cw-surface));
    color: var(--cw-primary-strong);
}

.abs-pl-sum {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
    padding-left: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--cw-text-2);
    white-space: nowrap;
}

.abs-pl-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.abs-pl-none {
    font-weight: 400;
    color: var(--cw-muted);
}

.abs-plg .abs-d {
    height: 26px;
    font-size: 11px;
}

.abs-plg .abs-n {
    min-width: 0;
    width: 20px;
    height: 20px;
}

/* Co siódma kolumna (poniedziałek) odsunięta o 3 px: tygodnie czytają się jako grupy. */
.abs-plg .abs-wk {
    margin-left: 3px;
}

/* Oś zespołu (osoba × dzień), zakładka Zespół: kolumna imion + jedna kolumna na dzień miesiąca (--days). Pozycję pigułki ustawiają zmienne --r/--c1/--c2
   (nigdy szerokość inline). Poniżej 640 px kontenera oś znika, a widoczna jest lista „Osoba - od - do” (dla czytnika ekranu lista jest zawsze). */
.abs-tl {
    position: relative;
    container-type: inline-size;
    container-name: abs-tl;
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-2);
}

.abs-tl-hint {
    margin: 0;
    font-size: 12px;
    color: var(--cw-text-3);
}

.abs-tl-scroll {
    overflow-x: auto;
}

.abs-tlg {
    display: grid;
    grid-template-columns: 150px repeat(var(--days), minmax(18px, 1fr));
    min-width: 720px;
    font-size: 11px;
}

.abs-tl-hd {
    grid-row: 1;
    padding: 3px 0;
    border-bottom: 1px solid var(--cw-border);
    text-align: center;
    font-weight: 600;
    color: var(--cw-text-3);
}

.abs-tl-hd small {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: var(--cw-muted);
}

.abs-tl-name {
    grid-column: 1;
    grid-row: var(--r, 1);
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 8px 0 0;
    overflow: hidden;
    border-bottom: 1px solid var(--cw-border-soft);
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.abs-tl-hd.abs-tl-name {
    justify-content: flex-start;
    border-bottom-color: var(--cw-border);
    padding: 3px 8px 3px 0;
    font-weight: 600;
    color: var(--cw-text-3);
}

.abs-tl-c {
    grid-row: var(--r);
    grid-column: var(--c);
    position: relative;
    min-height: 34px;
    border-bottom: 1px solid var(--cw-border-soft);
}

.abs-tl--we {
    background: var(--cw-day-weekend-bg);
}

.abs-tl--ho {
    background: var(--cw-day-holiday-bg);
}

.abs-tl-hd.abs-tl--td {
    color: var(--cw-primary-strong);
    box-shadow: inset 0 -2px 0 var(--cw-primary);
}

.abs-tl-c.abs-tl--td::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 50%;
    width: 2px;
    background: color-mix(in srgb, var(--cw-primary) 45%, transparent);
}

.abs-tl-bar {
    grid-row: var(--r);
    grid-column: var(--c1) / var(--c2);
    z-index: 1;
    align-self: center;
    display: flex;
    align-items: center;
    height: 18px;
    margin: 0 1px;
    padding: 0 6px;
    overflow: hidden;
    border-radius: var(--cw-radius-pill);
    background: color-mix(in srgb, var(--abs-tc, var(--cw-primary-mid)) var(--abs-type-mix), var(--cw-surface));
    color: var(--abs-tt, var(--cw-on-primary));
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

:root[data-theme="noc"] .abs-tl-bar {
    color: var(--abs-tt-noc, var(--cw-text));
}

.abs-tl-list {
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.abs-tl-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--cw-border-soft);
    font-size: 12px;
}

.abs-tl-list li:last-child {
    border-bottom: 0;
}

.abs-tl-when {
    color: var(--cw-text-3);
    white-space: nowrap;
}

/* Dla czytnika ekranu lista jest zawsze w drzewie dostępności (wizualnie ukryta), a oś (aria-hidden) jest tylko ilustracją. */
.abs-tl-list {
    display: flex;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@container abs-tl (max-width: 40rem) {
    .abs-tl-wide {
        display: none;
    }

    .abs-tl-list {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
        white-space: normal;
    }
}

@media (max-width: 640px) {
    .abs-actions .btn {
        flex: 1 1 100%;
    }
}

/* Historia wniosków (absences-redesign, Faza 4): status to pigułka (StatusPill), wiersze nie są kolorowane; typ = próbka ze skrótem + nazwa. */
.abs-tp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.abs-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin-top: 3px;
}

/* Zarządzanie › Wnioski o nieobecność (Faza 6): „W tym czasie nieobecni” pod zakresem dat i pole powodu odrzucenia z widoczną etykietą. */
.abs-conf {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--cw-warn-strong);
}

.abs-conf svg {
    flex: none;
    margin-top: 1px;
}

.abs-rej {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
    margin-top: 8px;
}

.abs-rej .form-label {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--cw-text-2);
}

/* Podsumowanie w oknie wniosku: dni robocze, pominięte święta, limit przed i po wniosku. */
.abs-sum {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--cw-border-soft);
    border-radius: var(--cw-radius-lg);
    background: var(--cw-surface-2);
    font-size: 12px;
}

.abs-sum-kv {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.abs-sum-kv > span {
    color: var(--cw-text-3);
}

.abs-sum-kv > b {
    font-weight: 700;
}

.abs-sum-note {
    margin: 0;
    font-size: 11px;
    color: var(--cw-text-3);
}

.abs-sum-warn {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
}

.cw-alert--warn {
    background: var(--cw-warn-tint);
    color: var(--cw-warn-strong);
}

/* Zarządzanie > Wnioski (and any other filtered grid): the grid scrolls within its own box
   instead of stretching the whole page - both axes, since a filter-heavy table can get wide on
   narrow viewports too. Bordered box (flat corners, like every other surface in the app - see
   the flat-corner decision at the time; today --cw-radius-card) so the grid reads as one self-contained unit instead of a
   bare table floating on the page. */
.table-scroll {
    overflow: auto;
    /* Capped against viewport height too (not just a flat rem value) - on shorter windows the
       table shrinks instead of pushing the app footer far below the fold, same rationale as
       Konfiguracja's .ticket-shortcut-list-page. */
    max-height: min(32rem, 45vh);
    border: 1px solid var(--cw-border);
}

    .table-scroll table {
        margin-bottom: 0;
        /* Required for position:sticky <th> to render reliably across browsers (Safari in
           particular fails to stick header cells under the default border-collapse: collapse
           some resets apply to <table>) - punkt 1, 2026-08-29, fixes scrolled rows briefly
           painting over/through the header instead of disappearing behind it. */
        border-collapse: separate;
        border-spacing: 0;
    }

    /* Sticky header: only the body scrolls underneath, the header row stays put - position:sticky
       on each <th> (not on <thead>/<tr>) is the reliable cross-browser way to do this inside a
       scrolling ancestor. Needs its own opaque background (can't inherit transparency) so scrolled
       rows don't show through underneath it, and a visible accent so the header actually reads as
       "the header" instead of just another row - a bottom border in the brand color plus small
       bold uppercase text, the same idiom PolishDatePicker already uses for emphasis.
       z-index bumped above the zebra/hover row backgrounds below, not just above plain rows. */
    .table-scroll thead th {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    /* ui-data-grid-and-tabs (Faza 3): the header of every table - in a DataGrid card or a scrolling box in a window -
       is a band (design-system.md, "Tabela / DataGrid"): --cw-table-head (od 2026-11-13 mocniejsze niż --cw-surface-2 - nagłówek był za podobny
       do wierszy), small semibold --cw-text-2, no capitals, a soft line under it. It must be opaque, because the sticky header covers the rows
       scrolling underneath. */
    .table-scroll thead th,
    .data-grid-card thead th {
        background: var(--cw-table-head);
        border-bottom: 1px solid var(--cw-border);
        font-size: var(--cw-text-xs);
        font-weight: var(--cw-weight-semibold);
        color: var(--cw-text-2);
    }

    /* Bootstrap sizes .form-check-input in em, so a checkbox in the smaller header text above came
       out a different size than the ones in the rows - a checkbox-only header cell takes the
       table's own font size instead, whatever that is for this grid. */
    .table-scroll thead th.table-col-checkbox {
        font-size: inherit;
    }

/* Taller variant (punkt 1, 2026-08-29) for grids whose content is worth showing more of at once
   (Kolory's fixed 12-category list) - stacks with .table-scroll, doesn't replace it. */
.table-scroll-tall {
    max-height: min(48rem, 65vh);
}

/* Unsaved-change row highlight (punkt 1, 2026-08-29) - same idiom as .absence-row-pending
   (a whole-row background tint), subtle enough not to look like an error/warning state. */
.row-unsaved {
    background-color: var(--cw-primary-tint);
}

/* datagrid-component: DataGrid's scrollbar starts BELOW the sticky header row instead of running
   over it (explicit request) - the vertical track gets a top margin equal to the measured header
   height (--data-grid-header-height, set by DataGrid.razor.js). Custom thin styling is required
   for the track margin to apply at all (Chromium/Safari ::-webkit-scrollbar); Firefox ignores
   these and keeps its default full-height scrollbar. Never combine with scrollbar-width/-color on
   this element - in Chromium those standard properties switch the ::-webkit-scrollbar rules off. */
/* The strip beside the header where the scrollbar no longer runs would otherwise show the box's
   plain background - paint the header's own look there (its background + the 2px primary bottom
   border from `.table-scroll thead th`), so the header visually extends over the scrollbar's
   width. A container background doesn't scroll with the content (default attachment), so this
   strip stays put exactly like the sticky header; everywhere else it's transparent. With no
   sticky header the variable is 0px and the strip has no height. */
.data-grid-scroll {
    background-image: linear-gradient(to bottom,
        var(--cw-surface-2) calc(var(--data-grid-header-height, 0px) - 1px),
        var(--cw-border) calc(var(--data-grid-header-height, 0px) - 1px),
        var(--cw-border) var(--data-grid-header-height, 0px),
        transparent var(--data-grid-header-height, 0px));
    background-repeat: no-repeat;
}

.data-grid-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.data-grid-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.data-grid-scroll::-webkit-scrollbar-track:vertical {
    margin-top: var(--data-grid-header-height, 0px);
}

.data-grid-scroll::-webkit-scrollbar-thumb {
    background-color: var(--cw-border-strong);
    border: 2px solid transparent;
    border-radius: var(--cw-radius-sm);
    background-clip: padding-box;
}

    .data-grid-scroll::-webkit-scrollbar-thumb:hover {
        background-color: var(--cw-text-3);
    }

.data-grid-scroll::-webkit-scrollbar-corner {
    background: transparent;
}

/* datagrid-component: DataGrid's footer - the "Wyświetlono X z Y" counter always in the grid's
   bottom-right corner, with optional footer content (e.g. AbsenceRequests' paging) on its left. */
.data-grid-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem 1rem;
    padding: var(--cw-space-2) var(--cw-space-4);
    border-top: 1px solid var(--cw-border-soft);
    background: var(--cw-surface-2);
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
    font-variant-numeric: tabular-nums;
}

/* The counter: an at-a-glance hint in the bar's bottom-right corner, not something that competes with the rows. */
.data-grid-count {
    margin-left: auto;
    white-space: nowrap;
}

/* ui-data-grid-and-tabs (Faza 3): DataGrid is a card - the table, its empty states and the counter bar - and the filter
   panel above it a card of its own ("Tabela / DataGrid", "Panel filtrów"). Inside a .settings-card the shadow goes, so a
   card on a card is only a bordered frame. */
.data-grid-card {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-card);
    box-shadow: var(--cw-shadow);
    overflow: hidden;
}

.settings-card .data-grid-card {
    box-shadow: none;
}

.data-grid-card .table-scroll {
    border: 0;
    border-radius: 0;
}

.data-grid-card .table {
    margin-bottom: 0;
}

.data-grid-empty {
    margin: 0;
    padding: var(--cw-space-6) var(--cw-space-4);
    text-align: center;
    color: var(--cw-text-2);
}

    .data-grid-empty p {
        margin: 0 0 var(--cw-space-3);
    }

.table-sortable {
    white-space: nowrap;
}

/* ui-data-grid-and-tabs (Faza 3): the sort control is a <button> in the <th> (keyboard, aria-sort), drawn as plain
   header text with an arrow icon that shows on the sorted column. */
.table-sort {
    display: inline-flex;
    align-items: center;
    gap: var(--cw-space-1);
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    user-select: none;
    /* The click area is at least 24 x 24 px (WCAG 2.2, 2.5.8) - a short label such as "Nr" would be 14 x 18 px - while
       the header row stays 36 px. */
    min-width: 24px;
    min-height: 28px;
}

    .table-sort:hover {
        color: var(--cw-text);
    }

.table-sort-icon {
    flex-shrink: 0;
    color: var(--cw-primary-strong);
}

th[aria-sort="ascending"] .table-sort,
th[aria-sort="descending"] .table-sort {
    color: var(--cw-text);
}

/* Row hover (any table, not just scrolling ones) - a faint highlight makes it easier to track a
   row across many columns without relying on the zebra stripe alone. Uses the same light-blue
   tint as .form-control:focus's box-shadow color, so it reads as "this app's accent", not a new
   ad-hoc color. */
.table tbody tr:hover {
    background-color: var(--cw-hover);
}

/* --- Dashboard --- */

.widget-holidays {
    padding: 1.25rem 1.5rem;
}

.widget-holidays-scroll {
    max-height: 15rem;
    overflow-y: auto;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    padding: 1.25rem 1.5rem;
    /* Column layout so .stat-progress can pin itself to the card's bottom edge (margin-top:
       auto) instead of just trailing whatever content happens to sit above it. */
    display: flex;
    flex-direction: column;
}

.stat-card-label {
    font-size: var(--cw-text-xs);
    line-height: 1.3;
    color: var(--cw-text-3);
    font-weight: 600;
    /* Reserve room for 2 lines even when this card's own label happens to fit on 1 - siblings
       in the same row have labels of very different lengths, and without this, .stat-card-value
       started at a different height in each card depending on how many lines its label wrapped
       to at the current width. */
    min-height: calc(1.3em * 2);
}

.stat-card-value {
    font-size: var(--cw-text-2xl);
    font-weight: 700;
    margin-top: 0.25rem;
}

.stat-card-sub {
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Subtle "how much is left" preview inline next to a .stat-card-value - deliberately smaller and
   more muted than .stat-card-sub, since this is a nice-to-glance-at extra, not the primary
   figure the widget already reports. */
.stat-card-remaining {
    font-size: var(--cw-text-2xs);
    font-weight: 400;
    color: var(--cw-text-3);
    margin-left: 0.4rem;
}

/* Track (unfilled) uses the same Zostało/WidgetRemaining color as the donut's track, and the
   border uses the same Przysługuje/WidgetTotal color as the donut's outer ring - consistent
   admin-configurable palette between the hours widget's bar and the absence donuts. */
.stat-progress {
    height: 0.4rem;
    background: var(--color-status-widget-remaining-border);
    border: 1px solid var(--color-status-widget-total-border);
    /* auto pins the bar to the card's bottom edge (see .stat-card's flex-direction: column) so
       every progress bar in a row lines up regardless of how tall the content above it is -
       still at least 0.5rem below whatever precedes it, since margin-top: auto never collapses
       below the sibling's own margin-bottom. */
    margin-top: auto;
    overflow: hidden;
}

/* leave-and-absence-management, Faza 4 (feedback z ręcznej weryfikacji): a donut-chart widget
   for each configured absence type - conic-gradient ring (no chart library needed) showing
   used-vs-total proportion, with a legend spelling out przysługuje/wykorzystano/zostało instead
   of a wall of plain numbers. */
/* Shared by every stat-card that carries an InfoPopoverButton (Dashboard's absence-limit widgets
   and the overtime widget) - position:relative anchors the icon below, and the label gets out of
   its way. Generically named on purpose: this has nothing to do with absence specifically, it's
   just "a stat-card with an info icon in its corner". */
.stat-card-with-info-icon {
    position: relative;
}

.stat-card-with-info-icon .stat-card-label {
    padding-right: 1.8rem;
}

/* InfoPopoverButton.razor's icon - always a <button> (a click toggle, not a hover title=, since
   a native title= never responds to a click/tap at all - the bug this whole thing replaced).
   Resets the browser's native <button> chrome (background/border/padding/font) on top of the
   plain visual bits (color/position/size/cursor). */
.info-popover-icon {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: var(--cw-radius-pill);
    background: none;
    color: var(--cw-muted);
    font: inherit;
    cursor: pointer;
    transition: background-color var(--cw-duration-fast) var(--cw-ease), color var(--cw-duration-fast) var(--cw-ease);
}

    /* ui-dialogs-and-notices: the "Informacja ⓘ" pattern - muted at rest, primary on its tint on hover/open. */
    .info-popover-icon:hover,
    .info-popover-icon[aria-expanded="true"] {
        background: var(--cw-primary-tint);
        color: var(--cw-primary);
    }

/* Sits right after a section heading/checkbox label in normal text flow instead of a card's
   top-right corner - used to collapse the explanatory paragraph that used to sit below a form
   field into a click-to-reveal bubble, so the form itself stays compact. */
.info-popover-icon-inline {
    position: static;
    margin-left: 0.35rem;
    vertical-align: middle;
}

/* Feedback z ręcznej weryfikacji: "2 dni zostało" alone doesn't say whether that resets weekly,
   monthly or yearly - this pill next to the widget title spells out the period. */
.absence-widget-period-badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.55rem;
    border-radius: var(--cw-radius-pill);
    background: var(--cw-bg);
    border: 1px solid var(--cw-border);
    color: var(--cw-text-3);
    font-size: var(--cw-text-2xs);
    font-weight: 600;
    vertical-align: middle;
}

.absence-widget-body {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-top: 0.85rem;
    flex-wrap: wrap;
}

/* Three colors, all admin-configurable and matching the legend 1:1: outer ring border =
   Przysługuje (WidgetTotal), filled arc = Wykorzystano (ringColor - Normal/Warning/Danger
   depending on state), unfilled track = Zostało (WidgetRemaining). */
.absence-donut {
    --pct: 0;
    --ring-color: var(--color-status-widget-normal-border);
    box-sizing: border-box;
    width: 5.5rem;
    height: 5.5rem;
    flex-shrink: 0;
    border-radius: 50%;
    border: 3px solid var(--color-status-widget-total-border);
    background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--color-status-widget-remaining-border) 0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.absence-donut-hole {
    width: 3.9rem;
    height: 3.9rem;
    border-radius: 50%;
    background: var(--cw-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.2rem;
}

.absence-donut-value {
    font-size: var(--cw-text-lg);
    font-weight: 700;
    line-height: 1.15;
}

.absence-donut-unit {
    font-size: var(--cw-text-2xs);
    color: var(--cw-text-3);
    line-height: 1.15;
}

.absence-widget-legend {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: var(--cw-text-xs);
    flex: 1;
    min-width: 8rem;
}

.absence-legend-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.absence-legend-swatch {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-progress-bar {
    height: 100%;
    transition: width 0.2s ease;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    height: 10rem;
    margin-top: 1rem;
}

.bar-chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.bar-chart-bar-track {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bar-chart-bar {
    width: 60%;
    min-height: 2px;
    transition: height 0.2s ease;
}

.bar-chart-label {
    font-size: var(--cw-text-2xs);
    color: var(--cw-text-3);
    margin-top: 0.4rem;
    text-align: center;
}

.bar-chart-value {
    font-size: var(--cw-text-2xs);
    font-weight: 600;
    margin-top: 0.15rem;
}

/* Dashboard's yearly heatmap for an unlimited absence type (e.g. L4) - 12 month tiles (6x2, not
   day-level: 53 week-columns turned out too cramped to read in a narrow dashboard tile) shaded by
   that month's day count relative to this type's own busiest month, with the count printed on any
   non-zero tile. .absence-month-cell-fill is a separate layer under the number (not opacity on
   the whole tile) so the text itself never fades along with a light tint. */
.absence-month-heatmap {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.2rem;
    height: 3rem;
    margin-top: 0.75rem;
}

.absence-month-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cw-border);
    overflow: hidden;
}

.absence-month-cell-fill {
    position: absolute;
    inset: 0;
    background: var(--color-status-widget-normal-border);
}

.absence-month-cell-value {
    position: relative;
    z-index: 1;
    font-size: var(--cw-text-2xs);
    font-weight: 700;
    color: var(--cw-text);
}

.ticket-breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: var(--cw-text-xs);
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--cw-border);
}

    .ticket-breakdown-row:last-child {
        border-bottom: none;
    }

.dashboard-link-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}

    .dashboard-link-card:hover {
        border-color: var(--cw-primary);
    }

/* .pl-date-picker* styles moved to Shared/PolishDatePicker.razor.css (Blazor CSS isolation) -
   scoped to that component only, so it can be copied to another app as a self-contained pair
   of files instead of needing global CSS edits here. */

/* ui-data-grid-and-tabs (Faza 4): the "Zakładki" pattern (design-system.md) - TabStrip.razor. A line under the strip,
   the selected tab underlined; the tabs wrap on a narrow screen (four tabs, e.g. Wnioski o nieobecność, were wider
   than a phone and pushed the whole page, and with it the fixed top bar, sideways). */
.tab-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    column-gap: var(--cw-space-4);
    row-gap: var(--cw-space-2);
    border-bottom: 1px solid var(--cw-border);
    margin-bottom: var(--cw-space-6);
}

.tab-strip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--cw-space-5);
}

/* Registration's Skróty/Notatki: the actions (font size, expand) sit on the same row, at the right. */
.tab-strip--with-actions {
    align-items: center;
}

.tab-strip-actions {
    display: flex;
    align-items: center;
}

.tab-strip-tab {
    display: inline-flex;
    align-items: center;
    gap: var(--cw-space-1-5);
    margin-bottom: -1px;
    padding: var(--cw-space-2-5) var(--cw-space-1);
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--cw-text-3);
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-medium);
    cursor: pointer;
    transition: color var(--cw-duration-fast) var(--cw-ease), border-color var(--cw-duration-fast) var(--cw-ease);
}

    .tab-strip-tab:hover {
        color: var(--cw-text);
    }

    /* Zakładka jeszcze niewydana (TabItem.Hidden): widzi ją tylko admin aplikacji - wyszarzona, z przekreślonym okiem. */
    .tab-strip-tab--hidden:not(.active) {
        opacity: 0.55;
    }

    .tab-strip-tab.active {
        color: var(--cw-primary-strong);
        border-bottom-color: var(--cw-primary);
        font-weight: var(--cw-weight-semibold);
    }

/* Opcjonalne: kropka koloru stanu i licznik w zakładce (Rozliczenia: ile okresów w danym statusie). Kolor nigdy nie jest jedynym nośnikiem -
   liczba i etykieta stoją obok. */
.tab-strip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cw-text-3);
}

.tab-strip-dot--primary { background: var(--cw-primary); }
.tab-strip-dot--warn { background: var(--cw-warn); }
.tab-strip-dot--ok { background: var(--cw-ok); }
.tab-strip-dot--danger { background: var(--cw-danger); }

.tab-strip-count {
    min-width: 1.5rem;
    padding: 0 var(--cw-space-1-5);
    border-radius: var(--cw-radius-pill);
    background: var(--cw-surface-3);
    color: var(--cw-text-2);
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.tab-strip-count--primary { background: var(--cw-primary-tint); color: var(--cw-primary-strong); }
.tab-strip-count--warn { background: var(--cw-warn-tint); color: var(--cw-warn-strong); }
.tab-strip-count--ok { background: var(--cw-ok-tint); color: var(--cw-ok); }
.tab-strip-count--danger { background: var(--cw-danger-tint); color: var(--cw-danger-strong); }

/* Section header + "Dodaj" button layout convention (2026-08-29, punkt 1): the button always
   sits on its own row below the header (and below the description, if the section has one) -
   never sharing a row with the header via space-between, which packed it too close to
   filters/grid below and made the header/button feel glued together. Right-aligned to match
   where these buttons already sat when they were still inline with the header. */
.section-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 10px;
}

/* Shared filter convention (punkt 6, notes-ux-dashboard-consistency follow-up; poprawki-p1
   korekta: label-beside-input per user-provided reference screenshot, but responsive instead of
   the screenshot's fixed two columns): every list-filter bar in the app (Team.razor,
   AbsenceRequests.razor, EmailTemplates.razor, Permissions.razor, SystemAnnouncements.razor,
   Configuration.razor's Dodatkowe kwoty) uses this same trio - a visually bounded panel, label
   immediately beside its field, fields wrap onto their own additional row(s) if they don't fit,
   and the action buttons (Wyczyść filtr/Filtruj) always sit on their own row below the fields,
   right-aligned - never inline with the fields themselves. */
.filter-panel {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-3);
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-card);
    padding: var(--cw-space-3) var(--cw-space-4);
    margin-bottom: var(--cw-space-3);
}

/* ui-data-grid-and-tabs (Faza 3): first row - funnel icon + "Filtry:", separated from the fields by a soft line. */
.filter-panel-toggle {
    display: flex;
    align-items: center;
    gap: var(--cw-space-2);
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.filter-panel-chevron {
    margin-left: auto;
    display: inline-flex;
    transform: rotate(90deg);
    transition: transform var(--cw-duration-fast) var(--cw-ease);
}

.filter-panel--collapsed .filter-panel-chevron {
    transform: none;
}

.filter-panel--collapsed {
    gap: 0;
}

    .filter-panel--collapsed .filter-panel-head {
        padding-bottom: 0;
        border-bottom: 0;
    }

.filter-panel-head {
    display: flex;
    align-items: center;
    gap: var(--cw-space-2);
    padding-bottom: var(--cw-space-2);
    border-bottom: 1px solid var(--cw-border-soft);
    color: var(--cw-earth-strong);
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
}

/* poprawki-p1 (korekta): reverted from the earlier auto-fit-grid-of-column-pairs + subgrid
   approach - `repeat(auto-fit, minmax(0, max-content) ...)` is a known CSS Grid footgun: the
   spec computes the auto-fit REPEAT COUNT using each track's max sizing function if it's a
   definite length, else its min - and max-content isn't a definite length, so the label track
   counts as 0-width for that computation. The browser then decides on more label/input pairs
   than actually fit once real (non-zero) label widths are laid out, so the row overflows and
   fields get squeezed/overlap or are pushed out of view entirely. Plain flex-wrap has none of
   that: each .filter-field sizes itself to its own content and wraps as a whole unit, so nothing
   can silently miscalculate and disappear. The tradeoff is that labels in different wrapped rows
   no longer share an identical column width - acceptable; a working, simple layout beats a
   fragile, clever one. */
.filter-fields {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.25rem;
    row-gap: 0.6rem;
    align-items: flex-end;
}

/* Label immediately beside its own input, both as a single inline unit that wraps as a whole -
   works the same whether the field is label-then-input (search/select fields) or the reversed
   input-then-label order used by checkbox fields, so no separate checkbox case is needed. */
.filter-field {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

    .filter-field .form-label {
        margin-bottom: 0;
        white-space: nowrap;
    }

/* ui-data-grid-and-tabs: a field whose label comes first (search, select, date) puts the label ABOVE the field; a
   checkbox field (input first, then its label) stays in one row. The fields align on their bottom edge, so a checkbox
   sits level with the neighbouring inputs. */
.filter-field:has(> .form-label:first-child) {
    flex-direction: column;
    align-items: stretch;
    gap: var(--cw-space-1);
}

    .filter-field:has(> .form-label:first-child) .form-label {
        font-size: var(--cw-text-xs);
    }

/* The colon belongs to filters only (design-system.md, Open Question 6, decided 17.10): "Wersja:" - set here, in one
   place, so no page has to change its label text. A checkbox field's label is not the first child, so it gets none. */
.filter-field > .form-label:first-child::after {
    content: ":";
}

/* A checkbox field has no label above to lift it: give it the field height so it lines up with the inputs. */
.filter-field:not(:has(> .form-label:first-child)) {
    min-height: 36px;
}

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.form-control-narrow {
    max-width: 10rem;
}

.input-group-narrow {
    max-width: 12.5rem;
}

.set-now-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.6rem;
    color: var(--cw-text-3);
}

.set-now-btn:hover {
    color: var(--cw-primary-strong);
}

/* ui-data-grid-and-tabs (Faza 3): every table - rows 36 px (a 32 px icon button plus 2 px above and below fits),
   --cw-text-xs (12 px, the same size as the header, decided 17.10: a cell is never larger than its header), a soft
   separator; the cells are transparent, so the card behind the table shows through and the row hover and status
   colours are visible. */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--cw-text);
    --bs-table-border-color: var(--cw-border-soft);
    font-size: var(--cw-text-xs);
}

/* Nagłówek każdej tabeli to pas --cw-table-head z tekstem --cw-text-2 (design-system.md, „Tabela / DataGrid”; decyzja użytkownika 2026-11-13:
   także zwykłe .table poza DataGrid i .table-scroll, które wcześniej nie miały pasa wcale). */
.table > thead th {
    background: var(--cw-table-head);
    color: var(--cw-text-2);
    font-weight: var(--cw-weight-semibold);
}

.table th,
.table td {
    height: 36px;
    padding-top: 0.125rem;
    padding-bottom: 0.125rem;
    vertical-align: middle;
}

/* Controls and pills inside a cell take the cell's text size too (a button or field in a row is never larger than the
   header above it); a status pill would otherwise shrink to 9 px (Bootstrap's .badge is .75em of its parent), so it
   gets the smallest token instead. */
.table td .btn,
.table td .form-control,
.table td .form-select {
    font-size: var(--cw-text-xs);
}

.table td .badge {
    font-size: var(--cw-text-2xs);
}

/* Shrink-to-fit column (2026-08-29, Rejestracja Godz. od/Godz. do/Czas) - width:1% makes a table
   column take only the space its content needs (the browser distributes the rest to columns
   without it), white-space:nowrap stops the short time/duration values from wrapping and
   defeating that. Frees up room for Typ/Opis, which actually need it. */
.table-col-fit {
    width: 1%;
    white-space: nowrap;
}

/* Poprawka na wyraźną prośbę: a table-col-fit column sitting right next to a normal (non-icon)
   column - e.g. Miesiąc/Kwota do FV, Data/Nazwa - read as "too close" with just Bootstrap's own
   cell padding (0.25rem on a .table-sm, 0.5rem otherwise). Ties Bootstrap's own padding rule on
   specificity (one class + one :not()), so this wins on source order (app.css loads after
   bootstrap.css) without needing !important. Icon-action columns never carry table-col-fit (they
   rely on the :last-child rule below instead), so this never affects them. */
td.table-col-fit,
th.table-col-fit {
    padding-right: var(--cw-space-5);
}

/* Poprawki P2, Faza 0: global fix for "empty space after the action icons" - every grid in the
   app follows the same convention (trailing header-less column holding the row's action
   buttons), so a single last-child rule shrinks that column to its content and pushes it flush
   right instead of hand-adding .table-col-fit to every grid's action column individually. */
.table th:last-child,
.table td:last-child {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

/* Poprawki P2: opt-out for a grid whose last column is real data (e.g. Billing.razor's "Kwota do
   FV"/"Opis"), not action icons - the rule above wrongly shrank+right-aligned+nowrapped it too,
   throwing off every other column's width (a numeric column ended up abnormally wide because the
   real last column stole the "shrink to content" treatment meant for icons). Higher specificity
   (two classes + element vs. the rule above's one class + element) wins without needing !important. */
.table th.table-col-normal:last-child,
.table td.table-col-normal:last-child {
    width: auto;
    white-space: normal;
    text-align: left;
}

/* Poprawka na wyraźną prośbę: Rozliczenia - te tabele nie są duże, więc równe, proporcjonalne
   kolumny wyglądają lepiej niż dopasowane do treści. table-layout:fixed z każdą kolumną bez
   jawnej szerokości dzieli tabelę na równe części automatycznie. Neutralizuje też last-child'ową
   regułę powyżej (ta wymuszałaby węższą, przyklejoną-do-prawej ostatnią kolumnę - tu ma być tej
   samej szerokości i wyrównania co pozostałe, zwykłe dane, np. "Opis"). Kolumna "Dodatkowe koszty"
   (sama ikonka) dostaje wyśrodkowanie osobno, przez zwykłe Bootstrapowe .text-center na komórce -
   to jedyna kolumna, dla której środek ma sens. */
.table.table-cols-equal {
    table-layout: fixed;
}

    .table.table-cols-equal th:last-child,
    .table.table-cols-equal td:last-child {
        width: auto;
        white-space: normal;
        text-align: left;
    }

/* ui-data-grid-and-tabs (Faza 3): the zebra stripe of shared tables is gone - the new look separates rows with a soft
   line and highlights the hovered one (design-system.md, "Tabela / DataGrid"). */

/* --- Home page --- */

.page-loading {
    color: var(--cw-text-3);
    padding: 2rem 0;
}

.hero {
    max-width: 42rem;
    padding: 2rem 0 1rem;
}

.hero-subtitle {
    color: var(--cw-text-3);
    font-size: var(--cw-text-lg);
    margin: 1rem 0 1.75rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.page-header {
    margin-bottom: var(--cw-space-3);
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.page-subtitle {
    color: var(--cw-text-3);
}

/* Klasy narzędziowe zamiast statycznych style="" (kryterium ukończenia fazy ekranowej). */
.cw-text-xs { font-size: var(--cw-text-xs); }
.cw-text-2xs { font-size: var(--cw-text-2xs); }
.cw-mono-sm { font-family: ui-monospace, Consolas, monospace; font-size: var(--cw-text-sm); }
.cw-pre-wrap { white-space: pre-wrap; }
.cw-pointer { cursor: pointer; }
.cw-w-4rem { width: 4rem; }
.cw-w-5-5rem { width: 5.5rem; }
.cw-w-fill-1-5rem { width: calc(100% - 1.5rem); }
.cw-mw-6rem { max-width: 6rem; }
.cw-mw-8rem { max-width: 8rem; }
.cw-mw-20rem { max-width: 20rem; }
.cw-mw-22rem { max-width: 22rem; }
.cw-mw-26rem { max-width: 26rem; }
.cw-logo-footer { max-height: 2.5rem; object-fit: contain; border-radius: var(--cw-radius-sm); }
.cw-code-block { background: var(--cw-surface-2); border-radius: var(--cw-radius-sm); word-break: break-all; }
.cw-lead-in { margin: 0 0 0.75rem; }
.cw-color-swatch { display: inline-block; width: 1.25rem; height: 1.25rem; border-radius: var(--cw-radius-sm); background: var(--swatch-bg); vertical-align: middle; }
.cw-logo-thumb { width: 2.5rem; height: 2.5rem; object-fit: contain; border-radius: var(--cw-radius-sm); }

.empty-state {
    background: var(--cw-surface);
    border: 1px dashed var(--cw-border);
    border-radius: var(--cw-radius-card);
    padding: 2rem;
    color: var(--cw-text-2);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--cw-ok);
}

.invalid {
    outline: 1px solid var(--cw-danger);
}

/* time-per-project: a field that failed validation (EditForm's .invalid) gets a red frame and tint like .cw-input -
   design-system.md "Pole formularza", state "błąd" - and keeps it while focused, so the user sees what to fix. */
.form-control.invalid,
.form-select.invalid {
    border-color: var(--cw-danger);
    background-color: var(--cw-danger-tint);
}

    .form-control.invalid:focus,
    .form-select.invalid:focus {
        border-color: var(--cw-danger);
        box-shadow: 0 0 0 3px var(--cw-danger-tint);
    }

.validation-message {
    color: var(--cw-danger-strong);
}

/* Nieobsłużony wyjątek Blazora: pasek u dołu w tokenach (komunikat z kolorem ostrzeżenia + tekst, nie sam kolor). */
#blazor-error-ui {
    background: var(--cw-warn-tint);
    color: var(--cw-text);
    border-top: 2px solid var(--cw-warn);
    bottom: 0;
    box-shadow: var(--cw-shadow-popover);
    box-sizing: border-box;
    display: none;
    font-size: var(--cw-text-sm);
    left: 0;
    padding: var(--cw-space-3) var(--cw-space-8) var(--cw-space-3) var(--cw-space-5);
    position: fixed;
    width: 100%;
    z-index: var(--cw-z-floating);
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Boot splash (index.html, before Blazor has booted): the brand backdrop and ghost tiles of AuthShell, duplicated
   as plain unscoped rules because static index.html markup never gets Blazor's CSS-isolation attribute. Keep the
   two in sync if the pages before login change. */
.boot-loading {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--cw-brand-backdrop);
}

/* Logo 164 blown up behind the splash, as on AuthShell's left half (.auth-ghost): eight tiles, the eighth amber. */
.boot-loading-ghost {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: repeat(4, 128px);
    gap: 12px;
    pointer-events: none;
}

    .boot-loading-ghost i {
        height: 128px;
        border-radius: 24px;
        background: #ffffff;
    }

        .boot-loading-ghost i:nth-child(1) { opacity: 0.03; }
        .boot-loading-ghost i:nth-child(2) { opacity: 0.04; }
        .boot-loading-ghost i:nth-child(3) { opacity: 0.05; }
        .boot-loading-ghost i:nth-child(4) { opacity: 0.06; }
        .boot-loading-ghost i:nth-child(5) { opacity: 0.07; }
        .boot-loading-ghost i:nth-child(6) { opacity: 0.08; }
        .boot-loading-ghost i:nth-child(7) { opacity: 0.09; }

        .boot-loading-ghost i:nth-child(8) {
            background: var(--cw-brand-amber);
            opacity: 0.22;
        }

@media (max-width: 640px) {
    .boot-loading-ghost {
        grid-template-columns: repeat(4, 64px);
        gap: 8px;
    }

        .boot-loading-ghost i {
            height: 64px;
            border-radius: var(--cw-radius-card);
        }
}

/* Logo 164 in its Dark variant (BrandLogoVariant.Dark): white tiles, the eighth tile and "work" amber. */
.boot-loading-mark {
    position: relative;
    z-index: 1;
    display: block;
    width: 6rem;
    height: 6rem;
}

.boot-loading-tile {
    fill: #ffffff;
}

.boot-loading-tile-now {
    fill: var(--cw-brand-amber);
}

/* The mark doubles as the progress bar: Blazor sets --blazor-load-percentage while it downloads, and each of the
   eight tiles lights up over its own 12.5 % (from a faint 15 % to the logo's own opacity, 0.4 -> 1). CSS only,
   so it works before any script of ours runs; without the variable (not started yet) every tile stays faint. */
.boot-loading-mark rect {
    --boot-p: var(--blazor-load-percentage, 0%);
    opacity: clamp(15%, (var(--boot-p) - var(--boot-from)) * 8, var(--boot-max));
    transition: opacity 0.2s linear;
}

    .boot-loading-mark rect:nth-of-type(1) { --boot-from: 0%; --boot-max: 40%; }
    .boot-loading-mark rect:nth-of-type(2) { --boot-from: 12.5%; --boot-max: 50%; }
    .boot-loading-mark rect:nth-of-type(3) { --boot-from: 25%; --boot-max: 60%; }
    .boot-loading-mark rect:nth-of-type(4) { --boot-from: 37.5%; --boot-max: 70%; }
    .boot-loading-mark rect:nth-of-type(5) { --boot-from: 50%; --boot-max: 80%; }
    .boot-loading-mark rect:nth-of-type(6) { --boot-from: 62.5%; --boot-max: 90%; }
    .boot-loading-mark rect:nth-of-type(7) { --boot-from: 75%; --boot-max: 100%; }
    .boot-loading-mark rect:nth-of-type(8) { --boot-from: 87.5%; --boot-max: 100%; }

.boot-loading-brand {
    position: relative;
    z-index: 1;
    color: #ffffff;
    font-size: var(--cw-text-3xl);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.04em;
}

    .boot-loading-brand b {
        font-weight: 800;
        color: var(--cw-brand-amber);
    }

.loading-progress-text {
    position: relative;
    z-index: 1;
    text-align: center;
    font-weight: 600;
    font-size: var(--cw-text-sm);
    color: rgba(255, 255, 255, 0.85);
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Ładowanie");
    }

code {
    color: var(--cw-code);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Legal pages (Regulamin / Polityka prywatności): the brand backdrop of the pages before login with a fixed
   white card - fixed, not the theme's --cw-surface, so a long text never turns dark in "noc" (17.10). */
.legal-page {
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
    padding: var(--cw-space-8) var(--cw-space-4) 48px;
    background: var(--cw-brand-backdrop);
    font-family: var(--cw-font-sans);
}

.legal-card {
    /* Long reading text: stays at 14 px, outside the 12 px rule for normal text (decided 18.10). */
    font-size: var(--cw-text-md);
    max-width: 820px;
    margin: 0 auto;
    padding: var(--cw-space-6) var(--cw-space-8) var(--cw-space-8);
    border-radius: var(--cw-radius-card);
    background: #ffffff;
    color: var(--cw-brand-text);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.legal-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--cw-space-3);
    padding-bottom: var(--cw-space-5);
    margin-bottom: var(--cw-space-6);
    border-bottom: 1px solid var(--cw-brand-rule);
}

.legal-brand {
    display: inline-flex;
    text-decoration: none;
}

.legal-page a {
    color: var(--cw-brand-teal);
}

.legal-back {
    font-size: var(--cw-text-sm);
    font-weight: var(--cw-weight-semibold);
    text-decoration: none;
}

    .legal-back:hover {
        text-decoration: underline;
    }

.legal-page a:focus-visible {
    outline: 2px solid var(--cw-brand-teal);
    outline-offset: var(--cw-focus-offset);
    border-radius: var(--cw-radius-xs);
}

.legal-content h1 {
    margin: 0 0 var(--cw-space-1);
    font-size: var(--cw-text-3xl);
    font-weight: 700;
    letter-spacing: var(--cw-letter-spacing-tight);
    color: var(--cw-brand-ink);
}

.legal-updated {
    color: var(--cw-brand-text-2);
    font-size: var(--cw-text-sm);
    margin-bottom: var(--cw-space-8);
}

.legal-content h2,
.legal-content h3 {
    font-size: var(--cw-text-xl);
    font-weight: 700;
    margin-top: var(--cw-space-8);
    margin-bottom: var(--cw-space-3);
    color: var(--cw-brand-ink);
}

.legal-content p, .legal-content li {
    color: var(--cw-brand-text);
    line-height: 1.6;
}

.legal-content strong {
    color: var(--cw-brand-ink);
}

.legal-content ul {
    padding-left: 1.25rem;
}

.legal-footer-link {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--cw-brand-rule);
}

@media (max-width: 640px) {
    .legal-page {
        padding: var(--cw-space-4) var(--cw-space-3) var(--cw-space-8);
    }

    .legal-card {
        padding: var(--cw-space-5) var(--cw-space-4) var(--cw-space-6);
    }
}

/* App footer with links to legal pages */
/* ui-dialogs-and-notices (Faza 2): variant A, warning tone - used as is when the admin set no colours of their own;
   StyleFor() in AnnouncementBanner.razor overrides background/border/text per announcement. */
.announcement-banner {
    background: var(--cw-warnbox);
    border-bottom: 1px solid var(--cw-border-soft);
    color: var(--cw-warnbox-text);
    padding: var(--cw-space-3) var(--cw-space-6);
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-medium);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: var(--cw-space-3);
}

    .announcement-banner svg {
        flex-shrink: 0;
        margin-top: 1px;
    }

.announcement-banner-content {
    min-width: 0;
}

/* Result banner for a finished Jira sync batch - deliberately a different look (info-blue, not
   warning-yellow) and behavior (has a close button + auto-dismiss) from .announcement-banner
   above, since it's a one-off completion notice rather than a standing system-wide notice. */
.registration-layout {
    display: grid;
    /* billing-readability: minmax(0, ...) - bez tego kolumna nie zwęża się poniżej szerokości tabeli i strona robi się szersza od okna. */
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
    gap: 1.5rem;
}

@media (max-width: 1280px) {
    .registration-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

.registration-ticket-shortcuts {
    max-width: none;
}

.ticket-shortcut-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

    .ticket-shortcut-toolbar input[type="search"] {
        flex: 1 1 auto;
    }

    .ticket-shortcut-toolbar .ticket-shortcut-font-size {
        flex: 0 0 auto;
        width: auto;
    }

/* Shared Skróty+Notatki font-size/expand controls (poprawki-p2 follow-up) - sits inline in
   the TabStrip Actions slot now (own row's flex/justify-content handles the right-alignment),
   so the toolbar's usual bottom margin (meant for separating it from the list below) is dropped. */
.ticket-shortcut-toolbar-shared {
    justify-content: flex-end;
    margin-bottom: 0;
}

.ticket-shortcut-list {
    max-height: 320px;
    overflow-y: auto;
    font-size: var(--cw-text-xs);
    transition: max-height 0.15s ease;
}

/* Side-panel empty states keep the panel's smaller text (they used an inline font-size before
   moving into DataGrid). */
.registration-ticket-shortcuts .data-grid-empty {
    font-size: var(--cw-text-xs);
}

    .ticket-shortcut-list.font-size-small {
        font-size: var(--cw-text-2xs);
    }

    .ticket-shortcut-list.font-size-medium {
        font-size: var(--cw-text-xs);
    }

    .ticket-shortcut-list.font-size-large {
        font-size: var(--cw-text-sm);
    }

    /* Bug fix: Skróty/Notatki render a <table class="table">, and .table has its own fixed
       font-size (0.85rem) that always wins over an ANCESTOR's font-size (inheritance is weaker
       than any rule that targets the element directly, regardless of specificity) - so the
       selector above never actually changed anything visible. These target the table itself. */
    .ticket-shortcut-list.font-size-small .table {
        font-size: var(--cw-text-2xs);
    }

    .ticket-shortcut-list.font-size-medium .table {
        font-size: var(--cw-text-xs);
    }

    .ticket-shortcut-list.font-size-large .table {
        font-size: var(--cw-text-sm);
    }

    /* ui-data-grid-and-tabs: the user picks one size for the whole list, so the header cells take that size too - a cell
       is never larger than its header (design-system.md, "Tabela / DataGrid"). */
    .ticket-shortcut-list .table thead th {
        font-size: inherit;
    }

    .ticket-shortcut-list.expanded {
        max-height: 720px;
    }

    /* Konfiguracja's notes list is the page's main content (not a sidebar panel like
       Registration's), so it gets a taller default without needing the expand toggle. Capped
       against viewport height (not just a flat px), so on shorter windows the list shrinks
       instead of pushing the app footer (Regulamin/Polityka prywatności) far below the fold. */
    .ticket-shortcut-list.ticket-shortcut-list-page {
        max-height: min(480px, 45vh);
    }

.ticket-shortcut-expand-chevron {
    display: inline-flex;
    transition: transform 0.15s ease;
}

    .ticket-shortcut-expand-chevron.expanded {
        transform: rotate(90deg);
    }

/* "Zaraportowano dziś" summary card (Rejestracja, 2026-08-29) - one card, toggle chevron always
   at its top-left corner in both states. Collapsed = just the chevron + compact summary in one
   row. Expanded = the chevron row sits above three columns (Zaraportowano/Czas per numer/Czas per
   typ), separated by a vertical divider that floats clear of the top/bottom edges. */
.registration-stats-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    /* .settings-card's default 1.75rem is sized for a card whose content fills it out - this
       card's toggle row is much shorter, so the default padding read as an oversized gap above
       the arrow (and, when collapsed, above/below the single row too). */
    padding: 0.6rem 1.25rem;
}

    /* Collapsed = just one slim row, even less padding needed. */
    .registration-stats-card.registration-stats-card-collapsed {
        padding: 0.5rem 1.25rem;
    }

/* Poprawki P9: on a phone the row wraps instead of pushing the sync button over the date field below, and the button keeps only its icon
   (its aria-label/title still say "Synchronizuj z Jirą"). */
.registration-stats-toggle-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    min-width: 0;
}

@media (max-width: 575.98px) {
    .registration-stats-sync .jira-sync-button-label {
        display: none;
    }
}

.registration-stats-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

/* Pushes the dot+status group to the right edge of the row - the sync icon right after it keeps
   its own small, fixed gap (not another auto-margin) so it hugs the status text instead of
   floating off toward the row's far edge. */
.registration-stats-jira-right {
    margin-left: auto;
}

.registration-stats-sync {
    margin-left: 10px;
}

/* Shared look for every "Synchronizuj z Jirą" button (Rejestracja czasu pracy + Kalendarz) -
   icon + label, spaced consistently regardless of the surrounding btn-* size modifier. */
.jira-sync-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.registration-stats-bar-label {
    color: var(--cw-text-3);
}

.registration-stats-bar-jira {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.registration-stats-bar-jira-status {
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

/* Górny obszar Rejestracji ma stałą wysokość (nic nie skacze przy zmianie dnia): każda kolumna ma tyle samo miejsca, a lista „czas per zgłoszenie /
   słownik” pokazuje 4 pozycje, przy większej liczbie się przewija. 9,1 rem = etykieta + 4 wiersze po ok. 1,7 rem. */
.registration-stats-columns {
    display: flex;
    flex-wrap: nowrap; /* jedna linia o stałej wysokości - kolumny rozciągają się do niej, a lista w kolumnie przewija się zamiast ją rozpychać */
    height: 9.1rem;
}

.registration-stats-col {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    min-height: 0;
    padding: 0 1.5rem;
    position: relative;
}

.registration-stats-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    /* Odstęp między wartościami a suwakiem: miejsce na suwak jest zarezerwowane, a wartości mają jeszcze własny oddech - nie nachodzą na suwak. */
    scrollbar-gutter: stable;
    padding-right: var(--cw-space-3);
}

    .registration-stats-col:first-child {
        padding-left: 0;
    }

    .registration-stats-col:last-child {
        padding-right: 0;
    }

    /* The divider itself - a floating vertical line to the left of every column but the first,
       inset from the card's top/bottom edges (not a full-height border). */
    .registration-stats-col + .registration-stats-col::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0.25rem;
        bottom: 0.25rem;
        width: 1px;
        background: var(--cw-border);
    }

@media (max-width: 768px) {
    /* Kolumny jedna pod drugą: wysokość wynika z treści, a lista nadal pokazuje najwyżej ok. 5 wierszy. */
    .registration-stats-columns {
        flex-direction: column;
        flex-wrap: wrap;
        height: auto;
    }

    .registration-stats-list {
        flex: 0 0 auto;
        max-height: 8.5rem;
    }

    .registration-stats-col {
        /* billing-readability: w kolumnie o wysokości „auto” flex: 1 1 0 zapadał kolumny do zera i treść wylewała się poza kartę (700 i 390 px). */
        flex: 0 0 auto;
        padding: 0.75rem 0;
    }

        .registration-stats-col:first-child {
            padding-top: 0;
        }

        .registration-stats-col:last-child {
            padding-bottom: 0;
        }

        /* Stacked layout - the divider flips to a horizontal line above each column but the
           first, inset from the left/right edges instead of top/bottom. */
        .registration-stats-col + .registration-stats-col::before {
            left: 0.25rem;
            right: 0.25rem;
            top: 0;
            bottom: auto;
            width: auto;
            height: 1px;
        }
}

/* Icon-only toggle button (2026-08-29) - no visible button chrome (border/background), just the
   chevron itself, since the whole bar is already clickable and a fully-styled button here would
   compete visually with the compact summary text next to it. */
.btn-icon-plain {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0.15rem;
    color: var(--cw-text-3);
    cursor: pointer;
}

    .btn-icon-plain:hover {
        color: var(--cw-primary-strong);
    }

/* Explicit request: the grid "Pokaż opis" icon (Registration.razor/Configuration.razor) reads as
   grey inside .btn-icon-plain (color: var(--cw-text-3)) - overridden to the app's near-
   black body-text color on the icon itself, which wins over the inherited grey without touching
   .btn-icon-plain (still used unmodified by Registration.razor's unrelated stats-collapse
   toggle). Deliberately static, not swapping to the accent color on hover like the button around
   it still does for OTHER icons - the whole point here was "always black", not "black until
   hovered". */
.document-icon-dark {
    color: var(--cw-text);
}

/* Registration.razor's Opis "speech bubble" (poprawki-p2 follow-up, explicit request) - a comic-
   style callout anchored to the clicked note icon (see Registration.razor.js), not a centered
   Modal. Position is set to fixed with inline top/left by the JS (--tail-left is the only piece
   set from Razor, since only the .NET side knows which entry's icon was clicked). Invisible
   full-viewport backdrop + outside-click-to-close, same idiom as PolishDatePicker's own popup -
   deliberately NOT Modal.razor's "close only via the X" rule, since this reads as a lightweight
   tooltip-like popover, not a dialog. */
.description-bubble-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1055;
    background: transparent;
}

/* ui-dialogs-and-notices (Faza 3): variant B of board 6b - a light card with a tail, on --cw-* (Noc gets a dark card,
   it floats above everything). z-index above every stacked window (Modal.razor.js raises each by one from 1050). */
.description-bubble {
    top: var(--bubble-top, 0);
    left: var(--bubble-left, 0);
    position: fixed;
    z-index: 1070;
    background: var(--cw-surface);
    color: var(--cw-text);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-md);
    box-shadow: var(--cw-shadow-popover);
    padding: var(--cw-space-3) var(--cw-space-8) var(--cw-space-3) var(--cw-space-4);
    max-width: 22rem;
    white-space: pre-line;
    font-size: var(--cw-text-xs);
    line-height: var(--cw-leading-body);
    /* top/left start at 0/0 (Razor's default double fields) until Registration.razor.js computes
       the real coordinates - hidden until then so there's no one-frame flash at the wrong spot. */
    visibility: hidden;
}

    .description-bubble.positioned {
        visibility: visible;
    }

.description-bubble-close {
    position: absolute;
    top: var(--cw-space-1-5);
    right: var(--cw-space-1-5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: var(--cw-radius-sm);
    background: none;
    color: var(--cw-muted);
    cursor: pointer;
}

    .description-bubble-close:hover {
        background: var(--cw-hover-strong);
        color: var(--cw-text);
    }

/* The tail: two stacked triangles (border color, then a slightly smaller surface-color one on
   top) - the standard CSS speech-bubble trick for faking a 1px border on the pointer itself.
   Points up by default (bubble sits below the icon); .flipped points down instead (bubble sits
   above the icon, per Registration.razor.js's viewport-edge flip). */
.description-bubble::before,
.description-bubble::after {
    content: "";
    position: absolute;
    left: var(--tail-left, 1rem);
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
}

.description-bubble::before {
    top: -9px;
    border-bottom: 9px solid var(--cw-border);
}

.description-bubble::after {
    top: -8px;
    border-bottom: 8px solid var(--cw-surface);
}

.description-bubble.flipped::before {
    top: auto;
    bottom: -9px;
    border-bottom: none;
    border-top: 9px solid var(--cw-border);
}

.description-bubble.flipped::after {
    top: auto;
    bottom: -8px;
    border-bottom: none;
    border-top: 8px solid var(--cw-surface);
}

.ticket-note-group-header {
    font-weight: 700;
    font-size: var(--cw-text-2xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--cw-text-3);
    margin-top: 0.75rem;
}

    .ticket-note-group-header:first-child {
        margin-top: 0;
    }

    .ticket-shortcut-list.font-size-small .ticket-note-group-header {
        font-size: var(--cw-text-2xs);
        margin-top: 0.5rem;
    }

    .ticket-shortcut-list.font-size-large .ticket-note-group-header {
        font-size: var(--cw-text-xs);
        margin-top: 0.9rem;
    }

/* Poprawki-p2 follow-up (per explicit request): Skróty is now a normal <table> (nr zgłoszenia,
   tytuł, actions - headers, filters, same idiom as the Notatki table right next to it), not a
   bespoke flex row - only the ticket-number-as-link button needs its own rule. */
/* Code-review/explicit follow-up: font type and size must match the rest of the table (and
   Notatki's own table) exactly - only color+cursor signal "this is clickable", no bold override,
   so this reads as the same typeface as every other cell instead of visually standing out. */
.ticket-shortcut-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--cw-primary-strong);
    cursor: pointer;
    text-align: left;
}

    .ticket-shortcut-link:hover {
        color: var(--cw-primary-strong);
        text-decoration: underline;
    }

.jira-json-preview-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    font-weight: 500;
    color: var(--cw-text);
}

    .jira-json-preview-toggle:hover {
        color: var(--cw-primary-strong);
    }

.jira-json-preview-chevron {
    display: inline-flex;
    transition: transform 0.15s ease;
}

    .jira-json-preview-chevron.expanded {
        transform: rotate(90deg);
    }

.jira-json-preview {
    background: var(--cw-surface-2);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-sm);
    padding: 0.75rem 1rem;
    font-size: var(--cw-text-xs);
    max-height: 320px;
    overflow: auto;
    white-space: pre;
}

/* ui-dialogs-and-notices (Faza 2): variant A of board 6b - the whole strip in the state's tint, text and icon in its
   "strong" colour; info (a Jira sync in progress) blue, success green, warning amber, error red. Colours come from the
   --cw-notice-* tokens (poprawki-po-visual-design-system: editable per theme in „Kolory i motywy”, stock values clearly
   apart from --cw-bg - the old --cw-ok-tint / --cw-primary-tint blended into Morski). */
.notification-banner {
    background: var(--cw-notice-info-bg);
    border-bottom: 1px solid var(--cw-border-soft);
    color: var(--cw-notice-info-text);
    padding: var(--cw-space-3) var(--cw-space-6);
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-medium);
    display: flex;
    align-items: flex-start;
    gap: var(--cw-space-3);
}

    .notification-banner-icon {
        flex-shrink: 0;
        margin-top: 1px;
    }

.notification-banner-text {
    flex: 1;
    min-width: 0;
}

/* Pinned while the page scrolls, instead of scrolling away with the rest of the content - right
   under the fixed TopBar (see --topbar-height's own comment), phones too: they have the compact top
   bar (ui-shell-theme-nav, Faza 6), and a save error raised from a modal after scrolling down must
   not land above the viewport, behind the overlay (2026-10-07).
   poprawki-po-visual-design-system: the admin's announcement used to scroll away (only the save
   result was sticky). Both now sit in one sticky .cw-banners, one under the other - two sticky
   siblings with the same top would overlap. Sticky sits on .cw-banners since it is the direct child
   of <main>. Pre-login pages (EmptyLayout) have no top bar: .cw-banners--top pins to the very top. */
.cw-banners {
    position: sticky;
    top: var(--topbar-height);
    z-index: 900;
}

.cw-banners--top {
    top: 0;
}

/* The slide-in menu is open on a phone: the page behind it does not scroll. */
@media (max-width: 640.98px) {
    body:has(.sidebar.open) {
        overflow: hidden;
    }
}

/* Slide-in/out from under the TopBar. The wrap's grid row animates 0fr <-> 1fr so the page
   content below moves smoothly instead of jumping when the banner's own height appears/
   disappears; the banner itself slides by its own height inside the clip, so it never overlaps
   the TopBar. z-index (on .cw-banners, the sticky box) stays under the TopBar (1000) so its account
   menu opens over the banner - but goes above .modal-overlay (1050) while a modal is open: a save
   result (e.g. a server error while a popup stays open with the user's input) must be visible on
   top of that modal. */
.notification-banner-wrap {
    display: grid;
    grid-template-rows: 1fr;
    animation: notification-banner-wrap-in 250ms ease-out;
}

body:has(.modal-overlay) .cw-banners {
    z-index: 1060;
}

.notification-banner-clip {
    min-height: 0;
    overflow: hidden;
}

.notification-banner-wrap .notification-banner {
    animation: notification-banner-slide-in 250ms ease-out;
}

/* Duration must match NotificationBanner.razor's LeaveAnimationDuration. */
.notification-banner-wrap.notification-banner-leaving {
    animation: notification-banner-wrap-out 300ms ease-in forwards;
}

    .notification-banner-wrap.notification-banner-leaving .notification-banner {
        animation: notification-banner-slide-out 300ms ease-in forwards;
    }

/* google-integration, Faza 7: pasek po zakończeniu spotkania (wzorzec „Komunikat z akcją”). Kolor „informacja” jak NotificationBanner, tylko tokeny --cw-notice-info-*.
   Nieblokujący: stoi w .cw-banners pod paskiem górnym, w jednej linii (tytuł + dwa przyciski), poniżej 640 px krótszy tekst i przyciski pod nim. */
.cw-meeting-bar {
    background: var(--cw-notice-info-bg);
    border-bottom: 1px solid var(--cw-border-soft);
    color: var(--cw-notice-info-text);
    padding: var(--cw-space-2) var(--cw-space-6);
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-medium);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--cw-space-3);
}

    .cw-meeting-bar-icon {
        flex-shrink: 0;
    }

/* Fokus programowy na <main> (MeetingEndedBar.razor.js focusMain): kontener, nie element interaktywny, więc bez obrysu. */
main[tabindex="-1"]:focus {
    outline: none;
}

    .cw-meeting-bar-text {
        flex: 1 1 18rem;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .cw-meeting-bar-short {
        display: none;
    }

    .cw-meeting-bar-more {
        margin-left: var(--cw-space-2);
        font-weight: var(--cw-weight-semibold);
        white-space: nowrap;
    }

    .cw-meeting-bar-actions {
        display: inline-flex;
        align-items: center;
        gap: var(--cw-space-2);
        flex-shrink: 0;
    }

    /* Przyciski w kolorze tekstu paska (kontrast tekstu do tła paska jest pilnowany przez ThemeColorCatalogTests). */
    .cw-meeting-bar-btn {
        display: inline-flex;
        align-items: center;
        gap: var(--cw-space-1);
        min-height: 32px;
        border: 1px solid var(--cw-notice-info-text);
        background: transparent;
        color: var(--cw-notice-info-text);
    }

        .cw-meeting-bar-btn:hover:not(:disabled) {
            background: color-mix(in srgb, var(--cw-notice-info-text) 12%, transparent);
            color: var(--cw-notice-info-text);
        }

        .cw-meeting-bar-btn:focus-visible {
            outline: 2px solid var(--cw-notice-info-text);
            outline-offset: 2px;
        }

    .cw-meeting-bar-btn--primary {
        background: var(--cw-notice-info-text);
        color: var(--cw-notice-info-bg);
    }

        .cw-meeting-bar-btn--primary:hover:not(:disabled) {
            background: var(--cw-notice-info-text);
            color: var(--cw-notice-info-bg);
            opacity: .88;
        }

@media (max-width: 640px) {
    .cw-meeting-bar {
        padding: var(--cw-space-2) var(--cw-space-4);
    }

    .cw-meeting-bar-long {
        display: none;
    }

    .cw-meeting-bar-short {
        display: inline;
    }

    .cw-meeting-bar-actions {
        flex-basis: 100%;
    }
}

@keyframes notification-banner-wrap-in {
    from { grid-template-rows: 0fr; }
    to { grid-template-rows: 1fr; }
}

@keyframes notification-banner-wrap-out {
    from { grid-template-rows: 1fr; }
    to { grid-template-rows: 0fr; }
}

@keyframes notification-banner-slide-in {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes notification-banner-slide-out {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-100%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .notification-banner-wrap,
    .notification-banner-wrap .notification-banner,
    .notification-banner-wrap.notification-banner-leaving,
    .notification-banner-wrap.notification-banner-leaving .notification-banner {
        animation: none;
    }
}

.jira-ticket-link {
    margin-left: 0.35rem;
    color: var(--cw-text-3);
    display: inline-flex;
    vertical-align: middle;
}

    .jira-ticket-link:hover {
        color: var(--cw-primary-strong);
    }

/* The X of a banner: a 28 px icon button in the banner's own colour (an admin may set the announcement's). */
.notification-banner-close,
.announcement-banner-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin: -4px -4px -4px 0;
    padding: 0;
    border: 0;
    border-radius: var(--cw-radius-sm);
    background: transparent;
    color: inherit;
    opacity: 0.8;
    cursor: pointer;
}

    .notification-banner-close:hover,
    .announcement-banner-close:hover {
        opacity: 1;
        background: color-mix(in srgb, currentColor 10%, transparent);
    }

/* Touch screens: the close X's grow to --cw-target-min. The bubble's X sits in the corner over its padding,
   so it keeps its 24 px look and only its hit area grows (::after). */
@media (pointer: coarse) {
    .modal-close,
    .notification-banner-close,
    .announcement-banner-close {
        width: var(--cw-target-min);
        height: var(--cw-target-min);
    }

    .notification-banner-close,
    .announcement-banner-close {
        margin: -8px -8px -8px 0;
    }

    .description-bubble-close::after {
        content: "";
        position: absolute;
        inset: calc((var(--cw-target-min) - 24px) / -2);
    }
}

.notification-banner-success {
    background: var(--cw-notice-ok-bg);
    color: var(--cw-notice-ok-text);
}

/* poprawki-po-visual-design-system: partial success or "not saved, because..." (e.g. a stopwatch run under a minute). */
.notification-banner-warning {
    background: var(--cw-notice-warn-bg);
    color: var(--cw-notice-warn-text);
}

.notification-banner-error {
    background: var(--cw-notice-err-bg);
    color: var(--cw-notice-err-text);
}

.app-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    padding-bottom: 1.5rem;
    border-top: 1px solid var(--cw-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

.app-footer-links {
    display: flex;
    gap: 1rem;
}

.app-footer a {
    color: var(--cw-text-3);
}

/* Cookie notice (ui-dialogs-and-notices, Faza 2): a light card above the bottom edge (board 6b) - the text stays the
   full legal wording. Over the menu and the sheet alike, so it follows the theme's own --cw-* (Noc included). */
.cookie-banner {
    position: fixed;
    left: var(--cw-space-4);
    right: var(--cw-space-4);
    bottom: var(--cw-space-4);
    z-index: var(--cw-z-dropdown);
    background: var(--cw-surface);
    color: var(--cw-text-2);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-lg);
    box-shadow: var(--cw-shadow-popover);
    padding: var(--cw-space-3) var(--cw-space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--cw-space-4);
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1 1 32rem;
    margin: 0;
    font-size: var(--cw-text-xs);
    line-height: var(--cw-leading-body);
}

    .cookie-banner-text a {
        color: var(--cw-link);
    }

.cookie-banner-actions {
    display: flex;
    gap: var(--cw-space-3);
    flex-shrink: 0;
}

/* ksef-incoming-invoices: purchase invoice preview (PurchaseInvoices.razor modal) - layout per
   context/foundation/web-design-brief.md: a "Do przelewu" panel (amount, due date, account,
   transfer title - each copyable), then a details grid, then the actions. Existing tokens only. */
.invoice-pay-panel {
    background: var(--cw-bg);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.invoice-pay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Same type as the row labels (.invoice-pay-rows dt), only bold - the panel heading. */
.invoice-pay-label {
    font-size: var(--cw-text-xs);
    font-weight: 700;
    color: var(--cw-text-3);
}

.invoice-pay-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.invoice-pay-rows {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 1rem;
    row-gap: 0.6rem;
    margin: 0;
    align-items: baseline;
}

.invoice-pay-rows dt {
    font-weight: 400;
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

.invoice-pay-rows dd {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.5rem;
    min-width: 0;
}

.invoice-pay-rows dd .page-subtitle {
    flex-basis: 100%;
    margin: 0;
    font-size: var(--cw-text-xs);
}

.invoice-pay-value {
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.invoice-overdue {
    color: var(--cw-danger-strong);
    font-weight: 600;
}

.invoice-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem 1.5rem;
    margin: 0 0 1.25rem;
}

.invoice-details dt {
    font-weight: 400;
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

.invoice-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.invoice-numbers {
    font-variant-numeric: tabular-nums;
}

.invoice-ksef-number {
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
    word-break: break-all;
}

/* Editable rows (Zapłata, Archiwum) span both columns of the details grid. */
.invoice-details-full {
    grid-column: 1 / -1;
}

.invoice-paid-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.invoice-paid-field .page-subtitle,
.invoice-details-full .page-subtitle {
    display: block;
    margin: 0.25rem 0 0;
    font-size: var(--cw-text-xs);
}

@media (min-width: 576px) {
    .invoice-details {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== ui-dashboard (Faza 1): ogólne komponenty .cw-card / .cw-chip / .cw-pill (Shared/Ui) + elementy Dashboardu .dash-* =====
   Globalne klasy, nie CSS-isolation (jak AuthShell): jedno miejsce zmian dla każdego ekranu. Tylko tokeny --cw-*; kolory
   statusów (pierścień, pasek, wykres) czytają --color-status-* tam, gdzie je podaje komponent wywołujący. */

.cw-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-card);
    box-shadow: var(--cw-shadow);
}

/* Nagłówek karty ma stałą wysokość, żeby wszystkie karty w rzędzie miały go równy niezależnie od opisu i długości tytułu:
   tytuł do dwóch linii (jednej, gdy jest opis), opis w jednej linii z wielokropkiem (pełny tekst w title). */
.cw-card-hd {
    display: flex;
    align-items: flex-start;
    gap: var(--cw-space-3);
    box-sizing: border-box;
    height: 4.25rem;
    padding: var(--cw-space-3) var(--cw-space-5) 0;
    border-bottom: 1px solid var(--cw-border-soft);
}

.cw-card-hd-text {
    flex: 1 1 auto;
    min-width: 0;
}

.cw-card-title-row {
    display: flex;
    align-items: center;
    gap: var(--cw-space-1);
    min-width: 0;
}

.cw-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: var(--cw-text-sm);
    font-weight: var(--cw-weight-semibold);
    line-height: 1.3;
    color: var(--cw-text);
}

.cw-card-hd-text:has(.cw-card-desc) .cw-card-title {
    -webkit-line-clamp: 1;
}

.cw-card-desc {
    margin: 1px 0 0;
    overflow: hidden;
    font-size: var(--cw-text-xs);
    line-height: 1.35;
    color: var(--cw-text-3);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-card-bd {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-3);
    flex: 1 1 auto;
    padding: var(--cw-space-4) var(--cw-space-5) var(--cw-space-5);
    font-variant-numeric: tabular-nums;
}

.cw-chip {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--cw-radius-md);
}

.cw-chip--primary { background: var(--cw-primary-tint); color: var(--cw-primary-strong); }
.cw-chip--sea { background: var(--cw-sea-tint); color: var(--cw-sea-strong); }
.cw-chip--earth { background: var(--cw-earth-tint); color: var(--cw-earth-strong); }

/* Rozmiary tekstu w kartach pulpitu są trzy: liczba 22 px, tekst i etykiety 12 px, opis w pierścieniu 10-15 px (mieści się w kole). */
.cw-num {
    font-variant-numeric: tabular-nums;
}

.cw-num-value {
    font-size: var(--cw-text-2xl);
    font-weight: var(--cw-weight-bold);
    letter-spacing: var(--cw-letter-spacing-tight);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.cw-num-note {
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

.cw-card-link {
    margin-top: auto;
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    color: var(--cw-link);
    text-decoration: none;
}

    .cw-card-link:hover {
        text-decoration: underline;
    }

/* Stany regionu karty. */
.cw-card-skeleton {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-2);
}

    .cw-card-skeleton span {
        display: block;
        height: 12px;
        border-radius: var(--cw-radius-pill);
        background: var(--cw-surface-3);
    }

        .cw-card-skeleton span:nth-child(1) { width: 55%; height: 24px; }
        .cw-card-skeleton span:nth-child(2) { width: 85%; }
        .cw-card-skeleton span:nth-child(3) { width: 40%; }

.cw-card-empty,
.cw-card-error {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--cw-space-3);
    color: var(--cw-text-3);
    font-size: var(--cw-text-xs);
}

    .cw-card-empty p,
    .cw-card-error p {
        margin: 0;
    }

.cw-card-error {
    color: var(--cw-danger-strong);
}

/* Pigułka statusu. */
.cw-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--cw-space-1-5);
    padding: 2px var(--cw-space-2-5);
    border-radius: var(--cw-radius-pill);
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    line-height: 1.4;
    white-space: nowrap;
}

.cw-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.cw-pill--danger { background: var(--cw-danger-tint); color: var(--cw-danger-strong); }
.cw-pill--warn { background: var(--cw-warn-tint); color: var(--cw-warn-strong); }
.cw-pill--primary { background: var(--cw-primary-tint); color: var(--cw-primary-strong); }
.cw-pill--ok { background: var(--cw-ok-tint); color: var(--cw-ok); }
.cw-pill--custom { background: var(--pill-bg); color: var(--pill-fg); }
.cw-pill--neutral { background: var(--cw-surface-3); color: var(--cw-text-2); }

/* --- Dashboard: pasek strony i kafle panelu właściciela --- */
.dash-page-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--cw-space-2);
    margin-bottom: var(--cw-space-5);
}

    .dash-page-bar .btn {
        gap: var(--cw-space-2);
    }

.dash-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--cw-space-4);
}

.dash-tile {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-3);
    padding: var(--cw-space-4) var(--cw-space-5);
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-card);
    box-shadow: var(--cw-shadow);
    color: var(--cw-text);
    text-decoration: none;
    transition: transform var(--cw-duration-fast) var(--cw-ease), box-shadow var(--cw-duration-fast) var(--cw-ease);
}

    .dash-tile:hover {
        color: var(--cw-text);
        transform: translateY(-2px);
        box-shadow: var(--cw-shadow-popover);
    }

    /* Poprawki P20: a transform makes the tile the containing block of its fixed (i) bubble - the lift on hover would move an open bubble. */
    .dash-tile:has(.description-bubble) {
        transform: none;
    }

    .dash-tile:focus-visible {
        outline: 2px solid var(--cw-primary-strong);
        outline-offset: 2px;
    }

.dash-tile-head {
    display: flex;
    align-items: center;
    gap: var(--cw-space-3);
}

.dash-tile-title {
    margin: 0;
    font-size: var(--cw-text-lg);
    font-weight: var(--cw-weight-semibold);
}

.dash-tile-desc {
    margin: 0;
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

.dash-tile-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cw-space-2);
}

/* Karta „Faktury do zapłaty”: pigułki jedna pod drugą - czytelniej niż dwie w jednym wierszu. */
.dash-tile-pills--stack {
    flex-direction: column;
    align-items: flex-start;
}

@media (prefers-reduced-motion: reduce) {
    .dash-tile {
        transition: none;
    }

        .dash-tile:hover {
            transform: none;
        }
}

/* ===== ui-dashboard (Faza 2): .cw-ring / .cw-bar (Shared/Ui) + siatka kart .dash-grid ===== */
.cw-ring {
    position: relative;
    flex: 0 0 auto;
    width: var(--ring-size, 84px);
    height: var(--ring-size, 84px);
}

.cw-ring-arc {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(var(--ring-color, var(--cw-primary)) calc(var(--pct, 0) * 1%), var(--cw-surface-3) 0);
    -webkit-mask: radial-gradient(circle, transparent 0 calc(var(--ring-size, 84px) * 0.38), #000 calc(var(--ring-size, 84px) * 0.39));
    mask: radial-gradient(circle, transparent 0 calc(var(--ring-size, 84px) * 0.38), #000 calc(var(--ring-size, 84px) * 0.39));
}

.cw-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-bold);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

/* Liczba i podpis w środku pierścienia mają być małe: inner koło ma ok. 64 px, więc „godz. zostało” zawija się i nie wychodzi poza nie. */
.cw-ring-center .cw-num-value {
    font-size: var(--cw-text-lg);
    line-height: 1.1;
}

.cw-ring-center .cw-num-note {
    max-width: 62%;
    font-weight: var(--cw-weight-regular);
    font-size: calc(var(--cw-text-2xs) - 2px);
    line-height: 1.1;
}

.cw-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--cw-space-2);
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
    font-variant-numeric: tabular-nums;
}

    .cw-bar:not(:has(.cw-bar-label)) {
        grid-template-columns: 1fr auto;
    }

.cw-bar-track {
    display: block;
    height: 8px;
    border-radius: var(--cw-radius-pill);
    background: var(--cw-surface-3);
    overflow: hidden;
}

.cw-bar-fill {
    display: block;
    width: calc(var(--pct, 0) * 1%);
    height: 100%;
    border-radius: var(--cw-radius-pill);
    background: var(--bar-color, var(--cw-primary));
}

.cw-bar-value {
    color: var(--cw-text);
    text-align: right;
}

.cw-tone-ok { color: var(--cw-ok); }
.cw-tone-danger { color: var(--cw-danger-strong); }
.cw-tone-strong { font-weight: var(--cw-weight-semibold); }

.cw-card-row {
    display: flex;
    align-items: center;
    gap: var(--cw-space-4);
}

.cw-card-col {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-1);
    min-width: 0;
}

.dash-grid-wrap {
    container-type: inline-size;
}

/* Siatka to zawijany flex o --dash-cols kolumnach: szerokość karty to --dash-n kolumn (z odstępami), a poza trybem edycji karta rośnie
   (flex-grow = --dash-n) o tyle, by wiersz wypełnił całą szerokość - niepełny wiersz (np. trzy karty po jednej kolumnie) nie zostawia
   luki, tylko rozciąga karty proporcjonalnie do ich szerokości. W trybie edycji nic nie rośnie, więc widać układ taki, jaki ustawiono. */
.dash-grid {
    --dash-cols: 4;
    --dash-gap: var(--cw-space-4);
    display: flex;
    flex-wrap: wrap;
    gap: var(--dash-gap);
    align-items: stretch;
}

.dash-grid > .dash-cell {
    /* Szerokość n kolumn: n * kolumna + (n - 1) * odstęp; 0.1px zapasu, żeby błąd zaokrąglenia nie zrzucił ostatniej karty do nowego wiersza. */
    flex: 0 0 calc((100% - (var(--dash-cols) - 1) * var(--dash-gap)) / var(--dash-cols) * var(--dash-n, 1) + (var(--dash-n, 1) - 1) * var(--dash-gap) - 0.1px);
}

.dash-grid:not(.dash-grid--editing) > .dash-cell {
    flex-grow: var(--dash-n, 1);
}

.dash-span-1 { --dash-n: 1; }
.dash-span-2 { --dash-n: 2; }
.dash-span-3 { --dash-n: 3; }
.dash-span-4 { --dash-n: 4; }

/* Kolumny zależą od szerokości samej siatki (nie okna): menu zwinięte lub rozwinięte zmienia ją bez zmiany okna. */
@container (max-width: 1039px) {
    .dash-grid { --dash-cols: 3; }
    .dash-grid > .dash-span-4 { --dash-n: 3; }
}

@container (max-width: 759px) {
    .dash-grid { --dash-cols: 2; }
    .dash-grid > .dash-span-3,
    .dash-grid > .dash-span-4 { --dash-n: 2; }
}

@container (max-width: 499px) {
    .dash-grid { --dash-cols: 1; }
    .dash-grid > .dash-span-2,
    .dash-grid > .dash-span-3,
    .dash-grid > .dash-span-4 { --dash-n: 1; }
}

.cw-bar-label {
    min-width: 64px;
}

/* ===== ui-dashboard (Faza 3): karta nieobecności, wykres tygodnia, święta (Shared/Dashboard, klasy .dash-*) ===== */
.dash-legend {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-1);
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

    .dash-legend strong {
        color: var(--cw-text);
        font-variant-numeric: tabular-nums;
    }

.dash-legend--row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--cw-space-1) var(--cw-space-4);
    padding-top: var(--cw-space-3);
    border-top: 1px solid var(--cw-border-soft);
}

.dash-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: var(--cw-space-2);
    border-radius: var(--cw-radius-xs);
    background: var(--swatch, var(--cw-primary));
    vertical-align: baseline;
}

.dash-alert {
    margin: 0;
    padding: var(--cw-space-2) var(--cw-space-3);
    border-radius: var(--cw-radius-md);
    font-size: var(--cw-text-xs);
}

.dash-alert--warn {
    background: var(--cw-warn-tint);
    color: var(--cw-warn-strong);
}

/* Heatmapa 12 miesięcy: intensywność wypełnienia przez --i (0-1). */
.dash-heat {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--cw-space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.dash-heat-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border-radius: var(--cw-radius-sm);
    background: var(--cw-surface-3);
    overflow: hidden;
}

.dash-heat-fill {
    position: absolute;
    inset: 0;
    background: var(--cw-sea);
    opacity: var(--i, 0);
}

.dash-heat-value {
    position: relative;
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    color: var(--cw-text);
}

/* Wykres tygodnia: wysokość słupka --h (0-100%), kolor --bar-color, linia normy --target (0-100%). */
/* Wykres: lewa oś godzin (0, norma dzienna, maksimum skali) obok osi dni; wszystko na jednej siatce. */
.dash-week {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--cw-space-2);
}

.dash-week-axis {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    min-width: 2.4rem;
    height: 180px;
    font-size: var(--cw-text-2xs);
    color: var(--cw-text-3);
    text-align: right;
}

    .dash-week-axis > span {
        position: absolute;
        right: 0;
        bottom: calc((100% - 22px) * var(--at, 0) / 100);
        transform: translateY(50%);
        white-space: nowrap;
    }

.dash-week-axis-tick {
    color: var(--cw-text-3);
}

.dash-week-axis-target {
    color: var(--cw-text);
    font-weight: var(--cw-weight-semibold);
}

.dash-week > .dash-week-plot {
    grid-column: 2;
    grid-row: 1;
}

.dash-week > .dash-week-labels {
    grid-column: 2;
    grid-row: 2;
}

.dash-week-plot {
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: end;
    gap: var(--cw-space-2);
    height: 180px;
    border-bottom: 1px solid var(--cw-border-strong);
}

.dash-week-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: var(--cw-space-1);
    height: 100%;
}

.dash-week-value {
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    font-variant-numeric: tabular-nums;
    color: var(--cw-text);
}

.dash-week-col--today .dash-week-value {
    color: var(--cw-primary-strong);
}

.dash-week-bar {
    display: block;
    width: min(36px, 70%);
    height: calc((100% - 22px) * var(--h, 0) / 100);
    min-height: 4px;
    border-radius: var(--cw-radius-md) var(--cw-radius-md) 3px 3px;
    background: var(--bar-color, var(--cw-primary));
    transition: opacity var(--cw-duration-fast) var(--cw-ease);
}

.dash-week-bar--empty {
    background: var(--cw-border);
}

/* 0 h to płaska kreska przy osi (P33, time-per-project) - także w tygodniu bez żadnych godzin; zarys na pół wysokości sugerował dane, których nie ma. */

.dash-week-col--today .dash-week-bar {
    background: repeating-linear-gradient(135deg, var(--bar-color, var(--cw-primary)) 0 6px, var(--cw-primary-mid) 6px 12px);
}

.dash-week-plot:hover .dash-week-bar {
    opacity: 0.55;
}

    .dash-week-plot:hover .dash-week-bar:hover {
        opacity: 1;
    }

.dash-week-target {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc((100% - 22px) * var(--target, 0) / 100);
    border-top: 2px dashed var(--cw-text);
    pointer-events: none;
}

.dash-week-labels {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: var(--cw-space-2);
    margin-top: var(--cw-space-2);
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
    text-align: center;
}

.dash-week-label--today {
    color: var(--cw-primary-strong);
    font-weight: var(--cw-weight-semibold);
}

@media (prefers-reduced-motion: reduce) {
    .dash-week-bar {
        transition: none;
    }
}

/* Święta: nawigacja po roku w nagłówku karty i przewijana lista z datą. */
.dash-year-nav {
    display: flex;
    align-items: center;
    gap: var(--cw-space-1);
}

.dash-dates {
    max-height: 260px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    font-size: var(--cw-text-xs);
}

    .dash-dates li {
        display: flex;
        gap: var(--cw-space-3);
        padding: var(--cw-space-1-5) 0;
        border-bottom: 1px solid var(--cw-border-soft);
    }

    .dash-dates li:last-child {
        border-bottom: 0;
    }

.dash-dates-date {
    flex: 0 0 auto;
    min-width: 86px;
    color: var(--cw-text-3);
    font-variant-numeric: tabular-nums;
}

/* ===== ui-dashboard (Faza 4): stan szkieletu ===== */
.dash-grid--loading .cw-card-bd {
    min-height: 96px;
}

/* ===== ui-dashboard (Faza 7): tryb „Ustawienia widżetów” - przeciąganie, przesuwanie, szerokość i widoczność kart (Shared/Dashboard/DashboardGrid) ===== */
/* Komórka siatki trzyma kartę i (w trybie edycji) jej pasek narzędzi; szerokość daje klasa .dash-span-N. */
.dash-cell {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-cell-card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

    .dash-cell-card > .cw-card {
        flex: 1 1 auto;
    }

.dash-grid--editing .dash-cell {
    position: relative;
    gap: var(--cw-space-2);
    padding: var(--cw-space-2);
    border: 2px dashed var(--cw-border-strong);
    border-radius: calc(var(--cw-radius-card) + 4px);
}

/* Karta ukryta: na końcu listy, wyszarzona i nieaktywna; zostaje tylko oko do jej przywrócenia. */
.dash-cell--off {
    border-style: dotted;
}

    .dash-cell--off .dash-cell-card {
        opacity: 0.45;
        filter: grayscale(1);
        pointer-events: none;
    }

.dash-cell-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cw-space-2);
    min-width: 0;
}

.dash-cell-title {
    flex: 1 1 60px;
    min-width: 0;
    overflow: hidden;
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    color: var(--cw-text-2);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-cell-size,
.dash-cell-move {
    display: inline-flex;
    align-items: center;
    gap: var(--cw-space-1);
}

.dash-cell-move {
    margin-left: auto;
}

.dash-cell-span {
    min-width: 30px;
    font-size: var(--cw-text-xs);
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: var(--cw-text-2);
}

.dash-cell-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
}

.dash-cell-grip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--cw-border-strong);
    border-radius: var(--cw-radius-sm);
    background: var(--cw-surface);
    color: var(--cw-text-2);
    cursor: grab;
    touch-action: none;
}

    .dash-cell-grip:hover {
        background: var(--cw-hover-strong);
        border-color: var(--cw-primary-mid);
        color: var(--cw-primary-strong);
    }

    .dash-cell-grip:active {
        cursor: grabbing;
    }

.dash-cell--dragging {
    opacity: 0.45;
}

/* Linia wstawienia: zielona kreska po stronie karty docelowej, na którą spadnie przeciągana karta. */
.dash-cell--drop-before::before,
.dash-cell--drop-after::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: var(--cw-radius-pill);
    background: var(--cw-ok);
    pointer-events: none;
}

.dash-cell--drop-before::before {
    left: -10px;
}

.dash-cell--drop-after::after {
    right: -10px;
}

.dash-layout-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--cw-space-3);
    margin-bottom: var(--cw-space-4);
    padding: var(--cw-space-3) var(--cw-space-4);
    border: 1px solid var(--cw-primary-mid);
    border-radius: var(--cw-radius-lg);
    background: var(--cw-primary-tint);
    color: var(--cw-text);
    font-size: var(--cw-text-xs);
}

.dash-layout-bar-actions {
    display: flex;
    gap: var(--cw-space-2);
}

/* ===== Stoper (faza 8 migracji): pływający panel w prawym dolnym rogu + pigułka po zwinięciu (Shared/Stopwatch.razor) ===== */
.cw-stopwatch,
.cw-stopwatch-pill {
    position: fixed;
    right: var(--cw-space-5);
    bottom: var(--cw-space-5);
    z-index: var(--cw-z-floating);
}

/* Stoper, pigułka i dok stoją na ciemnym --cw-rail-1: zwykły pierścień fokusu (--cw-primary-strong) ginie na nim - tu jest akcentem. */
.cw-stopwatch,
.cw-stopwatch-pill,
.cw-dock {
    --cw-focus-ring: var(--cw-focus-ring-on-rail);
}

.cw-stopwatch {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-3);
    width: min(380px, calc(100vw - 2 * var(--cw-space-5)));
    max-height: min(70vh, 560px);
    padding: var(--cw-space-4);
    /* poprawki-po-visual-design-system: the panel itself never scrolls - only "Dzisiejsze wpisy" does (.cw-stopwatch-list),
       so the header, the current entry and "Dodaj nowy" stay put and no thick scrollbar runs down the card's rounded edge. */
    overflow: hidden;
    background: var(--cw-rail-1);
    color: var(--cw-brand-white);
    border-radius: var(--cw-radius-card);
    box-shadow: var(--cw-shadow-floating);
    font-variant-numeric: tabular-nums;
}

.cw-stopwatch-hd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--cw-space-3);
}

.cw-stopwatch-title {
    margin: 0;
    font-size: var(--cw-text-lg);
    font-weight: var(--cw-weight-semibold);
}

.cw-stopwatch-today {
    font-size: var(--cw-text-xs);
    color: color-mix(in srgb, var(--cw-brand-white) 70%, transparent);
}

.cw-stopwatch-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--cw-brand-white) 30%, transparent);
    border-radius: var(--cw-radius-md);
    background: transparent;
    color: inherit;
    cursor: pointer;
}

    .cw-stopwatch-icon-btn:hover {
        background: color-mix(in srgb, var(--cw-brand-white) 16%, transparent);
    }

.cw-stopwatch-now {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--cw-space-3);
    padding: var(--cw-space-3);
    border-radius: var(--cw-radius-lg);
    background: color-mix(in srgb, var(--cw-brand-white) 10%, transparent);
}

.cw-stopwatch-now-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cw-stopwatch-time {
    font-size: var(--cw-text-2xl);
    font-weight: var(--cw-weight-bold);
    line-height: 1.15;
}

.cw-stopwatch-ticket {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    color: var(--cw-brand-amber);
}

.cw-stopwatch-ticket-title,
.cw-stopwatch-row-title {
    overflow: hidden;
    font-size: var(--cw-text-xs);
    color: color-mix(in srgb, var(--cw-brand-white) 70%, transparent);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Start / Stop: działa = wypełnienie akcentem, stoi = sama obwódka akcentu (kształt ikony niesie sens, nie tylko kolor). */
.cw-stopwatch-go,
.cw-stopwatch-row-go {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid var(--cw-brand-amber);
    border-radius: 50%;
    background: transparent;
    color: var(--cw-brand-amber);
    cursor: pointer;
}

.cw-stopwatch-go { width: 44px; height: 44px; }
.cw-stopwatch-row-go { width: 30px; height: 30px; border-width: 1.5px; }

.cw-stopwatch-go--on,
.cw-stopwatch-row-go--on {
    background: var(--cw-brand-amber);
    color: var(--cw-brand-ink);
}

    .cw-stopwatch-go:hover:not(:disabled),
    .cw-stopwatch-row-go:hover:not(:disabled) {
        background: color-mix(in srgb, var(--cw-brand-amber) 35%, transparent);
    }

    .cw-stopwatch-go--on:hover:not(:disabled),
    .cw-stopwatch-row-go--on:hover:not(:disabled) {
        background: var(--cw-brand-white);
    }

    .cw-stopwatch-go:disabled,
    .cw-stopwatch-row-go:disabled {
        opacity: 0.5;
        cursor: default;
    }

.cw-stopwatch-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.cw-stopwatch-list-title {
    margin: 0;
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    color: color-mix(in srgb, var(--cw-brand-white) 70%, transparent);
}

.cw-stopwatch-empty {
    margin: 0;
    font-size: var(--cw-text-xs);
    color: color-mix(in srgb, var(--cw-brand-white) 70%, transparent);
}

/* Everything in the panel but the list keeps its height; the list takes what is left and scrolls inside the card,
   with the same thin scrollbar as the menu (NavMenu.razor.css .rail-scroll). */
.cw-stopwatch > * {
    flex-shrink: 0;
}

.cw-stopwatch > .cw-stopwatch-list {
    flex: 1 1 auto;
    min-height: 0;
}

.cw-stopwatch-list {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-1);
    /* The padding keeps the rows' focus ring (outline + offset) inside the scroll box, the negative margin keeps the
       rows where they were; on the right it also leaves room for the scrollbar. */
    margin: -4px calc(-1 * var(--cw-space-2)) -4px -4px;
    padding: 4px var(--cw-space-2) 4px 4px;
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--cw-rail-muted) 60%, transparent) transparent;
}

.cw-stopwatch-row {
    display: flex;
    align-items: center;
    gap: var(--cw-space-3);
    padding: var(--cw-space-1-5) var(--cw-space-2);
    border-radius: var(--cw-radius-md);
    font-size: var(--cw-text-xs);
}

.cw-stopwatch-row--on {
    background: color-mix(in srgb, var(--cw-brand-amber) 18%, transparent);
}

.cw-stopwatch-row-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.cw-stopwatch-row-label {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: var(--cw-weight-semibold);
    color: var(--cw-brand-amber);
}

.cw-stopwatch-row-hours {
    font-weight: var(--cw-weight-semibold);
}

.cw-stopwatch-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--cw-space-2);
    padding: var(--cw-space-2) var(--cw-space-3);
    border: 1px solid color-mix(in srgb, var(--cw-brand-white) 40%, transparent);
    border-radius: var(--cw-radius-md);
    color: inherit;
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    text-decoration: none;
}

    .cw-stopwatch-add:hover {
        background: color-mix(in srgb, var(--cw-brand-white) 16%, transparent);
        color: inherit;
    }

.cw-stopwatch-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--cw-space-2);
    padding: var(--cw-space-2) var(--cw-space-4);
    border: 0;
    border-radius: var(--cw-radius-pill);
    background: var(--cw-rail-1);
    color: var(--cw-brand-white);
    box-shadow: var(--cw-shadow-floating);
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    max-width: min(280px, 70vw);
}

.cw-stopwatch-dot {
    position: relative;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border: 2px solid var(--cw-brand-amber);
    border-radius: 50%;
}

/* Pigułka: numer zgłoszenia w kolorze akcentu (jak w panelu), czas biały; kropka czerwona i pulsuje, gdy czas leci. */
.cw-stopwatch-pill-label {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cw-brand-amber);
}

.cw-stopwatch-pill-time {
    flex: 0 0 auto;
    color: var(--cw-brand-white);
}

/* „Spróbuj ponownie” przy błędzie wczytania listy - link-przycisk w kolorze akcentu. */
.cw-stopwatch-retry {
    margin-left: var(--cw-space-1);
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cw-brand-amber);
    font: inherit;
    font-weight: var(--cw-weight-semibold);
    text-decoration: underline;
    cursor: pointer;
}

/* Napis „Zwiń” przy minusie widać tylko na telefonie (dolny arkusz), na szerokim ekranie zostaje sama ikona. */
.cw-stopwatch-collapse-text {
    display: none;
}

/* Pigułka „tylko na telefonie”: stoper rozwinięty w ustawieniach, ale na wąskim ekranie startuje zwinięty (Stopwatch.razor, C2). */
.cw-stopwatch-pill--narrow-only {
    display: none;
}

.cw-stopwatch-pill--on .cw-stopwatch-dot {
    background: var(--cw-danger);
    border-color: var(--cw-danger);
}

/* Puls tylko gdy użytkownik go nie wyłączył (Konfiguracja → Preferencje → „Pulsująca kropka stopera”). */
/* poprawki-po-visual-design-system: puls kropki stopera (prośba użytkownika 2026-10-23) - kropka stoi, a z niej rozchodzi się
   pierścień (0,6× → 1,8×) i gaśnie, 2 s z miękkim wyhamowaniem. Wcześniej kurczyła się sama kropka; mały pierścień z cienia (0 → 5 px) był na ciemnym
   pasku prawie niewidoczny, dlatego ten zaczyna 6 px poza kropką (tam 4 px przy kropce 8 px) i ma obrys 2 px zamiast 1 px. */
.cw-stopwatch-pill--pulse .cw-stopwatch-dot::after {
    content: "";
    position: absolute;
    inset: -6px;
    border: 2px solid var(--cw-danger);
    border-radius: 50%;
    pointer-events: none;
    animation: cw-stopwatch-pulse 2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

@keyframes cw-stopwatch-pulse {
    from { transform: scale(0.6); opacity: 1; }
    to { transform: scale(1.8); opacity: 0; }
}

/* Przy „ogranicz ruch” (np. wyłączone animacje w Windows) pulsowanie to tylko łagodne przygasanie kropki - bez ruchu, a dalej widać, że czas leci. */
@keyframes cw-stopwatch-fade {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    .cw-stopwatch-pill--pulse .cw-stopwatch-dot {
        animation: cw-stopwatch-fade 1.4s ease-in-out infinite;
    }

    .cw-stopwatch-pill--pulse .cw-stopwatch-dot::after {
        content: none;
    }
}

.cw-stopwatch-hd-actions {
    display: flex;
    gap: var(--cw-space-1);
}

/* Lista wpisów otwarta z docka: ten sam panel, ale przy menu (lewy dolny róg treści), nie w prawym rogu. */
.cw-stopwatch--from-dock {
    right: auto;
    left: calc(var(--cw-rail-width) + var(--cw-space-4));
    bottom: var(--cw-space-4);
}

:root[data-nav="collapsed"] .cw-stopwatch--from-dock {
    left: calc(var(--cw-rail-width-collapsed) + var(--cw-space-4));
}

/* Zadokowany stoper w stopce menu: Start/Stop, czas, zgłoszenie, „Lista wpisów”. Menu ma stałe kolory marki (ciemne tło). */
.cw-dock {
    display: flex;
    align-items: center;
    gap: var(--cw-space-2);
    margin: 0 var(--cw-space-3) var(--cw-space-2);
    padding: var(--cw-space-2) var(--cw-space-3);
    border-radius: var(--cw-radius-lg);
    background: color-mix(in srgb, var(--cw-brand-white) 10%, transparent);
    color: var(--cw-brand-white);
    font-variant-numeric: tabular-nums;
}

.cw-dock-go { width: 36px; height: 36px; }

.cw-dock-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.cw-dock-time {
    font-size: var(--cw-text-md);
    font-weight: var(--cw-weight-bold);
    line-height: 1.2;
}

.cw-dock-ticket {
    overflow: hidden;
    font-size: var(--cw-text-2xs);
    color: var(--cw-brand-amber);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-dock-list {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--cw-brand-white) 30%, transparent);
    border-radius: var(--cw-radius-md);
    background: transparent;
    color: inherit;
    cursor: pointer;
}

    .cw-dock-list:hover {
        background: color-mix(in srgb, var(--cw-brand-white) 16%, transparent);
    }

/* Zwinięte menu (ikony): sam przycisk Start/Stop i czas pod nim. */
:root[data-nav="collapsed"] .cw-dock {
    flex-direction: column;
    gap: var(--cw-space-1);
    margin: 0 var(--cw-space-2) var(--cw-space-2);
    padding: var(--cw-space-2) 0;
}

:root[data-nav="collapsed"] .cw-dock-text {
    align-items: center;
    flex: 0 0 auto;
}

:root[data-nav="collapsed"] .cw-dock-ticket,
:root[data-nav="collapsed"] .cw-dock-list {
    display: none;
}

:root[data-nav="collapsed"] .cw-dock-time {
    font-size: var(--cw-text-2xs);
}

/* Telefon: pływający stoper nie zasłania treści - mniejszy odstęp od krawędzi; rozwinięty panel to dolny arkusz na całą szerokość (najwyżej 60% ekranu)
   z wyraźnym „Zwiń”, a po wejściu na stronę stoper jest pigułką (--narrow-only / --narrow-hidden, Stopwatch.razor). */
@media (max-width: 640px) {
    .cw-stopwatch,
    .cw-stopwatch-pill {
        right: var(--cw-space-3);
        bottom: var(--cw-space-3);
    }

    /* Pigułka wisi nad treścią w prawym dolnym rogu - stopka (ostatni wiersz strony) ma pod sobą miejsce na pigułkę z jej odstępem,
       żeby ostatni wiersz tabeli i stopkę dało się przewinąć nad nią (review r2 time-per-project F4). */
    .app-footer {
        padding-bottom: calc(2 * var(--cw-space-3) + 2.5rem);
    }

    .cw-stopwatch,
    .cw-stopwatch--from-dock {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: var(--cw-radius-card) var(--cw-radius-card) 0 0;
    }

    .cw-stopwatch--narrow-hidden {
        display: none;
    }

    .cw-stopwatch-pill--narrow-only {
        display: inline-flex;
    }

    .cw-stopwatch-collapse {
        width: auto;
        gap: var(--cw-space-1);
        padding: 0 var(--cw-space-2);
    }

    .cw-stopwatch-collapse-text {
        display: inline;
        font-size: var(--cw-text-xs);
        font-weight: var(--cw-weight-semibold);
    }
}

/* ===== Przyciski akcji (po przeglądzie 18.10) ===== */
/* Zapisz: delikatna zielona obwódka; po najechaniu wypełnienie tym samym kolorem. Anuluj: delikatny czerwony. Dezaktywuj: szary. */
.btn-save,
.btn-cancel,
.btn-deactivate {
    --bs-btn-bg: var(--cw-surface);
    --bs-btn-hover-bg: var(--btn-accent);
    --bs-btn-active-bg: var(--btn-accent);
    --bs-btn-border-color: var(--btn-accent);
    --bs-btn-hover-border-color: var(--btn-accent);
    --bs-btn-active-border-color: var(--btn-accent);
    --bs-btn-hover-color: var(--cw-text);
    --bs-btn-active-color: var(--cw-text);
}

/* Zielony jak przycisk „Aktywuj” (btn-outline-success, #198754), bledszy: stały odcień zielony - ta sama zieleń w każdym motywie. */
.btn-save { --btn-accent: color-mix(in srgb, #198754 45%, var(--cw-surface)); }
.btn-cancel { --btn-accent: color-mix(in srgb, var(--cw-danger) 42%, var(--cw-surface)); }
.btn-deactivate { --btn-accent: var(--cw-border-strong); }

    .btn-deactivate:hover {
        --bs-btn-hover-bg: var(--cw-surface-3);
        --bs-btn-hover-border-color: var(--cw-border-strong);
    }

/* Luka między wpisami w Rejestracji (tryb „Od-do”): delikatnie pomarańczowy, przygaszony wiersz z „+” i „Pomiń”. */
.registration-gap-row > td {
    background: color-mix(in srgb, var(--cw-warn) 10%, var(--cw-surface));
    color: var(--cw-text-3);
}

.registration-gap-text {
    font-style: italic;
}

/* Tekst luki po lewej, przyciski dokładnie na środku komórki (trzy kolumny: tekst | przyciski | puste). Na wąskim ekranie jedno pod drugim. */
.registration-gap-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: var(--cw-space-3, 0.75rem);
}

@media (max-width: 640.98px) {
    .registration-gap-content {
        grid-template-columns: 1fr;
        row-gap: var(--cw-space-2, 0.5rem);
    }
}

/* --- admin-theme-colors: ekran „Kolory i motywy” (Panel admina). Podgląd czyta kolory z własnych zmiennych ustawionych inline na .admin-theme-preview. --- */
.admin-theme-name {
    display: inline-flex;
    align-items: center;
    gap: var(--cw-space-3);
}

/* Lista motywów: wiersz wybiera motyw do edycji kolorów niżej; wybrany wiersz jest podświetlony. Z klawiatury działa przycisk z nazwą w pierwszej komórce. */
.admin-theme-row {
    cursor: pointer;
}

.admin-theme-row.is-selected > td,
.admin-theme-row.is-selected:hover > td {
    background: var(--cw-primary-tint);
}

.admin-theme-row.is-selected > td:first-child {
    box-shadow: inset 3px 0 0 var(--cw-primary);
}

.admin-theme-pick {
    display: inline-flex;
    align-items: center;
    gap: var(--cw-space-3);
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

/* „Zapisz” / „Przywróć” pod listą motywów i pod polami kolorów: odstęp od treści, żeby przyciski się z nią nie zlewały. */
.form-actions.admin-theme-actions {
    margin-top: var(--cw-space-5);
}

.admin-theme-pick:focus-visible {
    outline: var(--cw-focus-ring);
    outline-offset: 2px;
}

/* poprawki-po-visual-design-system: podgląd czterech pasków (prawdziwe klasy .notification-banner na zmiennych ustawionych inline)
   na tle strony edytowanego motywu, żeby było widać, czy pasek nie zlewa się z tłem. */
.admin-notice-preview {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-2);
    align-self: start;
    padding: var(--cw-space-3);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-card);
    background: var(--cw-bg);
}

    .admin-notice-preview .notification-banner {
        padding: var(--cw-space-2) var(--cw-space-3);
        border-radius: var(--cw-radius-md);
    }

/* calendar-redesign: podgląd kolorów dni (miniatury dni i statusy Jiry) na zmiennych ustawionych inline, na karcie edytowanego motywu. */
.admin-calendar-preview {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-3);
    align-self: start;
    padding: var(--cw-space-3);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-card);
    background: var(--cw-surface);
    color: var(--cw-text);
    font-size: var(--cw-text-xs);
}

    .admin-calendar-preview .acp-days {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--cw-space-1);
    }

    .admin-calendar-preview .acp-day {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--cw-space-0-5);
        padding: var(--cw-space-2) var(--cw-space-1);
        border-radius: var(--cw-radius-sm);
        font-size: var(--cw-text-2xs);
        color: var(--cw-text);
    }

    .admin-calendar-preview .acp-day b {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        height: 24px;
        border-radius: var(--cw-radius-pill);
        font-size: var(--cw-text-xs);
        font-variant-numeric: tabular-nums;
    }

    .admin-calendar-preview .acp-today {
        background: var(--cw-day-today);
        color: var(--cw-surface);
    }

    .admin-calendar-preview .acp-holiday {
        background: var(--cw-day-holiday-bg);
        color: var(--cw-day-holiday-text);
    }

    .admin-calendar-preview .acp-weekend {
        background: var(--cw-day-weekend-bg);
    }

    .admin-calendar-preview .acp-under {
        color: var(--cw-day-under);
        font-style: normal;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

    .admin-calendar-preview .acp-jira {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
        gap: var(--cw-space-1) var(--cw-space-3);
        margin: 0;
        padding: 0;
        list-style: none;
    }

        .admin-calendar-preview .acp-jira li {
            display: flex;
            align-items: center;
            gap: var(--cw-space-2);
        }

    .admin-calendar-preview .acp-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex: none;
    }

    .admin-calendar-preview .acp-jira-none { background: var(--cw-jira-none); }
    .admin-calendar-preview .acp-jira-not-synced { background: var(--cw-jira-not-synced); }
    .admin-calendar-preview .acp-jira-synced { background: var(--cw-jira-synced); }
    .admin-calendar-preview .acp-jira-changed { background: var(--cw-jira-changed); }

/* poprawki-po-visual-design-system: karta „Czas wyświetlania komunikatów” - trzy pola liczbowe obok siebie, na telefonie jedno pod drugim. */
.admin-notice-times {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 12rem));
    gap: var(--cw-space-4);
    margin-top: var(--cw-space-3);
}

.admin-theme-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
    gap: var(--cw-space-5);
    margin-top: var(--cw-space-4);
}

.admin-theme-fields {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-3);
}

.admin-theme-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--cw-space-4);
    padding: var(--cw-space-3) var(--cw-space-4);
    border: 1px solid var(--cw-border-soft);
    border-radius: var(--cw-radius-lg);
    background: var(--cw-surface-2);
}

.admin-theme-preview {
    display: flex;
    flex-direction: column;
    min-height: 12rem;
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-card);
    overflow: hidden;
    background: var(--cw-bg);
}

.admin-theme-preview-rail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--cw-space-3) var(--cw-space-4);
    background: var(--cw-rail-1);
    color: #ffffff;
    font-size: var(--cw-text-sm);
    font-weight: var(--cw-weight-semibold);
}

.admin-theme-preview-rail i {
    width: 2.5rem;
    height: 3px;
    border-radius: var(--cw-radius-xs);
    background: var(--cw-accent);
}

.admin-theme-preview-body {
    flex: 1;
    padding: var(--cw-space-4);
}

.admin-theme-preview-card {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-3);
    padding: var(--cw-space-4);
    border-radius: var(--cw-radius-card);
    background: var(--cw-surface);
    color: var(--cw-text);
    font-size: var(--cw-text-sm);
}

.admin-theme-preview-chips,
.admin-theme-preview-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cw-space-2);
}

.admin-theme-preview-chips b {
    padding: 2px var(--cw-space-3);
    border-radius: var(--cw-radius-pill);
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
    color: #ffffff;
}

.admin-theme-preview-chips .chip-sea { background: var(--cw-sea); }
.admin-theme-preview-chips .chip-earth { background: var(--cw-earth); }

.admin-theme-preview-primary,
.admin-theme-preview-cta {
    padding: var(--cw-space-2) var(--cw-space-4);
    border-radius: var(--cw-radius-md);
    font-weight: var(--cw-weight-semibold);
}

.admin-theme-preview-primary { background: var(--cw-primary); color: var(--cw-on-primary); }
.admin-theme-preview-cta { background: var(--cw-cta); color: var(--cw-on-cta); }

@media (max-width: 860px) {
    .admin-theme-editor {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Okno „Dodaj / Edytuj klienta” (time-per-project): zwarte pola (mb-2, bez odstępu .modal-form), sekcje z małym nagłówkiem
   i podpowiedź pod polem w kolorze drugorzędnym; ostrzeżenie (np. NIP spoza białej listy) w kolorze ostrzeżenia z tekstem. */
.client-form .form-label {
    margin-bottom: var(--cw-space-1);
}

.client-form-section {
    margin: var(--cw-space-4) 0 var(--cw-space-2);
    padding-top: var(--cw-space-3);
    border-top: 1px solid var(--cw-border-soft);
    font-size: var(--cw-text-sm);
    font-weight: var(--cw-weight-semibold);
    color: var(--cw-text-2);
}

    .client-form-section:first-child {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

.client-form-hint {
    margin: var(--cw-space-1) 0 0;
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

.client-form-hint--warn {
    color: var(--cw-warn-strong);
}

/* Projekty (time-per-project Faza 2): kropka koloru projektu przed nazwą (kolor tylko z nazwą obok, nigdy sam), zakładki
   edytora nad formularzem i ramka podformularzy (nowa wersja warunków, etap płatności, cel) - osobne wiersze listy
   z własnym przyciskiem, odróżnione od pól projektu zapisywanych „Zapisz”. */
.project-name {
    display: inline-flex;
    align-items: center;
    gap: var(--cw-space-2);
}

.project-swatch {
    display: inline-block;
    flex: 0 0 auto;
    vertical-align: middle;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--project-color, var(--cw-primary));
    box-shadow: inset 0 0 0 1px var(--cw-border);
}

/* Poprawki P6 - Wybór projektu (Shared/ProjectPicker.razor): a select-like button with the project's dot, a listbox grouped by client.
   Positioned like PolishDatePicker's panel (absolute under the field, a transparent backdrop closes it). */
.project-picker {
    position: relative;
}

.project-picker-button {
    display: flex;
    align-items: center;
    gap: var(--cw-space-2);
    width: 100%;
    text-align: left;
    background-color: var(--cw-surface);
}

.project-picker-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-picker-client,
.project-picker-placeholder {
    color: var(--cw-text-3);
    font-size: var(--cw-text-sm);
    white-space: nowrap;
}

.project-picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--cw-z-popover-backdrop);
}

.project-picker-list {
    position: absolute;
    top: calc(100% + var(--cw-space-1));
    left: 0;
    right: 0;
    z-index: var(--cw-z-popover);
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: var(--cw-space-1) 0;
    list-style: none;
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-card);
    box-shadow: var(--cw-shadow-popover);
}

.project-picker-group {
    padding: var(--cw-space-2) var(--cw-space-3) var(--cw-space-1);
    color: var(--cw-text-3);
    font-size: var(--cw-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.project-picker-group-options {
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-picker-option {
    display: flex;
    align-items: center;
    gap: var(--cw-space-2);
    padding: var(--cw-space-2) var(--cw-space-3) var(--cw-space-2) var(--cw-space-4);
    cursor: pointer;
}

.project-picker-option:hover,
.project-picker-option.is-active {
    background: var(--cw-surface-2);
}

.project-picker-option[aria-selected="true"] {
    font-weight: 600;
}

.project-form {
    margin-top: var(--cw-space-3);
}

.project-subform {
    margin: var(--cw-space-2) 0 var(--cw-space-3);
    padding: var(--cw-space-3);
    border: 1px solid var(--cw-border-soft);
    border-radius: var(--cw-radius-sm);
    background: var(--cw-surface-2);
}

    .project-subform .client-form-section {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

/* Znacznik niezapisanych zmian obok „Zapisz” (Motywy, Uprawnienia, szczegóły zgłoszenia - review UI paczka C). Tekst, nie sam kolor. */
.form-unsaved-note {
    align-self: center;
    margin-right: auto;
    color: var(--cw-text-2);
    font-size: var(--cw-text-xs);
    font-weight: var(--cw-weight-semibold);
}

/* Wiersz godzin w oknie „Dodaj wpis”: etykieta z ikoną informacji („Czas trwania ⓘ”) jest wyższa o ikonę (22 px) niż zwykła („Godzina od”) i spychała swoje
   pole niżej. Etykiety w wierszu mają tę samą wysokość, więc pola stoją na jednej linii. */
.cw-time-row .form-label {
    display: flex;
    align-items: center;
    min-height: 22px;
}

/* Raporty (time-per-project Faza 8): lista raportów do przygotowania, panel filtrów bez własnej karty i podgląd raportu
   (nagłówek w dwóch kolumnach, sekcje z tabelami, sumy pod spodem). */
.report-due-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.report-due-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--cw-space-3);
    padding: var(--cw-space-2) 0;
    border-top: 1px solid var(--cw-border-soft);
}

.report-due-list li:first-child {
    border-top: 0;
}

.report-filters {
    margin-top: var(--cw-space-2);
}

.report-preview-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--cw-space-3) var(--cw-space-5);
    margin-bottom: var(--cw-space-3);
    padding-bottom: var(--cw-space-3);
    border-bottom: 1px solid var(--cw-border);
    font-size: var(--cw-text-sm);
}

.report-preview-header-right {
    text-align: right;
}

.report-preview-section {
    margin-bottom: var(--cw-space-4);
}

.report-preview-totals {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--cw-space-1) var(--cw-space-4);
    max-width: 420px;
    margin: var(--cw-space-3) 0 0 auto;
    font-weight: var(--cw-weight-semibold);
}

.report-preview-totals dd {
    margin: 0;
}

@media (max-width: 575.98px) {
    .report-preview-header-right {
        text-align: left;
    }

    .report-preview-totals {
        max-width: none;
    }
}

.day-window-summary {
    margin-bottom: var(--cw-space-2);
}

.day-window-note,
.day-window-empty {
    color: var(--cw-text-2);
    margin-bottom: var(--cw-space-2);
}

.day-window-deadlines {
    list-style: none;
    margin: 0 0 var(--cw-space-3);
    padding: var(--cw-space-2) var(--cw-space-3);
    border: 1px solid var(--cw-warn-tint);
    border-radius: var(--cw-radius-md);
    background: var(--cw-warn-tint);
    color: var(--cw-warn-strong);
}

.day-window-deadlines li {
    display: flex;
    align-items: center;
    gap: var(--cw-space-2);
}

.day-window-group {
    margin-bottom: var(--cw-space-3);
}

.day-window-group-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--cw-space-2) var(--cw-space-3);
    margin: 0 0 var(--cw-space-1);
    padding-bottom: var(--cw-space-1);
    border-bottom: 1px solid var(--cw-border);
    font-size: var(--cw-text-sm);
    font-weight: var(--cw-weight-semibold);
}

.day-window-client {
    color: var(--cw-text-2);
    font-weight: normal;
}

.day-window-hours {
    margin-left: auto;
}

.day-window-entries {
    list-style: none;
    margin: 0;
    padding: 0;
}

.day-window-entries li {
    display: flex;
    align-items: baseline;
    gap: var(--cw-space-3);
    padding: var(--cw-space-1) 0;
    font-size: var(--cw-text-sm);
}

.day-window-time {
    flex: 0 0 auto;
    min-width: 6.5em;
    color: var(--cw-text-2);
}

.day-window-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Dashboard (time-per-project Faza 9): przełącznik zakresu w pasku strony i karty projektów / kwot klientów. */
.dash-scope {
    display: flex;
    align-items: center;
    gap: var(--cw-space-2);
    margin-right: auto;
}

.dash-scope-label {
    margin: 0;
    font-size: var(--cw-text-sm);
    color: var(--cw-text-2);
}

.dash-scope .form-select {
    width: auto;
    max-width: min(320px, 60vw);
}

.dash-project-list,
.dash-client-amounts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-3);
}

.dash-project-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--cw-space-2);
    margin-bottom: var(--cw-space-1);
    font-size: var(--cw-text-sm);
}

.dash-client-amounts li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--cw-space-3);
    font-size: var(--cw-text-sm);
}

@media (max-width: 575.98px) {
    .dash-scope {
        width: 100%;
        margin-right: 0;
    }

    .dash-scope .form-select {
        flex: 1 1 auto;
        max-width: none;
        /* UI-check 2026-11-01: bez tego select ma szerokość najdłuższej opcji (długa nazwa projektu) i strona przewija się w poziomie. */
        min-width: 0;
    }
}

/* Projekt → zakładka Zespół (time-per-project Faza 11): pole zatwierdzonych godzin w tabeli miesiąca i rozwijana lista wpisów osoby. */
.project-team-hours {
    width: 6.5rem;
    margin-left: auto;
    text-align: right;
}

.project-team-nav {
    margin-bottom: var(--cw-space-3);
}

.project-team-entries-row td {
    border-top: 0;
    padding-top: 0;
}

.project-team-entries {
    list-style: none;
    margin: var(--cw-space-2) 0 0;
    padding: 0;
    font-size: var(--cw-text-sm);
}

.project-team-entries li {
    display: flex;
    align-items: baseline;
    gap: var(--cw-space-3);
    padding: var(--cw-space-1) 0;
}

.project-team-entries li span:nth-child(2) {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Rozliczenia → Zysk i strata (time-per-project Faza 11). */
.billing-profit-client th,
.billing-profit-client td {
    background: var(--cw-surface-2);
}

.billing-profit-indent {
    padding-left: var(--cw-space-5);
    color: var(--cw-text-2);
}

/* Rozliczenia → podpowiedź faktury z KSeF (time-per-project Faza 12): pasek w rozwinięciu klienta, z przyciskiem otwierającym formularz statusu. */
.billing-ksef-suggestion {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cw-space-2) var(--cw-space-3);
    margin-top: var(--cw-space-3);
    padding: var(--cw-space-2) var(--cw-space-3);
    border: 1px solid var(--cw-primary-tint);
    border-radius: var(--cw-radius-md);
    background: var(--cw-primary-tint);
    color: var(--cw-primary-strong);
    font-size: var(--cw-text-sm);
}

.billing-ksef-suggestion > span {
    flex: 1 1 18rem;
    min-width: 0;
}

/* Poprawki P13: a saved row of the project's terms / payment stages / goals marked for removal - goes away on "Zapisz". */
.project-row-removed td {
    text-decoration: line-through;
    color: var(--cw-text-3);
}

.project-row-removed td:last-child {
    text-decoration: none;
}

/* billing-readability: karty rozliczeń na dashboardzie - wiek niezafakturowanych w trzech kolumnach, kwota klienta z uwagą „w toku” pod spodem. */
/* Wiek kwot jako wiersze: etykieta po lewej, kwota po prawej (karta pulpitu jest wąska - trzy kolumny łamały etykiety, ui-critique). */
.dash-aging {
    list-style: none;
    margin: var(--cw-space-2) 0;
    padding: 0;
}

.dash-aging li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--cw-space-3);
    min-width: 0;
    padding: var(--cw-space-1-5) 0;
    border-top: 1px solid var(--cw-border-soft);
}

.dash-aging-label {
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

.dash-aging-value {
    font-size: var(--cw-text-sm);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dash-aging .is-overdue .dash-aging-value {
    color: var(--cw-danger-strong);
}

.dash-aging .is-progress .dash-aging-label,
.dash-aging .is-progress .dash-aging-value {
    color: var(--cw-text-3);
}

.dash-client-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    white-space: nowrap;
}

.dash-client-note {
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
    font-weight: 400;
}

.dash-client-amounts li {
    align-items: flex-start;
}


/* billing-readability: karta podsumowania z kolumnami (wzorzec z „Zaraportowano dziś” w Rejestracji): jedna karta, kolumny rozdzielone pionową kreską, która nie dotyka
   górnej ani dolnej krawędzi. Poniżej 768 px kolumny stają się wierszami: etykieta i podpis po lewej, wartość po prawej, rozdzielone poziomą kreską - bez ucinania i bez
   nachodzenia. Używane w Rozliczeniach („Do faktury”, „Faktury i saldo”). */
.cw-summary {
    display: flex;
    flex-wrap: nowrap;
    min-width: 0;
    margin-bottom: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-card);
    box-shadow: var(--cw-shadow);
}

.cw-summary-col {
    position: relative;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    padding: 0 1.5rem;
}

.cw-summary-col:first-child {
    padding-left: 0;
}

.cw-summary-col:last-child {
    padding-right: 0;
}

.cw-summary-col + .cw-summary-col::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.25rem;
    bottom: 0.25rem;
    width: 1px;
    background: var(--cw-border);
}

.cw-summary-label {
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

.cw-summary-value {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    color: var(--cw-text);
    overflow-wrap: anywhere;
}

.cw-summary-sub {
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
    font-variant-numeric: tabular-nums;
}

.cw-summary-col.is-overdue .cw-summary-value {
    color: var(--cw-danger-strong);
}

.cw-summary-col.is-progress .cw-summary-value {
    color: var(--cw-text-3);
}

@media (max-width: 768px) {
    .cw-summary {
        flex-direction: column;
        padding: 0.25rem 1rem;
    }

    .cw-summary-col,
    .cw-summary-col:first-child,
    .cw-summary-col:last-child {
        display: grid;
        flex: 0 0 auto;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 1rem;
        align-items: center;
        padding: 0.625rem 0;
    }

    .cw-summary-label {
        grid-column: 1;
        grid-row: 1;
    }

    .cw-summary-sub {
        grid-column: 1;
        grid-row: 2;
    }

    .cw-summary-value {
        grid-column: 2;
        grid-row: 1 / span 2;
        font-size: 1.25rem;
        text-align: right;
        white-space: nowrap;
    }

    .cw-summary-col + .cw-summary-col::before {
        left: 0;
        right: 0;
        top: 0;
        bottom: auto;
        width: auto;
        height: 1px;
    }
}

/* Wariant zwarty (billing-readability, ui-review P2): stała belka okna klienta. Ta sama karta z kolumnami, ale bez własnej ramki i cienia (belka ma już tło
   --cw-surface-2) i z mniejszą wartością. Na wąskim ekranie siatka 2 × 2 zamiast wierszy - przyklejona belka nie może zjeść połowy okna. */
.cw-summary.cw-summary--compact {
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.cw-summary--compact .cw-summary-col {
    padding: 0 var(--cw-space-4);
}

.cw-summary--compact .cw-summary-col:first-child {
    padding-left: 0;
}

.cw-summary--compact .cw-summary-value {
    font-size: var(--cw-text-sm);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .cw-summary.cw-summary--compact {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--cw-space-2) var(--cw-space-4);
        padding: 0;
    }

    .cw-summary--compact .cw-summary-col,
    .cw-summary--compact .cw-summary-col:first-child,
    .cw-summary--compact .cw-summary-col:last-child {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
    }

    .cw-summary--compact .cw-summary-value {
        font-size: var(--cw-text-sm);
        text-align: left;
    }

    .cw-summary--compact .cw-summary-col + .cw-summary-col::before {
        content: none;
    }
}


/* client-summary: małe wykresy w tabeli (wzorzec „Małe wykresy w tabeli”, design-system.md) - Sparkline (mini słupki trendu), SplitBar (pasek podziału),
   PaymentDots (kwadraciki faktur). Wartości tylko przez zmienne CSS (--h, --w, --c); kolory z tokenów, więc działają w każdym motywie. */
.cw-spark {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 24px;
    vertical-align: middle;
}

.cw-spark-bar {
    display: block;
    flex: 0 0 6px;
    width: 6px;
    height: max(2px, calc(var(--h, 0) * 1%));
    border-radius: var(--cw-radius-xs) var(--cw-radius-xs) 0 0;
    background: var(--cw-primary-soft);
}

.cw-spark-bar.is-last {
    background: var(--cw-primary);
}

.cw-spark-bar.is-open {
    background: var(--cw-surface-3);
    outline: 1px dashed var(--cw-text-3);
    outline-offset: -1px;
}

.cw-split {
    display: flex;
    flex: 0 0 auto;
    width: 56px;
    height: 8px;
    overflow: hidden;
    border-radius: var(--cw-radius-pill);
    background: var(--cw-surface-3);
}

.cw-split--wide {
    width: 100%;
}

.cw-split-part {
    display: block;
    width: calc(var(--w, 0) * 1%);
    height: 100%;
    background: var(--c, var(--cw-primary));
}

.cw-dots {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--cw-space-1);
    vertical-align: middle;
}

.cw-dot {
    display: inline-block;
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-radius: var(--cw-radius-xs);
    background: var(--c, var(--cw-primary));
}

.cw-dot--ok { --c: var(--cw-primary); }
.cw-dot--late { --c: var(--cw-earth); }
.cw-dot--over { --c: var(--cw-danger-strong); }
.cw-dot--wait {
    background: transparent;
    box-shadow: inset 0 0 0 2px var(--cw-primary-soft);
}

/* client-summary: tabela Przeglądu klientów i Podsumowania klienta - grupa na bazę (waluta + netto/brutto), wiersz „Razem”, przewijanie w poziomie na wąskim ekranie. */
.client-summary-scroll {
    overflow-x: auto;
    margin-bottom: var(--cw-space-3);
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-card);
}

.client-summary-table {
    min-width: 960px;
    margin-bottom: 0;
    font-variant-numeric: tabular-nums;
}

.client-summary-table th,
.client-summary-table td {
    vertical-align: middle;
    white-space: nowrap;
}

.client-summary-table .num {
    text-align: right;
}

.client-summary-table .is-overdue {
    color: var(--cw-danger-strong);
    font-weight: 600;
}

.client-summary-group th {
    background: var(--cw-surface-2);
    color: var(--cw-text-2);
    font-size: var(--cw-text-xs);
    font-weight: 600;
}

.client-summary-name {
    font-weight: 600;
}

.client-summary-total th,
.client-summary-total td {
    font-weight: 600;
    border-top: 2px solid var(--cw-border-strong);
}

.client-summary-amount {
    display: inline-flex;
    align-items: center;
    gap: var(--cw-space-2);
}

.client-summary-punctuality {
    display: inline-flex;
    flex-direction: column;
    gap: var(--cw-space-1);
}

.client-summary-tone {
    font-size: var(--cw-text-xs);
    font-weight: 600;
}

.client-summary-tone.is-ok { color: var(--cw-ok); }
.client-summary-tone.is-warn { color: var(--cw-warn-strong); }
.client-summary-tone.is-danger { color: var(--cw-danger-strong); }
.client-summary-tone.is-neutral { color: var(--cw-text-3); }

/* ui-review 2026-11-07: liczba obok wykresiku trendu (zmiana ostatniego zamkniętego okresu wobec poprzedniego). */
.client-summary-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--cw-space-2);
}
.client-summary-trend-change {
    font-size: var(--cw-text-xs);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.client-summary-trend-change.is-up { color: var(--cw-ok); }
.client-summary-trend-change.is-down { color: var(--cw-warn-strong); }
.client-summary-trend-change.is-neutral { color: var(--cw-text-3); }

.client-summary-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cw-space-2) var(--cw-space-4);
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

.client-summary-legend .cw-dot {
    margin-right: var(--cw-space-1-5);
    vertical-align: -1px;
}

.client-summary-legend-title {
    font-weight: 600;
    color: var(--cw-text-2);
}

/* impl-review 2026-11-07 F9: wyjaśnienie kropek - własna linijka pod kwadracikami, przed legendą paska. */
.client-summary-legend-note {
    flex-basis: 100%;
}

/* client-summary, Faza 4: Podsumowanie klienta - okruszki z linkiem wstecz, nagłówek z meta i narzędziami, wykresy w kolumnach podsumowania, karty
   „Projekty” i „Rok do roku” obok siebie od 992 px. */
/* Przejścia to przyciski (decyzja użytkownika 2026-11-07): „Podsumowanie klienta” w kolumnie akcji (ikona + tekst, poniżej 700 px sama ikona), „Wróć do listy”
   pod nazwą klienta (jak „Wszystkie projekty” w edycji projektu). */
.client-summary-action,
.client-summary-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--cw-space-1-5);
}

.client-summary-back {
    align-self: flex-start;
    margin-top: var(--cw-space-1);
}

@media (max-width: 700px) {
    .client-summary-action-label {
        display: none;
    }
}

.client-summary-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--cw-space-3) var(--cw-space-4);
    margin-bottom: var(--cw-space-3);
}

.client-summary-title {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-1);
    min-width: 0;
}

.client-summary-title h1 {
    margin-bottom: 0;
}

.client-summary-meta,
.client-summary-muted {
    font-size: var(--cw-text-xs);
    color: var(--cw-text-3);
}

.client-summary-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--cw-space-2) var(--cw-space-3);
}

.client-summary-basis {
    margin-bottom: var(--cw-space-5);
}

.client-summary-basis-title,
.client-summary-section-title {
    margin: var(--cw-space-3) 0 var(--cw-space-2);
    font-size: var(--cw-text-lg);
    font-weight: 600;
}

.client-summary-cards .cw-spark,
.client-summary-cards .cw-split,
.client-summary-cards .cw-dots {
    margin: var(--cw-space-1-5) 0 var(--cw-space-1);
}

.client-summary-bar-col {
    width: 130px;
    min-width: 96px;
}

.client-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--cw-space-4);
    margin-bottom: var(--cw-space-3);
}

.client-summary-grid .cw-card-bd {
    display: flex;
    flex-direction: column;
    gap: var(--cw-space-3);
}

.client-summary-table--compact {
    min-width: 0;
    font-size: var(--cw-text-xs);
}

@media (min-width: 992px) {
    .client-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .client-summary-cards .cw-spark,
    .client-summary-cards .cw-split,
    .client-summary-cards .cw-dots {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .client-summary-grid .client-summary-table--compact {
        display: block;
        overflow-x: auto;
    }
}

/* amounts-net-gross-columns: kolumna „Netto/brutto” obok kwoty w tabelach, gdzie wiersze mają różną podstawę (design-system.md → „Kwoty: netto albo brutto”). */
.cw-basis {
    color: var(--cw-text-2);
    font-size: var(--cw-text-xs);
    white-space: nowrap;
}
/* google-integration, Faza 4: karta Pulpitu "Spotkania dziś" (MeetingsCard.razor). Wiersz: godziny, tytuł, pigułka, akcje; na wąskim ekranie akcje schodzą pod tytuł. */
.dash-meetings-box {
    /* Układ zależy od szerokości karty (1-4 pola siatki), nie okna: zapytanie kontenerowe poniżej. */
    container-type: inline-size;
}

.dash-meetings {
    list-style: none;
    margin: 0;
    padding: 0;
    /* Jedna siatka na całą listę, żeby kolumny (godzina, tytuł, status, trzy akcje) stały równo w każdym wierszu, niezależnie od tego, co jest w sąsiednim
       („Czas zapisany” vs „Zapisz czas”, spotkanie bez Meet). Wiersze biorą jej ścieżki przez subgrid. */
    display: grid;
    grid-template-columns: auto minmax(6rem, 1fr) auto auto auto auto;
}

.dash-meeting {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: center;
    column-gap: var(--cw-space-3);
    row-gap: var(--cw-space-2);
    padding: var(--cw-space-2) 0;
    border-bottom: 1px solid var(--cw-border);
    font-size: var(--cw-text-sm);
}

    .dash-meeting:last-child {
        border-bottom: 0;
    }

.dash-meeting-time {
    font-variant-numeric: tabular-nums;
    color: var(--cw-text-2);
    white-space: nowrap;
}

.dash-meeting-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    color: var(--cw-text);
}

.dash-meeting--ended .dash-meeting-title,
.dash-meeting--ended .dash-meeting-time {
    color: var(--cw-text-3);
}

.dash-meeting-status {
    display: inline-flex;
    justify-content: center;
}

/* Trzy komórki akcji (kalendarz, Dołącz, czas) jako podsiatka: te same szerokości w każdym wierszu, puste komórki zostają puste. */
.dash-meeting-actions {
    display: grid;
    grid-column: span 3;
    grid-template-columns: subgrid;
    align-items: center;
    justify-items: end;
    column-gap: var(--cw-space-2);
}

@container (max-width: 560px) {
    /* Wąska karta (telefon albo karta o szerokości 1-2 pól): spotkanie w dwóch liniach (godzina, tytuł, status; pod spodem akcje), puste komórki znikają. */
    .dash-meetings {
        display: flex;
        flex-direction: column;
    }

    .dash-meeting {
        grid-column: auto;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .dash-meeting-actions {
        display: flex;
        flex-wrap: wrap;
        grid-column: 1 / -1;
        justify-content: flex-start;
        gap: var(--cw-space-2);
    }

    .dash-meeting-actions > span:empty,
    .dash-meeting-status:empty {
        display: none;
    }
}

/* google-integration, Faza 5: karta o wysokości 2 wierszy. Tylko gdy któraś widoczna karta ma 2 wiersze, siatka (.dash-grid--tall) przechodzi z zawijanego
   flexa na CSS grid; układy bez takiej karty zostają dokładnie jak były (flex z flex-grow, wiersze wypełniają szerokość). W trybie grid niepełne wiersze
   nie rozciągają się na całą szerokość. DEFER(google-integration): sufit - liczba kolumn zależy od szerokości kontenera, której C# nie zna; ścieżka rozwoju - obserwator rozmiaru (JS)
   albo pakowanie świadome liczby kolumn, żeby dopełniać wiersze także w trybie siatki. */
.dash-grid--tall {
    --dash-row-min: 150px;
    display: grid;
    grid-template-columns: repeat(var(--dash-cols), minmax(0, 1fr));
    grid-auto-flow: row dense;
    grid-auto-rows: minmax(var(--dash-row-min), auto);
}

    .dash-grid--tall > .dash-cell {
        flex: none;
        grid-column: span var(--dash-n, 1);
    }

    .dash-grid--tall > .dash-rows-2 {
        grid-row: span 2;
    }

/* Jedna kolumna (telefon): karty stoją jedna pod drugą, więc wysokość 2 wraca do 1. */
@container (max-width: 499px) {
    .dash-grid--tall > .dash-rows-2 {
        grid-row: span 1;
    }
}
