/* SR Shoes Staff App — Module Styles */
@import url('../shared/style.css');

/* ── LAYOUT ── */
body { overflow: hidden; height: 100vh; }

#app {
  display: none; flex: 1; overflow: hidden;
  flex-direction: row; height: 100vh;
}
#app.visible { display: flex; }

/* ── MAIN AREA ── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.main-topbar {
  height: 52px; background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px;
  justify-content: space-between; flex-shrink: 0;
}
.main-topbar-title { font-size: 16px; font-weight: 700; color: var(--navy); }
.main-topbar-right { display: flex; align-items: center; gap: 12px; }

.panel { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.panel.active { display: flex; }
.panel-scroll { flex: 1; overflow-y: auto; padding: 20px; }

/* ── POS LAYOUT ── */
.pos-layout {
  flex: 1; display: flex; flex-direction: row; overflow: hidden;
}
.pos-left  { width: 55%; display: flex; flex-direction: column; background: var(--cream); border-right: 1px solid var(--border); }
.pos-right { width: 45%; display: flex; flex-direction: column; background: var(--white); }

/* ── POS SCAN BAR ── */
.pos-scan-bar {
  padding: 12px 16px; background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; gap: 8px; align-items: center; flex-shrink: 0;
}
.pos-scan-input {
  flex: 1; padding: 10px 14px; border: 2px solid var(--navy);
  border-radius: 8px; font-size: 14px; font-family: 'DM Mono', monospace;
  background: #f8fafc; color: var(--text); outline: none;
}
.pos-scan-input:focus { border-color: var(--gold); }
.pos-scan-input::placeholder { font-family: 'DM Sans', sans-serif; color: #aaa; }
.btn-add-scan {
  padding: 10px 16px; border-radius: 8px;
  background: var(--navy); color: #fff;
  border: none; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* ── SALESMAN BAR ── */
.salesman-bar {
  padding: 8px 16px; background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.salesman-bar label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.salesman-select {
  flex: 1; padding: 6px 10px; border-radius: 6px;
  border: 1.5px solid var(--border); font-size: 13px; font-weight: 500;
  background: var(--white); color: var(--navy); cursor: pointer; outline: none;
  font-family: 'DM Sans', sans-serif;
}

/* ── CART ── */
.cart-area { flex: 1; overflow-y: auto; }
.cart-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--white); transition: background 0.15s;
}
.cart-item:hover { background: #fafafa; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-meta     { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cart-item-salesman { font-size: 11px; color: var(--gold); font-weight: 600; margin-top: 2px; }
.cart-item-price    { font-size: 15px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1.5px solid var(--border); background: var(--white);
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--navy); font-weight: 700; transition: background 0.15s;
}
.qty-btn:hover { background: var(--warm); }
.qty-display { width: 32px; text-align: center; font-size: 14px; font-weight: 600; color: var(--navy); }
.btn-remove-cart {
  width: 28px; height: 28px; border-radius: 6px; margin-left: 8px;
  border: 1.5px solid #fde8e8; background: #fff5f5;
  color: var(--red); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}

/* ── SEARCH DROPDOWN ── */
.scan-wrap { position: relative; flex: 1; }
.search-dropdown {
  position: absolute; z-index: 100; background: var(--white);
  border: 1.5px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 280px; overflow-y: auto;
  left: 0; right: 0; top: calc(100% + 4px);
}
.search-result-item {
  padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.12s;
}
.search-result-item:last-child { border: none; }
.search-result-item:hover { background: var(--cream); }
.sri-name { font-size: 13px; font-weight: 600; color: var(--navy); }
.sri-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sri-price { font-size: 14px; font-weight: 700; color: var(--navy); }
.sri-stock-ok  { font-size: 11px; color: var(--green); }
.sri-stock-low { font-size: 11px; color: var(--amber); }
.sri-stock-out { font-size: 11px; color: var(--red);   }

/* ── RIGHT PANEL BILLING ── */
.billing-section { padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.section-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 10px; }
.customer-input {
  flex: 1; padding: 9px 12px; border-radius: 8px;
  border: 1.5px solid var(--border); font-size: 13px;
  font-family: 'DM Sans', sans-serif; outline: none; color: var(--text);
}
.customer-input:focus { border-color: var(--navy); }
.loyalty-info { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: #FFF8E1; border: 1px solid #FFECB3; font-size: 12px; color: #E65100; display: none; }
.loyalty-info.visible { display: block; }
.discount-input { width: 90px; padding: 6px 10px; border-radius: 6px; border: 1.5px solid var(--border); font-size: 13px; font-family: 'DM Mono', monospace; text-align: right; outline: none; }
.discount-type-btn { padding: 6px 10px; border-radius: 6px; border: 1.5px solid var(--border); background: var(--white); font-size: 12px; font-weight: 600; cursor: pointer; color: var(--navy); }

/* ── PAYMENT MODES ── */
.payment-modes { display: flex; gap: 8px; margin-bottom: 14px; }
.pay-btn {
  flex: 1; padding: 12px 8px; border-radius: 10px;
  border: 2px solid var(--border); background: var(--white);
  font-size: 13px; font-weight: 600; color: var(--navy);
  cursor: pointer; text-align: center; transition: all 0.15s;
}
.pay-btn:hover { border-color: var(--navy); }
.pay-btn.selected.cash  { background: var(--green2); border-color: var(--green); color: var(--green); }
.pay-btn.selected.upi   { background: #EDE7F6; border-color: #7B1FA2; color: #7B1FA2; }
.pay-btn.selected.khata { background: var(--amber2); border-color: var(--amber); color: var(--amber); }
.pay-btn .pay-icon { font-size: 20px; display: block; margin-bottom: 4px; }

.btn-bill {
  width: 100%; padding: 16px; border-radius: 12px; border: none;
  background: var(--navy); color: #fff;
  font-size: 18px; font-weight: 700; cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-bill:hover   { background: var(--navy2); }
.btn-bill:active  { transform: scale(0.98); }
.btn-bill:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-bill.ready { background: var(--green); }

/* ── TOTALS ── */
.total-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.total-row.main { font-size: 22px; font-weight: 700; color: var(--navy); margin-top: 10px; margin-bottom: 0; }
.total-row.discount { color: var(--green); }

/* ── RECEIPT MODAL ── */
.modal-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--white); border-radius: 16px; width: 480px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-head { padding: 18px 22px; background: var(--navy); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { color: #fff; font-size: 16px; font-weight: 600; }
.modal-close { background: rgba(255,255,255,0.15); border: none; border-radius: 50%; width: 30px; height: 30px; color: #fff; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.modal-body { flex: 1; overflow-y: auto; padding: 22px; }
.modal-actions { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

/* ── RECEIPT ── */
.receipt { font-family: 'DM Mono', monospace; font-size: 13px; line-height: 1.6; color: #000; width: 100%; }
.receipt-center { text-align: center; }
.receipt-divider { border-top: 1px dashed #888; margin: 6px 0; }
.receipt-bold { font-weight: 700; }
.receipt-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.receipt-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-total-row { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; }
.receipt-small { font-size: 11px; color: #555; }

/* ── AUDIT ── */
.scanner-zone { background: var(--navy); padding: 16px 20px; flex-shrink: 0; }
.audit-scan-input {
  width: 100%; padding: 12px 16px; border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08); color: #fff;
  font-size: 16px; font-family: 'DM Mono', monospace; outline: none;
}
.audit-scan-input:focus { border-color: var(--gold2); }
.audit-scan-input::placeholder { font-family: 'DM Sans', sans-serif; color: rgba(255,255,255,0.3); font-size: 14px; }
.scan-feedback { margin-top: 10px; padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; min-height: 36px; display: flex; align-items: center; gap: 8px; }
.scan-feedback.ok   { background: rgba(26,107,60,0.3); color: #5dde8a; }
.scan-feedback.err  { background: rgba(192,57,43,0.3); color: #ff6b6b; }
.scan-feedback.warn { background: rgba(230,126,34,0.3); color: #ffbb55; }
.audit-progress { background: var(--white); padding: 10px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; display: flex; align-items: center; gap: 14px; }
.progress-track { flex: 1; background: #e0e0e0; border-radius: 99px; height: 8px; overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 99px; background: var(--navy); transition: width 0.3s; }
.audit-tabs { display: flex; background: var(--white); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.audit-tab { flex: 1; padding: 11px; text-align: center; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; transition: all 0.15s; }
.audit-tab.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-count { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 11px; margin-left: 5px; background: var(--cream); }
.audit-tab.active .tab-count { background: var(--navy); color: #fff; }
.scan-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); animation: fadeIn 0.2s ease; }
.scan-item-name { font-size: 13px; font-weight: 600; color: var(--navy); }
.scan-item-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.disc-item { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.disc-severity { width: 4px; height: 48px; border-radius: 2px; flex-shrink: 0; }
.disc-diff { font-size: 18px; font-weight: 700; }
.disc-diff.minus { color: var(--red); }

/* ── ADMIN DASHBOARD ── */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }
.bar-chart  { display: flex; flex-direction: column; gap: 10px; }
.bar-row    { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.bar-label  { width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--navy); font-weight: 500; }
.bar-track  { flex: 1; background: #eee; border-radius: 99px; height: 8px; overflow: hidden; }
.bar-fill   { height: 100%; border-radius: 99px; background: var(--navy); }
.bar-val    { width: 60px; text-align: right; color: var(--muted); }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.alert-item:last-child { border: none; }
.alert-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── AI ANALYST ── */
.ai-header { background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; display: flex; align-items: center; gap: 16px; }
.ai-icon   { width: 52px; height: 52px; border-radius: 12px; background: rgba(201,147,42,0.2); border: 1px solid rgba(201,147,42,0.4); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.ai-header h2 { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.ai-header p  { font-size: 13px; color: rgba(255,255,255,0.55); }
.ai-controls  { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.ai-period-btn { padding: 8px 18px; border-radius: 20px; border: 1.5px solid rgba(255,255,255,0.2); background: transparent; color: rgba(255,255,255,0.6); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; font-family: 'DM Sans', sans-serif; }
.ai-period-btn.active { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-run-ai { padding: 8px 22px; border-radius: 20px; background: var(--gold); border: none; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; margin-left: auto; font-family: 'DM Sans', sans-serif; }
.btn-run-ai:disabled { opacity: 0.4; cursor: not-allowed; }
.ai-product-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ai-product-row:last-child { border: none; }
.ai-product-name { font-weight: 600; color: var(--navy); min-width: 200px; }
.ai-product-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ai-suggestion   { flex: 1; font-size: 12px; color: var(--text); background: var(--cream); border-radius: 6px; padding: 6px 10px; line-height: 1.5; }

/* ── PURCHASE ── */
.purchase-scan-bar { background: var(--navy); padding: 14px 18px; display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.purchase-scan-input { flex: 1; padding: 10px 14px; border-radius: 8px; border: 2px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); color: #fff; font-size: 14px; font-family: 'DM Mono', monospace; outline: none; }
.purchase-scan-input:focus { border-color: var(--gold2); }
.purchase-scan-input::placeholder { font-family: 'DM Sans', sans-serif; color: rgba(255,255,255,0.3); font-size: 13px; }
.btn-purchase-add { padding: 10px 18px; border-radius: 8px; background: var(--gold); border: none; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn-purchase-new { padding: 10px 18px; border-radius: 8px; background: var(--green); border: none; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; margin-left: 4px; }
.items-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.items-tbl thead th { background: var(--cream); padding: 9px 10px; text-align: left; font-weight: 600; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.items-tbl tbody td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl-input  { width: 100%; padding: 6px 8px; border-radius: 6px; border: 1.5px solid var(--border); font-size: 12px; outline: none; min-width: 60px; }
.tbl-select { padding: 6px 8px; border-radius: 6px; border: 1.5px solid var(--border); font-size: 12px; outline: none; background: var(--white); cursor: pointer; min-width: 70px; }
.btn-remove-row { width: 26px; height: 26px; border-radius: 6px; background: var(--red2); border: none; color: var(--red); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.totals-box { background: var(--navy); border-radius: var(--radius); padding: 18px 20px; color: #fff; }
.totals-box .total-row { color: rgba(255,255,255,0.7); }
.totals-box .total-row.main { color: #fff; border-top: 1px solid rgba(255,255,255,0.15); padding-top: 10px; }

/* ── COMMISSION VIEW (staff) ── */
.commission-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; margin-bottom: 16px; }
.comm-amount { font-size: 32px; font-weight: 700; color: var(--green); }
.comm-period { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ── NEW ITEM MODAL ── */
.new-item-modal-overlay { position: fixed; inset: 0; z-index: 600; background: rgba(0,0,0,0.55); display: none; align-items: center; justify-content: center; padding: 16px; }
.new-item-modal-overlay.open { display: flex; }
.new-item-modal-box { background: var(--white); border-radius: 14px; width: 100%; max-width: 600px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.new-item-modal-head { padding: 16px 20px; background: var(--green); display: flex; align-items: center; justify-content: space-between; }
.new-item-modal-head h3 { color: #fff; font-size: 15px; font-weight: 700; }

/* ── GRN ── */
.grn-header { background: var(--navy); border-radius: 14px; padding: 24px; margin-bottom: 20px; color: #fff; }
.grn-header h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.grn-stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }
.grn-stat { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 14px; }

/* ── FILTERS ── */
.filter-row { display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.filter-select { padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--border); font-size: 13px; font-family: 'DM Sans', sans-serif; color: var(--navy); background: var(--white); cursor: pointer; outline: none; }
.filter-input  { padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--border); font-size: 13px; font-family: 'DM Sans', sans-serif; color: var(--text); outline: none; width: 180px; }
.filter-input:focus, .filter-select:focus { border-color: var(--navy); }

/* ── CLOCK ── */
.clock { font-family: 'DM Mono', monospace; font-size: 12px; color: rgba(255,255,255,0.5); }

/* ── LAYOUT ─────────────────────────────────────────────────────── */
body { overflow: hidden; height: 100vh; }

#app {
  display: flex; flex-direction: row;
  height: 100vh; overflow: hidden;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────── */
.sidebar {
  width: 220px; background: var(--navy3);
  display: flex; flex-direction: column;
  flex-shrink: 0; overflow: hidden;
  transition: transform 0.25s;
  z-index: 200;
}

.sidebar-header {
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  font-size: 18px; font-weight: 700; color: #fff;
  margin-bottom: 4px;
}
.sidebar-logo span { color: var(--gold2); }
.sidebar-role {
  font-size: 11px; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 1px;
}

.sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; cursor: pointer; color: rgba(255,255,255,0.6);
  font-size: 13px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
  background: rgba(255,255,255,0.1); color: #fff;
  border-left-color: var(--gold2);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-clock {
  font-size: 12px; color: rgba(255,255,255,0.4);
  font-family: 'DM Mono', monospace; margin-bottom: 10px;
}
.lock-btn {
  width: 100%; padding: 8px; border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6); font-size: 12px;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
}
.lock-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ── MAIN CONTENT ────────────────────────────────────────────────── */
.main-content {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; background: var(--cream);
}

/* ── MOBILE TOPBAR ───────────────────────────────────────────────── */
.mobile-topbar {
  height: 52px; background: var(--navy);
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
  flex-shrink: 0; color: #fff;
}
.hamburger {
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 20px; cursor: pointer; padding: 4px;
  font-family: 'DM Sans', sans-serif;
}
.mobile-title {
  flex: 1; font-size: 15px; font-weight: 700; color: #fff;
}
.mobile-right { display: flex; align-items: center; gap: 10px; }
.role-badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; background: rgba(255,255,255,0.15); color: #fff;
}
.mobile-clock {
  font-size: 11px; color: rgba(255,255,255,0.5);
  font-family: 'DM Mono', monospace;
}

/* ── PANELS ──────────────────────────────────────────────────────── */
.panel { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.panel.active { display: flex; }
.panel-body { flex: 1; overflow-y: auto; padding: 20px; max-width: 960px; }

/* ── TAB BAR (admin) ─────────────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 2px; padding: 10px 16px;
  background: var(--white); border-bottom: 1px solid var(--border);
  overflow-x: auto; flex-shrink: 0;
}
.tab-btn {
  padding: 7px 14px; border-radius: 20px; border: none;
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; font-family: 'DM Sans', sans-serif;
  transition: background 0.15s, color 0.15s;
}
.tab-btn:hover { background: var(--cream); color: var(--navy); }
.tab-btn.active { background: var(--navy); color: #fff; }

/* ── STAT CARDS (dashboard) ──────────────────────────────────────── */
.stat-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 18px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%; border-radius: 4px 0 0 4px;
}
.stat-card.green::before { background: var(--green); }
.stat-card.gold::before  { background: var(--gold); }
.stat-card.blue::before  { background: var(--blue); }
.stat-card.red::before   { background: var(--red); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-val   { font-size: 24px; font-weight: 700; color: var(--navy); margin-bottom: 4px; font-family: 'DM Mono', monospace; }
.stat-sub   { font-size: 12px; color: var(--muted); }

/* ── ACTION CARDS (purchase home) ────────────────────────────────── */
.action-card {
  background: var(--white); border-radius: var(--radius);
  border: 1.5px solid var(--border); padding: 22px 18px;
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; gap: 8px;
}
.action-card:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.action-card:active { transform: scale(0.98); }
.action-icon  { font-size: 28px; }
.action-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.action-desc  { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ── POS LAYOUT ──────────────────────────────────────────────────── */
.pos-body {
  flex: 1; display: flex; overflow: hidden;
}
.pos-cart {
  flex: 1; overflow-y: auto; padding: 16px;
  border-right: 1px solid var(--border);
}
.pos-bill {
  width: 320px; flex-shrink: 0;
  overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--white);
}
.cart-empty {
  text-align: center; padding: 60px 20px;
  color: var(--muted); font-size: 13px;
}

/* ── BILL SECTION ────────────────────────────────────────────────── */
.bill-section { display: flex; flex-direction: column; gap: 8px; }
.bill-section-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.bill-input {
  width: 100%; padding: 8px 12px; border-radius: 8px;
  border: 1.5px solid var(--border); font-size: 13px;
  font-family: 'DM Sans', sans-serif; outline: none; color: var(--text);
}
.bill-input:focus { border-color: var(--navy); }

/* ── PAYMENT ─────────────────────────────────────────────────────── */
.pay-modes { display: flex; gap: 8px; }
.pay-btn {
  flex: 1; padding: 10px 6px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--white);
  color: var(--navy); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  font-family: 'DM Sans', sans-serif; text-align: center;
}
.pay-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── TOTALS ──────────────────────────────────────────────────────── */
.total-row {
  display: flex; justify-content: space-between;
  font-size: 13px; margin-bottom: 6px;
}
.total-row.grand {
  font-size: 18px; font-weight: 700; color: #fff;
  margin-top: 10px; margin-bottom: 0;
  border-top: 1px solid rgba(255,255,255,0.2); padding-top: 10px;
}

/* ── DISCOUNT TYPE BTN ───────────────────────────────────────────── */
.disc-type-btn {
  padding: 8px 14px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--cream);
  color: var(--navy); font-size: 14px; font-weight: 700;
  cursor: pointer; flex-shrink: 0;
}

/* ── CART ITEMS ──────────────────────────────────────────────────── */
.cart-item {
  background: var(--white); border-radius: 10px;
  border: 1px solid var(--border); padding: 12px 14px;
  margin-bottom: 10px; display: flex; gap: 12px; align-items: flex-start;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 13px; font-weight: 700; color: var(--navy); }
.cart-item-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cart-item-price { font-size: 14px; font-weight: 700; color: var(--navy); }
.qty-control { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1.5px solid var(--border); background: var(--cream);
  font-size: 16px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  font-family: 'DM Sans', sans-serif;
}
.qty-val { font-size: 14px; font-weight: 600; min-width: 20px; text-align: center; }

/* ── AUDIT VIEWS ─────────────────────────────────────────────────── */
.audit-view { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.audit-view.active { display: flex; }
.audit-scan-bar {
  background: var(--navy); padding: 14px 18px;
  display: flex; gap: 12px; align-items: center; flex-shrink: 0;
}
.audit-feedback {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.8);
  min-width: 100px;
}
.audit-progress-bar {
  height: 4px; background: rgba(0,0,0,0.08); flex-shrink: 0;
}
.audit-progress-fill {
  height: 100%; background: var(--green); transition: width 0.3s;
}
.audit-stats {
  display: flex; padding: 14px 20px; gap: 20px;
  border-bottom: 1px solid var(--border); background: var(--white);
  flex-shrink: 0;
}
.audit-stat { text-align: center; }
.audit-stat-val { font-size: 22px; font-weight: 700; color: var(--navy); }
.audit-stat-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.audit-tabs {
  display: flex; gap: 2px; padding: 8px 16px;
  background: var(--cream); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.audit-tab {
  padding: 6px 16px; border-radius: 20px; border: none;
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.audit-tab.active { background: var(--navy); color: #fff; }

/* ── PURCHASE VIEWS ──────────────────────────────────────────────── */
.purchase-view { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.purchase-view.active { display: flex; overflow-y: auto; }

/* ── PURCHASE BUTTONS ────────────────────────────────────────────── */
.btn-purchase-add {
  padding: 10px 16px; border-radius: 8px;
  background: var(--gold); border: none; color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap; font-family: 'DM Sans', sans-serif;
}
.btn-purchase-new {
  padding: 10px 16px; border-radius: 8px;
  background: var(--green); border: none; color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap; font-family: 'DM Sans', sans-serif;
}

/* ── SCAN INPUT (POS) ────────────────────────────────────────────── */
.scan-input {
  flex: 1; padding: 10px 14px; border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08); color: #fff;
  font-size: 14px; font-family: 'DM Mono', monospace; outline: none;
}
.scan-input:focus { border-color: var(--gold2); }
.scan-input::placeholder { font-family: 'DM Sans', sans-serif; color: rgba(255,255,255,0.3); font-size: 13px; }

/* ── MODAL ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.55);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: 14px;
  width: 100%; max-width: 600px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-head {
  padding: 16px 20px; background: var(--navy);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { color: #fff; font-size: 15px; font-weight: 700; }
.modal-close {
  background: rgba(255,255,255,0.2); border: none; border-radius: 50%;
  width: 30px; height: 30px; color: #fff; cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; background: var(--cream);
}

/* ── HISTORY ITEMS ───────────────────────────────────────────────── */
.history-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.12s;
}
.history-item:hover { background: var(--cream); }
.history-item:last-child { border: none; }
.history-info { flex: 1; }
.history-title { font-size: 13px; font-weight: 600; color: var(--navy); }
.history-meta  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.history-amount { font-size: 16px; font-weight: 700; color: var(--navy); }

/* ── AI ANALYST ──────────────────────────────────────────────────── */
.ai-product-row {
  display: flex; gap: 16px; padding: 12px 18px;
  border-bottom: 1px solid var(--border); align-items: flex-start;
}
.ai-product-row:last-child { border: none; }
.ai-product-name { font-size: 13px; font-weight: 600; color: var(--navy); }
.ai-product-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ai-suggestion   { font-size: 12px; color: var(--text); line-height: 1.5; flex: 1; }
.ai-period-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── SEARCH DROPDOWN ─────────────────────────────────────────────── */
.scan-wrap { position: relative; flex: 1; }
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 240px; overflow-y: auto;
}
.search-result {
  padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.12s;
}
.search-result:last-child { border: none; }
.search-result:hover { background: var(--cream); }
.sr-name { font-size: 13px; font-weight: 600; color: var(--navy); }
.sr-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sr-price { font-size: 13px; font-weight: 600; color: var(--navy); }

/* ── BILL NO BADGE ───────────────────────────────────────────────── */
.bill-no-badge {
  font-size: 11px; color: rgba(255,255,255,0.5);
  font-family: 'DM Mono', monospace;
}

/* ── RESPONSIVE / MOBILE SIDEBAR ────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { width: 100%; }
}
@media (min-width: 769px) {
  .hamburger { display: none; }
  .mobile-topbar { display: none; }
  .main-content.with-sidebar .panel { /* normal */ }
}

/* ── POS TOOLBAR ─────────────────────────────────────────────────── */
.pos-toolbar {
  background: var(--navy2); padding: 8px 14px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.pos-toolbar-btn {
  padding: 6px 12px; border-radius: 20px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
  white-space: nowrap;
}
.pos-toolbar-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
