/* Core Design System (Extended Token Layer) */
:root {
        /* Brand & Functional Colors */
        --primary-color: #0d6efd;
        --primary-color-rgb: 13,110,253;
        --success-color: #198754;
        --danger-color: #dc3545;
        --warning-color: #ffc107;
        --info-color: #0dcaf0;
        --neutral-0: #ffffff;
        --neutral-50: #f8f9fa;
        --neutral-100: #f1f3f5;
        --neutral-200: #e9ecef;
        --neutral-300: #dee2e6;
        --neutral-400: #ced4da;
        --neutral-500: #adb5bd;
        --neutral-600: #6c757d;
        --neutral-700: #495057;
        --neutral-800: #343a40;
        --neutral-900: #212529;

        /* Semantic Surface & Border */
        --surface-bg: var(--neutral-50);
        --surface-card: var(--neutral-0);
        --surface-elevated: var(--neutral-0);
        --surface-border: var(--neutral-200);
        --divider-color: var(--neutral-300);

        /* Elevation */
        --surface-elevation-1: 0 2px 8px rgba(0,0,0,0.06);
        --surface-elevation-2: 0 4px 16px rgba(0,0,0,0.08);
        --surface-elevation-3: 0 8px 24px rgba(0,0,0,0.12);

        /* Spacing Scale (4px base) */
        --space-0: 0;
        --space-1: 0.25rem; /* 4px */
        --space-2: 0.5rem;  /* 8px */
        --space-3: 0.75rem; /* 12px */
        --space-4: 1rem;    /* 16px */
        --space-5: 1.25rem; /* 20px */
        --space-6: 1.5rem;  /* 24px */
        --space-7: 2rem;    /* 32px */
        --space-8: 2.5rem;  /* 40px */
        --space-9: 3rem;    /* 48px */

        /* Typography (Fluid) */
        --font-size-xs: clamp(0.65rem, 0.7rem + 0.1vw, 0.75rem);
        --font-size-sm: clamp(0.75rem, 0.78rem + 0.15vw, 0.875rem);
        --font-size-base: clamp(0.875rem, 0.85rem + 0.3vw, 1rem);
        --font-size-md: clamp(1rem, 0.95rem + 0.5vw, 1.125rem);
        --font-size-lg: clamp(1.125rem, 1rem + 0.8vw, 1.375rem);
        --font-size-xl: clamp(1.25rem, 1.1rem + 1vw, 1.75rem);
        --font-size-xxl: clamp(1.5rem, 1.3rem + 1.5vw, 2.25rem);
        --line-height-tight: 1.15;
        --line-height-base: 1.4;
        --line-height-relaxed: 1.6;

        /* Radii */
        --radius-xs: 0.25rem;
        --radius-sm: 0.5rem;
        --radius-md: 0.75rem;
        --radius-lg: 1rem;
        --radius-pill: 50rem;
        --border-radius: var(--radius-md); /* legacy mapping */

        /* Z-Index Scale */
        --z-base: 1;
        --z-dropdown: 1000;
        --z-sticky: 1020;
        --z-fixed: 1030;
        --z-modal-backdrop: 1040;
        --z-modal: 1050;
        --z-popover: 1060;
        --z-tooltip: 1070;
        --z-toast: 1080;

        /* Layout & Breakpoints (aliases for reference; media queries remain manual) */
        --bp-xs: 0;
        --bp-sm: 576px;
        --bp-md: 768px;
        --bp-lg: 992px;
        --bp-xl: 1200px;
        --bp-xxl: 1400px;
        --container-max: 1200px;

        /* Motion / Transitions */
        --transition-fast: all 120ms cubic-bezier(0.4, 0, 0.2, 1);
        --transition-smooth: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
        --transition-slow: all 350ms cubic-bezier(0.4, 0, 0.2, 1);

        /* Component Specific Tokens */
        --fab-size: 3.75rem; /* 60px */
        --fab-size-sm: 3.125rem; /* 50px */
        --fab-icon-size: 1.25rem;
        --navbar-height: 3.5rem;
        --tap-target-min: 44px;

        /* Shadows (Alias) */
        --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
        --shadow-md: var(--surface-elevation-1);
        --shadow-lg: var(--surface-elevation-2);
        --shadow-xl: var(--surface-elevation-3);
}
/* --- Timeline (order events) --- */
.timeline { position: relative; padding-left: 1rem; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--divider-color,#e0e4ea); }
.timeline-item { position: relative; padding: .5rem 0 .5rem 1rem; }
.timeline-item::before { content: ""; position: absolute; left: 2px; top: .9rem; width: 12px; height: 12px; background: var(--primary-color,#0d6efd); border-radius: 50%; box-shadow: 0 0 0 3px #fff; }
.timeline-time { font-size: .8rem; color: var(--neutral-600,#6c757d); margin-bottom: .15rem; }
.timeline-body { background: var(--surface-card,#fff); border: 1px solid var(--divider-color,#e0e4ea); border-radius: .5rem; padding: .5rem .75rem; }

/* Icon picker scroll container (Departments) */
.icon-picker-scroll { height: 150px; overflow-y: auto; }

/* Orders: Stage strip */
.stage-strip { display: flex; gap: 16px; overflow-x: auto; padding: 8px 4px; background: var(--neutral-50); border: 1px solid var(--divider-color); border-radius: var(--radius-md); }
.stage-col { min-width: 88px; display: flex; flex-direction: column; align-items: center; }
.stage-name { font-size: .85rem; color: var(--neutral-700); text-align: center; margin-bottom: 6px; white-space: nowrap; }
.stage-check { position: absolute; left: -9999px; }
.stage-box { width: 44px; height: 44px; border: 2px solid var(--neutral-300); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--neutral-600); background: transparent; transition: var(--transition-smooth); }
.stage-box:hover { border-color: var(--neutral-500); }
.stage-box.is-completed { background: var(--success-color); border-color: var(--success-color); color: #fff; }
.stage-box.is-problem { background: var(--danger-color); border-color: var(--danger-color); color: #fff; }
.stage-box.is-locked { cursor: not-allowed; opacity: .5; }
.stage-time { font-size: .8rem; color: var(--neutral-600); text-align: center; margin-top: 6px; min-height: 1.1em; white-space: nowrap; }

/* --- Salary Report Refinements --- */
.salary-report-card .card-header { background: linear-gradient(90deg,var(--neutral-50),var(--neutral-0)); border-bottom: 1px solid var(--surface-border); }
[data-theme="dark"] .salary-report-card .card-header { background: linear-gradient(90deg,#1b1f23,#16191c); }
.salary-report-card h6 { font-size: var(--font-size-md); letter-spacing:.2px; }
.salary-toolbar .btn, .period-switch .btn { line-height:1.1; }
.salary-toolbar .export-group .btn { min-width:42px; }
.salary-toolbar .dropdown-menu { min-width: 220px; }
.salary-toolbar .dropdown-item { font-size: var(--font-size-sm); }
.payroll-spark { max-width:240px; }
/* Settings page */
.settings-sticky-nav { top:5.5rem; }
.audit-search-wrap { max-width:260px; }
.audit-table-scroll { max-height:320px; overflow:auto; }
/* Departments metro enhancements */
.dept-grid { --dept-min: 220px; display:grid; grid-template-columns:repeat(auto-fill,minmax(var(--dept-min),1fr)); gap:var(--space-4); align-content:start; }
.department-card { position:relative; border:1px solid var(--surface-border); box-shadow: var(--surface-elevation-1); transition: var(--transition-smooth); }
.department-card:hover { transform: translateY(-2px); box-shadow: var(--surface-elevation-2); }
.department-card .dept-name { font-weight:600; font-size: var(--font-size-sm); letter-spacing:.25px; }
.department-card::before { content:""; position:absolute; inset:0; border-left:4px solid var(--dept-color,#0d6efd); border-radius: var(--radius-md); pointer-events:none; }
.drag-handle { cursor:grab; }
.drag-handle:active { cursor:grabbing; }
@keyframes bounceIn { 0%{transform:scale(.9);opacity:0;} 60%{transform:scale(1.02);opacity:1;} 100%{transform:scale(1);} }
.bounce-in { animation:bounceIn .5s cubic-bezier(.34,1.56,.64,1) both; }
@media (max-width: 1199.98px){
    .salary-report-card .card-header { padding: var(--space-3) var(--space-4); }
    .salary-toolbar { width:100%; justify-content:flex-start; }
}
@media (max-width: 575.98px){
    .salary-toolbar { gap: .5rem; }
    .salary-toolbar .btn, .salary-toolbar .export-group .btn { flex:1 1 auto; }
    .period-switch { width:100%; }
    .period-switch .btn { flex:1 1 0; }
}

/* Dark Theme (prefers-color-scheme) */
@media (prefers-color-scheme: dark) {
    :root {
        --surface-bg: #0f1113;
        --surface-card: #1c1f22;
        --surface-elevated: #22262a;
        --surface-border: #2c3136;
        --divider-color: #343a40;
        --neutral-50: #141619;
        --neutral-100: #1f2326;
        --neutral-200: #252a2e;
        --neutral-300: #30363b;
        --neutral-400: #3a4248;
        --neutral-500: #4d565d;
        --neutral-600: #6c757d;
        --neutral-700: #b0bac3;
        --neutral-800: #ced4da;
        --neutral-900: #e9ecef;
        --primary-color: #3d8bfd; /* slight shift for dark contrast */
        --danger-color: #ff505f;
        --warning-color: #ffcc4d;
        --success-color: #33c27d;
        --info-color: #4ad8f7;
        --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
        --surface-elevation-1: 0 2px 8px rgba(0,0,0,0.5);
        --surface-elevation-2: 0 4px 16px rgba(0,0,0,0.55);
        --surface-elevation-3: 0 8px 28px rgba(0,0,0,0.6);
        --gradient-primary: linear-gradient(135deg,#2c76f4,#114a96);
        --gradient-accent: linear-gradient(135deg,#5f3dc4,#862e9c);
    }
}

/* Explicit theme override via data-theme attribute (takes precedence over media query) */
:root[data-theme="dark"] {
    --surface-bg: #0f1113;
    --surface-card: #1c1f22;
    --surface-elevated: #22262a;
    --surface-border: #2c3136;
    --divider-color: #343a40;
    --neutral-50: #141619;
    --neutral-100: #1f2326;
    --neutral-200: #252a2e;
    --neutral-300: #30363b;
    --neutral-400: #3a4248;
    --neutral-500: #4d565d;
    --neutral-600: #7f8a93;
    --neutral-700: #bfc7cf;
    --neutral-800: #dee2e6;
    --neutral-900: #f1f3f5;
    --primary-color: #3d8bfd;
    --danger-color: #ff505f;
    --warning-color: #ffcc4d;
    --success-color: #33c27d;
    --info-color: #4ad8f7;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --surface-elevation-1: 0 2px 8px rgba(0,0,0,0.5);
    --surface-elevation-2: 0 4px 16px rgba(0,0,0,0.55);
    --surface-elevation-3: 0 8px 28px rgba(0,0,0,0.6);
    --gradient-primary: linear-gradient(135deg,#2c76f4,#114a96);
    --gradient-accent: linear-gradient(135deg,#5f3dc4,#862e9c);
}

/* Explicit Light Theme Override
   Если пользователь выбрал светлую тему вручную (data-theme="light"),
   нужно гарантировать, что значения не наследуют переопределения из
   media query (prefers-color-scheme: dark). */
:root[data-theme="light"] {
    --surface-bg: var(--neutral-50);
    --surface-card: var(--neutral-0);
    --surface-elevated: var(--neutral-0);
    --surface-border: var(--neutral-200);
    --divider-color: var(--neutral-300);
    --neutral-50: #f8f9fa;
    --neutral-100: #f1f3f5;
    --neutral-200: #e9ecef;
    --neutral-300: #dee2e6;
    --neutral-400: #ced4da;
    --neutral-500: #adb5bd;
    --neutral-600: #6c757d;
    --neutral-700: #495057;
    --neutral-800: #343a40;
    --neutral-900: #212529;
    --primary-color: #0d6efd;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --surface-elevation-1: 0 2px 8px rgba(0,0,0,0.06);
    --surface-elevation-2: 0 4px 16px rgba(0,0,0,0.08);
    --surface-elevation-3: 0 8px 24px rgba(0,0,0,0.12);
    --gradient-primary: linear-gradient(135deg,#667eea,#764ba2);
    --gradient-accent: linear-gradient(135deg,#764ba2,#a855f7);
}



body { 
        background-color: var(--surface-bg); 
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        overflow-x: hidden;
        font-size: var(--font-size-base);
        line-height: var(--line-height-base);
        color: var(--neutral-800);
        -webkit-font-smoothing: antialiased;
}
.theme-soft-fade { animation: fadeIn .4s ease both; }
@keyframes fadeIn { from { opacity:0; transform: translateY(4px);} to { opacity:1; transform:translateY(0);} }

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; scroll-behavior:auto !important; }
    #cloudSyncInfoStatus .badge, .connection-indicator .status-dot { animation:none !important; }
}

/* Dark mode refinements */
@media (prefers-color-scheme: dark){
    .card { background: #1b1f23; }
    .navbar.bg-primary, .navbar.navbar-dark.bg-primary { background: linear-gradient(135deg,#1d4f91,#0f2f56); }
    .btn-primary, .btn-gradient-primary { background: var(--gradient-primary); }
    .btn-success { background: linear-gradient(135deg,#1b7d4a,#0f5a34); }
    .btn-danger { background: linear-gradient(135deg,#9f1d2a,#5c0d15); }
    /* Dark auto theme form controls (system dark) */
    .form-control, .form-select { background:#242a30; border-color:#3a4148; color: var(--neutral-900); }
    .form-control:focus, .form-select:focus { background:#262c33; box-shadow:0 0 0 2px rgba(61,139,253,.35); border-color:#3d8bfd; }
    .input-group-text { background:#262c31; border-color:#30363b; color: var(--neutral-400); }
    .badge.bg-secondary { background:#3a4148 !important; color:#e9ecef !important; }
    .text-muted, .small.text-muted { color: #b8c0c7 !important; }
}

/* Dark theme overrides when forced via data-theme */
[data-theme="dark"] .card { background: #1b1f23; }
[data-theme="dark"] .navbar.bg-primary, [data-theme="dark"] .navbar.navbar-dark.bg-primary { background: linear-gradient(135deg,#1d4f91,#0f2f56); }
[data-theme="dark"] .btn-primary, [data-theme="dark"] .btn-gradient-primary { background: var(--gradient-primary); }
[data-theme="dark"] .btn-success { background: linear-gradient(135deg,#1b7d4a,#0f5a34); }
[data-theme="dark"] .btn-danger { background: linear-gradient(135deg,#9f1d2a,#5c0d15); }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select { background:#242a30; border-color:#3a4148; color: var(--neutral-900); }
[data-theme="dark"] .form-control:focus, [data-theme="dark"] .form-select:focus { background:#262c33; box-shadow:0 0 0 2px rgba(61,139,253,.35); border-color:#3d8bfd; }
[data-theme="dark"] .input-group-text { background:#262c31; border-color:#30363b; color: var(--neutral-400); }
[data-theme="dark"] .badge.bg-secondary { background:#3a4148 !important; color:#e9ecef !important; }
[data-theme="dark"] .badge.bg-light { background:#d1d5db !important; color:#111 !important; }
[data-theme="dark"] .badge.bg-warning { color:#111 !important; }
[data-theme="dark"] .badge.bg-success { color:#fff !important; }
[data-theme="dark"] .badge.bg-info { color:#001219 !important; }
[data-theme="dark"] .badge.bg-danger { color:#fff !important; }
[data-theme="dark"] .text-muted, [data-theme="dark"] .small.text-muted { color: #b8c0c7 !important; }
[data-theme="dark"] .table-stackable tbody tr { background: #1e2226; }

/* Utility: Floating Face Log Button */
.floating-face-log-btn {
    position: fixed;
    bottom: var(--space-4);
    left: var(--space-4);
    z-index: var(--z-fixed);
    box-shadow: var(--surface-elevation-2);
    border-radius: var(--radius-pill);
}

.floating-face-log-btn:hover {
    transform: translateY(-2px);
}

/* Utility: Notification container (replaces inline styles) */
#notificationContainer {
    position: fixed;
    top: var(--space-5);
    right: var(--space-5);
    z-index: var(--z-toast);
    width: min(92vw, 360px);
}

/* Form & Touch Target Enhancements */
.form-section + .form-section { margin-top: var(--space-7); }
.form-label { font-weight: 600; font-size: var(--font-size-sm); letter-spacing: .3px; }
input.form-control, select.form-select, textarea.form-control { padding: .65rem .9rem; font-size: var(--font-size-base); border-radius: var(--radius-sm); }
input.form-control:focus, select.form-select:focus, textarea.form-control:focus { box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), .15); border-color: var(--primary-color); }
.form-control::placeholder { color: var(--neutral-500); opacity:.9; transition: color .2s ease; }
/* Light theme explicit to avoid inheriting dark values */
:root[data-theme="light"] .form-control, :root[data-theme="light"] .form-select, :root[data-theme="light"] textarea.form-control {
    background: var(--neutral-0);
    color: var(--neutral-800);
    border-color: var(--neutral-300);
}
:root[data-theme="light"] .form-control:focus, :root[data-theme="light"] .form-select:focus, :root[data-theme="light"] textarea.form-control:focus { background: var(--neutral-0); }
:root[data-theme="light"] .form-control::placeholder { color: var(--neutral-500); }

/* Dark theme placeholder higher contrast (AA ~>4.5) */
[data-theme="dark"] .form-control::placeholder { color: var(--neutral-700); opacity:.95; }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select, [data-theme="dark"] textarea.form-control { caret-color: var(--neutral-900); }

/* Disabled and readonly states */
.form-control:disabled, .form-select:disabled, textarea.form-control:disabled,
.form-control[readonly], textarea.form-control[readonly] {
    background: var(--neutral-200);
    color: var(--neutral-600);
    opacity: 1;
    cursor: not-allowed;
}
[data-theme="dark"] .form-control:disabled, [data-theme="dark"] .form-select:disabled, [data-theme="dark"] textarea.form-control:disabled,
[data-theme="dark"] .form-control[readonly], [data-theme="dark"] textarea.form-control[readonly] {
    background:#262c31;
    border-color:#343a40;
    color:#7f8a93; /* stays readable ~5:1 */
}

/* Invalid state accessibility */
.form-control.is-invalid, .form-select.is-invalid, .is-invalid.form-control, .is-invalid.form-select {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger-color) 40%, transparent);
}
[data-theme="dark"] .form-control.is-invalid, [data-theme="dark"] .form-select.is-invalid, [data-theme="dark"] .is-invalid.form-control, [data-theme="dark"] .is-invalid.form-select {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger-color) 55%, transparent);
}
.form-control.is-invalid:focus, .form-select.is-invalid:focus { outline: none; }

/* Modal input sync */
.modal .form-control, .modal .form-select, .modal textarea.form-control { background: var(--surface-card); color: inherit; }
[data-theme="dark"] .modal .form-control, [data-theme="dark"] .modal .form-select, [data-theme="dark"] .modal textarea.form-control { background:#20252a; }
.help-text { font-size: var(--font-size-xs); color: var(--neutral-600); margin-top: .25rem; }
.tap-target { min-height: var(--tap-target-min); display:inline-flex; align-items:center; justify-content:center; }
button.btn, .btn-group .btn { min-height: 40px; display:inline-flex; align-items:center; }
@media (max-width:575.98px){ button.btn, .btn-group .btn { width:100%; } .stack-sm-full > * { width:100%; } }
.input-group-text { background: var(--neutral-100); font-size: var(--font-size-sm); }
.form-divider { height:1px; background: linear-gradient(90deg, transparent, var(--divider-color), transparent); margin: var(--space-6) 0; }
.radio-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: var(--space-2); }
.radio-grid .form-check { background: var(--surface-card); border:1px solid var(--surface-border); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); cursor:pointer; transition: var(--transition-fast); }
.radio-grid .form-check:hover { box-shadow: var(--surface-elevation-1); }
.radio-grid .form-check-input { cursor:pointer; }
.field-inline-hint { font-size: var(--font-size-xs); color: var(--neutral-600); margin-left:auto; }
.required-asterisk::after { content:'*'; margin-left:2px; color: var(--danger-color); }
.btn-pill { border-radius: var(--radius-pill); }
.btn-gradient-primary { background: linear-gradient(135deg, var(--primary-color), #0056b3); color:#fff; border:none; }
.btn-gradient-primary:hover { filter:brightness(1.05); }
.input-compact .form-control, .input-compact .form-select { padding:.5rem .75rem; font-size: var(--font-size-sm); }
.form-grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width:767.98px){ .form-grid-2 { grid-template-columns: 1fr; } }

@media (prefers-color-scheme: dark) {
    body { color: var(--neutral-300); }
}

/* Transfer Progress Indicator */
.transfer-progress-container {
    position: fixed;
    top: calc(var(--navbar-height) + var(--space-4));
    right: var(--space-5);
    z-index: var(--z-modal-backdrop);
    width: 320px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.transfer-progress-container .card {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
[data-theme="dark"] .transfer-progress-container .card { background: rgba(30, 34, 38, 0.92); }
[data-theme="dark"] .transfer-status { color: #dee2e6; }
[data-theme="dark"] .transfer-speed { color: #b8c0c7; }

.transfer-progress-container .progress {
    background-color: rgba(0,0,0,0.1);
}

.transfer-progress-container .progress-bar {
    transition: width 0.3s ease;
    background: linear-gradient(45deg, #007bff, #0056b3);
    font-size: 0.7rem;
    font-weight: 600;
}

.transfer-status {
    color: #495057;
    font-weight: 500;
}

.transfer-speed {
    color: #6c757d;
    font-family: 'Courier New', monospace;
}

/* Cloud Sync Status Indicators */
#cloudSyncStatus {
    transition: all 0.3s ease;
    cursor: pointer;
}

#cloudSyncStatus:hover {
    transform: scale(1.05) !important;
}

.action-btn {
    transition: all 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
}

#cloudSyncInfoStatus .badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.02);
    }
}

/* Connection Status Animation */
.connecting {
    animation: connecting-pulse 1.5s infinite;
}

@keyframes connecting-pulse {
    0%, 100% { 
        background-color: #6c757d; 
        transform: scale(1);
    }
    50% { 
        background-color: #007bff; 
        transform: scale(1.05);
    }
}

/* Enhanced Card System */
.card {
    border-radius: var(--border-radius);
    box-shadow: var(--surface-elevation-1);
    border: 1px solid var(--surface-border);
    background: var(--surface-card);
    transition: var(--transition-smooth);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--surface-elevation-2);
}

/* Soft badge variants for improved contrast */
.badge-soft { border: 1px solid var(--surface-border); }
.badge-soft.bg-light { background: #eef2f7; color:#0b1320; }
[data-theme="dark"] .badge-soft.bg-light { background:#2a3137; color:#e9ecef; border-color:#3a4148; }

/* Connection Status Indicators */
.connection-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--surface-elevation-2);
    transition: var(--transition-smooth);
}

.connection-indicator.online {
    background: rgba(25, 135, 84, 0.9);
    color: white;
}

.connection-indicator.offline {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.connection-indicator.connecting {
    background: rgba(255, 193, 7, 0.9);
    color: black;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.5; 
        transform: scale(1.02);
    }
    100% { 
        opacity: 1; 
        transform: scale(1);
    }
}

/* Department Management */
.department-block {
    border: 2px dashed #ced4da;
    min-height: 280px;
    padding: 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition-smooth);
    position: relative;
}

.department-block.drag-over {
    background-color: #e9f5ff;
    border-color: var(--primary-color);
    border-style: solid;
    transform: scale(1.02);
}

/* Employee Cards Enhanced */
.employee-card {
    cursor: move;
    margin-bottom: 0.75rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
    background-color: #fff;
    border-radius: var(--border-radius);
    transition: var(--transition-smooth);
    -webkit-user-select: none; /* Safari */
    user-select: none;
    position: relative;
}

.employee-card:hover {
    box-shadow: var(--surface-elevation-2);
    transform: translateY(-2px);
}

.employee-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg) scale(0.95);
}

/* Rank-based card styles */
.employee-card.rank-1 {
    border-left: 4px solid #6c757d;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.employee-card.rank-2 {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #ffffff 100%);
}

.employee-card.rank-3 {
    border-left: 4px solid #007bff;
    background: linear-gradient(135deg, #cce7ff 0%, #ffffff 100%);
}

.employee-card.rank-4 {
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.employee-card.rank-5 {
    border-left: 4px solid #fd7e14;
    background: linear-gradient(135deg, #ffe8d1 0%, #ffffff 100%);
    box-shadow: 0 3px 12px rgba(253, 126, 20, 0.4);
}

.employee-card.rank-6 {
    border-left: 4px solid #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #ffffff 100%);
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.5);
    border: 2px solid #dc3545;
}

/* Brigade leader special styling */
.employee-card.brigade-leader {
    background: linear-gradient(135deg, #6610f2 0%, #6f42c1 100%);
    color: white;
    border: 2px solid #6610f2;
    box-shadow: 0 4px 20px rgba(102, 16, 242, 0.6);
    position: relative;
}

.employee-card.brigade-leader::before {
    content: "⭐";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ffc107;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid white;
}

.employee-card.brigade-leader .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Rank badges */
.rank-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
}

.rank-badge.rank-1 { background: #6c757d; }
.rank-badge.rank-2 { background: #28a745; }
.rank-badge.rank-3 { background: #007bff; }
.rank-badge.rank-4 { background: #ffc107; color: #000; }
.rank-badge.rank-5 { background: #fd7e14; }
.rank-badge.rank-6 { background: #dc3545; }

/* Enhanced Notification System */
.notification-container {
    position: fixed;
    top: calc(var(--navbar-height) + var(--space-6));
    right: var(--space-5);
    z-index: var(--z-toast);
    max-width: 350px;
}

.notification {
    margin-bottom: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--surface-elevation-2);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    transform: translateX(100%);
    opacity: 0;
    transition: var(--transition-smooth);
    font-size: var(--font-size-sm);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    background-color: var(--success-color);
    color: white;
}

.notification.error {
    background-color: var(--danger-color);
    color: white;
}

.notification.warning {
    background-color: var(--warning-color);
    color: black;
}
[data-theme="dark"] .notification.warning { color: #111; }

.notification.info {
    background-color: var(--info-color);
    color: white;
}

/* Action Buttons */
.action-buttons {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    z-index: var(--z-fixed);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.action-btn {
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: 50%;
    border: none;
    box-shadow: var(--surface-elevation-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fab-icon-size);
    transition: var(--transition-smooth);
    background: var(--primary-color);
    color: #fff;
}

.action-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--surface-elevation-3);
}

/* Dragging state for movable action toolbar */
.action-buttons.dragging { opacity: 0.92; cursor: move; z-index: calc(var(--z-fixed) + 10); }

/* Header mode: when toolbar is inside navbar */
.app-navbar .action-buttons.in-header {
    position: static;
    bottom: auto; right: auto; left: auto; top: auto;
    flex-direction: row; gap: .5rem; margin-left: auto; /* прижать к правому краю */
}
.app-navbar .action-buttons.in-header .action-btn {
    width: 40px; height: 40px; border-radius: 8px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.25);
}
.app-navbar .action-buttons.in-header .action-btn:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
/* Тёмная/светлая тема: адаптация иконок и фона */
:root[data-theme="light"] .app-navbar .action-buttons.in-header .action-btn { color: #f8f9fa; border-color: rgba(255,255,255,.35); }
:root[data-theme="dark"] .app-navbar .action-buttons.in-header .action-btn { color: #e9ecef; border-color: rgba(255,255,255,.25); }
@media (max-width: 575.98px){ .app-navbar .action-buttons.in-header { display:none; } }

/* Icon Picker Grid */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.icon-option {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 1.5rem;
}

.icon-option:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
}

.icon-option.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Color Picker */
.color-picker {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition-smooth);
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #000;
    transform: scale(1.2);
}

/* Validation Styles */
.is-invalid {
    border-color: var(--danger-color) !important;
}

.invalid-feedback {
    display: block;
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Analytics Cards */
.analytics-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.analytics-card .card-body {
    padding: 2rem;
}

/* Stat Cards */
.stat-card {
    background-color: #e9f5ff;
    border-left: 5px solid var(--primary-color);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateX(5px);
    box-shadow: var(--surface-elevation-1);
}
        
.stat-card h3 {
    font-size: 2rem;
    font-weight: 600;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* Utility widths for inputs/columns used in settings modals */
.mw-160 { max-width: 160px; }
.col-w-160 { width: 160px; }
.coeff-input { width: 90px; margin: 0 auto; }
.w-140 { width: 140px !important; }

/* Responsive Design */
@media (max-width: 768px) {
    .department-block { min-height: 200px; }
    .action-buttons { flex-direction: row; bottom: var(--space-3); right: var(--space-3); }
    .action-btn { width: var(--fab-size-sm); height: var(--fab-size-sm); font-size: 1rem; }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Синхронизация и подключение */
.sync-indicator {
    position: fixed;
    bottom: var(--space-5);
    left: var(--space-5);
    padding: var(--space-2) var(--space-4);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    display: none;
    z-index: var(--z-fixed);
    transition: var(--transition-smooth);
}

.sync-indicator.show {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

.sync-indicator.syncing {
    background: rgba(255, 193, 7, 0.9);
    color: black;
}

.sync-indicator.synced {
    background: rgba(25, 135, 84, 0.9);
    color: white;
}

.sync-indicator.error {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

/* Защищенные настройки */
.modal-header.bg-warning {
    background-color: #ffc107 !important;
}

#coefficientBtn:before,
#typeSettingsBtn:before {
    content: "🔒 ";
}

/* Стили для печати */
@media print {
    body { 
        background: white !important; 
        font-size: 12px !important;
        line-height: 1.3 !important;
    }
    .action-btn, .btn, .nav-tabs, .modal, .notification, .sync-indicator, .connection-indicator, .dropdown, .dropdown-menu {
        display: none !important;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        margin-bottom: 10px !important;
        break-inside: avoid;
    }
    /* Hide print buttons that appear in bottom right */
    .position-fixed, .fixed-bottom, .fixed-top {
        display: none !important;
    }
    .no-print { display: none !important; }
    .print-only { display: block !important; }
    .page-break { page-break-after: always; }
}

/* Default visibility for print sections */
.print-only { display: none; }

/* Добавляем поддержку drag & drop участков */
.department-container {
    min-height: 120px;
    border: 2px dashed var(--divider-color);
    border-radius: var(--border-radius);
    padding: var(--space-4);
    transition: var(--transition-smooth);
}

.department-container.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

/* Sortable.js drag states */
.sortable-ghost {
    opacity: 0.4;
    background: #f8f9fa;
    border: 2px dashed var(--primary-color);
}

.sortable-chosen {
    transform: scale(1.02);
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.sortable-drag {
    transform: rotate(5deg);
    opacity: 0.8;
}

.sortable-fallback {
    opacity: 0.8;
    transform: scale(0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Bulk select mode - disable drag when in bulk mode */
.bulk-select-mode .employee-card {
    cursor: default;
    pointer-events: all;
}

.bulk-select-mode .department-container {
    border-style: solid;
    border-color: #dee2e6;
}

.department-card {
    cursor: move;
    transition: var(--transition-smooth);
}

.department-card:hover { transform: translateY(-2px); box-shadow: var(--surface-elevation-2); }

.department-card.dragging {
    opacity: 0.7;
    transform: rotate(1deg) scale(0.98);
}

/* Employee count badge */
.employee-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Utility class for form button alignment */
.mt-btn {
    margin-top: 2rem;
}

/* Browser Compatibility Fixes */

/* User select with prefixes */
.noselect {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Width stretch fallbacks */
.stretch-width {
    width: -webkit-fill-available; /* Safari */
    width: -moz-available; /* Firefox */
    width: 100%; /* fallback */
}

/* Text decoration skip with webkit prefix */
a { text-decoration-skip-ink: auto; /* Standard */ }

/* Scrollbar styling with webkit and fallback */
/* Custom scrollbar visuals for WebKit browsers below */

/* Webkit browsers (Chrome, Safari, newer Edge) */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Progressive enhancement for scrollbar-gutter */
@supports (scrollbar-gutter: stable) {
  .table-responsive {
    scrollbar-gutter: stable;
  }
}

/* Text wrap with fallback */
.text-wrap-balance {
  /* Fallback for older browsers */
  word-wrap: break-word;
  overflow-wrap: break-word;
}
@supports (text-wrap: balance) {
    .text-wrap-balance { text-wrap: balance; }
}

/* Backdrop filter with webkit prefix */
.backdrop-blur {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* Fix for Safari touch scrolling */
.touch-scroll { overflow-x: auto; }

/* Utilities */
.scroll-150 { height: 150px; overflow-y: auto; }

/* Navigation & Drawer Utilities */
.app-navbar { min-height: var(--navbar-height); }
/* Defensive: гарантируем кликабельность пунктов навигации поверх драг/оverlay элементов */
.app-navbar, .navbar.app-navbar { position: relative; z-index: 5000; }
.app-navbar .navbar-collapse { z-index: 5001; }
.app-navbar .nav-link { position: relative; pointer-events: auto; }
.app-navbar .nav-link.disabled { pointer-events: none; }

/* Предохраняем навигацию от перекрытия плавающими кнопками */
.action-buttons { z-index: 1200; }
body.strict-ui .action-buttons { z-index: 1200; }
/* Если вдруг viewport маленький и панель уезжает вверх — смещение чуть ниже */
@media (max-height:620px){
    .action-buttons { bottom: var(--space-3); }
}

/* Bulk actions bar (employees) */
#bulkActionsBar.bulk-actions-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface-card, #fff);
    border-top: 1px solid var(--surface-border, #dee2e6);
    padding: var(--space-3) var(--space-4);
    box-shadow: 0 -4px 10px -4px rgba(0,0,0,0.08);
    transform: translateY(100%);
    transition: transform .28s ease;
    z-index: 900; /* Ниже navbar (5000) и ниже action-buttons (1200) */
    pointer-events: none;
}
#bulkActionsBar.bulk-actions-bar.show { transform: translateY(0); pointer-events: auto; }
body[data-theme="dark"] #bulkActionsBar.bulk-actions-bar { background:#1c2024; }
.app-navbar .nav-link { position: relative; pointer-events: auto !important; }
.app-navbar .nav-link.disabled { pointer-events: none; }
.icon-lg { font-size: 1.35rem; line-height: 1; }
.status-dot.dot-neutral { background: var(--neutral-500); }

/* Stackable Table (Mobile < 576px) */
/* Metro Dashboard */
.metro-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: var(--space-4); }
.metro-card { display:flex; flex-direction:column; min-height: 160px; padding: var(--space-4); color:#fff; text-decoration:none; border-radius: var(--border-radius); position:relative; overflow:hidden; box-shadow: var(--surface-elevation-1); transition: transform .15s ease, box-shadow .15s ease; }
.metro-card:hover { transform: translateY(-3px); box-shadow: var(--surface-elevation-3); }
.metro-card .metro-card-header { display:flex; align-items:center; gap:.5rem; font-weight:600; font-size: 1rem; }
.metro-card .metro-card-header i { font-size: 1.25rem; }
.metro-card .metro-card-body { margin-top: .75rem; display:flex; gap:1rem; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; }
.metro-card .metric { display:flex; flex-direction:column; }
.metro-card .metric-value { font-size: 2rem; line-height:1; font-weight:700; }
.metro-card .metric-label { font-size:.85rem; opacity:.9; }
.metro-card .metric-row { display:flex; gap:1.5rem; }
.metro-card .metro-actions { position:absolute; right:.5rem; bottom:.5rem; display:flex; gap:.5rem; }
.metro-card .btn { --bs-btn-padding-y: .15rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .8rem; }

/* Accents */
.accent-blue { background: linear-gradient(135deg, #4f7cff, #3456d1); }
.accent-teal { background: linear-gradient(135deg, #25b7a5, #138f80); }
.accent-purple { background: linear-gradient(135deg, #8a5bd1, #6c3cb1); }
.accent-orange { background: linear-gradient(135deg, #ff8c3a, #d96a13); }
.accent-cyan { background: linear-gradient(135deg, #30b2e0, #1387b1); }
.accent-green { background: linear-gradient(135deg, #49b86e, #2f8e50); }

/* Dark theme compensation */
[data-theme="dark"] .metro-card { box-shadow: none; }

/* Tablet Check-in KPI strip */
.tablet-kpi-grid { grid-template-columns: repeat(3, minmax(160px,1fr)); gap: .75rem; margin-bottom: .75rem; }
.metro-card.compact { min-height: 0; padding: .75rem; }
.metric-value-sm { font-size: 1.4rem; }
.metric-value-xs { font-size: 1.1rem; }

/* Metro-like toolbar chips (salary header) */
.toolbar-metro { display:flex; align-items:center; gap:.5rem; flex-wrap: wrap; }
.toolbar-metro .toolbar-sep { width:1px; height:28px; background: var(--surface-border); margin: 0 .25rem; }
.chip-btn { display:inline-flex; align-items:center; gap:.5rem; padding:.4rem .6rem; border-radius: 6px; border:1px solid transparent; font-weight:600; line-height:1; }
.chip-btn .bi { font-size: 1rem; }
.chip-btn .chip-text { display:inline-block; }
.chip-ghost { background: var(--neutral-600); color:#fff; border-color: transparent; }
.chip-warn { background: var(--warning-color); color:#111; border-color: color-mix(in srgb, var(--warning-color) 60%, #0000); }
.chip-info { background: var(--info-color); color:#001219; border-color: color-mix(in srgb, var(--info-color) 60%, #0000); }
.chip-neutral { background: #6c757d; color:#fff; border-color: #6c757d; }
.chip-success { background: #198754; color:#fff; border-color: #198754; }
.chip-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
@media (max-width: 575.98px){ .chip-btn .chip-text { display:none; } }
.table-stackable thead { background: var(--neutral-100); }
@media (max-width: 575.98px) {
    .table-stackable table,
    .table-stackable thead,
    .table-stackable tbody,
    .table-stackable th,
    .table-stackable td,
    .table-stackable tr { display: block; width: 100%; }
    .table-stackable thead { display: none; }
    .table-stackable tbody tr { 
        margin-bottom: var(--space-4); 
        border: 1px solid var(--divider-color); 
        border-radius: var(--radius-sm);
        padding: var(--space-3) var(--space-3) var(--space-2);
        background: var(--surface-card);
        box-shadow: var(--shadow-sm);
    }
    .table-stackable tbody tr.unfinished-night { background-image: none; background: linear-gradient(135deg, #ffdd00 0%, #fff7cc 60%); }
    .table-stackable tbody td { 
        border: none !important; 
        position: relative; 
        padding: var(--space-2) 0 var(--space-2) var(--space-6); 
        font-size: var(--font-size-sm);
        display: flex; 
        align-items: flex-start;
        gap: var(--space-2);
    }
    .table-stackable tbody td:first-child { padding-left: 0; }
    .table-stackable tbody td::before { 
        content: attr(data-label);
        position: absolute; 
        left: 0; 
        top: var(--space-2);
        font-weight: 600; 
        font-size: var(--font-size-xs);
        text-transform: uppercase; 
        letter-spacing: 0.5px;
        color: var(--neutral-600);
        width: var(--space-12, 5.5rem);
    }
    .table-stackable .row-actions { display: flex; gap: var(--space-2); }
    .table-stackable .row-divider { height: 1px; background: var(--divider-color); margin: var(--space-2) 0; }
}

/* Column priority helpers (hide on narrow) */
@media (max-width: 575.98px) {
    .col-priority-low { display: none !important; }
}

/* ===================== STRICT UI MODE ===================== */
body.strict-ui {
    --radius-xs: 0;
    --radius-sm: 2px;
    --radius-md: 3px;
    --radius-lg: 4px;
    --border-radius: 3px;
    --surface-card: var(--neutral-0);
    --surface-elevated: var(--neutral-0);
    --surface-bg: var(--neutral-50);
    background: var(--surface-bg) !important;
    font-feature-settings: "tnum" 1, "lnum" 1;
}
body.strict-ui[data-theme="dark"], body.strict-ui[data-theme="dark"]:root, :root[data-theme="dark"] body.strict-ui {
    --surface-bg: #101214;
    --surface-card: #171a1d;
    --surface-elevated: #1c2024;
    background: var(--surface-bg) !important;
}

body.strict-ui .card,
body.strict-ui [data-theme="dark"] .card { 
    border-radius: var(--radius-sm); 
    box-shadow: none; 
    border:1px solid var(--surface-border); 
    background: var(--surface-card); 
}
body.strict-ui .card-header { background: none; border-bottom:1px solid var(--surface-border); font-weight:600; }
body.strict-ui .navbar { box-shadow:none; }
body.strict-ui .navbar.bg-primary { background: var(--neutral-900); }
body.strict-ui [data-theme="dark"] .navbar.bg-primary { background:#162437; }
body.strict-ui .btn { border-radius:2px; box-shadow:none !important; }
body.strict-ui .btn-primary, body.strict-ui .btn-gradient-primary { background: var(--primary-color); }
body.strict-ui .btn-gradient-primary:hover { filter:none; }
body.strict-ui .btn, body.strict-ui .form-control, body.strict-ui .form-select { border-width:1px; }
body.strict-ui .form-control, body.strict-ui .form-select { background: var(--neutral-0); }
body.strict-ui [data-theme="dark"] .form-control, body.strict-ui [data-theme="dark"] .form-select { background:#1c2024; border-color:#2c3136; }
body.strict-ui .action-btn { border-radius:4px; width:52px; height:52px; }
body.strict-ui .action-buttons { gap: .4rem; }
body.strict-ui .badge { border-radius:2px; }
body.strict-ui .notification { border-radius:4px; }
body.strict-ui .modal-content { border-radius:4px; box-shadow:none; }
body.strict-ui .modal-header { border-bottom:1px solid var(--surface-border); }
body.strict-ui .modal-footer { border-top:1px solid var(--surface-border); }
body.strict-ui .employee-card, body.strict-ui .department-card { border-radius:3px; box-shadow:none; }
body.strict-ui .employee-card:hover, body.strict-ui .department-card:hover { transform:none; box-shadow:none; }
body.strict-ui .analytics-card { background: var(--primary-color); }
body.strict-ui .stat-card { background: var(--neutral-100); }
body.strict-ui [data-theme="dark"] .stat-card { background:#1c2024; }
body.strict-ui .login-card { background: var(--surface-card) !important; -webkit-backdrop-filter:none !important; backdrop-filter:none !important; border:1px solid var(--surface-border); }
body.strict-ui .login-header { background: none !important; color: var(--neutral-800); }
body.strict-ui [data-theme="dark"] .login-header { color: var(--neutral-200); }
body.strict-ui .demo-users { background: var(--neutral-100); border:1px solid var(--neutral-200); }
body.strict-ui [data-theme="dark"] .demo-users { background:#1c2024; border-color:#2c3136; }
body.strict-ui .theme-toggle-login button { background: var(--neutral-100); box-shadow:none; }
body.strict-ui [data-theme="dark"] .theme-toggle-login button { background:#1c2024; }
body.strict-ui .form-floating > label { font-weight:500; }
body.strict-ui .btn-pill { border-radius:2px; }
body.strict-ui .btn-login { background: var(--primary-color); }
body.strict-ui .btn-login:hover { filter:brightness(1.05); }
body.strict-ui .table-stackable tbody tr { box-shadow:none; }
body.strict-ui .badge-soft { border-radius:2px; }
body.strict-ui .transfer-progress-container .card { background: var(--surface-card); box-shadow:none; }
body.strict-ui [data-theme="dark"] .transfer-progress-container .card { background:#1c2024; }
body.strict-ui .auto-save-indicator { box-shadow:none; }
body.strict-ui .notification { box-shadow:none; }
body.strict-ui .action-btn:hover { transform:none; }
body.strict-ui .rank-4, body.strict-ui .rank-5, body.strict-ui .rank-6, body.strict-ui .brigade-leader { background:none; box-shadow:none; }
body.strict-ui .brigade-leader { color:inherit; border:1px solid var(--surface-border); }
body.strict-ui .brigade-leader::before { display:none; }

/* ========================================================== */
