        :root {
            --primary: #ea580c;
            --primary-dark: #c2410c;
            --accent-blue: #2563eb;
            --accent-orange: #ea580c;
            --accent-orange-light: #ffedd5;
            --accent-rust: #C04A3A;
            --accent-rust-dark: #9a3a2e;
            --accent-yellow: #F5C518;
            --accent-yellow-dark: #d4a810;
            --bg: #fffbf5;
            --surface: #ffffff;
            --text: #1e293b;
            --text-muted: #64748b;
            --border: #e7e5e4;
            --radius: 0;
            --shadow: 0 4px 20px rgba(234, 88, 12, 0.08);
            --status-safe: #16a34a;
            --status-critical: #ea580c;
            --status-overdue: #dc2626;
            --status-warning: #ca8a04;
            --status-approaching: #2563eb;
            --success: var(--status-safe);
            --danger: var(--status-overdue);
        }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
        #serverOfflineBanner { display: none; background: #fef3c7; color: #92400e; padding: 10px 20px; text-align: center; font-weight: 600; border-bottom: 1px solid #fcd34d; }
        .container { max-width: 1400px; margin: 0 auto; padding: 20px; }
        
        /* Header Styles */
        .header { 
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
            padding: 25px;
            border-radius: 10px;
            margin-bottom: 25px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .header h1 { font-size: 2.2em; margin-bottom: 8px; }
        .header p { opacity: 0.9; font-size: 1.1em; }

        /* Navigation */
        .nav {
            display: flex;
            background: var(--surface); 
            border-radius: 10px; 
            margin-bottom: 25px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            overflow: hidden;
        }
        .nav button {
            flex: 1; 
            background: none; 
            border: none;
            padding: 18px; 
            color: #2c3e50; 
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            border-bottom: 3px solid transparent;
        }
        .nav button:hover { 
            background: var(--bg); 
            color: var(--primary);
        }
        .nav button.active { 
            background: #ffffff;
            color: #4a8fc8;
            border-bottom-color: #5b9fd4;
        }
        .card { 
            background: var(--surface); 
            padding: 25px;
            border-radius: 10px; 
            box-shadow: 0 2px 10px rgba(0,0,0,0.08); 
            margin-bottom: 25px;
            border-left: 4px solid var(--primary);
        }
        .card h2 { color: var(--primary); margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }
        .card h3 { color: var(--primary); margin-bottom: 15px; }

        /* Alert Styles */
        .alert { 
            background: #e74c3c; 
            color: white; 
            padding: 15px; 
            border-radius: 6px; 
            margin: 10px 0; 
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .alert.warning { background: #fffbeb; color: #92400e; }
        .alert.info { background: #eff6ff; color: #1e40af; }
        .alert.success { background: #f0fdf4; color: #166534; }
        
        /* Form Styles */
        .form-group { margin-bottom: 20px; }
        label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text); }
        input, select, textarea { 
            width: 100%; 
            padding: 12px; 
            border: 2px solid #dcdfe6; 
            border-radius: 6px; 
            font-size: 14px;
            transition: border-color 0.3s;
        }
        input:focus, select:focus, textarea:focus {
            border-color: var(--primary);
            outline: none;
            box-shadow: 0 0 0 3px rgba(61, 69, 102, 0.12);
        }
        .form-row { display: flex; gap: 15px; }
        .form-row .form-group { flex: 1; }
        
        /* Button Styles */
        button { 
            background: var(--primary); 
            color: white; 
            padding: 12px 25px; 
            border: none; 
            border-radius: 6px; 
            cursor: pointer; 
            font-weight: 600;
            transition: all 0.3s ease;
        }
        button:hover { 
            background: var(--primary-dark); 
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }
        button.secondary { background: #95a5a6; }
        button.secondary:hover { background: #7f8c8d; }
        button.danger { background: #e74c3c; }
        button.danger:hover { background: #c0392b; }
        button.success { background: var(--status-safe); }
        button.success:hover { background: #15803d; }
        button.warning:not(.maint-summary-box) { background: var(--status-critical); color: var(--text); }
        button.warning:not(.maint-summary-box):hover { background: #d97706; }
        
        /* Tab Content */
        .tab { display: none; }
        .tab.active { display: block; animation: fadeIn 0.5s ease; }
        
        /* Stats Grid */
        .stats { 
            display: grid; 
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px; 
            margin-bottom: 25px; 
        }
        .stat-card { 
            background: var(--surface); 
            padding: 20px; 
            border-radius: 8px; 
            text-align: center; 
            box-shadow: 0 2px 10px rgba(0,0,0,0.08);
            border-top: 4px solid var(--primary);
        }
        .stat-value { font-size: 2em; font-weight: bold; color: var(--primary); margin: 10px 0; }
        .stat-label { color: #7f8c8d; font-size: 0.9em; text-transform: uppercase; letter-spacing: 1px; }
        
        /* Table Styles */
        table { 
            width: 100%; 
            border-collapse: collapse; 
            margin-top: 15px;
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0,0,0,0.08);
        }
        th, td { 
            padding: 15px; 
            text-align: left; 
            border-bottom: 1px solid #ecf0f1; 
        }
        th { 
            background: var(--primary);
            color: white; 
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-size: 0.9em;
        }
        tr:hover { background: #f8f9fa; }
        
        /* Action Buttons */
        .action-buttons { display: flex; gap: 8px; }
        .btn-small { padding: 6px 12px; font-size: 0.85em; }
        
        /* Improved Modal Styles */
        .modal { 
            display: none; 
            position: fixed; 
            z-index: 10050 !important; 
            left: 0; top: 0; 
            width: 100%; height: 100%; 
            background: rgba(0,0,0,0.5);
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding: max(12px, env(safe-area-inset-top)) 8px max(12px, env(safe-area-inset-bottom));
        }
        .modal-content {
            background: white;
            margin: 0 auto 16px;
            padding: 0;
            border-radius: 10px;
            width: 90%;
            max-width: 700px;
            min-width: min(320px, 96vw);
            min-height: min(220px, 60dvh);
            max-height: calc(100vh - 32px);
            max-height: calc(100dvh - 32px);
            overflow: hidden;
            position: relative;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            display: flex;
            flex-direction: column;
        }
        .modal-resizable {
            position: relative;
        }
        .modal-resize-handle {
            position: absolute;
            z-index: 6;
            background: transparent;
        }
        .modal-resize-n,
        .modal-resize-s {
            left: 10px;
            right: 10px;
            height: 8px;
            cursor: ns-resize;
        }
        .modal-resize-n { top: -3px; }
        .modal-resize-s { bottom: -3px; }
        .modal-resize-e,
        .modal-resize-w {
            top: 10px;
            bottom: 10px;
            width: 8px;
            cursor: ew-resize;
        }
        .modal-resize-e { right: -3px; }
        .modal-resize-w { left: -3px; }
        .modal-header {
            padding: 20px 30px;
            border-bottom: 2px solid #ecf0f1;
            flex-shrink: 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .modal-body {
            padding: 20px 30px;
            overflow-x: auto;
            overflow-y: auto;
            scrollbar-gutter: stable;
            flex: 1 1 auto;
            min-height: 0;
            -webkit-overflow-scrolling: touch;
        }
        .modal-footer {
            padding: 20px 30px;
            border-top: 2px solid #ecf0f1;
            background: white;
            flex-shrink: 0;
            position: sticky;
            bottom: 0;
            z-index: 2;
        }
        /* Persistent scrollbars + horizontal scroll in modal panels/tables */
        .modal .scrollable-table-wrap,
        .modal .table-responsive,
        .modal .timesheet-clock-wrap,
        .modal .timesheet-view-table-wrap,
        .modal .receive-parts-scroll {
            overflow-x: scroll;
            overflow-y: auto;
            scrollbar-gutter: stable;
            max-width: 100%;
        }
        .modal-body::-webkit-scrollbar,
        .modal .scrollable-table-wrap::-webkit-scrollbar,
        .modal .table-responsive::-webkit-scrollbar,
        .modal .timesheet-clock-wrap::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }
        .modal-body::-webkit-scrollbar-thumb,
        .modal .scrollable-table-wrap::-webkit-scrollbar-thumb,
        .modal .table-responsive::-webkit-scrollbar-thumb,
        .modal .timesheet-clock-wrap::-webkit-scrollbar-thumb {
            background: #b8bcc4;
            border-radius: 5px;
        }
        .modal-body::-webkit-scrollbar-track,
        .modal .scrollable-table-wrap::-webkit-scrollbar-track,
        .modal .table-responsive::-webkit-scrollbar-track,
        .modal .timesheet-clock-wrap::-webkit-scrollbar-track {
            background: #eef0f3;
        }
        .close { 
            font-size: 28px; 
            font-weight: bold; 
            cursor: pointer; 
            color: #7f8c8d;
            transition: color 0.3s;
        }
        .close:hover { color: #e74c3c; }
        
        /* Animation */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        /* Utility Classes */
        .text-center { text-align: center; }
        .text-right { text-align: right; }
        .mt-20 { margin-top: 20px; }
        .mb-20 { margin-bottom: 20px; }
        .hidden { display: none; }
        
        /* Login Styles */
        body:not(.app-logged-in) {
            overflow: hidden;
            height: 100vh;
        }
        body:not(.app-logged-in) #mainApp,
        body:not(.app-logged-in) #userInfoBar {
            display: none !important;
        }
        .login-container {
            display: flex;
            justify-content: center;
            align-items: center;
            position: fixed;
            inset: 0;
            z-index: 10000;
            min-height: 100vh;
            overflow-y: auto;
            background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
        }
        .login-card {
            background: white;
            padding: 40px;
            border-radius: 15px;
            box-shadow: 0 15px 35px rgba(0,0,0,0.1);
            width: 100%;
            max-width: 400px;
            margin: 24px 16px;
        }
        .login-hint {
            margin-top: 14px;
            font-size: .82em;
            color: #7f8c8d;
            text-align: center;
        }

        /* Role Badges */
        .role-badge {
            padding: 3px 8px;
            border-radius: 12px;
            font-size: 0.8em;
            font-weight: bold;
            text-transform: uppercase;
        }
        .role-badge.admin { background: var(--primary); color: white; }
        .role-badge.supervisor { background: #3498db; color: white; }
        .role-badge.operator { background: #95a5a6; color: white; }
        
        /* Responsive */
        @media (max-width: 768px) {
            .form-row { flex-direction: column; }
            .stats { grid-template-columns: 1fr; }
            .action-buttons { flex-direction: column; }
            td.action-buttons,
            .scrollable-table-wrap .action-buttons,
            .table-responsive .action-buttons,
            #inventoryList .action-buttons,
            #requisitionsList .action-buttons,
            #reportContent .action-buttons,
            .hrm-panel-full .action-buttons {
                flex-direction: row;
                flex-wrap: wrap;
                gap: 4px;
            }
            .modal-content { width: 95%; max-width: 95%; resize: none; }
            .modal-body { padding: 15px 20px; }
            .modal-header, .modal-footer { padding: 15px 20px; }
            .container { padding: 12px !important; }
            .card { padding: 16px !important; }
            .card-header-row { flex-direction: column; align-items: flex-start; }
            .edit-equipment-footer-main { margin-left: 0; width: 100%; justify-content: flex-end; }
        }

        /* Parts Selection Styles */
        .part-row {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
            align-items: center;
        }
        .part-row select, .part-row input {
            flex: 1;
        }
        .repair-part-row {
            flex-wrap: wrap;
            align-items: flex-start;
        }
        .repair-part-row .repair-part-source {
            flex: 0 0 100%;
            max-width: 220px;
        }
        .repair-part-inventory-fields,
        .repair-part-custom-fields {
            display: flex;
            flex: 1 1 100%;
            gap: 8px;
            min-width: 0;
        }
        .repair-part-inventory-fields select,
        .repair-part-custom-fields input {
            flex: 1;
            min-width: 0;
        }
        @media (max-width: 640px) {
            .repair-part-row {
                flex-direction: column;
            }
            .repair-part-row .repair-part-source {
                max-width: none;
                width: 100%;
            }
            .repair-part-inventory-fields,
            .repair-part-custom-fields {
                flex-direction: column;
                width: 100%;
            }
        }
        .stock-info {
            font-size: 0.8em;
            color: #7f8c8d;
            margin-top: 5px;
        }

        /* Maintenance Alert Styles */
        .maintenance-alert {
            background: #fff3cd;
            border: 1px solid #ffeaa7;
            color: #856404;
            padding: 12px;
            border-radius: 6px;
            margin: 10px 0;
        }
        .maintenance-critical {
            background: #f8d7da;
            border: 1px solid #f5c6cb;
            color: #721c24;
        }
        /* Action buttons in tables */
        .action-buttons {
            display: flex;
            gap: 5px;
            flex-wrap: wrap;
        }

        .action-buttons .btn-small {
            padding: 4px 8px;
            font-size: 0.75em;
            white-space: nowrap;
        }

        /* Ensure tables have enough space for actions */
        table td:last-child {
            min-width: 120px;
        }

        /* Maintenance Due Dates Summary Cards */
        .maintenance-summary-card {
            background: white;
            padding: 15px;
            border-radius: 8px;
            text-align: center;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

        .maintenance-summary-card.overdue { border-left: 4px solid var(--status-overdue); }
        .maintenance-summary-card.critical { border-left: 4px solid var(--status-critical); }
        .maintenance-summary-card.warning { border-left: 4px solid var(--accent-yellow); }
        .maintenance-summary-card.ontrack { border-left: 4px solid var(--status-safe); }

        .maintenance-summary-value {
            font-size: 1.8em;
            font-weight: bold;
            margin: 5px 0;
        }

        .maintenance-summary-label {
            font-size: 0.9em;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Maintenance Filter Button Styles */
        .maintenance-filter-btn {
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .maintenance-filter-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        .maintenance-filter-btn.active {
            box-shadow: 0 0 0 3px rgba(255,255,255,0.5);
            transform: scale(1.05);
        }

        /* Maintenance Card Styles */
        .maintenance-card {
            transition: all 0.3s ease;
        }

        .maintenance-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }

        /* Unit badges for inventory */
        .unit-badge {
            display: inline-block;
            padding: 2px 6px;
            background: #3498db;
            color: white;
            border-radius: 10px;
            font-size: 0.7em;
            font-weight: bold;
            margin-left: 5px;
        }

        /* Equipment Details Styles */
        .equipment-details-container {
            max-height: 70vh;
            overflow-y: auto;
            padding-right: 10px;
        }

        .detail-row {
            padding: 8px 0;
            border-bottom: 1px solid #e0e0e0;
        }

        .detail-row:last-child {
            border-bottom: none;
        }

        .equipment-details-container::-webkit-scrollbar {
            width: 8px;
        }

        .equipment-details-container::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 4px;
        }

        .equipment-details-container::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 4px;
        }

        .equipment-details-container::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }

        /* Modal enhancements */
        .modal-content {
            animation: modalSlideIn 0.3s ease-out;
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: translateY(-50px) scale(0.9);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        /* Enhanced Maintenance Alerts Styles */
        .alerts-container {
            max-height: 400px;
            overflow-y: auto;
            padding-right: 10px;
        }

        .alert-card {
            background: white;
            border-radius: 10px;
            padding: 15px;
            margin-bottom: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            border-left: 5px solid var(--primary);
            transition: all 0.3s ease;
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }

        .alert-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        .alert-card.critical {
            border-left-color: #e74c3c;
            background: linear-gradient(135deg, #fff 0%, #ffeaea 100%);
        }

        .alert-card.warning {
            border-left-color: var(--status-critical);
            background: linear-gradient(135deg, #fff 0%, #fff4e6 100%);
        }

        .alert-card.info {
            border-left-color: #3498db;
            background: linear-gradient(135deg, #fff 0%, #e8f4fd 100%);
        }

        .alert-card.success {
            border-left-color: #27ae60;
            background: linear-gradient(135deg, #fff 0%, #e8f6ef 100%);
        }

        .alert-icon {
            font-size: 1.5em;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .alert-content {
            flex: 1;
        }

        .alert-title {
            font-weight: bold;
            margin-bottom: 5px;
            color: #2c3e50;
            font-size: 1em;
        }

        .alert-message {
            color: #5d6d7e;
            font-size: 0.9em;
            line-height: 1.4;
        }

        .alert-meta {
            display: flex;
            gap: 15px;
            margin-top: 8px;
            font-size: 0.8em;
            color: #7f8c8d;
        }

        .alert-meta-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .alert-actions {
            display: flex;
            gap: 8px;
            margin-top: 10px;
        }

        .no-alerts-card {
            background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
            color: white;
            border-radius: 10px;
            padding: 30px 20px;
            text-align: center;
            box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
        }

        .no-alerts-icon {
            font-size: 3em;
            margin-bottom: 15px;
        }

        .no-alerts-title {
            font-size: 1.2em;
            font-weight: bold;
            margin-bottom: 8px;
        }

        .no-alerts-message {
            opacity: 0.9;
            font-size: 0.9em;
        }

        /* Scrollbar styling for alerts container */
        .alerts-container::-webkit-scrollbar {
            width: 6px;
        }

        .alerts-container::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        .alerts-container::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 3px;
        }

        .alerts-container::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }

        /* Inventory Card Styles */
        .inventory-card {
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .inventory-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        /* Table responsive — horizontal scroll on narrow viewports */
        .table-responsive {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            max-width: 100%;
        }

        /* Multi-select styling */
        select[multiple] {
            background: white;
            border: 2px solid #dcdfe6;
            border-radius: 6px;
        }

        select[multiple]:focus {
            border-color: var(--primary);
            outline: none;
            box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
        }
        /* Requisition Card Styles */
        .requisition-card {
            transition: all 0.3s ease;
        }

        .requisition-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        /* Receiving item styles */
        .receiving-item {
            transition: background-color 0.3s ease;
        }

        .receiving-item:hover {
            background-color: #f8f9fa;
        }

        .btn-small.danger {
            background-color: #e74c3c;
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.8em;
            transition: background-color 0.3s;
        }

        .btn-small.danger:hover {
            background-color: #c0392b;
        }

        .danger {
            background-color: #e74c3c;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .danger:hover {
            background-color: #c0392b;
        }

        .selected-part-item {
            transition: all 0.3s ease;
        }

        .selected-part-item:hover {
            background: #f0f0f0 !important;
            border-color: #3498db !important;
        }

        .btn-small {
            padding: 6px 10px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.8em;
            border: none;
            transition: background-color 0.3s;
        }

        .btn-small:hover {
            opacity: 0.9;
        }

        @keyframes slideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        @keyframes slideOut {
            from { transform: translateX(0); opacity: 1; }
            to { transform: translateX(100%); opacity: 0; }
        }

        .slide-in {
            animation: slideIn 0.3s ease-out;
        }

        .slide-out {
            animation: slideOut 0.3s ease-in;
        }

        /* Optional: Add smooth transitions for modal appearances */
        .modal-content {
            transition: all 0.3s ease;
        }

        /* Modern dialog styles */
        .modal-content {
            animation: slideIn 0.3s ease-out;
        }

        .modal-header {
            background: var(--primary) !important;
            color: white;
            padding: 20px;
            border-radius: 8px 8px 0 0;
        }

        .modal-header h3 {
            color: white;
            margin: 0;
        }

        .modal-body {
            padding: 25px;
            background: #f8f9fa;
        }

        .modal-footer {
            display: flex;
            gap: 10px;
            padding: 20px;
            background: white;
            border-radius: 0 0 8px 8px;
            border-top: 1px solid #eee;
            flex-shrink: 0;
            position: sticky;
            bottom: 0;
            z-index: 2;
        }

        .modal-footer button {
            padding: 12px 20px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 1em;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .modal-footer button:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }
        .btn-small {
            padding: 6px 12px !important;
            font-size: 0.85em !important;
            margin: 2px !important;
        }

        .admin-controls .btn-small {
            background: #34495e !important;
            border: 1px solid #4a6572 !important;
        }

        .admin-controls .btn-small:hover {
            background: #4a6572 !important;
            transform: translateY(-1px) !important;
        }

        @keyframes slideInRight {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        @keyframes toastEnter {
            from { transform: translateX(calc(100% + 24px)); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        @keyframes toastLeave {
            from { transform: translateX(0); opacity: 1; }
            to { transform: translateX(calc(100% + 24px)); opacity: 0; }
        }

        @keyframes toastProgress {
            from { transform: scaleX(1); }
            to { transform: scaleX(0); }
        }

        .machify-toast-container {
            position: fixed;
            top: max(16px, env(safe-area-inset-top));
            right: max(16px, env(safe-area-inset-right));
            z-index: 10200;
            display: flex;
            flex-direction: column;
            gap: 10px;
            width: min(380px, calc(100vw - 32px));
            pointer-events: none;
        }

        .machify-toast {
            pointer-events: auto;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 14px 14px 12px;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.97);
            border: 1px solid rgba(15, 23, 42, 0.08);
            box-shadow:
                0 16px 40px rgba(15, 23, 42, 0.14),
                0 4px 12px rgba(15, 23, 42, 0.08);
            backdrop-filter: blur(10px);
            animation: toastEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .machify-toast.is-leaving {
            animation: toastLeave 0.28s ease forwards;
        }

        .machify-toast-icon {
            flex: 0 0 28px;
            width: 28px;
            height: 28px;
            border-radius: 999px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.82rem;
            font-weight: 700;
            line-height: 1;
        }

        .machify-toast-body {
            flex: 1;
            min-width: 0;
        }

        .machify-toast-message {
            margin: 2px 0 8px;
            color: #0f172a;
            font-size: 0.92rem;
            line-height: 1.45;
            font-weight: 500;
        }

        .machify-toast-progress {
            display: block;
            height: 3px;
            border-radius: 999px;
            transform-origin: left center;
            animation: toastProgress linear forwards;
            opacity: 0.85;
        }

        .machify-toast-close {
            flex: 0 0 auto;
            width: 28px;
            height: 28px;
            padding: 0;
            border: none !important;
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.06) !important;
            color: #64748b !important;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            cursor: pointer;
            box-shadow: none !important;
            transition: background 0.15s ease, color 0.15s ease;
        }

        .machify-toast-close svg {
            display: block;
        }

        .machify-toast-close:hover {
            background: rgba(15, 23, 42, 0.1) !important;
            color: #0f172a !important;
            transform: none !important;
            box-shadow: none !important;
        }

        button.machify-toast-close,
        button.machify-toast-close:hover {
            padding: 0 !important;
            min-width: 28px !important;
            font-weight: 400 !important;
        }

        .machify-toast-success .machify-toast-icon {
            background: #dcfce7;
            color: #15803d;
        }
        .machify-toast-success .machify-toast-progress { background: #22c55e; }

        .machify-toast-error .machify-toast-icon {
            background: #fee2e2;
            color: #b91c1c;
        }
        .machify-toast-error .machify-toast-progress { background: #ef4444; }

        .machify-toast-warning .machify-toast-icon {
            background: #fef3c7;
            color: #b45309;
        }
        .machify-toast-warning .machify-toast-progress { background: #f59e0b; }

        .machify-toast-info .machify-toast-icon {
            background: #dbeafe;
            color: #1d4ed8;
        }
        .machify-toast-info .machify-toast-progress { background: #3b82f6; }

        .custom-notification {
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        }

        /* Dropdown Styles */
        .dropdown {
            position: relative;
            display: inline-block;
        }

        .dropdown-content {
            display: none;
            position: absolute;
            background: #2d2d2d;
            min-width: 160px;
            box-shadow: 0 8px 16px rgba(0,0,0,0.3);
            z-index: 1000;
            border: 1px solid #404040;
            border-radius: 6px;
            overflow: hidden;
            margin-top: 5px;
            right: 0;
        }

        .dropdown-content a {
            color: #e0e0e0;
            padding: 10px 15px;
            text-decoration: none;
            display: block;
            border-bottom: 1px solid #404040;
            cursor: pointer;
            transition: background 0.3s;
            font-size: 0.9em;
        }

        .dropdown-content a:hover {
            background: var(--primary);
            color: white;
        }

        .dropdown-content a:last-child {
            border-bottom: none;
        }

        .dropdown:hover .dropdown-content {
            display: block;
        }

        .dropdown-header {
            padding: 8px 15px;
            background: #404040;
            color: var(--accent-yellow);
            font-weight: bold;
            font-size: 0.8em;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .dropdown-divider {
            height: 1px;
            background: #404040;
            margin: 5px 0;
        }

        /* Dropdown Styles - Fixed */
        .dropdown {
            position: relative;
            display: inline-block;
        }

        .dropdown-content {
            display: none;
            position: absolute;
            background: #2d2d2d;
            min-width: 220px;
            box-shadow: 0 8px 25px rgba(0,0,0,0.5);
            z-index: 1001;
            border: 1px solid #404040;
            border-radius: 8px;
            overflow: hidden;
            top: 100%;
            right: 0;
            margin-top: 5px;
        }

        .dropdown-content a {
            color: #e0e0e0;
            padding: 12px 16px;
            text-decoration: none;
            display: block;
            border-bottom: 1px solid #404040;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.9em;
            background: none;
            border: none;
            width: 100%;
            text-align: left;
        }

        .dropdown-content a:hover {
            background: var(--primary);
            color: white;
            transform: translateX(5px);
        }

        .dropdown-content a:last-child {
            border-bottom: none;
        }

        .dropdown:hover .dropdown-content {
            display: block;
        }

        .dropdown-header {
            padding: 10px 16px;
            background: #404040;
            color: var(--accent-yellow);
            font-weight: bold;
            font-size: 0.8em;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 1px solid #505050;
        }

        .dropdown-divider {
            height: 1px;
            background: #505050;
            margin: 0;
        }

        /* Make sure dropdown stays on top */
        .modal {
            z-index: 10050 !important;
        }

        .dropdown-content {
            z-index: 1002;
        }

        /* Modal button styles */
        .modal-body .btn-small {
            padding: 12px 8px !important;
            font-size: 0.9em !important;
            margin: 0 !important;
            border: 1px solid #404040 !important;
            transition: all 0.3s ease !important;
        }

        .modal-body .btn-small:hover {
            transform: translateY(-2px) !important;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
        }

        /* Grid layout for buttons */
        .modal-body .btn-small {
            display: flex !important;
            flex-direction: column !important;
            align-items: center !important;
            justify-content: center !important;
            gap: 5px !important;
            min-height: 60px !important;
        }

        /* Admin-only styling */
        .admin-only {
            display: none;
        }

        .current-user-admin .admin-only {
            display: block;
        }

        .current-user-supervisor .admin-only {
            display: block;
        }

        .maintenance-summary-card {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 8px;
            padding: 15px;
            text-align: center;
            margin: 5px 0;
        }
        .maintenance-summary-card.urgent {
            border-color: #e74c3c;
            background: #fdf2f2;
        }
        .maintenance-count {
            font-size: 2em;
            font-weight: bold;
            color: #2c3e50;
        }
        .maintenance-label {
            color: #6c757d;
            font-size: 0.9em;
        }
        .urgent-count {
            color: #e74c3c;
            font-size: 0.8em;
            margin-top: 5px;
        }

        /* For Option 2 */
        .maintenance-quick-stats {
            display: flex;
            gap: 10px;
            justify-content: center;
        }
        .maintenance-quick-stats .stat {
            text-align: center;
            padding: 10px;
            background: #f8f9fa;
            border-radius: 6px;
            flex: 1;
        }
        .maintenance-quick-stats .stat.overdue {
            background: #fdf2f2;
            color: #e74c3c;
        }
        .maintenance-quick-stats .number {
            font-size: 1.5em;
            font-weight: bold;
            display: block;
        }
        .maintenance-quick-stats .label {
            font-size: 0.8em;
        }
        /* Option 1: Donut Chart */
        .maintenance-chart { text-align: center; }
        .chart-container { position: relative; display: inline-block; margin-bottom: 10px; }
        .donut-chart {
            width: 80px; height: 80px; border-radius: 50%;
        }
        .chart-center {
            position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
            text-align: center;
        }
        .total-count { font-weight: bold; font-size: 1.2em; }
        .total-label { font-size: 0.7em; color: #6c757d; }
        .chart-legend { font-size: 0.8em; }
        .legend-item { display: flex; align-items: center; margin: 3px 0; }
        .color-dot {
            width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px;
        }
        .urgent-dot { background: #e74c3c; }
        .warning-dot { background: #f39c12; }
        .normal-dot { background: #27ae60; }

        /* Option 2: Mini Bar Chart */
        .mini-bar-chart { text-align: center; }
        .chart-title { font-size: 0.9em; margin-bottom: 8px; color: #6c757d; }
        .bars-container { display: flex; justify-content: space-between; align-items: end; height: 70px; }
        .bar-column { display: flex; flex-direction: column; align-items: center; flex: 1; }
        .bar {
            background: #3498db;
            width: 12px;
            border-radius: 2px;
            position: relative;
            transition: height 0.3s ease;
        }
        .bar-count {
            position: absolute;
            top: -20px;
            font-size: 0.7em;
            font-weight: bold;
            width: 100%;
            text-align: center;
        }
        .day-label { font-size: 0.7em; margin-top: 3px; color: #6c757d; }
        .chart-summary { font-size: 0.8em; margin-top: 5px; color: #6c757d; }

        /* Option 3: Progress Ring */
        .progress-ring-chart { text-align: center; }
        .ring-container { position: relative; display: inline-block; }
        .ring-center {
            position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
            text-align: center;
        }
        .ring-percent { font-weight: bold; font-size: 1.1em; }
        .ring-label { font-size: 0.7em; color: #6c757d; }
        .ring-stats {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 8px;
        }
        .ring-stats .stat { text-align: center; }
        .ring-stats .stat-number { font-weight: bold; font-size: 1.1em; }
        .ring-stats .stat-label { font-size: 0.7em; color: #6c757d; }

        .dashboard-kpi { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
        .dashboard-kpi-secondary { margin-top: -10px; margin-bottom: 25px; }
        .stat-card.kpi-primary, .stat-card.kpi-warning, .stat-card.kpi-info, .stat-card.kpi-success {
            display: flex; flex-direction: column; align-items: flex-start; padding: 24px;
            border-radius: var(--radius); box-shadow: var(--shadow); border-top: 4px solid var(--accent);
        }
        .stat-card.kpi-warning { border-top-color: #f59e0b; }
        .stat-card.kpi-info { border-top-color: #3b82f6; }
        .stat-card.kpi-success { border-top-color: var(--success); }
        .stat-icon { font-size: 1.8em; margin-bottom: 8px; opacity: 0.9; }
        .chart-empty { text-align: center; padding: 40px; color: var(--text-muted); }
        /* ============================================================
           MODEST LIGHT THEME
           ============================================================ */
        :root {
            --m-bg: #fffbf5;
            --m-surface: #ffffff;
            --m-text: #1e293b;
            --m-muted: #64748b;
            --m-border: #e7e5e4;
            --m-accent: #ea580c;
            --m-accent-light: #ffedd5;
            --m-tab-blue: #5b9fd4;
            --m-tab-blue-dark: #4a8fc8;
            --m-tab-blue-light: #e8f4fc;
            --m-radius: 0;
            --m-radius-sm: 0;
            --m-shadow-sm: 0 1px 3px rgba(234, 88, 12, 0.08);
            --m-success: #16a34a;
            --m-warning: #ca8a04;
            --m-danger: #dc2626;
            --status-safe: #16a34a;
            --status-critical: #ea580c;
            --status-overdue: #dc2626;
            --status-warning: #ca8a04;
            --status-approaching: #2563eb;
        }

        html, body { height: auto; min-height: 100%; }
        body.app-logged-in {
            overflow-x: hidden;
            overflow-y: auto;
            height: auto;
            min-height: 100vh;
        }
        .app-shell {
            display: flex !important;
            flex-direction: column !important;
            min-height: 100vh !important;
            height: auto !important;
            max-height: none !important;
            overflow: visible !important;
            padding-bottom: 32px !important;
            margin-bottom: 0 !important;
        }
        .app-shell.container,
        #mainApp.container {
            padding: 8px 16px 0 !important;
        }
        .app-chrome {
            flex-shrink: 0;
            position: sticky;
            top: 0;
            z-index: 200;
            background: var(--m-bg);
            padding-bottom: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .app-top-bar {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            gap: 10px 16px;
            flex-wrap: nowrap;
            background: var(--m-surface);
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius);
            padding: 6px 12px;
            margin-bottom: 6px;
            box-shadow: var(--m-shadow-sm);
        }
        .app-top-bar .header {
            order: 0;
            flex: 0 0 auto;
            min-width: 0;
            margin-bottom: 0 !important;
            padding: 0 !important;
            border: none !important;
            box-shadow: none !important;
            background: transparent !important;
        }
        .app-top-bar .header h1 {
            font-size: 1.12em !important;
            margin: 0 !important;
            white-space: nowrap;
        }
        .app-brand-row {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
        }
        .app-brand-logo-wide {
            height: 34px;
            width: auto;
            max-width: 124px;
            object-fit: contain;
            flex-shrink: 0;
            display: block;
        }
        .app-brand-row .app-brand-badge {
            flex-shrink: 0;
            align-self: center;
        }
        .app-brand-name-fallback {
            font-size: 1.05em;
            font-weight: 700;
            color: var(--m-text);
            margin-right: 4px;
        }
        .header.app-brand .app-brand-tagline {
            margin-top: 4px;
        }
        .login-brand-block {
            margin-bottom: 30px;
        }
        .login-brand-logo-wide {
            width: min(100%, 175px);
            height: auto;
            aspect-ratio: 175 / 48;
            object-fit: contain;
            margin: 0 auto 14px;
            display: block;
        }
        .login-brand-block:not(:has(.login-logo-missing)) .login-title-fallback {
            display: none;
        }
        .machify-processing-overlay {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 100000;
            background: rgba(15, 23, 42, 0.45);
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .machify-processing-overlay.active {
            display: flex;
        }
        .machify-processing-card {
            background: var(--m-surface, #fff);
            border: 1px solid var(--m-border, #e5e7eb);
            border-radius: 12px;
            padding: 24px 28px;
            box-shadow: var(--m-shadow-md, 0 8px 24px rgba(0,0,0,.12));
            text-align: center;
            min-width: 200px;
        }
        .machify-processing-spinner {
            width: 36px;
            height: 36px;
            margin: 0 auto 12px;
            border: 3px solid #e5e7eb;
            border-top-color: var(--m-accent, #ea580c);
            border-radius: 50%;
            animation: machify-spin 0.75s linear infinite;
        }
        @keyframes machify-spin {
            to { transform: rotate(360deg); }
        }
        .machify-processing-message {
            margin: 0;
            font-size: 0.95em;
            color: var(--m-text, #1f2937);
        }
        body.machify-processing-active .modal-footer button,
        body.machify-processing-active .modal-footer button[type="submit"] {
            pointer-events: none;
            opacity: 0.55;
        }
        .inventory-storage-hint {
            display: block;
            margin-top: 4px;
            font-size: 0.78em;
            color: #6366f1;
            font-weight: 500;
            line-height: 1.3;
        }
        .issue-part-disposition-wrap .radio-inline {
            display: block;
            margin: 6px 0;
        }
        .form-label-block {
            display: block;
            font-weight: 600;
            margin-bottom: 6px;
        }
        .project-create-row {
            align-items: flex-end;
            gap: 12px;
            margin-bottom: 16px;
        }
        .project-create-action button {
            width: 100%;
        }
        .project-management-list input.project-edit-name,
        .project-management-list input.project-edit-prefix {
            width: 100%;
            max-width: 220px;
        }
        .app-brand-tagline {
            display: block;
            font-size: 0.72em;
            color: var(--m-muted);
            margin: 2px 0 0;
            line-height: 1.2;
            white-space: nowrap;
        }
        .app-brand-badge {
            background: var(--m-accent-light) !important;
            color: var(--m-accent) !important;
            padding: 2px 8px !important;
            border-radius: 12px !important;
            font-size: 0.72em !important;
            margin-left: 6px !important;
            font-weight: 700 !important;
        }
        .app-top-bar .user-info-bar {
            order: 1;
            flex: 1 1 auto;
            min-width: 0;
            justify-content: flex-end;
            padding: 0 !important;
            margin: 0 0 0 auto !important;
            border: none !important;
            box-shadow: none !important;
            background: transparent !important;
            gap: 12px;
        }
        .app-main-scroll {
            flex: 1 1 auto;
            overflow: visible;
            min-height: 0;
            padding-bottom: 24px;
        }

        body {
            font-family: 'Inter', 'Segoe UI', system-ui, sans-serif !important;
            background: var(--m-bg) !important;
            color: var(--m-text) !important;
        }
        .container { max-width: 1280px; padding: 24px 20px 40px !important; }
        #mainApp.container { padding: 8px 16px 0 !important; }

        /* Header — clean white bar */
        .header {
            background: var(--m-surface) !important;
            color: var(--m-text) !important;
            border-radius: var(--m-radius) !important;
            padding: 10px 18px !important;
            margin-bottom: 0 !important;
            box-shadow: var(--m-shadow-sm) !important;
            border: 1px solid var(--m-border) !important;
        }
        .header h1 { font-size: 1.45em !important; margin-bottom: 2px !important; }
        .header p { font-size: .88em !important; margin: 0 !important; }
        .header::after { display: none; }
        .header h1 { font-size: 1.6em !important; font-weight: 700 !important; color: var(--m-text) !important; }
        .header h1 span { color: var(--m-accent) !important; font-weight: 800; }
        .header p { color: var(--m-muted) !important; }

        /* Navigation — white bar, soft blue labels */
        .nav {
            background: #fff !important;
            border-radius: var(--m-radius) !important;
            border: 1px solid var(--m-border) !important;
            box-shadow: var(--m-shadow-sm) !important;
            padding: 3px !important;
            margin-bottom: 0 !important;
            gap: 2px;
            overflow-x: auto !important;
        }
        .nav button {
            border-radius: var(--m-radius-sm) !important;
            padding: 8px 12px !important;
            color: var(--m-tab-blue) !important;
            background: #fff !important;
            border: 1px solid transparent !important;
            font-size: .88em !important;
            font-weight: 500 !important;
            white-space: nowrap;
        }
        .nav button:hover {
            background: var(--m-tab-blue-light) !important;
            color: var(--m-tab-blue-dark) !important;
        }
        .nav button.active {
            background: #fff !important;
            color: var(--m-tab-blue-dark) !important;
            font-weight: 600 !important;
            border-color: var(--m-border) !important;
            box-shadow: inset 0 -3px 0 var(--m-tab-blue) !important;
        }

        button.accent {
            background: var(--m-accent) !important;
            color: #fff !important;
            border: none !important;
        }
        button.accent:hover { background: #c2410c !important; }

        /* Cards */
        .card {
            background: var(--m-surface) !important;
            border: 1px solid var(--m-border) !important;
            border-left: 3px solid var(--m-accent) !important;
            border-radius: var(--m-radius) !important;
            box-shadow: none !important;
            padding: 20px !important;
            margin-bottom: 12px !important;
        }
        .card h2, .card h3, .card h4 { color: var(--m-text) !important; font-weight: 600 !important; }
        .card-subtitle { color: var(--m-muted); font-size: .85em; margin: 0 0 12px; }
        .card-header-row {
            display: flex; justify-content: space-between; align-items: center;
            gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
        }
        .card-header-row h3 { margin: 0 !important; }
        .card-header-actions { display: flex; gap: 6px; flex-wrap: wrap; }
        .filter-panel {
            background: #f9fafb !important;
            border: 1px solid var(--m-border) !important;
            border-radius: var(--m-radius-sm) !important;
            padding: 14px !important;
            margin-bottom: 16px !important;
        }
        .filter-panel h4 { color: var(--m-text) !important; font-size: .95em !important; margin-bottom: 10px !important; }

        /* Buttons — neutral default */
        button {
            border-radius: var(--m-radius-sm) !important;
            font-weight: 500 !important;
            font-size: .9em !important;
        }
        button:not(.secondary):not(.danger):not(.success):not(.info):not(.warning):not(.maint-summary-box):not(.cal-day):not(.equip-summary-box):not(.inventory-view-tab):not(.requisition-stat):not(.nav-mobile-toggle):not(.report-type-btn):not(.settings-menu-toggle):not(.settings-menu-item):not(.nav-tab-btn):not(.hrm-subnav-btn):not(.timesheet-day-toggle):not(.timesheet-mode-btn):not(.machify-toast-close):not(.login-forgot-link):not(.login-password-toggle) {
            background: var(--m-accent) !important;
            color: #fff !important;
            border: none !important;
        }
        /* Nav tabs & filter chips must stay neutral (global button rule above is too broad) */
        .nav button {
            background: #fff !important;
            color: var(--m-tab-blue) !important;
            border: 1px solid transparent !important;
        }
        .nav button:hover {
            background: var(--m-tab-blue-light) !important;
            color: var(--m-tab-blue-dark) !important;
        }
        .nav button.active {
            background: #fff !important;
            color: var(--m-tab-blue-dark) !important;
            border-color: var(--m-border) !important;
            box-shadow: inset 0 -3px 0 var(--m-tab-blue) !important;
        }
        .equip-summary-box,
        .inventory-view-tab,
        .requisition-stat {
            background: var(--m-surface) !important;
            color: var(--m-text) !important;
            border: 1px solid var(--m-border) !important;
        }
        .equip-summary-box.active,
        .inventory-view-tab.active,
        .requisition-stat.active-filter {
            background: var(--m-surface) !important;
            color: var(--m-text) !important;
        }
        .nav-mobile-toggle {
            background: #fff !important;
            color: var(--m-tab-blue) !important;
            border: 1px solid var(--m-border) !important;
        }
        .cal-day {
            background: #fff !important;
            color: var(--m-text) !important;
            border: 1px solid var(--m-border) !important;
        }
        .cal-day.empty {
            background: transparent !important;
            border: none !important;
        }
        .cal-day.has-maintenance.overdue { background: #fecaca !important; border-color: #ef4444 !important; color: #991b1b !important; }
        .cal-day.has-maintenance.critical { background: #fed7aa !important; border-color: #f97316 !important; color: #9a3412 !important; }
        .cal-day.has-maintenance.warning { background: #fef08a !important; border-color: #eab308 !important; color: #854d0e !important; }
        .cal-day.has-maintenance.approaching { background: #bfdbfe !important; border-color: #3b82f6 !important; color: #1e40af !important; }
        .cal-day.has-maintenance.on-track { background: #bbf7d0 !important; border-color: #22c55e !important; color: #166534 !important; }
        .maint-calendar-header .btn-small.secondary {
            background: #fff !important;
            color: var(--m-accent) !important;
            border: 1px solid var(--m-border) !important;
        }
        button.maint-summary-box {
            background: #fffbf5 !important;
            color: var(--m-text) !important;
            border: 1px solid var(--m-border) !important;
        }
        button.maint-summary-box:hover {
            background: #fff7ed !important;
        }
        button.success { background: var(--m-success) !important; color: #fff !important; border: none !important; }
        button.secondary { background: #fff !important; color: var(--m-accent) !important; border: 1px solid var(--m-accent) !important; }
        button.secondary:hover { background: var(--m-accent-light) !important; }
        button.danger { background: var(--m-danger) !important; color: #fff !important; border: none !important; }
        .btn-small { padding: 6px 11px !important; font-size: .8em !important; }

        /* Inputs */
        input, select, textarea {
            border: 1px solid var(--m-border) !important;
            border-radius: var(--m-radius-sm) !important;
            background: #fff !important;
            color: var(--m-text) !important;
        }
        input:focus, select:focus, textarea:focus {
            border-color: var(--m-accent) !important;
            box-shadow: 0 0 0 3px var(--m-accent-light) !important;
        }
        label { color: var(--m-text) !important; font-weight: 500 !important; font-size: .87em; }
        .period-select { max-width: 160px; padding: 6px 10px !important; font-size: .85em !important; }

        /* Tables — sticky headers inside scroll wrappers */
        table.sticky-header-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
        }
        th {
            background: #fff7ed !important;
            color: #78716c !important;
            font-size: .72em !important;
            font-weight: 600 !important;
            text-transform: uppercase;
        }
        table.sticky-header-table thead th {
            position: sticky;
            top: 0;
            z-index: 4;
            background: #fff7ed !important;
            box-shadow: 0 1px 0 var(--m-border);
        }
        td { color: var(--m-text); border-bottom: 1px solid #f3f4f6 !important; }
        tr:hover { background: #fffaf5 !important; }

        /* Scrollable panels — data tables & lists */
        .scrollable-panel,
        .scrollable-table-wrap,
        #inventoryList .table-responsive,
        #recordsList .scrollable-table-wrap,
        .alerts-container.scrollable-panel,
        .equipment-table-wrap.scrollable-table-wrap,
        .maint-equipment-list {
            max-height: min(52vh, 560px);
            overflow-y: auto;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        .scrollable-table-wrap,
        #inventoryList .table-responsive,
        .equipment-table-wrap.scrollable-table-wrap {
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            width: 100%;
            max-width: 100%;
        }
        .equipment-list-panel .scrollable-table-wrap {
            max-height: min(48vh, 520px);
        }
        .maint-equipment-list {
            flex: 1;
            min-height: 0;
            max-height: none;
        }

        /* Dashboard widgets */
        .chart-wrap { min-height: 200px; position: relative; }
        .chart-empty-msg {
            text-align: center; padding: 48px 16px; color: var(--m-muted); font-size: .9em;
        }
        .pending-req-list { display: flex; flex-direction: column; gap: 10px; }
        .pending-req-item {
            padding: 12px; border: 1px solid var(--m-border); border-radius: var(--m-radius-sm);
            background: #fafafa;
        }
        .pending-req-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
        .pending-req-meta { font-size: .82em; color: var(--m-muted); margin-top: 4px; }
        .no-alerts-card.modest {
            background: #f0fdf4 !important;
            color: var(--m-text) !important;
            box-shadow: none !important;
            border: 1px solid #bbf7d0;
            padding: 24px !important;
        }

        .records-summary {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 10px; margin-bottom: 14px; padding: 12px;
            background: #f9fafb; border: 1px solid var(--m-border); border-radius: var(--m-radius-sm);
        }
        .summary-stat { text-align: center; }
        .summary-stat-value { font-size: 1.3em; font-weight: 600; color: var(--m-text); }
        .summary-stat-label { font-size: .8em; color: var(--m-muted); }
        .inventory-stat {
            padding: 10px; border-radius: var(--m-radius-sm); text-align: center;
            border: 1px solid var(--m-border); background: var(--m-surface);
        }
        .inventory-stat-value { font-size: 1.15em; font-weight: 600; }
        .inventory-stat-label { font-size: .76em; color: var(--m-muted); }
        .inventory-stat.warning { border-top: 2px solid var(--m-warning); }
        .inventory-stat.danger { border-top: 2px solid var(--m-danger); }
        .inventory-stat.safe { border-top: 2px solid var(--m-success); }

        .empty-state { text-align: center; padding: 32px 16px; color: var(--m-muted); }

        /* Status badges */
        .role-badge { border-radius: 999px !important; padding: 3px 9px !important; font-size: .72em !important; font-weight: 600 !important; }
        .role-badge.active, .role-badge.completed, .role-badge.success { background: #dcfce7 !important; color: #15803d !important; }
        .role-badge.maintenance, .role-badge.warning, .role-badge.in-progress { background: #fef3c7 !important; color: #b45309 !important; }
        .role-badge.inactive, .role-badge.danger { background: #fee2e2 !important; color: #b91c1c !important; }

        /* Alerts on dashboard */
        .alert-card { border-left-width: 3px !important; box-shadow: none !important; border: 1px solid var(--m-border) !important; background: #fff !important; }
        .alert-card.critical { border-left-color: var(--status-overdue) !important; }
        .alert-card.warning { border-left-color: var(--status-critical) !important; }
        .alert-card.info { border-left-color: #9ca3af !important; }

        /* Modals & login */
        .modal { background: rgba(0,0,0,.35) !important; }
        .modal-header { background: var(--m-surface) !important; color: var(--m-text) !important; border-bottom: 1px solid var(--m-border) !important; }
        .modal-header h3 { color: var(--m-text) !important; }
        .modal-body { background: var(--m-bg) !important; }
        .login-container { background: #eef0f3 !important; }
        .login-card { border: 1px solid var(--m-border) !important; box-shadow: var(--m-shadow-sm) !important; }
        .login-card h1, .login-title { color: var(--m-text) !important; }
        #userInfoBar {
            background: transparent !important;
            color: var(--m-text) !important;
            border: none !important;
            box-shadow: none !important;
            margin-bottom: 0 !important;
        }
        .user-info-bar {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 12px;
            flex-wrap: nowrap;
        }
        .user-info-left {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
            min-width: 0;
        }
        .header-user-name {
            font-size: 0.85em;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 140px;
        }
        .header-role-badge {
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 0.72em;
            background: #f3f4f6 !important;
            color: var(--m-muted) !important;
            border: 1px solid var(--m-border);
            white-space: nowrap;
        }
        .project-switcher-wrap {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-shrink: 1;
            min-width: 0;
            position: relative;
            min-height: 44px;
        }
        /* project switcher — base layout in "Project switcher + session access" section below */
        .user-info-actions {
            display: flex;
            align-items: center;
            gap: 4px;
            flex-shrink: 0;
        }
        .btn-icon-only {
            padding: 5px 7px !important;
            min-width: 30px;
            line-height: 1.1;
            font-size: 1em !important;
        }
        .connection-status-indicator {
            display: none;
            align-items: center;
            justify-content: center;
            min-width: 30px;
            height: 30px;
            padding: 5px 7px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: #fff;
            flex-shrink: 0;
            cursor: default;
            box-sizing: border-box;
        }
        .connection-status-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #94a3b8;
            box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25);
        }
        .connection-status-indicator.level-online .connection-status-dot {
            background: #16a34a;
            box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
        }
        .connection-status-indicator.level-poor .connection-status-dot {
            background: #ca8a04;
            box-shadow: 0 0 0 2px rgba(202, 138, 4, 0.25);
        }
        .connection-status-indicator.level-offline .connection-status-dot {
            background: #dc2626;
            box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
        }
        .connection-status-indicator.level-local .connection-status-dot {
            background: #64748b;
            box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.2);
        }
        .maint-equipment-filter-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 0 0 12px;
            flex-wrap: wrap;
        }
        .maint-equipment-filter-row label {
            font-size: 0.85em;
            font-weight: 600;
            color: var(--m-text-muted, #64748b);
            margin: 0;
            white-space: nowrap;
        }
        .maint-equipment-filter-select {
            flex: 1;
            min-width: 160px;
            max-width: 420px;
            padding: 6px 10px !important;
            font-size: 0.88em !important;
        }
        .header-logout-btn:hover {
            background: #fef2f2 !important;
            border-color: var(--m-danger) !important;
            color: var(--m-danger) !important;
        }
        .header-icon-svg {
            display: block;
        }
        .checkbox-inline {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9em;
            font-weight: 500;
            cursor: pointer;
        }
        .part-equipment-multi-select {
            width: 100%;
            min-height: 160px;
            padding: 8px !important;
            font-size: 0.88em !important;
        }
        .part-equipment-assign-wrap .field-hint {
            margin: 4px 0 8px;
        }
        .settings-menu-wrap {
            position: relative;
        }
        .settings-menu-toggle {
            white-space: nowrap;
        }
        .settings-menu-dropdown {
            position: absolute;
            top: calc(100% + 4px);
            right: 0;
            min-width: 168px;
            background: #fff;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            box-shadow: var(--m-shadow-sm);
            padding: 4px;
            z-index: 400;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .settings-menu-dropdown[hidden] {
            display: none !important;
        }
        .settings-menu-item {
            display: block;
            width: 100%;
            text-align: left;
            padding: 8px 12px !important;
            background: #fff !important;
            color: var(--m-text) !important;
            border: none !important;
            border-radius: var(--m-radius-sm) !important;
            font-size: .88em !important;
            cursor: pointer;
        }
        .settings-menu-item:hover {
            background: var(--m-tab-blue-light) !important;
            color: var(--m-tab-blue-dark) !important;
        }
        #userInfoBar #currentUserRoleBadge,
        .header-role-badge {
            background: #f3f4f6 !important;
            color: var(--m-muted) !important;
            border: 1px solid var(--m-border);
        }

        .data-sync-banner {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 10px 16px;
            margin: 0 0 12px;
            padding: 10px 14px;
            border-radius: 8px;
            font-size: 0.88rem;
            border: 1px solid transparent;
        }
        .data-sync-banner.ok {
            background: #ecfdf5;
            border-color: #a7f3d0;
            color: #065f46;
        }
        .data-sync-banner.warning {
            background: #fffbeb;
            border-color: #fcd34d;
            color: #92400e;
        }
        .data-sync-banner.error {
            background: #fef2f2;
            border-color: #fecaca;
            color: #991b1b;
        }
        .data-sync-banner span { flex: 1 1 200px; }
        .server-connection-banner {
            margin: 0;
        }
        .db-tools-sync-panel {
            margin-bottom: 16px;
        }
        .db-tools-sync-panel:not(.ok):not(.warning):not(.error) {
            display: none;
        }

        .readonly-field {
            padding: 12px;
            border: 2px solid #e5e7eb;
            border-radius: 6px;
            background: #f9fafb;
            color: var(--m-text);
            font-weight: 500;
        }

        .nav-container {
            position: relative;
        }
        .nav-mobile-toggle {
            display: none;
            width: 100%;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 10px 14px !important;
            background: var(--m-surface) !important;
            border: 1px solid var(--m-border) !important;
            border-radius: var(--m-radius-sm) !important;
            color: var(--m-text) !important;
            font-weight: 600 !important;
        }
        .nav-mobile-icon {
            font-size: 1.1em;
            line-height: 1;
        }

        .modal-content-wide {
            max-width: 960px !important;
            min-width: min(480px, 96vw);
            min-height: min(320px, 65dvh);
        }
        .modal-content.modal-user-sized,
        .modal-content-wide.modal-user-sized {
            max-width: none !important;
        }
        .hrm-full-view-body {
            max-height: none;
        }
        .hrm-section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }
        .hrm-section-header h4 {
            margin: 0;
        }

        @media (max-width: 640px) {
            .nav-mobile-toggle { display: flex; }
            .nav {
                display: none;
                position: absolute;
                top: calc(100% + 4px);
                left: 0;
                right: 0;
                flex-direction: column;
                z-index: 300;
                background: var(--m-surface) !important;
                border: 1px solid var(--m-border) !important;
                border-radius: var(--m-radius-sm) !important;
                box-shadow: var(--m-shadow-sm) !important;
                padding: 6px !important;
                max-height: min(70vh, 420px);
                overflow-y: auto;
            }
            .nav.nav-open { display: flex; }
            .nav button {
                flex: none !important;
                width: 100%;
                text-align: left;
            }
            .app-top-bar {
                flex-wrap: wrap;
                align-items: stretch;
                padding: 8px 10px;
                gap: 8px;
            }
            .app-top-bar .header {
                flex: 1 1 100%;
                width: 100%;
            }
            .app-top-bar .header h1 {
                font-size: 0.95em !important;
                white-space: normal;
            }
            .app-top-bar .user-info-bar {
                flex: 1 1 100%;
                width: 100% !important;
                gap: 6px;
                flex-wrap: wrap;
                align-items: center;
                justify-content: space-between;
            }
            .user-info-left {
                order: 1;
                flex: 1 1 auto;
                min-width: 0;
            }
            .user-info-actions {
                order: 2;
                flex: 0 0 auto;
                width: auto !important;
                justify-content: flex-end;
            }
            .project-switcher-label,
            .project-current-label {
                display: flex;
                align-items: center;
                pointer-events: none;
                position: relative;
                z-index: 1;
            }
            .app-brand-tagline {
                display: none !important;
            }
            .app-brand-badge {
                display: none;
            }
            .header-user-name {
                max-width: none;
                font-size: 0.82em;
            }
            .header-role-badge {
                display: none;
            }
            .project-switcher-wrap {
                order: 3;
                flex: 1 1 100%;
                width: 100%;
                min-height: 44px;
                justify-content: flex-start;
                padding: 0 10px;
            }
            .project-switcher-select {
                position: absolute;
                inset: 0;
                width: 100%;
                height: 100%;
                max-width: none;
                min-width: 0;
                min-height: 44px;
                margin: 0;
                padding: 0 10px !important;
                opacity: 0;
                cursor: pointer;
                z-index: 2;
                -webkit-tap-highlight-color: transparent;
                font-size: 16px !important;
                -webkit-appearance: none;
                appearance: none;
            }
            #manageProjectsBtn {
                position: relative;
                z-index: 3;
                flex-shrink: 0;
                min-width: 44px;
                min-height: 44px;
                pointer-events: auto;
            }
            .dashboard-maint-calendar .maintenance-calendar { min-height: 150px; }
            .dashboard-maint-calendar .cal-day {
                font-size: .72em;
                min-height: 26px;
                aspect-ratio: auto;
            }
            .dashboard-maint-calendar .cal-weekdays,
            .dashboard-maint-calendar .cal-days { gap: 3px; }
            .dashboard-maint-calendar .maint-calendar-legend {
                font-size: .65em;
                gap: 6px;
                margin-bottom: 6px;
            }
            .dashboard-maint-calendar .maint-calendar-day-detail {
                min-height: 42px;
                font-size: .78em;
            }
            .dashboard-maint-card { min-height: auto !important; }
            .dashboard-bottom-row > .card { min-height: auto; }
            .maint-equipment-schedules {
                grid-template-columns: 1fr;
            }
            .user-info-left {
                flex-wrap: wrap;
            }
            .user-info-actions {
                width: 100%;
                justify-content: flex-end;
            }
            .equipment-filter-row .form-group { min-width: 100%; }
            .equipment-filter-actions { width: 100%; }
        }

        .maintenance-summary-card.overdue { border-left-color: var(--status-overdue) !important; }
        .maintenance-summary-card.critical { border-left-color: var(--status-critical) !important; }
        .maintenance-summary-card.ontrack { border-left-color: var(--status-safe) !important; }

        /* Dashboard layout */
        .dashboard-summary-strip {
            padding: 14px 20px !important;
            margin-bottom: 16px !important;
        }
        .dashboard-summary-strip h3 {
            margin-bottom: 10px !important;
            font-size: 1.05em !important;
        }
        .dashboard-utilization-card { margin-bottom: 16px !important; }

        /* Equipment summary — horizontal strip */
        .equip-summary-horizontal {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .equip-summary-horizontal .equip-summary-box {
            flex: 1 1 90px;
            min-width: 90px;
            max-width: 130px;
        }
        .equip-summary-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
            gap: 8px;
        }
        .equip-summary-box {
            text-align: center;
            padding: 12px 8px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: var(--m-surface);
            cursor: pointer;
            font: inherit;
            color: inherit;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .equip-summary-box:hover {
            border-color: #9ca3af;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
        }
        .equip-summary-box.active {
            border-color: var(--m-text);
            background: var(--m-surface);
            box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
        }
        .equip-summary-total.active {
            border-color: var(--m-text);
        }
        .equip-summary-count {
            display: block;
            font-size: 1.35em;
            font-weight: 700;
            color: var(--m-text);
            line-height: 1.2;
        }
        .equip-summary-label {
            display: block;
            font-size: .72em;
            color: var(--m-muted);
            margin-top: 4px;
            line-height: 1.25;
        }
        .equip-summary-total {
            background: var(--m-surface);
            border-color: var(--m-border);
        }
        .equip-summary-total .equip-summary-count { font-size: 1.5em; color: var(--m-text); }
        .equip-summary-inactive {
            border-color: #94a3b8;
            background: #f8fafc;
        }
        .equip-summary-inactive.active {
            border-color: #64748b;
            box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.2);
        }
        .equipment-type-group-header--inactive {
            color: #64748b;
        }

        .utilization-split {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 16px;
            min-height: 320px;
            max-height: 320px;
            align-items: stretch;
            overflow: hidden;
        }
        .dashboard-utilization-card .utilization-split {
            width: 100%;
        }
        .utilization-breakdown {
            max-height: 320px;
            min-height: 320px;
            height: 320px;
            min-width: 0;
            overflow-y: auto;
        }
        .utilization-charts-stack {
            display: flex;
            flex-direction: column;
            gap: 0;
            height: 320px;
            max-height: 320px;
            min-height: 320px;
            min-width: 0;
            overflow: hidden;
        }
        .utilization-charts-stack .utilization-chart-wrap {
            height: 160px;
            max-height: 160px;
            min-height: 160px;
            flex: 0 0 160px;
            overflow: hidden;
            padding: 8px 10px;
        }
        .utilization-charts-stack .utilization-chart-wrap + .utilization-chart-wrap {
            border-top: none;
            margin-top: 0;
        }
        .utilization-chart-half {
            flex: 0 0 160px;
            min-height: 160px;
            max-height: 160px;
            height: 160px;
        }
        .utilization-chart-wrap {
            position: relative;
            min-height: 260px;
            height: 320px;
            border: 1px solid #fed7aa;
            border-radius: var(--m-radius-sm);
            background: linear-gradient(180deg, #fff7ed 0%, #fff 100%);
            padding: 12px;
        }
        .utilization-chart-wrap canvas {
            width: 100% !important;
            height: 100% !important;
        }
        .utilization-chart-wrap .chart-empty-msg {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .utilization-chart-wrap .chart-empty-msg[hidden] {
            display: none !important;
        }
        .utilization-period-label {
            font-size: .82em;
            color: var(--m-muted);
            margin: 0 0 10px;
        }
        .utilization-type-group {
            margin-bottom: 14px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            overflow: hidden;
        }
        .utilization-type-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 12px;
            background: #f3f4f6;
            font-size: .88em;
        }
        .utilization-type-header span { color: var(--m-muted); font-size: .9em; }
        .utilization-machine-list {
            list-style: none;
            margin: 0;
            padding: 0;
        }
        .utilization-machine-list li {
            display: flex;
            justify-content: space-between;
            padding: 7px 12px;
            font-size: .84em;
            border-top: 1px solid #f3f4f6;
        }
        .utilization-machine-list li span:last-child {
            color: var(--m-muted);
            font-weight: 600;
        }

        /* Dashboard — maintenance status summary */
        .dashboard-bottom-row {
            align-items: stretch !important;
            gap: 16px !important;
        }
        .dashboard-bottom-row > .card {
            flex: 1 !important;
            display: flex;
            flex-direction: column;
            min-height: 480px;
        }
        .dashboard-maint-card {
            min-height: 520px;
        }
        .dashboard-maint-body {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            min-height: 0;
        }
        .maint-dashboard-stack {
            display: flex;
            flex-direction: column;
            gap: 14px;
            width: 100%;
            flex: 1;
        }
        .maint-calendar-section {
            border-top: 1px solid var(--m-border);
            padding-top: 12px;
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }
        .maint-calendar-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 8px;
        }
        .maint-calendar-title {
            font-weight: 600;
            font-size: .95em;
            flex: 1;
            text-align: center;
        }
        .maint-calendar-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            font-size: .72em;
            color: var(--m-muted);
            margin-bottom: 8px;
        }
        .maint-calendar-legend span { display: inline-flex; align-items: center; gap: 4px; }
        .cal-dot {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
        }
        .cal-dot.overdue { background: #ef4444; }
        .cal-dot.critical { background: #f97316; }
        .cal-dot.warning { background: #eab308; }
        .cal-dot.approaching { background: #3b82f6; }
        .cal-dot.on-track { background: #22c55e; }
        .maintenance-calendar { flex: 1; min-height: 180px; }
        .cal-weekdays, .cal-days {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 4px;
        }
        .cal-weekdays {
            font-size: .72em;
            color: var(--m-muted);
            text-align: center;
            margin-bottom: 4px;
        }
        .cal-day {
            aspect-ratio: 1;
            border: 1px solid var(--m-border);
            border-radius: 4px;
            background: #fff;
            font-size: .78em;
            position: relative;
            cursor: default;
            padding: 0;
            color: var(--m-text);
        }
        .cal-day.empty { border: none; background: transparent; }
        .cal-day.today { border-color: var(--m-accent); font-weight: 700; box-shadow: 0 0 0 2px var(--m-accent-light); }
        .cal-day.has-maintenance { cursor: pointer; font-weight: 600; }
        .cal-day.has-maintenance.overdue { background: #fecaca; border-color: #ef4444; color: #991b1b; }
        .cal-day.has-maintenance.critical { background: #fed7aa; border-color: #f97316; color: #9a3412; }
        .cal-day.has-maintenance.warning { background: #fef08a; border-color: #eab308; color: #854d0e; }
        .cal-day.has-maintenance.approaching { background: #bfdbfe; border-color: #3b82f6; color: #1e40af; }
        .cal-day.has-maintenance.on-track { background: #bbf7d0; border-color: #22c55e; color: #166534; }
        .cal-marker {
            position: absolute;
            top: 2px;
            right: 3px;
            font-size: .65em;
            font-style: normal;
            color: var(--m-muted);
        }
        .maint-calendar-day-detail {
            margin-top: 8px;
            padding: 8px 10px;
            background: #f9fafb;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            font-size: .82em;
            min-height: 48px;
        }
        .maint-calendar-day-title { font-weight: 600; margin: 0 0 6px; }
        .maint-calendar-day-list { margin: 0; padding-left: 16px; }
        .maint-calendar-day-list li { margin-bottom: 4px; }
        .maint-summary-grid {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            gap: 10px;
            width: 100%;
            align-items: stretch;
        }
        .maint-summary-box,
        button.maint-summary-box {
            text-align: center;
            padding: 14px 8px;
            border-radius: var(--m-radius-sm);
            border: 1px solid var(--m-border) !important;
            background: #fffbf5 !important;
            color: var(--m-text) !important;
            cursor: pointer;
            transition: box-shadow .15s ease;
            display: flex;
            flex-direction: column;
            justify-content: center;
            flex: 1 1 0;
            min-width: 0;
            min-height: 80px;
        }
        .maint-summary-box:hover { box-shadow: var(--m-shadow-sm); }
        .maint-summary-count {
            display: block;
            font-size: 1.6em;
            font-weight: 700;
            line-height: 1.2;
        }
        .maint-summary-label {
            display: block;
            font-size: .78em;
            margin-top: 4px;
            font-weight: 600;
            color: var(--m-muted);
        }
        .maint-summary-box.overdue { border-top: 3px solid #dc2626 !important; }
        .maint-summary-box.overdue .maint-summary-count { color: #dc2626; }
        .maint-summary-box.critical { border-top: 3px solid #ea580c !important; }
        .maint-summary-box.critical .maint-summary-count { color: #ea580c; }
        .maint-summary-box.warning { border-top: 3px solid #ca8a04 !important; }
        .maint-summary-box.warning .maint-summary-count { color: #ca8a04; }
        .maint-summary-box.approaching { border-top: 3px solid #2563eb !important; }
        .maint-summary-box.approaching .maint-summary-count { color: #2563eb; }
        .maint-summary-box.on-track { border-top: 3px solid #16a34a !important; }
        .maint-summary-box.on-track .maint-summary-count { color: #16a34a; }
        .maint-summary-box.not-set { border-top: 3px solid #94a3b8 !important; }
        .maint-summary-box.not-set .maint-summary-count { color: #64748b; }
        .maint-summary-box.active-filter {
            outline: 2px solid var(--m-accent);
            box-shadow: 0 0 0 3px var(--m-accent-light);
        }

        /* Maintenance tab layout */
        .maint-tab-header-card { margin-bottom: 12px !important; padding: 14px 18px !important; }
        .maint-tab-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }
        .maint-tab-summary-row {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 10px;
            margin-top: 10px;
            overflow: visible;
        }
        .maint-equipment-section {
            margin-bottom: 12px !important;
            padding: 14px 18px !important;
        }
        .maint-equipment-grid-panel {
            overflow: visible;
        }
        .maint-equipment-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
        }
        .maint-equipment-grid-title {
            font-size: 1em;
            font-weight: 600;
            color: var(--m-text);
            margin: 0 0 10px;
        }
        .maint-equipment-card {
            background: #fff;
            border-radius: var(--m-radius-sm);
            padding: 14px;
            border: 1px solid var(--m-border);
            border-left: 4px solid var(--m-border);
            min-height: 200px;
            display: flex;
            flex-direction: column;
        }
        .maint-equipment-card.overdue { border-left-color: #dc2626; }
        .maint-equipment-card.critical { border-left-color: #ea580c; }
        .maint-equipment-card.warning { border-left-color: #ca8a04; }
        .maint-equipment-card.approaching { border-left-color: #2563eb; }
        .maint-equipment-card.on-track { border-left-color: #16a34a; }
        .maint-equipment-card.not-set { border-left-color: #94a3b8; }
        .maint-equipment-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 8px;
            margin-bottom: 8px;
        }
        .maint-equipment-card-header h4 {
            margin: 0 0 4px;
            font-size: 1.05em;
        }
        .maint-equipment-card-header p {
            margin: 0;
            font-size: .88em;
            color: var(--m-muted);
        }
        .maint-equipment-card-stats {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            font-size: .9em;
            margin-bottom: 10px;
            flex: 1;
        }
        .maint-equipment-card-actions {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }
        .maint-equipment-card-actions .btn-small { flex: 1; min-width: 70px; }

        .maint-tab-bottom-row {
            display: grid;
            gap: 12px;
            align-items: stretch;
            margin-bottom: 12px;
        }
        .maint-tab-bottom-row-2 {
            grid-template-columns: minmax(280px, 34%) 1fr;
        }
        .maint-tab-bottom-row-2 .maint-calendar-compact-card {
            max-width: 100%;
        }
        .maint-status-wide {
            display: flex;
            flex-direction: column;
            min-height: 0;
        }
        .maint-status-stack {
            display: flex;
            flex-direction: column;
            gap: 12px;
            height: 100%;
            justify-content: flex-start;
        }
        .maint-status-stack .maint-status-indicator-panel {
            flex: 0 0 auto;
            height: auto;
            justify-content: flex-start;
        }
        .maint-status-stack .maint-status-indicator-panel:not(:first-child) {
            padding-top: 10px;
            border-top: 1px solid var(--m-border, #e2e8f0);
        }
        .maint-status-stack .maint-status-indicator-panel:not(:first-child) .maint-status-bar {
            height: 10px;
        }
        .maint-status-stack .maint-status-indicator-panel:not(:first-child) .maint-status-indicator-title {
            font-size: .82em;
        }
        .maint-status-stack .maint-status-indicator-panel:not(:first-child) .maint-status-legend {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 4px 10px;
            font-size: .72em;
        }
        @media (min-width: 1100px) {
            .maint-status-stack .maint-status-indicator-panel:not(:first-child) .maint-status-legend {
                grid-template-columns: repeat(6, 1fr);
            }
        }
        .maint-status-wide .maint-status-indicator-panel:first-child {
            flex: 0 0 auto;
            justify-content: flex-start;
        }
        .maint-status-wide .maint-status-stack > .maint-status-indicator-panel:first-child .maint-status-legend {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px 16px;
        }
        @media (min-width: 1100px) {
            .maint-status-wide .maint-status-stack > .maint-status-indicator-panel:first-child .maint-status-legend {
                grid-template-columns: repeat(6, 1fr);
            }
        }
        .equipment-type-group-header {
            margin: 18px 0 8px;
            padding-bottom: 6px;
            border-bottom: 2px solid var(--m-border, #e2e8f0);
            color: var(--m-text, #1e293b);
            font-size: 0.95em;
            font-weight: 700;
        }
        .equipment-type-group-header:first-child {
            margin-top: 0;
        }
        .equipment-type-group-count {
            font-weight: 500;
            color: #64748b;
            font-size: 0.9em;
        }
        .equipment-cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 15px;
            margin-bottom: 8px;
        }
        .equipment-type-group-table {
            margin-bottom: 16px;
        }
        .maint-calendar-compact-card {
            margin-bottom: 0 !important;
        }
        .maint-calendar-compact-card h3 {
            font-size: .92em !important;
            margin-bottom: 6px !important;
        }
        .maint-calendar-compact-card .maint-calendar-section {
            padding-top: 0;
            border-top: none;
        }
        .maint-calendar-compact-card .maint-calendar-legend {
            font-size: .68em;
            gap: 6px;
            margin-bottom: 6px;
        }
        .maint-calendar-compact-card .cal-weekdays,
        .maint-calendar-compact-card .cal-days {
            gap: 3px;
        }
        .maint-calendar-compact-card .cal-day {
            font-size: .68em;
            min-height: 28px;
            padding: 2px;
        }
        .maint-status-compact-card {
            margin-bottom: 0 !important;
        }
        .maint-status-indicator-panel {
            height: 100%;
            min-height: 0;
            margin-top: 0;
            padding: 0;
            border: none;
            background: transparent;
            display: flex;
            flex-direction: column;
            gap: 10px;
            justify-content: center;
        }
        .maint-history-section { padding: 14px 18px !important; margin-bottom: 12px !important; }
        .maint-history-filters { margin-bottom: 12px !important; padding: 10px 12px !important; }
        .maint-history-filter-actions { display: flex; align-items: flex-end; }
        .maint-history-table-panel {
            overflow: visible;
            max-height: none;
        }

        /* Multi-service schedules (equipment form + maintenance cards) */
        .service-schedules-header {
            display: grid;
            grid-template-columns: 1.2fr 1fr 0.9fr 0.9fr 36px;
            gap: 8px;
            font-size: .75em;
            font-weight: 600;
            color: var(--m-muted);
            margin-bottom: 6px;
            padding: 0 2px;
        }
        .service-schedule-row {
            display: grid;
            grid-template-columns: 1.2fr 1fr 0.9fr 0.9fr 36px;
            gap: 8px;
            align-items: center;
            margin-bottom: 8px;
        }
        .service-schedule-row input,
        .service-schedule-row select {
            width: 100%;
            min-width: 0;
            font-size: .88em !important;
            padding: 6px 8px !important;
        }
        .maint-equipment-schedules {
            list-style: none;
            margin: 0 0 10px;
            padding: 0;
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            font-size: .78em;
        }
        .maint-equipment-schedules li {
            display: flex;
            flex-direction: column;
            gap: 2px;
            padding: 6px 8px;
            background: #f9fafb;
            border: 1px solid var(--m-border);
            min-width: 0;
        }
        .maint-schedule-slot-empty {
            background: #fafafa;
            border-style: dashed;
            justify-content: center;
            align-items: center;
            min-height: 52px;
        }
        .schedule-equipment-checkboxes {
            display: flex;
            flex-direction: column;
            gap: 6px;
            max-height: 180px;
            overflow-y: auto;
            padding: 8px 10px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: #fafafa;
        }
        .schedule-equipment-option {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: .88em;
            cursor: pointer;
        }
        .schedule-equipment-option input { flex-shrink: 0; }
        .maint-schedule-meta {
            color: var(--m-muted);
            font-size: .92em;
        }
        .upcoming-services-panel {
            overflow: visible;
        }
        .upcoming-services-list {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .upcoming-service-item {
            padding: 8px 10px;
            border: 1px solid var(--m-border);
            background: #fafafa;
        }
        .upcoming-service-main {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 6px;
            font-size: .82em;
        }
        .upcoming-service-type {
            color: var(--m-muted);
            font-size: .9em;
        }
        .upcoming-service-meta {
            display: flex;
            justify-content: space-between;
            margin-top: 4px;
            font-size: .78em;
            color: var(--m-muted);
        }
        .upcoming-service-hrs { font-weight: 600; }

        @media (max-width: 960px) {
            .maint-equipment-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .maint-tab-bottom-row-2 {
                grid-template-columns: 1fr;
            }
        }
        @media (max-width: 640px) {
            .maint-equipment-grid {
                grid-template-columns: 1fr;
            }
            .maint-equipment-section,
            #maintenanceEquipmentList,
            .maint-equipment-grid-panel {
                overflow: visible;
                width: 100%;
                min-width: 0;
            }
            .maint-equipment-card {
                min-height: auto;
                width: 100%;
                min-width: 0;
            }
            .maint-equipment-card-header {
                flex-direction: column;
                align-items: flex-start;
            }
            .maint-equipment-card-actions {
                flex-direction: column;
            }
            .maint-equipment-card-actions .btn-small {
                flex: none;
                width: 100%;
                min-width: 0;
            }
            .maint-schedule-meta {
                word-break: break-word;
                white-space: normal;
            }
            .maint-tab-actions {
                width: 100%;
            }
            .maint-tab-actions .btn-small {
                flex: 1 1 calc(50% - 4px);
                min-width: 0;
                white-space: normal;
                text-align: center;
            }
        }
        .maint-status-indicator-title {
            font-size: .88em;
            font-weight: 600;
            margin: 0;
            color: var(--m-text);
        }
        .maint-status-bar {
            display: flex;
            height: 14px;
            border-radius: 999px;
            overflow: hidden;
            background: #f5f5f4;
            border: 1px solid var(--m-border);
        }
        .maint-status-segment { min-width: 4px; transition: width .3s ease; }
        .maint-status-segment.overdue { background: #dc2626; }
        .maint-status-segment.critical { background: #ea580c; }
        .maint-status-segment.warning { background: #ca8a04; }
        .maint-status-segment.approaching { background: #2563eb; }
        .maint-status-segment.on-track { background: #16a34a; }
        .maint-status-segment.not-set { background: #94a3b8; }
        .maint-status-legend {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
            font-size: .78em;
        }
        .maint-status-legend li {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }
        .maint-status-legend .legend-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
            margin-right: 6px;
            display: inline-block;
        }
        .legend-dot.overdue { background: #dc2626; }
        .legend-dot.critical { background: #ea580c; }
        .legend-dot.warning { background: #ca8a04; }
        .legend-dot.approaching { background: #2563eb; }
        .legend-dot.on-track { background: #16a34a; }
        .legend-dot.not-set { background: #94a3b8; }
        .maint-status-legend .legend-label {
            display: flex;
            align-items: center;
            flex: 1;
        }
        .maint-status-legend .legend-count { font-weight: 700; color: var(--m-text); }
        .maint-calendar-standalone { border-top: none; padding-top: 0; }
        .maintenance-calendar-widget { max-width: 100%; }

        @media (max-width: 900px) {
            .maint-tab-summary-row {
                grid-template-columns: repeat(3, 1fr);
            }
        }
        @media (max-width: 520px) {
            .maint-tab-summary-row {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        /* Dashboard — right column panels */
        .dashboard-right-stack {
            display: flex;
            flex-direction: column;
            gap: 0;
        }
        .dashboard-side-section {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }
        .dashboard-side-section + .dashboard-side-section {
            margin-top: 4px;
        }
        .dashboard-subheading {
            font-size: .92em;
            font-weight: 600;
            color: var(--m-text);
            margin: 0 0 8px;
            padding-top: 12px;
            border-top: 1px solid var(--m-border);
        }
        .dashboard-side-panel {
            flex: 1;
            max-height: none;
            min-height: 100px;
        }
        .low-stock-list { display: flex; flex-direction: column; gap: 8px; }
        .low-stock-item {
            padding: 9px 10px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: #fafafa;
            font-size: .84em;
        }
        .low-stock-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 6px;
        }
        .low-stock-meta { color: var(--m-muted); font-size: .92em; margin-top: 3px; }

        @media (max-width: 900px) {
            .utilization-split {
                grid-template-columns: 1fr;
            }
            .utilization-breakdown {
                max-height: none;
                height: auto;
                min-height: 240px;
            }
            .utilization-charts-stack {
                height: auto;
                max-height: none;
                min-height: 0;
            }
            .utilization-charts-stack .utilization-chart-wrap {
                height: 200px;
                max-height: 200px;
                min-height: 200px;
                flex: 0 0 200px;
            }
            .utilization-chart-half {
                min-height: 200px;
                max-height: 200px;
                height: 200px;
            }
            .maint-summary-grid {
                flex-wrap: wrap;
            }
            .maint-summary-box {
                flex: 1 1 calc(33% - 10px);
                min-width: 90px;
            }
            .dashboard-bottom-row > .card { min-height: auto; }
        }

        /* Equipment tab — full-width list */
        .equipment-tab-card { width: 100%; }
        .equipment-tab-header { margin-bottom: 4px; }
        .equipment-filter-row .form-group { min-width: 0; }
        .equipment-filter-actions {
            text-align: center;
            margin-top: 10px;
            display: flex;
            gap: 8px;
            justify-content: center;
            flex-wrap: wrap;
        }
        .equipment-summary-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 14px;
        }
        .equipment-summary-row .equip-summary-box {
            flex: 1 1 100px;
            min-width: 100px;
            max-width: 160px;
        }
        .equipment-list-panel {
            width: 100%;
            min-height: 280px;
            max-height: 58vh;
        }
        .equipment-table-wrap {
            width: 100%;
        }
        .equipment-table-wrap table {
            width: 100%;
            min-width: 720px;
        }
        .equipment-empty-msg {
            text-align: center;
            padding: 40px 16px;
            color: var(--m-muted);
            min-height: 120px;
        }
        .equipment-transfer-note {
            display: block;
            margin-top: 3px;
            font-size: .78em;
            color: #9a3412;
            line-height: 1.2;
        }
        td .equipment-transfer-note {
            display: block;
            margin-top: 2px;
        }
        .equipment-transfer-banner {
            margin: 0 0 16px;
            padding: 10px 12px;
            border-radius: var(--m-radius-sm);
            background: #fff7ed;
            border: 1px solid #fed7aa;
            color: #9a3412;
            font-size: .92em;
        }
        .move-equip-summary {
            margin-top: 4px;
        }
        .equipment-type-summary { margin-bottom: 14px; }
        .field-hint {
            font-size: .78em;
            color: var(--m-muted);
            margin: 4px 0 0;
        }
        .location-history-panel {
            margin-bottom: 12px;
            padding: 10px 12px;
            background: #f9fafb;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            max-height: 140px;
            overflow-y: auto;
        }
        .location-history-title {
            font-size: .88em;
            margin: 0 0 8px;
            color: var(--m-text);
        }
        .location-history-list {
            margin: 0;
            padding-left: 18px;
            font-size: .82em;
        }
        .location-history-list li { margin-bottom: 4px; }
        .delete-confirm-panel {
            background: #fef2f2;
            border: 1px solid #fecaca;
            border-radius: var(--m-radius-sm);
            padding: 12px;
            margin-bottom: 10px;
        }
        .delete-confirm-panel p { margin: 0 0 10px; font-size: .88em; }
        .delete-confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
        .edit-equipment-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            gap: 10px;
            flex-wrap: wrap;
        }
        .edit-equipment-footer-main {
            display: flex;
            gap: 8px;
            margin-left: auto;
        }

        /* Inventory tab */
        .inventory-tab-card { margin-bottom: 12px !important; }
        .inventory-group-section { margin-bottom: 20px; }
        .inventory-type-group {
            margin-bottom: 22px;
            padding: 10px 10px 6px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: #fff;
        }
        .inventory-type-heading {
            margin: 0 0 10px;
            font-size: 1.05em;
            font-weight: 700;
            color: var(--m-text);
            padding-bottom: 6px;
            border-bottom: 2px solid var(--m-accent);
        }
        .inventory-model-group {
            margin: 0 0 14px 8px;
            padding-left: 10px;
            border-left: 3px solid #fed7aa;
        }
        .inventory-model-heading {
            margin: 0 0 8px;
            font-size: .95em;
            font-weight: 650;
            color: #9a3412;
        }
        .inventory-category-group { margin: 0 0 12px; }
        .inventory-category-heading {
            margin: 0 0 8px;
            font-size: .86em;
            font-weight: 600;
            color: var(--m-muted);
            text-transform: uppercase;
            letter-spacing: .03em;
        }
        .inventory-group-title {
            font-size: .92em;
            font-weight: 600;
            color: var(--m-text);
            margin: 0 0 10px;
            padding-bottom: 6px;
            border-bottom: 2px solid var(--m-accent-light);
        }
        .inventory-group-count { color: var(--m-muted); font-weight: 500; }
        .inventory-cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 12px;
        }
        .inventory-card {
            background: #fff;
            border: 1px solid var(--m-border);
            padding: 14px;
            border-left: 3px solid var(--m-accent);
        }
        .inventory-card-header {
            display: flex;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 10px;
        }
        .inventory-card-header h4 { margin: 0 0 4px; font-size: .95em; }
        .inventory-card-header p { margin: 0; font-size: .8em; color: var(--m-muted); }
        .inventory-card-body {
            display: grid;
            gap: 6px;
            font-size: .85em;
            margin-bottom: 10px;
        }
        .inventory-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
        .inventory-card-actions .btn-small { flex: 1 1 auto; }
        .inventory-type-summary {
            margin: 0 0 14px;
        }
        .inventory-filter-panel {
            padding: 10px 12px !important;
            margin-bottom: 12px !important;
        }
        .inventory-filter-panel .filter-panel-header-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 8px;
        }
        .inventory-filter-panel .filter-panel-header-row h4 {
            margin: 0 !important;
        }
        .inventory-filter-row {
            margin-bottom: 0 !important;
            gap: 8px !important;
        }
        .inventory-filter-row .form-group {
            margin-bottom: 0;
            min-width: 0;
        }
        .inventory-filter-row label {
            font-size: .78em;
            margin-bottom: 3px;
        }
        .inventory-filter-row input,
        .inventory-filter-row select {
            padding: 6px 8px !important;
            font-size: .88em !important;
        }
        .inventory-parts-table col.inv-col-partno { width: 12%; }
        .inventory-parts-table col.inv-col-name { width: 18%; }
        .inventory-parts-table col.inv-col-category { width: 10%; }
        .inventory-parts-table col.inv-col-qty { width: 8%; }
        .inventory-parts-table col.inv-col-min { width: 5%; }
        .inventory-parts-table col.inv-col-purchase { width: 14%; }
        .inventory-parts-table col.inv-col-status { width: 9%; }
        .inventory-parts-table col.inv-col-actions { width: 14%; }
        .inventory-category-cell,
        .inventory-status-cell {
            font-size: .82em;
        }
        .inventory-purchase-cell {
            font-size: .78em;
            line-height: 1.3;
        }
        .inventory-purchase-compact {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .inventory-purchase-compact span {
            font-weight: 500;
            color: var(--m-text);
        }
        .inventory-purchase-compact small {
            color: var(--m-muted);
            font-size: .92em;
        }
        .inventory-actions-cell {
            padding-top: 6px !important;
            padding-bottom: 6px !important;
        }
        .inventory-row-actions {
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-width: 0;
        }
        .inventory-row-actions .inventory-action-full {
            width: 100%;
            padding: 4px 6px !important;
            font-size: .72em !important;
            white-space: normal;
            line-height: 1.2;
        }
        .inventory-action-row {
            display: flex;
            gap: 4px;
            width: 100%;
        }
        .inventory-action-row .btn-small {
            flex: 1 1 0;
            min-width: 0;
            padding: 4px 5px !important;
            font-size: .72em !important;
            white-space: nowrap;
        }
        .btn-tiny {
            padding: 2px 5px !important;
            font-size: .68em !important;
            line-height: 1.2;
            border-radius: 4px !important;
        }
        .inventory-purchase-compact .btn-tiny {
            align-self: flex-start;
            margin-top: 2px;
            white-space: nowrap;
        }
        #inventoryList .inventory-row-actions .btn-small {
            margin: 0;
        }
        #inventoryList table tr.inventory-row-in td { background: #f0fdf4; }
        #inventoryList table tr.inventory-row-low td { background: #fff7ed; }
        #inventoryList table tr.inventory-row-out td { background: #fef2f2; }
        #inventoryList table tr.inventory-row-in td:first-child { box-shadow: inset 4px 0 0 #16a34a; }
        #inventoryList table tr.inventory-row-low td:first-child { box-shadow: inset 4px 0 0 #ea580c; }
        #inventoryList table tr.inventory-row-out td:first-child { box-shadow: inset 4px 0 0 #dc2626; }
        .inventory-card.inventory-row-in { border-left-color: #16a34a; }
        .inventory-card.inventory-row-low { border-left-color: #ea580c; }
        .inventory-card.inventory-row-out { border-left-color: #dc2626; }
        #inventoryList .role-badge.warning,
        .inventory-card .role-badge.warning {
            background: #ffedd5 !important;
            color: #ea580c !important;
            border: 1px solid #fdba74 !important;
        }
        #inventoryList .role-badge.success,
        .inventory-card .role-badge.success {
            background: #dcfce7 !important;
            color: #16a34a !important;
            border: 1px solid #bbf7d0 !important;
        }
        #inventoryList .role-badge.danger,
        .inventory-card .role-badge.danger {
            background: #fee2e2 !important;
            color: #dc2626 !important;
            border: 1px solid #fecaca !important;
        }
        .part-price-cell {
            display: flex;
            flex-direction: column;
            gap: 2px;
            font-size: .82em;
        }
        .part-price-cell small { color: var(--m-muted); }
        .part-pricing-section,
        .part-pricing-readonly {
            background: #f9fafb;
            border: 1px solid var(--m-border);
            padding: 12px;
            margin-top: 8px;
        }
        .part-pricing-heading {
            font-size: .9em;
            margin: 0 0 8px;
            color: var(--m-text);
        }
        .part-pricing-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            font-size: .88em;
        }
        .pricing-label {
            display: block;
            font-size: .75em;
            color: var(--m-muted);
            margin-bottom: 2px;
        }
        input.readonly-field {
            background: #f3f4f6 !important;
            color: var(--m-muted) !important;
            cursor: default;
        }
        .receive-parts-scroll { max-height: 65vh; overflow-y: auto; }
        .receive-purchase-source {
            margin-bottom: 12px;
        }
        .receive-purchase-source input {
            width: 100%;
        }
        .receive-parts-title { margin: 0 0 8px; font-size: .95em; }
        .receive-parts-list { display: flex; flex-direction: column; gap: 12px; }
        .receive-part-row {
            border: 1px solid var(--m-border);
            padding: 12px;
            background: #fafafa;
        }
        .receive-part-info { margin-bottom: 10px; }
        .receive-part-info small { color: var(--m-muted); display: block; margin-top: 4px; }
        .receive-part-fields {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 10px;
        }
        .receive-part-fields .form-group { margin: 0; }
        .receive-part-fields label { font-size: .75em; }
        .part-history-summary {
            display: flex;
            flex-direction: column;
            gap: 4px;
            font-size: .82em;
            align-items: flex-start;
        }
        .part-history-summary small { color: var(--m-muted); }
        .part-pricing-heading-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }
        .part-history-table { font-size: .82em; }
        .part-history-table td small { color: var(--m-muted); }

        /* Inventory view tabs + panels */
        .inventory-view-tabs {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 14px;
            align-items: stretch;
        }
        .inventory-view-tab,
        .inventory-view-stat-value {
            flex: 1;
            min-width: 130px;
            padding: 12px 14px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: var(--m-surface);
            text-align: center;
            cursor: pointer;
            transition: border-color .15s, box-shadow .15s;
        }
        .inventory-view-stat-value { cursor: default; border-top: 2px solid var(--m-success); }
        .inventory-view-tab:hover { border-color: #9ca3af; }
        .inventory-view-tab.active {
            border-color: var(--m-text);
            box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
            background: var(--m-surface) !important;
        }
        .inventory-view-tab.primary { border-top: 2px solid var(--m-accent); }
        .inventory-view-tab.success { border-top: 2px solid var(--m-success); }
        .inventory-view-tab.info { border-top: 2px solid #6366f1; }
        .inventory-view-tab.warning { border-top: 2px solid var(--m-warning); }
        .inventory-view-tab.danger { border-top: 2px solid var(--m-danger); }
        button.inventory-view-tab.primary,
        button.inventory-view-tab.success,
        button.inventory-view-tab.info,
        button.inventory-view-tab.warning,
        button.inventory-view-tab.danger {
            background: var(--m-surface) !important;
            color: var(--m-text) !important;
            border: 1px solid var(--m-border) !important;
        }
        button.inventory-view-tab.primary:hover,
        button.inventory-view-tab.success:hover,
        button.inventory-view-tab.info:hover,
        button.inventory-view-tab.warning:hover,
        button.inventory-view-tab.danger:hover {
            border-color: #9ca3af !important;
            background: var(--m-surface) !important;
            color: var(--m-text) !important;
        }
        button.inventory-view-tab.active {
            background: var(--m-surface) !important;
            color: var(--m-text) !important;
        }
        .inventory-view-tab-count,
        .inventory-view-stat-value .inventory-view-tab-count {
            display: block;
            font-size: 1.2em;
            font-weight: 600;
            color: var(--m-text);
        }
        .inventory-view-tab-label {
            display: block;
            font-size: .76em;
            color: var(--m-muted);
            margin-top: 2px;
        }
        .inventory-list-panel {
            display: flex;
            flex-direction: column;
            max-height: 72vh;
            min-height: 480px;
            overflow: hidden;
            margin-bottom: 24px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            padding: 0;
            background: #fafafa;
        }
        .inventory-list-table-shell {
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
            height: 100%;
        }
        .inventory-list-table-head {
            flex: 0 0 auto;
            padding: 10px 10px 0;
            background: #fafafa;
            border-bottom: 1px solid var(--m-border);
            z-index: 2;
        }
        .inventory-list-table-body {
            flex: 1 1 auto;
            min-height: 0;
            overflow: auto;
            padding: 0 10px 10px;
            -webkit-overflow-scrolling: touch;
        }
        .inventory-list-table-head table,
        .inventory-list-table-body table {
            width: 100%;
            table-layout: fixed;
            border-collapse: separate;
            border-spacing: 0;
        }
        .inventory-list-table-head table th {
            background: #f3f4f6 !important;
            color: #6b7280 !important;
            font-size: 10px !important;
            padding: 6px 8px !important;
        }
        .inventory-unified-table-wrap {
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        #inventoryList .inventory-parts-table-unified thead th {
            position: sticky;
            top: 0;
            z-index: 5;
            background: #f3f4f6 !important;
            box-shadow: 0 1px 0 var(--m-border);
        }
        .inventory-type-section-row td,
        .inventory-model-section-row td {
            background: #fafafa;
            border-bottom: none !important;
            padding-top: 14px;
            padding-bottom: 4px;
        }
        .inventory-type-section-row .inventory-type-heading {
            margin: 0;
            padding-bottom: 3px;
            border-bottom: 2px solid var(--m-accent);
        }
        .inventory-model-section-row .inventory-model-heading {
            margin: 0 0 0 8px;
        }
        .inventory-type-section-row:hover,
        .inventory-model-section-row:hover {
            background: #fafafa !important;
        }
        .inventory-row-highlight td {
            animation: inventoryRowHighlight 1.2s ease;
        }
        @keyframes inventoryRowHighlight {
            0%, 100% { background-color: inherit; }
            35% { background-color: #fff7ed !important; }
        }
        #inventoryList .table-responsive,
        #inventoryList .scrollable-table-wrap {
            max-height: none;
            overflow-x: auto;
            overflow-y: visible;
            -webkit-overflow-scrolling: touch;
        }
        .inventory-subsection {
            margin-top: 28px;
            padding-top: 20px;
            border-top: 1px solid var(--m-border);
        }
        .inventory-subsection h4 { margin: 0; font-size: 1em; }
        .inventory-requisitions-panel,
        .inventory-financial-panel {
            max-height: 360px;
            overflow-x: auto;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            margin-top: 10px;
        }
        .inv-dual-currency-cell {
            line-height: 1.35;
        }
        .inv-kes-amt {
            display: block;
            font-weight: 500;
            color: var(--m-text);
        }
        .inv-usd-ref {
            display: block;
            margin-top: 2px;
            font-size: .78em;
            font-weight: 400;
            color: #9ca3af;
        }
        #financialHistoryPRTotal .inv-kes-amt {
            display: inline;
            font-weight: 700;
        }
        #financialHistoryPRTotal .inv-usd-ref {
            display: inline;
            margin-left: 8px;
            font-size: .88em;
        }
        .inventory-equal-table {
            table-layout: fixed;
            width: 100%;
        }
        .inventory-equal-table th,
        .inventory-equal-table td {
            word-wrap: break-word;
            overflow-wrap: break-word;
            vertical-align: top;
        }
        .inventory-part-cell {
            max-width: 0;
        }
        .inventory-equip-models-cell {
            font-size: .82em;
            line-height: 1.35;
            word-break: break-word;
        }
        .inventory-shared-badge {
            display: inline-block;
            margin-left: 6px;
            padding: 1px 6px;
            border-radius: 999px;
            font-size: .72em;
            font-weight: 600;
            letter-spacing: .02em;
            text-transform: uppercase;
            color: #9a3412;
            background: #ffedd5;
            border: 1px solid #fdba74;
            vertical-align: middle;
            white-space: nowrap;
        }
        .inventory-row-shared {
            background-image: linear-gradient(90deg, rgba(254, 215, 170, .18), transparent 120px);
        }
        .inventory-part-subline {
            display: block;
            margin-top: 2px;
            color: var(--m-muted);
            font-size: clamp(0.62rem, 0.72em, 0.78rem);
            font-weight: 400;
            line-height: 1.25;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .inventory-card-header h4 .inventory-part-subline,
        .inventory-card-header p .inventory-part-subline {
            font-size: clamp(0.62rem, 0.85em, 0.78rem);
        }
        .requisition-summary-row {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin: 12px 0;
        }
        .requisition-stat {
            flex: 1;
            min-width: 100px;
            padding: 10px;
            text-align: center;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: var(--m-surface);
            cursor: pointer;
        }
        button.requisition-stat,
        button.requisition-stat.primary,
        button.requisition-stat.warning,
        button.requisition-stat.safe,
        button.requisition-stat.danger {
            background: var(--m-surface) !important;
            color: var(--m-text) !important;
            border: 1px solid var(--m-border) !important;
            box-shadow: none !important;
        }
        button.requisition-stat:hover,
        button.requisition-stat.primary:hover,
        button.requisition-stat.warning:hover,
        button.requisition-stat.safe:hover,
        button.requisition-stat.danger:hover {
            border-color: #9ca3af !important;
            background: var(--m-surface) !important;
            color: var(--m-text) !important;
        }
        button.requisition-stat.active-filter {
            border-color: var(--m-text) !important;
            box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
            background: var(--m-surface) !important;
            color: var(--m-text) !important;
        }
        .requisitions-tab-card .action-buttons .btn-small:not(.success):not(.danger) {
            background: #fff !important;
            color: var(--m-accent) !important;
            border: 1px solid var(--m-accent) !important;
        }
        .requisitions-financial-section {
            margin-top: 20px;
            padding-top: 16px;
            border-top: 1px solid var(--m-border);
        }
        .pr-selected-part-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            padding: 12px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            margin-bottom: 8px;
            background: #f9fafb;
        }
        .pr-selected-part-main { flex: 1; min-width: 0; }
        .pr-selected-part-title {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .pr-part-number-badge {
            background: #eef2ff;
            color: #3730a3;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 0.78em;
        }
        .pr-selected-part-meta {
            margin-top: 6px;
            font-size: 0.88em;
            color: var(--m-muted);
            display: flex;
            flex-wrap: wrap;
            gap: 8px 14px;
        }
        .pr-selected-part-actions {
            display: flex;
            gap: 6px;
            flex-shrink: 0;
        }
        .requisition-stat.primary { border-top: 2px solid var(--m-accent); }
        .requisition-stat.warning { border-top: 2px solid var(--m-warning); }
        .requisition-stat.safe { border-top: 2px solid var(--m-success); }
        .requisition-stat.danger { border-top: 2px solid var(--m-danger); }
        .requisition-stat-value { display: block; font-size: 1.15em; font-weight: 600; }
        .requisition-stat-label { display: block; font-size: .76em; color: var(--m-muted); }

        /* HRM tab */
        .hrm-summary-row {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 16px;
        }
        .hrm-stat {
            flex: 1;
            min-width: 120px;
            padding: 12px;
            text-align: center;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: var(--m-surface);
        }
        .hrm-stat.primary { border-top: 2px solid var(--m-accent); }
        .hrm-stat.safe { border-top: 2px solid var(--m-success); }
        .hrm-stat.warning { border-top: 2px solid var(--m-warning); }
        .hrm-stat.info { border-top: 2px solid #6366f1; }
        .hrm-stat.accent { border-top: 2px solid var(--m-accent); }
        .hrm-stat-value { display: block; font-size: 1.2em; font-weight: 600; }
        .hrm-stat-label { display: block; font-size: .76em; color: var(--m-muted); margin-top: 2px; }

        /* HRM — full-width modern layout */
        .hrm-page {
            width: 100%;
            max-width: none;
            padding: 0 0 24px;
        }
        .hrm-page-header {
            display: flex;
            flex-wrap: wrap;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 16px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--m-border);
        }
        .hrm-page-header h2 { margin: 0 0 4px; font-size: 1.35em; }
        .hrm-page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
        .hrm-subnav-bar {
            display: flex;
            flex-wrap: wrap;
            align-items: flex-end;
            justify-content: space-between;
            gap: 10px 16px;
            margin-bottom: 16px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--m-border);
        }
        .hrm-subnav {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-bottom: 0;
            border-bottom: none;
            padding-bottom: 0;
        }
        .hrm-subnav-month {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-left: auto;
            flex-shrink: 0;
        }
        .hrm-filter-label {
            font-size: .78em;
            font-weight: 600;
            color: var(--m-muted);
            text-transform: uppercase;
            letter-spacing: .03em;
        }
        .hrm-filter-heading {
            font-size: .78em;
            font-weight: 600;
            color: var(--m-text);
        }
        .hrm-filter-control {
            min-width: 0;
        }
        .hrm-filter-divider {
            width: 1px;
            height: 22px;
            background: var(--m-border);
            margin: 0 2px;
        }
        .hrm-panels-wrap {
            min-height: 280px;
        }
        @media (max-width: 900px) {
            .hrm-subnav-bar {
                flex-direction: column;
                align-items: stretch;
            }
            .hrm-subnav-month {
                margin-left: 0;
            }
        }
        .hrm-subnav-btn {
            padding: 8px 16px;
            border: 1px solid transparent;
            border-radius: var(--m-radius-sm);
            background: transparent;
            color: var(--m-muted);
            font-size: .88em;
            font-weight: 500;
            cursor: pointer;
        }
        .hrm-subnav-btn:hover { background: var(--m-surface); color: var(--m-text); }
        .hrm-subnav-btn.active {
            background: var(--m-accent-light, #fff7ed);
            color: var(--m-accent);
            border-color: var(--m-accent);
            font-weight: 600;
        }
        .hrm-panel-full {
            width: 100%;
            margin-bottom: 8px;
        }
        .hrm-section-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 10px;
        }
        .hrm-section-toolbar h3 { margin: 0; font-size: 1em; font-weight: 600; }
        .hrm-section-toolbar-actions { display: flex; align-items: center; gap: 8px; }
        .hrm-section-toolbar-compact {
            flex-wrap: nowrap;
            gap: 12px;
            margin-bottom: 8px;
        }
        .hrm-section-toolbar-compact h3 {
            flex-shrink: 0;
            white-space: nowrap;
        }
        .hrm-toolbar-filters {
            display: flex;
            flex-wrap: nowrap;
            align-items: center;
            gap: 6px;
            margin-left: auto;
            min-width: 0;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        .hrm-data-scroll {
            max-height: min(72vh, 800px);
            overflow: auto;
            -webkit-overflow-scrolling: touch;
        }
        .hrm-data-scroll .scrollable-table-wrap {
            max-height: none;
            overflow: visible;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
        }
        .hrm-table { width: 100%; font-size: 13px; }
        .hrm-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--m-muted); }
        .hrm-table td { vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--m-border); }
        .hrm-table tbody tr:hover { background: #fafafa; }
        .hrm-table .payroll-select-col { width: 36px; text-align: center; }
        .hrm-payroll-export-hint { font-size: .82em; color: var(--m-muted); margin: 0 0 10px; }

        /* Timesheet calendar */
        .timesheet-month-row { align-items: flex-end; }
        .timesheet-month-nav { display: flex; align-items: center; gap: 6px; }
        .timesheet-month-nav input[type="month"] { flex: 1; }
        .timesheet-pay-preview {
            padding: 8px 12px;
            background: var(--m-accent-light, #fff7ed);
            border: 1px solid #fed7aa;
            border-radius: var(--m-radius-sm);
            font-size: .88em;
        }
        .timesheet-calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 4px;
            margin: 12px 0;
        }
        .timesheet-cal-head {
            text-align: center;
            font-size: .72em;
            font-weight: 600;
            color: var(--m-muted);
            padding: 4px 0;
            text-transform: uppercase;
        }
        .timesheet-cal-cell {
            min-height: 72px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            padding: 4px;
            background: var(--m-surface);
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .timesheet-cal-cell.empty { background: transparent; border-color: transparent; }
        .timesheet-cal-cell.worked {
            border-color: var(--m-accent);
            background: #fff7ed;
        }
        .timesheet-cal-cell.locked-other {
            border-color: #93c5fd;
            background: #eff6ff;
            cursor: not-allowed;
        }
        .timesheet-cal-cell.on-leave {
            border-color: #eab308;
            background: #fef9c3;
            cursor: not-allowed;
        }
        .timesheet-day-num.leave { color: #854d0e; }
        .timesheet-leave-hint { display: block; font-size: .65em; color: #a16207; }
        .timesheet-day-num.locked {
            color: #2563eb;
            cursor: not-allowed;
        }
        .timesheet-locked-hint {
            display: block;
            font-size: .58em;
            color: #2563eb;
            text-align: center;
            line-height: 1.1;
        }
        .hrm-payroll-subtotal-row {
            background: #f8fafc;
            border-top: 2px solid var(--m-border);
        }
        .hrm-payroll-subtotal-row td {
            border-bottom: 2px solid var(--m-border);
        }
        .hrm-payroll-table {
            font-size: 11px;
        }
        .hrm-payroll-table th {
            font-size: 9.5px;
            padding: 8px 6px;
            white-space: nowrap;
        }
        .hrm-payroll-table td {
            padding: 6px 6px;
            font-size: 11px;
            vertical-align: middle;
        }
        .hrm-payroll-table .payroll-money-col,
        .hrm-payroll-table .payroll-money {
            white-space: nowrap;
            font-size: 10.5px;
            letter-spacing: -0.01em;
        }
        .hrm-payroll-table .payroll-equip-col {
            max-width: 96px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .hrm-payroll-table .payroll-rate-col {
            max-width: 72px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 10px;
        }
        .hrm-payroll-table .action-buttons {
            white-space: nowrap;
        }
        .hrm-payroll-table .action-buttons .btn-small {
            font-size: 10px;
            padding: 4px 8px;
        }
        .payroll-table-wrap {
            overflow-x: auto;
        }
        .hrm-payroll-balance-row td {
            background: #fff7ed !important;
        }
        .hrm-payroll-balance-row:hover td {
            background: #ffedd5 !important;
        }
        .payroll-balance-due {
            color: #c2410c;
            font-weight: 700;
        }
        .hrm-payroll-footer-row td {
            font-weight: 700;
            border-top: 2px solid var(--m-border);
            background: #f1f5f9;
            white-space: nowrap;
        }
        .hrm-site-group-row {
            background: #fff7ed;
        }
        .hrm-site-group-row td {
            padding: 8px 12px;
            font-size: 0.9rem;
            border-bottom: 1px solid #fed7aa;
            color: #9a3412;
        }
        .project-sites-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 240px;
            overflow-y: auto;
        }
        .project-site-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 8px 10px;
            background: #f8fafc;
            border: 1px solid var(--m-border);
            border-radius: 6px;
        }
        .timesheet-day-toggle,
        .timesheet-day-num {
            width: 100%;
            border: none;
            background: transparent;
            font-weight: 600;
            font-size: .85em;
            cursor: pointer;
            padding: 2px 0;
            border-radius: 4px;
            color: var(--m-text);
            text-align: center;
            display: block;
        }
        .timesheet-day-num:hover { background: rgba(0, 0, 0, 0.04); }
        .timesheet-cal-cell.worked .timesheet-day-toggle,
        .timesheet-cal-cell.worked .timesheet-day-num { color: var(--m-accent); }

        /* Jobcard lightbox viewer */
        .jobcard-viewer-modal {
            max-width: min(960px, 96vw);
            width: 96vw;
        }
        .jobcard-viewer-header {
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }
        .jobcard-viewer-header h3 {
            flex: 1 1 200px;
            margin: 0;
            font-size: 1em;
        }
        .jobcard-viewer-toolbar {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }
        .jobcard-viewer-counter,
        .jobcard-viewer-zoom-label {
            font-size: .82em;
            color: var(--m-text-muted, #64748b);
            min-width: 3.5em;
        }
        .jobcard-viewer-body {
            display: flex;
            align-items: stretch;
            gap: 8px;
            padding: 0 !important;
            min-height: 420px;
        }
        .jobcard-viewer-stage {
            position: relative;
            flex: 1;
            min-height: 420px;
            background: #0f172a;
            border-radius: var(--m-radius-sm);
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: grab;
            touch-action: none;
        }
        .jobcard-viewer-stage.is-dragging { cursor: grabbing; }
        .jobcard-viewer-stage .empty-state {
            color: #94a3b8;
            padding: 24px;
        }
        .jobcard-viewer-canvas {
            transform-origin: center center;
            transition: transform 0.05s linear;
            will-change: transform;
            max-width: 100%;
            max-height: 100%;
        }
        .jobcard-viewer-canvas.is-pdf {
            width: 100%;
            height: 100%;
            transform: none !important;
        }
        .jobcard-viewer-image {
            display: block;
            max-width: min(880px, 88vw);
            max-height: 62vh;
            width: auto;
            height: auto;
            border-radius: 4px;
            box-shadow: 0 8px 32px rgba(0,0,0,.45);
            user-select: none;
            pointer-events: none;
        }
        .jobcard-viewer-pdf {
            width: 100%;
            height: 62vh;
            min-height: 360px;
            border: none;
            background: #fff;
        }
        .jobcard-viewer-hint {
            position: absolute;
            bottom: 10px;
            left: 50%;
            transform: translateX(-50%);
            margin: 0;
            padding: 4px 10px;
            font-size: .72em;
            color: #cbd5e1;
            background: rgba(15, 23, 42, .75);
            border-radius: 999px;
            pointer-events: none;
        }
        .jobcard-nav {
            flex: 0 0 36px;
            align-self: center;
            width: 36px;
            height: 72px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: var(--m-surface);
            color: var(--m-text);
            font-size: 1.6em;
            line-height: 1;
            cursor: pointer;
        }
        .jobcard-nav:hover { background: #fff7ed; border-color: #fdba74; }
        .jobcard-viewer-thumbs {
            display: flex;
            gap: 8px;
            padding: 10px 16px;
            overflow-x: auto;
            border-top: 1px solid var(--m-border);
            background: var(--m-surface-alt, #f8fafc);
        }
        .jobcard-viewer-thumb {
            flex: 0 0 auto;
            width: 64px;
            height: 64px;
            padding: 0;
            border: 2px solid transparent;
            border-radius: 6px;
            overflow: hidden;
            cursor: pointer;
            background: #e2e8f0;
        }
        .jobcard-viewer-thumb.active {
            border-color: #ea580c;
            box-shadow: 0 0 0 2px rgba(234, 88, 12, .25);
        }
        .jobcard-viewer-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        .jobcard-thumb-pdf {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            font-size: .72em;
            font-weight: 700;
            color: #475569;
        }
        .jobcard-viewer-footer {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
        }

        .timesheet-day-fields {
            display: flex;
            flex-direction: column;
            gap: 2px;
            margin-top: auto;
        }
        .timesheet-day-fields label {
            display: flex;
            align-items: center;
            gap: 3px;
            font-size: .62em;
            color: var(--m-muted);
        }
        .timesheet-day-fields input {
            width: 100%;
            padding: 2px 4px;
            font-size: .75em;
            border: 1px solid var(--m-border);
            border-radius: 3px;
            color: var(--m-text);
            background: #fff;
        }

        .timesheet-log-mode-toggle {
            display: flex;
            gap: 0;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            overflow: hidden;
        }
        .timesheet-mode-btn {
            flex: 1;
            border: none !important;
            background: var(--m-surface) !important;
            padding: 8px 12px;
            font-size: .85em;
            cursor: pointer;
            color: var(--m-muted) !important;
            font-weight: 500 !important;
        }
        .timesheet-mode-btn.active {
            background: var(--m-accent) !important;
            color: #fff !important;
            font-weight: 600 !important;
        }
        .timesheet-mode-btn:not(.active):hover {
            background: #f3f4f6 !important;
            color: var(--m-text) !important;
        }
        .timesheet-clock-toolbar {
            display: flex;
            justify-content: flex-start;
            margin: 8px 0 10px;
        }
        .timesheet-clock-shift-row {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 10px;
            flex-wrap: wrap;
        }
        .timesheet-clock-shift-row > label {
            font-weight: 600;
            font-size: 0.9rem;
            margin: 0;
        }
        .timesheet-other-shift-badge {
            display: block;
            color: #9a3412;
            font-size: 0.7rem;
            margin-top: 2px;
        }
        .timesheet-clock-wrap {
            max-height: 420px;
            overflow-x: scroll;
            overflow-y: auto;
            scrollbar-gutter: stable;
            margin-bottom: 12px;
        }
        .timesheet-clock-table {
            width: 100%;
            min-width: 880px;
            font-size: .82em;
        }
        .timesheet-clock-table th {
            white-space: nowrap;
            font-size: .78em;
            text-transform: uppercase;
            letter-spacing: .02em;
        }
        .timesheet-clock-table input[type="date"],
        .timesheet-clock-table input[type="time"],
        .timesheet-clock-table input[type="number"],
        .timesheet-clock-table select {
            width: 100%;
            min-width: 72px;
            padding: 4px 6px;
            font-size: .92em;
        }
        .timesheet-clock-table input[type="number"] { min-width: 64px; }
        .timesheet-clock-tally {
            text-align: center;
            white-space: nowrap;
            font-variant-numeric: tabular-nums;
        }
        .timesheet-clock-row-locked {
            background: #eff6ff;
        }
        .timesheet-clock-row-locked input,
        .timesheet-clock-row-locked select {
            border-color: #93c5fd;
        }
        .timesheet-clock-row-inactive {
            opacity: 0.55;
        }
        .timesheet-clock-row-inactive input:not([type="checkbox"]),
        .timesheet-clock-row-inactive select {
            pointer-events: none;
            background: #f8fafc;
        }
        .timesheet-clock-row-active {
            background: #fffbeb;
        }
        .timesheet-clock-active-col {
            width: 42px;
            text-align: center;
        }
        .timesheet-clock-date {
            white-space: nowrap;
            font-weight: 500;
        }

        .payroll-pay-summary {
            padding: 8px 10px;
            background: #f8fafc;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            font-weight: 500;
        }

        .payroll-pay-breakdown {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid var(--m-border);
        }

        .payroll-pay-total-row input {
            font-weight: 600;
        }

        /* Equipment map */
        .dashboard-map-section {
            width: 100%;
            margin-top: 16px;
            border-top: 1px solid var(--m-border);
            padding-top: 16px;
        }
        .dashboard-map-header { margin-bottom: 10px; }
        .dashboard-map-header h3 { margin: 0 0 4px; }
        .equipment-map-container {
            width: 100%;
            height: 420px;
            border-radius: var(--m-radius);
            border: 1px solid var(--m-border);
            overflow: hidden;
            background: #e5e7eb;
        }
        .equipment-tab-map-section { margin-top: 20px; }
        .equipment-map-label-icon {
            background: transparent !important;
            border: none !important;
        }
        .equip-map-pin {
            display: flex;
            flex-direction: column;
            align-items: center;
            pointer-events: auto;
            cursor: pointer;
        }
        .equip-map-pin-dot {
            width: 18px;
            height: 18px;
            border-radius: 50% 50% 50% 0;
            transform: rotate(-45deg);
            background: var(--pin-color, #ea580c);
            border: 2.5px solid #fff;
            box-shadow: 0 2px 6px rgba(0,0,0,.4);
        }
        .equip-map-pin-label {
            display: none;
        }
        .equip-map-hover-tooltip {
            font-size: 11px;
            font-weight: 600;
            padding: 3px 7px;
            border-radius: 4px;
            white-space: nowrap;
        }
        .equip-map-popup-wrap .leaflet-popup-content { margin: 10px 12px; font-size: 13px; }
        .equip-map-popup { line-height: 1.45; }

        /* Records tab layout */
        .records-tab-layout {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        .records-tab-layout > .card {
            width: 100%;
        }
        .records-hours-form-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 12px;
        }
        .records-filter-panel {
            margin: 0;
            padding: 0;
            border: none;
            background: transparent;
        }
        .records-filter-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-top: 8px;
        }
        .records-chart-wrap {
            height: 280px;
            min-height: 280px;
            flex: 1 1 auto;
        }
        .records-charts-row {
            display: grid;
            grid-template-columns: minmax(0, 65fr) minmax(0, 35fr);
            gap: 16px;
            width: 100%;
            align-items: stretch;
        }
        .records-chart-panel {
            display: flex;
            flex-direction: column;
            min-width: 0;
            min-height: 0;
        }
        .records-chart-subtitle {
            margin: 0 0 8px;
            font-size: .9em;
            font-weight: 600;
            color: var(--m-text-muted, #64748b);
        }
        @media (max-width: 900px) {
            .records-charts-row { grid-template-columns: 1fr; }
        }
        .records-inline-filter {
            margin: 0 0 12px;
            padding: 10px 12px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: var(--m-surface, #f8fafc);
        }
        .records-inline-filter > summary {
            cursor: pointer;
            font-weight: 600;
            font-size: .92rem;
            color: var(--m-text-muted, #64748b);
            user-select: none;
        }
        .records-inline-filter[open] > summary {
            margin-bottom: 10px;
        }
        .modal-footer-split {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }
        .modal-footer-actions {
            display: flex;
            gap: 8px;
            margin-left: auto;
        }
        .field-readonly {
            margin: 0;
            padding: 8px 10px;
            border-radius: var(--m-radius-sm);
            background: var(--m-surface, #f1f5f9);
            border: 1px solid var(--m-border);
        }
        .leave-view-details {
            display: grid;
            grid-template-columns: 120px 1fr;
            gap: 8px 16px;
            margin: 0;
        }
        .leave-view-details dt {
            font-weight: 600;
            color: var(--m-text-muted, #64748b);
        }
        .leave-view-details dd {
            margin: 0;
        }
        .movement-history-wrap {
            max-height: 420px;
        }
        .movement-qty-positive { color: #16a34a; font-weight: 600; }
        .movement-qty-negative { color: #dc2626; font-weight: 600; }
        .timesheet-upload-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 8px;
        }
        .timesheet-upload-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: var(--m-radius-sm);
            border: 1px solid var(--m-border);
            background: var(--m-surface);
        }
        .timesheet-upload-item.status-selected { border-color: #94a3b8; }
        .timesheet-upload-item.status-uploading { border-color: #2563eb; background: #eff6ff; }
        .timesheet-upload-item.status-uploaded { border-color: #16a34a; background: #f0fdf4; }
        .timesheet-upload-item.status-error { border-color: #dc2626; background: #fef2f2; }
        .timesheet-upload-meta { flex: 1; min-width: 0; }
        .timesheet-upload-meta strong {
            display: block;
            font-size: .88em;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .timesheet-upload-status { font-size: .78em; color: var(--m-text-muted, #64748b); }
        .timesheet-upload-item.status-uploaded .timesheet-upload-status { color: #16a34a; font-weight: 600; }
        .timesheet-upload-item.status-error .timesheet-upload-status { color: #dc2626; }
        .timesheet-upload-thumb {
            width: 40px;
            height: 40px;
            object-fit: cover;
            border-radius: 4px;
            border: 1px solid var(--m-border);
        }
        .timesheet-upload-actions { margin-top: 6px; }
        .timesheet-view-meta {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 8px 16px;
            margin-bottom: 12px;
            padding: 10px 12px;
            background: #fafafa;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            font-size: .88em;
        }
        .timesheet-view-meta p { margin: 0; }
        .timesheet-view-table-wrap {
            max-height: min(52vh, 480px);
            margin-bottom: 14px;
        }
        .timesheet-view-operators {
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding-top: 12px;
            border-top: 1px solid var(--m-border);
        }
        .timesheet-view-operator-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            background: #fff;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
        }
        .timesheet-view-operator-row strong { flex: 1 1 140px; min-width: 0; }
        .timesheet-view-operator-row small { color: var(--m-muted); }
        .timesheet-list-actions {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            align-items: center;
            gap: 4px;
            white-space: nowrap;
        }
        .timesheet-list-actions .btn-small {
            white-space: nowrap;
            padding: 3px 7px !important;
            font-size: 11px !important;
        }
        .timesheet-view-entry-table { margin-bottom: 0; }
        .timesheet-view-total-row td {
            background: #fff7ed !important;
            border-top: 2px solid #fed7aa !important;
        }
        .timesheet-view-section-title {
            margin: 14px 0 8px;
            font-size: .92em;
            font-weight: 600;
        }
        .equipment-map-picker {
            width: 100%;
            height: 220px;
            border-radius: var(--m-radius-sm);
            border: 1px solid var(--m-border);
            overflow: hidden;
            background: #e5e7eb;
        }

        .hrm-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
        }
        @media (max-width: 960px) {
            .hrm-grid { grid-template-columns: 1fr; }
        }
        .hrm-section h4 { margin: 0 0 8px; font-size: .88em; }
        .hrm-panel {
            max-height: 360px;
            overflow-y: auto;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            padding: 6px;
            background: #fafafa;
            font-size: 12px;
            line-height: 1.35;
        }
        .hrm-panel table.sticky-header-table th {
            background: #f3f4f6 !important;
            color: #6b7280 !important;
            font-size: 10px !important;
            padding: 6px 8px !important;
        }
        .hrm-panel table.sticky-header-table td {
            padding: 5px 8px !important;
            font-size: 12px !important;
            vertical-align: top;
        }
        .hrm-panel table.sticky-header-table td small {
            font-size: 10px;
            color: var(--m-muted);
        }
        .hrm-panel .btn-small {
            padding: 3px 7px !important;
            font-size: 11px !important;
        }
        .hrm-panel .action-buttons {
            white-space: nowrap;
        }

        /* Project switcher + session access */
        .project-switcher-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 0 0 auto;
            flex-wrap: nowrap;
            min-width: 0;
            min-height: 44px;
            padding: 0;
            border: none;
            border-radius: 0;
            background: transparent;
            font-size: .85rem;
            white-space: nowrap;
            position: relative;
        }
        .project-switcher-label { color: var(--m-muted); font-weight: 500; flex-shrink: 0; }
        .project-switcher-select {
            flex: 0 1 auto;
            min-width: 120px;
            max-width: 220px;
            min-height: 44px;
            padding: 6px 10px !important;
            font-size: .85rem !important;
            background: #fff !important;
            color: var(--m-text) !important;
            border: 1px solid var(--m-border) !important;
            border-radius: var(--m-radius-sm);
            box-shadow: none !important;
            cursor: pointer;
        }
        .project-current-label {
            display: none;
            font-weight: 600;
            color: var(--m-text);
            flex: 1 1 auto;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            pointer-events: none;
        }
        #manageProjectsBtn {
            position: relative;
            z-index: 3;
            flex-shrink: 0;
            pointer-events: auto;
        }
        @media (max-width: 640px) {
            .user-info-bar {
                flex-wrap: wrap;
                align-items: stretch;
                gap: 6px;
            }
            .user-info-left { order: 1; }
            .user-info-actions { order: 2; }
            .project-switcher-wrap {
                order: 3;
                flex: 1 1 100%;
                width: 100%;
                min-height: 44px;
                justify-content: flex-start;
                padding: 0 10px;
                border: 1px solid var(--m-border);
                border-radius: var(--m-radius-sm);
                background: var(--m-surface);
                cursor: pointer;
            }
            .project-switcher-label,
            .project-current-label {
                display: flex;
                align-items: center;
                pointer-events: none;
                position: relative;
                z-index: 1;
            }
            .project-switcher-select {
                position: absolute;
                inset: 0;
                width: 100%;
                height: 100%;
                max-width: none;
                min-width: 0;
                min-height: 44px;
                margin: 0;
                padding: 0 10px !important;
                opacity: 0;
                cursor: pointer;
                z-index: 2;
                -webkit-tap-highlight-color: transparent;
                font-size: 16px !important;
                -webkit-appearance: none;
                appearance: none;
            }
            #manageProjectsBtn {
                position: relative;
                z-index: 3;
                flex-shrink: 0;
                min-width: 44px;
                min-height: 44px;
                pointer-events: auto;
            }
        }
        .session-readonly-badge {
            padding: 2px 8px;
            border-radius: 10px;
            font-size: .72em;
            background: #fef3c7;
            color: #92400e;
            border: 1px solid #fcd34d;
        }
        .session-access-list {
            display: flex;
            flex-direction: column;
            gap: 0;
            max-height: 220px;
            overflow-y: auto;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: #fafafa;
            font-size: .88rem;
        }
        .session-access-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 10px 12px;
            border-bottom: 1px solid var(--m-border);
            cursor: pointer;
        }
        .session-access-row:last-child { border-bottom: none; }
        .session-access-row:hover { background: #f1f5f9; }
        .session-access-name {
            flex: 1;
            min-width: 0;
            font-weight: 500;
            color: var(--m-text);
        }
        .session-access-check {
            flex-shrink: 0;
            display: flex;
            align-items: center;
        }
        .session-access-check input[type="checkbox"] {
            width: 18px;
            height: 18px;
            margin: 0;
            cursor: pointer;
        }
        .session-access-option {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
        }

        .login-forgot-wrap {
            text-align: center;
            margin-top: 14px;
        }
        .login-forgot-link {
            background: none !important;
            border: none !important;
            color: var(--m-muted) !important;
            text-decoration: none !important;
            cursor: pointer;
            font-size: .9rem;
            padding: 0 !important;
            box-shadow: none !important;
            font-weight: 400 !important;
        }
        .login-forgot-link:hover {
            color: var(--m-text) !important;
            text-decoration: underline !important;
            background: none !important;
        }
        .login-back-wrap {
            text-align: center;
            margin: 20px 0 0;
            padding-top: 16px;
            border-top: 1px solid var(--m-border);
        }
        .login-back-link {
            color: var(--m-muted);
            text-decoration: none;
            font-size: .9rem;
            font-weight: 500;
        }
        .login-back-link:hover {
            color: var(--m-text);
            text-decoration: underline;
        }
        .password-input-wrap {
            position: relative;
            display: flex;
            align-items: stretch;
        }
        .password-input-wrap input {
            width: 100%;
            padding-right: 2.75rem;
        }
        .login-password-toggle {
            position: absolute;
            right: 4px;
            top: 50%;
            transform: translateY(-50%);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            padding: 0 !important;
            background: none !important;
            border: none !important;
            box-shadow: none !important;
            color: var(--m-muted) !important;
            cursor: pointer;
            border-radius: var(--m-radius-sm);
        }
        .login-password-toggle:hover {
            color: var(--m-text) !important;
            background: rgba(0, 0, 0, 0.04) !important;
        }
        .login-password-toggle .icon-eye-closed {
            display: none;
        }
        .login-password-toggle.is-visible .icon-eye-open {
            display: none;
        }
        .login-password-toggle.is-visible .icon-eye-closed {
            display: block;
        }

        /* Compact data tables — equipment, records, maintenance, inventory, reports */
        #equipmentList,
        #equipmentList table,
        #recordsList,
        #recordsList table,
        #maintenanceHistory,
        #maintenanceHistory table,
        #maintenanceEquipmentList,
        #maintenanceEquipmentList table,
        #inventoryList,
        #inventoryList table,
        #requisitionsList,
        #requisitionsList table,
        #reportContent,
        #reportContent table,
        .equipment-table-wrap table,
        .maint-history-table-panel table,
        .inventory-equal-table,
        .report-content-panel table {
            font-size: 12px;
            line-height: 1.35;
        }
        #equipmentList table.sticky-header-table th,
        #recordsList table.sticky-header-table th,
        #maintenanceHistory table.sticky-header-table th,
        #inventoryList table.sticky-header-table th,
        #requisitionsList table.sticky-header-table th,
        #reportContent table.sticky-header-table th,
        .equipment-table-wrap table th,
        .maint-history-table-panel table th {
            background: #f3f4f6 !important;
            color: #6b7280 !important;
            font-size: 10px !important;
            padding: 6px 8px !important;
        }
        #equipmentList table.sticky-header-table td,
        #recordsList table.sticky-header-table td,
        #maintenanceHistory table.sticky-header-table td,
        #inventoryList table.sticky-header-table td,
        #requisitionsList table.sticky-header-table td,
        #reportContent table.sticky-header-table td,
        .equipment-table-wrap table td,
        .maint-history-table-panel table td {
            padding: 5px 8px !important;
            font-size: 12px !important;
            vertical-align: top;
        }
        #equipmentList .btn-small,
        #recordsList .btn-small,
        #maintenanceHistory .btn-small,
        #inventoryList .btn-small,
        #requisitionsList .btn-small,
        #reportContent .btn-small {
            padding: 3px 7px !important;
            font-size: 11px !important;
        }

        .hrm-payroll-total {
            margin-top: 12px;
            padding: 10px 12px;
            background: #f0fdf4;
            border: 1px solid #bbf7d0;
            border-radius: var(--m-radius-sm);
            text-align: right;
        }

        /* Reports tab */
        .report-main-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }
        .report-main-tab {
            flex: 1;
            padding: 10px 14px;
            border: 1px solid var(--m-border) !important;
            border-radius: var(--m-radius-sm);
            background: #fff !important;
            color: var(--m-accent) !important;
            cursor: pointer;
            font-size: .9em;
            font-weight: 600;
        }
        .report-main-tab:hover {
            background: var(--m-accent-light) !important;
            color: var(--m-accent) !important;
        }
        .report-main-tab.active {
            background: var(--m-accent) !important;
            color: #fff !important;
            border-color: var(--m-accent) !important;
        }
        .schedule-equipment-multiselect {
            width: 100%;
            min-height: 140px;
            padding: 8px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            font-size: .9em;
        }
        .view-services-table { font-size: .88em; }
        .view-services-table td, .view-services-table th { padding: 8px 10px; }
        .reports-tab-card .report-controls {
            margin-bottom: 16px;
            padding: 14px;
            background: #f8fafc;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
        }
        .report-filter-row { align-items: flex-end; flex-wrap: wrap; gap: 12px; }
        .report-filter-row .form-group { flex: 1; min-width: 140px; margin-bottom: 0; }
        .report-type-tabs {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 14px;
        }
        .report-type-btn {
            flex: 1;
            min-width: 140px;
            padding: 10px 12px;
            border: 1px solid var(--m-border) !important;
            border-radius: var(--m-radius-sm);
            background: #fff !important;
            color: var(--m-accent) !important;
            cursor: pointer;
            font-size: .88em;
            font-weight: 600;
            transition: border-color .15s, background .15s, color .15s;
        }
        .report-type-btn:hover {
            border-color: var(--m-accent) !important;
            background: var(--m-accent-light) !important;
            color: var(--m-accent) !important;
        }
        .report-type-btn.active {
            border-color: var(--m-accent) !important;
            background: var(--m-accent) !important;
            color: #fff !important;
            font-weight: 600;
            box-shadow: none !important;
        }
        .report-controls-hint { margin-top: 10px; margin-bottom: 0; font-size: .82em; }
        .report-content-panel {
            max-height: 520px;
            overflow-x: auto;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            margin-top: 12px;
        }
        .report-table-wrap {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            max-width: 100%;
        }
        .report-output-header { margin-bottom: 12px; }
        .report-output-header h4 { margin: 0 0 4px; }
        .report-summary-row {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 16px;
        }
        .report-summary-card {
            flex: 1;
            min-width: 120px;
            padding: 10px 12px;
            text-align: center;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: var(--m-surface);
        }
        .report-summary-value { display: block; font-size: 1.1em; font-weight: 600; }
        .report-summary-label { display: block; font-size: .76em; color: var(--m-muted); margin-top: 2px; }
        .report-section-title { margin: 20px 0 8px; font-size: .95em; }
        .report-section { margin-bottom: 20px; }
        .report-section-heading {
            margin: 0 0 10px;
            font-size: 1em;
            font-weight: 600;
            color: var(--m-text);
        }
        .report-modal-section-title {
            margin: 18px 0 10px;
            font-size: .92em;
            font-weight: 600;
            color: var(--m-text);
        }
        .report-modal-section-title:first-child { margin-top: 0; }
        .report-equipment-modal .report-summary-row { margin-top: 8px; }
        .report-view-btn-wrap { flex: 0 0 auto; min-width: 100px; }
        .report-modal-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 12px 16px;
        }
        .report-modal-grid-compact { margin-bottom: 12px; }
        .report-modal-field-wide { grid-column: 1 / -1; }
        .report-modal-label {
            display: block;
            font-size: .76em;
            color: var(--m-muted);
            margin-bottom: 2px;
        }
        .report-service-job-block {
            padding: 12px;
            margin-bottom: 10px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            background: #f8fafc;
        }
        .report-parts-table { margin-top: 8px; font-size: .85em; }
        .report-service-sheet-totals {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            justify-content: flex-end;
            margin-top: 14px;
            padding-top: 12px;
            border-top: 1px solid var(--m-border);
            font-size: .92em;
        }
        .report-data-table { font-size: .82em; }

        /* Mobile: wide data tables scroll horizontally (maintenance history pattern) */
        @media (max-width: 768px) {
            .inventory-list-panel {
                min-height: 0;
                max-height: none;
                overflow: visible;
            }
            .inventory-list-table-body {
                overflow-x: auto !important;
                -webkit-overflow-scrolling: touch;
            }
            .scrollable-table-wrap,
            .table-responsive,
            .report-table-wrap,
            #requisitionsList.scrollable-panel,
            .inventory-requisitions-panel,
            .inventory-financial-panel,
            .report-content-panel,
            .maint-history-table-panel .scrollable-table-wrap,
            .hrm-panel-full .scrollable-table-wrap,
            .hrm-panel-full .table-responsive {
                overflow-x: auto !important;
                -webkit-overflow-scrolling: touch;
                max-width: 100%;
            }
            .scrollable-table-wrap > table.sticky-header-table,
            .table-responsive > table.sticky-header-table,
            .report-table-wrap > table.sticky-header-table,
            #requisitionsList > .scrollable-table-wrap > table.sticky-header-table,
            #inventoryList .inventory-parts-table,
            #maintenanceHistory table.sticky-header-table {
                table-layout: auto !important;
                min-width: 720px;
                width: 100%;
            }
            .hrm-payroll-table {
                min-width: 920px;
            }
            #inventoryList .inventory-part-cell {
                max-width: none;
                min-width: 120px;
            }
            #inventoryList .inventory-actions-cell {
                min-width: 140px;
            }
        }

        .role-badge.overdue, .role-badge.critical { background: #fef2f2 !important; color: #dc2626 !important; border: 1px solid #fecaca !important; }
        .role-badge.warning { background: #fefce8 !important; color: #ca8a04 !important; border: 1px solid #fef08a !important; }
        .role-badge.on-track, .role-badge.success { background: #f0fdf4 !important; color: #16a34a !important; border: 1px solid #bbf7d0 !important; }
        .role-badge.approaching { background: #eff6ff !important; color: #2563eb !important; border: 1px solid #bfdbfe !important; }

        .low-stock-chart { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: hidden; }
        .low-stock-chart-row { display: grid; grid-template-columns: minmax(0, 1fr) 1.2fr auto; gap: 8px; align-items: center; font-size: .78em; }
        .low-stock-chart-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--m-text); }
        .low-stock-chart-bar-wrap { height: 10px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
        .low-stock-chart-bar { height: 100%; border-radius: 4px; }
        .low-stock-chart-bar.low { background: #ca8a04; }
        .low-stock-chart-bar.out { background: #dc2626; }
        .low-stock-chart-qty { font-size: .85em; color: var(--m-muted); white-space: nowrap; }
        .dashboard-side-panel { max-height: 240px !important; overflow-y: auto !important; }

        /* Main tab menu — orange filled style (matches report sub-tabs) */
        body.app-logged-in #mainNav.nav button.nav-tab-btn,
        body.app-logged-in .nav-container .nav button.nav-tab-btn {
            background: #fff !important;
            color: var(--m-accent) !important;
            border: 1px solid var(--m-border) !important;
            box-shadow: none !important;
            font-weight: 600 !important;
        }
        body.app-logged-in #mainNav.nav button.nav-tab-btn:hover,
        body.app-logged-in .nav-container .nav button.nav-tab-btn:hover {
            background: var(--m-accent-light) !important;
            color: var(--m-accent) !important;
        }
        body.app-logged-in #mainNav.nav button.nav-tab-btn.active,
        body.app-logged-in .nav-container .nav button.nav-tab-btn.active {
            background: var(--m-accent) !important;
            color: #fff !important;
            font-weight: 600 !important;
            border-color: var(--m-accent) !important;
            box-shadow: none !important;
        }
        body.app-logged-in .nav-container .nav {
            background: #fff !important;
        }

        /* User management modal */
        .user-mgmt-modal { max-width: min(920px, 96vw); }
        .user-create-modal { max-width: min(560px, 96vw); }
        .user-mgmt-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }
        .user-mgmt-header-actions {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .user-mgmt-body { padding-top: 0; }
        .user-mgmt-role-hint { margin: 0 0 12px; }
        .user-mgmt-form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px 12px;
        }
        .user-mgmt-form-grid-full { grid-column: 1 / -1; }
        .user-mgmt-form-grid-3 { grid-template-columns: repeat(3, 1fr); }
        .user-mgmt-form-grid .form-group { margin-bottom: 0; }
        .user-mgmt-form-grid label,
        .user-mgmt-create-form label { font-size: .82em; margin-bottom: 4px; }
        .user-mgmt-users-list { max-height: 420px; overflow: auto; }
        .user-mgmt-table-wrap { max-height: 400px; }
        .user-mgmt-table { font-size: .86em; }
        .user-mgmt-table td, .user-mgmt-table th { padding: 8px 10px; white-space: nowrap; }
        .user-edit-modal .modal-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }
        .user-edit-footer-left { margin-right: auto; }
        .user-edit-footer-right { display: flex; gap: 8px; }
        .user-mgmt-password-details {
            margin-top: 14px;
            border: 1px solid var(--m-border);
            border-radius: var(--m-radius-sm);
            padding: 10px 12px;
        }
        .user-mgmt-password-details summary { cursor: pointer; font-weight: 600; font-size: .9em; }
        .user-mgmt-password-form { margin-top: 10px; }
        @media (max-width: 700px) {
            .user-mgmt-form-grid-3 { grid-template-columns: 1fr; }
            .user-mgmt-form-grid { grid-template-columns: 1fr; }
        }

        .role-badge.company { background: #e2e8f0; color: #475569; }
        .role-badge.fleet_admin { background: #dbeafe; color: #1d4ed8; }
        .role-badge.inventory_clerk { background: #fef3c7; color: #b45309; }
        .role-badge.superadmin { background: #fce7f3; color: #be185d; }

