:root {
  --bg-primary: #0a0e17; --bg-secondary: #111827; --bg-card: #1a2332; --bg-input: #0d1420;
  --border: #2a3a4e; --accent: #3b82f6; --accent-hover: #2563eb; --accent-glow: rgba(59,130,246,0.3);
  --success: #10b981; --warning: #f59e0b; --danger: #ef4444; --info: #8b5cf6;
  --text-primary: #f1f5f9; --text-secondary: #94a3b8; --text-muted: #64748b;
  --gradient-1: linear-gradient(135deg, #3b82f6, #8b5cf6); --radius: 12px; --radius-sm: 8px;
  --transition: all 0.3s ease; --sidebar-width: 260px; --bottom-nav-height: 64px;
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height:100vh; overflow-x:hidden; }
::-webkit-scrollbar { width:6px; height:6px; } ::-webkit-scrollbar-track { background: var(--bg-primary); } ::-webkit-scrollbar-thumb { background: var(--border); border-radius:3px; }

.auth-container { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; background: radial-gradient(ellipse at top, var(--bg-secondary), var(--bg-primary)); }
.auth-box { background: var(--bg-card); border:1px solid var(--border); border-radius: var(--radius); padding:32px 24px; width:100%; max-width:440px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.auth-logo { text-align:center; margin-bottom:24px; } .auth-logo i { font-size:40px; background: var(--gradient-1); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.auth-logo h1 { font-size:24px; background: var(--gradient-1); -webkit-background-clip:text; -webkit-text-fill-color:transparent; } .auth-logo p { color: var(--text-secondary); font-size:13px; margin-top:4px; }
.auth-tabs { display:flex; background: var(--bg-input); border-radius: var(--radius-sm); padding:4px; margin-bottom:20px; }
.auth-tab { flex:1; padding:10px; text-align:center; border-radius:6px; cursor:pointer; font-weight:600; font-size:14px; color: var(--text-secondary); border:none; background:transparent; }
.auth-tab.active { background: var(--accent); color:white; box-shadow: 0 2px 8px var(--accent-glow); }
.form-group { margin-bottom:16px; } .form-group label { display:block; margin-bottom:6px; font-size:12px; font-weight:600; color: var(--text-secondary); text-transform:uppercase; letter-spacing:0.5px; }
.form-group input, .form-group select, .form-group textarea { width:100%; padding:12px 14px; background: var(--bg-input); border:1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size:15px; outline:none; }
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.btn { padding:10px 20px; border:none; border-radius: var(--radius-sm); font-size:14px; font-weight:600; cursor:pointer; transition: var(--transition); display:inline-flex; align-items:center; gap:8px; justify-content:center; }
.btn-primary { background: var(--gradient-1); color:white; } .btn-success { background: var(--success); color:white; } .btn-warning { background: var(--warning); color:#000; }
.btn-danger { background: var(--danger); color:white; } .btn-info { background: var(--info); color:white; } .btn-outline { background:transparent; border:1px solid var(--border); color: var(--text-primary); }
.btn-full { width:100%; } .btn-sm { padding:6px 12px; font-size:13px; } .btn-xs { padding:4px 8px; font-size:12px; }

.app-layout { display:none; min-height:100vh; } .app-layout.active { display:flex; }
.sidebar { width: var(--sidebar-width); background: var(--bg-secondary); border-right:1px solid var(--border); display:flex; flex-direction:column; position:fixed; top:0; left:0; bottom:0; z-index:100; }
.sidebar-header { padding:16px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:10px; }
.sidebar-header i, .sidebar-header h2 { background: var(--gradient-1); -webkit-background-clip:text; -webkit-text-fill-color:transparent; font-size:16px; font-weight:700; }
.sidebar-user { padding:12px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:10px; }
.sidebar-avatar { width:36px; height:36px; border-radius:50%; background: var(--gradient-1); display:flex; align-items:center; justify-content:center; font-weight:700; color:white; }
.sidebar-user-info h4 { font-size:13px; } .sidebar-user-info p { font-size:11px; color: var(--text-muted); }
.sidebar-nav { flex:1; padding:8px; overflow-y:auto; } .nav-item { display:flex; align-items:center; gap:10px; padding:10px; border-radius: var(--radius-sm); cursor:pointer; color: var(--text-secondary); font-size:13px; border:none; background:transparent; width:100%; text-align:left; }
.nav-item:hover { background: rgba(59,130,246,0.1); color: var(--text-primary); } .nav-item.active { background: rgba(59,130,246,0.15); color: var(--accent); }
.nav-item i { width:18px; text-align:center; } .nav-item .badge { margin-left:auto; background: var(--danger); color:white; font-size:10px; padding:2px 6px; border-radius:8px; }
.sidebar-footer { padding:12px 20px; border-top:1px solid var(--border); }

.main-content { flex:1; margin-left: var(--sidebar-width); min-height:100vh; padding-bottom: calc(var(--bottom-nav-height) + 20px); }
.topbar { background: var(--bg-secondary); border-bottom:1px solid var(--border); padding:12px 20px; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:50; }
.topbar-left { display:flex; align-items:center; gap:12px; } .topbar-left h2 { font-size:18px; font-weight:700; }
.topbar-btn { width:36px; height:36px; border-radius:50%; background: var(--bg-card); border:1px solid var(--border); color: var(--text-secondary); display:flex; align-items:center; justify-content:center; cursor:pointer; position:relative; }
.topbar-btn .notif-dot { position:absolute; top:6px; right:6px; width:7px; height:7px; background: var(--danger); border-radius:50%; }
.content-area { padding:16px; } .mobile-toggle { display:none; width:36px; height:36px; border-radius:50%; background: var(--bg-card); border:1px solid var(--border); color: var(--text-primary); align-items:center; justify-content:center; cursor:pointer; }

.bottom-nav { position:fixed; bottom:0; left:0; right:0; height: var(--bottom-nav-height); background: var(--bg-secondary); border-top:1px solid var(--border); display:none; z-index:90; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav-item { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; background:none; border:none; color: var(--text-muted); font-size:10px; cursor:pointer; padding:8px 4px; }
.bottom-nav-item i { font-size:18px; } .bottom-nav-item.active { color: var(--accent); }

.stats-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap:12px; margin-bottom:20px; }
.stat-card { background: var(--bg-card); border:1px solid var(--border); border-radius: var(--radius); padding:16px; position:relative; }
.stat-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background: var(--gradient-1); }
.stat-card.green::before { background: linear-gradient(135deg, #10b981, #3b82f6); } .stat-card.orange::before { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.stat-card.purple::before { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.stat-card h3 { font-size:24px; font-weight:700; margin-bottom:4px; } .stat-card p { font-size:12px; color: var(--text-secondary); }

.table-container { background: var(--bg-card); border:1px solid var(--border); border-radius: var(--radius); overflow:hidden; margin-bottom:16px; }
.table-header { padding:14px 16px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--border); flex-wrap:wrap; gap:8px; }
.table-header h3 { font-size:16px; font-weight:700; } .search-input { padding:8px 12px; background: var(--bg-input); border:1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size:13px; outline:none; width:200px; max-width:100%; }
.table-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; } table { width:100%; border-collapse:collapse; min-width:500px; }
thead th { padding:10px 14px; text-align:left; font-size:11px; text-transform:uppercase; color: var(--text-muted); font-weight:700; border-bottom:1px solid var(--border); background: var(--bg-input); }
tbody td { padding:12px 14px; font-size:13px; border-bottom:1px solid var(--border); } tbody tr:hover { background: rgba(59,130,246,0.05); }
.status-badge { padding:3px 10px; border-radius:16px; font-size:11px; font-weight:600; display:inline-block; }
.status-badge.active { background: rgba(16,185,129,0.15); color: var(--success); } .status-badge.low { background: rgba(245,158,11,0.15); color: var(--warning); } .status-badge.out { background: rgba(239,68,68,0.15); color: var(--danger); }

.product-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap:10px; }
.product-card { background: var(--bg-input); border:1px solid var(--border); border-radius: var(--radius); padding:12px; cursor:pointer; }
.product-card h4 { font-size:13px; margin-bottom:6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.product-card .price { font-size:15px; font-weight:700; color: var(--success); margin-bottom:4px; } .product-card .stock { font-size:12px; color: var(--text-muted); }

.quick-sale-item { display:flex; align-items:center; gap:8px; padding:10px; background: var(--bg-input); border:1px solid var(--border); border-radius: var(--radius-sm); margin-bottom:6px; }
.quick-sale-item .item-info { flex:1; min-width:0; } .quick-sale-item .item-name { font-weight:600; font-size:13px; } .quick-sale-item .item-price { font-size:12px; color: var(--success); }
.qty-control { display:flex; align-items:center; gap:6px; } .qty-control button { width:28px; height:28px; border-radius:50%; background: var(--bg-card); border:1px solid var(--border); color: var(--text-primary); cursor:pointer; }
.qty-control span { width:32px; text-align:center; font-weight:700; }

.modal-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.7); backdrop-filter:blur(4px); z-index:1000; display:none; align-items:center; justify-content:center; padding:16px; }
.modal-overlay.active { display:flex; } .modal { background: var(--bg-card); border:1px solid var(--border); border-radius:16px; width:100%; max-width:560px; max-height:85vh; overflow-y:auto; }
.modal-header { padding:16px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.modal-header h3 { font-size:18px; font-weight:700; } .modal-close { width:32px; height:32px; border-radius:50%; background: var(--bg-input); border:1px solid var(--border); color: var(--text-secondary); display:flex; align-items:center; justify-content:center; cursor:pointer; }
.modal-body { padding:20px; } .modal-footer { padding:12px 20px; border-top:1px solid var(--border); display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; }

.scanner-box { background:#000; border-radius:8px; overflow:hidden; margin-bottom:12px; min-height:250px; } #qr-reader { width:100%; min-height:250px; }
.scanner-permission { text-align:center; padding:30px 20px; display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:250px; }
.scanner-permission i { font-size:48px; color: var(--accent); margin-bottom:12px; } .scanner-permission p { color: var(--text-secondary); margin-bottom:16px; }
.scanner-manual { display:flex; gap:8px; margin-top:12px; } .scanner-manual input { flex:1; padding:12px; background: var(--bg-card); border:1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); }

.toast-container { position:fixed; top:16px; right:16px; z-index:2000; display:flex; flex-direction:column; gap:6px; }
.toast { padding:12px 16px; border-radius: var(--radius-sm); color:white; font-size:13px; font-weight:500; display:flex; align-items:center; gap:8px; animation: slideIn 0.3s ease; box-shadow: var(--shadow); }
.toast-success { background: var(--success); } .toast-error { background: var(--danger); } .toast-warning { background: var(--warning); color:#000; } .toast-info { background: var(--accent); }
@keyframes slideIn { from { transform:translateX(100%); opacity:0; } to { transform:translateX(0); opacity:1; } }

.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap:16px; } .grid-3 { display:grid; grid-template-columns: repeat(3, 1fr); gap:12px; }
.chart-container { background: var(--bg-card); border:1px solid var(--border); border-radius: var(--radius); padding:16px; margin-bottom:16px; } .chart-container h3 { font-size:16px; margin-bottom:16px; }
.bar-chart { display:flex; align-items:flex-end; gap:6px; height:160px; padding-top:16px; } .bar-item { flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; }
.bar { width:100%; max-width:32px; border-radius:4px 4px 0 0; background: var(--gradient-1); min-height:4px; } .bar-label { font-size:10px; color: var(--text-muted); } .bar-value { font-size:10px; color: var(--text-secondary); font-weight:600; }

.payment-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap:10px; margin:16px 0; }
.pay-btn { padding:12px; border:1px solid var(--border); border-radius:8px; background: var(--bg-input); color: var(--text-primary); cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:6px; font-size:13px; }
.pay-btn:hover { border-color: var(--accent); background: rgba(59,130,246,0.1); } .pay-btn i { font-size:24px; } .bank-qr { text-align:center; margin-top:12px; padding:12px; background:white; border-radius:8px; display:inline-block; } .bank-qr img { max-width:180px; }

.alert { padding:12px 16px; border-radius: var(--radius-sm); margin-bottom:12px; display:flex; align-items:center; gap:10px; font-size:13px; }
.alert-warning { background: rgba(245,158,11,0.1); border:1px solid rgba(245,158,11,0.3); color: var(--warning); }
.alert-danger { background: rgba(239,68,68,0.1); border:1px solid rgba(239,68,68,0.3); color: var(--danger); }
.alert-success { background: rgba(16,185,129,0.1); border:1px solid rgba(16,185,129,0.3); color: var(--success); }
.alert-info { background: rgba(59,130,246,0.1); border:1px solid rgba(59,130,246,0.3); color: var(--accent); }
.empty-state { text-align:center; padding:40px 20px; color: var(--text-muted); } .empty-state i { font-size:40px; margin-bottom:12px; opacity:0.5; } .empty-state h4 { font-size:16px; margin-bottom:6px; color: var(--text-secondary); }

@media (max-width: 1024px) { .grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 260px; } .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; } .mobile-toggle { display:flex !important; } .bottom-nav { display:flex !important; }
  .main-content { padding-bottom: calc(var(--bottom-nav-height) + 16px); } .content-area { padding:12px; }
  .topbar { padding:10px 12px; } .topbar-left h2 { font-size:16px; } .auth-box { padding:24px 18px; }
  .form-group input, .form-group select { padding:10px 12px; font-size:14px; } .search-input { width:100%; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap:8px; } .payment-grid { grid-template-columns: repeat(2, 1fr); }
  .scanner-manual { flex-direction:column; } .scanner-manual input { font-size:16px; }
}
