/* ============================================================
   ROTI BAKAR NGEUNAH — Premium POS Design System v2
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Brand — Red primary, Orange secondary */
  --primary:      #DC2626;
  --primary-600:  #B91C1C;
  --primary-700:  #991B1B;
  --white:        #FFFFFF;

  /* Semantic colors */
  --danger:       #DC2626;
  --danger-bg:    #FEE2E2;
  --success:      #16A34A;
  --success-bg:   #DCFCE7;
  --warning:      #F97316;
  --warning-bg:   #FFEDD5;
  --info:         #2563EB;
  --info-bg:      #DBEAFE;

  /* Neutral / grayscale */
  --bg:         #F8F8F8;
  --bg-alt:     #F1F1F1;
  --surface:    #FFFFFF;
  --surface-2:  #F9FAFB;
  --border:     #E5E7EB;
  --border-strong: #D1D5DB;
  --text:       #111827;
  --text-sub:   #374151;
  --text-muted: #6B7280;

  /* Legacy aliases */
  --orange:       #F97316;
  --orange-light: #FFEDD5;
  --orange-dark:  #EA580C;
  --red:          var(--danger);
  --red-light:    var(--danger-bg);
  --red-dark:     #B91C1C;
  --success-dark: #15803D;
  --yellow-light: #FEF9C3;

  /* Spacing tokens (allowed set only): 4 / 8 / 12 / 16 / 24 / 32 */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;

  /* Backwards aliases (avoid arbitrary values) */
  --s8: var(--s6);
  --s10: var(--s6);
  --s12: var(--s6);

  /* Radii: small / medium / large / xl / 2xl */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-2xl: 24px;
  --r-full: 9999px;

  /* Shadows (minimal) */
  --sh-xs: 0 1px 2px rgba(2,6,23,0.04);
  --sh-sm: 0 4px 10px rgba(2,6,23,0.06);
  --sh:    0 8px 20px rgba(2,6,23,0.08);
  --sh-md: 0 14px 30px rgba(2,6,23,0.10);
  --sh-lg: 0 20px 40px rgba(2,6,23,0.14);
  --sh-xl: 0 30px 60px rgba(2,6,23,0.18);
  --sh-orange: 0 4px 14px rgba(251,140,0,0.30);
  --sh-red: 0 4px 14px rgba(220,38,38,0.25);

  /* Sidebar */
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 64px;
  --sidebar-bg: #0D1117;

  /* Transitions */
  --t:      0.14s ease;
  --t-med:  0.2s ease;
  --t-slow: 0.28s ease;

  /* Font */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, select, textarea { font-family: inherit; outline: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
svg { display: block; }

/* ── Typography utilities ──────────────────────────────────── */
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 14px; }
.text-md   { font-size: 15px; }
.text-lg   { font-size: 17px; }
.text-xl   { font-size: 20px; }
.text-2xl  { font-size: 24px; }
.text-3xl  { font-size: 30px; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.text-muted   { color: var(--text-muted); }
.text-sub     { color: var(--text-sub); }
.text-red     { color: var(--red); }
.text-orange  { color: var(--orange); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center  { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Enforced semantic typography (SaaS scale) */
h1, .h1 { font-size: 24px; font-weight: 700; line-height: 1.2; margin: 0 0 var(--s3) 0; }
h2, .h2 { font-size: 18px; font-weight: 600; line-height: 1.25; margin: 0 0 var(--s2) 0; }
body, .body { font-size: 14px; font-weight: 400; }
.small, .text-small { font-size: 12px; }

/* ── Layout utilities ──────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: var(--s1); }
.gap-2 { gap: var(--s2); }
.dashed-border { border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); padding: var(--s2) 0; margin-bottom: var(--s2); }
.dashed-border-top { border-top: 1px dashed var(--border); margin-top: var(--s2); padding-top: var(--s2); }
.gap-3 { gap: var(--s3); }
.gap-4 { gap: var(--s4); }
.gap-6 { gap: var(--s6); }
.min-w-0 { min-width: 0; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 9px 18px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--t);
  border: 1.5px solid transparent;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.01em;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.btn svg { flex-shrink: 0; }

.btn-primary {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
  box-shadow: 0 4px 14px rgba(220,38,38,0.28);
}
.btn-primary:hover  {
  background: var(--red-dark);
  border-color: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(220,38,38,0.38);
}
.btn-primary:active { transform: scale(0.97); box-shadow: var(--sh-sm); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--sh-xs);
}
.btn-secondary:hover { background: var(--bg); transform: translateY(-1px); box-shadow: var(--sh-sm); }
.btn-secondary:active { transform: scale(0.97); }

.btn-outline {
  background: transparent;
  color: var(--text-sub);
  border-color: var(--border-strong);
}
.btn-outline:hover { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
.btn-outline:active { transform: scale(0.97); }

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
  box-shadow: var(--sh-red);
}
.btn-danger:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-danger:active { transform: scale(0.97); }

.btn-danger-soft {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: transparent;
}
.btn-danger-soft:hover { background: #fecaca; }

.btn-success {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
  box-shadow: 0 4px 16px rgba(22,163,74,0.28);
}
.btn-success:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--r-sm); gap: 5px; }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: var(--r-lg); }
.btn-xl { padding: 16px 32px; font-size: 16px; border-radius: var(--r-lg); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  display: inline-flex; align-items: center; justify-content: center;
  transition: var(--t);
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg-alt); color: var(--text); border-color: var(--border-strong); }
.btn-icon-danger:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }

/* Loading state */
.btn.loading { pointer-events: none; }
.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  letter-spacing: 0.2px;
}

.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--t), box-shadow var(--t);
  line-height: 1.4;
}
.form-control:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(251,140,0,0.14);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 2px; display: none; }
.form-error.show { display: block; }

select.form-control { cursor: pointer; appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }

.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; font-weight: 600; color: var(--text-muted); pointer-events: none;
}
.input-prefix-wrap .form-control { padding-left: 36px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--sh-xs);
  overflow: hidden;
}
.card-body { padding: var(--s5); }
.card-header {
  padding: 13px var(--s5);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  background: var(--surface-2);
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text); }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge-red     { background: var(--red-light);    color: var(--red);     border: 1px solid rgba(229,57,53,.2); }
.badge-orange  { background: var(--orange-light); color: var(--orange-dark); border: 1px solid rgba(251,140,0,.2); }
.badge-green   { background: var(--success-bg);   color: var(--success); border: 1px solid rgba(22,163,74,.2); }
.badge-yellow  { background: var(--yellow-light); color: #78600A; border: 1px solid rgba(253,216,53,.3); }
.badge-success { background: var(--success-bg);   color: var(--success); border: 1px solid rgba(22,163,74,.2); }
.badge-danger  { background: var(--danger-bg);    color: var(--danger);  border: 1px solid rgba(220,38,38,.2); }
.badge-info    { background: var(--info-bg);      color: var(--info);    border: 1px solid rgba(37,99,235,.2); }
.badge-gray    { background: var(--bg-alt);       color: var(--text-sub);border: 1px solid var(--border); }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: var(--surface-2); border-bottom: 1.5px solid var(--border); }
th {
  padding: 10px var(--s4);
  text-align: left;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}
td {
  padding: 11px var(--s4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
  color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t); }
tbody tr:hover td { background: var(--surface-2); }
.empty-td { text-align: center; color: var(--text-muted); padding: 40px; font-size: 13px; }

/* ── Modals ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.50);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s4);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-slow), visibility var(--t-slow);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  width: 100%; max-width: 480px;
  max-height: 92vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--t-slow);
  border: 1px solid var(--border);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 660px; }
.modal-sm { max-width: 380px; }

/* ── Confirm Modal (Custom) ── */
.modal-confirm-card {
  text-align: center;
  max-width: 380px;
  padding: 0;
}
.modal-confirm-icon {
  font-size: 48px;
  padding: 28px 0 8px;
  line-height: 1;
}
.modal-confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  padding: 0 24px 8px;
}
.modal-confirm-body {
  font-size: 14px;
  color: var(--text-muted);
  padding: 0 24px 24px;
  line-height: 1.5;
}
.modal-confirm-footer {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.btn-confirm-cancel, .btn-confirm-ok {
  flex: 1;
}

.modal-header {
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  background: var(--surface); z-index: 10;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.modal-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.modal-body { padding: var(--s5); flex: 1; overflow-y: auto; min-height: 0; }
.modal-footer {
  padding: var(--s3) var(--s5) var(--s5);
  display: flex; gap: var(--s2); justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  flex-shrink: 0;
}
.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--r-full);
  border: none; background: var(--bg);
  color: var(--text-sub);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--t); flex-shrink: 0;
  font-size: 18px;
}
.modal-close:hover { background: var(--bg-alt); color: var(--text); }

/* ── Toast Notifications ───────────────────────────────────── */
#toast-container {
  position: fixed; top: var(--s4); right: var(--s4);
  z-index: 2000;
  display: flex; flex-direction: column; gap: var(--s2);
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--r-lg);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--sh-lg);
  max-width: 360px;
  display: flex; align-items: center; gap: var(--s2);
  animation: toastIn 0.22s ease, toastOut 0.22s ease 2.78s forwards;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
}
.toast-success { background: #15803D; color: white; }
.toast-error   { background: var(--red);   color: white; }
.toast-warning { background: var(--orange); color: white; }
.toast-info    { background: var(--info);  color: white; }

@keyframes toastIn  { from { opacity:0; transform:translateX(110%) scale(0.9); } to { opacity:1; transform:translateX(0) scale(1); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(110%); } }

/* ── Loading ───────────────────────────────────────────────── */
.loader-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.8);
  z-index: 1500;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Misc ──────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: var(--s4) 0; }

.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 11px; color: var(--text-muted); pointer-events: none; display: flex; }
.search-wrap input { padding-left: 34px; }

/* Utility helpers (replace inline styles) */
.hidden { display: none !important; }
.search-wrap.search-compact { flex: 1; max-width: 260px; }
.pos-cart-actions { margin-left: auto; display: flex; gap: var(--s2); align-items: center; }
.pos-relative { position: relative; }
.held-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; border-radius: var(--r-full); background: var(--danger); color: white; font-size: 11px; font-weight: 800; padding: 0 6px; border: 2px solid var(--surface); }
.empty-state.full { grid-column: 1 / -1; }

/* Panel header helper */
.panel-header { display:flex; align-items:center; justify-content:space-between; margin-bottom: var(--s4); }

/* Content width helpers */
.content-narrow { max-width: 480px; }

/* Alerts */
.alert-warning {
  background: var(--warning-bg);
  border: 1px solid rgba(217,119,6,0.2);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: var(--s4);
  font-size: 12px; color: var(--warning); font-weight: 600;
}

/* Icon sizing (use with lucide icons) */
.icon { width: 18px; height: 18px; display:inline-block; vertical-align:middle; }

/* Small utilities */
.p-0 { padding: 0 !important; }
.max-h-60vh { max-height: 60vh; overflow: auto; }
.w-auto { width: auto !important; }
.flex-shrink-0 { flex-shrink: 0; }

/* Accessibility */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Background helpers for stat icons */
.bg-info { background: var(--info-bg); }
.bg-success { background: var(--success-bg); }
.bg-warning { background: var(--warning-bg); }

/* Stats grid helper */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }

.stat-card-hero .stat-value { font-size: 32px; }

.text-white { color: var(--white) !important; }
.opacity-70 { opacity: 0.7; }
.p-4 { padding: var(--s4) !important; }

/* Additional spacing utilities */
.mb-5 { margin-bottom: var(--s5); }
.mb-6 { margin-bottom: var(--s6); }
.mt-5 { margin-top: var(--s5); }
.mt-6 { margin-top: var(--s6); }
.p-5 { padding: var(--s5) !important; }
.p-6 { padding: var(--s6) !important; }
.pb-1 { padding-bottom: var(--s1) !important; }

/* Flex alignment helpers */
.items-end { align-items: flex-end; }
.flex-none { flex: 0 0 auto; }

/* Form-width helpers used in admin filters */
.form-flex-180 { flex: 1; min-width: 180px; }
.form-flex-160 { flex: 1; min-width: 160px; }
.max-w-280 { max-width: 280px; }

/* White-space helper */
.nowrap { white-space: nowrap; }

/* Responsive width helpers */
.w-full { width: 100%; }
.sm-w-auto { width: auto; } /* default desktop: auto width */
@media (max-width: 768px) { .sm-w-auto { width: 100%; } }

/* Small icon size */
.icon-sm { width: 14px; height: 14px; display:inline-block; vertical-align:middle; }

/* DB help code block used in status messages */
.db-help-code {
  display: block;
  margin-top: var(--s2);
  padding: var(--s2);
  background: rgba(0,0,0,0.08);
  border-radius: var(--r-sm);
  font-size: 11px;
  line-height: 1.6;
}

/* Additional small helpers used by admin layout */
.mt-2 { margin-top: var(--s2); }
.gap-2 { gap: var(--s2); }
.max-w-320 { max-width: 320px; }
.receipt-preview { background: var(--surface); border: 1px solid var(--border); padding: var(--s3); border-radius: var(--r-sm); max-width: 320px; }
.grid-1fr-420 { display: grid; grid-template-columns: 1fr 420px; gap: var(--s4); }
.max-w-120 { max-width: 120px; }
.m-0 { margin: 0 !important; }
/* Collapse 2-column admin settings grid on tablet/mobile */
@media (max-width: 900px) {
  .grid-1fr-420 { grid-template-columns: 1fr; }
}

/* Modal and product helpers */
.modal-footer-compact { padding: 0; border: none; margin-top: var(--s2); }
.variant-form { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s3); }
.variant-form-title { font-size: 12px; font-weight: 700; color: var(--text-sub); margin-bottom: var(--s3); text-transform: uppercase; letter-spacing: 0.5px; }
.grid-2-col-s5 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); align-items: start; }
.grid-2-col-s3 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); align-items: start; }
/* Collapse 2-col product modal grid on mobile */
@media (max-width: 600px) {
  .grid-2-col-s5 { grid-template-columns: 1fr; gap: var(--s4); }
  .grid-2-col-s3 { grid-template-columns: 1fr; gap: var(--s3); }
}
.panel-surface { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); margin-bottom: var(--s4); }
.grid-po-items { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: var(--s2); align-items: flex-end; }
.po-total { text-align: right; font-weight: 900; font-size: 15px; margin-top: var(--s3); color: var(--orange-dark); }
.panel-placeholder { padding: var(--s3); text-align: center; border: 1px dashed var(--border); border-radius: var(--r); }

/* POS helpers */
.justify-start { justify-content: flex-start; }
.p-3 { padding: var(--s3) !important; }
.icon-lg { width: 20px; height: 20px; display: inline-block; vertical-align: middle; }
.icon-xl { width: 36px; height: 36px; display: inline-block; vertical-align: middle; }
.mr-2 { margin-right: var(--s2); }
.clickable { cursor: pointer; }
.col-span-full { grid-column: 1 / -1; }
.img-cover { width:100%; height:100%; object-fit: cover; display:block; }
.empty-msg { color: var(--text-muted); text-align: center; padding: var(--s5) 0; }
.btn-list-item { justify-content: flex-start; padding: 12px !important; }
.grid-2-col-s2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); align-items: start; }
.btn-danger-ghost { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.mt-3 { margin-top: var(--s3); }
.w-full { width: 100%; }
.py-2 { padding-top: var(--s2); padding-bottom: var(--s2); }
.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.pt-4 { padding-top: var(--s4); }
.qty-input { width: 36px; text-align: center; border: 1px solid var(--border); border-radius: 6px; padding: 2px; }

/* Emphasized input for POS cash entry */
.input-hero {
  font-size: 18px; font-weight: 700; padding: 12px 14px;
}
/* Spacing helpers (use allowed spacing tokens) */
.mb-1 { margin-bottom: var(--s1); }
.mb-2 { margin-bottom: var(--s2); }
.mb-3 { margin-bottom: var(--s3); }
.mb-4 { margin-bottom: var(--s4); }
.mt-1 { margin-top: var(--s1); }

/* ── Empty States ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--s10) var(--s6);
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
}
.empty-icon {
  width: 64px; height: 64px;
  border-radius: var(--r-xl);
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin-bottom: var(--s2);
  border: 1px solid var(--border);
}
.empty-title { font-size: 15px; font-weight: 700; color: var(--text); }
.empty-desc  { font-size: 13px; color: var(--text-muted); max-width: 280px; }
.empty-cta { margin-top: var(--s3); }

/* ── Toggle Switch ─────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: var(--s2); }
.toggle { position: relative; width: 40px; height: 22px; display: inline-block; }
.toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: var(--r-full);
  cursor: pointer; transition: var(--t-med);
}
.toggle-slider::after {
  content: '';
  position: absolute; left: 2px; top: 2px;
  width: 18px; height: 18px;
  background: white; border-radius: 50%;
  transition: var(--t-med);
  box-shadow: var(--sh-sm);
}
.toggle input:checked + .toggle-slider { background: var(--orange); }
.toggle input:checked + .toggle-slider::after { transform: translateX(18px); }
.toggle-label { font-size: 13px; color: var(--text-sub); font-weight: 500; }

/* ── Image Upload ──────────────────────────────────────────── */
.img-upload-wrap {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--s6);
  text-align: center; cursor: pointer;
  transition: var(--t); background: var(--surface-2);
}
.img-upload-wrap:hover { border-color: var(--orange); background: var(--orange-light); }
.upload-icon { font-size: 30px; margin-bottom: var(--s1); }
.upload-text { font-size: 13px; color: var(--text-sub); font-weight: 500; }
.upload-hint { font-size: 11px; color: var(--text-muted); margin-top: var(--s1); }
.img-preview { width: 100%; max-height: 160px; object-fit: contain; border-radius: var(--r); margin-bottom: var(--s2); }

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: var(--s5);
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--t), transform var(--t);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  transition: background var(--t);
}
.stat-card:hover { box-shadow: var(--sh); transform: translateY(-1px); }
.stat-card:hover::before { background: var(--orange); }
.stat-card.hero::before { background: linear-gradient(90deg, var(--red), var(--orange)); }

.stat-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: var(--s2); }
.stat-value { font-size: 28px; font-weight: 900; line-height: 1.1; letter-spacing: -0.02em; }
.stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: var(--s1); }
.stat-icon  { font-size: 24px; margin-bottom: var(--s3); }
.stat-icon-wrap {
  width: 44px; height: 44px;
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: var(--s3);
}
.stat-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-full);
  margin-top: var(--s1);
}
.stat-trend.up   { background: var(--success-bg); color: var(--success); }
.stat-trend.down { background: var(--danger-bg);  color: var(--danger); }
.stat-trend.neutral { background: var(--bg-alt); color: var(--text-muted); }

/* Hero stat card */
.stat-card-hero {
  background: linear-gradient(135deg, #1E3A5F 0%, #0F172A 100%);
  border: 1px solid rgba(255,255,255,0.06);
  color: white;
}
.stat-card-hero::before { background: linear-gradient(90deg, var(--red), var(--orange)); }
.stat-card-hero .stat-label { color: rgba(255,255,255,0.6); }
.stat-card-hero .stat-value { color: white; }
.stat-card-hero .stat-sub   { color: rgba(255,255,255,0.5); }

/* ── Quick Filters ─────────────────────────────────────────── */
.quick-filters {
  display: flex; gap: var(--s2); flex-wrap: wrap;
}
.quick-filter-btn {
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
}
.quick-filter-btn:hover { border-color: var(--orange); color: var(--orange-dark); background: var(--orange-light); }
.quick-filter-btn.active { background: var(--orange); border-color: var(--orange); color: white; box-shadow: var(--sh-orange); }

/* ── Admin List Card (branches, staff) ─────────────────────── */
.admin-list { display: flex; flex-direction: column; gap: 1px; }

.admin-list-card {
  display: flex; align-items: center; gap: var(--s4);
  padding: var(--s4) var(--s5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.admin-list-card:last-child { border-bottom: none; }
.admin-list-card:hover { background: var(--surface-2); }

.list-card-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-lg);
  background: var(--orange-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  border: 1px solid rgba(251,140,0,0.2);
}
.list-card-icon.blue  { background: var(--info-bg); border-color: rgba(37,99,235,0.15); }
.list-card-icon.green { background: var(--success-bg); border-color: rgba(22,163,74,0.15); }

.list-card-info { flex: 1; min-width: 0; }
.list-card-title { font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card-sub   { font-size: 12px; color: var(--text-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list-card-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.list-card-actions { display: flex; gap: var(--s2); flex-shrink: 0; }

/* ── Product Admin Cards ───────────────────────────────────── */
.product-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s4);
  padding: var(--s5);
}

.product-admin-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
  box-shadow: var(--sh-xs);
  display: flex; flex-direction: column;
}
.product-admin-card:hover {
  border-color: var(--orange);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

.product-admin-img {
  width: 100%; aspect-ratio: 1/1;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.product-admin-img img { width: 100%; height: 100%; object-fit: cover; }
.product-admin-placeholder { font-size: 40px; }

.product-admin-body {
  padding: var(--s3) var(--s4);
  flex: 1;
}
.product-admin-name { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.3; margin-bottom: 5px; }

.product-admin-footer {
  padding: var(--s2) var(--s3) var(--s3);
  display: flex; gap: var(--s2);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ── Inventory Cards ───────────────────────────────────────── */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s4);
}
.inv-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1.5px solid var(--border);
  padding: var(--s4);
  box-shadow: var(--sh-xs);
  transition: var(--t);
}
.inv-card:hover { box-shadow: var(--sh); transform: translateY(-1px); }
.inv-name   { font-size: 14px; font-weight: 700; }
.inv-unit   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.inv-stock  { font-size: 24px; font-weight: 900; margin: var(--s2) 0 var(--s1); letter-spacing: -0.02em; }
.inv-stock.low  { color: var(--danger); }
.inv-stock.good { color: var(--success); }
.inv-stock-bar { height: 4px; border-radius: var(--r-full); background: var(--border); overflow: hidden; margin-bottom: var(--s2); }
.inv-stock-fill { height: 100%; border-radius: var(--r-full); background: var(--success); transition: width 0.4s ease; }
.inv-stock-fill.low { background: var(--danger); }

/* ── Pagination ────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--s1); margin-top: var(--s4); }
.page-btn {
  width: 34px; height: 34px;
  border-radius: var(--r-sm); border: 1.5px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--t);
  display: flex; align-items: center; justify-content: center; color: var(--text-sub);
}
.page-btn.active { background: var(--orange); border-color: var(--orange); color: white; }
.page-btn:hover:not(.active) { background: var(--bg-alt); }

/* ── Inner Tabs ────────────────────────────────────────────── */
.inner-tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--s5);
  overflow-x: auto;
}
.inner-tabs::-webkit-scrollbar { display: none; }
.inner-tab {
  padding: 10px var(--s4);
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  transition: var(--t);
  white-space: nowrap;
  flex-shrink: 0;
}
.inner-tab:hover { color: var(--text-sub); }
.inner-tab.active { color: var(--orange); border-bottom-color: var(--orange); }

/* ── Report Stats ──────────────────────────────────────────── */
.report-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.report-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  text-align: center;
  box-shadow: var(--sh-xs);
}
.report-stat-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--s2); }
.report-stat-value { font-size: 22px; font-weight: 900; color: var(--orange-dark); letter-spacing: -0.02em; }

/* ── Top Products ──────────────────────────────────────────── */
.top-products-section { margin-bottom: var(--s5); }
.top-products-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: var(--s3); }
.top-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.top-product-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}
.top-product-podium { border-left-width: 4px; }
.top-product-rank { font-size: 22px; font-weight: 900; color: var(--text-muted); min-width: 28px; text-align: center; line-height: 1; }
.top-product-info { flex: 1; min-width: 0; }
.top-product-name { font-weight: 700; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.top-product-meta { display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); }
.prod-rank-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; border: 1px solid; }

/* ── Sidebar Overlay ───────────────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150; backdrop-filter: blur(2px);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0D1117 0%, #1E293B 50%, #0D1117 100%);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s4);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(229,57,53,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(251,140,0,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.login-card {
  background: var(--surface);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-xl);
  width: 100%; max-width: 420px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative; z-index: 1;
}

.login-brand {
  background: linear-gradient(135deg, var(--red), var(--orange));
  padding: var(--s8) var(--s6);
  text-align: center; color: white;
  position: relative; overflow: hidden;
}
.login-brand::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='30' fill='white' fill-opacity='0.04'/%3E%3C/svg%3E") repeat;
}
.login-brand-logo {
  width: 80px; height: 80px;
  border-radius: var(--r-xl);
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--s4);
  font-size: 40px;
  border: 2px solid rgba(255,255,255,0.3);
  overflow: hidden;
  position: relative; z-index: 1;
}
.login-brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-brand-name    { font-size: 22px; font-weight: 900; line-height: 1.2; position: relative; z-index: 1; }
.login-brand-tagline { font-size: 12px; opacity: 0.8; margin-top: var(--s1); position: relative; z-index: 1; }

.login-form-wrap { padding: var(--s6); }
.login-form-title { font-size: 18px; font-weight: 800; margin-bottom: var(--s5); color: var(--text); }
.login-form .form-group { margin-bottom: var(--s4); }

.login-error {
  background: var(--danger-bg);
  border: 1px solid rgba(220,38,38,0.25);
  border-radius: var(--r);
  padding: var(--s3) var(--s4);
  font-size: 13px; color: var(--danger);
  margin-bottom: var(--s4); display: none;
  font-weight: 500;
}
.login-error.show { display: block; }

/* ============================================================
   POS PAGE
   ============================================================ */
.pos-page {
  display: flex; flex-direction: column;
  height: 100vh; /* fallback */
  height: 100dvh; /* actual visible viewport — handles Android nav bar & iOS safari */
  overflow: hidden;
  background: var(--bg);
}

/* Header */
.pos-header {
  background: var(--danger);
  color: #fff;
  border-bottom: none;
  padding: 0 var(--s5);
  height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(220,38,38,0.25);
  z-index: 100;
}
.pos-header .pos-brand-name { color: #fff; font-size: 15px; }
.pos-header .pos-branch-name { color: rgba(255,255,255,0.85); font-weight:600; }
.pos-header .pos-header-right .btn { color: rgba(255,255,255,0.95); border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.12); }
.pos-header .pos-header-right .btn:hover { background: rgba(255,255,255,0.22); }
.pos-header .pos-brand-dot { background: rgba(255,255,255,0.12); }
.pos-brand { display: flex; align-items: center; gap: var(--s3); }
.pos-brand-dot {
  width: 36px; height: 36px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--red), var(--orange));
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: white; flex-shrink: 0;
  overflow: hidden;
}
.pos-brand-dot img { width: 100%; height: 100%; object-fit: cover; }
.pos-brand-name   { font-size: 14px; font-weight: 800; line-height: 1.2; color: var(--text); }
.pos-branch-name  { font-size: 11px; color: var(--text-muted); }
.pos-header-right { display: flex; align-items: center; gap: var(--s2); }
.pos-staff-name   { font-size: 13px; font-weight: 600; color: #ffffff; }

/* Body wrapper */
.pos-content-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Kasir body */
.pos-body { display: grid; grid-template-columns: 1fr 340px; flex: 1; overflow: hidden; min-height: 0; height: 100%; }

/* Products Panel */
.pos-products { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; background: var(--bg); }

.pos-products-toolbar {
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--s3);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  min-height: 52px;
}

.pos-category-bar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; flex: 1; }
.pos-category-bar::-webkit-scrollbar { display: none; }
.cat-btn {
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  cursor: pointer; transition: var(--t);
  white-space: nowrap; flex-shrink: 0;
  letter-spacing: 0.1px;
}
.cat-btn:hover { background: var(--bg-alt); color: var(--text); }
.cat-btn.active {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  box-shadow: 0 4px 12px rgba(220,38,38,0.25);
}

/* ── Product Grid ──────────────────────────────────────────── */
.pos-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  align-content: start;
}

/* ── Product Card (pcard) ──────────────────────────────────── */
.pcard {
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid #e5e7eb;
  /* NO overflow:hidden — prevents body from being clipped by parent overflow */
  cursor: pointer;
  display: block;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pcard:hover {
  border-color: #f97316;
  box-shadow: 0 6px 20px rgba(0,0,0,.13);
  transform: translateY(-3px);
}
.pcard:active { transform: scale(0.97); }
.pcard.out-of-stock { opacity: .5; cursor: not-allowed; }
.pcard.out-of-stock:hover { transform: none; border-color: #e5e7eb; box-shadow: 0 1px 4px rgba(0,0,0,.07); }

/* Image — aspect-ratio on block element, border-radius only on image wrapper */
.pcard-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f3f4f6;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  position: relative;
}
.pcard-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.pcard:hover .pcard-img img { transform: scale(1.05); }
.pcard-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 28px;
}

/* Body — plain block, renders at natural height, never clipped */
.pcard-body {
  padding: 8px 10px 10px;
  background: #fff;
  border-radius: 0 0 10px 10px;
}
.pcard-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: #111827;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  margin: 0 0 3px;
}
.pcard-meta {
  font-size: 10px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.pcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.pcard-price {
  font-size: 12px;
  font-weight: 800;
  color: #dc2626;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.pcard-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: background .15s ease, transform .15s ease;
}
.pcard:hover .pcard-btn { background: #dc2626; transform: scale(1.1); }

/* Cart Panel */
.pos-cart {
  width: 340px; flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: -2px 0 12px rgba(0,0,0,0.04);
}

.pos-cart-header {
  padding: var(--s3) var(--s4);
  display: flex; align-items: center; gap: var(--s2);
  background: var(--surface); flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}
.mobile-back-btn { display: none; }
.pos-fab-cart { display: none !important; }
.pos-cart-title { font-size: 15px; font-weight: 800; color: var(--text); flex: 1; letter-spacing: -0.01em; }
.pos-cart-count {
  font-size: 11px;
  background: var(--danger);
  color: white;
  border-radius: var(--r-full);
  padding: 2px 8px;
  font-weight: 800;
  min-width: 22px; text-align: center;
}

.pos-cart-items { flex: 1; overflow-y: auto; min-height: 0; }
.pos-cart-items::-webkit-scrollbar { width: 3px; }
.pos-cart-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Cart Item */
.cart-item {
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.cart-item:hover { background: var(--surface-2); }
.cart-item:last-child { border-bottom: none; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name    { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cart-item-variant { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.cart-item-price   { font-size: 11px; color: var(--danger); font-weight: 600; margin-top: 2px; }
.cart-price-btn {
  display: inline-flex; align-items: center; gap: 2px;
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 11px; color: var(--danger); font-weight: 600;
  border-bottom: 1px dashed rgba(220,38,38,.35);
  line-height: 1.3;
}
.cart-price-btn:hover { color: var(--orange); border-color: var(--orange); }

.cart-item-qty {
  display: flex; align-items: center; gap: var(--s1);
  flex-shrink: 0; margin-top: 2px;
}
.qty-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 16px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--t); color: var(--text-sub);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.qty-btn:hover { background: var(--bg-alt); border-color: var(--border-strong); color: var(--text); }
.qty-btn.minus:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.qty-btn.plus:hover  { border-color: var(--orange); color: var(--orange); background: var(--orange-light); }
.qty-value { font-size: 14px; font-weight: 800; min-width: 24px; text-align: center; color: var(--text); }

.qty-input { width: 38px; text-align: center; border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 3px; font-size: 13px; font-weight: 700; color: var(--text); }
.qty-input:focus { border-color: var(--orange); }

.cart-item-sub {
  font-size: 13px; font-weight: 800; color: var(--text);
  min-width: 70px; text-align: right; flex-shrink: 0;
  margin-top: 2px;
}
.cart-item-delete {
  width: 26px; height: 26px;
  border-radius: var(--r-sm); border: none;
  background: transparent; color: var(--text-muted);
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--t); flex-shrink: 0; margin-top: 2px;
}
.cart-item-delete:hover { background: var(--danger-bg); color: var(--danger); }

/* Cart Empty */
.pos-cart-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--s3); color: var(--text-muted); padding: var(--s8);
}
.pos-cart-empty .empty-icon { font-size: 44px; }
.pos-cart-empty .empty-text { font-size: 13px; text-align: center; line-height: 1.5; }

/* Cart Footer */
.pos-cart-footer {
  border-top: 1.5px solid var(--border);
  padding: var(--s4) var(--s4) var(--s5);
  background: var(--surface); flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 20;
}
.cart-summary { margin-bottom: var(--s3); }
.cart-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-sub); padding: 3px 0;
}
.cart-discount-row {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--danger); padding: 2px 0;
}
.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s3) 0 0;
  margin-top: var(--s2);
  border-top: 2px dashed var(--border);
}
.cart-total-label { font-size: 12px; font-weight: 700; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.6px; }
.cart-total-value { font-size: 22px; font-weight: 900; color: var(--danger); letter-spacing: -0.02em; }

.btn-checkout {
  width: 100%; padding: var(--s4) var(--s5);
  min-height: 52px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #ffffff;
  font-size: 15px; font-weight: 900;
  border: none; cursor: pointer;
  transition: background var(--t-med), transform var(--t-med), box-shadow var(--t-med);
  box-shadow: 0 4px 16px rgba(220,38,38,0.35);
  margin-top: var(--s3);
  letter-spacing: 0.2px;
  display: flex; align-items: center; justify-content: center; gap: var(--s2);
}
.btn-checkout:hover { background: linear-gradient(135deg, #b91c1c, #991b1b); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(220,38,38,0.45); }
.btn-checkout:active { transform: scale(0.98); }
.btn-checkout:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Mobile Bottom Tabs */
.pos-mobile-tabs { display: none; background: var(--surface); border-top: 1.5px solid var(--border); flex-shrink: 0; }
.pos-tab-btn {
  flex: 1; padding: 10px var(--s3);
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--text-muted); cursor: pointer;
  transition: var(--t); border: none; background: none;
  position: relative; letter-spacing: 0.3px;
  -webkit-tap-highlight-color: transparent;
}
.pos-tab-btn.active { color: var(--danger); }
.pos-tab-btn .tab-icon { font-size: 20px; display: block; margin-bottom: 2px; }
.pos-tab-badge {
  position: absolute; top: 6px;
  right: calc(50% - 20px);
  background: var(--red); color: white;
  font-size: 9px; font-weight: 900;
  border-radius: var(--r-full);
  min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
}

/* Payment Modal */
.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: var(--s4);
}
@media (max-width: 480px) {
  .payment-methods {
    grid-template-columns: repeat(2, 1fr);
  }
}
.payment-method-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
}
.payment-method-btn:hover {
  border-color: rgba(251,140,0,0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.payment-method-btn.active {
  border-color: var(--orange);
  background: var(--orange-light);
  color: var(--orange-dark);
  box-shadow: 0 4px 16px rgba(251,140,0,0.15);
  transform: translateY(-2px);
}
.payment-method-btn .pm-icon {
  margin-bottom: 2px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.payment-method-btn.active .pm-icon {
  color: var(--orange);
}

.payment-summary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  margin-bottom: var(--s4);
}
.payment-summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: var(--text-sub); }
.payment-summary-divider { border-top: 1px dashed var(--border); margin: var(--s3) 0; }
.payment-summary-total {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px;
  font-size: clamp(18px, 5vw, 26px); font-weight: 900; color: var(--red);
  padding-top: var(--s2); margin-top: var(--s2);
  border-top: 2px solid var(--border);
  letter-spacing: -0.02em;
}
.payment-summary-total span:first-child { font-size: 14px; font-weight: 700; color: var(--text-sub); align-self: flex-end; padding-bottom: 2px; }

.change-display {
  background: var(--success-bg);
  border: 1px solid rgba(22,163,74,0.2);
  border-radius: var(--r-lg);
  padding: var(--s3) var(--s4);
  display: flex; justify-content: space-between; align-items: center;
  margin-top: var(--s3);
}
.change-label { font-size: 13px; font-weight: 700; color: var(--success); }
.change-value { font-size: 22px; font-weight: 900; color: var(--success); letter-spacing: -0.02em; }

.discount-section {
  background: var(--warning-bg);
  border: 1px solid rgba(217,119,6,0.2);
  border-radius: var(--r-lg);
  padding: var(--s3) var(--s4);
  margin-bottom: var(--s3);
}

/* Quick cash amounts */
.quick-amounts { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }
.quick-amount-btn {
  padding: 6px 12px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12px; font-weight: 700;
  cursor: pointer; transition: var(--t);
  color: var(--text-sub);
}
.quick-amount-btn:hover { background: var(--orange-light); border-color: var(--orange); color: var(--orange-dark); }

/* Held badge */
.held-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--red); color: white;
  border-radius: var(--r-full);
  width: 18px; height: 18px;
  font-size: 10px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

/* Shift badge */
.shift-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 700; cursor: pointer;
  transition: var(--t);
}
.badge-green-fill { background: var(--success-bg); color: var(--success); border: 1.5px solid rgba(22,163,74,0.25); }
.badge-green-fill:hover { background: #bbf7d0; }

/* ── Modern Shift Closing (POS Professional) ───────────────── */
.shift-summary-modern {
  display: flex; flex-direction: column; gap: var(--s4);
}

.shift-stat-group {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3);
}

.shift-stat-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s3) var(--s4);
  text-align: center;
}
.shift-stat-item.highlight {
  background: var(--bg-alt);
  border-color: var(--border-strong);
}

.shift-stat-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.shift-stat-val {
  font-size: 18px; font-weight: 900; color: var(--text); letter-spacing: -0.01em;
}

.shift-detail-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s2) var(--s4);
  display: flex; flex-direction: column;
}

.shift-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s2) 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px; color: var(--text-sub); font-weight: 600;
}
.shift-detail-row:last-child { border-bottom: none; }
.shift-detail-row span { display: flex; align-items: center; }

.shift-expected-box {
  background: linear-gradient(135deg, var(--blue-dark, #1e3a8a), var(--blue, #3b82f6));
  border-radius: var(--r-lg);
  padding: var(--s4);
  color: white;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 4px 15px rgba(59,130,246,0.3);
}
.shift-expected-label { font-size: 13px; font-weight: 700; opacity: 0.9; }
.shift-expected-val { font-size: 24px; font-weight: 900; letter-spacing: -0.02em; }

.shift-actual-input {
  margin-top: var(--s2);
}

.shift-selisih-box {
  margin-top: var(--s2);
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-lg);
  animation: fadeIn 0.3s ease;
}
.shift-selisih-icon { font-size: 24px; flex-shrink: 0; }
.shift-selisih-info { flex: 1; display: flex; flex-direction: column; }
.shift-selisih-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.8; }
.shift-selisih-val { font-size: 18px; font-weight: 900; }

.selisih-ok { background: var(--success-bg); color: var(--success); border: 1px solid rgba(22,163,74,0.3); }
.selisih-lebih { background: var(--success-bg); color: var(--success); border: 1px solid rgba(22,163,74,0.3); }
.selisih-kurang { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(220,38,38,0.3); }


/* ============================================================
   RECEIPT
   ============================================================ */
/* ── Receipt (58mm thermal) ─────────────────────────────── */
.receipt-wrap {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px; line-height: 1.55;
  width: 58mm; margin: 0 auto;
  color: #000; background: #fff;
  padding: 4px 0;
}
.receipt-header    { text-align: center; margin-bottom: 10px; }
.receipt-shop-name { font-size: 14px; font-weight: bold; display: block; }
.receipt-address   { font-size: 11px; color: #222; display: block; }
.receipt-divider   { border: none; border-top: 1px dashed #444; margin: 7px 0; }
.receipt-item-row  { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; font-size: 12px; }
.receipt-item-name { flex: 1; padding-right: 6px; word-break: break-word; }
.receipt-item-qty  { color: #444; font-size: 11px; }
.receipt-item-price{ white-space: nowrap; text-align: right; }
.receipt-total-row { display: flex; justify-content: space-between; font-weight: bold; font-size: 13px; margin-top: 5px; border-top: 1px solid #000; padding-top: 4px; }
.receipt-footer    { text-align: center; font-size: 11px; color: #333; margin-top: 10px; }

@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body > *:not(#modal-receipt) { display: none !important; }
  #modal-receipt { position: static !important; background: none !important;
    padding: 0 !important; display: block !important; opacity: 1 !important; visibility: visible !important; }
  #modal-receipt .modal { box-shadow: none !important; width: 58mm !important; max-width: 58mm !important;
    margin: 0 !important; border-radius: 0 !important; transform: none !important;
    border: none !important; padding: 0 !important; }
  #modal-receipt .modal-header,
  #modal-receipt .modal-footer { display: none !important; }
  #modal-receipt .modal-body { padding: 0 !important; }
  .receipt-wrap { font-size: 12px !important; width: 58mm !important; margin: 0 !important; color: #000 !important; }
}

/* ============================================================
   ADMIN PAGE
   ============================================================ */
.admin-page { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ──────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: width var(--t-slow);
  z-index: 200;
  position: relative;
}

/* Sidebar Brand */
.sidebar-brand {
  padding: var(--s4) var(--s4);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: var(--s3);
  min-height: 64px; flex-shrink: 0;
}
.sidebar-brand-img {
  width: 34px; height: 34px;
  border-radius: var(--r-lg);
  object-fit: cover; flex-shrink: 0;
}
.sidebar-brand-text { overflow: hidden; flex: 1; min-width: 0; }
.sidebar-brand-name  { font-size: 13px; font-weight: 900; color: white; line-height: 1.2; white-space: nowrap; }
.sidebar-brand-sub   { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 1px; white-space: nowrap; }

/* Sidebar Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--s3) 0; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.sidebar-section-label {
  padding: var(--s4) var(--s4) var(--s1);
  font-size: 9px; font-weight: 800;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  overflow: hidden; white-space: nowrap;
}

.nav-item {
  display: flex; align-items: center; gap: var(--s3);
  padding: 10px var(--s4);
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.55);
  cursor: pointer; transition: all var(--t);
  border: none; background: none; width: 100%;
  text-align: left; border-left: 3px solid transparent;
  white-space: nowrap; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
  border-left-color: rgba(255,255,255,0.15);
}
.nav-item.active {
  background: rgba(251,140,0,0.14);
  color: #FFA726;
  border-left-color: var(--orange);
  font-weight: 700;
}
.nav-item svg, .nav-item .nav-icon-svg { flex-shrink: 0; width: 18px; height: 18px; }
.nav-text { overflow: hidden; }
.nav-item .nav-icon { font-size: 17px; flex-shrink: 0; width: 22px; text-align: center; }

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--s3) var(--s4);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: var(--s3);
  flex-shrink: 0;
}
.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--red), var(--orange));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: white; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; overflow: hidden; }
.sidebar-user-name { font-size: 13px; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: rgba(255,255,255,0.35); }

/* Sidebar Collapse */
.sidebar-collapse-btn {
  position: absolute; bottom: 80px; right: -14px;
  width: 28px; height: 28px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
  box-shadow: var(--sh-sm);
  transition: var(--t); z-index: 10;
  font-size: 13px;
}
.sidebar-collapse-btn:hover { color: var(--orange); border-color: var(--orange); background: var(--orange-light); }

/* Collapsed sidebar */
.admin-sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.admin-sidebar.collapsed .sidebar-brand-text,
.admin-sidebar.collapsed .nav-text,
.admin-sidebar.collapsed .sidebar-section-label,
.admin-sidebar.collapsed .sidebar-user-info,
.admin-sidebar.collapsed .sidebar-brand-name,
.admin-sidebar.collapsed .sidebar-brand-sub {
  opacity: 0; width: 0; overflow: hidden;
}
.admin-sidebar.collapsed .sidebar-brand { padding: var(--s4) var(--s3); justify-content: center; }
.admin-sidebar.collapsed .nav-item { padding: 10px; justify-content: center; gap: 0; }
.admin-sidebar.collapsed .sidebar-footer { padding: var(--s3); justify-content: center; }
.admin-sidebar.collapsed .sidebar-footer .btn { display: none; }
.admin-sidebar.collapsed .sidebar-collapse-btn { right: -14px; }

/* ── Topbar ────────────────────────────────────────────────── */
.admin-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--s6);
  height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  flex-shrink: 0;
  box-shadow: var(--sh-xs);
  z-index: 100;
}
.admin-topbar-left { display: flex; align-items: center; gap: var(--s3); }
.admin-topbar-title { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.admin-topbar-right { display: flex; align-items: center; gap: var(--s2); }
.topbar-date { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.hamburger-btn {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--t); font-size: 18px;
}
.hamburger-btn:hover { background: var(--bg); }

/* ── Main Content ──────────────────────────────────────────── */
.admin-main { flex: 1; overflow-y: auto; padding: var(--s6); }
.admin-main::-webkit-scrollbar { width: 5px; }
.admin-main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Sections */
.admin-section { display: none; }
.admin-section.active { display: block; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap;
}
.section-title { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; color: var(--text); }
.section-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s4);
  margin-bottom: var(--s6);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--s4);
}

/* Low stock alert row */
.alert-row { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }
.alert-row:last-child { border-bottom: none; }

/* Section filters bar */
.filters-bar {
  display: flex; align-items: flex-end;
  gap: var(--s3); flex-wrap: wrap;
  margin-bottom: var(--s4);
  padding: var(--s4);
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile sidebar */
@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed; left: -100%; top: 0; bottom: 0;
    z-index: 200; transition: left 0.28s ease;
    width: var(--sidebar-w) !important;
  }
  .admin-sidebar.open { left: 0; }
  .admin-sidebar.collapsed { width: var(--sidebar-w) !important; }
  .admin-sidebar.collapsed .sidebar-brand-text,
  .admin-sidebar.collapsed .nav-text,
  .admin-sidebar.collapsed .sidebar-section-label,
  .admin-sidebar.collapsed .sidebar-user-info { opacity: 1; width: auto; overflow: visible; }
  .admin-sidebar.collapsed .sidebar-brand { padding: var(--s4) var(--s4); justify-content: flex-start; }
  .admin-sidebar.collapsed .nav-item { padding: 10px var(--s4); justify-content: flex-start; gap: var(--s3); }
  .admin-sidebar.collapsed .sidebar-footer { padding: var(--s3) var(--s4); justify-content: flex-start; }
  .admin-sidebar.collapsed .sidebar-footer .btn { display: inline-flex; }
  .sidebar-collapse-btn { display: none; }
  .sidebar-overlay.show { display: block; }
  .hamburger-btn { display: flex; }
  .admin-topbar { padding: 0 var(--s4); }
  .admin-main { padding: var(--s4); }
}

/* Small tablet */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .product-admin-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .section-header { flex-direction: column; align-items: flex-start; }
  .section-actions { width: 100%; }
}

/* ── POS Tab Bar (desktop only — hidden on mobile/tablet via media query) ──── */
.pos-tab-bar {
  display: flex;
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  min-height: 44px;
}
.pos-tab-bar::-webkit-scrollbar { display: none; }

.pos-tab-item {
  padding: var(--s3) var(--s5);
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  background: transparent; border: none;
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  transition: var(--t);
  display: inline-flex; align-items: center; gap: var(--s2);
  white-space: nowrap; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.pos-tab-item:hover { color: var(--text-sub); background: var(--bg-alt); }
.pos-tab-item.active { color: var(--orange); border-bottom-color: var(--orange); }

/* Alt panels — canonical rule. Duplicate at bottom of file is removed. */
.pos-alt-panel { display: none; overflow-y: auto; padding: var(--s4); background: var(--bg); }
.pos-alt-panel.active { display: block; flex: 1; min-height: 0; }

/* Mobile tabs hidden on desktop */
.pos-mobile-tabs { display: none; }

/* ── POS Summary / Stock panels ─────────────────────────────── */
.pos-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s4);
  margin-bottom: var(--s4);
}

.pos-stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1.5px solid var(--border);
  padding: var(--s4);
  box-shadow: var(--sh-xs);
}
.pos-stat-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: var(--s2);
}
.pos-stat-value {
  font-size: 22px; font-weight: 900;
  color: var(--text); letter-spacing: -0.02em;
}
.pos-stat-card-hero {
  background: linear-gradient(135deg, var(--orange-dark), var(--orange));
  border-color: rgba(251,140,0,0.3);
  box-shadow: var(--sh-orange);
}

.pos-inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--s3);
  padding: var(--s4);
  align-content: start;
  overflow-y: auto;
  flex: 1;
}
/* When showing table view, the div with style grid-column:1/-1 spans full width */
.pos-inv-grid .table-wrap { width: 100%; }

.pos-inv-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1.5px solid var(--border);
  padding: var(--s4);
  box-shadow: var(--sh-xs);
  transition: var(--t);
}
.pos-inv-card:hover { box-shadow: var(--sh); transform: translateY(-1px); }
.pos-inv-name { font-size: 13px; font-weight: 700; color: var(--text); }
.pos-inv-stock {
  font-size: 22px; font-weight: 900;
  margin: var(--s2) 0 var(--s1);
  letter-spacing: -0.02em;
}
.pos-inv-stock.low  { color: var(--danger); }
.pos-inv-stock.good { color: var(--success); }
.pos-inv-unit { font-size: 11px; color: var(--text-muted); }

/* ── Variant Select Modal ───────────────────────────────────────── */
.variant-product-preview {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3);
  background: var(--surface-2);
  border-radius: var(--r-lg); border: 1px solid var(--border);
  margin-bottom: var(--s4);
}
.variant-product-img {
  width: 52px; height: 52px;
  border-radius: var(--r);
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.variant-product-img img { width: 100%; height: 100%; object-fit: cover; }
.variant-product-title { font-size: 14px; font-weight: 700; color: var(--text); }
.variant-product-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.variant-select-grid { display: flex; flex-direction: column; gap: var(--s2); }
.variant-select-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-lg);
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer; transition: var(--t);
  font-size: 14px; color: var(--text); width: 100%;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}
.variant-select-btn:hover {
  border-color: var(--orange);
  background: var(--orange-light);
}
.variant-select-btn:active { transform: scale(0.98); }
.variant-select-name { font-weight: 700; }
.variant-select-price { font-size: 15px; font-weight: 800; color: var(--orange-dark); }

/* ── Product modal: responsive grid ──────────────────────── */
@media (max-width: 700px) {
  #modal-product .modal-body > div[style*="grid"] { grid-template-columns: 1fr !important; }
}

/* ── Tablet: hide desktop tab bar, show hamburger ──────────── */
@media (max-width: 900px) {
  .pos-tab-bar { display: none; }
  .pos-mobile-menu-btn { display: flex !important; }
  .pos-products-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ── Small tablet (769–900px): compact cart sidebar ─────────── */
@media (min-width: 769px) and (max-width: 900px) {
  .pos-body { grid-template-columns: 1fr 290px; }
  .pos-cart { width: 290px; }
  .pos-cart-footer { padding: var(--s3) var(--s3) var(--s4); }
  .btn-checkout { min-height: 46px; font-size: 13px; }
  .cart-total-value { font-size: 18px; }
  /* Alt panels: allow scroll without fixed height constraint */
  .pos-alt-panel { min-height: 0; }
  /* Panel header wrapping on narrow tablet */
  .panel-header { flex-wrap: wrap; gap: 8px; }
}

/* Mobile */
@media (max-width: 768px) {
  /* POS mobile layout — revert grid to stacked flex */
  .pos-body { display: flex; flex-direction: column; overflow: hidden; }
  .pos-cart {
    width: 100%; border-left: none; border-top: none; box-shadow: none;
    display: none; flex: 1;
  }
  .pos-cart.mobile-show { display: flex; }
  .pos-products.mobile-hide { display: none; }
  .mobile-back-btn { display: flex; align-items: center; padding: 0; margin-right: var(--s2); }

  /* Floating cart button — bottom bar style, shown when .show added by JS */
  .pos-fab-cart.show {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 64px; border-radius: 0;
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: white;
    display: flex !important; align-items: center; justify-content: space-between;
    padding: 0 var(--s5);
    box-shadow: 0 -4px 16px rgba(220,38,38,0.3); z-index: 99;
    border: none; cursor: pointer;
    transition: transform var(--t);
  }
  .pos-fab-cart:active { transform: scale(0.99); }
  .pos-fab-cart .fab-info {
    display: flex; flex-direction: column; align-items: flex-start;
  }
  .pos-fab-cart .fab-title {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; opacity: 0.85; line-height: 1.2;
  }
  .pos-fab-cart .fab-total {
    font-size: 18px; font-weight: 900; line-height: 1.2; letter-spacing: -0.02em;
  }
  .pos-fab-cart .fab-action {
    display: flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: 13px;
    background: rgba(255,255,255,0.18);
    padding: var(--s2) var(--s4);
    border-radius: var(--r-full);
  }
  .pos-fab-cart .fab-badge {
    background: white; color: var(--danger);
    font-size: 11px; font-weight: 900;
    padding: 2px 7px; border-radius: 12px;
  }

  .pos-mobile-tabs { display: flex; overflow-x: auto; }
  .pos-mobile-tabs::-webkit-scrollbar { display: none; }
  .pos-tab-btn { flex: 1; min-width: 56px; font-size: 10px; padding: 6px var(--s1); }
  .pos-tab-btn .tab-icon { font-size: 16px; }

  .pos-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    padding-bottom: 80px;
  }
  .pos-cart { max-height: calc(100dvh - 56px); max-height: calc(100svh - 56px); }

  .pcard-body { padding: 6px 8px 8px; }
  .pcard-name { font-size: 11px; }
  .pcard-meta { display: none; margin-bottom: 4px; }
  .pcard-price { font-size: 10px; }
  .pcard-btn { width: 22px; height: 22px; font-size: 14px; }

  /* Toolbar: stack search bar above category pills */
  .pos-products-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s2);
    padding: var(--s2) var(--s3);
    min-height: unset;
  }
  .search-wrap.search-compact { max-width: 100%; }
  .pos-category-bar { flex-wrap: nowrap; }

  /* Cart header on mobile — remove min-height enforcement */
  .pos-cart-header { min-height: 48px; padding: var(--s2) var(--s3); }

  /* Cart item on mobile: wrap cleanly */
  .cart-item { flex-wrap: wrap; align-items: center; gap: var(--s1); padding: var(--s3); }
  .cart-item-info { width: 100%; margin-bottom: 0; }
  .cart-item-qty { margin-top: 0; }
  .cart-item-sub { flex: 1; text-align: right; margin-top: 0; font-size: 13px; }
  .cart-item-delete { margin-top: 0; }

  /* Qty buttons: keep touchable on mobile */
  .qty-btn { width: 40px; height: 40px; font-size: 18px; }

  /* Alt panels on mobile */
  .pos-alt-panel { min-height: calc(100dvh - 60px); padding: var(--s3); }
  .pos-content-area { min-height: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .admin-main { padding: var(--s3); }

  /* ── POS Header: compact on mobile ──────────────────── */
  .pos-header {
    display: flex;
    align-items: center;
    padding: 0 var(--s2) 0 0;
    gap: var(--s2);
    height: 48px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .pos-mobile-menu-btn { padding: var(--s2); margin-right: 0; flex-shrink: 0; }
  .pos-brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2); overflow: hidden; }
  .pos-brand-dot {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  .pos-brand > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
  .pos-brand-name {
    display: none !important;
  }
  .pos-branch-name {
    display: none !important;
  }
  .pos-staff-name  { display: none !important; }
  #header-staff-name { display: none !important; }
  .pos-header-right { gap: var(--s1); flex-shrink: 0; display: flex; align-items: center; }
  .pos-header-right .btn { padding: 6px var(--s2); min-width: 36px; min-height: 36px; }
  .pos-header-right .btn span { display: none; }
  .pos-header-right .btn-ghost { display: none; }

  /* Modals: slide from bottom on mobile */
  .modal-overlay { padding: var(--s2); align-items: flex-end; }
  .modal {
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 95vh;
    transform: translateY(30px);
  }
  .modal-overlay.active .modal { transform: translateY(0); }
  .modal-lg { max-width: 100%; }

  /* Prevent iOS Safari auto-zoom on input focus */
  .form-control,
  .pos-products-toolbar input,
  .search-input {
    font-size: 16px;
  }

  /* Mobile Toast: drop from top */
  #toast-container {
    left: var(--s4); right: var(--s4); top: var(--s2);
    align-items: center;
  }
  .toast {
    width: 100%; max-width: none;
    animation: toastInMobile 0.22s ease, toastOutMobile 0.22s ease 2.78s forwards;
  }

  /* Payment modal: reduce large total font on small screens */
  .payment-summary-total { font-size: 20px; }
}

@keyframes toastInMobile  { from { opacity:0; transform:translateY(-110%) scale(0.9); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes toastOutMobile { from { opacity:1; transform:translateY(0); } to { opacity:0; transform:translateY(-110%); } }

/* Mid-size phone / small tablet: 3 columns (500–768px) */
@media (min-width: 500px) and (max-width: 768px) {
  .pos-products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pcard-meta { display: block; }
}

/* Very small mobile (≤400px) */
@media (max-width: 400px) {
  .pos-products-grid { gap: 6px; padding: 6px; padding-bottom: 80px; }
  .pcard-name { font-size: 10px; }
  .pcard-price { font-size: 9px; }
  .pcard-btn { width: 20px; height: 20px; font-size: 13px; }
  .cat-btn, .pos-category-bar button { font-size: 11px; padding: 4px 10px; }
  .pos-products-toolbar { gap: var(--s1); padding: var(--s1) var(--s2); }
  .stats-grid { grid-template-columns: 1fr; }
  .product-admin-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Desktop (≥769px): grid layout, dark cart footer */
@media (min-width: 769px) {
  /* Cart footer — sticky, dark brand */
  .pos-cart-footer {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: #111827;
    border-top: none;
    /* safe-area-inset-bottom: agar tidak ketutup navigation bar Android/iOS */
    padding: var(--s4) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom, 0px));
  }
  .pos-cart-footer .cart-summary { border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: var(--s3); margin-bottom: var(--s3); }
  .pos-cart-footer .cart-summary-row,
  .pos-cart-footer .cart-total-label { color: rgba(255,255,255,0.7); }
  .pos-cart-footer .cart-total-value { color: #fff; }
  .pos-cart-footer .cart-discount-row { color: #fca5a5; }

  /* Checkout button */
  .btn-checkout { background: #dc2626; color: #fff; border: none; }
  .btn-checkout:hover { background: #b91c1c; }

  .pos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 14px;
  }
  .pos-cart { width: 340px; }
}

/* Wide Desktop (≥1280px) — maximize product grid, wider cart */
@media (min-width: 1280px) {
  .pos-body { grid-template-columns: 1fr 360px; }
  .pos-cart { width: 360px; }
  .pos-products-grid { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
  /* Cart footer action area gets extra breathing room */
  .pos-cart-footer { padding: var(--s4) var(--s5) var(--s6); }
  .btn-checkout { min-height: 56px; font-size: 16px; }
}

/* ── Mobile Drawer ─────────────────────────────────────────── */
.pos-mobile-menu-btn {
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text); border: none;
  padding: var(--s2); margin-right: var(--s2); cursor: pointer;
}
@media (min-width: 900px) { .pos-mobile-menu-btn { display: none; } }

.pos-mobile-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 280px; max-width: 80vw;
  background: var(--surface);
  box-shadow: var(--sh-xl);
  z-index: 2000;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex; flex-direction: column;
}
.pos-mobile-drawer.active { transform: translateX(0); }
.pos-mobile-drawer-header {
  padding: var(--s4);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.pos-mobile-drawer-menu {
  flex: 1; overflow-y: auto;
  padding: var(--s2);
  display: flex; flex-direction: column; gap: var(--s1);
}
.drawer-btn {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: transparent; border: none;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; color: var(--text-sub);
  cursor: pointer; text-align: left;
}
.drawer-btn:hover, .drawer-btn.active {
  background: var(--bg-alt); color: var(--text);
}
.drawer-btn.active {
  color: var(--orange-dark); background: var(--orange-light);
}

/* ── New Components v3 ─────────────────────────────────────── */

/* btn-warning */
.btn-warning {
  background: var(--warning);
  color: var(--white);
  border-color: var(--warning);
  box-shadow: 0 4px 14px rgba(217,119,6,0.25);
}
.btn-warning:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* Pending variant rows (inline create in product modal) */
.pending-variant-row {
  display: flex; align-items: center; gap: var(--s2);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: var(--s2);
  margin-bottom: var(--s2);
}
.pending-variant-row input { flex: 1; }

/* Cash log list rows in POS cash tab */
.cash-log-list { padding: var(--s2) var(--s3); max-height: 280px; overflow-y: auto; }
.cash-log-row {
  display: flex; align-items: center; gap: var(--s2);
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.cash-log-row:last-child { border-bottom: none; }

/* pos-stat-card inside POS cash tab */
.pos-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  box-shadow: var(--sh-xs);
}
.pos-stat-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--s1); }
.pos-stat-value { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.pos-stat-card-hero {
  background: linear-gradient(135deg, #1E3A5F 0%, #0F172A 100%);
  border: 1px solid rgba(255,255,255,0.06);
  grid-column: 1 / -1;
}
.pos-stat-card-hero .pos-stat-label { color: rgba(255,255,255,0.6); }
.pos-stat-card-hero .pos-stat-value { color: #fff; }

/* text-green for cash amounts */
.text-green { color: var(--success); }

/* Saved-variant-form: hide when product is new (pending mode) */
.new-product-mode #saved-variant-form { display: none; }
.new-product-mode #add-pending-variant-btn { display: flex; }

/* ── Stock Table Enhancements ───────────────────────────────── */
.stock-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stock-table th { background: var(--surface-2); }
.stock-table .row-even { background: var(--surface); }
.stock-table .row-odd  { background: var(--surface-2); }
.stock-table tr:hover td { background: rgba(249,115,22,0.04); }

.badge-terpakai {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--r-full);
  background: var(--warning-bg); color: var(--warning);
  border: 1px solid rgba(249,115,22,0.2);
  font-size: 11px; font-weight: 700;
}

/* ── Panel Transactions: active state ───────────────────────── */
/* NOTE: .pos-alt-panel canonical rule is near top of POS section — not duplicated here */

/* ── Cash Sub-tabs ──────────────────────────────────────────── */
.cash-subtab-bar {
  display: flex; gap: var(--s2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px;
}
.cash-subtab-btn {
  flex: 1; padding: 9px 14px;
  border-radius: var(--r);
  border: none; background: transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--t-med);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.cash-subtab-btn:hover { background: var(--surface); color: var(--text); }
.cash-subtab-btn.active-in  { background: var(--success); color: #fff; box-shadow: 0 2px 8px rgba(22,163,74,0.25); }
.cash-subtab-btn.active-out { background: var(--danger);  color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,0.25); }

/* ── Cash Stat Cards ────────────────────────────────────────── */
.cash-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s2);
}
@media (min-width: 640px) {
  .cash-stats-grid { grid-template-columns: repeat(3, 1fr); }
}
.cash-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s3) var(--s4);
  box-shadow: var(--sh-xs);
}
.cash-stat-label {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}
.cash-stat-value { font-size: 16px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.cash-stat-hero {
  background: linear-gradient(135deg, #1E3A5F 0%, #0F172A 100%);
  border-color: rgba(255,255,255,0.06); grid-column: 1/-1;
}
.cash-stat-hero .cash-stat-label { color: rgba(255,255,255,0.6); }
.cash-stat-hero .cash-stat-value { color: #fff; font-size: 22px; }
.cash-stat-expected {
  grid-column: 1/-1;
  border-color: var(--warning); background: var(--warning-bg);
}
.cash-stat-expected .cash-stat-label { color: var(--warning); }
.cash-stat-expected .cash-stat-value { color: var(--orange-dark); }

/* ── Cash Log Items ─────────────────────────────────────────── */
.cash-log-list { display: flex; flex-direction: column; }
.cash-log-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px var(--s4);
  border-bottom: 1px solid var(--border);
  gap: var(--s3);
  transition: background var(--t);
}
.cash-log-item:last-child { border-bottom: none; }
.cash-log-item:hover { background: var(--surface-2); }
.cash-log-item.cash-log-voided { opacity: 0.45; }
.cash-log-meta {
  display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0;
}
.cash-log-time { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.cash-log-right {
  display: flex; align-items: center; gap: var(--s2); flex-shrink: 0;
}


/* Hide logo on mobile screens */
@media (max-width: 768px) {
  .pos-brand-dot,
  .sidebar-brand-img {
    display: none !important;
  }
}


/* Transaction List Mobile First */
.trx-list { display: flex; flex-direction: column; }
.trx-item { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); transition: background 0.2s; cursor: pointer; }
.trx-item:last-child { border-bottom: none; }
.trx-item:hover { background: var(--surface-2); }
.trx-item-left { display: flex; flex-direction: column; gap: 4px; }
.trx-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.trx-item-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Success Popup (menggantikan success-overlay) ──────────── */
#modal-success-trx { background: rgba(0,0,0,.55); }
.success-popup {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: var(--s6) var(--s5) var(--s5);
  max-width: 360px;
  width: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s4);
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  animation: spop-in .28s cubic-bezier(.22,.68,0,1.2) both;
}
@keyframes spop-in {
  from { opacity:0; transform:scale(.88) translateY(12px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}

/* SVG checkmark */
.success-popup-check { width: 72px; height: 72px; }
.success-check-svg { width: 72px; height: 72px; }
.success-check-circle {
  stroke: var(--success); stroke-width: 2.5;
  stroke-dasharray: 166; stroke-dashoffset: 166;
  animation: stroke-circle .5s ease forwards;
}
.success-check-mark {
  stroke: var(--success); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 48; stroke-dashoffset: 48;
  animation: stroke-mark .35s ease .4s forwards;
}
@keyframes stroke-circle { to { stroke-dashoffset: 0; } }
@keyframes stroke-mark   { to { stroke-dashoffset: 0; } }

.success-popup-title {
  font-size: 20px; font-weight: 800; color: var(--text);
  letter-spacing: -0.02em;
}
.success-popup-meta {
  width: 100%; background: var(--surface-2);
  border-radius: var(--r); padding: var(--s3) var(--s4);
  display: flex; flex-direction: column; gap: 6px;
}
.spop-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-sub);
}
.spop-row strong { color: var(--text); font-weight: 700; }

.success-popup-btns {
  display: flex; gap: var(--s3); width: 100%;
  flex-wrap: wrap;
}
.success-popup-btns .btn { flex: 1; min-width: 120px; }

/* Keep old classes for any lingering references (no-op) */
.success-overlay, .success-checkmark, .check-icon, .icon-line, .icon-circle, .icon-fix { display: none !important; }
.success-checkmark { width: 80px; height: 80px; margin: 0 auto; }
.success-checkmark .check-icon { width: 80px; height: 80px; position: relative; border-radius: 50%; box-sizing: content-box; border: 4px solid var(--success); }
.success-checkmark .check-icon::before { top: 3px; left: -2px; width: 30px; transform-origin: 100% 50%; border-radius: 100px 0 0 100px; }
.success-checkmark .check-icon::after { top: 0; left: 30px; width: 60px; transform-origin: 0 50%; border-radius: 0 100px 100px 0; animation: rotate-circle 4.25s ease-in; }
.success-checkmark .check-icon::before, .success-checkmark .check-icon::after { content: ''; height: 100px; position: absolute; background: transparent; transform: rotate(-45deg); }
.success-checkmark .icon-line { height: 5px; background-color: var(--success); display: block; border-radius: 2px; position: absolute; z-index: 10; }
.success-checkmark .icon-line.line-tip { top: 46px; left: 14px; width: 25px; transform: rotate(45deg); animation: icon-line-tip 0.75s; }
.success-checkmark .icon-line.line-long { top: 38px; right: 8px; width: 47px; transform: rotate(-45deg); animation: icon-line-long 0.75s; }
.success-checkmark .icon-circle { top: -4px; left: -4px; z-index: 10; width: 80px; height: 80px; border-radius: 50%; position: absolute; box-sizing: content-box; border: 4px solid rgba(76,175,80,.2); }
.success-checkmark .icon-fix { top: 8px; width: 5px; left: 26px; z-index: 1; height: 85px; position: absolute; transform: rotate(-45deg); background-color: transparent; }
@keyframes icon-line-tip { 0% { width: 0; left: 1px; top: 19px; } 54% { width: 0; left: 1px; top: 19px; } 70% { width: 50px; left: -8px; top: 37px; } 84% { width: 17px; left: 21px; top: 48px; } 100% { width: 25px; left: 14px; top: 46px; } }
@keyframes icon-line-long { 0% { width: 0; right: 46px; top: 54px; } 65% { width: 0; right: 46px; top: 54px; } 84% { width: 55px; right: 0px; top: 35px; } 100% { width: 47px; right: 8px; top: 38px; } }

.pos-mobile-menu-btn { color: white !important; }
.pos-mobile-menu-btn i { stroke: white !important; }
