/* 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);
}
*, *::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); }
.table-row.selected { background: var(--accent-subtle); }
.table-row.hidden { display: none; }
.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; }
.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); }
.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); }

.tasks-bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); padding: var(--space-md) var(--space-lg); background: var(--accent-subtle); border: 1px solid var(--border-default); border-radius: var(--radius-md); margin-bottom: var(--space-md); }
.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; }
.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); }

/* KATALOG USŁUG (page-services) */
.page-section#page-services .toolbar { width: 100%; }
.page-section#page-services .toolbar .search-bar { margin: 0 auto; }
.services-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-lg); overflow-y: auto; min-height: 0; padding-bottom: var(--space-md); align-content: start; }
.service-category { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.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; }
.service-list { display: flex; flex-direction: column; padding: var(--space-sm); }
.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: pointer; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; transition: all var(--transition-fast); }
.maturity-badge:hover { filter: brightness(0.9); transform: scale(1.05); }
.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; }

/* 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; }
.ai-logo { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent-primary), #8b5cf6, var(--info)); border-radius: var(--radius-lg); flex-shrink: 0; animation: ai-pulse 3s ease-in-out infinite; box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
.ai-logo svg { width: 24px; height: 24px; color: white; animation: ai-sparkle 2s ease-in-out infinite; }
@keyframes ai-pulse { 0%, 100% { box-shadow: 0 0 15px rgba(99, 102, 241, 0.3); transform: scale(1); } 50% { box-shadow: 0 0 25px rgba(139, 92, 246, 0.5); transform: scale(1.05); } }
@keyframes ai-sparkle { 0%, 100% { opacity: 1; transform: rotate(0deg); } 25% { opacity: 0.8; transform: rotate(5deg) scale(0.95); } 50% { opacity: 1; transform: rotate(0deg) scale(1.1); } 75% { opacity: 0.9; transform: rotate(-5deg) scale(0.98); } }
.ai-message-avatar { animation: ai-avatar-glow 4s ease-in-out infinite; }
@keyframes ai-avatar-glow { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 8px rgba(99, 102, 241, 0.3); } }
.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: 100px minmax(0, 1fr) 150px 180px 50px 100px; 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; }
.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); }
.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; }

/* 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; }
.btn-sm { padding: 5px 10px; font-size: var(--font-size-xs); }
.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); }
.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: 70px minmax(0, 1fr) 100px 130px 40px 80px; gap: var(--space-sm); }
}
@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); }
