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

:root {
  --primary: #7c3aed; --primary-dark: #6d28d9; --primary-light: #a78bfa;
  --primary-glow: rgba(124, 58, 237, 0.2);
  --success: #10b981; --success-light: #d1fae5;
  --danger: #ef4444; --danger-light: #fee2e2;
  --warning: #f59e0b; --warning-light: #fef3c7;
  --info: #3b82f6;
  --bg: #f1f5f9; --bg-card: #ffffff;
  --text: #0f172a; --text-secondary: #475569; --text-light: #94a3b8;
  --border: #e2e8f0; --border-light: #f1f5f9;
  --hover: #f8fafc;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
  --radius: 8px; --radius-sm: 6px; --radius-lg: 12px; --radius-xl: 16px;
  --nav-height: 60px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body { font-family: var(--font); background: var(--bg); color: var(--text); overflow: hidden; height: 100vh; -webkit-font-smoothing: antialiased; }

input, select, button, textarea { font-family: inherit; font-size: 14px; }
a { text-decoration: none; color: var(--primary); cursor: pointer; }

/* === Buttons === */
.btn { padding: 8px 18px; border: none; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; transition: all var(--transition); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; letter-spacing: 0.01em; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 14px var(--primary-glow); }
.btn-success { background: linear-gradient(135deg, var(--success), #059669); color: #fff; }
.btn-success:hover { box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3); }
.btn-danger { background: linear-gradient(135deg, var(--danger), #dc2626); color: #fff; }
.btn-warning { background: linear-gradient(135deg, var(--warning), #d97706); color: #fff; }
.btn-secondary { background: var(--hover); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-lg { padding: 14px 28px; font-size: 17px; border-radius: var(--radius); font-weight: 700; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* === Screen === */
.screen { display: none; height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* === Login Screen === */
.login-container { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 40%, #3b82f6 100%); position: relative; overflow: hidden; }
.login-container::before { content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%); top: -200px; right: -200px; }
.login-container::after { content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%); bottom: -100px; left: -100px; }
.login-box { background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); padding: 44px 40px; border-radius: var(--radius-xl); width: 420px; max-width: 92vw; box-shadow: var(--shadow-xl); text-align: center; position: relative; animation: loginFadeIn 0.6s ease-out; }
@keyframes loginFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.login-logo { font-size: 56px; margin-bottom: 12px; display: block; }
.login-box h1 { font-size: 26px; font-weight: 800; margin-bottom: 4px; color: var(--text); letter-spacing: -0.5px; }
.login-subtitle { color: var(--text-secondary); margin-bottom: 28px; font-size: 14px; }
.login-box .form-group { text-align: left; margin-bottom: 18px; }
.login-box .form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.login-box .form-group input, .login-box .form-group select { width: 100%; padding: 11px 14px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 15px; transition: all var(--transition); background: var(--bg); }
.login-box .form-group input:focus, .login-box .form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); background: #fff; }
.login-box .btn-primary { margin-top: 4px; }
.error-message { color: var(--danger); margin-top: 12px; font-size: 13px; min-height: 20px; font-weight: 500; }

/* === Navbar === */
#navbar { height: var(--nav-height); background: rgba(255,255,255,0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 8px; box-shadow: var(--shadow-sm); z-index: 100; flex-shrink: 0; }
.nav-brand { font-weight: 800; font-size: 17px; white-space: nowrap; margin-right: 12px; display: flex; align-items: center; gap: 6px; letter-spacing: -0.3px; color: var(--text); }
.nav-logo { height: 34px; vertical-align: middle; object-fit: contain; }
.nav-links { display: flex; gap: 2px; flex: 1; overflow-x: auto; padding: 0 4px; }
.nav-link { padding: 7px 16px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 13px; font-weight: 500; white-space: nowrap; transition: all var(--transition); }
.nav-link:hover { background: var(--hover); color: var(--text); }
.nav-link.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px var(--primary-glow); }
.nav-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.nav-user { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.lang-select { padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-size: 12px; font-weight: 500; cursor: pointer; }
.lang-select:focus { outline: none; border-color: var(--primary); }

/* === Content Screens === */
.content-screen { display: none; flex: 1; overflow-y: auto; padding: 24px; }
.content-screen.active { display: block; animation: screenFadeIn 0.25s ease-out; }
@keyframes screenFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.screen-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.screen-header h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }

/* === POS Layout === */
.pos-layout { display: flex; gap: 20px; height: calc(100vh - var(--nav-height) - 48px); }
.pos-products { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pos-cart { width: 400px; background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); display: flex; flex-direction: column; flex-shrink: 0; border: 1px solid var(--border); overflow: hidden; }
.pos-toolbar { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.pos-scan-row { display: flex; gap: 8px; }
.barcode-input { flex: 0 0 200px; padding: 12px 16px; border: 2px solid var(--primary); border-radius: var(--radius); font-size: 15px; background: #fff; transition: all var(--transition); letter-spacing: 2px; font-family: 'Courier New', monospace; font-weight: 700; }
.barcode-input:focus { outline: none; border-color: var(--primary-dark); box-shadow: 0 0 0 3px var(--primary-glow); }
.barcode-input::placeholder { letter-spacing: 0; font-family: var(--font); font-weight: 400; }
.search-input { flex: 1; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 15px; background: var(--bg-card); transition: all var(--transition); }
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); background: #fff; }
.barcode-feedback { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 600; z-index: 2000; animation: slideUp 0.3s ease-out; pointer-events: none; }
.barcode-feedback.success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.barcode-feedback.error { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.pos-categories { display: flex; gap: 6px; padding: 2px 0; overflow-x: auto; }
.pos-cat-btn { padding: 7px 18px; border-radius: 100px; border: 1.5px solid var(--border); background: var(--bg-card); cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; transition: all var(--transition); color: var(--text-secondary); }
.pos-cat-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(124, 58, 237, 0.04); }
.pos-cat-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px var(--primary-glow); }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; overflow-y: auto; flex: 1; padding: 4px 2px 8px; align-content: start; }
.product-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 12px 10px; cursor: pointer; text-align: center; transition: all var(--transition); position: relative; }
@keyframes cardFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.product-card:hover { border-color: var(--primary); box-shadow: 0 8px 25px var(--primary-glow); transform: translateY(-3px); }
.product-card:active { transform: translateY(-1px); }
.product-card .prod-img { width: 100%; height: 90px; object-fit: contain; border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--bg); padding: 4px; }
.product-card .prod-img-placeholder { width: 100%; height: 90px; border-radius: var(--radius-sm); margin-bottom: 8px; background: linear-gradient(135deg, var(--bg), var(--border-light)); display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--text-light); }
.product-card .prod-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.product-card .prod-price { color: var(--primary); font-weight: 800; font-size: 17px; letter-spacing: -0.3px; }
.product-card .prod-qty { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.product-card.low-stock { border-color: var(--warning); background: linear-gradient(135deg, #fffbeb, #fff); }
.product-card.low-stock .prod-price { color: var(--warning); }
.product-card.out-of-stock { border-color: var(--danger); background: linear-gradient(135deg, #fef2f2, #fff); opacity: 0.75; cursor: not-allowed; }
.product-card.out-of-stock .prod-price { color: var(--text-light); }
.product-card.out-of-stock .prod-name { text-decoration: line-through; }
.product-card.added-anim { animation: addedPulse 0.4s ease-out; }
@keyframes addedPulse { 0% { transform: scale(1); } 50% { transform: scale(0.95); box-shadow: 0 0 0 3px var(--primary-glow); } 100% { transform: scale(1); } }
.stock-badge { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 10px; font-weight: 700; letter-spacing: 0.3px; }
.stock-badge.ok { background: var(--success-light); color: #065f46; }
.stock-badge.low { background: var(--warning-light); color: #92400e; }
.stock-badge.out { background: var(--danger-light); color: #991b1b; }
.product-card .stock-badge { position: absolute; top: 6px; right: 6px; }

tr.row-low-stock { background: #fffbeb; }
tr.row-out-of-stock { background: #fef2f2; }
tr.row-expired td { background: #fef2f2; }
tr.row-expiring td { background: #fffbeb; }

.prod-exp-badge { position: absolute; bottom: 32px; left: 6px; right: 6px; font-size: 9px; font-weight: 700; text-align: center; padding: 2px 4px; border-radius: 4px; letter-spacing: 0.2px; }
.prod-exp-badge.expired { background: var(--danger-light); color: #991b1b; }
.prod-exp-badge.expiring { background: var(--warning-light); color: #92400e; }
.product-card.expired { opacity: 0.75; border-color: var(--danger); }
.product-card.expiring-soon { border-color: var(--warning); }

.prod-table-img { width: 40px; height: 40px; object-fit: contain; border-radius: var(--radius-sm); background: var(--bg); }
.prod-table-img-placeholder { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; color: var(--text-light); }

.image-preview { max-width: 200px; max-height: 150px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-top: 8px; display: block; }
.image-upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 20px; text-align: center; cursor: pointer; transition: all var(--transition); background: var(--bg); }
.image-upload-area:hover { border-color: var(--primary); background: rgba(124, 58, 237, 0.03); }
.image-upload-area.has-image { border-color: var(--success); border-style: solid; background: var(--success-light); }
.image-upload-row { display: flex; gap: 8px; align-items: flex-start; }
.image-upload-row .image-upload-area { flex: 1; }
.camera-btn { font-size: 20px; padding: 12px 16px; min-width: 48px; display: flex; align-items: center; justify-content: center; }
.pos-cat-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pos-cat-checkbox { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--bg-card); transition: all var(--transition); }
.pos-cat-checkbox:hover { border-color: var(--primary); background: var(--primary-glow); }
.pos-cat-checkbox input { margin: 0; }

/* Cart */
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, var(--bg), var(--bg-card)); }
.cart-header h3 { font-size: 16px; font-weight: 700; }
.cart-header h3::before { content: '🛒 '; }
.cart-customer { padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; color: var(--primary); font-weight: 500; transition: all var(--transition); display: flex; align-items: center; gap: 6px; }
.cart-customer:hover { background: rgba(124, 58, 237, 0.04); }
.cart-items { flex: 1; overflow-y: auto; padding: 4px 0; }
.cart-empty { text-align: center; padding: 48px 20px; color: var(--text-light); font-size: 14px; line-height: 1.6; }
.cart-empty::before { content: '🛒'; font-size: 40px; display: block; margin-bottom: 12px; opacity: 0.4; }
.cart-item { display: flex; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--border-light); font-size: 13px; transition: background var(--transition); animation: slideIn 0.2s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
.cart-item:hover { background: var(--hover); }
.cart-item:last-child { border-bottom: none; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-details { font-size: 12px; color: var(--text-secondary); }
.cart-item-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cart-item-actions input { width: 52px; padding: 5px 6px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); text-align: center; font-weight: 600; font-size: 13px; transition: border var(--transition); }
.cart-item-actions input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
.cart-item-remove { color: var(--danger); cursor: pointer; font-size: 20px; line-height: 1; transition: all var(--transition); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cart-item-remove:hover { background: var(--danger-light); transform: scale(1.1); }

.cart-delivery { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg); }
.cart-delivery label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px; }
.cart-delivery select, .cart-delivery input { width: 100%; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: #fff; transition: border var(--transition); }
.cart-delivery select:focus, .cart-delivery input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
.cart-delivery input { margin-top: 6px; }

.cart-footer { padding: 16px 20px; border-top: 1px solid var(--border); background: linear-gradient(135deg, var(--bg-card), var(--bg)); }
.cart-total { display: flex; justify-content: space-between; align-items: flex-end; flex-direction: column; gap: 4px; font-size: 22px; font-weight: 800; margin-bottom: 14px; letter-spacing: -0.3px; flex-wrap: wrap; }
.cart-total .total-amount,
.cart-total #cart-total-amount { font-size: 24px; color: var(--primary); width:100%; }
.cart-total .total-breakdown { width: 100%; display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.cart-total .total-breakdown span { display: flex; gap: 4px; }
.cart-discount-row { display:flex; align-items:center; gap:8px; padding:8px 0; font-size:13px; font-weight:500; flex-wrap:wrap; }
.cart-discount-row > span { color:var(--text-secondary); white-space:nowrap; }
.cart-discount-row #cart-discount-btns { display:flex; gap:4px; flex-wrap:wrap; }
.cart-discount-row #cart-discount-btns .btn { min-width:48px; padding:4px 10px; font-size:12px; font-weight:600; }
.cart-discount-row #cart-discount-label { font-weight:700; color:var(--danger); font-size:14px; }
.cart-discount-row { width:100%; display:flex; align-items:center; gap:8px; font-size:13px; font-weight:500; padding:4px 0; }
.cart-discount-row label { color:var(--text-secondary); white-space:nowrap; }
.cart-discount-row input { padding:4px 8px; border:1.5px solid var(--border); border-radius:var(--radius-sm); font-size:13px; width:60px; text-align:center; }
.customer-icon { font-size: 16px; }
.customer-hint { font-size: 10px; color: var(--text-light); font-weight: 400; }
.cart-customer .customer-icon { margin-right: 2px; }
.prod-img-wrap { width: 100%; height: 90px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; background: var(--bg); border-radius: var(--radius-sm); overflow: hidden; }

/* === Tables === */
.table-container { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow-x: auto; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-light); font-size: 13px; }
th { background: var(--bg); font-weight: 600; color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--hover); }

/* === Modal === */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; animation: overlayFadeIn 0.15s ease-out; }
@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: var(--radius-xl); padding: 28px; min-width: 420px; max-width: 92vw; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-xl); animation: modalSlideUp 0.2s ease-out; }
@keyframes modalSlideUp { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal h3 { margin-bottom: 20px; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.modal .form-group { margin-bottom: 16px; }
.modal .form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.modal .form-group input, .modal .form-group select, .modal .form-group textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; transition: border var(--transition); }
.modal .form-group input:focus, .modal .form-group select:focus, .modal .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
.modal .btn-group { margin-top: 20px; gap: 10px; justify-content: flex-end; }

/* === Dashboard === */
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dash-card { background: var(--bg-card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: all var(--transition); }
.dash-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dash-card .dash-value { font-size: 28px; font-weight: 800; margin: 4px 0; letter-spacing: -0.5px; }
.dash-card .dash-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.dash-card .dash-icon { font-size: 32px; margin-bottom: 8px; }

/* === Session === */
.session-status { padding: 16px 20px; margin-bottom: 16px; border-radius: var(--radius); font-weight: 600; font-size: 14px; }
.session-status.opened { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.session-status.closed { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }

/* === Reports === */
.report-controls { display: flex; gap: 10px; align-items: center; }
.report-controls select { padding: 9px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: #fff; cursor: pointer; }
.report-controls select:focus { outline: none; border-color: var(--primary); }
.report-results { background: var(--bg-card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.report-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.report-stat { text-align: center; padding: 20px; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border-light); }
.report-stat .stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.3px; }
.report-stat .stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-top: 4px; }

/* === Settings === */
.settings-form { max-width: 520px; background: var(--bg-card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.settings-form .form-group { margin-bottom: 20px; }
.settings-form label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13px; color: var(--text-secondary); }
.settings-form input, .settings-form select { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; transition: border var(--transition); }
.settings-form input:focus, .settings-form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
.success-message { color: var(--success); margin-top: 12px; font-size: 13px; font-weight: 500; }

/* === Backup === */
.backup-status { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--bg); border-radius: var(--radius-sm); font-size: 13px; margin-top: 12px; }
.backup-status #backup-status-text { font-weight: 600; }
.backup-status #backup-status-text.running { color: var(--primary); }
.backup-status #backup-status-text.idle { color: var(--success); }
.backup-status #backup-status-text.error { color: var(--danger); }

/* === Bulk Delete === */
.product-filters { display: flex; gap: 10px; padding: 12px 0; flex-wrap: wrap; align-items: center; }
.product-filters .search-input, .product-filters .filter-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: var(--bg-card); color: var(--text); }
.product-filters .search-input:focus, .product-filters .filter-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.product-filters .filter-select { min-width: 130px; cursor: pointer; }
.bulk-delete-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--danger-light); border-radius: var(--radius) var(--radius) 0 0; border: 1px solid #fecaca; border-bottom: none; font-size: 13px; font-weight: 600; color: #991b1b; }
.bulk-delete-bar .btn { flex-shrink: 0; }

/* === Utility === */
.status-badge { display: inline-block; padding: 3px 12px; border-radius: 100px; font-size: 11px; font-weight: 600; letter-spacing: 0.2px; }
.status-paid, .status-done { background: var(--success-light); color: #065f46; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-draft { background: var(--warning-light); color: #92400e; }
.status-cancelled { background: var(--danger-light); color: #991b1b; }
.status-refunded { background: #e0e7ff; color: #3730a3; }
.status-opened { background: var(--success-light); color: #065f46; }
.status-closed { background: #e2e8f0; color: #475569; }
.text-right { text-align: right; }

/* Order detail */
.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; padding: 16px; background: var(--bg); border-radius: var(--radius); }
.order-detail-grid .label { color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }
.order-detail-grid .value { font-weight: 700; font-size: 14px; margin-top: 2px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* === Nav Toggle (Hamburger) === */
.nav-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); color: var(--text-secondary); transition: all var(--transition); line-height: 1; }
.nav-toggle:hover { background: var(--hover); color: var(--text); }
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  #navbar { flex-wrap: wrap; gap: 4px; padding: 0 12px; height: auto; min-height: var(--nav-height); align-items: center; }
  .nav-links { display: none; width: 100%; flex: 0 0 100%; flex-direction: column; gap: 2px; padding: 4px 0 8px; overflow: visible; border-top: 1px solid var(--border); margin-top: 4px; }
  .nav-links.open { display: flex; animation: screenFadeIn 0.15s ease-out; }
  .nav-link { padding: 10px 14px; font-size: 14px; border-radius: var(--radius-sm); }
  .nav-right { margin-left: auto; gap: 8px; }
  .nav-user { display: none; }
}

/* === Responsive === */
@media (max-width: 1024px) {
  .pos-cart { width: 340px; }
  .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .report-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .pos-layout { flex-direction: column; height: auto; }
  .pos-products { flex: none; }
  .pos-cart { width: 100%; height: auto; max-height: 50vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .cart-items { max-height: 200px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
  .modal { min-width: unset; width: 95vw; padding: 20px; max-height: 92vh; }
  .modal .btn-group { flex-direction: column; }
  .modal .btn-group .btn { width: 100%; justify-content: center; }
  .login-box { padding: 32px 24px; width: 95vw; }
  .screen-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .screen-header h2 { font-size: 18px; }
  .pos-scan-row { flex-direction: column; gap: 6px; }
  .barcode-input { flex: 1; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .report-controls { flex-direction: column; align-items: stretch; }
  .report-controls select, .report-controls .btn { width: 100%; }
  .report-summary { grid-template-columns: 1fr; }
  .report-results { padding: 16px; }
  .settings-form { max-width: 100%; padding: 20px; }
  .pos-categories { padding: 2px 0 8px; }
  .product-card .prod-img, .product-card .prod-img-placeholder, .prod-img-wrap { height: 70px; }
  .product-card .prod-price { font-size: 15px; }
  .content-screen { padding: 16px; }
  .dash-card .dash-value { font-size: 22px; }
  .dash-card { padding: 16px; }
  table { font-size: 12px; }
  th, td { padding: 8px 10px; }
  .cart-total { font-size: 18px; }
  .cart-total .total-amount { font-size: 20px; }
  .cart-delivery select, .cart-delivery input { font-size: 16px; } /* prevent iOS zoom */
  .modal .form-group input, .modal .form-group select, .modal .form-group textarea { font-size: 16px; }
  .search-input { font-size: 16px; }
}

@media (max-width: 480px) {
  .dashboard-cards { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .product-card { padding: 8px 6px; }
  .product-card .prod-name { font-size: 11px; }
  .product-card .prod-price { font-size: 14px; }
  .product-card .stock-badge { font-size: 8px; padding: 1px 5px; }
  .modal { padding: 16px; width: 98vw; }
  .login-box { padding: 24px 16px; width: 100vw; border-radius: 0; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
  .login-container::before, .login-container::after { display: none; }
  .pos-cart { max-height: 45vh; }
  .cart-item { padding: 10px 14px; }
  .cart-header, .cart-footer, .cart-delivery { padding: 12px 14px; }
  .cart-item-actions input { width: 42px; }
  th, td { padding: 6px 8px; font-size: 11px; }
  .screen-header h2 { font-size: 16px; }
  .dash-card .dash-icon { font-size: 24px; }
  .dash-card .dash-value { font-size: 20px; }
  .btn { font-size: 12px; padding: 7px 14px; }
  .btn-lg { padding: 12px 20px; font-size: 15px; }
  #navbar { padding: 0 8px; }
  .nav-brand { font-size: 14px; }
  .lang-select { font-size: 11px; padding: 4px 6px; }
  .report-stat .stat-value { font-size: 20px; }
  .barcode-feedback { left: 16px; right: 16px; bottom: 16px; text-align: center; }
}
