:root {
            --primary: #2563eb;
            --bg-light: #f3f4f6;
            --text-dark: #1f2937;
            --white: #ffffff;
            --danger: #ef4444;
            --success: #10b981;
            --warning: #f59e0b;
            --muted: #64748b;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            display: flex;
            height: 100vh;
            background-color: var(--bg-light);
            color: var(--text-dark);
            overflow: hidden;
        }

        .sidebar {
            width: 230px;
            background: #1e293b;
            color: var(--white);
            padding: 15px;
            display: flex;
            flex-direction: column;
            transition: transform 0.3s;
            z-index: 100;
        }

        .brand {
            font-size: 1.3rem;
            font-weight: bold;
            margin-bottom: 30px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .nav-item {
            padding: 12px;
            cursor: pointer;
            border-radius: 6px;
            margin-bottom: 4px;
            display: flex;
            align-items: center;
            gap: 10px;
            transition: 0.3s;
            font-size: 0.9rem;
        }

        .nav-item:hover, .nav-item.active {
            background: var(--primary);
        }

        .bottom-nav {
            display: none;
        }

        .main-content {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            position: relative;
        }

        .sync-badge {
            position: relative;
            width: 100%;
            margin-top: 10px;
            background: rgba(255,255,255,0.10);
            padding: 8px 10px;
            border-radius: 10px;
            box-shadow: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 0.75rem;
            font-weight: 700;
            color: #e2e8f0;
            z-index: 50;
            transition: all 0.3s;
            white-space: nowrap;
            border: 1px solid rgba(255,255,255,0.14);
        }

        .sync-badge.syncing { color: #93c5fd; border-color: rgba(147,197,253,.35); background: rgba(37,99,235,.16); }
        .sync-badge.success { color: #86efac; border-color: rgba(134,239,172,.35); background: rgba(16,185,129,.14); }
        .sync-badge.cached  { color: #fcd34d; border-color: rgba(252,211,77,.38); background: rgba(245,158,11,.14); }
        .sync-badge.error   { color: #fca5a5; border-color: rgba(252,165,165,.38); background: rgba(239,68,68,.14); }

        #toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 2000;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }

        .toast {
            background: white;
            padding: 12px 20px;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 250px;
            transform: translateX(100%);
            animation: slideIn 0.3s forwards;
            pointer-events: auto;
            border-left: 5px solid #ccc;
        }

        .toast.success { border-left-color: var(--success); }
        .toast.error { border-left-color: var(--danger); }
        .toast i { font-size: 1.2rem; }
        .toast.success i { color: var(--success); }
        .toast.error i { color: var(--danger); }
        .toast-msg { font-size: 0.9rem; font-weight: 600; color: #374151; }

        @keyframes slideIn { to { transform: translateX(0); } }

        #system-error-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.8);
            z-index: 9999;
            justify-content: center;
            align-items: center;
        }

        .error-box {
            background: white;
            width: 90%;
            max-width: 400px;
            padding: 30px;
            border-radius: 12px;
            text-align: center;
            box-shadow: 0 10px 25px rgba(0,0,0,0.5);
        }

        .error-icon { font-size: 3rem; color: var(--danger); margin-bottom: 15px; }
        .error-title { font-size: 1.2rem; font-weight: bold; color: #1f2937; margin-bottom: 10px; }
        .error-desc {
            font-size: 0.9rem;
            color: #4b5563;
            margin-bottom: 20px;
            line-height: 1.5;
            background: #fef2f2;
            padding: 10px;
            border-radius: 6px;
            border: 1px solid #fee2e2;
            word-break: break-word;
        }

        .btn-reload {
            background: var(--text-dark);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            width: 100%;
        }

        .btn-reload:hover { background: black; }

        .header {
            margin-bottom: 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
            flex-wrap: nowrap; /* Prevent title and actions from splitting */
        }

        .header h2 { font-size: 1.5rem; flex-shrink: 0; }
        
        .header-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
            flex-wrap: nowrap; /* Horizontal alignment fix */
        }

        .search-box { position: relative; }
        .search-box input {
            padding: 8px 15px 8px 30px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            width: 250px;
            outline: none;
            transition: 0.2s;
            font-size: 0.9rem;
        }

        .search-box input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
        }

        .search-box i {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            color: #9ca3af;
            font-size: 0.8rem;
        }

        .data-table-container {
            background: var(--white);
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 5px;
            table-layout: auto;
        }

        th, td {
            text-align: left;
            padding: 8px 10px;
            border-bottom: 1px solid #e5e7eb;
            vertical-align: middle;
            font-size: 0.85rem;
        }

        th {
            color: #6b7280;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 700;
            background: #f9fafb;
        }

        /* Ensure the actions column has enough width */
        th:last-child, td:last-child {
            min-width: 150px;
            white-space: nowrap;
        }

        td:first-child {
            font-weight: 600;
            color: #f59e0b;
        }

        .status-select {
            padding: 2px 8px;
            height: 24px;
            border-radius: 12px;
            border: none;
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            appearance: none;
            text-align: center;
            outline: none;
            width: 100px;
        }

        .status-select.Open { background: #dbeafe; color: #1e40af; }
        .status-select.Accepted { background: #e0f2fe; color: #0369a1; }
        .status-select.InProgress { background: #fef3c7; color: #b45309; }
        .status-select.OnHold { background: #f3f4f6; color: #4b5563; }
        .status-select.Completed { background: #dcfce7; color: #15803d; }

        .priority {
            font-weight: 600;
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 0.75rem;
            display: inline-block;
            text-align: center;
        }

        .priority.Low { background: #dbeafe; color: #1e40af; }
        .priority.Medium { background: #fef3c7; color: #b45309; }
        .priority.Critical { background: #fee2e2; color: #991b1b; }

        .desc-cell { max-width: 240px; }
        .desc-preview {
            cursor: pointer;
            display: inline-block;
            line-height: 1.4;
            color: #374151;
            word-break: break-word;
        }
        .desc-preview:hover {
            color: var(--primary);
            text-decoration: underline;
        }

        .btn {
            padding: 8px 16px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: 0.2s;
            font-size: 0.9rem;
            white-space: nowrap;
        }

        .btn:hover { background: #1e40af; }
        .btn-success { background: var(--success); }
        .btn-danger { background: var(--danger); padding: 6px 10px; border-radius: 4px; }
        .btn-critical {
            background: #ef4444;
            color: white;
            padding: 8px 16px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 0.9rem;
        }

        /* Fixed: Action buttons aligned horizontally without wrapping */
        .action-btn-group {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap; 
            gap: 6px;
            align-items: center;
            justify-content: flex-start;
            white-space: nowrap;
        }

        .btn-icon {
            width: 28px;
            height: 28px;
            flex-shrink: 0; /* Prevent buttons from squishing */
            border-radius: 4px;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            transition: 0.2s;
            font-size: 0.85rem;
        }

        .btn-view { background-color: #64748b; }
        .btn-view:hover { background-color: #475569; }
        .btn-edit { background-color: var(--warning); }
        .btn-edit:hover { background-color: #d97706; }
        .btn-del { background-color: var(--danger); }
        .btn-del:hover { background-color: #dc2626; }
        .btn-pdf { background-color: #e11d48; }
        .btn-pdf:hover { background-color: #be123c; }

        .calendar-container {
            background: white;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .calendar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .calendar-title { font-size: 1.1rem; font-weight: bold; }
        .calendar-nav-btn {
            background: #f3f4f6;
            border: none;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .calendar-nav-btn:hover { background: #e5e7eb; }

        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 5px;
            text-align: center;
        }

        .cal-day-name {
            font-size: 0.75rem;
            font-weight: bold;
            color: #6b7280;
            padding-bottom: 5px;
        }

        .cal-day {
            height: 50px;
            border: 1px solid #e5e7eb;
            border-radius: 4px;
            position: relative;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
        }

        .cal-day:hover { background: #f9fafb; border-color: var(--primary); }
        .cal-day.today { background: #eff6ff; border-color: #bfdbfe; font-weight: bold; color: var(--primary); }
        .cal-day.selected { background: var(--primary); color: white; border-color: var(--primary); }
        .cal-day.empty { border: none; background: transparent; cursor: default; }

        .job-dots {
            display: flex;
            gap: 2px;
            position: absolute;
            bottom: 4px;
        }

        .job-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #ccc;
        }

        .job-dot.has-job { background: var(--primary); }
        .job-dot.has-critical { background: var(--danger); }

        .cal-day.selected .job-dot { background: white; }

        #calendar-details {
            margin-top: 20px;
            border-top: 1px solid #e5e7eb;
            padding-top: 15px;
        }

        .modal {
            display: none;
            position: fixed;
            inset: 0;
            width: 100%;
            height: 100%;
            background: rgba(15, 23, 42, 0.62);
            backdrop-filter: blur(5px);
            justify-content: center;
            align-items: center;
            z-index: 1000;
            padding: 24px;
        }

        .modal-content {
            background: #ffffff;
            padding: 28px;
            border-radius: 18px;
            width: min(560px, 96vw);
            position: relative;
            max-height: 88vh;
            overflow-y: auto;
            box-shadow: 0 28px 80px rgba(15, 23, 42, 0.32);
            border: 1px solid rgba(148, 163, 184, 0.22);
            animation: modalPop 0.18s ease-out;
        }

        .modal-content > span[onclick*="closeModal"] {
            position: absolute;
            top: 14px;
            right: 16px;
            width: 32px;
            height: 32px;
            border-radius: 999px;
            background: #f1f5f9;
            color: #334155;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.35rem;
            line-height: 1;
            transition: 0.2s;
        }

        .modal-content > span[onclick*="closeModal"]:hover {
            background: #e2e8f0;
            color: #0f172a;
        }

        .modal-content h3 {
            font-size: 1.2rem;
            font-weight: 800;
            color: #0f172a;
            margin-bottom: 18px;
            padding-right: 38px;
        }

        @keyframes modalPop {
            from { opacity: 0; transform: translateY(10px) scale(.98); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        .form-group { margin-bottom: 15px; }
        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: 500;
            font-size: 0.9rem;
        }

        .form-group input,
        .form-group select,
        .form-group textarea {
            width: 100%;
            padding: 8px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            font-size: 0.9rem;
        }

        .form-group textarea {
            resize: vertical;
            min-height: 100px;
            font-family: inherit;
        }

        .char-count {
            text-align: right;
            font-size: 0.75rem;
            color: #6b7280;
            margin-top: 2px;
        }

        .detail-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #f3f4f6;
            font-size: 0.9rem;
            gap: 10px;
        }

        .detail-label { font-weight: 600; color: #64748b; }
        .section { display: none; }
        .section.active { display: block; }

        .settings-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 15px;
        }

        .settings-card {
            background: white;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            display: flex;
            flex-direction: column;
            max-height: 500px;
        }

        .settings-card h3 {
            margin-bottom: 10px;
            color: #374151;
            border-bottom: 2px solid #f3f4f6;
            padding-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 1.1rem;
        }

        .settings-list {
            list-style: none;
            overflow-y: auto;
            flex: 1;
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            margin-bottom: 10px;
            background: #fafafa;
        }

        .settings-item {
            padding: 8px;
            border-bottom: 1px solid #f3f4f6;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #fff;
            transition: 0.2s;
        }

        .settings-item:hover { background: #f9fafb; }
        .settings-item:last-child { border-bottom: none; }

        .item-info { display: flex; flex-direction: column; }
        .item-main { font-weight: 600; font-size: 0.85rem; color: #1f2937; }
        .item-sub { font-size: 0.7rem; color: #6b7280; }

        .item-actions { display: flex; gap: 5px; }
        .btn-mini {
            padding: 2px 6px;
            border-radius: 4px;
            border: none;
            cursor: pointer;
            color: white;
            font-size: 0.7rem;
        }

        .add-row {
            display: flex;
            gap: 10px;
            margin-top: auto;
        }

        #img-preview-container { margin-top: 10px; text-align: center; }
        #edit-img-preview {
            max-height: 100px;
            border-radius: 5px;
            border: 1px solid #ddd;
            display: none;
        }

        #remove-img-btn {
            background: #ef4444;
            color: white;
            border: none;
            padding: 4px 8px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.8rem;
            margin-top: 5px;
            display: none;
        }

        .parts-box {
            background:#f9fafb;
            border:1px solid #e5e7eb;
            border-radius:6px;
            padding:10px;
        }

        .part-row {
            display:flex;
            justify-content:space-between;
            align-items:center;
            gap:8px;
            padding:6px 0;
            border-bottom:1px solid #e5e7eb;
        }

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

        .inventory-low {
            color: #dc2626;
            font-weight: 700;
        }

        .dashboard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px;
            margin-bottom: 15px;
        }

        .summary-card {
            background: white;
            border-radius: 10px;
            padding: 14px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.06);
            border: 1px solid #e5e7eb;
        }

        .summary-card-label {
            color: #64748b;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 6px;
            font-weight: 700;
        }

        .summary-card-value {
            font-size: 1.7rem;
            font-weight: 800;
            color: #0f172a;
        }

        .summary-card-note {
            margin-top: 4px;
            font-size: 0.78rem;
            color: #64748b;
        }

        .today-jobs-card {
            background: white;
            border-radius: 10px;
            padding: 14px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.06);
            border: 1px solid #e5e7eb;
            margin-bottom: 15px;
        }
        .today-jobs-card h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; color: #0f172a; margin-bottom: 10px; }
        .today-jobs-list { display: grid; gap: 8px; }
        .today-job-item {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 10px;
            background: #f8fafc;
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 6px 10px;
            align-items: center;
        }
        .today-job-title { font-weight: 800; color: #0f172a; font-size: 0.9rem; }
        .today-job-meta { color: #64748b; font-size: 0.78rem; line-height: 1.4; }

        .alert-box {
            background: #fff7ed;
            border: 1px solid #fdba74;
            color: #9a3412;
            border-radius: 10px;
            padding: 12px 14px;
            margin-bottom: 15px;
        }

        .alert-box strong {
            display: block;
            margin-bottom: 4px;
        }

        .alert-box.hidden {
            display: none;
        }

        .overdue-row {
            background: #fff7f7;
        }

        .overdue-badge {
            display: inline-block;
            margin-left: 6px;
            padding: 2px 8px;
            border-radius: 999px;
            background: #fee2e2;
            color: #b91c1c;
            font-size: 0.7rem;
            font-weight: 700;
            vertical-align: middle;
        }

        .parts-list-view {
            margin-top: 12px;
            background: #f8fafc;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 10px;
        }

        .backup-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 15px;
        }

        
        .auth-overlay {
            position: fixed; inset: 0; background: rgba(15,23,42,.68);
            display: none; align-items: center; justify-content: center; z-index: 5000;
            padding: 20px;
        }
        .auth-card {
            width: 100%; max-width: 420px; background: white; border-radius: 16px; padding: 24px;
            box-shadow: 0 24px 64px rgba(0,0,0,.22);
        }
        .auth-card h2 { margin-bottom: 8px; }
        .auth-card p { color: #64748b; margin-bottom: 18px; }
        .auth-row { margin-bottom: 12px; }
        .auth-row input, .auth-row select { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; }
        .auth-error { color: #b91c1c; font-size: 0.85rem; min-height: 1.2rem; margin: 8px 0 0; }
        .sidebar-account { margin-top:auto; padding-top:12px; border-top:1px solid rgba(255,255,255,0.12); display:flex; flex-direction:column; gap:8px; }
        .user-pill { display:block; background:rgba(255,255,255,0.12); border:1px solid rgba(255,255,255,0.18); border-radius:10px; padding:8px 10px; font-size:.8rem; font-weight:600; color:#fff; text-align:center; }
        .sidebar-auth-btn { width:100%; padding:8px 10px; font-size:0.85rem; }
        .hidden-auth { display:none !important; }


        .empty-state {
            text-align: center;
            color: #64748b;
            padding: 28px 16px;
        }
        .empty-state i {
            font-size: 1.8rem;
            margin-bottom: 10px;
            color: #94a3b8;
            display: block;
        }
        .activity-log-list {
            list-style: none;
            overflow-y: auto;
            flex: 1;
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            background: #fafafa;
        }
        .activity-log-item {
            padding: 10px 12px;
            border-bottom: 1px solid #e5e7eb;
            background: #fff;
        }
        .activity-log-item:last-child { border-bottom: none; }
        .activity-log-top {
            display:flex;
            align-items:center;
            justify-content:space-between;
            gap:10px;
            margin-bottom:4px;
        }
        .activity-log-title { font-weight:700; font-size:0.82rem; color:#0f172a; }
        .activity-log-meta { font-size:0.72rem; color:#64748b; }
        .activity-log-details { font-size:0.78rem; color:#475569; line-height:1.4; }
        .action-modal-card {
            width: min(460px, 96vw);
            background: #ffffff;
            border-radius: 18px;
            padding: 24px;
            box-shadow: 0 28px 80px rgba(15, 23, 42, 0.34);
            border: 1px solid rgba(148, 163, 184, 0.22);
            animation: modalPop 0.18s ease-out;
        }
        .action-modal-title { font-size: 1.18rem; font-weight: 850; margin-bottom: 8px; color:#0f172a; }
        .action-modal-message { color:#64748b; line-height:1.55; margin-bottom: 16px; }
        .action-modal-actions { display:flex; justify-content:flex-end; gap:10px; margin-top: 18px; }
        .btn-secondary { background:#e5e7eb; color:#111827; }
        .btn-secondary:hover { background:#d1d5db; }
        .loading-inline { opacity: .7; pointer-events: none; }
        [data-role-guard="manager"] { display: none; }
        [data-role-guard="admin"] { display: none; }


        .master-list-card {
            margin-top: 22px;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            padding: 15px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.06);
        }
        .master-list-card .data-table-container { box-shadow: none; padding: 0; }
        .master-list-header { align-items: flex-start; margin-bottom: 12px; }
        .master-list-tab-active { background: var(--primary) !important; color: #fff !important; }


        /* Windows-style centered popup upgrade */
        .modal {
            background: rgba(15, 23, 42, 0.58) !important;
            backdrop-filter: blur(4px);
            align-items: center !important;
            justify-content: center !important;
        }

        .modal-content,
        .action-modal-card {
            border-radius: 10px !important;
            border: 1px solid #cbd5e1 !important;
            box-shadow: 0 24px 80px rgba(15, 23, 42, 0.38), 0 2px 8px rgba(15, 23, 42, 0.18) !important;
            animation: windowsPop 0.16s ease-out !important;
        }

        .modal-content h3,
        .action-modal-title {
            background: linear-gradient(180deg, #f8fafc, #e2e8f0);
            margin: -28px -28px 18px -28px !important;
            padding: 14px 48px 14px 18px !important;
            border-bottom: 1px solid #cbd5e1;
            border-radius: 10px 10px 0 0;
            font-weight: 800;
            color: #0f172a;
        }

        .modal-content > span[onclick*="closeModal"] {
            top: 9px !important;
            right: 10px !important;
            width: 30px !important;
            height: 30px !important;
            background: transparent !important;
            border-radius: 6px !important;
            color: #475569 !important;
            font-weight: 700 !important;
        }

        .modal-content > span[onclick*="closeModal"]:hover {
            background: #ef4444 !important;
            color: #ffffff !important;
        }

        .form-group {
            margin-bottom: 11px !important;
        }

        .form-group label {
            font-size: 0.82rem !important;
            font-weight: 700 !important;
            color: #334155 !important;
        }

        .form-group input,
        .form-group select,
        .form-group textarea {
            padding: 7px 9px !important;
            border-radius: 6px !important;
        }

        .modal-content .btn,
        .action-modal-card .btn {
            border-radius: 6px !important;
        }

        @keyframes windowsPop {
            from { opacity: 0; transform: translateY(8px) scale(0.985); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        @media (max-width: 768px) {
            .sidebar { display: none; }
            .bottom-nav {
                display: flex;
                position: fixed;
                bottom: 0;
                left: 0;
                width: 100%;
                background: #1e293b;
                color: white;
                justify-content: space-around;
                padding: 12px 0;
                z-index: 900;
                box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
                overflow-x: auto;
            }

            .nav-btn {
                background: none;
                border: none;
                color: #94a3b8;
                cursor: pointer;
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 4px;
                font-size: 0.65rem;
                font-weight: 500;
                min-width: 65px;
            }

            .nav-btn.active { color: var(--primary); }
            .main-content { padding: 15px; padding-bottom: 90px; }
            .header { flex-direction: column; align-items: flex-start; gap: 12px; }
            .header h2 { font-size: 1.3rem; }
            
            .header-actions {
                width: 100%;
                justify-content: space-between;
                flex-wrap: wrap; 
                gap: 10px;
            }
            .search-box { flex: 1; width: 100%; }
            .search-box input { width: 100%; }
            .btn { white-space: nowrap; font-size: 0.85rem; padding: 8px 12px; }
            .data-table-container { padding: 0; box-shadow: none; background: transparent; }
            table { min-width: 760px; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
            .modal { padding: 14px; }
            .modal-content { width: 100%; max-height: 88vh; padding: 22px; border-radius: 16px; }
            .settings-grid { grid-template-columns: 1fr; }
            #toast-container { right: 10px; left: 10px; width: auto; }
        }
