        :root {
            --primary: #f59e0b;
            --primary-hover: #d97706;
            --bg: #0f172a;
            --surface: #1e293b;
            --surface-light: #334155;
            --text: #f8fafc;
            --text-muted: #94a3b8;
            --border: #334155;
            --success: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --sidebar-width: 260px;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); overflow: hidden; }

        .app-container { display: flex; height: 100vh; position: relative; }
        
        .sidebar { 
            width: var(--sidebar-width); 
            background: var(--surface); 
            border-right: 1px solid var(--border); 
            display: flex; 
            flex-direction: column; 
            flex-shrink: 0; 
            transition: transform 0.3s ease; 
            z-index: 1100;
        }
        .sidebar-header { padding: 1.5rem; border-bottom: 1px solid var(--border); text-align: center; position: relative; }
        .logo { font-size: 1.2rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
        .nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
        .nav-item { padding: 0.75rem 1.5rem; display: flex; align-items: center; gap: 0.75rem; color: var(--text-muted); text-decoration: none; cursor: pointer; transition: 0.2s; font-size: 0.9rem; font-weight: 500; }
        .nav-item:hover { background: var(--surface-light); color: var(--text); }
        .nav-item.active { background: rgba(245, 158, 11, 0.1); color: var(--primary); border-right: 3px solid var(--primary); }

        .menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; padding: 0.5rem; }
        .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1050; }

        .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
        .view-container { flex: 1; overflow-y: auto; padding: 1.5rem; }
        .header { height: 60px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; flex-shrink: 0; gap: 1rem; }
        .view-container { flex: 1; overflow-y: auto; padding: 1.5rem; }

        .card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; overflow-x: auto; }
        .grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
        .stat-card { padding: 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
        .stat-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.25rem; }
        .stat-value { font-size: 1.4rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; }

        .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
        table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; min-width: 600px; }
        th { text-align: left; padding: 0.75rem; border-bottom: 2px solid var(--border); font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); }
        td { padding: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
        tr:hover { background: rgba(255,255,255,0.02); }

        .form-group { margin-bottom: 1rem; }
        label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-muted); }
        input, select, textarea { width: 100%; padding: 0.6rem; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-family: inherit; outline: none; }
        input:focus { border-color: var(--primary); }
        .btn { padding: 0.6rem 1.2rem; border-radius: 6px; border: none; font-weight: 700; cursor: pointer; transition: 0.2s; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.5rem; }
        .btn-primary { background: var(--primary); color: #000; }
        .btn-danger { background: var(--danger); color: #fff; }
        .btn-success { background: var(--success); color: #fff; }
        .btn-warning { background: var(--warning); color: #000; }
        .btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
        .btn-sm { padding: 0.4rem 0.8rem; font-size: 0.75rem; }

        .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 1000; }
        .modal { background: var(--surface); width: 90%; max-width: 600px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
        .modal-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
        .modal-body { padding: 1.5rem; max-height: 70vh; overflow-y: auto; }
        .modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.5rem; }

        .pos-grid { display: grid; grid-template-columns: 1fr 350px; gap: 1.5rem; }
        @media (max-width: 1024px) { .pos-grid { grid-template-columns: 1fr; } }

        @media (max-width: 768px) {
            .menu-toggle { display: block; }
            .sidebar { position: absolute; top: 60px; left: 0; right: 0; width: 100%; height: auto; max-height: 0; transform: none; overflow: hidden; transition: max-height 0.3s ease; background: var(--surface); border-right: none; border-bottom: 1px solid var(--border); z-index: 1100; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
            .sidebar.open { max-height: 90vh; overflow-y: auto; }
            .sidebar-header { display: none; }
            .sidebar-overlay.open { display: block; }
            .nav { flex-direction: column; overflow-x: visible; }
            .nav-item { white-space: normal; border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; }
            .nav-item.active { border-right: none; border-left: 4px solid var(--primary); background: rgba(245, 158, 11, 0.1); }
            .header { 
                padding: 0 0.5rem; 
                height: 60px; 
                flex-wrap: nowrap; 
                overflow: hidden;
            }
            .header > div:first-child {
                flex-shrink: 0;
                display: flex;
                align-items: center;
                gap: 0.5rem;
                min-width: 0;
            }
            #view-title {
                font-size: 1rem;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                max-width: 120px;
            }
            .search-container { display: none; }
            .view-container { padding: 0.5rem; overflow-x: hidden; }
            .grid { grid-template-columns: 1fr; }
            /* FIXED: Mobile tabs styling */
            .tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding-bottom: 0.5rem; }
            .tab { padding: 0.5rem 0.75rem; cursor: pointer; border-bottom: 2px solid transparent; font-size: 0.75rem; flex-shrink: 0; }
            .tab.active { border-bottom-color: var(--primary); color: var(--primary); }
            /* Toast mobile */
            .toast-container { bottom: 1rem; right: 1rem; left: 1rem; }
            .toast { min-width: auto; width: 100%; }
            /* Tables mobile */
            table { font-size: 0.75rem; }
            th, td { padding: 0.4rem !important; }
        }

        .cart-list { height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem; margin-bottom: 1rem; }
        .cart-item { display: flex; justify-content: space-between; padding: 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.8rem; }

        .alert { padding: 0.75rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.8rem; font-weight: 600; }
        .alert-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid var(--danger); }
        .alert-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid var(--success); }
        .alert-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid var(--warning); }

        .hidden { display: none; }
        .text-right { text-align: right; }
        .text-success { color: var(--success); }
        .text-danger { color: var(--danger); }
        .text-warning { color: var(--warning); }
        .text-muted { color: var(--text-muted); }

        .clickable-row { cursor: pointer; transition: background 0.2s; }
        .clickable-row:hover { background: rgba(245, 158, 11, 0.05); }

        .search-container { position: relative; margin-right: 1rem; flex: 1; max-width: 400px; }
        .search-container input { width: 100%; padding-left: 2.5rem; border-radius: 20px; background: var(--bg); }
        .search-container::before { content: '🔍'; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.9rem; }
        .search-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); z-index: 1000; max-height: 400px; overflow-y: auto; display: none; margin-top: 0.5rem; }
        .search-result-item { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; }
        .search-result-item:hover { background: var(--surface-light); }

        .badge { padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.7rem; font-weight: bold; }
        .badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
        .badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
        .badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
        .badge-primary { background: rgba(59, 130, 246, 0.1); color: var(--primary); }

        .loader-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.8); display: none; align-items: center; justify-content: center; z-index: 2000; flex-direction: column; gap: 1rem; }
        .spinner { width: 40px; height: 40px; border: 4px solid rgba(245, 158, 11, 0.1); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }

        .toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 3000; display: flex; flex-direction: column; gap: 0.5rem; }
        .toast { padding: 1rem 1.5rem; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); display: flex; align-items: center; gap: 0.75rem; animation: slideIn 0.3s ease-out; min-width: 300px; }
        .toast-success { border-left: 4px solid var(--success); }
        .toast-error { border-left: 4px solid var(--danger); }
        @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

        .empty-state { padding: 3rem; text-align: center; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 1rem; }

        .insight-card { background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; position: relative; overflow: hidden; }
        .insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

        .stat-card.clickable { cursor: pointer; transition: transform 0.2s, border-color 0.2s; }
        .stat-card.clickable:hover { transform: translateY(-3px); border-color: var(--primary); }

        .variance-positive { color: var(--success); }
        .variance-negative { color: var(--danger); }
        .variance-warning { color: var(--warning); }

        .nozzle-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 0.5rem; }
        .nozzle-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
        .nozzle-title { font-weight: 600; color: var(--primary); }
        .meter-reading { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; }

        .tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
        .tab { padding: 0.5rem 1rem; cursor: pointer; border-bottom: 2px solid transparent; }
        .tab.active { border-bottom-color: var(--primary); color: var(--primary); }

        .reading-input { font-family: 'JetBrains Mono', monospace; font-size: 1.2rem; text-align: right; }
        .reading-diff { font-size: 0.85rem; margin-top: 0.25rem; }

        .pump-status { display: inline-flex; align-items: center; gap: 0.5rem; }
        .status-dot { width: 8px; height: 8px; border-radius: 50%; }
        .status-active { background: var(--success); }
        .status-inactive { background: var(--danger); }

        /* Footer Styles */
        .footer {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            color: #e0e0e0;
            padding: 1rem 1.5rem;
            text-align: center;
            font-size: 0.85rem;
            border-top: 1px solid rgba(245, 158, 11, 0.3);
        }
        .footer a {
            color: #f59e0b;
            text-decoration: none;
            font-weight: 600;
            transition: color 0.3s ease;
        }
        .footer a:hover {
            color: #fbbf24;
            text-decoration: underline;
        }
        .footer-contact {
            margin-top: 0.5rem;
            display: flex;
            justify-content: center;
            gap: 1.5rem;
            flex-wrap: wrap;
            font-size: 0.8rem;
        }
        .footer-contact span {
            display: flex;
            align-items: center;
            gap: 0.3rem;
        }
        @media (max-width: 768px) {
            .footer { padding: 0.75rem 0.5rem; font-size: 0.75rem; }
            .footer-contact { gap: 1rem; font-size: 0.7rem; }
        }
        /* Demo Login Button Hover Effects */
        button:hover { transform: translateY(-2px); }
        button:active { transform: translateY(0); }

        /* Login Page Mobile Scroll */
        @media (max-width: 480px) {
            body { overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
            body > div:first-child { align-items: flex-start !important; padding-top: 1rem !important; min-height: 100vh !important; }
            body > div:first-child > div { padding-bottom: 2rem; }
        }
