        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: transparent;
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1600px;
            margin: 0 auto;
            background: white;
            border-radius: 15px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
            overflow: hidden;
        }

        .header {
            background: #f8f9fa;
            color: white;
            padding: 30px;
            text-align: center;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .header-content {
            text-align: center;
        }

        .header-main-logo {
            max-width: 100%;
            height: auto;
            max-height: 80px;
            margin-bottom: 15px;
        }

        .header-subtitle {
            color: #2c3e50;
            font-size: 1.2rem;
            font-weight: bold;
            margin: 0;
        }

        .logout-icon-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: #95a5a6;
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: white;
            transition: background-color 0.3s ease;
        }

        .logout-icon-btn:hover {
            background: #7f8c8d;
        }

        .header h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
        }

        /* Tab Navigation Styles */
        .tab-navigation {
            display: flex;
            background: #f8f9fa;
            border-bottom: 1px solid #dee2e6;
            margin: 0;
            padding: 10px;
            gap: 5px;
        }

        .tab-button {
            flex: 1;
            padding: 15px 20px;
            background: #e9ecef;
            border: 2px solid #dee2e6;
            border-radius: 10px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 600;
            color: #6c757d;
            transition: all 0.3s ease;
            position: relative;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .tab-button:hover {
            background: #f8f9fa;
            color: #495057;
            border-color: #adb5bd;
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        }

        .tab-button.active {
            background: #34495e;
            color: white;
            border-color: #34495e;
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(52, 73, 94, 0.3);
            z-index: 1;
        }

        .tab-content {
            display: none;
            animation: fadeIn 0.3s ease-in-out;
        }

        .tab-content.active {
            display: block;
        }

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

        /* NSI Sub-navigation Styles */
        .nsi-sub-navigation {
            display: flex;
            background: #f8f9fa;
            border-bottom: 2px solid #dee2e6;
            margin: 0;
            padding: 0 20px;
            gap: 5px;
        }

        .nsi-sub-button {
            padding: 12px 20px;
            background: transparent;
            border: none;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: #6c757d;
            transition: all 0.3s ease;
            border-bottom: 3px solid transparent;
            border-radius: 6px 6px 0 0;
        }

        .nsi-sub-button:hover {
            background: #e9ecef;
            color: #495057;
        }

        .nsi-sub-button.active {
            background: white;
            color: #2c3e50;
            border-bottom-color: #3498db;
        }

        .nsi-sub-content {
            display: none;
            animation: fadeIn 0.3s ease-in-out;
        }

        .nsi-sub-content.active {
            display: block;
        }

        /* Image Upload Styles */
        .image-upload-container {
            margin-top: 15px;
        }

        .image-upload-area {
            border: 2px dashed #ddd;
            border-radius: 8px;
            padding: 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            background: #fafafa;
        }

        .image-upload-area:hover {
            border-color: #3498db;
            background: #f0f8ff;
        }

        .image-upload-area.dragover {
            border-color: #3498db;
            background: #e3f2fd;
        }

        .image-upload-input {
            display: none;
        }

        .image-preview-container {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 15px;
        }

        .image-preview {
            position: relative;
            display: inline-block;
        }

        .image-preview img {
            width: 100px;
            height: 100px;
            object-fit: cover;
            border-radius: 8px;
            border: 2px solid #ddd;
        }

        .image-preview-remove {
            position: absolute;
            top: -8px;
            right: -8px;
            background: #e74c3c;
            color: white;
            border: none;
            border-radius: 50%;
            width: 24px;
            height: 24px;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .image-preview-remove:hover {
            background: #c0392b;
        }

        .image-gallery {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
        }

        .image-thumbnail {
            width: 40px;
            height: 40px;
            object-fit: cover;
            border-radius: 4px;
            border: 1px solid #ddd;
            cursor: pointer;
            transition: transform 0.2s ease;
        }

        .image-thumbnail:hover {
            transform: scale(1.1);
        }

        /* Image Modal Styles */
        .image-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.8);
            z-index: 2000;
            cursor: pointer;
        }

        .image-modal img {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            max-width: 90%;
            max-height: 90%;
            border-radius: 8px;
        }

        .image-modal-close {
            position: absolute;
            top: 20px;
            right: 30px;
            color: white;
            font-size: 40px;
            font-weight: bold;
            cursor: pointer;
        }

        .stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            padding: 30px;
            background: #f8f9fa;
        }

        .stat-card {
            background: white;
            padding: 20px;
            border-radius: 10px;
            text-align: center;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            transition: transform 0.3s ease;
        }

        .stat-card:hover {
            transform: translateY(-5px);
        }

        .stat-number {
            font-size: 2rem;
            font-weight: bold;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        .stat-label {
            color: #7f8c8d;
            font-size: 0.9rem;
        }

        .overdue {
            color: #e74c3c;
        }

        .due-soon {
            color: #f39c12;
        }

        .current {
            color: #27ae60;
        }

        .controls {
            padding: 30px;
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            align-items: center;
            background: white;
            border-bottom: 1px solid #eee;
        }

        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .btn-primary {
            background: #3498db;
            color: white;
        }

        .btn-primary:hover:not(:disabled) {
            background: #2980b9;
            transform: translateY(-2px);
        }

        .btn-success {
            background: #27ae60;
            color: white;
        }

        .btn-success:hover:not(:disabled) {
            background: #229954;
        }

        .btn-danger {
            background: #e74c3c;
            color: white;
        }

        .btn-danger:hover:not(:disabled) {
            background: #c0392b;
        }

        .btn-warning {
            background: #f39c12;
            color: white;
        }

        .btn-warning:hover:not(:disabled) {
            background: #e67e22;
        }

        .search-filter {
            flex: 1;
            min-width: 300px;
            display: flex;
            gap: 10px;
        }

        .search-input {
            flex: 1;
            padding: 12px;
            border: 2px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
        }

        .search-input:focus {
            outline: none;
            border-color: #3498db;
        }

        .filter-select {
            padding: 12px;
            border: 2px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
            min-width: 150px;
        }

        .table-container {
            overflow-x: auto;
            padding: 0 30px 30px;
        }

        .customer-table {
            width: 100%;
            border-collapse: collapse;
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }

        /* Mobile card layout for customers */
        .mobile-customer-cards {
            display: none;
            padding: 0 20px 30px;
        }

        /* Force mobile layout class */
        .force-mobile .table-container {
            display: none !important;
        }

        .force-mobile .mobile-customer-cards {
            display: block !important;
        }

        /* Show mobile cards by default on small screens */
        @media (max-width: 900px) {
            .table-container {
                display: none !important;
            }

            .mobile-customer-cards {
                display: block !important;
            }
        }

        .customer-card {
            background: white;
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 15px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .customer-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 15px;
        }

        .customer-name {
            font-size: 1.2rem;
            font-weight: bold;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        .customer-details {
            font-size: 0.9rem;
            color: #7f8c8d;
            line-height: 1.6;
        }
        
        /* Enhanced spacing for NSI mobile cards */
        .nsi-sub-content .customer-details {
            line-height: 1.8;
        }
        
        .nsi-sub-content .customer-details br {
            line-height: 2.2;
        }

        .customer-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .customer-actions .btn {
            padding: 8px 12px;
            font-size: 12px;
            min-height: auto;
        }

        .customer-table th {
            background: #34495e;
            color: white;
            padding: 15px;
            text-align: left;
            font-weight: 600;
            cursor: pointer;
            user-select: none;
            position: relative;
        }

        .customer-table th:hover {
            background: #2c3e50;
        }

        .customer-table th.sortable::after {
            content: '↕';
            position: absolute;
            right: 10px;
            opacity: 0.5;
        }

        .customer-table th.sort-asc::after {
            content: '↑';
            opacity: 1;
        }

        .customer-table th.sort-desc::after {
            content: '↓';
            opacity: 1;
        }

        .customer-table td {
            padding: 15px;
            border-bottom: 1px solid #eee;
            vertical-align: middle;
            word-wrap: break-word;
            overflow: hidden;
        }

        .customer-table tr:hover {
            background: #f8f9fa;
        }

        .status-badge {
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: bold;
            text-transform: uppercase;
        }

        .status-current {
            background: #d5edda;
            color: #155724;
        }

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

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

        .status-can-be-done {
            background: #d1ecf1;
            color: #0c5460;
        }

        .status-due-last-month {
            background: #f5c6cb;
            color: #721c24;
        }

        .status-completed {
            background: #d1ecf1;
            color: #0c5460;
        }

        /* Complaint Status Badges */
        .status-open {
            background: rgba(231, 76, 60, 0.2); /* Faded red */
            color: #c0392b;
            border: 1px solid rgba(231, 76, 60, 0.3);
        }

        .status-investigating {
            background: rgba(243, 156, 18, 0.2); /* Faded amber */
            color: #d68910;
            border: 1px solid rgba(243, 156, 18, 0.3);
        }

        .status-resolved {
            background: rgba(39, 174, 96, 0.2); /* Faded green */
            color: #27ae60;
            border: 1px solid rgba(39, 174, 96, 0.3);
        }

        .status-closed {
            background: rgba(52, 73, 94, 0.2); /* Faded dark blue */
            color: #2c3e50;
            border: 1px solid rgba(52, 73, 94, 0.3);
        }

        /* ID Badge Status Colors */
        .status-active {
            background: rgba(39, 174, 96, 0.2); /* Faded green */
            color: #27ae60;
            border: 1px solid rgba(39, 174, 96, 0.3);
        }

        .status-expired {
            background: rgba(231, 76, 60, 0.2); /* Faded red */
            color: #c0392b;
            border: 1px solid rgba(231, 76, 60, 0.3);
        }

        .status-revoked {
            background: rgba(52, 73, 94, 0.2); /* Faded dark blue */
            color: #2c3e50;
            border: 1px solid rgba(52, 73, 94, 0.3);
        }

        /* Test Equipment Status Colors */
        .status-calibrated {
            background: rgba(39, 174, 96, 0.2); /* Faded green */
            color: #27ae60;
            border: 1px solid rgba(39, 174, 96, 0.3);
        }

        .status-due-calibration {
            background: rgba(243, 156, 18, 0.2); /* Faded amber */
            color: #d68910;
            border: 1px solid rgba(243, 156, 18, 0.3);
        }

        .status-overdue {
            background: rgba(231, 76, 60, 0.2); /* Faded red */
            color: #c0392b;
            border: 1px solid rgba(231, 76, 60, 0.3);
        }

        /* First Aid Status Colors */
        .status-due-soon {
            background: rgba(243, 156, 18, 0.2); /* Faded amber */
            color: #d68910;
            border: 1px solid rgba(243, 156, 18, 0.3);
        }

        .inspection-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-top: 10px;
        }

        .inspection-card {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 6px;
            padding: 10px;
        }

        .inspection-title {
            font-weight: bold;
            margin-bottom: 5px;
            color: #2c3e50;
        }

        .completion-history {
            margin-top: 10px;
            font-size: 12px;
            color: #6c757d;
        }

        .completion-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 2px;
        }

        .monthly-stats-container {
            padding: 30px;
            background: #f8f9fa;
            border-bottom: 1px solid #eee;
        }

        .monthly-stats-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .monthly-stats-header h3 {
            margin: 0;
            color: #2c3e50;
        }

        .monthly-stats {
            transition: all 0.3s ease;
        }

        .monthly-stats.hidden {
            display: none;
        }

        .monthly-carousel {
            position: relative;
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 30px;
        }

        .monthly-grid-container {
            flex: 1;
            overflow: hidden;
        }

        .monthly-grid {
            display: flex;
            gap: 20px;
            transition: transform 0.3s ease;
            min-height: 200px;
        }

        .carousel-btn {
            background: #3498db;
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            font-size: 20px;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.3s ease;
            flex-shrink: 0;
        }

        .carousel-btn:hover {
            background: #2980b9;
        }

        .carousel-btn:disabled {
            background: #bdc3c7;
            cursor: not-allowed;
        }

        .monthly-card {
            background: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            text-align: center;
            min-width: 350px;
            flex-shrink: 0;
        }

        .monthly-card h4 {
            color: #2c3e50;
            margin-bottom: 10px;
            font-size: 1.1rem;
        }

        .monthly-numbers {
            display: flex;
            justify-content: space-around;
            margin: 15px 0;
        }

        .monthly-stat {
            text-align: center;
        }

        .monthly-stat-number {
            font-size: 1.5rem;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .monthly-stat-label {
            font-size: 0.8rem;
            color: #7f8c8d;
        }

        .on-time {
            color: #27ae60;
        }

        .late {
            color: #e74c3c;
        }

        .completion-chart {
            background: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            margin-top: 20px;
        }

        .chart-bar {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            gap: 10px;
        }

        .chart-label {
            min-width: 80px;
            font-weight: 500;
            color: #2c3e50;
        }

        .chart-bar-container {
            flex: 1;
            background: #ecf0f1;
            border-radius: 10px;
            height: 20px;
            overflow: hidden;
        }

        .chart-bar-fill {
            height: 100%;
            border-radius: 10px;
            transition: width 0.3s ease;
        }

        .chart-bar-fill.on-time {
            background: #27ae60;
        }

        .chart-bar-fill.can-be-done {
            background: #f39c12;
        }

        .chart-bar-fill.late {
            background: #e74c3c;
        }

        .chart-percentage {
            min-width: 60px;
            text-align: right;
            font-weight: 500;
            color: #2c3e50;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
        }

        .modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 30px;
            border-radius: 10px;
            width: 90%;
            max-width: 600px;
            max-height: 90vh;
            overflow-y: auto;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: 500;
            color: #2c3e50;
        }

        .form-group input,
        .form-group select,
        .form-group textarea {
            width: 100%;
            padding: 10px;
            border: 2px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
            background-color: white;
        }

        .form-group select {
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 12px center;
            background-size: 16px;
            padding-right: 40px;
        }

        .form-group select:focus {
            outline: none;
            border-color: #3498db;
        }

        .form-group textarea {
            resize: vertical;
            min-height: 80px;
        }

                 .form-row {
             display: grid;
             grid-template-columns: 1fr 1fr;
             gap: 15px;
         }
         
         .battery-grid {
             display: grid;
             grid-template-columns: 1fr 1fr 1fr;
             gap: 15px;
             margin-top: 10px;
         }
         
         .battery-item {
             display: flex;
             flex-direction: column;
         }
         
         .battery-item label {
             font-size: 0.9rem;
             margin-bottom: 5px;
             color: #2c3e50;
             font-weight: 500;
         }
         
         .battery-item input {
             padding: 8px;
             border: 2px solid #ddd;
             border-radius: 6px;
             font-size: 14px;
         }

        .form-actions {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            margin-top: 30px;
        }

        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: #7f8c8d;
        }

        .empty-state h3 {
            font-size: 1.5rem;
            margin-bottom: 15px;
        }

        .loading {
            display: none;
            text-align: center;
            padding: 20px;
            color: #666;
        }

        .error-message {
            background: #f8d7da;
            color: #721c24;
            padding: 15px;
            border-radius: 6px;
            margin: 20px;
            display: none;
        }

        .success-message {
            background: #d5edda;
            color: #155724;
            padding: 15px;
            border-radius: 6px;
            margin: 20px;
            display: none;
        }

        .completion-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
        }

        .completion-modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 30px;
            border-radius: 10px;
            width: 90%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
        }

        .modal-close {
            position: absolute;
            top: 15px;
            right: 20px;
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #666;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.3s ease;
        }

        .modal-close:hover {
            background: #f0f0f0;
            color: #333;
        }

        /* Mobile Footer Tab Navigation */
        .mobile-footer-tabs {
            display: none;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: #f8f9fa;
            border-top: 1px solid #dee2e6;
            z-index: 1000;
            padding: 0;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            justify-content: space-around;
        }

        .mobile-tab-button {
            flex: 1;
            background: transparent;
            border: none;
            color: #6c757d;
            padding: 12px 8px 8px 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 60px;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
        }

        .mobile-tab-button.active {
            color: #34495e;
            background: rgba(52, 73, 94, 0.1);
        }

        .mobile-tab-button:active {
            transform: scale(0.95);
        }

        .mobile-tab-icon {
            margin-bottom: 4px;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .mobile-tab-icon svg {
            width: 20px;
            height: 20px;
        }

        .mobile-tab-label {
            font-size: 11px;
            font-weight: 500;
            line-height: 1;
        }

        @media (max-width: 768px), (max-height: 768px), (orientation: portrait) {
            .header {
                padding: 20px;
            }

            /* Hide top tab navigation on mobile */
            .tab-navigation {
                display: none !important;
            }

            /* Show mobile footer tabs */
            .mobile-footer-tabs {
                display: flex !important;
            }

            /* Add bottom padding to content to account for footer tabs */
            .container {
                padding-bottom: 70px;
                min-height: 100vh;
                width: 100%;
                max-width: 100%;
            }
            
            /* Hide tables and show mobile cards in portrait/small screens */
            .table-container {
                display: none !important;
            }
            
            /* Force mobile cards to show */
            .mobile-customer-cards {
                display: block !important;
            }
            
            /* Fix NSI content visibility in portrait mode - only show active sub-content */
            .nsi-sub-content {
                display: none !important;
            }
            
            .nsi-sub-content.active {
                display: block !important;
                width: 100% !important;
                min-height: 300px !important;
                visibility: visible !important;
            }
            
            /* Show NSI mobile cards only when their parent sub-content is active */
            .nsi-sub-content.active #mobileComplaintCards,
            .nsi-sub-content.active #mobileIdBadgeCards,
            .nsi-sub-content.active #mobileTestEquipCards,
            .nsi-sub-content.active #mobileFirstAidCards {
                display: block !important;
                visibility: visible !important;
                width: 100% !important;
                padding: 0 20px 30px !important;
            }
            
            /* Enhanced line spacing for NSI mobile cards on mobile */
            .nsi-sub-content .customer-card .customer-details {
                line-height: 1.9 !important;
                margin-bottom: 15px;
            }
            
            .nsi-sub-content .customer-card .customer-details strong {
                display: inline-block;
                margin-bottom: 3px;
                margin-top: 2px;
            }
            
            /* Add space after each info line in NSI mobile cards */
            .nsi-sub-content .customer-card .customer-details br {
                display: block;
                margin-bottom: 6px;
                content: "";
            }
            
            /* Alternative approach: style each line as a block */
            .nsi-info-line {
                display: block;
                margin-bottom: 8px;
                line-height: 1.5;
            }
            
            /* Hide NSI mobile cards when their parent sub-content is not active */
            .nsi-sub-content:not(.active) #mobileComplaintCards,
            .nsi-sub-content:not(.active) #mobileIdBadgeCards,
            .nsi-sub-content:not(.active) #mobileTestEquipCards,
            .nsi-sub-content:not(.active) #mobileFirstAidCards {
                display: none !important;
            }
            
            /* NSI sub-navigation mobile styles */
            .nsi-sub-navigation {
                flex-wrap: wrap;
                padding: 10px;
                gap: 8px;
            }
            
            .nsi-sub-button {
                flex: 1;
                min-width: calc(50% - 4px);
                padding: 12px 8px;
                font-size: 13px;
                text-align: center;
                min-height: 44px;
                touch-action: manipulation;
                -webkit-tap-highlight-color: transparent;
            }
            
            .nsi-sub-button:active {
                transform: scale(0.95);
            }

            .header-main-logo {
                max-height: 60px;
                margin-bottom: 10px;
            }

            .header-subtitle {
                font-size: 1rem;
            }

            .logout-icon-btn {
                width: 35px;
                height: 35px;
                top: 10px;
                right: 10px;
            }

            .logout-icon-btn svg {
                width: 16px;
                height: 16px;
            }

            /* Hide monthly stats by default on mobile */
            .monthly-stats {
                display: none;
            }

            .monthly-stats-header {
                flex-direction: column;
                gap: 10px;
                align-items: flex-start;
            }

            .monthly-stats-header h3 {
                font-size: 1.3rem;
            }

            .controls {
                flex-direction: column;
                align-items: stretch;
            }

            .search-filter {
                min-width: auto;
                flex-direction: column;
                gap: 15px;
            }

            /* These rules are now handled above in the main mobile media query */

            .customer-table {
                font-size: 12px;
            }

            .customer-table th,
            .customer-table td {
                padding: 8px;
            }

            .inspection-grid {
                grid-template-columns: 1fr;
            }

                         .form-row {
                 grid-template-columns: 1fr;
             }
             
             .battery-grid {
                 grid-template-columns: 1fr;
                 gap: 10px;
             }

            /* Mobile-specific improvements */
            .btn {
                padding: 15px 20px;
                font-size: 16px;
                min-height: 44px;
                touch-action: manipulation;
            }

            .modal-content {
                width: 95%;
                max-width: none;
                margin: 10px;
                padding: 20px;
            }

            .completion-modal-content {
                width: 95%;
                max-width: none;
                margin: 10px;
                padding: 20px;
                max-height: 85vh;
                top: 50%;
                transform: translate(-50%, -50%);
            }

            .form-group input,
            .form-group select,
            .form-group textarea {
                font-size: 16px;
                padding: 12px;
                min-height: 44px;
            }

            /* Mobile dropdown filter improvements */
            .filter-select {
                font-size: 16px;
                padding: 15px 12px;
                min-height: 44px;
                min-width: auto;
                width: 100%;
                border: 2px solid #ddd;
                border-radius: 6px;
                background-color: white;
                appearance: none;
                background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
                background-repeat: no-repeat;
                background-position: right 12px center;
                background-size: 16px;
                padding-right: 40px;
                touch-action: manipulation;
            }

            .filter-select:focus {
                outline: none;
                border-color: #3498db;
                box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
            }

            .search-input {
                font-size: 16px;
                padding: 15px 12px;
                min-height: 44px;
                border: 2px solid #ddd;
                border-radius: 6px;
                touch-action: manipulation;
            }

            .search-input:focus {
                outline: none;
                border-color: #3498db;
                box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
            }

            .stats {
                grid-template-columns: 1fr 1fr;
                gap: 15px;
                padding: 20px;
            }

            .stat-card {
                padding: 15px;
            }

            .stat-number {
                font-size: 1.2rem;
            }

            .stat-label {
                font-size: 0.8rem;
            }

            .monthly-grid {
                grid-template-columns: 1fr;
                gap: 15px;
            }

            .monthly-card {
                padding: 15px;
                min-width: 250px;
            }

            .monthly-carousel {
                gap: 10px;
            }

            .carousel-btn {
                width: 35px;
                height: 35px;
                font-size: 18px;
            }

            .monthly-numbers {
                flex-direction: column;
                gap: 10px;
            }

            .chart-bar {
                flex-direction: column;
                align-items: stretch;
                gap: 5px;
            }

            .chart-label {
                min-width: auto;
                text-align: center;
            }

            .chart-percentage {
                min-width: auto;
                text-align: center;
            }


        }

        /* PWA-specific styles */
        @media (display-mode: standalone) {
            body {
                padding: 0;
            }
            
            .container {
                border-radius: 0;
                min-height: 100vh;
            }

            /* Always show mobile footer tabs in PWA mode */
            .mobile-footer-tabs {
                display: flex !important;
            }

            /* Hide top navigation in PWA mode */
            .tab-navigation {
                display: none !important;
            }

            /* Add bottom padding for PWA footer tabs */
            .container {
                padding-bottom: 70px !important;
            }
        }

        /* Prevent zoom on input focus (iOS) */
        @media screen and (-webkit-min-device-pixel-ratio: 0) {
            select,
            textarea,
            input {
                font-size: 16px;
            }
        }

        @media (max-width: 768px) {
            /* Hide main tab Add buttons on mobile, but keep NSI sub-page buttons */
            .tab-content:not(#nsiTab) .controls .btn-primary {
                display: none;
            }
        }
        

        /* Splash Screen Styles */
        .splash-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: white;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 15000;
            animation: fadeOut 0.5s ease-in-out 2s forwards;
        }

        .splash-logo {
            width: 120px;
            height: 120px;
            background-image: url('icons/web-app-manifest-192x192.png');
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
            animation: logoFadeIn 1s ease-in-out, logoPulse 2s ease-in-out infinite;
            margin-bottom: 20px;
        }

        .splash-text {
            font-size: 1.5rem;
            font-weight: 600;
            color: #1E1B5C;
            animation: textFadeIn 1s ease-in-out 0.5s both;
        }

        .splash-subtitle {
            font-size: 1rem;
            color: #666;
            margin-top: 10px;
            animation: textFadeIn 1s ease-in-out 1s both;
        }

        /* Alex Message Screen */
        .alex-message-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(180deg, #0a0e27 0%, #1a1a3e 50%, #0a0e27 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 14500;
            opacity: 0;
            visibility: hidden;
            animation: alexScreenSequence 6s ease-in-out forwards;
            overflow: hidden;
        }

        .alex-message-screen::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image:
                radial-gradient(2px 2px at 20% 30%, white, transparent),
                radial-gradient(2px 2px at 60% 70%, white, transparent),
                radial-gradient(1px 1px at 50% 50%, white, transparent),
                radial-gradient(1px 1px at 80% 10%, white, transparent),
                radial-gradient(2px 2px at 90% 60%, white, transparent),
                radial-gradient(1px 1px at 33% 80%, white, transparent),
                radial-gradient(1px 1px at 15% 90%, white, transparent),
                radial-gradient(2px 2px at 75% 40%, white, transparent),
                radial-gradient(1px 1px at 40% 20%, white, transparent),
                radial-gradient(1px 1px at 95% 85%, white, transparent);
            background-size: 200% 200%;
            background-position: 0% 0%;
            animation: stars 120s linear infinite;
            opacity: 0.8;
        }

        .alex-message {
            font-size: 2rem;
            font-weight: 600;
            color: #ff69b4;
            text-align: center;
            padding: 40px;
            text-shadow: 0 0 10px rgba(255, 105, 180, 0.5), 0 0 20px rgba(255, 105, 180, 0.3);
            animation: messageGlow 2s ease-in-out infinite, messageFloat 3s ease-in-out infinite;
            position: relative;
            z-index: 1;
        }

        @keyframes alexScreenSequence {
            0% { opacity: 0; visibility: hidden; }
            41.6% { opacity: 0; visibility: hidden; }  /* 2.5s delay */
            50% { opacity: 1; visibility: visible; }    /* 0.5s fade in (at 3s) */
            91.6% { opacity: 1; visibility: visible; }  /* stays until 5.5s */
            100% { opacity: 0; visibility: hidden; }    /* 0.5s fade out */
        }

        @keyframes stars {
            0% { background-position: 0% 0%; }
            100% { background-position: 100% 100%; }
        }

        @keyframes messageGlow {
            0%, 100% {
                text-shadow: 0 0 10px rgba(255, 105, 180, 0.5), 0 0 20px rgba(255, 105, 180, 0.3);
            }
            50% {
                text-shadow: 0 0 20px rgba(255, 105, 180, 0.8), 0 0 30px rgba(255, 105, 180, 0.5), 0 0 40px rgba(255, 105, 180, 0.3);
            }
        }

        @keyframes messageFloat {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
        }

        @keyframes logoFadeIn {
            0% { opacity: 0; transform: scale(0.5); }
            100% { opacity: 1; transform: scale(1); }
        }

        @keyframes logoPulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

        @keyframes textFadeIn {
            0% { opacity: 0; transform: translateY(20px); }
            100% { opacity: 1; transform: translateY(0); }
        }

        @keyframes fadeOut {
            0% { opacity: 1; }
            100% { opacity: 0; visibility: hidden; }
        }

        /* Login Screen Styles */
        .login-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: white;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
        }

        .login-container {
            background: white;
            padding: 40px;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            text-align: center;
            max-width: 400px;
            width: 90%;
            border: 1px solid #f0f0f0;
        }

        .login-logo {
            width: 80px;
            height: 80px;
            background-image: url('icons/web-app-manifest-192x192.png');
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
            margin: 0 auto 20px auto;
            animation: logoFadeIn 0.8s ease-in-out;
        }

        .login-header h1 {
            color: #1E1B5C;
            margin-bottom: 10px;
            font-size: 1.8rem;
            font-weight: 600;
        }

        .login-header p {
            color: #7f8c8d;
            margin-bottom: 30px;
        }

        .login-form .form-group {
            margin-bottom: 20px;
            text-align: left;
        }

        .login-form .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #2c3e50;
        }

        .login-form .form-group input {
            width: 100%;
            padding: 15px;
            border: 2px solid #ddd;
            border-radius: 8px;
            font-size: 16px;
            box-sizing: border-box;
        }

        .login-form .form-group input:focus {
            outline: none;
            border-color: #3498db;
        }

        .login-form .btn {
            width: 100%;
            padding: 15px;
            font-size: 16px;
            margin-bottom: 15px;
        }

        .login-error {
            background: #f8d7da;
            color: #721c24;
            padding: 10px;
            border-radius: 6px;
            font-size: 14px;
        }

        @media (max-width: 768px) {
            .login-container {
                padding: 30px 20px;
                margin: 20px;
            }

            .login-header h1 {
                font-size: 1.8rem;
            }
        }

        /* Help Tab Styles */
        .help-container {
            width: 100%;
            padding: 20px;
            text-align: center;
        }

        .help-subtabs {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-bottom: 30px;
            margin-top: 10px;
            flex-wrap: wrap;
        }

        .help-subtab-button {
            padding: 12px 24px;
            border: 2px solid #ddd;
            background: white;
            color: #555;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
            font-weight: 500;
            transition: all 0.3s ease;
        }

        .help-subtab-button:hover {
            border-color: #3498db;
            color: #3498db;
        }

        .help-subtab-button.active {
            background: #3498db;
            color: white;
            border-color: #3498db;
        }

        .help-subtab-content {
            display: none;
        }

        .help-subtab-content.active {
            display: block;
        }

        .help-section {
            background: white;
            border-radius: 12px;
            padding: 25px;
            margin-bottom: 25px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            text-align: center;
        }

        .help-section h3 {
            color: #2c3e50;
            font-size: 1.5rem;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid #3498db;
        }

        .help-intro {
            color: #555;
            font-size: 1rem;
            margin-bottom: 20px;
            padding: 15px;
            background: #f8f9fa;
            border-left: 4px solid #3498db;
            border-radius: 4px;
            text-align: center;
        }

        .help-category {
            margin-bottom: 25px;
            text-align: center;
        }

        .help-category h4 {
            color: #34495e;
            font-size: 1.2rem;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .help-category ul {
            list-style: none;
            padding-left: 0;
            display: inline-block;
            text-align: left;
        }

        .help-category > ul > li {
            padding: 10px 0 10px 30px;
            position: relative;
            color: #555;
            line-height: 1.6;
        }

        .help-category > ul > li:before {
            content: "•";
            color: #3498db;
            font-weight: bold;
            font-size: 1.5rem;
            position: absolute;
            left: 10px;
            top: 5px;
        }

        .help-category ul ul {
            margin-top: 8px;
            margin-left: 20px;
        }

        .help-category ul ul li {
            padding: 5px 0;
            color: #666;
            font-size: 0.95rem;
        }

        .help-category ul ul li:before {
            content: "→";
            color: #95a5a6;
            margin-right: 8px;
        }

        .help-category strong {
            color: #2c3e50;
        }

        @media (max-width: 768px) {
            .help-container {
                padding: 15px;
            }

            .help-container h2 {
                font-size: 1.5rem;
            }

            .help-section {
                padding: 15px;
            }

            .help-section h3 {
                font-size: 1.2rem;
            }

            .help-category h4 {
                font-size: 1.1rem;
            }

            .help-category > ul > li {
                padding-left: 25px;
                font-size: 0.95rem;
            }
        }

        /* Logs Tab Styles */
        .logs-container {
            padding: 20px;
        }

        .logs-subtabs {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-bottom: 30px;
            margin-top: 10px;
            flex-wrap: wrap;
        }

        .logs-subtab-button {
            padding: 12px 24px;
            border: 2px solid #ddd;
            background: white;
            color: #555;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
            font-weight: 500;
            transition: all 0.3s ease;
        }

        .logs-subtab-button:hover {
            border-color: #3498db;
            color: #3498db;
        }

        .logs-subtab-button.active {
            background: #3498db;
            color: white;
            border-color: #3498db;
        }

        .logs-subtab-content {
            display: none;
        }

        .logs-subtab-content.active {
            display: block;
        }

        /* Activity Log Styles */
        #activityLogContainer {
            background: white;
            border-radius: 12px;
            padding: 25px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }

        .activity-log-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #f0f0f0;
        }

        .activity-log-header h3 {
            margin: 0;
            color: #2c3e50;
            font-size: 1.5rem;
        }

        .activity-log-item {
            padding: 15px;
            margin-bottom: 12px;
            border-left: 4px solid #3498db;
            background: #f8f9fa;
            border-radius: 6px;
        }

        .activity-log-item.success {
            border-left-color: #27ae60;
            background: #d5edda;
        }

        .activity-log-item.warning {
            border-left-color: #c0392b;
            background: #f8d7da;
        }

        .activity-log-item.error {
            border-left-color: #c0392b;
            background: #f8d7da;
        }

        .activity-log-time {
            font-size: 0.85rem;
            color: #7f8c8d;
            margin-bottom: 5px;
        }

        .activity-log-action {
            font-weight: 600;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        .activity-log-details {
            font-size: 0.9rem;
            color: #555;
            margin-top: 8px;
        }

        .activity-log-empty {
            text-align: center;
            padding: 40px;
            color: #7f8c8d;
            font-style: italic;
        }

        @media (max-width: 768px) {
            .logs-container {
                padding: 15px;
            }

            .activity-log-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 10px;
            }

            .activity-log-header h3 {
                font-size: 1.2rem;
            }

            #activityLogContainer {
                padding: 15px;
            }
        }