        :root {
            --sidebar-bg: #1a1a1a;
            --sidebar-hover: #2a2a2a;
            --sidebar-active: #333333;
            --accent-gold: #c9a227;
            --accent-gold-light: #e3c565;
            --conrail-blue: #0079c1;
            --conrail-blue-light: #00a0e9;
            --conrail-blue-dark: #005a8e;
            --bg-main: #f1f5f9;
            --bg-card: #ffffff;
            --bg-input: #ffffff;
            --bg-table-header: #f8fafc;
            --bg-table-hover: #f1f5f9;
            --text-primary: #1e293b;
            --text-secondary: #475569;
            --text-muted: #94a3b8;
            --border-color: #e2e8f0;
            --success: #10b981;
            --success-light: #d1fae5;
            --warning: #f59e0b;
            --warning-light: #fef3c7;
            --danger: #ef4444;
            --danger-light: #fee2e2;
            --info: #3b82f6;
            --info-light: #dbeafe;
            --link-color: #2563eb;
        }
        
        [data-theme="dark"] {
            --bg-main: #0f0f0f;
            --bg-card: #1a1a1a;
            --bg-input: #2a2a2a;
            --bg-table-header: #1a1a1a;
            --bg-table-hover: #252525;
            --text-primary: #f1f5f9;
            --text-secondary: #cbd5e1;
            --text-muted: #64748b;
            --border-color: #333333;
            --success-light: #064e3b;
            --warning-light: #78350f;
            --danger-light: #7f1d1d;
            --info-light: #1e3a5f;
            --link-color: #93c5fd;
        }
        
        a, .link {
            color: var(--link-color);
            text-decoration: none;
        }
        
        a:hover, .link:hover {
            text-decoration: underline;
            opacity: 0.9;
        }
        
        * { margin: 0; padding: 0; box-sizing: border-box; }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--bg-main);
            color: var(--text-primary);
            line-height: 1.5;
            transition: background 0.3s, color 0.3s;
        }
        
        .login-page {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
            padding: 20px;
        }
        
        .login-card {
            background: var(--bg-card);
            border-radius: 16px;
            box-shadow: 0 25px 50px rgba(0,0,0,0.5);
            width: 100%;
            max-width: 420px;
            padding: 48px 40px;
            text-align: center;
            border: 1px solid var(--border-color);
        }
        
        .login-logo { 
            height: 60px; 
            margin-bottom: 24px; 
            filter: brightness(0) saturate(100%) invert(28%) sepia(98%) saturate(1500%) hue-rotate(185deg) brightness(95%) contrast(101%);
        }
        .login-title { font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
        .login-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }
        .login-form { text-align: left; }
        .form-group { margin-bottom: 20px; }
        .form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
        
        .form-input, .form-select {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid var(--border-color);
            border-radius: 8px;
            font-size: 15px;
            background: var(--bg-input);
            color: var(--text-primary);
            transition: all 0.2s;
        }
        
        .form-input:focus, .form-select:focus {
            outline: none;
            border-color: var(--accent-gold);
            box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
        }
        
        textarea.form-input { resize: vertical; min-height: 80px; }
        
        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        
        .btn-primary { background: var(--accent-gold); color: #000; }
        .btn-primary:hover { background: var(--accent-gold-light); transform: translateY(-1px); }
        .btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); }
        .btn-secondary:hover { background: var(--bg-table-hover); }
        .btn-danger { background: var(--danger); color: white; }
        .btn-sm { padding: 8px 16px; font-size: 13px; }
        .btn-block { width: 100%; justify-content: center; }
        
        .login-footer { margin-top: 24px; font-size: 12px; color: var(--text-muted); }
        .login-error { color: var(--danger); font-size: 14px; margin-bottom: 16px; text-align: center; }
        
        .app-layout { display: flex; min-height: 100vh; }
        
        .sidebar {
            width: 260px;
            background: var(--sidebar-bg);
            color: white;
            display: flex;
            flex-direction: column;
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            z-index: 100;
        }
        
        .sidebar-header { padding: 24px 20px; border-bottom: 1px solid #2a2a2a; text-align: center; flex-shrink: 0; }
        .sidebar-logo { 
            height: 45px; 
            margin-bottom: 8px; 
            filter: brightness(0) saturate(100%) invert(28%) sepia(98%) saturate(1500%) hue-rotate(185deg) brightness(95%) contrast(101%);
        }
        .sidebar-title { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.7); letter-spacing: 0.5px; }
        .sidebar-nav { padding: 12px 8px; flex: 1; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
        .sidebar-nav::-webkit-scrollbar { width: 4px; }
        .sidebar-nav::-webkit-scrollbar-track { background: transparent; }
        .sidebar-nav::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
        .sidebar-nav::-webkit-scrollbar-thumb:hover { background: #555; }
        
        body.mobile-sidebar-open { overflow: hidden; position: fixed; width: 100%; }
        .nav-section { margin-bottom: 4px; }
        .nav-section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: rgba(255,255,255,0.5);
            cursor: pointer;
            border-radius: 6px;
            transition: all 0.2s;
            user-select: none;
        }
        .nav-section-header:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7); }
        .nav-section-header.not-collapsible { cursor: default; }
        .nav-section-header.not-collapsible:hover { background: transparent; color: rgba(255,255,255,0.5); }
        .collapse-icon { font-size: 10px; transition: transform 0.2s; opacity: 0.6; }
        .collapse-icon.collapsed { transform: rotate(-90deg); }
        .nav-items { overflow: hidden; transition: max-height 0.3s ease, opacity 0.2s ease; max-height: 2000px; opacity: 1; }
        .nav-items.collapsed { max-height: 0; opacity: 0; }
        .nav-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(255,255,255,0.4); padding: 0 12px; margin-bottom: 8px; }
        
        .nav-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 9px 12px;
            border-radius: 6px;
            color: rgba(255,255,255,0.7);
            text-decoration: none;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            margin: 2px 0;
            transition: all 0.15s;
        }
        
        .nav-item:hover { background: var(--sidebar-hover); color: white; }
        .nav-item.active { background: var(--sidebar-active); color: white; border-left: 3px solid var(--accent-gold); margin-left: -3px; padding-left: 9px; }
        .nav-icon { font-size: 14px; width: 20px; text-align: center; }
        .nav-badge { margin-left: auto; background: var(--accent-gold); color: var(--sidebar-bg); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; }
        
        .sidebar-footer { padding: 16px 20px; border-top: 1px solid #2a2a2a; flex-shrink: 0; }
        .user-info { display: flex; align-items: center; gap: 12px; }
        .user-avatar { width: 40px; height: 40px; background: var(--accent-gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: #000; }
        .user-details { flex: 1; }
        .user-name { font-size: 14px; font-weight: 600; color: white; }
        .user-role { font-size: 12px; color: rgba(255,255,255,0.5); text-transform: capitalize; }
        .logout-btn { background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 18px; padding: 8px; border-radius: 4px; }
        .logout-btn:hover { background: var(--sidebar-hover); color: white; }
        
        .app-footer {
            position: fixed;
            bottom: 0;
            left: 260px;
            right: 0;
            height: 44px;
            background: var(--bg-card);
            border-top: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 24px;
            z-index: 90;
        }
        .app-footer .footer-copyright {
            font-size: 11px;
            color: var(--text-muted);
            letter-spacing: 0.01em;
        }
        
        .main-content {
            flex: 1;
            margin-left: 260px;
            padding: 24px 32px;
            padding-bottom: 68px;
            background: var(--bg-main);
            min-height: 100vh;
            overflow-x: hidden;
            max-width: calc(100vw - 260px);
        }
        
        .page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
        .page-title { font-size: 28px; font-weight: 700; color: var(--text-primary); }
        .page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
        .header-actions { display: flex; gap: 12px; flex-wrap: wrap; }
        
        .card {
            background: var(--bg-card);
            border-radius: 12px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            border: 1px solid var(--border-color);
            margin-bottom: 24px;
        }
        
        .card-header {
            padding: 20px 24px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 12px;
        }
        
        .card-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
        .card-body { padding: 24px; }
        .card-body.no-padding { padding: 0; }
        
        .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; }
        
        .stat-card {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 24px;
            border: 1px solid var(--border-color);
        }
        
        .stat-card.stat-warning {
            border: 2px solid var(--danger);
            background: var(--danger-light);
        }
        
        .stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
        .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--bg-table-hover); }
        .stat-value { font-size: 32px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
        .stat-label { font-size: 14px; color: var(--text-muted); }
        
        .data-table { width: 100%; border-collapse: collapse; }
        .data-table th {
            text-align: left;
            padding: 12px 16px;
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-muted);
            background: var(--bg-table-header);
            border-bottom: 2px solid var(--border-color);
        }
        
        .data-table td {
            padding: 14px 16px;
            border-bottom: 1px solid var(--border-color);
            font-size: 14px;
        }
        
        .data-table tr:hover td { background: var(--bg-table-hover); }
        .trainee-name { font-weight: 600; color: var(--text-primary); }
        .trainee-id { font-size: 12px; color: var(--text-muted); }
        
        .badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
        .badge-success { background: var(--success-light); color: var(--success); }
        .badge-warning { background: var(--warning-light); color: var(--warning); }
        .badge-danger { background: var(--danger-light); color: var(--danger); }
        .badge-info { background: var(--info-light); color: var(--info); }
        
        .progress-bar { height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; width: 120px; }
        .progress-fill { height: 100%; background: var(--accent-gold); border-radius: 4px; }
        .progress-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
        
        .table-actions { display: flex; gap: 8px; }
        .action-btn {
            width: 32px;
            height: 32px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-table-hover);
            color: var(--text-secondary);
            transition: all 0.2s;
            font-size: 14px;
        }
        .action-btn:hover { background: var(--accent-gold); color: #000; }
        
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.6);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            padding: 20px;
        }
        
        .modal {
            background: var(--bg-card);
            border-radius: 16px;
            width: 100%;
            max-width: 600px;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 25px 50px rgba(0,0,0,0.3);
        }
        
        .modal-header {
            padding: 24px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-shrink: 0;
        }
        
        .modal-title { font-size: 20px; font-weight: 700; }
        .modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); padding: 0; }
        .modal-close:hover { color: var(--text-primary); }
        .modal-body { padding: 24px; overflow-y: auto; flex: 1; }
        .modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 12px; flex-shrink: 0; background: var(--bg-card); }
        
        .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        .form-grid .form-group.full-width { grid-column: 1 / -1; }
        
        .toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; }
        .toast {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 16px 20px;
            margin-top: 8px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.2);
            display: flex;
            align-items: center;
            gap: 12px;
            animation: slideIn 0.3s ease;
        }
        @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
        .toast-success { border-left: 4px solid var(--success); }
        .toast-error { border-left: 4px solid var(--danger); }
        
        .schedule-grid {
            display: grid;
            gap: 1px;
            background: var(--border-color);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            position: relative;
        }
        
        /* Matrix Table Styles - Frozen first column */
        .matrix-scroll-container {
            overflow-x: auto;
            overflow-y: auto;
            max-height: calc(100vh - 320px);
            position: relative;
        }
        
        .matrix-table {
            border-collapse: separate;
            border-spacing: 0;
            width: max-content;
            min-width: 100%;
        }
        
        .matrix-table th,
        .matrix-table td {
            padding: 10px 12px;
            font-size: 12px;
            white-space: nowrap;
            border-bottom: 1px solid var(--border-color);
            border-right: 1px solid var(--border-color);
        }
        
        .matrix-header {
            background: var(--bg-table-header);
            font-weight: 700;
            text-transform: uppercase;
            font-size: 10px;
            color: var(--text-muted);
            text-align: center;
            position: sticky;
            top: 0;
            z-index: 10;
            min-width: 80px;
        }
        
        .matrix-sticky-col {
            position: sticky;
            left: 0;
            z-index: 20;
            background: var(--bg-card);
            box-shadow: 3px 0 6px rgba(0,0,0,0.15);
            min-width: 200px;
            max-width: 200px;
        }
        
        .matrix-sticky-col.matrix-header {
            z-index: 30;
            background: var(--bg-table-header);
        }
        
        .matrix-name {
            font-weight: 600;
            cursor: pointer;
            min-width: 200px;
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .matrix-name:hover {
            background: var(--bg-table-hover);
        }
        
        .matrix-cell {
            text-align: center;
            cursor: pointer;
            transition: background 0.2s;
            min-width: 80px;
            background: var(--bg-card);
        }
        
        .matrix-cell:hover {
            background: var(--bg-table-hover);
        }
        
        .matrix-inactive {
            background: var(--bg-table-hover) !important;
            opacity: 0.3;
            cursor: default !important;
        }
        
        /* v24.9.4: Conflict highlighting */
        .matrix-conflict {
            box-shadow: inset 0 0 0 3px #ef4444, 0 0 8px rgba(239,68,68,0.4) !important;
            background: rgba(239,68,68,0.15) !important;
            animation: conflict-pulse 1.5s ease-in-out infinite;
        }
        .matrix-gap {
            box-shadow: inset 0 0 0 3px #f59e0b !important;
            background: rgba(245,158,11,0.1) !important;
        }
        .matrix-duplicate {
            box-shadow: inset 0 0 0 3px #8b5cf6 !important;
            background: rgba(139,92,246,0.1) !important;
        }
        @keyframes conflict-pulse {
            0%, 100% { box-shadow: inset 0 0 0 3px #ef4444, 0 0 8px rgba(239,68,68,0.4); background: rgba(239,68,68,0.15); }
            50% { box-shadow: inset 0 0 0 4px #ff6b6b, 0 0 14px rgba(239,68,68,0.6); background: rgba(239,68,68,0.25); }
        }
        
        /* v24.9.4: Swap mode - highlight selected cell */
        .matrix-swap-selected {
            box-shadow: inset 0 0 0 3px #22d3ee, 0 0 8px rgba(34,211,238,0.4) !important;
            background: rgba(34, 211, 238, 0.15) !important;
            animation: swap-pulse 1.5s ease-in-out infinite;
        }
        .matrix-slide-selected {
            box-shadow: inset 0 0 0 3px #8b5cf6, 0 0 8px rgba(139,92,246,0.4) !important;
            background: rgba(139, 92, 246, 0.2) !important;
        }
        @keyframes swap-pulse {
            0%, 100% { box-shadow: inset 0 0 0 3px #22d3ee, 0 0 8px rgba(34,211,238,0.4); }
            50% { box-shadow: inset 0 0 0 4px #67e8f9, 0 0 14px rgba(34,211,238,0.6); }
        }
        
        /* v24.9.4: What-If mode - highlight staged changes */
        .matrix-whatif-staged {
            box-shadow: inset 0 0 0 3px #a78bfa, 0 0 6px rgba(167,139,250,0.3) !important;
            background: rgba(167, 139, 250, 0.15) !important;
            font-style: italic;
        }
        
        .matrix-cell.view-only {
            cursor: pointer;
        }
        
        .matrix-cell.view-only:hover::after {
            content: '👁️';
            position: absolute;
            right: 2px;
            top: 2px;
            font-size: 10px;
            opacity: 0.6;
        }
        
        .view-only-banner {
            background: linear-gradient(135deg, #f59e0b22, #d9770622);
            border: 1px solid #f59e0b44;
            border-radius: 8px;
            padding: 12px 16px;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 13px;
        }
        
        .view-only-banner strong {
            color: var(--accent-gold);
        }
        
        .schedule-cell {
            background: var(--bg-card);
            padding: 8px 10px;
            font-size: 12px;
            min-height: 38px;
            display: flex;
            align-items: center;
            line-height: 1.3;
            white-space: nowrap;
        }
        
        .schedule-header {
            background: var(--bg-table-header);
            font-weight: 700;
            text-transform: uppercase;
            font-size: 10px;
            color: var(--text-muted);
            justify-content: center;
            text-align: center;
            position: sticky;
            top: 0;
            z-index: 10;
            flex-direction: column;
            padding: 8px 6px;
            min-width: 85px;
        }
        
        .schedule-header:first-child {
            position: sticky;
            left: 0;
            top: 0;
            z-index: 30;
            min-width: 180px;
            background: var(--bg-table-header);
        }
        
        .schedule-name {
            position: sticky;
            left: 0;
            background: var(--bg-card);
            z-index: 15;
            font-weight: 600;
            font-size: 12px;
            padding: 8px 12px;
            min-width: 180px;
            max-width: 180px;
            overflow: hidden;
            text-overflow: ellipsis;
            box-shadow: 2px 0 4px rgba(0,0,0,0.15);
        }
        
        .schedule-assignment {
            cursor: pointer;
            justify-content: center;
            text-align: center;
            transition: all 0.2s;
            font-size: 12px;
            padding: 8px 10px;
            min-width: max-content;
        }
        
        .schedule-assignment:hover { background: var(--bg-table-hover); }
        .schedule-inactive { background: var(--bg-table-hover); opacity: 0.3; cursor: default !important; }
        .schedule-inactive:hover { background: var(--bg-table-hover); }
        
        /* Phase colors: Beginner=Green, Intermediate=Yellow, Final=Red, Classroom=Blue */
        .phase-beginner { background: #dcfce7 !important; color: #166534 !important; font-weight: 600; }
        .phase-intermediate { background: #fef3c7 !important; color: #92400e !important; font-weight: 600; }
        .phase-final { background: #fee2e2 !important; color: #991b1b !important; font-weight: 600; }
        .phase-classroom { background: #dbeafe !important; color: #1e40af !important; font-weight: 600; }
        

        /* v23.2 Quick Win: Trainee Avatar */
        .trainee-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0; }
        .trainee-avatar-sm { width: 28px; height: 28px; font-size: 11px; }
        
        /* v23.2 Quick Win: Status Dot */
        .status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
        .status-dot.active { background: var(--success); }
        .status-dot.completed { background: var(--info); }
        .status-dot.on_hold { background: var(--warning); }
        .status-dot.at-risk { background: var(--danger); }
        .status-dot.normal { background: var(--success); }
        
        /* v23.2 Quick Win: Conflict Badge */
        .nav-badge-danger { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; }
        
        /* v23.2 Quick Win: Floating Shortcut Button */
        .shortcut-fab { position: fixed; bottom: 20px; right: 20px; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-gold); color: #000; border: none; font-size: 18px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.3); z-index: 999; display: flex; align-items: center; justify-content: center; transition: transform 0.15s; }
        .shortcut-fab:hover { transform: scale(1.1); }
        @media (max-width: 768px) { .shortcut-fab { bottom: 70px; } }
        
        /* v23.2 Notification Center */
        .notif-bell { position: relative; cursor: pointer; font-size: 20px; padding: 4px 8px; }
        .notif-bell .notif-count { position: absolute; top: -2px; right: 0; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 10px; min-width: 16px; text-align: center; }
        .notif-dropdown { position: absolute; top: 100%; right: 0; width: 380px; max-height: 480px; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); z-index: 1000; display: none; }
        .notif-dropdown.show { display: block; }
        .notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background 0.1s; }
        .notif-item:hover { background: var(--bg-table-hover); }
        .notif-item.unread { border-left: 3px solid var(--accent-gold); }
        .notif-item .notif-title { font-weight: 600; font-size: 13px; }
        .notif-item .notif-msg { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
        .notif-item .notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
        .notif-priority-warning .notif-title { color: var(--warning); }
        .notif-priority-danger .notif-title { color: var(--danger); }
        .content-topbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; margin: -16px -24px 16px -24px; background: var(--bg-card); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 50; }
        @media (max-width: 768px) { .content-topbar { margin: -10px -10px 10px -10px; padding: 8px 12px; } .content-topbar span[style*="Ctrl"] { display: none; } }
        .notif-priority-critical { border-left-color: var(--danger) !important; }
        .notif-priority-important { border-left-color: var(--warning) !important; }
        
        /* v23.2 Timeline/Gantt */
        .gantt-container { overflow-x: auto; padding: 0; }
        .gantt-row { display: flex; align-items: center; border-bottom: 1px solid var(--border-color); min-height: 36px; }
        .gantt-row:hover { background: var(--bg-table-hover); }
        .gantt-label { width: 180px; min-width: 180px; padding: 6px 12px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 0; background: var(--bg-card); z-index: 2; border-right: 1px solid var(--border-color); }
        .gantt-bars { flex: 1; position: relative; height: 36px; min-width: 800px; }
        .gantt-bar { position: absolute; height: 22px; top: 7px; border-radius: 4px; font-size: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; cursor: pointer; transition: opacity 0.15s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
        .gantt-bar:hover { opacity: 0.85; }
        .gantt-bar.phase-b { background: #16a34a; }
        .gantt-bar.phase-i { background: #d97706; }
        .gantt-bar.phase-f { background: #dc2626; }
        .gantt-bar.phase-c { background: #2563eb; }
        .gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent-gold); z-index: 1; }
        .gantt-header { display: flex; border-bottom: 2px solid var(--border-color); font-size: 11px; color: var(--text-muted); }
        .gantt-header-cell { text-align: center; border-right: 1px solid var(--border-color); padding: 4px 0; }
        .gantt-class-header { background: var(--bg-table-header); padding: 8px 12px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--border-color); cursor: pointer; display: flex; align-items: center; gap: 8px; }
        .gantt-class-header:hover { background: var(--bg-table-hover); }
        
        /* v23.2 Trainee Dashboard */
        .td-header { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
        .td-avatar { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: #fff; flex-shrink: 0; }
        .td-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
        .td-stat { padding: 16px; background: var(--bg-table-hover); border-radius: 8px; text-align: center; }
        .td-stat-value { font-size: 28px; font-weight: 700; }
        .td-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
        .td-timeline { display: flex; gap: 2px; margin-bottom: 24px; flex-wrap: wrap; }
        .td-week { width: 40px; height: 40px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; cursor: pointer; border: 2px solid transparent; }
        .td-week.current { border-color: var(--accent-gold); }
        .td-week.completed { opacity: 1; }
        .td-week.future { opacity: 0.5; }
        
        /* v23.2 Graduation Tracker */
        .grad-class { margin-bottom: 24px; }
        .grad-bar-container { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
        .grad-name { width: 150px; min-width: 150px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .grad-bar { flex: 1; height: 24px; background: var(--border-color); border-radius: 4px; overflow: hidden; position: relative; }
        .grad-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; font-size: 11px; font-weight: 600; color: #fff; transition: width 0.3s; }
        .grad-pct { width: 45px; text-align: right; font-size: 13px; font-weight: 600; }
        
        /* v23.2 What-If Mode */
        .whatif-banner { background: linear-gradient(90deg, #7c3aed, #6d28d9); color: #fff; padding: 10px 20px; border-radius: 8px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
        .whatif-badge { background: rgba(255,255,255,0.2); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
        
        /* v23.2 Matrix keyboard nav */
        .matrix-cell.kb-selected { outline: 2px solid var(--accent-gold) !important; outline-offset: -2px; z-index: 1; position: relative; }
        .matrix-cell.kb-editing { background: var(--bg-input) !important; }
        

        /* v23.3 Drag-and-Drop */
        .matrix-cell.drag-over { outline: 2px dashed var(--accent-gold) !important; background: rgba(255,193,7,0.15) !important; }
        .matrix-cell.dragging { opacity: 0.5; }
        .matrix-cell[draggable="true"] { cursor: grab; }
        .matrix-cell[draggable="true"]:active { cursor: grabbing; }
        .swap-preview { position: fixed; z-index: 9999; padding: 12px 16px; background: var(--bg-card); border: 2px solid var(--accent-gold); border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); font-size: 13px; pointer-events: none; max-width: 280px; }
        .swap-preview .swap-arrow { color: var(--accent-gold); font-weight: 700; margin: 4px 0; }
        
        /* v23.3 Inline Cell Editing */
        .inline-cell-dropdown { position: absolute; z-index: 100; background: var(--bg-card); border: 1px solid var(--accent-gold); border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.2); max-height: 200px; overflow-y: auto; min-width: 180px; }
        .inline-cell-dropdown .icd-item { padding: 6px 10px; cursor: pointer; font-size: 12px; border-bottom: 1px solid var(--border-color); }
        .inline-cell-dropdown .icd-item:hover, .inline-cell-dropdown .icd-item.highlighted { background: var(--accent-gold); color: #000; }
        .inline-cell-dropdown .icd-search { width: 100%; padding: 6px 10px; border: none; border-bottom: 1px solid var(--border-color); background: var(--bg-input); color: var(--text-primary); font-size: 12px; outline: none; }
        
        /* v23.3 Dashboard Mini Calendar */
        .mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 11px; }
        .mini-cal-day { text-align: center; padding: 4px 2px; border-radius: 4px; cursor: pointer; position: relative; }
        .mini-cal-day.today { background: var(--accent-gold); color: #000; font-weight: 700; }
        .mini-cal-day.has-activity { font-weight: 600; }
        .mini-cal-day .cal-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--success); position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%); }
        .mini-cal-day.selected { background: var(--accent-blue) !important; color: #fff; font-weight: 700; }
        .mini-cal-header { font-weight: 700; color: var(--text-muted); text-align: center; padding: 2px; }
        
        /* v23.3 Instructor Matrix */
        .inst-matrix { overflow-x: auto; }
        .inst-matrix table { border-collapse: collapse; width: 100%; font-size: 12px; }
        .inst-matrix th, .inst-matrix td { padding: 6px 8px; border: 1px solid var(--border-color); text-align: center; min-width: 80px; }
        .inst-matrix th { background: var(--bg-table-header); font-weight: 600; white-space: nowrap; }
        .inst-matrix td.specialized { background: rgba(34,197,94,0.15); }
        .inst-matrix td.assigned { background: rgba(59,130,246,0.2); font-weight: 600; }
        .inst-matrix .inst-name { text-align: left; font-weight: 600; white-space: nowrap; position: sticky; left: 0; background: var(--bg-card); z-index: 1; min-width: 140px; }
        
        /* v23.3 Import Wizard */
        .import-wizard { max-width: 800px; }
        .import-step { display: none; }
        .import-step.active { display: block; }
        .import-steps-nav { display: flex; gap: 0; margin-bottom: 24px; }
        .import-steps-nav .step-indicator { flex: 1; padding: 10px; text-align: center; font-size: 13px; font-weight: 600; border-bottom: 3px solid var(--border-color); color: var(--text-muted); }
        .import-steps-nav .step-indicator.active { border-bottom-color: var(--accent-gold); color: var(--text-primary); }
        .import-steps-nav .step-indicator.done { border-bottom-color: var(--success); color: var(--success); }
        .column-map-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
        .column-map-row label { width: 120px; font-weight: 600; font-size: 13px; }
        .column-map-row select { flex: 1; }
        
        /* v23.3 Utilization Chart */
        .util-bar-container { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
        .util-bar-label { width: 140px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .util-bar { flex: 1; height: 18px; background: var(--border-color); border-radius: 4px; overflow: hidden; }
        .util-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
        .util-bar-value { width: 40px; text-align: right; font-size: 12px; font-weight: 600; }

        /* v23.2 Print Styles */
        @media print {
            .sidebar, .shortcut-fab, .btn, .header-actions, .nav-section, .app-footer, .mobile-menu-btn { display: none !important; }
            .main-content { margin-left: 0 !important; padding: 10px !important; }
            .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
            .page-header { margin-bottom: 10px !important; }
            body { background: white !important; color: black !important; font-size: 12px !important; }
            .progress-bar { border: 1px solid #ddd; }
            .progress-fill { background: #333 !important; }
            .badge { border: 1px solid #999; }
            .matrix-table { font-size: 9px; }
            .matrix-cell { padding: 2px !important; }
        }

        [data-theme="dark"] .phase-beginner { background: #14532d !important; color: #86efac !important; }
        [data-theme="dark"] .phase-intermediate { background: #78350f !important; color: #fcd34d !important; }
        [data-theme="dark"] .phase-final { background: #7f1d1d !important; color: #fca5a5 !important; }
        [data-theme="dark"] .phase-classroom { background: #1e3a5f !important; color: #93c5fd !important; }
        
        .hidden { display: none !important; }
        
        .theme-toggle { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; }
        .toggle-switch {
            width: 44px;
            height: 24px;
            background: #333;
            border-radius: 12px;
            position: relative;
            transition: background 0.3s;
        }
        .toggle-switch::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 20px;
            height: 20px;
            background: white;
            border-radius: 50%;
            transition: transform 0.3s;
        }
        .toggle-switch.active { background: var(--accent-gold); }
        .toggle-switch.active::after { transform: translateX(20px); }
        
        .filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
        .filter-input { width: 250px; }
        .filter-select { width: 150px; }
        
        .loading {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 40px;
            color: var(--text-muted);
        }
        
        /* Mobile menu toggle button */
        .mobile-menu-toggle {
            display: none;
            position: fixed;
            top: 12px;
            left: 10px;
            z-index: 1001;
            background: var(--accent-gold);
            color: #000;
            border: none;
            padding: 10px 14px;
            border-radius: 8px;
            font-size: 20px;
            cursor: pointer;
            box-shadow: 0 2px 8px rgba(0,0,0,0.3);
        }
        
        /* Safe-area aware positioning for notched/Dynamic Island devices */
        @supports (top: env(safe-area-inset-top)) {
            .mobile-menu-toggle {
                top: calc(12px + env(safe-area-inset-top));
            }
        }
        
        /* Hide menu button when not logged in */
        body.not-logged-in .mobile-menu-toggle { display: none !important; }
        
        .mobile-menu-toggle:hover {
            background: var(--accent-gold-light);
        }
        
        /* Tablet styles (768px - 1024px) */
        @media (max-width: 1024px) {
            .sidebar { width: 200px; }
            .main-content { margin-left: 200px; max-width: calc(100vw - 200px); }
            .app-footer { left: 200px; }
            .stats-grid { grid-template-columns: repeat(2, 1fr); }
            .schedule-grid { font-size: 10px; }
            .schedule-cell { font-size: 9px; padding: 2px 3px; }
            .filter-select { width: 120px; }
        }
        
        /* Mobile styles (< 768px) */
        @media (max-width: 768px) {
            .mobile-menu-toggle { display: block; }
            
            .sidebar { 
                display: none;
                position: fixed;
                top: 0;
                left: 0;
                width: 280px;
                height: 100vh;
                z-index: 1000;
                transform: translateX(-100%);
                transition: transform 0.3s ease;
            }
            
            .sidebar.mobile-open {
                display: flex;
                transform: translateX(0);
            }
            
            .mobile-overlay {
                display: none;
                position: fixed;
                top: 0;
                left: 0;
                width: 100vw;
                height: 100vh;
                background: rgba(0,0,0,0.5);
                z-index: 999;
            }
            
            .mobile-overlay.active { display: block; }
            
            .main-content { 
                margin-left: 0; 
                padding: 12px 12px 80px 12px;
                padding-top: calc(12px + env(safe-area-inset-top, 0px));
                max-width: 100vw;
            }
            
            .app-footer { left: 0; height: auto; min-height: 44px; flex-direction: column; padding: 8px 16px; gap: 2px; text-align: center; }
            .app-footer .footer-copyright { font-size: 10px; line-height: 1.3; }
            .app-footer span { font-size: 10px; }
            
            .form-grid { grid-template-columns: 1fr; }
            
            .stats-grid { 
                grid-template-columns: 1fr; 
                gap: 10px;
            }
            
            .stat-card {
                padding: 12px;
            }
            
            .stat-value { font-size: 24px; }
            
            .page-header { 
                flex-direction: column; 
                gap: 12px; 
                align-items: flex-start;
            }
            
            .page-header .flex { 
                flex-wrap: wrap; 
                gap: 8px; 
                width: 100%;
            }
            
            .btn { 
                padding: 10px 16px; 
                font-size: 14px;
            }
            
            .filter-group { 
                flex-wrap: wrap; 
                gap: 8px;
            }
            
            .filter-select { 
                width: 100%; 
                min-width: 0;
            }
            
            /* Schedule matrix horizontal scroll */
            .card-body {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
            
            .schedule-grid { 
                font-size: 9px; 
                min-width: 800px;
            }
            
            .schedule-cell {
                padding: 4px 2px;
                font-size: 8px;
            }
            
            .schedule-cell.schedule-assignment { 
                font-size: 8px; 
                padding: 2px; 
            }
            
            /* Table responsive */
            .data-table {
                display: block;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
            
            .action-btn {
                padding: 8px 10px;
            }
            
            /* Modal responsive */
            .modal-content {
                width: 95%;
                max-width: none;
                margin: 10px;
                max-height: 90vh;
            }
            
            .modal-body {
                max-height: 60vh;
                overflow-y: auto;
            }
        }
        
        /* Small mobile (< 480px) */
        @media (max-width: 480px) {
            .main-content { padding: 55px 8px 68px 8px; }
            
            .page-header h1 { font-size: 20px; }
            
            .stats-grid { gap: 8px; }
            
            .stat-card { padding: 10px; }
            .stat-value { font-size: 20px; }
            .stat-label { font-size: 11px; }
            
            .btn { 
                padding: 8px 12px; 
                font-size: 13px;
            }
            
            .schedule-grid { min-width: 600px; }
        }
        
        /* UX-07: Print styles */
        @media print {
            .app-layout { display: block !important; }
            .sidebar, .content-topbar, .app-footer, .mobile-menu-toggle,
            .mobile-overlay, .btn, .action-btn, .notif-bell, .filter-bar,
            .nav-group, #toastContainer { display: none !important; }
            .main-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
            .card { break-inside: avoid; border: 1px solid #ddd !important; box-shadow: none !important; }
            .data-table { font-size: 11px; }
            .data-table th { background: #f0f0f0 !important; color: #000 !important; -webkit-print-color-adjust: exact; }
            .page-title { font-size: 18px; color: #000 !important; }
            body { background: #fff !important; color: #000 !important; }
            * { color-adjust: exact !important; -webkit-print-color-adjust: exact !important; }
        }
        
        /* UX-05: Loading overlay */
        .loading-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5); display: flex; align-items: center;
            justify-content: center; z-index: 10000;
        }
        .loading-spinner {
            width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.3);
            border-top-color: var(--accent-gold); border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .loading-overlay .loading-text {
            color: #fff; margin-top: 12px; font-size: 14px; text-align: center;
        }
        
        /* UX-03: Danger confirmation dialog */
        .confirm-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6); display: flex; align-items: center;
            justify-content: center; z-index: 10001;
        }
        .confirm-dialog {
            background: var(--bg-card); border-radius: 12px; padding: 24px;
            max-width: 420px; width: 90%; border: 1px solid var(--border-color);
            box-shadow: 0 20px 60px rgba(0,0,0,0.4);
        }
        .confirm-dialog h3 { margin: 0 0 12px; font-size: 16px; }
        .confirm-dialog p { margin: 0 0 16px; font-size: 13px; color: var(--text-muted); line-height: 1.5; }
        .confirm-dialog .confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }
        .confirm-dialog .btn-danger { background: #dc2626; color: #fff; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; }
        .confirm-dialog .btn-cancel { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-color); padding: 8px 16px; border-radius: 6px; cursor: pointer; }
        .confirm-dialog input.confirm-input {
            width: 100%; padding: 8px 12px; border-radius: 6px;
            background: var(--bg-input); border: 1px solid var(--border-color);
            color: var(--text-primary); margin-bottom: 12px; font-size: 13px;
        }
        
        /* v24.9.4: iOS safe area support */
        @supports (padding-bottom: env(safe-area-inset-bottom)) {
            .app-footer { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
            @media (max-width: 768px) {
                .main-content { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
                .sidebar { padding-top: env(safe-area-inset-top); }
            }
        }
        
        /* v24.10.5: Device-specific overrides via JS detection */
        @media (max-width: 768px) {
            /* Android devices */
            body.device-android .mobile-menu-toggle { top: calc(8px + env(safe-area-inset-top, 0px)); }
            body.device-android .main-content { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
            
            /* iOS without notch (iPhone 8 and older) */
            body.device-ios .mobile-menu-toggle { top: calc(12px + env(safe-area-inset-top, 20px)); }
            body.device-ios .main-content { padding-top: calc(12px + env(safe-area-inset-top, 20px)); }
            
            /* Notched iPhones (X, XS, 11, 12, 13, 14) */
            body.device-notch .mobile-menu-toggle { top: calc(14px + env(safe-area-inset-top, 44px)); }
            body.device-notch .main-content { padding-top: calc(14px + env(safe-area-inset-top, 44px)); }
            
            /* Dynamic Island devices (iPhone 14 Pro+, 15, 16) */
            body.device-dynamic-island .mobile-menu-toggle { top: calc(14px + env(safe-area-inset-top, 54px)); }
            body.device-dynamic-island .main-content { padding-top: calc(14px + env(safe-area-inset-top, 54px)); }
        }
        
        /* v24.10.5: PWA standalone mode — HIGHEST PRIORITY
           In standalone (no Safari chrome), env() safe areas may report differently.
           These use higher specificity to ensure they win. */
        @media (max-width: 768px) and (display-mode: standalone) {
            .mobile-menu-toggle { top: calc(14px + env(safe-area-inset-top, 20px)) !important; }
            .main-content { padding-top: calc(14px + env(safe-area-inset-top, 20px)) !important; }
            .app-footer { 
                padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
            }
        }
        /* iOS standalone detection (navigator.standalone = true, older iOS) */
        @media (max-width: 768px) {
            body.is-pwa .mobile-menu-toggle { top: calc(14px + env(safe-area-inset-top, 20px)) !important; }
            body.is-pwa .main-content { padding-top: calc(14px + env(safe-area-inset-top, 20px)) !important; }
            body.is-pwa .app-footer {
                padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
            }
            /* PWA + notched iPhone */
            body.is-pwa.device-notch .mobile-menu-toggle { top: calc(14px + env(safe-area-inset-top, 44px)) !important; }
            body.is-pwa.device-notch .main-content { padding-top: calc(14px + env(safe-area-inset-top, 44px)) !important; }
            /* PWA + Dynamic Island */
            body.is-pwa.device-dynamic-island .mobile-menu-toggle { top: calc(14px + env(safe-area-inset-top, 54px)) !important; }
            body.is-pwa.device-dynamic-island .main-content { padding-top: calc(14px + env(safe-area-inset-top, 54px)) !important; }
            /* PWA footer — stacked layout */
            body.is-pwa .app-footer { height: auto; min-height: 44px; flex-direction: column; padding: 8px 16px; gap: 2px; text-align: center; }
        }
        
        /* v24.9.4: Better touch targets for mobile */
        @media (max-width: 768px) {
            .nav-item { min-height: 44px; display: flex; align-items: center; }
            .form-input, .form-select { min-height: 44px; font-size: 16px; }
            .conv-item { min-height: 60px; }
            input[type="checkbox"] { min-width: 20px; min-height: 20px; }
        }

/* v24.11.0: Dashboard drag-drop and Weekly Overview scroll */
.dashboard-tile.dragging { opacity: 0.4; }
.dashboard-tile.drag-over { outline: 2px dashed var(--accent-blue); outline-offset: 4px; }


/* v24.11.1: Weekly Overview fixed header layout */
.main-content.so-layout {
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    padding-bottom: 0 !important;
}
.so-fixed-header {
    flex-shrink: 0;
    padding-bottom: 12px;
}
.so-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 4px 80px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.so-scroll-area::-webkit-scrollbar { width: 6px; }
.so-scroll-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.so-scroll-area::-webkit-scrollbar-track { background: transparent; }


/* ============================================
   DISTRICT SELECTOR (Phase 2)
   ============================================ */
.district-selector {
    padding: 4px 12px 8px;
}
.district-selector select {
    width: 100%;
    padding: 6px 28px 6px 8px;
    border: 1px solid var(--border-color, #3a3f4b);
    border-radius: 6px;
    background: var(--bg-secondary, #1e2028);
    color: var(--text-primary, #e4e6eb);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M3 4.5L6 8l3-3.5H3z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.district-selector select:hover {
    border-color: var(--accent-blue, #0065B3);
}
.district-selector select:focus {
    outline: none;
    border-color: var(--accent-blue, #0065B3);
    box-shadow: 0 0 0 2px rgba(0, 101, 179, 0.25);
}
.district-label {
    padding: 4px 12px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    letter-spacing: 0.5px;
}

/* District reduced-permission badge */
.district-role-badge {
    padding: 2px 8px;
    margin: 0 12px 6px;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* District color tags */
.district-tag { display:inline-block; padding:1px 6px; border-radius:3px; font-size:10px; font-weight:700; letter-spacing:0.5px; margin-right:4px; color:#fff; vertical-align:middle; }
.district-breakdown-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:12px; }
.district-breakdown-card { border-radius:8px; padding:14px 16px; border-left:4px solid; background:var(--card-bg); transition:transform 0.15s; }
.district-breakdown-card:hover { transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,0.15); }
.district-breakdown-card h4 { margin:0 0 8px; font-size:14px; }
.dbc-stats { display:flex; gap:16px; font-size:12px; color:var(--text-muted); }
.dbc-stat-val { font-weight:700; font-size:16px; color:var(--text-primary); display:block; }
