        :root { --bg: #f4f6fb; --card: #ffffff; --primary: #4f46e5; --success: #10b981; --warning: #f59e0b; --danger: #ef4444; --info: #3b82f6; --text: #1e293b; --text-secondary: #64748b; --text-muted: #94a3b8; --border: #e2e8f0; --input-bg: #f8fafc; --radius: 12px; --shadow: 0 4px 12px rgba(0,0,0,0.05); --shadow-lg: 0 10px 25px rgba(0,0,0,0.1); }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; padding: 16px; min-height: 100vh; }
        .loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.85); backdrop-filter: blur(4px); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
        .loading-overlay.show { opacity: 1; pointer-events: auto; }
        .spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 12px; }
        @keyframes spin { to { transform: rotate(360deg); } }
        .toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1e293b; color: white; padding: 12px 24px; border-radius: 30px; font-size: 14px; font-weight: 500; z-index: 10000; box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
        .toast.success { background: #059669; } .toast.error { background: #dc2626; } .toast.warning { background: #d97706; } .toast.info { background: #4f46e5; }
        .btn { background: white; border: 1px solid var(--border); padding: 8px 16px; border-radius: 20px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; transition: all 0.2s ease; white-space: nowrap; }
        .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); } .btn:active { transform: translateY(0); }
        .btn-primary { background: var(--primary); color: white; border: none; } .btn-success { background: var(--success); color: white; border: none; }
        .btn-warning { background: var(--warning); color: white; border: none; } .btn-danger { background: var(--danger); color: white; border: none; }
        .btn-info { background: var(--info); color: white; border: none; } .btn-wa { background: #25D366; color: white; border: none; }
        .btn-call { background: #6366f1; color: white; border: none; } .btn-edit { background: #8b5cf6; color: white; border: none; }
        .btn-sm { padding: 6px 12px; font-size: 12px; } .btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 12px; } .btn-lg { padding: 12px 24px; font-size: 16px; }
        .btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
        .btn-logout { background: transparent; border: 1px solid var(--border); padding: 6px 12px; border-radius: 16px; font-size: 12px; cursor: pointer; color: var(--text-secondary); transition: all 0.2s; }
        .btn-logout:hover { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
        .login-container { max-width: 400px; margin: 10vh auto; background: var(--card); border-radius: 24px; padding: 40px 24px; text-align: center; box-shadow: var(--shadow-lg); }
        .login-icon { font-size: 48px; margin-bottom: 12px; }
        .header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; background: var(--card); padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow); }
        .header h1 { font-size: 20px; } .header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
        .connection-dot { width: 10px; height: 10px; background: #22c55e; border-radius: 50%; transition: background 0.3s; } .connection-dot.offline { background: #ef4444; }
        .badge-pill { background: #e0e7ff; color: #4338ca; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
        .tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; background: var(--card); padding: 10px; border-radius: 16px; box-shadow: var(--shadow); }
        .tab { padding: 8px 14px; border-radius: 20px; font-size: 13px; cursor: pointer; font-weight: 500; color: var(--text-secondary); transition: all 0.2s ease; display: flex; align-items: center; gap: 5px; user-select: none; }
        .tab:hover { background: #f1f5f9; } .tab.active { background: var(--primary); color: white; }
        .badge { background: #e2e8f0; color: #1e293b; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; } .badge.urgent { background: #fee2e2; color: #b91c1c; }
        .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
        .stat-card { background: var(--card); padding: 16px; border-radius: 16px; cursor: pointer; transition: all 0.2s ease; border-left: 4px solid transparent; box-shadow: var(--shadow); }
        .stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); } .stat-card.new { border-left-color: #f59e0b; } .stat-card.confirmed { border-left-color: #3b82f6; }
        .stat-card.active { border-left-color: #8b5cf6; } .stat-card.delivered { border-left-color: #10b981; } .stat-card.revenue { border-left-color: #ec4899; }
        .stat-info h3 { font-size: 24px; font-weight: 700; } .stat-info p { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
        .filters-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; align-items: center; }
        .search-box { flex: 1; min-width: 200px; padding: 10px 16px; border: 1px solid var(--border); border-radius: 24px; font-size: 13px; background: var(--input-bg); transition: all 0.2s; }
        .search-box:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
        .filter-select { padding: 10px 16px; border: 1px solid var(--border); border-radius: 24px; font-size: 13px; background: var(--input-bg); cursor: pointer; transition: all 0.2s; }
        .card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
        .card-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); } .card-header h3 { font-size: 16px; font-weight: 600; }
        .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
        table { width: 100%; border-collapse: collapse; font-size: 13px; }
        th { text-align: left; padding: 12px 8px; color: var(--text-secondary); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; background: #f8fafc; position: sticky; top: 0; }
        td { padding: 12px 8px; border-bottom: 1px solid var(--border); } tr:hover td { background: #f8fafc; } .new-row { background: #fffbeb; } .new-row:hover td { background: #fef3c7; }
        .status, .payment-status { padding: 4px 12px; border-radius: 14px; font-size: 11px; font-weight: 600; display: inline-block; text-transform: uppercase; letter-spacing: 0.3px; }
        .status-new { background: #fef3c7; color: #92400e; } .status-confirmed { background: #dbeafe; color: #1e40af; } .status-preparing { background: #ede9fe; color: #6d28d9; }
        .status-ready { background: #dcfce7; color: #15803d; } .status-delivering { background: #fce7f3; color: #9d174d; } .status-delivered { background: #d1fae5; color: #065f46; }
        .status-cancelled { background: #fee2e2; color: #991b1b; } .payment-paid { background: #d1fae5; color: #065f46; } .payment-pending { background: #fef3c7; color: #92400e; }
        .payment-cod { background: #e0e7ff; color: #3730a3; }
        .brand-pill { display: inline-block; background: #f1f5f9; padding: 3px 10px; border-radius: 12px; font-size: 11px; margin: 2px 4px 2px 0; font-weight: 500; }
        .brand-pill.ready { background: #dcfce7; color: #15803d; } .brand-pill.preparing { background: #fef3c7; color: #92400e; }
        .rider-info { font-size: 11px; color: var(--text-muted); } .rider-info.assigned { color: #6366f1; font-weight: 500; }
        .order-cards { display: none; }
        @media (max-width: 768px) { body { padding: 8px; } .table-container { display: none; } .order-cards { display: flex; flex-direction: column; gap: 12px; } .stats-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; } .tabs { overflow-x: auto; flex-wrap: nowrap; } .filters-bar { flex-direction: column; } .search-box { width: 100%; } }
        .order-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; transition: all 0.2s; } .order-card:hover { box-shadow: var(--shadow); }
        .grouped-card { border-left: 4px solid #f59e0b; } .new-card { border-left: 4px solid #f97316; }
        .brand-mini { background: white; padding: 10px; border-radius: 10px; margin: 6px 0; border: 1px solid var(--border); }
        .brand-mini.ready { border-left: 3px solid #22c55e; } .brand-mini.preparing { border-left: 3px solid #f59e0b; }
        .modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
        .modal.show { opacity: 1; pointer-events: auto; }
        .modal-content { background: var(--card); border-radius: 24px; padding: 24px; max-width: 650px; width: 90%; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: slideUp 0.3s ease; }
        @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        .brand-detail-card { background: var(--input-bg); padding: 16px; border-radius: 12px; margin: 10px 0; border: 1px solid var(--border); }
        .brand-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
        .summary-bar { display: flex; justify-content: space-between; align-items: center; background: #f0fdf4; padding: 14px; border-radius: 12px; font-weight: 700; margin: 10px 0; }
        .notification-bar { background: #fef3c7; padding: 12px 20px; border-radius: 30px; margin-bottom: 16px; font-weight: 500; cursor: pointer; display: none; text-align: center; animation: pulse 2s infinite; }
        @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.8; } }
        #pwa-install-btn { display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1a1a1a; color: white; padding: 10px 20px; border-radius: 25px; cursor: pointer; z-index: 9999; font-size: 13px; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
        .product-search-container { position: relative; }
        .product-search-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; z-index: 1001; margin-top: 4px; }
        .product-search-item { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: 10px; transition: background 0.2s; }
        .product-search-item:hover { background: #f8fafc; }
        .edit-item-row { display: grid; grid-template-columns: 2fr 80px 100px 80px 40px; gap: 8px; align-items: center; background: #f8fafc; padding: 10px; border-radius: 8px; border: 1px solid var(--border); transition: all 0.3s; }
        .edit-item-row:hover { background: #f1f5f9; border-color: #cbd5e1; }
        .edit-section { margin-bottom: 20px; } .edit-section h4 { margin-bottom: 10px; font-size: 14px; font-weight: 600; }
        .edit-input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; margin-bottom: 8px; transition: all 0.2s; }
        .edit-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
        @media (max-width: 768px) { .edit-item-row { grid-template-columns: 1fr 60px 80px 60px 30px; gap: 4px; font-size: 11px; } }
    
