/* @font-face — ESDInter (ścieżki względem css/); pliki esd-ui-*.woff2 nie są w repo — wgraj public/fonts/inter/ na serwer */
@font-face {
    font-family: "ESDInter";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/inter/esd-ui-regular.woff2") format("woff2");
}
@font-face {
    font-family: "ESDInter";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/inter/esd-ui-medium.woff2") format("woff2");
}
@font-face {
    font-family: "ESDInter";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/inter/esd-ui-semibold.woff2") format("woff2");
}
@font-face {
    font-family: "ESDInter";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/inter/esd-ui-bold.woff2") format("woff2");
}

/**
 * ESD Control — Design System (źródło prawdy)
 *
 * Kolejność ładowania: design-system.css → style.css (shell: sidebar, auth, reset)
 *
 * Warstwy:
 *   1. Tokeny (:root --ds-*, hierarchia kolorów, typografia 11/12/14 + nagłówki 16/20/24/28)
 *   2. Prymitywy (typografia, przyciski, badge, formularze)
 *   3. Komponenty (karty, KPI, tabele, kalendarz, moduły widoków)
 *
 * Breakpointy (tylko w @media — bez var()):
 *   1080px tablet · 768px mobile · 640px sm
 *
 * Komponenty (prefiks .ds-* lub oznaczenie KOMPONENT w pliku):
 *   ds-entity-list-view — widok listy zasobów (tabela + kafelki)
 *   ds-card, ds-list-item — karty i wiersze
 *   ds-count-badge — liczba w szarym kole (ilości kategorii)
 *   ds-status-badge — statusy
 *   view-toolbar — pasek wyszukiwania/filtrów
 *   empty-state — pusty stan
 *   entity-module-list-view — toolbar + karta listy (raporty, audyty dzienne, kosz)
 *   btn, ds-page-header — prymitywy UI
 *
 * Audyt (2026-05): style.css = layout shell; tokeny i komponenty tutaj.
 */

:root {
    /* ── Paleta bazowa (design system — domyślne wartości) ──
       Warstwa wykresów nadpisywana przez js/colors/palette.js */
    --palette-brand-hue: 44;

    /* Niebieski — UI pomocniczy / KPI całkowity */
    --ds-blue: #3B82F6;
    --ds-blue-soft: #DBEAFE;
    --ds-blue-muted: #93C5FD;

    /* Zielony — sukces / EPA (reserved for future EPA styling) */
    --ds-pcb-base: #059669;
    --ds-pcb-light: #10B981;
    --ds-pcb-dark: #047857;
    --ds-pcb-soft: #D1FAE5;
    --ds-pcb-muted: #34D399;
    --ds-pcb-border: #CAF0E3;

    /* Tła — warstwy UI (używane w aplikacji) */
    --ds-bg: #F7F7F7;
    --ds-surface: #ffffff;
    --ds-surface-muted: #F3F3F3;
    --ds-table-head-bg: var(--ds-surface-muted);
    --ds-surface-hover: #ECECEC;
    --account-nav-bg: var(--ds-bg);
    --ds-border: #E8E8EA;
    --ds-border-strong: #D4D4D8;
    --ds-border-emphasis: #A1A1AA;
    --ds-text: #1A1A1A;
    --ds-text-secondary: #6B6B6B;
    --ds-text-tertiary: #9A9A9A;
    --ds-primary: #1A1A1A;
    --ds-primary-hover: #333333;
    --ds-primary-active: #000000;
    --ds-success: #22C55E;
    --ds-success-soft: #F0FDF4;
    --ds-warning: var(--ds-status-text-warn);
    --ds-warning-soft: var(--ds-status-bg-warn);
    --ds-danger: #DC2626;
    --ds-danger-soft: #FEF2F2;
    /* Status badge — jeden zestaw tokenów (tło / tekst / obwódka) */
    --ds-status-border-ok: color-mix(in srgb, var(--ds-success) 55%, #BBF7D0);
    --ds-status-border-fail: color-mix(in srgb, var(--ds-danger) 50%, #FECACA);
    --ds-status-border-warn: color-mix(in srgb, var(--ds-status-text-warn) 34%, var(--ds-brand-tint-32));
    --ds-status-border-neutral: color-mix(in srgb, var(--ds-text) 24%, var(--ds-border));
    --ds-status-border-accent: color-mix(in srgb, var(--ds-blue) 42%, var(--ds-blue-soft));
    --ds-status-bg-ok: var(--ds-success-soft);
    --ds-status-text-ok: var(--ds-success);
    --ds-status-bg-warn: var(--ds-brand-tint-10);
    --ds-status-text-warn: #B88A00;
    --ds-status-bg-fail: var(--ds-danger-soft);
    --ds-status-text-fail: var(--ds-danger);
    --ds-status-bg-neutral: var(--ds-surface-muted);
    --ds-status-text-neutral: var(--ds-text-secondary);
    --ds-status-bg-accent: var(--ds-blue-soft);
    --ds-status-text-accent: #2563EB;
    /* Badge liczby — szare koło, czarna cyfra (listy kategorii, normy, ilości) */
    --ds-count-badge-bg: var(--ds-surface-muted);
    --ds-count-badge-text: var(--ds-text);
    --ds-count-badge-border: var(--ds-border);
    /* Wykresy — żółty / niebieski / zielony (niezależne od akcentu UI) */
    --chart-1: #FFCF33;
    --chart-2: #3B82F6;
    --chart-3: #22C55E;
    --chart-1-alpha: #FFF0BE;
    --chart-2-alpha: #D0E1FD;
    --chart-3-alpha: #CAF1D8;
    /* Kalendarz — aktywny dzień (solid hex, bez przezroczystości) */
    --ds-cal-selected-bg: var(--ds-brand-tint-12);
    --ds-cal-selected-border: var(--ds-brand-cta);
    --ds-cal-selected-count-bg: #FFCF33;
    --ds-cal-hover-bg: transparent;
    --ds-cal-hover-border: var(--ds-border-emphasis);
    --ds-cal-hover-active-bg: var(--ds-surface-muted);
    /* Odcienie marki — 100% krycia, równoważne rgba(#FFCF33, α) na białym */
    --ds-brand-tint-08: #FFFBEF;
    --ds-brand-tint-10: #FFFAEB;
    --ds-brand-tint-12: #FFF9E7;
    --ds-brand-tint-14: #FFF8E2;
    --ds-brand-tint-18: #FFF6DA;
    --ds-brand-tint-20: #FFF5D6;
    --ds-brand-tint-22: #FFF4D2;
    --ds-brand-tint-32: #FFF0BE;
    --ds-brand-tint-34: #FFEFBA;
    --ds-brand-tint-35: #FFEEB8;
    --ds-brand-tint-38: #FFEDB1;
    --ds-brand-tint-42: #FFEBA9;
    --ds-brand-tint-45: #FFE9A3;
    --ds-brand-tint-48: #FFE89D;
    --ds-green-tint-12: #E4F8EC;
    --ds-green-tint-22: #CEF2DC;
    --ds-cal-event-bg: var(--ds-brand-tint-22);
    --ds-cal-event-border: var(--ds-brand-tint-38);
    --ds-cal-event-bg-hover: var(--ds-brand-tint-34);
    --ds-cal-event-border-hover: var(--ds-brand-tint-48);
    --ds-cal-count-bg: #FFCF33;
    --ds-cal-count-text: #1A1A1A;
    --ds-cal-count-size: 18px;
    --ds-cal-count-font: var(--text-xs);
    --ds-cal-count-weight: 700;
    /* Pulpit — harmonogram miesiąca (kółko z liczbą pomiarów) */
    --ds-dash-cal-count-size: 18px;
    --ds-dash-cal-count-font: 10px;
    --ds-dash-cal-count-weight: 600;
    /* Pulpit — wysokość karty Harmonogram (nie pełny ekran) */
    --ds-dash-cal-h: clamp(380px, 56dvh, 560px);
    /* Pulpit — wiersz wykresów (zgodność + listy obok); niższy niż kalendarz */
    --ds-dash-charts-row-footer-h: calc(2 * var(--ds-card-inset-y) + 48px + 1px);
    --ds-dash-charts-pad-y: 40px;
    --ds-dash-charts-row-h: clamp(
        320px,
        calc(
            var(--ds-card-header-height)
            + var(--ds-dashboard-body-gap)
            + var(--ds-dashboard-list-scroll-h)
            + var(--ds-inset-y)
            + var(--ds-dash-charts-row-footer-h)
            + (2 * var(--ds-dash-charts-pad-y))
        ),
        480px
    );
    --ds-cal-selected-text: #1A1A1A;
    --ds-brand-cta: #FFCF33;
    --ds-brand-cta-soft: #FFF8DC;
    --ds-brand-cta-muted: #FFE999;
    --ds-brand-cta-subtle: #FFF0B3;
    --ds-row-hover-bg: color-mix(in srgb, var(--ds-brand-cta) 10%, var(--ds-surface));
    --ds-row-hover-bg-strong: color-mix(in srgb, var(--ds-brand-cta) 18%, var(--ds-surface));
    --ds-brand-cta-hover: #FFD966;
    --ds-brand-cta-active: #E6BA2E;
    --ds-brand-cta-border: #E6BA2E;
    --ds-brand-cta-text: #1A1A1A;
    /* ── Hierarchia kolorów (poziomy UI) ──
       Tekst 1→4 (malejący kontrast) · Tła 0→3 · Obwódki 1→3 · Semantyka marki/statusu
       Aliasy produkcyjne bez zmian: --ds-text, --ds-bg, --ds-border… */
    --ds-color-text-1: var(--ds-text);
    --ds-color-text-2: var(--ds-text-secondary);
    --ds-color-text-3: var(--ds-text-tertiary);
    --ds-color-text-4: #ADADAD;
    --ds-color-text-disabled: var(--ds-color-text-4);
    --ds-color-text-inverse: #ffffff;
    --ds-color-text-on-brand: var(--ds-brand-cta-text);
    --ds-color-bg-0: var(--ds-bg);
    --ds-color-bg-1: var(--ds-surface);
    --ds-color-bg-2: var(--ds-surface-muted);
    --ds-color-bg-3: var(--ds-surface-hover);
    --ds-color-border-1: var(--ds-border);
    --ds-color-border-2: var(--ds-border-strong);
    --ds-color-border-3: var(--ds-border-emphasis);
    --ds-color-brand: var(--ds-brand-cta);
    --ds-color-brand-hover: var(--ds-brand-cta-hover);
    --ds-color-brand-active: var(--ds-brand-cta-active);
    --ds-color-brand-subtle: var(--ds-brand-cta-subtle);
    --ds-color-brand-tint: var(--ds-brand-tint-10);
    --ds-color-success: var(--ds-success);
    --ds-color-success-subtle: var(--ds-success-soft);
    --ds-color-warning: var(--ds-warning);
    --ds-color-warning-subtle: var(--ds-warning-soft);
    --ds-color-danger: var(--ds-danger);
    --ds-color-danger-subtle: var(--ds-danger-soft);
    --ds-color-accent: var(--ds-blue);
    --ds-color-accent-subtle: var(--ds-blue-soft);
    /* ── Odcienie (shades) — skala semantyczna (używać w nowym kodzie) ──
       Brand 50→700 · status success/danger/warning/accent/neutral
       Legacy fine-grained: --ds-brand-tint-* (zachowane dla istniejących komponentów) */
    --ds-shade-brand-50: var(--ds-brand-tint-08);
    --ds-shade-brand-100: var(--ds-brand-tint-10);
    --ds-shade-brand-200: var(--ds-brand-tint-18);
    --ds-shade-brand-300: var(--ds-brand-tint-32);
    --ds-shade-brand-500: var(--ds-brand-cta);
    --ds-shade-brand-600: var(--ds-brand-cta-hover);
    --ds-shade-brand-700: var(--ds-brand-cta-active);
    --ds-shade-brand-muted: var(--ds-brand-cta-muted);
    --ds-shade-brand-subtle: var(--ds-brand-cta-subtle);
    --ds-shade-success-50: var(--ds-success-soft);
    --ds-shade-success-500: var(--ds-success);
    --ds-shade-danger-50: var(--ds-danger-soft);
    --ds-shade-danger-500: var(--ds-danger);
    --ds-shade-warning-50: var(--ds-status-bg-warn);
    --ds-shade-warning-500: var(--ds-status-text-warn);
    --ds-shade-accent-50: var(--ds-blue-soft);
    --ds-shade-accent-500: var(--ds-blue);
    --ds-shade-neutral-50: var(--ds-status-bg-neutral);
    --ds-shade-neutral-500: var(--ds-status-text-neutral);
    --ds-bp-tablet: 1080px;
    --ds-bp-mobile: 768px;
    --esd-viewport-h-px: 100vh;
    --esd-vh: 1vh;

    /* Map legacy vars */
    --bg-color: var(--ds-bg);
    --card-bg: var(--ds-surface);
    --surface-muted: var(--ds-surface-muted);
    --text-main: var(--ds-text);
    --text-muted: var(--ds-text-secondary);
    --text-subtle: var(--ds-text-tertiary);
    --border-color: var(--ds-border);
    --border-strong: var(--ds-border-strong);
    --accent-color: var(--ds-brand-cta);
    --accent-hover: var(--ds-brand-cta-active);
    --accent-light: var(--ds-surface-muted);
    --accent-subtle: var(--ds-surface-muted);
    --primary-btn: var(--ds-primary);
    --primary-btn-hover: var(--ds-primary-hover);
    --input-bg: var(--ds-surface);

    /* ── Radius (subtle, not pill-heavy) ── */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --radius-xl: 10px;

    /* ── Spacing scale ── */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    /* Jedyny token paddingu treści: 20px desktop → 16px mobile (override w @1080px) */
    --ds-content-pad: var(--space-5);
    --view-padding: var(--ds-content-pad);
    --ds-app-min-w: 360px;
    /* Wewnętrzny odstęp w wierszu listy — stałe 16px L/R (niezależnie od insetu karty) */
    --ds-list-item-pad-x: var(--space-4);
    --ds-row-pad-x: var(--ds-list-item-pad-x);
    --ds-row-pad-end: var(--ds-list-item-pad-x);

    /* ── Motion (microinterakcje) ── */
    --ds-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ds-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ds-ease-spring: cubic-bezier(0.34, 1.2, 0.64, 1);
    --ds-motion-fast: 0.16s;
    --ds-motion-mid: 0.28s;
    --ds-motion-slow: 0.42s;

    /* Focus — inset na przyciski; zewnętrzny glow na pola do wpisywania */
    --ds-focus-ring: inset 0 0 0 2px var(--ds-primary);
    --ds-focus-ring-on-fill: inset 0 0 0 2px var(--ds-text);
    --ds-focus-ring-danger: inset 0 0 0 2px var(--ds-danger);
    /* Stany interaktywne — wspólne hover / focus / active (cała aplikacja) */
    --ds-interactive-hover-bg: #E8E8EC;
    --ds-interactive-hover-border: #AEAEB6;
    --ds-interactive-active-bg: #DCDCE2;
    --ds-interactive-focus-border: var(--ds-brand-cta-active);
    --ds-interactive-focus-ring: 0 0 0 3px var(--ds-brand-tint-32);
    --ds-focus-ring-field: var(--ds-interactive-focus-ring);
    /* Pola wpisywania — hover tylko obrys; tło zawsze = domyślne (surface) */
    --ds-field-hover-bg: var(--ds-surface);
    /* Bufor wokół pól — miejsce na zewnętrzny ring focus (3px) */
    --ds-field-isolation: 1px;
    --ds-form-grid-gap: calc(var(--space-4) + var(--ds-field-isolation));
    --ds-btn-scroll-padding: 2px;
    --ds-form-section-gap: var(--space-6);
    /* Odstęp nagłówek sekcji → treść (lista pól, detail-list, kod QR itd.) */
    --ds-block-title-gap: var(--space-5);
    /* Panele szczegółów / formularze w slide-panel */
    --ds-panel-form-block-gap: var(--space-6);
    --ds-panel-form-divider-margin: var(--space-4);
    --ds-panel-detail-label-col: minmax(9.5rem, 36%);
    --ds-panel-detail-col-gap: var(--space-4);
    --ds-panel-chrome-header-min-h: 68px;
    --ds-panel-footer-pad: var(--ds-content-pad);
    --ds-panel-section-divider-color: var(--ds-border-strong);
    --ds-hint-banner-bg: var(--ds-brand-tint-12);
    --ds-hint-banner-border: var(--ds-brand-tint-38);
    --ds-info-icon-color: var(--ds-text-tertiary);

    /* ── Typography scale (SaaS: baza 14px, skala 11 / 12 / 14 / 16 / 20 / 24 / 28) ── */
    --font-ui: "ESDInter", sans-serif;
    --ds-font-features: "ss01" 1, "liga" 1, "calt" 1;
    --ds-font-numeric: lining-nums proportional-nums;
    --ds-font-numeric-tabular: lining-nums tabular-nums;
    --text-2xs: 11px;   /* micro: badge, tag, hint błędu — nie używać jako body */
    --text-xs: 12px;    /* etykiety pól, caption, kod, btn-sm */
    --text-sm: 14px;    /* body, input, btn-md, tabela, nav */
    --text-base: var(--text-sm); /* domyślny body aplikacji = 14px (nie 16px) */
    --text-md: 16px;    /* nagłówek karty / modułu / panelu */
    --text-lg: 20px;    /* podtytuł sekcji */
    --text-xl: 24px;    /* tytuł widoku (page header) */
    --text-2xl: 28px;   /* display / KPI wartość / hero */
    --leading-tight: 1.3;
    --leading-normal: 1.5;
    --leading-relaxed: 1.65;
    /* Semantyka typografii — mapowanie na komponenty aplikacji */
    --ds-type-family: var(--font-ui);
    --ds-type-body-size: var(--text-sm);
    --ds-type-body-weight: 400;
    --ds-type-body-strong-weight: 500;
    --ds-type-body-emphasis-weight: 600;
    --ds-type-label-size: var(--text-xs);
    --ds-type-label-weight: 400;
    --ds-type-caption-size: var(--text-2xs);
    --ds-type-caption-weight: 400;
    --ds-type-overline-size: var(--text-2xs);
    --ds-type-overline-weight: 600;
    --ds-type-heading-display-size: var(--text-2xl);
    --ds-type-heading-page-size: var(--text-xl);
    --ds-type-heading-section-size: var(--text-lg);
    --ds-type-heading-card-size: var(--text-md);
    --ds-type-kpi-value-size: var(--text-2xl);
    --ds-type-kpi-label-size: var(--text-xs);
    --ds-type-table-head-size: var(--text-xs);
    --ds-type-table-cell-size: var(--text-sm);
    --ds-type-btn-sm-size: var(--text-xs);
    --ds-type-btn-md-size: var(--text-sm);
    --ds-type-btn-lg-size: var(--text-sm);
    --ds-type-input-size: var(--text-sm);
    --ds-type-input-weight: 400;
    /* Wspólna wysokość: pole tekstowe = dropdown = btn-md */
    --ds-control-h: 48px;
    --ds-type-nav-size: var(--text-sm);
    --ds-type-badge-size: var(--text-2xs);
    --ds-type-code-size: var(--text-xs);
    --ds-type-line-tight: var(--leading-tight);
    --ds-type-line-body: var(--leading-normal);
    --ds-type-line-relaxed: var(--leading-relaxed);
    --font-size-xs: var(--text-xs);
    --font-size-sm: var(--text-sm);
    --font-size-md: var(--text-base);
    --font-size-lg: var(--text-md);
    --font-size-xl: var(--text-xl);
    --space-xs: var(--space-1);
    --space-sm: var(--space-2);
    --space-md: var(--space-4);
    --space-lg: var(--space-5);
    --space-xl: var(--space-6);
    /* --radius-xl: 10px (L161) — bez nadpisywania na --radius-md */
    --success: var(--ds-success);
    --warning: var(--ds-warning);
    --danger: var(--ds-danger);
    --topbar-height: 76px;
    /* Wspólna linia startu pierwszej pozycji w menu głównym i menu ustawień */
    --nav-rail-first-y: calc(var(--topbar-height) + var(--ds-dashboard-shell-pad-y));
    --sidebar-brand-block-h: calc(var(--nav-rail-first-y) - var(--space-4) - var(--ds-dashboard-shell-pad-y));
    --nav-rail-item-h: 48px;
    --nav-rail-item-gap: 4px;
    --nav-rail-item-px: 16px;
    --nav-rail-first-offset: var(--ds-dashboard-shell-pad-y);
    --cal-cell-h: 48px;

    /* Layout shell (style.css) */
    --sidebar-bg: #F4F4F5;
    --sidebar-text: #525252;
    --sidebar-text-active: #171717;
    --sidebar-active-bg: #ECECEC;
    --bg-elevated: var(--ds-surface);
    --card-shadow: none;
    --card-shadow-hover: none;
    --accent-medium: rgba(0, 0, 0, 0.08);

    /* Struktura komponentów */
    --ds-card-header-height: 60px;
    --ds-header-pad-x: var(--ds-content-pad);
    --ds-header-pad-y: var(--ds-content-pad);
    /* Inset kart — treść i stopka (nagłówki: --ds-header-pad-x) */
    --ds-inset-x: var(--ds-content-pad);
    --ds-inset-y: var(--ds-content-pad);
    /* Popup / dialog / slide-panel — 32px inset (nagłówki: --ds-popup-header-pad-y) */
    --ds-popup-inset: var(--space-8);
    --ds-popup-header-pad-y: var(--space-6);
    --ds-module-inset-x: var(--ds-content-pad);
    --ds-module-inset-y: var(--ds-content-pad);
    --ds-card-inset-x: var(--ds-content-pad);
    --ds-card-inset-y: var(--ds-content-pad);
    --ds-transition-fast: 0.12s ease;
    --ds-transition-base: 0.2s ease;
    --ds-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --ds-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --ds-shadow-lg: 0 14px 36px rgba(15, 23, 42, 0.14);
    --ds-btn-h-sm: 32px;
    --ds-btn-h-md: var(--ds-control-h);
    --ds-btn-h-md-outline: var(--ds-control-h);
    --ds-btn-h-lg: var(--ds-control-h);
    --ds-search-h: var(--ds-control-h);
    --ds-search-pad-x: var(--space-4);
    --ds-search-icon-size: 20px;
    --ds-btn-border-width: 1px;
    --ds-btn-border-color: var(--ds-border);
    --ds-btn-border-color-hover: var(--ds-interactive-hover-border);
    --ds-dashboard-row-height: 520px;
    --ds-cal-page-min-height: 560px;
    --ds-scroll-edge: var(--ds-scrollbar-edge-offset);
    --ds-scroll-gutter: var(--ds-card-inset-x);
    --ds-cal-panel-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    --ds-scrollbar-size: 4px;
    --ds-scrollbar-edge-offset: 2px;
    --ds-scrollbar-thumb: rgba(120, 120, 128, 0.58);
    --ds-scrollbar-thumb-hover: #FFCF33;
    --ds-scrollbar-track: transparent;
    --ds-scrollbar-track-inset: var(--ds-scrollbar-edge-offset);
    --ds-entity-code-col-w: 54px;
    --ds-list-code-col: var(--ds-entity-code-col-w);
    --ds-dashboard-list-code-col: 9rem;
    /* KOMPONENT: tabela produktów (.data-table--products) — szerokości kolumn */
    --ds-products-col-compact-pad-x: var(--space-2);
    --ds-products-col-code-w: 11.25rem;
    /* KOMPONENT: tabela kosza (.data-table--trash) — kolumna kod + data (composite) */
    --ds-trash-col-code-date-w: 10.5rem;
    --ds-trash-col-type-w: 8.5rem;
    --ds-trash-code-date-gap: var(--space-1);
    --ds-trash-code-date-code-font: var(--ds-entity-font-code);
    --ds-trash-code-date-code-weight: var(--ds-entity-font-code-weight);
    --ds-trash-code-date-date-font: var(--ds-entity-font-meta);
    --ds-trash-code-date-date-weight: 400;
    --ds-trash-code-date-date-color: var(--ds-text-secondary);
    --ds-products-col-category-w: 14.25rem;
    --ds-products-col-location-w: 17.25rem;
    --ds-products-col-status-w: 11rem;
    --ds-products-col-name-min-w: 10rem;
    /* KOMPONENT: podgląd kodu zasobu (.qr-preview-box) */
    --ds-qr-preview-pad: var(--space-8);
    --ds-qr-preview-min-h: 18rem;
    --ds-qr-preview-size-min: 112px;
    --ds-qr-preview-size-max: 280px;
    --ds-entity-row-content-min-h: 32px;
    --ds-entity-row-pad-y: var(--space-3);
    --ds-entity-row-min-h: calc(var(--ds-entity-row-pad-y) * 2 + var(--ds-entity-row-content-min-h));
    --ds-table-head-h: calc(var(--ds-entity-row-min-h) - var(--space-2));
    --ds-table-head-pad-y: calc(var(--ds-entity-row-pad-y) - var(--space-1));
    --ds-entity-list-pad-x: var(--ds-list-item-pad-x);
    --ds-entity-card-pad: var(--ds-inset-x);
    --ds-chart-axis-size: 12px;
    --ds-list-item-pad-end: var(--ds-list-item-pad-x);
    --ds-entity-list-scroll-edge: var(--ds-scrollbar-edge-offset);
    /* Pas scrollbara w kartach list — ten sam co padding toolbara / insetu (20px / 16px) */
    --ds-entity-scroll-gutter: var(--ds-inset-x);
    --ds-entity-table-min-w: 680px;
    --ds-entity-table-min-w-products: 52rem;
    --ds-entity-table-min-w-devices: 720px;
    /* KOMPONENT: typografia widoków zasobów (lista / tabela / kafelki) */
    --ds-entity-font: var(--text-sm);
    --ds-entity-font-code: var(--ds-entity-font);
    --ds-entity-font-code-weight: 400;
    --ds-entity-font-name-weight: 600;
    --ds-entity-font-meta: var(--text-xs);
    --ds-entity-font-head: var(--text-sm);
    --ds-entity-list-head-weight: 500;
    --ds-entity-check-box-w: 16px;
    --ds-entity-check-gap: var(--space-5);
    --ds-entity-check-col-pad-start: var(--space-5);
    --ds-entity-check-col-extra: 10px;
    --ds-entity-check-col-w: var(--ds-entity-check-box-w);
    --ds-entity-check-col-inner-w: calc(var(--ds-entity-check-box-w) + var(--ds-entity-check-gap) + var(--ds-entity-check-col-extra));
    --ds-entity-check-col-w-padded: calc(var(--ds-entity-check-col-pad-start) + var(--ds-entity-check-box-w) + var(--ds-entity-check-gap) + var(--ds-entity-check-col-extra));
    --ds-row-kebab-pad-end: var(--space-2);
    --ds-row-kebab-col-w: calc(var(--ds-row-kebab-pad-end) + 32px);
    --ds-entity-actions-w: var(--ds-row-kebab-col-w);
    --ds-entity-actions-pad-x: 0;
    --ds-entity-line: var(--leading-normal);
    --cal-gutter-width: 88px;
    --cal-mini-row-min: 36px;
    --ds-dashboard-charts-row-min-height: 280px;
    --ds-dashboard-list-row-h: 56px;
    --ds-dashboard-list-visible: 5;
    --ds-dashboard-list-scroll-h: calc(
        var(--ds-dashboard-list-visible) * var(--ds-dashboard-list-row-h)
        + (var(--ds-dashboard-list-visible) - 1) * var(--space-2)
    );
    --ds-dashboard-list-body-h: var(--ds-dashboard-list-scroll-h);
    --ds-dashboard-shell-pad-y: var(--ds-content-pad);
    --ds-dashboard-shell-pad-x: var(--ds-content-pad);
    --ds-dashboard-shell-pad-bottom: calc(var(--ds-dashboard-shell-pad-y) + var(--space-4));
    --ds-dashboard-gap: var(--space-4);
    --ds-dashboard-body-gap: var(--space-3);
    /* Odstęp pod nagłówkiem widoku = inset górny (--ds-content-pad); z flex gap odejmujemy --ds-dashboard-gap */
    --ds-page-header-gap: var(--ds-content-pad);
    /* Tytuł nagłówka — desktop = mobile (jak ewidencja); wcześniej mobile było text-lg/2xl */
    --ds-page-header-title-size: var(--text-xl);
    /* Inset kontenera listy entity — góra tak jak inset; dół bez pustego pasu pod ostatnim wierszem */
    --ds-entity-list-inset-top: var(--ds-inset-y);
    --ds-entity-list-inset-bottom: 0;
}

/* ── Typografia fluid (opcjonalna — TYLKO style guide / demo) ───────────────
   Produkcja (index.html): BEZ data-type-fluid → stała skala 14px base.
   ─────────────────────────────────────────────────────────────────────────── */
html[data-type-fluid] {
    --text-2xs: clamp(11px, 10px + 0.2vw, 12px);
    --text-xs: clamp(12px, 11px + 0.25vw, 13px);
    --text-sm: clamp(14px, 13px + 0.3vw, 15px);
    --text-base: var(--text-sm);
    --text-md: clamp(16px, 15px + 0.35vw, 17px);
    --text-lg: clamp(20px, 18px + 0.5vw, 22px);
    --text-xl: clamp(24px, 20px + 0.85vw, 28px);
    --text-2xl: clamp(28px, 24px + 1vw, 32px);
}

html {
    font-family: var(--font-ui) !important;
    font-feature-settings: var(--ds-font-features);
    font-variant-numeric: var(--ds-font-numeric);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
html, body {
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--ds-text);
}
body {
    font-family: var(--font-ui) !important;
    font-feature-settings: var(--ds-font-features);
}
button,
input,
select,
textarea,
optgroup {
    font-family: inherit;
    font-feature-settings: inherit;
    font-variant-numeric: inherit;
}
.material-symbols-outlined,
.material-symbols-rounded,
.material-symbols-sharp {
    font-family: "Material Symbols Outlined" !important;
    font-feature-settings: "liga" 1 !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-variant-numeric: normal !important;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}
:where(
    .kpi-card__value,
    .kpi-card__share-pct,
    .kpi-mini__value,
    .compliance-v4__total,
    .compliance-v4__meta,
    .compliance-v4__meta strong,
    .compliance-v4__meta span,
    #dash-inventory-list .data-table,
    .chart-legend__value,
    .chart-legend__pct,
    .cal-cell__num,
    .cal-cell__count,
    .data-table,
    .data-table th,
    .data-table td,
    .notif-summary__item,
    time,
    .ds-status-badge,
    .ds-badge,
    .badge,
    .status-badge
) {
    font-variant-numeric: var(--ds-font-numeric);
}

/* ── Typography utilities ── */
.text-display { font-size: var(--text-2xl); font-weight: 600; letter-spacing: -0.025em; line-height: var(--leading-tight); color: var(--ds-text); }
.text-title { font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.02em; line-height: var(--leading-tight); color: var(--ds-text); }
.text-subtitle { font-size: var(--text-base); font-weight: 500; color: var(--ds-text-secondary); line-height: var(--leading-normal); }
.text-label { font-size: var(--ds-type-label-size); font-weight: var(--ds-type-label-weight); color: var(--ds-color-text-2); line-height: var(--ds-type-line-body); }
.text-caption { font-size: var(--ds-type-caption-size); font-weight: var(--ds-type-caption-weight); color: var(--ds-text-tertiary); line-height: var(--leading-normal); }
.text-overline { font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ds-text-tertiary); }
.text-mono { font-family: var(--font-ui); }
/* Semantyczne klasy typografii (--ds-type-*) */
.ds-type-body { font-family: var(--ds-type-family); font-size: var(--ds-type-body-size); font-weight: var(--ds-type-body-weight); line-height: var(--ds-type-line-body); color: var(--ds-color-text-1); }
.ds-type-label { font-family: var(--ds-type-family); font-size: var(--ds-type-label-size); font-weight: var(--ds-type-label-weight); line-height: var(--ds-type-line-body); color: var(--ds-color-text-2); }
.ds-type-caption { font-family: var(--ds-type-family); font-size: var(--ds-type-caption-size); font-weight: var(--ds-type-caption-weight); line-height: var(--ds-type-line-body); color: var(--ds-color-text-3); }
.ds-type-overline { font-family: var(--ds-type-family); font-size: var(--ds-type-overline-size); font-weight: var(--ds-type-overline-weight); letter-spacing: 0.06em; text-transform: uppercase; line-height: var(--ds-type-line-body); color: var(--ds-color-text-3); }
.ds-type-heading-page { font-family: var(--ds-type-family); font-size: var(--ds-type-heading-page-size); font-weight: var(--ds-type-body-emphasis-weight); letter-spacing: -0.025em; line-height: var(--ds-type-line-tight); color: var(--ds-color-text-1); }
.ds-type-heading-section { font-family: var(--ds-type-family); font-size: var(--ds-type-heading-section-size); font-weight: var(--ds-type-body-emphasis-weight); letter-spacing: -0.02em; line-height: var(--ds-type-line-tight); color: var(--ds-color-text-1); }
.ds-type-heading-card { font-family: var(--ds-type-family); font-size: var(--ds-type-heading-card-size); font-weight: var(--ds-type-body-emphasis-weight); line-height: var(--ds-type-line-tight); color: var(--ds-color-text-1); }

/* ── KOMPONENT: tożsamość zasobu (kod / nazwa — jedna skala w całej aplikacji) ── */
#esd-app .ds-asset-code,
#esd-app .entity-card__code,
#esd-app .cal-time-grid__event-code,
#esd-app .ds-list-item__code,
#esd-app .data-table .data-table__cell-code,
#esd-app .topbar-search-result__code,
#esd-app .norms-product-chip__code,
#esd-app .cal-product-row__code,
#esd-app .pc-code,
#esd-app input.ds-asset-code,
#esd-app .details-value.ds-asset-code,
#esd-app .report-asset-code {
    font-size: var(--ds-entity-font-code);
    font-weight: var(--ds-entity-font-code-weight);
    color: var(--ds-text);
    line-height: var(--ds-entity-line);
}
#esd-app .ds-asset-name,
#esd-app .entity-card__title,
#esd-app .cal-time-grid__event-name,
#esd-app .ds-list-item__title,
#esd-app .data-table .data-table__cell-name,
#esd-app .topbar-search-result__name,
#esd-app .norms-product-chip__name,
#esd-app .cal-product-row__name,
#esd-app .dash-meter-list-item .ds-list-item__title,
#esd-app input.ds-asset-name,
#esd-app .details-value.ds-asset-name,
#esd-app .report-asset-name {
    font-size: var(--ds-entity-font);
    font-weight: var(--ds-entity-font-name-weight);
    color: var(--ds-text);
    line-height: var(--ds-entity-line);
}

/* ── KOMPONENT: widok listy (.ds-entity-list-view — kanoniczna klasa) ──
   Moduły: Ewidencja, Mierniki, Lokalizacje, Raporty, Kosz, Zespół, wizardy.
   Struktura: .entity-list-card → .ds-scroll-lane → .ds-scroll-rail → .ds-scroll-rail__body + .ds-scroll-gutter
   Host treści: .ds-entity-list-body (wewnątrz scroll hosta)
   Padding kontenera: --ds-inset-x (host / scroll-rail__body); komórki th/td: --ds-list-item-pad-x; kebab: --ds-row-kebab-pad-end. */
.ds-entity-list-body,
.ds-entity-list-view,
.entity-list,
.entity-grid,
.entity-list-scroll,
.table-card.entity-list,
.module-list--dashboard {
    font-size: var(--ds-entity-font);
    line-height: var(--ds-entity-line);
}
.ds-entity-list-body {
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
}
.ds-entity-list-body.entity-grid {
    display: grid;
}
/* Nagłówki kolumn — jeden styl we wszystkich modułach */
.ds-entity-list-view .data-table thead th,
.entity-list .data-table thead th,
.entity-list-scroll .data-table thead th,
.table-card.entity-list .data-table thead th {
    font-family: var(--font-ui);
    font-size: var(--ds-entity-font-head);
    font-weight: var(--ds-entity-list-head-weight);
    font-style: normal;
    letter-spacing: normal;
    text-transform: none;
    color: var(--ds-text-tertiary);
    line-height: var(--ds-entity-line);
}
.ds-entity-list-view .data-table td,
.entity-list .data-table td,
.entity-list-scroll .data-table td,
.table-card.entity-list .data-table td {
    font-size: var(--ds-entity-font);
}
/* Treść tabeli — jeden rozmiar; nagłówki kolumn (label) osobno powyżej */
:is(.ds-entity-list-view, .entity-list) .data-table tbody td,
:is(.ds-entity-list-view, .entity-list) .data-table tbody td .ds-asset-code,
:is(.ds-entity-list-view, .entity-list) .data-table tbody td .ds-table-cell__content {
    font-size: var(--ds-entity-font);
}
/* Komórki tabeli — stały inset poziomy 16px (--ds-entity-list-pad-x) we wszystkich widokach */
.ds-entity-list-view .data-table thead th:not(.data-table__col-check):not(.ds-row-kebab-cell),
.table-card.entity-list .data-table thead th:not(.data-table__col-check):not(.ds-row-kebab-cell),
.entity-list-scroll.ds-entity-list-view .data-table thead th:not(.data-table__col-check):not(.ds-row-kebab-cell) {
    padding-top: var(--ds-table-head-pad-y);
    padding-bottom: var(--ds-table-head-pad-y);
    padding-left: var(--ds-entity-list-pad-x);
    padding-right: var(--ds-entity-list-pad-x);
    vertical-align: middle;
    border-left: none;
    border-right: none;
}
.ds-entity-list-view .data-table tbody td:not(.data-table__cell-check):not(.ds-row-kebab-cell),
.table-card.entity-list .data-table tbody td:not(.data-table__cell-check):not(.ds-row-kebab-cell),
.entity-list-scroll.ds-entity-list-view .data-table tbody td:not(.data-table__cell-check):not(.ds-row-kebab-cell) {
    padding-top: var(--ds-entity-row-pad-y);
    padding-bottom: var(--ds-entity-row-pad-y);
    padding-left: var(--ds-entity-list-pad-x);
    padding-right: var(--ds-entity-list-pad-x);
    vertical-align: middle;
    border-left: none;
    border-right: none;
}
.ds-entity-list-view .data-table tbody td.ds-row-kebab-cell,
.table-card.entity-list .data-table tbody td.ds-row-kebab-cell,
.entity-list-scroll.ds-entity-list-view .data-table tbody td.ds-row-kebab-cell {
    padding-left: var(--ds-entity-actions-pad-x);
    padding-right: var(--ds-row-kebab-pad-end);
    width: var(--ds-entity-actions-w);
    min-width: var(--ds-entity-actions-w);
    max-width: var(--ds-entity-actions-w);
    text-align: right;
    overflow: visible;
    box-sizing: border-box;
}
.ds-entity-list-view .data-table thead th.ds-row-kebab-cell,
.table-card.entity-list .data-table thead th.ds-row-kebab-cell,
.entity-list-scroll.ds-entity-list-view .data-table thead th.ds-row-kebab-cell {
    width: var(--ds-entity-actions-w);
    min-width: var(--ds-entity-actions-w);
    max-width: var(--ds-entity-actions-w);
    padding-top: var(--ds-table-head-pad-y);
    padding-bottom: var(--ds-table-head-pad-y);
    padding-left: var(--ds-entity-actions-pad-x);
    padding-right: var(--ds-row-kebab-pad-end);
    overflow: visible;
}
.ds-entity-list-view .data-table col.data-table__col-kebab {
    width: var(--ds-entity-actions-w);
}
.ds-entity-list-view .data-table col.data-table__col-name {
    width: auto;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table col.data-table__col-code {
    width: var(--ds-entity-code-col-w);
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table :is(
    thead th.data-table__col-code,
    tbody td.data-table__cell-code
) {
    width: var(--ds-entity-code-col-w);
    min-width: var(--ds-entity-code-col-w);
    max-width: var(--ds-entity-code-col-w);
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ds-entity-list-view .ds-row-kebab-cell .dropdown-actions,
.ds-entity-list-view .ds-row-kebab-cell .ds-kebab-btn {
    overflow: visible;
}
.ds-entity-list-view .data-table thead th,
.entity-list .data-table thead th,
.entity-list-scroll .data-table thead th,
.table-card.entity-list .data-table thead th {
    text-align: left;
}
/* Kolumna checkbox — wąska; lewy inset jak lista, wysokość wiersza = --ds-entity-row-min-h */
:is(.ds-entity-list-view, .entity-list) .data-table:has(col.data-table__col-check) col.data-table__col-check {
    width: var(--ds-entity-check-col-w-padded);
}
:is(.ds-entity-list-view, .entity-list) .data-table:has(col.data-table__col-check) col.data-table__col-code {
    width: auto;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table:has(col.data-table__col-check) :is(
    thead th.data-table__col-code,
    tbody td.data-table__cell-code
) {
    width: auto;
    min-width: 7rem;
    max-width: none;
}
:is(.ds-entity-list-view, .entity-list) .data-table thead th.data-table__col-check,
.entity-list-scroll .data-table thead th.data-table__col-check,
.table-card.entity-list .data-table thead th.data-table__col-check {
    width: var(--ds-entity-check-col-w-padded);
    min-width: var(--ds-entity-check-col-w-padded);
    max-width: var(--ds-entity-check-col-w-padded);
    padding-top: var(--ds-table-head-pad-y);
    padding-bottom: var(--ds-table-head-pad-y);
    padding-left: var(--ds-entity-check-col-pad-start);
    padding-right: var(--ds-entity-check-gap);
    box-sizing: border-box;
    vertical-align: middle;
    text-align: left;
    line-height: 1;
    overflow: visible;
}
:is(.ds-entity-list-view, .entity-list) .data-table tbody td.data-table__cell-check,
.entity-list-scroll .data-table tbody td.data-table__cell-check,
.table-card.entity-list .data-table tbody td.data-table__cell-check {
    width: var(--ds-entity-check-col-w-padded);
    min-width: var(--ds-entity-check-col-w-padded);
    max-width: var(--ds-entity-check-col-w-padded);
    padding-top: var(--ds-entity-row-pad-y);
    padding-bottom: var(--ds-entity-row-pad-y);
    padding-left: var(--ds-entity-check-col-pad-start);
    padding-right: var(--ds-entity-check-gap);
    box-sizing: border-box;
    vertical-align: middle;
    text-align: left;
    line-height: 1;
    overflow: visible;
}
:is(.ds-entity-list-view, .entity-list) .data-table .data-table__cell-check .ds-check.ds-check--table,
.entity-list-scroll .data-table .data-table__cell-check .ds-check.ds-check--table,
.table-card.entity-list .data-table .data-table__cell-check .ds-check.ds-check--table {
    width: auto;
    margin: 0;
    gap: 0;
    line-height: 1;
    min-height: 0;
    height: var(--ds-entity-check-box-w);
    justify-content: flex-start;
    align-items: center;
}
.ds-check--sm-box.ds-check--table {
    gap: 0;
}
:is(.ds-entity-list-view, .entity-list) .data-table:has(col.data-table__col-check) :is(
    thead th.data-table__col-code,
    tbody td.data-table__cell-code
) {
    padding-left: 0;
}
/* Wewnątrz insetu — padding 16px L/R; kebab-cell osobno (8px prawy) */
:is(.ds-content-inset, .ds-inset-scroll--host) :is(.ds-entity-list-view, .entity-list) .data-table thead th:not(.ds-row-kebab-cell):not(.data-table__col-check),
:is(.ds-content-inset, .ds-inset-scroll--host) :is(.ds-entity-list-view, .entity-list) .data-table tbody td:not(.ds-row-kebab-cell):not(.data-table__cell-check) {
    padding-left: var(--ds-entity-list-pad-x);
    padding-right: var(--ds-entity-list-pad-x);
}
:is(.ds-content-inset, .ds-inset-scroll--host) :is(.ds-entity-list-view, .entity-list) .data-table .ds-row-kebab-cell {
    padding-left: 0;
    padding-right: var(--ds-row-kebab-pad-end);
}
:is(.ds-content-inset, .ds-inset-scroll--host) .module-empty,
:is(.ds-content-inset, .ds-inset-scroll--host) .dash-inventory-table__empty {
    padding-left: 0;
    padding-right: 0;
}
.ds-entity-list-view .data-table__cell-code,
.entity-list .data-table__cell-code,
.entity-list-scroll .data-table__cell-code {
    font-size: var(--ds-entity-font-code);
}
/* Widok listy zasobów — bez separatorów kolumn i wierszy */
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table {
    border-collapse: separate;
    border-spacing: 0;
    border: none;
    table-layout: auto;
    width: max(100%, var(--ds-entity-table-min-w));
    min-width: var(--ds-entity-table-min-w);
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table :is(thead th, tbody td):not(.ds-row-kebab-cell):not(.data-table__cell-check) {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table :is(
    tbody td.ds-row-kebab-cell,
    thead th.ds-row-kebab-cell,
    tbody td:last-child,
    thead th:last-child,
    thead th.data-table__col-report-action,
    tbody td.data-table__cell-report-action
) {
    overflow: visible;
    text-overflow: clip;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table :is(
    thead th.data-table__col-status,
    tbody td.data-table__cell-status
) {
    min-width: 9.5rem;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table :is(
    tbody td.ds-row-kebab-cell,
    thead th.ds-row-kebab-cell
) {
    min-width: var(--ds-entity-actions-w);
    width: var(--ds-entity-actions-w);
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table tbody td:not(.data-table__cell-status) :is(.badge, .ds-status-badge) {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table td.data-table__cell-status .ds-status-badge {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table :is(th.data-table__col-status, td.data-table__cell-status) {
    overflow: visible;
    text-overflow: clip;
    vertical-align: middle;
    white-space: nowrap;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table td.data-table__cell-status .ds-table-cell__content {
    display: flex;
    align-items: center;
    overflow: visible;
    min-height: 0;
    min-width: min-content;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table td.data-table__cell-status .ds-status-badge {
    flex-shrink: 0;
    min-width: min-content;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll, .table-card.entity-list) .data-table :is(thead, tbody, tr, th, td) {
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: none;
    outline: none;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll, .table-card.entity-list) .data-table tbody td {
    border-top: 1px solid var(--ds-border);
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll, .table-card.entity-list) .data-table thead th + th {
    border-left: none;
    box-shadow: none;
}
/* Entity list — scroll host wypełnia obszar do paddingu (.ds-content-inset) */
.ds-content-inset--scroll > .ds-scroll-lane--fill,
.ds-inset-scroll--host.ds-inset-scroll--fill > .ds-scroll-lane--fill {
    flex: 1 1 0%;
    min-height: 0;
}
.ds-content-inset--scroll > .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset,
.ds-inset-scroll--host > .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.ds-content-inset--scroll .ds-scroll-lane__inset > :is(.ds-entity-list-body, .entity-list),
.ds-inset-scroll--host .ds-scroll-lane__inset > :is(.ds-entity-list-body, .entity-list) {
    flex: 0 0 auto;
    min-height: 0;
    height: auto;
    align-self: stretch;
    width: 100%;
    overflow: visible;
}
.ds-entity-list-body.is-shown-flex:not(.entity-grid) {
    display: block !important;
    flex: none !important;
    height: auto;
}
:is(.ds-entity-list-body, .entity-list):not(.entity-grid) .data-table {
    height: auto;
    flex: none;
}
:is(.ds-entity-list-body, .entity-list):not(.entity-grid):not(.ds-entity-list-view) .data-table tbody tr {
    height: auto;
    max-height: none;
}
:is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table tbody tr {
    min-height: var(--ds-entity-row-min-h);
}
.ds-content-inset--scroll .ds-scroll-lane__inset > .entity-grid.is-shown-grid,
.ds-inset-scroll--host .ds-scroll-lane__inset > .entity-grid.is-shown-grid,
.entity-list-card .ds-scroll-rail .ds-scroll-lane__inset > .entity-grid.is-shown-grid {
    flex: 0 0 auto;
    min-height: auto;
    height: auto;
    max-height: none;
    overflow: visible !important;
}
.ds-entity-list-view .data-table__cell-name,
.entity-list .data-table__cell-name,
.entity-list-scroll .data-table__cell-name {
    font-size: var(--ds-entity-font);
}
.ds-entity-list-view .data-table thead th.data-table__col-qty,
.ds-entity-list-view .data-table tbody td.data-table__cell-qty {
    text-align: left;
    overflow: visible;
    text-overflow: clip;
}
.ds-entity-list-view .data-table thead th.data-table__col-category,
.ds-entity-list-view .data-table tbody td.data-table__cell-category {
    text-align: left;
    font-weight: 500;
}
.entity-card__meta-label,
.entity-card__meta-value,
.ds-list-item__meta,
.ds-list-item__date {
    font-size: var(--ds-entity-font-meta);
}

/* ── Page header ── */
.ds-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--ds-page-header-gap);
    flex-shrink: 0;
    min-height: unset;
    height: auto;
    box-sizing: border-box;
}
.dashboard-scroll > .ds-page-header {
    align-items: center;
    margin-bottom: calc(var(--ds-page-header-gap) - var(--ds-dashboard-gap));
}
:is(
    .dashboard-scroll,
    .app-view.entity-view.dashboard-view > .entity-view-scroll
) > :is(.ds-page-header, .ds-page-header--actions) {
    margin-bottom: calc(var(--ds-page-header-gap) - var(--ds-dashboard-gap));
}
:is(
    .dashboard-scroll,
    .app-view.entity-view.dashboard-view > .entity-view-scroll
) > .account-section-header {
    margin-bottom: 0;
}
.ds-page-header__eyebrow { font-size: var(--text-xs); font-weight: 500; color: var(--ds-text-secondary); margin: 0 0 var(--space-1); }
.ds-page-header__title { font-size: var(--ds-page-header-title-size); font-weight: 600; letter-spacing: -0.025em; margin: 0; line-height: var(--leading-tight); }
.ds-page-header__desc { font-size: var(--text-sm); color: var(--ds-text-secondary); margin: var(--space-2) 0 0; max-width: 520px; line-height: var(--leading-relaxed); }

.page-header { margin-bottom: var(--space-6); gap: var(--space-4); }
.page-header h1, .ds-page-header__title { font-size: var(--ds-page-header-title-size); font-weight: 600; }
.page-eyebrow { font-size: var(--text-xs); margin-bottom: var(--space-1); color: var(--ds-text-secondary); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0 16px;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    overflow: visible;
    transition: background var(--ds-motion-fast) var(--ds-ease-out),
                border-color var(--ds-motion-fast) var(--ds-ease-out),
                color var(--ds-motion-fast) var(--ds-ease-out),
                box-shadow var(--ds-motion-fast) var(--ds-ease-out),
                transform var(--ds-motion-fast) var(--ds-ease-out);
    text-decoration: none;
}
.btn:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--ds-primary);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn .material-symbols-outlined { font-size: 18px; line-height: 1; }

/* ── Przyciski — obrys/hover/focus nie obcinany (cała aplikacja) ── */
#esd-app :is(
    button:not(.calendar-day):not(.custom-option):not(.ds-head-dropdown__option):not(.notif-filter-mobile__option),
    a.btn,
    .btn,
    .btn-text,
    .btn-cal-today,
    .btn-cal-nav-sm,
    .icon-btn,
    .filter-bar__clear,
    .meas-method-type__btn,
    .meas-status-tiles__btn,
    .prod-code-type__btn,
    .prod-code-upload-btn,
    .ds-back-link,
    .ds-kebab-btn,
    [class*="__point-action-btn"],
    [class*="__action-btn"]
) {
    overflow: visible;
    box-sizing: border-box;
}
#esd-app :is(
    .ds-dialog__footer,
    .ds-dialog__footer-actions,
    .slide-panel__footer,
    .slide-panel__footer-actions,
    #meas-wizard-footer,
    .view-toolbar__actions,
    .filter-bar__actions,
    .filter-bar > .filter-bar__clear,
    .ds-page-header__actions,
    .ds-card__header-actions,
    .ds-card__footer,
    .ds-module__foot,
    .entity-card__header-actions,
    .account-section-header__actions,
    .company-logo-upload__actions,
    .avatar-section__actions,
    .measurement-form__point-actions,
    .measurement-form__points-stack,
    .prod-code-preview-controls,
    .notif-dropdown__foot,
    .cal-side-panel__foot,
    .auth-card-content .auth-form-actions,
    .ds-add-product-form__actions,
    .report-wizard-toolbar,
    .empty-state__actions
) {
    overflow: visible;
}
#esd-app :is(
    .ds-scroll-rail__body,
    .ds-dialog__body,
    .slide-panel__body,
    .slide-panel__body--meas-wizard,
    .meas-wizard-form-wrap .ds-scroll-rail__body
) {
    scroll-padding: var(--ds-btn-scroll-padding);
}

.btn-primary {
    background: var(--ds-primary);
    border-color: var(--ds-primary);
    color: #fff;
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    box-shadow: none;
}
.btn-primary:hover { background: var(--ds-primary-hover); border-color: var(--ds-primary-hover); filter: none; }
.btn-primary:active { background: var(--ds-primary-active); border-color: var(--ds-primary-active); }
.btn-primary:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--ds-text);
}

.btn-secondary {
    background: var(--ds-surface);
    border: var(--ds-btn-border-width) solid var(--ds-btn-border-color);
    color: var(--ds-text);
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
    font-size: var(--text-sm);
    font-weight: 500;
    box-shadow: none;
}
.btn-secondary:hover { background: var(--ds-interactive-hover-bg); border-color: var(--ds-interactive-hover-border); color: var(--ds-text); box-shadow: none; }
.btn-secondary:active { background: var(--ds-interactive-active-bg); box-shadow: none; }

.btn-outline {
    background: var(--ds-surface);
    border: var(--ds-btn-border-width) solid var(--ds-btn-border-color);
    color: var(--ds-text);
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
    font-size: var(--text-sm);
    font-weight: 500;
    box-sizing: border-box;
    box-shadow: none;
}
.btn-outline:hover { background: var(--ds-interactive-hover-bg); border-color: var(--ds-interactive-hover-border); color: var(--ds-text); box-shadow: none; }
.btn-outline:active { background: var(--ds-interactive-active-bg); box-shadow: none; }
.btn-outline:focus-visible {
    outline: none;
    border-color: var(--ds-interactive-focus-border);
    box-shadow: var(--ds-focus-ring);
}
.btn-outline--active {
    background: var(--ds-surface);
    border-color: var(--ds-interactive-focus-border);
    color: var(--ds-text);
    box-shadow: none;
}
.btn-outline--clear {
    background: transparent;
}
.btn-outline--clear:hover {
    background: var(--ds-interactive-hover-bg);
    border-color: var(--ds-interactive-hover-border);
}
.btn-outline--clear:active {
    background: var(--ds-interactive-active-bg);
}
.btn-outline.btn-outline--active:hover,
.btn-outline.btn-outline--active:focus-visible:not(:disabled) {
    background: var(--ds-surface);
    border-color: var(--ds-interactive-focus-border);
    border-width: var(--ds-btn-border-width);
    color: var(--ds-text);
    box-shadow: var(--ds-interactive-focus-ring);
    transform: none;
}

/* Przycisk Filtry — hover bez ciemnego tła (tylko obrys, jak pola formularza) */
.view-toolbar__actions [id^="btn-toggle-filters"].btn-outline:not(.btn-outline--active):hover:not(:disabled),
.view-toolbar__actions .view-toolbar__mobile-toggle.btn-outline:not(.btn-outline--active):hover:not(:disabled) {
    background: var(--ds-surface);
    border-color: var(--ds-interactive-hover-border);
    box-shadow: none;
}
.view-toolbar__actions [id^="btn-toggle-filters"].btn-outline--active,
.view-toolbar__actions .view-toolbar__mobile-toggle.btn-outline--active {
    background: var(--ds-brand-cta-soft);
    border-color: color-mix(in srgb, var(--ds-brand-cta) 38%, var(--ds-border));
    color: var(--ds-text);
    box-shadow: none;
}
.view-toolbar__actions [id^="btn-toggle-filters"].btn-outline--active:hover:not(:disabled),
.view-toolbar__actions [id^="btn-toggle-filters"].btn-outline--active:focus-visible:not(:disabled),
.view-toolbar__actions .view-toolbar__mobile-toggle.btn-outline--active:hover:not(:disabled),
.view-toolbar__actions .view-toolbar__mobile-toggle.btn-outline--active:focus-visible:not(:disabled) {
    background: color-mix(in srgb, var(--ds-brand-cta) 14%, var(--ds-brand-cta-soft));
    border-color: color-mix(in srgb, var(--ds-brand-cta) 52%, var(--ds-border));
    box-shadow: var(--ds-interactive-focus-ring);
    transform: none;
}

.btn-small { height: 32px; min-height: 32px; padding: 0 12px; font-size: var(--text-xs); }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--ds-text-secondary);
    padding: 9px 12px;
}
.btn-ghost:hover { background: var(--ds-interactive-hover-bg); color: var(--ds-text); }
.btn-ghost:active { background: var(--ds-interactive-active-bg); }
.btn-ghost.btn-md {
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
    padding: 0 16px;
    font-size: var(--text-sm);
    font-weight: 500;
    box-sizing: border-box;
}

.btn-accent {
    background: var(--ds-brand-cta);
    border: 1px solid var(--ds-brand-cta-border);
    color: var(--ds-brand-cta-text);
    font-weight: 600;
}
.btn-accent:hover {
    background: var(--ds-brand-cta-hover);
    border-color: var(--ds-brand-cta-hover);
    color: var(--ds-brand-cta-text);
}
.btn-accent:active { background: var(--ds-brand-cta-active); }
.btn-accent .material-symbols-outlined { color: var(--ds-brand-cta-text); }

.btn-brand {
    background: var(--ds-brand-cta);
    border: 1px solid var(--ds-brand-cta-border);
    color: var(--ds-brand-cta-text);
    font-weight: 600;
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
    box-shadow: none;
}
.btn-brand:hover {
    background: var(--ds-brand-cta-hover);
    border-color: var(--ds-brand-cta-hover);
    color: var(--ds-brand-cta-text);
}
.btn-brand:active {
    background: var(--ds-brand-cta-active);
    border-color: var(--ds-brand-cta-active);
}
.btn-brand .material-symbols-outlined { color: var(--ds-brand-cta-text); }

.btn-ghost.btn--danger {
    color: var(--ds-text-secondary);
}
.btn-ghost.btn--danger:hover {
    background: var(--ds-danger-soft);
    color: var(--ds-danger);
}
.btn-outline.btn--danger {
    color: var(--ds-text-secondary);
}
.btn-outline.btn--danger:hover {
    background: var(--ds-danger-soft);
    border-color: var(--ds-danger);
    color: var(--ds-danger);
}
.btn-ghost.btn--danger:hover .material-symbols-outlined,
.btn-outline.btn--danger:hover .material-symbols-outlined {
    color: var(--ds-danger);
}
.btn-outline.btn--danger:focus-visible,
.btn-ghost.btn--danger:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--ds-danger);
}
.btn:not(:disabled):hover:not(:active) .material-symbols-outlined {
    transform: scale(1.08);
}
.btn.prod-code-upload-btn:not(:disabled):hover:not(:active) .material-symbols-outlined,
.btn.prod-code-download-btn:not(:disabled):hover:not(:active) .material-symbols-outlined,
.icon-btn--infield:not(:disabled):hover:not(:active) .material-symbols-outlined,
.schedule-date-step__cal-btn:not(:disabled):hover:not(:active) .material-symbols-outlined {
    transform: none;
}

.btn-sm { height: 32px; min-height: 32px; padding: 0 12px; font-size: var(--text-xs); }
.btn-md { height: var(--ds-control-h); min-height: var(--ds-control-h); padding: 0 18px; font-size: var(--text-sm); }
.btn-outline.btn-md { height: var(--ds-control-h); min-height: var(--ds-control-h); }
.btn-lg { height: var(--ds-control-h); min-height: var(--ds-control-h); padding: 0 20px; font-size: var(--text-base); }
.btn-lg .material-symbols-outlined { font-size: 20px; }
/* Skala rozmiarów (small / normal / big) — wspólna dla .btn, .btn-text, .btn--icon-only, .icon-btn--sm/md/lg */
.btn-block { width: 100%; }

/* Kwadratowy przycisk ikony — wysokość = btn-sm / btn-md / btn-lg */
.btn--icon-only {
    width: var(--ds-control-h);
    min-width: var(--ds-control-h);
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
    padding: 0;
}
.btn-outline.btn--icon-only {
    width: var(--ds-control-h);
    min-width: var(--ds-control-h);
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
}
.btn-sm.btn--icon-only {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
}
.btn-outline.btn-sm.btn--icon-only {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
}
.btn-md.btn--icon-only {
    width: var(--ds-control-h);
    min-width: var(--ds-control-h);
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
}
.btn-outline.btn-md.btn--icon-only {
    width: var(--ds-control-h);
    min-width: var(--ds-control-h);
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
}
.btn-lg.btn--icon-only {
    width: var(--ds-control-h);
    min-width: var(--ds-control-h);
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
}
.btn-outline.btn-lg.btn--icon-only {
    width: var(--ds-control-h);
    min-width: var(--ds-control-h);
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
}
.btn-sm.btn--icon-only .material-symbols-outlined { font-size: 16px; }
.btn--icon-only .material-symbols-outlined { margin: 0; }

/* Legacy: wariant bez klasy .btn — wyrównanie do btn-md */
.btn-primary:not(.btn),
.btn-secondary:not(.btn),
.btn-outline:not(.btn),
.btn-ghost:not(.btn),
.btn-accent:not(.btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-ui);
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn-primary:not(.btn) .material-symbols-outlined,
.btn-secondary:not(.btn) .material-symbols-outlined,
.btn-outline:not(.btn) .material-symbols-outlined { font-size: 18px; line-height: 1; }
.btn-primary:not(.btn),
.btn-secondary:not(.btn) { height: var(--ds-control-h); min-height: var(--ds-control-h); padding: 0 18px; font-size: var(--text-sm); font-weight: 500; }
.btn-outline:not(.btn) { height: var(--ds-control-h); min-height: var(--ds-control-h); padding: 0 18px; font-size: var(--text-sm); font-weight: 500; box-sizing: border-box; }
.btn-small:not(.btn),
.btn-sm:not(.btn) { height: 32px; min-height: 32px; padding: 0 12px; font-size: var(--text-xs); }

.btn-footer {
    width: 100%;
    font-weight: 500;
    justify-content: center;
}
.btn:active:not(:disabled) { transform: scale(0.98); }

/* Kontekst użycia — hierarchia przycisków:
 * btn-brand   — jeden główny CTA modułu (Dodaj zasób, Nowy raport, Zapisz produkt)
 * btn-primary — zapis / potwierdź / dalej (Zapisz zmiany, Zapisz pomiar, Dalej)
 * btn-outline — akcje drugorzędne (Filtry, Anuluj, Wczytaj kod); obwódka --ds-btn-border-color
 * btn-ghost   — reset / pomocnicze (Wyczyść filtry, Usuń miękkie, Oznacz wszystkie)
 * btn-text   — linkowy, bez tła; hover = podkreślenie (Wybierz awatara, Pokaż więcej)
 * btn--danger — destrukcyjne (hover), np. Wyloguj, Usuń encję
 */

.btn-text, .btn-cal-today {
    background: none;
    border: none;
    color: var(--ds-text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.btn-text.btn-sm {
    font-size: var(--text-xs);
    padding: 4px 8px;
}
.btn-text.btn-md {
    font-size: var(--text-sm);
    padding: 6px 10px;
}
.btn-text.btn-lg {
    font-size: var(--text-base);
    padding: 8px 12px;
}
.btn-text:hover {
    background: transparent;
    color: var(--ds-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.btn.btn-text:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--ds-primary) !important;
}
.btn-cal-today:hover { background: var(--ds-surface-muted); color: var(--ds-text); text-decoration: none; }

.icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    border: var(--ds-btn-border-width) solid var(--ds-btn-border-color);
    background: var(--ds-surface);
    color: var(--ds-text-secondary);
    cursor: pointer;
    overflow: visible;
    transition: background var(--ds-motion-fast) var(--ds-ease-out),
                border-color var(--ds-motion-fast) var(--ds-ease-out),
                color var(--ds-motion-fast) var(--ds-ease-out),
                transform var(--ds-motion-fast) var(--ds-ease-out),
                box-shadow var(--ds-motion-fast) var(--ds-ease-out);
}
.icon-btn .material-symbols-outlined {
    font-size: 22px;
    line-height: 1;
    color: inherit;
    transition: transform var(--ds-motion-mid) var(--ds-ease-spring),
                color var(--ds-motion-fast) var(--ds-ease-out);
}
.icon-btn:not(.icon-btn--active):not(.icon-btn--topbar-refresh):not(.icon-btn--topbar-notifications):not(.icon-btn--topbar-settings):not(.topbar__menu-btn):not(.icon-btn--infield):not(.schedule-date-step__cal-btn):not(.ds-close-btn):not(.modal-close):not(.ds-kebab-btn):not([data-dialog-close]):not([data-panel-close]):hover .material-symbols-outlined {
    transform: scale(1.14) rotate(-8deg);
}
.icon-btn:active:not(:disabled):not(.schedule-date-step__cal-btn):not(.icon-btn--active) { transform: none; }
.icon-btn:hover {
    background: var(--ds-interactive-hover-bg);
    border-color: var(--ds-interactive-hover-border);
    color: var(--ds-text);
}
.icon-btn--ghost {
    border: none;
    background: transparent;
    color: var(--ds-text-secondary);
}
.icon-btn--ghost:hover {
    background: var(--ds-interactive-hover-bg);
    border: none;
    color: var(--ds-text);
}
.icon-btn--xs {
    width: 28px;
    height: 28px;
}
.icon-btn--xs .material-symbols-outlined {
    font-size: 18px;
}
.icon-btn--sm {
    width: 32px;
    height: 32px;
}
.icon-btn--sm .material-symbols-outlined {
    font-size: 20px;
}
.icon-btn--md {
    width: 40px;
    height: 40px;
}
.icon-btn--md .material-symbols-outlined {
    font-size: 22px;
}
.icon-btn--infield {
    width: 32px;
    height: 32px;
}
.icon-btn--infield .material-symbols-outlined {
    font-size: 20px;
}
.icon-btn--lg {
    width: 48px;
    height: 48px;
}
.icon-btn--lg .material-symbols-outlined {
    font-size: 24px;
}
.icon-btn.icon-btn--active {
    background: var(--ds-primary);
    border-color: var(--ds-primary);
    color: #fff;
}
.icon-btn.icon-btn--active:hover,
.icon-btn.icon-btn--active:focus:not(:focus-visible):not(:disabled) {
    background: var(--ds-primary);
    border-color: var(--ds-primary);
    border-width: var(--ds-btn-border-width);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: none;
}
.icon-btn.icon-btn--active:focus-visible:not(:disabled) {
    background: var(--ds-primary);
    border-color: var(--ds-primary);
    border-width: var(--ds-btn-border-width);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--ds-focus-ring-on-fill) !important;
}
.icon-btn.icon-btn--active .material-symbols-outlined { color: #fff; }
.icon-btn.icon-btn--active:hover .material-symbols-outlined,
.icon-btn.icon-btn--active:focus-visible .material-symbols-outlined {
    color: #fff;
    transform: scale(1.14) rotate(-8deg);
}
/* Topbar icon animacje: .icon-btn--topbar-refresh | --topbar-notifications | --topbar-settings — patrz sekcja IV */
.btn-footer.btn-secondary:hover,
.btn-footer.btn-outline:hover {
    background: var(--ds-primary);
    border-color: var(--ds-primary);
    color: #fff;
}
.btn-footer.btn-secondary:hover .material-symbols-outlined,
.btn-footer.btn-outline:hover .material-symbols-outlined { color: #fff; }

.topbar .icon-btn:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-btn-border-color-hover);
    color: var(--ds-text);
}
.topbar .icon-btn.icon-btn--active,
.topbar .icon-btn.icon-btn--active:hover,
.topbar .icon-btn.icon-btn--active:focus:not(:focus-visible) {
    background: var(--ds-primary) !important;
    border-color: var(--ds-primary) !important;
    border-width: var(--ds-btn-border-width);
    color: #fff !important;
    transform: none !important;
    box-shadow: none !important;
}
.topbar .icon-btn.icon-btn--active:focus-visible {
    background: var(--ds-primary) !important;
    border-color: var(--ds-primary) !important;
    border-width: var(--ds-btn-border-width);
    color: #fff !important;
    transform: none !important;
    box-shadow: var(--ds-focus-ring-on-fill) !important;
}
.topbar .icon-btn.icon-btn--active:hover .material-symbols-outlined,
.topbar .icon-btn.icon-btn--active:focus-visible .material-symbols-outlined {
    transform: scale(1.14) rotate(-8deg);
}
.topbar .icon-btn.icon-btn--active .material-symbols-outlined { color: #fff !important; }

.notif-dropdown-wrap { position: relative; display: inline-flex; flex-shrink: 0; z-index: 2; }
.notif-dropdown-wrap:has(.notif-dropdown:not([hidden])) {
    z-index: 1200;
}
.notif-btn-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
}

/* Topbar — ikony stałe w slocie (bez przesuwania przy active/hover/focus) */
.topbar__slot--actions .icon-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    transform: none !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    outline: none;
    box-shadow: none;
}
.topbar__slot--actions .icon-btn:hover,
.topbar__slot--actions .icon-btn:focus:not(:focus-visible),
.topbar__slot--actions .icon-btn:active,
.topbar__slot--actions .icon-btn.icon-btn--active:not(:focus-visible) {
    transform: none !important;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-width: var(--ds-btn-border-width);
    outline: none;
    box-shadow: none;
}
.topbar__slot--actions .icon-btn:focus-visible {
    transform: none !important;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-width: var(--ds-btn-border-width);
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
.topbar__slot--actions .icon-btn.icon-btn--active:focus-visible {
    box-shadow: var(--ds-focus-ring-on-fill) !important;
}
.topbar__slot--actions .icon-btn.icon-btn--active:hover,
.topbar__slot--actions .icon-btn.icon-btn--active:focus-visible {
    border-width: var(--ds-btn-border-width);
}
.topbar__slot--actions .icon-btn .material-symbols-outlined {
    display: block;
    width: 22px;
    height: 22px;
    font-size: 22px;
    line-height: 22px;
    text-align: center;
    flex-shrink: 0;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}
.topbar__slot--actions .icon-btn.icon-btn--active .material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* Badge liczby powiadomień — czerwony pill */
.topbar-notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--ds-danger) !important;
    color: #fff !important;
    font-size: 10px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--ds-surface);
    line-height: 1;
    z-index: 3;
    pointer-events: none;
    box-sizing: border-box;
    animation: ds-pop 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.topbar-notif-badge:not(:empty) {
    display: inline-flex;
}
.topbar-notif-badge--round {
    width: 18px;
    padding: 0;
}
.has-notifications .material-symbols-outlined { color: var(--ds-text-secondary); }
.topbar .icon-btn.icon-btn--active.has-notifications .material-symbols-outlined { color: #fff !important; }

.global-search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    height: var(--ds-search-h);
    min-height: var(--ds-search-h);
    padding: 0 var(--ds-search-pad-x);
    box-sizing: border-box;
    cursor: text;
    overflow: visible;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.global-search .material-symbols-outlined {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: var(--ds-search-icon-size);
    color: var(--ds-text-tertiary);
}
.global-search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    color: var(--ds-text);
    padding: 0;
    line-height: 1.35;
    align-self: center;
}
.global-search:hover:not(:focus-within) {
    border-color: var(--ds-interactive-hover-border);
}
.global-search:focus-within {
    border: 1px solid var(--ds-interactive-focus-border);
    box-shadow: var(--ds-interactive-focus-ring);
    background: var(--ds-surface);
}
.global-search input,
.global-search input:focus,
.global-search input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* ── Moduł (ds-module) ──
   Jeden komponent = ramka + nagłówek + treść. Nagłówek i treść NIE mają własnej karty.

   Samodzielny moduł (widoczna karta):
     .ds-module.ds-module--framed  (= .ds-card — alias wsteczny)
       > .ds-module__head
       > .ds-module__body
       [> .ds-module__foot]

   Panel wewnątrz modułu (split, kolumny — bez własnej ramki):
     .ds-module
       > .ds-module__head
       > .ds-module__body

   Rozciąganie: .ds-module--framed.ds-module--stretch + .ds-module__body--grow
── */
.ds-module {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}
.ds-card,
.ds-module.ds-module--framed {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.ds-card__header,
.ds-module__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    height: var(--ds-card-header-height);
    min-height: var(--ds-card-header-height);
    max-height: var(--ds-card-header-height);
    padding: 0 var(--ds-header-pad-x);
    flex-shrink: 0;
    border-bottom: 1px solid var(--ds-border);
    box-sizing: border-box;
    margin: 0;
    background: transparent;
    overflow: visible;
}
.ds-card__footer,
.ds-module__foot {
    overflow: visible;
}
/* Nagłówki modułów — tytuł i akcje zawsze wyśrodkowane w pionie względem kontenera */
.ds-card__header > *,
.ds-module__head > *,
.ds-card__header-actions,
.ds-module__head-actions,
.ds-card__header-main,
.ds-module__head-main,
.ds-card__title,
.ds-module__title,
.notif-panel-split__col .ds-module__head > * {
    align-self: center;
}
.ds-card__title,
.ds-module__title {
    font-size: var(--text-md);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1;
    align-self: center;
    display: flex;
    align-items: center;
    min-height: 0;
}
.ds-card__header-actions,
.ds-module__head-actions {
    display: flex;
    align-items: center;
    align-self: center;
    gap: var(--space-2);
    margin-left: auto;
    min-width: 0;
    flex-shrink: 1;
    height: 100%;
}
.ds-card__header-actions > *,
.ds-module__head-actions > * {
    align-self: center;
}
.ds-card__header-actions .btn-outline,
.ds-module__head-actions .btn-outline {
    border: var(--ds-btn-border-width) solid var(--ds-btn-border-color);
    background: var(--ds-surface);
}

/* ── KOMPONENT: dropdown w nagłówku modułu/karty (Lista powiadomień, filtry list) ──
   Typografia opcji = wariant przycisku triggera (btn-sm → text-xs, btn-md → text-sm, btn-lg → text-base).
   Otwarte menu nie może być przycinane przez overflow kart/modułów. */
.ds-head-dropdown,
.notif-filter-mobile {
    display: block;
    position: relative;
    flex-shrink: 0;
    --ds-dropdown-font-size: var(--text-sm);
    --ds-dropdown-option-py: 10px;
    --ds-dropdown-option-px: 12px;
}
.ds-head-dropdown:has(.btn-sm),
.notif-filter-mobile:has(.btn-sm) {
    --ds-dropdown-font-size: var(--text-xs);
    --ds-dropdown-option-py: 8px;
    --ds-dropdown-option-px: 10px;
}
.ds-head-dropdown:has(.btn-lg),
.notif-filter-mobile:has(.btn-lg) {
    --ds-dropdown-font-size: var(--text-base);
    --ds-dropdown-option-py: 12px;
    --ds-dropdown-option-px: 14px;
}
:is(
    .dashboard-layout,
    .dashboard-body,
    .dashboard-row,
    .dashboard-row--charts,
    .dashboard-row--bar-charts,
    .entity-list-card,
    .view-toolbar,
    .view-toolbar__filters,
    .filter-bar,
    .form-group,
    .ds-card,
    .ds-module.ds-module--framed,
    .notif-panel-split__col,
    .dash-inventory-card,
    #view-dashboard .dashboard-row--charts .dash-inventory-card
):is(
    :has(.ds-head-dropdown.is-open),
    :has(.ds-head-dropdown__menu:not([hidden])),
    :has(.custom-select.open),
    :has(.cal-view-dropdown.open),
    :has(.dropdown-actions.is-open)
) {
    overflow: visible;
}
.dashboard-row--charts > .ds-card:has(:is(.ds-head-dropdown.is-open, .custom-select.open, .dropdown-actions.is-open, .cal-view-dropdown.open)),
.dashboard-row > .ds-card:has(:is(.ds-head-dropdown.is-open, .custom-select.open, .dropdown-actions.is-open, .cal-view-dropdown.open)),
.dash-inventory-card:has(:is(.ds-head-dropdown.is-open, .custom-select.open, .dropdown-actions.is-open)) {
    overflow: visible;
}
.ds-card:has(:is(.ds-head-dropdown.is-open, .custom-select.open)) :is(.ds-card__body, .ds-card__body--grow),
.dash-inventory-card:has(.ds-head-dropdown.is-open) :is(.ds-card__body, .ds-card__body--grow, .ds-inset-scroll--host, .ds-scroll-lane) {
    overflow: visible;
}
.custom-select.open {
    overflow: visible;
    z-index: 350;
}
.ds-card__header-actions .ds-head-dropdown,
.ds-module__head-actions .ds-head-dropdown,
.ds-card__header-actions .notif-filter-mobile,
.ds-module__head-actions .notif-filter-mobile {
    z-index: 4;
}
.ds-head-dropdown.is-open,
.notif-filter-mobile:has(.ds-head-dropdown__menu:not([hidden])),
.notif-filter-mobile:has(.notif-filter-mobile__menu:not([hidden])) {
    z-index: 500;
}
.ds-head-dropdown__trigger,
.notif-filter-mobile__btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    width: auto;
    justify-content: flex-start;
}
.ds-head-dropdown__trigger.btn-sm,
.notif-filter-mobile__btn.btn-sm {
    padding: 0 var(--space-1) 0 var(--space-2);
}
.ds-head-dropdown__trigger.btn-md,
.notif-filter-mobile__btn.btn-md {
    padding: 0 var(--space-2) 0 var(--space-3);
}
.ds-head-dropdown__trigger.btn-lg,
.notif-filter-mobile__btn.btn-lg {
    padding: 0 var(--space-3) 0 var(--space-4);
}
.ds-head-dropdown__trigger .ds-head-dropdown__label,
.notif-filter-mobile__btn .ds-head-dropdown__label {
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
}
.ds-head-dropdown__trigger .material-symbols-outlined,
.notif-filter-mobile__btn .material-symbols-outlined {
    font-size: 18px;
    color: var(--ds-text-tertiary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.ds-head-dropdown.is-open .ds-head-dropdown__trigger .material-symbols-outlined,
.notif-filter-mobile:has(.ds-head-dropdown__menu:not([hidden])) .ds-head-dropdown__trigger .material-symbols-outlined {
    transform: rotate(180deg);
}
.ds-head-dropdown__menu,
.notif-filter-mobile__menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 188px;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: var(--space-1);
    background: var(--ds-surface);
    z-index: 501;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.ds-head-dropdown__menu[hidden],
.notif-filter-mobile__menu[hidden] {
    display: none !important;
}
.ds-head-dropdown__option,
.notif-filter-mobile__option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--ds-dropdown-option-py) var(--ds-dropdown-option-px);
    border: none;
    border-radius: var(--radius-xs);
    background: var(--ds-surface);
    color: var(--ds-text);
    font-family: var(--font-ui);
    font-size: var(--ds-dropdown-font-size);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}
.ds-head-dropdown__option:hover,
.ds-head-dropdown__option.is-active,
.notif-filter-mobile__option:hover,
.notif-filter-mobile__option.active {
    background: var(--ds-surface-muted);
}
.ds-head-dropdown__option.is-active,
.notif-filter-mobile__option.active {
    font-weight: 600;
}
.ds-card__subtitle,
.ds-module__subtitle { font-size: var(--text-xs); color: var(--ds-text-secondary); margin: var(--space-1) 0 0; line-height: var(--leading-normal); }
.ds-card__header-main,
.ds-module__head-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.ds-card__body--flush { padding: 0; }

.panel-card, .table-card, .view-toolbar, .entity-card, .stat-card, .quick-action {
    border-radius: var(--radius-md);
}

.panel-card { padding: 0; border: 1px solid var(--ds-border); background: var(--ds-surface); }
.panel-header { padding: var(--space-5) var(--space-5) 0; margin-bottom: var(--space-3); }
.panel-title { font-size: var(--text-md); font-weight: 600; margin: 0; }

/* ── KPI ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--ds-dashboard-gap);
    margin-bottom: 0;
}
.kpi-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.kpi-card--stat {
    --kpi-stat-icon-size: 40px;
    --kpi-stat-pad-y: var(--ds-inset-y);
    --kpi-stat-pad-x: var(--ds-inset-x);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: var(--kpi-stat-pad-y) var(--kpi-stat-pad-x);
    min-height: 0;
}
.kpi-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-width: 0;
    min-height: var(--kpi-stat-icon-size);
}
.kpi-card--stat .kpi-card__icon-box {
    width: var(--kpi-stat-icon-size);
    height: var(--kpi-stat-icon-size);
    margin: 0;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: var(--kpi-accent-soft);
    color: var(--kpi-accent);
}
.kpi-card--stat .kpi-card__label {
    margin: var(--space-2) 0 var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text);
    line-height: var(--leading-normal);
}
.kpi-card--stat .kpi-card__value {
    flex: 1;
    min-width: 0;
    display: block;
    height: auto;
    font-size: clamp(1.75rem, 2.4vw, 2.125rem);
    font-weight: 700;
    font-family: "ESDInter", sans-serif !important;
    line-height: 1;
    letter-spacing: -0.03em;
    margin: 0;
}
.kpi-card__foot {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-1);
    padding-top: var(--space-1);
    width: 100%;
    min-width: 0;
}
.kpi-card__share {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
    font-size: var(--text-xs);
    line-height: 1.2;
    width: 100%;
    min-width: 0;
}
.kpi-card__share-label {
    color: var(--ds-text-tertiary);
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}
.kpi-card__share-pct {
    font-weight: 500;
    color: var(--ds-text-tertiary);
    font-variant-numeric: var(--ds-font-numeric);
    flex-shrink: 0;
    white-space: nowrap;
}
.kpi-card__track {
    height: 6px;
    width: 100%;
    align-self: stretch;
    border-radius: var(--radius-xs);
    background: var(--ds-surface-muted);
    overflow: hidden;
}
.kpi-card__bar {
    display: block;
    height: 100%;
    width: 0;
    max-width: 100%;
    border-radius: inherit;
    background: var(--kpi-accent, var(--ds-blue));
    transition: width 0.72s var(--ds-ease-out);
    will-change: width;
}
.kpi-card--total {
    --kpi-accent: var(--ds-blue);
    --kpi-accent-soft: #F5F9FF;
}
.kpi-card--ok {
    --kpi-accent: var(--ds-success);
    --kpi-accent-soft: var(--ds-success-soft);
}
.kpi-card--warn {
    --kpi-accent: var(--ds-brand-cta);
    --kpi-accent-soft: var(--ds-brand-tint-10);
}
.kpi-card--fail {
    --kpi-accent: #DC2626;
    --kpi-accent-soft: #FEE2E2;
}
.kpi-card--stat .kpi-card__value {
    color: var(--kpi-accent);
}
.kpi-card--fail .kpi-card__value,
.kpi-card--fail .kpi-card__icon-box {
    color: #DC2626;
}
.kpi-card--fail .kpi-card__icon-box {
    background: #FEE2E2;
}
.kpi-card--fail .kpi-card__bar {
    background: #DC2626;
}
.kpi-card__label { font-size: var(--text-xs); font-weight: 500; color: var(--ds-text-secondary); line-height: var(--leading-normal); }
.kpi-card__value {
    font-size: var(--text-2xl);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--ds-text);
    font-family: var(--font-ui) !important;
    font-feature-settings: var(--ds-font-features) !important;
    font-variant-numeric: var(--ds-font-numeric);
}
.kpi-card__hint { font-size: var(--text-2xs); color: var(--ds-text-tertiary); margin-top: var(--space-1); }
.kpi-card--accent .kpi-card__value { color: var(--ds-brand-cta-active); }

.kpi-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
.kpi-mini {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    padding: var(--space-5) var(--space-4);
}
.kpi-mini__label { font-size: var(--text-xs); color: var(--ds-text-secondary); margin-bottom: var(--space-2); }
.kpi-mini__value {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    font-feature-settings: var(--ds-font-features);
    font-variant-numeric: var(--ds-font-numeric);
}

/* ── Dashboard layout ── */
.dashboard-view { padding: 0 !important; }
.dashboard-scroll {
    flex: 1;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--ds-dashboard-shell-pad-y) var(--ds-dashboard-shell-pad-x);
    display: flex;
    flex-direction: column;
    gap: var(--ds-dashboard-gap);
    box-sizing: border-box;
}
.dashboard-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--ds-bg);
}
.dashboard-shell--fill {
    flex: 1;
    min-height: 0;
    height: 100%;
}
.dashboard-shell > .dashboard-scroll,
.dashboard-shell > .account-layout > .account-main > .dashboard-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    display: block;
}
.dashboard-shell > .account-layout > .account-main > .dashboard-scroll[data-account-shell] {
    display: flex;
    flex-direction: column;
}
.dashboard-shell > .account-layout {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    overflow: hidden;
}
.dashboard-shell > .dashboard-scroll.dashboard-scroll--calendar-fill {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dashboard-shell > .app-footer-bar {
    flex-shrink: 0;
    margin: 0;
    width: 100%;
    padding: var(--space-5) var(--ds-dashboard-shell-pad-x);
    border-top: 1px solid var(--ds-border);
    background: var(--ds-bg);
    box-sizing: border-box;
}
.dashboard-scroll > .dashboard-layout {
    flex-shrink: 0;
}
.dashboard-scroll > .ds-page-header {
    flex-shrink: 0;
}
.dashboard-scroll > .account-shell__body:has(> .notif-module) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.dashboard-scroll > .account-shell__body:has(> .settings-layout) {
    flex: 0 0 auto;
    min-height: unset;
    display: flex;
    flex-direction: column;
}
.account-shell__body > .settings-layout {
    flex: 0 0 auto;
    min-height: unset;
}
.account-shell__body > .notif-module {
    flex: 1;
    min-height: 0;
}
.ds-page-header--actions {
    align-items: center;
    margin-bottom: var(--ds-page-header-gap);
    flex-shrink: 0;
    min-height: unset;
    height: auto;
}
.ds-page-header--actions .ds-page-header__title { margin: 0; }
.ds-page-header__lead {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}
.ds-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-left: auto;
    align-items: center;
}
.ds-page-header__actions .btn {
    min-height: var(--ds-control-h);
    height: var(--ds-control-h);
    padding-top: 0;
    padding-bottom: 0;
    align-items: center;
}
.ds-page-header__actions .btn-outline,
.ds-page-header__actions .btn-secondary {
    min-height: var(--ds-control-h);
    height: var(--ds-control-h);
}

.dashboard-layout {
    display: flex;
    flex-direction: column;
    gap: var(--ds-dashboard-gap);
    min-width: 0;
    max-width: 100%;
}
.dashboard-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(148px, 1fr));
    gap: var(--ds-dashboard-gap);
}
.dashboard-body {
    display: flex;
    flex-direction: column;
    gap: var(--ds-dashboard-gap);
}
.dashboard-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--ds-dashboard-gap);
    align-items: stretch;
}
.dashboard-body > .dashboard-row:first-child,
.dashboard-body > .dashboard-row.dashboard-row--today {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: none;
    min-height: 0;
    height: auto;
    max-height: none;
    align-items: stretch;
}
.dashboard-row--charts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex: 1 1 0;
    min-height: var(--ds-dash-charts-row-h);
    height: auto;
    max-height: none;
    align-items: stretch;
}
.dashboard-row--charts > * {
    min-height: 0;
    align-self: stretch;
    overflow: hidden;
}
.dashboard-row--charts .ds-card__body,
.dashboard-row--charts .ds-card__body--grow {
    min-height: 0;
    overflow: hidden;
}
.dashboard-row--charts .ds-card--chart .ds-card__body--grow,
.dashboard-row--charts .ds-card--compliance .ds-card__body--grow {
    min-height: 0;
}
.dashboard-row--charts .ds-card--stretch {
    height: 100%;
    min-height: var(--ds-dash-charts-row-h);
}
.dashboard-row > * {
    min-height: 0;
    height: auto;
    align-self: stretch;
    max-height: none;
    overflow: hidden;
}
#view-dashboard.dashboard-view {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}
#view-dashboard .dashboard-scroll {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: var(--ds-dashboard-shell-pad-bottom);
    scroll-padding-bottom: var(--ds-dashboard-shell-pad-bottom);
}
#view-dashboard .dashboard-scroll > .dashboard-layout {
    flex: none;
    min-height: auto;
    display: flex;
    flex-direction: column;
}
#view-dashboard .dashboard-kpi-row {
    flex-shrink: 0;
}
#view-dashboard .dashboard-body {
    flex: none;
    min-height: auto;
}
/* Pulpit — mniejszy odstęp nagłówek → pierwszy wiersz treści (wszystkie karty) */
#view-dashboard .ds-card :is(.ds-content-inset, .ds-inset-scroll--host):not(.ds-inset-scroll--no-pad) {
    padding-top: var(--ds-dashboard-body-gap);
}
#view-dashboard .ds-card :is(.ds-inset-scroll--host, .ds-content-inset):has(.ds-scroll-rail) {
    padding-top: 0;
}
#view-dashboard .ds-card :is(.ds-inset-scroll--host, .ds-content-inset):has(.ds-scroll-rail) > .ds-scroll-lane {
    padding-top: var(--ds-dashboard-body-gap);
    padding-bottom: var(--ds-inset-y);
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view :is(.ds-inset-scroll--host, .ds-content-inset):has(.ds-scroll-rail) > .ds-scroll-lane {
    padding-inline-start: var(--ds-entity-scroll-gutter);
    padding-inline-end: 0;
    padding-top: var(--ds-dashboard-body-gap);
    padding-bottom: var(--ds-inset-y);
}
#view-dashboard .ds-card .cal-module-calendar {
    padding-top: var(--ds-dashboard-body-gap);
}
#view-dashboard .ds-card--compliance .ds-content-inset--fill {
    padding: 0;
}
#view-dashboard .ds-card--compliance .compliance-v5-host {
    padding: 0;
}
#view-dashboard .ds-inset-scroll--dashboard-list.ds-inset-scroll--host {
    height: calc(var(--ds-dashboard-list-scroll-h) + var(--ds-dashboard-body-gap) + var(--ds-inset-y));
    max-height: calc(var(--ds-dashboard-list-scroll-h) + var(--ds-dashboard-body-gap) + var(--ds-inset-y));
    min-height: calc(var(--ds-dashboard-list-scroll-h) + var(--ds-dashboard-body-gap) + var(--ds-inset-y));
}
#view-dashboard .dashboard-body > .dashboard-row:first-child,
#view-dashboard .dashboard-row--charts {
    flex: none;
    min-height: auto;
}
#view-dashboard .dashboard-row--charts {
    align-items: stretch;
    min-height: var(--ds-dash-charts-row-h);
}
#view-dashboard .dashboard-row--charts > .ds-card--stretch {
    height: var(--ds-dash-charts-row-h);
    min-height: var(--ds-dash-charts-row-h);
    max-height: var(--ds-dash-charts-row-h);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#view-dashboard .dashboard-row--charts .dash-inventory-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}
#view-dashboard .dashboard-row--charts .module-body--fill,
#view-dashboard .dashboard-row--charts .ds-card--chart:not(.ds-card--compliance) .ds-card__body--grow {
    flex: 1 1 auto;
    min-height: 0;
}
#view-dashboard .dashboard-row--charts .ds-inset-scroll--dashboard-list,
#view-dashboard .dashboard-row--charts .ds-scroll-lane--dashboard-list {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
}
#view-dashboard .dashboard-row--charts .ds-inset-scroll--dashboard-list.ds-inset-scroll--host {
    overflow: hidden;
}
#view-dashboard .dashboard-row:not(.dashboard-row--charts) > * {
    height: auto;
    overflow: visible;
}
#view-dashboard .dashboard-row:not(.dashboard-row--charts) .ds-card--stretch .module-body--fill {
    flex: none;
    min-height: auto;
}
#view-dashboard .ds-card--stretch {
    height: auto;
    min-height: 0;
}
#view-dashboard .dashboard-row:not(.dashboard-row--charts) .ds-card--stretch .ds-card__body--grow,
#view-dashboard .dashboard-row:not(.dashboard-row--charts) .ds-card--stretch :is(.ds-inset-scroll, .ds-content-inset.ds-inset-scroll--host),
#view-dashboard .dashboard-row:not(.dashboard-row--charts) .ds-card--stretch .module-body--fill {
    flex: none;
    min-height: auto;
}
#view-dashboard .dashboard-row:first-child .ds-card--no-footer {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}
#view-dashboard .dashboard-row:first-child .ds-card--no-footer .ds-card__body--grow,
#view-dashboard .dashboard-row:first-child .ds-card--no-footer :is(.ds-inset-scroll, .ds-content-inset.ds-inset-scroll--host),
#view-dashboard .dashboard-row:first-child .ds-card--no-footer .ds-scroll-lane {
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
}
#view-dashboard .dashboard-row:first-child .ds-card--no-footer:not(.ds-card--today) .ds-scroll-lane > .ds-scroll-lane__inset {
    flex: 1;
    min-height: 0;
}
#view-dashboard .dashboard-row:first-child .ds-card--no-footer .ds-scroll-rail .ds-scroll-lane__inset {
    flex: none;
    height: auto;
    min-height: auto;
    max-height: none;
    display: block;
    overflow: visible !important;
}
#view-dashboard .dashboard-row:first-child .ds-card--no-footer .module-list--dashboard {
    flex: 0 0 auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
}
#view-dashboard #today-products-list .module-empty,
#view-dashboard #today-products-list .cal-empty-state--day,
#view-dashboard #dash-devices-list .module-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    margin: 0;
}
#view-dashboard #dash-calendar-module.cal-module--drilldown {
    --dash-cal-card-h: var(--ds-dash-cal-h);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
#view-dashboard #dash-calendar-module.cal-module--drilldown:not(.cal-day-detail-open) {
    height: var(--ds-dash-cal-h);
    min-height: var(--ds-dash-cal-h);
    max-height: var(--ds-dash-cal-h);
    overflow: hidden;
}
#view-dashboard #dash-calendar-module.cal-module--drilldown.is-height-locked {
    height: var(--dash-cal-locked-h, var(--dash-cal-card-h));
    min-height: var(--dash-cal-locked-h, var(--dash-cal-card-h));
    max-height: var(--dash-cal-locked-h, var(--dash-cal-card-h));
    overflow: hidden;
}
#view-dashboard #dash-calendar-module:not(.cal-day-detail-open) .ds-card__body--grow.cal-module-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .ds-card__body--grow.cal-module-body {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    overflow: hidden;
}
#view-dashboard #dash-calendar-module:not(.cal-day-detail-open) .cal-module-body,
#view-dashboard #dash-calendar-module:not(.cal-day-detail-open) .cal-module-split,
#view-dashboard #dash-calendar-module:not(.cal-day-detail-open) .cal-module-calendar,
#view-dashboard #dash-calendar-module:not(.cal-day-detail-open) .cal-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-module-body,
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-module-split,
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-module-calendar {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    overflow: hidden;
}
#view-dashboard #dash-calendar-module:not(.cal-day-detail-open) .cal-grid-wrap {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-grid-wrap {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#view-dashboard #dash-calendar-module:not(.cal-day-detail-open) .cal-grid--dash {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    grid-auto-rows: 1fr;
    align-content: stretch;
}
#view-dashboard #dash-calendar-module:not(.cal-day-detail-open) .cal-grid--dash .cal-cell {
    aspect-ratio: unset;
    height: auto;
    min-height: 0;
    max-height: none;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-grid--dash {
    flex: none;
    min-height: auto;
    grid-auto-rows: auto;
    align-content: start;
}
#view-dashboard .dashboard-row--charts .ds-card__body,
#view-dashboard .dashboard-row--charts .ds-card__body--grow {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
#view-dashboard .dashboard-row--charts .ds-card__body--grow:has(.ds-inset-scroll--dashboard-list) {
    min-height: 0;
    overflow: hidden;
}
#view-dashboard .dashboard-row--charts .ds-card--compliance .ds-content-inset--fill {
    flex: 0 1 auto;
    min-height: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 0;
}
#view-dashboard .dashboard-row--charts .ds-card--compliance .compliance-v5-host {
    flex: 0 0 auto;
    min-height: 0;
    height: auto;
    justify-content: center;
}
#view-dashboard .dashboard-shell {
    flex: 1;
    min-height: 0;
}
.ds-card--stretch,
.ds-module.ds-module--framed.ds-module--stretch {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}
.ds-card--stretch .ds-card__body--grow,
.ds-card--stretch .ds-module__body--grow,
.ds-module.ds-module--framed.ds-module--stretch .ds-module__body--grow,
.ds-card--stretch :is(.ds-inset-scroll, .ds-content-inset.ds-inset-scroll--host):not(.ds-inset-scroll--dashboard-list),
.ds-module.ds-module--framed.ds-module--stretch :is(.ds-inset-scroll, .ds-content-inset.ds-inset-scroll--host):not(.ds-inset-scroll--dashboard-list),
.ds-card--stretch .module-body--fill,
.ds-module.ds-module--framed.ds-module--stretch .module-body--fill {
    flex: 1;
    min-height: 0;
}
.ds-card__body--grow,
.ds-module__body--grow {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.ds-card__body--flush,
.ds-module__body--flush { padding: 0; }
.ds-card__body--flush:not(.ds-card__body--grow),
.ds-module__body--flush:not(.ds-module__body--grow) {
    flex: none;
    min-height: auto;
}
.ds-card--stretch .ds-inset-scroll--dashboard-list,
.ds-module.ds-module--framed.ds-module--stretch .ds-inset-scroll--dashboard-list {
    flex: 0 0 auto;
}

.dashboard-4col {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--ds-dashboard-gap);
    align-items: stretch;
}
.ds-card--span-2 { grid-column: span 2; }

.dash-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2);
    padding: var(--space-4);
    min-height: 100%;
}
.dash-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4);
    min-height: 72px;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface-muted);
    color: var(--ds-text);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    text-align: center;
}
.dash-quick-btn .material-symbols-outlined { font-size: 22px; color: var(--ds-text-secondary); }
.dash-quick-btn:hover,
.dash-quick-btn:active {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
}
.dash-quick-btn:hover .material-symbols-outlined { color: var(--ds-text-secondary); }

/* ── Pulpit: lista w kartach (mierniki itd.) ── */
.dash-meter-list-item .dash-meter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 6.25rem 5.25rem;
    align-items: center;
    column-gap: var(--space-5);
    row-gap: var(--space-1);
    width: 100%;
    min-width: 0;
}
.dash-meter-list-item .ds-list-item__title {
    font-weight: 500;
    text-align: left;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-meter-list-item .ds-list-item__date {
    font-weight: 500;
    color: var(--ds-text-secondary);
    font-variant-numeric: var(--ds-font-numeric);
    text-align: right;
    justify-self: end;
    white-space: nowrap;
}
.dash-meter-list-item .dash-meter-row--dash {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--space-3);
}
.dash-meter-list-item.ds-list-item--has-menu .dash-meter-row--dash {
    width: 100%;
}
.dash-meter-list-item .dash-meter-badge {
    justify-self: end;
    flex-shrink: 0;
    margin-inline-end: var(--space-2);
}

/* ── Pulpit: wykresy słupkowe (typ + lokalizacja) ── */
.dashboard-row--bar-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ds-dashboard-gap);
    align-items: stretch;
}
#view-dashboard .dashboard-row--bar-charts .ds-card--chart-bar {
    display: flex;
    flex-direction: column;
    min-height: calc(50dvh - 56px);
    height: calc(50dvh - 40px);
    max-height: calc(50dvh - 24px);
}
#view-dashboard .dashboard-row--bar-charts .ds-card--chart-bar:has(.dash-bar-chart-wrap--horizontal) .ds-card__body {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
#view-dashboard .dashboard-row--bar-charts .ds-card--chart-bar .ds-card__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.dash-bar-chart-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    height: auto;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}
.dash-bar-chart-wrap--horizontal {
    flex: 1;
    min-height: calc(var(--bar-rows, 4) * 36px + 48px);
    height: auto;
}
.dash-bar-chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
#view-dashboard .dashboard-row--charts .dash-inventory-card .ds-card__body--grow {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.dash-inventory-card .ds-card__header-actions {
    flex-shrink: 0;
}
.dash-inventory-filter {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}
.dash-inventory-filter__dropdown {
    min-width: 0;
    max-width: none;
}
.dash-inventory-card > .ds-card__header {
    position: relative;
    z-index: 3;
    overflow: visible;
}
/* Pulpit — tabela kategorii: inset hosta (--ds-inset-x) + padding wiersza jak .module-list--dashboard */
.dash-inventory-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: var(--ds-dashboard-list-scroll-h);
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: visible !important;
    font-size: var(--ds-entity-font);
    line-height: var(--ds-entity-line);
}
.dash-inventory-table .data-table--dash-inventory,
.dash-inventory-table .data-table--dash-summary {
    width: max(100%, 20rem);
    min-width: max(100%, 20rem);
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
    border: none;
}
.dash-inventory-table .data-table--dash-inventory :is(thead th, tbody td),
.dash-inventory-table .data-table--dash-summary :is(thead th, tbody td) {
    padding-block: 0;
    padding-inline: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-sizing: border-box;
    vertical-align: middle;
}
.dash-inventory-table .data-table--dash-inventory thead th,
.dash-inventory-table .data-table--dash-summary thead th {
    background: var(--ds-table-head-bg);
    font-family: var(--font-ui);
    font-size: var(--ds-entity-font-head);
    font-weight: var(--ds-entity-list-head-weight);
    color: var(--ds-text-tertiary);
    height: var(--ds-table-head-h);
    min-height: var(--ds-table-head-h);
    vertical-align: middle;
    white-space: nowrap;
}
.dash-inventory-table .data-table--dash-inventory tbody td,
.dash-inventory-table .data-table--dash-summary tbody td {
    height: var(--ds-dashboard-list-row-h);
    min-height: var(--ds-dashboard-list-row-h);
    max-height: var(--ds-dashboard-list-row-h);
    border-top: 1px solid var(--ds-border);
    font-size: var(--ds-entity-font);
}
.dash-inventory-table .data-table--dash-inventory thead th.data-table__col-category,
.dash-inventory-table .data-table--dash-inventory tbody td.data-table__cell-category,
.dash-inventory-table .data-table--dash-summary thead th.data-table__col-category,
.dash-inventory-table .data-table--dash-summary tbody td.data-table__cell-category {
    width: auto;
    min-width: 12rem;
    padding-left: var(--ds-list-item-pad-x);
    padding-right: var(--space-2);
    text-align: left;
    font-weight: 500;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}
.dash-inventory-table .data-table--dash-inventory col.data-table__col-qty,
.dash-inventory-table .data-table--dash-summary col.data-table__col-qty {
    width: 4.25rem;
}
.dash-inventory-table .data-table--dash-inventory thead th.data-table__col-qty,
.dash-inventory-table .data-table--dash-inventory tbody td.data-table__cell-qty,
.dash-inventory-table .data-table--dash-summary thead th.data-table__col-qty,
.dash-inventory-table .data-table--dash-summary tbody td.data-table__cell-qty {
    width: 4.25rem;
    min-width: 4.25rem;
    max-width: none;
    padding-left: var(--space-2);
    padding-right: var(--ds-list-item-pad-x);
    text-align: right;
    font-weight: 500;
    font-variant-numeric: var(--ds-font-numeric);
    color: var(--ds-text);
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}
.dash-inventory-table .data-table--dash-inventory tbody tr.clickable-row {
    cursor: default;
}
.dash-inventory-table .data-table--dash-inventory tbody tr.clickable-row:hover td {
    background: var(--ds-surface);
}
.dash-inventory-table__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--ds-dashboard-list-scroll-h);
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.dash-inventory-row-in {
    animation: dashInventoryRowIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes dashInventoryRowIn {
    from { opacity: 0; transform: translateX(-6px); }
    to { opacity: 1; transform: translateX(0); }
}
.dashboard-layout--enter > .dashboard-kpi-row {
    animation: dashSectionIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.dashboard-layout--enter > .dashboard-body {
    animation: dashSectionIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) 0.07s both;
}
.dashboard-layout--enter > .dashboard-row--bar-charts {
    animation: dashSectionIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) 0.21s both;
}
@keyframes dashSectionIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .dashboard-layout--enter > *,
    .dash-inventory-row-in {
        animation: none !important;
    }
}

/* ── Pulpit: mini-donuty wg grup (legacy) ── */
.dashboard-row--donuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}
.dash-donut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: var(--space-4);
    padding: var(--ds-card-inset-y) var(--ds-card-inset-x);
    min-height: 148px;
    align-content: start;
}
.dash-donut-grid--scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--ds-scrollbar-thumb) transparent;
    padding-bottom: calc(var(--ds-card-inset-y) + var(--space-1));
}
.dash-donut-grid--scroll .dash-donut-card {
    flex: 0 0 104px;
    scroll-snap-align: start;
}
.dash-donut-grid__empty {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}
.dash-donut-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    animation: dash-donut-card-in var(--ds-motion-mid) var(--ds-ease-out) both;
}
.dash-donut-card:nth-child(2) { animation-delay: 0.04s; }
.dash-donut-card:nth-child(3) { animation-delay: 0.08s; }
.dash-donut-card:nth-child(4) { animation-delay: 0.12s; }
.dash-donut-card:nth-child(5) { animation-delay: 0.16s; }
.dash-donut-card:nth-child(6) { animation-delay: 0.2s; }
.dash-donut-card__chart {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}
.dash-donut__ring {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        var(--chart-1) 0 calc(var(--donut-pass, 0) * 1%),
        var(--chart-2) calc(var(--donut-pass, 0) * 1%) calc((var(--donut-pass, 0) + var(--donut-pending, 0)) * 1%),
        var(--chart-3) calc((var(--donut-pass, 0) + var(--donut-pending, 0)) * 1%) calc((var(--donut-pass, 0) + var(--donut-pending, 0) + var(--donut-fail, 0)) * 1%),
        var(--ds-surface-muted) calc((var(--donut-pass, 0) + var(--donut-pending, 0) + var(--donut-fail, 0)) * 1%) 100%
    );
    transition: background 0.72s var(--ds-ease-out);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.dash-donut__ring::after {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: 50%;
    background: var(--ds-surface);
}
.dash-donut__total {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--ds-text);
    font-variant-numeric: var(--ds-font-numeric);
    pointer-events: none;
}
.dash-donut-card__label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--ds-text-secondary);
    text-align: center;
    line-height: 1.25;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@keyframes dash-donut-card-in {
    from { opacity: 0; transform: translateY(6px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.ds-beta-hero--dashboard {
    min-height: calc(var(--ds-dashboard-list-body-h) + var(--ds-card-header-height));
    height: 100%;
}
.dashboard-row--charts > .ds-beta-hero--dashboard {
    overflow: hidden;
}
.dashboard-row--beta {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: stretch;
}
.dashboard-row--beta > .ds-beta-hero {
    grid-column: 1;
}
.dashboard-row--charts > .ds-beta-hero--dashboard {
    grid-column: auto;
    min-width: 0;
}
.ds-beta-hero {
    position: relative;
    min-height: calc(var(--ds-dashboard-list-body-h) + var(--ds-card-header-height));
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, var(--ds-cal-selected-bg) 65%, var(--ds-brand-cta-active) 35%);
    background: var(--ds-cal-selected-bg);
    overflow: hidden;
    box-shadow: none;
}
.ds-beta-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    --ds-beta-hero-grid-line: color-mix(in srgb, var(--ds-cal-selected-bg) 88%, var(--ds-brand-cta-active) 12%);
    background-image:
        linear-gradient(var(--ds-beta-hero-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--ds-beta-hero-grid-line) 1px, transparent 1px);
    background-size: 32px 32px;
}
.ds-beta-hero__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    min-height: inherit;
    padding: var(--ds-content-pad);
    box-sizing: border-box;
}
.ds-beta-hero__icon {
    display: block;
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-5);
    flex-shrink: 0;
}
.ds-beta-hero__title {
    margin: 0 0 var(--space-3);
    font-size: clamp(1.125rem, 1.6vw, 1.375rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--ds-cal-selected-text);
    flex-shrink: 0;
}
.ds-beta-hero__text {
    margin: 0 0 var(--space-5);
    max-width: 28ch;
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.55;
    color: color-mix(in srgb, var(--ds-cal-selected-text) 72%, transparent);
    flex-shrink: 0;
}
.ds-beta-hero__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: 0 var(--space-5);
    border: 1px solid var(--ds-primary);
    border-radius: var(--radius-sm);
    background: var(--ds-primary);
    color: #fff;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(26, 26, 26, 0.14);
    transition: background var(--ds-motion-fast) var(--ds-ease-out),
                border-color var(--ds-motion-fast) var(--ds-ease-out),
                transform var(--ds-motion-fast) var(--ds-ease-out),
                box-shadow var(--ds-motion-fast) var(--ds-ease-out);
}
.ds-beta-hero__cta .material-symbols-outlined {
    font-size: 20px;
    color: #fff;
}
.account-section-header__title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    min-width: 0;
}
.account-section-header__title-row .account-section-header__title {
    margin: 0;
}
.account-section-header__title-row #profile-role-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.account-section-header__title-row #profile-role-badge .badge {
    font-size: var(--text-2xs);
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    line-height: 1.2;
}
.account-section-header--with-back {
    align-items: center;
    gap: var(--space-3);
}
.account-section-header--with-back .account-section-header__title {
    flex: 1;
    min-width: 0;
}
.ds-beta-survey-view .dashboard-scroll[data-account-shell] {
    align-items: center;
}
.ds-beta-survey-layout {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.ds-beta-survey-card {
    margin-top: 0;
    padding: var(--ds-card-inset-y) var(--ds-card-inset-x);
    overflow: visible;
}
.ds-beta-survey-intro {
    margin: 0 0 var(--space-5);
    font-size: var(--text-sm);
    line-height: 1.55;
    color: var(--ds-text-secondary);
}
.ds-beta-survey-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}
.ds-beta-survey-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.ds-beta-survey-section h3 {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--ds-text);
}
.ds-beta-check-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.ds-beta-radio-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
}
.ds-beta-radio {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--ds-text);
    transition: border-color 0.12s, background 0.12s;
    box-sizing: border-box;
}
.ds-beta-radio:has(input:checked) {
    border-color: var(--ds-primary);
    background: color-mix(in srgb, var(--ds-primary) 8%, var(--ds-surface));
}
.ds-beta-radio input {
    accent-color: var(--ds-primary);
}
.ds-beta-survey-actions {
    display: flex;
    justify-content: stretch;
    padding-top: var(--space-4);
    border-top: 1px solid var(--ds-border);
}
.ds-beta-survey-actions .btn {
    width: 100%;
}
.ds-beta-survey-view .form-group textarea,
.ds-beta-survey-view .form-group select {
    width: 100%;
    box-sizing: border-box;
}
@media (max-width: 960px) {
    .dashboard-row--beta {
        grid-template-columns: 1fr;
    }
    .ds-beta-hero {
        min-height: 320px;
    }
    .ds-beta-survey-layout {
        max-width: 100%;
    }
}

/* ── Beta: pływające przypomnienie na pulpicie ── */
/* ── Beta: pływające przypomnienie ankiety ── */
.beta-nudge-root {
    position: fixed;
    right: max(20px, var(--ds-dashboard-shell-pad-x, 24px));
    bottom: max(20px, var(--space-5));
    z-index: 2100;
    pointer-events: none;
}
.beta-nudge-root:not([hidden]) {
    pointer-events: auto;
}
.beta-nudge-fab {
    position: relative;
    width: 48px;
    height: 48px;
    border: 2px solid var(--ds-brand-cta-active);
    border-radius: var(--radius-sm);
    background: var(--ds-brand-cta);
    color: var(--ds-brand-cta-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(26, 26, 26, 0.12);
    transition: box-shadow var(--ds-motion-mid) var(--ds-ease-out);
    animation: betaNudgeFabGlow 2.2s ease-in-out infinite;
}
.beta-nudge-fab::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: calc(var(--radius-sm) + 3px);
    border: 2.5px solid var(--ds-brand-cta-active);
    opacity: 0;
    pointer-events: none;
    animation: betaNudgeFabRing 2.2s ease-out infinite;
}
.beta-nudge-fab .material-symbols-outlined {
    position: relative;
    z-index: 1;
    font-size: 22px;
}
.beta-nudge-fab:hover {
    box-shadow: 0 6px 18px rgba(26, 26, 26, 0.14);
}
.beta-nudge-fab.is-reminding {
    animation: betaNudgeFabGlowStrong 1.8s ease-in-out 1;
}
.beta-nudge-fab.is-reminding::after {
    animation: betaNudgeFabRingStrong 1.8s ease-out 1;
}
@keyframes betaNudgeFabGlow {
    0%, 100% {
        border-color: var(--ds-brand-cta-border);
        box-shadow: 0 0 0 0 rgba(255, 207, 51, 0), 0 4px 14px rgba(26, 26, 26, 0.12);
    }
    50% {
        border-color: #b8860b;
        box-shadow:
            0 0 0 4px var(--ds-brand-tint-38),
            0 0 14px var(--ds-brand-tint-38),
            0 4px 18px rgba(255, 184, 0, 0.35);
    }
}
@keyframes betaNudgeFabRing {
    0% {
        transform: scale(1);
        opacity: 0.72;
    }
    70%, 100% {
        transform: scale(1.65);
        opacity: 0;
    }
}
@keyframes betaNudgeFabGlowStrong {
    0%, 100% {
        border-color: var(--ds-brand-cta-border);
        box-shadow: 0 4px 14px rgba(26, 26, 26, 0.12);
    }
    50% {
        border-color: #996f00;
        box-shadow:
            0 0 0 6px var(--ds-brand-tint-42, #FFEBA9),
            0 0 20px var(--ds-brand-tint-45, #FFE9A3),
            0 8px 24px rgba(255, 184, 0, 0.4);
    }
}
@keyframes betaNudgeFabRingStrong {
    0% {
        transform: scale(1);
        opacity: 0.85;
    }
    100% {
        transform: scale(1.75);
        opacity: 0;
    }
}
.beta-nudge-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(340px, calc(100vw - 32px));
    min-height: 320px;
    display: flex;
    flex-direction: column;
    --beta-nudge-close-inset: var(--space-4);
    --beta-nudge-body-pad: var(--space-8);
    padding: var(--beta-nudge-body-pad);
    box-sizing: border-box;
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    box-shadow: 0 12px 32px rgba(26, 26, 26, 0.12);
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.96) translateY(6px);
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.28s cubic-bezier(0.34, 1.15, 0.64, 1),
        opacity 0.22s var(--ds-ease-out);
}
.beta-nudge-popover.is-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.beta-nudge-popover__header {
    position: absolute;
    top: var(--beta-nudge-close-inset);
    right: var(--beta-nudge-close-inset);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    min-height: 0;
    padding: 0;
    z-index: 2;
}
.beta-nudge-popover__close {
    flex-shrink: 0;
    margin-left: auto;
    border-color: transparent;
    background: transparent;
    color: var(--ds-text-secondary);
}
.beta-nudge-popover__close:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border);
    color: var(--ds-text);
    transform: none;
}
.beta-nudge-popover__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-4);
    padding: 0;
}
.beta-nudge-popover__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--ds-brand-cta);
    color: var(--ds-brand-cta-text);
    border: 1.5px solid var(--ds-brand-cta-border);
    flex-shrink: 0;
}
.beta-nudge-popover__icon .material-symbols-outlined {
    font-size: 18px;
}
.beta-nudge-popover__title {
    margin: 0;
    width: 100%;
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--ds-text);
}
.beta-nudge-popover__copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    width: 100%;
}
.beta-nudge-popover__text {
    margin: 0;
    max-width: 19rem;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    line-height: 1.55;
    color: var(--ds-text-secondary);
}
.beta-nudge-popover__text--note {
    margin-top: 0;
}
.beta-nudge-popover__cta {
    width: fit-content;
    max-width: 100%;
    margin-top: var(--space-3);
    align-self: center;
}
.ds-settings-beta {
    grid-column: 1 / -1;
    min-height: min(50vh, 520px);
    display: flex;
    flex-direction: column;
}
.ds-settings-beta .ds-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.ds-settings-beta__lead {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.55;
    color: var(--ds-text-secondary);
}
.ds-settings-beta .ds-beta-changelog {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.ds-beta-changelog__entry {
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    background: var(--ds-surface-muted);
    border: 1px solid var(--ds-border);
}
.ds-beta-changelog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.ds-beta-changelog__ver {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--ds-text);
}
.ds-beta-changelog__date {
    font-size: var(--text-xs);
    color: var(--ds-text-tertiary);
}
.ds-beta-changelog__items {
    margin: 0;
    padding-left: 1.1em;
    font-size: var(--text-sm);
    line-height: 1.55;
    color: var(--ds-text-secondary);
}
.ds-beta-changelog__items li + li {
    margin-top: var(--space-1);
}
@media (max-width: 768px) {
    .dashboard-row--bar-charts {
        grid-template-columns: minmax(0, 1fr);
    }
    #view-dashboard .dashboard-row--bar-charts .ds-card--chart-bar {
        min-height: 280px;
        height: min(50dvh, 360px);
        max-height: none;
    }
    #view-dashboard .dashboard-row--charts .dash-inventory-card,
    #view-dashboard .dashboard-row--charts > .ds-card--stretch:not(.ds-card--compliance):not(.ds-card--chart) {
        height: var(--ds-dash-charts-row-h);
        min-height: var(--ds-dash-charts-row-h);
        max-height: var(--ds-dash-charts-row-h);
    }
    .beta-nudge-root {
        right: 16px;
        bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    }
    .ds-settings-beta {
        min-height: 360px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .beta-nudge-fab,
    .beta-nudge-fab.is-reminding,
    .beta-nudge-fab::after {
        animation: none;
    }
    .beta-nudge-popover {
        transition: none;
    }
}

.kpi-card--icon { position: relative; }
.kpi-card--horizontal {
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
}
.kpi-card--horizontal .kpi-card__icon-box {
    margin-bottom: 0;
}
.kpi-card--icon-right {
    flex-direction: row-reverse;
}
.kpi-card__body-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
    flex: 1;
}
.kpi-card--icon-right .kpi-card__body-text {
    text-align: right;
    align-items: flex-end;
}
.kpi-card__icon-box {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-3);
    flex-shrink: 0;
}
.kpi-card__icon-box .material-symbols-outlined { font-size: 22px; line-height: 1; }
.kpi-card--ok .kpi-card__icon-box { background: var(--ds-status-bg-ok); color: var(--ds-status-text-ok); }
.kpi-card--warn .kpi-card__icon-box { background: var(--kpi-accent-soft); color: var(--kpi-accent); }
.kpi-card--fail .kpi-card__icon-box { background: var(--ds-status-bg-fail); color: var(--ds-status-text-fail); }
.kpi-card--stat .kpi-card__icon-box .material-symbols-outlined {
    font-size: 20px;
}

.ds-card__header--compact,
.ds-module__head--compact {
    height: var(--ds-card-header-height);
    min-height: var(--ds-card-header-height);
    max-height: var(--ds-card-header-height);
    box-sizing: border-box;
    align-items: center;
    border-bottom: 1px solid var(--ds-border);
}
.ds-card__body,
.ds-module__body {
    padding: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.ds-card__body:not(.ds-card__body--flush),
.ds-module__body:not(.ds-module__body--flush) {
    padding: var(--ds-card-inset-y) var(--ds-card-inset-x);
}
.ds-card__footer,
.ds-module__foot {
    padding: var(--ds-card-inset-y) var(--ds-card-inset-x);
    border-top: 1px solid var(--ds-border);
    flex-shrink: 0;
    margin: 0;
    background: var(--ds-surface);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.ds-card__body--empty .module-empty {
    min-height: var(--ds-dashboard-list-scroll-h);
}

/* Powrót w drill-down — jeden komponent w całej aplikacji */
.ds-back-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px 6px 4px;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--ds-text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    white-space: nowrap;
    transition: color 0.12s, background 0.12s;
}
.ds-back-link .material-symbols-outlined {
    font-size: 20px;
    flex-shrink: 0;
}
.ds-back-link:hover {
    color: var(--ds-text);
    background: var(--ds-surface-muted);
}
.ds-back-link--icon {
    padding: 6px;
    color: var(--ds-text-tertiary);
    background: transparent;
}
.ds-back-link--icon .material-symbols-outlined {
    font-size: 22px;
}
.ds-back-link--icon:hover {
    color: var(--ds-text);
    background: var(--ds-surface-muted);
}
.ds-back-link[hidden] {
    display: none !important;
}
.ds-card__header-actions .ds-back-link,
.cal-page-toolbar__primary .ds-back-link {
    margin-right: var(--space-1);
}

.chart-wrap { position: relative; width: 100%; }
.chart-wrap--donut-sm { height: 120px; max-width: 120px; margin: 0 auto; }
.chart-wrap--donut-md { height: 156px; max-width: 156px; margin: 0 auto; flex-shrink: 0; }
.chart-wrap--bar-sm { height: 140px; }
.chart-wrap--bar-wide { height: 160px; padding: 0 var(--space-4) var(--space-4); }
.chart-wrap--bar-fill {
    flex: 1;
    min-height: 120px;
    padding: 0 var(--space-4) var(--space-4);
    position: relative;
}
.chart-wrap--bar-fill canvas {
    width: 100% !important;
    height: 100% !important;
}
.chart-stack--fill {
    flex: 1;
    min-height: 0;
    justify-content: flex-start;
    align-items: center;
    padding-top: var(--space-4);
}
.chart-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    padding: var(--ds-card-inset-y) var(--ds-card-inset-x);
    gap: var(--space-4);
}
.chart-panel__viz {
    flex: 1;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) 0;
}
.chart-panel__legend {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.chart-legend__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    min-height: 0;
}
.chart-legend__item-main {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}
.chart-legend__swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.chart-legend__item-stats {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
    flex-shrink: 0;
}
.chart-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.chart-legend__label {
    font-size: var(--text-sm);
    color: var(--ds-text);
    line-height: 1.3;
    font-weight: 500;
}
.chart-legend__value {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--ds-text);
    font-variant-numeric: var(--ds-font-numeric);
}
.chart-legend__pct {
    font-size: var(--text-xs);
    color: var(--ds-text-secondary);
    font-variant-numeric: var(--ds-font-numeric);
    min-width: 2.5rem;
    text-align: right;
}
.chart-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;
    height: 100%;
    min-height: 0;
}
.chart-card__head .ds-card__title {
    align-self: center;
}
.chart-type-picker {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface-muted);
    flex-shrink: 0;
}
.chart-type-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--ds-text-tertiary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}
.chart-type-btn .material-symbols-outlined { font-size: 18px; }
.chart-type-btn:hover { color: var(--ds-text-secondary); background: var(--ds-surface); }
.chart-type-btn.active {
    background: var(--ds-surface);
    color: var(--ds-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.ds-card__header--today {
    align-items: center;
    gap: var(--space-3);
}
.ds-card__header--today .dash-today-head {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}
.ds-card__header--today .ds-card__title {
    margin: 0;
    line-height: 1.2;
    flex: 0 1 auto;
}
.dash-today-header-divider {
    width: 1px;
    height: 1.25em;
    min-height: 20px;
    background: var(--ds-border-strong);
    flex-shrink: 0;
}
.dash-today-date--header {
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--ds-text);
    white-space: nowrap;
    flex-shrink: 0;
}
.dash-today-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    background: var(--ds-surface-muted);
    border: 1px solid var(--ds-border);
    color: var(--ds-text);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    flex-shrink: 0;
    margin-left: auto;
}
#today-products-list .dropdown-actions.is-open,
#dash-selected-day-products .dropdown-actions.is-open,
#today-products-list.dash-day-view__list .dropdown-actions.is-open {
    z-index: 10051;
}
#today-products-list .dropdown-actions.is-open .dropdown-actions-content--fixed,
#dash-selected-day-products .dropdown-actions.is-open .dropdown-actions-content--fixed,
#today-products-list.dash-day-view__list .dropdown-actions.is-open .dropdown-actions-content--fixed {
    z-index: 10050;
}
#view-dashboard #today-products-list .dropdown-actions,
#view-dashboard #today-products-list.dash-day-view__list .dropdown-actions {
    position: relative;
    z-index: 2;
}
#view-dashboard #today-products-list .dropdown-actions.is-open,
#view-dashboard #today-products-list.dash-day-view__list .dropdown-actions.is-open {
    z-index: 10051;
}
.chart-stack { display: flex; flex-direction: column; gap: var(--space-3); padding: 0 var(--space-4) var(--space-4); }
.chart-legend--below { gap: var(--space-2); }
.chart-legend__item {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--ds-text-secondary);
}
.chart-legend__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-legend__value { font-weight: 600; color: var(--ds-text); font-variant-numeric: var(--ds-font-numeric); font-size: var(--text-xs); }

.dash-today-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}
.dash-today-meta__date { font-size: var(--text-xs); color: var(--ds-text-secondary); }
.dash-today-meta__count {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ds-text);
    line-height: 1;
}

/* module scroll areas — inset z .ds-card__body, nie z module-body */
.module-body,
.cal-module-body {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}
.module-body--fill { flex: 1; min-height: 0; overflow: hidden; }
.module-body .module-list {
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
}
.module-body .module-list,
.dash-day-view__list,
.cal-time-grid-wrap,
.scroll-content.module-list {
    margin-right: 0;
    box-sizing: border-box;
}
.cal-module--drilldown .cal-module-body .dash-day-view__list,
.cal-module--drilldown .cal-module-body .cal-time-grid-wrap {
    margin-right: 0;
}

/* ── Kontener treści + scroll-rail (gutter poza paddingiem treści) ─────────
   Padding na hoście (.ds-inset-scroll--host). Scroll wyłącznie w .ds-scroll-rail__body.
─────────────────────────────────────────────────────────────────────────── */

/* ── KOMPONENT: inset treści (.ds-content-inset) — jeden padding w całej aplikacji ──
   Wartości: var(--ds-inset-y) × var(--ds-inset-x) (= --ds-content-pad, 20px / 16px mobile).
   Używaj ZAWSZE jako jedynej warstwy paddingu wokół treści modułu (lista, tabela, wykres).
   Wariant ze scrollem: .ds-content-inset--scroll + .ds-scroll-lane > .ds-scroll-lane__inset
   Alias scroll-host: .ds-inset-scroll--host (ten sam padding + flex column). */
.ds-content-inset,
.ds-inset-scroll--host {
    box-sizing: border-box;
    padding: var(--ds-inset-y) var(--ds-inset-x);
}
.ds-content-inset--scroll,
.ds-inset-scroll--host:not(.ds-inset-scroll--no-pad) {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ds-content-inset--fill {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
/* Treść w inset — bez własnego paddingu (padding wyłącznie na hoście .ds-content-inset / .ds-inset-scroll--host) */
.ds-content-inset > :is(
    .compliance-v4,
    .compliance-v5-host,
    .dash-bar-chart-wrap,
    .module-list,
    .module-list--dashboard,
    .dash-inventory-table,
    .ds-list,
    .ds-entity-list-body,
    .entity-grid,
    .notifications-feed,
    .notif-feed,
    .classif-list-host
) {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 0;
    border: none;
    box-sizing: border-box;
}
.ds-content-inset > .dash-bar-chart-wrap,
.ds-content-inset > .compliance-v4,
.ds-content-inset > .compliance-v5-host {
    display: flex;
    flex-direction: column;
}
/* Body karty/modułu — inset wypełnia obszar, bez dodatkowego paddingu na dzieciach */
.ds-card__body--flush > .ds-content-inset,
.ds-card__body--flush > .ds-inset-scroll--host,
.ds-module__body--flush > .ds-content-inset,
.ds-module__body--flush > .ds-inset-scroll--host,
.ds-card__body--grow > .ds-content-inset,
.ds-card__body--grow > .ds-inset-scroll--host {
    flex: 1;
    min-height: 0;
}
.ds-card__body--flush > :is(.ds-entity-list-body, .table-card.entity-list, .module-list, .module-list--dashboard, .ds-list, .notifications-feed, .notif-feed) {
    padding: 0;
    border: none;
}
.ds-inset-scroll:not(.ds-inset-scroll--host):not(.ds-content-inset) {
    flex: 1;
    min-height: 0;
    min-width: 0;
    box-sizing: border-box;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ds-inset-scroll--host.ds-inset-scroll--no-pad {
    display: flex;
    flex-direction: column;
}
.ds-content-inset.ds-content-inset--no-pad {
    padding: 0;
}
.ds-inset-scroll--host {
    overflow: hidden;
    min-height: 0;
    min-width: 0;
    box-sizing: border-box;
}
.ds-scroll-lane {
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}
.ds-inset-scroll--host > .ds-scroll-lane {
    flex: 1;
    min-height: 0;
    min-width: 0;
}
.ds-scroll-lane--fill,
.ds-inset-scroll--fill > .ds-scroll-lane {
    flex: 1;
    min-height: 0;
}
.ds-scroll-lane__inset {
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    position: relative;
    box-sizing: border-box;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}
/* Fallback: inset bez scroll-rail (do czasu migracji JS) */
.ds-inset-scroll--host > .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset,
.ds-content-inset--scroll > .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset,
.cal-time-scroll-host > .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset {
    overflow-x: hidden;
    overflow-y: auto;
}
.ds-inset-scroll--host > .ds-scroll-lane > .ds-scroll-rail .ds-scroll-lane__inset,
.ds-content-inset--scroll > .ds-scroll-lane > .ds-scroll-rail .ds-scroll-lane__inset,
.cal-time-scroll-host:has(.ds-scroll-rail) > .ds-scroll-lane > .ds-scroll-lane__inset,
.cal-time-scroll-host .ds-scroll-rail .ds-scroll-lane__inset {
    overflow: visible !important;
}
/* Treść w inset — width 100% lane (nigdy poza padding hosta) */
.ds-scroll-lane__inset > .module-list,
.ds-scroll-lane__inset > .module-list--dashboard,
.ds-scroll-lane__inset > .dash-inventory-table,
.ds-scroll-lane__inset > .dash-day-view__list,
.ds-scroll-lane__inset > .ds-list,
.ds-scroll-lane__inset > .cal-time-grid-wrap {
    flex: none;
    min-height: auto;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
/* ── Zasada insetu: padding TYLKO na .ds-inset-scroll--host; dzieci lane bez paddingu kontenerowego ── */
.ds-inset-scroll--host .ds-scroll-lane__inset > :is(
    .module-list,
    .module-list--dashboard,
    .ds-list,
    .notifications-feed,
    .notif-feed,
    .dash-inventory-table
) {
    padding: 0;
}
#view-dashboard .dashboard-row:first-child .ds-card--no-footer .ds-scroll-lane__inset > .module-list--dashboard {
    flex: none;
    min-height: auto;
}
/* Treść w inset — jedna szerokość = lane (100%); scroll tylko na hoście inset */
.ds-scroll-lane__inset > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
/* Scroll TYLKO na hoście inset — dzieci NIGDY nie scrollują pionowo (eliminuje podwójny suwak) */
.ds-inset-scroll--host .ds-scroll-lane__inset > :is(
    .module-list,
    .module-list--dashboard,
    .module-list--fill,
    .ds-list,
    .dash-day-view__list,
    .entity-list,
    .entity-grid,
    .ds-entity-list-body,
    .table-card.entity-list,
    .table-card.ds-entity-list-view,
    .notifications-feed,
    .notif-feed,
    .notif-detail-panel__inset,
    .dash-inventory-table,
    .cal-time-grid-wrap,
    .entity-list-scroll__content
) {
    flex: 0 0 auto;
    min-height: auto;
    max-height: none;
    overflow-y: visible !important;
    overflow-x: visible;
}
.ds-inset-scroll--host .ds-scroll-lane__inset > :is(
    .entity-list,
    .ds-entity-list-body,
    .table-card.entity-list,
    .table-card.ds-entity-list-view
) {
    overflow-x: auto;
    overflow-y: visible !important;
}
.ds-inset-scroll--no-pad {
    padding: 0;
}
/* Pulpit — dokładnie 5 wierszy + padding hosta */
.ds-inset-scroll--dashboard-list {
    flex: 0 0 auto;
    height: calc(var(--ds-dashboard-list-scroll-h) + 2 * var(--ds-inset-y));
    max-height: calc(var(--ds-dashboard-list-scroll-h) + 2 * var(--ds-inset-y));
    min-height: calc(var(--ds-dashboard-list-scroll-h) + 2 * var(--ds-inset-y));
}
.ds-scroll-lane--dashboard-list {
    flex: 0 0 auto;
    height: var(--ds-dashboard-list-scroll-h);
    max-height: var(--ds-dashboard-list-scroll-h);
    min-height: var(--ds-dashboard-list-scroll-h);
}
/* Powiadomienia / szczegóły — treść w lane */
.ds-inset-scroll--host .ds-scroll-lane__inset .notif-item,
.ds-inset-scroll--host .ds-scroll-lane__inset .notif-detail-card,
.ds-inset-scroll--host .ds-scroll-lane__inset .notif-detail-panel__placeholder,
.ds-inset-scroll--host .ds-scroll-lane__inset .notifications-feed,
.ds-inset-scroll--host .ds-scroll-lane__inset .notif-detail-panel__inset {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.ds-inset-scroll--fill {
    flex: 1;
    min-height: 0;
}
.dash-day-view > :is(.ds-inset-scroll, .ds-content-inset) {
    flex: 1;
    min-height: 0;
}
.cal-day-detail-layout__col > :is(.ds-inset-scroll, .ds-content-inset) {
    flex: 1;
    min-height: 0;
}
/* Scrollbar — wygląd DS tylko w gutterze scroll-rail */
.ds-scroll-gutter {
    scrollbar-width: thin;
    scrollbar-color: var(--ds-scrollbar-thumb) var(--ds-scrollbar-track);
}
.ds-scroll-gutter::-webkit-scrollbar {
    width: var(--ds-scrollbar-size);
    height: var(--ds-scrollbar-size);
}
.ds-scroll-gutter::-webkit-scrollbar-track {
    background: var(--ds-scrollbar-track);
}
.ds-scroll-gutter::-webkit-scrollbar-thumb {
    background: var(--ds-scrollbar-thumb);
    border-radius: 999px;
    border-inline-end: var(--ds-scrollbar-edge-offset) solid transparent;
    background-clip: padding-box;
}
.ds-scroll-gutter:hover::-webkit-scrollbar-thumb {
    background: var(--ds-scrollbar-thumb-hover);
}
.ds-scroll-lane__inset > :is(
    .module-list--dashboard,
    .dash-inventory-table,
    .entity-grid
) > :hover {
    transform: none;
    box-shadow: none;
}
.ds-card__body--flush > :is(.ds-inset-scroll, .ds-content-inset.ds-inset-scroll--host):not(.ds-inset-scroll--dashboard-list),
.ds-module__body--flush > :is(.ds-inset-scroll, .ds-content-inset.ds-inset-scroll--host):not(.ds-inset-scroll--dashboard-list) {
    flex: 1;
    min-height: 0;
}
.ds-inset-scroll--host .cal-day-summary-host,
.ds-scroll-lane .cal-day-summary-host {
    display: flex;
    flex-direction: column;
    flex: none;
    min-height: auto;
    height: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.ds-inset-scroll--host .cal-day-mini:not(.cal-day-mini--fill),
.ds-scroll-lane .cal-day-mini:not(.cal-day-mini--fill) {
    flex: none;
    min-height: auto;
    height: auto;
    max-height: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    scrollbar-width: none;
}
.ds-inset-scroll--host .cal-day-mini:not(.cal-day-mini--fill)::-webkit-scrollbar,
.ds-scroll-lane .cal-day-mini:not(.cal-day-mini--fill)::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}
.ds-inset-scroll--host .cal-day-mini:not(.cal-day-mini--fill) .cal-day-mini__hours,
.ds-scroll-lane .cal-day-mini:not(.cal-day-mini--fill) .cal-day-mini__hours {
    flex: none;
    min-height: auto;
    grid-template-rows: repeat(var(--cal-mini-hour-count, 17), minmax(var(--cal-mini-row-min, 36px), auto));
    overflow: visible;
}
.ds-inset-scroll--host .cal-day-mini:not(.cal-day-mini--fill) .cal-day-mini__row,
.ds-scroll-lane .cal-day-mini:not(.cal-day-mini--fill) .cal-day-mini__row {
    min-height: var(--cal-mini-row-min, 36px);
    height: auto;
}

/* Scroll w strefie paddingu rodzica — treść bez własnego scrolla */
.ds-scroll-in-padding,
.ds-card .cal-time-grid-wrap,
#cal-page-module .cal-time-grid-wrap,
.dashboard-body .module-body > .module-list,
.ds-card .module-body > .module-list.scroll-content,
.ds-card .table-card.scroll-content,
.ds-card .entity-grid.scroll-content,
.ds-card .report-wizard-panel__body.scroll-content {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    box-sizing: border-box;
    overflow: visible;
}

.module-list--fill {
    max-height: none;
    flex: 1;
    min-height: 0;
    overflow: visible;
}
.ds-inset-scroll--host .module-list--fill {
    flex: 0 0 auto;
    min-height: auto;
    overflow-y: visible !important;
}
/* Pulpit — jednolita lista: 5 wierszy widocznych, reszta scroll (patrz .ds-scroll-lane) */
.module-list--dashboard {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: 0;
    overflow-x: hidden;
    container-type: inline-size;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.cal-side-panel .dash-day-view {
    padding: 0;
    box-sizing: border-box;
}
/* ── KOMPONENT: wiersz listy dashboard (stałe wartości wszędzie) ─────────── */
.module-list--dashboard > .ds-list-item,
.module-list--dashboard > .ds-list-item--interactive,
.module-list--dashboard > button.ds-list-item--interactive {
    min-height: var(--ds-dashboard-list-row-h);
    height: var(--ds-dashboard-list-row-h);
    max-height: var(--ds-dashboard-list-row-h);
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.module-list--dashboard > .ds-list-item--has-menu,
.module-list--dashboard > .ds-list-item--interactive.ds-list-item--has-menu {
    overflow: visible;
}
.module-list--dashboard .ds-badge {
    flex-shrink: 0;
}
.ds-scroll-lane__inset > .notifications-feed > .empty-state-inline,
.ds-scroll-lane__inset .empty-state-inline {
    flex: 0 1 auto;
    min-height: 0;
}
/* Pulpit — dokładnie 5 wierszy + padding hosta; pusty stan wypełnia wysokość listy */
.ds-inset-scroll--dashboard-list .module-list--dashboard .module-empty,
.ds-inset-scroll--dashboard-list .module-list--dashboard .cal-empty-state--day {
    min-height: var(--ds-dashboard-list-scroll-h);
}
.module-list--dashboard .module-empty,
.module-list--dashboard .cal-empty-state--day {
    min-height: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.module-list--dashboard > .ds-list-item--interactive:not(.notif-row):hover,
.module-list--dashboard > .ds-list-item--has-menu:hover,
.module-list--dashboard > button.ds-list-item--interactive:not(.notif-row):hover {
    background: var(--ds-row-hover-bg);
    border-color: var(--ds-border);
    transform: none;
    box-shadow: none;
}
.module-list--dashboard > .ds-list-item--has-menu:hover,
.module-list--dashboard > .ds-list-item--interactive.ds-list-item--has-menu:hover {
    transform: none;
    box-shadow: none;
}
.module-list--dashboard > .ds-list-item--interactive:not(.notif-row),
.module-list--dashboard > button.ds-list-item--interactive:not(.notif-row) {
    transition:
        background var(--ds-motion-fast) var(--ds-ease-out),
        border-color var(--ds-motion-fast) var(--ds-ease-out);
}
.cal-side-panel .dash-day-view__list.module-list--dashboard:not(.ds-scroll-lane__inset) {
    flex: none;
    min-height: auto;
    max-height: none;
    height: auto;
    padding: 0 !important;
}
.module-list--short { max-height: 180px; }
.module-list--tall { max-height: 280px; }
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table td.module-empty {
    padding: var(--ds-content-pad);
    text-align: center;
    vertical-align: middle;
    border: none;
    background: transparent;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table td.module-empty .table-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin: 0 auto;
    max-width: 36ch;
    color: var(--ds-text-secondary);
    font-size: var(--text-sm);
    line-height: 1.5;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table td.module-empty .table-empty-state .material-symbols-outlined {
    font-size: 40px;
    line-height: 1;
    color: var(--ds-info-icon-color);
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table td.module-empty .table-empty-state p {
    margin: 0;
}
.module-empty { padding: var(--space-2) 0; }
.dashboard-body .module-body > .module-list:not(.module-list--dashboard) {
    flex: 1;
    min-height: 0;
    padding: var(--ds-content-pad);
    gap: var(--space-2);
    scroll-padding: var(--ds-scroll-edge);
}
.dashboard-body .module-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 120px;
    padding: var(--ds-content-pad) var(--ds-inset-x);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
    line-height: 1.5;
    border: none;
    background: transparent;
}
.dashboard-body .module-empty .material-symbols-outlined {
    font-size: 40px;
    line-height: 1;
    color: var(--ds-info-icon-color);
}
.dashboard-body .module-empty p {
    margin: 0;
    max-width: 36ch;
}

/* Scroll — oddech treści przy przewijaniu (scroll-padding, bez paddingu na kontenerze) */
:is(
    .ds-scroll-lane__inset,
    .ds-scroll-gutter,
    .scroll-content,
    .cal-time-grid-wrap,
    .module-list,
    .dashboard-scroll,
    .norms-nav__list,
    .dash-donut-grid--scroll
) {
    scroll-padding: var(--ds-scroll-edge);
}
:is(
    .ds-scroll-lane__inset,
    .ds-scroll-gutter,
    .scroll-content,
    .cal-time-grid-wrap,
    .module-list,
    .dashboard-scroll,
    .norms-nav__list,
    .dash-donut-grid--scroll
) {
    scroll-padding-block: var(--ds-scroll-edge);
}
.ds-card .cal-time-grid-wrap,
.ds-card .scroll-content.module-list,
.ds-card .module-body > .module-list.scroll-content,
.ds-card .table-card.scroll-content,
.ds-card .entity-grid.scroll-content,
.ds-card .report-wizard-panel__body.scroll-content {
    box-sizing: border-box;
}

.ds-card--fill {
    min-height: 300px;
    display: flex;
    flex-direction: column;
}
.ds-card--fill .module-body { flex: 1; }

.cal-view-toggle--sm .cal-view-toggle__btn { padding: 5px 10px; font-size: var(--text-2xs); }

.chart-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: var(--space-5);
    align-items: center;
}
.chart-legend {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.chart-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── List modules — padding poziomy wiersza: 16px L/R (--ds-list-item-pad-x) ── */
.ds-list { display: flex; flex-direction: column; gap: var(--space-2); }
.ds-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--ds-card-inset-y);
    padding-inline: var(--ds-list-item-pad-x);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    cursor: pointer;
    text-align: left;
    font-family: var(--font-ui);
    font-size: inherit;
    font-weight: inherit;
    font-style: inherit;
    line-height: inherit;
    color: inherit;
    width: 100%;
    transition: background 0.12s, border-color 0.12s;
    box-sizing: border-box;
}
.ds-list-item:hover { background: var(--ds-interactive-hover-bg); border-color: var(--ds-interactive-hover-border); }
.ds-list-item--static { cursor: default; }
.ds-list-item--static:hover { background: var(--ds-surface); border-color: var(--ds-border); }

.ds-list-item--interactive {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;
    padding-block: var(--ds-card-inset-y);
    padding-inline: var(--ds-list-item-pad-x);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    cursor: pointer;
    text-align: left;
    font-family: var(--font-ui);
    font-size: inherit;
    font-weight: inherit;
    font-style: inherit;
    line-height: inherit;
    color: inherit;
    transition: background 0.12s, border-color 0.12s;
    box-sizing: border-box;
}
.ds-list-item--interactive.notif-row {
    transition: none;
}
.ds-list-item--interactive:not(.notif-row):hover {
    background: var(--ds-interactive-hover-bg);
    border-color: var(--ds-interactive-hover-border);
}
/* Dashboard list — wysokość wiersza; padding poziomy = --ds-list-item-pad-x (16px) */
.module-list--dashboard > .ds-list-item,
.module-list--dashboard > .ds-list-item--interactive,
.module-list--dashboard > button.ds-list-item--interactive {
    padding-block: 0;
    padding-inline: var(--ds-list-item-pad-x);
}
.module-list--dashboard > .ds-list-item--has-menu,
.module-list--dashboard > .ds-list-item--interactive.ds-list-item--has-menu,
.module-list--dashboard > .ds-list-item--has-trail,
.module-list--dashboard > .ds-list-item--interactive.ds-list-item--has-trail,
.module-list--dashboard > button.ds-list-item--has-trail {
    padding-inline-start: var(--ds-list-item-pad-x);
    padding-inline-end: var(--ds-row-kebab-pad-end);
}
.ds-list-item--interactive.ds-list-item--has-menu {
    gap: var(--space-2);
    padding-block: 0;
    padding-inline-start: var(--ds-list-item-pad-x);
    padding-inline-end: var(--ds-row-kebab-pad-end);
    overflow: visible;
}
.ds-list-item--has-menu .ds-list-item__open {
    flex: 1;
    min-width: 0;
    min-height: inherit;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-ui);
    font-size: inherit;
    font-weight: inherit;
    font-style: inherit;
    line-height: inherit;
    color: inherit;
}
.ds-list-item--has-menu .dropdown-actions {
    flex-shrink: 0;
    padding: 0;
    margin: 0 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    align-self: center;
    position: relative;
}
.ds-list-item--has-menu:has(.dropdown-actions.is-open) {
    position: relative;
    z-index: 300;
    overflow: visible;
}
.ds-list-item--has-menu .dropdown-actions .ds-kebab-btn,
.ds-list-item--has-menu .dropdown-actions > .icon-btn {
    color: var(--ds-text-tertiary);
    border: none;
    background: transparent;
}
.ds-list-item--has-menu:hover .dropdown-actions .ds-kebab-btn,
.ds-list-item--has-menu:hover .dropdown-actions > .icon-btn {
    color: var(--ds-text-secondary);
}
.ds-list-item--has-menu .dropdown-actions .ds-kebab-btn:hover,
.ds-list-item--has-menu .dropdown-actions > .icon-btn:hover {
    background: var(--ds-surface);
    border: var(--ds-btn-border-width) solid var(--ds-btn-border-color-hover);
    color: var(--ds-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
/* ── KOMPONENT: kebab w .module-list--dashboard — wariant C (jak tabela ewidencji) ── */
.module-list--dashboard > .ds-list-item--has-menu :is(.dropdown-actions, .ds-row-kebab) > :is(.icon-btn.ds-kebab-btn, .icon-btn.icon-btn--sm.icon-btn--ghost),
.module-list--dashboard > .ds-list-item--interactive.ds-list-item--has-menu :is(.dropdown-actions, .ds-row-kebab) > :is(.icon-btn.ds-kebab-btn, .icon-btn.icon-btn--sm.icon-btn--ghost),
.module-list--dashboard > button.ds-list-item--interactive.ds-list-item--has-menu :is(.dropdown-actions, .ds-row-kebab) > :is(.icon-btn.ds-kebab-btn, .icon-btn.icon-btn--sm.icon-btn--ghost) {
    border-color: transparent;
    background: transparent;
    color: var(--ds-text-tertiary);
    box-shadow: none;
}
.module-list--dashboard > .ds-list-item--has-menu:hover :is(.dropdown-actions, .ds-row-kebab) > :is(.icon-btn.ds-kebab-btn, .icon-btn.icon-btn--sm.icon-btn--ghost),
.module-list--dashboard > .ds-list-item--interactive.ds-list-item--has-menu:hover :is(.dropdown-actions, .ds-row-kebab) > :is(.icon-btn.ds-kebab-btn, .icon-btn.icon-btn--sm.icon-btn--ghost),
.module-list--dashboard > button.ds-list-item--interactive.ds-list-item--has-menu:hover :is(.dropdown-actions, .ds-row-kebab) > :is(.icon-btn.ds-kebab-btn, .icon-btn.icon-btn--sm.icon-btn--ghost) {
    color: var(--ds-text-secondary);
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}
.module-list--dashboard > .ds-list-item--has-menu :is(.dropdown-actions, .ds-row-kebab) > :is(.icon-btn.ds-kebab-btn, .icon-btn.icon-btn--sm.icon-btn--ghost):hover,
.module-list--dashboard > .ds-list-item--interactive.ds-list-item--has-menu :is(.dropdown-actions, .ds-row-kebab) > :is(.icon-btn.ds-kebab-btn, .icon-btn.icon-btn--sm.icon-btn--ghost):hover,
.module-list--dashboard > button.ds-list-item--interactive.ds-list-item--has-menu :is(.dropdown-actions, .ds-row-kebab) > :is(.icon-btn.ds-kebab-btn, .icon-btn.icon-btn--sm.icon-btn--ghost):hover,
.module-list--dashboard > .ds-list-item--has-menu .dropdown-actions.is-open > :is(.icon-btn.ds-kebab-btn, .icon-btn.icon-btn--sm.icon-btn--ghost),
.module-list--dashboard > .ds-list-item--interactive.ds-list-item--has-menu .dropdown-actions.is-open > :is(.icon-btn.ds-kebab-btn, .icon-btn.icon-btn--sm.icon-btn--ghost),
.module-list--dashboard > button.ds-list-item--interactive.ds-list-item--has-menu .dropdown-actions.is-open > :is(.icon-btn.ds-kebab-btn, .icon-btn.icon-btn--sm.icon-btn--ghost) {
    background: var(--ds-row-hover-bg-strong);
    border-color: color-mix(in srgb, var(--ds-brand-cta) 28%, var(--ds-border));
    color: var(--ds-text);
    box-shadow: none;
}

.ds-list-item__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; overflow: hidden; }
/* Wiersz produktu (pulpit) — kod + nazwa w jednej linii; szersza kolumna kodu */
.ds-list-item__main--dashboard-product {
    display: grid;
    grid-template-columns: var(--ds-dashboard-list-code-col) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    min-width: 0;
    width: 100%;
}
.ds-list-item__main--dashboard-product .ds-list-item__code,
.ds-list-item__main--dashboard-product .ds-list-item__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    line-height: var(--ds-entity-line);
}
.ds-list-item__main--dashboard-product .ds-list-item__code {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
.ds-list-item__main--dashboard-product .ds-list-item__title {
    min-width: 0;
}
@container (max-width: 299px) {
    .module-list--dashboard .ds-list-item__main--dashboard-product {
        grid-template-columns: 1fr;
        gap: 2px;
        align-items: flex-start;
    }
}
/* Legacy — wiersz produktu (kolumna) */
.ds-list-item__main--product .ds-list-item__title,
.ds-list-item__main--product .ds-list-item__code {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.ds-list-item__main--product {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1;
    min-width: 0;
    width: 100%;
}
@container (min-width: 300px) {
    .module-list--dashboard .ds-list-item__main--product:not(.ds-list-item__main--dashboard-product) {
        flex-direction: row;
        align-items: baseline;
        gap: var(--space-3);
    }
    .module-list--dashboard .ds-list-item__main--product:not(.ds-list-item__main--dashboard-product) .ds-list-item__code {
        flex-shrink: 0;
        width: var(--ds-entity-code-col-w);
        min-width: var(--ds-entity-code-col-w);
        max-width: var(--ds-entity-code-col-w);
    }
    .module-list--dashboard .ds-list-item__main--product:not(.ds-list-item__main--dashboard-product) .ds-list-item__title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
@container (max-width: 299px) {
    .module-list--dashboard {
        flex: none;
        min-height: 0;
        height: auto;
    }
    .module-list--dashboard > .ds-list-item,
    .module-list--dashboard > .ds-list-item--interactive,
    .module-list--dashboard > button.ds-list-item--interactive,
    .module-list--dashboard > .ds-list-item--has-menu,
    .module-list--dashboard > .ds-list-item--interactive.ds-list-item--has-menu {
        height: auto;
        max-height: none;
        min-height: 0;
        padding-block: var(--space-2);
        align-items: center;
    }
    .module-list--dashboard > .ds-list-item--has-menu .ds-list-item__open {
        min-height: 0;
        height: auto;
        align-items: center;
    }
}
.module-list--dashboard .ds-list-item__main--product .ds-list-item__code,
.module-list--dashboard .ds-list-item__main--product .ds-list-item__title {
    line-height: var(--ds-entity-line);
}
.ds-list-item__main.ds-list-item__main--inline,
.ds-list-item__main--inline {
    display: grid;
    grid-template-columns: var(--ds-list-code-col) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
    width: 100%;
}
.ds-list-item--has-menu .ds-list-item__main--inline {
    display: grid;
    grid-template-columns: var(--ds-list-code-col) minmax(0, 1fr);
}
.ds-list-item__main--cols3 {
    grid-template-columns: var(--ds-list-code-col) auto minmax(0, 1fr);
    column-gap: var(--space-2);
}
.ds-list-item__main--product .ds-list-item__code {
    width: var(--ds-entity-code-col-w);
    max-width: var(--ds-entity-code-col-w);
}
.ds-list-item__main--inline .ds-list-item__code,
.ds-list-item__main--cols3 .ds-list-item__code {
    width: var(--ds-list-code-col);
    min-width: var(--ds-list-code-col);
    max-width: var(--ds-list-code-col);
    flex-shrink: 0;
    box-sizing: border-box;
}
.ds-list-item__code {
    font-family: var(--font-ui);
    letter-spacing: normal;
    line-height: var(--leading-normal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.ds-list-item__main--inline .ds-list-item__title {
    flex: 1;
    min-width: 0;
}
.ds-list-item__date,
.ds-list-item__title {
    font-weight: 400;
    color: var(--ds-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-ui);
    min-width: 0;
}
.ds-list-item__meta { color: var(--ds-text-tertiary); font-family: var(--font-ui); }

/* ── Status badge — komponent (.ds-status-badge) + aliasy legacy ── */
.ds-status-badge,
.ds-badge,
.status-badge,
.badge {
    --ds-status-bg: var(--ds-status-bg-neutral);
    --ds-status-text: var(--ds-status-text-neutral);
    --ds-status-border: var(--ds-status-border-neutral);
    font-size: var(--text-2xs);
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    align-self: flex-start;
    flex-shrink: 0;
    line-height: 1.2;
    height: auto;
    min-height: 0;
    min-width: 0;
    white-space: nowrap;
    font-family: var(--font-ui) !important;
    font-feature-settings: var(--ds-font-features) !important;
    font-variant-numeric: var(--ds-font-numeric) !important;
    box-sizing: border-box;
    background: var(--ds-status-bg);
    color: var(--ds-status-text);
    border: 1px solid var(--ds-status-border);
}
.dash-meter-badge {
    padding: 2px 8px;
    line-height: 1.35;
}
/* Zielony / zgodny */
.ds-status-badge--ok,
.ds-badge--ok,
.status-ok,
.badge.pass {
    --ds-status-bg: var(--ds-status-bg-ok);
    --ds-status-text: var(--ds-status-text-ok);
    --ds-status-border: var(--ds-status-border-ok);
}
/* Żółty / ostrzeżenie */
.ds-status-badge--warn,
.ds-badge--warn,
.status-warn,
.badge.pending,
.badge.yellow,
.badge.warn {
    --ds-status-bg: var(--ds-status-bg-warn);
    --ds-status-text: var(--ds-status-text-warn);
    --ds-status-border: var(--ds-status-border-warn);
}
/* Czerwony / niezgodny */
.ds-status-badge--fail,
.ds-badge--fail,
.status-bad,
.badge.fail {
    --ds-status-bg: var(--ds-status-bg-fail);
    --ds-status-text: var(--ds-status-text-fail);
    --ds-status-border: var(--ds-status-border-fail);
}
/* Neutralny */
.ds-status-badge--neutral,
.ds-badge--neutral,
.badge.neutral {
    --ds-status-bg: var(--ds-status-bg-neutral);
    --ds-status-text: var(--ds-status-text-neutral);
    --ds-status-border: var(--ds-status-border-neutral);
}
/* Akcent / info */
.ds-status-badge--accent,
.badge.accent {
    --ds-status-bg: var(--ds-status-bg-accent);
    --ds-status-text: var(--ds-status-text-accent);
    --ds-status-border: var(--ds-status-border-accent);
}

/* ── KOMPONENT: badge liczby (.ds-count-badge) — szare koło, czarna cyfra ── */
.ds-count-badge {
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--ds-count-badge-bg);
    color: var(--ds-count-badge-text);
    border: 1px solid var(--ds-count-badge-border);
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: var(--ds-font-numeric);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.ds-count-badge--md {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    font-size: var(--text-xs);
    font-weight: 600;
}

/* ── Forms (global consistency) ── */
.form-group:not(.form-group--checkbox) {
    margin-bottom: var(--space-4);
    position: relative;
    overflow: visible;
    box-sizing: border-box;
}
.form-group--checkbox {
    margin-bottom: var(--space-4);
    position: relative;
    overflow: visible;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--ds-form-grid-gap);
}
/* Siatki pól — min. 1px odstępu między hover/focus sąsiednich kontrolek */
:is(
    .measurement-form__fields-grid,
    .measurement-form__point-grid,
    .ds-add-product-form__fields-grid,
    .filter-bar,
    .view-toolbar__filters .filter-bar,
    .selective-scope-step__grid,
    .report-wizard-grid
) {
    gap: var(--ds-form-grid-gap);
}
.form-divider-title {
    grid-column: span 2;
    font-size: var(--text-sm);
    font-weight: 600;
    margin: var(--space-6) 0 var(--space-3);
    color: var(--ds-brand-cta);
    border-bottom: 1px solid var(--ds-border);
    padding-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.form-group--checkbox label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
    cursor: pointer;
}
.form-group--checkbox input:not(.ds-check__input):not(.ds-toggle__input) {
    width: auto;
}
/* Etykieta pola — jeden standard w całej app (--ds-type-label-*) */
.form-group label,
.filter-group label,
.ds-add-product-form__field label {
    font-family: var(--ds-type-family);
    font-size: var(--ds-type-label-size);
    font-weight: var(--ds-type-label-weight);
    line-height: var(--ds-type-line-body);
    letter-spacing: normal;
    text-transform: none;
    color: var(--ds-color-text-2);
    margin-bottom: var(--space-2);
    display: block;
}
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group textarea,
.form-group select,
.custom-select-trigger {
    font-family: var(--font-ui);
    font-feature-settings: var(--ds-font-features);
    font-variant-numeric: var(--ds-font-numeric);
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    width: 100%;
    padding: 0 12px;
    min-height: var(--ds-control-h);
    height: var(--ds-control-h);
    border-radius: var(--radius-sm);
    line-height: var(--ds-control-h);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    color: var(--ds-text);
    box-sizing: border-box;
    outline: none;
    background-clip: padding-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.form-group textarea {
    height: auto;
    min-height: var(--ds-control-h);
    padding: 10px 12px;
    line-height: var(--leading-normal);
}
.form-group textarea::placeholder {
    font-family: var(--font-ui);
    font-feature-settings: var(--ds-font-features);
}
/* Pola wpisywania — bez overflow:hidden (ring focus nie może być obcięty) */
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group textarea,
.form-group select,
.custom-select,
.custom-date-picker,
.schedule-date-step__picker,
.meas-input-with-unit,
.global-search,
.view-toolbar__search.search-input-wrapper {
    overflow: visible;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.form-group input:not([type="checkbox"]):not([type="radio"]):hover:not(:disabled):not(:focus):not(:focus-visible),
.form-group textarea:hover:not(:disabled):not(:focus):not(:focus-visible),
:is(.filter-bar, .view-toolbar__filters) .form-group input:not([type="checkbox"]):not([type="radio"]):hover:not(:disabled):not(:focus):not(:focus-visible),
:is(.filter-bar, .view-toolbar__filters) .form-group textarea:hover:not(:disabled):not(:focus):not(:focus-visible),
.custom-select:not(.open) .custom-select-trigger:hover:not(:disabled):not(:focus):not(:focus-visible),
.ds-date-input:hover:not(:disabled):not(:focus):not(:focus-visible),
.schedule-date-step__input:hover:not(:disabled):not(:focus):not(:focus-visible) {
    border-color: var(--ds-interactive-hover-border);
    background: var(--ds-field-hover-bg);
}
.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group input:not([type="checkbox"]):not([type="radio"]):focus-visible,
.form-group textarea:focus,
.form-group textarea:focus-visible,
:is(.filter-bar, .view-toolbar__filters) .form-group input:not([type="checkbox"]):not([type="radio"]):focus,
:is(.filter-bar, .view-toolbar__filters) .form-group input:not([type="checkbox"]):not([type="radio"]):focus-visible,
:is(.filter-bar, .view-toolbar__filters) .form-group textarea:focus,
:is(.filter-bar, .view-toolbar__filters) .form-group textarea:focus-visible,
.custom-select-trigger:focus-visible,
.custom-select.open .custom-select-trigger,
.custom-select.open .custom-select-trigger:hover {
    outline: none;
    border: 1px solid var(--ds-interactive-focus-border);
    background: var(--ds-surface);
    box-shadow: var(--ds-interactive-focus-ring);
}
/* Data/godzina — ring na kontenerze (nie obcina się na inpucie) */
.custom-date-picker:focus-within,
.schedule-date-step__picker:focus-within {
    overflow: visible;
    border-radius: var(--radius-sm);
    box-shadow: var(--ds-interactive-focus-ring);
}
.custom-date-picker:focus-within :is(.ds-date-input, .schedule-date-step__input),
.schedule-date-step__picker:focus-within :is(.ds-date-input, .schedule-date-step__input) {
    outline: none;
    border: 1px solid var(--ds-interactive-focus-border);
    background: var(--ds-surface);
    box-shadow: none;
}
.ds-date-input:focus,
.ds-date-input:focus-visible,
.schedule-date-step__input:focus,
.schedule-date-step__input:focus-visible {
    outline: none;
    border: 1px solid var(--ds-interactive-focus-border);
    background: var(--ds-surface);
    box-shadow: var(--ds-interactive-focus-ring);
}
.custom-date-picker:focus-within .ds-date-input:is(:focus, :focus-visible),
.schedule-date-step__picker:focus-within :is(.ds-date-input, .schedule-date-step__input):is(:focus, :focus-visible) {
    box-shadow: none;
}
/* Aktywne pole — focus / otwarty select wygrywa z hover (także gdy kursor nad polem) */
:is(
    .form-group input:not([type="checkbox"]):not([type="radio"]),
    .form-group textarea,
    :is(.filter-bar, .view-toolbar__filters) .form-group input:not([type="checkbox"]):not([type="radio"]),
    :is(.filter-bar, .view-toolbar__filters) .form-group textarea
):is(:focus, :focus-visible):hover:not(:disabled),
.custom-select.open .custom-select-trigger,
.custom-select.open .custom-select-trigger:hover,
.custom-select-trigger:is(:focus, :focus-visible),
.custom-select-trigger:is(:focus, :focus-visible):hover,
.global-search:focus-within,
.global-search:focus-within:hover,
.view-toolbar__search.global-search:focus-within,
.view-toolbar__search.search-input-wrapper:focus-within {
    outline: none;
    border-color: var(--ds-interactive-focus-border);
    background: var(--ds-surface);
    box-shadow: var(--ds-interactive-focus-ring);
}
.custom-date-picker:focus-within:hover,
.schedule-date-step__picker:focus-within:hover {
    box-shadow: var(--ds-interactive-focus-ring);
}
.custom-select:not(.open) .custom-select-trigger:hover:not(:disabled):not(:focus):not(:focus-visible) {
    border-color: var(--ds-interactive-hover-border);
    background: var(--ds-field-hover-bg);
}
.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    width: 100%;
    overflow: visible;
    cursor: pointer;
    line-height: 1.2;
}
.custom-select-trigger .material-symbols-outlined {
    flex-shrink: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.custom-select:not(.open) .custom-select-trigger:hover:not(:disabled):not(:focus-visible) {
    background: var(--ds-field-hover-bg);
    border-color: var(--ds-interactive-hover-border);
}
:is(.filter-bar, .view-toolbar__filters) .custom-select-trigger {
    min-height: var(--ds-control-h);
    height: var(--ds-control-h);
}

/* ── Entity cards & lists ── */
.entity-view {
    container-type: inline-size;
    container-name: entity-view;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    min-width: 0;
}
/* Widoki list bez dashboard-view — margines jak stary entity-view */
.entity-view:not(.dashboard-view) .entity-view-scroll > .entity-list-card,
.entity-view:not(.dashboard-view) #reports-list-view > .entity-list-card,
.entity-view:not(.dashboard-view) #audits-list-view > .entity-list-card {
    flex: 1 1 0%;
    min-height: 0;
    margin-inline: var(--view-padding);
    margin-bottom: var(--view-padding);
}
#view-team .entity-list-card {
    flex: 1 1 0%;
    min-height: 0;
}
#view-schedule-products > .entity-list-card,
#view-audit-select > .entity-list-card {
    flex: 1 1 0%;
    min-height: 0;
}
.app-view.entity-view.dashboard-view .entity-list-card {
    margin-inline: 0;
    margin-bottom: 0;
}
.entity-list-card .ds-card__body--grow {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.entity-list-card .ds-card__body--grow:has(> .empty-state.is-shown) {
    display: flex;
    flex-direction: column;
    min-height: 12rem;
}
.entity-list-card .empty-state.is-shown {
    flex: 1;
    min-height: 12rem;
}
.entity-list-card .empty-state {
    padding: var(--ds-content-pad);
    box-sizing: border-box;
}
/* Entity list card — inset kontenera (--ds-inset-x); komórki th/td osobno */
.entity-list-card :is(.ds-inset-scroll--host, .ds-content-inset, .ds-content-inset--scroll) {
    padding-inline: var(--ds-inset-x);
    padding-top: var(--ds-entity-list-inset-top);
    padding-bottom: var(--ds-entity-list-inset-bottom);
}
/* ── Scroll rail — treść + osobny pas scrollbara (20px / 16px) ── */
.ds-scroll-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--ds-entity-scroll-gutter);
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
    width: 100%;
    align-items: stretch;
}
.ds-scroll-rail__body {
    min-height: 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
}
.ds-scroll-rail__body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
:is(.ds-inset-scroll--host, .ds-content-inset--scroll) > .ds-scroll-lane > .ds-scroll-rail .ds-scroll-lane__inset,
.ds-scroll-rail .ds-scroll-lane__inset {
    overflow: visible !important;
    flex: none !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    display: block;
}
:is(.ds-inset-scroll--host, .ds-content-inset--scroll) > .ds-scroll-lane > .ds-scroll-rail .ds-scroll-lane__inset > :is(
    .module-list,
    .module-list--dashboard,
    .ds-list,
    .dash-day-view__list
) {
    flex: none !important;
    height: auto !important;
    min-height: auto !important;
}
.ds-scroll-gutter {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;
    min-width: 0;
    width: auto;
    margin-inline-end: var(--ds-scrollbar-edge-offset);
    box-sizing: border-box;
    border: none;
    background: transparent;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.ds-scroll-gutter__pad {
    width: 1px;
    pointer-events: none;
}
/* Scroll rail — padding L jak toolbar; prawy pas = kolumna scroll-gutter (nie tabele entity-list) */
:is(.ds-inset-scroll--host, .ds-content-inset--scroll):not(.ds-inset-scroll--no-pad):has(.ds-scroll-rail) {
    padding: 0;
}
:is(.ds-inset-scroll--host, .ds-content-inset--scroll):has(.ds-scroll-rail):not(:has(:is(.entity-list, .ds-entity-list-body) > .data-table)) > .ds-scroll-lane {
    padding-inline-start: var(--ds-entity-scroll-gutter);
    padding-inline-end: 0;
    padding-block: var(--ds-inset-y);
    box-sizing: border-box;
}
.cal-time-scroll-host.ds-inset-scroll--no-pad:has(.ds-scroll-rail) > .ds-scroll-lane {
    padding-inline-start: var(--ds-entity-scroll-gutter);
    padding-inline-end: 0;
    padding-block: var(--ds-inset-y);
    box-sizing: border-box;
}
/* Tabele entity-list — inset kontenera w scroll-rail__body (góra + L/R); lane bez paddingu; dół = 0 */
:is(.ds-inset-scroll--host, .ds-content-inset--scroll):has(.ds-scroll-rail):has(:is(.entity-list, .ds-entity-list-body) > .data-table) > .ds-scroll-lane {
    padding: 0;
}
:is(.ds-inset-scroll--host, .ds-content-inset--scroll):has(.ds-scroll-rail):has(:is(.entity-list, .ds-entity-list-body) > .data-table) .ds-scroll-rail__body {
    padding-top: var(--ds-entity-list-inset-top);
    padding-inline: var(--ds-inset-x);
    padding-bottom: 0;
    box-sizing: border-box;
}
:is(.ds-inset-scroll--host, .ds-content-inset--scroll):has(.ds-scroll-rail) :is(.entity-list, .ds-entity-list-body) .data-table .ds-row-kebab-cell {
    padding-left: 0;
    padding-right: var(--ds-row-kebab-pad-end);
}
:is(.ds-inset-scroll--host, .ds-content-inset--scroll):has(.ds-scroll-rail) .entity-grid {
    padding-inline: 0;
}
/* Pulpity list — scroll-rail: host/lane 0; inset kontenera w scroll-rail__body; komórki osobno */
.app-view.entity-view.dashboard-view .entity-list-card :is(.ds-inset-scroll--host, .ds-content-inset--scroll):has(.ds-scroll-rail) {
    padding: 0;
}
.app-view.entity-view.dashboard-view .entity-list-card :is(.ds-inset-scroll--host, .ds-content-inset--scroll):has(.ds-scroll-rail) > .ds-scroll-lane {
    padding: 0;
    box-sizing: border-box;
}
.app-view.entity-view.dashboard-view .entity-list-card .ds-scroll-rail__body {
    padding-top: var(--ds-entity-list-inset-top);
    padding-inline: var(--ds-inset-x);
    padding-bottom: 0;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.app-view.entity-view.dashboard-view .entity-list-card .ds-scroll-rail__body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
@media (max-width: 1080px) {
    :is(.ds-inset-scroll--host, .ds-content-inset--scroll):not(.cal-time-scroll-host):not(.meas-wizard-form-wrap):has(.ds-scroll-rail) {
        padding: var(--ds-entity-scroll-gutter);
    }
    :is(.ds-inset-scroll--host, .ds-content-inset--scroll):not(.cal-time-scroll-host):has(.ds-scroll-rail) > .ds-scroll-lane {
        padding-inline-start: 0;
        padding-block: 0;
    }
    #cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-scroll-host:has(.ds-scroll-rail) > .ds-scroll-lane {
        padding-inline-start: var(--ds-entity-scroll-gutter) !important;
        padding-inline-end: 0 !important;
        padding-block: var(--ds-inset-y) !important;
    }
    #cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host:has(.ds-scroll-rail) > .ds-scroll-lane {
        padding-inline-start: var(--ds-entity-scroll-gutter) !important;
        padding-inline-end: 0 !important;
        padding-block: var(--ds-inset-y) !important;
    }
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout__col > :is(.ds-inset-scroll, .ds-content-inset, .cal-time-scroll-host):has(.ds-scroll-rail) > .ds-scroll-lane {
        padding-inline-start: var(--ds-entity-scroll-gutter) !important;
        padding-inline-end: 0 !important;
        padding-top: var(--ds-dashboard-body-gap) !important;
        padding-bottom: var(--ds-inset-y) !important;
    }
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout__col :is(.ds-inset-scroll--host, .ds-content-inset):has(.ds-scroll-rail) {
        padding: 0 !important;
    }
}
.entity-list-card .ds-scroll-rail__body {
    padding-top: var(--ds-entity-list-inset-top);
    padding-inline: var(--ds-inset-x);
    padding-bottom: 0;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.entity-list-card .ds-scroll-rail__body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.entity-list-scroll__host {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.entity-list-scroll__host > .ds-scroll-lane {
    flex: 1;
    min-height: 0;
}
.entity-list-scroll__content {
    min-width: 0;
}
.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: var(--space-4);
    flex: 1;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    align-content: start;
    align-items: start;
    padding: 0;
    box-sizing: border-box;
}
.ds-inset-scroll--host .ds-scroll-lane__inset > .entity-grid,
.entity-list-card .ds-scroll-rail .ds-scroll-lane__inset > .entity-grid {
    flex: 0 0 auto !important;
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}
.ds-scroll-lane__inset > .entity-grid,
.ds-inset-scroll--host .ds-scroll-lane__inset > .entity-grid {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
}
.entity-list,
.table-card.ds-entity-list-view,
.table-card.entity-list {
    flex: 1;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
}
/* W module z .ds-inset-scroll--host scroll tylko na .ds-scroll-lane__inset */
.ds-inset-scroll--host .ds-scroll-lane__inset :is(
    .entity-list,
    .ds-entity-list-body,
    .table-card.entity-list,
    .table-card.ds-entity-list-view,
    .entity-grid,
    .module-list,
    .module-list--dashboard,
    .dash-inventory-table
) {
    flex: 0 0 auto;
    min-height: auto;
    max-height: none;
    overflow-y: visible !important;
}
.ds-inset-scroll--host .ds-scroll-lane__inset :is(
    .entity-list,
    .ds-entity-list-body,
    .table-card.entity-list,
    .table-card.ds-entity-list-view
) {
    overflow-x: auto;
}
.ds-scroll-lane__inset > :is(.entity-list, .table-card.entity-list, .table-card.ds-entity-list-view, .ds-entity-list-body:not(.entity-grid)) {
    flex: 0 0 auto;
    min-height: auto;
    overflow-x: auto;
    overflow-y: visible !important;
}
.table-card.ds-entity-list-view > .data-table,
.table-card.entity-list > .data-table {
    width: max(100%, var(--ds-entity-table-min-w));
}
.table-card.ds-entity-list-view .data-table thead th,
.table-card.entity-list .data-table thead th,
.ds-entity-list-body .data-table thead th {
    padding-top: var(--ds-entity-row-pad-y);
    padding-bottom: var(--ds-entity-row-pad-y);
    padding-left: var(--ds-entity-list-pad-x);
    padding-right: var(--ds-entity-list-pad-x);
    background: var(--ds-table-head-bg);
    border: none;
    text-align: left;
    white-space: nowrap;
}
.table-card.ds-entity-list-view .data-table tbody td,
.table-card.entity-list .data-table tbody td,
.ds-entity-list-body .data-table tbody td {
    padding-top: var(--ds-entity-row-pad-y);
    padding-bottom: var(--ds-entity-row-pad-y);
    padding-left: var(--ds-entity-list-pad-x);
    padding-right: var(--ds-entity-list-pad-x);
    border: none;
    background: var(--ds-surface);
}
.table-card.ds-entity-list-view .data-table tbody tr.clickable-row:hover td,
.table-card.entity-list .data-table tbody tr.clickable-row:hover td,
.ds-entity-list-body .data-table tbody tr.clickable-row:hover td {
    background: var(--ds-row-hover-bg);
}
.table-card.ds-entity-list-view .data-table tbody tr.clickable-row,
.table-card.entity-list .data-table tbody tr.clickable-row,
.ds-entity-list-body .data-table tbody tr.clickable-row {
    transition: background var(--ds-motion-fast) var(--ds-ease-out);
}
.table-card.ds-entity-list-view .data-table tbody tr.clickable-row td,
.table-card.entity-list .data-table tbody tr.clickable-row td,
.ds-entity-list-body .data-table tbody tr.clickable-row td {
    transition: background var(--ds-motion-fast) var(--ds-ease-out);
}
.table-card.ds-entity-list-view:has(> .data-table:not([hidden])),
.table-card.entity-list:has(> .data-table:not([hidden])),
.ds-entity-list-body:has(> .data-table:not([hidden])) {
    padding: 0;
}
.ds-table-cell__content {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table .ds-table-cell__content {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    min-width: min-content;
}

.entity-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    padding: var(--ds-content-pad);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
    min-height: unset;
    height: auto;
    position: relative;
    min-width: 0;
    box-sizing: border-box;
}
.entity-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-shrink: 0;
    min-width: 0;
    width: 100%;
    min-height: 32px;
    margin-bottom: var(--space-3);
}
.entity-card__top-menu,
.entity-card__top-status {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.entity-card__top-menu {
    justify-content: flex-end;
    margin-left: auto;
}
.entity-card__top-status {
    justify-content: flex-start;
}
.entity-card__top .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: auto;
    min-height: 0;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    line-height: 1.2;
    padding: 3px 8px;
    vertical-align: middle;
}
.entity-card__top .dropdown-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    margin: 0 0 0 auto;
    padding: 0;
}
.entity-card__title {
    margin: 0;
    padding-bottom: var(--space-3);
    line-height: var(--ds-entity-line);
    border-bottom: 1px solid var(--ds-border);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.entity-card__code {
    font-family: var(--font-ui);
    letter-spacing: normal;
    margin: 0 0 var(--space-2);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Kafelki — kod zasobu w tej samej skali co etykiety meta (Kategoria, Lokalizacja…) */
#esd-app .entity-grid .entity-card__code.ds-asset-code {
    font-size: var(--ds-entity-font-meta);
    font-weight: 400;
    color: var(--ds-text-tertiary);
    line-height: var(--ds-entity-line);
    margin-bottom: var(--space-1);
}
.entity-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
}
.entity-card__meta-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    line-height: var(--ds-entity-line);
}
.entity-card__meta-label {
    color: var(--ds-text-tertiary);
    flex-shrink: 0;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}
.entity-card__meta-value {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    text-align: right;
    color: var(--ds-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.entity-card__meta-value--accent { color: var(--ds-blue); font-weight: 600; }

/* flush body: padding TYLKO na .ds-content-inset / .ds-inset-scroll--host wewnątrz */
/* ── KOMPONENT: pusty stan (empty state) ── */
.empty-state, .empty-state-inline,
.main-widget-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-2);
    padding: var(--ds-content-pad);
    border: 1px dashed var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    color: var(--ds-text-secondary);
    flex: 1;
    flex-shrink: 0;
    box-sizing: border-box;
}
.empty-state .material-symbols-outlined,
.empty-state-inline .material-symbols-outlined,
.main-widget-area .material-symbols-outlined { font-size: 40px; color: var(--ds-info-icon-color); }
.empty-state h3,
.main-widget-area h3 { color: var(--ds-text); font-size: var(--text-md); font-weight: 600; margin: 0; }
.empty-state p,
.main-widget-area p { font-size: var(--text-sm); color: var(--ds-text-secondary); margin: 0; max-width: 36ch; }

/* ── Calendar ── */
.cal-side-panel {
    padding: 0;
    border-left: none;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: transparent;
}
.cal-side-panel__box {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    background: var(--ds-surface);
}
.cal-side-panel__head {
    margin-bottom: var(--space-3);
    padding: 0;
}
.cal-side-panel__head h3 { font-size: var(--text-md); font-weight: 600; margin: var(--space-1) 0; }
.cal-side-panel__label { font-size: var(--text-2xs); margin-bottom: var(--space-1); color: var(--ds-text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.cal-side-panel__count { font-size: var(--text-xs); margin-top: var(--space-1); display: block; color: var(--ds-text-secondary); }

.cal-module-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.cal-module-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    flex: 1;
    min-height: 0;
    border-top: 1px solid var(--ds-border);
}
.cal-module-calendar {
    padding: var(--ds-inset-y) var(--ds-inset-x);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    border-right: 1px solid var(--ds-border);
}
.cal-module-split .cal-side-panel {
    border-left: none;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}
.cal-module-split .cal-module-calendar {
    overflow: hidden;
}
.cal-module-split .cal-grid-wrap {
    overflow: hidden;
}
.cal-module-split .cal-side-panel__list {
    max-height: none;
}
.cal-module-split .cal-grid:not(.cal-grid--dash) {
    flex: 1;
    min-height: 0;
    grid-auto-rows: 1fr;
    align-content: stretch;
}
.cal-module-split .cal-grid--dash {
    flex: none;
    min-height: auto;
    grid-auto-rows: auto;
    align-content: start;
    gap: var(--dash-cal-grid-gap, 8px);
}
.cal-module-split .cal-grid:not(.cal-grid--dash) .cal-cell {
    height: auto;
    min-height: 0;
    max-height: none;
}
.cal-module-split .cal-grid--dash .cal-cell {
    aspect-ratio: 1;
    height: auto;
    min-height: 0;
    max-height: none;
}
#view-dashboard #dash-calendar-module:not(.cal-day-detail-open) .cal-grid--dash .cal-cell {
    aspect-ratio: unset;
    height: auto;
    min-height: 0;
    max-height: none;
}

/* Moduł kalendarza z drill-down (pulpit + strona kalendarza) */
.cal-module--drilldown {
    min-height: 0;
    height: 100%;
    border: 1px solid var(--ds-border);
}
.cal-module--drilldown.ds-card--calendar .ds-card__header--calendar {
    height: var(--ds-card-header-height);
    min-height: var(--ds-card-header-height);
    max-height: var(--ds-card-header-height);
}
.cal-module--drilldown .cal-module-calendar {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: var(--ds-inset-y) var(--ds-inset-x);
    box-sizing: border-box;
    background: transparent;
    border: none;
}
.cal-module--drilldown .cal-grid-wrap {
    gap: var(--space-3);
    flex: 1;
    min-height: 0;
    border: none;
}
.cal-module--drilldown .ds-card__header-actions {
    position: static;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    margin-left: auto;
    align-self: center;
    height: 100%;
}
.cal-module--drilldown .ds-card__header--calendar {
    flex-wrap: nowrap;
    gap: var(--space-3);
    align-items: center;
}
.cal-module--drilldown .ds-card__header--calendar .ds-card__title {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
}
.cal-module--drilldown .cal-header-nav {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    transition: opacity 0.24s ease, visibility 0.24s ease;
}
.cal-module--drilldown .cal-header-nav.cal-header-nav--grouped {
    display: grid;
    grid-template-columns: 34px auto 34px;
    align-items: center;
    justify-items: center;
    gap: var(--space-2);
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
}
.cal-day-detail-nav {
    display: none;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
    gap: var(--space-3);
}
.cal-day-detail-nav.cal-header-nav--grouped {
    display: none;
    grid-template-columns: 34px auto 34px;
    align-items: center;
    justify-items: center;
    gap: var(--space-2);
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
}
.cal-day-detail-nav.cal-header-nav--grouped .cal-toolbar__title,
.cal-day-detail-nav.cal-header-nav--grouped .cal-day-detail-nav__title {
    min-width: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: center;
    margin: 0;
    padding: 0 var(--space-2);
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
    word-break: normal;
    align-self: center;
    justify-self: center;
    width: auto;
}
.cal-day-detail-nav__title {
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
    word-break: normal;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-nav.cal-header-nav--grouped:not([hidden]) {
    display: grid;
}
#dash-calendar-module.cal-day-detail-open .cal-day-detail-nav.cal-header-nav--grouped:not([hidden]) {
    display: grid;
}
.cal-module--drilldown .cal-module-split {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
    border-top: none;
}
.cal-module--drilldown .cal-side-panel {
    flex: 1;
    min-height: 0;
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0;
    background: transparent;
}
.cal-module--drilldown.cal-day-detail-open .cal-module-calendar {
    display: none;
}
.cal-module--drilldown.cal-day-detail-open .cal-side-panel {
    display: flex;
    animation: dashDayPaneIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.cal-module--drilldown .cal-side-panel__head {
    display: none;
}
.cal-module--drilldown.cal-day-detail-open .cal-module-body {
    border-top: none;
    overflow: hidden;
}
.cal-module--drilldown.cal-day-detail-open .dash-day-view {
    flex: 1;
    min-height: 0;
    gap: 0;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
}
.cal-module--drilldown .ds-card__footer[hidden] {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}
#dash-calendar-module .dash-cal-card__footer {
    min-height: calc(var(--ds-btn-h-lg) + 2 * var(--space-3));
    flex-shrink: 0;
}
#dash-calendar-module {
    --cal-cell-h: 40px;
    --dash-cal-grid-gap: 6px;
    --dash-cal-week-rows: 6;
    --dash-cal-body-min-h: auto;
    --dash-cal-footer-h: 0px;
    --ds-dash-cal-dot-inset: clamp(6px, 12%, 10px);
}
#dash-calendar-module.cal-day-detail-open {
    --dash-cal-footer-h: calc(var(--ds-btn-h-lg) + 2 * var(--space-3) + 1px);
}
#dash-calendar-module:not(.cal-day-detail-open) .dash-cal-card__footer[hidden] {
    display: none !important;
    min-height: 0;
    padding: 0;
    border: none;
}
#dash-calendar-module.cal-day-detail-open .dash-cal-card__footer[hidden] {
    display: flex !important;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}
#dash-calendar-module:not(.cal-day-detail-open) .cal-module-body {
    min-height: auto;
    flex: none;
}
#dash-calendar-module.cal-day-detail-open .cal-module-body {
    min-height: 0;
    flex: 1 1 0;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .ds-card__body--grow {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
@keyframes dashDayPaneIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}
.cal-module--drilldown .cal-header-nav .btn-cal-today {
    margin-left: var(--space-2);
    padding: 6px 12px;
    font-size: var(--text-xs);
    font-weight: 600;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
}

/* Pulpit — siatka miesiąca */
.dash-day-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: var(--space-3);
    padding-top: 0;
    overflow: hidden;
}
.dash-day-view__intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-shrink: 0;
    padding-top: 0;
    border-top: none;
}
.dash-day-view__intro-label {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ds-text-tertiary);
}
.dash-day-view__date {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: var(--ds-text);
}
.dash-day-view__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    background: var(--ds-surface-muted);
    border: 1px solid var(--ds-border);
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--ds-text);
    flex-shrink: 0;
}
.dash-day-view__list-scroll {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.dash-day-view__list {
    flex: 1;
    min-height: 0;
}
.ds-scroll-rail .dash-day-view__list,
.ds-scroll-rail .module-list--dashboard {
    flex: none;
    min-height: auto;
    height: auto;
}
.dash-day-view__list:not(.ds-scroll-lane__inset) {
    overflow: visible;
}
.dash-day-view__list.module-list--dashboard:not(.ds-scroll-lane__inset) {
    flex: none;
    max-height: none;
    min-height: auto;
    height: auto;
}
.dash-day-view__list .dropdown-actions {
    position: relative;
    z-index: 2;
}
.dash-day-view__list .dropdown-actions.is-open {
    z-index: 10000;
}
.dash-day-view__foot {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 0;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-module-body,
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-module-split,
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-side-panel,
#view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view {
    gap: 0;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-module-split {
    height: auto;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-side-panel {
    width: 100%;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view > :is(.ds-inset-scroll, .ds-content-inset.ds-inset-scroll--host) {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#dash-calendar-module.cal-day-detail-open .cal-module-body,
#dash-calendar-module.cal-day-detail-open .ds-card__body--flush.cal-module-body {
    padding: 0;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view > :is(.ds-inset-scroll, .ds-content-inset.ds-inset-scroll--host) {
    padding: 0;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view :is(.ds-inset-scroll--host, .ds-content-inset):has(.ds-scroll-rail) {
    padding: 0;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view .ds-scroll-lane {
    flex: 1;
    min-height: 0;
    position: relative;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col > :is(.ds-inset-scroll, .ds-content-inset):not(.ds-inset-scroll--no-pad):not(.ds-content-inset--no-pad) {
    box-sizing: border-box;
}
/* Pulpit · Harmonogram — nagłówek (desktop: jeden wiersz, mobile: tytuł + nawigacja) */
#dash-calendar-module .ds-card__header--dash-cal {
    box-sizing: border-box;
}
#dash-calendar-module .dash-cal-head-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3);
    min-width: 0;
    flex: 0 1 auto;
}
#dash-calendar-module .dash-cal-head-row > .ds-close-btn {
    flex: 0 0 auto;
    margin: 0;
}
#dash-calendar-module .dash-cal-head-row > .ds-card__title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
}
#dash-calendar-module .dash-cal-nav-row {
    flex: 0 0 auto;
    min-width: 0;
    margin-left: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
#dash-calendar-module .dash-cal-nav-row #dash-cal-header-nav.cal-header-nav--grouped,
#dash-calendar-module .dash-cal-nav-row #dash-cal-day-detail-nav.cal-header-nav--grouped {
    display: grid;
    grid-template-columns: 34px auto 34px;
    align-items: center;
    justify-items: center;
    gap: var(--space-2);
    width: fit-content;
    max-width: 100%;
    min-width: 0;
}
#dash-calendar-module:not(.cal-day-detail-open) .dash-cal-head-row > .ds-close-btn {
    display: none !important;
}
#dash-calendar-module.cal-day-detail-open .dash-cal-head-row > .ds-close-btn:not([hidden]) {
    display: inline-flex;
}
#dash-calendar-module:not(.cal-day-detail-open) #dash-cal-day-detail-nav {
    display: none !important;
}
#dash-calendar-module.cal-day-detail-open #dash-cal-header-nav {
    display: none !important;
}
#dash-calendar-module.cal-day-detail-open #dash-cal-day-detail-nav:not([hidden]) {
    display: grid !important;
}
#dash-calendar-module:not(.cal-day-detail-open) #dash-cal-header-nav:not([hidden]) {
    display: grid !important;
}
@media (min-width: 1081px) {
    #dash-calendar-module .ds-card__header--dash-cal {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: var(--space-3);
        height: var(--ds-card-header-height);
        min-height: var(--ds-card-header-height);
        max-height: var(--ds-card-header-height);
        padding: 0 var(--ds-header-pad-x);
    }
    #dash-calendar-module .dash-cal-head-row > .ds-card__title {
        flex: 0 1 auto;
    }
}
@media (max-width: 1080px) {
    #dash-calendar-module {
        --ds-dash-cal-mobile-head-h: var(--ds-card-header-height);
        --ds-dash-cal-mobile-nav-h: calc(var(--cal-nav-btn-size, 32px) + 2 * var(--space-3));
    }
    #dash-calendar-module .ds-card__header--dash-cal {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        height: calc(var(--ds-dash-cal-mobile-head-h) + var(--ds-dash-cal-mobile-nav-h));
        min-height: calc(var(--ds-dash-cal-mobile-head-h) + var(--ds-dash-cal-mobile-nav-h));
        max-height: calc(var(--ds-dash-cal-mobile-head-h) + var(--ds-dash-cal-mobile-nav-h));
        flex-shrink: 0;
        padding: 0;
        border-bottom: none;
        overflow: hidden;
        box-sizing: border-box;
    }
    #dash-calendar-module .dash-cal-head-row {
        justify-content: flex-start;
        flex: 0 0 var(--ds-dash-cal-mobile-head-h);
        width: 100%;
        height: var(--ds-dash-cal-mobile-head-h);
        min-height: var(--ds-dash-cal-mobile-head-h);
        max-height: var(--ds-dash-cal-mobile-head-h);
        box-sizing: border-box;
        padding: 0 var(--ds-header-pad-x);
        border-bottom: 1px solid var(--ds-border);
    }
    #dash-calendar-module.cal-day-detail-open .dash-cal-head-row {
        justify-content: space-between;
    }
    #dash-calendar-module .dash-cal-head-row > .ds-card__title {
        order: 1;
        flex: 0 1 auto;
    }
    #dash-calendar-module.cal-day-detail-open .dash-cal-head-row > .ds-close-btn:not([hidden]) {
        order: 2;
        flex: 0 0 auto;
    }
    #dash-calendar-module .dash-cal-nav-row {
        flex: 0 0 var(--ds-dash-cal-mobile-nav-h);
        width: 100%;
        height: var(--ds-dash-cal-mobile-nav-h);
        min-height: var(--ds-dash-cal-mobile-nav-h);
        max-height: var(--ds-dash-cal-mobile-nav-h);
        box-sizing: border-box;
        margin-left: 0;
        padding: 0 var(--ds-header-pad-x);
        border-bottom: 1px solid var(--ds-border);
        justify-content: stretch;
        align-items: center;
    }
    #dash-calendar-module .dash-cal-nav-row #dash-cal-header-nav.cal-header-nav--grouped,
    #dash-calendar-module .dash-cal-nav-row #dash-cal-day-detail-nav.cal-header-nav--grouped {
        width: 100%;
        grid-template-columns: 34px minmax(0, 1fr) 34px;
    }
    #dash-calendar-module .dash-cal-nav-row #dash-cal-header-nav .btn-cal-nav:first-child,
    #dash-calendar-module .dash-cal-nav-row #dash-cal-day-detail-nav .btn-cal-nav:first-child {
        justify-self: start;
    }
    #dash-calendar-module .dash-cal-nav-row #dash-cal-header-nav .btn-cal-nav:last-child,
    #dash-calendar-module .dash-cal-nav-row #dash-cal-day-detail-nav .btn-cal-nav:last-child {
        justify-self: end;
    }
}
#dash-calendar-module.cal-day-detail-open .cal-module-split {
    border-top: none;
}
#dash-calendar-module.cal-day-detail-open #dash-cal-header-nav {
    display: none !important;
}
#dash-calendar-module:not(.cal-day-detail-open) #dash-cal-day-detail-nav {
    display: none !important;
}
#dash-calendar-module.cal-day-detail-open #dash-cal-day-detail-nav {
    display: grid !important;
}
#dash-calendar-module .cal-weekdays--dash span {
    text-align: center;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: var(--space-2) 0 var(--space-1);
    color: var(--ds-text-secondary);
}
#dash-calendar-module .cal-grid--dash {
    gap: var(--dash-cal-grid-gap);
}
#dash-calendar-module .cal-cell:active:not(.cal-cell--muted):not(.cal-cell--selected) {
    transform: scale(0.98);
}
#dash-calendar-module .cal-cell__num {
    font-size: var(--text-sm);
    font-weight: 600;
}
#dash-calendar-module .cal-cell__count {
    min-width: var(--ds-dash-cal-count-size);
    height: var(--ds-dash-cal-count-size);
    font-size: var(--ds-dash-cal-count-font);
    font-weight: var(--ds-dash-cal-count-weight);
    font-variant-numeric: var(--ds-font-numeric);
}
/* Pulpit · siatka dni — te same kafelki co .cal-grid--page (obrys + tło) */
#dash-calendar-module .cal-grid--dash .cal-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: clamp(6px, 12%, 12px);
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    box-shadow: none;
    border-radius: var(--radius-sm);
}
#dash-calendar-module .cal-grid--dash .cal-cell--muted {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
#dash-calendar-module .cal-grid--dash .cal-cell--in-month:not(.cal-cell--selected):not(.cal-cell--muted) {
    background: var(--ds-surface);
    border-color: var(--ds-border);
}
#dash-calendar-module .cal-grid--dash .cal-cell__num {
    align-self: flex-start;
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.15;
}
#dash-calendar-module .cal-grid--dash .cal-cell--has-events .cal-cell__num {
    font-weight: 700;
}
#dash-calendar-module .cal-grid--dash .cal-cell__dot {
    position: absolute;
    top: auto;
    bottom: var(--ds-dash-cal-dot-inset);
    right: var(--ds-dash-cal-dot-inset);
    left: auto;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ds-brand-cta);
    pointer-events: none;
    flex-shrink: 0;
}
#dash-calendar-module .cal-grid--dash .cal-cell--selected {
    background: var(--ds-cal-selected-bg);
    border: 1px solid var(--ds-cal-selected-border);
    border-radius: var(--radius-sm);
}
#dash-calendar-module .cal-grid--dash .cal-cell--selected .cal-cell__dot {
    background: var(--ds-brand-cta);
}
#dash-calendar-module .cal-grid--dash .cal-cell:hover:not(.cal-cell--muted):not(.cal-cell--selected) {
    background: var(--ds-cal-hover-bg) !important;
    border: 1px solid var(--ds-cal-hover-border) !important;
    border-radius: var(--radius-sm);
    box-shadow: none;
}
#dash-calendar-module .cal-empty-state {
    flex: 1;
    min-height: 140px;
    justify-content: center;
}
#dash-calendar-module .cal-header-nav .btn-cal-today {
    margin-left: var(--space-2);
    padding: 6px 12px;
    font-size: var(--text-xs);
    font-weight: 600;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
}

.btn-cal-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    width: fit-content;
    max-width: 100%;
    padding: 4px 12px 4px 4px;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    appearance: none;
    -webkit-appearance: none;
    white-space: nowrap;
    color: var(--ds-text);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.btn-cal-back__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs);
    background: var(--ds-cal-selected-bg);
    border: 1px solid var(--ds-cal-selected-border);
    color: var(--ds-text);
    flex-shrink: 0;
}
.btn-cal-back__icon .material-symbols-outlined { font-size: 18px; }
.btn-cal-back__label { line-height: 1; }
.btn-cal-back:hover {
    background: var(--ds-surface);
    border-color: var(--ds-cal-selected-border);
    color: var(--ds-text);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.btn-cal-back:hover .btn-cal-back__icon {
    background: #FFCF33;
    border-color: #FFCF33;
}

.cal-panel-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 0;
    min-height: 0;
    height: 100%;
}
.cal-panel-layout--fill {
    flex: 1;
    min-height: 0;
}
.cal-panel-layout--fill .cal-side-panel {
    min-height: 0;
    height: 100%;
    overflow: hidden;
}
.cal-panel-layout--fill .cal-side-panel__list {
    max-height: none;
}
.cal-panel-layout__calendar { padding: 0 var(--ds-content-pad) var(--ds-content-pad); min-width: 0; display: flex; flex-direction: column; min-height: 0; height: 100%; }
.cal-grid-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.cal-panel-layout--fill .cal-grid {
    flex: 1;
    min-height: 0;
    grid-auto-rows: 1fr;
    align-content: stretch;
}
.cal-panel-layout--fill .cal-cell {
    height: auto;
    min-height: 0;
    max-height: none;
}
.ds-card__header--calendar {
    align-items: center;
    height: var(--ds-card-header-height);
    min-height: var(--ds-card-header-height);
    max-height: var(--ds-card-header-height);
    box-sizing: border-box;
}
.ds-card__header--calendar .ds-card__title {
    margin: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
    align-self: center;
}
.cal-header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
    flex-shrink: 0;
    height: 100%;
}
.cal-header-nav--split {
    flex: 1;
    min-width: 0;
    justify-content: space-between;
    gap: var(--space-3);
    margin-left: 0;
}
.cal-header-nav--grouped {
    display: grid;
    grid-template-columns: 34px auto 34px;
    align-items: center;
    gap: var(--space-2);
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    justify-items: center;
}
.cal-header-nav--grouped .cal-toolbar__title {
    min-width: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: center;
    margin: 0;
    padding: 0 var(--space-2);
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
    word-break: normal;
    align-self: center;
    justify-self: center;
    width: auto;
}
.cal-header-nav--grouped .btn-cal-nav {
    justify-self: center;
    align-self: center;
}
.cal-nav-arrows {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    flex-shrink: 0;
}
.cal-header-nav:not(.cal-header-nav--grouped) .cal-toolbar__title {
    font-size: var(--text-base);
    font-weight: 600;
    min-width: 0;
    text-align: left;
    margin: 0;
}
.cal-header-nav--inline {
    margin-left: 0;
    justify-content: center;
    padding: var(--space-5) 0 var(--space-3);
    flex-shrink: 0;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: var(--cal-cell-h);
    gap: 4px;
    width: 100%;
}
.cal-grid--page {
    flex: none;
    min-height: auto;
    max-height: none;
    grid-auto-rows: auto;
    gap: var(--cal-page-grid-gap, 4px);
    align-content: start;
    overflow: visible;
    width: 100%;
    min-width: var(--cal-page-grid-min-w, 100%);
    box-sizing: border-box;
}
#cal-page-module .cal-grid--page .cal-cell {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    box-sizing: border-box;
}
.cal-month-wrap--page {
    flex: none;
    min-height: auto;
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}
.cal-month-wrap--page .cal-weekdays {
    flex-shrink: 0;
    min-width: var(--cal-page-grid-min-w, 100%);
    gap: var(--cal-page-grid-gap, 4px);
    margin-bottom: var(--cal-page-grid-gap, 4px);
    box-sizing: border-box;
}
.cal-month-wrap--page .cal-grid--page {
    flex: none;
    min-height: auto;
    height: auto;
}
#cal-page-module {
    --cal-page-cell-h: auto;
    --cal-page-grid-gap: 6px;
    --cal-page-col-min: 0;
    --cal-page-grid-min-w: 100%;
    --cal-page-week-min-w: 720px;
    --cal-page-day-min-w: 360px;
    --cal-day-detail-col-list-min: 300px;
    --cal-day-detail-col-summary-min: 360px;
    --cal-day-detail-stack-bp: 1360px;
    --cal-page-week-rows: var(--dash-cal-week-rows, 6);
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}
#cal-page-module.ds-card {
    overflow: visible;
}
#cal-page-module > .ds-card__header--cal-page {
    position: relative;
    z-index: 30;
    overflow: visible;
}
#cal-page-module .cal-module-body {
    overflow: hidden;
}
#cal-page-module:not(.cal-day-detail-open) .cal-module-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#cal-page-module.cal-day-detail-open .cal-module-body {
    padding: 0;
    overflow: hidden;
    overflow-x: auto;
}
#cal-page-module:not(.cal-day-detail-open) .cal-module-split {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#cal-page-module .cal-grid--page {
    height: auto;
    flex: none;
    min-height: auto;
}
#cal-page-module .cal-grid--page .cal-cell {
    padding: clamp(8px, 10%, 14px);
}
#cal-page-module .cal-grid--page .cal-cell__num {
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1.15;
}
#cal-page-module .cal-grid--page .cal-cell__count {
    min-width: 28px;
    height: 28px;
    font-size: 12px;
    font-weight: 700;
}
#cal-page-module:not(.cal-day-detail-open) .cal-module-calendar {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-right: none;
    box-sizing: border-box;
}
#cal-page-module.cal-view-mode--month:not(.cal-day-detail-open) .cal-module-calendar {
    padding: var(--ds-inset-y) var(--ds-inset-x);
}
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-module-calendar,
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-module-calendar {
    padding: 0;
}
#cal-page-module.cal-day-detail-open .cal-module-calendar {
    display: none !important;
}
#cal-page-module:not(.cal-day-detail-open) .cal-module-calendar > [hidden] {
    display: none !important;
}
#cal-page-module:not(.cal-day-detail-open) .cal-module-calendar > :not([hidden]) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#cal-page-module .cal-module-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#cal-page-module .cal-module-calendar {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#cal-page-module .cal-time-grid-wrap {
    flex: none;
    min-height: 0;
    overflow: visible;
    display: block;
}
#cal-page-module.cal-view-mode--month .cal-time-grid-wrap {
    overflow: visible;
}
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-scroll-host,
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host,
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary .cal-time-scroll-host {
    flex: 1;
    min-height: 0;
}
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-grid-wrap,
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-grid-wrap,
#cal-page-module.cal-day-detail-open #cal-day-summary.cal-time-grid-wrap {
    overflow: visible;
}
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-grid,
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-grid,
#cal-page-module.cal-day-detail-open #cal-day-summary .cal-time-grid {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100%;
    max-height: none;
    flex: 0 0 auto;
    overflow: visible;
}
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-grid__body--rows,
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-grid__body--rows,
#cal-page-module.cal-day-detail-open #cal-day-summary .cal-time-grid__body--rows {
    overflow: visible;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#cal-page-module.cal-view-mode--week .cal-time-grid__row,
#cal-page-module.cal-view-mode--day .cal-time-grid__row,
#cal-page-module.cal-day-detail-open #cal-day-summary .cal-time-grid__row {
    flex: 1 1 auto;
    min-height: 52px;
    height: auto;
}
#cal-page-module:not(.cal-view-mode--month) .cal-cell {
    height: auto;
    min-height: 0;
    max-height: none;
}
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-module-split,
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-module-split {
    grid-template-columns: minmax(0, 1fr);
}
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-side-panel,
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-side-panel {
    display: none;
}
#cal-page-module.cal-day-detail-open .cal-side-panel {
    display: flex !important;
}
#cal-page-module.cal-day-detail-open .cal-module-split {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    border-top: none;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout--page {
    display: grid;
    grid-template-columns:
        minmax(var(--cal-day-detail-col-list-min), 1fr)
        minmax(var(--cal-day-detail-col-summary-min), 1fr);
    gap: 0;
    flex: 1;
    min-height: 0;
    min-width: calc(var(--cal-day-detail-col-list-min) + var(--cal-day-detail-col-summary-min));
    width: 100%;
    height: 100%;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    padding: 0;
}
#cal-page-module.cal-day-detail-open .cal-module-split {
    border-top: none;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--list {
    border-right: 1px solid var(--ds-border);
    border-bottom: none;
}
/* Drill-down — obie kolumny: ten sam inset co listy na pulpicie (nagłówek → treść → scroll rail) */
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col > :is(.ds-inset-scroll, .ds-content-inset, .cal-time-scroll-host) {
    flex: 1 1 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col > :is(.ds-inset-scroll, .ds-content-inset, .cal-time-scroll-host) > .ds-scroll-lane,
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col :is(.ds-inset-scroll--host, .ds-content-inset, .cal-time-scroll-host):has(.ds-scroll-rail) > .ds-scroll-lane {
    flex: 1 1 0;
    min-height: 0;
    padding-inline-start: var(--ds-entity-scroll-gutter);
    padding-inline-end: 0;
    padding-top: var(--ds-dashboard-body-gap);
    padding-bottom: var(--ds-inset-y);
    box-sizing: border-box;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col :is(.ds-inset-scroll--host, .ds-content-inset, .cal-time-scroll-host):has(.ds-scroll-rail) {
    padding: 0;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col :is(.ds-inset-scroll--host, .ds-content-inset, .cal-time-scroll-host):has(.ds-scroll-rail) .ds-scroll-rail {
    flex: 1 1 0;
    min-height: 0;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary .cal-time-scroll-host {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary .cal-time-scroll-host > .ds-scroll-lane,
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary .cal-time-scroll-host .ds-scroll-rail {
    flex: 1 1 0;
    min-height: 0;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary .cal-time-scroll-host .ds-scroll-rail__body {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-col__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-shrink: 0;
    height: var(--ds-card-header-height);
    min-height: var(--ds-card-header-height);
    max-height: var(--ds-card-header-height);
    padding: 0 var(--ds-entity-list-pad-x);
    box-sizing: border-box;
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-surface);
}
#cal-page-module.cal-day-detail-open .cal-day-detail-col__head > * {
    align-self: center;
}
.cal-day-detail-col__title {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
    letter-spacing: -0.01em;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-col__footer {
    flex-shrink: 0;
    border-top: 1px solid var(--ds-border);
    padding: var(--ds-card-inset-y) var(--ds-entity-list-pad-x);
    background: var(--ds-surface);
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--list .dash-day-view__list {
    min-height: auto;
}
#cal-page-module .cal-time-grid {
    flex: 1;
    min-height: 0;
    height: 100%;
}
.cal-time-grid__body--rows .cal-time-grid__hour {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-2);
    min-height: 100%;
    height: 100%;
    border-right: 1px solid var(--ds-border);
    border-bottom: none;
    background: var(--ds-surface-muted);
    box-sizing: border-box;
    text-align: center;
}
#cal-page-module .cal-time-grid__body--rows {
    overflow: visible;
    flex: 0 0 auto;
    min-height: 0;
}
#cal-page-module .cal-time-grid__body {
    overflow: visible;
}
#cal-page-module .cal-time-grid__hours {
    display: grid;
    grid-template-rows: repeat(var(--cal-hour-count, 17), minmax(0, 1fr));
    min-height: 0;
}
#cal-page-module .cal-time-grid__col {
    display: grid;
    grid-template-rows: repeat(var(--cal-hour-count, 17), minmax(0, 1fr));
    min-height: 0;
}
#cal-page-module .cal-time-grid__hour,
#cal-page-module .cal-time-grid__slot {
    min-height: 0;
    height: auto;
}
#cal-page-module .cal-time-grid__body--rows .cal-time-grid__hour,
#cal-page-module .cal-time-grid__body--rows .cal-time-grid__slot {
    height: auto;
    min-height: 52px;
    align-self: stretch;
}
#cal-page-module .cal-time-grid__body--rows .cal-time-grid__row-days {
    height: auto;
    min-height: 100%;
    align-items: stretch;
}
#cal-page-module .cal-time-grid__body--rows .cal-time-grid__hour {
    min-height: 100%;
}

/* Strona kalendarza — pasek akcji */
.cal-page-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3);
    width: 100%;
    min-width: 0;
    flex: 1;
}
.cal-page-toolbar__primary {
    order: 1;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-2);
}
.cal-page-toolbar__primary .cal-header-nav--grouped,
.cal-page-toolbar__primary .cal-day-detail-nav.cal-header-nav--grouped {
    flex: 0 0 auto;
    min-width: 0;
    display: grid;
}
.cal-page-toolbar__primary .cal-header-nav:not(.cal-header-nav--grouped),
.cal-page-toolbar__primary .cal-day-detail-nav:not(.cal-header-nav--grouped) {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.cal-page-toolbar__primary [hidden] {
    display: none !important;
}
.cal-header-nav--page.cal-header-nav--grouped {
    margin-left: 0;
    justify-content: flex-start;
    flex: 0 0 auto;
    min-width: 0;
}
.cal-page-header__views {
    order: 2;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
}
.cal-page-toolbar__actions--desktop {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: flex-end;
}
.cal-page-toolbar__mobile {
    display: none;
    width: 100%;
    gap: var(--space-2);
    align-items: stretch;
}
.cal-view-toggle--desktop { display: inline-flex; }

/* Dropdown widoku kalendarza (Miesiąc / Tydzień / Dzień) */
.cal-view-dropdown {
    position: relative;
    flex-shrink: 0;
    --ds-dropdown-font-size: var(--text-sm);
    --ds-dropdown-option-py: 10px;
    --ds-dropdown-option-px: 12px;
}
.cal-view-dropdown--sm {
    --ds-dropdown-font-size: var(--text-xs);
    --ds-dropdown-option-py: 8px;
    --ds-dropdown-option-px: 10px;
}
.cal-view-dropdown--lg {
    --ds-dropdown-font-size: var(--text-base);
    --ds-dropdown-option-py: 12px;
    --ds-dropdown-option-px: 14px;
}
.cal-view-dropdown__trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 36px;
    padding: 0 12px 0 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    color: var(--ds-text);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.cal-view-dropdown__trigger:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
}
.cal-view-dropdown.open .cal-view-dropdown__trigger {
    background: var(--ds-surface);
    border-color: var(--ds-border-strong);
    box-shadow: 0 0 0 2px var(--ds-brand-tint-20);
}
.cal-view-dropdown__chev {
    font-size: 20px;
    color: var(--ds-text-secondary);
    transition: transform 0.2s ease;
}
.cal-view-dropdown.open .cal-view-dropdown__chev {
    transform: rotate(180deg);
}
.cal-view-dropdown__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 500;
    min-width: 148px;
    padding: var(--space-1);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    animation: dsPopupIn 0.18s ease;
}
.cal-view-dropdown__menu[hidden] {
    display: none;
}
.cal-view-dropdown__option {
    display: block;
    width: 100%;
    padding: var(--ds-dropdown-option-py) var(--ds-dropdown-option-px);
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ds-text);
    font-family: var(--font-ui);
    font-size: var(--ds-dropdown-font-size);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}
.cal-view-dropdown__option:hover {
    background: var(--ds-surface-muted);
}
.cal-view-dropdown__option.is-active {
    background: var(--ds-brand-tint-18);
    font-weight: 600;
}

.cal-mobile-select {
    position: relative;
    flex: 1;
    min-width: 0;
}
.cal-mobile-select__native {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    padding: 10px 36px 10px 12px;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
}
.cal-mobile-select__icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--ds-text-secondary);
    font-size: 20px;
}
.cal-mobile-actions {
    position: relative;
    flex-shrink: 0;
}
.cal-mobile-actions__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 50;
    padding: var(--space-1);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cal-mobile-actions__item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-xs);
    background: transparent;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text);
    cursor: pointer;
    text-align: left;
}
.cal-mobile-actions__item:hover { background: var(--ds-surface-muted); }
.cal-mobile-actions__item .material-symbols-outlined { font-size: 18px; color: var(--ds-text-secondary); }

/* ── Menu Szybkie akcje (pulpit, kalendarz) ── */
.ds-actions-menu {
    position: relative;
    flex-shrink: 0;
}
.ds-actions-menu__trigger {
    position: relative;
    overflow: visible;
    isolation: isolate;
    gap: var(--space-2);
    font-weight: 600;
    padding: 0 11px 0 14px;
    box-shadow: none;
    transition:
        transform var(--ds-motion-fast) var(--ds-ease-out),
        background var(--ds-motion-fast) var(--ds-ease-out),
        border-color var(--ds-motion-fast) var(--ds-ease-out);
}
.ds-actions-menu__trigger:hover {
    transform: translateY(-2px);
}
.ds-actions-menu__trigger:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.08s;
}
.ds-actions-menu.is-open .ds-actions-menu__trigger {
    transform: translateY(-2px);
    box-shadow: none;
}
.ds-actions-menu__chev {
    font-size: 20px;
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ds-actions-menu.is-open .ds-actions-menu__chev {
    transform: scale(1.08);
}
.ds-actions-menu__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 248px;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
    padding: var(--space-2);
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    transform-origin: top right;
    opacity: 0;
    transform: translateY(-14px) scale(0.88);
    filter: blur(4px);
    transition:
        opacity 0.26s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.34s cubic-bezier(0.34, 1.56, 0.64, 1),
        filter 0.26s ease,
        visibility 0s linear 0.34s;
    pointer-events: none;
    visibility: hidden;
}
.ds-actions-menu.is-open .ds-actions-menu__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    pointer-events: auto;
    visibility: visible;
    transition:
        opacity 0.26s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.34s cubic-bezier(0.34, 1.56, 0.64, 1),
        filter 0.26s ease,
        visibility 0s;
}
.ds-actions-menu__item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 11px 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text);
    cursor: pointer;
    text-align: left;
    opacity: 0;
    transform: translateX(12px) scale(0.96);
    transition:
        opacity 0.24s ease,
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.14s ease;
}
.ds-actions-menu.is-open .ds-actions-menu__item:nth-child(1) {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition-delay: 0.05s;
}
.ds-actions-menu.is-open .ds-actions-menu__item:nth-child(2) {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition-delay: 0.1s;
}
.ds-actions-menu.is-open .ds-actions-menu__item:nth-child(3) {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition-delay: 0.15s;
}
.ds-actions-menu.is-open .ds-actions-menu__item:nth-child(4) {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition-delay: 0.2s;
}
.ds-actions-menu.is-open .ds-actions-menu__item:nth-child(5) {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition-delay: 0.25s;
}
.ds-actions-menu.is-open .ds-actions-menu__item:nth-child(6) {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition-delay: 0.3s;
}
.ds-actions-menu__item:hover {
    background: var(--ds-brand-tint-18);
    transform: translateY(-1px) scale(1.01);
}
.ds-actions-menu__item:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.08s;
}
.ds-actions-menu__item .material-symbols-outlined {
    font-size: 20px;
    color: var(--ds-text-secondary);
    transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.14s ease;
}
.ds-actions-menu__item:hover .material-symbols-outlined {
    transform: scale(1.14) rotate(-6deg);
    color: var(--ds-text);
}

.ds-actions-menu--up .ds-actions-menu__panel {
    top: auto;
    bottom: calc(100% + 8px);
    transform-origin: bottom right;
    transform: translateY(14px) scale(0.88);
}
.ds-actions-menu--up.is-open .ds-actions-menu__panel {
    transform: translateY(0) scale(1);
}
#modal-product-details .ds-asset-card-panel__footer {
    justify-content: space-between;
    flex-wrap: wrap;
    overflow: visible;
    position: relative;
    z-index: 4;
}
#modal-product-details .ds-actions-menu {
    margin-left: auto;
}
#modal-product-details .ds-actions-menu__panel {
    z-index: 200;
}

/* Widok tygodnia / dnia — siatka godzin */
.cal-time-grid-wrap {
    flex: none;
    min-height: 0;
    min-width: 0;
    overflow: visible;
}
.cal-module-calendar > .ds-inset-scroll--host.ds-inset-scroll--no-pad {
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}
.cal-time-grid {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--ds-surface);
    box-shadow: var(--ds-cal-panel-shadow);
    --cal-gutter-width: 88px;
}
.cal-time-grid__header,
.cal-time-grid__allday,
.cal-time-grid__body {
    display: grid;
    grid-template-columns: var(--cal-gutter-width) minmax(0, 1fr);
}
.cal-time-grid__header {
    flex-shrink: 0;
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-surface-muted);
    align-items: stretch;
}
.cal-time-grid__days,
.cal-time-grid__allday-cols,
.cal-time-grid__cols {
    display: grid;
    grid-template-columns: repeat(var(--cal-cols, 7), minmax(0, 1fr));
    min-width: 0;
    align-items: stretch;
}
.cal-time-grid__gutter {
    border-right: 1px solid var(--ds-border);
    background: var(--ds-surface-muted);
    min-width: 0;
}
.cal-time-grid__dayhead {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: var(--space-2);
    border: none;
    border-right: 1px solid var(--ds-border);
    background: transparent;
    cursor: pointer;
    font-family: var(--font-ui);
    color: var(--ds-text-secondary);
    min-height: 48px;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    container-type: inline-size;
    position: relative;
}
.cal-time-grid__dayhead:last-child { border-right: none; }
.cal-time-grid__dayhead-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: var(--space-2);
    min-width: 0;
    width: 100%;
    max-width: 100%;
}
.cal-time-grid__dayhead.is-today,
.cal-time-grid__dayhead.is-selected.is-today {
    background: #FFCF33;
    color: #1A1A1A;
}
.cal-time-grid__dayhead.is-today .cal-time-grid__daynum,
.cal-time-grid__dayhead.is-today .cal-time-grid__dayname {
    color: #1A1A1A;
    font-weight: 700;
}
.cal-time-grid__dayhead.is-selected:not(.is-today) {
    background: var(--ds-surface-muted);
    color: var(--ds-text);
}
.cal-time-grid--week .cal-time-grid__header {
    min-height: 44px;
}
.cal-time-grid--week .cal-time-grid__dayhead {
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-3);
}
.cal-time-grid--week .cal-time-grid__daynum,
.cal-time-grid--week .cal-time-grid__dayname {
    font-size: var(--text-sm);
}
.cal-time-grid--week .cal-time-grid__dayhead-inner {
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}
.cal-time-grid--week .cal-time-grid__dayname {
    flex: 0 1 auto;
    justify-content: center;
}
.cal-time-grid__event {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--ds-cal-event-border);
    border-radius: var(--radius-xs);
    background: var(--ds-cal-event-bg);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: normal;
    color: #1A1A1A;
    text-align: left;
    cursor: pointer;
    white-space: normal;
    overflow: hidden;
    line-height: 1.25;
    transition: background 0.16s ease, border-color 0.16s ease;
}
.cal-time-grid__event-code {
    display: block;
    font-size: var(--text-xs);
    line-height: 1.25;
}
.cal-time-grid__event-name {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.cal-time-grid__event:hover {
    background: var(--ds-cal-event-bg-hover);
    border-color: var(--ds-cal-event-border-hover);
    filter: none;
}
#cal-page-module.cal-view-mode--week .cal-time-grid-wrap .cal-time-grid,
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-grid-wrap .cal-time-grid,
#cal-page-module.cal-day-detail-open #cal-day-summary .cal-time-grid {
    border-bottom: none;
}
.cal-time-grid__allday + .cal-time-grid__body--rows .cal-time-grid__row:first-child {
    border-top: none;
}
.cal-time-grid__dayname {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: -0.01em;
    text-transform: none;
    color: inherit;
    min-width: 0;
    max-width: 100%;
    line-height: 1.1;
    flex: 1 1 auto;
}
.cal-time-grid__dayname-full,
.cal-time-grid__dayname-short {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.cal-time-grid__dayname-short { display: none; }
.cal-time-grid__daynum {
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.1;
    color: inherit;
    flex-shrink: 0;
}
.cal-time-grid--day .cal-time-grid__dayname-full { display: inline; }
.cal-time-grid--day .cal-time-grid__dayname-short { display: none; }
.cal-time-grid__daycount { display: none !important; }
@container (max-width: 128px) {
    .cal-time-grid__dayhead-inner {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
    }
    .cal-time-grid:not(.cal-time-grid--day) .cal-time-grid__dayname-full { display: none; }
    .cal-time-grid:not(.cal-time-grid--day) .cal-time-grid__dayname-short { display: inline; }
}
@container (max-width: 96px) {
    .cal-time-grid__dayhead {
        padding: var(--space-1) 2px;
    }
    .cal-time-grid__daynum,
    .cal-time-grid__dayname {
        font-size: var(--text-xs);
    }
}
@media (max-width: 1280px) {
    .cal-time-grid--week { --cal-gutter-width: 64px; }
}
@media (max-width: 1080px) {
    .cal-time-grid--week { --cal-gutter-width: 52px; }
    .cal-time-grid--week .cal-time-grid__dayhead {
        min-height: 44px;
        padding: var(--space-1) var(--space-1);
    }
    #cal-page-module.cal-view-mode--week .cal-time-grid__row {
        min-height: 44px;
    }
}
@media (max-width: 860px) {
    .cal-time-grid--week { --cal-gutter-width: 40px; }
    .cal-time-grid--week .cal-time-grid__dayhead-inner {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
    }
    .cal-time-grid--week .cal-time-grid__dayname-full { display: none; }
    .cal-time-grid--week .cal-time-grid__dayname-short { display: inline; }
    .cal-time-grid--week .cal-time-grid__daynum,
    .cal-time-grid--week .cal-time-grid__dayname {
        font-size: var(--text-xs);
    }
}
.cal-time-grid__daycount { display: none !important; }
.cal-time-grid__allday {
    flex-shrink: 0;
    border-bottom: 1px solid var(--ds-border);
    min-height: 36px;
}
.cal-time-grid__allday-label {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-2) 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--ds-text-tertiary);
    text-transform: none;
    letter-spacing: 0.02em;
    font-family: var(--font-ui);
    white-space: nowrap;
    line-height: 1.2;
}
.cal-time-grid__allday-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
    border-right: 1px solid var(--ds-border);
    min-height: 32px;
}
.cal-time-grid__allday-col:last-child { border-right: none; }
.cal-time-grid__event:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring);
}
.cal-time-grid__body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: var(--cal-gutter-width) minmax(0, 1fr);
    align-items: stretch;
}
.cal-time-grid__body--rows {
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-height: 0;
    position: relative;
}
.cal-time-grid__now-line,
.cal-day-mini__now-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ds-success);
    z-index: 12;
    pointer-events: none;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ds-success) 35%, transparent);
}
.cal-now-marker {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--now-minute-pct, 0) * 100%);
    height: 2px;
    margin-top: -1px;
    background: var(--ds-success);
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ds-success) 35%, transparent);
}
.cal-time-grid__row {
    display: grid;
    grid-template-columns: var(--cal-gutter-width) minmax(0, 1fr);
    min-height: 52px;
    height: auto;
    position: relative;
    border-bottom: 1px solid var(--ds-border);
}
.cal-time-grid__row-days {
    display: grid;
    grid-template-columns: repeat(var(--cal-cols, 7), minmax(0, 1fr));
    min-height: 100%;
    height: 100%;
    min-width: 0;
}
.cal-time-grid__row--alt .cal-time-grid__slot {
    background: rgba(0, 0, 0, 0.025);
}
[data-theme="dark"] .cal-time-grid__row--alt .cal-time-grid__slot {
    background: rgba(255, 255, 255, 0.03);
}
.cal-time-grid__row:hover .cal-time-grid__hour,
.cal-time-grid__row:hover .cal-time-grid__slot {
    background: var(--ds-row-hover-bg);
}
.cal-time-grid__row.is-current-hour::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--now-minute-pct, 0) * 100%);
    height: 2px;
    background: var(--ds-success);
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ds-success) 35%, transparent);
}
.cal-time-grid__row.is-current-hour .cal-time-grid__hour span {
    color: var(--ds-success);
    font-weight: 700;
}
.cal-time-grid__hours {
    display: grid;
    grid-template-rows: repeat(var(--cal-hour-count, 17), minmax(0, 1fr));
    min-height: 0;
    height: 100%;
    border-right: 1px solid var(--ds-border);
    background: var(--ds-surface-muted);
}
.cal-time-grid__hour {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: 100%;
    border-bottom: 1px solid var(--ds-border);
    box-sizing: border-box;
    padding: 0 6px;
    text-align: center;
}
.cal-time-grid__hour span {
    position: static;
    font-size: 12px;
    font-weight: 500;
    color: var(--ds-text-tertiary);
    font-variant-numeric: var(--ds-font-numeric);
    line-height: 1.2;
    font-family: var(--font-ui);
}
.cal-time-grid__cols {
    min-height: 0;
    height: 100%;
    overflow: hidden;
}
.cal-time-grid__col {
    display: grid;
    grid-template-rows: repeat(var(--cal-hour-count, 17), minmax(0, 1fr));
    min-height: 0;
    height: 100%;
    border-right: 1px solid var(--ds-border);
}
.cal-time-grid__col:last-child { border-right: none; }
.cal-time-grid__slot {
    min-height: 52px;
    height: auto;
    border-bottom: none;
    border-right: 1px solid var(--ds-border);
    box-sizing: border-box;
    background: var(--ds-surface);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-2);
    overflow: visible;
    align-items: stretch;
    align-content: flex-start;
}
.cal-time-grid__slot:last-child { border-right: none; }
.cal-time-grid__slot .cal-time-grid__event {
    flex-shrink: 0;
    padding: var(--space-2);
    font-size: 11px;
    white-space: normal;
    line-height: 1.35;
}
.cal-time-grid__slot:nth-child(even) { background: inherit; }

.cal-grid--full {
    flex: 0 0 auto;
    align-content: start;
    max-height: calc(var(--cal-cell-h) * 6 + 12px);
    overflow-y: auto;
}
.cal-grid--dash {
    flex: none;
    min-height: auto;
    grid-auto-rows: auto;
    gap: var(--dash-cal-grid-gap, 8px);
    align-content: start;
}
.cal-grid--dash .cal-cell {
    aspect-ratio: 1;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    box-sizing: border-box;
}
.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    margin-bottom: 4px;
}
.cal-cell {
    height: var(--cal-cell-h);
    min-height: var(--cal-cell-h);
    max-height: var(--cal-cell-h);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    padding: 5px 6px;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    cursor: pointer;
    font-family: var(--font-ui);
    color: var(--ds-text);
    box-shadow: none;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cal-cell__num { font-size: var(--text-xs); font-weight: 600; line-height: 1.2; align-self: flex-start; }

.calendar-page__side { display: flex; flex-direction: column; gap: var(--space-4); padding: 0; border: none; background: transparent; }
.calendar-page__side .ds-card { flex: 1; min-height: 0; }

.task-list, #today-products-list, #dash-selected-day-products, #dash-devices-list { gap: var(--space-2); }

.cal-side-panel__body.module-body {
    padding: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.cal-side-panel__list {
    max-height: none;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.cal-side-panel__foot {
    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid var(--ds-border);
    flex-shrink: 0;
}
.cal-side-panel__foot .btn-footer { min-height: 48px; }

.cal-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-3);
    padding: var(--ds-content-pad);
    min-height: 140px;
    color: var(--ds-text-secondary);
}
.cal-empty-state__icon {
    font-size: 36px;
    color: var(--ds-info-icon-color);
    line-height: 1;
}
.cal-empty-state__text {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.55;
    max-width: 220px;
}
.cal-empty-state--day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100%;
    padding: var(--ds-content-pad) var(--ds-entity-list-pad-x);
    margin: 0;
    color: var(--ds-text-secondary);
}
.cal-empty-state--day .cal-empty-state__text {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.55;
    max-width: 16rem;
    white-space: pre-line;
}

.cal-toolbar { margin-bottom: var(--space-3); gap: var(--space-2); }
.cal-header-nav:not(.cal-header-nav--grouped) .cal-toolbar__title {
    font-size: var(--text-sm);
    font-weight: 600;
    min-width: 120px;
    margin: 0;
}

.btn-cal-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    box-sizing: border-box;
    border-radius: var(--radius-sm);
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text-secondary);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn-cal-nav:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
}
.btn-cal-nav .material-symbols-outlined {
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cal-weekdays span {
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: var(--space-2) 0;
    color: var(--ds-text-tertiary);
}

.cal-view-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--ds-surface-muted);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
}
.cal-view-toggle__btn {
    padding: 7px 14px;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--ds-text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.cal-view-toggle__btn:hover { color: var(--ds-text); background: rgba(255,255,255,0.6); }
.cal-view-toggle__btn.active {
    background: var(--ds-surface);
    color: var(--ds-text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.cal-cell--in-month:not(.cal-cell--selected) {
    background: var(--ds-surface);
    border-color: var(--ds-border);
}
.cal-cell--today:not(.cal-cell--selected) {
    border-color: var(--ds-primary);
    font-weight: 600;
    box-shadow: none;
}
.cal-cell--muted {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    cursor: default;
    pointer-events: none;
}

.cal-cell__count {
    font-size: var(--ds-cal-count-font);
    font-weight: var(--ds-cal-count-weight);
    background: var(--ds-cal-count-bg);
    color: var(--ds-cal-count-text);
    border-radius: 50%;
    min-width: var(--ds-cal-count-size);
    height: var(--ds-cal-count-size);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    flex-shrink: 0;
    align-self: flex-end;
    margin-top: auto;
}
.cal-cell--selected,
.cal-cell--selected:hover,
.cal-cell--selected:focus-visible {
    background: var(--ds-cal-selected-bg);
    border: 1px solid var(--ds-cal-selected-border);
    color: var(--ds-cal-selected-text);
    box-shadow: none;
}
.cal-cell--selected.cal-cell--today {
    box-shadow: none;
    border-color: var(--ds-cal-selected-border);
}
.cal-cell--selected .cal-cell__num {
    color: var(--ds-cal-selected-text);
}
.cal-cell--selected .cal-cell__count {
    background: var(--ds-cal-selected-count-bg);
    color: var(--ds-cal-count-text);
}
.cal-cell--selected:hover {
    background: var(--ds-cal-selected-bg);
    border: 1px solid var(--ds-cal-selected-border);
    color: var(--ds-cal-selected-text);
    box-shadow: none;
}
.cal-cell--has-events:not(.cal-cell--selected) {
    background: var(--ds-surface);
    border-color: var(--ds-border);
}
.cal-cell:hover:not(.cal-cell--muted):not(.cal-cell--selected) {
    background: var(--ds-cal-hover-bg) !important;
    border: 1px solid var(--ds-cal-hover-border) !important;
    color: var(--ds-text);
    box-shadow: none !important;
    transform: none;
}
.cal-cell--selected:hover .cal-cell__num,
.cal-cell--selected:hover .cal-cell__count {
    color: var(--ds-cal-count-text);
}
.cal-cell--today:not(.cal-cell--selected):hover {
    background: var(--ds-cal-hover-bg) !important;
    border: 1px solid var(--ds-primary) !important;
    box-shadow: none;
    transform: none;
}
.cal-cell:active:not(.cal-cell--muted):not(.cal-cell--selected):not(.cal-cell--today) {
    background: var(--ds-cal-hover-active-bg);
    border-color: var(--ds-cal-hover-border);
    transform: none;
    box-shadow: none;
}
.cal-cell--today:not(.cal-cell--selected):active {
    background: var(--ds-cal-hover-active-bg);
    border-color: var(--ds-primary);
    transform: none;
    box-shadow: none;
}

/* ── Modals & overlays ── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
    box-sizing: border-box;
}
#modal-custom-confirm.modal,
#modal-custom-prompt.modal {
    z-index: 2200;
}
.modal.show {
    display: flex;
    animation: modalBackdropIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalBackdropIn {
    from { background-color: rgba(15, 23, 42, 0); }
    to { background-color: rgba(15, 23, 42, 0.55); }
}
@keyframes modalContentIn {
    from { opacity: 0; transform: scale(0.97) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-content {
    background: var(--ds-surface);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 500px;
    max-width: 100%;
    max-height: 90dvh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
    border: 1px solid var(--ds-border);
    box-sizing: border-box;
    animation: modalContentIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-content.modal-large {
    width: 800px;
    overflow: visible;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    gap: var(--space-3);
}
.modal-header h2 { font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-2);
}
/* ── KOMPONENT: zamknij (×) — jeden wygląd w całej aplikacji ── */
.icon-btn.ds-close-btn,
.icon-btn.modal-close,
.slide-panel__head .icon-btn.icon-btn--ghost,
.slide-panel__header > .icon-btn.icon-btn--ghost,
[data-dialog-close].icon-btn,
[data-panel-close].icon-btn,
.ds-card__header-actions > .icon-btn.icon-btn--ghost,
.account-section-header__actions > .icon-btn.icon-btn--ghost {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--ds-text-tertiary);
    flex-shrink: 0;
    border-radius: var(--radius-sm);
}
.icon-btn.ds-close-btn:hover,
.icon-btn.modal-close:hover,
.slide-panel__head .icon-btn.icon-btn--ghost:hover,
.slide-panel__header > .icon-btn.icon-btn--ghost:hover,
[data-dialog-close].icon-btn:hover,
[data-panel-close].icon-btn:hover,
.ds-card__header-actions > .icon-btn.icon-btn--ghost:hover,
.account-section-header__actions > .icon-btn.icon-btn--ghost:hover {
    background: var(--ds-surface-muted);
    border: none;
    color: var(--ds-text);
    transform: none;
}
.icon-btn.ds-close-btn .material-symbols-outlined,
.icon-btn.modal-close .material-symbols-outlined,
.slide-panel__head .icon-btn.icon-btn--ghost .material-symbols-outlined,
.slide-panel__header > .icon-btn.icon-btn--ghost .material-symbols-outlined,
[data-dialog-close].icon-btn .material-symbols-outlined,
[data-panel-close].icon-btn .material-symbols-outlined,
.ds-card__header-actions > .icon-btn.icon-btn--ghost .material-symbols-outlined,
.account-section-header__actions > .icon-btn.icon-btn--ghost .material-symbols-outlined {
    font-size: 22px;
    transition: none;
    transform: none !important;
}
.icon-btn.ds-close-btn:hover .material-symbols-outlined,
.icon-btn.modal-close:hover .material-symbols-outlined,
.slide-panel__head .icon-btn.icon-btn--ghost:hover .material-symbols-outlined,
.slide-panel__header > .icon-btn.icon-btn--ghost:hover .material-symbols-outlined,
[data-dialog-close].icon-btn:hover .material-symbols-outlined,
[data-panel-close].icon-btn:hover .material-symbols-outlined,
.ds-card__header-actions > .icon-btn.icon-btn--ghost:hover .material-symbols-outlined,
.account-section-header__actions > .icon-btn.icon-btn--ghost:hover .material-symbols-outlined,
.icon-btn.ds-close-btn:focus-visible .material-symbols-outlined,
.icon-btn.modal-close:focus-visible .material-symbols-outlined,
.slide-panel__head .icon-btn.icon-btn--ghost:focus-visible .material-symbols-outlined,
.slide-panel__header > .icon-btn.icon-btn--ghost:focus-visible .material-symbols-outlined,
[data-dialog-close].icon-btn:focus-visible .material-symbols-outlined,
[data-panel-close].icon-btn:focus-visible .material-symbols-outlined,
.ds-card__header-actions > .icon-btn.icon-btn--ghost:focus-visible .material-symbols-outlined,
.account-section-header__actions > .icon-btn.icon-btn--ghost:focus-visible .material-symbols-outlined,
.icon-btn.ds-close-btn:active .material-symbols-outlined,
.icon-btn.modal-close:active .material-symbols-outlined,
.slide-panel__head .icon-btn.icon-btn--ghost:active .material-symbols-outlined,
.slide-panel__header > .icon-btn.icon-btn--ghost:active .material-symbols-outlined,
[data-dialog-close].icon-btn:active .material-symbols-outlined,
[data-panel-close].icon-btn:active .material-symbols-outlined,
.ds-card__header-actions > .icon-btn.icon-btn--ghost:active .material-symbols-outlined,
.account-section-header__actions > .icon-btn.icon-btn--ghost:active .material-symbols-outlined {
    transform: none !important;
}
.icon-btn.ds-close-btn:focus-visible,
.icon-btn.modal-close:focus-visible,
.slide-panel__head .icon-btn.icon-btn--ghost:focus-visible,
.slide-panel__header > .icon-btn.icon-btn--ghost:focus-visible,
[data-dialog-close].icon-btn:focus-visible,
[data-panel-close].icon-btn:focus-visible,
.ds-card__header-actions > .icon-btn.icon-btn--ghost:focus-visible,
.account-section-header__actions > .icon-btn.icon-btn--ghost:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--ds-primary);
}

/* Status badges — definicja w sekcji .ds-status-badge (wyżej) */
/* ── View toolbar & filters ── */
.view-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    flex-shrink: 0;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    container-type: inline-size;
}
.view-toolbar:has(.custom-select.open),
.view-toolbar:has(.dropdown-actions.is-open),
.view-toolbar:has(.ds-head-dropdown.is-open) {
    overflow: visible;
}
.view-toolbar--open:has(.custom-select.open),
.view-toolbar--open:has(.ds-head-dropdown.is-open) {
    overflow: visible;
}
.view-toolbar__row {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--ds-header-pad-x);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.view-toolbar__search.global-search,
.view-toolbar__search.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    height: var(--ds-search-h);
    min-height: var(--ds-search-h);
    padding: 0 var(--ds-search-pad-x);
    min-width: 0;
    box-sizing: border-box;
    cursor: text;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.view-toolbar__row > .view-toolbar__search {
    flex: 0 1 auto;
    width: min(50%, 360px);
    max-width: min(50%, 360px);
    min-width: 200px;
}
.entity-view .view-toolbar__row > .view-toolbar__search {
    flex: 0 1 auto;
    width: min(50%, 360px);
    max-width: min(50%, 360px);
    min-width: 200px;
}
.view-toolbar__search.global-search:hover:not(:focus-within),
.view-toolbar__search.search-input-wrapper:hover:not(:focus-within) {
    border-color: var(--ds-interactive-hover-border);
}
.view-toolbar__search.global-search:focus-within,
.view-toolbar__search.search-input-wrapper:focus-within {
    border: 1px solid var(--ds-interactive-focus-border);
    box-shadow: var(--ds-interactive-focus-ring);
    background: var(--ds-surface);
}
.view-toolbar__search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    padding: 0;
    line-height: 1.35;
    color: var(--ds-text);
    min-width: 0;
    align-self: center;
}
.view-toolbar__search .material-symbols-outlined {
    color: var(--ds-text-tertiary);
    font-size: var(--ds-search-icon-size);
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.view-toolbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
}
.view-toolbar__actions .btn {
    max-width: 100%;
    box-sizing: border-box;
}
.view-toolbar__actions .btn:not(.btn-outline) {
    min-height: var(--ds-control-h);
    height: var(--ds-control-h);
    padding-top: 0;
    padding-bottom: 0;
}
.view-toolbar__actions .btn-outline {
    min-height: var(--ds-control-h);
    height: var(--ds-control-h);
    padding-top: 0;
    padding-bottom: 0;
}
.view-toolbar__actions .btn-outline.btn--icon-only {
    width: var(--ds-control-h);
    min-width: var(--ds-control-h);
    padding: 0;
}
.view-toolbar__mobile-toggle {
    display: none;
    flex-shrink: 0;
}
[data-entity-toolbar] .view-toolbar__mobile-toggle {
    display: none !important;
}
/* Wąski toolbar (mobile / wąska kolumna) — przyciski mieszczą się w kontenerze */
@container (max-width: 640px) {
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
        padding: var(--space-3);
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__search,
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__search.global-search {
        flex: none;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__actions {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: none;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: var(--space-2);
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__actions > .btn-outline:not(.btn--icon-only) {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__actions > .btn--icon-only:not(.view-toolbar__mobile-toggle) {
        grid-column: 2;
        grid-row: 1;
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        justify-self: end;
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__actions > .btn-brand,
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__actions > .btn-primary:not(.btn--icon-only) {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        max-width: 100%;
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__filters {
        padding: var(--space-3);
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__filters .filter-bar,
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__filters .filter-bar--compact {
        grid-template-columns: minmax(0, 1fr);
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__filters .filter-bar__hint {
        grid-column: 1 / -1;
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__filters .filter-bar__clear {
        grid-column: 1 / -1;
        justify-self: end;
        max-width: 100%;
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__filters .form-group {
        min-width: 0;
        width: 100%;
    }
}
.view-toolbar__filters {
    display: none;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: none;
    background: var(--ds-surface);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.view-toolbar--open .view-toolbar__filters {
    display: block;
    max-height: none;
    overflow: visible;
    padding: var(--space-4) var(--ds-card-inset-x);
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface);
    border-radius: 0 0 calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px);
    box-sizing: border-box;
}
.view-toolbar__filters .filter-bar {
    border: none;
    padding: 0;
    border-radius: 0;
    margin: 0;
    overflow: visible;
    min-width: 0;
}
/* Panel filtrów — kompakt: 2 równe kolumny (daty), 1 kolumna gdy jedno pole */
.view-toolbar__filters .filter-bar--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}
.view-toolbar__filters .filter-bar--compact:has(> .form-group:only-of-type) {
    grid-template-columns: minmax(0, 1fr);
}
.view-toolbar__filters .filter-bar--compact:not(:has(> .form-group)) {
    grid-template-columns: minmax(0, 1fr);
}
.view-toolbar__filters .filter-bar--compact .filter-bar__hint {
    grid-column: 1 / -1;
}
.view-toolbar__filters .filter-bar--compact .filter-bar__clear {
    grid-column: 1 / -1;
    justify-self: end;
    max-width: 100%;
}
.view-toolbar__filters .form-group {
    min-width: 0;
    width: 100%;
}
.filter-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: var(--ds-form-grid-gap);
    align-items: end;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.filter-bar > .form-group {
    margin-bottom: 0;
    min-width: 0;
    width: 100%;
    max-width: none;
}
.filter-bar > .form-group:has(> .custom-select),
.view-toolbar__filters .form-group:has(> .custom-select) {
    width: 100%;
    max-width: none;
}
.filter-bar .custom-select,
.view-toolbar__filters .custom-select {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.filter-bar .custom-select-trigger,
.view-toolbar__filters .custom-select-trigger {
    min-width: 0;
    width: 100%;
}
.filter-bar > .filter-bar__clear {
    justify-self: end;
    align-self: end;
    white-space: nowrap;
}
.filter-bar__clear {
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
    align-self: end;
    white-space: nowrap;
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--ds-text-secondary);
    font-weight: 500;
}
.filter-bar__clear:hover {
    background: var(--ds-surface-muted);
    border: none;
    color: var(--ds-text);
}
.filter-bar__clear .material-symbols-outlined {
    font-size: 16px;
    color: var(--ds-text-tertiary);
}
.filter-bar__clear:hover .material-symbols-outlined {
    color: var(--ds-text-secondary);
}
.filter-bar--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.filter-bar--compact:has(> .form-group:only-of-type) {
    grid-template-columns: minmax(0, 1fr);
}
.filter-bar--compact:not(:has(> .form-group)) {
    grid-template-columns: minmax(0, 1fr);
}
.filter-bar .form-group,
.view-toolbar__filters .form-group {
    width: 100%;
    min-width: 0;
}
.filter-bar .form-group input:not([type="checkbox"]):not([type="radio"]),
.filter-bar .form-group textarea,
.filter-bar .form-group .ds-date-input,
.filter-bar .form-group .custom-date-picker,
.view-toolbar__filters .form-group input:not([type="checkbox"]):not([type="radio"]),
.view-toolbar__filters .form-group textarea,
.view-toolbar__filters .form-group .ds-date-input,
.view-toolbar__filters .form-group .custom-date-picker {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.filter-bar .form-group .custom-date-picker,
.view-toolbar__filters .form-group .custom-date-picker {
    display: block;
}
.filter-bar--compact .filter-bar__clear,
.filter-bar--compact .filter-bar__hint {
    grid-column: 1 / -1;
}
.filter-bar__hint {
    grid-column: 1 / -1;
    margin: 0;
    font-size: var(--text-xs);
    color: var(--ds-text-secondary);
    line-height: var(--leading-normal);
}
.filter-bar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-self: end;
}
.view-toolbar--panel .view-toolbar__filters {
    padding-left: var(--ds-inset-x);
    padding-right: var(--ds-inset-x);
}
.view-toolbar--open.view-toolbar--panel .view-toolbar__filters {
    display: block;
    max-height: 140px;
    overflow: visible;
}
@media (max-width: 1080px) {
    .filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .filter-bar > .filter-bar__clear,
    .filter-bar__clear,
    .filter-bar__actions {
        grid-column: 1 / -1;
        justify-self: end;
    }
    .view-toolbar__filters .filter-bar--compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .view-toolbar__filters .filter-bar--compact:has(> .form-group:only-of-type) {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 768px) {
    .filter-bar,
    .filter-bar--compact {
        grid-template-columns: 1fr;
    }
    .view-toolbar--open .view-toolbar__filters {
        max-height: 480px;
    }
}
.topbar .icon-btn:active:not(:disabled) { transform: none; }
.view-toolbar__filters .form-group {
    margin: 0;
    min-width: 0;
    overflow: visible;
}
.view-toolbar__filters .custom-select.open {
    z-index: 120;
}
.view-toolbar__filters .custom-select.open .custom-select-options {
    z-index: 200;
}
.data-table th {
    font-size: var(--ds-entity-font-head);
    font-weight: var(--ds-entity-list-head-weight);
    letter-spacing: normal;
    text-transform: none;
    padding: var(--space-3) var(--space-4);
    color: var(--ds-text-tertiary);
}
.data-table td {
    padding: var(--space-3) var(--space-4);
    vertical-align: middle;
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .table-card.entity-list) .data-table td {
    border-bottom: none;
}
.data-table th,
.data-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    font-feature-settings: var(--ds-font-features);
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list, .entity-list-scroll) .data-table :is(th, td):not(.ds-row-kebab-cell):not(.data-table__cell-check) {
    overflow: visible;
    text-overflow: clip;
}
.data-table th.ds-row-kebab-cell,
.data-table td.ds-row-kebab-cell {
    overflow: visible;
    text-overflow: clip;
}
.table-card .data-table {
    width: 100%;
}
.table-card {
    padding: 0;
    min-width: 0;
    max-width: 100%;
}
#product-list-container.ds-entity-list-body,
#devices-list-container.ds-entity-list-body,
#locations-list-container.ds-entity-list-body,
#reports-list-container.ds-entity-list-body,
#trash-list-container.ds-entity-list-body,
#product-list-container.table-card.entity-list,
#devices-list-container.table-card.entity-list,
#locations-list-container.table-card.entity-list,
#reports-list-container.table-card.entity-list,
#trash-list-container.table-card.entity-list {
    padding: 0;
}
#view-reports #reports-list-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: var(--space-4);
}
#view-reports .entity-view-scroll #reports-list-view > .view-toolbar,
#view-reports #reports-list-view > .view-toolbar {
    margin-bottom: 0;
    margin-inline: 0;
    flex-shrink: 0;
}
#view-reports #reports-grid-container.entity-grid,
#view-reports #reports-list-view > .entity-list-card {
    flex: 1;
    min-height: 0;
}
#view-reports #reports-list-container:is(.ds-entity-list-body, .table-card.entity-list) {
    flex: 0 0 auto;
    height: auto;
    align-self: stretch;
}
#view-reports > .schedule-step--date,
#view-reports > .schedule-step--products {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
#view-reports > .schedule-step--products {
    display: flex;
    flex-direction: column;
}
#view-reports > .schedule-step:not(.is-active) {
    display: none !important;
}
#view-reports #report-wizard-view .schedule-step--products {
    display: none;
    flex-direction: column;
}
#view-reports #report-wizard-view .schedule-step--products.is-active {
    display: flex;
}
#view-reports #reports-list-view.is-hidden {
    display: none !important;
}

#view-daily-audits {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#view-daily-audits > .entity-view-scroll > .ds-page-header {
    flex-shrink: 0;
}
#view-daily-audits > .entity-view-scroll > #audits-list-view {
    flex: 1 1 0;
    min-height: 0;
}
#view-daily-audits #audits-list-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: var(--space-4);
}
#view-daily-audits .entity-view-scroll #audits-list-view > .view-toolbar,
#view-daily-audits #audits-list-view > .view-toolbar {
    margin-bottom: 0;
    margin-inline: 0;
    flex-shrink: 0;
}
#view-daily-audits #audits-grid-container.entity-grid,
#view-daily-audits #audits-list-view > .entity-list-card {
    flex: 1;
    min-height: 0;
}
#view-daily-audits #audits-list-container:is(.ds-entity-list-body, .table-card.entity-list) {
    flex: 0 0 auto;
    height: auto;
    align-self: stretch;
}

/* ── KOMPONENT: entity-module-list-view — toolbar + karta listy (raporty, audyty, kosz) ── */
.entity-module-list-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: var(--ds-dashboard-gap);
}
.entity-module-list-view > .view-toolbar {
    margin-bottom: 0;
    margin-inline: 0;
    flex-shrink: 0;
}
.entity-module-list-view > .entity-list-card {
    flex: 1;
    min-height: 0;
}
#view-trash {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#view-trash > .entity-view-scroll > .ds-page-header {
    flex-shrink: 0;
}
#view-trash > .entity-view-scroll > .entity-module-list-view {
    flex: 1 1 0;
    min-height: 0;
}
#view-trash #trash-list-container:is(.ds-entity-list-body, .table-card.entity-list) {
    flex: 0 0 auto;
    height: auto;
    align-self: stretch;
}

/* Podgląd raportu w aplikacji — design system (DOC eksport osobno) */
.report-preview-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
#report-preview-modal .report-preview-content .ds-add-product-form--panel-sections {
    --ds-panel-form-divider-margin: var(--space-8);
    --ds-panel-form-block-gap: var(--space-6);
}
.ds-add-product-form--panel-sections {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.ds-add-product-form--panel-sections .ds-add-product-form__block {
    display: flex;
    flex-direction: column;
    gap: var(--ds-panel-form-block-gap);
    padding-block: 0;
}
.ds-add-product-form--panel-sections .ds-add-product-form__section-divider {
    margin: var(--ds-panel-form-divider-margin) 0;
    border-top-color: var(--ds-panel-section-divider-color);
}
.ds-add-product-form--panel-sections .ds-detail-list__row {
    display: grid;
    grid-template-columns: var(--ds-panel-detail-label-col) minmax(0, 1fr);
    gap: var(--ds-panel-detail-col-gap);
    align-items: start;
}
.ds-norms-lines {
    display: inline-flex;
    flex-direction: column;
    gap: 0.2em;
    align-items: flex-start;
}
.ds-norms-lines__item {
    display: block;
}
.report-preview-summary .ds-detail-list__row,
.report-preview-product .ds-detail-list__row {
    display: grid;
    grid-template-columns: var(--ds-panel-detail-label-col) minmax(0, 1fr);
    gap: var(--ds-panel-detail-col-gap);
    align-items: start;
}
.report-preview-product {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}
.report-preview-product + .report-preview-product,
.report-preview-content > .ds-add-product-form__section-divider + .report-preview-product {
    margin-top: 0;
}
.report-preview-product__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-width: 0;
    margin-bottom: var(--ds-panel-form-block-gap);
}
.report-preview-product__title {
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1.3;
    min-width: 0;
}
.report-preview-block__title {
    margin: 0 0 var(--ds-block-title-gap);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
}
.report-preview-block {
    min-width: 0;
}
.report-preview-block + .report-preview-block {
    margin-top: 0;
}
.report-preview-product .report-preview-block__title:not(:first-child) {
    margin-top: var(--space-1);
}
.report-rpp-points-list {
    margin: 0;
    padding: 0 0 0 1.15em;
    list-style: disc;
}
.report-rpp-points-list li {
    margin: 0;
    padding: 0;
    line-height: 1.4;
}
.report-rpp-points-list li + li {
    margin-top: 0.1em;
}
.report-preview-cell--points .report-rpp-points-list {
    padding-left: 1.1em;
}
.report-preview-points {
    margin-top: 0;
    max-width: 100%;
    overflow: visible;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
}
.report-preview-point-table--spaced {
    margin-bottom: var(--space-3);
}
.report-preview-point-table--kv {
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    overflow: hidden;
}
.report-preview-kv-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.report-preview-kv-table__title {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-size: var(--ds-entity-font);
    font-weight: 700;
    color: var(--ds-text);
    background: var(--ds-surface-muted);
    border-bottom: 1px solid var(--ds-border);
}
.report-preview-kv-table__label,
.report-preview-kv-table__value {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--ds-border);
    vertical-align: top;
    text-align: left;
    font-size: var(--ds-entity-font);
    line-height: 1.45;
    word-break: break-word;
}
.report-preview-kv-table__label {
    width: 34%;
    font-weight: 600;
    color: var(--ds-text-secondary);
    background: var(--ds-surface-muted);
    border-right: 1px solid var(--ds-border);
}
.report-preview-kv-table__value {
    color: var(--ds-text);
    background: var(--ds-surface);
}
.report-preview-point-table--kv .report-preview-table-title {
    margin: 0;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--ds-border);
}
.report-preview-point-table__rows {
    padding: var(--space-3) var(--space-4);
}
.report-preview-point-table__title,
.report-preview-table-title {
    font-size: var(--ds-entity-font);
    font-weight: 700;
    color: var(--ds-text);
    background: var(--ds-surface-muted);
}
.report-preview-table-title {
    margin: 0 0 var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
}
.report-preview-title-block {
    margin: 0 0 var(--space-4);
}
.report-preview-title-block__heading {
    margin: 0;
    font-size: var(--ds-text-lg);
    font-weight: 700;
    line-height: 1.3;
    color: var(--ds-text-primary);
}
.report-preview-product--single > .report-preview-kv-table {
    margin-bottom: 0;
}
.report-preview-reading {
    margin: 0;
    max-width: 100%;
}
.report-preview-reading img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 28rem;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
}
.report-preview-points .data-table--report-preview-points {
    width: 100%;
    min-width: 0;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
    border: none;
    margin: 0;
}
.report-preview-points .data-table--report-preview-points thead th {
    padding: var(--ds-table-head-pad-y) var(--space-4);
    border-top: 1px solid var(--ds-border);
    border-left: none;
    border-right: none;
    border-bottom: none;
    vertical-align: top;
    text-align: left;
    font-size: var(--ds-entity-font);
    line-height: 1.45;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: break-word;
    min-width: 0;
}
.report-preview-points .data-table--report-preview-points tbody td {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--ds-border);
    border-left: none;
    border-right: none;
    border-bottom: none;
    vertical-align: top;
    text-align: left;
    font-size: var(--ds-entity-font);
    line-height: 1.45;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: break-word;
    min-width: 0;
}
.report-preview-points .data-table--report-preview-points thead th {
    font-size: var(--ds-entity-font-head);
    font-weight: var(--ds-entity-list-head-weight);
    color: var(--ds-text-tertiary);
    background: var(--ds-surface-muted);
    white-space: nowrap;
    vertical-align: middle;
}
.report-preview-points .data-table--report-preview-points thead tr:first-child th {
    border-top: none;
}
.report-preview-points .data-table--report-preview-points :is(
    th.data-table__col-status,
    td.data-table__cell-status,
    th.data-table__col-result,
    td.data-table__cell-result,
    .report-preview-cell--limit
) {
    white-space: nowrap;
}
.report-preview-points .data-table--report-preview-points .report-preview-cell--norm {
    white-space: normal;
}
.report-preview-points .data-table--report-preview-points .report-preview-cell--points {
    white-space: normal;
}
.report-preview-points .data-table--report-preview-points td.data-table__cell-status {
    overflow: visible;
    vertical-align: middle;
}
.report-preview-points .data-table--report-preview-points td.data-table__cell-status .ds-status-badge {
    max-width: none;
    white-space: nowrap;
}
.data-table--report-preview-points .report-preview-col--name { width: 22%; min-width: 9rem; }
.data-table--report-preview-points .report-preview-col--points { width: 24%; min-width: 11rem; }
.data-table--report-preview-points .report-preview-col--result { width: 1%; min-width: 7.5rem; }
.data-table--report-preview-points .report-preview-col--norm { width: 1%; min-width: 8rem; }
.data-table--report-preview-points .report-preview-col--limit { width: 1%; min-width: 5.5rem; }
.data-table--report-preview-points .report-preview-col--notes { width: auto; min-width: 10rem; }
.data-table--report-preview-points .report-preview-col--status { width: 1%; min-width: 9.5rem; }
@media (max-width: 899px) {
    .report-preview-points .data-table--report-preview-points {
        min-width: 40rem;
        width: max-content;
    }
}
@media (min-width: 900px) {
    .report-preview-points {
        overflow-x: visible;
    }
    .report-preview-points .data-table--report-preview-points {
        width: 100%;
    }
}
.report-preview-points__pair-total {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
}
.report-preview-empty {
    margin: 0;
}
.slide-panel--report-preview .slide-panel__drawer--wide {
    width: min(1280px, calc(100% - var(--space-6)));
}
.slide-panel--report-preview .report-preview-content {
    max-width: none;
}

/* Normy — nagłówek widoku bez dodatkowych warstw */
.norms-page-head.ds-page-header {
    align-items: flex-start;
    margin-bottom: calc(var(--ds-page-header-gap) - var(--ds-dashboard-gap));
}

/* Tabele modułów — spójna typografia (ewidencja, mierniki, strefy, raporty) */
#esd-app :is(.ds-entity-list-body, .table-card.entity-list).ds-entity-list-view .data-table {
    font-size: var(--ds-entity-font);
    line-height: var(--ds-entity-line);
    color: var(--ds-text);
}
#esd-app :is(.ds-entity-list-body, .table-card.entity-list).ds-entity-list-view .data-table thead th {
    font-size: var(--ds-entity-font-head);
    font-weight: var(--ds-entity-list-head-weight);
    color: var(--ds-text-tertiary);
    line-height: var(--ds-entity-line);
}
#esd-app :is(.ds-entity-list-body, .table-card.entity-list).ds-entity-list-view .data-table tbody td {
    font-size: var(--ds-entity-font);
    font-weight: 400;
    color: var(--ds-text);
    line-height: var(--ds-entity-line);
}
.table-card.entity-list-scroll {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
.entity-list-scroll .data-table {
    min-width: 880px;
}
.schedule-entity-list .data-table {
    min-width: 760px;
    border: none;
}
.schedule-entity-list .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--ds-table-head-bg);
}
.schedule-step--products > .ds-content-inset--scroll {
    flex: 1;
    min-height: 0;
}
.schedule-entity-list.entity-list-scroll .data-table {
    min-width: 760px;
    border: none;
}
.entity-list-scroll .data-table thead th {
    padding-top: var(--ds-table-head-pad-y);
    padding-bottom: var(--ds-table-head-pad-y);
    padding-left: var(--ds-entity-list-pad-x);
    padding-right: var(--ds-entity-list-pad-x);
    background: var(--ds-table-head-bg);
    border: none;
    text-align: left;
}
.entity-list-scroll .data-table tbody td {
    padding-top: var(--ds-entity-row-pad-y);
    padding-bottom: var(--ds-entity-row-pad-y);
    padding-left: var(--ds-entity-list-pad-x);
    padding-right: var(--ds-entity-list-pad-x);
    border: none;
    background: var(--ds-surface);
}
.entity-list-scroll .data-table tbody tr.clickable-row:hover td {
    background: var(--ds-row-hover-bg);
}
.table-card.entity-list-scroll .data-table tbody tr.clickable-row {
    transition: background var(--ds-motion-fast) var(--ds-ease-out);
}
.entity-list-scroll .data-table thead th:first-child,
.entity-list-scroll .data-table thead th:last-child {
    padding-left: var(--ds-entity-list-pad-x);
    padding-right: var(--ds-entity-list-pad-x);
}
.schedule-entity-list.entity-list-scroll .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--ds-table-head-bg);
}
.schedule-select-row--selected td {
    background: var(--ds-brand-tint-10);
}
.table-card:has(> .data-table:not([hidden])):not(.entity-list-scroll):not(.ds-entity-list-body):not(.entity-list) {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    padding: 0;
}
.ds-inset-scroll--host .table-card:has(> .data-table:not([hidden])),
.ds-inset-scroll--host :is(.entity-list, .ds-entity-list-body):has(> .data-table:not([hidden])) {
    overflow: visible !important;
    flex: 0 0 auto;
    min-height: auto;
}
.table-card.entity-list:has(> .data-table:not([hidden])),
.table-card.ds-entity-list-view:has(> .data-table:not([hidden])),
.ds-entity-list-body:has(> .data-table:not([hidden])) {
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table.data-table--products {
    table-layout: auto;
    width: max(100%, var(--ds-entity-table-min-w-products));
    min-width: var(--ds-entity-table-min-w-products);
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table thead tr {
    height: var(--ds-table-head-h);
    min-height: var(--ds-table-head-h);
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table tbody tr {
    height: var(--ds-entity-row-min-h);
    min-height: var(--ds-entity-row-min-h);
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table thead th {
    min-height: var(--ds-table-head-h);
    box-sizing: border-box;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table tbody td {
    min-height: var(--ds-entity-row-min-h);
    box-sizing: border-box;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table.data-table--products col.data-table__col-code { width: var(--ds-products-col-code-w); }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table.data-table--products col.data-table__col-name { width: auto; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table.data-table--products col.data-table__col-location { width: var(--ds-products-col-location-w); }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table.data-table--products col.data-table__col-status { width: var(--ds-products-col-status-w); }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table.data-table--products:not(:has(col.data-table__col-check)) :is(
    thead th.data-table__col-code,
    tbody td.data-table__cell-code
) {
    width: auto;
    min-width: var(--ds-products-col-code-w);
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table.data-table--products:has(col.data-table__col-check) :is(
    thead th.data-table__col-code,
    tbody td.data-table__cell-code
) {
    min-width: var(--ds-products-col-code-w);
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table.data-table--products :is(
    thead th.data-table__col-name,
    tbody td.data-table__cell-name
) {
    min-width: var(--ds-products-col-name-min-w);
    overflow: visible;
    text-overflow: clip;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table.data-table--products :is(
    thead th.data-table__col-location,
    tbody td.data-table__cell-location
) {
    width: auto;
    min-width: var(--ds-products-col-location-w);
    overflow: visible;
    text-overflow: clip;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table.data-table--products :is(
    thead th.data-table__col-status,
    tbody td.data-table__cell-status
) {
    width: auto;
    min-width: var(--ds-products-col-status-w);
    overflow: visible;
    text-overflow: clip;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table.data-table--products :is(
    th.data-table__col-name,
    td.data-table__cell-name,
    th.data-table__col-location,
    td.data-table__cell-location,
    th.data-table__col-status,
    td.data-table__cell-status
) {
    padding-inline: var(--ds-products-col-compact-pad-x);
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table.data-table--products :is(
    td.data-table__cell-name,
    td.data-table__cell-location
) .ds-table-cell__content {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}
#devices-list-container .data-table.data-table--devices,
#locations-list-container .data-table.data-table--locations {
    min-width: var(--ds-entity-table-min-w-devices);
}
#devices-list-container .data-table,
#locations-list-container .data-table,
#reports-list-container .data-table,
#audits-list-container .data-table,
#trash-list-container .data-table {
    min-width: var(--ds-entity-table-min-w);
    table-layout: auto;
    width: max(100%, var(--ds-entity-table-min-w));
}
.view-toolbar.view-toolbar--open {
    position: relative;
    z-index: 40;
}
.view-toolbar.view-toolbar--open:has(.custom-select.open),
.view-toolbar.view-toolbar--open:has(.dropdown-actions.is-open) {
    overflow: visible;
}
.view-toolbar__filters .custom-select.open {
    position: relative;
    z-index: 350;
}
.view-toolbar__filters .custom-select.open .custom-select-options {
    z-index: 400;
}
.ds-actions-menu.is-open {
    z-index: 50;
}
.table-card:not(.entity-list) .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--ds-table-head-bg);
}
.table-card:not(.entity-list) .data-table thead th.ds-row-kebab-cell {
    position: sticky;
    top: 0;
    right: 0;
    z-index: 5;
    background: var(--ds-table-head-bg);
    box-shadow: none;
}
/* Widok listy zasobów — nagłówek przewija się z tabelą (bez sticky) */
:is(.ds-entity-list-body, .table-card.entity-list) .data-table thead th,
:is(.ds-entity-list-body, .table-card.entity-list) .data-table thead th.ds-row-kebab-cell {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    box-shadow: none;
    min-width: 0;
    background: var(--ds-table-head-bg);
}
:is(.ds-entity-list-body, .table-card.entity-list) .data-table thead th.ds-row-kebab-cell {
    width: var(--ds-entity-actions-w);
    min-width: var(--ds-entity-actions-w);
    max-width: var(--ds-entity-actions-w);
    padding-left: var(--ds-entity-actions-pad-x);
    padding-right: var(--ds-row-kebab-pad-end);
    text-align: right;
    overflow: visible;
}
:is(.ds-entity-list-body, .table-card.entity-list) .data-table thead tr {
    background: var(--ds-table-head-bg);
}
:is(.ds-entity-list-body, .table-card.entity-list) .data-table tbody td.ds-row-kebab-cell {
    position: static;
    right: auto;
    z-index: auto;
    box-shadow: none;
}
:is(.ds-entity-list-body, .table-card.entity-list) .data-table tbody td.ds-row-kebab-cell,
:is(.ds-entity-list-body, .table-card.entity-list) .data-table tbody td:last-child {
    overflow: visible;
}
/* ── KOMPONENT: tabela produktów — komórki i status ── */
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table--products:not(:has(col.data-table__col-check)) .data-table__cell-code .ds-table-cell__content {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table--products:has(col.data-table__col-check) .data-table__cell-code .ds-table-cell__content {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table--products thead th {
    overflow: visible;
    text-overflow: clip;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table--products :is(
    th.data-table__col-status,
    td.data-table__cell-status
) {
    overflow: visible;
    text-overflow: clip;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table--products td.data-table__cell-status :is(.badge, .ds-status-badge) {
    white-space: nowrap;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
}
/* ── KOMPONENT: tabela mierników (.data-table--devices) ── */
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--devices col.data-table__col-name { width: 28%; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--devices col.data-table__col-category { width: 18%; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--devices col.data-table__col-date { width: 16%; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--devices :is(
    thead th.data-table__col-name,
    tbody td.data-table__cell-name
) { min-width: 148px; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--devices :is(
    thead th.data-table__col-category,
    tbody td:nth-child(2)
) { min-width: 96px; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--devices :is(
    thead th.data-table__col-date,
    tbody td:nth-child(4)
) { min-width: 132px; }
/* ── KOMPONENT: tabela lokalizacji (.data-table--locations) ── */
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--locations col.data-table__col-category { width: 18%; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--locations col.data-table__col-name { width: 28%; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--locations col.data-table__col-location { width: 22%; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--locations col.data-table__col-contact { width: 22%; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--locations :is(
    thead th.data-table__col-category,
    tbody td:nth-child(1)
) { min-width: 112px; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--locations :is(
    thead th.data-table__col-name,
    tbody td.data-table__cell-name
) { min-width: 148px; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--locations :is(
    thead th.data-table__col-location,
    tbody td:nth-child(3)
) { min-width: 120px; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--locations :is(
    thead th.data-table__col-contact,
    tbody td:nth-child(4)
) { min-width: 140px; }
/* Archiwum (raporty, audyty) — wspólne proporcje kolumn */
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table--archive col.data-table__col-name { width: 50%; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table--archive col.data-table__col-qty { width: 12%; }
/* Kosz — kolumna kod+data (composite); nazwa elastyczna; typ wąski */
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table--trash col.data-table__col-trash-code { width: var(--ds-trash-col-code-date-w); }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table--trash col.data-table__col-name { width: auto; }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view .data-table--trash col.data-table__col-category { width: var(--ds-trash-col-type-w); }
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--trash :is(
    thead th.data-table__col-trash-code,
    tbody td.data-table__cell-trash-code
) {
    width: var(--ds-trash-col-code-date-w);
    min-width: var(--ds-trash-col-code-date-w);
    max-width: var(--ds-trash-col-code-date-w);
    box-sizing: border-box;
    vertical-align: middle;
    white-space: normal;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--trash :is(
    thead th.data-table__col-name,
    tbody td.data-table__cell-name
) {
    width: auto;
    min-width: 12rem;
    max-width: none;
}
:is(.ds-entity-list-body, .entity-list, .entity-list-scroll).ds-entity-list-view:not(.entity-grid) .data-table--trash :is(
    thead th.data-table__col-category,
    tbody td:nth-child(3):not(.ds-row-kebab-cell)
) {
    width: var(--ds-trash-col-type-w);
    min-width: var(--ds-trash-col-type-w);
    max-width: 11rem;
    white-space: nowrap;
}
.ds-trash-code-date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--ds-trash-code-date-gap);
    min-width: 0;
    max-width: 100%;
}
.ds-trash-code-date__code {
    font-size: var(--ds-trash-code-date-code-font);
    font-weight: var(--ds-trash-code-date-code-weight);
    line-height: var(--ds-entity-line);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ds-trash-code-date__date {
    font-size: var(--ds-trash-code-date-date-font);
    font-weight: var(--ds-trash-code-date-date-weight);
    color: var(--ds-trash-code-date-date-color);
    line-height: var(--leading-normal);
    white-space: nowrap;
}
.data-table .data-table__cell-code {
    text-align: left;
    white-space: nowrap;
}
.data-table thead th.data-table__col-code {
    text-align: left;
    white-space: nowrap;
}
.data-table .data-table__cell-strong {
    font-weight: 600;
}
/* Kanoniczne kolumny status / data / akcje — ta sama pozycja we wszystkich tabelach entity-list */
.ds-entity-list-view.entity-list .data-table col.data-table__col-status { width: 15%; }
.ds-entity-list-view.entity-list .data-table col.data-table__col-date { width: 11%; }
.ds-entity-list-view.entity-list .data-table col.data-table__col-kebab { width: var(--ds-entity-actions-w); }
.app-view.entity-view.dashboard-view .entity-list-card .ds-scroll-rail__body {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.app-view.entity-view.dashboard-view .entity-list-card .ds-scroll-rail__body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
/* Kafelki — wybór zasobów (planowanie pomiaru) */
.schedule-entity-card .entity-card__top {
    justify-content: flex-start;
    gap: var(--space-2);
}
.schedule-entity-card__check {
    flex: 0 0 auto;
    margin: 0;
}
.schedule-entity-card .entity-card__top-status {
    margin-left: auto;
}
.schedule-entity-card.schedule-select-row--selected {
    border-color: color-mix(in srgb, var(--ds-primary) 35%, var(--ds-border));
    background: var(--ds-brand-tint-10);
}
.ds-entity-picker-list.entity-grid {
    padding-inline: var(--ds-list-item-pad-x);
}
.ds-row-kebab-cell--empty {
    width: var(--ds-entity-actions-w);
    min-width: var(--ds-entity-actions-w);
    max-width: var(--ds-entity-actions-w);
    overflow: hidden;
    pointer-events: none;
    vertical-align: middle;
}
.ds-row-kebab-cell--empty::before {
    content: "";
    display: block;
    width: var(--ds-entity-row-content-min-h);
    height: var(--ds-entity-row-content-min-h);
    margin-left: auto;
}
/* ── KOMPONENT: row kebab (.ds-row-kebab-cell + .ds-row-kebab)
   Komórka kolumny ⋮ — padding prawy 8px; reszta wiersza bez zmian (16px). ── */
.ds-row-kebab-cell {
    width: var(--ds-row-kebab-col-w);
    min-width: var(--ds-row-kebab-col-w);
    max-width: var(--ds-row-kebab-col-w);
    padding-left: 0;
    padding-right: var(--ds-row-kebab-pad-end);
    text-align: right;
    overflow: visible;
    box-sizing: border-box;
}
.ds-row-kebab {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    margin-left: auto;
}
.ds-row-kebab-cell .ds-row-kebab,
.ds-row-kebab-cell .dropdown-actions {
    justify-content: flex-end;
    margin-left: auto;
}
.table-card.entity-list .data-table tbody td.ds-row-kebab-cell,
.table-card.ds-entity-list-view .data-table tbody td.ds-row-kebab-cell {
    text-align: right;
}
/* table-card — inset krawędzi jak w toolbarze / ds-card */
.table-card .data-table th,
.table-card .data-table td {
    padding-top: var(--ds-entity-row-pad-y);
    padding-bottom: var(--ds-entity-row-pad-y);
    vertical-align: middle;
}
:is(.ds-entity-list-body, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table th,
:is(.ds-entity-list-body, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table td,
.entity-list-scroll .data-table th,
.entity-list-scroll .data-table td {
    padding-left: var(--ds-entity-list-pad-x);
    padding-right: var(--ds-entity-list-pad-x);
    border-left: none;
    border-right: none;
}
:is(.ds-entity-list-body, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table .ds-row-kebab-cell,
.entity-list-scroll .data-table .ds-row-kebab-cell {
    padding-left: 0;
    padding-right: var(--ds-row-kebab-pad-end);
}
:is(.ds-entity-list-body, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table thead th,
.entity-list-scroll .data-table thead th {
    text-align: left;
}
:is(.ds-entity-list-body, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table tbody td,
.entity-list-scroll .data-table tbody td {
    text-align: left;
}
.table-card.entity-list .data-table tbody td.ds-row-kebab-cell,
.table-card.ds-entity-list-view .data-table tbody td.ds-row-kebab-cell,
.ds-entity-list-body .data-table tbody td.ds-row-kebab-cell {
    text-align: right;
}
.table-card:not(.entity-list):not(.ds-entity-list-view) .data-table td:first-child {
    padding-left: 0;
}
.table-card:not(.entity-list):not(.ds-entity-list-view) .data-table td:last-child {
    padding-right: 0;
}
.table-card:not(.entity-list):not(.ds-entity-list-view) .data-table tbody tr.clickable-row td {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}
.table-card:not(.entity-list):not(.ds-entity-list-view) .data-table tbody tr.clickable-row td.ds-row-kebab-cell {
    padding-left: var(--space-2);
    padding-right: var(--ds-row-kebab-pad-end);
    width: 52px;
    text-align: right;
    overflow: visible;
}
.table-card.entity-list,
.table-card.scroll-content {
    box-sizing: border-box;
}
.table-card:not(.entity-list):not(.ds-entity-list-view) .data-table th:not(:first-child):not(:last-child),
.table-card:not(.entity-list):not(.ds-entity-list-view) .data-table td:not(:first-child):not(:last-child) {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}
.data-table tbody tr.clickable-row {
    transition: background 0.12s ease;
    cursor: pointer;
}
.table-card .data-table tbody tr.clickable-row:hover {
    background: var(--ds-row-hover-bg);
}

/* ── KOMPONENT: karta statystyki (stat-card) ── */
.stat-card {
    padding: var(--space-5);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
}
.stat-info h3 { font-size: var(--text-xs); font-weight: 500; margin-bottom: var(--space-2); }
.stat-info p { font-size: var(--text-2xl); font-weight: 600; letter-spacing: -0.03em; }

/* ── Filters panel (legacy override) ── */
.filters-panel {
    border-radius: var(--radius-md);
    padding: var(--space-5);
    border: 1px solid var(--ds-border);
}

/* ── Auth boot (session check) ── */
html:not(.app-authenticated) #main-app,
html:not(.app-authenticated) #mobile-bottom-nav,
html:not(.app-authenticated) #mobile-drawer,
html:not(.app-authenticated) #mobile-drawer-backdrop,
html:not(.app-authenticated) #toast-container,
html:not(.app-authenticated) .modal {
    display: none !important;
}
html.app-authenticated #main-app {
    display: flex;
}
html:not(.app-authenticated) #auth-overlay.is-visible {
    display: flex;
}
html:not(.app-authenticated),
html:not(.app-authenticated) body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: var(--esd-viewport-h-px, 100vh);
    height: auto;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
}
html:not(.app-authenticated) body {
    background: #0c0c0c;
}
#auth-overlay:not(.is-visible) {
    display: none !important;
}

/* ── Widoki aplikacji — routing klasami ── */
.app-view:not(.is-active) {
    display: none !important;
}
.app-view {
    flex-direction: column;
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.app-view.is-active {
    display: flex;
    animation: viewEnter 0.35s ease;
}
.app-view-fill {
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* ── Utility visibility ── */
.is-hidden {
    display: none !important;
}
.is-shown-flex {
    display: flex !important;
}
.is-shown-grid {
    display: grid !important;
}
.empty-state.is-shown {
    display: flex;
}

.text-muted {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.auth-boot {
    position: fixed;
    inset: 0;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: var(--esd-viewport-h-px, 100vh);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-bg, #0c0c0c);
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.56s ease;
}
.auth-boot.is-hiding {
    opacity: 0;
    pointer-events: none;
}
html:not(.app-authenticated):has(#auth-overlay.is-visible) #auth-boot,
html.auth-login-visible #auth-boot {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}
html.auth-login-visible #auth-overlay,
html:not(.app-authenticated) #auth-overlay.is-visible {
    display: flex !important;
    z-index: 10000;
}
.auth-boot__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.auth-boot__logo {
    position: relative;
    z-index: 2;
    opacity: 0.7;
    animation: auth-boot-pulse 1.15s ease-in-out infinite;
}
@keyframes auth-boot-pulse {
    0%, 100% { opacity: 0.45; transform: scale(0.96); }
    50% { opacity: 1; transform: scale(1); }
}

/* ── Auth screens ── */
.auth-overlay {
    color-scheme: dark;
    --auth-bg: #0c0c0c;
    --auth-bg-rgb: 12, 12, 12;
    --ds-surface: rgba(255, 255, 255, 0.1);
    --ds-surface-muted: rgba(255, 255, 255, 0.08);
    --ds-border: rgba(168, 168, 168, 0.34);
    --ds-border-strong: rgba(188, 188, 188, 0.42);
    --ds-text: rgba(245, 245, 245, 0.94);
    --ds-text-tertiary: rgba(245, 245, 245, 0.62);
    --input-bg: rgba(255, 255, 255, 0.1);
    --text-main: rgba(245, 245, 245, 0.94);
    --text-muted: rgba(245, 245, 245, 0.62);
    --border-color: rgba(168, 168, 168, 0.34);
    --border-strong: rgb(255, 207, 51);
    --card-bg: rgba(255, 255, 255, 0.13);
    --auth-brand-rgb: 255, 207, 51;
    --auth-brand-hover-rgb: 255, 217, 102;
    --auth-brand-active-rgb: 230, 186, 46;
    --auth-brand-muted-rgb: 255, 233, 153;
    --auth-brand-light-rgb: 255, 248, 220;
    --auth-content-pad-x: 44px;
    --auth-card-gutter: 2px;
    --auth-card-fill: rgba(0, 0, 0, 0.6);
    --auth-control-radius: var(--radius-sm);
    --auth-input-bg: rgba(12, 12, 12, 0.97);
    --auth-input-bg-focus: rgba(16, 16, 16, 0.98);
    --auth-electric-border-color: var(--ds-brand-cta);
    --auth-electric-light-color: var(--ds-brand-cta-hover);
    --auth-electric-gradient: rgba(var(--auth-brand-rgb), 0.24);
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 100vh;
    min-height: var(--esd-viewport-h-px, 100vh);
    padding: var(--ds-content-pad) var(--ds-content-pad) 0;
    padding-bottom: max(var(--ds-content-pad), env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    box-sizing: border-box;
    background: var(--auth-bg);
    opacity: 1;
}
.auth-overlay.is-visible {
    opacity: 1;
}

/* Tablet / telefon / PWA — bez canvas i ozdobników (migotanie, wydajność) */
@media (max-width: 1080px), (display-mode: standalone), (display-mode: fullscreen) {
    .auth-esd-canvas,
    .auth-card-canvas,
    .auth-overlay .glow-outer,
    .auth-overlay .corner-overlay,
    .auth-overlay .glow-card.auth-card-surface,
    .auth-card-inner,
    .auth-login-splash {
        display: none !important;
    }
    .auth-card-container.glow-card-wrapper {
        box-shadow: none;
    }
}

.auth-esd-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    touch-action: none;
    background: var(--auth-bg);
}
.auth-overlay__vignette {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 52% 88% at 0% 38%, rgba(255, 252, 245, 0.07) 0%, transparent 72%),
        radial-gradient(ellipse 80% 70% at 50% 45%, rgba(var(--auth-bg-rgb), 0) 0%, rgba(var(--auth-bg-rgb), 0.32) 100%),
        linear-gradient(180deg, rgba(var(--auth-bg-rgb), 0.12) 0%, rgba(var(--auth-bg-rgb), 0) 45%, rgba(var(--auth-bg-rgb), 0.22) 100%);
}
.auth-overlay__footer {
    position: static;
    flex-shrink: 0;
    margin-top: auto;
    z-index: 3;
    display: flex;
    justify-content: center;
    width: 100%;
    padding:
        var(--space-4)
        var(--space-6)
        max(var(--space-5), env(safe-area-inset-bottom, 0px));
    pointer-events: none;
}
.auth-overlay__footer-line {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: var(--leading-normal);
    color: rgba(245, 245, 245, 0.62);
    white-space: nowrap;
}
.auth-overlay__footer-tag {
    color: rgba(var(--auth-brand-rgb), 0.52);
    font-weight: 500;
}
.auth-overlay__footer-sep {
    margin: 0 0.55em;
    color: rgba(245, 245, 245, 0.16);
}
.auth-shell {
    position: relative;
    z-index: 2;
    flex: 1 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) calc(var(--auth-grid-step, 32px) * var(--auth-grid-cols, 13));
    grid-template-rows: auto auto;
    gap: var(--space-10);
    width: min(980px, 100%);
    margin-inline: auto;
    align-content: center;
    align-items: center;
    pointer-events: none;
}
.auth-shell > * {
    pointer-events: auto;
}
.auth-brand-intro {
    grid-column: 1;
    grid-row: 1;
    color: #f5f5f5;
    padding: var(--space-4);
    padding-bottom: 0;
}
.auth-login-stack {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    width: calc(var(--auth-grid-step, 32px) * var(--auth-grid-cols, 13));
    max-width: 100%;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
}
.auth-features-panel {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    width: 100%;
    margin: 0;
    padding: 0 var(--space-4) var(--space-4);
    background: none;
    border: none;
    box-shadow: none;
    box-sizing: border-box;
}
.auth-features {
    list-style: none;
    margin: 0;
    padding: var(--space-2) 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    width: 100%;
    align-self: stretch;
    box-sizing: border-box;
    background: none;
    border: none;
}
.auth-features li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    font-size: var(--text-sm);
    font-weight: 500;
    color: rgba(245, 245, 245, 0.62);
}
.auth-features__text {
    flex: 1;
    min-width: 0;
    line-height: var(--leading-normal);
    text-align: left;
}
.auth-card-container.glow-card-wrapper {
    --auth-electric-border-color: var(--ds-brand-cta);
    --auth-electric-light-color: var(--ds-brand-cta-hover);
    --auth-card-bg: var(--auth-bg);
    --auth-glow-line: rgba(var(--auth-brand-light-rgb), 0.95);
    --auth-glow-accent: var(--ds-brand-cta);
    position: relative;
    display: grid;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    padding: 2px;
    border-radius: 24px;
    overflow: visible;
    background: transparent;
    box-sizing: border-box;
}
.auth-card-container.glow-card-wrapper > * {
    grid-area: 1 / 1;
}
.auth-card-surface.glow-card {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 100%;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
    background-color: var(--auth-card-fill);
    background-image:
        radial-gradient(ellipse 135% 125% at 0% 0%,
            rgba(var(--auth-brand-rgb), 0.26) 0%,
            rgba(var(--auth-brand-rgb), 0.15) 18%,
            rgba(var(--auth-brand-rgb), 0.09) 34%,
            rgba(var(--auth-brand-rgb), 0.055) 48%,
            rgba(var(--auth-brand-rgb), 0.03) 62%,
            rgba(var(--auth-brand-rgb), 0.015) 76%,
            rgba(var(--auth-brand-rgb), 0.006) 88%,
            rgba(var(--auth-brand-rgb), 0) 98%),
        radial-gradient(ellipse 135% 125% at 100% 100%,
            rgba(var(--auth-brand-rgb), 0.26) 0%,
            rgba(var(--auth-brand-rgb), 0.15) 18%,
            rgba(var(--auth-brand-rgb), 0.09) 34%,
            rgba(var(--auth-brand-rgb), 0.055) 48%,
            rgba(var(--auth-brand-rgb), 0.03) 62%,
            rgba(var(--auth-brand-rgb), 0.015) 76%,
            rgba(var(--auth-brand-rgb), 0.006) 88%,
            rgba(var(--auth-brand-rgb), 0) 98%);
}
.glow-inner {
    position: absolute;
    width: 300px;
    height: 300px;
    pointer-events: none;
    filter: blur(20px);
}
.glow-inner-tl {
    top: -1px;
    left: -1px;
    background: radial-gradient(ellipse 115% 115% at 0% 0%,
        rgba(var(--auth-brand-rgb), 0.24) 0%,
        rgba(var(--auth-brand-rgb), 0.13) 26%,
        rgba(var(--auth-brand-rgb), 0.07) 44%,
        rgba(var(--auth-brand-rgb), 0.035) 58%,
        rgba(var(--auth-brand-rgb), 0.018) 72%,
        rgba(var(--auth-brand-rgb), 0.008) 84%,
        rgba(var(--auth-brand-rgb), 0) 96%);
}
.glow-inner-br {
    bottom: -1px;
    right: -1px;
    background: radial-gradient(ellipse 115% 115% at 100% 100%,
        rgba(var(--auth-brand-rgb), 0.24) 0%,
        rgba(var(--auth-brand-rgb), 0.13) 26%,
        rgba(var(--auth-brand-rgb), 0.07) 44%,
        rgba(var(--auth-brand-rgb), 0.035) 58%,
        rgba(var(--auth-brand-rgb), 0.018) 72%,
        rgba(var(--auth-brand-rgb), 0.008) 84%,
        rgba(var(--auth-brand-rgb), 0) 96%);
}
.glow-outer {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
}
.glow-tl-lg {
    top: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(ellipse 50% 50% at 22% 22%,
        rgba(var(--auth-brand-rgb), 0.22) 0%,
        rgba(var(--auth-brand-rgb), 0.07) 50%,
        transparent 72%);
    filter: blur(30px);
}
.glow-tl-md {
    top: -30px;
    left: -30px;
    width: 180px;
    height: 180px;
    background: radial-gradient(ellipse 55% 55% at 20% 20%,
        rgba(var(--auth-brand-rgb), 0.45) 0%,
        rgba(var(--auth-brand-rgb), 0.15) 45%,
        transparent 70%);
    filter: blur(18px);
}
.glow-tl-sm {
    top: -12px;
    left: -12px;
    width: 100px;
    height: 100px;
    background: radial-gradient(ellipse 60% 60% at 18% 18%,
        rgba(var(--auth-brand-rgb), 0.7) 0%,
        rgba(var(--auth-brand-rgb), 0.25) 40%,
        transparent 65%);
    filter: blur(8px);
}
.glow-br-lg {
    bottom: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(ellipse 50% 50% at 78% 78%,
        rgba(var(--auth-brand-rgb), 0.22) 0%,
        rgba(var(--auth-brand-rgb), 0.07) 50%,
        transparent 72%);
    filter: blur(30px);
}
.glow-br-md {
    bottom: -30px;
    right: -30px;
    width: 180px;
    height: 180px;
    background: radial-gradient(ellipse 55% 55% at 80% 80%,
        rgba(var(--auth-brand-rgb), 0.45) 0%,
        rgba(var(--auth-brand-rgb), 0.15) 45%,
        transparent 70%);
    filter: blur(18px);
}
.glow-br-sm {
    bottom: -12px;
    right: -12px;
    width: 100px;
    height: 100px;
    background: radial-gradient(ellipse 60% 60% at 82% 82%,
        rgba(var(--auth-brand-rgb), 0.7) 0%,
        rgba(var(--auth-brand-rgb), 0.25) 40%,
        transparent 65%);
    filter: blur(8px);
}
.corner-overlay {
    position: absolute;
    width: 120px;
    height: 120px;
    pointer-events: none;
    z-index: 10;
}
.corner-tl { top: 0; left: 0; }
.corner-tr { top: 0; right: 0; }
.corner-bl { bottom: 0; left: 0; }
.corner-br { bottom: 0; right: 0; }
.corner-tl .corner-line-h {
    position: absolute;
    top: 0;
    left: 20px;
    width: calc(100% - 20px);
    height: 2px;
    background: linear-gradient(to right,
        var(--auth-glow-line) 0%,
        var(--auth-glow-accent) 10%,
        rgba(var(--auth-brand-rgb), 0.45) 50%,
        transparent 100%);
    filter: drop-shadow(0 0 3px var(--auth-glow-accent)) drop-shadow(0 0 8px rgba(var(--auth-brand-rgb), 0.8));
}
.corner-br .corner-line-h {
    position: absolute;
    bottom: 0;
    right: 20px;
    width: calc(100% - 20px);
    height: 2px;
    background: linear-gradient(to left,
        var(--auth-glow-line) 0%,
        var(--auth-glow-accent) 10%,
        rgba(var(--auth-brand-rgb), 0.45) 50%,
        transparent 100%);
    filter: drop-shadow(0 0 3px var(--auth-glow-accent)) drop-shadow(0 0 8px rgba(var(--auth-brand-rgb), 0.8));
}
.corner-tr .corner-line-h {
    position: absolute;
    top: 0;
    right: 20px;
    width: calc(100% - 20px);
    height: 1px;
    background: linear-gradient(to left,
        rgba(var(--auth-brand-rgb), 0.24) 0%,
        rgba(var(--auth-brand-rgb), 0.12) 28%,
        transparent 100%);
    filter: none;
}
.corner-bl .corner-line-h {
    position: absolute;
    bottom: 0;
    left: 20px;
    width: calc(100% - 20px);
    height: 1px;
    background: linear-gradient(to right,
        rgba(var(--auth-brand-rgb), 0.24) 0%,
        rgba(var(--auth-brand-rgb), 0.12) 28%,
        transparent 100%);
    filter: none;
}
.corner-tl .corner-line-v {
    position: absolute;
    top: 20px;
    left: 0;
    width: 2px;
    height: calc(100% - 20px);
    background: linear-gradient(to bottom,
        var(--auth-glow-line) 0%,
        var(--auth-glow-accent) 10%,
        rgba(var(--auth-brand-rgb), 0.45) 50%,
        transparent 100%);
    filter: drop-shadow(0 0 3px var(--auth-glow-accent)) drop-shadow(0 0 8px rgba(var(--auth-brand-rgb), 0.8));
}
.corner-br .corner-line-v {
    position: absolute;
    bottom: 20px;
    right: 0;
    width: 2px;
    height: calc(100% - 20px);
    background: linear-gradient(to top,
        var(--auth-glow-line) 0%,
        var(--auth-glow-accent) 10%,
        rgba(var(--auth-brand-rgb), 0.45) 50%,
        transparent 100%);
    filter: drop-shadow(0 0 3px var(--auth-glow-accent)) drop-shadow(0 0 8px rgba(var(--auth-brand-rgb), 0.8));
}
.corner-tr .corner-line-v {
    position: absolute;
    top: 20px;
    right: 0;
    width: 1px;
    height: calc(100% - 20px);
    background: linear-gradient(to bottom,
        rgba(var(--auth-brand-rgb), 0.24) 0%,
        rgba(var(--auth-brand-rgb), 0.12) 28%,
        transparent 100%);
    filter: none;
}
.corner-bl .corner-line-v {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 1px;
    height: calc(100% - 20px);
    background: linear-gradient(to top,
        rgba(var(--auth-brand-rgb), 0.24) 0%,
        rgba(var(--auth-brand-rgb), 0.12) 28%,
        transparent 100%);
    filter: none;
}
.corner-tl .corner-arc {
    position: absolute;
    top: 0;
    left: 0;
}
.corner-tr .corner-arc {
    position: absolute;
    top: 0;
    right: 0;
}
.corner-bl .corner-arc {
    position: absolute;
    bottom: 0;
    left: 0;
}
.corner-br .corner-arc {
    position: absolute;
    bottom: 0;
    right: 0;
}
.corner-arc path {
    stroke: var(--auth-glow-line);
    filter: drop-shadow(0 0 3px var(--auth-glow-accent)) drop-shadow(0 0 9px rgba(var(--auth-brand-rgb), 1));
}
.corner-tr .corner-arc path,
.corner-bl .corner-arc path {
    stroke: rgba(var(--auth-brand-rgb), 0.26);
    stroke-width: 1.5;
    filter: none;
}
.auth-brand-head {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}
.auth-brand-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin: 0;
}
.auth-brand-logo__img {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.auth-brand__eyebrow {
    display: none;
}
.auth-brand-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--ds-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.auth-brand-icon .material-symbols-outlined { font-size: 26px; }
.auth-brand-intro h1,
.auth-brand-head h1 {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: var(--leading-tight);
    color: #f5f5f5;
}
.auth-brand__lead {
    margin: 0;
    max-width: 420px;
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    color: rgba(245, 245, 245, 0.62);
}
.auth-features__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    box-shadow: none;
    align-self: center;
}
.auth-features__icon .material-symbols-outlined {
    flex-shrink: 0;
    width: auto;
    height: auto;
    margin: 0;
    font-size: var(--text-md);
    line-height: 1;
    color: rgb(var(--auth-brand-rgb));
}
.auth-login-splash {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--auth-bg, #0c0c0c);
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.42s ease;
    pointer-events: none;
}
.auth-login-splash.is-visible {
    display: flex;
}
.auth-login-splash.is-hiding {
    opacity: 0;
}
.auth-login-splash__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.auth-login-splash__logo {
    position: relative;
    z-index: 2;
    opacity: 0.7;
    animation: auth-boot-pulse 1.15s ease-in-out infinite;
}
.auth-card-inner {
    position: relative;
    z-index: 11;
    min-height: 100%;
    width: 100%;
    pointer-events: none;
    overflow: visible;
}
.auth-card-canvas-wrap {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: none;
}
.auth-card-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.auth-card-content {
    position: relative;
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-self: center;
    width: 100%;
    padding: 48px var(--auth-content-pad-x);
    color: #f5f5f5;
    pointer-events: auto;
    background: transparent;
    box-sizing: border-box;
}
.auth-card-content h2 {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #f5f5f5;
}
.auth-card__header {
    text-align: center;
    margin-bottom: var(--space-6);
}
.auth-subtitle {
    margin: var(--space-2) 0 0;
    font-size: var(--text-sm);
    color: rgba(245, 245, 245, 0.52);
    line-height: var(--leading-relaxed);
}
.auth-card-content .auth-form-group,
.auth-card-content .form-group { margin-bottom: var(--space-4); }
.auth-card-content .auth-form-group label,
.auth-card-content .form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-family: var(--ds-type-family);
    font-size: var(--ds-type-label-size);
    font-weight: var(--ds-type-label-weight);
    line-height: var(--ds-type-line-body);
    color: rgba(245, 245, 245, 0.62);
}
#auth-overlay #login-form input,
#auth-overlay #login-form .password-field input,
#auth-overlay .auth-login-input,
#auth-overlay .auth-form-group .auth-login-input,
#auth-overlay .form-group .auth-login-input {
    width: 100%;
    padding: 11px 12px;
    font: 16px/1.35 var(--font-ui);
    font-size: 16px;
    line-height: 1.35;
    min-height: 0;
    height: auto;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    border-radius: var(--auth-control-radius);
    border: 1px solid rgba(168, 168, 168, 0.34);
    background: var(--auth-input-bg);
    color: rgba(245, 245, 245, 0.94);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    box-shadow: none;
    box-sizing: border-box;
    animation: authLoginInputTextFix 0.01ms both;
    transition:
        border-color 0.22s ease,
        background-color 0.22s ease,
        box-shadow 0.22s ease;
}
@keyframes authLoginInputTextFix {
    from, to {
        font-size: 16px;
        line-height: 1.35;
    }
}
#auth-overlay #login-form input::placeholder {
    color: rgba(168, 168, 168, 0.72);
    font-size: 16px;
}
#auth-overlay #login-form input:-webkit-autofill,
#auth-overlay #login-form input:-webkit-autofill:hover,
#auth-overlay #login-email:-webkit-autofill,
#auth-overlay #login-password:-webkit-autofill {
    -webkit-text-fill-color: rgba(245, 245, 245, 0.94);
    caret-color: rgba(245, 245, 245, 0.94);
    font-size: 16px;
    line-height: 1.35;
    border-color: rgba(168, 168, 168, 0.34);
    box-shadow: 0 0 0 1000px rgba(14, 14, 14, 0.98) inset;
    transition: background-color 99999s ease-out 0s;
}
#auth-overlay #login-form input:focus,
#auth-overlay #login-form input:focus-visible,
#auth-overlay #login-form .password-field input:focus,
#auth-overlay #login-form .password-field input:focus-visible {
    border-color: rgb(var(--auth-brand-rgb));
    background: var(--auth-input-bg-focus);
    font-size: 16px;
    box-shadow: 0 0 0 2px color-mix(in srgb, rgb(var(--auth-brand-rgb)) 20%, transparent);
    outline: none;
}
#auth-overlay #login-form input:-webkit-autofill:focus,
#auth-overlay #login-email:-webkit-autofill:focus,
#auth-overlay #login-password:-webkit-autofill:focus {
    -webkit-text-fill-color: rgba(245, 245, 245, 0.94);
    font-size: 16px;
    border-color: rgb(var(--auth-brand-rgb));
    box-shadow:
        0 0 0 1000px rgba(14, 14, 14, 0.98) inset,
        0 0 0 2px color-mix(in srgb, rgb(var(--auth-brand-rgb)) 20%, transparent);
}
.auth-card-content .password-field {
    position: relative;
    display: block;
    width: 100%;
}
.auth-card-content .password-field input,
.auth-card-content .password-field .auth-login-input {
    display: block;
    width: 100%;
    padding-right: 44px;
    box-sizing: border-box;
}
.auth-card-content .password-field::after {
    content: "";
    position: absolute;
    top: 1px;
    right: 40px;
    width: 20px;
    height: calc(100% - 2px);
    pointer-events: none;
    z-index: 5;
    border-radius: 0;
    background: linear-gradient(90deg, rgba(12, 12, 12, 0) 0%, var(--auth-input-bg) 100%);
}
.auth-card-content .password-field:focus-within::after {
    background: linear-gradient(90deg, rgba(16, 16, 16, 0) 0%, var(--auth-input-bg-focus) 100%);
}
.auth-card-content .password-toggle {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    z-index: 10;
    width: 36px;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    border: none;
    background: var(--auth-input-bg);
    color: rgba(120, 120, 120, 0.92);
    border-radius: 0 var(--auth-control-radius) var(--auth-control-radius) 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: none;
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    -webkit-tap-highlight-color: transparent;
}
.auth-card-content .password-field:focus-within .password-toggle {
    background: var(--auth-input-bg-focus);
}
.auth-card-content .password-toggle:hover {
    background: var(--auth-input-bg-focus);
    color: rgba(245, 245, 245, 0.82);
}
.auth-card-content .password-toggle:focus-visible {
    outline: 2px solid rgba(var(--auth-brand-rgb), 0.48);
    outline-offset: 1px;
}
.auth-card-content .password-toggle .material-symbols-outlined {
    font-size: 22px;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}
.auth-card-content #login-form .auth-form-group:has(.password-field) {
    margin-bottom: var(--space-2);
}
.auth-card-content .btn-primary.btn-block,
.auth-card-content .auth-login-submit,
#auth-overlay #login-form button[type="submit"].btn-primary {
    position: relative;
    width: 100%;
    margin-top: var(--space-6);
    min-height: 44px;
    border-radius: var(--auth-control-radius);
    font-size: var(--text-sm);
    font-weight: 600;
    background: rgb(var(--auth-brand-rgb));
    border-color: rgb(var(--auth-brand-active-rgb));
    color: #1a1a1a;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.32),
        0 0 18px rgba(var(--auth-brand-rgb), 0.28);
    animation: auth-login-btn-pulse 2.6s ease-in-out infinite;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease,
        filter 0.16s ease;
}
@keyframes auth-login-btn-pulse {
    0%, 100% {
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.32),
            0 0 14px rgba(var(--auth-brand-rgb), 0.24),
            0 0 0 0 rgba(var(--auth-brand-rgb), 0);
    }
    50% {
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.32),
            0 0 30px rgba(var(--auth-brand-rgb), 0.5),
            0 0 0 2px var(--ds-brand-tint-18);
    }
}
.auth-card-content .btn-primary.btn-block:hover:not(:disabled),
.auth-card-content .auth-login-submit:hover:not(:disabled),
#auth-overlay #login-form button[type="submit"].btn-primary:hover:not(:disabled) {
    animation: none;
    background: rgb(var(--auth-brand-hover-rgb));
    border-color: rgb(var(--auth-brand-hover-rgb));
    color: #111;
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.28),
        0 0 28px rgba(var(--auth-brand-rgb), 0.62),
        0 0 0 2px rgba(var(--auth-brand-rgb), 0.38);
}
.auth-card-content .btn-primary.btn-block:active:not(:disabled),
.auth-card-content .auth-login-submit:active:not(:disabled),
#auth-overlay #login-form button[type="submit"].btn-primary:active:not(:disabled) {
    animation: none;
    background: rgb(var(--auth-brand-active-rgb));
    border-color: rgb(var(--auth-brand-active-rgb));
    color: #111;
    filter: none;
    transform: translateY(0) scale(0.98);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.32),
        0 0 16px rgba(var(--auth-brand-rgb), 0.34);
}
.auth-card-content .btn-primary.btn-block:focus-visible,
.auth-card-content .auth-login-submit:focus-visible,
#auth-overlay #login-form button[type="submit"].btn-primary:focus-visible {
    animation: none;
    outline: 2px solid rgba(var(--auth-brand-rgb), 0.72);
    outline-offset: 2px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.32),
        0 0 24px rgba(var(--auth-brand-rgb), 0.46),
        0 0 0 3px rgba(var(--auth-brand-rgb), 0.22);
}
.auth-card-content .auth-login-submit:disabled,
#auth-overlay #login-form button[type="submit"].btn-primary:disabled {
    opacity: 0.72;
    cursor: wait;
    transform: none;
    filter: none;
    animation: none;
}
.auth-forgot-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}
.auth-forgot-divider__line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}
.auth-forgot-divider__link {
    flex-shrink: 0;
    color: rgba(245, 245, 245, 0.38);
    font-size: var(--text-xs);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}
.auth-forgot-divider__link:hover {
    color: rgba(245, 245, 245, 0.62);
    text-decoration: none;
}
.auth-error {
    margin: var(--space-3) 0 0;
    min-height: 0;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ds-danger);
}
.auth-error:empty {
    margin: 0;
}

@media (max-width: 1080px) {
    .auth-overlay {
        --auth-pad-x: var(--ds-content-pad);
        --auth-inner-pad-x: calc(var(--auth-card-gutter) + var(--auth-content-pad-x));
        --auth-card-fixed-width: calc(var(--auth-grid-step, 32px) * var(--auth-grid-cols, 13));
        padding:
            max(40px, env(safe-area-inset-top, 0px))
            var(--auth-pad-x)
            0;
    }
    .auth-shell {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        flex: 1 0 auto;
        width: 100%;
        max-width: 100%;
        min-height: 0;
        margin-inline: auto;
        gap: var(--space-5);
    }
    .auth-brand-intro {
        order: 1;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        text-align: center;
    }
    .auth-brand-head {
        justify-content: center;
        align-items: center;
        margin-bottom: var(--space-3);
    }
    .auth-brand-logo {
        width: 40px;
        height: 40px;
    }
    .auth-brand-logo__img {
        width: 40px;
        height: 40px;
    }
    .auth-brand-intro h1,
    .auth-brand-head h1 {
        font-size: var(--text-lg);
    }
    .auth-brand__lead {
        width: 100%;
        max-width: none;
        margin: 0 auto var(--space-6);
        padding-bottom: var(--space-2);
        text-align: center;
        font-size: var(--text-md);
        line-height: 1.55;
    }
    .auth-login-stack {
        order: 2;
        width: var(--auth-card-fixed-width);
        max-width: 100%;
        margin: 0 auto;
        align-self: center;
    }
    .auth-features-panel {
        order: 3;
        grid-column: auto;
        grid-row: auto;
        width: var(--auth-card-fixed-width);
        max-width: 100%;
        margin: var(--space-4) auto 0;
        padding: 0;
        align-self: center;
    }
    .auth-features {
        padding-top: var(--space-4);
    }
    .auth-card-container {
        order: unset;
        grid-column: auto;
        grid-row: auto;
        width: 100%;
        max-width: 100%;
        margin: 0;
        align-self: stretch;
    }
    .auth-card-content {
        padding: 52px var(--auth-content-pad-x);
    }
    .auth-features__icon {
        width: 30px;
        height: 30px;
        margin: 0;
        border-radius: 9px;
        background: rgba(255, 255, 255, 0.04);
        border: none;
        box-shadow: none;
    }
    .auth-features__icon .material-symbols-outlined {
        font-size: var(--text-md);
        color: rgb(var(--auth-brand-rgb));
    }
    .auth-overlay__footer-line {
        white-space: normal;
        text-align: center;
        line-height: 1.6;
    }
}

@media (max-width: 640px) {
    .auth-overlay {
        --auth-pad-x: 40px;
        padding-inline:
            max(40px, env(safe-area-inset-left, 0px))
            max(40px, env(safe-area-inset-right, 0px));
    }
    .auth-login-stack,
    .auth-features-panel {
        width: 100%;
        max-width: 100%;
        align-self: stretch;
    }
}

/* Tablet — logowanie: stabilna wysokość, przewijalna treść (pasek przeglądarki / landscape) */
@media (min-width: 641px) and (max-width: 1080px) {
    .auth-overlay {
        --auth-pad-x: var(--ds-content-pad);
        padding:
            max(24px, env(safe-area-inset-top, 0px))
            max(var(--auth-pad-x), env(safe-area-inset-right, 0px))
            max(16px, env(safe-area-inset-bottom, 0px))
            max(var(--auth-pad-x), env(safe-area-inset-left, 0px));
        justify-content: flex-start;
    }
    .auth-shell {
        justify-content: flex-start;
        padding-block: var(--space-4);
        flex: 1 0 auto;
    }
    .auth-login-stack,
    .auth-features-panel {
        width: min(var(--auth-card-fixed-width, 416px), 100%);
        max-width: 100%;
    }
    .auth-card-content {
        padding: 40px var(--auth-content-pad-x);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-esd-canvas,
    .auth-card-canvas { display: none; }
    .glow-outer,
    .glow-inner,
    .corner-overlay,
    .auth-login-splash { display: none !important; }
    .auth-overlay { background: linear-gradient(160deg, var(--auth-bg) 0%, #090909 55%, var(--auth-bg) 100%); }
    .auth-boot,
    .auth-overlay {
        transition: none;
    }
    .auth-card-content .btn-primary.btn-block {
        animation: none;
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.32),
            0 0 18px rgba(var(--auth-brand-rgb), 0.34);
    }
}

.kpi-card__hint { font-size: var(--text-2xs); line-height: var(--leading-relaxed); }
.kpi-card__hint strong { font-weight: 600; color: var(--ds-text-secondary); }

/* ── Sidebar refinement ── */
.sidebar {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--space-4) var(--space-3) var(--ds-content-pad);
    width: 232px;
    min-width: 232px;
    z-index: 10;
    box-shadow: none;
    border-right: 1px solid var(--ds-border);
    background: var(--sidebar-bg);
    box-sizing: border-box;
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    padding: var(--space-2) var(--space-3) var(--space-4);
    height: var(--sidebar-brand-block-h);
    min-height: var(--sidebar-brand-block-h);
    max-height: var(--sidebar-brand-block-h);
    box-sizing: border-box;
}
.sidebar-header .brand-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ds-text);
    white-space: nowrap;
    line-height: 1.1;
}
.sidebar-header .logo-mark.brand-logo-slot {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-header .brand-logo-slot__img {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
}
.sidebar-header > div:last-child {
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    transition:
        opacity var(--ds-motion-mid) var(--ds-ease-out),
        max-width var(--ds-motion-mid) var(--ds-ease-out);
    max-width: 140px;
    opacity: 1;
}
.nav-item__text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.25;
    transition:
        opacity var(--ds-motion-mid) var(--ds-ease-out),
        max-width var(--ds-motion-mid) var(--ds-ease-out);
    max-width: 160px;
    opacity: 1;
}
.nav-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    height: var(--nav-rail-item-h);
    min-height: var(--nav-rail-item-h);
    max-height: var(--nav-rail-item-h);
    padding: 0 var(--nav-rail-item-px);
    margin: 0;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
}
.nav-item .material-symbols-outlined {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--sidebar-text);
}
.nav-divider {
    height: 1px;
    background: var(--ds-border);
    margin: var(--space-2) var(--space-1);
    flex-shrink: 0;
    border: none;
}
/* Wspólna siatka wierszy — menu główne i menu ustawień (nadpisanie kaskady) */
.sidebar-nav > .nav-item:not(.logout),
.account-side-nav__list > .nav-item,
.account-side-nav__list > .account-side-nav__item,
.account-side-nav__foot > .nav-item:not(.logout) {
    height: var(--nav-rail-item-h);
    min-height: var(--nav-rail-item-h);
    max-height: var(--nav-rail-item-h);
    padding: 0 var(--nav-rail-item-px);
    margin: 0;
    border: 1px solid transparent;
    box-sizing: border-box;
}
.sidebar-nav > .nav-item:first-child {
    margin-top: 0;
}
.sidebar-nav,
.account-side-nav__list {
    gap: var(--nav-rail-item-gap);
}
.account-side-nav {
    padding-top: var(--nav-rail-first-offset);
}
.sidebar-nav {
    padding-top: var(--nav-rail-first-offset);
}
.nav-item:hover { color: var(--sidebar-text-active); }
.nav-item:hover .material-symbols-outlined { color: var(--sidebar-text-active); }
.nav-item.active {
    background: #FFCF33;
    color: #1A1A1A;
}
.nav-item.active .material-symbols-outlined { color: #1A1A1A; }
/* Focus w scrollowanych listach — inset ring (outline + offset jest przycinany przez overflow) */
.nav-item:focus-visible,
.account-side-nav__list > .account-side-nav__item:focus-visible,
.norms-nav__item:focus-visible,
.norms-group-pill:focus-visible,
.norms-product-chip:focus-visible,
.classif-tabs__item:focus-visible,
.settings-nav-link:focus-visible,
.mobile-bottom-nav__item:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring);
}
.nav-item.active:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring-on-fill);
}
.sidebar-header { padding: var(--space-2) var(--space-3) var(--space-4); }
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--nav-rail-item-gap);
    overflow-y: auto;
    min-height: 0;
    padding-top: var(--nav-rail-first-offset);
}
.sidebar-nav > .nav-item:first-child { margin-top: 0; }
.nav-item.logout {
    margin-top: auto;
    margin-bottom: 0;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    padding: 0 12px;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--sidebar-text);
    border: 1px solid transparent;
    background: transparent;
}
.nav-item.logout .material-symbols-outlined,
.nav-item.logout .nav-item__text {
    color: var(--sidebar-text);
}
.nav-item.logout .material-symbols-outlined {
    font-size: 20px;
}

.user-profile {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    padding: 0 0 0 var(--space-2) !important;
    border: none !important;
    background: transparent !important;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
    transition: none !important;
    transform: none !important;
    flex-shrink: 0;
    box-sizing: border-box;
}
.user-profile:hover,
.user-profile:focus:not(:focus-visible),
.user-profile:active,
.user-profile--active,
.user-profile--active:hover,
.user-profile--active:focus:not(:focus-visible),
.user-profile--active:active {
    background: transparent !important;
    padding: 0 0 0 var(--space-2) !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    transform: none !important;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
}
.user-profile:focus-visible,
.user-profile--active:focus-visible {
    background: transparent !important;
    padding: 0 0 0 var(--space-2) !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    transform: none !important;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
}
.user-profile:focus-visible .avatar,
.user-profile--active:focus-visible .avatar {
    box-shadow: var(--ds-focus-ring) !important;
}
.user-profile .avatar,
.user-profile:hover .avatar,
.user-profile:focus .avatar,
.user-profile:active .avatar,
.user-profile--active .avatar,
.user-profile--active:hover .avatar {
    transform: none !important;
    transition: none !important;
}
.user-profile--active .user-profile__name { color: var(--ds-text); font-weight: 600; }
.user-profile--active .avatar {
    background: var(--ds-surface-muted);
    color: var(--ds-text-secondary);
    box-shadow: none;
    border-color: var(--ds-border);
}
.user-profile--active #topbar-avatar-placeholder { color: var(--ds-text-secondary); }
.user-profile--active .avatar:has(img:not([hidden])) {
    background: var(--ds-surface);
    border-color: var(--ds-border);
}
.user-profile__name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 40px;
}
.user-profile .avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
    font-size: 18px;
    background: var(--ds-surface-muted);
    color: var(--ds-text-secondary);
    border: 1px solid var(--ds-border);
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    transition: border-color var(--ds-motion-fast) var(--ds-ease-out);
    transform: none;
    box-sizing: border-box;
}
.user-profile:hover .avatar {
    background: var(--ds-surface-muted);
    color: var(--ds-text-secondary);
    border-color: #FFCF33;
    box-shadow: none;
}
.user-profile .avatar img,
.user-profile .avatar .material-symbols-outlined {
    grid-area: 1 / 1;
}
.user-profile .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    transition: none;
    transform: none;
}
.user-profile .avatar img[hidden] {
    display: none !important;
}
.user-profile .avatar .material-symbols-outlined {
    font-size: 22px;
    line-height: 1;
}
.user-profile .avatar .material-symbols-outlined[hidden] {
    display: none !important;
}
.user-profile .avatar:has(img:not([hidden])) .material-symbols-outlined {
    display: none !important;
}

/* ── Topbar ── */
.topbar {
    position: relative;
    z-index: 1000;
    overflow: visible;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    flex-shrink: 0;
    padding: var(--ds-header-pad-y) var(--ds-dashboard-shell-pad-x);
    background: var(--ds-surface);
    border-bottom: 1px solid var(--ds-border);
    box-sizing: border-box;
}
.topbar .global-search {
    height: var(--ds-search-h);
    min-height: var(--ds-search-h);
    padding: 0 var(--ds-search-pad-x);
}
.topbar .global-search:hover:not(:focus-within) {
    border-color: var(--ds-interactive-hover-border);
}
.topbar .global-search:focus-within {
    border: 1px solid var(--ds-interactive-focus-border);
    box-shadow: var(--ds-interactive-focus-ring);
    background: var(--ds-surface);
}
.topbar .global-search .material-symbols-outlined { font-size: var(--ds-search-icon-size); }
.topbar .global-search input { font-size: var(--ds-type-input-size); font-weight: var(--ds-type-input-weight); }
.topbar-search-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 480px;
}
.topbar-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    margin-inline-end: var(--space-5);
}
.topbar-brand[hidden] { display: none !important; }
.topbar-brand__frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: min(180px, 36vw);
    height: 38px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}
.topbar-brand img {
    display: block;
    max-height: 32px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center center;
}

/* Topbar layout — sloty (display/gap w bazowej regule .topbar powyżej) */
.topbar__slot--brand:not(:has(.topbar-brand:not([hidden]))) {
    display: none;
    width: 0;
    min-width: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}
.topbar__slot {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}
.topbar__slot--brand {
    flex-shrink: 0;
    gap: var(--space-3);
}
.topbar__desktop-search {
    flex: 1;
    min-width: 0;
    max-width: 480px;
}
.topbar:has(.topbar-brand:not([hidden])) .topbar__desktop-search {
    flex: 1;
    max-width: 480px;
}
.topbar__slot--actions {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    margin-left: auto;
    overflow: visible;
}
.topbar__mobile-only { display: none !important; }
.topbar__desktop-bar {
    display: flex;
    flex: 1;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}
.topbar__desktop-only { display: inline-flex; }
.topbar__desktop-only.user-profile { display: flex; }
.topbar__menu-btn { display: none !important; }

.topbar__mobile-bar {
    display: none;
    position: relative;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-width: 0;
}
.topbar__mobile-brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-width: 0;
    max-width: calc(100% - 200px);
    overflow: hidden;
    padding: 0 var(--space-1);
    pointer-events: none;
    z-index: 1;
}
.topbar__mobile-brand .topbar-app-mark__logo {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.topbar__mobile-brand .topbar-app-mark__title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
}
.topbar__mobile-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-1);
    flex-shrink: 0;
    margin-left: auto;
    overflow: visible;
    position: relative;
    z-index: 2;
}
.topbar__mobile-actions .notif-btn-wrap {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    overflow: visible;
    z-index: 2;
}
.topbar-notif-badge--mobile,
#notif-count-badge-mobile.topbar-notif-badge {
    background: var(--ds-danger) !important;
    color: #fff !important;
    border-color: var(--ds-surface) !important;
}
.topbar-notif-badge--mobile {
    top: -5px;
    right: -5px;
    z-index: 12;
}
.topbar__mobile-lead,
.topbar__mobile-actions .icon-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

@media (min-width: 1081px) {
    .topbar__mobile-only,
    .topbar__mobile-bar,
    .topbar__menu-btn {
        display: none !important;
    }
    .topbar__desktop-only { display: inline-flex !important; }
    .topbar__desktop-only.user-profile { display: flex !important; }
    #mobile-fab-menu {
        display: none !important;
        pointer-events: none !important;
    }
}
.topbar-app-mark {
    display: none;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 0;
}
.topbar-app-mark:not([hidden]) {
    display: inline-flex;
}
.topbar-app-mark__logo {
    flex-shrink: 0;
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
}
.topbar-app-mark__title {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ds-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}
.topbar-brand:not([hidden]) ~ .topbar-app-mark,
.topbar__slot--brand:has(.topbar-brand:not([hidden])) .topbar-app-mark {
    display: none !important;
}
.company-logo-upload__preview {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 48px;
    padding: var(--space-3);
    border: 1px dashed var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface-muted);
    margin-bottom: var(--space-3);
}
.company-logo-upload__preview img {
    max-height: 40px;
    max-width: 200px;
    object-fit: contain;
}
.company-logo-upload__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.entity-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--ds-border);
}
.entity-card__header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-shrink: 0;
}
.entity-card .dropdown-actions { flex-shrink: 0; }
.slide-panel__footer--end { justify-content: flex-end; }
.slide-panel__footer .btn .material-symbols-outlined { font-size: 18px; }
.topbar-search-wrap .global-search,
.global-search.topbar-search {
    width: min(100%, 320px);
    max-width: 320px;
}
.topbar-search { width: 100%; cursor: text; }
.topbar-search input { cursor: text; }
.topbar-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: var(--space-2);
    max-height: 320px;
    overflow-y: auto;
}
.topbar-search-result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: var(--space-3);
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-ui);
    font-size: inherit;
    font-weight: inherit;
    font-style: inherit;
    line-height: inherit;
    color: inherit;
}
.topbar-search-result:hover { background: var(--ds-surface-muted); }
.topbar-search-result__code { font-size: var(--text-xs); font-family: var(--font-ui); }
.topbar-search-result__name { font-size: var(--text-sm); }

/* Avatar picker (profil) */
.avatar-picker-block { margin-top: var(--space-5); width: 100%; }
.avatar-picker-label {
    font-family: var(--ds-type-family);
    font-size: var(--ds-type-label-size);
    font-weight: var(--ds-type-label-weight);
    line-height: var(--ds-type-line-body);
    color: var(--ds-color-text-2);
    margin-bottom: var(--space-3);
    text-align: center;
}
.avatar-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: var(--space-2);
    max-height: 280px;
    overflow-y: auto;
    padding-right: var(--space-1);
    justify-content: center;
}
.avatar-picker__option {
    width: 52px;
    height: 52px;
    padding: 0;
    border: 2px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.avatar-picker__option img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-picker__option:hover { border-color: var(--ds-border-strong); transform: translateY(-1px); }
.avatar-picker__option--active {
    border-color: #FFCF33;
    box-shadow: 0 0 0 2px #FFCF33;
}

/* ── Powiadomienia dropdown ── */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(380px, calc(100vw - 24px));
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    max-height: min(480px, calc(100vh - 120px));
    overflow: hidden;
}
.notif-dropdown[hidden] { display: none !important; }
.notif-dropdown__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    flex-shrink: 0;
}
.notif-dropdown__head h3 {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
}
.notif-dropdown__list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--ds-entity-list-pad-x);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.notif-dropdown__empty[hidden] { display: none !important; }
.notif-dropdown__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-8) var(--space-5);
    color: var(--ds-text-secondary);
    text-align: center;
}
.notif-dropdown__empty .material-symbols-outlined { font-size: 28px; opacity: 0.5; }
.notif-dropdown__foot {
    padding: var(--space-3) var(--space-4) var(--space-4);
    border-top: 1px solid var(--ds-border);
    flex-shrink: 0;
}
.notif-dropdown__foot .btn-footer {
    min-height: 44px;
    font-size: var(--text-sm);
}

.notification-card--page.unread {
    background: var(--ds-surface);
    box-shadow: inset 3px 0 0 var(--ds-brand-cta);
}
.notification-card--page.unread .content strong {
    font-weight: 600;
}
.notification-card--compact.unread {
    background: var(--ds-surface);
    box-shadow: inset 3px 0 0 var(--ds-brand-cta);
    opacity: 1;
}
.notification-card--compact.read {
    opacity: 0.55;
}
.notif-mark-read {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    color: var(--ds-text-tertiary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.notif-mark-read:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
}
.notif-mark-read .material-symbols-outlined { font-size: 20px; }
.notification-card--compact .notif-mark-read { margin-left: 0; align-self: flex-start; justify-self: end; }
.notification-card--compact .content { align-self: flex-start; min-width: 0; }
.notification-card--page .btn-mark-read {
    font-size: var(--text-xs);
    gap: var(--space-1);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    background: var(--ds-surface);
    color: var(--ds-text-secondary);
}
.notification-card--page .btn-mark-read:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
}
.notification-card--compact {
    padding: 10px var(--space-3);
    gap: var(--space-3);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 36px;
    align-items: start;
    min-height: 52px;
    cursor: default;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.notification-card--compact:hover {
    border-color: var(--ds-border-strong);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.notification-card--page {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.notification-card--page:hover {
    border-color: var(--ds-border-strong);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}
.notification-card .icon {
    --notif-icon-size: calc(1.35 * var(--text-sm));
    width: var(--notif-icon-size);
    height: var(--notif-icon-size);
    min-width: var(--notif-icon-size);
    border-radius: var(--radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: calc(var(--text-sm) * 0.95);
    align-self: start;
}
.notification-card .content strong {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
    margin-bottom: 4px;
    line-height: 1.35;
    min-height: calc(1.35 * var(--text-sm));
}
.notification-card .content p {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
    line-height: 1.45;
}
.notification-card .content small {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-2xs);
    color: var(--ds-text-tertiary);
}

/* ── Custom checkbox (Material) ── */
.ds-check {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    user-select: none;
    width: 100%;
}
.ds-check__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.ds-check__box {
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--ds-border-strong);
    border-radius: var(--radius-xs);
    background: var(--ds-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.12s, border-color 0.12s;
}
.ds-check__box .material-symbols-outlined {
    font-size: 16px;
    line-height: 1;
    color: #fff;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.12s, transform 0.12s;
}
.ds-check__input:checked + .ds-check__box {
    background: var(--ds-success);
    border-color: var(--ds-success);
}
.ds-check__input:checked + .ds-check__box .material-symbols-outlined {
    opacity: 1;
    transform: scale(1);
}
.form-group--checkbox .ds-check { margin: 0; }

/* ── Checkbox size variants ── */
.ds-check--sm { gap: var(--space-2); }
.ds-check--sm .ds-check__box { width: 16px; height: 16px; min-width: 16px; }
.ds-check--sm .ds-check__box .material-symbols-outlined { font-size: 12px; }
.ds-check--sm .ds-check__label { font-size: var(--text-xs); font-weight: var(--ds-type-input-weight); }

.ds-check--sm-box { gap: var(--space-2); }
.ds-check--sm-box .ds-check__box { width: 16px; height: 16px; min-width: 16px; }
.ds-check--sm-box .ds-check__box .material-symbols-outlined { font-size: 12px; }

.ds-check:hover:not(:has(.ds-check__input:checked)) .ds-check__box {
    border-color: var(--ds-border-emphasis);
    background: var(--ds-surface-muted);
}
.ds-check__input:focus-visible + .ds-check__box,
.ds-check:focus-within .ds-check__box {
    box-shadow: 0 0 0 3px var(--ds-brand-tint-22);
}
.ds-check__input:checked + .ds-check__box,
.ds-check:has(.ds-check__input:checked):focus-within .ds-check__box,
.ds-check__input:checked:focus-visible + .ds-check__box {
    box-shadow: none;
}
.ds-check--table:focus-within .ds-check__box,
.ds-check--table .ds-check__input:focus-visible + .ds-check__box {
    box-shadow: none;
}
.ds-check__label {
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    color: var(--ds-text);
    line-height: 1.4;
    white-space: nowrap;
}

/* ── Radio atom ── */
.ds-radio {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    user-select: none;
}
.ds-radio__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.ds-radio__dot {
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--ds-border-strong);
    border-radius: 50%;
    background: var(--ds-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ds-radio__dot::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    transform: scale(0.6);
    transition: background 0.12s, transform 0.12s;
}
.ds-radio__input:checked + .ds-radio__dot { border-color: var(--ds-brand-cta-active); }
.ds-radio__input:checked + .ds-radio__dot::after { background: var(--ds-brand-cta); transform: scale(1); }
.ds-radio__input:focus-visible + .ds-radio__dot {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-text) 8%, transparent);
}
.ds-radio__input:disabled + .ds-radio__dot { opacity: 0.55; }
.ds-radio__label {
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    color: var(--ds-text);
}
.ds-radio-group { display: flex; flex-direction: column; gap: var(--space-2); }
.ds-radio--sm .ds-radio__dot { width: 16px; height: 16px; }
.ds-radio--sm .ds-radio__dot::after { width: 8px; height: 8px; }
.ds-radio--sm .ds-radio__label { font-size: var(--text-xs); font-weight: var(--ds-type-input-weight); }

/* ── Toggle sm ── */
.ds-toggle--sm { width: 32px; height: 20px; }
.ds-toggle--sm .ds-toggle__track { width: 32px; height: 18px; }
.ds-toggle--sm .ds-toggle__track::after { width: 14px; height: 14px; top: 2px; left: 2px; }
.ds-toggle--sm .ds-toggle__input:checked + .ds-toggle__track::after { transform: translateX(14px); }

/* ── Custom select size variants ── */
.custom-select.custom-select--sm {
    --ds-dropdown-font-size: var(--text-xs);
    --ds-dropdown-option-py: 8px;
    --ds-dropdown-option-px: 10px;
}
.custom-select.custom-select--lg {
    --ds-dropdown-font-size: var(--text-base);
    --ds-dropdown-option-py: 12px;
    --ds-dropdown-option-px: 14px;
}
.custom-select.custom-select--sm .custom-select-trigger {
    min-height: 32px;
    height: 32px;
    font-size: var(--text-xs);
    padding: 0 10px;
}
.custom-select.custom-select--lg .custom-select-trigger {
    min-height: 48px;
    height: 48px;
    font-size: var(--text-base);
    padding: 0 14px;
}
.custom-select.custom-select--sm .custom-option {
    font-size: var(--ds-dropdown-font-size);
    padding: var(--ds-dropdown-option-py) var(--ds-dropdown-option-px);
    line-height: 1.25;
}
.custom-select.custom-select--lg .custom-option {
    font-size: var(--ds-dropdown-font-size);
    padding: var(--ds-dropdown-option-py) var(--ds-dropdown-option-px);
    line-height: 1.3;
}

/* ── Form invalid state ── */
.form-group--invalid input:not([type="checkbox"]):not([type="radio"]),
.form-group--invalid textarea,
.form-group--invalid .custom-select-trigger {
    border-color: var(--ds-danger);
    box-shadow: 0 0 0 3px var(--ds-danger-soft);
}
.form-group--invalid input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group--invalid input:not([type="checkbox"]):not([type="radio"]):focus-visible,
.form-group--invalid textarea:focus,
.form-group--invalid textarea:focus-visible {
    border-color: var(--ds-danger);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-danger) 18%, transparent);
}
.form-group--invalid .form-hint--error:not([hidden]),
.form-hint.form-hint--error:not([hidden]) {
    color: var(--ds-danger);
    font-size: var(--ds-type-caption-size);
    font-weight: var(--ds-type-caption-weight);
    margin-top: var(--space-2);
    line-height: var(--ds-type-line-relaxed);
    display: block;
}
.form-group--invalid .form-hint--error[hidden] { display: none; }

/* ── Spinner + loading buttons ── */
.ds-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    line-height: 0;
}
.ds-spinner svg {
    display: block;
    width: 100%;
    height: 100%;
    animation: ds-spin 0.9s linear infinite;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .ds-spinner svg { animation: none; }
}
.ds-spinner--2xs { width: 16px; height: 16px; }
.ds-spinner--sm { width: 20px; height: 20px; }
.ds-spinner--md { width: 24px; height: 24px; }
.ds-spinner--lg { width: 32px; height: 32px; }
.ds-spinner--xl { width: 40px; height: 40px; }
.btn.is-loading {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.btn.is-loading .ds-spinner { flex-shrink: 0; }
.ds-spinner--on-brand svg circle:first-of-type {
    stroke: color-mix(in srgb, var(--ds-brand-cta-text) 22%, transparent);
}
.ds-spinner--on-brand svg circle:last-of-type { stroke: var(--ds-brand-cta-text); }
.btn-brand.is-loading .ds-spinner:not(.ds-spinner--on-brand) svg circle:first-of-type,
.btn-accent.is-loading .ds-spinner:not(.ds-spinner--on-brand) svg circle:first-of-type {
    stroke: color-mix(in srgb, var(--ds-brand-cta-text) 22%, transparent);
}
.btn-brand.is-loading .ds-spinner:not(.ds-spinner--on-brand) svg circle:last-of-type,
.btn-accent.is-loading .ds-spinner:not(.ds-spinner--on-brand) svg circle:last-of-type {
    stroke: var(--ds-brand-cta-text);
}

.ds-account-view .ds-check__label {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* custom-select-trigger — global styles at ~1103; account view uses same tokens */
.custom-select-trigger .material-symbols-outlined {
    font-size: 20px;
    color: var(--ds-text-tertiary);
    flex-shrink: 0;
}

/* ── Account pages ── */
.ds-account-view {
    background: var(--ds-bg);
}
.ds-account-view .ds-page-header {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    padding: var(--ds-content-pad);
    margin-bottom: 0;
}
.ds-account-view .settings-grid .form-card {
    border-radius: var(--radius-md);
}
.notif-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    overflow: hidden;
    box-sizing: border-box;
}
.notifications-feed--page {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
.notifications-feed--page.module-list--dashboard {
    gap: var(--space-2);
    padding: 0;
}
.notifications-feed--page.module-list--dashboard > .notif-row {
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    box-shadow: none;
    transition: none;
}
/* Powiadomienie — kropka + tekst po lewej, done po prawej (jedna linia) */
.notifications-feed--page.module-list--dashboard > .notif-row,
.notif-feed > .notif-row,
.notif-feed > button.notif-row,
.notif-feed > div.notif-row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) 32px;
    grid-template-areas: "lead main trail";
    align-items: center;
    column-gap: var(--space-3);
    row-gap: 0;
    min-height: 48px;
    height: auto;
    max-height: none;
    padding: var(--space-3) var(--space-4);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: left;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    color: inherit;
}
.notif-feed > .notif-row,
.notif-feed > button.notif-row,
.notif-feed > div.notif-row {
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--ds-border);
    background: transparent;
    box-shadow: none;
    transition: background 0.12s, box-shadow 0.12s;
}
.notif-feed > .notif-row:not(:has(.notif-row__action)):not(:has(.notif-row__status)) {
    grid-template-columns: 10px minmax(0, 1fr);
    grid-template-areas: "lead main";
}
.notif-feed > .notif-row.notif-row--has-mark-label,
.notifications-feed--page.module-list--dashboard > .notif-row.notif-row--has-mark-label {
    grid-template-columns: 10px minmax(0, 1fr) auto;
}
.notif-feed > .notif-row:last-child {
    border-bottom: none;
}
.notifications-feed--page.module-list--dashboard > .notif-row.ds-list-item--has-trail,
.notif-feed > .notif-row.ds-list-item--has-trail {
    padding-inline: var(--space-4);
}
.notifications-feed--page.module-list--dashboard > .notif-row.ds-list-item--interactive:hover,
.module-list--dashboard > button.notif-row.ds-list-item--interactive:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border);
    box-shadow: none;
    transform: none;
}
.notif-feed > .notif-row:hover {
    background: transparent;
    border-bottom-color: var(--ds-border-emphasis);
    box-shadow:
        inset 1px 0 0 var(--ds-border-emphasis),
        inset -1px 0 0 var(--ds-border-emphasis);
    transform: none;
}
.notif-feed > .notif-row:first-child {
    border-top-left-radius: calc(var(--radius-md) - 1px);
    border-top-right-radius: calc(var(--radius-md) - 1px);
}
.notif-feed > .notif-row:last-child {
    border-bottom-left-radius: calc(var(--radius-md) - 1px);
    border-bottom-right-radius: calc(var(--radius-md) - 1px);
}
.notif-feed > .notif-row:only-child {
    border-radius: calc(var(--radius-md) - 1px);
}
.notif-feed > .notif-row:first-child:hover {
    box-shadow:
        inset 1px 0 0 var(--ds-border-emphasis),
        inset -1px 0 0 var(--ds-border-emphasis),
        inset 0 1px 0 var(--ds-border-emphasis);
}
.notif-feed > .notif-row:last-child:hover {
    box-shadow:
        inset 1px 0 0 var(--ds-border-emphasis),
        inset -1px 0 0 var(--ds-border-emphasis),
        inset 0 -1px 0 var(--ds-border-emphasis);
}
.notif-feed > .notif-row:only-child:hover {
    box-shadow: inset 0 0 0 1px var(--ds-border-emphasis);
}
.notif-feed > .notif-row:hover .notif-row__action .notif-mark-read,
.notif-feed > .notif-row:hover .notif-row__action .notif-mark-read--list {
    color: var(--ds-text-secondary);
}
.notif-row--unread .ds-list-item__title {
    font-weight: 600;
    color: var(--ds-text);
}
.notif-row--unread .ds-list-item__title::before {
    display: none;
    content: none;
}
.notif-row--selected {
    background: var(--ds-brand-cta-subtle);
}
.notifications-feed--page.module-list--dashboard > .notif-row.notif-row--selected {
    border-color: var(--ds-border);
}
.notif-row--selected:hover,
.notifications-feed--page.module-list--dashboard > .notif-row.notif-row--selected:hover {
    background: var(--ds-brand-cta-subtle);
    border-color: var(--ds-border);
    box-shadow: none;
}
.notif-row--read .ds-list-item__title {
    color: var(--ds-text);
    font-weight: 500;
}
.notif-row--read .ds-list-item__title::before {
    display: none;
    content: none;
}
/* Jedna kropka — kolor wg stanu (nadpisuje klasy typu .ok/.warn/.fail) */
.notif-row--important .notif-row__dot,
.notif-row--important .notif-row__icon {
    background: var(--ds-danger);
    opacity: 1;
}
.notif-row--unread:not(.notif-row--important) .notif-row__dot,
.notif-row--unread:not(.notif-row--important) .notif-row__icon {
    background: var(--ds-brand-cta);
    opacity: 1;
}
.notif-row--read:not(.notif-row--important) .notif-row__dot,
.notif-row--read:not(.notif-row--important) .notif-row__icon {
    background: var(--ds-success);
    opacity: 1;
}
.notif-row__action,
.notif-row__status {
    grid-area: trail;
    flex: 0 0 auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
    align-self: center;
    width: 32px;
    height: 32px;
    margin: 0;
}
.notif-row__action .notif-mark-read,
.notif-row__action .notif-mark-read--list {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ds-text-tertiary);
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
}
.notif-row__action .notif-mark-read:hover,
.notif-row__action .notif-mark-read--list:hover {
    color: var(--ds-text-secondary);
    background: var(--ds-surface-muted);
}
.notif-row--has-mark-label .notif-row__action {
    width: auto;
    max-width: none;
    height: auto;
    min-height: 32px;
}
.notif-row--has-mark-label .ds-list-item__main {
    min-width: 0;
    overflow: hidden;
}
.notif-row--has-mark-label .ds-list-item__title {
    flex: 1 1 auto;
    min-width: 0;
}
.notif-row__status {
    color: var(--ds-text-tertiary);
}
.notif-row__status .material-symbols-outlined {
    font-size: 18px;
}
.notif-row__dot,
.notif-row__icon {
    grid-area: lead;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
    align-self: center;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    color: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
.notif-row__icon .material-symbols-outlined {
    display: none;
}
.notif-row__icon.material-symbols-outlined {
    font-size: 0;
    letter-spacing: 0;
    text-indent: -9999px;
}
.notif-row__dot.ok,
.notif-row__icon.ok {
    background: var(--ds-status-text-ok);
}
.notif-row__dot.warn,
.notif-row__icon.warn {
    background: var(--ds-status-text-warn);
}
.notif-row__dot.fail,
.notif-row__icon.fail {
    background: var(--ds-status-text-fail);
}
.notif-row__dot.blue,
.notif-row__icon.blue {
    background: var(--ds-status-text-accent);
}
.notif-row__dot.accent,
.notif-row__icon.accent {
    background: var(--ds-status-text-neutral);
}
.notif-row--rich {
    align-items: center;
    min-height: 48px;
    padding-block: var(--space-3);
}
.module-list--dashboard > .notif-row.ds-list-item--interactive,
.module-list--dashboard > button.notif-row.ds-list-item--interactive,
.module-list--dashboard > div.notif-row.ds-list-item--interactive,
.notif-feed.module-list--dashboard > .notif-row {
    display: grid;
    height: auto;
    max-height: none;
    min-height: 48px;
}
.notif-row__desc {
    display: inline;
    font-size: var(--text-xs);
    color: var(--ds-text-secondary);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
}
.notif-row__desc::before {
    content: "·";
    margin-inline: var(--space-2);
    color: var(--ds-text-tertiary);
    font-weight: 400;
}
.notif-row .ds-list-item__main {
    grid-area: main;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 0;
    overflow: hidden;
}
.notif-row .ds-list-item__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text);
    min-width: 0;
    flex: 0 1 auto;
    max-width: 100%;
    text-align: left;
}
.notif-row__action .notif-mark-read-btn {
    white-space: nowrap;
    flex-shrink: 0;
    gap: var(--space-1);
    width: auto;
    max-width: none;
    padding-inline: var(--space-2);
    font-size: var(--text-xs);
}
.notif-row__action .notif-mark-read-btn .material-symbols-outlined {
    font-size: 18px;
}
.notif-list-item {
    position: relative;
    padding: var(--space-2);
    padding-right: calc(var(--space-2) + 12px);
    align-items: center;
    justify-content: flex-start;
}
.notifications-feed--page.module-list--dashboard > .notif-list-item {
    padding-block: var(--space-2);
    padding-inline: var(--space-2);
    padding-right: calc(var(--space-2) + 12px);
}
.notif-list-item:hover {
    background: transparent;
    border-color: var(--ds-border-emphasis);
    box-shadow:
        inset 1px 0 0 var(--ds-border-emphasis),
        inset -1px 0 0 var(--ds-border-emphasis);
    transform: none;
}
.notif-list-item__main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    min-height: 100%;
}
.notif-list-item .ds-list-item__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
}
.notif-read-dot {
    position: absolute;
    right: var(--space-2);
    bottom: var(--space-2);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ds-brand-cta);
    pointer-events: none;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--ds-surface);
}
.notif-list-item--read .notif-read-dot {
    background: transparent;
    border: 1.5px solid var(--ds-border-strong);
    box-shadow: none;
}
.notif-list-item--selected {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
}
.notif-list-item--read {
    opacity: 0.72;
}
.notif-list-item--read .ds-list-item__title {
    color: var(--ds-text-secondary);
    font-weight: 500;
}
.notif-detail-panel__inset {
    padding: 0;
    box-sizing: border-box;
    min-height: 100%;
}
.notif-detail-panel__inset:has(.notif-detail-panel__placeholder:not([hidden])) {
    flex: 1;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}
.notif-detail-panel__placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin: 0;
    min-height: 100%;
    padding: var(--ds-content-pad);
    text-align: center;
    box-sizing: border-box;
}
.notif-detail-panel__placeholder[hidden] {
    display: none !important;
}
.notif-detail-panel__inset:has(.notif-detail-panel__placeholder:not([hidden])) > .notif-detail-card {
    display: none !important;
}
.notif-detail-card[hidden] {
    display: none !important;
}
.notif-detail-panel__placeholder-icon {
    font-size: 40px;
    line-height: 1;
    color: var(--ds-info-icon-color);
    opacity: 0.72;
}
.notif-detail-panel__placeholder-title {
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--ds-text-secondary);
    line-height: 1.35;
}
.notif-detail-panel__placeholder-text {
    margin: 0;
    max-width: 30ch;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text-tertiary);
    line-height: 1.55;
}
.notif-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    flex: 1;
    min-height: 0;
}
.notif-page-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: var(--space-6);
    align-items: stretch;
    flex: 1;
    min-height: calc(100vh - 220px);
}
.notif-page-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.notif-page-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
    min-height: 0;
    border-left: 1px solid var(--ds-border);
    padding-left: var(--ds-content-pad);
}
.notif-summary--stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.notif-summary--stack .notif-summary__item { width: 100%; }
.notif-summary__item .material-symbols-outlined { color: var(--ds-text-secondary); }
.notification-card--page:hover { border-color: var(--ds-border-strong); box-shadow: none; }
.notif-mark-read:hover,
.notification-card--page .btn-mark-read:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
}
.notif-retention-hint {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--ds-text-tertiary);
    line-height: 1.45;
}
.notification-card--page.read {
    opacity: 0.72;
}
.notification-card--page.read .content strong {
    font-weight: 600;
    color: var(--ds-text-secondary);
}
.notif-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}
.notif-summary__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
}
.notif-summary__item .material-symbols-outlined {
    font-size: 22px;
    color: var(--ds-text-secondary);
    background: var(--ds-surface-muted);
    border: 1px solid var(--ds-border);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notif-summary__item strong {
    display: block;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--ds-text);
    line-height: 1.2;
}
.notif-summary__item span:last-child {
    font-size: var(--text-xs);
    color: var(--ds-text-secondary);
}
.ds-module__head .cal-view-toggle,
.ds-card__header .cal-view-toggle {
    align-self: center;
}
.account-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    max-width: 1080px;
}
.account-hero {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--ds-content-pad);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
}
.account-hero--compact {
    padding: var(--ds-content-pad);
}
.account-hero__avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    background: var(--ds-surface-muted);
    border: 1px solid var(--ds-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.account-hero__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.account-hero__avatar .material-symbols-outlined {
    font-size: 36px;
    color: var(--ds-text-tertiary);
}
.account-hero__info {
    flex: 1;
    min-width: 0;
}
.account-hero__eyebrow {
    font-size: var(--text-2xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--ds-text-tertiary);
    margin: 0 0 var(--space-1);
}
.account-hero__title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin: 0;
    color: var(--ds-text);
}
.account-hero__meta {
    margin: var(--space-1) 0 0;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
}
.notification-card--compact .content p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notification-card .icon {
    background: var(--ds-surface-muted);
}
.notification-card .icon.ok { color: var(--ds-status-text-ok); background: var(--ds-status-bg-ok); }
.notification-card .icon.warn { color: var(--ds-status-text-warn); background: var(--ds-status-bg-warn); }
.notification-card .icon.fail { color: var(--ds-status-text-fail); background: var(--ds-status-bg-fail); }
.notification-card .icon.blue { color: var(--ds-status-text-accent); background: var(--ds-status-bg-accent); }
.notification-card .icon.accent { color: var(--ds-brand-cta); background: var(--ds-surface-muted); }
.notification-card .content { flex: 1; min-width: 0; }
.notification-card .content strong {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
    margin-bottom: 2px;
}
.notification-card .content p {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--ds-text-secondary);
    line-height: var(--leading-relaxed);
}
.notification-card .content small {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-2xs);
    color: var(--ds-text-tertiary);
}
.notification-card .icon.accent { color: var(--ds-brand-cta); background: var(--ds-surface-muted); }

.dropdown-actions {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    z-index: 1;
    --ds-dropdown-font-size: var(--text-xs);
    --ds-dropdown-option-py: 8px;
    --ds-dropdown-option-px: 12px;
}
/* Kebab — zawsze przy prawej krawędzi karty / wiersza */
.ds-row-kebab-cell .ds-row-kebab,
.ds-row-kebab-cell .dropdown-actions,
.entity-card__top-menu .ds-row-kebab,
.entity-card__top-menu .dropdown-actions,
.ds-list-item--has-menu > .ds-row-kebab,
.ds-list-item--has-menu > .dropdown-actions {
    margin-left: auto;
    justify-content: flex-end;
}
.dropdown-actions.is-open {
    z-index: 10051;
}
/* Przycisk ⋮ — jeden komponent w całej aplikacji (menu lub pojedyncza akcja w wierszu) */
:is(.dropdown-actions, .ds-row-kebab) > .icon-btn.ds-kebab-btn,
:is(.dropdown-actions, .ds-row-kebab) > .icon-btn.icon-btn--sm.icon-btn--ghost {
    width: 32px;
    height: 32px;
    padding: 0;
    flex-shrink: 0;
    border: 1px solid var(--ds-border);
    background: transparent;
    color: var(--ds-text-tertiary);
    position: relative;
    z-index: 2;
    cursor: pointer;
    touch-action: manipulation;
    transition:
        background var(--ds-motion-fast) var(--ds-ease-out),
        border-color var(--ds-motion-fast) var(--ds-ease-out),
        color var(--ds-motion-fast) var(--ds-ease-out),
        transform var(--ds-motion-fast) var(--ds-ease-out),
        box-shadow var(--ds-motion-fast) var(--ds-ease-out);
}
:is(.dropdown-actions, .ds-row-kebab) > .icon-btn.ds-kebab-btn .material-symbols-outlined,
:is(.dropdown-actions, .ds-row-kebab) > .icon-btn.icon-btn--sm.icon-btn--ghost .material-symbols-outlined {
    font-size: 20px;
    transition: transform var(--ds-motion-fast) var(--ds-ease-out);
    transform: none;
}
:is(.dropdown-actions, .ds-row-kebab) > .icon-btn.ds-kebab-btn:hover,
:is(.dropdown-actions, .ds-row-kebab) > .icon-btn.icon-btn--sm.icon-btn--ghost:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
    transform: none;
}
:is(.dropdown-actions, .ds-row-kebab) > .icon-btn.ds-kebab-btn:hover .material-symbols-outlined,
:is(.dropdown-actions, .ds-row-kebab) > .icon-btn.icon-btn--sm.icon-btn--ghost:hover .material-symbols-outlined {
    transform: none;
}
.dropdown-actions.is-open > .icon-btn.ds-kebab-btn,
.dropdown-actions.is-open > .icon-btn.icon-btn--sm.icon-btn--ghost {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
    transform: none;
    box-shadow: none;
}
.dropdown-actions.is-open > .icon-btn.ds-kebab-btn .material-symbols-outlined,
.dropdown-actions.is-open > .icon-btn.icon-btn--sm.icon-btn--ghost .material-symbols-outlined {
    transform: rotate(90deg);
}
:is(.dropdown-actions, .ds-row-kebab) > .icon-btn.ds-kebab-btn:active,
:is(.dropdown-actions, .ds-row-kebab) > .icon-btn.icon-btn--sm.icon-btn--ghost:active {
    transform: none;
}

.dropdown-actions-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
    padding: var(--space-2);
    background: var(--ds-surface);
    overflow: visible;
    z-index: 200;
    transform-origin: top right;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-14px) scale(0.88);
    filter: blur(4px);
    transition:
        opacity 0.26s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.34s cubic-bezier(0.34, 1.56, 0.64, 1),
        filter 0.26s ease,
        visibility 0s linear 0.34s;
}
.dropdown-actions.is-open .dropdown-actions-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    filter: blur(0);
    transition:
        opacity 0.26s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.34s cubic-bezier(0.34, 1.56, 0.64, 1),
        filter 0.26s ease,
        visibility 0s;
}
.dropdown-actions.is-open .dropdown-actions-content--fixed {
    position: fixed;
    z-index: 10050;
    pointer-events: auto;
}
#dash-calendar-module .dash-day-view__list .dropdown-actions.is-open .dropdown-actions-content,
#dash-calendar-module .dash-day-view__list .dropdown-actions.is-open .dropdown-actions-content--fixed,
.cal-module--drilldown .dash-day-view__list .dropdown-actions.is-open .dropdown-actions-content,
.cal-module--drilldown .dash-day-view__list .dropdown-actions.is-open .dropdown-actions-content--fixed,
#view-dashboard #today-products-list.dash-day-view__list .dropdown-actions.is-open .dropdown-actions-content,
#view-dashboard #today-products-list.dash-day-view__list .dropdown-actions.is-open .dropdown-actions-content--fixed {
    z-index: 10050;
}
.dropdown-actions__item,
.dropdown-actions-content a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--ds-dropdown-option-py) var(--ds-dropdown-option-px);
    font-size: var(--ds-dropdown-font-size);
    font-weight: 500;
    gap: var(--space-2);
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ds-text);
    text-decoration: none;
    cursor: pointer;
    font-family: var(--font-ui);
    text-align: left;
    box-sizing: border-box;
    opacity: 0;
    transform: translateX(12px) scale(0.96);
    transition:
        opacity 0.24s ease,
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.14s ease;
}
.dropdown-actions.is-open .dropdown-actions__item:nth-child(1),
.dropdown-actions.is-open .dropdown-actions-content a:nth-child(1) {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition-delay: 0.05s;
}
.dropdown-actions.is-open .dropdown-actions__item:nth-child(2),
.dropdown-actions.is-open .dropdown-actions-content a:nth-child(2) {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition-delay: 0.1s;
}
.dropdown-actions.is-open .dropdown-actions__item:nth-child(3),
.dropdown-actions.is-open .dropdown-actions-content a:nth-child(3) {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition-delay: 0.15s;
}
.dropdown-actions.is-open .dropdown-actions__item:nth-child(4),
.dropdown-actions.is-open .dropdown-actions-content a:nth-child(4) {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition-delay: 0.2s;
}
.dropdown-actions.is-open .dropdown-actions__item:nth-child(5),
.dropdown-actions.is-open .dropdown-actions-content a:nth-child(5) {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition-delay: 0.25s;
}
.dropdown-actions__item--danger {
    color: var(--ds-text-secondary);
}
.dropdown-actions__item--danger .material-symbols-outlined {
    color: var(--ds-text-secondary);
}
.dropdown-actions__item .material-symbols-outlined,
.dropdown-actions-content a .material-symbols-outlined {
    font-size: 20px;
    color: var(--ds-text-secondary);
    transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.14s ease;
}
.dropdown-actions__item:hover,
.dropdown-actions-content a:hover {
    background: var(--ds-brand-tint-18);
    color: var(--ds-text);
    transform: translateY(-1px) scale(1.01);
}
.dropdown-actions__item:active,
.dropdown-actions-content a:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.08s;
}
.dropdown-actions__item:hover .material-symbols-outlined,
.dropdown-actions-content a:hover .material-symbols-outlined {
    color: var(--ds-text);
    transform: scale(1.12) rotate(-6deg);
}
.dropdown-actions__item--danger:hover,
.dropdown-actions__item--danger:focus-visible {
    background: color-mix(in srgb, var(--ds-danger) 12%, transparent);
    color: var(--ds-text-secondary);
}
.dropdown-actions__item--danger:hover .material-symbols-outlined,
.dropdown-actions__item--danger:focus-visible .material-symbols-outlined {
    color: var(--ds-danger);
    transform: none;
}

.avatar-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
}
.avatar-section__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.avatar-trigger {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 2px solid var(--ds-border);
    background: var(--ds-surface-muted);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.avatar-trigger:hover {
    border-color: var(--ds-border-strong);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.06);
}
.avatar-trigger img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-trigger__placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--ds-text-tertiary); }
.avatar-trigger__placeholder .material-symbols-outlined { font-size: 40px; }
.avatar-panel { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 120; width: min(360px, calc(100vw - 32px)); }
.avatar-panel[hidden] { display: none !important; }
.avatar-panel__inner { background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--radius-md); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12); padding: var(--space-5); }
.avatar-panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.avatar-panel__head h4 { margin: 0; font-size: var(--text-sm); font-weight: 600; }
.avatar-dropzone { border: 1px dashed var(--ds-border-strong); border-radius: var(--radius-sm); padding: var(--space-5); text-align: center; background: var(--ds-surface-muted); margin-bottom: var(--space-4); display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.avatar-dropzone--active { border-color: var(--ds-primary); background: #f5f5f5; }
.avatar-dropzone .material-symbols-outlined { font-size: 28px; color: var(--ds-text-secondary); }
.avatar-dropzone p { margin: 0; font-size: var(--text-sm); color: var(--ds-text); }
.avatar-dropzone__hint { font-size: var(--text-xs); color: var(--ds-text-secondary); }

.ds-account-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    background: var(--ds-bg);
}
.ds-account-view.dashboard-view .dashboard-scroll[data-account-shell] {
    padding: var(--ds-dashboard-shell-pad-y) var(--ds-dashboard-shell-pad-x);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.account-shell__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--ds-dashboard-gap);
    width: 100%;
    padding: 0;
}
.account-shell__body > .account-section-header {
    flex-shrink: 0;
}
.dashboard-scroll[data-account-shell] .account-shell__body:has(> .notif-module) {
    flex: 1;
    min-height: 0;
}
.dashboard-scroll[data-account-shell] .account-shell__body:has(> .settings-layout) {
    flex: 0 0 auto;
    min-height: unset;
}
.app-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-4);
    padding: 0;
    margin-top: 0;
    border-top: none;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: var(--leading-normal);
    color: var(--ds-text-tertiary);
    white-space: nowrap;
}
.app-footer__left {
    justify-self: start;
    font-variant-numeric: var(--ds-font-numeric);
}
.app-footer__center {
    justify-self: center;
    text-align: center;
}
.app-footer__center strong {
    color: var(--ds-text-secondary);
    font-weight: 600;
}
.app-footer__right {
    justify-self: end;
}
.app-footer__sep {
    margin: 0 0.35em;
    color: var(--ds-border-strong);
}
.account-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}
.account-side-nav {
    width: 240px;
    min-width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--account-nav-bg);
    border-right: 1px solid var(--ds-border);
    padding: var(--nav-rail-first-offset) var(--space-3) var(--ds-content-pad);
    overflow-y: auto;
    overflow-x: hidden;
    font-family: var(--font-ui);
    box-sizing: border-box;
    align-self: stretch;
}
.account-side-nav__list {
    display: flex;
    flex-direction: column;
    gap: var(--nav-rail-item-gap);
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 0;
}
.account-side-nav__list .nav-item,
.account-side-nav__list .account-side-nav__item,
.account-side-nav__foot .nav-item {
    width: 100%;
    height: var(--nav-rail-item-h);
    min-height: var(--nav-rail-item-h);
    max-height: var(--nav-rail-item-h);
    padding: 0 var(--nav-rail-item-px);
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    box-sizing: border-box;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
}
.account-side-nav .nav-item .material-symbols-outlined {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--sidebar-text);
}
body.sidebar-compact .account-side-nav .nav-item {
    justify-content: flex-start;
    padding: 0 var(--nav-rail-item-px);
    height: var(--nav-rail-item-h);
    min-height: var(--nav-rail-item-h);
    max-height: var(--nav-rail-item-h);
}
body.sidebar-compact .account-side-nav .nav-item__text {
    max-width: 160px;
    opacity: 1;
    pointer-events: auto;
}
.account-side-nav .nav-item.active {
    background: #FFCF33;
    border-color: transparent;
    color: #1A1A1A;
}
.account-side-nav .nav-item.active .material-symbols-outlined {
    color: #1A1A1A;
}
.account-side-nav__foot {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: var(--space-2);
}
.account-side-nav__foot .nav-divider {
    margin: var(--space-2) 0 var(--space-3);
}
.account-side-nav__mobile {
    display: none;
}
.account-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}
.account-layout > .account-main > .dashboard-scroll[data-account-shell] {
    flex: 1;
    min-width: 0;
    min-height: 0;
}
.account-top-nav {
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    padding: var(--space-3) 0 var(--space-4);
    margin: 0;
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-bg);
}
html[data-account-nav="tabs"] .account-top-nav,
.account-layout--tabs .account-top-nav {
    display: flex;
    padding: var(--ds-dashboard-shell-pad-y) var(--ds-dashboard-shell-pad-x) var(--space-4);
}
html[data-account-nav="tabs"] .account-side-nav,
.account-layout--tabs .account-side-nav {
    display: none !important;
}
.account-layout:not(.account-layout--tabs) .account-side-nav {
    display: flex;
}
.account-top-nav__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    flex-shrink: 0;
    white-space: nowrap;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--ds-surface-muted);
    color: var(--ds-text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    transition:
        background var(--ds-motion-fast) var(--ds-ease-out),
        color var(--ds-motion-fast) var(--ds-ease-out),
        border-color var(--ds-motion-fast) var(--ds-ease-out);
}
.account-top-nav__label {
    text-decoration: none;
    color: inherit;
}
.account-top-nav__pill .material-symbols-outlined {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    color: var(--ds-text-tertiary);
}
.account-top-nav__pill:hover {
    background: var(--ds-surface-hover);
    color: var(--ds-text);
}
.account-top-nav__pill.is-active {
    background: var(--ds-surface);
    color: var(--ds-text);
    border-color: var(--ds-border-strong);
}
.account-top-nav__pill.is-active .material-symbols-outlined {
    color: var(--ds-text);
}
html[data-account-nav="tabs"] .account-top-nav__pill,
.account-layout--tabs .account-top-nav__pill {
    background: transparent;
    border-color: var(--ds-border);
    padding: 6px 10px;
    font-size: var(--text-2xs);
    font-weight: 500;
    gap: var(--space-1);
}
html[data-account-nav="tabs"] .account-top-nav__pill .material-symbols-outlined,
.account-layout--tabs .account-top-nav__pill .material-symbols-outlined {
    font-size: 14px;
}
html[data-account-nav="tabs"] .account-top-nav__pill:hover,
.account-layout--tabs .account-top-nav__pill:hover {
    background: transparent;
    border-color: var(--ds-border-emphasis);
    color: var(--ds-text);
    box-shadow: none;
}
html[data-account-nav="tabs"] .account-top-nav__pill.is-active,
.account-layout--tabs .account-top-nav__pill.is-active {
    background: transparent;
    border-color: var(--ds-primary);
    color: var(--ds-text);
    box-shadow: none;
}
html[data-account-nav="tabs"] .account-top-nav__pill.is-active .material-symbols-outlined,
.account-layout--tabs .account-top-nav__pill.is-active .material-symbols-outlined {
    color: var(--ds-text);
}
@media (max-width: 768px) {
    html[data-account-nav="tabs"] .account-top-nav,
    .account-layout--tabs .account-top-nav {
        display: none;
    }
    html[data-account-nav="tabs"] .account-side-nav,
    .account-layout--tabs .account-side-nav {
        display: flex !important;
    }
}
.account-subnav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: nowrap;
    position: sticky;
    top: calc(-1 * var(--ds-dashboard-shell-pad-y));
    z-index: 30;
    flex-shrink: 0;
    background: var(--ds-bg);
    padding: var(--ds-dashboard-shell-pad-y) var(--ds-dashboard-shell-pad-x) var(--space-4);
    margin: calc(-1 * var(--ds-dashboard-shell-pad-y)) calc(-1 * var(--ds-dashboard-shell-pad-x)) var(--space-4);
    border-bottom: 1px solid var(--ds-border);
}
.account-subnav-bar::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: var(--ds-bg);
    z-index: -1;
}
.account-subnav-picker {
    position: relative;
    width: 100%;
}
/* Mobile: przełącznik sekcji konta (sheet — panel nawigacji, nie dropdown) */
.account-subnav-sheet {
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
    box-shadow: none;
}
.account-subnav-sheet.is-open {
    border-color: transparent;
}
.account-subnav-sheet__trigger {
    display: block;
    width: 100%;
    min-height: auto;
    padding: var(--space-2) 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--ds-text);
    font-family: var(--font-ui);
    cursor: pointer;
    text-align: left;
    transition: background var(--ds-motion-fast);
}
.account-subnav-sheet__trigger:hover,
.account-subnav-picker.is-open .account-subnav-sheet__trigger {
    background: transparent;
}
.account-subnav-sheet__main {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-height: 36px;
    padding: 0;
    box-sizing: border-box;
}
.account-subnav-sheet__label {
    flex: 1;
    min-width: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: normal;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-subnav-sheet .account-subnav-dropdown__icon {
    font-size: 18px;
}
.account-subnav-sheet__chev {
    font-size: 20px;
    color: var(--ds-text-tertiary);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform var(--ds-motion-fast) var(--ds-ease-out);
}
.account-subnav-sheet__inner {
    overflow: hidden;
    min-height: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.account-subnav-picker.is-open .account-subnav-sheet__inner {
    padding: var(--space-2) 0 var(--space-1);
    border-top: 1px solid var(--ds-border);
    background: transparent;
}
/* Legacy accordion box — zachowane dla starszych widoków */
.account-subnav-accordion {
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    overflow: hidden;
    transition: border-color var(--ds-motion-fast), box-shadow var(--ds-motion-fast);
}
.account-subnav-accordion.is-open {
    border-color: var(--ds-border-strong);
    box-shadow: var(--ds-shadow-sm);
}
.account-subnav-accordion__trigger,
.account-subnav-dropdown__trigger:not(.account-subnav-sheet__trigger) {
    display: flex;
    align-items: center;
    width: 100%;
    gap: var(--space-2);
    min-height: 44px;
    padding: 0 var(--space-2) 0 var(--space-3);
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--ds-text);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--ds-motion-fast);
}
.account-subnav-accordion__trigger:hover,
.account-subnav-dropdown__trigger:not(.account-subnav-sheet__trigger):hover {
    background: var(--ds-surface-muted);
}
.account-subnav-sheet__trigger:hover {
    background: transparent;
}
.account-subnav-accordion.is-open .account-subnav-accordion__trigger,
.account-subnav-picker.is-open .account-subnav-accordion__trigger:not(.account-subnav-sheet__trigger) {
    background: var(--ds-surface-muted);
}
.account-subnav-dropdown__icon {
    font-size: 20px;
    color: var(--ds-text-secondary);
    flex-shrink: 0;
}
.account-subnav-dropdown__label {
    flex: 1;
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-subnav-dropdown__chev {
    font-size: 20px;
    color: var(--ds-text-secondary);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform var(--ds-motion-fast) var(--ds-ease-out);
}
.account-subnav-picker.is-open .account-subnav-dropdown__chev,
.account-subnav-accordion.is-open .account-subnav-dropdown__chev {
    transform: rotate(180deg);
}
.account-subnav-accordion__panel,
.account-subnav-sheet__panel {
    display: grid;
    grid-template-rows: 0fr;
    border-top: 1px solid transparent;
    transition:
        grid-template-rows 0.24s var(--ds-ease-out),
        border-color 0.24s var(--ds-ease-out);
}
.account-subnav-picker.is-open .account-subnav-accordion__panel,
.account-subnav-accordion.is-open .account-subnav-accordion__panel {
    grid-template-rows: 1fr;
}
.account-subnav-accordion.is-open .account-subnav-accordion__panel:not(.account-subnav-sheet__panel) {
    border-top-color: var(--ds-border);
}
.account-subnav-accordion__inner {
    overflow: hidden;
    min-height: 0;
    padding: 0 var(--space-2) 0;
}
.account-subnav-accordion.is-open .account-subnav-accordion__inner:not(.account-subnav-sheet__inner) {
    padding: var(--space-1) var(--space-2) var(--space-2);
}
.account-subnav-accordion__option,
.account-subnav-sheet__option,
.account-subnav-dropdown__option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ds-text);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background var(--ds-motion-fast);
}
.account-subnav-sheet__option {
    padding: 10px 12px;
}
.account-subnav-accordion__option:hover,
.account-subnav-sheet__option:hover,
.account-subnav-dropdown__option:hover {
    background: var(--ds-surface-muted);
}
.account-subnav-accordion__option.is-active,
.account-subnav-dropdown__option.is-active,
.account-subnav-sheet__option.is-active {
    background: var(--ds-brand-cta-soft);
    color: var(--ds-text);
    font-weight: 600;
}
.account-subnav-accordion__option .material-symbols-outlined,
.account-subnav-sheet__option .material-symbols-outlined,
.account-subnav-dropdown__option .material-symbols-outlined {
    font-size: 18px;
    color: var(--ds-text-secondary);
    flex-shrink: 0;
}
.account-subnav-accordion__option.is-active .material-symbols-outlined,
.account-subnav-sheet__option.is-active .material-symbols-outlined,
.account-subnav-dropdown__option.is-active .material-symbols-outlined {
    color: var(--ds-text);
}
/* Legacy dropdown (desktop hidden) — zachowane dla kompatybilności */
.account-subnav-dropdown {
    display: none;
    flex: 1;
    min-width: 0;
    max-width: 320px;
}
.account-subnav-dropdown__backdrop,
.account-subnav-dropdown__menu {
    display: none !important;
}
.account-subnav__actions {
    flex-shrink: 0;
    margin-left: auto;
}
.account-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--ds-border);
    margin-bottom: var(--space-2);
    background: transparent;
}
.account-section-header--compact {
    align-items: center;
    padding-bottom: var(--space-4);
    margin-bottom: 0;
    border-bottom: none;
}
.account-section-header--compact .account-section-header__title {
    margin: 0;
}
.account-section-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
    flex-shrink: 0;
}
.account-logout-btn.btn--danger {
    color: var(--ds-text-secondary);
}
.account-section-header__main {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-width: 0;
}
.account-section-header__avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--ds-surface-muted);
    border: 1px solid var(--ds-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.account-section-header__avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-section-header__avatar .material-symbols-outlined { font-size: 28px; color: var(--ds-text-tertiary); }
.account-section-header__eyebrow {
    font-size: var(--text-2xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--ds-text-tertiary);
    margin: 0 0 var(--space-1);
}
.account-section-header__title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin: 0;
    color: var(--ds-text);
}
.account-section-header__meta {
    margin: var(--space-1) 0 0;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
}
.app-footer__link {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-ui);
    font-size: inherit;
    font-weight: inherit;
    font-style: inherit;
    line-height: inherit;
    color: var(--ds-text);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.app-footer__link:hover { color: var(--ds-text); opacity: 0.72; }
.plans-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}
@media (min-width: 1280px) {
    .plans-page,
    #view-plans .dashboard-scroll[data-account-shell] > .account-section-header {
        max-width: 1320px;
    }
}
#view-plans .dashboard-scroll[data-account-shell] > .account-section-header {
    width: 100%;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}
.plans-page__hero {
    text-align: center;
    max-width: 40rem;
    margin: 0 auto;
}
.plans-page__lead {
    margin: 0;
    text-align: center;
    text-wrap: pretty;
}
.plans-billing {
    display: inline-flex;
    align-self: center;
    align-items: center;
    gap: 2px;
    padding: 3px;
    margin-bottom: calc(var(--space-10) + var(--space-4));
    border-radius: 999px;
    background: var(--ds-surface-muted);
    border: 1px solid var(--ds-border);
}
.plans-billing__opt {
    appearance: none;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text-secondary);
    padding: 8px 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: background var(--ds-motion-fast) var(--ds-ease-out), color var(--ds-motion-fast) var(--ds-ease-out);
}
.plans-billing__opt.is-active {
    background: var(--ds-surface);
    color: var(--ds-text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.plans-billing__tag {
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--ds-success);
    background: var(--ds-success-soft);
    border: 1px solid var(--ds-success);
    padding: 2px 8px;
    border-radius: 999px;
}
.plans-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.14fr) minmax(0, 1fr);
    gap: var(--ds-dashboard-gap);
    align-items: stretch;
}
.plan-card {
    position: relative;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    padding: var(--space-10);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    box-shadow: none;
    min-height: 100%;
}
.plan-card--featured {
    border: 2px solid var(--ds-brand-cta);
    padding-top: calc(var(--space-10) + var(--space-2));
}
.plan-card--featured .plan-card__name {
    font-size: clamp(1.625rem, 2.4vw, 1.875rem);
}
.plan-card__ribbon {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 4px 14px;
    border-radius: 999px;
    font-size: var(--text-2xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ds-brand-cta-text);
    background: var(--ds-brand-cta);
    border: 1px solid rgba(0, 0, 0, 0.06);
    white-space: nowrap;
}
.plan-card__head {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.plan-card__tier {
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ds-text-secondary);
}
.plan-card__name {
    margin: 0;
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    text-wrap: balance;
}
.plan-card__tagline {
    margin: var(--space-3) 0 0;
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--ds-text-secondary);
    text-wrap: pretty;
}
.plan-card__offer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-top: 1px solid var(--ds-border);
    border-bottom: 1px solid var(--ds-border);
}
.plan-card__cta {
    width: 100%;
    justify-content: center;
}
.plan-card__price-block {
    text-align: left;
    min-width: 0;
}
.plan-card__price {
    margin: 0;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
}
.plan-card__price-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ds-text);
}
.plan-card__price-period {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text-secondary);
}
.plan-card__price-hint {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-2xs);
    color: var(--ds-text-secondary);
}
.plan-card__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}
.plan-card__features li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--ds-text);
    text-wrap: pretty;
}
.plan-card__features .material-symbols-outlined {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ds-success-soft);
    color: var(--ds-success);
    border: 1px solid var(--ds-green-tint-22);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}
.help-card--wide,
.form-card--wide { grid-column: 1 / -1; }
.help-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.help-links a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    color: var(--ds-text);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: background 0.12s, border-color 0.12s;
}
.help-links a:hover { background: var(--ds-surface-muted); border-color: var(--ds-border-strong); }
.help-links .material-symbols-outlined { font-size: 20px; color: var(--ds-brand-cta-active); }
.help-card__text { font-size: var(--text-sm); color: var(--ds-text-secondary); line-height: var(--leading-relaxed); margin: 0 0 var(--space-4); }
.help-faq {
    border-bottom: 1px solid var(--ds-border);
}
.help-faq:last-child { border-bottom: none; }
.help-faq summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) 0;
}
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq__label {
    flex: 1;
    min-width: 0;
    line-height: 1.45;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
}
.help-faq__chev {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--ds-text-tertiary);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s ease;
}
.help-faq[open] .help-faq__chev {
    transform: rotate(180deg);
    color: var(--ds-text-secondary);
}
.help-faq__body {
    padding: 0 0 var(--space-4);
    overflow: hidden;
    animation: helpFaqBodyIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.help-faq__body p {
    margin: 0;
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--ds-text-secondary);
    line-height: var(--leading-relaxed);
}
.help-faq__body code {
    font-size: var(--text-xs);
    padding: 1px 6px;
    border-radius: var(--radius-xs);
    background: var(--ds-surface-muted);
}
.ds-account-view .privacy-doc h3 {
    margin: 0 0 var(--space-3);
    font-size: var(--text-md);
    font-weight: 600;
    padding-bottom: 0;
    border-bottom: none;
}
.ds-account-view .ds-card.privacy-doc {
    padding: var(--ds-content-pad);
}
.ds-account-view .privacy-doc section {
    margin-bottom: 0;
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--ds-border);
}
.ds-account-view .privacy-doc section + section {
    padding-top: var(--space-5);
}
.ds-account-view .privacy-doc section:last-child {
    padding-bottom: 0;
    border-bottom: none;
}
.privacy-doc p { margin: 0; font-size: var(--text-sm); color: var(--ds-text-secondary); line-height: var(--leading-relaxed); }
.privacy-doc a { color: var(--ds-brand-cta-active); }
.ds-account-view .settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: start;
}
.ds-account-view .settings-grid .form-card--wide { grid-column: 1 / -1; }
.ds-account-view .form-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    padding: var(--ds-content-pad);
    box-shadow: none;
}
.ds-account-view .form-card h3 {
    margin: 0 0 var(--space-5);
    font-size: var(--text-md);
    font-weight: 600;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--ds-border);
}
.ds-account-view .form-group { margin-bottom: var(--space-4); }
.ds-account-view .form-group:last-child { margin-bottom: 0; }
.ds-account-view .form-group input:not([type="checkbox"]):not([type="radio"]),
.ds-account-view .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    font-family: var(--font-ui);
    background: var(--ds-surface);
    color: var(--ds-text);
}
.ds-account-view .form-group--checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--ds-border-strong);
    border-radius: var(--radius-xs);
    accent-color: var(--ds-primary);
    cursor: pointer;
    flex-shrink: 0;
}
.ds-account-view .form-group--checkbox label {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    color: var(--ds-text);
    margin: 0;
    cursor: pointer;
    width: 100%;
}
.form-hint {
    margin: var(--space-2) 0 0;
    font-family: var(--ds-type-family);
    font-size: var(--ds-type-caption-size);
    font-weight: var(--ds-type-caption-weight);
    color: var(--ds-color-text-3);
    line-height: var(--ds-type-line-relaxed);
}
.form-hint--error {
    color: var(--ds-danger);
}
.form-group--select-only,
.form-group:has(> .custom-select) {
    width: fit-content;
    max-width: 100%;
}
.custom-select.custom-select--fluid {
    display: grid;
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(0, 1fr);
}
.custom-select.custom-select--fluid .custom-select-trigger {
    width: 100%;
    min-width: 0;
    max-width: none;
}
.form-group:has(> .custom-select--fluid) {
    width: 100%;
    max-width: none;
}
.custom-select {
    position: relative;
    display: inline-grid;
    grid-template-columns: minmax(max-content, 100%);
    grid-template-rows: auto auto;
    width: fit-content;
    max-width: min(480px, calc(100vw - 24px));
    vertical-align: top;
    box-sizing: border-box;
    margin: 0;
    isolation: isolate;
    overflow: visible;
    --ds-dropdown-font-size: var(--text-sm);
    --ds-dropdown-option-py: 10px;
    --ds-dropdown-option-px: 12px;
}
.custom-select-trigger {
    grid-row: 1;
    grid-column: 1;
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: max-content;
    box-sizing: border-box;
}
.custom-select__sizer {
    grid-row: 2;
    grid-column: 1;
    height: 0;
    min-height: 0;
    overflow: hidden;
    visibility: hidden;
    white-space: nowrap;
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    line-height: 0;
    padding: 0 36px 0 12px;
    box-sizing: border-box;
    pointer-events: none;
    border: 1px solid transparent;
}
.custom-select--sm .custom-select__sizer {
    font-size: var(--text-xs);
    line-height: 0;
    min-height: 0;
    padding: 0 32px 0 10px;
}
.custom-select--lg .custom-select__sizer {
    font-size: var(--text-base);
    line-height: 0;
    min-height: 0;
    padding: 0 40px 0 14px;
}
.custom-select.open .custom-select-trigger .material-symbols-outlined {
    transform: rotate(180deg);
}
.custom-select-trigger .material-symbols-outlined {
    transition: transform 0.2s ease;
}
.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 300;
    width: max-content;
    min-width: 100%;
    max-width: min(480px, calc(100vw - 24px));
    box-sizing: border-box;
    background: var(--ds-surface);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    box-shadow: none;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    padding: 0 var(--space-1);
    margin: 0;
    transform: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.custom-select.open .custom-select-options {
    max-height: 240px;
    overflow-x: hidden;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    padding: var(--space-1);
    border-color: var(--ds-border);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    transform: translateY(0);
}
.custom-select-options.custom-select-options--portaled {
    position: fixed;
    z-index: 5000;
    max-height: min(240px, 50dvh);
    overflow-x: hidden;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    padding: var(--space-1);
    margin: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    transform: none;
    box-sizing: border-box;
}
.ds-wizard-dialog:has(.custom-select.open) .ds-dialog__panel,
.selective-wizard-dialog:has(.custom-select.open) .ds-dialog__panel {
    overflow: visible;
}
.ds-wizard-dialog:has(.custom-select.open) .ds-dialog__body,
.selective-wizard-dialog:has(.custom-select.open) .ds-dialog__body {
    overflow: visible;
}
.selective-wizard-dialog:has(.custom-select.open) :is(.selective-scope-step, .schedule-date-step__field) {
    overflow: visible;
}
.view-toolbar:has(.custom-select.open),
.filter-bar:has(.custom-select.open) {
    overflow: visible;
}
.view-toolbar__filters .custom-select,
.filter-bar .custom-select {
    display: block;
    width: 100%;
    max-width: 100%;
}
.view-toolbar__filters .custom-select__sizer,
.filter-bar .custom-select__sizer {
    display: none;
}
.custom-option {
    display: block;
    padding: var(--ds-dropdown-option-py, 10px) var(--ds-dropdown-option-px, 12px);
    font-size: var(--ds-dropdown-font-size, var(--text-sm));
    color: var(--ds-text);
    cursor: pointer;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.custom-option:hover { background: var(--ds-surface-muted); }
.custom-option.selected { background: var(--ds-brand-tint-14); font-weight: var(--ds-type-input-weight); }
.ds-account-view .form-group input:not([type="checkbox"]):focus,
.ds-account-view .form-group input:not([type="checkbox"]):focus-visible,
.ds-account-view .form-group select:focus,
.ds-account-view .form-group select:focus-visible {
    outline: none;
    border: 1px solid var(--ds-primary);
    background: var(--ds-surface);
    box-shadow: var(--ds-focus-ring-field);
}
/* ── Sidebar compact ── */
body.sidebar-compact .sidebar {
    width: 72px;
    min-width: 72px;
    padding: var(--space-4) 0 var(--ds-content-pad);
    align-items: center;
    overflow: visible;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar-header > div:last-child,
body.sidebar-compact:not(.sidebar-expanded) .sidebar-header h2,
body.sidebar-compact:not(.sidebar-expanded) .sidebar-tagline,
body.sidebar-compact:not(.sidebar-expanded) .brand-title,
body.sidebar-compact:not(.sidebar-expanded) .sidebar .nav-item__text {
    max-width: 0;
    opacity: 0;
    pointer-events: none;
}
body.sidebar-compact .sidebar-header {
    justify-content: center;
    padding: var(--space-2) 0 var(--space-4);
    width: 100%;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar-header .logo-mark.brand-logo-slot {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    margin: 0 auto;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar-header .brand-logo-slot__img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
}
body.sidebar-compact.sidebar-expanded .sidebar-header {
    justify-content: flex-start;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar-nav {
    width: 100%;
    align-items: center;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar .nav-item {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: var(--nav-rail-item-h);
    min-height: var(--nav-rail-item-h);
    max-height: var(--nav-rail-item-h);
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    justify-content: center;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar .nav-item .material-symbols-outlined {
    margin: 0;
    font-size: 22px;
}
body.sidebar-compact .nav-divider {
    width: calc(100% - var(--space-4));
    margin: var(--space-2) auto;
}

body.sidebar-compact.sidebar-expanded .sidebar {
    width: 232px;
    min-width: 232px;
    padding: var(--space-4) var(--space-3) var(--ds-content-pad);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 120;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.1);
}
body.sidebar-compact.sidebar-expanded .sidebar .nav-item {
    justify-content: flex-start;
    padding: 0 var(--nav-rail-item-px);
    height: var(--nav-rail-item-h);
    min-height: var(--nav-rail-item-h);
    max-height: var(--nav-rail-item-h);
}
body.sidebar-compact.sidebar-expanded .sidebar .nav-item .material-symbols-outlined {
    margin: 0;
}

.sidebar-rail-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(15, 23, 42, 0.18);
    border: none;
    padding: 0;
    margin: 0;
    cursor: default;
}
body.sidebar-compact.sidebar-expanded .sidebar-rail-backdrop {
    display: block;
}

.sidebar-rail-toggle {
    display: none;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 210;
    width: 56px;
    height: 64px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    align-items: center;
    justify-content: flex-end;
    box-sizing: border-box;
    overflow: visible;
}
body.sidebar-compact .sidebar-rail-toggle {
    display: inline-flex;
    transform: translate(50%, -50%);
    width: auto;
    height: auto;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar-rail-toggle__track {
    width: 22px;
    height: 22px;
    margin-right: 0;
    border: 1px solid var(--ds-border);
    border-radius: 6px;
    border-left: 1px solid var(--ds-border);
    box-shadow: 0 1px 2px rgba(26, 26, 26, 0.04);
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar-rail-toggle__track::before,
body.sidebar-compact:not(.sidebar-expanded) .sidebar-rail-toggle__track::after {
    display: none;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar-rail-toggle__btn {
    width: 100%;
    height: 100%;
    background: transparent;
    border-radius: 5px;
    box-shadow: none;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar-rail-toggle:hover .sidebar-rail-toggle__btn {
    filter: none;
    background: color-mix(in srgb, var(--sidebar-text) 10%, var(--sidebar-bg));
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar-rail-toggle__icon {
    font-size: 14px;
    font-weight: 600;
    color: var(--sidebar-text);
}
body.sidebar-compact.sidebar-expanded .sidebar-rail-toggle {
    right: var(--space-3);
    top: var(--space-4);
    transform: none;
    width: auto;
    height: auto;
    z-index: 25;
}
.sidebar-rail-toggle__track {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 58px;
    margin-right: -1px;
    background: var(--sidebar-bg);
    border: 1px solid var(--ds-border);
    border-left: none;
    border-radius: 12px 12px 12px 0;
    box-sizing: border-box;
    box-shadow: -2px 0 0 var(--sidebar-bg);
}
.sidebar-rail-toggle__track::before,
.sidebar-rail-toggle__track::after {
    content: "";
    position: absolute;
    left: 0;
    width: 12px;
    height: 12px;
    background: transparent;
    pointer-events: none;
}
.sidebar-rail-toggle__track::before {
    top: -12px;
    border-bottom-left-radius: 12px;
    box-shadow: -6px 6px 0 0 var(--sidebar-bg);
}
.sidebar-rail-toggle__track::after {
    bottom: -12px;
    border-top-left-radius: 12px;
    box-shadow: -6px -6px 0 0 var(--sidebar-bg);
}
.sidebar-rail-toggle__btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FFCF33;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(26, 26, 26, 0.08);
}
.sidebar-rail-toggle:hover .sidebar-rail-toggle__btn {
    filter: brightness(0.98);
}
.sidebar-rail-toggle__icon {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: #1A1A1A;
    transition: transform var(--ds-motion-mid) var(--ds-ease-out);
}
.sidebar-rail-toggle.is-expanded .sidebar-rail-toggle__icon {
    transform: rotate(180deg);
}
body.sidebar-compact.sidebar-expanded .sidebar-rail-toggle__track {
    width: 36px;
    height: 36px;
    margin-right: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
}
body.sidebar-compact.sidebar-expanded .sidebar-rail-toggle__track::before,
body.sidebar-compact.sidebar-expanded .sidebar-rail-toggle__track::after {
    display: none;
}
body.sidebar-compact.sidebar-expanded .sidebar-rail-toggle__btn {
    width: 100%;
    height: 100%;
    background: transparent;
}
body.sidebar-compact.sidebar-expanded .sidebar-rail-toggle__icon {
    font-size: 20px;
    color: var(--ds-text-secondary);
}

.logo-settings-bar {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.logo-settings-bar__topbar-mock {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 var(--ds-content-pad);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
}
.logo-settings-bar__slot {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 44px;
    padding: 6px 12px;
    background: var(--ds-surface-muted);
    border: 1px dashed var(--ds-border-strong);
    border-radius: var(--radius-sm);
    max-width: 200px;
}
.logo-settings-bar__slot img {
    max-height: 32px;
    max-width: 100%;
    object-fit: contain;
}
.logo-settings-bar__slot img:not([hidden]) + .logo-settings-bar__placeholder { display: none; }
.logo-settings-bar__placeholder {
    font-size: var(--text-xs);
    color: var(--ds-text-tertiary);
}
.logo-settings-bar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}
.logo-settings-bar--drag .logo-settings-bar__slot {
    border-color: var(--ds-primary);
    background: var(--ds-surface-muted);
}


.cal-page-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(148px, 1fr));
    gap: var(--ds-dashboard-gap);
    margin-bottom: 0;
}

.logo-dropzone {
    border: 1px dashed var(--ds-border-strong);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    background: var(--ds-surface-muted);
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.logo-dropzone--drag {
    border-color: var(--ds-primary);
    background: var(--ds-surface-muted);
}
.logo-dropzone__icon {
    font-size: 32px;
    color: var(--ds-text-secondary);
    display: block;
    margin: 0 auto var(--space-2);
}
.logo-dropzone__text {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
}
.logo-dropzone__link {
    border: none;
    background: none;
    color: var(--ds-text);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.logo-dropzone__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    margin-bottom: var(--space-3);
}
.logo-dropzone__preview img {
    max-height: 40px;
    max-width: 200px;
    object-fit: contain;
}


.report-wizard-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-shrink: 0;
}
.report-wizard-toolbar__search { flex: 1; min-width: 0; }
.report-wizard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: var(--ds-dashboard-gap);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.report-wizard-grid--split {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.report-wizard-grid--equal {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.report-wizard-step-view {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.report-wizard-step-view > .entity-view-scroll {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.report-wizard-step-view .report-wizard-grid {
    padding: 0 var(--ds-page-pad-x) var(--space-4);
    box-sizing: border-box;
}
.report-wizard-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    margin: 0;
    padding: 0;
}
.report-wizard-panel__head {
    display: flex;
    align-items: center;
    min-height: var(--ds-card-header-height);
    padding: 0 var(--ds-card-inset-x);
    border-bottom: 1px solid var(--ds-border);
    flex-shrink: 0;
}
.report-wizard-panel__title {
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ds-text);
}
.report-wizard-panel__footer {
    justify-content: flex-start;
}
.report-wizard-panel h3 {
    margin: 0 0 var(--space-3);
    font-size: var(--text-md);
    font-weight: 600;
}
.report-wizard-panel .ds-content-inset--scroll {
    flex: 1;
    min-height: 0;
    margin-top: var(--space-2);
}
.report-wizard-panel__body {
    flex: 1;
    min-height: 0;
    overflow: visible;
    margin-top: var(--space-2);
}
.report-wizard-footer {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--ds-border);
    flex-shrink: 0;
}
.report-wizard-footer__count {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-right: auto;
    margin-bottom: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text-secondary);
    white-space: nowrap;
}
.report-wizard-panel__footer.ds-card__footer--schedule {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ── Report wizard · product table (dziedziczy .ds-entity-list-view + .data-table--products) ── */
.report-wizard-panel .data-table.data-table--products {
    width: max(100%, var(--ds-entity-table-min-w-products));
    min-width: var(--ds-entity-table-min-w-products);
    max-width: none;
}
.report-wizard-panel .data-table.data-table--products col.data-table__col-check { width: 0; }
.report-wizard-panel .data-table.data-table--products col.data-table__col-name { width: auto; }
.report-wizard-panel .data-table.data-table--products col.data-table__col-status { width: auto; }
.report-wizard-panel .data-table.data-table--products col.data-table__col-report-action { width: auto; }
.report-wizard-panel .entity-list .data-table.data-table--products thead th.data-table__col-check,
.report-wizard-panel .ds-scroll-lane__inset .data-table.data-table--products thead th.data-table__col-check {
    width: var(--ds-entity-check-col-w-padded);
    min-width: var(--ds-entity-check-col-w-padded);
    max-width: var(--ds-entity-check-col-w-padded);
    padding-top: var(--ds-table-head-pad-y);
    padding-bottom: var(--ds-table-head-pad-y);
    padding-left: var(--ds-entity-check-col-pad-start);
    padding-right: var(--ds-entity-check-gap);
    box-sizing: border-box;
    text-align: left;
    line-height: 1;
}
.report-wizard-panel .entity-list .data-table.data-table--products tbody td.data-table__cell-check,
.report-wizard-panel .ds-scroll-lane__inset .data-table.data-table--products tbody td.data-table__cell-check {
    width: var(--ds-entity-check-col-w-padded);
    min-width: var(--ds-entity-check-col-w-padded);
    max-width: var(--ds-entity-check-col-w-padded);
    padding-top: var(--ds-entity-row-pad-y);
    padding-bottom: var(--ds-entity-row-pad-y);
    padding-left: var(--ds-entity-check-col-pad-start);
    padding-right: var(--ds-entity-check-gap);
    box-sizing: border-box;
    text-align: left;
    line-height: 1;
}
.report-wizard-panel .data-table.data-table--products:has(col.data-table__col-check) :is(
    thead th.data-table__col-code,
    tbody td.data-table__cell-code,
    thead th.data-table__col-name,
    tbody td.data-table__cell-name
) {
    padding-left: 0;
}
.report-wizard-panel .data-table.data-table--products .data-table__cell-check .ds-check.ds-check--table {
    width: auto;
    margin: 0;
    gap: 0;
    line-height: 1;
    min-height: 0;
    height: var(--ds-entity-check-box-w);
    justify-content: flex-start;
    align-items: center;
}
.report-wizard-panel .data-table thead th.data-table__col-report-action,
.report-wizard-panel .data-table__cell-report-action {
    text-align: left;
    white-space: nowrap;
    min-width: 5.5rem;
    width: auto;
    overflow: visible;
    text-overflow: clip;
    padding-left: var(--space-2);
    padding-right: var(--ds-entity-list-pad-x);
}
.report-wizard-panel .data-table__cell-report-action .btn { margin-left: 0; }
.report-wizard-panel .data-table__cell-report-action .btn.btn--danger:focus-visible {
    outline: 2px solid var(--ds-danger);
    outline-offset: 2px;
}
.report-wizard-panel .data-table.data-table--products .data-table__cell-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.report-wizard-panel .data-table.data-table--products th.data-table__col-status,
.report-wizard-panel .data-table.data-table--products .data-table__cell-status {
    width: auto;
    min-width: 9.5rem;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    vertical-align: middle;
    padding-right: var(--space-3);
}
.report-wizard-panel .data-table.data-table--products .data-table__cell-status .ds-status-badge {
    width: fit-content;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    vertical-align: middle;
}
.report-wizard-panel .ds-scroll-lane__inset .entity-list .data-table.data-table--products,
.report-wizard-panel .ds-scroll-lane__inset .data-table.data-table--products {
    min-width: var(--ds-entity-table-min-w-products);
    width: max(100%, var(--ds-entity-table-min-w-products));
    max-width: none;
}

/* Kreator raportu — kompaktowa tabela (kod, nazwa, lokalizacja, status) */
.report-wizard-panel .data-table--report-picker {
    width: max(100%, var(--ds-entity-table-min-w-products));
    min-width: var(--ds-entity-table-min-w-products);
    max-width: none;
    table-layout: fixed;
}
.report-wizard-panel .data-table--report-picker col.data-table__col-check { width: 0; }
.report-wizard-panel .data-table--report-picker col.data-table__col-code { width: auto; }
.report-wizard-panel .data-table--report-picker col.data-table__col-name { width: auto; }
.report-wizard-panel .data-table--report-picker col.data-table__col-location { width: auto; }
.report-wizard-panel .data-table--report-picker col.data-table__col-status { width: auto; }
.report-wizard-panel .data-table--report-picker col.data-table__col-report-action { width: auto; }
.report-wizard-panel .data-table--report-picker :is(
    thead th.data-table__col-status,
    tbody td.data-table__cell-status
) {
    min-width: 9.5rem;
    width: auto;
    overflow: visible;
    text-overflow: clip;
}
.report-wizard-panel .data-table--report-picker :is(
    thead th.data-table__col-report-action,
    tbody td.data-table__cell-report-action
) {
    min-width: 5.5rem;
    width: auto;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}
.report-wizard-panel .data-table--report-selected .data-table__cell-report-action {
    text-align: center;
    padding-right: var(--ds-row-kebab-pad-end);
}
.report-wizard-panel .data-table--report-selected .data-table__cell-report-action .btn {
    margin: 0 auto;
}

/* ── QR scanner modal ── */
.qr-reader-stack { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.qr-reader-wrap {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--ds-border);
    min-height: 260px;
    background: linear-gradient(165deg, #3a3a42 0%, #222228 55%, #1a1a20 100%);
    display: grid;
    place-items: center;
    color: var(--ds-text-tertiary);
    font-size: var(--text-sm);
}
.qr-reader-wrap__mount {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.qr-reader-wrap__mount:empty { display: none; }
.qr-reader-wrap__mount:not(:empty) + .qr-reader-wrap__placeholder { display: none; }
.qr-reader-wrap__placeholder { position: relative; z-index: 0; pointer-events: none; }
.qr-reader-wrap__viewport {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58%;
    max-width: 220px;
    aspect-ratio: 1;
    overflow: hidden;
    border: 2px solid var(--ds-brand-cta);
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.48);
    z-index: 2;
    pointer-events: none;
}
.qr-reader-wrap__scan {
    position: absolute;
    left: 8%;
    right: 8%;
    height: 2px;
    top: 12%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 207, 51, 0.95) 50%, transparent 100%);
    box-shadow: 0 0 10px rgba(255, 207, 51, 0.85);
    animation: qr-line-viewport 2.4s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}
@keyframes qr-line-viewport { 0%, 100% { top: 10%; opacity: 0.75; } 50% { top: 90%; opacity: 1; } }
.qr-reader-wrap--error .qr-reader-wrap__viewport {
    border-color: var(--ds-danger);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.48);
}
.qr-reader-wrap--error .qr-reader-wrap__scan { display: none; }
.qr-reader-wrap__toast {
    position: static;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: var(--ds-type-caption-size);
    font-weight: var(--ds-type-caption-weight);
    background: var(--ds-danger-soft);
    color: var(--ds-danger);
    border: 1px solid var(--ds-status-border-fail);
}
.modal-qr-scanner { max-width: 420px; width: 100%; }
.modal-qr-hint {
    font-size: var(--ds-type-body-size);
    color: var(--ds-color-text-2);
    margin: 0 0 16px;
}

/* ── Dark theme ── */
html[data-theme="dark"] {
    --ds-bg: #1a1a1a;
    --ds-surface: #242424;
    --ds-surface-muted: #2c2c2c;
    --ds-table-head-bg: #212121;
    --ds-surface-hover: #363636;
    --ds-border: #3a3a3a;
    --ds-border-strong: #4a4a4a;
    --ds-border-emphasis: #606060;
    --ds-interactive-hover-bg: #323238;
    --ds-interactive-hover-border: #62626e;
    --ds-interactive-active-bg: #3c3c44;
    --ds-interactive-focus-border: var(--ds-brand-cta);
    --ds-interactive-focus-ring: 0 0 0 3px var(--ds-brand-tint-22);
    --ds-focus-ring-field: var(--ds-interactive-focus-ring);
    --ds-btn-border-color-hover: var(--ds-interactive-hover-border);
    --ds-field-hover-bg: var(--ds-surface);
    --ds-row-hover-bg: color-mix(in srgb, var(--ds-brand-cta) 14%, var(--ds-surface));
    --ds-row-hover-bg-strong: color-mix(in srgb, var(--ds-brand-cta) 22%, var(--ds-surface));
    --ds-text: #f4f4f5;
    --ds-text-secondary: #a1a1aa;
    --ds-text-tertiary: #71717a;
    --ds-primary: #f4f4f5;
    --ds-primary-hover: #ffffff;
    --ds-primary-active: #e4e4e7;
    --ds-btn-primary-bg: #FFCF33;
    --ds-btn-primary-hover: #FFD966;
    --ds-btn-primary-active: #E6BA2E;
    --ds-btn-primary-text: #1A1A1A;
    --ds-brand-cta-soft: #4A4028;
    --ds-brand-cta-subtle: #5C502E;
    --ds-success: #4ade80;
    --ds-success-soft: #14532d;
    --ds-warning: var(--ds-brand-cta);
    --ds-warning-soft: #2C2818;
    --ds-danger: #f87171;
    --ds-danger-soft: #450a0a;
    --ds-color-text-4: #52525b;
    --ds-color-text-disabled: var(--ds-color-text-4);
    --ds-status-bg-ok: #064e3b;
    --ds-status-text-ok: #6ee7b7;
    --ds-status-border-ok: rgba(110, 231, 183, 0.45);
    --ds-status-bg-fail: #450a0a;
    --ds-status-text-fail: #fca5a5;
    --ds-status-border-fail: rgba(252, 165, 165, 0.42);
    --ds-status-bg-warn: #2C2818;
    --ds-status-text-warn: var(--ds-brand-cta);
    --ds-status-border-warn: color-mix(in srgb, var(--ds-brand-cta) 42%, transparent);
    --ds-status-bg-neutral: var(--ds-surface-muted);
    --ds-status-text-neutral: var(--ds-text-secondary);
    --ds-status-border-neutral: rgba(244, 244, 245, 0.22);
    --ds-status-bg-accent: color-mix(in srgb, var(--ds-blue) 18%, var(--ds-surface));
    --ds-status-text-accent: #93C5FD;
    --ds-status-border-accent: color-mix(in srgb, var(--ds-blue) 45%, transparent);
    --ds-count-badge-bg: var(--ds-surface-muted);
    --ds-count-badge-text: var(--ds-text);
    --ds-count-badge-border: var(--ds-border);
    --ds-scrollbar-thumb: rgba(161, 161, 170, 0.45);
    --ds-scrollbar-thumb-hover: #FFCF33;
    --sidebar-bg: #171717;
    --account-nav-bg: var(--ds-bg);
    --sidebar-text: #a1a1aa;
    --sidebar-text-active: #f4f4f5;
    --sidebar-active-bg: #2e2e2e;
    --bg-color: #1a1a1a;
    --card-bg: #242424;
    --input-bg: #2c2c2c;
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --border-color: #3a3a3a;
    --bg-elevated: #242424;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.24), 0 8px 24px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] body { background: var(--ds-bg); color: var(--ds-text); }
html[data-theme="dark"] .sidebar { background: var(--sidebar-bg); border-color: var(--ds-border); }
html[data-theme="dark"] .sidebar-header h2,
html[data-theme="dark"] .brand-title,
html[data-theme="dark"] .sidebar-tagline { color: var(--ds-text); }
html[data-theme="dark"] .sidebar-tagline { color: var(--ds-text-tertiary); }
html[data-theme="dark"] .nav-item { color: var(--sidebar-text); }
html[data-theme="dark"] .nav-item .material-symbols-outlined { color: var(--sidebar-text); }
html[data-theme="dark"] .nav-item:hover {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-active);
}
html[data-theme="dark"] .nav-item:hover .material-symbols-outlined { color: var(--sidebar-text-active); }
html[data-theme="dark"] .nav-item.active {
    background: #FFCF33;
    color: #1A1A1A;
}
html[data-theme="dark"] .nav-item.active .material-symbols-outlined { color: #1A1A1A; }
html[data-theme="dark"] .nav-item.logout { color: var(--sidebar-text); }
html[data-theme="dark"] .nav-item.logout .material-symbols-outlined,
html[data-theme="dark"] .nav-item.logout .nav-item__text { color: var(--sidebar-text); }
html[data-theme="dark"] .nav-item.logout:hover,
html[data-theme="dark"] .nav-item.logout:focus-visible {
    background: rgba(248, 113, 113, 0.1);
    color: var(--ds-danger);
    border-color: color-mix(in srgb, var(--ds-danger) 32%, var(--ds-border));
    box-shadow: none;
    outline: none;
}
html[data-theme="dark"] .nav-item.logout:hover .material-symbols-outlined,
html[data-theme="dark"] .nav-item.logout:hover .nav-item__text,
html[data-theme="dark"] .nav-item.logout:focus-visible .material-symbols-outlined,
html[data-theme="dark"] .nav-item.logout:focus-visible .nav-item__text {
    color: var(--ds-danger);
}
html[data-theme="dark"] .nav-item.logout:active {
    background: rgba(248, 113, 113, 0.22);
    color: var(--ds-danger);
}
html[data-theme="dark"] .nav-item.logout:active .material-symbols-outlined,
html[data-theme="dark"] .nav-item.logout:active .nav-item__text {
    color: var(--ds-danger);
}
html[data-theme="dark"] .topbar { background: var(--ds-surface); border-color: var(--ds-border); }
html[data-theme="dark"] .account-section-header,
html[data-theme="dark"] .ds-page-header,
html[data-theme="dark"] .ds-account-view .ds-page-header {
    background: var(--ds-surface);
    border-color: var(--ds-border);
    color: var(--ds-text);
}
html[data-theme="dark"] .account-section-header__title,
html[data-theme="dark"] .ds-page-header__title { color: var(--ds-text); }
html[data-theme="dark"] .ds-card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .notif-dropdown,
html[data-theme="dark"] .notification-card--compact,
html[data-theme="dark"] .notification-card--page {
    background: var(--ds-surface);
    border-color: var(--ds-border);
    color: var(--ds-text);
}
html[data-theme="dark"] .global-search { background: var(--ds-surface-muted); border-color: var(--ds-border); }
html[data-theme="dark"] .global-search:hover:not(:focus-within) {
    border-color: var(--ds-interactive-hover-border);
}
html[data-theme="dark"] .global-search:focus-within {
    background: var(--ds-surface);
    border: 1px solid var(--ds-interactive-focus-border);
    box-shadow: var(--ds-interactive-focus-ring);
}
html[data-theme="dark"] .icon-btn { background: var(--ds-surface-muted); color: var(--ds-text-secondary); }
html[data-theme="dark"] .icon-btn:hover { background: var(--ds-surface-hover); border-color: var(--ds-btn-border-color-hover); color: var(--ds-text); }
html[data-theme="dark"] .topbar .icon-btn.icon-btn--active,
html[data-theme="dark"] .topbar .icon-btn.icon-btn--active:hover,
html[data-theme="dark"] .topbar .icon-btn.icon-btn--active:focus-visible {
    background: var(--ds-primary) !important;
    border-color: var(--ds-primary) !important;
    border-width: var(--ds-btn-border-width);
    color: #fff !important;
    transform: none !important;
    box-shadow: none !important;
}
html[data-theme="dark"] .topbar .icon-btn.icon-btn--active:hover .material-symbols-outlined,
html[data-theme="dark"] .topbar .icon-btn.icon-btn--active:focus-visible .material-symbols-outlined {
    transform: scale(1.14) rotate(-8deg);
}
html[data-theme="dark"] .topbar .icon-btn.icon-btn--active .material-symbols-outlined { color: #fff !important; }
html[data-theme="dark"] .kpi-card--total {
    --kpi-accent: #60a5fa;
    --kpi-accent-soft: color-mix(in srgb, var(--ds-blue) 12%, transparent);
}
html[data-theme="dark"] .kpi-card--ok {
    --kpi-accent: #4ade80;
    --kpi-accent-soft: color-mix(in srgb, var(--ds-success) 16%, transparent);
}
html[data-theme="dark"] .kpi-card--warn {
    --kpi-accent: var(--ds-brand-cta);
    --kpi-accent-soft: var(--ds-status-bg-warn);
}
html[data-theme="dark"] .account-subnav-accordion__option.is-active,
html[data-theme="dark"] .account-subnav-dropdown__option.is-active,
html[data-theme="dark"] .account-subnav-sheet__option.is-active {
    background: var(--ds-brand-cta-subtle);
    color: var(--ds-text);
}
html[data-theme="dark"] .entity-card:hover {
    background: var(--ds-brand-cta-subtle);
    border-color: var(--ds-brand-tint-35);
}
html[data-theme="dark"] .kpi-card--fail {
    --kpi-accent: #DC2626;
    --kpi-accent-soft: color-mix(in srgb, #DC2626 18%, transparent);
}
html[data-theme="dark"] .kpi-card--fail .kpi-card__value,
html[data-theme="dark"] .kpi-card--fail .kpi-card__icon-box {
    color: #DC2626;
}
html[data-theme="dark"] .kpi-card--fail .kpi-card__icon-box {
    background: color-mix(in srgb, #DC2626 18%, transparent);
}
html[data-theme="dark"] .kpi-card--fail .kpi-card__bar {
    background: #DC2626;
}
html[data-theme="dark"] .ds-list-item { background: var(--ds-surface); border-color: var(--ds-border); }
html[data-theme="dark"] .ds-list-item:hover { background: var(--ds-interactive-hover-bg); border-color: var(--ds-interactive-hover-border); }
html[data-theme="dark"] .custom-select-trigger,
html[data-theme="dark"] .ds-account-view .form-group input:not([type="checkbox"]),
html[data-theme="dark"] .ds-account-view .form-group select {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border);
    color: var(--ds-text);
}
html[data-theme="dark"] .chart-type-picker { background: var(--ds-surface-muted); }
html[data-theme="dark"] .chart-type-btn.active { background: var(--ds-surface); }
html[data-theme="dark"] .btn-secondary { background: var(--ds-surface-muted); color: var(--ds-text); }
html[data-theme="dark"] .btn-secondary:hover { background: var(--ds-surface-hover); border-color: var(--ds-btn-border-color-hover); }
html[data-theme="dark"] .btn-outline { background: transparent; color: var(--ds-text); border-color: var(--ds-btn-border-color); }
html[data-theme="dark"] .btn-outline:hover { background: var(--ds-surface-hover); border-color: var(--ds-btn-border-color-hover); color: var(--ds-text); }
html[data-theme="dark"] .btn-outline.btn-outline--active,
html[data-theme="dark"] .btn-outline.btn-outline--active:hover,
html[data-theme="dark"] .btn-outline.btn-outline--active:focus-visible:not(:disabled) {
    background: transparent;
    border-color: var(--ds-interactive-focus-border);
    box-shadow: var(--ds-interactive-focus-ring);
}
html[data-theme="dark"] .view-toolbar__actions [id^="btn-toggle-filters"].btn-outline:not(.btn-outline--active):hover:not(:disabled),
html[data-theme="dark"] .view-toolbar__actions .view-toolbar__mobile-toggle.btn-outline:not(.btn-outline--active):hover:not(:disabled) {
    background: transparent;
}
html[data-theme="dark"] .view-toolbar__actions [id^="btn-toggle-filters"].btn-outline--active,
html[data-theme="dark"] .view-toolbar__actions [id^="btn-toggle-filters"].btn-outline--active:hover:not(:disabled),
html[data-theme="dark"] .view-toolbar__actions [id^="btn-toggle-filters"].btn-outline--active:focus-visible:not(:disabled),
html[data-theme="dark"] .view-toolbar__actions .view-toolbar__mobile-toggle.btn-outline--active,
html[data-theme="dark"] .view-toolbar__actions .view-toolbar__mobile-toggle.btn-outline--active:hover:not(:disabled),
html[data-theme="dark"] .view-toolbar__actions .view-toolbar__mobile-toggle.btn-outline--active:focus-visible:not(:disabled) {
    background: var(--ds-brand-cta-soft);
    border-color: color-mix(in srgb, var(--ds-brand-cta) 45%, var(--ds-border));
    color: var(--ds-text);
}
html[data-theme="dark"] .btn-ghost { color: var(--ds-text-secondary); }
html[data-theme="dark"] .btn-ghost:hover { background: var(--ds-surface-hover); color: var(--ds-text); }
html[data-theme="dark"] .btn-primary {
    background: var(--ds-btn-primary-bg, #FFCF33);
    border-color: var(--ds-btn-primary-bg, #FFCF33);
    color: var(--ds-btn-primary-text, #1A1A1A);
}
html[data-theme="dark"] .btn-primary:hover {
    background: var(--ds-btn-primary-hover, #FFD966);
    border-color: var(--ds-btn-primary-hover, #FFD966);
    color: var(--ds-btn-primary-text, #1A1A1A);
}
html[data-theme="dark"] .btn-primary:active {
    background: var(--ds-btn-primary-active, #E6BA2E);
    border-color: var(--ds-btn-primary-active, #E6BA2E);
}
html[data-theme="dark"] .btn-primary .material-symbols-outlined { color: var(--ds-btn-primary-text, #1A1A1A); }
html[data-theme="dark"] .btn-brand {
    background: var(--ds-brand-cta);
    border-color: var(--ds-brand-cta-border);
    color: var(--ds-brand-cta-text);
}
html[data-theme="dark"] .btn-brand:hover {
    background: var(--ds-brand-cta-hover);
    border-color: var(--ds-brand-cta-hover);
    color: var(--ds-brand-cta-text);
}
html[data-theme="dark"] .btn-brand:active {
    background: var(--ds-brand-cta-active);
    border-color: var(--ds-brand-cta-active);
}
html[data-theme="dark"] .btn-brand .material-symbols-outlined { color: var(--ds-brand-cta-text); }
html[data-theme="dark"] .filter-bar__clear {
    background: transparent;
    border: none;
    color: var(--ds-text-secondary);
}
html[data-theme="dark"] .filter-bar__clear:hover {
    background: var(--ds-surface-hover);
    color: var(--ds-text);
}
html[data-theme="dark"] .filter-bar__clear .material-symbols-outlined { color: var(--ds-text-tertiary); }
html[data-theme="dark"] .filter-bar__clear:hover .material-symbols-outlined { color: var(--ds-text-secondary); }
html[data-theme="dark"] .btn-ghost.btn--danger:hover,
html[data-theme="dark"] .btn-outline.btn--danger:hover {
    background: rgba(248, 113, 113, 0.12);
    border-color: var(--ds-danger);
    color: var(--ds-danger);
}
html[data-theme="dark"] .btn-accent {
    background: var(--ds-btn-primary-bg, #FFCF33);
    border-color: var(--ds-btn-primary-active, #E6BA2E);
    color: var(--ds-btn-primary-text, #1A1A1A);
}
html[data-theme="dark"] .btn-accent:hover {
    background: var(--ds-btn-primary-hover, #FFD966);
    color: var(--ds-btn-primary-text, #1A1A1A);
}
html[data-theme="dark"] .btn-accent .material-symbols-outlined { color: var(--ds-btn-primary-text, #1A1A1A); }
html[data-theme="dark"] .btn-footer.btn-outline {
    background: transparent;
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
}
html[data-theme="dark"] .btn-footer.btn-outline:hover {
    background: var(--ds-surface-hover);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
}
html[data-theme="dark"] .btn-footer.btn-outline:hover .material-symbols-outlined { color: var(--ds-text); }
html[data-theme="dark"] .cal-cell--has-events:not(.cal-cell--selected) { background: var(--ds-surface); border-color: var(--ds-border-strong); }
html[data-theme="dark"] .cal-cell--selected,
html[data-theme="dark"] .cal-cell--selected:hover {
    background: #3D3419;
    border-color: #FFCF33;
    color: var(--ds-text);
    box-shadow: none;
}
html[data-theme="dark"] .cal-cell--selected .cal-cell__count {
    background: #FFCF33;
    color: #1A1A1A;
}
html[data-theme="dark"] .cal-cell__count {
    background: #FFCF33;
    color: #1A1A1A;
}
html[data-theme="dark"] .cal-cell:hover:not(.cal-cell--muted):not(.cal-cell--selected),
html[data-theme="dark"] #dash-calendar-module .cal-cell--in-month:hover:not(.cal-cell--selected):not(.cal-cell--muted),
html[data-theme="dark"] #cal-page-module .cal-cell--in-month:hover:not(.cal-cell--selected):not(.cal-cell--muted) {
    background: transparent !important;
    border: 1px solid var(--ds-border-emphasis) !important;
    box-shadow: none !important;
}
html[data-theme="dark"] .cal-cell:active:not(.cal-cell--muted):not(.cal-cell--selected),
html[data-theme="dark"] #dash-calendar-module .cal-cell--in-month:active:not(.cal-cell--selected):not(.cal-cell--muted),
html[data-theme="dark"] #cal-page-module .cal-cell--in-month:active:not(.cal-cell--selected):not(.cal-cell--muted) {
    background: var(--ds-surface-muted);
}
html[data-theme="dark"] .notification-card--page.unread,
html[data-theme="dark"] .notification-card--compact.unread { background: var(--ds-surface); }
html[data-theme="dark"] .dashboard-scroll { background: var(--ds-bg); }
html[data-theme="dark"] .module-list--dashboard .ds-list-item--interactive:hover,
html[data-theme="dark"] .module-list--dashboard .ds-list-item--has-menu:hover,
html[data-theme="dark"] .notifications-feed--page .notif-list-item:hover {
    background: var(--ds-surface-muted);
}
html[data-theme="dark"] .notif-feed > .notif-row:hover {
    background: transparent;
    border-bottom-color: var(--ds-border-emphasis);
    box-shadow:
        inset 1px 0 0 var(--ds-border-emphasis),
        inset -1px 0 0 var(--ds-border-emphasis);
}
html[data-theme="dark"] .notifications-feed--page.module-list--dashboard > .notif-row:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border);
    box-shadow: none;
}
html[data-theme="dark"] .notif-feed > .notif-row:first-child:hover {
    box-shadow:
        inset 1px 0 0 var(--ds-border-emphasis),
        inset -1px 0 0 var(--ds-border-emphasis),
        inset 0 1px 0 var(--ds-border-emphasis);
}
html[data-theme="dark"] .notif-feed > .notif-row:last-child:hover {
    box-shadow:
        inset 1px 0 0 var(--ds-border-emphasis),
        inset -1px 0 0 var(--ds-border-emphasis),
        inset 0 -1px 0 var(--ds-border-emphasis);
}
html[data-theme="dark"] .notif-feed > .notif-row:only-child:hover {
    box-shadow: inset 0 0 0 1px var(--ds-border-emphasis);
}
html[data-theme="dark"] .notifications-feed--page .notif-list-item:hover {
    background: transparent;
    box-shadow:
        inset 1px 0 0 var(--ds-border-emphasis),
        inset -1px 0 0 var(--ds-border-emphasis);
}
html[data-theme="dark"] .notif-detail-card__icon.blue {
    background: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .media-upload__zone {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
}
html[data-theme="dark"] .media-upload[data-media-variant="avatar"] .media-upload__zone-wrap:has(.media-upload__avatar-alt) {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
}
html[data-theme="dark"] .media-upload__zone:hover,
html[data-theme="dark"] .media-upload__zone:focus-visible {
    background: var(--ds-row-hover-bg);
    border-color: var(--ds-brand-cta-border);
}
html[data-theme="dark"] .media-upload[data-media-variant="avatar"] .media-upload__zone-wrap:has(.media-upload__avatar-alt):has(.media-upload__zone:hover),
html[data-theme="dark"] .media-upload[data-media-variant="avatar"] .media-upload__zone-wrap:has(.media-upload__avatar-alt):has(.media-upload__zone:focus-visible) {
    background: var(--ds-row-hover-bg);
    border-color: var(--ds-brand-cta-border);
}
html[data-theme="dark"] .media-upload__zone:hover .media-upload__glyph,
html[data-theme="dark"] .media-upload__zone:focus-visible .media-upload__glyph {
    background: var(--ds-brand-cta-subtle);
    border-color: var(--ds-brand-cta-border);
    color: var(--ds-brand-cta);
}
html[data-theme="dark"] .media-upload__glyph {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--ds-border-strong);
    color: var(--ds-text-secondary);
}
html[data-theme="dark"] .theme-preview-card {
    background: var(--ds-surface);
    border-color: var(--ds-border);
}
html[data-theme="dark"] .theme-preview-card[aria-pressed="true"] {
    background: var(--ds-success-soft);
    border-color: var(--ds-success);
}
html[data-theme="dark"] .ds-card__header,
html[data-theme="dark"] .ds-card__footer {
    background: var(--ds-surface);
    border-color: var(--ds-border);
}
html[data-theme="dark"] .form-group label { color: var(--ds-color-text-2); }
html[data-theme="dark"] .form-group input:not([type="checkbox"]),
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border);
    color: var(--ds-text);
}
html[data-theme="dark"] .cal-time-grid,
html[data-theme="dark"] .cal-day-mini {
    background: var(--ds-surface);
    border-color: var(--ds-border);
}
html[data-theme="dark"] .cal-time-grid__header,
html[data-theme="dark"] .cal-time-grid__gutter,
html[data-theme="dark"] .cal-time-grid__hour,
html[data-theme="dark"] .cal-day-mini__hour,
html[data-theme="dark"] .cal-day-mini__allday {
    background: var(--ds-surface-muted);
}
html[data-theme="dark"] .cal-time-grid__dayhead.is-today {
    background: #5A4F2D;
}
html[data-theme="dark"] .cal-time-grid__row.is-current-hour .cal-time-grid__hour span,
html[data-theme="dark"] .cal-day-mini__row.is-current-hour .cal-day-mini__hour span {
    color: var(--ds-success);
}

.nav-item.logout:hover,
.nav-item.logout:focus-visible {
    background: color-mix(in srgb, var(--ds-danger-soft) 72%, transparent);
    color: var(--ds-danger);
    border-color: color-mix(in srgb, var(--ds-danger) 28%, var(--ds-border));
    transform: none;
    box-shadow: none;
    outline: none;
}
.nav-item.logout:hover .material-symbols-outlined,
.nav-item.logout:hover .nav-item__text,
.nav-item.logout:focus-visible .material-symbols-outlined,
.nav-item.logout:focus-visible .nav-item__text {
    color: var(--ds-danger);
}
.nav-item.logout:active {
    background: color-mix(in srgb, var(--ds-danger) 10%, var(--ds-danger-soft));
    color: var(--ds-danger);
    border-color: color-mix(in srgb, var(--ds-danger) 36%, var(--ds-border));
    transform: none;
}
.nav-item.logout:active .material-symbols-outlined,
.nav-item.logout:active .nav-item__text {
    color: var(--ds-danger);
}

.form-control-select {
    width: 100%;
    padding: 10px 12px;
    font-size: var(--text-base);
    font-family: var(--font-ui);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    color: var(--ds-text);
}

/* ── View toolbar ── */

.app-view:not(.dashboard-view) { padding: var(--view-padding); }
.app-view.entity-view:not(.dashboard-view) {
    padding: var(--view-padding) 0 0;
}
.app-view.entity-view.dashboard-view {
    padding: 0 !important;
}
.app-view.entity-view.dashboard-view > .entity-view-scroll {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    gap: var(--ds-dashboard-gap);
    overflow: hidden;
}
.app-view.entity-view.dashboard-view > .entity-view-scroll > .ds-page-header {
    padding-inline: 0;
    flex-shrink: 0;
}
.app-view.entity-view.dashboard-view > .entity-view-scroll > .view-toolbar,
.app-view.entity-view.dashboard-view > .entity-view-scroll .entity-module-list-view > .view-toolbar,
.app-view.entity-view.dashboard-view > .entity-view-scroll #reports-list-view > .view-toolbar,
.app-view.entity-view.dashboard-view > .entity-view-scroll #audits-list-view > .view-toolbar {
    margin-inline: 0;
    margin-bottom: 0;
    flex-shrink: 0;
}
.app-view.entity-view.dashboard-view > .entity-view-scroll > .entity-list-card,
.app-view.entity-view.dashboard-view > .entity-view-scroll > .report-wizard-grid,
.app-view.entity-view.dashboard-view > .entity-view-scroll .entity-module-list-view,
.app-view.entity-view.dashboard-view > .entity-view-scroll #reports-list-view,
.app-view.entity-view.dashboard-view > .entity-view-scroll #audits-list-view,
.app-view.entity-view.dashboard-view > .entity-view-scroll #trash-list-view {
    flex: 1 1 0;
    min-height: 0;
    margin-inline: 0;
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.app-view.entity-view.dashboard-view > .entity-view-scroll .entity-module-list-view,
.app-view.entity-view.dashboard-view > .entity-view-scroll #reports-list-view,
.app-view.entity-view.dashboard-view > .entity-view-scroll #audits-list-view,
.app-view.entity-view.dashboard-view > .entity-view-scroll #trash-list-view {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: var(--ds-dashboard-gap);
}
.app-view.entity-view.dashboard-view > .entity-view-scroll .entity-module-list-view > .entity-list-card,
.app-view.entity-view.dashboard-view > .entity-view-scroll #reports-list-view > .entity-list-card,
.app-view.entity-view.dashboard-view > .entity-view-scroll #audits-list-view > .entity-list-card,
.app-view.entity-view.dashboard-view > .entity-view-scroll #trash-list-view > .entity-list-card {
    flex: 1 1 0;
    min-height: 0;
}
.entity-view:not(.dashboard-view) > .ds-page-header,
.entity-view:not(.dashboard-view) > .empty-state {
    padding-inline: var(--view-padding);
    box-sizing: border-box;
}
.entity-view:not(.dashboard-view) > .view-toolbar,
.entity-view:not(.dashboard-view) #reports-list-view > .view-toolbar {
    margin-inline: var(--view-padding);
}

/* ── Animacje ── */
@keyframes ds-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes ds-pop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes viewEnter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-layout > *,
.dashboard-body > * > * {
    animation: ds-fade-up 0.22s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.dashboard-kpi-row > *:nth-child(1) { animation-delay: 0.02s; }
.dashboard-kpi-row > *:nth-child(2) { animation-delay: 0.04s; }
.dashboard-kpi-row > *:nth-child(3) { animation-delay: 0.06s; }
.dashboard-kpi-row > *:nth-child(4) { animation-delay: 0.08s; }
.dashboard-body > .dashboard-row:nth-child(1) > *:nth-child(1) { animation-delay: 0.1s; }
.dashboard-body > .dashboard-row:nth-child(1) > *:nth-child(2) { animation-delay: 0.12s; }
.dashboard-body > .dashboard-row:nth-child(1) > *:nth-child(3) { animation-delay: 0.14s; }
.dashboard-body > .dashboard-row:nth-child(2) > *:nth-child(1) { animation-delay: 0.16s; }
.dashboard-body > .dashboard-row:nth-child(2) > *:nth-child(2) { animation-delay: 0.18s; }
.dashboard-body > .dashboard-row:nth-child(2) > *:nth-child(3) { animation-delay: 0.2s; }

.dashboard-4col > * {
    animation: ds-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.dashboard-4col > *:nth-child(1) { animation-delay: 0.02s; }
.dashboard-4col > *:nth-child(2) { animation-delay: 0.04s; }
.dashboard-4col > *:nth-child(3) { animation-delay: 0.06s; }
.dashboard-4col > *:nth-child(4) { animation-delay: 0.08s; }
.dashboard-4col > *:nth-child(5) { animation-delay: 0.1s; }
.dashboard-4col > *:nth-child(6) { animation-delay: 0.12s; }
.dashboard-4col > *:nth-child(7) { animation-delay: 0.14s; }
.dashboard-4col > *:nth-child(8) { animation-delay: 0.16s; }

.kpi-card {
    transition:
        border-color var(--ds-motion-mid) var(--ds-ease-out),
        box-shadow var(--ds-motion-mid) var(--ds-ease-out),
        transform var(--ds-motion-fast) var(--ds-ease-out);
}
#dash-calendar-module .cal-cell--in-month {
    transition:
        background var(--ds-motion-fast) var(--ds-ease-out),
        border-color var(--ds-motion-fast) var(--ds-ease-out),
        transform var(--ds-motion-fast) var(--ds-ease-out),
        box-shadow var(--ds-motion-fast) var(--ds-ease-out);
}
#dash-calendar-module .cal-cell--in-month:hover:not(.cal-cell--selected):not(.cal-cell--muted),
#cal-page-module .cal-cell--in-month:hover:not(.cal-cell--selected):not(.cal-cell--muted) {
    background: var(--ds-cal-hover-bg) !important;
    border: 1px solid var(--ds-cal-hover-border) !important;
    transform: none;
    box-shadow: none !important;
}
#dash-calendar-module .cal-cell--in-month:active:not(.cal-cell--selected):not(.cal-cell--muted),
#cal-page-module .cal-cell--in-month:active:not(.cal-cell--selected):not(.cal-cell--muted) {
    background: var(--ds-cal-hover-active-bg);
    border-color: var(--ds-cal-hover-border);
    transform: scale(0.98);
    box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
    .ds-actions-menu:not(.is-open) .ds-actions-menu__trigger {
        animation: none;
    }
    .ds-actions-menu__trigger::before {
        display: none;
    }
    .ds-actions-menu__panel,
    .dropdown-actions-content {
        filter: none;
    }
    .dropdown-actions__item,
    .dropdown-actions-content a {
        opacity: 1;
        transform: none;
        transition: background 0.14s ease;
    }
    .dropdown-actions.is-open .dropdown-actions__item,
    .dropdown-actions.is-open .dropdown-actions-content a {
        transition-delay: 0s;
    }
    .module-list--dashboard > .ds-list-item--interactive:hover,
    .notifications-feed--page .notif-list-item:hover,
    .kpi-card:hover,
    #dash-calendar-module .cal-cell--in-month:hover:not(.cal-cell--selected):not(.cal-cell--muted),
    .dropdown-actions > .icon-btn.ds-kebab-btn:hover,
    .dropdown-actions > .icon-btn.icon-btn--sm.icon-btn--ghost:hover,
    .nav-item:hover {
        transform: none;
    }
    .nav-item::before {
        display: none;
    }
}

/* Min. szerokość layoutu 360px (mobile ≤1080px) — bez transform scale na UI */
@media (max-width: 1080px) {
    .btn:not(:disabled):hover,
    .btn:not(:disabled):active,
    .icon-btn:not(:disabled):hover,
    .icon-btn:not(:disabled):active,
    .ds-beta-hero__cta:hover,
    .ds-beta-hero__cta:active,
    .cal-view-dropdown__trigger:active,
    .dropdown-actions__item:hover,
    .dropdown-actions__item:active,
    .dropdown-actions-content a:hover,
    .dropdown-actions-content a:active,
    .ds-actions-menu__item:hover,
    .ds-actions-menu__item:active,
    .ds-actions-menu__trigger:hover,
    .ds-actions-menu__trigger:active,
    .kpi-card:hover,
    .entity-card:hover,
    .ds-list-item--interactive:hover,
    .nav-item:hover,
    .nav-item:active,
    .mobile-bottom-nav__item:active,
    .filter-bar__clear:active,
    #dash-calendar-module .cal-cell--in-month:active:not(.cal-cell--selected):not(.cal-cell--muted),
    #cal-page-module .cal-cell--in-month:active:not(.cal-cell--selected):not(.cal-cell--muted) {
        transform: none !important;
    }

    .mobile-bottom-nav__item--scan:active {
        transform: translateY(calc(-50% + 4px)) !important;
    }

    .btn .material-symbols-outlined,
    .icon-btn:not(.icon-btn--topbar-refresh):not(.icon-btn--topbar-notifications):not(.icon-btn--topbar-settings):not(.topbar__menu-btn):not(.icon-btn--infield):not(.schedule-date-step__cal-btn):not(.ds-close-btn):not(.modal-close):not(.ds-kebab-btn):not([data-dialog-close]):not([data-panel-close]) .material-symbols-outlined,
    .icon-btn:not(.icon-btn--topbar-refresh):not(.icon-btn--topbar-notifications):not(.icon-btn--topbar-settings):not(.topbar__menu-btn):not(.icon-btn--infield):not(.schedule-date-step__cal-btn):not(.ds-close-btn):not(.modal-close):not(.ds-kebab-btn):not([data-dialog-close]):not([data-panel-close]):hover .material-symbols-outlined,
    .icon-btn:not(.icon-btn--topbar-refresh):not(.icon-btn--topbar-notifications):not(.icon-btn--topbar-settings):not(.topbar__menu-btn):not(.icon-btn--infield):not(.schedule-date-step__cal-btn):not(.ds-close-btn):not(.modal-close):not(.ds-kebab-btn):not([data-dialog-close]):not([data-panel-close]):active .material-symbols-outlined,
    .dropdown-actions__item .material-symbols-outlined,
    .dropdown-actions__item:hover .material-symbols-outlined,
    .dropdown-actions-content a .material-symbols-outlined,
    .dropdown-actions-content a:hover .material-symbols-outlined,
    .nav-item:hover:not(.active):not(.logout) .material-symbols-outlined,
    .topbar .icon-btn.icon-btn--active:hover .material-symbols-outlined,
    html[data-theme="dark"] .topbar .icon-btn.icon-btn--active:hover .material-symbols-outlined {
        transform: none !important;
        rotate: none !important;
    }

    .dropdown-actions-content,
    .ds-actions-menu__panel {
        filter: none;
        transform: none !important;
    }

    .dropdown-actions__item,
    .dropdown-actions-content a,
    .dropdown-actions.is-open .dropdown-actions__item,
    .dropdown-actions.is-open .dropdown-actions-content a {
        opacity: 1;
        transform: none !important;
        transition-delay: 0s !important;
    }

    .ds-dialog__panel,
    .ds-dialog.show .ds-dialog__panel,
    .ds-dialog.is-closing .ds-dialog__panel,
    .slide-panel__drawer,
    .slide-panel.show .slide-panel__drawer,
    .slide-panel.is-closing .slide-panel__drawer {
        transform: none !important;
    }

    .ds-check:hover .ds-check__box,
    label.ds-toggle:active .ds-toggle__track {
        transform: none !important;
    }
}

.ds-card {
    transition:
        border-color var(--ds-motion-mid) var(--ds-ease-out),
        box-shadow var(--ds-motion-mid) var(--ds-ease-out),
        transform var(--ds-motion-fast) var(--ds-ease-out);
}

/* ── Microinterakcje (globalne) ── */
.btn:not(:disabled):hover:not(.btn-outline--active):not(.auth-login-submit):not(.prod-code-download-btn),
.icon-btn:not(:disabled):hover:not(.icon-btn--active):not(.topbar__menu-btn):not(.ds-kebab-btn),
.ds-beta-hero__cta:hover {
    transform: translateY(-1px);
}
.btn:not(:disabled):active:not(.auth-login-submit):not(.prod-code-download-btn),
.icon-btn:not(:disabled):active:not(.topbar__menu-btn):not(.ds-kebab-btn),
.ds-beta-hero__cta:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.08s;
}
/* Kebab ⋮ — bez microinterakcji translate (stabilny layout w kartach i wierszach) */
:is(.dropdown-actions, .ds-row-kebab) > .icon-btn.ds-kebab-btn:not(:disabled):hover,
:is(.dropdown-actions, .ds-row-kebab) > .icon-btn.ds-kebab-btn:not(:disabled):active {
    transform: none;
}
.btn-primary:not(:disabled):hover:not(.auth-login-submit) {
    box-shadow: 0 4px 14px rgba(26, 26, 26, 0.14);
}
.btn-outline:not(:disabled):hover,
.btn-secondary:not(:disabled):hover {
    box-shadow: none;
}
.btn-accent:not(:disabled):hover,
.btn-brand:not(:disabled):hover {
    background: var(--ds-brand-cta-hover, #ffd966);
    box-shadow: 0 6px 18px rgba(255, 184, 0, 0.28);
}
.btn-accent:not(:disabled):active,
.btn-brand:not(:disabled):active {
    background: var(--ds-brand-cta-active, #e6a600);
}
.ds-beta-hero__cta:hover {
    background: var(--ds-primary-hover);
    border-color: var(--ds-primary-hover);
    color: #fff;
    box-shadow: 0 6px 18px rgba(26, 26, 26, 0.18);
}
.ds-beta-hero__cta:active {
    background: var(--ds-primary-active);
    border-color: var(--ds-primary-active);
    color: #fff;
}
.nav-item {
    position: relative;
    transition:
        background 0.24s cubic-bezier(0.34, 1.2, 0.64, 1),
        color 0.24s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.nav-item::before {
    display: none;
}
.nav-item .material-symbols-outlined {
    transition:
        transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
        color 0.24s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.nav-item:hover:not(.active):not(.logout):not(:focus-visible) {
    background: var(--sidebar-active-bg);
    transform: none;
    box-shadow: none;
}
.nav-item:hover:not(.active):not(.logout) .material-symbols-outlined {
    transform: scale(1.08);
    rotate: -2deg;
}
.nav-item.active:hover:not(:focus-visible) {
    transform: none;
    box-shadow: none;
}
.nav-item:focus-visible,
.nav-item:focus-visible:hover,
.nav-item.active:focus-visible,
.nav-item.active:focus-visible:hover {
    outline: none;
    box-shadow: var(--ds-focus-ring);
}
.nav-item.active:focus-visible,
.nav-item.active:focus-visible:hover {
    box-shadow: var(--ds-focus-ring-on-fill);
}
.nav-item.logout:focus-visible,
.nav-item.logout:focus-visible:hover {
    outline: none;
    box-shadow: none;
    border-color: color-mix(in srgb, var(--ds-danger) 32%, var(--ds-border));
}
.nav-item:active:not(.active) {
    transform: none;
}
.help-faq summary {
    transition: color 0.3s ease;
    border-radius: var(--radius-sm);
    margin: 0 calc(var(--space-2) * -1);
    padding-left: var(--space-2);
    padding-right: var(--space-2);
}
.help-faq summary:hover {
    color: var(--ds-text);
}
.help-faq__chev {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s ease;
}
.help-faq[open] .help-faq__chev {
    transform: rotate(180deg);
}
.help-faq__body {
    animation: helpFaqBodyIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
@keyframes helpFaqBodyIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.help-faq-list .help-faq__body {
    padding: var(--space-2) var(--space-2) var(--space-4);
}
.help-faq-list .help-faq__body p {
    line-height: 1.65;
}
.ds-check__box {
    transition: background var(--ds-motion-fast) var(--ds-ease-out),
                border-color var(--ds-motion-fast) var(--ds-ease-out),
                transform var(--ds-motion-fast) var(--ds-ease-out);
}
.ds-check:hover .ds-check__box {
    transform: scale(1.04);
}
.ds-toast {
    transition: opacity var(--ds-motion-mid) var(--ds-ease-out),
                transform var(--ds-motion-mid) var(--ds-ease-out);
}
.ds-beta-hero {
    animation: ds-fade-up var(--ds-motion-mid) var(--ds-ease-out) 0.08s backwards;
}

@media (max-height: 800px) {
    #view-dashboard {
        --ds-dash-charts-row-h: clamp(
            260px,
            calc(
                var(--ds-card-header-height)
                + var(--ds-dashboard-body-gap)
                + var(--ds-dashboard-list-scroll-h)
                + var(--ds-inset-y)
                + var(--ds-dash-charts-row-footer-h)
            ),
            360px
        );
    }
}

@media (max-height: 720px) {
    .dashboard-body > .dashboard-row:first-child,
    .dashboard-row--charts {
        min-height: 180px;
    }
    .dashboard-row > *,
    .dashboard-row--charts > * {
        min-height: 180px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 1080px) {
    .dashboard-kpi-row,
    .dashboard-row:not(.dashboard-row--charts),
    .dashboard-4col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-row--charts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-body > .dashboard-row:first-child,
    .dashboard-row--charts {
        flex: none;
        height: auto;
        min-height: 0;
        max-height: none;
    }
    .dashboard-row > * {
        min-height: 260px;
        height: auto;
    }
    .dashboard-row--charts > * {
        min-height: 260px;
    }
    .ds-card--span-2 { grid-column: span 2; }
    .chart-row { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .plans-grid { grid-template-columns: 1fr; }
}

@media (min-width: 1081px) {
    :root {
        --ds-popup-inset: var(--space-8);
        --ds-popup-header-pad-y: var(--space-6);
    }
}

@media (max-width: 1080px) {
    :root {
        --topbar-height: 64px;
        --ds-content-pad: var(--space-4);
        --ds-dashboard-list-visible: 4;
        --cal-cell-h: 40px;
        /* Wysokość dolnej nawigacji + safe area — odstęp na końcu scrolla pulpitu */
        --ds-mobile-bottom-nav-inset: calc(88px + env(safe-area-inset-bottom, 0px));
    }
    /* Nagłówki — pełna widoczność tekstu, bez obcinania */
    .ds-card__header:not(.ds-card__header--dash-cal):not(.ds-asset-card-panel__header),
    .ds-card__header--compact:not(.ds-card__header--dash-cal):not(.ds-asset-card-panel__header),
    .ds-card__header--calendar:not(.ds-card__header--dash-cal),
    .ds-card__header--today,
    .ds-card__header--cal-page,
    .ds-module__head,
    .ds-module__head--compact,
    .account-section-header,
    .cal-module--drilldown.ds-card--calendar .ds-card__header--calendar:not(.ds-card__header--dash-cal) {
        height: auto;
        max-height: none;
        min-height: var(--ds-card-header-height);
        overflow: visible;
        flex-wrap: wrap;
        align-items: center;
        padding-block: var(--ds-header-pad-y);
        padding-inline: var(--ds-header-pad-x);
    }
    .ds-page-header,
    .ds-page-header--actions {
        height: auto;
        max-height: none;
        min-height: unset;
        overflow: visible;
        flex-wrap: wrap;
        align-items: center;
        margin-bottom: var(--ds-page-header-gap);
        padding: 0;
    }
    .ds-card__title,
    .ds-module__title,
    .ds-page-header__title,
    .account-section-header__title {
        overflow: visible;
        text-overflow: unset;
        white-space: normal;
        word-break: break-word;
    }
    .cal-header-nav--grouped .cal-toolbar__title,
    .cal-day-detail-nav.cal-header-nav--grouped .cal-toolbar__title,
    .cal-day-detail-nav__title {
        overflow: visible;
        text-overflow: unset;
        white-space: nowrap;
        font-size: var(--text-sm);
        font-weight: 600;
        line-height: 1.2;
        color: var(--ds-text);
        text-align: center;
        padding: 0 var(--space-2);
    }

    /* Mobile — scroll rail widoczny w modułach (nie chować scroll-gutter) */
    .main-content,
    .dashboard-scroll,
    .dashboard-scroll.scroll-content {
        scrollbar-width: none;
        -ms-overflow-style: none;
        scrollbar-gutter: auto;
    }
    .main-content::-webkit-scrollbar,
    .dashboard-scroll::-webkit-scrollbar,
    .dashboard-scroll.scroll-content::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }
    .ds-scroll-gutter {
        scrollbar-width: thin;
        scrollbar-color: var(--ds-scrollbar-thumb) var(--ds-scrollbar-track);
    }
    .ds-scroll-gutter::-webkit-scrollbar {
        display: block;
        width: var(--ds-scrollbar-size);
    }

    html {
        overflow-x: auto;
        overflow-y: hidden;
        min-width: var(--ds-app-min-w);
        max-width: none;
    }
    body#esd-app,
    .app-layout,
    .main-content,
    .app-view,
    .dashboard-scroll {
        min-width: var(--ds-app-min-w);
        max-width: none;
    }
    body#esd-app,
    .app-layout,
    .main-content,
    .app-view,
    .dashboard-scroll {
        overflow-x: hidden;
    }

    body { -webkit-tap-highlight-color: transparent; }

    /* Jedna warstwa paddingu 16px; treść = 100% szerokości minus padding shella */
    .main-content .app-view.dashboard-view {
        padding: 0 !important;
    }
    .main-content .app-view:not(.dashboard-view) {
        padding: var(--view-padding) !important;
        box-sizing: border-box;
    }
    .main-content .app-view.entity-view.dashboard-view {
        padding: 0 !important;
    }
    .main-content .app-view.entity-view:not(.dashboard-view) {
        padding: var(--view-padding) 0 0 !important;
    }
    #view-dashboard .dashboard-scroll {
        padding-bottom: calc(var(--ds-dashboard-shell-pad-bottom) + var(--ds-mobile-bottom-nav-inset));
        scroll-padding-bottom: calc(var(--ds-dashboard-shell-pad-bottom) + var(--ds-mobile-bottom-nav-inset));
    }
    .dashboard-scroll,
    .ds-account-view.dashboard-view .dashboard-scroll[data-account-shell] {
        padding: var(--ds-dashboard-shell-pad-y) var(--ds-dashboard-shell-pad-x);
        padding-bottom: calc(var(--ds-dashboard-shell-pad-y) + var(--ds-mobile-bottom-nav-inset));
        scroll-padding-bottom: calc(var(--ds-dashboard-shell-pad-y) + var(--ds-mobile-bottom-nav-inset));
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
    }
    /* Formularz zasobu — ten sam inset co karty pulpitu; scroll na całym dashboard-scroll */
    #view-add-product.dashboard-view,
    .ds-add-product-view.dashboard-view {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    .ds-add-product-view .dashboard-scroll {
        display: block;
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .ds-add-product-layout {
        padding: 0;
        max-width: none;
    }
    .ds-add-product-form,
    .ds-add-product-form__panel,
    .ds-add-product-form__content {
        overflow: visible;
        max-height: none;
        height: auto;
    }
    .dashboard-scroll > .dashboard-layout,
    .dashboard-scroll > .ds-page-header,
    .dashboard-scroll > .account-section-header,
    .dashboard-scroll > .ds-add-product-layout,
    .account-shell__body,
    .account-shell__body > *,
    .dashboard-layout,
    .dashboard-body,
    .dashboard-body > *,
    .settings-layout,
    .help-layout,
    .view-toolbar,
    .table-card,
    .entity-grid,
    .ds-card,
    .form-card,
    .page-header,
    .notif-module,
    .privacy-doc,
    .report-wizard-panel,
    .plans-grid,
    .kpi-grid,
    .dashboard-kpi-row,
    .dashboard-row,
    .dashboard-row--charts {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .view-toolbar--panel {
        padding-left: 0;
        padding-right: 0;
    }

    .sidebar { display: none !important; }
    /* Widoki pulpitu scrollują w .dashboard-scroll — inset dolny tam, nie na main-content (unikamy obcinania treści) */
    .main-content:has(> .dashboard-view.is-active) {
        padding-bottom: 0;
    }
    .main-content:has(> .entity-view.dashboard-view.is-active) {
        padding-bottom: 0;
    }
    .main-content:not(:has(> .dashboard-view.is-active)) {
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }

    .topbar {
        display: flex;
        flex-wrap: nowrap;
        justify-content: stretch;
        height: var(--topbar-height);
        min-height: var(--topbar-height);
        padding: 0 var(--ds-dashboard-shell-pad-x);
        gap: 0;
        overflow: visible;
    }
    .topbar__desktop-bar { display: none !important; }
    .topbar__mobile-bar {
        display: flex !important;
        overflow: visible;
    }
    .topbar__mobile-bar .topbar__menu-btn { display: inline-flex !important; }
    .topbar__slot--brand,
    .topbar__slot--actions,
    .topbar__desktop-search { display: none !important; }
    .notif-dropdown { display: none !important; }

    .dashboard-shell > .app-footer-bar {
        padding: var(--space-4) var(--ds-dashboard-shell-pad-x);
    }
    .cal-page-toolbar__actions--desktop { display: none; }
    .cal-page-toolbar__mobile { display: flex; }
    .cal-view-toggle--desktop { display: none !important; }
    #cal-page-module { min-height: 0; }
    .cal-module--drilldown .ds-card__header--calendar { flex-wrap: nowrap; }
    .cal-module--drilldown .ds-card__header--calendar > .ds-card__header-actions ~ .ds-card__title,
    .cal-module--drilldown .ds-card__header--calendar:not(:has(.ds-card__header-primary)) .ds-card__title {
        flex: 1 1 100%;
    }
    .cal-module--drilldown .ds-card__header-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }

    .dashboard-scroll > .ds-page-header,
    .dashboard-scroll > .ds-page-header--actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-2) var(--space-3);
        margin-bottom: calc(var(--ds-page-header-gap) - var(--ds-dashboard-gap));
        min-height: unset;
    }
    .dashboard-scroll > .ds-page-header .ds-page-header__title,
    .dashboard-scroll > .ds-page-header--actions .ds-page-header__title {
        flex: 1 1 auto;
        min-width: 0;
        text-align: left;
        font-size: var(--ds-page-header-title-size);
        line-height: var(--leading-tight);
    }
    .ds-page-header__title { font-size: var(--ds-page-header-title-size); }
    .ds-page-header--actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-2) var(--space-3);
        margin-bottom: var(--ds-page-header-gap);
    }
    .ds-page-header--actions .ds-page-header__title {
        flex: 1 1 auto;
        min-width: 0;
        text-align: left;
        font-size: var(--ds-page-header-title-size);
    }
    .ds-page-header__actions {
        margin-left: auto;
        width: auto;
        flex: 0 0 auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: var(--space-2);
    }
    .ds-page-header__actions .btn,
    .ds-page-header__actions .ds-actions-menu__trigger {
        width: auto;
        flex: 0 0 auto;
        max-width: 100%;
        height: 40px;
        min-height: 40px;
        white-space: nowrap;
    }

    .dashboard-kpi-row,
    .cal-page-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--ds-dashboard-gap);
    }
    .dashboard-kpi-row .kpi-card--stat,
    .cal-page-kpi-row .kpi-card--stat {
        --kpi-stat-icon-size: 36px;
    }
    .dashboard-kpi-row .kpi-card--stat .kpi-card__value,
    .cal-page-kpi-row .kpi-card--stat .kpi-card__value {
        font-size: clamp(1.5rem, 5vw, 1.75rem);
    }
    .dashboard-kpi-row .kpi-card--stat .kpi-card__icon-box,
    .cal-page-kpi-row .kpi-card--stat .kpi-card__icon-box {
        width: var(--kpi-stat-icon-size);
        height: var(--kpi-stat-icon-size);
    }
    .cal-page-kpi-row .kpi-card--stat:last-child:nth-child(odd) {
        grid-column: span 2;
    }
    .dashboard-layout,
    .dashboard-body {
        gap: var(--ds-dashboard-gap);
    }
    .dashboard-row,
    .dashboard-row--charts,
    .dashboard-row--donuts,
    .dashboard-4col {
        grid-template-columns: 1fr !important;
        gap: var(--ds-dashboard-gap);
    }
    .dashboard-body > .dashboard-row:first-child,
    .dashboard-row--charts {
        height: auto;
        min-height: 0;
        max-height: none;
    }
    #view-dashboard {
        --ds-dash-cal-h: clamp(360px, 58dvh, 580px);
    }
    .dashboard-row > *:not(#dash-calendar-module),
    .dashboard-row--charts > * {
        min-height: unset !important;
    }
    #view-dashboard .dashboard-row--charts > .ds-card--stretch {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }
    #view-dashboard .dashboard-row--charts > .ds-card--stretch:not(.ds-card--compliance) {
        min-height: calc(
            var(--ds-card-header-height)
            + var(--ds-dashboard-body-gap)
            + min(var(--ds-dashboard-list-scroll-h), 240px)
        ) !important;
    }
    #view-dashboard .dashboard-row--charts .ds-inset-scroll--dashboard-list,
    #view-dashboard .dashboard-row--charts .ds-scroll-lane--dashboard-list,
    #view-dashboard .dashboard-row--charts .ds-inset-scroll--dashboard-list.ds-inset-scroll--host {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
    }
    #view-dashboard #dash-calendar-module.cal-module--drilldown:not(.cal-day-detail-open) {
        height: var(--ds-dash-cal-h) !important;
        min-height: var(--ds-dash-cal-h) !important;
        max-height: var(--ds-dash-cal-h) !important;
        overflow: hidden !important;
    }
    .ds-card--span-2 { grid-column: span 1; }

    #dash-calendar-module.ds-card--calendar .ds-card__header--calendar:not(.ds-card__header--dash-cal),
    #dash-calendar-module.cal-module--drilldown.ds-card--calendar .ds-card__header--calendar:not(.ds-card__header--dash-cal) {
        flex-wrap: nowrap;
        align-items: stretch;
    }
    #dash-calendar-module .cal-header-nav--grouped .cal-toolbar__title,
    #dash-calendar-module .cal-day-detail-nav__title {
        flex: none;
        width: auto;
        min-width: 0;
        text-align: center;
        font-size: var(--text-sm);
        font-weight: 600;
        line-height: 1.2;
        color: var(--ds-text);
        white-space: nowrap;
    }
    #dash-calendar-module .cal-header-nav--grouped .btn-cal-nav,
    #dash-calendar-module .cal-day-detail-nav .btn-cal-nav {
        --cal-nav-btn-size: 32px;
        flex: 0 0 var(--cal-nav-btn-size);
        width: var(--cal-nav-btn-size);
        height: var(--cal-nav-btn-size);
        min-width: var(--cal-nav-btn-size);
        min-height: var(--cal-nav-btn-size);
    }
    #dash-calendar-module .cal-header-nav--grouped .btn-cal-nav .material-symbols-outlined,
    #dash-calendar-module .cal-day-detail-nav .btn-cal-nav .material-symbols-outlined {
        font-size: 18px;
    }

    /* Pulpit — widok dnia: zablokowana wysokość karty + scroll rail (jak kalendarz główny) */
    #view-dashboard #dash-calendar-module.cal-day-detail-open.cal-module--drilldown,
    #view-dashboard #dash-calendar-module.cal-day-detail-open {
        height: var(--dash-cal-locked-h, var(--ds-dash-cal-h)) !important;
        min-height: var(--dash-cal-locked-h, var(--ds-dash-cal-h)) !important;
        max-height: var(--dash-cal-locked-h, var(--ds-dash-cal-h)) !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }
    #view-dashboard .dashboard-body > .dashboard-row:first-child > #dash-calendar-module.cal-module--drilldown.cal-day-detail-open {
        align-self: start;
    }
    #view-dashboard #dash-calendar-module.cal-day-detail-open .cal-module-body {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
    #view-dashboard #dash-calendar-module.cal-day-detail-open .cal-module-split,
    #view-dashboard #dash-calendar-module.cal-day-detail-open .cal-side-panel,
    #view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view,
    #view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view > :is(.ds-inset-scroll, .ds-content-inset.ds-inset-scroll--host),
    #view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view .ds-scroll-lane {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }
    #view-dashboard #dash-calendar-module.cal-day-detail-open .cal-side-panel {
        border-top: none !important;
    }
    #view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view :is(.ds-inset-scroll--host, .ds-content-inset):has(.ds-scroll-rail) {
        padding: 0 !important;
    }
    #view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view__list.module-list--dashboard {
        min-height: 0;
        padding: 0;
        margin: 0;
    }
    #view-dashboard #dash-calendar-module.cal-day-detail-open .cal-empty-state--day {
        min-height: 0;
        flex: 1;
    }

    #dash-calendar-module .cal-module-split {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    #dash-calendar-module .cal-module-calendar,
    #dash-calendar-module .cal-side-panel {
        padding: 0;
    }
    #dash-calendar-module .cal-module-body {
        padding: var(--ds-card-inset-y) var(--ds-card-inset-x);
    }
    #dash-calendar-module .cal-grid--dash {
        gap: 3px;
        grid-auto-rows: 1fr;
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        align-content: stretch;
    }
    #dash-calendar-module .cal-grid--dash .cal-cell {
        aspect-ratio: unset;
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 4px;
        align-items: stretch;
        justify-content: flex-start;
    }
    #dash-calendar-module .cal-cell__num,
    #dash-calendar-module .cal-cell__count {
        align-self: flex-start;
        margin: 0;
    }
    #dash-calendar-module .cal-cell__num {
        font-size: var(--text-xs);
        font-weight: 600;
    }
    #dash-calendar-module .cal-cell__count {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
        font-weight: var(--ds-dash-cal-count-weight);
    }
    #cal-page-module.cal-view-mode--month .cal-grid--page .cal-cell__num {
        font-size: 13px;
    }
    #cal-page-module.cal-view-mode--month .cal-grid--page .cal-cell__count {
        min-width: 22px;
        height: 22px;
        font-size: 11px;
    }
    #dash-calendar-module .cal-weekdays--dash span {
        text-align: center;
    }

    #view-dashboard .dashboard-body > .dashboard-row:first-child > .ds-card--today {
        height: var(--dash-today-sync-h, var(--ds-dash-cal-h)) !important;
        min-height: var(--dash-today-sync-h, var(--ds-dash-cal-h)) !important;
        max-height: var(--dash-today-sync-h, var(--ds-dash-cal-h)) !important;
        align-self: stretch;
    }
    #view-dashboard .dashboard-row:first-child .ds-card--no-footer:not(.ds-card--today) {
        height: auto !important;
    }
    #view-dashboard .dashboard-row:first-child .ds-card--no-footer:not(.ds-card--today) .ds-card__body--grow,
    #view-dashboard .dashboard-row:first-child .ds-card--no-footer:not(.ds-card--today) .ds-inset-scroll,
    #view-dashboard .dashboard-row:first-child .ds-card--no-footer:not(.ds-card--today) .ds-scroll-lane {
        flex: none !important;
        min-height: 0 !important;
        height: auto !important;
    }
    #view-dashboard .ds-card--today .ds-card__body--grow,
    #view-dashboard .ds-card--today .ds-inset-scroll,
    #view-dashboard .ds-card--today .ds-scroll-lane,
    #view-dashboard .ds-card--today .ds-scroll-rail {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
    }
    #view-dashboard .ds-card--today :is(.ds-inset-scroll--host, .ds-content-inset--scroll) > .ds-scroll-lane:not(:has(.ds-scroll-rail)),
    #view-dashboard .ds-card--today .ds-scroll-lane:not(:has(.ds-scroll-rail)) {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    #view-dashboard .ds-card--today :is(
        .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset,
        .ds-scroll-rail .ds-scroll-lane__inset
    ),
    #view-dashboard .ds-card--today :is(
        .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset,
        .ds-scroll-rail .ds-scroll-lane__inset
    ) > #today-products-list:not(:has(:is(.cal-empty-state--day, .module-empty))) {
        flex: none !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }
    #view-dashboard .dashboard-row:first-child .ds-card--no-footer:not(.ds-card--today) .ds-scroll-lane__inset {
        overflow: visible;
        height: auto;
        min-height: 0;
    }
    #view-dashboard .ds-card--today .module-list--dashboard .cal-empty-state--day,
    #view-dashboard #today-products-list .module-empty,
    #view-dashboard #today-products-list .cal-empty-state--day {
        min-height: 120px;
        flex: none;
    }
    #view-dashboard .ds-card__header--today {
        position: relative;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: var(--space-2);
        padding-block: var(--ds-header-pad-y);
        padding-inline: var(--ds-header-pad-x);
        padding-right: calc(var(--ds-header-pad-x) + 44px);
    }
    #view-dashboard .ds-card__header--today .dash-today-head {
        flex: 1 1 auto;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
        min-width: 0;
    }
    #view-dashboard .ds-card__header--today .dash-today-header-divider {
        display: none;
    }
    #view-dashboard .ds-card__header--today .ds-card__title {
        white-space: nowrap;
        font-size: var(--text-sm);
        line-height: 1.3;
    }
    #view-dashboard .ds-card__header--today .dash-today-date--header {
        font-size: var(--text-sm);
        white-space: normal;
        line-height: 1.3;
    }
    #view-dashboard .ds-card__header--today .dash-today-count {
        position: absolute;
        top: var(--space-3);
        right: var(--ds-card-inset-x);
        margin-left: 0;
    }

    #view-dashboard .ds-card:not(#dash-calendar-module) :is(.ds-inset-scroll--host, .ds-content-inset):has(.ds-scroll-rail),
    #view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view :is(.ds-inset-scroll--host, .ds-content-inset):has(.ds-scroll-rail) {
        padding: 0 !important;
    }
    #view-dashboard .ds-card:not(#dash-calendar-module) :is(.ds-inset-scroll--host, .ds-content-inset):has(.ds-scroll-rail) > .ds-scroll-lane,
    #view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view :is(.ds-inset-scroll--host, .ds-content-inset):has(.ds-scroll-rail) > .ds-scroll-lane {
        padding-inline-start: var(--ds-entity-scroll-gutter) !important;
        padding-inline-end: 0 !important;
        padding-block: var(--ds-inset-y) !important;
    }

    #view-dashboard .ds-page-header__actions,
    #view-calendar .ds-page-header__actions {
        display: none;
    }

    #view-dashboard .dashboard-row--bar-charts {
        grid-template-columns: 1fr !important;
    }
    #view-dashboard .dashboard-row--bar-charts .ds-card--chart-bar {
        min-height: auto;
        height: auto;
        max-height: none;
    }
    #view-dashboard .dashboard-row--bar-charts .dash-bar-chart-wrap:not(.dash-bar-chart-wrap--horizontal) {
        flex: none;
        min-height: clamp(200px, 48vw, 300px);
        height: clamp(200px, 48vw, 300px);
    }
    #view-dashboard .dashboard-row--bar-charts .dash-bar-chart-wrap--horizontal {
        flex: none;
        min-height: calc(var(--bar-rows, 4) * 32px + 56px);
        height: calc(var(--bar-rows, 4) * 32px + 56px);
    }
    #view-dashboard .dashboard-row--charts .ds-card--compliance,
    #view-dashboard .dashboard-row--charts .ds-card--compliance .ds-card__body--grow {
        min-height: auto;
        height: auto;
        max-height: none;
    }
    .compliance-v4 {
        gap: var(--space-2);
    }
    .compliance-v4__total {
        font-size: clamp(1.375rem, 5.5vw, 1.75rem);
    }
    .compliance-v4__total-label,
    .compliance-v4__meta {
        font-size: var(--text-xs);
    }
    .compliance-v4__label {
        font-size: var(--text-xs);
        white-space: normal;
        line-height: 1.35;
        word-break: break-word;
    }
    .compliance-v4__row-head {
        grid-template-columns: 8px minmax(0, 1fr) auto;
        gap: var(--space-1) var(--space-2);
    }
    .compliance-v4__bars {
        gap: var(--space-2);
    }

    .chart-panel {
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-3) var(--space-4) var(--space-4);
    }
    .chart-wrap--donut-md {
        height: clamp(140px, 40vw, 180px);
        max-width: clamp(140px, 40vw, 180px);
    }
    .chart-wrap--bar-fill {
        min-height: clamp(180px, 45vw, 240px);
        height: clamp(180px, 45vw, 240px);
    }
    .chart-wrap--bar-sm {
        min-height: clamp(140px, 38vw, 180px);
        height: clamp(140px, 38vw, 180px);
    }
    .ds-card--chart .ds-card__body--grow {
        min-height: clamp(180px, 42vw, 240px);
    }

    .cal-module-split { grid-template-columns: 1fr; }
    .cal-module-calendar { border-right: none; border-bottom: 1px solid var(--ds-border); }
    .cal-side-panel:not(#dash-cal-side-panel) { border-left: none; border-top: 1px solid var(--ds-border); max-height: none; }
    .cal-panel-layout { grid-template-columns: 1fr; }
    .calendar-page { grid-template-columns: 1fr; }
    .calendar-page__side { max-height: none; }

    .notif-page-layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .notif-page-layout > .notif-page-main {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--ds-border);
        padding-top: var(--space-4);
    }
    .notif-summary--stack { gap: var(--space-2); }
    .notif-summary__item { padding: var(--space-3) var(--space-4); }

    .settings-grid--carousel {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: var(--space-4);
        padding-bottom: var(--space-2);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .settings-grid--carousel::-webkit-scrollbar { display: none; }
    .settings-grid--carousel .form-card {
        flex: 0 0 calc(100vw - 2 * var(--ds-dashboard-shell-pad-x));
        scroll-snap-align: start;
        min-height: 280px;
    }

    /* Widoki list — układ aplikacji mobilnej */
    .page-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        margin-bottom: var(--space-4);
        gap: var(--space-2) var(--space-3);
    }
    .page-header h1 {
        flex: 1 1 auto;
        min-width: 0;
        font-size: var(--text-lg);
        text-align: left;
    }
    /* View toolbar — mobile (pozostałe widoki, nie listy entity) */
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
        padding: var(--space-3);
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__search,
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__search.global-search {
        flex: none;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__actions {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: none;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: var(--space-2);
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__actions > .btn-outline:not(.btn--icon-only) {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__actions > .btn--icon-only:not(.view-toolbar__mobile-toggle) {
        grid-column: 2;
        grid-row: 1;
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        justify-self: end;
    }
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__actions > .btn-brand,
    .view-toolbar:not([data-entity-toolbar]) .view-toolbar__actions > .btn-primary:not(.btn--icon-only) {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        max-width: 100%;
    }
    .view-toolbar:not([data-entity-toolbar]).view-toolbar--open .view-toolbar__filters {
        padding: var(--space-3);
        border-top: 1px solid var(--ds-border);
    }
    .view-toolbar:not([data-entity-toolbar]).view-toolbar--open .view-toolbar__filters .filter-bar__clear {
        width: 100%;
        max-width: 100%;
        justify-self: stretch;
    }

    /* Listy entity — mobile: szukaj + filtr w jednym rzędzie; ikona filtra/X zawsze po prawej od szukaj */
    [data-entity-toolbar].view-toolbar .view-toolbar__row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        grid-template-rows: auto;
        align-items: center;
        gap: var(--space-2);
        padding: var(--ds-inset-x) var(--ds-inset-x) var(--space-3);
    }
    [data-entity-toolbar].view-toolbar .view-toolbar__search,
    [data-entity-toolbar].view-toolbar .view-toolbar__search.global-search {
        grid-column: 1;
        grid-row: 1;
        flex: none;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    [data-entity-toolbar].view-toolbar .view-toolbar__actions {
        display: contents;
    }
    [data-entity-toolbar].view-toolbar:not(.view-toolbar--open) .view-toolbar__actions > *:not([id^="btn-toggle-filters"]) {
        display: none !important;
    }
    [data-entity-toolbar].view-toolbar .view-toolbar__actions > [id^="btn-toggle-filters"] {
        grid-column: 2;
        grid-row: 1;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        height: 44px;
        min-height: 44px;
        max-height: 44px;
        padding: 0;
        justify-self: end;
        align-self: center;
    }
    [data-entity-toolbar].view-toolbar .view-toolbar__actions > [id^="btn-toggle-filters"] .btn__label {
        display: none;
    }
    [data-entity-toolbar].view-toolbar .view-toolbar__actions > [id^="btn-toggle-filters"] .material-symbols-outlined {
        display: block;
        flex: none;
        margin: 0;
        font-size: 20px;
        line-height: 1;
    }
    [data-entity-toolbar].view-toolbar.view-toolbar--open .view-toolbar__row {
        grid-template-rows: auto auto;
    }
    [data-entity-toolbar].view-toolbar.view-toolbar--open .view-toolbar__actions > .btn-brand,
    [data-entity-toolbar].view-toolbar.view-toolbar--open .view-toolbar__actions > .btn-primary:not(.btn--icon-only) {
        grid-column: 1 / -1;
        grid-row: 2;
        display: flex !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    [data-entity-toolbar].view-toolbar.view-toolbar--open .view-toolbar__actions > [id^="btn-toggle-view"] {
        display: none !important;
    }
    [data-entity-toolbar].view-toolbar.view-toolbar--open .view-toolbar__actions:not(:has(> .btn-brand)):not(:has(> .btn-primary:not(.btn--icon-only))) > [id^="btn-toggle-view"] {
        grid-column: 1 / -1;
        grid-row: 2;
        display: inline-flex !important;
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        justify-self: start;
    }
    [data-entity-toolbar].view-toolbar.view-toolbar--open .view-toolbar__filters {
        padding: var(--space-3) var(--ds-inset-x);
        border-top: 1px solid var(--ds-border);
    }
    [data-entity-toolbar].view-toolbar.view-toolbar--open .view-toolbar__filters .filter-bar,
    [data-entity-toolbar].view-toolbar.view-toolbar--open .view-toolbar__filters .filter-bar--compact {
        grid-template-columns: minmax(0, 1fr);
    }
    [data-entity-toolbar].view-toolbar.view-toolbar--open .view-toolbar__filters .filter-bar__clear {
        width: 100%;
        max-width: 100%;
        justify-self: stretch;
    }

    /* Widoki list — flex + scroll w karcie (bez obcinania treści) */
    .app-view.entity-view.dashboard-view > .entity-view-scroll {
        padding-bottom: calc(var(--ds-dashboard-shell-pad-y) + var(--ds-mobile-bottom-nav-inset));
    }
    .app-view.entity-view.dashboard-view.is-active > .entity-view-scroll > .entity-list-card,
    #view-reports.is-active .entity-view-scroll #reports-list-view > .entity-list-card {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        max-width: 100%;
    }
    #view-daily-audits.is-active .entity-view-scroll #audits-list-view > .entity-list-card,
    #view-trash.is-active .entity-view-scroll #trash-list-view > .entity-list-card {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        max-width: 100%;
    }
    .app-view.entity-view.dashboard-view .entity-view-scroll > .ds-page-header,
    .app-view.entity-view.dashboard-view .entity-view-scroll > .view-toolbar,
    #view-reports .entity-view-scroll #reports-list-view > .view-toolbar {
        flex-shrink: 0;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    #view-daily-audits .entity-view-scroll #audits-list-view > .view-toolbar,
    #view-trash .entity-view-scroll #trash-list-view > .view-toolbar {
        flex-shrink: 0;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    #view-schedule-products .schedule-products-head {
        gap: var(--space-2);
    }
    .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-entity-list-body, .entity-list):not(.entity-grid) .data-table {
        width: max(100%, var(--ds-entity-table-min-w));
        min-width: var(--ds-entity-table-min-w);
    }
    .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-entity-list-body, .entity-list):not(.entity-grid) .data-table.data-table--products {
        width: max(100%, var(--ds-entity-table-min-w-products));
        min-width: var(--ds-entity-table-min-w-products);
    }
    #devices-list-container .data-table.data-table--devices,
    #locations-list-container .data-table.data-table--locations {
        width: max(100%, var(--ds-entity-table-min-w-devices));
        min-width: var(--ds-entity-table-min-w-devices);
    }
    .ds-card__footer--schedule {
        flex-wrap: wrap;
        gap: var(--space-2) var(--space-4);
    }
    .ds-add-product-layout--schedule-date {
        width: 100%;
        max-width: 100%;
    }
    .ds-schedule-date-view .dashboard-scroll {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .ds-schedule-date-view .schedule-date-step {
        width: 100%;
        max-width: 100%;
    }
    .ds-form-panel__content--schedule-date {
        --ds-wizard-intro-pad-top: calc(var(--ds-inset-y) + var(--space-3));
    }

    .entity-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    .table-card:not(:is(.entity-list, .ds-entity-list-body)) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-card:not(:is(.entity-list, .ds-entity-list-body)) .data-table {
        min-width: 36rem;
    }
    .dashboard-shell > .app-footer-bar {
        display: none;
    }

    .account-section-header {
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-2) var(--space-3);
    }
    .account-section-header__title,
    .account-section-header__intro {
        flex: 1 1 auto;
        min-width: 0;
        text-align: left;
    }
    .account-section-header__actions {
        margin-left: auto;
        width: auto;
        flex: 0 0 auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: var(--space-2);
    }
    .account-section-header__actions .btn {
        width: auto;
        flex: 0 0 auto;
        max-width: 100%;
        white-space: nowrap;
    }
    .notif-page-layout {
        min-height: unset;
        grid-template-columns: 1fr;
    }
    .slide-panel__drawer,
    .slide-panel__drawer--wide,
    .slide-panel__drawer--xl,
    .slide-panel__drawer--form-panel,
    .slide-panel__drawer--form-panel.slide-panel__drawer--xl,
    .slide-panel__drawer--asset-card,
    .slide-panel__drawer--xl.schedule-panel {
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100dvh !important;
        border-radius: 0;
    }
    .slide-panel__drawer--form-panel {
        padding: 0;
    }
    .slide-panel__drawer--asset-card .ds-asset-card-panel {
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    .slide-panel .slide-panel__header,
    .slide-panel .slide-panel__body,
    .slide-panel .slide-panel__footer {
        padding-inline: var(--ds-content-pad);
    }
    .slide-panel__footer {
        padding-bottom: calc(var(--ds-content-pad) + env(safe-area-inset-bottom, 0px));
    }
    .slide-panel__body .measurement-form__fields-grid,
    .slide-panel__body .measurement-form__point-grid {
        grid-template-columns: 1fr;
    }
    .slide-panel__body .measurement-form__context-row {
        grid-template-columns: 1fr;
        gap: var(--space-1);
        align-items: start;
    }
    .slide-panel__body .measurement-form__field--device {
        width: 100%;
    }
    .app-footer { grid-template-columns: 1fr; white-space: normal; text-align: center; }
    .app-footer__left, .app-footer__center, .app-footer__right { justify-self: center; }
    .ds-account-view .settings-grid:not(.settings-grid--carousel) {
        grid-template-columns: 1fr;
    }
    .kpi-grid, .kpi-mini-grid { grid-template-columns: repeat(2, 1fr); }
    .plans-grid, .help-grid { grid-template-columns: 1fr; }
    .report-wizard-grid { grid-template-columns: 1fr; }
    .schedule-step--date { padding: var(--space-4); }

    .mobile-bottom-nav {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        z-index: 1500;
        background: var(--ds-surface);
        border-top: 1px solid var(--ds-border);
        padding: 4px 2px calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
        align-items: end;
        column-gap: 2px;
        box-shadow: none;
        overflow: visible;
        min-height: 58px;
        box-sizing: border-box;
    }
    .mobile-bottom-nav__item {
        flex: none;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        justify-self: center;
    }
    .mobile-bottom-nav__item:first-child { justify-self: start; padding-left: 2px; }
    .mobile-bottom-nav__item:nth-child(2) { justify-self: end; padding-right: 4px; }
    .mobile-bottom-nav__item:nth-child(4) { justify-self: start; padding-left: 4px; }
    .mobile-bottom-nav__item:nth-child(5) { justify-self: end; padding-right: 2px; }
    .mobile-bottom-nav__item .material-symbols-outlined { font-size: 22px; }
    .mobile-bottom-nav__item.active { color: var(--ds-text); }
    .mobile-bottom-nav__item--scan {
        flex: none;
        width: 54px;
        height: 54px;
        max-width: 54px;
        margin-inline: 16px;
        align-self: flex-start;
        justify-self: center;
        margin-top: 0;
        transform: translateY(calc(-50% + 4px));
        border-radius: var(--radius-md);
        background: var(--ds-brand-cta);
        border: 2px solid var(--ds-surface);
        color: var(--ds-brand-cta-text);
        box-shadow: 0 2px 8px color-mix(in srgb, var(--ds-brand-cta-text) 12%, transparent);
        justify-content: center;
        align-items: center;
        z-index: 2;
    }
    .mobile-bottom-nav__item--scan:active {
        transform: translateY(calc(-50% + 4px)) scale(0.97);
    }
    .mobile-bottom-nav__item--scan .material-symbols-outlined {
        font-size: 28px;
        font-weight: 700;
        color: var(--ds-brand-cta-text) !important;
        font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
        line-height: 1;
        background: none;
        width: auto;
        height: auto;
    }

    .mobile-drawer-backdrop {
        display: block !important;
        position: fixed;
        inset: 0;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1600;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;
    }
    body.mobile-drawer-open .mobile-drawer-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    .mobile-drawer {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        right: auto;
        width: min(280px, 88vw);
        height: 100%;
        background: var(--sidebar-bg);
        z-index: 1700;
        transform: translateX(-100%);
        transition: transform 0.28s var(--ds-ease-out);
        border-right: 1px solid var(--ds-border);
        box-shadow: none;
        padding: var(--space-4) var(--space-4) var(--ds-content-pad);
        box-sizing: border-box;
    }
    body.mobile-drawer-open .mobile-drawer { transform: translateX(0); }
    .mobile-drawer__head {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        padding: var(--space-2) 0 var(--space-4);
        border-bottom: none;
        flex-shrink: 0;
        width: 100%;
    }
    .mobile-drawer__head > .icon-btn,
    #btn-mobile-drawer-close {
        width: auto;
        height: auto;
        min-width: 0;
        min-height: 0;
        padding: var(--space-1);
        margin-left: auto;
        margin-right: calc(-1 * var(--space-1));
        border: none;
        background: transparent;
        box-shadow: none;
        color: var(--ds-text-secondary);
    }
    .mobile-drawer__head > .icon-btn:hover,
    .mobile-drawer__head > .icon-btn:active,
    #btn-mobile-drawer-close:hover,
    #btn-mobile-drawer-close:active {
        background: transparent;
        border: none;
        box-shadow: none;
        color: var(--ds-text);
        transform: none;
    }
    .mobile-drawer__head > .icon-btn .material-symbols-outlined,
    #btn-mobile-drawer-close .material-symbols-outlined {
        font-size: 24px;
    }
    .mobile-drawer__head .logo-mark.brand-logo-slot {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        padding: 0;
        border-radius: var(--radius-sm);
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .mobile-drawer__head .brand-logo-slot__img {
        display: block;
        width: 32px;
        height: 32px;
        object-fit: contain;
        border-radius: 6px;
    }
    .mobile-drawer__head-title {
        min-width: 0;
        overflow: visible;
        flex: 0 1 auto;
    }
    .mobile-drawer__head .brand-title {
        font-size: var(--text-md);
        font-weight: 700;
        color: var(--sidebar-text-active);
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        word-break: break-word;
    }
    .mobile-drawer__nav {
        display: flex;
        flex-direction: column;
        padding: 0;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }
    .mobile-drawer__nav > .nav-item:first-child {
        margin-top: var(--space-2);
    }
    .mobile-drawer__nav .nav-divider {
        height: 1px;
        background-color: var(--ds-border);
        margin: var(--space-2) var(--space-1);
        flex-shrink: 0;
    }
    .mobile-drawer__nav .nav-item {
        display: flex;
        align-items: center;
        text-decoration: none;
        width: 100%;
        box-sizing: border-box;
        padding: 11px var(--space-3);
    }
    .mobile-drawer__nav .nav-item .nav-item__text {
        max-width: none;
    }
    .mobile-drawer__logout {
        margin-top: auto;
        color: var(--sidebar-text);
    }
    .mobile-drawer__nav .nav-item.logout,
    .mobile-drawer__nav .nav-item.logout .material-symbols-outlined,
    .mobile-drawer__nav .nav-item.logout .nav-item__text {
        color: var(--sidebar-text);
    }
    .mobile-drawer__nav .nav-item.logout:hover,
    .mobile-drawer__nav .nav-item.logout:hover .material-symbols-outlined,
    .mobile-drawer__nav .nav-item.logout:hover .nav-item__text {
        color: var(--ds-danger);
        background: color-mix(in srgb, var(--ds-danger-soft) 72%, transparent);
        border-color: color-mix(in srgb, var(--ds-danger) 28%, var(--ds-border));
    }
    .mobile-drawer__nav .nav-item.logout:active,
    .mobile-drawer__nav .nav-item.logout:active .material-symbols-outlined,
    .mobile-drawer__nav .nav-item.logout:active .nav-item__text {
        color: var(--ds-danger);
        background: color-mix(in srgb, var(--ds-danger) 16%, var(--ds-danger-soft));
    }

    /* Wąskie telefony — KPI zostają w 2 kolumnach */
    @media (max-width: 480px) {
        .kpi-mini-grid {
            grid-template-columns: 1fr;
        }
        .topbar__mobile-brand .topbar-app-mark__title {
            font-size: 16px;
        }
        #btn-mobile-refresh {
            display: none;
        }
    }
}

/* ── Slide panel (boczne okno) ── */
.slide-panel {
    position: fixed;
    inset: 0;
    z-index: 2100;
    pointer-events: none;
    visibility: hidden;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-width: 100%;
    max-height: 100dvh;
    box-sizing: border-box;
}
.slide-panel.show,
.slide-panel.is-closing {
    visibility: visible;
}
.slide-panel.show {
    pointer-events: auto;
}
/* Wszystkie popupy (slide-panel + ds-dialog) — wyśrodkowane w pionie i poziomie */
.slide-panel.ds-dialog.show,
.slide-panel.ds-dialog.is-closing {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}
.slide-panel.show:not(.ds-dialog) .slide-panel__drawer,
.slide-panel.show:not(.ds-dialog) .slide-panel__drawer--left {
    transform: translateX(0);
}
.slide-panel.is-closing:not(.ds-dialog) .slide-panel__drawer {
    transform: translateX(100%);
}
.slide-panel.is-closing:not(.ds-dialog) .slide-panel__drawer--left {
    transform: translateX(-100%);
}
.slide-panel.ds-dialog.show .slide-panel__drawer--asset-card,
.slide-panel.ds-dialog.is-closing .slide-panel__drawer--asset-card {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none !important;
    border-left: 1px solid var(--ds-border);
    width: min(100%, var(--ds-dialog-w, 920px));
    max-width: min(100%, var(--ds-dialog-w, 920px));
    height: auto;
}
.slide-panel.ds-dialog.show .slide-panel__drawer--asset-card {
    opacity: 0;
    animation: dsDialogPanelIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    max-height: min(90dvh, calc(100dvh - 2 * var(--space-4)));
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
}
.slide-panel.ds-dialog.show .slide-panel__drawer:not(.slide-panel__drawer--asset-card),
.slide-panel.ds-dialog.is-closing .slide-panel__drawer:not(.slide-panel__drawer--asset-card) {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none !important;
    opacity: 0;
    border-left: 1px solid var(--ds-border);
    animation: dsDialogPanelIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    max-height: min(90dvh, calc(100dvh - 2 * var(--space-4)));
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
}
.slide-panel.ds-dialog.is-closing .slide-panel__drawer {
    animation: dsDialogPanelOut 0.22s ease forwards;
}
@keyframes dsDialogPanelIn {
    from { opacity: 0; transform: scale(0.97) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes dsDialogPanelOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.98) translateY(6px); }
}
.slide-panel.is-closing {
    pointer-events: none;
}
.slide-panel__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    opacity: 0;
    transition: opacity 0.42s cubic-bezier(0.32, 0.72, 0, 1);
}
.slide-panel.show .slide-panel__backdrop { opacity: 1; }
.slide-panel.is-closing .slide-panel__backdrop { opacity: 0; }
.slide-panel__drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(560px, 100%);
    max-width: 100%;
    max-height: 100dvh;
    background: var(--ds-surface);
    border-left: 1px solid var(--ds-border);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.14);
    display: flex;
    flex-direction: column;
    min-height: 0;
    transform: translateX(100%);
    transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
    box-sizing: border-box;
    overflow: hidden;
}
.slide-panel__drawer--wide { width: min(720px, 100%); max-width: 100%; }
.slide-panel__drawer--xl { width: min(880px, 100%); max-width: 100%; }
.slide-panel__drawer--left {
    left: 0;
    right: auto;
    border-left: none;
    border-right: 1px solid var(--ds-border);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.14);
    transform: translateX(-100%);
}
.slide-panel.show:not(.ds-dialog) .slide-panel__drawer--left { transform: translateX(0); }
.slide-panel.show:not(.ds-dialog) .slide-panel__drawer { transform: translateX(0); }
.slide-panel.is-closing:not(.ds-dialog) .slide-panel__drawer { transform: translateX(100%); }
.slide-panel.is-closing:not(.ds-dialog) .slide-panel__drawer--left { transform: translateX(-100%); }
.slide-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: var(--ds-panel-chrome-header-min-h);
    padding: var(--ds-popup-header-pad-y) var(--ds-popup-inset);
    border-bottom: 1px solid var(--ds-border);
    flex-shrink: 0;
    box-sizing: border-box;
}
.slide-panel__header > * {
    align-self: center;
}
.slide-panel__header h2 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--ds-text);
}
.slide-panel__subhead {
    flex-shrink: 0;
    padding: var(--space-3) var(--ds-popup-inset) var(--space-4);
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-surface);
}
#modal-perform-measurement .slide-panel__drawer--wide {
    width: min(640px, 100%);
    --meas-wizard-inset-x: var(--ds-popup-inset);
    --meas-wizard-inset-y: var(--ds-popup-inset);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
@media (max-width: 1080px) {
    #modal-perform-measurement .slide-panel__drawer--wide {
        --meas-wizard-inset-x: var(--ds-content-pad);
        --meas-wizard-inset-y: var(--ds-content-pad);
    }
    #modal-perform-measurement .slide-panel__header--meas {
        padding-inline: var(--ds-content-pad);
    }
    #modal-perform-measurement .slide-panel__subhead--meas {
        padding-inline: var(--ds-content-pad);
        padding-bottom: var(--space-4);
    }
    #modal-perform-measurement .meas-wizard-screen--main #meas-wizard-footer {
        padding: var(--space-3) var(--ds-content-pad);
        padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
    }
    .meas-finish-layout,
    .meas-wizard-step__cols {
        grid-template-columns: minmax(0, 1fr);
    }
    .meas-wizard-step__cols > .meas-wizard-step__col-divider,
    .meas-finish-layout > .meas-wizard-step__col-divider {
        display: none;
    }
    .meas-wizard-step__cols--split {
        padding-block: 0;
    }
    .meas-wizard-step__cols--split > .ds-add-product-form__block:first-of-type,
    .meas-wizard-step__cols--split > .ds-add-product-form__block:last-of-type {
        padding-left: 0;
        padding-right: 0;
    }
    #modal-perform-measurement .measurement-form__active-point-body[data-layout="rg"],
    #modal-perform-measurement .measurement-form__active-point-body[data-layout="rpp"] {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "name"
            "result"
            "notes"
            "status"
            "reading"
            "confirm";
    }
    #modal-perform-measurement .measurement-form__active-point-body[data-layout="rpp"] {
        grid-template-areas:
            "name-a"
            "name-b"
            "result-a"
            "notes"
            "status"
            "reading"
            "confirm";
    }
    #modal-perform-measurement .measurement-form__active-point-body[data-layout="rpp"] .measurement-form__point-cell--name-a {
        grid-area: name-a;
    }
    #modal-perform-measurement .measurement-form__active-point-body[data-layout="rpp"] .measurement-form__point-cell--name-b {
        grid-area: name-b;
    }
}
#modal-perform-measurement .slide-panel__header--meas {
    padding-block: var(--ds-popup-header-pad-y);
    padding-inline: var(--ds-popup-inset);
}
#modal-perform-measurement .slide-panel__subhead--meas {
    padding-block: var(--space-3) var(--space-4);
    padding-inline: var(--meas-wizard-inset-x);
}
#modal-perform-measurement .slide-panel__body--meas-wizard {
    padding: 0;
}
#modal-perform-measurement .slide-panel__subhead--meas {
    flex-shrink: 0;
}
#modal-perform-measurement .meas-context-head__name {
    min-height: 0;
}
#modal-perform-measurement .ds-add-product-form--measurement .ds-add-product-form__block-title {
    font-size: var(--text-md);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ds-text);
    min-height: 0;
}
#modal-perform-measurement .meas-point-card .ds-card__title,
#modal-perform-measurement .meas-point-card__saved-title {
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: normal;
    line-height: 1.3;
    color: var(--ds-text);
}
#modal-perform-measurement .meas-wizard-step__inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    width: 100%;
    max-width: none;
    margin: 0;
}
#modal-perform-measurement .meas-points-phase--setup.is-active > .ds-add-product-form__block:first-child {
    padding-top: var(--space-2);
}
#modal-perform-measurement .meas-points-phase--setup .ds-add-product-form__section-divider {
    margin: var(--space-6) 0;
}
#modal-perform-measurement .meas-points-block {
    gap: var(--space-5);
}
#modal-perform-measurement .meas-points-block > .meas-range-banner {
    margin-bottom: 0;
}
#modal-perform-measurement .meas-points-block > .ds-add-product-form__block-title {
    margin-top: var(--space-6);
}
#modal-perform-measurement .meas-range-banner {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
}
#modal-perform-measurement .meas-range-banner__head {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}
#modal-perform-measurement .meas-range-banner__icon {
    width: 1em;
    height: 1em;
}
#modal-perform-measurement .meas-range-banner__label,
#modal-perform-measurement .meas-range-banner__value {
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    line-height: 1.35;
    color: var(--ds-text);
}
#modal-perform-measurement .meas-range-banner__value {
    font-weight: 600;
    text-align: right;
}
#modal-perform-measurement .meas-points-phase {
    display: none !important;
}
#modal-perform-measurement .meas-points-phase.is-active {
    display: flex !important;
    flex-direction: column;
}
#modal-perform-measurement .meas-points-phase--setup.is-active {
    gap: var(--space-8);
}
#modal-perform-measurement .meas-points-phase--session.is-active {
    flex: 1 1 auto;
    min-height: 0;
    gap: var(--space-5);
}
#modal-perform-measurement .meas-wizard-stage--points-session {
    flex: 1 1 auto;
    min-height: min(58vh, 560px);
    display: flex;
    flex-direction: column;
}
#modal-perform-measurement .meas-wizard-stage--points-session .meas-wizard-step-viewport {
    flex: 1 1 auto;
    min-height: 0;
}
#modal-perform-measurement .meas-wizard-stage--points-session .meas-wizard-step__inner--wide {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}
#modal-perform-measurement .meas-wizard-form-wrap:has(.meas-wizard-stage--points-session) {
    flex: 1 1 auto;
    min-height: 0;
}
#modal-perform-measurement .meas-wizard-form-wrap:has(.meas-wizard-stage--points-session) > .ds-scroll-lane {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}
#modal-perform-measurement .meas-points-phase--session .meas-points-block {
    flex: 1 1 auto;
    min-height: 0;
}
#modal-perform-measurement .meas-points-phase--session .measurement-form__points-stack {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
#modal-perform-measurement .meas-wizard-step__fields-grid--env {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
#modal-perform-measurement .slide-panel__header--meas {
    align-items: center;
}
#modal-perform-measurement .slide-panel__header--meas > .icon-btn[data-panel-close] {
    align-self: center;
    flex-shrink: 0;
}
#modal-perform-measurement .slide-panel__header--meas .slide-panel__title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: var(--leading-tight);
    text-transform: none;
}
.meas-wizard-progress {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text-secondary);
    line-height: 1.4;
}
.selective-wizard-steps--meas-compact {
    gap: var(--space-1);
}
.selective-wizard-steps--meas-compact .selective-wizard-steps__item {
    padding-inline: var(--space-2);
    gap: var(--space-1);
}
.selective-wizard-steps--meas-compact .selective-wizard-steps__label {
    font-size: var(--text-xs);
}
.selective-wizard-steps--meas-compact .selective-wizard-steps__num {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    font-size: 11px;
}
.meas-context-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-width: 0;
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--ds-border);
}
.meas-context-head__name {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}
.meas-context-head__link {
    flex-shrink: 0;
    align-self: center;
    padding-inline: var(--space-2);
}
.meas-context-panel--compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}
.meas-context-panel--compact .meas-context-panel__line {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.meas-context-panel--compact .meas-context-panel__name {
    font-weight: 600;
    color: var(--ds-text);
}
.meas-context-panel--compact .meas-context-panel__dot {
    margin-inline: var(--space-1);
    opacity: 0.5;
}
.meas-context-panel--compact .meas-context-panel__link {
    flex-shrink: 0;
    padding-inline: var(--space-2);
}
.meas-wizard-step__cols,
.meas-finish-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--space-5);
    row-gap: 0;
    align-items: stretch;
    min-height: 0;
    position: relative;
}
.meas-wizard-step__cols--split {
    --meas-wizard-split-pad: var(--meas-wizard-inset-x, var(--ds-popup-inset));
    column-gap: 0;
    padding-block: var(--meas-wizard-split-pad);
    box-sizing: border-box;
}
.meas-wizard-step__cols--split > .ds-add-product-form__block {
    box-sizing: border-box;
}
.meas-wizard-step__cols--split > .ds-add-product-form__block:first-of-type {
    padding-left: 0;
    padding-right: var(--meas-wizard-split-pad);
}
.meas-wizard-step__cols--split > .ds-add-product-form__block:last-of-type {
    padding-left: var(--meas-wizard-split-pad);
    padding-right: 0;
}
.meas-wizard-step__col-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    min-width: 0;
    align-self: stretch;
}
.meas-wizard-step__stack {
    display: flex;
    flex-direction: column;
    gap: var(--ds-form-section-gap);
    min-width: 0;
    width: 100%;
}
.meas-wizard-step__stack--parameters {
    gap: var(--space-5);
}
.meas-wizard-step__stack--parameters .meas-parameters-block {
    width: 100%;
}
#modal-perform-measurement .meas-wizard-step__stack--parameters .meas-method-type--tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
#modal-perform-measurement .meas-parameters-block .meas-method-type--tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.meas-wizard-step__col-stack--criteria,
.meas-wizard-step__col-stack--parameters,
.meas-wizard-step__col-stack--device {
    justify-content: flex-start;
}
.meas-criteria-value {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.45;
    color: var(--ds-text);
    word-break: break-word;
}
#modal-perform-measurement .meas-wizard-step__cols--method-device {
    align-items: start;
}
#modal-perform-measurement .meas-parameters-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
    align-self: stretch;
}
#modal-perform-measurement .meas-parameters-block .ds-add-product-form__block-title {
    min-height: 0;
    margin: 0;
}
#modal-perform-measurement .meas-parameters-block .measurement-form__method-field,
#modal-perform-measurement .meas-parameters-block .form-group {
    margin-bottom: 0;
}
#modal-perform-measurement .meas-method-type--tiles {
    gap: var(--space-2);
    padding: 0;
}
#modal-perform-measurement .meas-method-type--tiles .meas-method-type__btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    min-height: 44px;
    padding: var(--space-3) var(--space-4);
    padding-left: calc(var(--space-4) + 18px + var(--space-3));
    border-radius: var(--radius-md);
    gap: 0;
}
#modal-perform-measurement .meas-method-type--tiles .meas-method-type__btn:not(.is-active) {
    min-height: 48px;
    padding: var(--space-4) var(--space-4);
    padding-left: calc(var(--space-4) + 18px + var(--space-3));
    background: var(--ds-surface);
    border-color: var(--ds-border);
    color: var(--ds-text-secondary);
}
#modal-perform-measurement .meas-method-type--tiles .meas-method-type__btn:not(.is-active):hover {
    border-color: var(--ds-interactive-hover-border);
    background: var(--ds-interactive-hover-bg);
    color: var(--ds-text);
}
#modal-perform-measurement .meas-method-type--tiles .meas-method-type__radio {
    top: 50%;
    left: var(--space-4);
    transform: translateY(-50%);
    margin-bottom: 0;
}
#modal-perform-measurement .meas-method-type__label {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#modal-perform-measurement .meas-method-type__code {
    flex-shrink: 0;
    width: auto;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.25;
}
#modal-perform-measurement .meas-method-type__sep {
    flex-shrink: 0;
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--ds-text-tertiary);
    line-height: 1;
}
#modal-perform-measurement .meas-method-type__desc {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--text-sm);
    font-weight: 400;
    line-height: 1.25;
    color: var(--ds-text-secondary);
    text-align: left;
}
#modal-perform-measurement .meas-method-type__btn.is-active {
    border-color: var(--ds-brand-cta);
    background: var(--ds-brand-tint-18);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ds-brand-cta) 40%, transparent);
}
#modal-perform-measurement .meas-method-type__btn.is-active .meas-method-type__desc {
    color: var(--ds-text);
    font-weight: 500;
}
#modal-perform-measurement .meas-method-type__btn.is-active:focus-visible {
    box-shadow: var(--ds-interactive-focus-ring);
}
.meas-wizard-step__cols > .meas-wizard-step__col-divider,
.meas-finish-layout > .meas-wizard-step__col-divider {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    min-width: 1px;
    margin: 0;
    padding: 0;
    transform: translateX(-50%);
    background: var(--ds-border);
    grid-column: unset;
    grid-row: unset;
    align-self: unset;
    justify-self: unset;
    height: auto;
    pointer-events: none;
}
.meas-wizard-step__fields-stack {
    grid-template-columns: minmax(0, 1fr);
}
.meas-wizard-step__cols--points-top {
    align-items: stretch;
}
#modal-perform-measurement .meas-wizard-step__cols .meas-method-type {
    width: 100%;
}
.meas-method-type__radio {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--ds-border-strong);
    border-radius: 50%;
    background: var(--ds-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: var(--space-1);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.meas-method-type__radio::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transform: scale(0.6);
    transition: background 0.12s ease, transform 0.12s ease;
}
.meas-method-type__btn.is-active .meas-method-type__radio {
    border-color: var(--ds-brand-cta-active);
}
.meas-method-type__btn.is-active .meas-method-type__radio::after {
    background: var(--ds-brand-cta);
    transform: scale(1);
}
.meas-method-type--tiles .meas-method-type__btn {
    position: relative;
}
.meas-method-type--tiles .meas-method-type__radio {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    margin-bottom: 0;
}
.meas-compliance-callout {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--ds-hint-banner-border);
    border-radius: var(--radius-md);
    background: var(--ds-hint-banner-bg);
}
.meas-compliance-callout__head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}
.meas-compliance-callout__icon {
    flex-shrink: 0;
    font-size: 18px;
    font-variation-settings: "opsz" 20;
    color: var(--ds-info-icon-color);
}
.meas-compliance-callout__title {
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.3;
    color: var(--ds-text);
}
.meas-compliance-callout__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}
.meas-compliance-callout__item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid color-mix(in srgb, var(--ds-border) 55%, transparent);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--ds-surface) 88%, transparent);
}
.meas-compliance-callout__label {
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ds-text-tertiary);
    line-height: 1.25;
}
.meas-compliance-callout__value {
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.4;
    color: var(--ds-text);
    word-break: break-word;
}
.meas-compliance-callout__item--accent .meas-compliance-callout__value {
    font-weight: 700;
}
#modal-perform-measurement .meas-wizard-screen--main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#modal-perform-measurement .meas-wizard-screen--main .slide-panel__subhead--meas {
    flex-shrink: 0;
    padding: var(--space-3) var(--meas-wizard-inset-x);
}
#modal-perform-measurement .meas-wizard-screen--main #meas-wizard-footer {
    flex-shrink: 0;
}
#modal-perform-measurement .slide-panel__body--meas-wizard {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
#modal-perform-measurement .meas-wizard-form-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
#modal-perform-measurement .meas-wizard-form-wrap > .ds-scroll-lane {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}
#modal-perform-measurement .meas-wizard-step-viewport {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}
#modal-perform-measurement .ds-add-product-form--measurement .ds-date-input:hover:not(:focus):not(:focus-visible):not(:disabled),
#modal-perform-measurement .ds-add-product-form--measurement .schedule-date-step__input:hover:not(:disabled):not(:focus):not(:focus-visible),
#modal-perform-measurement .ds-add-product-form--measurement .schedule-date-step__input--text:hover:not(:focus):not(:focus-visible) {
    background: var(--ds-field-hover-bg);
    border-color: var(--ds-interactive-hover-border);
}
#modal-perform-measurement .ds-add-product-form--measurement {
    display: flex;
    flex-direction: column;
    gap: 0;
}
#modal-perform-measurement .ds-add-product-form--measurement .ds-add-product-form__block {
    display: flex;
    flex-direction: column;
    gap: var(--ds-panel-form-block-gap);
    padding-block: 0;
}
#modal-perform-measurement .ds-add-product-form--measurement .ds-add-product-form__section-divider {
    margin: var(--ds-panel-form-divider-margin) 0;
    border-top-color: var(--ds-panel-section-divider-color);
}
#modal-perform-measurement .ds-add-product-form__fields-grid .form-group.ds-add-product-form__field {
    margin-bottom: 0;
}
#modal-perform-measurement .measurement-form__method-field {
    margin-bottom: 0;
}
.meas-finish-layout {
    align-items: stretch;
}
#modal-perform-measurement .meas-finish-layout .ds-add-product-form__block {
    padding-block: 0;
    gap: var(--space-5);
}
#modal-perform-measurement .meas-wizard-step__inner--finish > .ds-add-product-form__block:first-of-type {
    padding-block: 0;
    gap: var(--space-5);
}
#modal-perform-measurement .meas-wizard-step__inner--finish .meas-finish-recap {
    margin-bottom: 0;
}
#modal-perform-measurement .meas-wizard-step__inner--finish .meas-finish-layout + .ds-add-product-form__section-divider {
    margin: 0;
}
#modal-perform-measurement .meas-wizard-step__inner--finish .meas-finish-layout + .ds-add-product-form__section-divider + .ds-add-product-form__block {
    margin-top: 0;
    padding-block: 0;
    gap: var(--space-5);
}
.meas-input-with-unit {
    display: flex;
    align-items: stretch;
    min-height: var(--ds-control-h);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    overflow: visible;
    box-sizing: border-box;
    cursor: text;
}
.meas-input-with-unit:hover:not(:focus-within) {
    border-color: var(--ds-interactive-hover-border);
    background: var(--ds-field-hover-bg);
}
.meas-input-with-unit:focus-within {
    border-color: var(--ds-interactive-focus-border);
    box-shadow: var(--ds-interactive-focus-ring);
}
.meas-input-with-unit input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: calc(var(--ds-control-h) - 2px);
    border: none;
    background: transparent;
    padding: 0 12px;
    font-family: var(--font-ui);
    font-feature-settings: var(--ds-font-features);
    font-variant-numeric: var(--ds-font-numeric);
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    line-height: 1.4;
    color: var(--ds-text);
    box-shadow: none;
}
.meas-input-with-unit input:focus,
.meas-input-with-unit input:focus-visible {
    outline: none;
    box-shadow: none;
}
@media (max-width: 640px) {
    .selective-wizard-steps--meas-compact .selective-wizard-steps__label {
        display: none;
    }
    .meas-finish-layout,
    .meas-wizard-step__cols {
        grid-template-columns: minmax(0, 1fr);
    }
    .meas-wizard-step__cols > .meas-wizard-step__col-divider,
    .meas-finish-layout > .meas-wizard-step__col-divider {
        display: none;
    }
}
#modal-perform-measurement .slide-panel__subhead--meas {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-bottom: var(--space-6);
}
.meas-form-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
}
/* legacy — finish step uses ds-add-product-form__block */
.meas-input-with-unit__suffix {
    display: inline-flex;
    align-items: center;
    padding-inline: 12px;
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    color: var(--ds-text-secondary);
    background: transparent;
    border-left: none;
}
.meas-optional {
    font-weight: 400;
    color: var(--ds-text-tertiary);
}
.meas-compliance-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    border: 1px solid var(--ds-brand-tint-38);
    border-radius: var(--radius-md);
    background: var(--ds-brand-tint-12);
}
.meas-compliance-bar__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.meas-compliance-bar__label {
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ds-text-tertiary);
    line-height: 1.25;
}
.meas-compliance-bar__value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
    line-height: 1.35;
    word-break: break-word;
}
.meas-compliance-bar__item--accent .meas-compliance-bar__value {
    color: var(--ds-brand-cta-text, var(--ds-text));
}
.meas-point-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.meas-point-card.measurement-form__active-point {
    overflow: visible;
}
.meas-point-card--saved {
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
}
.meas-point-card--confirmed {
    border: 1px solid color-mix(in srgb, var(--ds-brand-cta) 32%, var(--ds-border));
    background: var(--ds-brand-tint-12);
}
.meas-point-card__saved-main {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    flex: 1 1 auto;
}
.meas-point-card__confirmed-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ds-brand-cta);
}
.meas-point-card__confirmed-icon .material-symbols-outlined {
    font-size: 20px;
    line-height: 1;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
}
.meas-point-card--confirmed .meas-point-card__saved-title {
    margin: 0;
    font-weight: 600;
    color: var(--ds-text);
    line-height: 1.35;
}
.meas-point-card--saved .ds-card__header,
.meas-point-card--saved .ds-card__header-actions {
    overflow: visible;
}
.meas-point-card--saved .meas-point-card__header--saved {
    border-bottom: 1px solid var(--ds-border);
    background: transparent;
}
.meas-point-card__header--editing {
    border-bottom: 1px solid var(--ds-border);
    background: transparent;
}
.meas-point-card__header--editing .ds-card__header-actions {
    overflow: visible;
}
.meas-point-card__discard-btn {
    flex-shrink: 0;
    color: var(--ds-text-secondary);
}
.meas-point-card__discard-btn:hover:not(:disabled) {
    color: var(--ds-danger, #dc2626);
    background: var(--ds-surface-muted);
}
.meas-point-card--saved .meas-point-card__header--only {
    border-bottom: none;
    background: transparent;
    align-items: center;
    gap: var(--space-3);
}
.meas-point-card--saved:has(.meas-point-card__header--only) .meas-point-card__saved-body {
    display: none !important;
}
.meas-point-card--saved .meas-point-card__saved-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-top: var(--space-2);
    padding-inline: var(--ds-card-inset-x);
    padding-bottom: var(--space-3);
}
.meas-point-card__saved-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    flex-wrap: wrap;
}
.meas-point-saved-reading-thumb {
    display: block;
    width: min(100%, 200px);
    height: auto;
    max-height: 8rem;
    object-fit: contain;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
}
#modal-perform-measurement .meas-point-status-preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--ds-control-h);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--ds-surface-muted, var(--ds-bg)) 70%, transparent);
    border: 1px solid color-mix(in srgb, var(--ds-border) 85%, transparent);
    box-sizing: border-box;
}
#modal-perform-measurement .meas-point-status-preview__value {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}
#modal-perform-measurement .meas-point-status-preview__placeholder {
    font-size: var(--text-sm);
    color: var(--ds-text-tertiary);
}
#modal-perform-measurement .meas-point-status-preview__limit {
    width: 100%;
    margin: 0;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--ds-text-secondary);
}
#modal-perform-measurement .meas-point-status-preview__wynik {
    font-size: var(--text-sm);
    font-weight: 600;
    font-variant-numeric: var(--ds-font-numeric);
    color: var(--ds-text);
}
#modal-perform-measurement .meas-reading-block--point-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    min-height: var(--ds-control-h);
    justify-content: center;
}
#modal-perform-measurement .measurement-form__point-cell--status,
#modal-perform-measurement .measurement-form__point-cell--reading {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
#modal-perform-measurement .meas-reading-block--point-form .meas-point-reading-btn {
    width: 100%;
    min-height: 2.75rem;
    justify-content: center;
}
#modal-perform-measurement .meas-point-reading-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-height: 2.75rem;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    color: var(--ds-text-secondary);
    font-size: var(--text-sm);
}
#modal-perform-measurement .meas-point-reading-status__icon {
    font-size: 1.125rem;
    color: var(--ds-success);
}
#modal-perform-measurement .meas-point-reading-status .btn {
    margin-left: auto;
}
#modal-perform-measurement .meas-reading-block--point-form .meas-reading-block__preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.meas-finish-recap-card__header .ds-status-badge {
    flex-shrink: 0;
}
.meas-point-card__saved-result {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.35;
    font-variant-numeric: var(--ds-font-numeric);
    color: var(--ds-text);
}
.meas-point-card__saved-notes {
    margin: 0;
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.4;
    color: var(--ds-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.meas-point-card--saved:has(.dropdown-actions.is-open) {
    overflow: visible;
    position: relative;
    z-index: 300;
}
#modal-perform-measurement .meas-saved-points-list:has(.dropdown-actions.is-open),
#modal-perform-measurement .measurement-form__points-stack:has(.dropdown-actions.is-open),
#modal-perform-measurement .meas-wizard-form-wrap:has(.dropdown-actions.is-open) > .ds-scroll-lane,
#modal-perform-measurement .meas-wizard-form-wrap:has(.dropdown-actions.is-open) .ds-scroll-rail__body,
#modal-perform-measurement .slide-panel__body--meas-wizard:has(.dropdown-actions.is-open) {
    overflow: visible;
}
#modal-perform-measurement.show .slide-panel__drawer:has(.meas-saved-points-list .dropdown-actions.is-open) {
    overflow: visible;
}
.meas-point-card__saved-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#modal-perform-measurement .meas-saved-points-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
#modal-perform-measurement .meas-point-saved-item {
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    overflow: visible;
}
#modal-perform-measurement .meas-point-saved-item__row.ds-list-item--has-menu {
    min-height: 3.5rem;
    padding-block: var(--space-4);
    padding-inline-start: var(--space-4);
    padding-inline-end: var(--ds-row-kebab-pad-end);
    gap: var(--space-3);
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
}
#modal-perform-measurement .meas-point-saved-item__row.ds-list-item--has-menu:hover {
    background: var(--ds-interactive-hover-bg);
}
#modal-perform-measurement .meas-point-saved-item__main {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}
#modal-perform-measurement .meas-point-saved-item__icon {
    flex-shrink: 0;
    font-size: 1.25rem;
    color: var(--ds-success, #16a34a);
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
}
#modal-perform-measurement .meas-point-saved-item__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.4;
}
#modal-perform-measurement .meas-point-saved-item__badge {
    flex-shrink: 0;
    margin-left: auto;
}
#modal-perform-measurement .meas-point-saved-item__detail {
    border-top: 1px solid var(--ds-border);
    padding: var(--space-4) var(--space-4) var(--space-5);
}
#modal-perform-measurement .meas-point-saved-item__kv {
    gap: 0;
}
#modal-perform-measurement .meas-point-saved-item__kv .ds-detail-list__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
    align-items: start;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ds-border);
}
#modal-perform-measurement .meas-point-saved-item__kv .ds-detail-list__row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
@media (min-width: 640px) {
    #modal-perform-measurement .meas-point-saved-item__kv .ds-detail-list__row {
        grid-template-columns: var(--ds-panel-detail-label-col) minmax(0, 1fr);
        gap: var(--ds-panel-detail-col-gap);
        align-items: center;
    }
    #modal-perform-measurement .meas-point-saved-item__kv .ds-detail-list__row--reading {
        align-items: start;
    }
}
#modal-perform-measurement .meas-point-saved-item__kv .ds-detail-list__row--reading {
    padding-block: var(--space-4);
}
#modal-perform-measurement .meas-point-saved-item:has(.dropdown-actions.is-open) {
    overflow: visible;
    position: relative;
    z-index: 20;
}
.meas-saved-points-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.meas-saved-points-list:empty,
.meas-saved-points-list[hidden] {
    display: none;
}
.meas-saved-points-list--has-items {
    margin-bottom: 0;
}
.measurement-form__points-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    overflow: visible;
}
.measurement-form__point-actions[hidden],
#btn-meas-confirm-point[hidden] {
    display: none !important;
}
.measurement-form__point-actions {
    display: flex;
    align-items: stretch;
    gap: var(--space-3);
    width: 100%;
    overflow: visible;
}
.measurement-form__point-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    overflow: visible;
    background: transparent;
    border: var(--ds-btn-border-width) dashed var(--ds-text);
    color: var(--ds-text);
}
#modal-perform-measurement .meas-wizard-step__stack--parameters .meas-method-type__desc {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}
#modal-perform-measurement .meas-parameters-block .meas-method-type__desc {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}
.measurement-form__point-action-btn--confirm {
    width: 100%;
    border-style: solid;
    border-color: var(--ds-border);
}
.measurement-form__point-action-btn--confirm:not(:disabled) {
    border-color: var(--ds-text);
}
.measurement-form__point-action-btn--confirm:hover:not(:disabled) {
    border-style: solid;
}
.measurement-form__point-action-btn--confirm:focus-visible:not(:disabled) {
    border-style: solid;
}
.measurement-form__point-action-btn--confirm:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.measurement-form__point-action-btn:hover:not(:disabled) {
    background: var(--ds-surface-muted);
    border-color: var(--ds-text);
    border-style: dashed;
    color: var(--ds-text);
}
.measurement-form__point-action-btn:focus-visible:not(:disabled) {
    outline: none;
    border-color: var(--ds-text);
    border-style: dashed;
    color: var(--ds-text);
    box-shadow: var(--ds-focus-ring);
}
.measurement-form__point-action-btn .material-symbols-outlined {
    font-size: 18px;
    color: inherit;
}
.measurement-form__point-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.meas-point-card .ds-card__body {
    gap: 0;
    padding-top: var(--ds-card-inset-y);
    padding-inline: var(--ds-card-inset-x);
    padding-bottom: var(--space-3);
}
.meas-point-card .measurement-form__point-cell--notes {
    padding-bottom: 0;
}
.meas-status-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}
.meas-status-tiles__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 88px;
    padding: var(--space-3);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    color: var(--ds-text-secondary);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.meas-status-tiles__btn:hover:not(.is-active) {
    border-color: var(--ds-interactive-hover-border);
    background: var(--ds-interactive-hover-bg);
    color: var(--ds-text);
}
.meas-status-tiles__btn.is-active {
    border-color: var(--ds-brand-cta);
    background: var(--ds-brand-tint-18);
    color: var(--ds-text);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ds-brand-cta) 45%, transparent);
}
.meas-status-tiles__btn:focus-visible {
    outline: none;
    border-color: var(--ds-interactive-focus-border);
    box-shadow: var(--ds-interactive-focus-ring);
}
.meas-status-tiles__icon {
    font-size: 1.5rem;
}
.meas-status-tiles__label {
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}
.meas-form-section--reading .measurement-form__reading-hint {
    margin: 0;
}
@media (max-width: 768px) {
    .meas-setup-grid {
        grid-template-columns: 1fr;
    }
    .meas-compliance-bar,
    .meas-compliance-callout__grid {
        grid-template-columns: 1fr;
    }
    .meas-status-tiles {
        grid-template-columns: 1fr;
    }
    .meas-status-tiles__btn {
        flex-direction: row;
        justify-content: flex-start;
        min-height: 0;
        padding: var(--space-3) var(--space-4);
    }
}
@media (max-width: 640px) {
    .meas-context-panel {
        flex-direction: column;
        align-items: stretch;
    }
    .meas-context-panel__link {
        width: 100%;
        justify-content: center;
    }
    .meas-form-section__fields {
        grid-template-columns: 1fr;
    }
}
.meas-wizard-stack {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.meas-wizard-track {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 200%;
    transform: translate3d(0, 0, 0);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
}
.meas-wizard-stack.is-detail-open .meas-wizard-track {
    transform: translate3d(-50%, 0, 0);
}
.meas-wizard-screen {
    flex: 0 0 50%;
    width: 50%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.meas-wizard-screen--details {
    background: var(--ds-surface);
}
.meas-wizard-form-wrap {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}
#modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: var(--ds-surface);
    overflow: hidden;
}
#modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__header.ds-card__header {
    border-bottom: 1px solid var(--ds-border);
    height: auto;
    min-height: var(--ds-panel-chrome-header-min-h);
    max-height: none;
    padding: var(--ds-popup-header-pad-y) var(--ds-popup-inset);
    gap: var(--space-3);
    box-sizing: border-box;
}
#modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__header .ds-card__title {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
#modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__body {
    padding: 0;
    gap: 0;
}
#modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__footer {
    box-sizing: border-box;
}
#modal-perform-measurement .meas-asset-card-panel__header--back {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
#modal-perform-measurement #btn-meas-close-details {
    flex-shrink: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
}
#modal-perform-measurement #btn-meas-close-details:hover:not(:disabled) {
    border-color: var(--ds-border-strong);
    background: var(--ds-surface);
}
#modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__summary--form {
    grid-template-columns: minmax(0, 1fr) 1px minmax(200px, 260px);
    column-gap: var(--ds-popup-inset);
}
@media (min-width: 1081px) {
    #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__summary--form.ds-product-asset-grid .ds-add-product-form__column--fields,
    #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__summary--form.ds-product-asset-grid .ds-add-product-form__column--code {
        padding-block: var(--space-4);
        padding-inline: 0;
    }
}
#modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__details {
    min-width: 0;
    overflow: hidden;
}
#modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__details .ds-detail-list {
    min-width: 0;
}
#modal-perform-measurement .meas-wizard-screen--details .ds-detail-list__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
    align-items: start;
}
@media (min-width: 1081px) {
    #modal-perform-measurement .meas-wizard-screen--details .ds-detail-list__row {
        grid-template-columns: minmax(108px, 34%) minmax(0, 1fr);
        gap: var(--space-3);
    }
}
#modal-perform-measurement .meas-wizard-screen--details .ds-detail-list__value {
    min-width: 0;
}
#modal-perform-measurement .meas-wizard-screen--details .ds-add-product-form__column--code {
    align-self: start;
    justify-self: stretch;
    min-width: 0;
}
#modal-perform-measurement .meas-wizard-screen--details .ds-actions-menu {
    position: relative;
}
@media (max-width: 768px) {
    #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__summary--form {
        grid-template-columns: 1fr;
    }
    #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__summary--form > .ds-add-product-form__column-divider {
        display: none;
    }
}
#modal-perform-measurement .meas-wizard-form-wrap.ds-inset-scroll--host {
    padding: 0;
    box-sizing: border-box;
}
#modal-perform-measurement .meas-wizard-form-wrap.ds-inset-scroll--host:not(:has(.ds-scroll-rail)) {
    padding-inline: var(--meas-wizard-inset-x);
    padding-block: var(--meas-wizard-inset-y);
    box-sizing: border-box;
}
/* Scroll-rail: lewy inset w body; prawy pas = kolumna gutter (w strefie paddingu) */
#modal-perform-measurement .meas-wizard-form-wrap.ds-inset-scroll--host:has(.ds-scroll-rail) {
    padding: 0;
}
#modal-perform-measurement .measurement-form {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#modal-perform-measurement .meas-wizard-stage {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#modal-perform-measurement .meas-wizard-step-viewport {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#modal-perform-measurement .meas-wizard-step-viewport > .meas-wizard-step:not([hidden]) {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}
#modal-perform-measurement .meas-wizard-step__inner--wide {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    height: auto;
}
#modal-perform-measurement .meas-wizard-step__inner--wide.meas-wizard-step__inner--finish {
    gap: var(--space-8);
}
#modal-perform-measurement .meas-wizard-step__cols {
    align-items: stretch;
}
#modal-perform-measurement .meas-wizard-step__cols .ds-add-product-form__block {
    align-self: stretch;
    width: 100%;
    gap: var(--space-5);
}
#modal-perform-measurement .meas-wizard-step__cols--method-device {
    align-items: start;
}
#modal-perform-measurement .meas-wizard-step__cols--method-device .ds-add-product-form__block {
    gap: var(--space-3);
}
#modal-perform-measurement .meas-wizard-step__cols > .meas-wizard-step__col-divider {
    position: absolute;
    top: 0;
    bottom: 0;
}
#modal-perform-measurement .meas-wizard-step__cols--split > .meas-wizard-step__col-divider {
    top: 0;
    bottom: 0;
    height: auto;
}
#modal-perform-measurement .meas-wizard-form-wrap.ds-inset-scroll--host:has(.ds-scroll-rail) > .ds-scroll-lane {
    padding: 0;
    box-sizing: border-box;
}
#modal-perform-measurement .meas-wizard-form-wrap > .ds-scroll-lane {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}
#modal-perform-measurement .meas-wizard-form-wrap .ds-scroll-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--meas-wizard-inset-x);
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    height: 100%;
}
#modal-perform-measurement .meas-wizard-form-wrap > .ds-scroll-lane > .ds-scroll-lane__inset,
#modal-perform-measurement .meas-wizard-form-wrap .ds-scroll-rail .ds-scroll-lane__inset {
    overflow: visible !important;
}
#modal-perform-measurement .meas-wizard-form-wrap .ds-scroll-rail__body {
    min-height: 0;
    flex: 1 1 auto;
    padding-inline-start: var(--meas-wizard-inset-x);
    padding-inline-end: 0;
    padding-block: var(--meas-wizard-inset-y);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
#modal-perform-measurement .meas-wizard-form-wrap .ds-scroll-rail .ds-scroll-lane__inset {
    flex: none;
    height: auto;
    min-height: 0;
}
#modal-perform-measurement .meas-wizard-form-wrap .ds-scroll-rail__body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.slide-panel__subhead--meas .selective-wizard-steps {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.slide-panel__subhead--meas .selective-wizard-steps__item {
    padding-block: var(--space-1);
    padding-inline: var(--space-1) var(--space-3);
    gap: var(--space-2);
}
.slide-panel__subhead--meas .selective-wizard-steps__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--ds-border);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1;
    text-align: center;
    box-sizing: border-box;
}
.slide-panel__subhead--meas .selective-wizard-steps__item.is-active .selective-wizard-steps__num {
    border: none;
    background: var(--ds-brand-cta);
    color: var(--ds-brand-contrast, #111);
}
.slide-panel__subhead--meas .selective-wizard-steps__item.is-done .selective-wizard-steps__num {
    border-color: var(--ds-brand-cta);
    color: var(--ds-brand-cta);
    background: transparent;
}
#modal-perform-measurement #meas-wizard-footer[hidden] {
    display: none !important;
}
#modal-perform-measurement #meas-wizard-footer .btn[hidden] {
    display: none !important;
}
#modal-perform-measurement #meas-wizard-footer .btn .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
}
#modal-perform-measurement .slide-panel__body--meas-wizard {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
#modal-perform-measurement .meas-wizard-stack {
    flex: 1 1 auto;
    min-height: 0;
}
#modal-perform-measurement .meas-wizard-screen--main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#modal-perform-measurement .meas-wizard-screen--main .slide-panel__body--meas-wizard {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#modal-perform-measurement .meas-wizard-step-viewport {
    position: relative;
}
#modal-perform-measurement .meas-wizard-step-viewport > .meas-wizard-step:not([hidden]) {
    position: relative;
    inset: auto;
    overflow: visible;
    padding: 0;
    width: 100%;
    max-width: none;
}
#modal-perform-measurement .slide-panel__body--meas-wizard.slide-panel__body--scroll-host {
    padding: 0;
}
#modal-perform-measurement .meas-wizard-form-wrap:has(.meas-wizard-stage--compact) {
    flex: 0 1 auto;
}
#modal-perform-measurement .meas-wizard-form-wrap:has(.meas-wizard-stage--compact) > .ds-scroll-lane {
    flex: 0 1 auto;
    height: auto;
}
/* measurement-form flex rules moved above with panel */
.meas-wizard-stage--compact {
    height: auto;
    min-height: 0;
    max-height: none;
    flex: 0 0 auto;
}
.meas-wizard-stage--compact .meas-wizard-step-viewport {
    flex: 0 0 auto;
    min-height: 0;
}
.meas-wizard-stage--compact .meas-wizard-step-viewport > .meas-wizard-step:not([hidden]) {
    position: relative;
    inset: auto;
    height: auto;
}
.meas-wizard-stage--compact .meas-wizard-step__inner--setup {
    height: auto;
}
.meas-wizard-stage--compact .meas-setup-step__body {
    flex: 0 0 auto;
    padding-bottom: 0;
}
.meas-wizard-stage--compact .meas-setup-step__content {
    flex: 0 0 auto;
}
.meas-wizard-stage--compact .meas-setup-step__col {
    min-height: 0;
}
.meas-wizard-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: min(58vh, 560px);
    height: min(58vh, 560px);
    max-height: min(58vh, 560px);
}
#modal-perform-measurement .meas-wizard-stage {
    flex: none;
    min-height: auto;
    height: auto;
    max-height: none;
    display: block;
}
.meas-wizard-step-viewport {
    position: relative;
    flex: 1;
    min-height: 0;
}
#modal-perform-measurement .meas-wizard-step-viewport {
    flex: none;
    min-height: auto;
}
.meas-wizard-step-viewport > .meas-wizard-step:not([hidden]) {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    padding: var(--space-3);
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    text-align: left;
}
.meas-wizard-step__inner {
    width: 100%;
    max-width: 300px;
    margin: auto;
}
.meas-wizard-step__inner--wide {
    max-width: 100%;
}
.meas-wizard-step-viewport > .meas-wizard-step--setup:not([hidden]) {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}
.meas-wizard-step__inner--setup {
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.meas-setup-step__body {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    min-height: 0;
}
.meas-setup-step__content--single {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}
.meas-setup-step__content--single .meas-setup-step__section + .meas-setup-step__section {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--ds-border);
}
.meas-setup-step__content--single .meas-setup-step__fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.meas-setup-step__col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
}
.meas-setup-step__section {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    box-sizing: border-box;
}
.meas-setup-step__section + .meas-setup-step__section {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--ds-border);
}
.meas-setup-step__col .ds-add-product-form__block {
    width: 100%;
    padding-block: 0;
}
.meas-setup-step__col .meas-setup-step__section {
    gap: var(--ds-block-title-gap);
}
.meas-setup-step__col .ds-add-product-form__block-title {
    flex-shrink: 0;
}
.meas-setup-step__col .measurement-form__method-field {
    margin-bottom: 0;
}
.meas-setup-step__divider {
    width: 1px;
    min-width: 1px;
    background: var(--ds-border);
    align-self: stretch;
    justify-self: center;
}
.meas-setup-step__fields-grid,
.meas-setup-step__fields {
    grid-template-columns: 1fr;
}
.meas-setup-step__start {
    width: 100%;
    flex-shrink: 0;
    margin-top: var(--space-5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    text-align: center;
    line-height: 1;
    padding-top: 0;
    padding-bottom: 0;
}
.meas-method-type--tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    padding: 0;
}
.meas-method-type--tiles .meas-method-type__btn {
    min-height: 44px;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
}
@media (max-width: 640px) {
    .meas-method-type--tiles {
        grid-template-columns: 1fr 1fr;
    }
    #modal-perform-measurement .meas-method-type--tiles .meas-method-type__btn {
        min-height: 40px;
    }
}
@media (max-width: 640px) {
    .meas-setup-step__content {
        grid-template-columns: 1fr;
        row-gap: var(--space-5);
    }
    .meas-setup-step__divider {
        display: none;
    }
    .meas-setup-step__content > .meas-setup-step__col + .meas-setup-step__col {
        margin-top: var(--space-5);
        padding-top: var(--space-5);
        border-top: 1px solid var(--ds-border);
    }
}
.measurement-form__asset-block {
    flex-shrink: 0;
}
.measurement-form__asset-toggle-icon {
    font-size: 1.25rem;
    transition: transform 0.15s ease;
}
.measurement-form__asset-toggle.is-expanded .measurement-form__asset-toggle-icon {
    transform: rotate(180deg);
}
.measurement-form__method-recap {
    margin: var(--space-2) 0 0;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
}
.measurement-form__active-point {
    margin: 0;
}
.meas-finish-recap {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.meas-finish-recap:empty {
    display: none;
}
.meas-finish-recap-card {
    min-width: 0;
}
.meas-finish-recap-card__header {
    gap: var(--space-4);
}
.meas-finish-recap-card__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.meas-finish-recap-card__value {
    flex-shrink: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.35;
    font-variant-numeric: var(--ds-font-numeric);
    color: var(--ds-text);
    text-align: right;
}
.meas-finish-recap-card__body {
    gap: var(--space-1);
    padding-top: var(--space-2);
    padding-inline: var(--ds-card-inset-x);
    padding-bottom: var(--space-3);
}
.meas-finish-recap-card__notes {
    margin: 0;
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.4;
    color: var(--ds-text-secondary);
}
.slide-panel__eyebrow {
    margin: 0 0 var(--space-1);
    font-size: var(--text-2xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--ds-text-tertiary);
}
.slide-panel__meta {
    margin: var(--space-1) 0 0;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
}
.slide-panel__body:not(.ds-inset-scroll--host) {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: var(--ds-popup-inset);
}
.slide-panel__body.ds-inset-scroll--host.slide-panel__body--scroll-host {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}
.slide-panel__body--scroll-host > .ds-scroll-lane:not(:has(.ds-product-asset-grid)) {
    padding: var(--ds-popup-inset);
    box-sizing: border-box;
}
.slide-panel__body--scroll-host > .ds-scroll-lane:has(.ds-product-asset-grid) {
    padding: 0;
}
.slide-panel__body--scroll-host .ds-scroll-rail {
    min-height: 0;
}
.ds-detail-list--panel {
    padding: 0;
}
#modal-location-details .ds-detail-list__row,
#modal-device-details .ds-detail-list__row {
    grid-template-columns: minmax(112px, 38%) minmax(0, 1fr);
}
.slide-panel__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--ds-popup-inset);
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface);
    flex-shrink: 0;
    box-sizing: border-box;
}
.slide-panel__footer-actions {
    display: flex;
    gap: var(--space-2);
}
body.slide-panel-open { overflow: hidden; }
body.slide-panel-instant .slide-panel__drawer,
body.slide-panel-instant .slide-panel__backdrop {
    transition: none !important;
}

/* ── Slide panel: szczegóły / formularze ── */
.details-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ds-border);
}
.details-label {
    color: var(--ds-text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
}
.details-value {
    font-size: var(--text-sm);
    font-weight: 400;
    margin: 0;
}
.details-row--inline {
    align-items: center;
    width: 100%;
}
.details-row__controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    min-width: 0;
}
.details-row__picker {
    flex: 1;
    min-width: 0;
}

/* ── Karta zasobu — przesuwanie widoków (karta | historia) w tym samym panelu ── */
.asset-panel-stack {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.asset-panel-track {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 200%;
    transform: translate3d(0, 0, 0);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
}
.asset-panel-stack.is-history-open .asset-panel-track {
    transform: translate3d(-50%, 0, 0);
}
.asset-panel-screen {
    flex: 0 0 50%;
    width: 50%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.asset-panel-screen .ds-asset-card-panel {
    flex: 1 1 auto;
    min-height: 0;
}
.asset-panel-history-intro {
    flex-shrink: 0;
    padding: 0 0 var(--space-3);
}
.asset-panel-history-intro__product {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text-secondary);
    line-height: 1.35;
}
.asset-panel-screen--history .product-history-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 0;
    overflow: hidden;
}
.asset-panel-screen--history .product-history-scroll > .ds-scroll-lane,
.asset-panel-screen--history .product-history-scroll .ds-scroll-lane__inset {
    padding: 0;
    min-height: 0;
}
.asset-panel-screen--history .product-history-scroll .ds-scroll-lane__inset {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.asset-panel-screen--history .product-history-scroll .ds-scroll-rail {
    grid-template-columns: minmax(0, 1fr);
}
.asset-panel-screen--history .product-history-scroll .ds-scroll-gutter {
    display: none !important;
}
.asset-panel-screen--history .product-history-scroll .ds-scroll-rail__body {
    padding: 0 !important;
    overflow-x: auto;
    overflow-y: auto;
}
.asset-panel-screen--history .product-history-table.ds-entity-list-body {
    padding: 0;
    border: none;
}
.asset-panel-screen--history .ds-asset-card-panel__body--flush {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: var(--ds-popup-inset);
    box-sizing: border-box;
}
#modal-product-details .asset-panel-screen--history .ds-asset-card-panel__body--flush,
#modal-perform-measurement .asset-panel-screen--history .ds-asset-card-panel__body--flush {
    padding: var(--ds-popup-inset);
}

/* ── Karta zasobu (slide-panel) ── */
.slide-panel__drawer--asset-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: min(920px, calc(100% - var(--space-4)));
    max-width: calc(100% - var(--space-4));
    background: transparent;
    border-left: none;
    box-shadow: none;
    overflow: hidden;
}
.slide-panel__drawer--asset-card .ds-asset-card-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    box-shadow: -10px 0 36px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}
.ds-asset-card-panel__header {
    padding-inline: var(--ds-header-pad-x);
    align-items: center;
    flex-wrap: nowrap;
    height: var(--ds-panel-chrome-header-min-h);
    min-height: var(--ds-panel-chrome-header-min-h);
    max-height: var(--ds-panel-chrome-header-min-h);
    padding-block: 0;
    border-bottom: 1px solid var(--ds-border);
}
.ds-asset-card-panel__header .ds-card__header-actions {
    align-self: flex-start;
    flex: 0 0 auto;
    flex-shrink: 0;
    height: auto;
    padding-top: 0;
}
.ds-asset-card-panel__header .ds-card__title {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: var(--leading-tight);
    color: var(--ds-text);
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
    align-self: center;
}
.ds-asset-card-panel__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    padding: var(--ds-card-inset-y) var(--ds-card-inset-x);
    overflow-y: auto;
}
.ds-asset-card-panel__details {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}
.ds-asset-card-panel__details > .ds-add-product-form__section-divider {
    margin: var(--ds-form-section-gap) 0;
    border-top-color: var(--ds-border);
}
#modal-product-details .ds-asset-card-panel__details > .ds-asset-card-panel__schedule-divider {
    display: none;
}
.ds-asset-card-panel__summary {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(240px, 1.35fr);
    gap: var(--space-5);
    align-items: start;
}
.ds-asset-card-panel__summary--form {
    --ds-add-product-block-title-h: 28px;
}
.ds-detail-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}
.ds-detail-list__row {
    display: grid;
    grid-template-columns: minmax(112px, 34%) minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ds-border);
}
.ds-detail-list__row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.ds-detail-list__row:first-child {
    padding-top: 0;
}
.ds-detail-list__label {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--ds-text-secondary);
    line-height: var(--leading-normal);
}
.ds-detail-list__value {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--ds-text);
    line-height: var(--leading-normal);
    min-width: 0;
}
.ds-detail-list__controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-width: 0;
}
.ds-detail-list__picker {
    flex: 1;
    min-width: 0;
}
.ds-asset-card-panel__qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-4);
    background: var(--ds-surface-muted);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    text-align: center;
}
.ds-asset-card-panel__qr-box {
    width: min(100%, 240px);
    min-height: 148px;
    height: auto;
    background: var(--ds-surface);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    padding: var(--space-5) var(--space-4);
    border: 1px solid var(--ds-border);
    box-sizing: border-box;
}
.ds-asset-card-panel__qr-box .product-code-qr__value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
}
.ds-asset-card-panel__qr-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    width: 100%;
}
.ds-asset-card-panel__section {
    display: flex;
    flex-direction: column;
    gap: var(--ds-panel-form-block-gap);
    padding-block: 0;
}
.ds-product-asset-grid .ds-asset-card-panel__section {
    gap: var(--ds-panel-form-block-gap);
}
.ds-asset-card-panel__section .ds-add-product-form__block-title {
    min-height: var(--ds-add-product-block-title-h, 28px);
}
.ds-asset-card-panel__section .ds-detail-list__row:first-child {
    padding-top: 0;
}
.ds-asset-card-panel__table-wrap {
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    overflow: hidden;
    max-height: min(240px, 36vh);
}
.ds-asset-card-panel__table-wrap .data-table thead th {
    background: var(--ds-surface-muted);
}
.ds-asset-card-panel__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    padding: var(--ds-popup-inset);
    box-sizing: border-box;
}
.ds-asset-card-panel__footer-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}
.ds-asset-card-panel__footer .btn .material-symbols-outlined {
    font-size: 18px;
}

/* Karta zasobu — modal szczegółów (layout treści) */
#modal-product-details .slide-panel__drawer--asset-card {
    overflow: hidden;
    background: var(--ds-surface);
}
#modal-product-details .asset-panel-screen,
#modal-product-details .asset-panel-stack,
#modal-product-details .asset-panel-track {
    background: var(--ds-surface);
}
#modal-product-details .ds-asset-card-panel {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: var(--ds-surface);
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
#modal-product-details .ds-asset-card-panel__header {
    height: auto;
    min-height: var(--ds-panel-chrome-header-min-h);
    max-height: none;
    padding: var(--ds-popup-header-pad-y) var(--ds-popup-inset);
    gap: var(--space-3);
    box-sizing: border-box;
}
#modal-product-details .ds-asset-card-panel__header .ds-card__title {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
#modal-product-details .ds-asset-card-panel__body {
    padding: 0;
    gap: 0;
}
#modal-perform-measurement .meas-detail-stack {
    height: 100%;
    min-height: 0;
}

#modal-measurement-detail.show { z-index: 2130; }
#modal-measurement-detail #measurement-detail-content .ds-add-product-form--panel-sections {
    --ds-panel-form-divider-margin: var(--space-8);
    --ds-panel-form-block-gap: var(--space-6);
}
.meas-compliance-detail.ds-detail-list {
    margin: 0;
}
.meas-compliance-block .ds-detail-list__value {
    font-weight: 500;
}
#modal-measurement-detail .ds-add-product-form--measurement-detail {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    min-width: 0;
}
#modal-measurement-detail .ds-add-product-form--measurement-detail .ds-detail-list {
    margin: 0;
}
#modal-measurement-detail .meas-detail-points {
    gap: 0;
}
#modal-measurement-detail .meas-detail-points--table .report-preview-points {
    overflow-x: auto;
    overflow-y: visible;
}
#modal-measurement-detail .meas-detail-points-table-wrap.ds-asset-card-panel__table-wrap {
    max-height: none;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}
#modal-measurement-detail .meas-detail-points-table-wrap.ds-asset-card-panel__table-wrap::-webkit-scrollbar {
    height: 6px;
}
#modal-measurement-detail .meas-detail-points-table-wrap.ds-asset-card-panel__table-wrap::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--ds-text-tertiary) 45%, transparent);
    border-radius: 999px;
}
#modal-measurement-detail .meas-detail-points--table .data-table--report-preview-points {
    min-width: 44rem;
    width: max-content;
    max-width: none;
}
#modal-measurement-detail .data-table--report-preview-points .report-preview-col--notes {
    width: auto;
    min-width: 14rem;
}
#modal-measurement-detail .data-table--report-preview-points .report-preview-col--reading {
    width: 1%;
    min-width: 9.5rem;
}
#modal-measurement-detail .data-table--report-preview-points .report-preview-col--points {
    min-width: 9rem;
}
#modal-measurement-detail .data-table--report-preview-points .report-preview-col--result {
    min-width: 7rem;
}
#modal-measurement-detail .data-table--report-preview-points .report-preview-col--status {
    min-width: 8.5rem;
}
#modal-measurement-detail .meas-detail-points-table__reading .meas-point-reading-btn {
    width: 100%;
    min-height: 2.5rem;
    justify-content: center;
}
#modal-measurement-detail .meas-detail-points-table__reading .meas-reading-block--point {
    min-width: 0;
}
#modal-measurement-detail .meas-detail-points-table__reading .meas-reading-thumb--md {
    width: min(100%, 12rem);
}
#modal-measurement-detail .meas-detail-points-empty {
    margin: 0;
    color: var(--ds-text-secondary);
}
#modal-measurement-detail .meas-detail-points--cards {
    display: none;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
    max-width: 100%;
}
#modal-measurement-detail .meas-detail-point-card {
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
#modal-measurement-detail .meas-detail-point-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-surface-muted);
    min-width: 0;
}
#modal-measurement-detail .meas-detail-point-card__title {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.4;
    color: var(--ds-text);
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
#modal-measurement-detail .meas-detail-point-card__head .ds-status-badge {
    flex: 0 1 auto;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
#modal-measurement-detail .meas-detail-point-card__body.ds-detail-list {
    margin: 0;
    min-width: 0;
}
#modal-measurement-detail .meas-detail-point-card__body .ds-detail-list__row {
    padding: var(--space-3) var(--space-4);
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
    min-width: 0;
}
#modal-measurement-detail .meas-detail-point-card__body .ds-detail-list__label,
#modal-measurement-detail .meas-detail-point-card__body .ds-detail-list__value {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
#modal-measurement-detail .meas-detail-point-card__body .ds-detail-list__row:last-child {
    border-bottom: none;
}
#modal-measurement-detail .meas-detail-point-card__body .ds-detail-list__row--reading .ds-detail-list__value {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
}
@media (max-width: 639px) {
    #modal-measurement-detail .meas-detail-points--table {
        display: none;
    }
    #modal-measurement-detail .meas-detail-points--cards {
        display: flex;
    }
    #modal-measurement-detail .meas-detail-point-card__head {
        flex-wrap: wrap;
    }
    #modal-measurement-detail .meas-reading-thumb--md {
        width: 100%;
        max-width: 100%;
    }
    #modal-measurement-detail .meas-reading-block__preview-actions .btn {
        flex: 1 1 calc(50% - var(--space-1));
        min-width: 0;
    }
    #modal-measurement-detail .meas-point-reading-btn {
        max-width: 100%;
    }
}
#modal-measurement-detail .meas-point-card--collapsible > summary {
    padding: var(--space-3) 0;
    min-height: 2.75rem;
}
#modal-measurement-detail .meas-point-card__expand {
    padding: 0;
    border-top: 1px solid var(--ds-border);
    background: transparent;
}
#modal-measurement-detail .meas-point-card__kv {
    gap: 0;
}
#modal-measurement-detail .meas-point-card__kv .ds-detail-list__label {
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
}
#modal-measurement-detail .meas-point-card__kv .ds-detail-list__value {
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}
#modal-measurement-detail .meas-point-card__kv .ds-detail-list__row--reading {
    padding-block: var(--space-4);
}
#modal-measurement-detail .ds-detail-list__value--reading {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
}
#modal-measurement-detail .meas-point-reading-btn {
    width: 100%;
    min-height: 2.75rem;
    justify-content: center;
}
#modal-measurement-detail .meas-reading-block--point {
    width: 100%;
}
#modal-measurement-detail .meas-reading-block--point .meas-reading-block__preview {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
}
#modal-measurement-detail .meas-reading-block--point .meas-reading-block__preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
#modal-measurement-detail .meas-reading-block--point .meas-reading-block__preview-actions .btn {
    min-height: 2.5rem;
}
.meas-point-card--collapsible {
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    overflow: hidden;
}
.meas-point-card--collapsible > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--ds-card-inset-x);
    min-height: 48px;
}
.meas-point-card--collapsible > summary::-webkit-details-marker {
    display: none;
}
.meas-point-card__summary-main {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    flex: 1 1 auto;
}
.meas-point-card__summary-meta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}
.meas-point-card__chev {
    color: var(--ds-text-secondary);
    transition: transform 0.2s ease;
}
.meas-point-card--collapsible[open] .meas-point-card__chev {
    transform: rotate(180deg);
}
.meas-point-card__expand {
    padding: 0 var(--ds-card-inset-x) var(--space-4);
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface-muted);
}
.meas-point-card__reading {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px dashed var(--ds-border);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.meas-point-card__reading-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text-secondary);
}
.meas-reading-block--point {
    margin: 0;
}
.meas-reading-thumb--md {
    max-width: 100%;
    width: min(100%, 280px);
}
.meas-reading-thumb--md img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 12rem;
    object-fit: contain;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
}
.report-preview-point-reading {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 14rem;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
}
.meas-point-sub {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid color-mix(in srgb, var(--ds-border) 80%, transparent);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--ds-surface-muted, var(--ds-bg)) 40%, var(--ds-surface));
}
.meas-point-sub__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-width: 0;
}
.meas-point-sub__name {
    font-weight: 600;
    color: var(--ds-text);
    min-width: 0;
}
.meas-point-sub__details.ds-detail-list,
.meas-point-sub__notes.ds-detail-list {
    gap: 0;
}
.meas-point-card--readonly .ds-card__body--compact {
    padding: var(--space-3) var(--ds-card-inset-x) var(--space-4);
}
.meas-point-card--readonly .ds-detail-list {
    gap: 0;
}
.meas-reading-block.is-loading {
    opacity: 0.72;
    pointer-events: none;
}
.meas-reading-thumb--lg {
    width: min(100%, 280px);
    height: auto;
    min-height: 120px;
}
.meas-reading-thumb--lg img {
    width: 100%;
    height: auto;
    object-fit: contain;
}
#modal-product-details .ds-asset-card-panel__details {
    min-width: 0;
    overflow: hidden;
}
#modal-product-details .ds-asset-card-panel__details .ds-detail-list {
    min-width: 0;
}
.ds-asset-card-panel__section .ds-detail-list__row,
#modal-product-details .ds-detail-list__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
    align-items: start;
}
@media (min-width: 1081px) {
    .ds-asset-card-panel__section .ds-detail-list__row,
    #modal-product-details .ds-detail-list__row {
        grid-template-columns: var(--ds-panel-detail-label-col) minmax(0, 1fr);
        gap: var(--ds-panel-detail-col-gap);
        align-items: center;
    }
}
#modal-product-details .ds-detail-list__value--field {
    min-width: 0;
}
#modal-product-details .ds-detail-list__field-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    max-width: none;
}
#modal-product-details .ds-detail-list__field-row .ds-detail-list__field,
#modal-product-details .ds-detail-list__field-row .custom-date-picker {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
}
#modal-product-details .ds-detail-list__save-btn {
    flex-shrink: 0;
    color: var(--ds-brand-cta-text, var(--ds-text));
    background: var(--ds-brand-tint-12);
    border-radius: var(--radius-sm);
}
#modal-product-details .ds-detail-list__value {
    min-width: 0;
}
#modal-product-details .ds-detail-list__value--with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}
#modal-product-details .ds-detail-list__inline-action {
    flex-shrink: 0;
    margin-left: auto;
    white-space: nowrap;
}
#modal-perform-measurement .ds-detail-list__value--with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}
#modal-perform-measurement .ds-detail-list__inline-action {
    flex-shrink: 0;
    margin-left: auto;
    white-space: nowrap;
}
.product-history-table .data-table tbody tr.clickable-row {
    cursor: pointer;
}
.product-history-table .data-table tbody tr.clickable-row:hover td {
    background: var(--ds-row-hover-bg);
}
:is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view {
    container-type: inline-size;
    container-name: product-history;
}
:is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}
:is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history col.data-table__col-date { width: 18%; }
:is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history col.data-table__col-time { width: 12%; }
:is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history col.data-table__col-status { width: 20%; }
:is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history col.data-table__col-name { width: auto; }
:is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history col.data-table__col-kebab { width: var(--ds-entity-actions-w); }
.product-history-table .data-table :is(th.data-table__col-status, td.data-table__cell-status) {
    overflow: visible;
}
/* Historia pomiarów — wąski kontener (mobile / panel boczny): wiersze jak karty zamiast ściskanej tabeli */
@container product-history (max-width: 560px) {
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history {
        display: block;
        width: 100%;
        min-width: 0;
        table-layout: auto;
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history colgroup,
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history thead {
        display: none;
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody {
        display: block;
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row {
        display: block;
        position: relative;
        padding: var(--space-3) var(--ds-inset-x);
        padding-right: calc(var(--ds-inset-x) + 40px);
        border-bottom: 1px solid var(--ds-border);
        cursor: pointer;
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row:hover td {
        background: transparent;
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row td {
        display: block;
        width: 100%;
        padding: 0;
        border: none;
        background: transparent !important;
        text-align: left;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row td.data-table__cell-date,
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row td.data-table__cell-time {
        display: inline;
        width: auto;
        font-size: var(--text-sm);
        font-weight: 600;
        vertical-align: baseline;
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row td.data-table__cell-date::after {
        content: " · ";
        font-weight: 400;
        color: var(--ds-text-tertiary);
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row td.data-table__cell-time {
        color: var(--ds-text-secondary);
        font-weight: 500;
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row td.data-table__cell-status {
        margin-top: var(--space-2);
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row td.data-table__cell-status .ds-status-badge {
        white-space: normal;
        max-width: 100%;
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row td.data-table__cell-name {
        margin-top: var(--space-1);
        font-size: var(--ds-entity-font-meta);
        color: var(--ds-text-secondary);
        line-height: var(--ds-entity-line);
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row td.data-table__cell-name::before {
        content: "Wykonał: ";
        color: var(--ds-text-tertiary);
    }
    #esd-app :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row td.ds-row-kebab-cell {
        position: absolute;
        top: var(--space-3);
        right: var(--ds-inset-x);
        width: auto;
        padding: 0;
    }
    #esd-app .asset-panel-screen--history .product-history-table.ds-entity-list-view:not(.entity-grid) .data-table tbody tr.meas-history-row td:not(.ds-row-kebab-cell) {
        padding-left: 0;
        padding-right: 0;
    }
    #esd-app .asset-panel-screen--history .product-history-table.ds-entity-list-view:not(.entity-grid) .data-table tbody tr.meas-history-row td.ds-row-kebab-cell {
        padding-right: 0;
    }
    #esd-app .asset-panel-screen--history :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row {
        padding-inline: 0;
        padding-right: 40px;
    }
    #esd-app .asset-panel-screen--history :is(.ds-entity-list-body, .entity-list).product-history-table.ds-entity-list-view .data-table.data-table--measurement-history tbody tr.meas-history-row td.ds-row-kebab-cell {
        right: 0;
    }
}

/* Małe popupy wizarda (data, krok 1 raportu, podsumowanie audytu) */
.ds-wizard-dialog.ds-dialog--sm {
    --ds-dialog-w: 400px;
}
.ds-wizard-dialog .ds-dialog__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(var(--ds-popup-inset) + var(--space-4)) var(--ds-popup-inset) var(--ds-popup-inset);
    overflow: visible;
    min-height: min(360px, 50dvh);
}
.ds-wizard-dialog--schedule-date:not(:has(> .ds-dialog__panel > .ds-dialog__header)) .ds-dialog__body,
.ds-wizard-dialog--schedule-date:not(:has(.ds-dialog__header)) .ds-dialog__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: var(--ds-popup-inset);
    overflow: visible;
    min-height: 0;
}
.ds-wizard-dialog--schedule-date .ds-dialog__header {
    padding-inline: var(--ds-popup-inset);
}
.ds-wizard-dialog--schedule-date:has(.ds-dialog__header) .ds-dialog__body {
    justify-content: flex-start;
    align-items: stretch;
    padding: var(--space-5) var(--ds-popup-inset) var(--ds-popup-inset);
    min-height: 0;
}
.ds-wizard-dialog .schedule-date-step {
    width: min(100%, 320px);
}
.ds-wizard-dialog--schedule-date .schedule-date-step {
    width: 100%;
    max-width: none;
    gap: var(--space-4);
    align-items: center;
    text-align: center;
}
.ds-wizard-dialog--schedule-date .schedule-date-step__title {
    width: 100%;
    text-align: center;
}
.ds-wizard-dialog .schedule-date-step__input:not(.schedule-date-step__input--text) {
    text-align: center;
    padding-left: 44px;
}

.selective-scope-step {
    width: 100%;
    max-width: 100%;
}
.selective-scope-step .schedule-date-step__field,
.selective-scope-step .custom-select,
.selective-scope-step .custom-select-trigger {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.selective-scope-step .custom-select-options {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.selective-wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    max-width: 100%;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--ds-border);
}
.selective-wizard-steps__item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-pill, 999px);
    color: var(--ds-text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.selective-wizard-steps__item:hover:not(.is-disabled):not(.is-active) {
    color: var(--ds-text);
    background: var(--ds-brand-tint-22);
}
.selective-wizard-steps__item.is-disabled,
.selective-wizard-steps__item[aria-disabled="true"] {
    cursor: default;
    pointer-events: none;
}
.selective-wizard-steps__item:focus {
    outline: none;
}
.selective-wizard-steps__item:focus-visible:not(.is-disabled) {
    outline: none;
    box-shadow: var(--ds-interactive-focus-ring);
}
.selective-wizard-steps__item.is-active {
    color: var(--ds-text);
    background: var(--ds-brand-tint-22);
    font-weight: 600;
}
.selective-wizard-steps__item.is-done {
    color: var(--ds-text);
}
.selective-wizard-steps__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--ds-border);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1;
}
.selective-wizard-steps__item.is-active .selective-wizard-steps__num {
    border: none;
    background: var(--ds-brand);
    color: var(--ds-brand-contrast, #111);
}
.selective-wizard-steps__item.is-done .selective-wizard-steps__num {
    border-color: var(--ds-brand);
    color: var(--ds-brand);
}
.selective-wizard-steps__sep {
    font-size: 18px;
    color: var(--ds-text-tertiary, var(--ds-text-secondary));
    user-select: none;
}
.selective-wizard-dialog .schedule-date-step {
    width: 100%;
    max-width: 100%;
}
.selective-scope-step__context {
    margin: 0 0 var(--space-3);
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
    text-align: center;
    width: 100%;
}
.selective-scope-step .schedule-date-step__actions {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
}
.selective-scope-step .schedule-date-step__field {
    width: 100%;
    max-width: 100%;
}
.ds-scope-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill, 999px);
    background: var(--ds-surface-muted);
    border: 1px solid var(--ds-border);
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
    max-width: min(360px, 50vw);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.schedule-date-step__actions--stack {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}
.schedule-date-step__actions--stack .btn {
    width: 100%;
}

@media (min-width: 769px) {
    .slide-panel.ds-dialog.show .slide-panel__drawer--asset-card {
        width: min(100%, 920px);
        max-width: 920px;
        height: auto;
    }
}

@media (max-width: 768px) {
    .slide-panel.ds-dialog.show.slide-panel--asset-card {
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
    }
    .slide-panel.ds-dialog.show .slide-panel__drawer--asset-card {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100dvh;
        border-radius: 0;
        align-self: stretch;
    }
    .slide-panel.ds-dialog.show .slide-panel__drawer--asset-card .ds-asset-card-panel {
        border-radius: 0;
    }
    .ds-asset-card-panel__summary {
        grid-template-columns: 1fr;
    }
    .ds-asset-card-panel__footer {
        flex-direction: column;
        align-items: stretch;
    }
    .ds-asset-card-panel__footer-group {
        width: 100%;
    }
    .ds-asset-card-panel__footer-group .btn {
        flex: 1 1 auto;
    }
}

.product-details-grid {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: var(--space-5);
}
.qr-code-section {
    text-align: center;
    border-left: 1px solid var(--ds-border);
    padding-left: var(--space-5);
}
#qr-code-box:not(.qr-preview-box),
.qr-code-box {
    width: min(100%, 220px);
    min-height: 160px;
    height: auto;
    background: var(--ds-surface);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    padding: var(--space-2);
    border: 1px solid var(--ds-border);
    box-sizing: border-box;
}
#qr-code-box img,
#qr-code-box svg,
#qr-code-box canvas,
.ds-asset-card-panel__qr-box img,
.ds-asset-card-panel__qr-box svg,
.ds-asset-card-panel__qr-box canvas,
.qr-code-box img,
.qr-code-box svg,
.qr-code-box canvas {
    max-width: 100%;
    height: auto;
}
html[data-theme="dark"] #qr-code-box:not(.qr-preview-box),
html[data-theme="dark"] .ds-asset-card-panel__qr-box,
html[data-theme="dark"] .qr-code-box {
    background: #fff;
}
.qr-code-actions {
    display: flex;
    gap: var(--space-1);
    justify-content: center;
    margin-top: var(--space-2);
}
.product-history-section .form-divider-title {
    margin-top: var(--space-8);
}
.product-history-scroll {
    max-height: 200px;
}

.global-search-panel__input.ds-date-input {
    height: var(--ds-search-h);
    min-height: var(--ds-search-h);
    padding: 0 var(--ds-search-pad-x);
    font-size: var(--text-base);
    box-sizing: border-box;
}
.global-search-results {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.slide-panel__body--overflow-visible {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.measurement-form__asset-block .ds-add-product-form__block-title {
    margin-bottom: var(--space-4);
}
.measurement-form__asset-block .measurement-form__context--product {
    margin-bottom: 0;
}
.measurement-form__context {
    background: var(--ds-surface-muted);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--ds-border);
}
.measurement-form__context--product {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.measurement-form__context-facts {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
}
.measurement-form__context-row {
    display: grid;
    grid-template-columns: minmax(108px, 36%) minmax(0, 1fr);
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ds-border);
    min-width: 0;
}
.measurement-form__context-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.measurement-form__context-row:first-child {
    padding-top: 0;
}
.measurement-form__context-row dt {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text-secondary);
    line-height: 1.55;
}
.measurement-form__context-row dd {
    margin: 0;
    min-width: 0;
}
.measurement-form__context-value--name {
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.35;
}
.measurement-form__context-value--code {
    font-size: var(--text-base);
    font-weight: 600;
}
.measurement-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}
.measurement-form__fields-grid--exec {
    grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 640px) {
    .measurement-form__fields-grid--exec {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .measurement-form__fields-grid--exec .measurement-form__field--full {
        grid-column: 1 / -1;
    }
}
.measurement-form__asset-block .ds-add-product-form__block-title,
.measurement-form__context--details {
    margin-bottom: var(--space-4);
}
.measurement-form__context--details {
    margin-top: 0;
}
.measurement-form__method-field {
    margin-bottom: var(--space-3);
}
.meas-method-type {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: max(var(--ds-field-isolation), var(--space-2));
    width: 100%;
    padding: var(--ds-field-isolation);
    box-sizing: border-box;
}
.meas-method-type__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-1);
    min-height: 64px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface-muted);
    color: var(--ds-text-secondary);
    font-family: var(--font-ui);
    overflow: visible;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.meas-method-type__btn:hover:not(.is-active) {
    border-color: var(--ds-interactive-hover-border);
    background: var(--ds-interactive-hover-bg);
    color: var(--ds-text);
}
.meas-method-type__btn.is-active {
    border-color: var(--ds-brand-cta);
    background: var(--ds-brand-tint-18);
    color: var(--ds-text);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ds-brand-cta) 40%, transparent);
}
.meas-method-type__btn:focus-visible {
    outline: none;
    border-color: var(--ds-interactive-focus-border);
    box-shadow: var(--ds-interactive-focus-ring);
}
.meas-method-type__btn.is-active:focus-visible {
    border-color: var(--ds-brand-cta);
    box-shadow: var(--ds-interactive-focus-ring);
}
.meas-method-type__code {
    font-size: var(--text-base);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    width: 100%;
}
.meas-method-type__desc {
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.35;
    color: var(--ds-text-secondary);
    width: 100%;
}
.meas-method-type__btn.is-active .meas-method-type__desc {
    color: var(--ds-text);
    font-weight: 600;
}
.measurement-form__reading-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
}

.measurement-form__reading-footer {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--ds-border);
}
#meas-step-finish .measurement-form__reading-btn .material-symbols-outlined,
#meas-step-finish .schedule-date-step__cal-btn .material-symbols-outlined,
#meas-step-finish .btn-cal-nav-sm .material-symbols-outlined {
    font-size: 1.375rem;
}
#meas-step-finish .measurement-form__reading-btn {
    min-height: 48px;
    font-size: var(--text-base);
}
#meas-step-finish .measurement-form__reading-btn .material-symbols-outlined {
    font-size: 1.5rem;
}
.measurement-form__reading-hint {
    margin: 0;
    color: var(--ds-text-secondary);
}
.measurement-point-card__remove:hover,
.measurement-point-card__remove:focus-visible {
    color: var(--ds-text);
    background: var(--ds-surface-muted);
}
.measurement-point-card__remove:hover .material-symbols-outlined,
.measurement-point-card__remove:focus-visible .material-symbols-outlined {
    color: var(--ds-text);
}
.meas-resistance-field--auto {
    grid-template-columns: minmax(0, 1fr) auto;
}
.meas-resistance-field--auto .meas-resistance-field__unit {
    white-space: nowrap;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text-secondary);
}
.custom-time-popup {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 100;
    min-width: 100%;
    box-sizing: border-box;
    padding: var(--space-4);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}
.custom-time-popup.small-popup {
    min-width: 100%;
    width: 100%;
}
.custom-time-popup.open {
    display: block;
    animation: dsPopupIn 0.18s ease;
}
.schedule-time-step__picker {
    position: relative;
    width: 100%;
}
.modal-confirm-message {
    margin: 0 0 var(--space-4);
    color: var(--ds-text-secondary);
    font-size: var(--text-sm);
    line-height: 1.5;
}
.measurement-form__context-value {
    display: block;
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--ds-text);
    line-height: 1.55;
    word-break: break-word;
}
.ds-add-product-form--measurement {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}
.ds-add-product-form--measurement .ds-add-product-form__section-divider {
    margin: 0;
}
.measurement-form__fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ds-form-grid-gap);
    align-items: start;
}
.measurement-form__fields-grid--summary {
    grid-template-columns: minmax(0, 1fr);
}
.measurement-form__field--full {
    grid-column: 1 / -1;
}
.measurement-form__field--device {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
}
.measurement-form__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-3);
}
.measurement-form__section-head .ds-add-product-form__block-title {
    margin-bottom: 0;
}
.measurement-form__field-aux {
    margin-top: var(--space-3);
}
.measurement-form__aux-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}
.ds-time-field {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}
.ds-time-field .ds-time-input {
    width: 100%;
    padding-right: 44px;
    appearance: none;
    -webkit-appearance: none;
}
.ds-time-field .ds-time-input::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 44px;
    height: 100%;
    cursor: pointer;
}
.ds-time-field__icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--ds-text-tertiary);
    pointer-events: none;
}
.meas-method-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    width: 100%;
}
.meas-method-toggle__btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: var(--ds-control-h);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    color: var(--ds-text-secondary);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.meas-method-toggle__btn:hover {
    border-color: var(--ds-border-strong);
    background: var(--ds-surface-muted);
}
.meas-method-toggle__btn.is-active {
    border-color: var(--ds-brand);
    background: var(--ds-brand-tint-12, rgba(234, 179, 8, 0.12));
    color: var(--ds-text);
}
.meas-method-toggle__code {
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.02em;
}
.meas-method-toggle__desc {
    font-size: var(--text-xs);
    color: var(--ds-text-secondary);
}
.meas-method-toggle__btn.is-active .meas-method-toggle__desc {
    color: var(--ds-text);
}
.measurement-points-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.measurement-point-card {
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}
.measurement-point-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: var(--ds-surface-muted);
    border-bottom: 1px solid var(--ds-border);
}
.measurement-point-card__badge {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
}
.measurement-point-card__remove:disabled {
    opacity: 0.35;
    pointer-events: none;
}
.measurement-form__point-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ds-form-grid-gap);
    padding: var(--space-4);
}
.meas-resistance-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: calc(var(--space-2) + var(--ds-field-isolation));
    width: 100%;
    box-sizing: border-box;
}
.meas-resistance-field--auto {
    grid-template-columns: minmax(0, 1fr) auto;
}
.meas-resistance-field__num {
    min-width: 0;
}
.meas-resistance-field__exp {
    min-width: 88px;
}
.meas-resistance-field__unit {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text-secondary);
    padding-inline: var(--space-1);
}
.measurement-form__grid-spaced {
    margin-top: var(--space-4);
}
@media (max-width: 768px) {
    .measurement-form__fields-grid,
    .measurement-form__point-grid,
    .measurement-form__context-row {
        grid-template-columns: minmax(0, 1fr);
    }
    .measurement-form__field--device {
        width: 100%;
    }
    .meas-method-toggle {
        grid-template-columns: minmax(0, 1fr);
    }
}
.measurement-form__point-grid--readonly {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
}
.measurement-point-card--readonly {
    margin-bottom: var(--space-3);
}

/* --- Formularz pomiarowy: kroki i punkty --- */
.meas-wizard-step[hidden] {
    display: none !important;
}
.measurement-form__asset-block[hidden] {
    display: none !important;
}
.meas-wizard-step {
    padding-bottom: 0;
}
.meas-wizard-step__title {
    margin-bottom: var(--space-4);
}
.measurement-form__subheading {
    margin: var(--space-4) 0 var(--space-3);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
}
#modal-perform-measurement .measurement-form__active-point-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.measurement-form__active-point-body {
    display: grid;
    gap: var(--ds-form-grid-gap);
}
.measurement-form__active-point-body[data-layout="rg"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
        "name result"
        "notes notes"
        "status reading"
        "confirm confirm";
}
.measurement-form__active-point-body[data-layout="rpp"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
        "name-a name-b"
        "result-a result-a"
        "notes notes"
        "status reading"
        "confirm confirm";
}
.measurement-form__active-point-body[data-layout="rg"] .measurement-form__point-cell--result-a {
    grid-area: result;
}
.measurement-form__active-point-body[data-layout="rpp"] .measurement-form__point-cell--result-a {
    grid-area: result-a;
}
.measurement-form__point-cell--name { grid-area: name; }
.measurement-form__point-cell--name-a { grid-area: name-a; }
.measurement-form__point-cell--name-b { grid-area: name-b; }
.measurement-form__point-cell--notes { grid-area: notes; }
.measurement-form__point-cell--status { grid-area: status; }
.measurement-form__point-cell--reading { grid-area: reading; }
.measurement-form__point-cell--confirm {
    grid-area: confirm;
    margin: 0;
}
.measurement-form__point-cell[hidden] {
    display: none !important;
}
@media (max-width: 640px) {
    #modal-perform-measurement .meas-wizard-step__fields-grid--env {
        grid-template-columns: minmax(0, 1fr);
    }
}
#modal-perform-measurement .ds-add-product-form--measurement .form-group input:not([type="hidden"]),
#modal-perform-measurement .ds-add-product-form--measurement .form-group textarea:not(#meas-point-notes),
#modal-perform-measurement .ds-add-product-form--measurement .form-group .custom-select-trigger,
#modal-perform-measurement .ds-add-product-form--measurement .form-group .ds-date-input,
#modal-perform-measurement .ds-add-product-form--measurement .meas-resistance-field__num {
    min-height: var(--ds-control-h);
    box-sizing: border-box;
}
#modal-perform-measurement .ds-add-product-form--measurement #meas-point-notes {
    min-height: 5rem;
    resize: vertical;
    box-sizing: border-box;
}
#modal-perform-measurement .ds-add-product-form--measurement .meas-resistance-field {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--ds-control-h);
    padding: 0;
    box-sizing: border-box;
}
#modal-perform-measurement .ds-add-product-form--measurement .meas-resistance-field__num {
    flex: 1 1 auto;
    min-width: 0;
}
#modal-perform-measurement .measurement-form__point-grid--active {
    padding: 0;
}
#modal-perform-measurement .measurement-form__points-stack {
    gap: var(--space-4);
}
#modal-perform-measurement .measurement-form__point-action-btn {
    width: 100%;
    margin-top: 0;
}
#modal-perform-measurement .measurement-form__reading-btn {
    width: 100%;
}
#modal-perform-measurement .ds-add-product-form--measurement .ds-add-product-form__block {
    padding-block: 0;
}
.meas-point-list-row__open {
    display: flex;
    flex: 1;
    min-width: 0;
    pointer-events: none;
}
.measurement-form__active-point-wrap[hidden] {
    display: none !important;
}
@media (max-width: 640px) {
    .slide-panel__subhead--meas .selective-wizard-steps__label {
        display: none;
    }
    .slide-panel__subhead--meas .selective-wizard-steps__sep {
        margin-inline: 0;
    }
    .meas-context-panel__link .material-symbols-outlined {
        font-size: 1.125rem;
    }
    .meas-setup-step__content--single .meas-setup-step__fields-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
.meas-detail-points-title {
    margin: var(--space-4) 0 var(--space-3);
}
.meas-reading-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.meas-reading-block__hint {
    margin: var(--space-2) 0 0;
    color: var(--ds-text-secondary);
}
.meas-reading-block__preview {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.meas-reading-block__preview.is-hidden {
    display: none;
}
.meas-reading-block__img {
    display: block;
    width: 100%;
    max-width: 360px;
    max-height: 240px;
    object-fit: contain;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface-muted);
}
.meas-reading-block__preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.meas-reading-thumb {
    display: inline-flex;
    padding: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface-muted);
    cursor: pointer;
    overflow: hidden;
    line-height: 0;
    transition: border-color var(--ds-motion-fast), box-shadow var(--ds-motion-fast);
}
.meas-reading-thumb:hover {
    border-color: var(--ds-border-strong);
    box-shadow: var(--ds-shadow-sm);
}
.meas-reading-thumb img {
    width: 56px;
    height: 40px;
    object-fit: cover;
    display: block;
}
.meas-reading-view {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    box-sizing: border-box;
}
.meas-reading-view.is-open {
    display: flex;
}
.meas-reading-view__backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--ds-text) 52%, transparent);
}
.meas-reading-view__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 720px);
    max-height: min(92vh, 900px);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--ds-shadow-lg);
    overflow: hidden;
}
.meas-reading-view__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--ds-border);
}
.meas-reading-view__title {
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
}
.meas-reading-view__body {
    padding: var(--space-4);
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
.meas-reading-view__img {
    display: block;
    max-width: 100%;
    max-height: min(72vh, 760px);
    object-fit: contain;
    border-radius: var(--radius-md);
}
.ds-input-plain {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}
.slide-panel-form__submit {
    margin-top: var(--space-4);
}
.panel-details-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.data-table__empty-cell {
    text-align: center;
}

@media (max-width: 640px) {
    .product-details-grid {
        grid-template-columns: 1fr;
    }
    .qr-code-section {
        border-left: none;
        padding-left: 0;
        margin-top: var(--space-4);
    }
}

/* Custom date/time inputs */
.custom-date-picker { position: relative; width: 100%; z-index: 20; overflow: visible; cursor: pointer; }
.schedule-date-step__picker { cursor: pointer; }
.custom-calendar-popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 400;
    display: none;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
    padding: var(--space-4);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}
.custom-calendar-popup.small-popup {
    min-width: 100%;
    width: 100%;
}
.custom-calendar-popup.open { display: block; animation: dsPopupIn 0.18s ease; }
@keyframes dsPopupIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--ds-border);
}
.custom-cal-month-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
}
.btn-cal-nav-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    cursor: pointer;
    color: var(--ds-text-secondary);
}
.btn-cal-nav-sm:hover { background: var(--ds-surface-muted); }
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}
.calendar-grid--names { margin-bottom: 4px; }
.calendar-day-name {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--ds-text-tertiary);
    padding: 2px 0;
}
/* Mini kalendarz (popup daty) — aktywny: żółte tło; hover: ciemna obwódka bez wypełnienia */
.custom-calendar-popup .calendar-day,
.calendar-grid .calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    min-width: 0;
    aspect-ratio: 1;
    padding: 0;
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    cursor: pointer;
    color: var(--ds-text);
    user-select: none;
    box-shadow: none;
    transform: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    box-sizing: border-box;
}
.custom-calendar-popup .calendar-day:hover:not(.muted):not(.empty):not(.selected),
.calendar-grid .calendar-day:hover:not(.muted):not(.empty):not(.selected) {
    background: var(--ds-cal-hover-bg) !important;
    border: 1px solid var(--ds-cal-hover-border) !important;
    box-shadow: none !important;
    transform: none;
}
.custom-calendar-popup .calendar-day.selected,
.custom-calendar-popup .calendar-day.selected:hover,
.calendar-grid .calendar-day.selected,
.calendar-grid .calendar-day.selected:hover {
    background: var(--ds-cal-selected-bg);
    border: 1px solid var(--ds-cal-selected-border);
    color: var(--ds-cal-selected-text);
    font-weight: 600;
    border-radius: 2px;
    box-shadow: none;
    transform: none;
}
.custom-calendar-popup .calendar-day.today:not(.selected),
.calendar-grid .calendar-day.today:not(.selected) {
    border-color: var(--ds-border-strong);
    font-weight: 600;
    box-shadow: none;
}
.custom-calendar-popup .calendar-day.muted,
.custom-calendar-popup .calendar-day.empty,
.calendar-grid .calendar-day.muted,
.calendar-grid .calendar-day.empty {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
    background: transparent;
    border-color: transparent;
}
.calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }

.ds-date-input {
    width: 100%;
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
    padding: 0 12px;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    color: var(--ds-text);
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    font-family: var(--font-ui);
    line-height: var(--ds-control-h);
    box-sizing: border-box;
    outline: none;
    background-clip: padding-box;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.ds-date-input:hover:not(:focus):not(:focus-visible):not(:disabled) {
    border-color: var(--ds-interactive-hover-border);
    background: var(--ds-field-hover-bg);
}
.ds-date-input:focus,
.ds-date-input:focus-visible {
    outline: none;
    border: 1px solid var(--ds-interactive-focus-border);
    background: var(--ds-surface);
    box-shadow: var(--ds-interactive-focus-ring);
}
.custom-cal-month-label { font-size: var(--text-sm); font-weight: 700; color: var(--ds-text); }
.btn-cal-nav-sm {
    border: 1px solid var(--ds-border);
    background: var(--ds-surface-muted);
    border-radius: var(--radius-sm);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ds-text-secondary);
}
.btn-cal-nav-sm .material-symbols-outlined { font-size: 18px; }
.custom-time-field__row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.custom-time-field__sep { font-weight: 700; color: var(--ds-text-secondary); }
.custom-select--time { min-width: 72px; }

/* Schedule picker */
.view-toolbar--panel { padding: 0 var(--ds-content-pad); border-bottom: 1px solid var(--ds-border); background: var(--ds-bg); flex-shrink: 0; }
.schedule-picker-table { margin: 0; border: 1px solid var(--ds-border); border-radius: var(--radius-md); overflow: hidden; }
.schedule-picker-table .data-table thead th { position: sticky; top: 0; background: var(--ds-surface-muted); z-index: 1; }
.schedule-product-row--selected { background: var(--ds-surface-muted); }
.ds-check--table { width: auto; }
.ds-check--head .ds-check__label { font-size: var(--text-2xs); text-transform: uppercase; }
#schedule-selected-count { font-size: var(--text-sm); font-weight: 600; color: var(--ds-text-secondary); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Calendar full-height view ── */
.dashboard-view--calendar-fill {
    min-height: 0;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#view-calendar .dashboard-scroll--calendar-fill {
    flex: 1 1 0;
    min-height: 0;
}
#view-profile.ds-account-view,
#view-settings.ds-account-view,
#view-notifications.ds-account-view {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}
.dashboard-scroll[data-account-shell]:has(> .notif-module) {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.dashboard-scroll[data-account-shell]:has(> .notif-module) > .account-section-header {
    flex-shrink: 0;
}
.dashboard-scroll[data-account-shell]:has(> .notif-module) > .notif-module {
    flex: 1 1 auto;
    min-height: min(560px, calc(100dvh - 168px));
}
.dashboard-scroll[data-account-shell] .settings-layout {
    flex: 0 0 auto;
    min-height: unset;
}
.dashboard-scroll[data-account-shell] .account-shell__body > .notif-module {
    flex: 1;
    min-height: 0;
}
.dashboard-scroll--calendar-fill {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: var(--ds-dashboard-shell-pad-y) var(--ds-dashboard-shell-pad-x);
}
.dashboard-scroll--calendar-fill.cal-scroll--month {
    overflow: hidden;
}
.dashboard-scroll--calendar-fill.cal-scroll--time {
    overflow: hidden;
}
.dashboard-scroll--calendar-fill > .ds-page-header,
.dashboard-scroll--calendar-fill > .cal-page-kpi-row {
    flex-shrink: 0;
}
.dashboard-scroll--calendar-fill > .cal-page-module,
#view-calendar #cal-page-module {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    align-self: stretch;
}
.cal-page-header-actions__mobile { display: none; position: relative; }
.ds-card__header--cal-page {
    display: flex;
    align-items: center;
    height: var(--ds-card-header-height);
    min-height: var(--ds-card-header-height);
    max-height: var(--ds-card-header-height);
    box-sizing: border-box;
}
.ds-card__header--cal-page > * {
    align-self: center;
}
.ds-card__header--cal-page .cal-page-toolbar {
    align-items: center;
    min-height: 40px;
    width: 100%;
}
.ds-card__header--cal-page .cal-page-header__views {
    order: 2;
    margin-left: auto;
}

/* Mini widok dnia — ten sam styl co .cal-time-grid */
.cal-day-mini {
    display: flex;
    flex-direction: column;
    flex: none;
    min-height: auto;
    height: auto;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    overflow-x: hidden;
    overflow-y: visible;
    background: var(--ds-surface);
    box-shadow: var(--ds-cal-panel-shadow);
    --cal-mini-gutter-width: 72px;
}
.cal-day-mini__hours {
    display: grid;
    grid-template-rows: repeat(var(--cal-mini-hour-count, 17), minmax(var(--cal-mini-row-min, 36px), auto));
    flex: none;
    min-height: auto;
    overflow: visible;
}
.cal-day-mini__row {
    display: grid;
    grid-template-columns: var(--cal-mini-gutter-width) minmax(0, 1fr);
    min-height: var(--cal-mini-row-min, 36px);
    height: auto;
    position: relative;
    border-bottom: 1px solid var(--ds-border);
}
.cal-day-mini__row:last-child {
    border-bottom: none;
}
.cal-day-mini__row--alt .cal-day-mini__slot {
    background: rgba(0, 0, 0, 0.025);
}
[data-theme="dark"] .cal-day-mini__row--alt .cal-day-mini__slot {
    background: rgba(255, 255, 255, 0.03);
}
.cal-day-mini__row:hover .cal-day-mini__hour,
.cal-day-mini__row:hover .cal-day-mini__slot {
    background: var(--ds-row-hover-bg);
}
.cal-day-mini__row.is-current-hour::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--now-minute-pct, 0) * 100%);
    height: 2px;
    background: var(--ds-success);
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ds-success) 35%, transparent);
}
.cal-day-mini__row.is-current-hour .cal-day-mini__hour span {
    color: var(--ds-success);
    font-weight: 700;
}
.cal-day-mini__hour {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: 100%;
    padding: 0 var(--space-2);
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--ds-text-tertiary);
    font-variant-numeric: var(--ds-font-numeric);
    text-align: center;
    border-right: 1px solid var(--ds-border);
    background: var(--ds-surface-muted);
    box-sizing: border-box;
}
.cal-day-mini__hour span {
    line-height: 1.2;
}
.cal-day-mini__allday {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    flex-shrink: 0;
    min-height: 40px;
    padding: var(--space-2);
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-surface-muted);
}
.cal-day-mini--has-allday .cal-day-mini__hours {
    flex: none;
    min-height: auto;
}
.cal-day-mini__allday-label {
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--ds-text-tertiary);
    margin-right: var(--space-2);
    flex-shrink: 0;
}
.cal-day-mini__chip {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-xs);
    background: var(--ds-cal-event-bg);
    border: 1px solid var(--ds-cal-event-border);
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--ds-text);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-day-mini__slot {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
    gap: var(--space-1);
    padding: var(--space-2);
    min-height: 0;
    height: 100%;
    background: var(--ds-surface);
}

/* Avatar upload — jak logo */
.avatar-upload-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.avatar-upload-panel__dropzone img {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-md);
    object-fit: cover;
}
.avatar-upload-panel__preset-label {
    margin: 0 0 var(--space-3);
    font-family: var(--ds-type-family);
    font-size: var(--ds-type-label-size);
    font-weight: var(--ds-type-label-weight);
    line-height: var(--ds-type-line-body);
    color: var(--ds-color-text-2);
}
.avatar-upload-panel__preset-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
}
.avatar-picker--panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: var(--space-2);
}
.settings-layout--profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
    width: 100%;
    flex: 0 0 auto;
    min-height: unset;
}
.dashboard-scroll > .account-shell__body:has(> .settings-layout--profile),
.dashboard-scroll[data-account-shell] .account-shell__body:has(> .settings-layout--profile) {
    flex: 0 0 auto;
    min-height: unset;
}
.account-shell__body > .settings-layout--profile {
    flex: 0 0 auto;
    min-height: unset;
}
.settings-layout--profile .settings-layout__col--profile-media {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
}
.settings-layout--profile .settings-layout__col {
    min-width: 0;
}
.settings-layout--profile .form-group {
    width: 100%;
    max-width: 100%;
}
.settings-layout--profile .settings-section .ds-card__body .form-group input:not([type="checkbox"]):not([type="radio"]),
.settings-layout--profile .settings-section .ds-card__body .form-group textarea,
.settings-layout--profile .settings-section .ds-card__body .form-group select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.settings-layout--profile .settings-section--profile-identity,
.settings-layout--profile .settings-section--profile-upload {
    flex: none;
    width: 100%;
    min-height: unset;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
}
.settings-layout--profile .settings-section--profile-identity .ds-card__body,
.settings-layout--profile .settings-section--profile-upload .ds-card__body {
    flex: none;
    min-height: unset;
    display: block;
}
.settings-layout--profile .settings-section--profile-upload .ds-card__body {
    padding-top: var(--ds-content-pad);
    padding-bottom: var(--ds-content-pad);
}
.settings-layout--profile .settings-section--profile-upload .media-upload,
.settings-layout--profile .settings-section--profile-upload .media-upload__main,
.settings-layout--profile .settings-section--profile-upload .media-upload__zone-wrap,
.settings-layout--profile .settings-section--profile-upload .media-upload__zone {
    flex: none;
    min-height: unset;
    height: auto;
}
.settings-layout--profile .media-upload[data-media-variant="avatar"] {
    flex: none;
    max-height: none;
    min-height: unset;
    display: block;
}
.settings-layout--profile .media-upload[data-media-variant="avatar"] .media-upload__main,
.settings-layout--profile .media-upload[data-media-variant="avatar"] .media-upload__preset {
    flex: none;
    min-height: unset;
}
.settings-layout--profile .media-upload[data-media-variant="avatar"] .media-upload__zone {
    flex: 0 0 auto;
    height: auto;
}
.settings-layout__col--appearance .media-upload[data-media-variant="logo"],
.settings-layout__col--appearance .logo-upload-panel {
    flex: 0 0 auto;
    min-height: unset;
    display: flex;
    flex-direction: column;
}
.settings-layout__col--appearance .media-upload[data-media-variant="logo"] .media-upload__zone,
.settings-layout__col--appearance .logo-upload-panel__dropzone {
    flex: 1 1 auto;
    max-height: none;
    min-height: 120px;
    height: auto;
}

/* ── Toggle switch ── */
.ds-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    width: 40px;
    height: 24px;
    cursor: pointer;
}
.ds-toggle__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.ds-toggle__track {
    display: block;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: var(--ds-border-strong);
    position: relative;
    overflow: hidden;
    transition: background 0.2s;
    box-sizing: border-box;
}
.ds-toggle__track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease;
    box-sizing: border-box;
}
.ds-toggle__input:checked + .ds-toggle__track {
    background: var(--ds-success);
}
.ds-toggle__input:checked + .ds-toggle__track::after {
    transform: translateX(18px);
}
.ds-toggle__input:focus-visible + .ds-toggle__track {
    box-shadow: 0 0 0 3px var(--ds-success-soft);
}

/* ── Settings layout ── */
.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--ds-dashboard-gap);
    align-items: start;
    flex: 0 0 auto;
    min-height: unset;
}
.settings-layout__col {
    display: flex;
    flex-direction: column;
    gap: var(--ds-dashboard-gap);
    min-width: 0;
    min-height: unset;
}
.settings-layout .ds-card.settings-section {
    min-width: 0;
    flex: 0 0 auto;
    min-height: unset;
    display: flex;
    flex-direction: column;
}
.settings-section--nav-link .ds-card__body {
    padding: var(--space-2) var(--ds-inset-x);
}
.settings-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-2);
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ds-text);
    font-family: var(--font-ui);
    text-align: left;
    cursor: pointer;
    transition: background var(--ds-motion-fast);
}
.settings-nav-link:hover {
    background: var(--ds-surface-muted);
}
.settings-nav-link > .material-symbols-outlined:first-child {
    font-size: 22px;
    color: var(--ds-text-secondary);
    flex-shrink: 0;
}
.settings-nav-link__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.settings-nav-link__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
}
.settings-nav-link__desc {
    font-size: var(--text-xs);
    color: var(--ds-text-secondary);
    line-height: 1.35;
}
.settings-nav-link__chev {
    font-size: 20px;
    color: var(--ds-text-tertiary);
    flex-shrink: 0;
}
.settings-layout .ds-card__body:not(.ds-card__body--flush) {
    flex: 0 0 auto;
    min-height: unset;
    display: flex;
    flex-direction: column;
    padding: var(--ds-inset-y) var(--ds-inset-x);
}
.settings-layout .ds-card__body {
    flex: 0 0 auto;
    min-height: unset;
    display: flex;
    flex-direction: column;
}
.settings-layout__col--appearance .theme-preview-picker {
    flex: 0 0 auto;
    align-items: stretch;
    min-height: unset;
}
.settings-layout__col--appearance .theme-preview-card {
    flex: 1;
    min-height: 0;
    justify-content: space-between;
}
.settings-layout__col--appearance .theme-preview-card__frame {
    flex: 1;
    min-height: 120px;
}
.settings-layout__col--appearance .media-upload,
.settings-layout__col--appearance .logo-upload-panel {
    flex: 1;
    min-height: 0;
}
.settings-layout__col--other .ds-card__body {
    justify-content: flex-start;
}
.settings-section__hint {
    margin: var(--space-3) 0 var(--space-4);
    font-size: var(--text-xs);
    color: var(--ds-text-tertiary);
}
.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ds-border);
}
.settings-toggle-row .ds-toggle { flex-shrink: 0; }
.settings-toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
.settings-toggle-row__title { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--ds-text); }
.settings-toggle-row__desc { display: block; font-size: var(--text-xs); color: var(--ds-text-secondary); margin-top: 2px; }

.theme-preview-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}
.theme-preview-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 2px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    cursor: pointer;
    font-family: var(--font-ui);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    text-align: left;
}
.theme-preview-card[aria-pressed="true"] {
    border-color: var(--ds-success);
    background: var(--ds-success-soft);
    box-shadow: 0 0 0 1px var(--ds-green-tint-12);
}
.theme-preview-card__frame {
    width: 100%;
    height: 76px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--ds-border);
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
}
.theme-preview-card__frame--light { background: #f4f4f4; }
.theme-preview-card__frame--dark { background: #161616; border-color: #333; }
.theme-preview-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 0 2px;
}
.theme-preview-card__label { font-size: var(--text-sm); font-weight: 600; color: var(--ds-text); }
.theme-preview-card__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ds-border-strong);
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.theme-preview-card__dot--active {
    background: var(--ds-success);
    box-shadow: 0 0 0 2px var(--ds-success-soft);
}

/* Theme wireframe — minimal */
.theme-wireframe {
    display: grid;
    grid-template-columns: 22% 1fr;
    gap: 6px;
    width: 100%;
    height: 100%;
    min-height: 0;
    align-items: stretch;
}
.theme-wireframe__aside {
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.theme-preview-card__frame--dark .theme-wireframe__aside {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
}
.theme-wireframe__panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.theme-wireframe__strip {
    height: 10px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.theme-preview-card__frame--dark .theme-wireframe__strip {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.theme-wireframe__tile {
    flex: 1;
    min-height: 24px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.theme-preview-card__frame--dark .theme-wireframe__tile {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Media upload — logo i avatar (spójny komponent) */
.media-upload {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.media-upload__main {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
}
.media-upload__zone-wrap {
    position: relative;
}
.media-upload__zone-wrap .media-upload__zone {
    width: 100%;
}
.media-upload--drag .media-upload__zone {
    border-color: #FFCF33;
    background: var(--ds-brand-tint-08);
    box-shadow: 0 0 0 3px var(--ds-brand-tint-12);
}
.media-upload__zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 168px;
    padding: var(--space-8) var(--space-5);
    border: 1.5px dashed var(--ds-border-strong);
    border-radius: var(--radius-md);
    background: var(--ds-surface-muted);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
    text-align: center;
    gap: var(--space-3);
    box-sizing: border-box;
}
.media-upload__zone:hover,
.media-upload__zone:focus-visible {
    border-color: var(--ds-brand-cta-border);
    background: var(--ds-row-hover-bg);
    outline: none;
}
.media-upload__zone:hover .media-upload__glyph,
.media-upload__zone:focus-visible .media-upload__glyph {
    background: var(--ds-brand-cta-subtle);
    border-color: var(--ds-brand-cta-border);
    color: var(--ds-brand-cta-active);
}
.media-upload__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    max-width: 280px;
}
.media-upload__glyph {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--ds-surface-hover);
    border: 1px solid var(--ds-border-strong);
    font-size: 28px;
    color: var(--ds-text-secondary);
}
.media-upload[data-media-variant="avatar"] .media-upload__glyph {
    border-radius: 50%;
}
.media-upload__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
}
.media-upload__hint {
    font-size: var(--text-xs);
    color: var(--ds-text-tertiary);
    line-height: 1.45;
}
.media-upload[data-media-variant="avatar"] .media-upload__zone-wrap:has(.media-upload__avatar-alt) {
    display: flex;
    flex-direction: column;
    border: 1.5px dashed var(--ds-border-strong);
    border-radius: var(--radius-md);
    background: var(--ds-surface-muted);
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.media-upload[data-media-variant="avatar"] .media-upload__zone-wrap:has(.media-upload__avatar-alt) .media-upload__zone {
    min-height: unset;
    padding: var(--space-10) var(--space-5);
    border: none;
    border-radius: 0;
    background: transparent;
}
.media-upload[data-media-variant="avatar"] .media-upload__zone-wrap:has(.media-upload__avatar-alt):has(.media-upload__zone:hover),
.media-upload[data-media-variant="avatar"] .media-upload__zone-wrap:has(.media-upload__avatar-alt):has(.media-upload__zone:focus-visible) {
    border-color: var(--ds-brand-cta-border);
    background: var(--ds-row-hover-bg);
}
.media-upload--drag .media-upload__zone-wrap:has(.media-upload__avatar-alt) {
    border-color: #FFCF33;
    background: var(--ds-brand-tint-08);
    box-shadow: 0 0 0 3px var(--ds-brand-tint-12);
}
.media-upload[data-media-variant="avatar"] .media-upload__zone {
    min-height: unset;
    padding: var(--space-10) var(--space-5);
}
.media-upload[data-media-variant="avatar"] .media-upload__empty {
    max-width: none;
    width: 100%;
    gap: var(--space-3);
}
.media-upload__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    margin-bottom: 0;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ds-text);
    transition: background var(--ds-motion-fast) var(--ds-ease-out),
        border-color var(--ds-motion-fast) var(--ds-ease-out),
        color var(--ds-motion-fast) var(--ds-ease-out),
        box-shadow var(--ds-motion-fast) var(--ds-ease-out);
    pointer-events: auto;
}
.media-upload__cta .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}
.media-upload__cta:hover {
    border-color: #3d3d3d;
    background: #3d3d3d;
    color: #fff;
    box-shadow: none;
}
.media-upload__cta:active {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: #fff;
}
.media-upload__avatar-alt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 0;
    padding: var(--space-8) var(--space-5) var(--space-10);
    border-top: 1px solid var(--ds-border);
    box-sizing: border-box;
}
.media-upload__avatar-alt-lead {
    margin: 0;
    max-width: 28ch;
    width: 100%;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--ds-text-secondary);
    line-height: 1.5;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}
.media-upload__avatar-alt-btn {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--ds-text);
}
.media-upload__avatar-alt-link {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    color: var(--ds-text);
    cursor: pointer;
}
.media-upload__avatar-alt-link:hover {
    color: var(--ds-primary);
}
.media-upload__zone:has(.media-upload__preview:not([hidden])) {
    min-height: 120px;
    gap: var(--space-4);
}
.media-upload__preview {
    max-width: 100%;
    object-fit: contain;
}
.media-upload__preview[hidden] {
    display: none !important;
}
.media-upload[data-media-variant="logo"] .media-upload__preview {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.media-upload[data-media-variant="avatar"] .media-upload__preview:not([hidden]) {
    width: 96px;
    height: 96px;
    max-width: none;
    max-height: none;
    border-radius: 50%;
    object-fit: cover;
    border: none;
    box-shadow: none;
    display: block;
}
.media-upload__zone:has(.media-upload__preview:not([hidden])) .media-upload__empty {
    display: none;
}
.media-upload__zone:has(.media-upload__preview:not([hidden])) {
    min-height: 120px;
}
.media-upload__clear {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    z-index: 2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.media-upload__clear:hover {
    background: var(--ds-danger-soft);
    color: var(--ds-danger);
    border-color: rgba(180, 60, 60, 0.35);
}
.media-upload__clear .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}
.media-upload__clear[hidden] {
    display: none !important;
}
.media-upload[data-media-variant="avatar"] .media-upload__zone:has(.media-upload__preview:not([hidden])) {
    min-height: 96px;
}
.media-upload__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}
.media-upload__main[hidden],
.media-upload__preset[hidden] {
    display: none !important;
}
.media-upload--preset {
    gap: 0;
}
.media-upload__preset {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.media-upload__preset .avatar-picker--panel {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    align-content: start;
}
.media-upload__preset-label {
    margin: 0;
    flex-shrink: 0;
    font-family: var(--ds-type-family);
    font-size: var(--ds-type-label-size);
    font-weight: var(--ds-type-label-weight);
    line-height: var(--ds-type-line-body);
    color: var(--ds-color-text-2);
}
.media-upload__preset-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: 0;
    flex-shrink: 0;
    justify-content: flex-end;
}
.help-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: start;
}
.help-layout .ds-card.settings-section {
    min-width: 0;
    min-height: unset;
    height: auto;
    flex: 0 0 auto;
    box-shadow: none;
}
.help-layout .ds-card.settings-section .ds-card__body {
    flex: 0 0 auto;
    min-height: unset;
}
.help-faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: 0;
    box-sizing: border-box;
}
.help-faq-list .help-faq {
    border-bottom: 1px solid var(--ds-border);
}
.help-faq-list .help-faq:last-child {
    border-bottom: none;
}
.help-faq-list .help-faq summary {
    padding: var(--space-3) 0;
    margin: 0;
}
.help-faq-list .help-faq__body {
    padding: 0 0 var(--space-4);
}
.help-contact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
}
.help-contact__lead {
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1.45;
    color: var(--ds-text);
    text-wrap: balance;
}
.help-contact__text {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.55;
    color: var(--ds-text-secondary);
    text-wrap: balance;
}
.help-contact__btn {
    align-self: flex-start;
    margin-top: var(--space-2);
    box-shadow: none;
}
.help-contact__btn:hover,
.help-contact__btn:active {
    box-shadow: none;
}
.help-card__text {
    margin: 0 0 var(--space-4);
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
    line-height: 1.55;
}

/* Logo upload panel (legacy — mapowane przez media-upload) */
.logo-upload-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.logo-upload-panel--drag .logo-upload-panel__dropzone {
    border-color: var(--ds-primary);
    background: var(--ds-brand-tint-08);
}
.logo-upload-panel__dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 188px;
    padding: var(--space-8) var(--ds-content-pad);
    border: 1.5px dashed var(--ds-border-strong);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}
.logo-upload-panel__dropzone:hover,
.logo-upload-panel__dropzone:focus-visible {
    border-color: var(--ds-brand-cta-border);
    background: var(--ds-row-hover-bg);
    outline: none;
}
.logo-upload-panel__dropzone img {
    max-height: 64px;
    max-width: 100%;
    object-fit: contain;
}
.logo-upload-panel__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    text-align: center;
    max-width: 280px;
}
.logo-upload-panel__drop-text {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
    line-height: 1.5;
}
.logo-upload-panel__choose {
    margin-top: var(--space-1);
}
.logo-upload-panel__prompt { display: none; }
.logo-upload-panel__file-icon {
    position: relative;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.logo-upload-panel__doc {
    font-size: 48px !important;
    color: var(--ds-border-strong);
}
.logo-upload-panel__upload-badge {
    position: absolute;
    right: -4px;
    bottom: -2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1A2B4B;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.logo-upload-panel__upload-badge .material-symbols-outlined {
    font-size: 14px !important;
}
.logo-upload-panel__meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    font-size: var(--text-xs);
    color: var(--ds-text-tertiary);
}
.logo-upload-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.logo-dropzone {
    border: 2px dashed var(--ds-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    background: var(--ds-surface-muted);
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}
.logo-dropzone--drag { border-color: var(--ds-success); background: var(--ds-success-soft); }
.logo-dropzone__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    margin-bottom: var(--space-3);
}
.logo-dropzone__preview img { max-height: 48px; max-width: 100%; object-fit: contain; }
.logo-dropzone__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    text-align: center;
    color: var(--ds-text-secondary);
    font-size: var(--text-sm);
}
.logo-dropzone__empty .material-symbols-outlined { font-size: 32px; color: var(--ds-text-tertiary); }
.logo-dropzone__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; }

/* ── Schedule panel ── */
.schedule-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.schedule-panel__header {
    align-items: center;
    padding: var(--space-3) var(--ds-content-pad);
    min-height: var(--ds-card-header-height);
}
.schedule-panel__title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 700;
    line-height: 1.2;
}
.schedule-panel__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.schedule-step[hidden] {
    display: none !important;
}
.schedule-date-step[hidden],
.selective-scope-step[hidden] {
    display: none !important;
}
.schedule-step--date {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ds-content-pad);
}
/* Wizard intro step — wspólny komponent (planowanie pomiaru, krok 1 raportu, …) */
.schedule-date-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    width: min(100%, 340px);
    text-align: center;
}
.schedule-date-step__title {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--ds-text);
    line-height: 1.25;
}
.schedule-date-step__hint {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
    line-height: 1.5;
    max-width: 280px;
}
.schedule-date-step__field {
    width: 100%;
    margin-top: var(--space-1);
    box-sizing: border-box;
    overflow: visible;
}
.schedule-date-step__field .custom-date-picker {
    width: 100%;
}
.schedule-date-step__picker {
    position: relative;
    width: 100%;
    overflow: visible;
}
.schedule-date-step__input {
    width: 100%;
    min-height: var(--ds-control-h);
    height: var(--ds-control-h);
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    text-align: center;
    padding-right: 44px;
    padding-left: 44px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: var(--ds-control-h);
    box-sizing: border-box;
}
.schedule-date-step__input--text {
    text-align: left;
    padding-right: var(--space-4);
    padding-left: var(--space-4);
    cursor: text;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    color: var(--ds-text);
}
.schedule-date-step__input--text:hover:not(:focus):not(:focus-visible) {
    border-color: var(--ds-interactive-hover-border);
    background: var(--ds-field-hover-bg);
}
.schedule-date-step__input--text:focus,
.schedule-date-step__input--text:focus-visible {
    outline: none;
    border: 1px solid var(--ds-interactive-focus-border);
    background: var(--ds-surface);
    box-shadow: var(--ds-interactive-focus-ring);
}
.schedule-date-step__cal-btn {
    position: absolute;
    right: 6px;
    top: 0;
    bottom: 0;
    margin-block: auto;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    transform: none;
    overflow: hidden;
}
.schedule-date-step__cal-btn .material-symbols-outlined {
    transform: none;
    font-size: 18px;
    line-height: 1;
}
.schedule-date-step__cal-btn:hover:not(:disabled),
.schedule-date-step__cal-btn:focus-visible:not(:disabled) {
    transform: none;
    background: var(--ds-surface-muted);
    border: none;
    color: var(--ds-text);
}
.schedule-date-step__cal-btn:hover:not(:disabled) .material-symbols-outlined,
.schedule-date-step__cal-btn:focus-visible:not(:disabled) .material-symbols-outlined {
    transform: none;
}
.schedule-date-step__cal-btn:active:not(:disabled) {
    transform: scale(0.96);
}
.schedule-date-step__cal-btn.sg-st-hover,
.sg-showcase .schedule-date-step__cal-btn.sg-st-hover,
.schedule-date-step__cal-btn.sg-st-active,
.sg-showcase .schedule-date-step__cal-btn.sg-st-active {
    transform: none;
}
.schedule-date-step__cal-btn.sg-st-active:not(:disabled),
.sg-showcase .schedule-date-step__cal-btn.sg-st-active:not(:disabled) {
    transform: scale(0.96);
}
.schedule-date-step__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    margin-top: var(--space-3);
}
.schedule-date-step__cancel,
.schedule-date-step__next {
    min-height: var(--ds-control-h);
    height: var(--ds-control-h);
    width: 100%;
}
.schedule-date-step__next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    flex-direction: row;
}
.schedule-date-step__picker .custom-calendar-popup {
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    min-width: 100%;
    max-width: none;
    padding: var(--space-4);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
}
.schedule-date-step__picker .custom-calendar-popup.open {
    animation: dsPopupIn 0.18s ease;
}
.schedule-date-step__picker .btn-cal-nav-sm:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
}
.schedule-step--products {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}
#view-schedule-products .ds-page-header__actions.schedule-products-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    padding: 0;
    border: none;
    flex-shrink: 0;
}
.schedule-entity-list {
    flex: 1;
    min-height: 0;
    margin: 0;
}
.schedule-entity-grid {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: var(--ds-content-pad);
}
.schedule-panel.is-step-date .schedule-panel__footer-step#schedule-footer-step2 {
    display: none !important;
}
.schedule-panel__footer {
    justify-content: flex-end;
    align-items: center;
}
.schedule-panel__count {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text-secondary);
}
.schedule-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(2px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.28s ease;
}
.schedule-success-overlay.is-visible {
    opacity: 1;
}
.schedule-success-overlay.is-hiding {
    opacity: 0;
}
.schedule-success-overlay__card,
.ds-popup-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    width: 320px;
    max-width: 100%;
    padding: var(--ds-content-pad);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
    box-sizing: border-box;
    text-align: center;
}
.schedule-success-overlay__card {
    transform: scale(0.88);
    opacity: 0;
    animation: scheduleSuccessPop 0.48s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.ds-popup-card__icon,
.schedule-success-overlay__icon-wrap,
.schedule-success-overlay__icon.material-symbols-outlined {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    line-height: 1;
}
.ds-popup-card__icon .material-symbols-outlined,
.schedule-success-overlay__icon-wrap .material-symbols-outlined {
    font-size: 22px;
    line-height: 1;
}
.ds-popup-card--success .ds-popup-card__icon,
.schedule-success-overlay__icon-wrap--success,
.schedule-success-overlay__icon.material-symbols-outlined {
    background: var(--ds-success-soft);
    color: var(--ds-success);
}
.ds-popup-card--warn .ds-popup-card__icon {
    background: var(--ds-status-bg-warn);
    color: var(--ds-status-text-warn);
}
.ds-popup-card--error .ds-popup-card__icon {
    background: var(--ds-danger-soft);
    color: var(--ds-danger);
}
.schedule-success-overlay__icon.material-symbols-outlined {
    font-size: 22px;
    animation: scheduleSuccessIcon 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.08s backwards;
}
.ds-popup-card__title,
.schedule-success-overlay__text {
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--ds-text);
    line-height: 1.35;
}
.ds-popup-card__text,
.schedule-success-overlay__detail {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
    line-height: 1.5;
    max-width: 26rem;
}
.ds-popup-card__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    margin-top: var(--space-1);
}
.ds-popup-card__actions--split {
    flex-direction: row;
    gap: var(--space-3);
}
.ds-popup-card__actions--split .btn {
    flex: 1;
    min-width: 0;
}
@keyframes scheduleSuccessPop {
    from { transform: scale(0.88); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes scheduleSuccessIcon {
    from { transform: scale(0.4) rotate(-18deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}
.notification-card--dropdown {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    cursor: pointer;
}
.notification-card--dropdown .content {
    min-width: 0;
    overflow: hidden;
}
.notification-card--dropdown .content strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-sm);
    line-height: 1.35;
}
.notification-card--dropdown:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
}
.help-faq-list .help-faq summary:hover {
    background: transparent;
    color: inherit;
}
.custom-option.selected {
    background: var(--ds-surface-muted);
    font-weight: 600;
    color: var(--ds-text);
}

/* ── Notifications module ── */
.notif-module {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.notif-module .ds-module__body--grow {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.notif-module .notif-panel-split {
    flex: 1;
    min-height: 0;
}
.notif-module__header-actions {
    flex-wrap: wrap;
    gap: var(--space-2);
}
.notif-retention-hint {
    font-size: var(--text-2xs);
    color: var(--ds-text-tertiary);
    margin: 0;
    line-height: 1.35;
}
.notif-panel-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    height: 100%;
    align-items: stretch;
}
.notif-panel-split__col--list {
    border-right: 1px solid var(--ds-border);
    background: var(--ds-surface);
    overflow: visible;
}
.notif-panel-split__col--list > .ds-module__body {
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.notif-panel-split__col--detail {
    background: #fff;
}
.notif-panel-split__col .ds-module__head {
    flex-shrink: 0;
}
.notif-panel-split__col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    height: 100%;
}
.notif-list-header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}
.notif-filter--desktop {
    display: none !important;
}
.notif-panel-split__col .ds-module__head .notif-retention-hint {
    max-width: 220px;
    text-align: right;
}
.ds-card__header--toolbar-only {
    justify-content: flex-end;
}
.ds-card__header--toolbar-only .ds-card__header-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
}

.cal-module--drilldown.cal-day-detail-open .dash-day-view__list-scroll,
.cal-module--drilldown.cal-day-detail-open .ds-inset-scroll {
    flex: 1;
    min-height: 0;
}
.cal-module--drilldown.cal-day-detail-open .dash-day-view__list {
    padding: 0;
    gap: var(--space-2);
    min-height: 0;
    overflow: visible;
}
.cal-module--drilldown.cal-day-detail-open .dash-day-view__intro {
    padding: 0;
}
.notif-item-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    flex-shrink: 0;
}
.notif-panel-split__col--detail .notif-detail-panel__head {
    justify-content: flex-start;
    align-items: center;
    gap: var(--space-2);
}
.notif-panel-split__col--detail .notif-detail-panel__head .ds-module__title {
    margin: 0;
    text-align: left;
    justify-content: flex-start;
}
.notif-panel-split__col--detail:not(.notif-panel-split__col--has-detail) > .ds-module__body {
    border-top: none;
}
.notif-panel-split__col--detail:not(.notif-panel-split__col--has-detail) .ds-content-inset {
    padding: 0;
}
@media (min-width: 1081px) {
    .notif-detail-back {
        display: none !important;
    }
}
.notif-detail-card__asset-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-4) 0 0;
    padding: var(--space-4) 0 0;
    border-top: 1px solid var(--ds-border);
}
.notif-detail-card__asset-action[hidden] {
    display: none !important;
}
/* ── Info tip (system tooltip) ── */
.ds-info-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ds-text-tertiary);
    cursor: help;
    font-family: var(--font-ui);
    flex-shrink: 0;
    transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.ds-info-tip .material-symbols-outlined {
    font-size: 18px !important;
    line-height: 1;
}
.ds-info-tip:hover,
.ds-info-tip:focus-visible {
    color: var(--ds-text-secondary);
    background: var(--ds-surface-muted);
    border-color: var(--ds-border);
    outline: none;
}
.ds-info-tip::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: 280px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    color: var(--ds-text);
    border: 1px solid var(--ds-border);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.55;
    text-align: center;
    white-space: pre-line;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    z-index: 60;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.ds-info-tip:hover::after,
.ds-info-tip:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.ds-info-tip--align-right::after,
.notif-item-actions .ds-info-tip::after {
    left: auto;
    right: 0;
    transform: translateY(4px);
}
.notif-item-actions .ds-info-tip:hover::after,
.notif-item-actions .ds-info-tip:focus-visible::after {
    transform: translateY(0);
}
.ds-info-tip--inline {
    width: 32px;
    height: 32px;
}
.notif-module .ds-module__head {
    overflow: visible;
}
.notif-module.notif-detail-open .ds-module__head .notif-detail-back {
    flex-shrink: 0;
    margin-right: var(--space-2);
}
.notif-panel-split__col--detail .ds-module__head {
    gap: var(--space-2);
}
.notif-panel-split__col > .ds-module__body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}
.notif-panel-split__col--detail > .ds-module__body.ds-inset-scroll--host {
    flex: 1;
    min-height: 0;
}
.notif-panel-split__col--list > .ds-module__body.ds-inset-scroll .ds-scroll-lane,
.notif-panel-split__col--list > .ds-module__body.ds-inset-scroll .ds-scroll-lane__inset {
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.notif-panel-split__col--list > .ds-module__body.ds-inset-scroll .ds-scroll-lane__inset {
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
}
.notif-panel-split__col--detail > .ds-module__body.ds-inset-scroll:not(:has(#notif-detail-card:not([hidden]))) .ds-scroll-lane,
.notif-panel-split__col--detail > .ds-module__body.ds-inset-scroll:not(:has(#notif-detail-card:not([hidden]))) .ds-scroll-lane__inset {
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.notif-panel-split__col--detail > .ds-module__body.ds-inset-scroll:not(:has(#notif-detail-card:not([hidden]))) .ds-scroll-lane__inset {
    justify-content: center;
    overflow: hidden;
}
.notif-detail-card:not([hidden]) {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
}
.notif-detail-card__shell {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--ds-surface);
}
.notif-detail-card__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--ds-border);
}
.notif-detail-card__head-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}
.notif-detail-card__body {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: var(--space-4);
}
.notif-detail-card__copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.notif-detail-card__asset-action[hidden],
.notif-detail-card__foot[hidden] {
    display: none !important;
}
.notif-detail-card__icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ds-surface-muted);
    flex-shrink: 0;
    font-size: 18px;
    margin: 0;
}
.notif-detail-card__icon.ok { color: var(--ds-status-text-ok); background: var(--ds-status-bg-ok); }
.notif-detail-card__icon.warn { color: var(--ds-status-text-warn); background: var(--ds-status-bg-warn); }
.notif-detail-card__icon.fail { color: var(--ds-status-text-fail); background: var(--ds-status-bg-fail); }
.notif-detail-card__icon.blue { color: var(--ds-status-text-accent); background: var(--ds-status-bg-accent); }
.notif-detail-card__title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: normal;
    text-transform: none;
    color: var(--ds-text);
    overflow-wrap: break-word;
}
.notif-detail-card__date {
    flex: 0 0 auto;
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 400;
    line-height: 1.45;
    color: var(--ds-text-secondary);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.notif-detail-card__message {
    margin: 0;
    padding: 0;
    font-size: var(--text-sm);
    font-weight: 400;
    line-height: 1.55;
    color: var(--ds-text);
    white-space: pre-wrap;
    overflow-wrap: break-word;
}
.notif-detail-card__message[hidden] {
    display: none !important;
}
.notif-detail-card__message--intro {
    color: var(--ds-text-secondary);
}
.notif-detail-card__assets {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--ds-border);
    width: 100%;
    min-width: 0;
}
.notif-detail-card__assets[hidden] {
    display: none !important;
}
.notif-detail-card__copy:not(:has(.notif-detail-card__message:not([hidden]))) + .notif-detail-card__assets:not([hidden]) {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.notif-detail-asset-group .module-list--dashboard {
    gap: var(--space-2);
}
.notif-detail-asset-group__label {
    margin: 0 0 var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ds-text-secondary);
}
.notif-detail-asset-group--split {
    padding-top: var(--space-4);
    border-top: 2px solid var(--ds-border);
}
.notif-detail-facts {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: var(--space-4) 0 0;
    padding: var(--space-4) 0 0;
    width: 100%;
    border: none;
    border-top: 1px solid var(--ds-border);
    border-radius: 0;
    overflow: hidden;
    background: transparent;
}
.notif-detail-facts[hidden] {
    display: none !important;
}
.notif-detail-facts__row {
    display: grid;
    grid-template-columns: minmax(108px, 36%) minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ds-border);
    min-width: 0;
    background: transparent;
    border-radius: 0;
}
.notif-detail-facts__row:first-child {
    padding-top: 0;
}
.notif-detail-facts__row:last-child {
    border-bottom: none;
}
.notif-detail-facts__row dt {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    color: var(--ds-text-secondary);
    line-height: 1.55;
    white-space: nowrap;
}
.notif-detail-facts__row dd {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--ds-text);
    line-height: 1.55;
    overflow-wrap: break-word;
    word-break: normal;
    text-align: left;
}
.notif-detail-facts__badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 2px;
    background: var(--ds-surface-muted);
    color: var(--ds-text);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.35;
    border: 1px solid var(--ds-border);
}
.notif-detail-card__product {
    display: none;
}
.notif-detail-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-6) 0 0;
    padding: var(--space-5) 0 0;
    border-top: 1px solid var(--ds-border);
}
.notif-detail-card__foot[hidden] {
    display: none !important;
}
.notif-detail-card__foot .notif-mark-read-btn {
    margin-right: 0;
}
@media (max-width: 1080px) {
    .notif-detail-card__head-main {
        flex-wrap: wrap;
        row-gap: var(--space-2);
    }
    .notif-detail-card__date {
        margin-left: auto;
    }
}
.notif-feed-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-2) 0;
    color: var(--ds-text-tertiary);
    font-size: var(--text-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.notif-feed-divider::before,
.notif-feed-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ds-border);
}
.notif-feed-all-read {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-8) 0;
    text-align: center;
    color: var(--ds-text-secondary);
}
.notif-feed-all-read .material-symbols-outlined {
    font-size: 36px;
    color: var(--ds-text-tertiary);
}
.notif-feed-all-read p {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.5;
}
.notif-read-archive-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding: var(--space-5) 0 var(--space-3);
    border-top: 1px solid var(--ds-border);
}
.notif-read-archive-foot .notif-retention-hint {
    text-align: center;
    width: 100%;
    margin: 0;
    padding: var(--space-2) 0;
}
.notif-retention-hint--inline {
    margin: var(--space-5) 0;
    padding: var(--space-3) 0;
    text-align: center;
    width: 100%;
    align-self: center;
}
.notif-mark-read--list {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ds-text-tertiary);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.12s, background 0.12s;
}
.notif-mark-read--list:hover {
    color: var(--ds-text-secondary);
    background: var(--ds-surface-muted);
}
.notif-mark-read--list .material-symbols-outlined { font-size: 18px; }

@media (max-width: 1080px) {
    .settings-layout { grid-template-columns: 1fr; }
    .notif-panel-split {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        min-height: min(520px, calc(100dvh - 180px));
    }
    .notif-panel-split__col--list {
        border-right: none;
        border-bottom: none;
        min-height: 0;
    }
    .notif-panel-split__col--detail {
        display: none;
        min-height: 0;
    }
    .notif-module.notif-detail-open .notif-panel-split__col--list {
        display: none;
    }
    .notif-module.notif-detail-open .notif-panel-split__col--detail {
        display: flex;
        animation: dashDayPaneIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .notif-module.notif-detail-open .notif-detail-back {
        display: inline-flex;
    }
    .notif-detail-back {
        display: none;
    }
    .notif-detail-facts__row {
        grid-template-columns: 1fr;
        gap: var(--space-1);
        align-items: start;
    }
    .notif-detail-facts__row dd {
        text-align: left;
    }
    .help-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .cal-page-header-actions__mobile { display: none; }
    .cal-page-toolbar {
        gap: var(--space-2);
    }
    .cal-page-toolbar__primary .cal-toolbar__title {
        font-size: var(--text-sm);
        max-width: none;
        overflow: visible;
        text-overflow: unset;
        white-space: normal;
        word-break: break-word;
    }
    .cal-view-dropdown__trigger {
        min-height: 34px;
        padding: 0 10px 0 12px;
        font-size: var(--text-xs);
    }
}

/* Toast notifications — spójne z design systemem */
.ds-toast-container {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
    max-width: min(420px, calc(100vw - 32px));
}
.ds-toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: auto;
}
.ds-toast--visible {
    opacity: 1;
    transform: translateX(0);
}
.ds-toast--hide {
    opacity: 0;
    transform: translateX(16px);
}
.ds-toast__icon {
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 1px;
}
.ds-toast__text {
    font-size: var(--text-sm);
    color: var(--ds-text);
    line-height: 1.45;
    flex: 1;
}
.ds-toast--success .ds-toast__icon { color: var(--ds-success); }
.ds-toast--error .ds-toast__icon { color: var(--ds-danger); }
.ds-toast--info .ds-toast__icon { color: var(--ds-info-icon-color); }

/* ── RBAC: role badges & user admin ── */
.account-section-header__intro {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}
.user-profile__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    min-width: 0;
}
#profile-role-badge .badge {
    display: inline-flex;
}

.org-users-section { margin-top: var(--space-5); }
.org-user-form { display: flex; flex-direction: column; gap: var(--space-5); }
.org-user-form__hint {
    margin: calc(var(--space-1) * -1) 0 var(--space-2);
    font-size: var(--text-xs);
    color: var(--ds-text-tertiary);
    line-height: 1.45;
}
.slide-panel--org-user .slide-panel__drawer {
    width: min(480px, 100vw);
}
.slide-panel--org-user .slide-panel__header-copy {
    min-width: 0;
    padding-right: var(--space-2);
}
.slide-panel--org-user .slide-panel__meta {
    max-width: 36ch;
    line-height: 1.5;
}
.org-user-panel__footer {
    background: var(--ds-surface-muted);
    border-top: 1px solid var(--ds-border);
}
.org-user-panel__actions {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
}
.org-user-panel__submit {
    min-width: 11.5rem;
    min-height: 44px;
    font-weight: 600;
    padding-inline: var(--space-5);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.org-user-panel__submit .material-symbols-outlined {
    font-size: 18px;
}
.zone-assign-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 280px;
    overflow: auto;
    padding: 0 var(--space-3);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
}
.zone-assign-list .zone-assign-row {
    margin: 0;
    padding: var(--space-3) 0;
}
.zone-assign-list .zone-assign-row:last-child {
    border-bottom: none;
    padding-bottom: var(--space-3);
}
.zone-assign-row__text {
    min-width: 0;
}
.zone-assign-row__text .settings-toggle-row__title {
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
}
/* Strefy EPA — ds-toggle (bez natywnych checkboxów) */
.slide-panel--org-user .zone-assign-list label.ds-toggle,
.org-user-form .zone-assign-list label.ds-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    cursor: pointer;
}
.slide-panel--org-user .zone-assign-list .ds-toggle__input,
.org-user-form .zone-assign-list .ds-toggle__input,
.org-user-form .form-group .ds-toggle__input,
.org-user-form .form-group .ds-check__input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border: none !important;
    margin: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    pointer-events: none;
    background: transparent !important;
    box-shadow: none !important;
}
.slide-panel--org-user .zone-assign-list .ds-toggle__track,
.org-user-form .zone-assign-list .ds-toggle__track {
    display: block;
}
.org-user-credentials {
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    background: var(--ds-success-soft);
    border: 1px solid var(--ds-green-tint-22);
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--ds-text);
}
.org-user-credentials p { margin: 0 0 var(--space-2); }
.org-user-credentials p:last-child { margin-bottom: 0; }
.org-users-table-wrap { margin-top: 0; }

.notification-card.notification-card--priority-high,
.notification-card.notification-card--priority-medium,
.notification-card.notification-card--priority-low.success-tone,
.notification-card.notification-card--priority-low.broadcast-tone {
    border-left-width: 1px;
}

/* ═══════════════════════════════════════════════════════════════
   UI/UX Corrections (2026-05) — desktop + tablet + mobile
   ═══════════════════════════════════════════════════════════════ */

/* II. Przyciski — bez cieni dekoracyjnych (focus ring zostaje) */
.btn:not(.sg-st-focus):not(:focus-visible),
.icon-btn:not(.sg-st-focus):not(:focus-visible),
.btn-cal-nav:not(.sg-st-focus):not(:focus-visible),
.cal-view-dropdown__trigger:not(.sg-st-focus):not(:focus-visible),
.custom-select-trigger:not(.sg-st-focus):not(:focus-visible),
.mobile-bottom-nav__item:not(.sg-st-focus):not(:focus-visible),
.mobile-fab-menu__item:not(.sg-st-focus):not(:focus-visible) {
    box-shadow: none !important;
}
.icon-btn:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
.icon-btn.icon-btn--active:focus-visible:not(:disabled) {
    box-shadow: var(--ds-focus-ring-on-fill) !important;
}
.btn-cal-nav:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
.custom-select-trigger:focus-visible {
    outline: none;
    border-color: var(--ds-border-strong);
    box-shadow: var(--ds-focus-ring) !important;
}
.btn:not(:disabled):active,
.icon-btn:not(:disabled):active,
.btn-cal-nav:active,
.cal-view-dropdown__trigger:active {
    transform: scale(0.97) translateY(1px);
    transition-duration: 0.08s;
}
.btn:not(:disabled):hover:not(:active),
.icon-btn:not(:disabled):hover:not(:active) {
    transition: transform var(--ds-motion-fast) var(--ds-ease-out), background var(--ds-motion-fast) var(--ds-ease-out), border-color var(--ds-motion-fast) var(--ds-ease-out), color var(--ds-motion-fast) var(--ds-ease-out);
}

/* KPI — bez hover */
.kpi-card,
.kpi-card:hover {
    box-shadow: none;
    transform: none;
    border-color: var(--ds-border);
}

/* III. Sidebar compact — bez animacji zwijania */
.sidebar {
    transition: none;
}
.sidebar-header .logo-mark.brand-logo-slot,
.sidebar-header .brand-logo-slot__img {
    transition: none;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar-header .logo-mark.brand-logo-slot {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar-header .brand-logo-slot__img {
    width: 36px;
    height: 36px;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar .nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
body.sidebar-compact:not(.sidebar-expanded) .sidebar .nav-item .material-symbols-outlined {
    margin: 0 auto;
}
body.sidebar-compact .sidebar-rail-toggle {
    display: inline-flex;
}

/* IV. Topbar — animacje ikon, padding, avatar */
.topbar {
    padding-left: var(--ds-dashboard-shell-pad-x);
    padding-right: var(--ds-dashboard-shell-pad-x);
}
.icon-btn--topbar-refresh .material-symbols-outlined,
.icon-btn--topbar-notifications .material-symbols-outlined,
.icon-btn--topbar-settings .material-symbols-outlined,
#btn-refresh .material-symbols-outlined,
#btn-mobile-refresh .material-symbols-outlined,
#btn-nav-notifications .material-symbols-outlined,
#btn-nav-settings .material-symbols-outlined {
    transition: transform var(--ds-motion-mid) var(--ds-ease-spring);
}
.icon-btn--topbar-refresh:hover .material-symbols-outlined,
#btn-refresh:hover .material-symbols-outlined,
#btn-mobile-refresh:hover .material-symbols-outlined {
    animation: topbar-refresh-spin 0.55s var(--ds-ease-out);
}
.icon-btn--topbar-notifications:hover .material-symbols-outlined,
#btn-nav-notifications:hover .material-symbols-outlined {
    animation: topbar-bell-ring 0.55s var(--ds-ease-out);
}
.icon-btn--topbar-settings:hover .material-symbols-outlined,
#btn-nav-settings:hover .material-symbols-outlined {
    transform: rotate(90deg);
}
.icon-btn--topbar-settings:active .material-symbols-outlined,
#btn-nav-settings:active .material-symbols-outlined {
    transform: rotate(120deg) scale(0.92);
}
@keyframes topbar-refresh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes topbar-bell-ring {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(14deg); }
    40% { transform: rotate(-12deg); }
    60% { transform: rotate(8deg); }
    80% { transform: rotate(-4deg); }
}
.user-profile:active .avatar {
    background: var(--ds-surface-muted);
    border-color: #FFCF33;
    color: var(--ds-text-secondary);
}
.user-profile:active .avatar .material-symbols-outlined {
    color: var(--ds-text-secondary);
}

/* V. Wykres zgodności — responsywne paski (compliance-v4) */
@media (max-width: 1080px) {
    .dashboard-row--charts {
        grid-template-columns: 1fr !important;
    }
    .dashboard-row--charts .ds-card--compliance {
        grid-column: span 1;
    }
}

/* V. Stan mierników — overflow fix */
#dash-devices-list .ds-list-item {
    min-width: 0;
    overflow: hidden;
}
#dash-devices-list .ds-list-item__main,
#dash-devices-list .ds-list-item__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* VII. Tabela ewidencji — sticky kolumna akcji, scroll poziomy */
.entity-list-scroll__inset,
.entity-list-scroll__content {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.entity-list-scroll .data-table {
    min-width: 880px !important;
}
#product-list-container .data-table,
#devices-list-container .data-table,
#locations-list-container .data-table,
#reports-list-container .data-table,
#audits-list-container .data-table,
#trash-list-container .data-table {
    min-width: var(--ds-entity-table-min-w);
}
.table-card:not(.entity-list) .data-table tbody td.ds-row-kebab-cell {
    position: sticky;
    right: 0;
    z-index: 4;
    background: var(--ds-surface);
    box-shadow: -8px 0 12px -8px rgba(0, 0, 0, 0.08);
}
.table-card:not(.entity-list) .data-table tbody tr.clickable-row:hover td.ds-row-kebab-cell {
    background: var(--ds-row-hover-bg);
}
@media (max-width: 1080px) {
    :is(.ds-entity-list-body, .table-card.entity-list) .data-table thead th {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    :is(.ds-entity-list-body, .table-card.entity-list) .data-table tbody td.ds-row-kebab-cell,
    :is(.ds-entity-list-body, .table-card.entity-list) .data-table tbody td:last-child {
        position: static;
        box-shadow: none;
    }
    .table-card:has(> .data-table:not([hidden])):not(.entity-list-scroll):not(.ds-entity-list-body) {
        padding-left: 0;
        padding-right: 0;
    }
    :is(.ds-entity-list-body, .table-card.entity-list) .data-table thead th:first-child:not(.data-table__col-check),
    :is(.ds-entity-list-body, .table-card.entity-list) .data-table tbody td:first-child:not(.data-table__cell-check) {
        padding-left: var(--ds-entity-list-pad-x);
    }
    :is(.ds-entity-list-body, .table-card.entity-list) .data-table thead th:last-child:not(.ds-row-kebab-cell),
    :is(.ds-entity-list-body, .table-card.entity-list) .data-table tbody td:last-child:not(.ds-row-kebab-cell) {
        padding-right: var(--ds-list-item-pad-x);
    }
    :is(.ds-entity-list-body, .table-card.entity-list) .data-table .ds-row-kebab-cell {
        padding-right: var(--ds-row-kebab-pad-end);
    }
    #devices-list-container .data-table thead th:nth-child(1) { min-width: 148px; }
    #devices-list-container .data-table thead th:nth-child(2) { min-width: 96px; }
    :is(.ds-entity-list-body, .entity-list).ds-entity-list-view .data-table--devices :is(
        thead th.data-table__col-code,
        tbody td.data-table__cell-code
    ) { min-width: var(--ds-entity-code-col-w); }
    #devices-list-container .data-table thead th:nth-child(4) { min-width: 132px; }
    #devices-list-container .data-table thead th:last-child { min-width: 44px; }
}
.data-table tbody td.ds-row-kebab-cell,
.data-table tbody td:last-child {
    background: var(--ds-surface);
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list) .data-table tbody td.ds-row-kebab-cell,
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list) .data-table tbody td:last-child {
    background: transparent;
}
.data-table tbody tr.clickable-row:hover td.ds-row-kebab-cell,
.data-table tbody tr.clickable-row:hover td:last-child {
    background: var(--ds-row-hover-bg);
}
:is(.ds-entity-list-body, .ds-entity-list-view, .entity-list) .data-table tbody tr.clickable-row:hover td {
    background: var(--ds-row-hover-bg);
}

/* Tabela entity — kebab w tonacji wiersza (wariant C: brand mix, bez szarego bloku) */
:is(.ds-entity-list-body, .entity-list, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table tbody tr.clickable-row :is(.dropdown-actions, .ds-row-kebab) > .icon-btn.ds-kebab-btn,
:is(.ds-entity-list-body, .entity-list, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table tbody tr.clickable-row :is(.dropdown-actions, .ds-row-kebab) > .icon-btn.icon-btn--sm.icon-btn--ghost {
    border-color: transparent;
    background: transparent;
}
:is(.ds-entity-list-body, .entity-list, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table tbody tr.clickable-row:hover :is(.dropdown-actions, .ds-row-kebab) > .icon-btn.ds-kebab-btn,
:is(.ds-entity-list-body, .entity-list, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table tbody tr.clickable-row:hover :is(.dropdown-actions, .ds-row-kebab) > .icon-btn.icon-btn--sm.icon-btn--ghost {
    color: var(--ds-text-secondary);
    border-color: transparent;
    background: transparent;
}
:is(.ds-entity-list-body, .entity-list, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table tbody tr.clickable-row :is(.dropdown-actions, .ds-row-kebab) > .icon-btn.ds-kebab-btn:hover,
:is(.ds-entity-list-body, .entity-list, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table tbody tr.clickable-row :is(.dropdown-actions, .ds-row-kebab) > .icon-btn.icon-btn--sm.icon-btn--ghost:hover,
:is(.ds-entity-list-body, .entity-list, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table tbody tr.clickable-row .dropdown-actions.is-open > .icon-btn.ds-kebab-btn,
:is(.ds-entity-list-body, .entity-list, .table-card.entity-list, .table-card.ds-entity-list-view) .data-table tbody tr.clickable-row .dropdown-actions.is-open > .icon-btn.icon-btn--sm.icon-btn--ghost {
    background: var(--ds-row-hover-bg-strong);
    border-color: color-mix(in srgb, var(--ds-brand-cta) 28%, var(--ds-border));
    color: var(--ds-text);
}

/* Historia pomiarów — jedna warstwa paddingu (kontener body); tabela bez insetu brzegowego */
#esd-app .asset-panel-screen--history .product-history-table.ds-entity-list-view:not(.entity-grid) .data-table :is(thead th, tbody td):not(.ds-row-kebab-cell):not(.data-table__cell-check) {
    padding-left: var(--ds-list-item-pad-x);
    padding-right: var(--ds-list-item-pad-x);
}
#esd-app .asset-panel-screen--history .product-history-table.ds-entity-list-view:not(.entity-grid) .data-table :is(thead th, tbody td):first-child:not(.ds-row-kebab-cell):not(.data-table__cell-check) {
    padding-left: 0;
}
#esd-app .asset-panel-screen--history .product-history-table.ds-entity-list-view:not(.entity-grid) .data-table :is(thead th, tbody td).ds-row-kebab-cell {
    padding-left: 0;
    padding-right: 0;
}

/* VII. Kafelki — hover (tylko obrys, bez unoszenia) */
.entity-card:hover {
    border-color: var(--ds-brand-cta-border);
    background: var(--ds-brand-cta-soft);
    box-shadow: none;
    transform: none;
    transition: border-color var(--ds-motion-fast) var(--ds-ease-out), background var(--ds-motion-fast) var(--ds-ease-out);
}

/* XIII. Powiadomienia */
.notifications-feed--page {
    padding-top: var(--space-3);
}
.notif-feed-all-read {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--ds-content-pad);
    text-align: center;
}
.notif-feed-all-read .material-symbols-outlined {
    font-size: 40px;
    color: var(--ds-text-tertiary);
}
.notif-mark-read-btn {
    white-space: nowrap;
}

/* XII. Menu konta — lewy panel (desktop), akordeon na mobile */
@media (max-width: 768px) {
    .account-layout {
        flex-direction: column;
    }
    .account-side-nav {
        width: 100%;
        min-width: 0;
        flex: none;
        border-right: none;
        border-bottom: none;
        padding: 0;
        background: transparent;
        position: relative;
        z-index: 80;
        display: flex !important;
        flex-direction: column;
    }
    html[data-account-nav="tabs"] .account-side-nav,
    .account-layout--tabs .account-side-nav {
        display: flex !important;
    }
    html[data-account-nav="tabs"] .account-top-nav,
    .account-layout--tabs .account-top-nav {
        display: none !important;
    }
    .account-side-nav__mobile {
        display: block;
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        padding: var(--space-3) var(--space-4) var(--space-3);
        box-sizing: border-box;
        background: var(--ds-surface-muted);
        border-bottom: 1px solid var(--ds-border);
    }
    .account-main > .dashboard-scroll > .account-shell__body > .account-section-header--compact {
        padding-top: var(--space-2);
    }
    .account-mobile-stack {
        width: 100%;
    }
    .account-mobile-stack__trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-2);
        width: 100%;
        padding: var(--space-2) var(--space-1);
        border: none;
        background: transparent;
        color: var(--ds-text);
        font-family: var(--font-ui);
        cursor: pointer;
        text-align: left;
    }
    .account-mobile-stack__current {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        min-width: 0;
        font-size: var(--text-sm);
        font-weight: 600;
    }
    .account-mobile-stack__current .account-subnav-dropdown__label {
        overflow: visible;
        text-overflow: unset;
        white-space: normal;
    }
    .account-mobile-stack__chev {
        font-size: 22px;
        color: var(--ds-text-tertiary);
        flex-shrink: 0;
        transition: transform var(--ds-motion-fast) var(--ds-ease-out);
    }
    .account-mobile-stack.is-open .account-mobile-stack__chev {
        transform: rotate(180deg);
    }
    .account-mobile-stack__cards {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-top: 0;
        width: 100%;
    }
    .account-mobile-stack__card {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 12px var(--space-1);
        border: none;
        border-radius: 0;
        border-bottom: 1px solid var(--ds-border);
        background: transparent;
        color: var(--ds-text);
        font-family: var(--font-ui);
        font-size: var(--text-sm);
        font-weight: 500;
        text-align: left;
        cursor: pointer;
        box-shadow: none;
        opacity: 0;
        transform: translateY(-3px);
        transition:
            opacity 0.18s var(--ds-ease-out),
            transform 0.18s var(--ds-ease-out),
            background var(--ds-motion-fast),
            color var(--ds-motion-fast);
        transition-delay: calc(var(--stack-i, 0) * 28ms);
    }
    .account-mobile-stack.is-open .account-mobile-stack__card {
        opacity: 1;
        transform: translateY(0);
    }
    .account-mobile-stack__card:last-child {
        border-bottom: none;
    }
    .account-mobile-stack__card.is-active {
        background: var(--ds-brand-cta-soft);
        color: var(--ds-text);
        font-weight: 600;
    }
    .account-mobile-stack__card.is-active .material-symbols-outlined {
        color: var(--ds-text);
    }
    .account-mobile-stack__card .material-symbols-outlined {
        font-size: 20px;
        color: var(--ds-text-secondary);
        flex-shrink: 0;
    }
    .account-side-nav__list {
        display: none;
    }
    .account-side-nav__foot .nav-divider {
        display: none;
    }
    .account-side-nav__foot {
        margin-top: var(--space-3);
        padding-top: 0;
    }
}

/* XIV. Profil — uzupełnienia (główne style media-upload wyżej) */
#profile-role-badge .badge {
    font-size: var(--text-2xs);
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
}
.media-upload__clear {
    font-size: var(--text-md);
}

/* XV. Broadcast header */
.settings-section--broadcast .ds-card__header--broadcast {
    height: auto;
    min-height: var(--ds-card-header-height);
    max-height: none;
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-5) var(--ds-inset-x);
}
.broadcast-header__channels {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-2) 0 0;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
}
.broadcast-header__channels .material-symbols-outlined {
    font-size: 18px;
    vertical-align: middle;
}
.broadcast-header__plus {
    color: var(--ds-text-tertiary);
    font-weight: 600;
}
.broadcast-header__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}
.broadcast-tag {
    font-size: var(--text-xs);
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
}
.broadcast-tag--info { background: var(--ds-brand-cta-subtle); color: var(--ds-brand-cta-text); border: 1px solid var(--ds-brand-cta-border); }
.broadcast-tag--danger { background: var(--ds-danger-soft); color: var(--ds-danger); border: 1px solid rgba(185, 28, 28, 0.2); }
.broadcast-tag--ok { background: var(--ds-success-soft); color: var(--ds-success); border: 1px solid rgba(21, 128, 61, 0.2); }

/* XVI. Plany — mobile */
@media (max-width: 900px) {
    .plan-card__offer {
        flex-direction: column;
        align-items: stretch;
    }
    .plan-card__price-block { text-align: left; }
    .plan-card__price { justify-content: flex-start; }
    .plan-card__cta { width: 100%; justify-content: center; }
}

/* Mobile bottom nav — kanoniczny komponent (#44–46): see EOF block ds-components */

/* Mobile FAB — Szybkie akcje + QR */
.mobile-fab-menu {
    position: fixed;
    inset: 0;
    z-index: 1700;
    pointer-events: none;
}
.mobile-fab-menu:not([hidden]) {
    pointer-events: auto;
}
.mobile-fab-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    transition: opacity var(--ds-motion-mid) var(--ds-ease-out);
}
.mobile-fab-menu.is-open .mobile-fab-menu__backdrop {
    opacity: 1;
}
.mobile-fab-menu__panel {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 52px);
    transform: translateX(-50%);
    width: max-content;
    max-width: min(calc(3 * 112px + 2 * var(--space-2)), calc(100vw - 2 * var(--ds-dashboard-shell-pad-x, 16px)));
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    opacity: 1;
    transition: none;
    pointer-events: none;
}
.mobile-fab-menu.is-open .mobile-fab-menu__panel {
    opacity: 1;
    pointer-events: auto;
}
.mobile-fab-menu__close {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    color: var(--ds-text-secondary);
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.22s var(--ds-ease-out),
        transform 0.28s var(--ds-ease-out),
        background var(--ds-motion-fast);
}
.mobile-fab-menu.is-open .mobile-fab-menu__close {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.02s;
}
.mobile-fab-menu__close .material-symbols-outlined {
    font-size: 20px;
}
.mobile-fab-menu__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(96px, 1fr));
    gap: var(--space-2);
    width: min(100%, 360px);
}
.mobile-fab-menu__item--solo {
    grid-column: 2;
    justify-self: center;
}
.mobile-fab-menu__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    width: 100%;
    max-width: 112px;
    justify-self: center;
    aspect-ratio: 1;
    padding: var(--space-2) var(--space-1);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    font-family: var(--font-ui);
    color: var(--ds-text);
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(100%);
    transition:
        opacity 0.26s var(--ds-ease-out),
        transform 0.32s var(--ds-ease-out),
        border-color var(--ds-motion-fast);
}
.mobile-fab-menu.is-open .mobile-fab-menu__item {
    opacity: 1;
    transform: translateY(0);
}
.mobile-fab-menu.is-open .mobile-fab-menu__item:nth-child(1) { transition-delay: 0.06s; }
.mobile-fab-menu.is-open .mobile-fab-menu__item:nth-child(2) { transition-delay: 0.09s; }
.mobile-fab-menu.is-open .mobile-fab-menu__item:nth-child(3) { transition-delay: 0.12s; }
.mobile-fab-menu.is-open .mobile-fab-menu__item:nth-child(4) { transition-delay: 0.15s; }
.mobile-fab-menu.is-open .mobile-fab-menu__item:nth-child(5) { transition-delay: 0.18s; }
.mobile-fab-menu.is-open .mobile-fab-menu__item:nth-child(6) { transition-delay: 0.21s; }
.mobile-fab-menu.is-open .mobile-fab-menu__item:nth-child(7) { transition-delay: 0.24s; }
.mobile-fab-menu:not(.is-open) .mobile-fab-menu__item,
.mobile-fab-menu:not(.is-open) .mobile-fab-menu__close {
    transition-delay: 0s;
}
.mobile-fab-menu__item:hover,
.mobile-fab-menu__item:active,
.mobile-fab-menu__item:focus-visible {
    background: var(--ds-surface);
    border-color: var(--ds-border-strong);
}
.mobile-fab-menu__item .material-symbols-outlined {
    font-size: 22px;
    color: var(--ds-text-secondary);
    line-height: 1;
    flex-shrink: 0;
}
.mobile-fab-menu__item--brand {
    background: var(--ds-brand-cta);
    border-color: var(--ds-brand-cta-border, var(--ds-brand-cta));
    color: var(--ds-brand-cta-text);
}
.mobile-fab-menu__item--brand .material-symbols-outlined {
    color: var(--ds-brand-cta-text);
}
.mobile-fab-menu__item--brand .mobile-fab-menu__label {
    color: var(--ds-brand-cta-text);
}
.mobile-fab-menu__item--brand:hover,
.mobile-fab-menu__item--brand:active,
.mobile-fab-menu__item--brand:focus-visible {
    background: var(--ds-brand-cta-hover, var(--ds-brand-cta));
    border-color: var(--ds-brand-cta-border, var(--ds-brand-cta));
}
.mobile-fab-menu__item--brand:hover .material-symbols-outlined,
.mobile-fab-menu__item--brand:active .material-symbols-outlined,
.mobile-fab-menu__item--brand:focus-visible .material-symbols-outlined,
.mobile-fab-menu__item--brand:hover .mobile-fab-menu__label,
.mobile-fab-menu__item--brand:active .mobile-fab-menu__label,
.mobile-fab-menu__item--brand:focus-visible .mobile-fab-menu__label {
    color: var(--ds-brand-cta-text);
}
#esd-app .mobile-fab-menu__item--brand:focus-visible {
    border-color: var(--ds-brand-cta-border, var(--ds-brand-cta));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-brand-cta) 35%, transparent) !important;
}
.mobile-fab-menu__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}
.mobile-fab-menu__icon--brand {
    background: var(--ds-brand);
    color: var(--ds-brand-contrast, #111);
}
.mobile-fab-menu__icon--brand .material-symbols-outlined {
    color: var(--ds-brand-contrast, #111);
}
.mobile-fab-menu__item:hover .mobile-fab-menu__icon--brand,
.mobile-fab-menu__item:active .mobile-fab-menu__icon--brand,
.mobile-fab-menu__item:focus-visible .mobile-fab-menu__icon--brand {
    background: var(--ds-brand);
}
.mobile-fab-menu__item:hover .mobile-fab-menu__icon--brand .material-symbols-outlined,
.mobile-fab-menu__item:active .mobile-fab-menu__icon--brand .material-symbols-outlined,
.mobile-fab-menu__item:focus-visible .mobile-fab-menu__icon--brand .material-symbols-outlined {
    color: var(--ds-brand-contrast, #111);
}
.mobile-fab-menu__label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-size: var(--text-2xs);
    font-weight: 600;
    line-height: 1.2;
    color: var(--ds-text);
    min-width: 0;
    max-width: 100%;
}
.mobile-fab-menu__label span {
    display: block;
}

/* Tablet/mobile topbar */
@media (max-width: 1080px) {
    .topbar__mobile-brand .topbar-app-mark__logo {
        width: 34px;
        height: 34px;
    }
    .topbar__mobile-brand .topbar-app-mark__title {
        font-size: 18px;
    }
}
@media (max-width: 768px) {
    .topbar__mobile-settings {
        display: none !important;
    }
}

/* Kalendarz — min wysokość komórek (widoki bez aspect-ratio) */
.cal-grid:not(.cal-grid--page):not(.cal-grid--dash) .cal-cell {
    min-height: var(--cal-cell-h);
}
.cal-grid--page .cal-cell,
.cal-grid--dash .cal-cell {
    min-height: 0;
}
.cal-page-module .ds-close-btn {
    order: -1;
    margin-right: var(--space-2);
}

/* Modale — animacja zamykania */
.modal.modal--closing {
    animation: modalBackdropOut 0.22s var(--ds-ease-out) forwards;
}
.modal.modal--closing .modal-content {
    animation: modalContentOut 0.22s var(--ds-ease-out) forwards;
}
@keyframes modalBackdropOut {
    to { background-color: rgba(15, 23, 42, 0); }
}
@keyframes modalContentOut {
    to { opacity: 0; transform: scale(0.97) translateY(8px); }
}

/* Slide panel — płynniejsze */
.slide-panel__drawer {
    transition: transform var(--ds-motion-slow) var(--ds-ease-out);
}
.slide-panel.is-closing .slide-panel__drawer {
    transition: transform var(--ds-motion-mid) var(--ds-ease-in-out);
}

/* ── Pulpit: wariant karty bez stopki — treść wypełnia wysokość ── */
.ds-card--no-footer .ds-card__body--grow {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.ds-card--no-footer .ds-inset-scroll--fill,
.ds-card--no-footer .ds-scroll-lane--fill {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
}
.ds-card--no-footer .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset {
    flex: 1 1 auto;
    min-height: 0;
}
#view-dashboard .dashboard-body > .dashboard-row:first-child {
    align-items: stretch;
}
#view-dashboard .dashboard-body > .dashboard-row:first-child > #dash-calendar-module.cal-module--drilldown.cal-day-detail-open {
    height: var(--dash-cal-locked-h, var(--ds-dash-cal-h));
    max-height: var(--dash-cal-locked-h, var(--ds-dash-cal-h));
    align-self: stretch;
}
#view-dashboard .dashboard-body > .dashboard-row:first-child > #dash-calendar-module.cal-module--drilldown:not(.cal-day-detail-open) {
    align-self: stretch;
}
#view-dashboard .dashboard-body > .dashboard-row:first-child > .ds-card--today {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: var(--dash-today-sync-h, var(--ds-dash-cal-h));
    min-height: var(--dash-today-sync-h, var(--ds-dash-cal-h));
    max-height: var(--dash-today-sync-h, var(--ds-dash-cal-h));
    overflow: hidden;
}
#view-dashboard .ds-card--today .ds-card__header {
    flex-shrink: 0;
}
/* Pomiary na dziś — scroll na lane; inset i lista = wysokość wierszy (bez pustej strefy pod listą) */
#view-dashboard .ds-card--today :is(.ds-inset-scroll--host, .ds-content-inset--scroll) > .ds-scroll-lane:not(:has(.ds-scroll-rail)),
#view-dashboard .ds-card--today .ds-scroll-lane:not(:has(.ds-scroll-rail)) {
    flex: 1 1 0%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
}
#view-dashboard .ds-card--today .ds-scroll-lane:not(:has(.ds-scroll-rail))::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
#view-dashboard .ds-card--today :is(
    .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset,
    .ds-scroll-rail .ds-scroll-lane__inset
) {
    flex: none !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    display: block;
}
#view-dashboard .ds-card--today :is(
    .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset,
    .ds-scroll-rail .ds-scroll-lane__inset
) > #today-products-list {
    flex: none !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    display: flex;
    flex-direction: column;
}
#view-dashboard .ds-card--today :is(
    .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset,
    .ds-scroll-rail .ds-scroll-lane__inset
) > #today-products-list:has(:is(.cal-empty-state--day, .module-empty)) {
    flex: 1 1 auto !important;
    min-height: 100%;
}
#dash-calendar-module.cal-day-detail-open .dash-day-view {
    flex: 1 1 auto;
    min-height: 0;
}
#dash-calendar-module.cal-day-detail-open .dash-day-view > :is(.ds-inset-scroll.ds-inset-scroll--host, .ds-content-inset.ds-inset-scroll--host),
#dash-calendar-module.cal-day-detail-open .dash-day-view > .ds-content-inset {
    flex: 1 1 0;
    min-height: 0;
    box-sizing: border-box;
}

#view-dashboard .dash-inventory-card .ds-inset-scroll--dashboard-list {
    flex: 1 1 0;
    height: auto;
    min-height: 0;
    max-height: none;
}
#view-dashboard .dash-inventory-card .ds-scroll-lane--dashboard-list {
    flex: 1 1 0;
    height: auto;
    min-height: 0;
    max-height: none;
}
#view-dashboard #dash-inventory-list {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: auto;
    display: block;
    align-self: stretch;
}
#view-dashboard #dash-inventory-list .module-empty {
    min-height: var(--ds-dashboard-list-scroll-h);
}
.compliance-v5-host,
.compliance-v5 {
    flex: 1 1 auto;
    min-height: 200px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.compliance-v5 {
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-3);
    width: 100%;
}
@media (min-width: 640px) {
    .compliance-v5 {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: clamp(var(--space-4), 4vw, var(--space-6));
        padding: var(--space-3) var(--space-4);
    }
}
.compliance-v5__chart {
    position: relative;
    flex: 0 0 auto;
    width: min(152px, 38vw);
    max-width: 168px;
    aspect-ratio: 1;
    margin: 0 auto;
}
.compliance-v5__svg {
    display: block;
    width: 100%;
    height: 100%;
}
.compliance-v5__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    pointer-events: none;
}
.compliance-v5__total {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--ds-text);
    font-variant-numeric: var(--ds-font-numeric);
}
.compliance-v5__total-label {
    font-size: var(--text-xs);
    color: var(--ds-text-tertiary);
}
.compliance-v5__seg--pass { stroke: var(--ds-success); }
.compliance-v5__seg--review { stroke: var(--ds-brand-cta); }
.compliance-v5__seg--fail { stroke: var(--ds-danger); }
.compliance-v5__seg--empty { stroke: color-mix(in srgb, var(--ds-border) 70%, var(--ds-surface)); }
.compliance-v5__legend {
    flex: 0 1 auto;
    width: 100%;
    max-width: 320px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    justify-content: center;
}
@media (min-width: 640px) {
    .compliance-v5__legend {
        flex: 1 1 auto;
        max-width: none;
    }
}
.compliance-v5__row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}
.compliance-v5__swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.compliance-v5__row--pass .compliance-v5__swatch { background: var(--ds-success); }
.compliance-v5__row--review .compliance-v5__swatch { background: var(--ds-brand-cta); }
.compliance-v5__row--fail .compliance-v5__swatch { background: var(--ds-danger); }
.compliance-v5__label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text-secondary);
    line-height: 1.35;
    min-width: 0;
}
.compliance-v5__meta {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
    font-size: var(--text-sm);
    white-space: nowrap;
}
.compliance-v5__meta strong {
    font-weight: 600;
    color: var(--ds-text);
    font-variant-numeric: var(--ds-font-numeric);
}
.compliance-v5__meta span {
    font-size: var(--text-xs);
    color: var(--ds-text-tertiary);
}
#view-dashboard .ds-card--compliance .compliance-v5-host {
    width: 100%;
    flex: 0 0 auto;
    min-height: 0;
    height: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    box-sizing: border-box;
}
/* ── Rozkład zgodności v4 — paski, pełna szerokość
   JS: components/compliance-v4.js · modyfikatory --pass | --review | --fail ── */
.compliance-v4,
#compliance-v3.compliance-v4 {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--space-3);
    padding: 0;
    box-sizing: border-box;
}
.compliance-v4__head {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: nowrap;
    flex-shrink: 0;
    padding-bottom: var(--space-3);
    margin-bottom: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--ds-border) 65%, transparent);
}
.compliance-v4__chart {
    position: relative;
    flex: 0 0 auto;
    width: 88px;
    height: 88px;
}
.compliance-v4__svg {
    display: block;
    width: 100%;
    height: 100%;
}
.compliance-v4__chart-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    pointer-events: none;
}
.compliance-v4__chart-total {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--ds-text);
    font-variant-numeric: var(--ds-font-numeric);
}
.compliance-v4__chart-total-label {
    font-size: var(--text-2xs);
    color: var(--ds-text-tertiary);
    line-height: 1.2;
}
.compliance-v4__head-copy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--space-2);
}
.compliance-v4__head-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
    line-height: 1.25;
}
.compliance-v4__pass-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.2;
    color: var(--ds-success);
    background: var(--ds-success-soft);
    border: 1px solid color-mix(in srgb, var(--ds-success) 28%, transparent);
}
.compliance-v4__pass-chip--empty {
    color: var(--ds-text-tertiary);
    background: var(--ds-surface-muted);
    border-color: var(--ds-border);
    font-weight: 500;
}
.compliance-v4__seg--pass { stroke: var(--ds-success); }
.compliance-v4__seg--review { stroke: var(--ds-brand-cta); }
.compliance-v4__seg--fail { stroke: var(--ds-danger); }
.compliance-v4__seg--empty { stroke: color-mix(in srgb, var(--ds-border) 70%, var(--ds-surface)); }

/* ── Rozkład zgodności — pulpit (.compliance-chart) ── */
.compliance-chart {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    height: auto;
    flex: 0 0 auto;
    min-height: 0;
    padding: var(--ds-dash-charts-pad-y, 40px) var(--ds-inset-x);
    box-sizing: border-box;
}
.compliance-chart__grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    width: 100%;
    align-items: stretch;
    margin: 0;
}
.compliance-chart__col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
    margin: 0;
    padding: 0 0 0 2px;
    border: 0;
    border-left: 2px solid transparent;
    background: transparent;
    font: inherit;
    text-align: left;
    color: inherit;
    box-sizing: border-box;
    cursor: pointer;
    transition:
        opacity 0.18s ease,
        border-color 0.18s ease,
        padding-left 0.18s ease;
}
button.compliance-chart__col {
    appearance: none;
    -webkit-appearance: none;
}
button.compliance-chart__col:focus-visible {
    outline: none;
    border-radius: var(--radius-sm);
    box-shadow: inset 0 0 0 2px var(--ds-primary);
}
.compliance-chart__col--empty {
    cursor: default;
    opacity: 0.5;
}
.compliance-chart__bar-axis {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    min-height: 16px;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    color: var(--ds-text-tertiary);
}
.compliance-chart__marker {
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    pointer-events: none;
}
.compliance-chart__marker-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid color-mix(in srgb, var(--ds-text-secondary) 85%, transparent);
}
.compliance-chart__marker-line {
    width: 1px;
    height: 10px;
    margin-top: 1px;
    background: color-mix(in srgb, var(--ds-text-secondary) 30%, transparent);
}
.compliance-chart__bar {
    display: block;
    width: 100%;
    height: 14px;
    min-height: 14px;
}
.compliance-chart__bar-track {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    overflow: hidden;
    box-sizing: border-box;
}
.compliance-chart__bar-track--pass {
    background: var(--ds-green-tint-22);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ds-status-border-ok) 42%, transparent);
}
.compliance-chart__bar-track--review {
    background: var(--ds-brand-tint-22);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ds-brand-cta-border) 38%, transparent);
}
.compliance-chart__bar-track--fail {
    background: color-mix(in srgb, var(--ds-status-bg-fail) 88%, var(--ds-surface));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ds-status-border-fail) 42%, transparent);
}
.compliance-chart__bar-fill {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: 999px;
    box-sizing: border-box;
    transition: width 0.2s ease, filter 0.2s ease;
}
.compliance-chart__bar-fill--pass {
    background: var(--ds-status-text-ok);
}
.compliance-chart__bar-fill--review {
    background: var(--ds-brand-cta);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ds-brand-cta-border) 55%, transparent);
}
.compliance-chart__bar-fill--fail {
    background: var(--ds-status-text-fail);
}
/* Legacy segmenty — style guide */
.compliance-chart__bar-rest {
    min-width: 6px;
    border-radius: 999px;
    box-sizing: border-box;
}
.compliance-chart__bar-gap {
    flex: 0 0 3px;
    width: 3px;
}
.compliance-chart__footer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-3);
    min-width: 0;
}
.compliance-chart__headline {
    display: flex;
    align-items: baseline;
    gap: 0.4em;
    margin: 0;
    min-width: 0;
    flex-wrap: wrap;
}
.compliance-chart__metric {
    margin: 0;
    flex-shrink: 0;
    font-size: clamp(1.375rem, 3vw, 1.875rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--ds-text);
    font-variant-numeric: var(--ds-font-numeric);
    transition: color 0.18s ease;
}
.compliance-chart__caption-label {
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.2;
    color: var(--ds-text);
    transition: color 0.18s ease;
}
.compliance-chart__caption-meta {
    flex-shrink: 0;
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.3;
    color: color-mix(in srgb, var(--ds-text-tertiary) 72%, var(--ds-surface));
}
.compliance-chart[data-active]:not([data-active=""]) .compliance-chart__col:not(.compliance-chart__col--empty) {
    opacity: 0.82;
}
.compliance-chart[data-active="pass"] .compliance-chart__col--pass,
.compliance-chart[data-active="review"] .compliance-chart__col--review,
.compliance-chart[data-active="fail"] .compliance-chart__col--fail {
    opacity: 1;
    padding-left: 6px;
    border-left-color: var(--ds-border-strong);
}
.compliance-chart[data-active="pass"] .compliance-chart__col--pass {
    border-left-color: var(--ds-status-text-ok);
}
.compliance-chart[data-active="review"] .compliance-chart__col--review {
    border-left-color: var(--ds-brand-cta);
}
.compliance-chart[data-active="fail"] .compliance-chart__col--fail {
    border-left-color: var(--ds-status-text-fail);
}
.compliance-chart[data-active="pass"] .compliance-chart__col--pass .compliance-chart__metric,
.compliance-chart[data-active="pass"] .compliance-chart__col--pass .compliance-chart__caption-label {
    color: var(--ds-status-text-ok);
}
.compliance-chart[data-active="review"] .compliance-chart__col--review .compliance-chart__metric,
.compliance-chart[data-active="review"] .compliance-chart__col--review .compliance-chart__caption-label {
    color: var(--ds-brand-cta-active);
}
.compliance-chart[data-active="fail"] .compliance-chart__col--fail .compliance-chart__metric,
.compliance-chart[data-active="fail"] .compliance-chart__col--fail .compliance-chart__caption-label {
    color: var(--ds-status-text-fail);
}
.compliance-chart[data-active="pass"] .compliance-chart__col--pass .compliance-chart__bar-fill,
.compliance-chart[data-active="review"] .compliance-chart__col--review .compliance-chart__bar-fill,
.compliance-chart[data-active="fail"] .compliance-chart__col--fail .compliance-chart__bar-fill {
    filter: none;
}
/* Legacy row / legenda — style guide */
.compliance-chart__legend {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: var(--space-3);
    justify-items: start;
}
.compliance-chart__legend-item {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex: none;
    width: 100%;
    min-width: 0;
    gap: 7px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    color: var(--ds-text-secondary);
    box-sizing: border-box;
}
.compliance-chart__legend-label {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
}
.compliance-chart__swatch {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex-shrink: 0;
}
.compliance-chart__legend-item--pass .compliance-chart__swatch { background: var(--ds-status-text-ok); }
.compliance-chart__legend-item--review .compliance-chart__swatch { background: var(--ds-brand-cta); }
.compliance-chart__legend-item--fail .compliance-chart__swatch { background: var(--ds-status-text-fail); }
.compliance-chart__row {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    margin: 0;
    padding: var(--space-2) var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    font: inherit;
    text-align: left;
    color: inherit;
    box-sizing: border-box;
}
.compliance-chart__row--pass .compliance-chart__swatch { background: var(--ds-status-text-ok); }
.compliance-chart__row--review .compliance-chart__swatch { background: var(--ds-brand-cta); }
.compliance-chart__row--fail .compliance-chart__swatch { background: var(--ds-status-text-fail); }

.compliance-v4__total {
    font-size: clamp(1.375rem, 2.5vw, 1.875rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--ds-text);
    font-family: var(--font-ui) !important;
    font-feature-settings: var(--ds-font-features) !important;
    font-variant-numeric: var(--ds-font-numeric);
}
.compliance-v4__total-label {
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--ds-text-tertiary);
    line-height: 1.3;
}
.compliance-v4__bars {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--space-3);
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    padding-top: var(--space-2);
    margin-top: 0;
}
.compliance-v4__row {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
}
.compliance-v4__row-head {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}
.compliance-v4__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 1;
}
.compliance-v4__label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text-secondary);
    line-height: 1.35;
    min-width: 0;
}
.compliance-v4__meta {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--ds-text-tertiary);
    white-space: nowrap;
}
.compliance-v4__meta strong {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
    font-family: var(--font-ui) !important;
    font-feature-settings: var(--ds-font-features) !important;
    font-variant-numeric: var(--ds-font-numeric);
}
.compliance-v4__meta span {
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--ds-text-tertiary);
}
.compliance-v4__track {
    height: 8px;
    border-radius: var(--radius-xs);
    background: color-mix(in srgb, var(--ds-border) 55%, var(--ds-surface));
    overflow: hidden;
}
.compliance-v4__fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    min-width: 0;
    transition: width 0.45s var(--ds-ease-out);
}
/* Warianty statusu — kolory tylko tutaj (zgodnie z DS) */
.compliance-v4__row--pass .compliance-v4__dot,
.compliance-v4__row--pass .compliance-v4__fill {
    background: var(--ds-success);
}
.compliance-v4__row--review .compliance-v4__dot,
.compliance-v4__row--review .compliance-v4__fill {
    background: var(--ds-brand-cta);
}
.compliance-v4__row--fail .compliance-v4__dot,
.compliance-v4__row--fail .compliance-v4__fill {
    background: var(--ds-danger);
}
#view-dashboard .ds-card--compliance {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#view-dashboard .ds-card--compliance .ds-card__body--grow {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* ══ FIX: drill-down dnia — lista + widok godzinowy wypełniają zablokowaną wysokość ══ */

/* Pulpit — harmonogram po kliknięciu dnia */
#view-dashboard #dash-calendar-module.cal-day-detail-open.cal-module--drilldown {
    display: flex;
    flex-direction: column;
    height: var(--dash-cal-locked-h, auto);
    min-height: var(--dash-cal-locked-h, auto);
    max-height: var(--dash-cal-locked-h, auto);
    overflow: hidden;
}
#view-dashboard #dash-calendar-module.cal-day-detail-open .ds-card__body--grow,
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-module-body,
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-module-split,
#view-dashboard #dash-calendar-module.cal-day-detail-open .cal-side-panel,
#view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view,
#view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view > :is(.ds-inset-scroll, .ds-content-inset.ds-inset-scroll--host),
#view-dashboard #dash-calendar-module.cal-day-detail-open .dash-day-view .ds-scroll-lane {
    flex: 1 1 0;
    min-height: 0;
}

/* Kalendarz pomiarów — drill-down: obie kolumny obok siebie */
#cal-page-module.cal-day-detail-open .cal-module-body,
#cal-page-module.cal-day-detail-open .cal-module-split,
#cal-page-module.cal-day-detail-open .cal-side-panel {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#cal-page-module.cal-day-detail-open .cal-side-panel {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    container-type: inline-size;
    container-name: cal-day-detail-panel;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout--page {
    display: grid;
    grid-template-columns:
        minmax(var(--cal-day-detail-col-list-min), 1fr)
        minmax(var(--cal-day-detail-col-summary-min), 1fr);
    gap: 0;
    flex: 1 1 0;
    min-height: 0;
    min-width: calc(var(--cal-day-detail-col-list-min) + var(--cal-day-detail-col-summary-min));
    width: 100%;
    height: 100%;
    overflow: hidden;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: visible;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-col__head {
    overflow: visible;
    flex-shrink: 0;
    max-height: none;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-col__title {
    overflow: visible;
    line-height: 1.3;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col > .ds-inset-scroll,
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col .ds-scroll-lane {
    flex: 1 1 0;
    min-height: 0;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--list {
    border-right: 1px solid var(--ds-border);
    border-bottom: none;
}

/* Prawa kolumna — ten sam komponent co widok Dzień (.cal-time-grid) */
#cal-page-module.cal-view-mode--week .cal-time-grid__body--rows,
#cal-page-module.cal-view-mode--day .cal-time-grid__body--rows,
#cal-page-module.cal-day-detail-open #cal-day-summary .cal-time-grid__body--rows {
    position: relative;
}
#cal-page-module.cal-view-mode--week .cal-time-grid__now-line,
#cal-page-module.cal-view-mode--day .cal-time-grid__now-line,
#cal-page-module.cal-day-detail-open #cal-day-summary .cal-time-grid__now-line {
    z-index: 25;
}
/* Linia „teraz” — tylko .cal-time-grid__now-line (JS), bez ::before na wierszu */
#cal-page-module .cal-time-grid__row.is-current-hour::before {
    content: none;
}
#cal-page-module.cal-view-mode--week .cal-time-grid__row .cal-time-grid__hour,
#cal-page-module.cal-view-mode--week .cal-time-grid__row .cal-time-grid__row-days,
#cal-page-module.cal-view-mode--day .cal-time-grid__row .cal-time-grid__hour,
#cal-page-module.cal-view-mode--day .cal-time-grid__row .cal-time-grid__row-days,
#cal-page-module.cal-day-detail-open #cal-day-summary .cal-time-grid__row .cal-time-grid__hour,
#cal-page-module.cal-day-detail-open #cal-day-summary .cal-time-grid__row .cal-time-grid__row-days {
    position: relative;
    z-index: 1;
}
#cal-page-module.cal-view-mode--week .cal-time-grid__row.is-current-hour .cal-time-grid__hour span,
#cal-page-module.cal-view-mode--day .cal-time-grid__row.is-current-hour .cal-time-grid__hour span,
#cal-page-module.cal-day-detail-open #cal-day-summary .cal-time-grid__row.is-current-hour .cal-time-grid__hour span {
    color: var(--ds-success);
    font-weight: 700;
}

/* Kalendarz drill-down — wąski panel / mobile: kolumny jedna pod drugą */
@media (max-width: 1280px) {
    #cal-page-module.cal-day-detail-open .cal-module-body {
        overflow: hidden;
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    #cal-page-module.cal-day-detail-open .cal-module-split,
    #cal-page-module.cal-day-detail-open .cal-side-panel {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout--page {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-width: 0;
        min-height: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout__col {
        flex: 1 1 0;
        min-width: 0;
        min-height: 0;
        width: 100%;
        overflow: hidden;
    }
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--list {
        border-right: none;
        border-bottom: 1px solid var(--ds-border);
        flex: 0 1 auto;
        min-height: 0;
        max-height: min(38vh, 320px);
        overflow: hidden;
    }
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout__col > :is(.ds-inset-scroll, .ds-content-inset) {
        padding: 0;
        flex: 1 1 0;
        min-height: 0;
    }
    #cal-page-module.cal-day-detail-open :is(.ds-inset-scroll--host, .ds-content-inset):has(.ds-scroll-rail) {
        padding: 0;
    }
    #cal-page-module.cal-day-detail-open :is(.ds-inset-scroll--host, .ds-content-inset, .cal-time-scroll-host):has(.ds-scroll-rail) > .ds-scroll-lane {
        padding-inline-start: var(--ds-entity-scroll-gutter);
        padding-inline-end: 0;
        padding-top: var(--ds-dashboard-body-gap);
        padding-bottom: var(--ds-inset-y);
    }
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary .cal-time-grid,
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary .cal-time-grid-wrap {
        min-width: 0;
        width: 100%;
    }
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary .ds-scroll-rail__body {
        overflow-x: auto;
    }
}

/* ── Kalendarz strony: miesiąc — cały miesiąc w wysokości okna ─────────── */
#cal-page-module.cal-view-mode--month:not(.cal-day-detail-open) .cal-month-wrap--page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#cal-page-module.cal-view-mode--month .cal-month-wrap--page .cal-weekdays {
    flex-shrink: 0;
}
#cal-page-module.cal-view-mode--month .cal-grid--page {
    flex: 1;
    min-height: 0;
    height: 100%;
    grid-auto-rows: unset;
    grid-template-rows: repeat(var(--cal-page-week-rows, 6), minmax(0, 1fr));
    align-content: stretch;
}
#cal-page-module.cal-view-mode--month .cal-grid--page .cal-cell {
    aspect-ratio: unset;
    height: 100%;
    min-height: 0;
    max-height: none;
    padding: clamp(4px, 6%, 12px);
}
#cal-page-module.cal-view-mode--month .cal-grid--page .cal-cell__num {
    font-size: clamp(var(--text-xs), 2.2vmin, var(--text-md));
    line-height: 1.15;
}
#cal-page-module.cal-view-mode--month .cal-grid--page .cal-cell__count {
    min-width: clamp(20px, 3.5vmin, 28px);
    width: clamp(20px, 3.5vmin, 28px);
    height: clamp(20px, 3.5vmin, 28px);
    font-size: clamp(10px, 1.6vmin, 12px);
}
.dashboard-scroll--calendar-fill.cal-scroll--month {
    overflow: hidden;
}
.dashboard-scroll--calendar-fill.cal-scroll--month > .cal-page-module,
.dashboard-scroll--calendar-fill.cal-scroll--month > #cal-page-module {
    flex: 1;
    min-height: 0;
    height: 100%;
}

/* ── Kalendarz strony: tydzień / dzień — stała szerokość tabeli + scroll rail ── */
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-scroll-host,
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-lane,
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-lane,
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-rail,
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-rail {
    flex: 1 1 0;
    min-height: 0;
}
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-rail__body,
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-rail__body,
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary .cal-time-scroll-host .ds-scroll-rail__body {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}
#cal-page-module .cal-time-scroll-host:has(.ds-scroll-rail) > .ds-scroll-lane {
    padding-inline-start: var(--ds-entity-scroll-gutter);
    padding-inline-end: 0;
    padding-block: var(--ds-inset-y);
    box-sizing: border-box;
}
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary .cal-time-grid-wrap,
#cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary .cal-time-grid {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-lane__inset > .cal-time-grid-wrap {
    width: max(100%, var(--cal-page-week-min-w));
    min-width: var(--cal-page-week-min-w);
    max-width: none;
    box-sizing: border-box;
}
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-lane__inset > .cal-time-grid-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
#cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-scroll-host .cal-time-grid {
    min-width: var(--cal-page-week-min-w);
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
#cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host .cal-time-grid {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1080px) {
    #cal-page-module {
        --cal-page-week-min-w: 720px;
        --cal-page-day-min-w: 0;
    }
    #cal-page-module.cal-view-mode--month {
        --cal-page-cell-h: auto;
        --cal-page-col-min: 0;
        --cal-page-grid-min-w: 100%;
        --cal-page-grid-gap: 3px;
    }
    #cal-page-module.cal-view-mode--month:not(.cal-day-detail-open) {
        height: var(--ds-dash-cal-h);
        min-height: var(--ds-dash-cal-h);
        max-height: var(--ds-dash-cal-h);
        flex: none;
        overflow: hidden;
    }
    #cal-page-module.cal-view-mode--month:not(.cal-day-detail-open) .cal-module-body,
    #cal-page-module.cal-view-mode--month:not(.cal-day-detail-open) .cal-module-split,
    #cal-page-module.cal-view-mode--month:not(.cal-day-detail-open) .cal-module-calendar {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    #cal-page-module.cal-view-mode--month:not(.cal-day-detail-open) .cal-month-wrap--page {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    #cal-page-module.cal-view-mode--month:not(.cal-day-detail-open) .cal-grid--page {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        grid-auto-rows: 1fr;
        grid-template-rows: repeat(var(--cal-page-week-rows, 6), minmax(0, 1fr));
        align-content: stretch;
        gap: 3px;
    }
    #cal-page-module.cal-view-mode--month:not(.cal-day-detail-open) .cal-grid--page .cal-cell {
        aspect-ratio: unset;
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 4px;
        align-items: stretch;
        justify-content: flex-start;
    }
    #cal-page-module.cal-view-mode--month:not(.cal-day-detail-open) .cal-grid--page .cal-cell__num {
        font-size: var(--text-xs);
        font-weight: 600;
    }
    #cal-page-module.cal-view-mode--month:not(.cal-day-detail-open) .cal-grid--page .cal-cell__count {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
        font-weight: var(--ds-dash-cal-count-weight);
    }
    #view-calendar .dashboard-scroll--calendar-fill.cal-scroll--month:not(:has(#cal-page-module.cal-day-detail-open)) {
        overflow-y: auto;
        overflow-x: hidden;
    }
    #view-calendar .dashboard-scroll--calendar-fill.cal-scroll--month:not(:has(#cal-page-module.cal-day-detail-open)) > #cal-page-module {
        flex: none;
        height: auto;
        min-height: 0;
    }
    #view-calendar .dashboard-scroll--calendar-fill.cal-scroll--month:not(:has(#cal-page-module.cal-day-detail-open)) > #cal-page-module.cal-view-mode--month:not(.cal-day-detail-open) {
        height: var(--ds-dash-cal-h);
        min-height: var(--ds-dash-cal-h);
        max-height: var(--ds-dash-cal-h);
    }
    #cal-page-module .cal-header-nav--grouped .cal-toolbar__title,
    #cal-page-module .cal-day-detail-nav.cal-header-nav--grouped .cal-toolbar__title,
    #cal-page-module .cal-day-detail-nav__title {
        flex: none;
        width: auto;
        min-width: 0;
        text-align: center;
        font-size: var(--text-sm);
        font-weight: 600;
        line-height: 1.2;
        color: var(--ds-text);
        white-space: nowrap;
    }
    #cal-page-module .cal-header-nav--grouped .btn-cal-nav,
    #cal-page-module .cal-day-detail-nav .btn-cal-nav {
        --cal-nav-btn-size: 32px;
        flex: 0 0 var(--cal-nav-btn-size);
        width: var(--cal-nav-btn-size);
        height: var(--cal-nav-btn-size);
        min-width: var(--cal-nav-btn-size);
        min-height: var(--cal-nav-btn-size);
    }
    #cal-page-module .cal-header-nav--grouped .btn-cal-nav .material-symbols-outlined,
    #cal-page-module .cal-day-detail-nav .btn-cal-nav .material-symbols-outlined {
        font-size: 18px;
    }
    #view-calendar .dashboard-scroll--calendar-fill:has(#cal-page-module.cal-day-detail-open) {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    #view-calendar .dashboard-scroll--calendar-fill:has(#cal-page-module.cal-day-detail-open) > #cal-page-module {
        flex: 1 1 0;
        min-height: 0;
        max-height: none;
        height: auto;
        overflow: hidden;
    }
    #cal-page-module.cal-view-mode--month .cal-grid--page .cal-cell {
        padding: 4px;
    }
    #cal-page-module.cal-day-detail-open {
        flex: 1 1 0;
        min-height: 0;
        max-height: none;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        height: auto;
    }
    #cal-page-module.cal-day-detail-open .cal-module-body {
        flex: 1 1 0;
        min-height: 0;
        max-height: none;
        overflow: hidden;
    }
    #cal-page-module.cal-day-detail-open .cal-module-split,
    #cal-page-module.cal-day-detail-open .cal-side-panel,
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout--page {
        overflow: hidden;
        flex: 1 1 0;
        min-height: 0;
        height: auto;
        display: flex;
        flex-direction: column;
    }
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout__col {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--list {
        flex: 0 1 auto;
        max-height: min(38vh, 320px);
    }
    #cal-page-module.cal-day-detail-open .cal-day-detail-layout__col--summary {
        flex: 1 1 0;
        min-height: 0;
    }
    #view-calendar .dashboard-scroll--calendar-fill.cal-scroll--time {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    #view-calendar .dashboard-scroll--calendar-fill.cal-scroll--time > #cal-page-module {
        flex: 1 1 0;
        min-height: 0;
        height: auto;
        max-height: none;
        overflow: hidden;
    }
    #cal-page-module.cal-view-mode--week:not(.cal-day-detail-open),
    #cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }
    #cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-module-body,
    #cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-module-body,
    #cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-module-split,
    #cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-module-split,
    #cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-module-calendar {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }
    #cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-scroll-host,
    #cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }
    #cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-rail,
    #cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-rail {
        flex: 1 1 0;
        min-height: 0;
        height: 100%;
    }
    #cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-rail__body {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
    #cal-page-module.cal-view-mode--week:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-rail__body {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-x pan-y;
    }
    #cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host .ds-scroll-lane__inset > .cal-time-grid-wrap,
    #cal-page-module.cal-view-mode--day:not(.cal-day-detail-open) .cal-time-scroll-host .cal-time-grid {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
}
@media (max-width: 768px) {
    #cal-page-module {
        --cal-page-week-min-w: 640px;
        --cal-page-day-min-w: 0;
    }
}

/* ── Dodawanie / edycja zasobu ── */
.ds-add-product-layout {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}
@media (min-width: 1081px) {
    .ds-add-product-view .dashboard-scroll {
        align-items: center;
    }
}
.ds-add-product-form {
    display: block;
    box-sizing: border-box;
}
.ds-add-product-form__panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    box-sizing: border-box;
    overflow: visible;
}
.ds-add-product-form__header {
    flex-shrink: 0;
}
.ds-add-product-form__header .ds-card__title {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
}
.ds-add-product-form__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(220px, 280px);
    column-gap: var(--ds-popup-inset);
    row-gap: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: visible;
}
/* Jedna powłoka siatki zasobu — mobile: jedna kolumna; desktop: pola | kreska | kod */
.ds-product-asset-grid {
    --ds-add-product-block-title-h: 28px;
    --ds-product-asset-code-col: minmax(200px, 260px);
    --ds-popup-columns-gap: var(--ds-popup-inset);
    --ds-popup-columns-pad-y: var(--space-4);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    row-gap: var(--space-5);
    padding: var(--ds-popup-inset);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}
@media (min-width: 1081px) {
    .ds-product-asset-grid {
        grid-template-columns: minmax(0, 1fr) 1px var(--ds-product-asset-code-col);
        column-gap: var(--ds-popup-columns-gap);
        row-gap: 0;
    }
    .ds-product-asset-grid .ds-add-product-form__column--fields,
    .ds-product-asset-grid .ds-add-product-form__column--code {
        padding-block: var(--ds-popup-columns-pad-y);
        padding-inline: 0;
    }
}
:is(.ds-asset-card-panel__summary, .ds-asset-card-panel__summary--form).ds-product-asset-grid {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    row-gap: var(--space-5);
    align-items: start;
}
@media (min-width: 1081px) {
    :is(.ds-asset-card-panel__summary, .ds-asset-card-panel__summary--form).ds-product-asset-grid {
        grid-template-columns: minmax(0, 1fr) 1px var(--ds-product-asset-code-col);
        column-gap: var(--ds-popup-columns-gap);
        row-gap: 0;
    }
    :is(.ds-asset-card-panel__summary, .ds-asset-card-panel__summary--form).ds-product-asset-grid .ds-add-product-form__column--fields,
    :is(.ds-asset-card-panel__summary, .ds-asset-card-panel__summary--form).ds-product-asset-grid .ds-add-product-form__column--code {
        padding-block: var(--ds-popup-columns-pad-y);
        padding-inline: 0;
    }
}
.ds-asset-card-panel__body:has(> .ds-product-asset-grid),
.ds-asset-card-panel__body:has(> .ds-add-product-form__content.ds-product-asset-grid) {
    padding: 0;
    gap: 0;
    overflow: hidden;
}
.ds-asset-card-panel__body > .ds-add-product-form__content.ds-product-asset-grid {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 1080px) {
    .ds-asset-card-panel__body > .ds-add-product-form__content.ds-product-asset-grid {
        overflow: visible;
        overflow-y: visible;
    }
}
.ds-add-product-form__column--fields .ds-asset-card-panel__details {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    width: 100%;
}
.ds-product-asset-grid .ds-add-product-form__column--code {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    align-self: start;
    position: static;
    top: auto;
}
@media (min-width: 1081px) {
    .ds-product-asset-grid .ds-add-product-form__column--code {
        grid-column: 3;
        grid-row: 1;
    }
}
.ds-asset-card-panel__body .ds-product-asset-grid .ds-add-product-form__column--code {
    position: static;
    top: auto;
}
.ds-add-product-form__column--code .ds-add-product-form__block--code,
.ds-add-product-form__column--code .prod-code-preview-wrap,
.ds-add-product-form__column--code .qr-preview-box,
.ds-add-product-form__column--code .prod-code-actions,
.ds-add-product-form__column--code .prod-code-download-actions {
    width: 100%;
    min-width: 0;
    max-width: none;
}
.ds-add-product-form__block--code .prod-code-actions {
    margin: 0;
    padding: 0;
}
.ds-add-product-form__column,
.ds-add-product-form__block,
.ds-add-product-form__fields-grid,
.ds-add-product-form .form-group.ds-add-product-form__field {
    overflow: visible;
}
.ds-add-product-form .schedule-date-step__picker,
.ds-add-product-form .custom-date-picker {
    overflow: visible;
}
.ds-add-product-form__columns {
    display: contents;
}
.ds-add-product-form__column {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    min-width: 0;
}
.ds-add-product-form__column--fields {
    grid-column: 1;
    grid-row: auto;
    gap: 0;
}
.ds-add-product-form__column-divider {
    display: none;
    grid-column: 2;
    grid-row: 1;
    width: 1px;
    min-width: 1px;
    background: var(--ds-border);
    align-self: stretch;
    justify-self: center;
    pointer-events: none;
}
/* Dwie kolumny w popupie — kreska + odstęp = inset kontenera (768+ dialog Dodaj zasób, 1081+ karta zasobu) */
@media (min-width: 768px) {
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__content.ds-product-asset-grid {
        grid-template-columns: minmax(0, 1fr) 1px minmax(168px, 200px);
        column-gap: var(--ds-popup-columns-gap);
        row-gap: 0;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__content.ds-product-asset-grid .ds-add-product-form__column-divider {
        display: block;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__content.ds-product-asset-grid .ds-add-product-form__column--fields,
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__content.ds-product-asset-grid .ds-add-product-form__column--code {
        padding-block: var(--ds-popup-columns-pad-y);
        padding-inline: 0;
    }
}
@media (min-width: 1081px) {
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__content.ds-product-asset-grid {
        grid-template-columns: minmax(0, 1fr) 1px var(--ds-product-asset-code-col);
    }
}
.ds-add-product-form__column--code {
    grid-column: 1;
    grid-row: auto;
    position: static;
    top: auto;
    align-self: start;
}
@media (min-width: 1081px) {
    .ds-add-product-form__column--fields {
        grid-row: 1;
    }
    .ds-product-asset-grid .ds-add-product-form__column-divider {
        display: block;
    }
    .ds-add-product-form__column--code {
        grid-column: 3;
        grid-row: 1;
        position: sticky;
        top: var(--ds-popup-columns-pad-y);
    }
}
.ds-add-product-form__section-divider {
    height: 0;
    margin: var(--ds-form-section-gap) 0;
    border: 0;
    border-top: 1px solid var(--ds-border);
}
/* Baner informacyjny — jasne żółte tło, żółty obrys, czarny tekst (label + wartość ta sama wielkość) */
.ds-hint-banner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--ds-hint-banner-border);
    border-radius: var(--radius-md);
    background: var(--ds-hint-banner-bg);
    box-sizing: border-box;
}
.ds-hint-banner__label,
.ds-hint-banner__value {
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.35;
    color: var(--ds-text);
}
.ds-hint-banner__value {
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}
.ds-hint-banner .material-symbols-outlined {
    flex-shrink: 0;
    font-size: var(--text-sm);
    line-height: 1;
    font-variation-settings: "opsz" 20, "wght" 500;
    color: var(--ds-info-icon-color);
}
.ds-add-product-form__category-link {
    align-self: flex-start;
    margin-top: 0;
}
.ds-add-product-form__field-aux {
    display: flex;
    align-items: flex-start;
    min-height: 22px;
    margin-top: var(--space-2);
}
.ds-add-product-form__field-aux--empty {
    visibility: hidden;
    pointer-events: none;
}
.ds-add-product-form__field-aux .btn-link {
    margin-top: 0;
}
.ds-add-product-form__category-link:hover {
    color: var(--ds-primary);
}
/* Etykieta pola + akcja pomocnicza w jednej linii (legacy — preferuj btn-link pod polem) */
.ds-field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    min-height: 0;
    margin-bottom: var(--space-2);
}
.ds-field-label-row > label {
    margin-bottom: 0;
    flex: 1 1 auto;
    min-width: 0;
}
.ds-add-product-form .product-field-error[hidden] {
    display: none !important;
}
.ds-add-product-form .form-group--invalid .product-field-error:not([hidden]) {
    color: var(--ds-danger);
    font-size: var(--ds-type-caption-size);
    font-weight: var(--ds-type-caption-weight);
    margin-top: var(--space-2);
    line-height: var(--ds-type-line-relaxed);
    display: block;
}
.ds-add-product-form__block {
    display: flex;
    flex-direction: column;
    gap: var(--ds-block-title-gap);
    min-width: 0;
}
.ds-add-product-form__block--code {
    gap: var(--ds-block-title-gap);
}
.ds-add-product-form__block-title {
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ds-text);
    min-height: var(--ds-add-product-block-title-h);
    display: flex;
    align-items: center;
    line-height: 1.25;
}
.ds-add-product-form__fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ds-form-grid-gap);
    align-items: start;
}
.ds-add-product-form__fields-grid > .ds-add-product-form__field--full {
    grid-column: 1 / -1;
}
.prod-code-input-row {
    display: flex;
    align-items: stretch;
    gap: var(--space-2);
    width: 100%;
}
.prod-code-input-row > input {
    flex: 1 1 auto;
    min-width: 0;
}
.prod-code-upload-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 132px;
    margin-top: 0;
    white-space: nowrap;
    border: var(--ds-btn-border-width) dashed var(--ds-btn-border-color);
    background: var(--ds-surface);
}
.prod-code-upload-btn:hover:not(:disabled) {
    background: var(--ds-surface-muted);
    border-color: var(--ds-btn-border-color-hover);
    border-style: dashed;
}
.prod-code-upload-btn:focus-visible {
    outline: none;
    border-color: var(--ds-btn-border-color-hover);
    box-shadow: var(--ds-focus-ring);
}
.ds-add-product-form__field--code-entry .form-hint {
    margin-top: var(--space-2);
}
.prod-code-preview-controls {
    width: 100%;
}
.prod-code-preview-controls[hidden] {
    display: none !important;
}
.prod-code-preview-controls--readonly {
    pointer-events: none;
    user-select: none;
}
.prod-code-preview-controls--readonly .prod-code-type__btn {
    cursor: default;
}
.ds-add-product-form__column--code .prod-code-type {
    display: flex;
    width: 100%;
    background: var(--ds-surface-muted);
}
.ds-add-product-form__column--code .prod-code-type__btn {
    flex: 1 1 0;
}
.ds-add-product-form__column--code .prod-code-type__btn.is-active {
    background: var(--ds-text);
    color: var(--ds-surface);
    box-shadow: none;
}
.ds-add-product-form__column--code .prod-code-type__btn.is-active .material-symbols-outlined {
    color: var(--ds-surface);
}
.prod-code-preview-wrap {
    position: relative;
    width: 100%;
    margin-inline: 0;
}
.qr-preview-box:has(.qr-preview-empty) {
    border-style: dashed;
    background: var(--ds-surface-muted);
    min-height: var(--ds-qr-preview-min-h);
}
.qr-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-5);
    text-align: center;
    font-size: var(--text-sm);
    line-height: 1.45;
    color: var(--ds-text-secondary);
}
.qr-preview-empty__icon {
    font-size: 40px;
    line-height: 1;
    color: var(--ds-info-icon-color);
}
.qr-preview-empty__text {
    max-width: 16em;
}
.ds-add-product-form__preview-label {
    font-size: var(--ds-type-label-size);
    font-weight: var(--ds-type-label-weight);
    color: var(--ds-text-secondary);
}
.ds-add-product-form__preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-2);
}
.ds-add-product-form__preview-head .ds-add-product-form__preview-label {
    margin-bottom: 0;
}
.prod-code-type {
    display: inline-flex;
    align-items: stretch;
    padding: max(var(--ds-field-isolation), 2px);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface-muted);
    gap: max(var(--ds-field-isolation), 2px);
    box-sizing: border-box;
}
.prod-code-type__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 30px;
    padding: 4px 10px;
    border: 0;
    border-radius: calc(var(--radius-sm) - 2px);
    background: transparent;
    color: var(--ds-text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    overflow: visible;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.prod-code-type__btn .material-symbols-outlined {
    font-size: 16px;
    line-height: 1;
}
.prod-code-type__btn:hover:not(.is-active) {
    color: var(--ds-text);
    background: color-mix(in srgb, var(--ds-surface) 80%, transparent);
}
.prod-code-type__btn.is-active {
    background: var(--ds-surface);
    color: var(--ds-text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.prod-code-type__btn:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--ds-primary);
}
.prod-code-type[hidden] {
    display: none !important;
}
.prod-code-type--fluid {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}
.prod-code-type--fluid .prod-code-type__btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: calc(var(--ds-control-h) - 4px);
    padding: 8px 12px;
    font-size: var(--text-sm);
}
.prod-code-type--fluid .prod-code-type__btn[hidden] {
    display: none;
}
.ds-add-product-form__field-foot {
    display: flex;
    justify-content: flex-start;
    margin-top: var(--space-3);
    padding-top: 0;
}
.ds-add-product-form__field-foot .prod-code-upload-btn {
    margin-top: 0;
}
.btn-link .material-symbols-outlined {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    transition: color var(--ds-motion-fast);
}
.btn-link__text {
    line-height: inherit;
}
.btn-link--sm {
    font-size: var(--text-xs);
    font-weight: 500;
    gap: 3px;
}
.btn-link--sm .material-symbols-outlined {
    font-size: 14px;
}
.prod-code-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
}
.prod-code-download-actions {
    display: flex;
    align-items: stretch;
    gap: var(--space-2);
    width: 100%;
}
.prod-code-download-actions[hidden] {
    display: none !important;
}
.prod-code-download-btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: 44px;
    min-height: 44px;
    justify-content: center;
    gap: var(--space-2);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    color: var(--ds-text);
    box-shadow: none;
    transform: none;
}
.prod-code-download-btn:hover {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
    box-shadow: none;
    transform: none;
}
.prod-code-download-btn:active {
    background: var(--ds-surface-hover);
    box-shadow: none;
    transform: none;
}
.prod-code-download-btn:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--ds-primary);
}
.prod-code-download-btn .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
    color: inherit;
}
.prod-code-reset-btn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    z-index: 2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.prod-code-reset-btn .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}
.prod-code-reset-btn:hover {
    background: var(--ds-surface-muted);
    color: var(--ds-text);
    border-color: var(--ds-border-strong);
}
.prod-code-reset-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--ds-primary);
}
.prod-code-reset-btn[hidden] {
    display: none !important;
}
.qr-preview-box {
    position: relative;
    width: 100%;
    min-height: var(--ds-qr-preview-min-h);
    height: auto;
    max-width: none;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ds-qr-preview-pad);
    box-sizing: border-box;
}
.qr-preview-box:has(.product-code-qr),
.qr-preview-box:has(.product-code-barcode),
.qr-preview-box:has(.product-code-image) {
    min-height: var(--ds-qr-preview-min-h);
    height: auto;
}
.qr-preview-box img,
.qr-preview-box svg,
.qr-preview-box canvas,
.qr-preview-box .product-code-qr__graphic canvas,
.qr-preview-box .product-code-qr__graphic img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}
.qr-preview-box .product-code-qr,
.qr-preview-box .product-code-barcode,
.qr-preview-box .product-code-image {
    width: 100%;
    max-width: 100%;
}
#product-card-qr-preview .product-code-qr__graphic canvas,
#product-card-qr-preview .product-code-qr__graphic img,
#product-card-qr-preview img,
#product-card-qr-preview svg,
#meas-card-qr-preview .product-code-qr__graphic canvas,
#meas-card-qr-preview .product-code-qr__graphic img,
#meas-card-qr-preview img,
#meas-card-qr-preview svg {
    max-width: 100%;
    height: auto;
}
.ds-add-product-form__section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
}
.ds-add-product-form .form-group:has(> .custom-select),
.ds-add-product-form .custom-select {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
}
.ds-add-product-form .custom-select-trigger {
    width: 100%;
    min-width: 0;
}
.ds-add-product-form .schedule-date-step__picker,
.ds-add-product-form .schedule-date-step__picker .custom-date-picker {
    width: 100%;
}
.ds-add-product-form .schedule-date-step__input {
    text-align: left;
    padding-right: 44px;
    padding-left: var(--space-4);
}
.btn-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-2);
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ds-text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--ds-motion-fast), background var(--ds-motion-fast), text-decoration-color var(--ds-motion-fast);
}
.btn-link:hover {
    color: var(--ds-text);
    background: transparent;
    text-decoration: none;
}
.btn-link:hover .btn-link__text {
    text-decoration: none;
}
.btn-link:hover .material-symbols-outlined {
    color: inherit;
}
.btn-link:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--ds-primary);
    border-radius: var(--radius-xs);
}
.product-code-block {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-lg);
    align-items: start;
}
.product-code-block__fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    min-width: 0;
}
.qr-preview-panel { text-align: center; }
.product-code-image {
    display: block;
    max-width: 100%;
    max-height: 124px;
    object-fit: contain;
}
.product-code-barcode {
    width: 100%;
    height: auto;
}
.product-code-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    max-width: 100%;
    min-height: 0;
}
.product-code-qr__graphic {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    width: 100%;
    max-width: 100%;
    min-height: 0;
}
.product-code-qr__graphic canvas,
.product-code-qr__graphic img {
    display: block;
    max-width: 100%;
    width: auto !important;
    height: auto !important;
}
.product-code-qr__value {
    flex: 0 0 auto;
    max-width: 100%;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 600;
    font-variant-numeric: var(--ds-font-numeric);
    color: var(--ds-text);
    text-align: center;
    line-height: 1.25;
    word-break: break-all;
    padding: 0 var(--space-1);
}

.field-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 4px;
}
.input-locked {
    background: var(--surface-muted) !important;
    color: var(--text-muted);
    cursor: not-allowed;
}
.ds-add-product-form__section {
    padding-top: var(--space-5);
    border-top: 1px solid var(--ds-border);
}
.ds-add-product-form__section-title {
    margin: 0 0 var(--space-4);
    font-size: var(--text-md);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ds-text);
}
.ds-add-product-form__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-5);
    border-top: 1px solid var(--ds-border);
    flex-shrink: 0;
}
.ds-add-product-form__actions .schedule-panel__count {
    margin-right: auto;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text-secondary);
}
.ds-add-product-form__actions .btn-ghost {
    background: transparent;
    border-color: transparent;
}
.ds-add-product-form__actions .btn-ghost:hover {
    background: var(--ds-surface-muted);
    color: var(--ds-text);
}
.ds-add-product-form__actions .btn-ghost:active {
    background: var(--ds-surface-hover);
}
@media (max-width: 767px) {
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column {
        overflow: visible;
        max-height: none;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column--fields,
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column--code {
        max-height: none;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__content {
        overflow: visible;
        max-height: none;
    }
    .ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__body--scroll-host > .ds-scroll-lane {
        padding: 0;
    }
    .ds-add-product-form__content.ds-product-asset-grid {
        padding: var(--ds-popup-inset);
    }
    .ds-add-product-form__content:not(.ds-product-asset-grid) {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: var(--space-5);
        padding: 0;
    }
    .ds-add-product-form__column {
        gap: var(--space-5);
    }
    .ds-add-product-form__column-divider {
        display: none;
    }
    .ds-add-product-form__column--fields {
        grid-column: 1;
        grid-row: 1;
        gap: 0;
    }
    .ds-add-product-form__column--code {
        grid-column: 1;
        grid-row: 2;
        position: static;
        padding-top: 0;
        border-top: none;
    }
    /* Separator przed kolumną kodu — ten sam rytm co między sekcjami */
    .ds-add-product-form__column--code::before {
        content: "";
        display: block;
        border-top: 1px solid var(--ds-border);
        margin-bottom: var(--space-4);
    }
    .ds-add-product-form__fields-grid {
        grid-template-columns: 1fr;
    }
    .prod-code-input-row {
        flex-direction: column;
    }
    .prod-code-upload-btn {
        width: 100%;
        min-width: 0;
    }
    .ds-add-product-form__actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .ds-add-product-form__actions .btn {
        width: 100%;
    }
}

/* Widoki pulpitu z listami (planowanie, kreator raportu) */
.ds-add-product-layout--flow {
    display: flex;
    flex-direction: column;
    min-height: min(100%, calc(100dvh - 120px));
}
.ds-add-product-form__panel--flow {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ds-form-panel__content--flow {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    grid-template-columns: 1fr !important;
    overflow: hidden;
}
.ds-form-panel__content--flow .report-wizard-toolbar {
    flex-shrink: 0;
    padding: var(--space-4) var(--space-5) 0;
}
.ds-form-panel__content--flow .report-wizard-grid {
    flex: 1;
    min-height: 0;
    padding: var(--space-4) var(--space-5);
}
.ds-form-panel__content--flow .view-toolbar--panel {
    flex-shrink: 0;
}
.ds-flow-panel__inset {
    flex: 1;
    min-height: 0;
    margin: 0 var(--space-5) var(--space-4);
}
@media (min-width: 1081px) {
    .ds-add-product-view:has(.ds-add-product-layout--flow) {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    .ds-add-product-view:has(.ds-add-product-layout--flow) .dashboard-scroll {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
        align-items: stretch;
    }
    .ds-add-product-view:has(.ds-add-product-layout--flow) .ds-add-product-layout--flow {
        flex: 1;
        min-height: 0;
        max-width: 980px;
        width: 100%;
        margin: 0 auto;
    }
}

/* Wizard intro — planowanie pomiaru, nowy raport (krok 1): panel wyśrodkowany na pulpicie */
.ds-schedule-date-view {
    flex: 1;
    min-height: 0;
}
.ds-schedule-date-view .dashboard-scroll {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    justify-content: center;
    align-items: center;
}
.ds-add-product-layout--schedule-date {
    width: min(100%, 400px);
    max-width: 400px;
    margin: 0;
    flex-shrink: 0;
}
.ds-schedule-date-view .ds-add-product-form__panel {
    height: auto;
}
.ds-form-panel__content--schedule-date {
    --ds-wizard-intro-pad-top: calc(var(--ds-inset-y) + var(--space-4));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--ds-wizard-intro-pad-top) var(--ds-inset-x) var(--ds-inset-y) !important;
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
}
.ds-schedule-date-view .schedule-date-step {
    width: min(100%, 320px);
}
.ds-schedule-date-view .schedule-date-step__input:not(.schedule-date-step__input--text) {
    text-align: center;
    padding-left: 44px;
}

.audit-summary-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface-muted);
    box-sizing: border-box;
}
.audit-summary-stats__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin: 0;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
}
.audit-summary-stats__row strong {
    color: var(--ds-text);
    font-weight: 600;
}

.slide-panel__header-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}
.slide-panel__header-meta {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ds-text-secondary);
    line-height: 1.35;
}

/* Planowanie pomiaru — krok 2: stopka karty (jedyny dodatek vs ewidencja) */
.ds-card__footer--schedule {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}
.ds-card__footer--schedule .schedule-panel__count {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text-secondary);
    flex: 1 1 auto;
    min-width: 0;
}
.ds-card__footer--schedule .btn {
    flex: 0 0 auto;
    width: auto;
}

/* Form panel — wspólny układ (slide-panel, kreator raportu, …) */
.slide-panel__drawer--form-panel {
    width: min(720px, 100%);
    max-width: 100%;
    padding: var(--space-4);
    background: var(--ds-surface-muted);
    border-left: none;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.1);
}
.slide-panel__drawer--form-panel.slide-panel__drawer--xl {
    width: min(880px, 100%);
    max-width: 100%;
}
.slide-panel__drawer--form-panel .ds-add-product-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
}
.slide-panel__drawer--form-panel .ds-add-product-form__panel {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.slide-panel__drawer--form-panel .ds-add-product-form__content {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.ds-form-panel__content--single {
    grid-template-columns: 1fr !important;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.ds-form-panel__content--wizard {
    display: flex;
    flex-direction: column;
    padding: var(--space-5) !important;
    gap: 0;
    overflow: hidden;
}
.ds-form-panel__content--wizard > .schedule-step {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: none;
    flex-direction: column;
}
.ds-form-panel__content--wizard > .schedule-step.is-active,
.ds-form-panel__content--wizard > .schedule-step:not([hidden]) {
    display: flex;
}
.ds-form-panel__content--wizard .schedule-step--date {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
}
.ds-form-panel__content--wizard .schedule-step--products {
    padding: 0;
    gap: var(--space-4);
}
.schedule-panel__footer-step {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--space-3);
    width: 100%;
}
.schedule-panel__footer-step[hidden] {
    display: none !important;
}
.schedule-panel__footer-step .schedule-panel__count {
    margin-right: auto;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
}
.report-wizard-view {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.report-wizard-view.is-hidden {
    display: none !important;
}
.report-wizard-view .ds-add-product-layout {
    flex: 1;
    min-height: 0;
    max-width: 980px;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-4) var(--space-4);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
#view-reports {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#view-reports > .entity-view-scroll > .ds-page-header,
#view-reports > #report-wizard-view {
    flex-shrink: 0;
}
#view-reports > .entity-view-scroll > #reports-list-view {
    flex: 1 1 0;
    min-height: 0;
}
#view-reports > #report-wizard-view:not(.is-hidden) {
    flex: 1;
    min-height: 0;
}
.report-wizard-view .ds-add-product-form__panel {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#view-reports > .ds-page-header.is-hidden {
    display: none !important;
}

.ds-add-product-form .form-group.ds-add-product-form__field {
    overflow: visible;
}
.ds-add-product-form #prodCategoryCustom,
.ds-add-product-form #prodLocationCustom {
    position: relative;
    z-index: auto;
}
.ds-add-product-form #prodCategoryCustom.open,
.ds-add-product-form #prodLocationCustom.open {
    z-index: 110;
}
.ds-add-product-form .schedule-date-step__picker {
    position: relative;
    z-index: 1;
}
.ds-add-product-form .schedule-date-step__picker:has(.custom-calendar-popup.open) {
    z-index: 120;
}
#prod-calendar-month-year.custom-cal-month-label {
    font-size: var(--text-sm);
    font-weight: 700;
}

.topbar-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.topbar-avatar-img[hidden] {
    display: none !important;
}

/* FONT LOCK przeniesiony → body#esd-app w index.html + style.css */

/* ── Klasyfikacje ── */
.settings-about {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
    line-height: var(--leading-normal);
}
.settings-about__line {
    margin: 0;
}
.settings-about__line strong {
    color: var(--ds-text);
    font-weight: 600;
}
.settings-about__sep {
    margin: 0 0.35em;
    color: var(--ds-border-strong);
}
.settings-about__link {
    align-self: flex-start;
    margin-top: var(--space-1);
    padding-left: 0;
}
.classif-shell {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    flex: 1;
    min-height: 0;
}
.classif-tabs-track {
    width: 100%;
    min-width: 0;
}
.classif-tabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--space-2);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.classif-tabs::-webkit-scrollbar {
    display: none;
}
.classif-tabs__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    flex: 0 0 auto;
    width: fit-content;
    min-width: fit-content;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
    scroll-snap-align: start;
    cursor: pointer;
    transition: background var(--ds-motion-fast), border-color var(--ds-motion-fast), color var(--ds-motion-fast);
}
.classif-tabs__item .material-symbols-outlined {
    font-size: 18px;
}
.classif-tabs__item:hover:not(.classif-tabs__item--active) {
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
}
.classif-tabs__item--active {
    background: var(--ds-primary);
    border-color: var(--ds-primary);
    color: #fff;
    font-weight: 600;
    transition: background var(--ds-motion-fast), border-color var(--ds-motion-fast), color var(--ds-motion-fast), transform var(--ds-motion-fast) var(--ds-ease-out), box-shadow var(--ds-motion-fast);
}
.classif-tabs__item--active:hover {
    background: var(--ds-primary);
    border-color: var(--ds-primary-active);
    border-width: 2px;
    color: #fff;
    transform: none;
    box-shadow: none;
}
.classif-tabs__item--active,
.classif-tabs__item--active:hover {
    color: #fff;
}
.classif-tabs__item--active .material-symbols-outlined,
.classif-tabs__item--active:hover .material-symbols-outlined {
    color: #fff;
}
html[data-theme="dark"] .classif-tabs__item--active,
html[data-theme="dark"] .classif-tabs__item--active:hover {
    color: #1a1a1a;
}
html[data-theme="dark"] .classif-tabs__item--active .material-symbols-outlined,
html[data-theme="dark"] .classif-tabs__item--active:hover .material-symbols-outlined {
    color: #1a1a1a;
}
/* DS: aktywny chip z lekkim uniesieniem na hover */
.ds-chip--active,
.btn-chip--active {
    transition: background var(--ds-motion-fast), border-color var(--ds-motion-fast), color var(--ds-motion-fast), transform var(--ds-motion-fast) var(--ds-ease-out), box-shadow var(--ds-motion-fast);
}
.ds-chip--active:hover,
.btn-chip--active:hover {
    transform: none;
    box-shadow: none;
}
.chart-type-btn.active:hover {
    background: var(--ds-surface);
    color: var(--ds-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), inset 0 0 0 1px var(--ds-text);
}
.cal-view-toggle__btn.active:hover {
    background: var(--ds-surface);
    color: var(--ds-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), inset 0 0 0 1px var(--ds-text);
}
.classif-panel > .classif-toolbar.view-toolbar--panel {
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-bg);
}
.classif-panel > .classif-toolbar .view-toolbar__row,
.classif-panel > .classif-toolbar .classif-toolbar__row {
    padding: var(--space-4) var(--space-5);
    box-sizing: border-box;
}
.classif-toolbar__row {
    align-items: stretch;
    gap: var(--space-3);
}
@media (max-width: 768px) {
    .classif-toolbar .classif-toolbar__row {
        flex-direction: column;
    }
}
@media (min-width: 769px) {
    .classif-toolbar .classif-toolbar__row {
        flex-direction: row;
        align-items: center;
    }
    .classif-toolbar__search-wrap {
        flex: 0 1 44%;
        max-width: 44%;
    }
    .classif-toolbar__footer {
        flex: 1;
        justify-content: flex-end;
    }
}
.classif-toolbar__search-wrap {
    width: 100%;
    min-width: 0;
}
.classif-toolbar__search-wrap .view-toolbar__search {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.classif-toolbar__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;
    min-width: 0;
}
.classif-toolbar__footer--add-only {
    justify-content: flex-end;
}
.classif-toolbar__footer--add-only .classif-toolbar__add {
    margin-left: 0;
}
@media (max-width: 768px) {
    .classif-toolbar__footer--add-only {
        justify-content: stretch;
    }
    .classif-toolbar__footer--add-only .classif-toolbar__add {
        width: 100%;
    }
}
.classif-sort-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface);
    font-family: var(--font-ui);
    cursor: pointer;
    transition: border-color var(--ds-motion-fast), background var(--ds-motion-fast);
}
.classif-sort-toggle:hover {
    border-color: var(--ds-border-strong);
    background: var(--ds-surface-muted);
}
.classif-sort-toggle__letters {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    line-height: 1;
    min-width: 12px;
}
.classif-sort-toggle__letter {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ds-text-tertiary);
    line-height: 1.15;
}
.classif-sort-toggle--asc .classif-sort-toggle__letter--top,
.classif-sort-toggle--desc .classif-sort-toggle__letter--bottom {
    color: var(--ds-text);
}
.classif-sort-toggle__swap {
    font-size: 22px;
    color: var(--ds-text-secondary);
    line-height: 1;
    transition: transform var(--ds-motion-fast), color var(--ds-motion-fast);
}
.classif-sort-toggle--desc .classif-sort-toggle__swap {
    transform: scaleY(-1);
    color: var(--ds-text);
}
.classif-toolbar__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    padding: 0 18px 0 14px;
    font-weight: 700;
    text-align: center;
}
.classif-toolbar__add .material-symbols-outlined {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 18px;
}
@media (max-width: 480px) {
    .classif-toolbar__footer {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-2);
    }
    .classif-sort-toggle {
        flex-shrink: 0;
    }
    .classif-toolbar__add {
        width: fit-content;
        margin-left: auto;
    }
}
@media (max-width: 768px) {
    .classif-shell {
        gap: var(--space-3);
    }
    .classif-tabs-track {
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        padding: 0 0 var(--space-2);
        box-sizing: border-box;
    }
    .classif-tabs {
        width: 100%;
        box-sizing: border-box;
        padding-left: var(--ds-dashboard-shell-pad-x);
        padding-right: var(--space-2);
        scroll-padding-inline: var(--ds-dashboard-shell-pad-x);
    }
    .classif-panel > .classif-toolbar .view-toolbar__row {
        padding: var(--space-4) var(--space-5);
    }
    .classif-row {
        align-items: flex-start;
        gap: var(--space-2);
        padding: var(--space-3) var(--space-2) var(--space-3) var(--space-5);
    }
    .classif-row__actions {
        flex-shrink: 0;
        margin-left: auto;
    }
}
.classif-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.classif-panel__body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.classif-panel__body > .ds-content-inset {
    flex: 1;
    min-height: 0;
}
.classif-list-host {
    min-height: 12rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.classif-list-host:has(> .classif-empty) {
    min-height: min(280px, 45vh);
    justify-content: center;
    align-items: center;
}
.classif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    padding: var(--space-8) var(--space-4);
    color: var(--ds-text-secondary);
    box-sizing: border-box;
}
.classif-list {
    display: flex;
    flex-direction: column;
}
.classif-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-2) var(--space-3) var(--ds-card-inset-x);
    border-bottom: 1px solid var(--ds-border);
}
.classif-row:last-child {
    border-bottom: none;
}
.classif-row__main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.classif-row__name {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--ds-text);
    word-break: break-word;
}
.classif-row__meta {
    font-size: var(--text-xs);
    color: var(--ds-text-tertiary);
}
.classif-row__actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-shrink: 0;
}
.classif-row__btn .material-symbols-outlined {
    font-size: 18px;
}
.classif-row__btn--danger {
    color: var(--ds-danger, #dc2626);
}
.classif-empty__icon {
    font-size: 40px;
    opacity: 0.45;
    margin-bottom: var(--space-3);
}
.classif-empty__title {
    margin: 0 0 var(--space-1);
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--ds-text);
}
.classif-empty__text {
    margin: 0;
    font-size: var(--text-sm);
    max-width: 28rem;
}

@media (max-width: 480px) {
    .classif-tabs__item {
        padding: 7px 12px;
        font-size: var(--text-xs);
    }
    .classif-tabs__item .material-symbols-outlined {
        font-size: 16px;
    }
    .classif-row__btn .material-symbols-outlined {
        font-size: 16px;
    }
}

/* ── Modal kompaktowy (prompt) ── */
.modal-content--compact {
    width: min(100%, 360px);
    padding: var(--space-5);
    overflow: visible;
}
.modal-content--compact .modal-header {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
}
.modal-header--no-close {
    justify-content: center;
    text-align: center;
}
.modal-header--no-close h2 {
    margin: 0;
    width: 100%;
}
.modal-content--compact .form-group {
    margin-bottom: var(--space-4);
}
.modal-content--compact .form-group input {
    width: 100%;
    height: var(--ds-control-h);
    min-height: var(--ds-control-h);
    line-height: var(--ds-control-h);
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text);
    font-family: var(--font-ui);
    font-size: var(--ds-type-input-size);
    font-weight: var(--ds-type-input-weight);
    box-sizing: border-box;
}
.modal-content--compact .form-group input:focus {
    outline: none;
    border-color: var(--ds-brand-cta);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ds-brand-cta) 20%, transparent);
}
.modal-content--compact .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

/* ── Modal potwierdzenia (customConfirm) ── */
.modal-content.modal-content--compact.modal-content--confirm {
    padding: var(--space-8) var(--space-6) var(--space-6);
}
.modal-content--confirm {
    position: relative;
    text-align: center;
}
.modal-content--confirm__body {
    padding: 0;
}
.modal-content--confirm__title {
    margin: 0 0 var(--space-3);
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: var(--leading-tight);
    color: var(--ds-text);
    text-align: center;
}
.modal-content--confirm .modal-confirm-message {
    margin: 0 0 var(--space-6);
    text-align: center;
}
.modal-content--confirm .modal-actions--split {
    margin-top: 0;
    padding-top: var(--space-2);
}
.modal-content--confirm .modal-actions--split .btn-primary.btn--danger:hover:not(:disabled) {
    background: var(--ds-danger);
    border-color: var(--ds-danger);
    color: #fff;
}
.modal-content--confirm .modal-actions--split .btn-primary.btn--danger:active:not(:disabled) {
    background: color-mix(in srgb, var(--ds-danger) 88%, #000);
    border-color: color-mix(in srgb, var(--ds-danger) 88%, #000);
    color: #fff;
}
.modal-content--confirm .modal-actions--split .btn-primary.btn--danger:focus-visible {
    box-shadow: inset 0 0 0 2px var(--ds-danger);
}
.modal-actions--split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    width: 100%;
}
.modal-actions--split .btn {
    width: 100%;
    justify-content: center;
}

/* ── ds-dialog — centrowany overlay ── */
.ds-dialog {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2100;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    box-sizing: border-box;
    pointer-events: none;
    visibility: hidden;
}
.ds-dialog.show,
.ds-dialog.is-closing {
    display: flex;
    visibility: visible;
}
.ds-dialog.show { pointer-events: auto; }
.ds-dialog.is-closing { pointer-events: none; }
.ds-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.ds-dialog.show .ds-dialog__backdrop { opacity: 1; }
.ds-dialog.is-closing .ds-dialog__backdrop { opacity: 0; }
.ds-dialog__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, var(--ds-dialog-w, 520px));
    max-width: 100%;
    max-height: min(90dvh, calc(100dvh - 2 * var(--space-4)));
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    box-sizing: border-box;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.97) translateY(10px);
    transition:
        opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.ds-dialog.show .ds-dialog__panel {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.ds-dialog.is-closing .ds-dialog__panel {
    opacity: 0;
    transform: scale(0.98) translateY(6px);
    transition-duration: 0.22s;
}
.ds-dialog--sm { --ds-dialog-w: 400px; }
.ds-dialog--md { --ds-dialog-w: 520px; }
.ds-dialog--lg { --ds-dialog-w: 720px; }
.ds-dialog--xl { --ds-dialog-w: 920px; }
.ds-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-shrink: 0;
    min-height: var(--ds-panel-chrome-header-min-h);
    padding: var(--ds-popup-header-pad-y) var(--ds-popup-inset);
    border-bottom: 1px solid var(--ds-border);
    box-sizing: border-box;
}
.ds-dialog__header-main { flex: 1; min-width: 0; }
.ds-dialog__title {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--ds-text);
}
.ds-dialog__meta,
.ds-dialog__eyebrow {
    margin: var(--space-1) 0 0;
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--ds-text-secondary);
}
.ds-dialog__eyebrow {
    font-size: var(--text-2xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--ds-text-tertiary);
}
.ds-dialog__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: var(--ds-popup-inset);
    box-sizing: border-box;
}
.ds-dialog__body--scroll-host {
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.ds-dialog__body--scroll-host > .ds-scroll-lane:not(:has(.ds-product-asset-grid)) {
    padding: var(--ds-popup-inset);
    box-sizing: border-box;
}
.ds-dialog__body--scroll-host > .ds-scroll-lane:has(.ds-product-asset-grid) {
    padding: 0;
}
.ds-dialog__body--scroll-host .ds-scroll-rail {
    min-height: 0;
}
.ds-dialog__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--space-2);
    flex-shrink: 0;
    padding: var(--ds-popup-inset);
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface);
    box-sizing: border-box;
}
.ds-dialog__footer--split { justify-content: space-between; }
.ds-dialog__footer-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.ds-dialog__footer .btn .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}
body.ds-dialog-open { overflow: hidden; }

/* Zamknij (×) w nagłówku dialogu — ten sam rytm co w kartach */
.ds-dialog__header > .icon-btn.icon-btn--ghost {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--ds-text-tertiary);
    flex-shrink: 0;
    border-radius: var(--radius-sm);
}
.ds-dialog__header > .icon-btn.icon-btn--ghost:hover {
    background: var(--ds-surface-muted);
    border: none;
    color: var(--ds-text);
    transform: none;
}
.ds-dialog__header > .icon-btn.icon-btn--ghost .material-symbols-outlined {
    font-size: 20px;
    line-height: 1;
}
.ds-dialog__header > .icon-btn.icon-btn--ghost:hover .material-symbols-outlined,
.ds-dialog__header > .icon-btn.icon-btn--ghost:focus-visible .material-symbols-outlined,
.ds-dialog__header > .icon-btn.icon-btn--ghost:active .material-symbols-outlined {
    transform: none;
}

.ds-dialog-form.ds-add-product-form {
    --ds-add-product-block-title-h: 28px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
/* Dialog Dodaj zasób — scroll-lane bez insetu (jeden padding na .ds-product-asset-grid) */
.ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__body--scroll-host > .ds-scroll-lane {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    box-sizing: border-box;
}
.ds-dialog-form.ds-add-product-form .ds-add-product-form__content.ds-product-asset-grid {
    row-gap: 0;
}
/* Karta zasobu — gap kolumn jak inset (padding wyłącznie na .ds-product-asset-grid) */
.ds-asset-card-panel__body > .ds-product-asset-grid,
.ds-asset-card-panel__body > .ds-add-product-form__content.ds-product-asset-grid {
    row-gap: 0;
}
#modal-product-details .ds-product-asset-grid .ds-add-product-form__column--fields,
#modal-perform-measurement .meas-wizard-screen--details .ds-product-asset-grid .ds-add-product-form__column--fields,
#modal-product-details .ds-product-asset-grid .ds-add-product-form__column--code,
#modal-perform-measurement .meas-wizard-screen--details .ds-product-asset-grid .ds-add-product-form__column--code {
    box-sizing: border-box;
}
@media (max-width: 1080px) {
    .ds-asset-card-panel__body > .ds-product-asset-grid,
    .ds-asset-card-panel__body > .ds-add-product-form__content.ds-product-asset-grid {
        row-gap: var(--space-5);
    }
}
.ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__body--scroll-host .ds-scroll-rail {
    flex: 1 1 auto;
    min-height: 0;
}
.ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__body--scroll-host .ds-scroll-rail__body {
    min-height: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__body--scroll-host .ds-scroll-rail__body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.ds-dialog-form.ds-add-product-form .ds-inset-scroll--host:has(.ds-scroll-rail) > .ds-scroll-lane {
    padding: 0;
}
.ds-dialog-form.ds-add-product-form .ds-scroll-rail__body,
.ds-dialog-form.ds-add-product-form .ds-scroll-lane,
.ds-dialog-form.ds-add-product-form .ds-scroll-lane__inset,
.ds-dialog-form.ds-add-product-form .ds-add-product-form__columns,
.ds-dialog-form.ds-add-product-form .ds-add-product-form__column {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.ds-dialog-form.ds-add-product-form .form-group.ds-add-product-form__field {
    margin-bottom: 0;
    width: 100%;
    max-width: none;
}
.ds-dialog-form.ds-add-product-form .form-group:has(> .custom-select) {
    width: 100%;
    max-width: none;
    align-self: stretch;
}
.ds-dialog-form.ds-add-product-form .form-group:has(> .custom-select),
.ds-dialog-form.ds-add-product-form .custom-select {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
}
.ds-dialog-form.ds-add-product-form #prodCategoryCustom,
.ds-dialog-form.ds-add-product-form #prodLocationCustom {
    width: 100%;
    max-width: none;
}
.ds-dialog-form.ds-add-product-form .custom-select-trigger {
    width: 100%;
    min-width: 0;
    max-width: none;
}
.ds-dialog-form.ds-add-product-form .schedule-date-step__picker,
.ds-dialog-form.ds-add-product-form .custom-date-picker,
.ds-dialog-form.ds-add-product-form .prod-code-input-row,
.ds-dialog-form.ds-add-product-form .prod-code-input-row > input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.ds-dialog-form.ds-add-product-form .ds-add-product-form__content {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    align-items: stretch;
}
.ds-dialog-form.ds-add-product-form .ds-add-product-form__fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-4);
    row-gap: var(--space-6);
    align-items: start;
}
.ds-dialog-form.ds-add-product-form .ds-add-product-form__field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    width: 100%;
    margin-bottom: 0;
}
.ds-dialog-form.ds-add-product-form .ds-add-product-form__field > label {
    margin-bottom: var(--space-2);
    flex-shrink: 0;
}
.ds-dialog-form.ds-add-product-form .ds-add-product-form__field > .custom-select,
.ds-dialog-form.ds-add-product-form .ds-add-product-form__field > .schedule-date-step__picker,
.ds-dialog-form.ds-add-product-form .ds-add-product-form__field > .custom-date-picker,
.ds-dialog-form.ds-add-product-form .ds-add-product-form__field > input:not([type="hidden"]) {
    flex: 0 0 auto;
    width: 100%;
}
.ds-dialog-form.ds-add-product-form .ds-add-product-form__field-aux {
    flex: 0 0 auto;
    width: 100%;
}
.ds-dialog-form.ds-add-product-form .ds-add-product-form__column--fields,
.ds-dialog-form.ds-add-product-form .ds-add-product-form__column--code {
    align-self: stretch;
}
.ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: 0;
}
.ds-dialog-form.ds-add-product-form .ds-add-product-form__column {
    min-height: 0;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
}
.ds-dialog-form.ds-add-product-form .ds-add-product-form__column-divider {
    align-self: stretch;
}
.ds-dialog-form.ds-add-product-form .ds-form-panel__content--single {
    padding: 0 !important;
}

/* Mobile — dialog Dodaj zasób: jeden scroll, jeden inset 16px, pola i stopka w kolumnie */
@media (max-width: 767px) {
    .ds-dialog-form.ds-add-product-form {
        flex: 1 1 auto;
        min-height: 0;
        overflow: visible;
    }
    .ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__body {
        overflow: hidden;
        padding: 0;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__content {
        display: flex;
        flex-direction: column;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        height: auto;
        overflow: visible;
        column-gap: 0;
        row-gap: var(--space-5);
        align-items: stretch;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__content.ds-product-asset-grid {
        padding: var(--ds-popup-inset);
        column-gap: 0;
        row-gap: 0;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column {
        flex: 0 0 auto;
        min-height: 0;
        max-height: none;
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column--fields {
        gap: 0;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column--code {
        position: static;
        top: auto;
        align-self: stretch;
        padding-top: 0;
        border-top: none;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column--code::before {
        content: "";
        display: block;
        border-top: 1px solid var(--ds-border);
        margin-bottom: var(--space-4);
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column-divider {
        display: none;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column {
        flex: 0 0 auto;
        padding: 0;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__fields-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-6);
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__fields-grid > .ds-add-product-form__field {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
    }
    .ds-dialog-form.ds-add-product-form .prod-code-input-row {
        flex-direction: column;
    }
    .ds-dialog-form.ds-add-product-form .prod-code-upload-btn {
        width: 100%;
        min-width: 0;
    }
    .ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__footer {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: var(--space-3);
    }
    .ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Tablet — dialog Dodaj zasób: 2 kolumny (węższa kolumna kodu), jeden scroll */
@media (min-width: 768px) and (max-width: 1080px) {
    .ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) {
        --ds-dialog-w: min(100%, 760px);
    }
    .ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__panel {
        transition:
            opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
            transform 0.44s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .ds-dialog--xl.is-closing:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__panel,
    .ds-dialog.is-closing.ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__panel {
        transition-duration: 0.34s;
    }
    .ds-dialog-form.ds-add-product-form {
        flex: 1 1 auto;
        min-height: 0;
        overflow: visible;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__content {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 1px minmax(168px, 200px);
        grid-template-rows: minmax(0, 1fr);
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        height: auto;
        overflow: visible;
        column-gap: var(--ds-popup-inset);
        row-gap: 0;
        align-items: stretch;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__content.ds-product-asset-grid {
        padding: var(--ds-popup-inset);
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__content.ds-product-asset-grid .ds-add-product-form__column--fields,
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__content.ds-product-asset-grid .ds-add-product-form__column--code {
        padding-block: var(--space-4);
        padding-inline: 0;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column {
        overflow: visible;
        max-height: none;
        height: auto;
        min-height: 0;
        align-self: stretch;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column--fields {
        grid-column: 1;
        grid-row: 1;
        gap: 0;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column-divider {
        display: block;
        grid-column: 2;
        grid-row: 1;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column--code {
        grid-column: 3;
        grid-row: 1;
        position: static;
        top: auto;
        align-self: stretch;
        padding-top: 0;
        border-top: none;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__column--code::before {
        display: none;
    }
    .ds-dialog--xl:has(.ds-dialog-form.ds-add-product-form) .ds-dialog__body {
        overflow: hidden;
        padding: 0;
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__fields-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-6);
    }
    .ds-dialog-form.ds-add-product-form .ds-add-product-form__fields-grid > .ds-add-product-form__field {
        grid-column: 1 / -1;
    }
    .ds-dialog-form.ds-add-product-form .qr-preview-box:has(.qr-preview-empty) {
        min-height: 160px;
    }
}

.ds-dialog--xl .ds-asset-card-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
.ds-dialog--xl .ds-dialog__body:has(> .ds-asset-card-panel) {
    padding: 0;
    display: flex;
    flex-direction: column;
}
.ds-dialog--xl .ds-asset-card-panel__body {
    flex: 1;
    min-height: 0;
}
.ds-dialog--xl .ds-asset-card-panel__footer { flex-shrink: 0; }

/* ── Wspólna powłoka paneli formularza (jak dialog „Dodaj zasób”) ── */
.slide-panel.ds-dialog--xl .slide-panel__drawer {
    width: min(100%, var(--ds-dialog-w, 920px));
}
.slide-panel.ds-dialog--xl .slide-panel__drawer--asset-card {
    background: var(--ds-surface);
}
.slide-panel.ds-dialog--xl .slide-panel__drawer--asset-card .ds-asset-card-panel,
.slide-panel.ds-dialog--xl .ds-asset-card-panel {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: var(--ds-surface);
}
.slide-panel.ds-dialog--xl .ds-asset-card-panel__header,
.slide-panel.ds-dialog--xl .ds-asset-card-panel__body {
    background: var(--ds-surface);
}
.slide-panel.ds-dialog--xl .ds-asset-card-panel__header {
    height: auto;
    min-height: var(--ds-panel-chrome-header-min-h);
    max-height: none;
    padding: var(--ds-popup-header-pad-y) var(--ds-popup-inset);
    gap: var(--space-3);
    box-sizing: border-box;
}
.slide-panel.ds-dialog--xl .ds-asset-card-panel__header .ds-card__title {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.slide-panel.ds-dialog--xl .ds-asset-card-panel__body {
    padding: 0;
    gap: 0;
}
.slide-panel.ds-dialog--xl .ds-asset-card-panel__footer {
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface);
}
.slide-panel.ds-dialog--xl .ds-asset-card-panel__section .ds-add-product-form__block-title,
.slide-panel.ds-dialog--xl .ds-product-asset-grid .ds-add-product-form__block-title {
    min-height: var(--ds-add-product-block-title-h, 28px);
}
.slide-panel.ds-dialog--xl .slide-panel__header {
    min-height: var(--ds-panel-chrome-header-min-h);
    padding: var(--ds-popup-header-pad-y) var(--ds-popup-inset);
    gap: var(--space-3);
    box-sizing: border-box;
}
.slide-panel.ds-dialog--xl .slide-panel__header .slide-panel__title {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.slide-panel.ds-dialog--xl .slide-panel__footer {
    box-sizing: border-box;
}

.slide-panel__drawer--wide { width: min(100%, 720px); max-width: 100%; }
.slide-panel__drawer--xl,
.slide-panel__drawer--asset-card { width: min(100%, 920px); max-width: 100%; }
.slide-panel__drawer:not(.slide-panel__drawer--wide):not(.slide-panel__drawer--xl):not(.slide-panel__drawer--asset-card) {
    width: min(100%, 520px);
    max-width: 100%;
}

@media (max-width: 768px) {
    .ds-dialog,
    .slide-panel.show:not(.slide-panel--asset-card) {
        padding: var(--space-3);
    }
    .ds-dialog__panel,
    .slide-panel__drawer:not(.slide-panel__drawer--asset-card) {
        width: 100%;
        max-height: min(92dvh, calc(100dvh - 2 * var(--space-3)));
        border-radius: var(--radius-lg);
    }
    .ds-dialog__footer {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: var(--space-3);
    }
    .ds-dialog__footer .btn {
        width: 100%;
        justify-content: center;
    }
    .ds-dialog__footer--split,
    .slide-panel__footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .ds-dialog__footer--split .ds-dialog__footer-actions,
    .slide-panel__footer-actions {
        width: 100%;
        justify-content: stretch;
    }
    .ds-dialog__footer--split .ds-dialog__footer-actions .btn,
    .slide-panel__footer-actions .btn {
        flex: 1 1 auto;
    }
}

/* ── Mobile pulpitu / kalendarza — nadpisania końcowe (kaskada) ── */
@media (max-width: 1080px) {
    #view-dashboard #dash-calendar-module:not(.cal-day-detail-open) .cal-grid--dash {
        grid-auto-rows: 1fr !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: 100% !important;
        align-content: stretch !important;
    }
    #view-dashboard #dash-calendar-module:not(.cal-day-detail-open) .cal-grid--dash .cal-cell {
        aspect-ratio: unset;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }
    #view-dashboard .dashboard-row--charts .dash-inventory-card,
    #view-dashboard .dashboard-row--charts > .ds-card--stretch:not(.ds-card--compliance):not(.ds-card--chart) {
        min-height: 260px;
    }
    #view-dashboard .dashboard-row--charts .ds-inset-scroll--dashboard-list,
    #view-dashboard .dashboard-row--charts .ds-scroll-lane--dashboard-list {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        max-height: none !important;
        height: auto !important;
    }
    .dash-inventory-card .ds-card__header {
        flex-wrap: nowrap;
        align-items: center;
        gap: var(--space-2);
    }
    .dash-inventory-card .ds-card__header-actions {
        width: auto;
        margin-left: auto;
        flex: 0 0 auto;
    }
    .dash-inventory-filter {
        width: auto;
    }
    .dash-inventory-filter__select {
        flex: 1;
        min-width: 0;
        max-width: none;
    }
}

/* ── Normy i limity ── */
.norms-shell {
    display: flex;
    flex-direction: column;
    gap: var(--ds-dashboard-gap);
    width: 100%;
    max-width: 100%;
}
.norms-shell:has(.norms-mobile-select.is-open) {
    overflow: visible;
}
.norms-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}
.norms-page-head__intro {
    flex: 1;
    min-width: min(100%, 420px);
}
.norms-page-head .ds-page-header__title {
    margin: 0;
    font-size: var(--ds-page-header-title-size);
    font-weight: 600;
    line-height: var(--leading-tight);
}
.norms-page-head__lead {
    margin: 0;
    max-width: 52ch;
    font-size: var(--text-sm);
    line-height: 1.55;
    color: var(--ds-text-secondary);
}
.norms-page-head__search {
    width: min(100%, 280px);
    flex-shrink: 0;
}
.norms-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.norms-toolbar__groups {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.norms-group-pill {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--ds-text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition:
        background var(--ds-motion-fast),
        border-color var(--ds-motion-fast),
        color var(--ds-motion-fast);
}
.norms-group-pill:hover {
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
}
.norms-group-pill.is-active {
    background: var(--ds-surface-muted);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
    font-weight: 600;
}
.norms-layout {
    display: grid;
    grid-template-columns: minmax(248px, 300px) minmax(0, 1fr);
    gap: var(--ds-dashboard-gap);
    align-items: start;
    min-height: 0;
}
.norms-aside {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
}
.norms-mobile-select {
    display: none;
    width: 100%;
}
.norms-mobile-select .ds-head-dropdown__trigger {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
}
.norms-mobile-select .ds-head-dropdown__menu {
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
}
.norms-nav {
    padding: 0;
    overflow: hidden;
}
.norms-nav .ds-inset-scroll--host {
    padding: var(--ds-dashboard-body-gap) var(--ds-inset-x) var(--ds-inset-y);
}
.norms-nav__scroll {
    max-height: min(72vh, 680px);
    min-height: 0;
}
.norms-nav__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: visible;
}
.norms-nav__item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 10px var(--space-3);
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ds-text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: background var(--ds-motion-fast), color var(--ds-motion-fast);
}
.norms-nav__item:hover {
    background: var(--ds-surface-muted);
    color: var(--ds-text);
}
.norms-nav__item.is-active {
    background: var(--ds-surface-muted);
    color: var(--ds-text);
    font-weight: 600;
}
.norms-nav__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.norms-nav__count {
    flex-shrink: 0;
}
.norms-nav__empty {
    padding: var(--space-4);
}
.norms-main {
    min-width: 0;
}
.norms-detail {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.norms-detail > .ds-card__body--grow {
    flex: 1;
    min-height: 0;
}
.norms-detail__inset {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
}
.norms-detail__summary {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
    line-height: 1.55;
}
.norms-detail__section--products {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    flex: 1;
    min-height: 0;
}
.norms-products-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-3);
    margin: 0;
    min-height: 10rem;
    padding: var(--ds-content-pad);
    box-sizing: border-box;
}
.norms-products-empty__icon {
    font-size: 40px;
    line-height: 1;
    color: var(--ds-info-icon-color);
}
.norms-products-empty__title {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
}
.norms-products-empty__text {
    margin: 0;
    max-width: 36ch;
    font-size: var(--text-sm);
    line-height: 1.55;
    color: var(--ds-text-secondary);
}
.norms-products__summary {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--ds-text-secondary);
}
.norms-products-list {
    max-height: min(360px, 42vh);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-sizing: border-box;
    scroll-padding-block: var(--space-2);
}
.norms-detail__meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.norms-detail__method {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--ds-text-tertiary);
}
.norms-detail__section {
    padding-top: var(--space-4);
    border-top: 1px solid var(--ds-border);
    margin: 0;
}
.norms-detail__norms {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.norms-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.35;
}
.norms-badge--norm {
    background: var(--ds-surface-muted);
    color: var(--ds-text-secondary);
    border: 1px solid var(--ds-border);
}
.norms-detail__section-title {
    margin: 0 0 var(--space-3);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--ds-text);
    letter-spacing: -0.01em;
}
.norms-detail__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: 0;
}
.norms-detail__section-head .norms-detail__section-title {
    margin: 0;
}
.norms-detail__count {
    flex-shrink: 0;
}
.norms-limit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-4);
}
.norms-limit-card {
    padding: var(--space-4);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    background: var(--ds-surface);
}
.norms-limit-card__label {
    margin: 0 0 var(--space-4);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ds-text);
    line-height: 1.4;
}
.norms-limit-card__pass,
.norms-limit-card__fail {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--ds-text-secondary);
}
.norms-limit-card__pass {
    margin-bottom: var(--space-3);
}
.norms-limit-card__tag {
    flex-shrink: 0;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.norms-limit-card__tag--pass {
    background: var(--ds-success-soft);
    color: var(--ds-success);
}
.norms-limit-card__tag--fail {
    background: var(--ds-danger-soft);
    color: var(--ds-danger);
}
.norms-product-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.norms-product-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    max-width: 240px;
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-sm);
    background: var(--ds-surface-muted);
    cursor: pointer;
    text-align: left;
    font-family: var(--font-ui);
    transition:
        border-color var(--ds-motion-fast),
        background var(--ds-motion-fast);
}
.norms-product-chip:hover {
    border-color: var(--ds-border-strong);
    background: var(--ds-surface);
}
.norms-product-chip__code {
    font-size: var(--text-xs);
}
.norms-product-chip__name {
    font-size: var(--text-xs);
    color: var(--ds-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.norms-products__empty,
.norms-products__more {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--ds-text-secondary);
}

@media (max-width: 1080px) {
    .norms-layout {
        grid-template-columns: 1fr;
    }
    .norms-mobile-select {
        display: block;
    }
    .norms-nav {
        display: none;
    }
}
@media (max-width: 1080px) {
    .settings-layout--profile {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .norms-page-head__search {
        width: 100%;
    }
    .norms-limit-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Profil: karta tożsamości użytkownika ── */
.profile-identity-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding: var(--space-4) var(--space-5);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
}
.profile-identity-card--in-section {
    margin-bottom: var(--space-5);
    padding: 0 0 var(--space-5);
    background: transparent;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--ds-border);
}
.profile-identity-card--in-section .profile-identity-card__name {
    font-size: var(--text-md);
}
.profile-identity-card--panel {
    margin: 0;
    padding: var(--space-5) var(--ds-inset-x);
    height: auto;
    min-height: unset;
    background: transparent;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
}
.profile-identity-card__avatar {
    position: relative;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--ds-surface-hover);
    border: 1px solid var(--ds-border-strong);
    display: grid;
    place-items: center;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    box-sizing: border-box;
}
.profile-identity-card__avatar img,
.profile-identity-card__avatar .material-symbols-outlined {
    grid-area: 1 / 1;
}
.profile-identity-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-identity-card__avatar img[hidden] {
    display: none !important;
}
.profile-identity-card__avatar .material-symbols-outlined {
    font-size: 28px;
    color: var(--ds-text-secondary);
    line-height: 1;
}
.profile-identity-card__avatar .material-symbols-outlined[hidden] {
    display: none !important;
}
.profile-identity-card__avatar:has(img:not([hidden])) {
    background: var(--ds-surface);
    border-color: var(--ds-border);
}
.profile-identity-card__avatar:has(img:not([hidden])) .material-symbols-outlined {
    display: none !important;
}
.profile-identity-card__body {
    flex: 1;
    min-width: 0;
}
.profile-identity-card__name {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.25;
    color: var(--ds-text);
}
.profile-identity-card__role-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-2) 0 0;
}
.profile-identity-card__role-label {
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
}
.profile-identity-card__role {
    display: inline-flex;
    align-items: center;
}
.profile-identity-card__role .badge,
.profile-identity-card__role .ds-status-badge {
    font-size: var(--text-2xs);
}

/* ── Mobile shell refinements ── */
@media (max-width: 1080px) {
    :root {
        --topbar-height: 64px;
    }
    .topbar__mobile-bar {
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        min-height: var(--topbar-height);
        height: var(--topbar-height);
        width: 100%;
    }
    .topbar__mobile-brand {
        max-width: calc(100% - 168px);
        padding: 0;
    }
    .topbar__mobile-brand .topbar-app-mark__logo {
        width: 32px;
        height: 32px;
    }
    .topbar__mobile-brand .topbar-app-mark__title {
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .topbar__mobile-actions {
        margin-left: auto;
        flex-shrink: 0;
    }
    .mobile-bottom-nav {
        padding: 4px 8px calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
        min-height: 64px;
    }
    .mobile-bottom-nav .nav-item.mobile-bottom-nav__item:not(.mobile-bottom-nav__item--scan) .material-symbols-outlined {
        font-size: 24px;
    }
    .mobile-bottom-nav__item--scan {
        flex: 0 0 56px;
        width: 56px;
        height: 56px;
        max-width: 56px;
        transform: translateY(calc(-50% + 8px));
    }
    .mobile-bottom-nav__item--scan .material-symbols-outlined {
        font-size: 30px;
    }
    #view-notifications .dashboard-scroll[data-account-shell] {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    #view-notifications .notif-module {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    #view-notifications .notif-panel-split {
        min-height: 0;
        height: auto;
        flex: 1;
    }
    #view-notifications .notif-panel-split__col--list {
        min-height: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    #view-notifications .notif-panel-split__col--list .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
        flex: 1;
    }
    #view-notifications .notif-panel-split__col--list .ds-scroll-rail .ds-scroll-lane__inset {
        overflow: visible !important;
        min-height: 0;
        flex: 1;
    }
    .schedule-panel__body {
        min-height: 0;
    }
    .slide-panel__drawer--xl.schedule-panel {
        width: 100vw;
        max-width: 100vw;
    }
    .schedule-panel__header {
        padding: var(--space-3) var(--space-4);
    }
    .schedule-panel__title {
        font-size: var(--text-lg);
    }
    .schedule-entity-grid {
        padding: var(--space-3) var(--space-4);
    }
    .schedule-panel__footer {
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    .schedule-step--date {
        padding: var(--space-4);
        align-items: flex-start;
    }
    .schedule-date-step {
        width: 100%;
    }
    .schedule-step--products > .ds-content-inset--scroll,
    .schedule-step--products .entity-list-scroll,
    .schedule-step--products .table-card {
        flex: 1;
        min-height: 0;
    }
    .account-side-nav {
        border-right: none;
        border-bottom: 1px solid var(--ds-border);
    }
}
@media (min-width: 1081px) {
    #view-notifications .dashboard-scroll[data-account-shell]:has(> .notif-module) {
        overflow: hidden;
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }
    #view-notifications .notif-panel-split__col--list .ds-scroll-lane:not(:has(.ds-scroll-rail)) > .ds-scroll-lane__inset {
        overflow-y: auto;
        min-height: 0;
    }
    #view-notifications .notif-panel-split__col--list .ds-scroll-rail .ds-scroll-lane__inset {
        overflow: visible !important;
        min-height: 0;
    }
}

/* ── Pulpit + listy: naprawy końcowe (nadpisują konflikty kaskady) ── */
@media (min-width: 1081px) {
    #esd-app #view-dashboard .dashboard-row--charts > .dash-inventory-card {
        align-self: stretch;
        min-height: 0;
        overflow: hidden;
    }
    #esd-app #view-dashboard .dashboard-row--charts .compliance-v5-host .compliance-chart {
        height: auto;
        flex: 0 0 auto;
        justify-content: center;
        padding-top: 40px;
        padding-bottom: 40px;
    }
    #esd-app #view-dashboard .dashboard-row--charts .compliance-chart__grid {
        margin: 0;
    }
}

#esd-app #view-dashboard #today-products-list .ds-list-item--has-menu,
#esd-app #view-dashboard #dash-devices-list .ds-list-item--has-menu,
#esd-app #view-dashboard #dash-selected-day-products .ds-list-item--has-menu {
    overflow: visible;
    position: relative;
    z-index: 1;
}
#esd-app #view-dashboard #today-products-list .ds-list-item--has-menu:has(.dropdown-actions.is-open),
#esd-app #view-dashboard #dash-devices-list .ds-list-item--has-menu:has(.dropdown-actions.is-open),
#esd-app #view-dashboard #dash-selected-day-products .ds-list-item--has-menu:has(.dropdown-actions.is-open) {
    z-index: 300;
    overflow: visible;
}
#esd-app #view-dashboard #today-products-list .dropdown-actions.is-open,
#esd-app #view-dashboard #dash-devices-list .dropdown-actions.is-open,
#esd-app #view-dashboard #dash-selected-day-products .dropdown-actions.is-open {
    z-index: 301;
}
#esd-app #view-dashboard #today-products-list .dropdown-actions.is-open .dropdown-actions-content,
#esd-app #view-dashboard #dash-devices-list .dropdown-actions.is-open .dropdown-actions-content,
#esd-app #view-dashboard #dash-selected-day-products .dropdown-actions.is-open .dropdown-actions-content {
    z-index: 302;
}
#esd-app #view-dashboard #today-products-list .dropdown-actions,
#esd-app #view-dashboard #dash-devices-list .dropdown-actions,
#esd-app #view-dashboard #dash-selected-day-products .dropdown-actions,
#esd-app #view-dashboard #today-products-list .ds-kebab-btn,
#esd-app #view-dashboard #dash-devices-list .ds-kebab-btn,
#esd-app #view-dashboard #dash-selected-day-products .ds-kebab-btn {
    pointer-events: auto;
}
#esd-app .entity-view :is(.ds-entity-list-body, .table-card.entity-list).ds-entity-list-view,
#esd-app #view-reports #reports-list-container:is(.ds-entity-list-body, .table-card.entity-list),
#esd-app #view-daily-audits #audits-list-container:is(.ds-entity-list-body, .table-card.entity-list),
#esd-app #view-trash #trash-list-container:is(.ds-entity-list-body, .table-card.entity-list) {
    padding: 0;
    border: none;
}

/* Lista entity — kanoniczny padding wierszy (16px L/R; kebab 8px P; checkbox: lewy inset w komórce) */
#esd-app :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table thead th:not(.ds-row-kebab-cell):not(.data-table__cell-check):not(.data-table__col-check) {
    padding-left: var(--ds-list-item-pad-x) !important;
    padding-right: var(--ds-list-item-pad-x) !important;
    padding-top: var(--ds-table-head-pad-y) !important;
    padding-bottom: var(--ds-table-head-pad-y) !important;
}
#esd-app :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table tbody td:not(.ds-row-kebab-cell):not(.data-table__cell-check):not(.data-table__col-check) {
    padding-left: var(--ds-list-item-pad-x) !important;
    padding-right: var(--ds-list-item-pad-x) !important;
    padding-top: var(--ds-entity-row-pad-y) !important;
    padding-bottom: var(--ds-entity-row-pad-y) !important;
}
#esd-app :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table thead th.data-table__col-check {
    padding-left: var(--ds-entity-check-col-pad-start) !important;
    padding-right: var(--ds-entity-check-gap) !important;
    padding-top: var(--ds-table-head-pad-y) !important;
    padding-bottom: var(--ds-table-head-pad-y) !important;
    width: var(--ds-entity-check-col-w-padded) !important;
    min-width: var(--ds-entity-check-col-w-padded) !important;
    max-width: var(--ds-entity-check-col-w-padded) !important;
}
#esd-app :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table tbody td.data-table__cell-check {
    padding-left: var(--ds-entity-check-col-pad-start) !important;
    padding-right: var(--ds-entity-check-gap) !important;
    padding-top: var(--ds-entity-row-pad-y) !important;
    padding-bottom: var(--ds-entity-row-pad-y) !important;
    width: var(--ds-entity-check-col-w-padded) !important;
    min-width: var(--ds-entity-check-col-w-padded) !important;
    max-width: var(--ds-entity-check-col-w-padded) !important;
}
#esd-app :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table:has(col.data-table__col-check) :is(
    thead th.data-table__col-code,
    tbody td.data-table__cell-code
) {
    padding-left: 0 !important;
}
#esd-app :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table thead th.ds-row-kebab-cell {
    padding-left: 0 !important;
    padding-right: var(--ds-row-kebab-pad-end) !important;
    padding-top: var(--ds-table-head-pad-y) !important;
    padding-bottom: var(--ds-table-head-pad-y) !important;
}
#esd-app :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table tbody td.ds-row-kebab-cell {
    padding-left: 0 !important;
    padding-right: var(--ds-row-kebab-pad-end) !important;
    padding-top: var(--ds-entity-row-pad-y) !important;
    padding-bottom: var(--ds-entity-row-pad-y) !important;
}
#esd-app :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table thead tr {
    min-height: var(--ds-table-head-h);
}
#esd-app :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table tbody tr {
    min-height: var(--ds-entity-row-min-h);
}
#esd-app :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table thead th {
    min-height: var(--ds-table-head-h);
}
#esd-app :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table tbody td {
    min-height: var(--ds-entity-row-min-h);
}

/* Pulpity list — inset kontenera (--ds-inset-x) + komórki th/td */
#esd-app .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-inset-scroll--host, .ds-content-inset--scroll):not(:has(.ds-scroll-rail)) {
    padding-top: var(--ds-entity-list-inset-top) !important;
    padding-bottom: var(--ds-entity-list-inset-bottom) !important;
    padding-inline: var(--ds-inset-x) !important;
}
#esd-app .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-inset-scroll--host, .ds-content-inset--scroll):has(.ds-scroll-rail) {
    padding: 0 !important;
}
#esd-app .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-inset-scroll--host, .ds-content-inset--scroll):has(.ds-scroll-rail) > .ds-scroll-lane {
    padding: 0 !important;
}
#esd-app .app-view.entity-view.dashboard-view .entity-list-card .ds-scroll-rail__body {
    padding-top: var(--ds-entity-list-inset-top) !important;
    padding-inline: var(--ds-inset-x) !important;
    padding-bottom: 0 !important;
    box-sizing: border-box;
    overflow-x: auto !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
#esd-app .app-view.entity-view.dashboard-view .entity-list-card .ds-scroll-rail__body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
#esd-app .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table thead th:not(.ds-row-kebab-cell):not(.data-table__cell-check):not(.data-table__col-check) {
    padding-left: var(--ds-list-item-pad-x) !important;
    padding-right: var(--ds-list-item-pad-x) !important;
    padding-top: var(--ds-table-head-pad-y) !important;
    padding-bottom: var(--ds-table-head-pad-y) !important;
}
#esd-app .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table tbody td:not(.ds-row-kebab-cell):not(.data-table__cell-check):not(.data-table__col-check) {
    padding-left: var(--ds-list-item-pad-x) !important;
    padding-right: var(--ds-list-item-pad-x) !important;
    padding-top: var(--ds-entity-row-pad-y) !important;
    padding-bottom: var(--ds-entity-row-pad-y) !important;
}
#esd-app .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table thead th.data-table__col-check {
    padding-left: var(--ds-entity-check-col-pad-start) !important;
    padding-right: var(--ds-entity-check-gap) !important;
    width: var(--ds-entity-check-col-w-padded) !important;
    min-width: var(--ds-entity-check-col-w-padded) !important;
    max-width: var(--ds-entity-check-col-w-padded) !important;
    padding-top: var(--ds-table-head-pad-y) !important;
    padding-bottom: var(--ds-table-head-pad-y) !important;
}
#esd-app .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table tbody td.data-table__cell-check {
    padding-left: var(--ds-entity-check-col-pad-start) !important;
    padding-right: var(--ds-entity-check-gap) !important;
    width: var(--ds-entity-check-col-w-padded) !important;
    min-width: var(--ds-entity-check-col-w-padded) !important;
    max-width: var(--ds-entity-check-col-w-padded) !important;
    padding-top: var(--ds-entity-row-pad-y) !important;
    padding-bottom: var(--ds-entity-row-pad-y) !important;
}
#esd-app .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table thead th.ds-row-kebab-cell {
    padding-left: 0 !important;
    padding-right: var(--ds-row-kebab-pad-end) !important;
    padding-top: var(--ds-table-head-pad-y) !important;
    padding-bottom: var(--ds-table-head-pad-y) !important;
}
#esd-app .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table tbody td.ds-row-kebab-cell {
    padding-left: 0 !important;
    padding-right: var(--ds-row-kebab-pad-end) !important;
    padding-top: var(--ds-entity-row-pad-y) !important;
    padding-bottom: var(--ds-entity-row-pad-y) !important;
}
#esd-app .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table:has(col.data-table__col-check) :is(
    thead th.data-table__col-code,
    tbody td.data-table__cell-code
) {
    padding-left: 0 !important;
}
/* Pulpity list — jawny inset komórek (ewidencja, pickery, raporty, kosz) */
#esd-app .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table thead th:not(.ds-row-kebab-cell):not(.data-table__cell-check):not(.data-table__col-check) {
    padding-left: var(--ds-list-item-pad-x) !important;
    padding-right: var(--ds-list-item-pad-x) !important;
    padding-top: var(--ds-table-head-pad-y) !important;
    padding-bottom: var(--ds-table-head-pad-y) !important;
}
#esd-app .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table tbody td:not(.ds-row-kebab-cell):not(.data-table__cell-check):not(.data-table__col-check) {
    padding-left: var(--ds-list-item-pad-x) !important;
    padding-right: var(--ds-list-item-pad-x) !important;
    padding-top: var(--ds-entity-row-pad-y) !important;
    padding-bottom: var(--ds-entity-row-pad-y) !important;
}
#esd-app .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table thead th.data-table__col-check {
    width: var(--ds-entity-check-col-w-padded) !important;
    min-width: var(--ds-entity-check-col-w-padded) !important;
    max-width: var(--ds-entity-check-col-w-padded) !important;
    padding-left: var(--ds-entity-check-col-pad-start) !important;
    padding-right: var(--ds-entity-check-gap) !important;
    padding-top: var(--ds-table-head-pad-y) !important;
    padding-bottom: var(--ds-table-head-pad-y) !important;
}
#esd-app .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table tbody td.data-table__cell-check {
    width: var(--ds-entity-check-col-w-padded) !important;
    min-width: var(--ds-entity-check-col-w-padded) !important;
    max-width: var(--ds-entity-check-col-w-padded) !important;
    padding-left: var(--ds-entity-check-col-pad-start) !important;
    padding-right: var(--ds-entity-check-gap) !important;
    padding-top: var(--ds-entity-row-pad-y) !important;
    padding-bottom: var(--ds-entity-row-pad-y) !important;
}
#esd-app .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table:has(col.data-table__col-check) :is(
    thead th.data-table__col-code,
    tbody td.data-table__cell-code
) {
    padding-left: 0 !important;
}
#esd-app .entity-list-card :is(.ds-inset-scroll--host, .ds-content-inset--scroll):not(:has(.ds-scroll-rail)) > .ds-scroll-lane > .ds-scroll-lane__inset:has(:is(.entity-list, .ds-entity-list-body) > .data-table) {
    padding-inline: 0 !important;
    box-sizing: border-box;
}
#esd-app .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table thead th.ds-row-kebab-cell {
    padding-left: 0 !important;
    padding-right: var(--ds-row-kebab-pad-end) !important;
    padding-top: var(--ds-table-head-pad-y) !important;
    padding-bottom: var(--ds-table-head-pad-y) !important;
}
#esd-app .entity-list-card :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table tbody td.ds-row-kebab-cell {
    padding-left: 0 !important;
    padding-right: var(--ds-row-kebab-pad-end) !important;
    padding-top: var(--ds-entity-row-pad-y) !important;
    padding-bottom: var(--ds-entity-row-pad-y) !important;
}

/* Kolumna checkbox — jeden kanon (audyt dzienny = wzorzec) */
#esd-app :is(.ds-entity-list-view, .entity-list) .data-table:has(col.data-table__col-check) col.data-table__col-check {
    width: var(--ds-entity-check-col-w-padded);
}
#esd-app :is(.ds-entity-list-view, .entity-list) .data-table:has(col.data-table__col-check) col.data-table__col-code {
    width: auto;
}
#esd-app :is(.ds-entity-list-view, .entity-list) .data-table :is(
    thead th.data-table__col-check,
    tbody td.data-table__cell-check
) {
    width: var(--ds-entity-check-col-w-padded);
    min-width: var(--ds-entity-check-col-w-padded);
    max-width: var(--ds-entity-check-col-w-padded);
    padding-left: var(--ds-entity-check-col-pad-start);
    padding-right: var(--ds-entity-check-gap);
    padding-top: var(--ds-entity-row-pad-y);
    padding-bottom: var(--ds-entity-row-pad-y);
    box-sizing: border-box;
    vertical-align: middle;
    text-align: left;
    line-height: 1;
}
#esd-app .entity-list-card :is(.ds-entity-list-view, .entity-list) .data-table :is(
    thead th.data-table__col-check,
    tbody td.data-table__cell-check
) {
    width: var(--ds-entity-check-col-w-padded) !important;
    min-width: var(--ds-entity-check-col-w-padded) !important;
    max-width: var(--ds-entity-check-col-w-padded) !important;
    padding-left: var(--ds-entity-check-col-pad-start) !important;
    padding-right: var(--ds-entity-check-gap) !important;
}

#esd-app #view-reports #reports-list-view,
#esd-app #view-daily-audits #audits-list-view,
#esd-app #view-trash #trash-list-view,
#esd-app .entity-module-list-view {
    gap: var(--ds-dashboard-gap);
}

/* Pusty stan — komunikat na środku karty listy (bez dodatkowego kontenera / obrysu) */
.app-view.entity-view.dashboard-view .entity-list-card .empty-state,
.entity-module-list-view .entity-list-card .empty-state {
    border: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}
.app-view.entity-view.dashboard-view .entity-list-card .empty-state.is-shown,
.entity-module-list-view .entity-list-card .empty-state.is-shown {
    flex: 1;
    min-height: 0;
    padding: var(--ds-content-pad);
}
.app-view.entity-view.dashboard-view .entity-list-card .empty-state.is-shown ~ :is(.ds-inset-scroll--fill, .ds-content-inset--scroll),
.entity-module-list-view .entity-list-card .empty-state.is-shown ~ .ds-inset-scroll--fill {
    display: none;
}
.app-view.entity-view.dashboard-view .entity-list-card .empty-state .material-symbols-outlined,
.entity-module-list-view .entity-list-card .empty-state .material-symbols-outlined {
    color: var(--ds-info-icon-color);
}

/* Nagłówki widoków — jeden kanoniczny układ (pulpit główny, kalendarz, ewidencja, listy…) */
#esd-app .dashboard-scroll > .ds-page-header,
#esd-app .dashboard-scroll > .ds-page-header--actions,
#esd-app .dashboard-scroll > .norms-shell > .ds-page-header,
#esd-app #norms-view-root > .norms-shell > .ds-page-header,
#esd-app .app-view.entity-view.dashboard-view > .entity-view-scroll > .ds-page-header,
#esd-app .app-view.entity-view.dashboard-view > .entity-view-scroll > .ds-page-header--actions {
    margin: 0 0 calc(var(--ds-page-header-gap) - var(--ds-dashboard-gap)) !important;
    padding: 0 !important;
    min-height: unset !important;
    height: auto !important;
    align-items: center;
    flex-shrink: 0;
    box-sizing: border-box;
}
#esd-app .dashboard-scroll > .ds-page-header .ds-page-header__title,
#esd-app .dashboard-scroll > .ds-page-header--actions .ds-page-header__title,
#esd-app .dashboard-scroll > .norms-shell > .ds-page-header .ds-page-header__title,
#esd-app #norms-view-root > .norms-shell > .ds-page-header .ds-page-header__title,
#esd-app .app-view.entity-view.dashboard-view > .entity-view-scroll > .ds-page-header .ds-page-header__title,
#esd-app .app-view.entity-view.dashboard-view > .entity-view-scroll > .ds-page-header--actions .ds-page-header__title {
    font-size: var(--ds-page-header-title-size) !important;
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: -0.025em;
    margin: 0;
}

#esd-app #view-trash .data-table--trash col.data-table__col-trash-code { width: var(--ds-trash-col-code-date-w) !important; }
#esd-app #view-trash .data-table--trash col.data-table__col-name { width: auto !important; }
#esd-app #view-trash .data-table--trash col.data-table__col-category { width: var(--ds-trash-col-type-w) !important; }
#esd-app #view-trash .data-table--trash :is(thead th.data-table__col-trash-code, tbody td.data-table__cell-trash-code) {
    width: var(--ds-trash-col-code-date-w) !important;
    min-width: var(--ds-trash-col-code-date-w) !important;
    max-width: var(--ds-trash-col-code-date-w) !important;
}
#esd-app #view-trash .data-table--trash :is(thead th.data-table__col-name, tbody td.data-table__cell-name) {
    width: auto !important;
    min-width: 12rem !important;
    max-width: none !important;
}
#esd-app #view-trash .data-table--trash :is(thead th.data-table__col-category, tbody td:nth-child(3):not(.ds-row-kebab-cell)) {
    width: var(--ds-trash-col-type-w) !important;
    min-width: var(--ds-trash-col-type-w) !important;
    max-width: 11rem !important;
}

#esd-app .sidebar-nav > a.nav-item.logout,
#esd-app .sidebar-nav > button.nav-item.logout,
#esd-app .mobile-drawer__nav .nav-item.logout {
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    padding-inline: 12px;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--sidebar-text);
    border: 1px solid transparent;
}
#esd-app .sidebar-nav > a.nav-item.logout .nav-item__text,
#esd-app .sidebar-nav > button.nav-item.logout .nav-item__text,
#esd-app .mobile-drawer__nav .nav-item.logout .nav-item__text {
    color: var(--sidebar-text);
}
#esd-app .sidebar-nav > a.nav-item.logout .material-symbols-outlined,
#esd-app .sidebar-nav > button.nav-item.logout .material-symbols-outlined,
#esd-app .mobile-drawer__nav .nav-item.logout .material-symbols-outlined {
    font-size: 20px;
    color: var(--sidebar-text);
}
#esd-app .sidebar-nav > a.nav-item.logout:hover,
#esd-app .sidebar-nav > button.nav-item.logout:hover,
#esd-app .sidebar-nav > a.nav-item.logout:focus-visible,
#esd-app .sidebar-nav > button.nav-item.logout:focus-visible,
#esd-app .mobile-drawer__nav .nav-item.logout:hover,
#esd-app .mobile-drawer__nav .nav-item.logout:focus-visible {
    background: color-mix(in srgb, var(--ds-danger-soft) 72%, transparent);
    color: var(--ds-danger);
    border-color: color-mix(in srgb, var(--ds-danger) 28%, var(--ds-border));
}
#esd-app .sidebar-nav > a.nav-item.logout:hover .material-symbols-outlined,
#esd-app .sidebar-nav > button.nav-item.logout:hover .material-symbols-outlined,
#esd-app .sidebar-nav > a.nav-item.logout:hover .nav-item__text,
#esd-app .sidebar-nav > button.nav-item.logout:hover .nav-item__text,
#esd-app .sidebar-nav > a.nav-item.logout:focus-visible .material-symbols-outlined,
#esd-app .sidebar-nav > button.nav-item.logout:focus-visible .material-symbols-outlined,
#esd-app .sidebar-nav > a.nav-item.logout:focus-visible .nav-item__text,
#esd-app .sidebar-nav > button.nav-item.logout:focus-visible .nav-item__text,
#esd-app .mobile-drawer__nav .nav-item.logout:hover .material-symbols-outlined,
#esd-app .mobile-drawer__nav .nav-item.logout:hover .nav-item__text,
#esd-app .mobile-drawer__nav .nav-item.logout:focus-visible .material-symbols-outlined,
#esd-app .mobile-drawer__nav .nav-item.logout:focus-visible .nav-item__text {
    color: var(--ds-danger);
}
#esd-app .sidebar-nav > a.nav-item.logout:active,
#esd-app .sidebar-nav > button.nav-item.logout:active,
#esd-app .mobile-drawer__nav .nav-item.logout:active {
    background: color-mix(in srgb, var(--ds-danger) 10%, var(--ds-danger-soft));
    color: var(--ds-danger);
    border-color: color-mix(in srgb, var(--ds-danger) 36%, var(--ds-border));
}
#esd-app .sidebar-nav > a.nav-item.logout:active .material-symbols-outlined,
#esd-app .sidebar-nav > button.nav-item.logout:active .material-symbols-outlined,
#esd-app .sidebar-nav > a.nav-item.logout:active .nav-item__text,
#esd-app .sidebar-nav > button.nav-item.logout:active .nav-item__text,
#esd-app .mobile-drawer__nav .nav-item.logout:active .material-symbols-outlined,
#esd-app .mobile-drawer__nav .nav-item.logout:active .nav-item__text {
    color: var(--ds-danger);
}

/* Popup chrome — wyższe nagłówki + 32px inset wszędzie */
#esd-app :is(.ds-dialog, .slide-panel.ds-dialog, .ds-wizard-dialog) :is(.ds-dialog__header, .slide-panel__header) {
    padding-block: var(--ds-popup-header-pad-y);
    padding-inline: var(--ds-popup-inset);
}
#esd-app :is(.ds-dialog, .slide-panel.ds-dialog, .ds-wizard-dialog) :is(
    .slide-panel__footer,
    .ds-dialog__footer,
    .ds-asset-card-panel__footer
) {
    padding: var(--ds-popup-inset);
}
#esd-app :is(.ds-dialog, .slide-panel.ds-dialog) .slide-panel__subhead {
    padding-inline: var(--ds-popup-inset);
}
#esd-app :is(.ds-dialog, .slide-panel.ds-dialog) :is(
    .slide-panel__body--scroll-host,
    .ds-dialog__body--scroll-host
):not(:has(.ds-product-asset-grid)) > .ds-scroll-lane {
    padding: var(--ds-popup-inset);
}
#esd-app :is(.ds-dialog, .slide-panel.ds-dialog) :is(
    .slide-panel__body--scroll-host,
    .ds-dialog__body--scroll-host
):has(.ds-product-asset-grid) > .ds-scroll-lane,
#esd-app :is(.ds-dialog, .slide-panel.ds-dialog):has(.ds-product-asset-grid) .ds-scroll-rail__body {
    padding: 0;
}
#esd-app :is(.slide-panel.ds-dialog, .ds-dialog) .ds-asset-card-panel__header {
    padding-inline: var(--ds-popup-inset);
}

#esd-app :is(.ds-entity-list-body, .entity-list).ds-entity-list-view:not(.entity-grid) .data-table.data-table--products :is(
    thead th.data-table__col-name,
    tbody td.data-table__cell-name,
    thead th.data-table__col-location,
    tbody td.data-table__cell-location,
    thead th.data-table__col-status,
    tbody td.data-table__cell-status
) {
    padding-left: var(--ds-products-col-compact-pad-x) !important;
    padding-right: var(--ds-products-col-compact-pad-x) !important;
}

/* ══ UI spójność (2026-05-28): focus, scrollbar, wykresy ══ */
#esd-app .ds-card__header,
#esd-app .ds-module__head,
#esd-app .ds-card__header-actions,
#esd-app .ds-module__head-actions,
#esd-app .topbar__slot--actions {
    overflow: visible;
}
#esd-app .cal-page-module .ds-close-btn {
    flex-shrink: 0;
    margin-right: var(--space-2);
}
#esd-app .dash-bar-chart-wrap {
    --dash-bar-track: var(--ds-surface-muted);
}

/* Mobile ≤767 — siatka zasobu jedna kolumna */
@media (max-width: 767px) {
    #esd-app .ds-product-asset-grid,
    #esd-app .ds-add-product-form__content.ds-product-asset-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        column-gap: 0 !important;
        row-gap: var(--space-5) !important;
    }
    #esd-app .ds-product-asset-grid .ds-add-product-form__column--fields,
    #esd-app .ds-product-asset-grid .ds-add-product-form__column--code {
        grid-column: 1 !important;
        grid-row: auto !important;
        position: static !important;
        top: auto !important;
        padding-inline: 0 !important;
        padding-block: 0 !important;
    }
    #esd-app .ds-product-asset-grid .ds-add-product-form__column-divider {
        display: none !important;
    }
}

/* Tablet 768–1080 — karta zasobu jedna kolumna (Dodaj zasób: 2 kolumny osobno) */
@media (min-width: 768px) and (max-width: 1080px) {
    #esd-app .ds-asset-card-panel .ds-add-product-form__content.ds-product-asset-grid,
    #esd-app #modal-product-details .ds-add-product-form__content.ds-product-asset-grid,
    #esd-app #modal-perform-measurement .ds-add-product-form__content.ds-product-asset-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        column-gap: 0 !important;
        row-gap: var(--space-5) !important;
    }
    #esd-app .ds-asset-card-panel .ds-product-asset-grid .ds-add-product-form__column--fields,
    #esd-app .ds-asset-card-panel .ds-product-asset-grid .ds-add-product-form__column--code,
    #esd-app #modal-product-details .ds-product-asset-grid .ds-add-product-form__column--fields,
    #esd-app #modal-product-details .ds-product-asset-grid .ds-add-product-form__column--code,
    #esd-app #modal-perform-measurement .ds-product-asset-grid .ds-add-product-form__column--fields,
    #esd-app #modal-perform-measurement .ds-product-asset-grid .ds-add-product-form__column--code {
        grid-column: 1 !important;
        grid-row: auto !important;
        position: static !important;
        top: auto !important;
        padding-inline: 0 !important;
        padding-block: 0 !important;
    }
    #esd-app .ds-asset-card-panel .ds-product-asset-grid .ds-add-product-form__column-divider,
    #esd-app #modal-product-details .ds-product-asset-grid .ds-add-product-form__column-divider,
    #esd-app #modal-perform-measurement .ds-product-asset-grid .ds-add-product-form__column-divider {
        display: none !important;
    }
}

/* Mobile ≤1080 — listy entity + karta zasobu (ostatnie nadpisanie kaskady) */
@media (max-width: 1080px) {
    #esd-app .ds-asset-card-panel__section .ds-detail-list__row,
    #esd-app #modal-product-details .ds-detail-list__row,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-detail-list__row,
    #esd-app .slide-panel__drawer--asset-card .ds-detail-list__row {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: var(--space-1) !important;
        align-items: start !important;
    }
    #esd-app .ds-asset-card-panel__body > .ds-add-product-form__content.ds-product-asset-grid {
        overflow: visible !important;
        overflow-y: visible !important;
    }
    /* Karta zasobu — pełny ekran, scroll treści, stopka i nagłówek */
    #esd-app #modal-product-details.slide-panel.show,
    #esd-app #modal-perform-measurement.slide-panel.slide-panel--asset-card.show {
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 0 !important;
    }
    #esd-app #modal-product-details .slide-panel__drawer--asset-card,
    #esd-app #modal-perform-measurement .slide-panel__drawer--asset-card {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }
    #esd-app #modal-product-details .ds-asset-card-panel__header,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__header {
        flex-wrap: nowrap !important;
        align-items: center !important;
        height: var(--ds-panel-chrome-header-min-h) !important;
        min-height: var(--ds-panel-chrome-header-min-h) !important;
        max-height: var(--ds-panel-chrome-header-min-h) !important;
        padding-block: 0 !important;
        overflow: hidden;
    }
    #esd-app #modal-product-details .ds-asset-card-panel__header .ds-card__title,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__header .ds-card__title {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        word-break: normal !important;
        min-width: 0;
        flex: 1 1 auto;
    }
    #esd-app #modal-product-details .ds-asset-card-panel__header .ds-card__header-actions,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__header .ds-card__header-actions {
        align-self: flex-start !important;
        flex-shrink: 0 !important;
        height: auto !important;
        margin-left: auto;
    }
    #esd-app #modal-product-details .ds-asset-card-panel__body,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__body,
    #esd-app #modal-product-details .ds-asset-card-panel__body:has(> .ds-product-asset-grid),
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__body:has(> .ds-product-asset-grid) {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    #esd-app #modal-product-details .ds-asset-card-panel__footer,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__footer {
        flex-wrap: wrap;
        align-items: stretch;
        gap: var(--space-3);
        padding-bottom: calc(var(--ds-content-pad) + env(safe-area-inset-bottom, 0px)) !important;
    }
    #esd-app #modal-product-details .ds-asset-card-panel__footer #btn-product-history,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__footer .btn-outline {
        flex: 1 1 auto;
        min-width: min(100%, 10rem);
        justify-content: center;
    }
    #esd-app #modal-product-details .ds-asset-card-panel__footer .ds-actions-menu,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__footer .ds-actions-menu {
        flex: 1 1 auto;
        min-width: min(100%, 10rem);
        margin-left: 0;
        width: auto;
    }
    #esd-app #modal-product-details .ds-asset-card-panel__footer .ds-actions-menu__trigger,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__footer .ds-actions-menu__trigger {
        width: 100%;
        justify-content: center;
    }
    #esd-app #modal-product-details .ds-detail-list__value--with-action,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-detail-list__value--with-action {
        flex-wrap: wrap;
        row-gap: var(--space-2);
    }
    #esd-app #modal-product-details .ds-detail-list__inline-action,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-detail-list__inline-action {
        margin-left: 0;
    }
    #esd-app #modal-product-details .qr-preview-box:has(.qr-preview-empty),
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .qr-preview-box:has(.qr-preview-empty) {
        min-height: 12rem;
    }
    /* Karta zasobu — mniejszy podgląd QR/barcode na mobile */
    #esd-app #modal-product-details #product-card-qr-preview,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details #meas-card-qr-preview {
        --ds-qr-preview-pad: var(--space-4);
        --ds-qr-preview-min-h: 8.5rem;
        --ds-qr-preview-size-min: 88px;
        --ds-qr-preview-size-max: 168px;
    }
    #esd-app #modal-product-details #product-card-qr-preview:has(:is(.product-code-qr, .product-code-barcode, .product-code-image)),
    #esd-app #modal-perform-measurement .meas-wizard-screen--details #meas-card-qr-preview:has(:is(.product-code-qr, .product-code-barcode, .product-code-image)) {
        min-height: 0;
    }
    #esd-app #modal-product-details #product-card-qr-preview :is(.product-code-qr, .product-code-barcode, .product-code-image),
    #esd-app #modal-perform-measurement .meas-wizard-screen--details #meas-card-qr-preview :is(.product-code-qr, .product-code-barcode, .product-code-image) {
        width: auto;
        max-width: min(100%, var(--ds-qr-preview-size-max));
        margin-inline: auto;
    }
    #esd-app #modal-product-details .prod-code-download-actions,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .prod-code-download-actions {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
    }
    #esd-app #modal-product-details .prod-code-download-actions .btn,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .prod-code-download-actions .btn {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }
    #esd-app .entity-list-card .ds-scroll-lane__inset > .entity-grid.is-shown-grid {
        overflow: visible !important;
        flex: 0 0 auto !important;
        min-height: auto !important;
        height: auto !important;
    }
    /* Listy entity — mobile: symetryczny inset, dolny odstęp w scrollu, bez gutter */
    #esd-app .app-view.entity-view.dashboard-view .entity-list-card .ds-scroll-rail {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    #esd-app .app-view.entity-view.dashboard-view .entity-list-card .ds-scroll-gutter {
        display: none !important;
    }
    #esd-app .app-view.entity-view.dashboard-view .entity-list-card :is(.ds-inset-scroll--host, .ds-content-inset--scroll):has(.entity-grid.is-shown-grid) {
        padding: 0 !important;
    }
    #esd-app .app-view.entity-view.dashboard-view .entity-list-card .ds-scroll-rail__body {
        padding-inline: var(--ds-inset-x) !important;
        padding-bottom: var(--ds-inset-y) !important;
        scroll-padding-bottom: calc(var(--ds-inset-y) + var(--ds-mobile-bottom-nav-inset)) !important;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    [data-entity-toolbar].view-toolbar .view-toolbar__row {
        padding-inline: var(--ds-inset-x) !important;
    }
    [data-entity-toolbar].view-toolbar.view-toolbar--open .view-toolbar__filters {
        padding-inline: var(--ds-inset-x) !important;
    }
    /* Wykonaj pomiar — mobile: symetryczny inset na hoście (bez kolumny gutter) */
    #esd-app #modal-perform-measurement .meas-wizard-form-wrap.ds-inset-scroll--host {
        padding-inline: var(--meas-wizard-inset-x) !important;
        padding-block: var(--meas-wizard-inset-y) !important;
        box-sizing: border-box;
    }
    #esd-app #modal-perform-measurement .meas-wizard-form-wrap .ds-scroll-rail {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    #esd-app #modal-perform-measurement .meas-wizard-form-wrap .ds-scroll-gutter {
        display: none !important;
    }
    #esd-app #modal-perform-measurement .meas-wizard-form-wrap .ds-scroll-rail__body {
        padding: 0 !important;
    }
    #esd-app #modal-perform-measurement .meas-wizard-step__inner--wide,
    #esd-app #modal-perform-measurement .meas-wizard-step__inner--wide.meas-wizard-step__inner--finish {
        gap: var(--space-8) !important;
    }
    #esd-app #modal-perform-measurement .meas-points-phase--setup.is-active {
        gap: var(--space-8) !important;
    }
    #esd-app #modal-perform-measurement .ds-add-product-form--measurement .ds-add-product-form__section-divider {
        margin: var(--ds-panel-form-divider-margin) 0 !important;
    }
    /* Popupy — pełny ekran na mobile (bez marginesów i zaokrągleń) */
    #esd-app .slide-panel.ds-dialog.show,
    #esd-app .slide-panel.ds-dialog.is-closing {
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 0 !important;
    }
    #esd-app .slide-panel.ds-dialog .slide-panel__drawer,
    #esd-app .slide-panel.show:not(.ds-dialog) .slide-panel__drawer,
    #esd-app .slide-panel.is-closing:not(.ds-dialog) .slide-panel__drawer {
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border-left: none !important;
        box-shadow: none !important;
        transform: none !important;
        opacity: 1 !important;
        animation: none !important;
    }
    #esd-app .slide-panel.ds-dialog.show .slide-panel__drawer,
    #esd-app .slide-panel.ds-dialog.is-closing .slide-panel__drawer {
        position: absolute !important;
    }
    #esd-app .slide-panel__drawer--asset-card .ds-asset-card-panel,
    #esd-app .slide-panel__drawer--form-panel .ds-add-product-form__panel {
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }
    #esd-app .slide-panel__drawer--form-panel {
        padding: 0 !important;
        background: var(--ds-surface) !important;
    }
    #esd-app .ds-dialog.show:not(.slide-panel):not(.ds-wizard-dialog),
    #esd-app .ds-dialog.is-closing:not(.slide-panel):not(.ds-wizard-dialog) {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }
    #esd-app .ds-dialog.show:not(.slide-panel):not(.ds-wizard-dialog) .ds-dialog__panel,
    #esd-app .ds-dialog.is-closing:not(.slide-panel):not(.ds-wizard-dialog) .ds-dialog__panel {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
    #esd-app .slide-panel .slide-panel__header:not(.slide-panel__header--meas),
    #esd-app .slide-panel .slide-panel__subhead:not(.slide-panel__subhead--meas),
    #esd-app .slide-panel .slide-panel__body:not(.slide-panel__body--meas-wizard),
    #esd-app .slide-panel .slide-panel__footer,
    #esd-app .ds-dialog:not(.slide-panel):not(.ds-wizard-dialog) .ds-dialog__header,
    #esd-app .ds-dialog:not(.slide-panel):not(.ds-wizard-dialog) .ds-dialog__body,
    #esd-app .ds-dialog:not(.slide-panel):not(.ds-wizard-dialog) .ds-dialog__footer {
        padding-inline: var(--ds-content-pad) !important;
    }
    #esd-app .slide-panel .slide-panel__footer,
    #esd-app .ds-dialog:not(.slide-panel):not(.ds-wizard-dialog) .ds-dialog__footer {
        padding-bottom: calc(var(--ds-content-pad) + env(safe-area-inset-bottom, 0px)) !important;
    }
}

@media (max-width: 480px) {
    #esd-app #modal-product-details .ds-asset-card-panel__footer,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__footer {
        flex-direction: column-reverse;
    }
    #esd-app #modal-product-details .ds-asset-card-panel__footer #btn-product-history,
    #esd-app #modal-product-details .ds-asset-card-panel__footer .ds-actions-menu,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__footer .btn-outline,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details .ds-asset-card-panel__footer .ds-actions-menu {
        width: 100%;
        min-width: 0;
    }
    #esd-app #modal-product-details #product-card-qr-preview,
    #esd-app #modal-perform-measurement .meas-wizard-screen--details #meas-card-qr-preview {
        --ds-qr-preview-size-max: 144px;
        --ds-qr-preview-min-h: 7.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DS COMPONENTS — kanoniczne warianty i stany (produkcja = esd-style-guide)
   Ostatnia sekcja pliku — nadpisuje konflikty kaskady.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── #44–46 Mobile bottom nav ─────────────────────────────────────────────
   Warianty: domyślnie labeled · modyfikator .mobile-bottom-nav--icons-only
   Stany: default · :hover · .active · :active · :focus-visible
   Markup: .mobile-bottom-nav__item + .material-symbols-outlined + .mobile-bottom-nav__label
   ──────────────────────────────────────────────────────────────────────── */
.mobile-bottom-nav .mobile-bottom-nav__item:not(.mobile-bottom-nav__item--scan) {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 2px 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ds-text-secondary);
    font-family: var(--font-ui);
    font-size: var(--ds-type-caption-size);
    font-weight: var(--ds-type-caption-weight);
    line-height: 1.1;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
    transition:
        color var(--ds-motion-fast) var(--ds-ease-out),
        transform var(--ds-motion-fast) var(--ds-ease-out);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.mobile-bottom-nav .mobile-bottom-nav__item:not(.mobile-bottom-nav__item--scan) .material-symbols-outlined {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    box-sizing: border-box;
    color: var(--ds-text-secondary);
    background: transparent;
    transition:
        background var(--ds-motion-fast) var(--ds-ease-out),
        color var(--ds-motion-fast) var(--ds-ease-out),
        transform var(--ds-motion-fast) var(--ds-ease-out);
}
.mobile-bottom-nav .mobile-bottom-nav__item:not(.mobile-bottom-nav__item--scan) .mobile-bottom-nav__label,
.mobile-bottom-nav .mobile-bottom-nav__item:not(.mobile-bottom-nav__item--scan) > span:not(.material-symbols-outlined):not(.mobile-bottom-nav__label) {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.1;
}
.mobile-bottom-nav .mobile-bottom-nav__item.active:not(.mobile-bottom-nav__item--scan) {
    color: var(--ds-text);
    background: none;
}
.mobile-bottom-nav .mobile-bottom-nav__item.active:not(.mobile-bottom-nav__item--scan) .material-symbols-outlined {
    background: var(--ds-surface-muted);
    color: var(--ds-text);
}
@media (hover: hover) {
    .mobile-bottom-nav .mobile-bottom-nav__item:not(.mobile-bottom-nav__item--scan):hover {
        color: var(--ds-text);
        background: none;
    }
    .mobile-bottom-nav .mobile-bottom-nav__item:not(.mobile-bottom-nav__item--scan):hover .material-symbols-outlined {
        background: var(--ds-surface-hover);
        color: var(--ds-text);
    }
    .mobile-bottom-nav .mobile-bottom-nav__item.active:not(.mobile-bottom-nav__item--scan):hover .material-symbols-outlined {
        background: var(--ds-surface-muted);
    }
}
.mobile-bottom-nav .mobile-bottom-nav__item:not(.mobile-bottom-nav__item--scan):active .material-symbols-outlined {
    background: var(--ds-border);
    color: var(--ds-text);
    transform: scale(0.96);
}
.mobile-bottom-nav .mobile-bottom-nav__item:not(.mobile-bottom-nav__item--scan):focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
.mobile-bottom-nav .mobile-bottom-nav__item:not(.mobile-bottom-nav__item--scan):focus-visible .material-symbols-outlined {
    box-shadow: none;
}

/* Wariant: tylko ikony (produkcja — aplikacja ESD) */
.mobile-bottom-nav.mobile-bottom-nav--icons-only {
    align-items: center;
    min-height: 54px;
    padding-top: 4px;
}
.mobile-bottom-nav.mobile-bottom-nav--icons-only .mobile-bottom-nav__item:not(.mobile-bottom-nav__item--scan) {
    justify-content: center;
    padding: 4px 2px;
}
.mobile-bottom-nav.mobile-bottom-nav--icons-only .mobile-bottom-nav__item:not(.mobile-bottom-nav__item--scan) .material-symbols-outlined {
    width: 48px;
    height: 48px;
}
.mobile-bottom-nav.mobile-bottom-nav--icons-only .mobile-bottom-nav__item .mobile-bottom-nav__label,
.mobile-bottom-nav.mobile-bottom-nav--icons-only .mobile-bottom-nav__item > span:not(.material-symbols-outlined) {
    display: none !important;
}

/* ── compliance-v4/v5 host — pulpit wypełnia kartę ───────────────────── */
#esd-app .compliance-v5-host .compliance-chart,
#esd-app .compliance-v5-host .compliance-v4,
#esd-app .compliance-v5-host .compliance-v5 {
    width: 100%;
    min-height: 0;
}
#esd-app .compliance-v5-host .compliance-chart,
#esd-app .compliance-v5-host .compliance-v4,
#esd-app .compliance-v5-host .compliance-v5 {
    height: 100%;
}
/* ── Pulpit — odstęp nad/pod wykresem zgodności (koniec pliku = najwyższa kaskada) ── */
#esd-app #view-dashboard .dashboard-row--charts .ds-card--compliance .ds-card__body--grow {
    justify-content: center;
}
#esd-app #view-dashboard .dashboard-row--charts .compliance-chart {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
}
#esd-app #view-dashboard .dashboard-row--charts .compliance-chart__grid {
    margin: 0 !important;
}

/* ── Mobile — hamburger bez animacji ikony ── */
.topbar__menu-btn .material-symbols-outlined,
.topbar__menu-btn:hover .material-symbols-outlined,
.topbar__menu-btn:active .material-symbols-outlined,
.topbar__menu-btn:focus-visible .material-symbols-outlined {
    transform: none !important;
    animation: none !important;
}
.topbar__menu-btn:hover,
.topbar__menu-btn:active {
    transform: none !important;
}

/* ── Przyciski — stany focus (uzupełnienie macierzy SG) ──────────────── */
.btn-brand:focus-visible,
.btn-accent:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring-on-fill) !important;
}
.btn-text:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
.btn-secondary:focus-visible,
.btn-ghost:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
.btn:focus-visible {
    box-shadow: var(--ds-focus-ring) !important;
}
.btn-primary:focus-visible {
    box-shadow: var(--ds-focus-ring-on-fill) !important;
}
.btn-outline:focus-visible {
    box-shadow: var(--ds-focus-ring) !important;
}
.btn-outline.btn-outline--active:focus-visible:not(:disabled),
#esd-app .view-toolbar__actions [id^="btn-toggle-filters"].btn-outline--active:focus-visible:not(:disabled),
#esd-app .view-toolbar__actions .view-toolbar__mobile-toggle.btn-outline--active:focus-visible:not(:disabled) {
    outline: none;
    border-color: var(--ds-interactive-focus-border) !important;
    box-shadow: var(--ds-interactive-focus-ring) !important;
}

/* ── Focus — wszystkie klikalne komponenty (#esd-app) ─────────────────
   Jeden inset ring (--ds-focus-ring); na ciemnym/żółtym tle: --ds-focus-ring-on-fill.
─────────────────────────────────────────────────────────────────────────── */
#esd-app :is(button, a)[class*="ds-list-item"]:focus-visible,
#esd-app button.ds-list-item--interactive:focus-visible,
#esd-app .ds-list-item--has-menu > .ds-list-item__open:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
    scroll-margin-block: 4px;
}
#esd-app .ds-list-item--has-menu > .ds-list-item__open:focus-visible {
    border-radius: calc(var(--radius-sm) - 1px);
}
#esd-app :is(.dropdown-actions, .ds-row-kebab) > .icon-btn.ds-kebab-btn:focus-visible,
#esd-app :is(.dropdown-actions, .ds-row-kebab) > .icon-btn.icon-btn--sm.icon-btn--ghost:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
    border-color: var(--ds-border-strong);
    background: var(--ds-surface-muted);
    scroll-margin-block: 4px;
}
#esd-app .dropdown-actions__item:focus-visible,
#esd-app .dropdown-actions-content :is(a, button):focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .cal-cell:focus-visible:not(.cal-cell--muted) {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .cal-cell--selected:focus-visible {
    box-shadow: var(--ds-focus-ring-on-fill) !important;
}
#esd-app .cal-view-toggle__btn:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .cal-view-dropdown__trigger:focus-visible {
    outline: none;
    border-color: var(--ds-border-strong);
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .cal-view-dropdown__option:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .custom-option:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .custom-calendar-popup .calendar-day:focus-visible:not(.muted):not(.empty),
#esd-app .calendar-grid .calendar-day:focus-visible:not(.muted):not(.empty) {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .custom-calendar-popup .calendar-day.selected:focus-visible,
#esd-app .calendar-grid .calendar-day.selected:focus-visible {
    box-shadow: var(--ds-focus-ring-on-fill) !important;
}
#esd-app .entity-card:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
    border-color: var(--ds-border-strong);
}
#esd-app .dash-quick-btn:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
    border-color: var(--ds-border-strong);
}
#esd-app .ds-actions-menu__trigger:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .ds-actions-menu__item:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app :is(.ds-head-dropdown__option, .notif-filter-mobile__option):focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .cal-mobile-actions__item:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .mobile-fab-menu__item:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
    border-color: var(--ds-border-strong);
}
#esd-app .notif-mark-read:focus-visible,
#esd-app .notif-mark-read--list:focus-visible,
#esd-app .notif-mark-read-btn:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
    border-radius: var(--radius-xs);
}
#esd-app .avatar-picker__option:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .ds-info-tip:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .sidebar-rail-toggle:focus-visible {
    outline: none;
}
#esd-app .sidebar-rail-toggle:focus-visible .sidebar-rail-toggle__btn {
    box-shadow: var(--ds-focus-ring-on-fill) !important;
}
#esd-app .schedule-date-step__cal-btn:focus-visible:not(:disabled) {
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app button.compliance-chart__col:focus-visible {
    box-shadow: var(--ds-focus-ring) !important;
}
#esd-app .cal-time-grid__event:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}
#view-dashboard #dash-calendar-module .ds-card__header--dash-cal :is(.btn-cal-nav, .ds-close-btn):focus-visible {
    box-shadow: var(--ds-focus-ring) !important;
    transform: none !important;
}

.code-scanner-overlay.modal {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 10100;
}
.code-scanner-overlay.modal.show {
    animation: none;
    background: transparent;
    display: flex;
}
body.code-scanner-open {
    overflow: hidden;
}
body.code-scanner-open #main-app,
body.code-scanner-open #mobile-bottom-nav,
body.code-scanner-open #mobile-fab-menu,
body.code-scanner-open #toast-container {
    visibility: hidden;
}
.code-scanner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    background: transparent;
    color: #fff;
    box-sizing: border-box;
    --scan-size: min(72vw, min(calc(100dvh - 240px), 300px));
    --scan-shade-opacity: 0.48;
}
.code-scanner__top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: calc(env(safe-area-inset-top, 0px) + var(--space-3)) var(--space-4) var(--space-3);
    background: transparent;
    pointer-events: auto;
}
.code-scanner__title {
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}
.code-scanner__close {
    color: #fff;
}
.code-scanner__close .material-symbols-outlined {
    color: inherit;
    filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.65));
}
.code-scanner__camera {
    position: fixed;
    inset: 0;
    width: max(100vw, var(--ds-app-min-w));
    min-width: var(--ds-app-min-w);
    height: 100dvh;
    z-index: 0;
    overflow: hidden;
    background: transparent;
    right: auto;
}
.code-scanner__camera #qr-reader {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    inset: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
}
.code-scanner__camera #qr-reader > div,
.code-scanner__camera > div {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    inset: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
}
.code-scanner__camera video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
}
.code-scanner__camera #qr-reader__dashboard_section,
.code-scanner__camera #qr-reader__scan_region,
.code-scanner__camera #qr-reader__header_message,
.code-scanner__camera #qr-reader__scan_region > img,
.code-scanner__camera canvas {
    display: none !important;
}
.code-scanner__mask {
    position: fixed;
    inset: 0;
    width: max(100vw, var(--ds-app-min-w));
    min-width: var(--ds-app-min-w);
    height: 100dvh;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    right: auto;
}
.code-scanner__svg-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.code-scanner__viewport {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding:
        calc(env(safe-area-inset-top, 0px) + 56px)
        var(--space-4)
        calc(env(safe-area-inset-bottom, 0px) + 88px);
    box-sizing: border-box;
    background: transparent;
}
.code-scanner__frame {
    position: relative;
    flex-shrink: 0;
    width: var(--scan-size);
    height: var(--scan-size);
    min-width: var(--scan-size);
    min-height: var(--scan-size);
    aspect-ratio: 1 / 1;
    background: transparent;
    overflow: visible;
}
.code-scanner__corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid var(--ds-brand-cta);
    box-sizing: border-box;
}
.code-scanner__corner--tl { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 10px 0 0 0; }
.code-scanner__corner--tr { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 10px 0 0; }
.code-scanner__corner--bl { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 10px; }
.code-scanner__corner--br { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 10px 0; }
.code-scanner__line {
    position: absolute;
    left: 8%;
    right: 8%;
    height: 2px;
    top: 12%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 207, 51, 0.95) 50%, transparent 100%);
    box-shadow: 0 0 10px rgba(255, 207, 51, 0.85);
    animation: code-scanner-line 2.4s ease-in-out infinite;
}
@keyframes code-scanner-line {
    0%, 100% { top: 12%; opacity: 0.75; }
    50% { top: 88%; opacity: 1; }
}
.code-scanner__footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-4) calc(env(safe-area-inset-bottom, 0px) + var(--space-5));
    background: transparent;
    pointer-events: auto;
}
.code-scanner__hint {
    margin: 0;
    text-align: center;
    font-size: var(--text-sm);
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
    max-width: var(--scan-size);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75);
}
.code-scanner__manual {
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
.code-scanner__manual:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* Blokada orientacji poziomej na telefonach (tylko po zalogowaniu) */
html:not(.app-authenticated) .esd-portrait-lock {
    display: none !important;
}
html:not(.app-authenticated) body.esd-portrait-locked {
    overflow: auto;
}
.esd-portrait-lock {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    background: var(--ds-surface);
    color: var(--ds-text);
    text-align: center;
    box-sizing: border-box;
}
.esd-portrait-lock:not([hidden]) {
    display: flex;
}
.esd-portrait-lock__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    max-width: 18rem;
}
.esd-portrait-lock__icon {
    font-size: 3rem;
    color: var(--ds-text-secondary);
}
.esd-portrait-lock__text {
    margin: 0;
    font-size: var(--text-md);
    line-height: 1.45;
    color: var(--ds-text-secondary);
}
body.esd-portrait-locked {
    overflow: hidden;
}

/* ── Rejestr komponentów DS (indeks — każda sekcja w tym pliku) ───────
   Fundamenty: :root tokeny (~L1)
   Przyciski: .btn * (~L845) · stany EOF
   Pola: .form-group (~L4450) · .ds-check · .ds-radio · .ds-toggle
   Nav: .nav-item (~L9173) · .mobile-bottom-nav EOF (#44–46)
   Karty: .ds-card (~L1415) · .kpi-card (~L1668)
   Listy: .ds-entity-list-view (~L563) · .data-table
   Status: .ds-status-badge (~L4341)
   Kalendarz: .cal-module--drilldown (~L4979) · #cal-page-module (~L5631)
   Wykres: .compliance-v5 (~L17988)
   Overlay: .modal (~L6976) · .slide-panel (~L14513) · .mobile-fab-menu
   ──────────────────────────────────────────────────────────────────────── */
