@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   PASS CONTROL — Корпоративные стили (Premium Edition)
   ============================================================ */

.input-no-transform {
    text-transform: none !important;
}

:root {
    --pc-primary: #4f46e5;          /* Modern Indigo */
    --pc-primary-light: #6366f1;    /* Vibrant Indigo */
    --pc-primary-dark: #3730a3;     /* Deep Indigo */
    --pc-accent: #10b981;           /* Emerald Mint */
    --pc-accent-hover: #059669;
    --pc-danger: #f43f5e;           /* Rose */
    --pc-warning: #f59e0b;          /* Amber */
    --pc-info: #06b6d4;             /* Cyan */
    --pc-bg: #e2e8f0;               /* Slate 200 - darker page background for higher container contrast */
    --pc-card-bg: #ffffff;
    --pc-text: #0f172a;             /* Slate 900 */
    --pc-text-muted: #334155;       /* Slate 700 - darker text for proper WCAG AA contrast (5:1) */
    --pc-border: #94a3b8;           /* Slate 400 - much more defined borders and lines */
    --pc-shadow: 0 2px 4px 0 rgba(15, 23, 42, 0.06), 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --pc-shadow-md: 0 4px 12px -1px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --pc-shadow-lg: 0 12px 24px -3px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
    --pc-radius: 12px;              /* Soft rounded borders */
    --pc-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base */
body {
    background: var(--pc-bg);
    color: var(--pc-text);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 15%, rgba(79, 70, 229, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.05) 0%, transparent 45%);
    pointer-events: none;
    z-index: -1;
}

/* Navbar */
.bg-primary-corporate {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.nav-link {
    font-weight: 500;
    transition: var(--pc-transition);
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    background: var(--pc-card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border: 1px solid var(--pc-border);
    box-shadow: var(--pc-shadow);
    transition: var(--pc-transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card:hover {
    box-shadow: var(--pc-shadow-lg);
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.2);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.stat-icon.bg-primary { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.stat-icon.bg-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.bg-success { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.bg-info { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.stat-icon.bg-danger { background: linear-gradient(135deg, #f43f5e, #e11d48); }

.stat-info h3 {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--pc-text);
    letter-spacing: -0.5px;
}

.stat-info p {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--pc-text-muted);
}

/* Cards (Premium Glassmorphism & High Contrast) */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--pc-border);
    border-radius: 20px;
    box-shadow: var(--pc-shadow);
    transition: var(--pc-transition);
}

[data-theme="dark"] .card {
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.card:hover {
    box-shadow: var(--pc-shadow-lg);
    transform: translateY(-2px);
    border-color: var(--pc-primary-light);
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--pc-border);
    padding: 1.25rem 1.5rem;
    font-weight: 700;
}

/* Buttons */
.btn {
    border-radius: 10px !important;
    font-weight: 500;
    transition: var(--pc-transition) !important;
}

.btn-sm {
    border-radius: 8px !important;
}

.btn-lg {
    border-radius: 12px !important;
}

.btn-primary-corporate {
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-light) 100%);
    border: none;
    color: #fff;
    font-weight: 500;
    transition: var(--pc-transition);
}

.btn-primary-corporate:hover {
    background: linear-gradient(135deg, var(--pc-primary-light) 0%, var(--pc-primary) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(26, 60, 94, 0.3);
}

.btn-primary-corporate:active {
    transform: scale(0.98);
}

/* Subtle Button Styles */
.btn-success-subtle {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}
.btn-success-subtle:hover {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #059669 !important;
}

.btn-warning-subtle {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: #d97706 !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
}
.btn-warning-subtle:hover {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #b45309 !important;
}

.btn-danger-subtle {
    background-color: rgba(244, 63, 94, 0.1) !important;
    color: #f43f5e !important;
    border: 1px solid rgba(244, 63, 94, 0.2) !important;
}
.btn-danger-subtle:hover {
    background-color: rgba(244, 63, 94, 0.2) !important;
    color: #e11d48 !important;
}

.btn-secondary-subtle {
    background-color: rgba(100, 116, 139, 0.1) !important;
    color: #64748b !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
}
.btn-secondary-subtle:hover {
    background-color: rgba(100, 116, 139, 0.2) !important;
    color: #475569 !important;
}

/* Subtle Badge Styles */
.bg-info-subtle {
    background-color: rgba(6, 182, 212, 0.12) !important;
}
.text-info {
    color: #06b6d4 !important;
}
.border-info-subtle {
    border-color: rgba(6, 182, 212, 0.25) !important;
}

.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.12) !important;
}
.text-success {
    color: #10b981 !important;
}
.border-success-subtle {
    border-color: rgba(16, 185, 129, 0.25) !important;
}

.bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.12) !important;
}
.text-warning {
    color: #f59e0b !important;
}
.border-warning-subtle {
    border-color: rgba(245, 158, 11, 0.25) !important;
}

.bg-danger-subtle {
    background-color: rgba(244, 63, 94, 0.12) !important;
}
.text-danger {
    color: #f43f5e !important;
}
.border-danger-subtle {
    border-color: rgba(244, 63, 94, 0.25) !important;
}

.bg-secondary-subtle {
    background-color: rgba(100, 116, 139, 0.12) !important;
}
.text-secondary {
    color: #94a3b8 !important;
}
.border-secondary-subtle {
    border-color: rgba(100, 116, 139, 0.25) !important;
}

.bg-primary-subtle {
    background-color: rgba(99, 102, 241, 0.12) !important;
}
.text-primary {
    color: #6366f1 !important;
}
.border-primary-subtle {
    border-color: rgba(99, 102, 241, 0.25) !important;
}


/* Bulk Action Floating Bar */
.bulk-action-floating-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 650px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 20px;
    padding: 0.85rem 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
    z-index: 1050;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .bulk-action-floating-bar {
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .bulk-action-floating-bar .dark-text-white {
    color: #f3f4f6 !important;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translate(-50%, 15px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@media (max-width: 768px) {
    .bulk-action-floating-bar {
        bottom: 80px; /* Leave space for mobile bottom tab bar */
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }
    .bulk-action-floating-bar div {
        justify-content: center;
    }
}


/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.status-cancelled {
    background-color: #e2e3e5;
    color: #383d41;
}

.status-completed {
    background-color: #cce5ff;
    color: #004085;
}

/* Tables (Premium Modern Design) */
.table-responsive {
    border-radius: var(--pc-radius);
    overflow-x: auto;
    overflow-y: hidden;
}

/* Custom Scrollbar for responsive tables */
.table-responsive::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.25);
    border-radius: 10px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.45);
}

.table {
    font-size: 0.875rem;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 0;
    color: var(--pc-text);
    vertical-align: middle;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--pc-text-muted);
    border-bottom: 1px solid var(--pc-border);
    border-top: none;
    padding: 0.75rem 1rem;
    background: rgba(79, 70, 229, 0.02);
    backdrop-filter: blur(5px);
}

[data-theme="dark"] .table thead th {
    background: rgba(255, 255, 255, 0.02);
}

.table tbody tr {
    transition: var(--pc-transition);
}

.table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--pc-border);
    vertical-align: middle;
    transition: var(--pc-transition);
}

.table-hover tbody tr:hover td {
    background-color: rgba(99, 102, 241, 0.04) !important;
}

[data-theme="dark"] .table-hover tbody tr:hover td {
    background-color: rgba(99, 102, 241, 0.08) !important;
}

/* Sleek Table Checkboxes */
.table .form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    border: 1.5px solid var(--pc-border);
    border-radius: 5px;
    background-color: transparent;
    cursor: pointer;
    transition: var(--pc-transition);
}

.table .form-check-input:checked {
    background-color: var(--pc-primary);
    border-color: var(--pc-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Separated Rows (Card-like table items) */
.table-separated {
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
    margin-top: -8px;
    background: transparent !important;
}

.table-separated thead th {
    border-bottom: none;
    background: transparent !important;
    backdrop-filter: none;
    padding-bottom: 0.25rem;
}

.table-separated tbody tr {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .table-separated tbody tr {
    background: rgba(30, 41, 59, 0.45);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.table-separated tbody td {
    border-top: 1px solid var(--pc-border);
    border-bottom: 1px solid var(--pc-border);
    padding: 0.75rem 1rem;
}

.table-separated tbody td:first-child {
    border-left: 1px solid var(--pc-border);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.table-separated tbody td:last-child {
    border-right: 1px solid var(--pc-border);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.table-separated.table-hover tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.08);
}

.table-separated.table-hover tbody tr:hover td {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

[data-theme="dark"] .table-separated.table-hover tbody tr:hover td {
    background: rgba(30, 41, 59, 0.75) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

/* Realistic License Plates */
.vehicle-plate {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    color: #111827;
    border: 2.5px solid #111827;
    border-radius: 6px;
    padding: 0;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.8);
    user-select: none;
    vertical-align: middle;
    overflow: hidden;
    height: 28px;
    box-sizing: border-box;
    white-space: nowrap;
    flex-shrink: 0;
}

.vehicle-plate-other {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px solid #6b7280;
    background: #f3f4f6;
    color: #374151;
    padding: 2px 8px;
    height: auto;
}

[data-theme="dark"] .vehicle-plate-other {
    background: #1f2937;
    color: #d1d5db;
    border-color: #4b5563;
}

.vehicle-plate .plate-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    height: 100%;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

/* If there is a left band, we adjust the left padding of plate-main */
.vehicle-plate .plate-left-band + .plate-main {
    padding-left: 6px;
}

/* Left Band (Euroband-like strip) */
.vehicle-plate .plate-left-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 100%;
    box-sizing: border-box;
    padding: 1px 0;
    font-size: 0.55rem;
    flex-shrink: 0;
}

.vehicle-plate .plate-left-band-by {
    background: #ffffff;
    border-right: 1.5px solid #111827;
}

.vehicle-plate .plate-left-band-kz {
    background: #ffffff;
    border-right: 1.5px solid #111827;
}

.vehicle-plate .plate-left-band-ua {
    background: #0057b7;
    color: #ffffff;
    border-right: 1.5px solid #111827;
}

.vehicle-plate .plate-left-band-eu {
    background: #003399;
    color: #ffffff;
    border-right: 1.5px solid #111827;
}

.vehicle-plate .plate-left-code {
    font-size: 0.5rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 1px;
}

.vehicle-plate .plate-left-band-by .plate-left-code,
.vehicle-plate .plate-left-band-kz .plate-left-code {
    color: #111827;
}

.vehicle-plate .plate-left-band-ua .plate-left-code,
.vehicle-plate .plate-left-band-eu .plate-left-code {
    color: #ffffff;
}

/* Right Region Box (for RU, KZ) */
.vehicle-plate .plate-region {
    border-left: 2px solid #111827;
    margin-left: 0;
    padding: 0 6px;
    font-size: 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    line-height: 1.1;
    height: 100%;
    box-sizing: border-box;
    min-width: 32px;
    white-space: nowrap;
    flex-shrink: 0;
}

.vehicle-plate .plate-region-num {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0;
}

.vehicle-plate .plate-flag {
    font-size: 0.5rem;
    line-height: 1;
    margin-top: 1px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 3px;
}

.vehicle-plate .plate-flag span {
    letter-spacing: 0;
}

/* CSS flags to bypass missing Windows flag emojis */
.flag-color {
    display: inline-block;
    width: 12px;
    height: 8px;
    border: 0.5px solid #d1d5db;
    box-sizing: border-box;
    vertical-align: middle;
}

.flag-color-ru {
    background: linear-gradient(to bottom, #ffffff 33.3%, #0039a6 33.3%, #0039a6 66.6%, #d52b1e 66.6%);
}

.flag-color-by {
    background: linear-gradient(to right, #ffffff 15%, transparent 15%), 
                linear-gradient(to bottom, #e01e2b 66.6%, #289947 66.6%);
    position: relative;
}
.flag-color-by::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background-image: repeating-linear-gradient(0deg, #e01e2b, #e01e2b 1px, transparent 1px, transparent 2px);
}

.flag-color-kz {
    background-color: #00afca;
    position: relative;
    border-color: #009cb4;
}
.flag-color-kz::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 3px;
    background-color: #fec100;
    border-radius: 50%;
}

.flag-color-ua {
    background: linear-gradient(to bottom, #0057b7 50%, #ffd700 50%);
    border-color: #004da3;
}

.flag-color-am {
    background: linear-gradient(to bottom, #d90012 33.3%, #0033a0 33.3%, #0033a0 66.6%, #f2a800 66.6%);
    border-color: #0033a0;
}

.flag-color-az {
    background: linear-gradient(to bottom, #00b5e2 33.3%, #ef3340 33.3%, #ef3340 66.6%, #509e2f 66.6%);
    border-color: #00b5e2;
}

.flag-color-eu {
    background-color: #003399;
    position: relative;
}
.flag-color-eu::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    border: 1px dotted #ffd700;
    border-radius: 50%;
}

/* Specificity Booster for Realistic License Plates in Dark Theme */
[data-theme="dark"] span.vehicle-plate {
    background-color: #111827 !important;
    border-color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .vehicle-plate .plate-main,
[data-theme="dark"] .vehicle-plate .plate-left-band,
[data-theme="dark"] .vehicle-plate .plate-region {
    background-color: transparent !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

[data-theme="dark"] .vehicle-plate .plate-left-code,
[data-theme="dark"] .vehicle-plate .plate-region-num,
[data-theme="dark"] .vehicle-plate .plate-flag,
[data-theme="dark"] .vehicle-plate .plate-flag span {
    color: #ffffff !important;
}



/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: transparent;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-light) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
}

/* Forms & Input Customization (High Contrast for Light Theme) */
html:not([data-theme="dark"]) .form-control,
html:not([data-theme="dark"]) .form-select {
    background-color: var(--pc-card-bg);
    border: 1.5px solid var(--pc-border);
    color: var(--pc-text);
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    transition: var(--pc-transition);
}

html:not([data-theme="dark"]) .form-control::placeholder {
    color: var(--pc-text-muted);
    opacity: 0.8;
}

html:not([data-theme="dark"]) .form-control:focus,
html:not([data-theme="dark"]) .form-select:focus {
    border-color: var(--pc-primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background-color: #ffffff;
}

/* High Contrast Enhancements for Light Theme Buttons & Badges */
html:not([data-theme="dark"]) .btn-success-subtle {
    color: #047857 !important;
}
html:not([data-theme="dark"]) .btn-danger-subtle {
    color: #be123c !important;
}
html:not([data-theme="dark"]) .btn-warning-subtle {
    color: #b45309 !important;
}
html:not([data-theme="dark"]) .btn-secondary-subtle {
    color: #334155 !important;
}

/* Badge Enhancements for Light Theme */
html:not([data-theme="dark"]) .badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

html:not([data-theme="dark"]) .badge.bg-success-subtle,
html:not([data-theme="dark"]) .badge.bg-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #047857 !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

html:not([data-theme="dark"]) .badge.bg-danger-subtle,
html:not([data-theme="dark"]) .badge.bg-danger {
    background-color: rgba(244, 63, 94, 0.1) !important;
    color: #be123c !important;
    border: 1px solid rgba(244, 63, 94, 0.25) !important;
}

html:not([data-theme="dark"]) .badge.bg-warning-subtle,
html:not([data-theme="dark"]) .badge.bg-warning {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: #b45309 !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

html:not([data-theme="dark"]) .badge.bg-info-subtle,
html:not([data-theme="dark"]) .badge.bg-info {
    background-color: rgba(6, 182, 212, 0.1) !important;
    color: #0891b2 !important;
    border: 1px solid rgba(6, 182, 212, 0.25) !important;
}

/* Toast Customization */
.toastify {
    border-radius: var(--pc-radius) !important;
    font-weight: 500 !important;
    box-shadow: var(--pc-shadow-lg) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 0.5rem 0;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .stat-info h3 {
        font-size: 1.5rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .login-card {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .stat-card {
        flex-direction: row;
        text-align: left;
        padding: 0.6rem;
        gap: 0.5rem;
        border-radius: 12px;
        align-items: center;
    }

    .stat-card h3 {
        font-size: 1.15rem;
        margin-bottom: 0.05rem;
        line-height: 1.1;
    }

    .stat-card p {
        font-size: 0.7rem;
        margin-bottom: 0;
        line-height: 1.1;
        color: var(--pc-text-muted);
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .table-responsive {
        font-size: 0.75rem;
    }

    h4 {
        font-size: 1.25rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .card-footer,
    .pagination {
        display: none !important;
    }

    .main-content {
        padding: 0;
        max-width: 100%;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ============================================================
   DARK THEME - Web 3.0 Style
   ============================================================ */

[data-theme="dark"] {
    --pc-primary: #6366f1;
    --pc-primary-light: #818cf8;
    --pc-primary-dark: #4f46e5;
    --pc-accent: #10b981;
    --pc-accent-hover: #059669;
    --pc-danger: #f43f5e;
    --pc-warning: #f59e0b;
    --pc-info: #06b6d4;
    --pc-bg: #090d16;
    --pc-card-bg: #111827;
    --pc-text: #f8fafc;
    --pc-text-muted: #94a3b8;
    --pc-border: #1f2937;
    --pc-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    --pc-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] body {
    background: var(--pc-bg);
    color: var(--pc-text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

[data-theme="dark"] body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.07) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.02) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

@keyframes bgShiftDark {
    0%, 100% { opacity: 0.6; transform: scale(1) translate(0, 0); }
    33% { opacity: 0.8; transform: scale(1.05) translate(2%, 2%); }
    66% { opacity: 0.7; transform: scale(0.98) translate(-2%, -2%); }
    50% { opacity: 1; transform: scale(1.08) translate(1%, -1%); }
}

[data-theme="dark"] .bg-primary-corporate {
    background: linear-gradient(135deg, #0a0a12 0%, #1a1a2e 100%) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.2) !important;
    border-bottom: 1px solid rgba(99, 102, 241, 0.3) !important;
    backdrop-filter: blur(10px) !important;
}

[data-theme="dark"] .navbar-brand {
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    color: #fff !important;
}

[data-theme="dark"] .nav-link,
[data-theme="dark"] .navbar-nav .nav-link,
[data-theme="dark"] .navbar-text,
[data-theme="dark"] .dropdown-toggle {
    color: rgba(255, 255, 255, 0.95) !important;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .navbar-nav .nav-link:hover {
    background-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    color: #fff !important;
}

[data-theme="dark"] .nav-link-new-request {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 700;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

[data-theme="dark"] .nav-link-new-request:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6), 0 0 25px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

[data-theme="dark"] .nav-link-new-request.active {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

[data-theme="dark"] .card {
    background: var(--pc-card-bg-gradient);
    border: 1px solid var(--pc-border);
    box-shadow: var(--pc-shadow);
}

[data-theme="dark"] .card:hover {
    box-shadow: var(--pc-shadow-lg), var(--pc-glow);
    border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .card-header {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid var(--pc-border);
    color: var(--pc-text) !important;
}

[data-theme="dark"] .card-header h5,
[data-theme="dark"] .card-header h6 {
    color: var(--pc-text) !important;
}

[data-theme="dark"] .card-footer {
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--pc-border);
}

[data-theme="dark"] .dropdown-menu {
    background: var(--pc-card-bg) !important;
    border: 1px solid var(--pc-border) !important;
    box-shadow: var(--pc-shadow-lg) !important;
}

[data-theme="dark"] .dropdown-menu .dropdown-item {
    color: var(--pc-text) !important;
}

[data-theme="dark"] .dropdown-menu .dropdown-item-text {
    color: var(--pc-text-muted) !important;
}

[data-theme="dark"] .dropdown-item {
    color: var(--pc-text);
}

[data-theme="dark"] .dropdown-item:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--pc-text);
}

[data-theme="dark"] .dropdown-divider {
    border-color: var(--pc-border);
}

[data-theme="dark"] .btn-primary-corporate {
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-dark) 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Enhanced visibility for "Новая заявка на авто" buttons in dark theme */
[data-theme="dark"] .btn-primary-corporate.btn-sm .bi-car-front {
    text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .btn-primary-corporate.btn-sm {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4) !important;
    font-weight: 600 !important;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .btn-primary-corporate.btn-sm:hover {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6), 0 0 25px rgba(79, 70, 229, 0.4) !important;
    transform: translateY(-2px) !important;
}

/* Ensure text inside button is visible */
[data-theme="dark"] .btn-primary-corporate.btn-sm {
    color: #fff !important;
}

[data-theme="dark"] .btn-primary-corporate:hover {
    background: linear-gradient(135deg, var(--pc-primary-light) 0%, var(--pc-primary) 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5), 0 0 15px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-outline-primary {
    color: var(--pc-primary-light);
    border-color: var(--pc-primary-light);
}

[data-theme="dark"] .btn-outline-primary:hover {
    background: var(--pc-primary);
    border-color: var(--pc-primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--pc-border);
    color: var(--pc-text);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--pc-primary);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--pc-text-muted);
}

[data-theme="dark"] .form-label {
    color: var(--pc-text-muted);
}

[data-theme="dark"] .form-text {
    color: var(--pc-text-muted);
}

[data-theme="dark"] .table {
    color: var(--pc-text);
}

[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
    color: var(--pc-text) !important;
    border-color: var(--pc-border);
}

[data-theme="dark"] .table thead th {
    color: var(--pc-text-muted);
    border-bottom-color: var(--pc-border);
    background: rgba(255, 255, 255, 0.015) !important;
}

[data-theme="dark"] .table-hover tbody tr:hover td {
    background-color: rgba(99, 102, 241, 0.08) !important;
}

[data-theme="dark"] .table tbody tr,
[data-theme="dark"] .table-light tbody tr,
[data-theme="dark"] .table-dark tbody tr {
    background-color: transparent !important;
    border-color: var(--pc-border);
}

[data-theme="dark"] .status-pending {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .status-approved,
[data-theme="dark"] .status-completed {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .status-rejected {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .status-cancelled {
    background-color: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .badge {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .badge.bg-primary {
    background: linear-gradient(135deg, var(--pc-primary), var(--pc-primary-dark)) !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .badge.bg-success {
    background: linear-gradient(135deg, var(--pc-accent), var(--pc-accent-hover)) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .badge.bg-danger {
    background: linear-gradient(135deg, var(--pc-danger), #dc2626) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .badge.bg-warning {
    background: linear-gradient(135deg, var(--pc-warning), #d97706) !important;
    color: #000;
}

[data-theme="dark"] .stat-card {
    background: var(--pc-card-bg-gradient);
    border: 1px solid var(--pc-border);
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: var(--pc-shadow-lg), var(--pc-glow);
    border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .stat-icon.bg-primary {
    background: linear-gradient(135deg, var(--pc-info), var(--pc-primary-dark));
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .stat-icon.bg-warning {
    background: linear-gradient(135deg, var(--pc-warning), #d97706);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .stat-icon.bg-success {
    background: linear-gradient(135deg, var(--pc-accent), var(--pc-accent-hover));
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .stat-icon.bg-info {
    background: linear-gradient(135deg, var(--pc-neon-blue), var(--pc-primary));
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

[data-theme="dark"] .stat-icon.bg-danger {
    background: linear-gradient(135deg, var(--pc-danger), #dc2626);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .alert {
    border: 1px solid var(--pc-border);
}

[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .login-card {
    background: var(--pc-card-bg-gradient);
    border: 1px solid var(--pc-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 40px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .login-logo {
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-dark) 100%);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

[data-theme="dark"] .login-container {
    background: transparent;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1a2e;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #4f46e5;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

[data-theme="dark"] .form-check-input:checked {
    background-color: var(--pc-primary);
    border-color: var(--pc-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .form-check-input:focus {
    border-color: var(--pc-primary);
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .pagination .page-link {
    background: var(--pc-card-bg);
    border-color: var(--pc-border);
    color: var(--pc-text);
}

[data-theme="dark"] .pagination .page-link:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--pc-primary);
    color: var(--pc-text);
}

[data-theme="dark"] .pagination .page-item.active .page-link {
    background: var(--pc-primary);
    border-color: var(--pc-primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--pc-text);
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* Enhanced visibility for "Новая заявка на авто" in dark theme */
[data-theme="dark"] .main-content h4.mb-0 {
    color: #fff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 0 0 20px rgba(99, 102, 241, 0.3);
    font-weight: 600;
}

[data-theme="dark"] .text-muted {
    color: var(--pc-text-muted) !important;
}

/* iOS Bottom-Sheet Modals on mobile & Frosted Glass on Desktop */
.modal-content {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 24px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    color: var(--pc-text);
}

[data-theme="dark"] .modal-content {
    background: rgba(26, 32, 44, 0.7) !important;
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    color: var(--pc-text);
}

.modal-header {
    border-bottom: none !important;
    padding: 1.5rem 1.5rem 0.5rem !important;
}

.modal-footer {
    border-top: none !important;
    padding: 0.5rem 1.5rem 1.5rem !important;
}

/* Apple-style blur backdrops */
.modal-backdrop {
    background-color: rgba(10, 10, 16, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* iOS bottom-sheet transition on mobile screens */
@media (max-width: 576px) {
    .modal.fade .modal-dialog {
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        margin: 0;
        display: flex;
        align-items: flex-end;
        min-height: 100vh;
    }
    
    .modal.show .modal-dialog {
        transform: translateY(0);
    }
    
    .modal-content {
        border-radius: 28px 28px 0 0 !important;
        border-bottom: none;
        width: 100%;
    }
}

/* Centered Modals on Mobile (overrides bottom-sheet style) */
@media (max-width: 576px) {
    .modal-centered-mobile.modal.fade .modal-dialog {
        transform: scale(0.9) !important;
        transition: transform 0.3s ease-out !important;
        margin: 1rem !important;
        display: flex !important;
        align-items: center !important;
        min-height: calc(100% - 2rem) !important;
    }
    .modal-centered-mobile.modal.show .modal-dialog {
        transform: scale(1) !important;
    }
    .modal-centered-mobile .modal-content {
        border-radius: 24px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.45) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
    }
    [data-theme="dark"] .modal-centered-mobile .modal-content {
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
}

[data-theme="dark"] .toastify {
    background: var(--pc-card-bg) !important;
    color: var(--pc-text) !important;
    border: 1px solid var(--pc-border) !important;
    box-shadow: var(--pc-shadow-lg), var(--pc-glow) !important;
}

[data-theme="dark"] .nav-pills .nav-link {
    color: var(--pc-text-muted);
}

[data-theme="dark"] .nav-pills .nav-link.active {
    background: var(--pc-primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .nav-pills .nav-link:hover:not(.active) {
    background: rgba(99, 102, 241, 0.1);
    color: var(--pc-text);
}

[data-theme="dark"] a {
    color: var(--pc-primary-light);
}

[data-theme="dark"] a:hover {
    color: var(--pc-neon-blue);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

[data-theme="dark"] hr {
    border-color: var(--pc-border);
    opacity: 0.5;
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

[data-theme="dark"] .list-group-item {
    background: transparent;
    border-color: var(--pc-border);
    color: var(--pc-text);
}

[data-theme="dark"] .list-group-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

[data-theme="dark"] .progress {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .progress-bar {
    background: linear-gradient(135deg, var(--pc-primary), var(--pc-primary-light));
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .border {
    border-color: var(--pc-border) !important;
}

[data-theme="dark"] .border-top {
    border-top-color: var(--pc-border) !important;
}

[data-theme="dark"] .border-bottom {
    border-bottom-color: var(--pc-border) !important;
}

[data-theme="dark"] .bg-light {
    background: rgba(255, 255, 255, 0.03) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--pc-text) !important;
}

[data-theme="dark"] .bg-white {
    background: var(--pc-card-bg) !important;
}

/* ============================================================
   DARK THEME TABLE FIX - Override Bootstrap 5.3
   ============================================================ */

[data-theme='dark'] table.table,
[data-theme='dark'] table.table-light,
[data-theme='dark'] table.table-dark,
[data-theme='dark'] table.table > tbody > tr,
[data-theme='dark'] table.table-light > tbody > tr,
[data-theme='dark'] table.table-dark > tbody > tr {
    background-color: transparent !important;
    --bs-table-bg: transparent !important;
    --bs-table-color: #e2e8f0 !important;
}

[data-theme='dark'] table.table thead > tr > th,
[data-theme='dark'] table.table-light thead > tr > th,
[data-theme='dark'] table.table-dark thead > tr > th {
    background-color: rgba(255, 255, 255, 0.05) !important;
    --bs-table-bg: rgba(255, 255, 255, 0.05) !important;
    --bs-table-color: #94a3b8 !important;
    color: #94a3b8 !important;
}

[data-theme='dark'] table.table tbody > tr > td,
[data-theme='dark'] table.table-light tbody > tr > td,
[data-theme='dark'] table.table-dark tbody > tr > td {
    background-color: transparent !important;
    --bs-table-bg: transparent !important;
    --bs-table-color: #e2e8f0 !important;
    color: #e2e8f0 !important;
}

[data-theme='dark'] table.table-hover tbody > tr:hover,
[data-theme='dark'] table.table-hover tbody > tr:hover > td {
    background-color: rgba(99, 102, 241, 0.08) !important;
}

/* ============================================================
   ADDITIONAL DARK THEME TEXT FIXES
   ============================================================ */

[data-theme="dark"] body,
[data-theme="dark"] p,
[data-theme="dark"] span:not(.badge):not(.vehicle-plate):not(.plate-main):not(.plate-region):not(.plate-region-num):not(.plate-flag):not(.flag-color),
[data-theme="dark"] label,
[data-theme="dark"] small {
    color: var(--pc-text) !important;
}

[data-theme="dark"] .card-body {
    color: var(--pc-text) !important;
}

[data-theme="dark"] .form-control-plaintext {
    color: var(--pc-text) !important;
}

[data-theme="dark"] code {
    color: var(--pc-neon-blue) !important;
}

[data-theme="dark"] .fw-bold,
[data-theme="dark"] .fw-semibold {
    color: var(--pc-text) !important;
}

[data-theme="dark"] .card-footer {
    color: var(--pc-text) !important;
}

[data-theme="dark"] .list-group-item {
    color: var(--pc-text) !important;
}

[data-theme="dark"] .stat-info h3,
[data-theme="dark"] .stat-info p {
    color: var(--pc-text) !important;
}

/* Dark theme support for accordion */
[data-theme="dark"] .accordion-button {
    background-color: var(--pc-card-bg) !important;
    color: var(--pc-text) !important;
    border-color: var(--pc-border) !important;
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: var(--pc-primary) !important;
    color: #fff !important;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.125);
}

[data-theme="dark"] .accordion-button:focus {
    border-color: var(--pc-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25) !important;
}

[data-theme="dark"] .accordion-button:hover:not(.collapsed) {
    background-color: var(--pc-primary-dark) !important;
}

[data-theme="dark"] .accordion-body {
    background-color: var(--pc-card-bg) !important;
    color: var(--pc-text) !important;
    border-color: var(--pc-border) !important;
}

[data-theme="dark"] .accordion-item {
    border-color: var(--pc-border) !important;
    background-color: var(--pc-card-bg) !important;
}

[data-theme="dark"] .accordion-item:first-of-type {
    border-top-left-radius: var(--pc-radius) !important;
    border-top-right-radius: var(--pc-radius) !important;
}

[data-theme="dark"] .accordion-item:last-of-type {
    border-bottom-right-radius: var(--pc-radius) !important;
    border-bottom-left-radius: var(--pc-radius) !important;
}

[data-theme="dark"] .accordion-item:not(:first-of-type) {
    border-top: 1px solid var(--pc-border) !important;
}

/* Dark theme support for Bootstrap tabs/navs */
[data-theme="dark"] .nav-tabs {
    border-bottom-color: var(--pc-border) !important;
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: var(--pc-text-muted) !important;
    background-color: transparent !important;
    border-color: transparent !important;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    color: var(--pc-text) !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: transparent !important;
}

[data-theme="dark"] .nav-tabs .nav-link.active,
[data-theme="dark"] .nav-tabs .nav-link.active:hover {
    color: #fff !important;
    background-color: var(--pc-primary) !important;
    border-color: var(--pc-primary) !important;
    border-bottom-color: transparent !important;
    position: relative;
}

[data-theme="dark"] .nav-tabs .nav-link.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--pc-primary), var(--pc-primary-light));
    opacity: 0.8;
    z-index: -1;
}

[data-theme="dark"] .tab-pane {
    background-color: var(--pc-card-bg) !important;
    color: var(--pc-text) !important;
}

[data-theme="dark"] .tab-pane {
    background-color: var(--pc-card-bg) !important;
    color: var(--pc-text) !important;
}

/* Dark theme support for form elements in admin areas */
[data-theme="dark"] .form-control {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--pc-border) !important;
    color: var(--pc-text) !important;
}

[data-theme="dark"] .form-control:focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--pc-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25) !important;
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--pc-text-muted) !important;
}

[data-theme="dark"] .form-select {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--pc-border) !important;
    color: var(--pc-text) !important;
}

[data-theme="dark"] .form-select option {
    background-color: var(--pc-card-bg) !important;
    color: var(--pc-text) !important;
    padding: 0.5rem;
}

[data-theme="dark"] .form-select:focus {
    border-color: var(--pc-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25) !important;
}

[data-theme="dark"] .form-label {
    color: var(--pc-text-muted) !important;
}

[data-theme="dark"] .input-group-text {
    background-color: var(--pc-card-bg) !important;
    border-color: var(--pc-border) !important;
    color: var(--pc-text) !important;
}

[data-theme="dark"] .dropdown-menu .dropdown-item-text {
    color: var(--pc-text-muted) !important;
}

/* Row Highlight Animation */
@keyframes highlight-fade {
    0% { background-color: rgba(99, 102, 241, 0.25); }
    100% { background-color: transparent; }
}
.row-highlight {
    animation: highlight-fade 8s ease-out;
}

/* Двухколоночное мега-меню для админки */
.dropdown-menu-mega {
    max-height: 80vh;
    overflow-y: auto;
    border-radius: var(--pc-radius);
    padding: 1rem !important;
}

@media (min-width: 768px) {
    .dropdown-menu-mega {
        min-width: 580px !important;
    }
    .dropdown-menu-mega .col-md-6.border-end {
        border-right: 1px solid var(--pc-border) !important;
    }
}

@media (max-width: 767.98px) {
    .dropdown-menu-mega {
        min-width: 100% !important;
    }
    .dropdown-menu-mega .col-md-6.border-end {
        border-right: none !important;
        border-bottom: 1px solid var(--pc-border);
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Отступ снизу для мобильного меню */
    body {
        padding-bottom: 80px !important;
    }
}

/* ============================================================
   MOBILE BOTTOM NAVIGATION & PREMIUM RESPONSIVE UI
   ============================================================ */

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1025;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
    transition: background 0.3s, border-color 0.3s;
}

[data-theme="dark"] .mobile-bottom-nav {
    background: rgba(26, 31, 44, 0.85);
    border-top-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--pc-text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    text-decoration: none;
    width: 20%;
    height: 100%;
    transition: color 0.2s ease;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--pc-primary-light);
}

[data-theme="dark"] .mobile-bottom-nav .nav-item.active {
    color: #4facfe;
}

.mobile-bottom-nav .nav-item-center {
    position: relative;
    width: 20%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-bottom-nav .nav-item-center .plus-icon {
    position: absolute;
    top: -18px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(26, 60, 94, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-bottom-nav .nav-item-center:active .plus-icon {
    transform: scale(0.9);
}

/* Мобильные карточки заявок */
.mobile-card-list {
    display: none;
}

.request-mobile-card {
    background: var(--pc-card-bg);
    border-radius: var(--pc-radius);
    border: 1px solid var(--pc-border);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--pc-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.request-mobile-card:active {
    transform: scale(0.99);
}

.request-mobile-card .card-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--pc-border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.request-mobile-card .card-body-mobile p {
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: var(--pc-text);
}

.request-mobile-card .card-actions-mobile {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--pc-border);
    padding-top: 8px;
}


/* Multi-step form wizard styles */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    position: relative;
}

.wizard-progress::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--pc-border);
    z-index: 1;
}

.wizard-progress-bar {
    position: absolute;
    top: 15px;
    left: 0;
    height: 3px;
    background: var(--pc-primary-light);
    z-index: 2;
    transition: width 0.3s ease;
}

.wizard-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--pc-card-bg);
    border: 2px solid var(--pc-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    z-index: 3;
    transition: all 0.3s ease;
    color: var(--pc-text-muted);
}

.wizard-step.active {
    border-color: var(--pc-primary-light);
    background: var(--pc-primary-light);
    color: #fff;
    box-shadow: 0 0 8px rgba(42, 82, 128, 0.4);
}

.wizard-step.completed {
    border-color: var(--pc-accent);
    background: var(--pc-accent);
    color: #fff;
}

/* Glassmorphism Stat Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .glass-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Floating labels adjustments for dark theme */
[data-theme="dark"] .form-floating > .form-control:focus ~ label,
[data-theme="dark"] .form-floating > .form-control:not(:placeholder-shown) ~ label,
[data-theme="dark"] .form-floating > .form-select ~ label {
    color: #4facfe;
    background-color: transparent !important;
}

/* ============================================================
   NEW MODERN LAYOUT STYLE (Sidebar & Header)
   ============================================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.app-sidebar {
    width: 280px;
    background: #0f172a; /* Slate 900 */
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1010;
    padding: 2rem 1.25rem;
    transition: var(--pc-transition);
}

[data-theme="light"] .app-sidebar {
    background: #ffffff;
    border-right-color: #e2e8f0;
}

.sidebar-header {
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

.sidebar-brand {
    font-size: 1.35rem;
    font-weight: 850;
    text-decoration: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    letter-spacing: -0.5px;
}

[data-theme="light"] .sidebar-brand {
    color: #0f172a;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
}

/* Custom Scrollbar for sidebar navigation */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

[data-theme="light"] .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.15);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: #94a3b8; /* Slate 400 */
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--pc-transition);
}

[data-theme="light"] .sidebar-link {
    color: #64748b;
}

.sidebar-link i {
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.sidebar-link:not(.active):hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link:not(.active):hover i {
    transform: translateX(2px);
}

[data-theme="light"] .sidebar-link:not(.active):hover {
    color: #4f46e5;
    background: #f1f5f9;
}

.sidebar-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.sidebar-section {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #475569;
    font-weight: 800;
    margin: 1.5rem 1rem 0.5rem;
}

[data-theme="light"] .sidebar-section {
    color: #94a3b8;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .sidebar-footer {
    border-top-color: #e2e8f0;
}

/* Main content wrapper */
.app-main-wrapper {
    flex-grow: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

@media (max-width: 991.98px) {
    .app-main-wrapper {
        margin-left: 0 !important;
    }
}

/* Header Styling */
.app-header {
    height: 75px;
    background: rgba(9, 13, 22, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

[data-theme="light"] .app-header {
    background: rgba(248, 250, 252, 0.8);
    border-bottom-color: #e2e8f0;
}

@media (max-width: 768px) {
    .app-header {
        padding: 0 1.25rem;
    }
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.btn-theme-toggle {
    border: none;
    background: none;
    color: var(--pc-text-muted);
    font-size: 1.3rem;
    padding: 0.5rem;
    border-radius: 10px;
    transition: var(--pc-transition);
}

.btn-theme-toggle:hover {
    color: var(--pc-text);
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .btn-theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.user-profile-btn {
    border: 1px solid var(--pc-border);
    border-radius: 12px;
    padding: 0.55rem 1.1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--pc-text);
    background: var(--pc-card-bg);
    transition: var(--pc-transition);
}

.user-profile-btn:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--pc-shadow);
}

.app-content-area {
    padding: 2.5rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .app-content-area {
        padding: 0.75rem;
    }
}

/* Gradient text styles */
.text-gradient {
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .text-gradient {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-indigo {
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

[data-theme="light"] .text-gradient-indigo {
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-rose {
    color: #f43f5e !important;
}

.text-indigo {
    color: #6366f1 !important;
}

/* D-block and D-none helper overrides for themes */
.d-block-theme-light { display: block; }
.d-block-theme-dark { display: none; }
[data-theme="dark"] .d-block-theme-light { display: none; }
[data-theme="dark"] .d-block-theme-dark { display: block; }

/* Offcanvas custom overrides */
.offcanvas {
    background: #0f172a; /* Slate 900 */
    color: #94a3b8;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(15px);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.3s ease-in-out;
}

[data-theme="light"] .offcanvas {
    background: #ffffff;
    color: #64748b;
    border-right-color: #e2e8f0;
}

.offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .offcanvas-header {
    border-bottom-color: #e2e8f0;
}

.btn-close-theme {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.7;
    transition: filter 0.3s, opacity 0.2s;
}

.btn-close-theme:hover {
    opacity: 1;
}

[data-theme="light"] .btn-close-theme {
    filter: none;
}

.offcanvas .sidebar-link:not(.active):hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .offcanvas .sidebar-link:not(.active):hover {
    color: #4f46e5;
    background: #f1f5f9;
}

.offcanvas .sidebar-link.active {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff !important;
}

/* Submenu Styling */
.sidebar-submenu {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.25rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .sidebar-submenu {
    border-left-color: rgba(0, 0, 0, 0.06);
}

.sidebar-submenu .sidebar-link {
    font-size: 0.88rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.sidebar-submenu .sidebar-link i {
    font-size: 1.1rem;
}

/* Сжатые отступы для бокового меню в ПК-версии */
@media (min-width: 992px) {
    .app-sidebar .sidebar-header {
        margin-bottom: 1.75rem;
    }
    .app-sidebar .sidebar-nav {
        gap: 0.25rem;
    }
    .app-sidebar .sidebar-link {
        padding: 0.55rem 0.85rem;
    }
    .app-sidebar .sidebar-section {
        margin: 1.1rem 0.85rem 0.35rem;
    }
    .app-sidebar .sidebar-footer {
        gap: 0.25rem;
    }
}

/* Fullscreen Camera Mobile & Desktop Aspect Ratio Fix */
.stream-container:fullscreen,
.stream-container:-webkit-full-screen,
.stream-container:-moz-full-screen,
.stream-container:-ms-fullscreen,
.fullscreen-camera {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    background-color: #000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    aspect-ratio: auto !important;
}

.stream-container:fullscreen .stream-image,
.stream-container:-webkit-full-screen .stream-image,
.stream-container:-moz-full-screen .stream-image,
.stream-container:-ms-fullscreen .stream-image,
.fullscreen-camera .stream-image {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
}
