/* SUW - GUI Standard (zgodnie z .cursor/rules/gui-preservation.mdc)
 * Font: Inter (Google Fonts), fallback: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif
 * Design tokens: zmienne CSS w :root (nie modyfikować). Breakpoints: 1200px, 900px.
 */
:root {
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --primary-hue: 222;
    --primary-sat: 47%;
    --navy-900: hsl(var(--primary-hue), var(--primary-sat), 7%);
    --navy-800: hsl(var(--primary-hue), var(--primary-sat), 11%);
    --navy-700: hsl(var(--primary-hue), var(--primary-sat), 18%);
    --navy-600: hsl(var(--primary-hue), var(--primary-sat), 26%);
    --accent-hue: 217;
    --accent-primary: hsl(var(--accent-hue), 91%, 60%);
    --accent-light: hsl(var(--accent-hue), 91%, 70%);
    --accent-dark: hsl(var(--accent-hue), 91%, 50%);
    --accent-subtle: hsla(var(--accent-hue), 91%, 60%, 0.12);
    --accent-glow: hsla(var(--accent-hue), 91%, 60%, 0.25);
    --bg-page: var(--navy-900);
    --bg-card: var(--navy-800);
    --bg-elevated: var(--navy-700);
    --bg-hover: hsla(var(--accent-hue), 91%, 60%, 0.08);
    --bg-active: hsla(var(--accent-hue), 91%, 60%, 0.15);
    --border-subtle: rgba(148, 163, 184, 0.08);
    --border-default: rgba(148, 163, 184, 0.12);
    --border-strong: rgba(148, 163, 184, 0.2);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --success: #22c55e; --success-subtle: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b; --warning-subtle: rgba(245, 158, 11, 0.12);
    --danger: #ef4444; --danger-subtle: rgba(239, 68, 68, 0.12);
    --info: #8b5cf6; --info-subtle: rgba(139, 92, 246, 0.12);
    --orange: #f97316; --orange-subtle: rgba(249, 115, 22, 0.12);
    --font-size-xs: 10px; --font-size-sm: 12px; --font-size-base: 13px; --font-size-lg: 15px; --font-size-xl: 18px;
    --space-xs: 4px; --space-sm: 6px; --space-md: 10px; --space-lg: 14px; --space-xl: 20px; --space-2xl: 32px;
    --radius-xs: 4px; --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.15); --shadow-md: 0 4px 16px rgba(0,0,0,0.2); --shadow-lg: 0 8px 32px rgba(0,0,0,0.3);
    --header-height: 56px;
    --transition-fast: 0.1s ease; --transition-base: 0.15s ease;
    --z-dropdown: 100; --z-sticky: 200; --z-modal-backdrop: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;
}
body.light-theme {
    --bg-page: #f1f5f9; --bg-card: #ffffff; --bg-elevated: #f8fafc;
    --bg-hover: rgba(59, 130, 246, 0.06); --bg-active: rgba(59, 130, 246, 0.1);
    --border-subtle: rgba(15, 23, 42, 0.05); --border-default: rgba(15, 23, 42, 0.08); --border-strong: rgba(15, 23, 42, 0.12);
    --text-primary: #0f172a; --text-secondary: #334155; --text-muted: #64748b;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08); --shadow-md: 0 4px 16px rgba(0,0,0,0.1); --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
}
/* Office theme — paleta wzorowana na formularzu JR (navy + slate + biały).
   Wszystkie nadpisania izolowane w tym selektorze — :root i .light-theme bez zmian.
   Bezpieczne: jak user nie wybierze "Office" w preferencjach, nic się nie aktywuje. */
body.office-theme {
    --font-family-base: 'Segoe UI', Tahoma, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    /* Akcent: navy #1e3a8a (głęboki granat z JR) — używany dla headings, badges, focus rings */
    --accent-primary: #1e3a8a;
    --accent-light: #2563eb;       /* Action button blue */
    --accent-dark: #1e40af;
    --accent-subtle: rgba(30, 58, 138, 0.10);
    --accent-glow: rgba(30, 58, 138, 0.22);
    /* Tła: jasny "papier" z białymi kartami */
    --bg-page: #f3f4f6;
    --bg-card: #ffffff;
    --bg-elevated: #fafafa;
    --bg-hover: rgba(30, 58, 138, 0.06);
    --bg-active: rgba(30, 58, 138, 0.10);
    /* Bordery slate (jak w JR HTML) */
    --border-subtle: rgba(15, 23, 42, 0.06);
    --border-default: #e5e7eb;
    --border-strong: #cbd5e1;
    /* Tekst */
    --text-primary: #222222;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    /* Subtle cienie (jak na papierze) */
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    /* Mniejsze radiusy = bardziej "dokumentowo" */
    --radius-xs: 2px; --radius-sm: 3px; --radius-md: 4px; --radius-lg: 6px; --radius-xl: 8px;
    /* Warning/info — ciepły żółty w stylu JR info-box */
    --warning: #d97706; --warning-subtle: #fef3c7;
}
/* Office theme — drobne korekty estetyczne (nie wymagają zmian markup) */
body.office-theme .page-title,
body.office-theme .modal-title,
body.office-theme h1, body.office-theme h2 {
    color: var(--accent-primary);
}
body.office-theme .table-head {
    background: #f9fafb;
    border-bottom: 1px solid var(--border-strong);
}
body.office-theme .table-head-cell {
    color: #374151;
    font-weight: 600;
    border-bottom: none;
}
body.office-theme .modal-window {
    border: 1px solid var(--border-default);
}
body.office-theme .btn-primary,
body.office-theme .nav-btn.active {
    background: var(--accent-light);
    border-color: var(--accent-light);
}
body.office-theme .btn-primary:hover { background: var(--accent-primary); }
/* Office: szerszy modal "Nowe zgłoszenie" + draggable modal-window, lekki backdrop bez blura */
body.office-theme .modal-backdrop {
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
body.office-theme .modal {
    max-width: 800px;
}
body.office-theme .modal-window {
    min-width: 640px;
    min-height: 480px;
}

/* ── PINK THEME — paleta różowa, paper-like (jak Office ale z różowym akcentem)
   Przyjazny, ciepły, dobry dla działów HR/komunikacji. Akcent: rose-500 (#ec4899).
   Wszystko izolowane w selektorze body.pink-theme. */
body.pink-theme {
    --accent-primary: #db2777;      /* rose-600 */
    --accent-light: #ec4899;        /* rose-500 — action buttons */
    --accent-dark: #be185d;         /* rose-700 */
    --accent-subtle: rgba(219, 39, 119, 0.10);
    --accent-glow: rgba(219, 39, 119, 0.25);
    --bg-page: #fdf2f8;              /* rose-50 */
    --bg-card: #ffffff;
    --bg-elevated: #fce7f3;          /* rose-100 — bardzo subtelne */
    --bg-hover: rgba(219, 39, 119, 0.06);
    --bg-active: rgba(219, 39, 119, 0.10);
    --border-subtle: rgba(157, 23, 77, 0.06);
    --border-default: #fbcfe8;       /* rose-200 */
    --border-strong: #f9a8d4;        /* rose-300 */
    --text-primary: #1f1f24;
    --text-secondary: #3f3f46;
    --text-muted: #6b7280;
    --shadow-sm: 0 1px 4px rgba(219, 39, 119, 0.08);
    --shadow-md: 0 2px 12px rgba(219, 39, 119, 0.10);
    --shadow-lg: 0 4px 20px rgba(219, 39, 119, 0.14);
}
body.pink-theme .table-head {
    background: #fce7f3;
    border-bottom: 1px solid var(--border-strong);
}
body.pink-theme .table-head-cell { color: #831843; font-weight: 600; border-bottom: none; }
body.pink-theme .btn-primary,
body.pink-theme .nav-btn.active {
    background: var(--accent-light);
    border-color: var(--accent-light);
}
body.pink-theme .btn-primary:hover { background: var(--accent-primary); }

/* ── ORANGE THEME — paleta pomarańczowa, ciepła, energetyczna.
   Dobry dla działu kreatywnego/marketingu. Akcent: orange-600 (#ea580c). */
body.orange-theme {
    --accent-primary: #ea580c;      /* orange-600 */
    --accent-light: #f97316;        /* orange-500 */
    --accent-dark: #c2410c;         /* orange-700 */
    --accent-subtle: rgba(234, 88, 12, 0.10);
    --accent-glow: rgba(234, 88, 12, 0.25);
    --bg-page: #fff7ed;              /* orange-50 */
    --bg-card: #ffffff;
    --bg-elevated: #ffedd5;          /* orange-100 — bardzo subtelne */
    --bg-hover: rgba(234, 88, 12, 0.06);
    --bg-active: rgba(234, 88, 12, 0.10);
    --border-subtle: rgba(154, 52, 18, 0.06);
    --border-default: #fed7aa;       /* orange-200 */
    --border-strong: #fdba74;        /* orange-300 */
    --text-primary: #1f1f24;
    --text-secondary: #3f3f46;
    --text-muted: #6b7280;
    --shadow-sm: 0 1px 4px rgba(234, 88, 12, 0.08);
    --shadow-md: 0 2px 12px rgba(234, 88, 12, 0.10);
    --shadow-lg: 0 4px 20px rgba(234, 88, 12, 0.14);
}
body.orange-theme .table-head {
    background: #ffedd5;
    border-bottom: 1px solid var(--border-strong);
}
body.orange-theme .table-head-cell { color: #7c2d12; font-weight: 600; border-bottom: none; }
body.orange-theme .btn-primary,
body.orange-theme .nav-btn.active {
    background: var(--accent-light);
    border-color: var(--accent-light);
}
body.orange-theme .btn-primary:hover { background: var(--accent-primary); }
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body { font-family: var(--font-family-base); font-size: var(--font-size-base); background: var(--bg-page); color: var(--text-primary); line-height: 1.4; display: flex; flex-direction: column; }
/* Jednolite rozmiary tekstu – wszędzie używaj tych klas zamiast inline font-size */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 200px; background: radial-gradient(ellipse 60% 50% at 50% -10%, var(--accent-glow), transparent); pointer-events: none; z-index: 0; opacity: 0.5; }
a { color: var(--accent-primary); text-decoration: none; }

/* HEADER */
.app-header { position: relative; z-index: var(--z-sticky); display: flex; align-items: center; justify-content: space-between; gap: var(--space-xl); padding: var(--space-sm) var(--space-xl); height: var(--header-height); background: var(--bg-card); border-bottom: 1px solid var(--border-default); flex-shrink: 0; min-height: 0; }
.header-left, .header-right { display: flex; align-items: center; gap: var(--space-xl); min-width: 0; }
.header-right { gap: var(--space-sm); flex-shrink: 0; }
.app-logo { display: flex; align-items: center; gap: var(--space-md); text-decoration: none; color: inherit; flex-shrink: 0; min-width: 0; }
.logo-mark { width: 36px; height: 36px; min-width: 36px; flex-shrink: 0; background: linear-gradient(135deg, var(--accent-primary), var(--accent-light)); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px var(--accent-glow); }
.logo-mark svg { width: 18px; height: 18px; color: white; }
.logo-text { font-size: var(--font-size-xl); font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-subtitle { font-size: var(--font-size-xs); color: var(--text-muted); font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; line-height: 1.3; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-logo > div { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; min-height: 0; }
.main-nav { flex-shrink: 1; min-width: 0; }
.header-right .icon-btn { flex-shrink: 0; min-width: 36px; }
.user-menu { flex-shrink: 0; min-width: 0; }
.user-avatar { flex-shrink: 0; width: 32px; height: 32px; min-width: 32px; }

/* NAV */
.main-nav { display: flex; align-items: center; gap: 2px; background: var(--bg-elevated); border-radius: var(--radius-md); padding: 3px; border: 1px solid var(--border-subtle); }
.nav-item { position: relative; }
.nav-btn { display: flex; align-items: center; gap: 5px; padding: 6px 12px; background: transparent; border: none; border-radius: var(--radius-sm); color: var(--text-secondary); font-family: inherit; font-size: var(--font-size-sm); font-weight: 600; cursor: pointer; transition: all var(--transition-base); white-space: nowrap; }
.nav-btn svg { width: 15px; height: 15px; }
.nav-btn:hover:not(.active) { background: var(--bg-hover); color: var(--text-primary); }
.nav-btn.active { background: var(--accent-primary); color: white; box-shadow: 0 2px 6px var(--accent-glow); }
/* Stałe miejsce na licznik – przyciski nie przesuwają się przy zmianie liczby */
.nav-btn .nav-count-slot { display: inline-flex; align-items: center; justify-content: center; width: 22px; min-width: 22px; flex-shrink: 0; margin-left: 4px; }
.nav-btn .count { padding: 1px 4px; border-radius: var(--radius-xs); font-size: var(--font-size-xs); font-weight: 700; background: rgba(255,255,255,0.2); text-align: center; line-height: 1.2; }
.nav-btn:not(.active) .count { background: var(--border-strong); color: var(--text-primary); }
.nav-dropdown-item .count { flex-shrink: 0; min-width: 18px; max-width: 28px; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.urgent-dot { position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; background: var(--danger); border-radius: 50%; border: 2px solid var(--bg-elevated); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* NAV DROPDOWN */
.nav-dropdown { position: relative; }
.nav-chevron { width: 12px !important; height: 12px !important; margin-left: 2px; transition: transform var(--transition-base); }
.nav-dropdown.open .nav-chevron { transform: rotate(180deg); }
.nav-dropdown-menu { position: absolute; top: calc(100% + 6px); left: 0; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 6px; min-width: 200px; box-shadow: var(--shadow-lg); z-index: var(--z-dropdown); display: none; }
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: var(--font-size-sm); cursor: pointer; transition: all var(--transition-fast); }
.nav-dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-dropdown-item svg { width: 14px; height: 14px; color: var(--accent-primary); }
.nav-dropdown-item .count { margin-left: auto; padding: 1px 6px; background: var(--accent-subtle); color: var(--accent-primary); border-radius: var(--radius-xs); font-size: var(--font-size-xs); font-weight: 700; }

/* ICON BTN & USER MENU */
.icon-btn { position: relative; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border-default); border-radius: var(--radius-md); color: var(--text-muted); cursor: pointer; transition: all var(--transition-base); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--bg-hover); border-color: var(--accent-primary); color: var(--accent-primary); }
.icon-btn .badge { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; min-width: 8px; min-height: 8px; background: var(--danger); border-radius: 50%; border: none; box-sizing: border-box; }
.icon-btn .badge:empty { display: none; }
.icon-btn .badge.badge-count { width: auto; min-width: 18px; height: 16px; padding: 0 5px; border-radius: 8px; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
/* Notifications dropdown (Faza 6) */
.notifications-dropdown { position: relative; }
.notifications-dropdown-menu { position: absolute; top: calc(100% + 6px); right: 0; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); min-width: 280px; max-width: 360px; box-shadow: var(--shadow-lg); z-index: var(--z-dropdown); }
.notification-item { display: block; padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); font-size: var(--font-size-sm); color: var(--text-secondary); cursor: pointer; transition: background var(--transition-fast); text-align: left; width: 100%; }
.notification-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.notification-item:last-child { border-bottom: none; }
.notification-item.unread { background: var(--accent-subtle); }
.notification-item .notification-title { font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notification-item .notification-meta { font-size: var(--font-size-xs); color: var(--text-muted); }
.user-menu { position: relative; display: flex; align-items: center; gap: var(--space-sm); padding: 4px 10px 4px 4px; border-radius: var(--radius-md); cursor: pointer; transition: background var(--transition-base); margin-left: var(--space-xs); }
.user-menu:hover { background: var(--bg-hover); }
.user-avatar { width: 30px; height: 30px; background: linear-gradient(135deg, var(--accent-primary), var(--info)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: var(--font-size-xs); font-weight: 700; color: white; flex-shrink: 0; overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-menu > div { min-width: 0; }
.user-name { font-size: var(--font-size-sm); font-weight: 600; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: var(--font-size-xs); color: var(--text-muted); line-height: 1.25; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chevron { width: 14px; height: 14px; color: var(--text-muted); margin-left: var(--space-xs); transition: transform var(--transition-base); }
.user-menu.open .user-chevron { transform: rotate(180deg); }
.user-dropdown-menu { position: absolute; top: calc(100% + 6px); right: 0; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 6px; min-width: 200px; box-shadow: var(--shadow-lg); z-index: var(--z-dropdown); display: none; }
.user-menu.open .user-dropdown-menu { display: block; }
.user-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: var(--font-size-sm); cursor: pointer; transition: all var(--transition-fast); }
.user-dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.user-dropdown-item svg { width: 14px; height: 14px; color: var(--accent-primary); }
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item.danger svg { color: var(--danger); }
.user-dropdown-item.danger:hover { background: var(--danger-subtle); }
.user-dropdown-divider { height: 1px; background: var(--border-subtle); margin: 4px 0; }

/* MAIN CONTENT */
.main-content { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; padding: var(--space-lg) var(--space-xl); overflow: hidden; min-height: 0; }
.page-section { display: none; }
.page-section.active { display: flex; flex-direction: column; flex: 1; overflow-y: auto; overflow-x: hidden; }

/* TOOLBAR */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); margin-bottom: var(--space-lg); flex-shrink: 0; flex-wrap: wrap; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: var(--space-lg); }
.toolbar-right { gap: var(--space-sm); }
.page-title { font-size: var(--font-size-lg); font-weight: 700; display: flex; align-items: center; gap: var(--space-sm); }
.page-title svg { width: 20px; height: 20px; color: var(--accent-primary); }
.page-subtitle { font-size: var(--font-size-sm); color: var(--text-muted); margin-left: var(--space-md); }

/* TABS */
.tabs-inline { display: flex; align-items: center; gap: 2px; }
.modal-tabs { display: flex; align-items: center; gap: 2px; padding: 0 var(--space-md); margin-bottom: 0; border-bottom: 1px solid var(--border-light); }
.modal-tab-btn { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: transparent; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0; color: var(--text-muted); font-family: inherit; font-size: var(--font-size-sm); font-weight: 600; cursor: pointer; transition: all var(--transition-base); }
.modal-tab-btn:hover { color: var(--text-primary); }
.modal-tab-btn.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
.tab-btn { display: flex; align-items: center; gap: 5px; padding: 6px 28px 6px 12px; background: transparent; border: none; border-radius: var(--radius-sm); color: var(--text-muted); font-family: inherit; font-size: var(--font-size-sm); font-weight: 600; cursor: pointer; transition: all var(--transition-base); white-space: nowrap; }
.tab-btn > svg, .tab-btn > i svg { width: 14px; height: 14px; flex-shrink: 0; }
.tab-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.tab-btn.active { color: var(--accent-primary); background: var(--accent-subtle); }
.tab-btn { position: relative; }
.tab-badge { padding: 1px 6px; background: var(--accent-primary); color: white; border-radius: var(--radius-xs); font-size: 10px; font-weight: 700; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.tab-badge:empty { visibility: hidden; }
.tab-btn:not(.active) .tab-badge { background: var(--border-strong); color: var(--text-secondary); }
.tab-btn.tab-btn-sm { padding: 4px 10px; font-size: 11px; font-weight: 500; }
.tabs-inline-divider { display: inline-flex; align-items: center; gap: 2px; border-left: 1px solid var(--border-default); padding-left: 8px; }

/* Integracje: karty – czytelność */
.admin-section-integration { max-width: 100%; }
.integration-desc { margin: 0 0 var(--space-md) 0; font-size: var(--font-size-sm); color: var(--text-secondary); line-height: 1.5; max-width: 52ch; }
.integration-desc code { background: var(--bg-elevated); padding: 2px 6px; border-radius: var(--radius-xs); font-size: 0.95em; }
.integration-list { margin: 0 0 var(--space-lg) 0; padding-left: 1.25em; font-size: var(--font-size-sm); color: var(--text-secondary); line-height: 1.5; }
.integration-list li { margin-bottom: var(--space-xs); }
.integration-list li:last-child { margin-bottom: 0; }
.integration-label { margin: 0 0 var(--space-sm) 0; font-size: var(--font-size-sm); font-weight: 600; color: var(--text-secondary); }
.integration-radios { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: var(--space-md); }
.integration-radios .radio-option { margin: 0; }
.integration-delay-row { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-sm); }
.integration-note { margin: var(--space-md) 0 0 0; font-size: var(--font-size-xs); color: var(--text-muted); line-height: 1.4; }
.integration-actions { display: flex; gap: var(--space-md); flex-wrap: wrap; }
/* Log synchronizacji ITarian – stały kontener z przewijaniem */
.integration-log-box { border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-elevated); padding: var(--space-md); width: 100%; }
.integration-log-content { max-height: 420px; overflow-y: auto; overflow-x: auto; min-height: 80px; width: 100%; }
.integration-log-content .table-wrap { margin: 0; width: 100%; }
.integration-log-content .data-table { width: 100%; }
.integration-log-content .data-table th,
.integration-log-content .data-table td { text-align: left; }

/* Integracje: ostatnie powiadomienia – tabela bez uciętych nagłówków */
.notifications-log-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-card); }
.notifications-log-table { width: 100%; font-size: var(--font-size-sm); table-layout: auto; min-width: 640px; }
.notifications-log-table th, .notifications-log-table td { padding: 10px 12px; vertical-align: top; border-bottom: 1px solid var(--border-subtle); }
.notifications-log-table thead th { position: sticky; top: 0; background: var(--bg-card); z-index: 1; color: var(--text-muted); font-weight: 600; font-size: var(--font-size-xs); text-transform: none; white-space: normal; word-break: break-word; }
.notifications-log-table th:nth-child(1) { min-width: 90px; }
.notifications-log-table th:nth-child(2) { min-width: 90px; }
.notifications-log-table th:nth-child(3) { min-width: 120px; }
.notifications-log-table th:nth-child(4) { min-width: 140px; }
.notifications-log-table th:nth-child(5) { min-width: 90px; }
.notifications-log-table th:nth-child(6) { min-width: 100px; }
.notifications-log-table .cell-subject { display: block; white-space: normal; word-break: break-word; max-width: 280px; }
.notifications-log-table .cell-recipient { display: block; white-space: normal; word-break: break-word; max-width: 200px; }
.notif-status { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: var(--radius-xs); font-size: var(--font-size-xs); font-weight: 600; }
.notif-status-sent { background: var(--success-subtle); color: var(--success); }
.notif-status-failed { background: var(--danger-subtle); color: var(--danger); }
.notif-status-queued, .notif-status-enqueued { background: var(--warning-subtle); color: var(--warning); }
.notif-status-skipped { background: var(--border-strong); color: var(--text-secondary); }
.page-section#page-my-requests .tab-badge { display: none; }

/* SEARCH & TOOLBAR BTN */
.search-bar { display: flex; align-items: center; gap: var(--space-sm); padding: 7px 12px; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); width: 220px; transition: all var(--transition-base); }
.search-bar:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-subtle); }
.search-bar svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input { flex: 1; background: none; border: none; outline: none; color: var(--text-primary); font-size: var(--font-size-sm); min-width: 0; }
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar-wrap { position: relative; }
.search-bar-wrap .search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); border: none; border-radius: var(--radius-xs); color: var(--text-muted); cursor: pointer; transition: all var(--transition-fast); }
.search-bar-wrap .search-clear:hover { background: var(--bg-hover); color: var(--text-primary); }
.search-bar-wrap .search-clear svg { width: 14px; height: 14px; }
.search-bar-wrap.active { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-subtle); }
.search-bar-wrap.has-clear input { padding-right: 28px; }
.search-bar-wrap .search-clear { right: 6px; }
.toolbar-btn { display: flex; align-items: center; gap: 6px; padding: 7px 12px; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); color: var(--text-secondary); font-family: inherit; font-size: var(--font-size-sm); font-weight: 500; cursor: pointer; transition: all var(--transition-base); }
.toolbar-btn:hover { background: var(--bg-hover); border-color: var(--accent-primary); color: var(--text-primary); }
.toolbar-btn.active { border-color: var(--accent-primary); background: var(--accent-subtle); color: var(--accent-primary); }
.toolbar-btn svg { width: 14px; height: 14px; }
.toolbar.has-active-filters .toolbar-right .search-bar-wrap { border-color: var(--accent-primary); }
.toolbar.has-active-filters .toolbar-right .toolbar-btn.active { border-color: var(--accent-primary); background: var(--accent-subtle); color: var(--accent-primary); }

/* VIEW TOGGLE */
.view-toggle { display: flex; background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 2px; border: 1px solid var(--border-subtle); }
.view-toggle-btn { padding: 5px 10px; background: transparent; border: none; border-radius: var(--radius-xs); color: var(--text-muted); cursor: pointer; transition: all var(--transition-base); display: flex; align-items: center; }
.view-toggle-btn svg { width: 14px; height: 14px; }
.view-toggle-btn:hover { color: var(--text-primary); }
.view-toggle-btn.active { background: var(--accent-primary); color: white; }

/* TABLE */
.table-container { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); }
.table-head { display: grid; grid-template-columns: 80px 1fr 150px; gap: var(--space-md); padding: var(--space-md) var(--space-xl); background: var(--bg-elevated); border-bottom: 1px solid var(--border-default); position: sticky; top: 0; z-index: 10; }
.table-head-cell { display: flex; align-items: center; gap: 4px; font-size: var(--font-size-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.25; user-select: none; transition: color var(--transition-base); }
.table-head-cell.sortable { cursor: pointer; }
.table-head-cell.sortable:hover { color: var(--accent-primary); }
.table-head-cell .sort-icon { width: 12px; height: 12px; opacity: 0.5; transition: all var(--transition-base); }
.table-head-cell.sorted { color: var(--accent-primary); }
.table-head-cell.sorted .sort-icon { opacity: 1; }
.table-head-cell.sorted.asc .sort-icon { transform: rotate(180deg); }
.table-body { flex: 1; overflow-y: auto; }
.table-row { display: grid; grid-template-columns: 80px 1fr 150px; gap: var(--space-md); padding: var(--space-md) var(--space-xl); align-items: center; border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: all var(--transition-base); font-size: var(--font-size-sm); font-weight: 500; }
.table-row:hover { background: var(--bg-hover); box-shadow: inset 0 0 0 2px var(--accent-primary); }
.table-row.selected { background: var(--accent-subtle); }
.table-row.hidden { display: none; }
/* Wiersze ticketów w stanie końcowym (kanban "done": closed/rejected/approved/
   provisioned/cancelled/completed/answered/withdrawn — wszystkie z TERMINAL_STATUSES
   mapują się na "done" w STATUS_TO_KANBAN). Tylko TŁO szare, tekst zostaje.
   Używamy --border-strong (rgba 12% overlay) jako tła — daje wyraźny szary
   pasek vs białe/ciemne tło karty, w obu motywach. Hover normalny. */
.table-row[data-status="done"] { background: var(--border-strong); }
.table-row[data-status="done"]:hover { background: var(--bg-hover); }
.checkbox { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); border: 1.5px solid var(--border-strong); border-radius: var(--radius-xs); cursor: pointer; transition: all var(--transition-base); }
.checkbox svg { width: 12px; height: 12px; color: white; opacity: 0; transition: opacity var(--transition-fast); }
.checkbox:hover { border-color: var(--accent-primary); }
.checkbox.checked { background: var(--accent-primary); border-color: var(--accent-primary); }
.checkbox.checked svg { opacity: 1; }
.row-main { display: flex; align-items: center; gap: var(--space-md); min-width: 0; }
.row-icon { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); flex-shrink: 0; }
.row-icon svg { width: 16px; height: 16px; }
.row-icon.leave { background: var(--info-subtle); color: var(--info); }
.row-icon.incident { background: var(--danger-subtle); color: var(--danger); }
.row-icon.access { background: var(--warning-subtle); color: var(--warning); }
.row-info { min-width: 0; flex: 1; overflow: hidden; max-width: 100%; }
.row-id { font-size: var(--font-size-sm); font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Wskaźniki w liście ticketów (ManageEngine SDP-style) ──
   3 mikro-sloty po ~28px każdy. Każdy slot zawiera ikonę z opcjonalnym badge'em.
   Pusty slot zachowuje miejsce (visibility:hidden) żeby kolumna była sztywna. */
.indicators-cell { display: inline-flex; gap: 2px; align-items: center; min-width: 84px; }
.indicator-icon, .indicator-mail, .indicator-slot-empty {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    flex-shrink: 0;
}
.indicator-slot-empty { cursor: default; visibility: hidden; }
.indicator-icon svg, .indicator-mail svg { width: 16px; height: 16px; }
.indicator-icon:hover, .indicator-mail:hover { background: var(--bg-hover); }

/* Spinacz: subtelny */
.indicator-attachment { color: var(--text-secondary); }
.indicator-attachment:hover { color: var(--accent-primary); }

/* Koperta: warianty kolorystyczne wg kierunku (kto ostatni odpisał).
   danger (czerwona) = czeka na MÓJ ruch (trzeba odpowiedzieć / mam nową odpowiedź)
   success (zielona) = piłka po DRUGIEJ stronie (OK po mojej stronie)
   info (niebieska) = nieprzeczytane ale nie pilne (rzadko używane) */
.indicator-mail-danger { color: var(--danger); }
.indicator-mail-danger:hover { background: var(--danger-subtle); }
.indicator-mail-success { color: var(--success); }
.indicator-mail-success:hover { background: var(--success-subtle); }
.indicator-mail-info { color: var(--info); }
.indicator-mail-info:hover { background: var(--info-subtle); }

/* SLA */
.indicator-sla-warn { color: var(--warning); }
.indicator-sla-warn:hover { background: var(--warning-subtle); }
.indicator-sla-breach { color: var(--danger); }
.indicator-sla-breach:hover { background: var(--danger-subtle); }

/* Badge na kopercie (liczba nieprzeczytanych) */
.indicator-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 14px; height: 14px;
    padding: 0 3px;
    background: var(--danger);
    color: white;
    border-radius: 7px;
    font-size: 9px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg-card);
}
.indicator-mail-info .indicator-badge { background: var(--info); }
.table-head-cell[data-col="id"] { white-space: nowrap; }
/* Komórka NR – nie ściskać, numer ticketu w jednej linii we wszystkich widokach */
.table-row > div:has(.row-id) { min-width: min-content; white-space: nowrap; }
.row-title { font-size: var(--font-size-sm); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; cursor: help; display: block; }
.row-subtitle { font-size: var(--font-size-sm); color: var(--text-muted); }
.row-date { font-size: var(--font-size-sm); color: var(--text-muted); }
.status-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: var(--radius-sm); font-size: var(--font-size-sm); font-weight: 600; }
.status-badge.waiting { background: var(--warning-subtle); color: var(--warning); }
.status-badge.progress { background: var(--accent-subtle); color: var(--accent-primary); }
.status-badge.done { background: var(--success-subtle); color: var(--success); }

/* Raw-status overrides — wygrywają z generic .waiting/.progress/.done przez CSS specificity */
/* Negatywne terminalne (anulowane, wycofane) — szare (brak akcji, nie błąd) */
.status-badge.cancelled, .status-badge.withdrawn { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }
/* Odrzucone — czerwony (decyzja negatywna) */
.status-badge.rejected { background: var(--danger-subtle); color: var(--danger); }
/* Pozytywne terminalne — zielony jak .done */
.status-badge.approved, .status-badge.resolved, .status-badge.provisioned, .status-badge.completed, .status-badge.answered { background: var(--success-subtle); color: var(--success); }

.status-subtext { margin-top: 4px; font-size: var(--font-size-xs); color: var(--text-muted); }
.page-section#page-tasks .tab-badge { display: none; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: var(--font-size-xs); font-weight: 700; color: white; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar.g1 { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.avatar.g2 { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.avatar.g3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.avatar.g4 { background: linear-gradient(135deg, #10b981, #14b8a6); }
.avatar.g5 { background: linear-gradient(135deg, #3b82f6, #0ea5e9); }

/* KANBAN */
.kanban-container { flex: 1; display: flex; gap: var(--space-lg); overflow-x: auto; padding-bottom: var(--space-md); }
.kanban-column { flex: 1; min-width: 280px; max-width: 350px; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); display: flex; flex-direction: column; }
.kanban-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border-default); }
.kanban-title { font-size: var(--font-size-sm); font-weight: 600; }
.kanban-count { padding: 2px 8px; background: var(--bg-elevated); border-radius: var(--radius-sm); font-size: var(--font-size-xs); font-weight: 600; color: var(--text-muted); }
.kanban-cards { flex: 1; padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm); overflow-y: auto; }
.kanban-card { background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-md); cursor: pointer; transition: all var(--transition-base); }
.kanban-card:hover { border-color: var(--accent-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kanban-card.urgent { border-left: 3px solid var(--danger); }
.kanban-card.draggable { cursor: grab; }
.kanban-card.kanban-dragging { opacity: 0.5; cursor: grabbing; }
.kanban-cards.kanban-drop-target { outline: 2px dashed var(--accent-primary); outline-offset: 2px; background: var(--accent-subtle); }

/* Bulk action bar — overlay nad toolbar (position:absolute), NIE przesuwa listy w dół.
   Pokazuje się w tym samym slocie co toolbar (top:0 względem #page-tasks). z-index 100 żeby
   był nad toolbar (toolbar może mieć dropdowny z z-index 50). Opaque background żeby
   CAŁKOWICIE zasłonił toolbar (nie półprzezroczyste). */
.tasks-bulk-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    /* Opaque background (NIE accent-subtle bo to semi-transparent) — bez tego toolbar pod spodem widać */
    background: var(--bg-elevated);
    border-bottom: 2px solid var(--accent);
    border-radius: 0;
    margin: 0;
    /* Minimalna wysokość żeby pokryć cały toolbar (toolbar ma ~56-64px wraz z padding) */
    min-height: 64px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
/* #page-tasks musi mieć position:relative żeby bulk bar był positioned względem niego */
#page-tasks { position: relative; }

/* Kontener dynamicznych workflow buttons w bulk bar — inline-flex z gap żeby
   przyciski nie były sklejone (default span nie ma flex; buttony lądowały bez odstępów) */
.tasks-bulk-transitions { display: inline-flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.tasks-bulk-actions { gap: var(--space-md); }
.tasks-bulk-actions .btn { white-space: nowrap; }

/* Create-ticket-form grid layout — naprawia pre-existing bug gdzie pola miały
   grid-column:span 6 ale parent NIE był display:grid → wszystkie pola renderowały
   się jako col-12 (jedno pod drugim). Po fixie: Imię/Nazwisko, Spółka/Oddział,
   Stanowisko/Dział, Przełożony/Data startu, Email prefix/Telefon — wszystko obok siebie. */
#create-ticket-form-fields {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-md);
    align-items: start;
}
#create-ticket-form-fields > .modal-section {
    margin-bottom: 0;
    /* Default span dla bazowych sekcji (Tytuł, Opis, Priorytet) — bez tego padają
       na 1/12 columny i wyglądają jak malutkie boxiki. form_layout fields nadpisują
       to przez inline style="grid-column: span N". */
    grid-column: span 12;
}
/* Mobile: degraduj do single-column */
@media (max-width: 640px) {
    #create-ticket-form-fields { grid-template-columns: 1fr; }
    #create-ticket-form-fields > .modal-section { grid-column: span 1 !important; }
}

/* Onboarding progress tracker (Etap 4) — data-driven widok progresu w detail modal.
   Renderowane tylko dla ticket_type=employee_onboarding. Wszystkie kolory używają CSS variables. */
.onboarding-progress-section { margin-top: var(--space-md); }
.onboarding-progress-wrap { margin: var(--space-sm) 0 var(--space-md); }
.onboarding-progress-info {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--space-xs); font-size: var(--font-size-sm);
}
.onboarding-progress-count { color: var(--text-primary); }
.onboarding-progress-percent { font-weight: 700; color: var(--accent); font-size: var(--font-size-lg); }
.onboarding-progress-bar {
    height: 8px; background: var(--bg-hover); border-radius: var(--radius-sm); overflow: hidden;
}
.onboarding-progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--accent), var(--success));
    transition: width 0.4s ease;
}
.onboarding-alerts { display: flex; flex-direction: column; gap: var(--space-xs); margin: var(--space-sm) 0; }
.onboarding-alert {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}
.onboarding-alert i { width: 16px; height: 16px; flex-shrink: 0; }
.onboarding-alert-warning { background: var(--warning-subtle); color: var(--warning); border: 1px solid var(--warning); }
.onboarding-alert-info { background: var(--info-subtle); color: var(--info); border: 1px solid var(--info); }
.onboarding-alert-error { background: var(--danger-subtle); color: var(--danger); border: 1px solid var(--danger); }
.onboarding-filter-chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: var(--space-md) 0 var(--space-sm); }
.onboarding-subtasks-list { display: flex; flex-direction: column; gap: var(--space-xs); }
.onboarding-subtask {
    display: flex; gap: var(--space-md); padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.onboarding-subtask:hover { background: var(--bg-hover); border-color: var(--accent); }
.subtask-status-icon { width: 24px; height: 24px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.subtask-status-icon i { width: 20px; height: 20px; }
.onboarding-subtask-completed .subtask-status-icon i { color: var(--success); }
.onboarding-subtask-in_progress .subtask-status-icon i { color: var(--info); }
.onboarding-subtask-blocked .subtask-status-icon i { color: var(--warning); }
.onboarding-subtask-open .subtask-status-icon i { color: var(--text-muted); }
.subtask-body { flex: 1; min-width: 0; }
.subtask-title { font-weight: 500; font-size: var(--font-size-sm); margin-bottom: 2px; }
.subtask-blocked-info { color: var(--text-muted); font-size: var(--font-size-xs); font-weight: 400; }
.subtask-meta { display: flex; flex-wrap: wrap; gap: var(--space-md); font-size: var(--font-size-xs); color: var(--text-muted); }
.subtask-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.subtask-meta-item i { width: 12px; height: 12px; }
.subtask-number { font-family: var(--font-mono); }
.onboarding-dag-section { margin-top: var(--space-md); }
.onboarding-dag-container {
    margin-top: var(--space-sm); padding: var(--space-md);
    background: var(--bg-elevated); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); overflow-x: auto;
}
.onboarding-dag-container .mermaid { background: transparent; }

/* Wiersz z otwartym context menu (right-click lub kebab ⋮) — wizualny hint
   "to ten wiersz" gdy user wybiera akcję. Sprząta się przy zamknięciu menu.
   Lekkie tło + lewy border-strip dla widoczności bez przeładowania. */
.table-row.row-context-active {
    background: var(--accent-subtle) !important;
    box-shadow: inset 3px 0 0 0 var(--accent);
}
.table-row.row-context-active .row-kebab-cell { opacity: 1; }

/* Kebab cell ⋮ w wierszu tabeli — akcje per wiersz (Faza 2 ujednolicenia akcji).
   Default opacity niska (0.4) — visible hint że można kliknąć, ale nie odwraca uwagi.
   On row hover → 0.95 (pełna widoczność). Cursor pointer. */
.row-kebab-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity var(--transition-fast), background var(--transition-fast);
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    margin: 0 auto;
    color: var(--text-muted);
}
.table-row:hover .row-kebab-cell { opacity: 0.95; }
.row-kebab-cell:hover {
    opacity: 1 !important;
    background: var(--bg-hover);
    color: var(--text-primary);
}
.row-kebab-cell i { width: 16px; height: 16px; }

/* Badge przy bulk transition button — "X / N" dla partial-applicability */
.tasks-bulk-transitions .btn .applicability-badge {
    display: inline-block;
    margin-left: var(--space-xs);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.15);
    font-size: 10px;
    font-weight: 700;
}
.tasks-bulk-transitions .btn.partial-applicable { opacity: 0.85; }
.tasks-bulk-label { font-size: var(--font-size-sm); font-weight: 600; color: var(--text-primary); }
.tasks-bulk-actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.bulk-status-wrap { display: flex; align-items: center; gap: var(--space-sm); }
.bulk-assign-results { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-xs); }
.bulk-assign-results .user-row { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); cursor: pointer; border-radius: var(--radius-md); transition: background var(--transition-fast); }
.bulk-assign-results .user-row:hover { background: var(--bg-hover); }
.bulk-assign-results .user-row .avatar { width: 32px; height: 32px; font-size: 11px; }
.bulk-assign-results .user-row .user-info { flex: 1; }
.bulk-assign-results .user-row .user-name { font-size: var(--font-size-sm); font-weight: 500; }
.bulk-assign-results .user-row .user-email { font-size: var(--font-size-xs); color: var(--text-muted); }
.checkbox.tasks-select-all { cursor: pointer; }
.checkbox.tasks-select-all.indeterminate { background: var(--accent-primary); border-color: var(--accent-primary); }
.checkbox.tasks-select-all.indeterminate svg { opacity: 0.6; }
.priority-badge { font-size: var(--font-size-sm); font-weight: 600; padding: 3px 8px; border-radius: var(--radius-sm); }
.priority-badge.priority-critical { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.priority-badge.priority-high { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.priority-badge.priority-medium { background: rgba(250, 204, 21, 0.15); color: #facc15; }
.priority-badge.priority-low { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.priority-badge.priority-normal { background: rgba(100, 116, 139, 0.18); color: #64748b; }

/* Opis ticketu w modalu — zachowaj formatowanie z formularza/maila
   (akapity, łamanie linii) i zawijaj długie linie. */
#modal-detail-desc { white-space: pre-wrap; word-wrap: break-word; }
.tasks-pagination-wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-md); padding: var(--space-md) var(--space-xl); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); margin-top: var(--space-md); font-size: var(--font-size-sm); color: var(--text-secondary); }
.pagination-info { font-weight: 500; }
.pagination-per { display: flex; align-items: center; gap: var(--space-xs); }
.pagination-per-label { color: var(--text-muted); }
.pagination-per-btn { padding: 4px 10px; }
.pagination-per-btn.active { background: var(--accent-subtle); color: var(--accent-primary); border-color: var(--accent-primary); }
.pagination-nav { display: flex; align-items: center; gap: var(--space-md); }
.pagination-page { color: var(--text-muted); }
.pagination-nav button:disabled { opacity: 0.5; cursor: not-allowed; }
.saved-filters-inner { display: flex; flex-direction: column; gap: var(--space-sm); max-height: 200px; overflow-y: auto; }
.saved-filters-toolbar { display: flex; align-items: center; gap: var(--space-xs); margin-right: var(--space-sm); }
.saved-filters-toolbar .toolbar-btn { font-size: var(--font-size-xs); padding: 4px 8px; }
.saved-filters-empty { padding: var(--space-lg); text-align: center; color: var(--text-muted); font-size: var(--font-size-sm); }
.saved-filter-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); background: var(--bg-elevated); border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.saved-filter-item span { flex: 1; font-size: var(--font-size-sm); }
.saved-filter-item .btn { flex-shrink: 0; }
.saved-filters-dropdown-list { display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-sm); max-height: 300px; overflow-y: auto; }
.saved-filter-dropdown-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); cursor: pointer; transition: background var(--transition-fast); }
.saved-filter-dropdown-item:hover { background: var(--bg-hover); }
.saved-filter-dropdown-item span { flex: 1; font-size: var(--font-size-sm); }
.saved-filter-dropdown-item .btn { flex-shrink: 0; padding: 2px 4px; }
.saved-filter-dropdown-item .btn:hover { background: var(--danger-subtle); color: var(--danger); }
/* Nagłówek grupy w dropdownzie zapisanych filtrów (Globalne / Zespołowe / Moje) */
.saved-filter-group-header { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-sm) var(--space-md) var(--space-xs); font-size: var(--font-size-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; border-top: 1px solid var(--border-subtle); margin-top: var(--space-xs); }
.saved-filter-group-header:first-child { border-top: none; margin-top: 0; }
.saved-filter-group-header i { width: 14px; height: 14px; }
/* Badge przy nazwie filtra (team_name / Globalny) */
.filter-scope-badge { display: inline-block; margin-left: var(--space-sm); padding: 1px 6px; border-radius: var(--radius-sm); font-size: var(--font-size-xs); background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border-subtle); font-weight: normal; }
.filter-scope-badge.filter-scope-global { background: var(--info-subtle); color: var(--info); border-color: var(--info); }

/* KATALOG USŁUG (page-services) */
.page-section#page-services .toolbar { width: 100%; }
.page-section#page-services .toolbar .search-bar { margin: 0 auto; }
/* Layout pozioma (Netflix-style rows): każda kategoria/zespół to wiersz pełnej szerokości,
   pozycje w jednym rzędzie. Więcej kategorii = scroll w dół. Pozycje wrapują naturalnie
   gdy nie mieszczą się w wierszu — brak wewnętrznego scrolla X. */
.services-grid { flex: 1; display: flex; flex-direction: column; gap: var(--space-lg); overflow-y: auto; min-height: 0; padding-bottom: var(--space-md); }
/* CRITICAL: flex-shrink: 0 — bez tego dzieci kontenera flex-column były ŚCISKANE poniżej
   swojej naturalnej wysokości, a ich `overflow: hidden` przycinał zawartość (np. "Pytanie"
   pokazywało się tylko górną połówką liter). Z flex-shrink: 0 dzieci zachowują wysokość
   naturalną, a rodzic robi scroll-y. */
.service-category { display: flex; flex-direction: column; flex-shrink: 0; }
/* Items wewnątrz rozwiniętej kategorii/zespołu/ulubionych — TILE GRID (kafelki).
   Te same wymiary co .service-tiles-grid (widok Kafelki) — wspólny język wizualny.
   `.service-tile` (zamiast `.service-item`) — patrz _renderServiceTileHtml. */
.service-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-md); padding: var(--space-md); }
/* Akordeon: domyślnie wszystkie kategorie zwinięte. Klik w nagłówek otwiera tę
   kategorię i ZAMYKA pozostałe (exclusive expansion). Działa zarówno na desktop
   jak i mobile. Przyciski "Rozwiń wszystko" / "Zwiń wszystko" w toolbar
   pozwalają na masową akcję. */
.service-category-header { cursor: pointer; user-select: none; }
.service-category-header::after {
    content: '▾';
    margin-left: auto;
    font-size: 14px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}
.service-category[data-expanded="false"] .service-category-header::after { transform: rotate(-90deg); }
.service-category[data-expanded="false"] .service-list { display: none; }
.service-category[data-expanded="false"] .service-category-header { border-bottom: none; }
/* Header bez akordeonu (np. Ulubione — zawsze otwarte, jedna sekcja). */
.service-category-header.is-static { cursor: default; }
.service-category-header.is-static::after { display: none; }
/* Wybrana (rozwinięta) kategoria ma niebieskie obramowanie — pattern z list/tabel.
   Używamy GRUBSZEGO border-width (2px zamiast 1px) ze sztywnym margin-compensation,
   bo box-shadow outset był clip'owany przez overflow:auto na .services-grid (boki
   wyglądały cieniej niż góra/dół). Border jest częścią modelu pudełka — uniform
   i nieclipowany. */
.service-category[data-expanded="true"] {
    border-color: var(--accent-primary);
    border-width: 2px;
    margin: -1px;
}
.service-category[data-expanded="true"] .service-category-header { background: var(--bg-elevated); }
@media (max-width: 768px) {
    .services-grid { grid-template-columns: 1fr; gap: var(--space-md); overflow-y: visible; }
}
/* Przyciski akcji akordeonu w toolbar */
.catalog-accordion-actions { display: inline-flex; gap: 4px; }
.catalog-accordion-actions .btn { padding: 6px 10px; font-size: var(--font-size-xs); }
/* Nowy layout pozycji w katalogu: ikona | body (nazwa nad badge'ami) + star w rogu. */
.service-item { position: relative; align-items: flex-start; padding-right: 32px; }
.service-item > svg:first-child,
.service-item > i:first-child { margin-top: 2px; flex-shrink: 0; }
.service-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.service-item-title { font-size: var(--font-size-sm); font-weight: 500; line-height: 1.35; white-space: normal; word-break: normal; overflow-wrap: break-word; color: var(--text-primary); }
.service-item-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* Star + info: pozycjonowane absolutnie w prawym górnym rogu, nie zabierają szerokości nazwie. */
.service-item-star { position: absolute; top: 8px; right: 8px; }
.service-item-info { position: absolute; top: 8px; right: 32px; width: 18px; height: 18px; padding: 2px; border-radius: 50%; color: var(--text-muted); opacity: 0; cursor: pointer; transition: all var(--transition-fast); flex-shrink: 0; }
.service-item:hover .service-item-info { opacity: 0.6; }
.service-item-info:hover { opacity: 1 !important; background: var(--bg-hover); color: var(--accent-primary); }
.service-item { padding-right: 56px; }  /* miejsce na 2 ikony (info + star) */
/* Maturity badge przestaje być klikalny → kursor default. */
.maturity-badge { cursor: default; }
/* Search bar: bardziej widoczny, większy, z akcentem przy focusie. */
#page-services .search-bar { width: 380px; max-width: 100%; border-radius: var(--radius-md); transition: all var(--transition-base); }
#page-services .search-bar input { font-size: var(--font-size-base); padding: 10px 12px; }
#page-services .search-bar:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
body.office-theme #page-services .search-bar:focus-within { box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15); }
body.light-theme #page-services .search-bar:focus-within { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18); }
/* overflow: visible — kafelki w środku mają hover-lift + box-shadow; overflow:hidden
   ucinałby cień na dolnej krawędzi karty. Background headera ma własny border-radius
   żeby się nie wylewał poza zaokrąglone rogi karty. */
.service-category { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: visible; display: flex; flex-direction: column; }
.service-category-header { border-top-left-radius: calc(var(--radius-lg) - 1px); border-top-right-radius: calc(var(--radius-lg) - 1px); }
.service-category[data-expanded="false"] .service-category-header { border-bottom-left-radius: calc(var(--radius-lg) - 1px); border-bottom-right-radius: calc(var(--radius-lg) - 1px); }
.service-category-header { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-lg) var(--space-xl); border-bottom: 1px solid var(--border-subtle); }
.service-category-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); flex-shrink: 0; }
.service-category-icon svg { width: 20px; height: 20px; }
.service-category-header h3 { font-size: var(--font-size-base); font-weight: 700; color: var(--text-primary); margin: 0; }
/* (override-stary: te poniżej rules dla .service-item są legacy — items zostały
    zastąpione przez .service-tile we wszystkich render-funkcjach katalogu.
    Zachowane na wypadek użycia .service-list/.service-item w innych miejscach.) */
.service-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg); border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-fast); color: var(--text-primary); }
.service-item:hover { background: var(--bg-hover); }
.service-item svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.service-item span:first-of-type { flex: 1; font-size: var(--font-size-sm); font-weight: 500; }
.service-sla { font-size: var(--font-size-xs); color: var(--text-muted); padding: 2px 8px; background: var(--bg-elevated); border-radius: var(--radius-xs); font-weight: 600; }
.service-sla.urgent { background: var(--danger-subtle); color: var(--danger); }

/* Maturity badges */
.maturity-badge { font-size: 0.6rem; padding: 1px 7px; border-radius: 10px; font-weight: 700; cursor: default; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; align-self: flex-start; }
/* Bez hover-scale/brightness — badge to etykieta statusu, nie przycisk. Skalowanie
   na hover sprawiało wrażenie że "rusza się" i zasłaniała sąsiednie pozycje. */
.maturity-0 { background: var(--bg-elevated); color: var(--text-muted); }
.maturity-1 { background: var(--warning-subtle); color: var(--warning); }
.maturity-2 { background: var(--info-subtle); color: var(--info); }
.maturity-3 { background: var(--success-subtle); color: var(--success); }
.service-item-hidden { opacity: 0.45; }
/* Przełącznik widoków katalogu (tab-like). */
.catalog-view-switcher { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); }
.catalog-view-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: none; background: transparent; color: var(--text-muted); font-size: var(--font-size-sm); font-weight: 500; border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition-fast); }
.catalog-view-btn svg { width: 15px; height: 15px; }
.catalog-view-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.catalog-view-btn.active { background: var(--bg-card); color: var(--accent-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); font-weight: 600; }
body.office-theme .catalog-view-btn.active { background: #fff; color: var(--accent-primary); }
/* BISArek robot icon — pixel-art PNG. Zaokrąglone rogi, brak ruchu ikony.
   Animacja: rozbłysk jasności (mózg świeci) + bursztynowa poświata. */
.bisarek-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    flex-shrink: 0;
    vertical-align: middle;
    border-radius: 4px;
    overflow: hidden;
}
.bisarek-icon-lg { width: 30px; height: 30px; border-radius: 6px; }
/* Theme-aware podmiana (zachowane dla przyszłej różnej grafiki per theme). */
body.light-theme img[data-bisarek-icon],
body.office-theme img[data-bisarek-icon] { content: url('/static/img/bisarek-dark.png'); }
/* Animacja "życia" robocika — soft amber aura (eye-friendly) + delikatne mrugnięcie.
   Best-practice research: Apple Siri / ChatGPT pulse — preferują:
   - niski peak luminancji (≤ +18%) zamiast skoków
   - DUŻY blur (18px) + UMIARKOWANY alpha (0.55) = soft halo glow
   - długi cykl (5s) z cubic-bezier zamiast linear/ease
   - ZERO transform = brak drgania w przestrzeni
   - prefers-reduced-motion respect (dostępność / epilepsja). */
@keyframes bisarek-life {
    0%, 100% {
        filter: brightness(1) contrast(1) drop-shadow(0 0 0 transparent);
    }
    /* Wolny ramp w soft amber aurę — peak ~40-45% */
    40% {
        filter: brightness(1.14) contrast(1) drop-shadow(0 0 18px rgba(251, 146, 60, 0.55));
    }
    /* Lekkie dogasanie */
    60% {
        filter: brightness(1.05) contrast(1) drop-shadow(0 0 8px rgba(251, 146, 60, 0.28));
    }
    /* Mrugnięcie oczu — contrast(0.22) wycisza tylko jasne piksele,
       reszta ikony zostaje w spoczynku. */
    72% { filter: brightness(1) contrast(1); }
    76% { filter: brightness(0.96) contrast(0.22); }
    80% { filter: brightness(0.96) contrast(0.22); }
    86% { filter: brightness(1) contrast(1); }
}
.nav-btn[data-page="ai"]:not(.active) .bisarek-icon,
.catalog-view-btn[data-view="ai"]:not(.active) .bisarek-icon,
.ai-assistant-box-header .bisarek-icon,
.ai-message-avatar .bisarek-icon {
    animation: bisarek-life 3s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.nav-btn[data-page="ai"]:not(.active):hover .bisarek-icon,
.catalog-view-btn[data-view="ai"]:not(.active):hover .bisarek-icon {
    animation-duration: 0.8s;
}
@media (prefers-reduced-motion: reduce) {
    .bisarek-icon { animation: none !important; }
}
/* BISArek personalized — sekcje flat (service-tiles-section) potrzebują gap między sobą.
   Pierwsza sekcja idzie zaraz pod .ai-assistant-box (które ma własny margin-bottom). */
#ai-personalized-section { display: flex; flex-direction: column; gap: var(--space-lg); }
/* AI assistant box w widoku AI */
.ai-assistant-box {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(99, 102, 241, 0.04));
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}
.ai-assistant-box-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ai-assistant-box-header i { width: 20px; height: 20px; color: #8b5cf6; }
.ai-assistant-box-header h3 { margin: 0; font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); }
.ai-assistant-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text-primary); font-size: var(--font-size-base); transition: all var(--transition-base); }
.ai-assistant-input:focus { outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15); }
.ai-assistant-hint { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 6px; }
.ai-suggestion-reason { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 2px; font-style: italic; }
/* Star toggle dla ulubionych — show on hover, brighter when favorited. */
.service-item-star { width: 18px; height: 18px; padding: 2px; border-radius: 50%; color: var(--text-muted); opacity: 0; cursor: pointer; transition: all var(--transition-fast); flex-shrink: 0; }
.service-item:hover .service-item-star { opacity: 0.6; }
.service-item-star:hover { opacity: 1 !important; background: var(--bg-hover); color: var(--accent-warning, #f59e0b); }
.service-item-star.is-fav { opacity: 1; color: var(--accent-warning, #f59e0b); fill: var(--accent-warning, #f59e0b); }
.service-item-star.is-fav svg { fill: currentColor; }

/* ── Widok KAFELKI (tiles) ──
   Statyczne sekcje (bez akordeonu) z kategorią w nagłówku + siatka kafelków pod spodem.
   Kafelek = ikona-góra + tytuł + meta na dole. Star/info absolutnie w rogach.
   Wszystko widoczne na raz — odpowiada na zasadę „tylko żeby się nic nie chowało". */
.service-tiles-section { display: flex; flex-direction: column; gap: var(--space-sm); flex-shrink: 0; }
.service-tiles-header { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm) var(--space-md); }
.service-tiles-header h3 { font-size: var(--font-size-base); font-weight: 700; color: var(--text-primary); margin: 0; }
.service-tiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-md); padding: 0 var(--space-sm) var(--space-sm); }
.service-tile {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    min-height: 150px;
    text-align: center;
}
.service-tile:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
body.dark-theme .service-tile:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5); }
.service-tile-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}
.service-tile-icon svg { width: 24px; height: 24px; }
.service-tile-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: break-word;
    width: 100%;
}
.service-tile-meta {
    margin-top: auto;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}
.service-tile-hidden { opacity: 0.45; }
.service-tile-star {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    padding: 2px;
    border-radius: 50%;
    color: var(--text-muted);
    opacity: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.service-tile:hover .service-tile-star { opacity: 0.6; }
.service-tile-star:hover { opacity: 1 !important; background: var(--bg-hover); color: var(--accent-warning, #f59e0b); }
.service-tile-star.is-fav { opacity: 1; color: var(--accent-warning, #f59e0b); fill: var(--accent-warning, #f59e0b); }
.service-tile-star.is-fav svg { fill: currentColor; }
.service-tile-info {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 18px;
    height: 18px;
    padding: 2px;
    border-radius: 50%;
    color: var(--text-muted);
    opacity: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.service-tile:hover .service-tile-info { opacity: 0.6; }
.service-tile-info:hover { opacity: 1 !important; background: var(--bg-hover); color: var(--accent-primary); }
@media (max-width: 480px) {
    .service-tiles-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-sm); }
    .service-tile { min-height: 130px; padding: var(--space-md) var(--space-sm); }
    .service-tile-icon { width: 40px; height: 40px; }
    .service-tile-icon svg { width: 20px; height: 20px; }
}
@media (max-width: 768px) {
    .catalog-view-btn span { display: none; }
    .catalog-view-btn { padding: 8px; }
}

/* Service page (changelog modal) */
.service-page-header { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-lg); }
.service-page-header h2 { margin: 0; font-size: var(--font-size-lg); }
.service-page-info { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm) var(--space-xl); margin-bottom: var(--space-lg); padding: var(--space-md) var(--space-lg); background: var(--bg-elevated); border-radius: var(--radius-md); }
.service-page-info .info-label { font-size: var(--font-size-xs); color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.service-page-info .info-value { font-size: var(--font-size-sm); color: var(--text-primary); margin-bottom: var(--space-sm); }
.changelog-list { display: flex; flex-direction: column; gap: 2px; }
.changelog-entry { display: grid; grid-template-columns: 110px 1fr auto; gap: var(--space-md); align-items: start; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); cursor: pointer; transition: background var(--transition-fast); font-size: var(--font-size-sm); }
.changelog-entry:hover { background: var(--bg-hover); }
.changelog-date { color: var(--text-muted); font-size: var(--font-size-xs); white-space: nowrap; }
.changelog-title { color: var(--text-primary); font-weight: 500; }
.changelog-author { color: var(--text-muted); font-size: var(--font-size-xs); white-space: nowrap; }
.changelog-detail { grid-column: 1 / -1; padding: var(--space-sm) var(--space-md); background: var(--bg-elevated); border-radius: var(--radius-sm); margin-top: var(--space-xs); font-size: var(--font-size-xs); color: var(--text-secondary); display: none; }
.changelog-detail.open { display: block; }
.changelog-type-badge { font-size: 0.6rem; padding: 1px 6px; border-radius: var(--radius-xs); font-weight: 600; background: var(--bg-elevated); color: var(--text-muted); }
.changelog-add-form { display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-md); background: var(--bg-elevated); border-radius: var(--radius-md); margin-top: var(--space-md); }
/* Workflow Diagram */
#service-workflow-diagram { margin-bottom: var(--space-md); }
.wf-flow { display: flex; flex-direction: column; align-items: center; }
.wf-card { display: flex; align-items: stretch; gap: 0; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); width: 100%; max-width: 380px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.wf-card-icon { display: flex; align-items: center; justify-content: center; width: 44px; flex-shrink: 0; }
.wf-card-icon svg { width: 20px; height: 20px; }
.wf-card-content { flex: 1; padding: 10px 14px 10px 0; min-width: 0; }
.wf-card-name { font-size: var(--font-size-md); font-weight: 600; color: var(--text-primary); }
.wf-card-meta { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 2px; }
.wf-card-backs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.wf-back-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 0.65rem; padding: 2px 8px; border-radius: 99px; background: var(--accent-subtle); color: var(--accent-primary); font-weight: 500; }
.wf-back-src { color: var(--text-muted); font-weight: 400; }
/* Card type colors */
.wf-card--initial { border-left: 4px solid var(--text-muted); }
.wf-card--initial .wf-card-icon { color: var(--text-muted); }
.wf-card--in_progress { border-left: 4px solid var(--color-info); }
.wf-card--in_progress .wf-card-icon { color: var(--color-info); }
.wf-card--pending { border-left: 4px solid var(--color-warning); }
.wf-card--pending .wf-card-icon { color: var(--color-warning); }
.wf-card--terminal { border-left: 4px solid var(--color-success); }
.wf-card--terminal .wf-card-icon { color: var(--color-success); }
.wf-card--cancelled { border-left: 4px solid var(--color-danger); }
.wf-card--cancelled .wf-card-icon { color: var(--color-danger); }
/* Connector arrow between cards */
.wf-connector { display: flex; flex-direction: column; align-items: center; padding: 2px 0; }
.wf-connector-line { width: 2px; height: 12px; background: var(--border-strong); }
.wf-connector-labels { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; padding: 2px 0; }
.wf-connector-label { font-size: var(--font-size-xs); color: var(--text-muted); background: var(--bg-elevated); padding: 1px 10px; border-radius: 99px; border: 1px solid var(--border-default); font-weight: 500; }
.wf-connector-arrow { color: var(--border-strong); font-size: 10px; line-height: 1; margin-top: -2px; }

/* DASHBOARD, STATS, CHARTS (page-dashboard, page-assets, page-reports) */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-xl); }
.stat-card { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-lg); background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); min-width: 0; }
.stat-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); flex-shrink: 0; }
.stat-icon svg { width: 22px; height: 22px; color: white; }
.stat-icon.urgent { background: var(--danger); }
.stat-icon.pending { background: var(--warning); }
.stat-icon.progress { background: var(--accent-primary); }
.stat-icon.done { background: var(--success); }
.stat-content { min-width: 0; flex: 1; }
.stat-value { font-size: var(--font-size-xl); font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.stat-label { font-size: var(--font-size-xs); color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Moje urlopy – czytelniejsze staty */
.page-section#page-my-leaves .stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.page-section#page-my-leaves .stat-card { align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg); min-height: 86px; }
.page-section#page-my-leaves .stat-icon { width: 40px; height: 40px; border-radius: var(--radius-md); }
.page-section#page-my-leaves .stat-icon svg { width: 20px; height: 20px; }
.page-section#page-my-leaves .stat-content { display: flex; flex-direction: column; gap: 2px; }
.page-section#page-my-leaves .stat-value { font-size: var(--font-size-lg); }
.page-section#page-my-leaves .stat-label { white-space: normal; overflow: visible; text-overflow: clip; text-transform: none; letter-spacing: 0; font-size: var(--font-size-sm); }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); align-content: start; }
.dashboard-card { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.dashboard-card.large { grid-column: span 2; }
.card-header { padding: var(--space-lg) var(--space-xl); border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
/* Settings page: single-column stacked layout, scrollable */
.settings-layout { display: flex; flex-direction: column; gap: var(--space-lg); max-width: 640px; padding-bottom: var(--space-xl); }
.card-title { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--font-size-base); font-weight: 700; margin: 0; }
.card-title svg { width: 18px; height: 18px; color: var(--accent-primary); }
.chart-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-md); padding: var(--space-2xl); background: var(--bg-elevated); color: var(--text-muted); font-size: var(--font-size-sm); min-height: 180px; }
.chart-placeholder svg { width: 48px; height: 48px; opacity: 0.5; }
.chart-placeholder span { text-align: center; }
.dashboard-task-list { list-style: none; margin: 0; padding: 0; width: 100%; text-align: left; }
.dashboard-task-list li { margin-bottom: var(--space-sm); }
.dashboard-task-link { cursor: pointer; color: var(--accent-primary); transition: color var(--transition-base); }
.dashboard-task-link:hover { color: var(--accent-dark); text-decoration: underline; }

/* AI ASYSTENT (page-ai) */
.ai-container { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ai-header { display: flex; align-items: center; gap: var(--space-lg); margin-bottom: var(--space-xl); flex-shrink: 0; }
/* BISArek logo wrapper — bez fioletowego gradientu, bez własnej animacji.
   Sama ikona ma już animację (bisarek-life). Wrapper tylko ustawia layout. */
.ai-logo { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-logo .bisarek-icon { width: 48px; height: 48px; border-radius: 8px; }
/* Chat avatar — usuwamy ai-avatar-glow box-shadow (kolidował z bisarek-life). */
.ai-message-avatar { background: transparent; }
.ai-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; }
.ai-messages { flex: 1; overflow-y: auto; padding: var(--space-xl); display: flex; flex-direction: column; gap: var(--space-lg); }
.ai-message { display: flex; gap: var(--space-md); align-items: flex-start; }
.ai-message-avatar { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--accent-subtle); border-radius: var(--radius-md); flex-shrink: 0; }
.ai-message-avatar svg { width: 18px; height: 18px; color: var(--accent-primary); }
.ai-message-content { flex: 1; min-width: 0; }
.ai-message-content p { margin: 0; font-size: var(--font-size-sm); color: var(--text-primary); line-height: 1.5; }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: var(--space-sm); padding: var(--space-md) var(--space-xl); border-top: 1px solid var(--border-subtle); flex-shrink: 0; }
.ai-suggestion { display: inline-flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); font-size: var(--font-size-sm); color: var(--text-secondary); cursor: pointer; transition: all var(--transition-fast); }
.ai-suggestion:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.ai-suggestion svg { width: 14px; height: 14px; }
.ai-input-container { display: flex; gap: var(--space-sm); padding: var(--space-lg) var(--space-xl); border-top: 1px solid var(--border-subtle); flex-shrink: 0; }
.ai-input { flex: 1; padding: var(--space-md) var(--space-lg); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); color: var(--text-primary); font-size: var(--font-size-sm); font-family: inherit; }
.ai-input::placeholder { color: var(--text-muted); }
.ai-input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-subtle); }
.ai-send-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--accent-primary); border: none; border-radius: var(--radius-md); color: white; cursor: pointer; transition: all var(--transition-base); flex-shrink: 0; }
.ai-send-btn:hover { background: var(--accent-dark); }
.ai-send-btn svg { width: 18px; height: 18px; }

/* MÓJ SPRZĘT – karty (page-my-assets) */
.my-assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-lg); align-content: start; }
.assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-lg); align-content: start; padding-bottom: var(--space-lg); }
/* #page-assets overflow now handled globally by .page-section.active */
.assets-grid.assets-view-list { display: block; }
.assets-grid.assets-view-list .assets-list-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.assets-grid.assets-view-list .assets-list-table thead th { text-align: left; padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border-default); color: var(--text-muted); font-weight: 600; }
.assets-grid.assets-view-list .assets-list-table tbody tr.asset-card { border-bottom: 1px solid var(--border-subtle); }
.assets-grid.assets-view-list .assets-list-table tbody tr.asset-card:hover { background: var(--bg-hover); }
.assets-grid.assets-view-list .assets-list-table tbody td { padding: var(--space-md); vertical-align: middle; }
.assets-grid.assets-view-list .assets-list-name { display: flex; align-items: center; gap: var(--space-sm); }
.assets-grid.assets-view-list .assets-list-name .asset-icon { width: 32px; height: 32px; }
.assets-grid.assets-view-list .assets-list-name .asset-icon svg { width: 16px; height: 16px; }
.assets-grid.assets-view-list .assets-list-actions { white-space: nowrap; }
.assets-grid.assets-view-list .assets-list-row-actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }

/* Zasoby – widok listy: pełna szerokość, wyrównanie do lewej (nie zbite na środku) */
#page-assets .table-container.assets-table-container { width: 100%; min-width: 0; }
.assets-table-container .table-body { width: 100%; min-width: 0; }
.assets-table-container .table-head,
.assets-table-container .table-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 60px 120px 120px; gap: var(--space-md); width: 100%; min-width: 0; box-sizing: border-box; }
.assets-table-container .table-head { padding: var(--space-md) var(--space-xl); position: sticky; top: 0; z-index: 2; background: var(--bg-card); }
.assets-table-container .table-row { padding: var(--space-md) var(--space-xl); align-items: center; }
.assets-table-container .table-head .table-head-cell { text-align: left; justify-content: flex-start; min-width: 0; }
.assets-table-container .table-row > div { text-align: left; min-width: 0; }
.assets-table-container .table-row { cursor: pointer; }
.assets-table-container .table-row:hover { background: var(--bg-hover); }
.assets-table-container .table-row .row-main { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; justify-content: flex-start; }
.assets-table-container .table-row .row-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); flex-shrink: 0; }
.assets-table-container .table-row .row-icon.laptop { background: var(--accent-subtle); color: var(--accent-primary); }
.assets-table-container .table-row .row-icon.desktop { background: var(--info-subtle); color: var(--accent-primary); }
.assets-table-container .table-row .row-icon.monitor { background: var(--info-subtle); color: var(--info); }
.assets-table-container .table-row .row-icon.phone { background: var(--success-subtle); color: var(--success); }
.assets-table-container .table-row .row-icon.vehicle { background: var(--warning-subtle); color: var(--warning); }
.assets-table-container .table-row .row-icon.license { background: var(--accent-subtle); color: var(--accent-primary); }
.assets-table-container .table-row .row-icon.other { background: var(--bg-elevated); color: var(--text-muted); }
.assets-table-container .table-row .row-icon svg { width: 16px; height: 16px; }
.assets-table-container .table-row .assets-row-actions { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; }

/* Zasoby – widok domenowy: Kategoria, Nazwa, Ważność, Rejestrator */
.assets-table-container.domain-view .table-head,
.assets-table-container.domain-view .table-row { grid-template-columns: 90px minmax(0, 1fr) 200px 160px; }

/* Moje zasoby – lista 4 kolumny (Kategoria, Nazwa, Status, Data dodania) */
.my-assets-table-container .table-head,
.my-assets-table-container .table-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 100px 120px; gap: var(--space-md); }
.my-assets-table-container .table-head { padding: var(--space-md) var(--space-xl); }
.my-assets-table-container .table-row { padding: var(--space-md) var(--space-xl); align-items: center; }
.my-assets-table-container .table-row .row-main { display: flex; align-items: center; gap: var(--space-sm); }
.my-assets-table-container .table-row .row-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); flex-shrink: 0; }
.my-assets-table-container .table-row .row-icon.laptop { background: var(--accent-subtle); color: var(--accent-primary); }
.my-assets-table-container .table-row .row-icon.desktop { background: var(--info-subtle); color: var(--accent-primary); }
.my-assets-table-container .table-row .row-icon.monitor { background: var(--info-subtle); color: var(--info); }
.my-assets-table-container .table-row .row-icon.phone { background: var(--success-subtle); color: var(--success); }
.my-assets-table-container .table-row .row-icon.other { background: var(--bg-elevated); color: var(--text-muted); }
.my-assets-table-container .table-row .row-icon svg { width: 16px; height: 16px; }

/* Podsumowanie zasobów (tabelka z API) */
.assets-summary-section { margin-bottom: var(--space-lg); }
.assets-summary-title { font-size: var(--font-size-base); font-weight: 600; margin: 0 0 var(--space-sm); color: var(--text-primary); }
.assets-summary-loading { padding: var(--space-md); color: var(--text-muted); font-size: var(--font-size-sm); }
.assets-summary-table { width: 100%; max-width: 480px; border-collapse: collapse; font-size: var(--font-size-sm); }
.assets-summary-table thead th { text-align: left; padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border-default); color: var(--text-muted); font-weight: 600; }
.assets-summary-table tbody td { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border-subtle); }
.assets-summary-label { display: flex; align-items: center; gap: var(--space-sm); }
.assets-summary-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--accent-subtle); color: var(--accent-primary); flex-shrink: 0; }
.assets-summary-icon svg { width: 14px; height: 14px; }
.assets-summary-count { font-weight: 600; color: var(--text-primary); text-align: right; }

/* Zakładki typów zasobów (Wszystkie | dynamicznie z API) */
.assets-type-tabs { display: flex; flex-wrap: wrap; gap: var(--space-xs); padding: var(--space-md) 0; border-bottom: 1px solid var(--border-subtle); margin-bottom: var(--space-md); }
.assets-type-tab { padding: var(--space-sm) var(--space-lg); font-size: var(--font-size-sm); font-weight: 500; color: var(--text-secondary); background: none; border: none; border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-fast); }
.assets-type-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.assets-type-tab.active { color: var(--accent-primary); background: var(--accent-subtle); }

.view-toggle { display: flex; align-items: center; gap: 2px; }
.toolbar-btn-icon { padding: var(--space-sm) var(--space-md); }
.toolbar-btn-icon.active { background: var(--accent-subtle); color: var(--accent-primary); }
.toolbar-btn-icon.active svg { color: var(--accent-primary); }
.asset-card { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; min-height: min-content; }
.asset-card-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-lg) var(--space-xl); border-bottom: 1px solid var(--border-subtle); }
.asset-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); flex-shrink: 0; }
.asset-icon svg { width: 20px; height: 20px; color: white; }
.asset-icon.laptop { background: var(--accent-subtle); color: var(--accent-primary); }
.asset-icon.laptop svg { color: var(--accent-primary); }
.asset-icon.desktop { background: var(--info-subtle); color: var(--accent-primary); }
.asset-icon.desktop svg { color: var(--accent-primary); }
.asset-icon.monitor { background: var(--info-subtle); color: var(--info); }
.asset-icon.monitor svg { color: var(--info); }
.asset-icon.phone { background: var(--success-subtle); color: var(--success); }
.asset-icon.phone svg { color: var(--success); }
.asset-icon.smartphone { background: var(--success-subtle); color: var(--success); }
.asset-icon.smartphone svg { color: var(--success); }
.asset-icon.printer { background: var(--warning-subtle); color: var(--warning); }
.asset-icon.printer svg { color: var(--warning); }
.asset-icon.phone_number { background: var(--info-subtle); color: var(--info); }
.asset-icon.phone_number svg { color: var(--info); }
.asset-icon.docking_station { background: var(--accent-subtle); color: var(--accent-primary); }
.asset-icon.docking_station svg { color: var(--accent-primary); }
.asset-icon.google_account { background: var(--danger-subtle); color: var(--danger); }
.asset-icon.google_account svg { color: var(--danger); }
.asset-icon.apple_account { background: var(--info-subtle); color: var(--info); }
.asset-icon.apple_account svg { color: var(--info); }
.asset-icon.server { background: #ede9fe; color: #7c3aed; }
.asset-icon.server svg { color: #7c3aed; }
.asset-icon.switch { background: #e0f2fe; color: #0284c7; }
.asset-icon.switch svg { color: #0284c7; }
.asset-icon.router { background: #fef3c7; color: #d97706; }
.asset-icon.router svg { color: #d97706; }
.asset-icon.domain { background: var(--accent-subtle); color: var(--accent-primary); }
.asset-icon.domain svg { color: var(--accent-primary); }
.asset-icon.vehicle { background: var(--warning-subtle); color: var(--warning); }
.asset-icon.vehicle svg { color: var(--warning); }
.asset-icon.license { background: var(--accent-subtle); color: var(--accent-primary); }
.asset-icon.license svg { color: var(--accent-primary); }
.asset-icon.other { background: var(--bg-hover); color: var(--text-muted); }
.asset-icon.other svg { color: var(--text-muted); }
.asset-status { font-size: var(--font-size-xs); font-weight: 600; padding: 3px 8px; border-radius: var(--radius-sm); }
.asset-status.active, .asset-status.wydany { background: var(--success-subtle); color: var(--success); }
.asset-status.repair, .asset-status.w_serwisie { background: var(--warning-subtle); color: var(--warning); }
.asset-status.storage, .asset-status.dostepny { background: var(--accent-subtle); color: var(--accent-primary); }
.asset-status.retired, .asset-status.zlikwidowany { background: var(--danger-subtle); color: var(--danger); }
.asset-status.nowy { background: var(--info-subtle); color: var(--info); }
.asset-status.wypozyczony { background: var(--warning-subtle); color: var(--warning); }
.asset-status.do_zwrotu { background: var(--orange-subtle); color: var(--orange); }
.asset-status.wymaga_decyzji { background: var(--danger-subtle); color: var(--danger); }
.asset-status.zagubiony, .asset-status.skradziony { background: var(--danger-subtle); color: var(--danger); }
.asset-card-body { padding: var(--space-xl); flex: 1; }
.asset-name { font-size: var(--font-size-base); font-weight: 700; margin: 0 0 var(--space-md); color: var(--text-primary); }
.asset-details { display: flex; flex-direction: column; gap: var(--space-xs); }
.asset-detail { display: flex; justify-content: space-between; gap: var(--space-md); font-size: var(--font-size-sm); }
.asset-detail .label { color: var(--text-muted); flex-shrink: 0; }
.asset-detail .value { color: var(--text-primary); text-align: right; }
.asset-card-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-md) var(--space-xl); border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
.asset-details-list { display: grid; gap: var(--space-sm); max-width: 600px; }
.asset-details-list .asset-detail { display: flex; justify-content: flex-start; gap: var(--space-md); font-size: var(--font-size-sm); }
.asset-details-list .asset-detail .label { color: var(--text-muted); flex-shrink: 0; min-width: 160px; }
.asset-details-list .asset-detail .value { color: var(--text-primary); text-align: left; }
.asset-section-header { font-size: var(--font-size-sm); font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; padding-bottom: var(--space-xs); border-bottom: 1px solid var(--border-subtle); margin-bottom: var(--space-xs); }
.asset-history-table .table-head,
.asset-history-table .table-row { grid-template-columns: 120px 1fr 160px 120px; }

.modal-history-table .table-head,
.modal-history-table .table-row { grid-template-columns: 140px 100px 120px 1fr 1fr; }
.modal-history-table .table-row { cursor: default; }
.modal-history-table .table-row:hover { background: var(--bg-hover); }

/* CONTEXT MENU */
.context-menu { position: fixed; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 6px; min-width: 200px; box-shadow: var(--shadow-lg); z-index: var(--z-modal); display: none; }
.context-menu.visible { display: block; }
.context-menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: var(--font-size-sm); cursor: pointer; transition: all var(--transition-fast); }
.context-menu-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.context-menu-item svg { width: 14px; height: 14px; color: var(--accent-primary); }
.context-menu-divider { height: 1px; background: var(--border-subtle); margin: 4px 0; }

/* FILTER & COLUMNS DROPDOWN */
.filter-dropdown-container, .columns-dropdown-container { position: relative; }
.filter-dropdown, .columns-dropdown { position: absolute; top: calc(100% + 6px); right: 0; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-md); min-width: 280px; box-shadow: var(--shadow-lg); z-index: var(--z-dropdown); display: none; }
.filter-dropdown.visible, .columns-dropdown.visible { display: block; }
.filter-dropdown-header, .columns-dropdown-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: var(--space-md); border-bottom: 1px solid var(--border-subtle); margin-bottom: var(--space-md); }
.filter-dropdown-header span, .columns-dropdown-header span { font-size: var(--font-size-sm); font-weight: 600; }
.filter-group { margin-bottom: var(--space-md); }
.filter-label { display: block; font-size: var(--font-size-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom: var(--space-sm); line-height: 1.25; }
.filter-chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.filter-chip { padding: 5px 10px; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); font-size: var(--font-size-xs); cursor: pointer; transition: all var(--transition-base); }
.filter-chip:hover { border-color: var(--accent-primary); }
.filter-chip.active { background: var(--accent-primary); border-color: var(--accent-primary); color: white; }
.filter-dropdown-footer, .columns-dropdown-footer { padding-top: var(--space-md); border-top: 1px solid var(--border-subtle); margin-top: var(--space-md); }
.columns-dropdown-footer small { display: flex; align-items: center; gap: var(--space-xs); font-size: var(--font-size-xs); color: var(--text-muted); }
.columns-dropdown-footer small svg { width: 12px; height: 12px; }
.columns-list { display: flex; flex-direction: column; gap: var(--space-xs); max-height: 300px; overflow-y: auto; }
.column-toggle { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); cursor: pointer; font-size: var(--font-size-sm); color: var(--text-secondary); transition: background var(--transition-fast); }
.column-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.column-toggle input { margin: 0; accent-color: var(--accent-primary); }
.column-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm) var(--space-md); background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); cursor: grab; transition: all var(--transition-base); }
.column-item:hover { border-color: var(--accent-primary); }
.column-item .grip { color: var(--text-muted); cursor: grab; }
.column-item .grip svg { width: 14px; height: 14px; }
.column-item .col-name { flex: 1; font-size: var(--font-size-sm); }
.column-item .col-toggle { width: 36px; height: 20px; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: 10px; position: relative; cursor: pointer; transition: all var(--transition-base); }
.column-item .col-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--text-muted); border-radius: 50%; transition: all var(--transition-base); }
.column-item .col-toggle.active { background: var(--accent-primary); border-color: var(--accent-primary); }
.column-item .col-toggle.active::after { left: 18px; background: white; }

/* MODALS */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: var(--z-modal-backdrop); display: none; align-items: center; justify-content: center; padding: var(--space-xl); }
.modal-backdrop.visible { display: flex; }
.modal { position: fixed; z-index: var(--z-modal); background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); max-width: 620px; width: calc(100% - 2 * var(--space-xl)); max-height: 85vh; display: flex; flex-direction: column; animation: modalIn 0.2s ease; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.modal.lg { max-width: 900px; }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-lg) var(--space-xl); border-bottom: 1px solid var(--border-default); flex-shrink: 0; }
.modal-title { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--font-size-lg); font-weight: 700; }
.modal-title svg { width: 20px; height: 20px; color: var(--accent-primary); }
.modal-id { color: var(--text-muted); font-weight: 500; }
.modal-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: none; border: none; border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; transition: all var(--transition-base); }
.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: var(--space-xl); overflow-y: auto; flex: 1; }
/* Układ 2-kolumnowy detalu zgłoszenia: treść (karty) po lewej, stały kontekst po prawej.
   Nadpisuje bazowy .modal-body (ta sama specyficzność, późniejsza w kaskadzie). */
.modal-body-split { display: flex; gap: 0; padding: 0; overflow: hidden; align-items: stretch; }
.modal-body-split .modal-main-col { flex: 1 1 auto; min-width: 0; overflow-y: auto; padding: var(--space-xl); }
.modal-body-split .modal-context-sidebar { flex: 0 0 340px; width: 340px; overflow-y: auto; padding: var(--space-lg); border-left: 1px solid var(--border-default); background: var(--bg-secondary); }
/* Kompaktowy meta-kontekst w sidebarze: pary etykieta/wartość jako pionowa lista. */
.modal-ctx-meta { margin-bottom: var(--space-md); }
.modal-ctx-row { padding: var(--space-xs) 0; border-bottom: 1px solid var(--border-subtle, var(--border-default)); }
.modal-ctx-row:last-child { border-bottom: none; }
.modal-ctx-row .modal-label { display: block; font-size: var(--font-size-xs); color: var(--text-muted); margin-bottom: 2px; }
.modal-ctx-row .modal-value { font-size: var(--font-size-sm); color: var(--text-primary); word-break: break-word; }
/* Wariant „inline": etykieta i wartość w jednym rzędzie (oszczędza pion dla krótkich pól). */
.modal-ctx-row.modal-ctx-inline { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); }
.modal-ctx-row.modal-ctx-inline .modal-label { margin-bottom: 0; flex-shrink: 0; }
.modal-ctx-row.modal-ctx-inline .modal-value { text-align: right; }
.modal-ctx-row .modal-value-with-action { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
/* Ikonka przy etykiecie meta (szybkie kojarzenie pola). */
.modal-ctx-ico { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; color: var(--text-muted); }
/* Nagłówek/tytuł zgłoszenia zaznaczalny (można zaznaczyć i skopiować numer/tytuł). */
.modal-title-selectable { user-select: text; -webkit-user-select: text; cursor: text; }
.modal-title-selectable .modal-id { user-select: all; }
/* Blok „Obsługa" w sidebarze: pionowe, pełnoszerokie, spójne przyciski akcji. */
.modal-obsluga { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: var(--space-md); }
.modal-obsluga-title { font-size: var(--font-size-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin-bottom: 2px; }
.modal-obsluga .modal-obsluga-btn { width: 100%; justify-content: flex-start; }
.modal-obsluga-mine { display: flex; align-items: center; gap: 6px; font-size: var(--font-size-sm); color: var(--success); font-weight: 600; }
.modal-obsluga-mine i { width: 14px; height: 14px; }
@media (max-width: 900px) {
  .modal-body-split { flex-direction: column; overflow-y: auto; }
  .modal-body-split .modal-main-col { overflow: visible; }
  .modal-body-split .modal-context-sidebar { flex-basis: auto; width: auto; overflow: visible; border-left: none; border-top: 1px solid var(--border-default); }
}

/* ── Panel „Sugestie AI" (email_ingest) ─────────────────────────────────────── */
.ai-sugg-head { display: flex; align-items: center; gap: var(--space-sm); cursor: pointer; user-select: none; }
.ai-conf-badge { margin-left: auto; font-size: var(--font-size-xs); font-weight: 600; border: 1px solid currentColor; border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.ai-sugg-chevron { transition: transform .15s ease; }
.ai-sugg-fields { display: flex; flex-direction: column; }
.ai-sugg-row { display: grid; grid-template-columns: 86px 1fr auto; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--font-size-sm); }
.ai-sugg-row:last-child { border-bottom: none; }
.ai-sugg-k { font-weight: 600; color: var(--text-secondary); }
.ai-sugg-v { color: var(--text-primary); word-break: break-word; }
.ai-sugg-act { display: inline-flex; gap: 4px; white-space: nowrap; }
.ai-sugg-yes svg { color: var(--success); }   /* akcept = zielony ptaszek (jeden primary = „Zastosuj wszystkie") */

/* ── Stoper: pływający globalny wskaźnik ─────────────────────────────────────
   z-index 250 = PONIŻEJ backdropu modala (300) → chowa się pod otwartym modalem
   (modal ma własny Start/Stop w panelu „Czas pracy"); widoczny na liście. */
.global-timer-indicator {
  position: fixed; left: 16px; bottom: 16px; z-index: 250;
  display: none; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: 999px; padding: 6px 8px 6px 12px; box-shadow: var(--shadow-lg);
  font-size: var(--font-size-sm);
}
.global-timer-indicator .gti-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--danger); flex-shrink: 0;
  animation: gtiPulse 1.4s ease-out infinite;
}
@keyframes gtiPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.global-timer-indicator .gti-open {
  display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none;
  cursor: pointer; color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; padding: 0;
}
.global-timer-indicator .gti-open i { width: 14px; height: 14px; color: var(--accent-primary); }
.global-timer-indicator .gti-ref { color: var(--text-secondary); }
.global-timer-indicator .gti-clock { font-weight: 700; letter-spacing: .5px; }
.global-timer-indicator .gti-stop {
  display: inline-flex; align-items: center; gap: 4px; background: var(--danger); color: #fff;
  border: none; cursor: pointer; border-radius: 999px; padding: 4px 10px;
  font-size: var(--font-size-xs); font-weight: 600;
}
.global-timer-indicator .gti-stop i { width: 12px; height: 12px; }
.global-timer-indicator .gti-stop:hover { background: #dc2626; }

/* ── Wskaźnik „ktoś teraz pracuje" na wierszu listy Obsługi ───────────────────
   CAŁA obwódka wiersza (czytelniej niż pasek) — pulsujący ring inset (nie rusza
   layoutu grid, nie koliduje z tłem hover) + widoczny badge z inicjałami osoby.
   Pauza = ring/badge w kolorze ostrzegawczym, bez animacji. */
.table-row.row-active-work {
  position: relative;
  border-radius: var(--radius-sm);
  animation: rowWorkRing 1.9s ease-in-out infinite;
}
@keyframes rowWorkRing {
  0%, 100% { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent-primary) 50%, transparent); }
  50%      { box-shadow: inset 0 0 0 2px var(--accent-primary); }
}
.table-row.row-active-work.paused {
  animation: none;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--warning) 60%, transparent);
}
/* Badge KTO pracuje (inicjały) — widoczny od razu, nie tylko w tooltipie. */
.row-work-badge {
  position: absolute; top: 50%; right: 42px; transform: translateY(-50%); z-index: 3;
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 999px; background: var(--accent-primary); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; white-space: nowrap;
  pointer-events: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
}
.row-work-badge.is-me { background: var(--success); }
.row-work-badge.paused { background: var(--warning); color: color-mix(in srgb, var(--warning), #000 70%); }
.global-timer-indicator .gti-pause {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; background: transparent; border: 1px solid var(--border-default);
  cursor: pointer; color: var(--text-primary);
}
.global-timer-indicator .gti-pause i { width: 13px; height: 13px; }
.global-timer-indicator .gti-pause:hover { background: var(--bg-secondary); }
.global-timer-indicator.paused .gti-dot { animation: none; background: var(--warning); }
@media (prefers-reduced-motion: reduce) {
  .table-row.row-active-work { animation: none; box-shadow: inset 0 0 0 2px var(--accent-primary); }
  .global-timer-indicator .gti-dot { animation: none; }
}
.modal-section { margin-bottom: var(--space-lg); }
.modal-label { display: block; font-size: var(--font-size-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--space-xs); line-height: 1.25; }
.modal-value { font-size: var(--font-size-base); color: var(--text-primary); }
/* Meta-grid: 2-kolumnowa siatka dla nagłówkowej metadaty zgłoszenia (Zgłaszający, Status, Przypisany, Typ, Zespół, Utworzono).
   Zwarte, łatwe do skanowania wzrokiem. Na mobile <600px collapse do 1 kolumny. */
.modal-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md) var(--space-xl); margin-bottom: var(--space-lg); padding-bottom: var(--space-md); border-bottom: 1px solid var(--border-subtle); }
.modal-meta-grid .modal-section { margin-bottom: 0; }
.modal-meta-grid .modal-section-full { grid-column: 1 / -1; }
@media (max-width: 600px) { .modal-meta-grid { grid-template-columns: 1fr; } }
/* Wartość z inline akcją (np. "—  [+ Przypisz]" w jednej linijce). */
.modal-value-with-action { display: inline-flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.modal-inline-action { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-secondary); font-size: var(--font-size-xs); cursor: pointer; transition: all var(--transition-fast); }
.modal-inline-action:hover { background: var(--bg-hover); color: var(--accent-primary); border-color: var(--accent-primary); }
.modal-inline-action i { width: 13px; height: 13px; }
/* Załączniki w zakładce Szczegóły: lista z mime-icon, nazwa (klik=preview), rozmiar, akcja download. */
.detail-attachments-list { display: flex; flex-direction: column; gap: 4px; }
.detail-attachment-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-card); transition: all var(--transition-fast); }
.detail-attachment-row:hover { border-color: var(--accent-primary); background: var(--bg-hover); }
.detail-attachment-row > i[data-lucide] { width: 18px; height: 18px; }
.detail-attachment-name { flex: 1; min-width: 0; padding: 0; border: none; background: none; color: var(--accent-primary); font-size: var(--font-size-sm); font-weight: 500; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-attachment-name:hover { text-decoration: underline; }
.detail-attachment-meta { font-size: var(--font-size-xs); color: var(--text-muted); white-space: nowrap; }
.detail-attachment-action { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-sm); color: var(--text-muted); text-decoration: none; transition: all var(--transition-fast); }
.detail-attachment-action:hover { background: var(--bg-elevated); color: var(--accent-primary); }
.detail-attachment-action i { width: 16px; height: 16px; }
/* Image lightbox — full-screen overlay z toolbar (download + close) + obrazek scale. */
.image-lightbox-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.88); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 40px 20px; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.image-lightbox-toolbar { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: rgba(0, 0, 0, 0.6); border-radius: var(--radius-md); backdrop-filter: blur(8px); }
.image-lightbox-filename { color: #fff; font-size: var(--font-size-sm); font-weight: 500; margin-right: 8px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-lightbox-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: none; background: transparent; color: #fff; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; transition: background 0.15s; }
.image-lightbox-btn:hover { background: rgba(255, 255, 255, 0.15); }
.image-lightbox-img { max-width: 100%; max-height: calc(100vh - 80px); border-radius: var(--radius-md); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); image-rendering: -webkit-optimize-contrast; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-sm); padding: var(--space-lg) var(--space-xl); border-top: 1px solid var(--border-default); flex-shrink: 0; flex-wrap: wrap; }
/* Split footer — LEFT: utility (Edytuj/Zamknij), RIGHT: workflow transitions.
   Faza 3 ujednolicenia akcji (2026-05-27) — best practice: workflow primary po prawej,
   secondary/utility po lewej (Material Design + Atlassian/Linear). */
.modal-footer-split { justify-content: space-between; }
.modal-footer-left, .modal-footer-right { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.modal-footer-right { margin-left: auto; }
.modal-footer-right:empty { display: none; }

/* Modal Window (draggable) */
.modal-window { position: fixed; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); display: none; flex-direction: column; z-index: var(--z-modal); min-width: 480px; min-height: 360px; }
.modal-window .modal-header { cursor: move; user-select: none; }
.modal-window.maximized { inset: 20px !important; width: auto !important; height: auto !important; }
.modal-actions { display: flex; gap: 4px; }
.modal-action-btn { width: 28px; height: 28px; border: none; background: transparent; color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition-fast); }
.modal-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-action-btn svg { width: 16px; height: 16px; }
.resize-handle { position: absolute; background: transparent; z-index: 10; }
.resize-handle-n { top: -4px; left: 10px; right: 10px; height: 8px; cursor: n-resize; }
.resize-handle-s { bottom: -4px; left: 10px; right: 10px; height: 8px; cursor: s-resize; }
.resize-handle-e { right: -4px; top: 10px; bottom: 10px; width: 8px; cursor: e-resize; }
.resize-handle-w { left: -4px; top: 10px; bottom: 10px; width: 8px; cursor: w-resize; }
.resize-handle-ne { top: -4px; right: -4px; width: 16px; height: 16px; cursor: ne-resize; }
.resize-handle-nw { top: -4px; left: -4px; width: 16px; height: 16px; cursor: nw-resize; }
.resize-handle-se { bottom: -4px; right: -4px; width: 16px; height: 16px; cursor: se-resize; }
.resize-handle-sw { bottom: -4px; left: -4px; width: 16px; height: 16px; cursor: sw-resize; }
.resize-handle-se::after { content: ''; position: absolute; bottom: 6px; right: 6px; width: 10px; height: 10px; border-right: 2px solid var(--border-strong); border-bottom: 2px solid var(--border-strong); opacity: 0.6; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border: 1px solid transparent; border-radius: var(--radius-md); font-family: inherit; font-size: var(--font-size-sm); font-weight: 600; cursor: pointer; transition: all var(--transition-base); white-space: nowrap; }
.btn svg { width: 14px; height: 14px; }
/* Drabinka rozmiarów: xs < sm < base (spójna, tekst nigdy <11px).
   Wcześniej .btn-xs NIE istniał (spadał na .btn → był większy niż .btn-sm),
   a .btn-sm miał font 10px — stąd niespójne wysokości przycisków w modalu. */
.btn-sm { padding: 6px 12px; font-size: var(--font-size-sm); }
.btn-sm svg { width: 13px; height: 13px; }
.btn-xs { padding: 3px 8px; font-size: 11px; gap: 4px; border-radius: var(--radius-sm); }
.btn-xs svg { width: 12px; height: 12px; }
.btn-primary { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-secondary); border-color: var(--border-default); }
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent-primary); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #16a34a; border-color: #16a34a; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }

/* BADGES */
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: var(--radius-sm); font-size: var(--font-size-xs); font-weight: 600; }
.badge-info { background: var(--info-subtle); color: var(--info); }
.badge-success { background: var(--success-subtle); color: var(--success); }
.badge-warning { background: var(--warning-subtle); color: var(--warning); }
.badge-danger { background: var(--danger-subtle); color: var(--danger); }
.badge-primary { background: var(--accent-subtle); color: var(--accent-primary); }
.badge-muted { background: var(--bg-tertiary); color: var(--text-muted); }
.badge-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.badge-orange { background: var(--orange-subtle); color: var(--orange); }
.badge-type-leave { background: var(--info-subtle); color: var(--info); }
.badge-type-access { background: var(--warning-subtle); color: var(--warning); }
.badge-type-incident { background: var(--danger-subtle); color: var(--danger); }
.badge-type-hardware { background: var(--info-subtle); color: var(--info); }
.badge-type-benefit { background: var(--info-subtle); color: var(--info); }
.badge-type-onboarding { background: var(--success-subtle); color: var(--success); }
.badge-type-offboarding { background: var(--warning-subtle); color: var(--warning); }
.badge-type-other { background: var(--info-subtle); color: var(--info); }

/* FORM ELEMENTS */
.form-input { width: 100%; padding: var(--space-md) var(--space-lg); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); color: var(--text-primary); font-family: inherit; font-size: var(--font-size-sm); transition: all var(--transition-base); }
.form-input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-subtle); }
.form-input::placeholder { color: var(--text-muted); }

/* Multi-select dropdown */
.multi-select-wrap { position: relative; display: inline-block; min-width: 160px; }
.multi-select-btn { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-sm) var(--space-md); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); color: var(--text-primary); font-size: var(--font-size-sm); cursor: pointer; user-select: none; white-space: nowrap; transition: all var(--transition-base); }
.multi-select-btn:hover { border-color: var(--accent-primary); }
.multi-select-btn.active { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-subtle); }
.multi-select-btn .ms-count { background: var(--accent-primary); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 10px; margin-left: 2px; }
.multi-select-dropdown { display: none; position: absolute; top: 100%; left: 0; z-index: 200; min-width: 220px; max-height: 280px; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); margin-top: 4px; padding: var(--space-xs) 0; }
.multi-select-dropdown.open { display: block; }
.multi-select-dropdown .ms-search { width: calc(100% - 16px); margin: 4px 8px 6px; padding: var(--space-xs) var(--space-sm); border: 1px solid var(--border-default); border-radius: var(--radius-sm); font-size: var(--font-size-xs); background: var(--bg-elevated); color: var(--text-primary); }
.multi-select-dropdown .ms-search:focus { outline: none; border-color: var(--accent-primary); }
.multi-select-dropdown label { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-md); cursor: pointer; font-size: var(--font-size-sm); color: var(--text-primary); transition: background var(--transition-fast); }
.multi-select-dropdown label:hover { background: var(--bg-hover); }
.multi-select-dropdown label.hidden { display: none; }
.multi-select-dropdown input[type="checkbox"] { accent-color: var(--accent-primary); width: 15px; height: 15px; cursor: pointer; }
.multi-select-dropdown .ms-actions { display: flex; gap: var(--space-xs); padding: var(--space-xs) var(--space-sm); border-top: 1px solid var(--border-subtle); margin-top: var(--space-xs); }
.multi-select-dropdown .ms-actions button { flex: 1; padding: 2px 0; border: none; background: none; font-size: var(--font-size-xs); color: var(--accent-primary); cursor: pointer; border-radius: var(--radius-xs); }
.multi-select-dropdown .ms-actions button:hover { background: var(--accent-subtle); }

.form-textarea { width: 100%; padding: var(--space-md) var(--space-lg); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); color: var(--text-primary); font-family: inherit; font-size: var(--font-size-sm); resize: vertical; transition: all var(--transition-base); }
.form-textarea:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-subtle); }
.form-textarea::placeholder { color: var(--text-muted); }

/* LEAVE CALENDAR (range picker) */
.leave-calendar { background: var(--bg-elevated); border-radius: var(--radius-md); padding: var(--space-md); max-width: 720px; width: 100%; }
.leave-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); }
.leave-cal-title { font-size: var(--font-size-sm); font-weight: 600; color: var(--text-primary); }
.leave-cal-nav { border: 1px solid var(--border-default); background: var(--bg-card); border-radius: var(--radius-sm); width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.leave-cal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
.leave-cal-month { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: var(--space-sm); }
.leave-cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: var(--font-size-xs); color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.leave-cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.leave-day { border: none; background: transparent; border-radius: 4px; padding: 4px 0; font-size: var(--font-size-xs); cursor: pointer; color: var(--text-primary); }
.leave-day:hover { background: var(--bg-hover); }
.leave-day.weekend { color: var(--text-muted); background: var(--bg-hover); }
.leave-day.holiday { color: var(--warning); background: var(--warning-subtle); }
.leave-day.in-range { background: var(--accent-subtle); color: var(--accent-dark); }
.leave-day.start, .leave-day.end { background: var(--accent-primary); color: white; }
.leave-cal-legend { display: flex; gap: var(--space-md); margin-top: var(--space-sm); font-size: var(--font-size-xs); color: var(--text-muted); flex-wrap: wrap; }
.leave-cal-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.leave-cal-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.leave-cal-dot.holiday { background: var(--warning-subtle); }
.leave-cal-dot.weekend { background: var(--bg-hover); }
.leave-cal-dot.range { background: var(--accent-subtle); }

/* LEAVE EVENTS CALENDAR (widok miesięczny zatwierdzonych urlopów) */
.leave-events-calendar { background: var(--bg-elevated); border-radius: var(--radius-md); padding: var(--space-md); }
.cal-grid-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 6px; }
.cal-weekday { font-size: var(--font-size-xs); font-weight: 600; color: var(--text-muted); text-align: center; }
.cal-grid-body { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, 42px); gap: 2px; }
.cal-cell { min-height: 36px; padding: 4px; border-radius: var(--radius-xs); font-size: var(--font-size-xs); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.cal-cell-current { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); }
.cal-cell-other { color: var(--text-muted); opacity: 0.6; }
.cal-day-num { font-weight: 600; margin-bottom: 2px; }
.cal-day-events { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; }
.cal-event-dot { color: var(--accent-primary); font-size: var(--font-size-xs); cursor: default; }
.cal-cell-leave { background: var(--accent-subtle, #dbeafe) !important; border-color: var(--accent-primary, #3b82f6) !important; }
.cal-cell-leave .cal-day-num { color: var(--accent-primary, #2563eb); font-weight: 700; }
.cal-leave-label { font-size: 9px; line-height: 1.1; color: var(--accent-primary, #2563eb); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: block; }
.cal-cell-clickable { cursor: pointer; transition: transform 0.1s, box-shadow 0.1s; }
.cal-cell-clickable:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(0,0,0,0.12); z-index: 2; }

/* LEAVE DETAILS (modal) */
.leave-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
.leave-detail-item { background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: var(--space-sm) var(--space-md); }
.leave-detail-label { font-size: var(--font-size-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.02em; }
.leave-detail-value { font-size: var(--font-size-sm); color: var(--text-primary); margin-top: 2px; }
.leave-detail-note { color: var(--text-muted); font-size: var(--font-size-xs); margin-left: 6px; }

/* LEAVE APPROVAL TIMELINE */
.leave-approval-list { display: grid; gap: var(--space-sm); }
.leave-approval-item { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: var(--space-sm) var(--space-md); background: var(--bg-elevated); }
.leave-approval-item.approved { border-color: rgba(34, 197, 94, 0.35); }
.leave-approval-item.rejected { border-color: rgba(239, 68, 68, 0.35); }
.leave-approval-item.pending { border-color: var(--border-default); }
.leave-approval-item.info { border-color: rgba(59, 130, 246, 0.35); background: rgba(59, 130, 246, 0.06); }
.leave-approval-status { font-weight: 600; font-size: var(--font-size-sm); }
.leave-approval-meta { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 2px; }
.leave-approval-note { font-size: var(--font-size-xs); color: var(--text-secondary); margin-top: 6px; }

/* RADIO OPTIONS */
.radio-option { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-base); }
.radio-option:hover { border-color: var(--accent-primary); }
.radio-option input[type="radio"] { width: 16px; height: 16px; accent-color: var(--accent-primary); }
.radio-option .radio-label { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--font-size-sm); }
.radio-option .radio-label svg { width: 16px; height: 16px; color: var(--accent-primary); }
.condition-options { display: flex; gap: var(--space-sm); }
.condition-dot { width: 10px; height: 10px; border-radius: 50%; }
.condition-dot.good { background: var(--success); }
.condition-dot.fair { background: var(--warning); }
.condition-dot.poor { background: var(--danger); }
.transfer-it-options { display: flex; flex-direction: column; gap: var(--space-sm); }

/* TOASTS */
#toast-container { position: fixed; bottom: var(--space-xl); right: var(--space-xl); display: flex; flex-direction: column; gap: var(--space-sm); z-index: var(--z-toast); }
.toast { display: flex; align-items: flex-start; gap: var(--space-md); padding: var(--space-md) var(--space-lg); background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); animation: toastIn 0.2s ease; max-width: 360px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }
.toast.hiding { animation: toastOut 0.2s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
.toast-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast-icon svg { width: 12px; height: 12px; }
.toast.success .toast-icon { background: var(--success-subtle); color: var(--success); }
.toast.error .toast-icon { background: var(--danger-subtle); color: var(--danger); }
.toast.info .toast-icon { background: var(--accent-subtle); color: var(--accent-primary); }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: var(--font-size-sm); font-weight: 600; }
.toast-message { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 2px; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0; display: flex; }
.toast-close svg { width: 14px; height: 14px; }

/* TRANSFER MODAL */
.transfer-asset-info { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); background: var(--bg-elevated); border-radius: var(--radius-md); margin-bottom: var(--space-lg); }
.transfer-asset-icon { width: 40px; height: 40px; background: var(--accent-subtle); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.transfer-asset-icon svg { width: 20px; height: 20px; color: var(--accent-primary); }
.transfer-asset-name { font-size: var(--font-size-sm); font-weight: 600; }
.transfer-asset-inv { font-size: var(--font-size-xs); color: var(--text-muted); font-family: monospace; }
.user-search-container { position: relative; }
.user-search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); max-height: 200px; overflow-y: auto; z-index: 10; display: none; }
.user-search-results.visible { display: block; }
.user-search-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); cursor: pointer; transition: background var(--transition-fast); }
.user-search-item:hover { background: var(--bg-hover); }
.user-search-item .avatar { width: 32px; height: 32px; }
.user-search-item-info { flex: 1; }
.user-search-item-name { font-size: var(--font-size-sm); font-weight: 500; }
.user-search-item-meta { font-size: var(--font-size-xs); color: var(--text-muted); }
.selected-user { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); background: var(--accent-subtle); border: 1px solid var(--accent-primary); border-radius: var(--radius-md); margin-top: var(--space-md); }
.selected-user-info { flex: 1; }
.selected-user-name { font-size: var(--font-size-sm); font-weight: 500; }
.selected-user-email { font-size: var(--font-size-xs); color: var(--text-muted); }
.transfer-info-box { display: flex; gap: var(--space-md); padding: var(--space-md); background: var(--info-subtle); border: 1px solid var(--border-default); border-radius: var(--radius-md); margin-top: var(--space-lg); }
.transfer-info-box > svg { width: 18px; height: 18px; color: var(--info); flex-shrink: 0; margin-top: 2px; }
.transfer-info-box strong { font-size: var(--font-size-sm); display: block; margin-bottom: var(--space-xs); }
.transfer-info-box p { font-size: var(--font-size-xs); color: var(--text-secondary); margin: 0; }

/* PROTOCOL MODAL */
.protocol-modal { max-width: 900px; }
.protocol-preview { background: white; border-radius: var(--radius-md); padding: var(--space-xl); color: #1e293b; }
.protocol-document { font-family: var(--font-family-base); }
.protocol-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-xl); padding-bottom: var(--space-lg); border-bottom: 2px solid var(--border-default); }
.protocol-logo { display: flex; align-items: center; gap: var(--space-md); }
.protocol-logo .logo-mark { width: 32px; height: 32px; background: linear-gradient(135deg, var(--accent-primary), var(--info)); }
.protocol-logo span { font-size: var(--font-size-sm); font-weight: 600; color: var(--text-muted); }
.protocol-number { font-family: monospace; font-size: var(--font-size-sm); color: var(--text-muted); background: var(--bg-elevated); padding: 4px 10px; border-radius: var(--radius-sm); }
.protocol-title { text-align: center; font-size: var(--font-size-lg); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-sm); }
.protocol-date { text-align: center; font-size: var(--font-size-sm); color: var(--text-muted); margin-bottom: var(--space-xl); }
.protocol-section { margin-bottom: var(--space-xl); }
.protocol-section h3 { font-size: var(--font-size-sm); font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-md); padding-bottom: var(--space-xs); border-bottom: 1px solid var(--border-default); }
.protocol-table { width: 100%; border-collapse: collapse; }
.protocol-table td { padding: var(--space-sm) 0; font-size: var(--font-size-sm); vertical-align: top; }
.protocol-table td:first-child { width: 140px; color: var(--text-muted); }
.protocol-section p { font-size: var(--font-size-sm); color: var(--text-secondary); }
.protocol-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); margin-top: var(--space-2xl); padding-top: var(--space-xl); border-top: 1px solid var(--border-default); }
.protocol-signature { text-align: center; }
.signature-line { height: 60px; border-bottom: 1px solid var(--border-strong); margin-bottom: var(--space-sm); }
.signature-label { font-size: var(--font-size-xs); color: var(--text-muted); margin-bottom: var(--space-sm); }
.signature-status { display: inline-flex; align-items: center; gap: var(--space-xs); padding: 4px 10px; border-radius: var(--radius-sm); font-size: var(--font-size-xs); font-weight: 600; }
.signature-status.pending { background: var(--warning-subtle); color: var(--warning); }
.signature-status.approved { background: var(--success-subtle); color: var(--success); }
.signature-status svg { width: 12px; height: 12px; }

/* PENDING TRANSFERS */
.pending-transfers-section { margin-bottom: var(--space-xl); }
.section-alert { display: flex; align-items: flex-start; gap: var(--space-md); padding: var(--space-md) var(--space-lg); border-radius: var(--radius-md); margin-bottom: var(--space-md); }
.section-alert.info { background: var(--info-subtle); border: 1px solid var(--border-default); }
.section-alert > svg { width: 20px; height: 20px; color: var(--info); flex-shrink: 0; }
.alert-content strong { font-size: var(--font-size-sm); display: block; }
.alert-content p { font-size: var(--font-size-xs); color: var(--text-secondary); margin: 0; }
.pending-transfers-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.pending-transfer-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); }

/* SAVED FILTERS */
.saved-filters-list { margin-top: var(--space-lg); }
.saved-filter-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm) var(--space-md); background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin-top: var(--space-sm); cursor: pointer; }
.saved-filter-item:hover { border-color: var(--accent-primary); }
.saved-filter-item svg { width: 14px; height: 14px; color: var(--accent-primary); }
.saved-filter-item span { flex: 1; font-size: var(--font-size-sm); }

/* ASSET CARD ACTIONS */
.asset-actions-dropdown { position: relative; }
.asset-actions-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; transition: all var(--transition-base); }
.asset-actions-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.asset-actions-btn svg { width: 16px; height: 16px; }
.asset-actions-menu { position: absolute; top: 100%; right: 0; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 4px; min-width: 180px; box-shadow: var(--shadow-lg); z-index: var(--z-dropdown); display: none; }
.asset-actions-menu.visible { display: block; }
.asset-action-item { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); font-size: var(--font-size-sm); color: var(--text-secondary); cursor: pointer; transition: all var(--transition-fast); }
.asset-action-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.asset-action-item svg { width: 14px; height: 14px; color: var(--accent-primary); }
.asset-action-divider { height: 1px; background: var(--border-subtle); margin: var(--space-xs) 0; }

/* PERMISSIONS */
.permissions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: var(--space-lg); }
.permissions-section { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-xl); }
.permissions-section-title { font-size: var(--font-size-base); font-weight: 600; margin-bottom: var(--space-lg); display: flex; align-items: center; gap: var(--space-sm); }
.permissions-section-title svg { width: 18px; height: 18px; color: var(--accent-primary); }
.permissions-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.permission-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); transition: all var(--transition-base); }
.permission-item:hover { border-color: var(--accent-primary); }
.permission-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.permission-icon svg { width: 18px; height: 18px; }
.permission-icon.role { background: var(--info-subtle); color: var(--info); }
.permission-icon.app { background: var(--accent-subtle); color: var(--accent-primary); }
.permission-icon.delegate { background: var(--success-subtle); color: var(--success); }
.permission-info { flex: 1; min-width: 0; }
.permission-name { font-size: var(--font-size-sm); font-weight: 600; }
.permission-desc { font-size: var(--font-size-xs); color: var(--text-muted); }
.permission-badge { padding: 3px 8px; border-radius: var(--radius-sm); font-size: var(--font-size-xs); font-weight: 600; flex-shrink: 0; }
.permission-badge.primary { background: var(--accent-subtle); color: var(--accent-primary); }
.permission-badge.success { background: var(--success-subtle); color: var(--success); }
.permission-badge.info { background: var(--info-subtle); color: var(--info); }
.ad-groups-list { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.ad-group-tag { padding: 4px 10px; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); font-size: var(--font-size-xs); font-weight: 500; color: var(--text-secondary); }

/* ADMIN */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-lg); }
.admin-section { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-xl); }
.admin-section-title { font-size: var(--font-size-base); font-weight: 600; margin-bottom: var(--space-lg); display: flex; align-items: center; gap: var(--space-sm); }
.admin-section-title svg { width: 18px; height: 18px; color: var(--accent-primary); }
.admin-user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.table-container[data-table="admin-users"] { }
.admin-users-table-head.table-head { display: grid; gap: var(--space-md); padding: var(--space-md) var(--space-xl); background: var(--bg-elevated); border-bottom: 1px solid var(--border-default); }
.admin-users-table-head .table-head-cell.sortable { cursor: pointer; }
.admin-users-table-head .table-head-cell.sortable.sorted { color: var(--accent-primary); }
.admin-user-email-cell { min-width: 0; word-break: break-word; overflow-wrap: break-word; }
.table-container[data-table="admin-users"] .table-body .table-row { display: grid; grid-template-columns: 44px minmax(260px, 1.4fr) 90px 100px 110px 100px 110px 70px minmax(200px, 1fr); gap: var(--space-md); padding: var(--space-md) var(--space-xl); align-items: center; }
.admin-user-detail .modal-section { margin-bottom: var(--space-lg); }
.admin-user-detail .modal-section strong { display: block; font-size: var(--font-size-sm); color: var(--text-muted); margin-bottom: var(--space-xs); }
.admin-user-groups, .admin-user-balances, .admin-user-assets { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.admin-user-detail .balance-chip { font-size: var(--font-size-sm); padding: 4px 8px; background: var(--bg-elevated); border-radius: var(--radius-sm); }
.pagination-bar { padding: var(--space-md) var(--space-xl); background: var(--bg-elevated); border: 1px solid var(--border-default); border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-md); font-size: var(--font-size-sm); }
.filter-option { display: block; padding: var(--space-sm) 0; cursor: pointer; font-size: var(--font-size-sm); }
.filter-option input { margin-right: var(--space-sm); }
.admin-logs-links { display: flex; flex-wrap: wrap; gap: var(--space-md); }
.admin-logs-links .btn { text-decoration: none; }
.admin-logs-links .btn svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: middle; }
.admin-option { margin-bottom: var(--space-lg); }
.admin-label { font-size: var(--font-size-sm); font-weight: 500; color: var(--text-secondary); margin-bottom: var(--space-sm); display: block; }
/* Komponent: option-group (segmented control) — przyciski wewnątrz to istniejący .tab-btn */
.option-group { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 3px; }
.option-group .tab-btn { padding: var(--space-xs) var(--space-md); white-space: nowrap; justify-content: center; }
.admin-option-desc { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: var(--space-xs); }
body.font-size-s { --font-size-xs: 9px; --font-size-sm: 11px; --font-size-base: 12px; --font-size-lg: 14px; --font-size-xl: 16px; }
body.font-size-m { --font-size-xs: 10px; --font-size-sm: 12px; --font-size-base: 13px; --font-size-lg: 15px; --font-size-xl: 18px; }
body.font-size-l { --font-size-xs: 11px; --font-size-sm: 13px; --font-size-base: 15px; --font-size-lg: 17px; --font-size-xl: 20px; }
body.font-size-xl { --font-size-xs: 12px; --font-size-sm: 14px; --font-size-base: 17px; --font-size-lg: 19px; --font-size-xl: 22px; }
.color-presets { display: flex; gap: var(--space-sm); }
.color-preset { width: 32px; height: 32px; border-radius: var(--radius-md); cursor: pointer; border: 2px solid transparent; transition: all var(--transition-base); }
.color-preset:hover, .color-preset.active { border-color: white; transform: scale(1.1); }
.admin-menu { display: flex; flex-direction: column; gap: var(--space-sm); }
.admin-menu-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-base); }
.admin-menu-item:hover { border-color: var(--accent-primary); background: var(--bg-hover); }
.admin-menu-item > svg { width: 20px; height: 20px; color: var(--accent-primary); }
.admin-menu-item > svg:last-child { color: var(--text-muted); margin-left: auto; width: 16px; height: 16px; }
.admin-menu-item > div { flex: 1; }
.admin-menu-title { font-size: var(--font-size-sm); font-weight: 600; }
.admin-menu-desc { font-size: var(--font-size-xs); color: var(--text-muted); }
.system-status { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.status-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm) 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.error { background: var(--danger); }
.status-dot.neutral { background: var(--text-muted); opacity: 0.7; }
.status-item span:first-of-type { flex: 1; font-size: var(--font-size-sm); }
.status-value { font-size: var(--font-size-sm); color: var(--text-muted); }
.system-info { border-top: 1px solid var(--border-subtle); padding-top: var(--space-md); }
.info-row { display: flex; justify-content: space-between; padding: var(--space-xs) 0; font-size: var(--font-size-sm); }
.info-row span:first-child { color: var(--text-muted); }
.table-wrap { overflow-x: auto; margin-top: var(--space-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.data-table th, .data-table td { padding: var(--space-sm) var(--space-md); text-align: left; border-bottom: 1px solid var(--border-subtle); }
.data-table th { color: var(--text-muted); font-weight: 600; }
.data-table tbody tr:hover { background: var(--bg-hover); }

/* USER PROFILE POPOVER */
.user-link { color: var(--accent-primary); cursor: pointer; text-decoration: underline; transition: color var(--transition-base); }
.user-link:hover { color: var(--accent-dark); }
.table-user-link { text-decoration: none; color: var(--text-primary); }
.table-user-link:hover { color: var(--accent-primary); }
/* Zgłaszający / Przypisany do – ten sam styl co badge: wypełnione tło, font-size-sm, font-weight 600 */
.cell-reporter, .cell-assigned { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: var(--radius-sm); font-size: var(--font-size-sm); font-weight: 600; background: var(--accent-subtle); color: var(--accent-primary); }
.cell-reporter .table-user-link, .cell-assigned .table-user-link { color: inherit; }
.cell-reporter .table-user-link:hover, .cell-assigned .table-user-link:hover { color: var(--accent-dark); }
/* Smart fallback warianty kolumny "Przypisany do" dla LVE (gdy assigned_user puste):
   - approver: czeka na decyzję, akcent z zegarem
   - hr: czeka u HR (brak managera lub manager niedostępny), żółty akcent
   - approved: już zatwierdzony, zielony akcent z check */
.cell-assigned.cell-assigned-approver { background: var(--accent-subtle); color: var(--accent-primary); }
.cell-assigned.cell-assigned-hr { background: var(--warning-subtle); color: var(--warning); font-size: var(--font-size-xs); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-assigned.cell-assigned-approved { background: var(--success-subtle); color: var(--success); }
.cell-assigned.cell-assigned-approved .table-user-link { color: inherit; }
.cell-assigned.cell-assigned-approved .table-user-link:hover { color: var(--success); opacity: 0.85; }
.user-profile-popover { position: fixed; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: var(--z-modal); min-width: 280px; max-width: 320px; }
.user-profile-header { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-lg); border-bottom: 1px solid var(--border-subtle); position: relative; }
.user-profile-avatar { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-primary), var(--info)); display: flex; align-items: center; justify-content: center; font-size: var(--font-size-base); font-weight: 700; color: white; flex-shrink: 0; overflow: hidden; position: relative; }
.user-profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; position: absolute; top: 0; left: 0; }
.user-profile-info { flex: 1; min-width: 0; }
.user-profile-name { font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); }
.user-profile-email { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 2px; }
.user-profile-close { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; transition: all var(--transition-fast); }
.user-profile-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.user-profile-close svg { width: 14px; height: 14px; }
.user-profile-body { padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-md); }
.user-profile-item { display: flex; align-items: flex-start; gap: var(--space-md); }
.user-profile-item svg { width: 18px; height: 18px; color: var(--accent-primary); flex-shrink: 0; margin-top: 2px; }
.user-profile-label { font-size: var(--font-size-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.user-profile-value { font-size: var(--font-size-sm); color: var(--text-primary); }
.user-profile-footer { padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--border-subtle); display: flex; gap: var(--space-sm); }
.user-profile-action { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); background: var(--accent-subtle); border: 1px solid var(--accent-primary); border-radius: var(--radius-md); color: var(--accent-primary); font-size: var(--font-size-sm); font-weight: 500; text-decoration: none; transition: all var(--transition-base); flex: 1; justify-content: center; }
.user-profile-action:hover { background: var(--accent-primary); color: white; }
.user-profile-action svg { width: 14px; height: 14px; }
.column-toggle.dragging { opacity: 0.5; }

/* OpenStreetMap in modal */
.location-map-container {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.location-map-search {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.location-map-search .form-input {
    flex: 1;
}

.location-map {
    height: 300px;
    width: 100%;
    background: var(--bg-elevated);
}

/* Fix Leaflet z-index w modalu */
.location-map .leaflet-pane { z-index: 1; }
.location-map .leaflet-top,
.location-map .leaflet-bottom { z-index: 2; }

.location-coords {
    display: flex;
    align-items: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

.location-coords .coord-field {
    flex: 1;
}

.location-coords .coord-field .modal-label {
    margin-bottom: 2px;
}

.location-coords .coord-field input {
    width: 100%;
    font-size: var(--font-size-xs);
    padding: var(--space-xs) var(--space-sm);
}

/* RESPONSIVE */
@media (max-width: 1200px) { .nav-btn span:not(.count):not(.nav-count-slot) { display: none; } .dashboard-card.large { grid-column: span 1; } }
@media (max-width: 1200px) { .user-role { display: none; } }
@media (max-width: 900px) { .search-bar { width: 160px; } .toolbar-btn span { display: none; } .table-head, .table-row { grid-template-columns: 60px 1fr 100px; } .user-name { max-width: 120px; } }
/* Zasoby – lista ma 4 kolumny także na małych ekranach (nie 3 jak zadania) */
@media (max-width: 900px) {
    .assets-table-container .table-head,
    .assets-table-container .table-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 50px 90px 90px; gap: var(--space-md); }
}
@media (max-width: 760px) { .user-name { display: none; } }
@media (max-width: 640px) {
    .modal { max-width: 100%; width: calc(100% - 2 * var(--space-md)); max-height: 90vh; border-radius: var(--radius-lg); }
    .modal.lg { max-width: 100%; }
    .modal-window { min-width: 320px; }
    .modal-footer { padding: var(--space-md); }
    .modal-footer .btn { flex: 1 1 auto; }
}

/* ===== Organization Directory (Katalog Organizacji) ===== */
.org-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-lg);
    padding: var(--space-md) 0;
}
.org-emp-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    transition: all var(--transition-base);
}
/* Org chart v3 — indented tree */
.oc-tree-wrapper { display: flex; flex-direction: column; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-card); overflow: hidden; }
.oc-tree-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--border-default); background: var(--bg-elevated); }
.oc-ctrl-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-secondary); font-size: var(--font-size-xs); font-weight: 500; cursor: pointer; transition: all var(--transition-fast); }
.oc-ctrl-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent-primary); }
.oc-tree-scroll { max-height: calc(100vh - 340px); min-height: 300px; overflow-y: auto; padding: 8px 0; }
.oc-tree-list { }
.oc-tree-separator { height: 1px; margin: 10px 14px; background: var(--border-default); }

/* Tree row */
.oc-tree-row { display: flex; align-items: center; gap: 6px; padding: 5px 14px 5px 4px; cursor: default; transition: background var(--transition-fast); position: relative; }
.oc-tree-row:hover { background: var(--bg-hover); }
.oc-tree-row-root { padding-top: 8px; padding-bottom: 8px; }

/* Indent area with vertical guide lines */
.oc-tree-indent { position: relative; flex-shrink: 0; height: 100%; }
.oc-tree-guide { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-default); }

/* Toggle (expand/collapse) */
.oc-tree-toggle { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); cursor: pointer; transition: all var(--transition-fast); }
.oc-tree-toggle:hover { background: var(--bg-hover); color: var(--accent-primary); }

/* Leaf placeholder (no children) */
.oc-tree-leaf { display: block; width: 22px; height: 22px; flex-shrink: 0; }

/* Avatar */
.oc-tree-avatar { flex-shrink: 0; }

/* Info (clickable) */
.oc-tree-info { flex: 1; min-width: 0; cursor: pointer; padding: 2px 4px; border-radius: var(--radius-sm); transition: background var(--transition-fast); }
.oc-tree-info:hover { background: var(--bg-elevated); }
.oc-tree-name { font-weight: 600; font-size: var(--font-size-sm); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.oc-tree-row-root .oc-tree-name { font-size: 14px; font-weight: 700; }
.oc-tree-title { font-size: var(--font-size-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; margin-top: 1px; }

/* Department badge */
.oc-tree-dept { flex-shrink: 0; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }

/* Children count badge */
.oc-tree-count { flex-shrink: 0; display: flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-primary); color: #fff; font-size: 10px; font-weight: 700; }

/* Children container */
.oc-tree-children { }

/* Orphans section */
.oc-orphans { border-top: 1px solid var(--border-default); background: var(--bg-card); }
.oc-orphans-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 14px; border: none; background: transparent; color: var(--text-muted); font-size: var(--font-size-sm); font-weight: 600; cursor: pointer; transition: color var(--transition-fast); }
.oc-orphans-toggle:hover { color: var(--text-primary); }
.oc-orphans-toggle span { flex: 1; text-align: left; }
.oc-orphans-toggle i:last-child { transition: transform 0.2s; }
.oc-orphans-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; padding: 0 14px 14px; }
.oc-orphan-card { padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-default); background: var(--bg-elevated); cursor: pointer; transition: all var(--transition-fast); }
.oc-orphan-card:hover { border-color: var(--accent-primary); box-shadow: var(--shadow-sm); }
@media (max-width: 900px) {
    .org-card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .oc-tree-dept { display: none; }
}

/* ── Impersonation banner ────────────────────────────────────────────── */
.impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: var(--color-warning, #f59e0b);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm, 8px);
    font-size: var(--font-size-sm, 13px);
    font-weight: 600;
    z-index: 10001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.impersonation-banner i { width: 16px; height: 16px; }
.imp-stop-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: var(--space-md, 12px);
    padding: 3px 12px;
    border-radius: var(--radius-sm, 4px);
    border: 1px solid rgba(0, 0, 0, 0.25);
    background: rgba(0, 0, 0, 0.12);
    color: #000;
    font-size: var(--font-size-sm, 13px);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast, 0.15s);
}
.imp-stop-btn:hover { background: rgba(0, 0, 0, 0.22); }
.imp-stop-btn i { width: 14px; height: 14px; }

body.impersonating .app-header { top: 36px; }
body.impersonating .main-content { padding-top: calc(var(--header-height, 56px) + 36px); }

.ai-cursor { animation: ai-blink 0.6s step-end infinite; color: var(--primary); font-weight: 300; }
@keyframes ai-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.ai-thinking { display: flex; align-items: center; gap: 4px; padding: 4px 0; }
.ai-thinking-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: ai-bounce 1.4s ease-in-out infinite; }
.ai-thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE OPTIMIZATIONS — FullHD + Mobile (2026-04-24)
   - FullHD: max-width 1600px na content żeby nie rozlewać się
   - Mobile: hamburger menu, modal-window responsive, dropdowny boundary
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tooltip dla nav-btn gdy labels są ukryte (< 1600px) ──────────────────
   Pojawia się pod przyciskiem gdy user hover'uje. Lepsze UX niż natywny
   `title` (szybszy, stylizowany, spójny z motywem). */
.nav-btn[data-tooltip] { position: relative; }
.nav-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: var(--z-tooltip);
}
.nav-btn[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0.3s;  /* nie migocz przy przesuwaniu myszy nad paskiem */
}
/* Nie pokazuj tooltipów gdy labels są widoczne (> 1600px) — redundant. */
@media (min-width: 1601px) {
    .nav-btn[data-tooltip]::after { display: none; }
}
/* Nie pokazuj tooltipów w drawerze mobile — tam są pełne labels. */
@media (max-width: 900px) {
    .main-nav.nav-open .nav-btn[data-tooltip]::after { display: none; }
}

/* ── Overflow fix (override older rules) ──────────────────────────────────
   Problem: 9 pozycji w main-nav + logo + header-right (3 icon-btn + user-menu)
   nie mieszczą się na typowym laptopie 1366-1600px → header-right nachodzi na
   nav. Podnosimy breakpoint ukrywania labels z 1200 do 1600px i pozwalamy
   header-right się ściskać zamiast rozpychać nav. */

/* header-right może się ściskać — user-name / user-role mają max-width, więc
   nic realnie nie zginie, tylko ellipsis zamiast pełnej nazwy. */
.header-right { flex-shrink: 1; min-width: 0; }

/* Labels nav-btn zostają tylko na szerokich ekranach (>= 1600px). */
@media (max-width: 1600px) {
    .nav-btn span:not(.count):not(.nav-count-slot) { display: none; }
}

/* user-role ukryty wcześniej — na 1400px zamiast 1200px. */
@media (max-width: 1400px) {
    .user-role { display: none; }
    .user-name { max-width: 120px; }
}

/* ── Hamburger button (default: hidden, shown on mobile) ──────────────────── */
.nav-burger {
    display: none;
    width: 38px; height: 38px;
    align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    flex-shrink: 0;
}
.nav-burger:hover { background: var(--bg-hover); color: var(--accent-primary); border-color: var(--accent-primary); }
.nav-burger svg { width: 18px; height: 18px; }
.nav-burger.open { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }

/* ── FullHD: max-width content + centrowanie ──────────────────────────────── */
@media (min-width: 1600px) {
    .main-content {
        max-width: 1600px;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    /* Header zachowuje pełną szerokość (logo + nav rozciągnięte) ale jego
       wewnętrzne elementy mogą mieć max-width. Zostawiamy header pełen —
       tylko content centrowany. */

    /* Wyjątek: każda strona z tabelą danych (.table-container) korzysta z
       pełnej szerokości ekranu. Cap 1600px wymuszał poziomy suwak na szerokich
       tabelach (np. Obsługa potrzebuje ~1610px, a dostępne było ~1560px).
       :has() jest już używane w tym pliku (.table-row > div:has(.row-id)). */
    .main-content:has(.table-container) {
        max-width: none;
    }
}

/* ── Dropdown "Zarządzanie" — prawy brzeg dla last-of-type żeby nie wychodził za ekran ── */
.main-nav .nav-dropdown:last-of-type .nav-dropdown-menu,
.main-nav .nav-dropdown.nav-dropdown-right .nav-dropdown-menu {
    left: auto;
    right: 0;
}

/* ── Tablet / small laptop: hamburger pojawia się, nav-btn labels z powrotem widoczne w drawer ── */
@media (max-width: 900px) {
    .nav-burger { display: flex; }

    /* Chowamy main-nav z flow header; pokaz jako drawer absolute */
    .main-nav {
        display: none !important;
        position: fixed;
        top: calc(var(--header-height, 56px));
        left: 8px;
        right: 8px;
        max-height: calc(100vh - var(--header-height, 56px) - 16px);
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
        gap: 4px;
        background: var(--bg-card);
        border: 1px solid var(--border-default);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        z-index: var(--z-sticky);
    }
    .main-nav.nav-open {
        display: flex !important;
    }
    /* W drawerze pokazujemy labels z powrotem (zakrywamy breakpoint 1200px) */
    .main-nav .nav-btn span:not(.count):not(.nav-count-slot) { display: inline !important; }
    .main-nav .nav-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 10px 12px;
    }
    .main-nav .nav-item, .main-nav .nav-dropdown { width: 100%; }
    /* Dropdown "Zarządzanie" w drawer — inline, bez absolute */
    .main-nav .nav-dropdown-menu {
        position: static;
        left: auto; right: auto; top: auto;
        box-shadow: none;
        border: none;
        padding: 4px 0 4px 24px;
        min-width: 0;
        background: transparent;
    }

    /* Impersonation banner offset — drawer idzie pod nim */
    body.impersonating .main-nav { top: calc(var(--header-height, 56px) + 36px); }
}

/* ── Mobile (<768px): modal-window full-width, dropdowny mieszczą się w viewport ── */
@media (max-width: 768px) {
    /* modal-window (floating detail — dragable) — na mobile traktujemy jak modal */
    .modal-window {
        min-width: 0 !important;
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        left: 8px !important;
        top: 8px !important;
        right: 8px;
        max-height: calc(100vh - 16px) !important;
    }
    .modal-window .modal-header { cursor: default; }  /* drag disabled on touch */

    /* Notifications / user / nav dropdowns - boundary */
    .notifications-dropdown-menu,
    .user-dropdown-menu {
        max-width: calc(100vw - 16px);
        right: 8px !important;
    }

    /* Tables: opakowane w overflow-x jeśli rodzic na to pozwala */
    .assets-table-container,
    .notifications-log-table-wrap,
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Header: mniej padding na mobile */
    .app-header { padding: var(--space-sm) var(--space-md); gap: var(--space-sm); }
    .header-left { gap: var(--space-md); }
    .logo-subtitle { display: none; }
    .main-content { padding: var(--space-md); }

    /* Search bar na mobile w headerze zostaje ale węższy */
    .search-bar { width: 120px !important; }
}

/* ── Very small (<480px): ukrywamy search-bar w headerze; działa button ikonowy ── */
@media (max-width: 480px) {
    .header-right .search-bar { display: none; }
    .logo-text { font-size: var(--font-size-lg); }
}

/* ============ URLOPY ZESPOŁU (oś czasu + lista) ============ */
:root {
    --leave-vacation: #34d399;
    --leave-on-demand: #60a5fa;
    --leave-sick: #f87171;
    --leave-occasional: #c084fc;
    --leave-childcare: #fbbf24;
    --leave-other: #94a3b8;
    --leave-bar-fg: #0b1220;
    --tl-weekend: rgba(148, 163, 184, 0.09);
    --tl-cov-high: rgba(245, 158, 11, 0.20);
}
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tl-leg-item { display: inline-flex; align-items: center; gap: 6px; font-size: var(--font-size-sm); color: var(--text-secondary); }
.tl-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex: none; }
.tl-grid { position: relative; }
.tl-row { position: relative; display: flex; }
.tl-head { border-bottom: 1px solid var(--border-default); }
.tl-name { position: sticky; left: 0; z-index: 2; flex: none; height: 100%; display: flex; align-items: center; gap: 7px; font-size: var(--font-size-sm); color: var(--text-primary); overflow: hidden; padding-right: 8px; box-sizing: border-box; background: var(--bg-card); border-right: 1px solid var(--border-default); }
.tl-ava { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-elevated); border: 1px solid var(--border-strong, var(--border-default)); font-size: 9px; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.tl-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; flex: none; height: 100%; }
.tl-cal-summary { font-size: var(--font-size-sm); color: var(--text-secondary); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.tl-cal-summary b { color: var(--text-primary); font-weight: 700; }
.tl-bg.tl-holiday { background: var(--tl-weekend); }
.tl-bg.tl-today { background: var(--accent-subtle); }
.tl-bg { position: absolute; top: 0; height: 100%; border-right: 1px solid var(--border-subtle, var(--border-default)); box-sizing: border-box; }
.tl-th { position: absolute; top: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 9px; line-height: 1.15; }
.tl-cov { position: absolute; top: 0; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 10px; border-right: 1px solid var(--border-subtle, var(--border-default)); box-sizing: border-box; color: var(--text-muted); border-radius: 3px; }
.tl-bar { position: absolute; top: 4px; height: 22px; border-radius: 5px; display: flex; align-items: center; padding: 0 6px; font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; cursor: pointer; }
.tl-bar:hover { filter: brightness(1.08); }
.tl-bar.tl-pend { background: transparent !important; border: 1.5px dashed; }
.tl-empty { text-align: center; color: var(--text-muted); padding: var(--space-xl); }
.tl-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-base); }
.tl-table th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: 11px; letter-spacing: .03em; text-transform: uppercase; padding: 9px 10px; border-bottom: 1px solid var(--border-strong, var(--border-default)); }
.tl-table td { padding: 11px 10px; border-bottom: 1px solid var(--border-default); color: var(--text-primary); }
.tl-table tbody tr:hover td { background: var(--bg-elevated); }
.tl-table tfoot td { border-bottom: 0; padding-top: 11px; color: var(--text-secondary); }
.tl-num { text-align: right; font-variant-numeric: tabular-nums; }
.tl-badge { display: inline-flex; align-items: center; gap: 5px; font-size: var(--font-size-sm); padding: 2px 9px; border-radius: 999px; font-weight: 500; background: var(--bg-elevated); }
.tl-badge.tl-badge-ok { background: var(--success-subtle, rgba(34, 197, 94, .14)); color: var(--success, #22c55e); }
.tl-summary { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.tl-mc { font-size: var(--font-size-base); color: var(--text-secondary); }
.tl-mc b { color: var(--text-primary); font-size: var(--font-size-lg); font-weight: 700; margin-right: 3px; }
.tl-cov.tl-cov-warn { background: var(--tl-cov-high); color: var(--text-primary); font-weight: 700; }
.tl-bar:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 1px; }
.tl-table tbody tr { cursor: pointer; }
.tl-table tbody tr:focus-visible { outline: 2px solid var(--accent-light); outline-offset: -2px; }
