/* ============================================================
   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; }
.text-right   { text-align: right; }
.text-left    { text-align: left; }
.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; }

.deposit-amount-stepper {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--s2);
  align-items: center;
}
.deposit-amount-stepper .btn {
  min-width: 76px;
  white-space: nowrap;
}

/* Deposit blocker modal */
.deposit-blocker-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  padding: 2rem 1.5rem 1.75rem;
}
.deposit-blocker-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(234, 179, 8, 0.12);
  color: #ca8a04;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.deposit-blocker-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text, #1A1A2E);
}
.deposit-blocker-desc {
  margin: 0 0 1.5rem;
  color: var(--text-muted, #666);
  font-size: 0.9rem;
  line-height: 1.5;
}
.deposit-blocker-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
}
.deposit-blocker-actions .btn {
  width: 100%;
  justify-content: center;
}

/* Staff cash deposit page */
.deposit-page {
  background: #F8F9FA;
  color: #1A1A2E;
  overflow-x: hidden;
}

.pos-alt-panel.deposit-page.active {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.deposit-page-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  min-width: 0;
}

.deposit-page-header {
  align-items: center;
  gap: var(--s3);
}

.deposit-page-title {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
}

.deposit-page-title .h2 {
  margin: 0;
  color: #1A1A2E;
}

.deposit-back-btn {
  flex-shrink: 0;
}

.deposit-header-meta {
  margin-top: 2px;
  font-size: 12px;
  color: #5D6D7E;
  line-height: 1.4;
}

.deposit-cash-card {
  margin: 0 0 var(--s3);
  padding: var(--s5);
  border-radius: 8px;
  background: #C0392B;
  color: #fff;
  box-shadow: 0 4px 14px rgba(220,38,38,0.14);
  outline: none;
}

.deposit-cash-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(192,57,43,0.22), 0 4px 14px rgba(192,57,43,0.14);
}

.deposit-cash-card.no-cash {
  background: #8F2F27;
}

.deposit-cash-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s4);
}

.deposit-card-label {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.86;
}

.deposit-card-amount {
  margin-top: var(--s2);
  font-size: 34px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
}

.deposit-card-icon {
  width: 34px;
  height: 34px;
  opacity: 0.88;
  flex-shrink: 0;
}

.deposit-card-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s3);
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid rgba(255,255,255,0.22);
}

.deposit-card-meta-grid span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.72);
}

.deposit-card-meta-grid strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

/* No-session card: light warning style instead of orange gradient */
.deposit-cash-card.no-session {
  background: #FFF7ED;
  border: 1px solid rgba(249,115,22,0.28);
  box-shadow: 0 4px 14px rgba(249,115,22,0.10);
  color: #7C2D12;
}

.deposit-cash-card.no-session .deposit-card-label {
  color: #92400E;
  opacity: 1;
}

.deposit-cash-card.no-session .deposit-card-amount {
  color: #7C2D12;
  font-size: 22px;
}

.deposit-cash-card.no-session .deposit-card-meta-grid {
  border-top-color: rgba(249,115,22,0.20);
}

.deposit-cash-card.no-session .deposit-card-meta-grid span {
  color: rgba(124,45,18,0.72);
}

.deposit-cash-card.no-session .deposit-card-meta-grid strong {
  color: #7C2D12;
}

.deposit-cash-card.no-session .deposit-card-icon {
  color: #D97706;
  opacity: 0.9;
}

/* Blocking alert */
.deposit-blocking-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 8px;
  background: #FFEDD5;
  border: 1px solid rgba(249,115,22,0.35);
  color: #7C2D12;
}

.deposit-blocking-alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: #D97706;
}

.deposit-blocking-alert-icon svg {
  width: 20px;
  height: 20px;
}

.deposit-blocking-alert-body {
  min-width: 0;
  flex: 1;
}

.deposit-blocking-alert-title {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #7C2D12;
  line-height: 1.3;
}

.deposit-blocking-alert-text {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #92400E;
}

.deposit-blocking-cta {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #C0392B;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.deposit-blocking-cta:hover {
  background: #A93226;
}

/* Legacy — kept for selector compat, element removed from HTML */
.deposit-no-cash {
  margin-top: var(--s4);
  padding: var(--s3) var(--s4);
  border-radius: 8px;
  background: rgba(255,255,255,0.14);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.deposit-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: var(--s4);
  padding: 0 0 var(--s5);
  align-items: start;
  max-width: 100%;
}

.deposit-form-card,
.deposit-history-card-wrap {
  border-radius: 8px;
  border-color: #E5E7EB;
  min-width: 0;
}

.deposit-form-card .card-body {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.deposit-success-state {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  border-radius: 8px;
  background: #EAF7EF;
  color: #1E8449;
  border: 1px solid rgba(30,132,73,0.22);
}

.deposit-success-state strong,
.deposit-success-state span {
  display: block;
}

.deposit-success-state span {
  font-size: 12px;
  color: #2E6E46;
}

.deposit-currency-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 4px 4px 4px var(--s3);
  background: #fff;
  min-height: 56px;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}

.deposit-currency-field:focus-within {
  border-color: #8B95A1;
  box-shadow: 0 0 0 3px rgba(26,26,46,0.08);
}

.deposit-currency-field span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 36px;
  border-radius: 8px;
  background: #F8F9FA;
  font-size: 17px;
  font-weight: 900;
  color: #1A1A2E;
}

.deposit-currency-field .form-control {
  border: none;
  box-shadow: none;
  padding: 12px 10px 12px 0;
  font-size: 18px;
  font-weight: 500;
  border-radius: 0;
}

.deposit-currency-field .form-control:focus {
  border-color: transparent;
  box-shadow: none;
}

.deposit-currency-field.error {
  border-color: #C0392B;
  background: #FFF7F6;
}

.deposit-currency-field.error:focus-within {
  border-color: #C0392B;
  box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}

.deposit-currency-field.is-disabled {
  background: #F3F4F6;
  border-color: #E5E7EB;
  cursor: not-allowed;
  pointer-events: none;
}

.deposit-currency-field.is-disabled span {
  background: #E5E7EB;
  color: #9CA3AF;
}

.deposit-currency-field.is-disabled .form-control {
  background: #F3F4F6;
  color: #9CA3AF;
  cursor: not-allowed;
}

.deposit-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s2);
  margin-top: var(--s2);
}

.deposit-quick-btn {
  min-height: 46px;
  border-radius: 10px;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  color: #1A1A2E;
  font-size: 13px;
  font-weight: 800;
  transition: background var(--t), border-color var(--t), transform var(--t);
}

.deposit-quick-btn:hover {
  border-color: #C0392B;
  background: #FDF2F0;
}

.deposit-quick-btn:active {
  transform: scale(0.98);
}

.deposit-quick-all {
  background: #1A1A2E;
  border-color: #1A1A2E;
  color: #fff;
}

.deposit-quick-btn:disabled {
  opacity: 1;
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #9CA3AF;
  cursor: not-allowed;
  pointer-events: none;
}

.deposit-quick-all:disabled {
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #9CA3AF;
}

.deposit-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s2);
  width: 100%;
  min-width: 0;
}

.deposit-method-card {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 76px;
  padding: var(--s3) var(--s4);
  border-radius: 10px;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  cursor: pointer;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  min-width: 0;
  width: 100%;
}

.deposit-method-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.deposit-method-card:hover,
.deposit-method-card:focus-visible {
  border-color: #C0392B;
  box-shadow: 0 0 0 3px rgba(192,57,43,0.10);
  outline: none;
}

.deposit-method-card.selected {
  border-color: #C0392B;
  background: rgba(220,38,38,0.05);
}

.deposit-method-card.is-disabled {
  background: #F9FAFB;
  border-color: #E5E7EB;
  cursor: not-allowed;
  pointer-events: none;
}

.deposit-method-card.is-disabled .deposit-method-copy strong {
  color: #9CA3AF;
}

.deposit-method-card.is-disabled .deposit-method-copy small {
  color: #D1D5DB;
}

.deposit-method-card.is-disabled .deposit-method-icon {
  background: #F3F4F6;
  color: #D1D5DB;
}

.deposit-method-card.is-disabled.selected {
  border-color: #E5E7EB;
  background: #F3F4F6;
}

.deposit-method-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #F8F9FA;
  color: #C0392B;
  flex-shrink: 0;
}

.deposit-method-copy {
  min-width: 0;
}

.deposit-method-copy strong,
.deposit-method-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deposit-method-copy strong {
  font-size: 14px;
  font-weight: 800;
  color: #1A1A2E;
  line-height: 1.2;
}

.deposit-method-copy small {
  margin-top: 3px;
  font-size: 11px;
  color: #5D6D7E;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.deposit-method-loading {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s2);
}

.deposit-method-loading span {
  height: 70px;
  border-radius: 8px;
  background: linear-gradient(90deg, #F3F4F6 0%, #E5E7EB 50%, #F3F4F6 100%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ── Deposit Method Select Dropdown ─────────────────────────────── */
.deposit-method-select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 500;
  color: #1A1A2E;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235D6D7E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t);
  padding-right: 40px;
}
.deposit-method-select:focus {
  outline: none;
  border-color: #C0392B;
  box-shadow: 0 0 0 3px rgba(192,57,43,0.10);
}
.deposit-method-select:disabled {
  background-color: #F9FAFB;
  color: #9CA3AF;
  cursor: not-allowed;
  border-color: #E5E7EB;
}

/* ── Deposit Method Detail Panel ─────────────────────────────────── */
.deposit-method-detail {
  margin-top: var(--s2);
  animation: fadeInDown 0.18s ease;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.deposit-method-detail-inner {
  background: #F8F9FA;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  padding: var(--s3) var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.deposit-method-detail-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5D6D7E;
  margin-bottom: 2px;
}
.deposit-bank-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.deposit-method-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
}
.deposit-method-detail-row span {
  font-size: 13px;
  color: #5D6D7E;
  flex-shrink: 0;
}
.deposit-method-detail-row strong {
  font-size: 14px;
  font-weight: 700;
  color: #1A1A2E;
  text-align: right;
  overflow-wrap: break-word;
  word-break: normal;
  min-width: 0;
}

/* Account Number Row */
.deposit-account-number-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  min-width: 0;
}
.deposit-account-number-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.deposit-account-number-info span {
  font-size: 12px;
  color: #5D6D7E;
}
.deposit-account-number {
  font-size: 20px;
  font-weight: 800;
  color: #1A1A2E;
  letter-spacing: 0.04em;
  user-select: all;
  word-break: break-all;
}
.deposit-copy-btn {
  flex-shrink: 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.deposit-copy-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #16A34A;
  padding: 6px 0 2px;
}

/* ── QRIS Detail Panel ───────────────────────────────────────────── */
.deposit-qris-detail {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.deposit-qris-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: var(--s3);
  min-height: 80px;
}
.deposit-qris-preview img {
  display: block;
  max-width: 240px;
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.deposit-qris-img-error {
  font-size: 13px;
  color: #DC2626;
  text-align: center;
  padding: var(--s2);
}
.deposit-qris-actions {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
}
.deposit-qris-actions .btn {
  flex: 1 1 auto;
  min-height: 42px;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.deposit-qris-note {
  font-size: 12px;
  color: #5D6D7E;
  margin: 0;
  line-height: 1.4;
}

/* ── Cash / Tunai Detail Panel ───────────────────────────────────── */
.deposit-cash-detail {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--s3);
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
}
.deposit-cash-icon {
  flex-shrink: 0;
  color: #C0392B;
  margin-top: 2px;
}

/* ── Config Error State ──────────────────────────────────────────── */
.deposit-method-config-error {
  display: flex;
  align-items: center;
  gap: var(--s2);
  background: #FEF2F2;
  border: 1.5px solid #FECACA;
  border-radius: 8px;
  padding: var(--s3) var(--s4);
  font-size: 13px;
  font-weight: 500;
  color: #DC2626;
}
.deposit-method-config-error [data-lucide] {
  flex-shrink: 0;
}

.deposit-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.deposit-upload-zone {
  min-height: 128px;
  border: 1.5px dashed #C9D0D8;
  border-radius: 12px;
  background: #F8F9FA;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: var(--s4);
  cursor: pointer;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}

.deposit-upload-zone:active {
  background: #EFF1F3;
}

.deposit-upload-zone:hover,
.deposit-upload-zone:focus-visible,
.deposit-upload-zone.dragover {
  border-color: #C0392B;
  background: #FDF2F0;
  outline: none;
}

.deposit-upload-zone.optional {
  border-color: #D7DDE3;
}

.deposit-upload-zone.is-disabled {
  background: #F9FAFB;
  border-color: #E5E7EB;
  cursor: not-allowed;
  pointer-events: none;
}

.deposit-upload-zone.is-disabled .deposit-upload-empty {
  color: #9CA3AF;
}

.deposit-upload-zone.is-disabled .deposit-upload-empty strong {
  color: #9CA3AF;
}

.deposit-upload-zone.is-disabled .deposit-upload-empty > [data-lucide] {
  color: #D1D5DB;
  background: #F3F4F6;
  box-shadow: inset 0 0 0 1px #E5E7EB;
}

.deposit-upload-empty {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--s3);
  text-align: left;
  color: #5D6D7E;
  width: 100%;
}

.deposit-upload-empty strong {
  display: block;
  color: #1A1A2E;
  font-size: 15px;
  line-height: 1.3;
}

.deposit-upload-empty span {
  display: block;
  max-width: 360px;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
}

.deposit-upload-empty > svg,
.deposit-upload-empty > [data-lucide] {
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 10px;
  background: #fff;
  color: #5D6D7E;
  box-shadow: inset 0 0 0 1px #E5E7EB;
  flex-shrink: 0;
}

.deposit-upload-copy {
  min-width: 0;
}

.deposit-proof-preview {
  width: 100%;
}

.deposit-preview-file,
.deposit-preview-image {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: 96px;
  padding: var(--s3);
  border-radius: 8px;
  background: #fff;
  border: 1px solid #E5E7EB;
}

.deposit-preview-image img {
  width: 96px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #E5E7EB;
}

.deposit-preview-file strong,
.deposit-preview-image strong,
.deposit-preview-file span,
.deposit-preview-image span {
  display: block;
}

.deposit-preview-file strong,
.deposit-preview-image strong {
  color: #1A1A2E;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.deposit-preview-file span,
.deposit-preview-image span {
  margin-top: 2px;
  color: #5D6D7E;
  font-size: 12px;
}

.deposit-proof-remove,
.deposit-confirm-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #C0392B;
  background: #FADBD8;
  flex-shrink: 0;
}

.deposit-proof-remove {
  margin-left: auto;
}

.deposit-submit-btn {
  min-height: 54px;
  border-radius: 12px;
  background: #C0392B;
  border-color: #C0392B;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 22px rgba(192,57,43,0.30);
  transition: background var(--t), box-shadow var(--t), transform 0.08s;
}

.deposit-submit-btn:hover:not(:disabled) {
  background: #A93226;
  border-color: #A93226;
  box-shadow: 0 10px 26px rgba(192,57,43,0.34);
}

.deposit-submit-btn:active:not(:disabled) {
  transform: scale(0.985);
}

.deposit-history-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4);
}

.deposit-history-loading {
  padding: var(--s5);
  color: #5D6D7E;
  text-align: center;
}

.deposit-history-empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  text-align: center;
  color: #5D6D7E;
  padding: var(--s5);
}

.deposit-history-empty strong {
  color: #1A1A2E;
  font-size: 15px;
}

.deposit-history-empty-icon {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FADBD8;
  color: #C0392B;
}

.deposit-history-card {
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.deposit-history-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3);
  cursor: pointer;
}

.deposit-history-summary::-webkit-details-marker {
  display: none;
}

.deposit-history-main {
  min-width: 0;
}

.deposit-history-main strong,
.deposit-history-main span {
  display: block;
}

.deposit-history-main strong {
  color: #1A1A2E;
  font-size: 15px;
  font-weight: 900;
}

.deposit-history-main span {
  margin-top: 2px;
  color: #5D6D7E;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deposit-history-detail {
  display: grid;
  gap: var(--s2);
  padding: var(--s3);
  border-top: 1px solid #E5E7EB;
  background: #F8F9FA;
}

.deposit-history-detail div {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
}

.deposit-history-detail span {
  color: #5D6D7E;
  font-size: 12px;
}

.deposit-history-detail strong {
  color: #1A1A2E;
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

.deposit-history-detail a {
  color: #C0392B;
  text-decoration: underline;
}

.deposit-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  background: rgba(10,15,30,0.52);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-med), visibility var(--t-med);
}

.deposit-confirm-overlay.active {
  opacity: 1;
  visibility: visible;
}

.deposit-confirm-modal {
  width: min(420px, 100%);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(10,15,30,0.26);
  transform: translateY(12px);
  transition: transform var(--t-med);
  overflow: hidden;
}

.deposit-confirm-overlay.active .deposit-confirm-modal {
  transform: translateY(0);
}

.deposit-confirm-header,
.deposit-confirm-footer {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4);
}

.deposit-confirm-header {
  justify-content: space-between;
  border-bottom: 1px solid #E5E7EB;
}

.deposit-confirm-kicker {
  font-size: 12px;
  font-weight: 800;
  color: #C0392B;
}

.deposit-confirm-header h3 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.25;
  color: #1A1A2E;
}

.deposit-confirm-body {
  padding: var(--s5);
}

.deposit-confirm-amount {
  margin-bottom: var(--s4);
  font-size: 28px;
  font-weight: 900;
  color: #1A1A2E;
}

.deposit-confirm-summary {
  display: grid;
  gap: var(--s2);
}

.deposit-confirm-summary div {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s2) 0;
  border-bottom: 1px solid #EEF0F2;
}

.deposit-confirm-summary div:last-child {
  border-bottom: none;
}

.deposit-confirm-summary span {
  color: #5D6D7E;
  font-size: 13px;
}

.deposit-confirm-summary strong {
  color: #1A1A2E;
  font-size: 13px;
  text-align: right;
  overflow-wrap: anywhere;
}

.deposit-confirm-footer {
  justify-content: flex-end;
  border-top: 1px solid #E5E7EB;
  background: #F8F9FA;
}

/* ── History card: better tap target ───────────────────── */
.deposit-history-summary {
  padding: var(--s4);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.deposit-history-card[open] .deposit-history-summary {
  border-bottom: 1px solid #E5E7EB;
}

/* ── Post-shift modal ───────────────────────────────────── */
.post-shift-modal {
  text-align: center;
}

.post-shift-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s6) var(--s6) var(--s3);
}

.post-shift-icon {
  width: 56px;
  height: 56px;
  color: #1E8449;
}

.post-shift-title {
  font-size: 20px;
  font-weight: 900;
  color: #1A1A2E;
  margin: 0 0 var(--s2);
}

.post-shift-desc {
  font-size: 14px;
  color: #5D6D7E;
  margin: 0;
  line-height: 1.5;
}

.post-shift-footer {
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4) var(--s5) calc(var(--s5) + env(safe-area-inset-bottom, 0px));
}

.post-shift-btn-deposit {
  min-height: 52px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 10px;
}

/* Desktop: add side padding to inner container */
@media (min-width: 769px) {
  .deposit-page-inner {
    padding: 16px 24px 24px;
  }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .deposit-content-grid {
    grid-template-columns: 1fr;
  }

  .deposit-history-card-wrap {
    margin-bottom: var(--s5);
  }
}

@media (max-width: 768px) {
  .pos-alt-panel.deposit-page {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0;
  }

  .deposit-page-inner {
    padding: 12px;
    padding-bottom: calc(128px + max(env(safe-area-inset-bottom, 0px), 16px));
  }

  .deposit-cash-card {
    margin: 0 0 12px;
    padding: 14px;
    border-radius: 8px;
  }

  .deposit-card-amount {
    font-size: 26px;
    margin-top: 6px;
  }

  .deposit-cash-card.no-session .deposit-card-amount {
    font-size: 18px;
  }

  .deposit-card-icon {
    width: 28px;
    height: 28px;
  }

  .deposit-content-grid {
    padding: 0;
    gap: 12px;
  }

  .deposit-form-card .card-body {
    padding: 16px;
    gap: 16px;
  }

  .deposit-method-card {
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 8px;
  }

  .deposit-method-icon {
    width: 32px;
    height: 32px;
  }

  .deposit-quick-btn {
    min-height: 42px;
    font-size: 13px;
    border-radius: 8px;
  }

  .deposit-currency-field {
    min-height: 48px;
    border-radius: 8px;
  }

  .deposit-upload-zone {
    min-height: 88px;
    padding: 12px;
    border-radius: 8px;
    justify-content: flex-start;
    flex-direction: row;
    text-align: left;
  }

  .deposit-upload-empty {
    flex-direction: row;
    align-items: center;
    text-align: left;
  }

  .deposit-upload-empty > [data-lucide] {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .deposit-method-select {
    min-height: 48px;
    font-size: 15px;
  }

  .deposit-method-detail-inner {
    padding: 12px 14px;
  }

  .deposit-account-number {
    font-size: 18px;
  }

  .deposit-qris-preview img {
    max-width: 200px;
  }

  /* FAB: hide on deposit tab mobile to avoid covering form */
  body.deposit-tab-active #ob-reopen-btn.visible {
    display: none;
  }
}

@media (max-width: 560px) {
  .deposit-page-header {
    align-items: center;
    padding: 0;
  }

  .deposit-page-title {
    align-items: center;
    gap: var(--s2);
  }

  .deposit-back-btn span {
    display: none;
  }

  .deposit-card-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  /* Waktu spans full width on 390-560px */
  .deposit-card-meta-grid > div:last-child {
    grid-column: 1 / -1;
  }

  .deposit-card-meta-grid strong {
    font-size: 11px;
  }

  .deposit-history-list {
    padding: var(--s3);
  }

  /* 6 quick buttons: 3 columns */
  .deposit-quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  /* Method cards: full width single column */
  .deposit-method-grid,
  .deposit-method-loading {
    grid-template-columns: minmax(0, 1fr);
  }

  .deposit-account-number-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .deposit-copy-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .deposit-account-number {
    font-size: 22px;
  }

  .deposit-qris-actions {
    flex-direction: column;
  }

  .deposit-qris-preview img {
    max-width: 180px;
  }

  /* Submit button */
  .deposit-submit-btn {
    min-height: 52px;
    font-size: 17px;
  }

  /* History cards */
  .deposit-history-summary {
    padding: var(--s4);
  }

  .deposit-history-main strong {
    font-size: 16px;
  }

  .deposit-history-main span {
    font-size: 13px;
    white-space: normal;
  }

  .deposit-history-detail {
    padding: var(--s4);
  }

  .deposit-history-summary,
  .deposit-history-detail div,
  .deposit-confirm-summary div {
    align-items: flex-start;
  }

  /* Confirm modal: slide from bottom */
  .deposit-confirm-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .deposit-confirm-modal {
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .deposit-confirm-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: var(--s2);
    padding-bottom: calc(var(--s5) + env(safe-area-inset-bottom, 0px));
  }

  .deposit-confirm-footer .btn {
    min-height: 50px;
    font-size: 16px;
  }

  /* Post-shift modal: slide from bottom on mobile */
  .post-shift-modal {
    border-radius: 16px 16px 0 0;
    width: 100%;
  }
}

/* <= 389px: very small phones — 1 column meta, 2 col quick buttons */
@media (max-width: 389px) {
  .deposit-page-inner {
    padding: 10px;
    padding-bottom: calc(128px + max(env(safe-area-inset-bottom, 0px), 16px));
  }

  .deposit-card-meta-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .deposit-card-meta-grid > div:last-child {
    grid-column: auto;
  }

  .deposit-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* >= 561px: 3 column meta grid (restore from 560px override) */
@media (min-width: 561px) {
  .deposit-card-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .deposit-card-meta-grid > div:last-child {
    grid-column: auto;
  }
}

/* ── Admin Deposit Filter Card ───────────────────────────── */
.dep-filter-card { padding: 16px 20px; margin-bottom: 0; }
.dep-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.dep-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 130px;
}
.dep-filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.dep-filter-select { height: 38px; padding-top: 0; padding-bottom: 0; }
.dep-filter-action { flex: 0 0 auto; min-width: auto; }
.dep-filter-btn {
  height: 38px;
  padding: 0 18px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Admin Deposit Table ─────────────────────────────────── */
.deposit-admin-row { transition: background .15s; }
.deposit-admin-row:hover { background: var(--bg-alt); }
.deposit-admin-row.pending  { background: rgba(245, 158, 11, 0.04); }
.deposit-admin-row.confirmed { background: rgba(22, 163, 74, 0.04); }
.deposit-admin-row.rejected { background: rgba(220, 38, 38, 0.04); }

.deposit-admin-id {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: .03em;
  white-space: nowrap;
}
.deposit-admin-date { white-space: nowrap; font-size: 13px; }
.deposit-admin-amount {
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}
.deposit-admin-kas {
  white-space: nowrap;
  text-align: right;
  font-size: 13px;
}
.deposit-admin-method {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  white-space: nowrap;
}
.deposit-admin-notes {
  display: block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-muted);
  cursor: default;
}
.deposit-admin-proof-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.deposit-admin-proof-link:hover { text-decoration: underline; }

.deposit-admin-status-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 100px;
}
.deposit-admin-badge { font-size: 11px; }
.deposit-admin-reviewer {
  font-size: 11px;
  color: var(--text-muted);
}
.deposit-admin-reject-reason {
  font-size: 11px;
  color: var(--danger, #dc2626);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deposit-admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  margin-top: 4px;
}
.deposit-admin-actions .btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 10px;
  height: 28px;
}

.deposit-totals-row {
  background: var(--bg-alt);
  font-size: 13px;
}
.deposit-totals-row td { border-top: 2px solid var(--border); }

.deposit-manual-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-alt);
  font-size: 13px;
}
.deposit-manual-status span {
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.deposit-manual-status strong {
  color: var(--success);
}

.manual-proof-group {
  position: relative;
}

.manual-proof-group .deposit-upload-zone {
  min-height: 112px;
  border-radius: 8px;
}

@media (max-width: 900px) {
  .dep-filter-group { min-width: 110px; }
}
@media (max-width: 600px) {
  .dep-filter-card { padding: 12px 14px; }
  .dep-filter-row { gap: 10px; }
  .dep-filter-group { min-width: calc(50% - 5px); flex: 0 0 calc(50% - 5px); }
  .dep-filter-action { flex: 1; }
  .dep-filter-btn { width: 100%; justify-content: center; }
}

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-warning { 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; }

/* ── Ingredient Log Modal: smooth fade-in AND fade-out ──────────────────────
   Fix: default CSS transitions visibility at midpoint (0.14s) so backdrop
   disappears abruptly on close. This override delays visibility:hidden until
   after opacity finishes fading, giving a true smooth close animation.      */
#modal-ingredient-log {
  transition: opacity 0.26s ease, visibility 0s linear 0.26s;
}
#modal-ingredient-log.active {
  transition: opacity 0.26s ease, visibility 0s;
}
#modal-ingredient-log .modal {
  transition: transform 0.28s cubic-bezier(0.34, 1.30, 0.64, 1);
}

/* ── 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;
}
.alert-info {
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: var(--s4);
  font-size: 12px; color: #1d4ed8; font-weight: 600;
  display: flex; align-items: flex-start; gap: 6px;
}

/* 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; }

.scp-action-panel {
  border: 1px solid rgba(234,88,12,.35);
  border-radius: var(--r-lg);
  background: #FFF7ED;
  padding: var(--s4);
  box-shadow: var(--sh-xs);
}
.scp-action-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 1px solid rgba(234,88,12,.18);
}
.scp-action-eyebrow {
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.scp-action-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 2px;
}
.scp-action-note {
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
  max-width: 280px;
}
.scp-action-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s3);
  padding: var(--s3) 0;
}
.scp-action-metric {
  min-width: 0;
  padding: var(--s3);
  border: 1px solid rgba(234,88,12,.14);
  border-radius: var(--r);
  background: rgba(255,255,255,.72);
}
.scp-action-metric-strong {
  background: rgba(255,255,255,.9);
}
.scp-action-form-grid {
  display: grid;
  grid-template-columns: minmax(220px, .85fr) minmax(0, 1.15fr);
  gap: var(--s3);
  align-items: start;
}
.scp-currency-input .input-prefix {
  color: var(--text);
  font-weight: 800;
}
.scp-currency-input .form-control {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.scp-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: var(--s2);
  margin-top: var(--s3);
}

#modal-scp-detail .modal {
  max-height: min(92vh, 920px);
}
#modal-scp-detail .modal-body {
  gap: var(--s4);
}
#modal-scp-detail .modal-footer {
  flex-wrap: wrap;
}
.scp-detail-section {
  min-width: 0;
}
.scp-detail-section-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: var(--s2);
}
.scp-breakdown-panel,
.scp-balance-strip,
.scp-history-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--sh-xs);
}
.scp-breakdown-panel {
  padding: var(--s3) var(--s4);
}
.scp-breakdown-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.scp-breakdown-table td {
  padding: 8px 0 !important;
  border-bottom: 1px solid var(--border);
}
.scp-breakdown-table tr:last-child td {
  border-bottom: none;
}
.scp-breakdown-total td {
  padding-top: var(--s3) !important;
  color: var(--text);
  font-weight: 800;
}
.scp-breakdown-pending td {
  color: var(--text-muted);
  font-size: 12px;
}
.scp-balance-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: visible;
}
.scp-balance-item {
  min-width: 0;
  padding: var(--s4);
}
.scp-balance-item + .scp-balance-item {
  border-left: 1px solid var(--border);
}
.scp-balance-value {
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.25;
  margin-top: var(--s1);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.scp-history-table-wrap {
  max-height: 220px;
  overflow: auto;
}
.scp-history-table-wrap-sm {
  max-height: 180px;
}
.scp-history-table {
  min-width: 760px;
  font-size: 12px;
}
.scp-history-table th,
.scp-history-table td {
  padding: 10px var(--s3);
}
.scp-history-table .empty-td {
  height: 92px;
  padding: var(--s5);
  vertical-align: middle;
}
.scp-row-active td {
  background: rgba(22,163,74,.04);
}
.scp-voided-row td {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

@media (max-width: 720px) {
  .scp-action-head,
  .scp-action-buttons {
    align-items: stretch;
    flex-direction: column;
  }
  .scp-action-note {
    max-width: none;
    text-align: left;
  }
  .scp-action-summary,
  .scp-action-form-grid {
    grid-template-columns: 1fr;
  }
  .scp-balance-strip {
    grid-template-columns: 1fr;
  }
  .scp-balance-item + .scp-balance-item {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}
/* 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;
  /* Fallback chain — --vh100 paling akurat karena dari window.innerHeight
     (JS di head mengecualikan Android nav bar & iOS safari bar secara real-time). */
  height: 100vh;         /* fallback paling lama */
  height: 100dvh;        /* modern fallback */
  height: var(--vh100, 100dvh); /* JS-corrected: selalu = viewport visible */
  overflow: hidden;
  background: var(--bg);
  /* Safe area untuk iOS (notch / home indicator) */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* 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; min-height: 0; }

/* 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-backdrop { display: none; }

.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);
  /* FIX: min-height:0 dan height:100% wajib agar grid item bisa shrink dan flex
     internal (.pos-cart-items flex:1 + .pos-cart-footer flex-shrink:0)
     berfungsi benar di semua resolusi */
  min-height: 0;
  height: 100%;
}

.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; }
.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) calc(var(--s5) + env(safe-area-inset-bottom, 12px));
  background: var(--surface);
  flex-shrink: 0;  /* KUNCI: footer tidak boleh menyusut */
  position: relative; /* bukan sticky — parent flex yang handle posisi */
  z-index: 20;
}

/* Resolusi pendek (1200x800, landscape tablet) */
@media (min-width: 901px) and (max-height: 860px) {
  .pos-cart-footer {
    padding-bottom: var(--s4); /* kurangi padding bawah di viewport pendek */
  }
  .btn-checkout { min-height: 46px; font-size: 14px; padding: var(--s3) var(--s4); }
}
.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; }
}

@media (max-width: 768px) {
  /* POS mobile layout — revert grid to stacked flex */
  .pos-body { display: flex; flex-direction: column; overflow: hidden; position: relative; }
  .pos-cart-backdrop.mobile-show {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
  }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes slideUpCart { from { transform: translateY(100%); } to { transform: translateY(0); } }

  .pos-cart {
    width: 100%; border-left: none; border-top: none; box-shadow: none;
    display: none; flex: 1;
  }
  .pos-cart.mobile-show {
    display: flex;
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 85vh;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    background: var(--surface);
    z-index: 1001;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
    animation: slideUpCart 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .pos-products.mobile-hide { display: flex !important; }
  .mobile-back-btn { display: flex; align-items: center; padding: 0; margin-right: var(--s2); }

  /* Floating cart button — styles moved to SPA section at end of file */
  .pos-fab-cart:active { transform: scale(0.99); }

  .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: calc(68px + max(env(safe-area-inset-bottom, 0px), 16px));
  }
  .pos-cart {
    display: none;
    flex-direction: column;
    overflow: hidden;
  }
  .pos-cart-items {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    /* Tambah padding bawah agar item terakhir tidak tertutup footer */
    padding-bottom: 8px;
  }
  .pos-cart-footer {
    flex-shrink: 0 !important;
    position: relative !important; /* override sticky agar tidak keluar dari flex */
    bottom: auto !important;
    /* Padding bawah extra untuk navigation bar Android */
    padding-bottom: calc(var(--s4) + max(env(safe-area-inset-bottom, 0px), 56px)) !important;
    background: #111827 !important;
    border-top: none !important;
  }
  .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; }
  .pos-cart-footer .cart-summary { border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: var(--s3); margin-bottom: var(--s3); }

  .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: calc(68px + max(env(safe-area-inset-bottom, 0px), 16px)); }
  .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 — flex-shrink:0 supaya tidak tenggelam, dark brand */
  .pos-cart-footer {
    flex-shrink: 0;
    position: relative;
    bottom: auto;
    z-index: 20;
    background: #111827;
    border-top: none;
    /* FIX: env(safe-area-inset-bottom) sering = 0 di Android Chrome.
       Gunakan max() untuk memastikan minimal 8px di atas padding var(--s5).
       Ini mencegah tombol Bayar tertutup navigation bar Android. */
    padding: var(--s4) var(--s4)
             calc(var(--s5) + max(env(safe-area-inset-bottom, 0px), 56px));
  }
  .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)
             calc(var(--s6) + max(env(safe-area-inset-bottom, 0px), 56px));
  }
  .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; }

/* ════════════════════════════════════════════════════════════
   SPA CART PAGE — View Swap Architecture
   PRD: Halaman Keranjang Terpisah v1.0.0
   ════════════════════════════════════════════════════════════ */

/* ── #panel-kasir: replaces old .pos-body grid layout ── */
#panel-kasir {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ── #view-kasir: product view, fills panel entirely ── */
#view-kasir {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#view-kasir[hidden] { display: none !important; }

/* ── #view-cart: full-page cart, hidden by default ── */
#view-cart {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
#view-cart[hidden] { display: none !important; }

/* ── FAB Cart Button — position:fixed, safe-area-inset-bottom ── */
/* Overrides the old .pos-fab-cart rules for ALL screen sizes */
.pos-fab-cart {
  position: fixed !important;
  bottom: max(env(safe-area-inset-bottom, 0px), 16px) !important;
  left: 0 !important;
  right: 0 !important;
  min-height: 60px !important;
  z-index: 800 !important;
  padding: 0 var(--s5) !important;
  padding-bottom: 0 !important;
  touch-action: manipulation !important;
  /* Default: hidden */
  display: none !important;
  /* Style */
  background: linear-gradient(135deg, var(--danger), #b91c1c) !important;
  color: white !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-shadow: 0 -4px 20px rgba(220,38,38,0.35) !important;
  border: none !important;
  cursor: pointer !important;
  border-radius: 0 !important;
  transition: transform 0.1s ease !important;
}
/* Show FAB when count > 0 and in kasir view */
.pos-fab-cart.show { display: flex !important; }
.pos-fab-cart:active { transform: scale(0.99) !important; }

/* FAB internal elements */
.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);
  min-height: 40px;
}
.pos-fab-cart .fab-badge {
  background: white;
  color: var(--danger);
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 12px;
}

/* Tablet landscape: rounded, with side margin */
@media (min-width: 768px) and (orientation: landscape) {
  .pos-fab-cart {
    bottom: max(env(safe-area-inset-bottom, 0px), 20px) !important;
    left: 24px !important;
    right: 24px !important;
    border-radius: var(--r-lg) !important;
    min-height: 60px !important;
  }
}

/* Product grid: ensure last row is always visible above FAB */
.pos-products-grid {
  padding-bottom: calc(68px + max(env(safe-area-inset-bottom, 0px), 16px));
}

/* ── Cart Page Header ── */
.cart-page-header {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 12px var(--s4);
  padding-top: max(env(safe-area-inset-top, 0px), 12px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: 56px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.cart-page-title {
  flex: 1;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cart-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  line-height: 1;
}
.cart-page-actions {
  display: flex;
  gap: var(--s2);
  align-items: center;
  flex-shrink: 0;
}

/* ── Cart Page Items (scrollable area) ── */
.cart-page-items {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.cart-page-items::-webkit-scrollbar { width: 3px; }
.cart-page-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Cart Page Empty State ── */
.cart-page-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  color: var(--text-muted);
  text-align: center;
  padding: 40px var(--s6);
}

/* ── Cart Page Footer (sticky, dark brand) ── */
.cart-page-footer {
  background: #111827;
  border-top: none;
  padding: var(--s4);
  padding-bottom: max(calc(var(--s5) + env(safe-area-inset-bottom, 0px)), 100px);
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}
.cart-page-footer .cart-summary {
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: var(--s3);
  margin-bottom: var(--s3);
}
.cart-page-footer .cart-summary-row,
.cart-page-footer .cart-total-label { color: rgba(255,255,255,0.7); }
.cart-page-footer .cart-total-value { color: #fff; }
.cart-page-footer .cart-discount-row { color: #fca5a5; display: flex; }
.cart-page-footer .btn-checkout {
  background: #dc2626;
  color: #fff;
  border: none;
}
.cart-page-footer .btn-checkout:hover { background: #b91c1c; }

/* Short viewport landscape (e.g. 1200×800) — jangan kurangi padding nav bar Android */
@media (min-width: 901px) and (max-height: 860px) {
  .cart-page-footer {
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 80px);
  }
  .cart-page-footer .btn-checkout { min-height: 46px; font-size: 14px; }
}

/* Mobile: compact footer */
@media (max-width: 768px) {
  .cart-page-header { padding: 10px var(--s3); min-height: 52px; }
  .cart-page-items { padding: 0; }
  .cart-page-footer {
    padding: var(--s3);
    /* fallback 100px agar tombol Bayar tidak tertutup nav-bar Android */
    padding-bottom: max(calc(var(--s4) + env(safe-area-inset-bottom, 0px)), 100px);
  }
}

/* Ensure cart-item styles work inside cart-page-items */
.cart-page-items .cart-item { border-bottom: 1px solid var(--border); }
.cart-page-items .cart-item:last-child { border-bottom: none; }

/* ============================================================
   UX RESPONSIVE IMPROVEMENTS v3
   ============================================================ */

/* ── Admin Bottom Navigation (mobile only) ──────────────── */
.admin-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  z-index: 160;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.admin-bottom-nav-inner {
  display: flex;
  height: 56px;
  align-items: stretch;
}

.admin-bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--t), background var(--t);
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  letter-spacing: 0.2px;
}
.admin-bottom-tab [data-lucide], .admin-bottom-tab svg { width: 20px; height: 20px; display: block; }
.admin-bottom-tab.active { color: var(--orange); }
.admin-bottom-tab.active::after {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2.5px;
  background: var(--orange);
  border-radius: 0 0 3px 3px;
}
.admin-bottom-tab:active { background: var(--bg-alt); }

@media (max-width: 900px) {
  .admin-bottom-nav { display: block; }
  /* Push admin-main content above bottom nav */
  .admin-main {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + var(--s5)) !important;
  }
}

/* ── Admin: table column hiding on small mobile ──────────── */
/* Transactions: hide Kasir & Metode columns */
@media (max-width: 600px) {
  #section-transactions table thead th:nth-child(4),
  #section-transactions table thead th:nth-child(5),
  #section-transactions table tbody td:nth-child(4),
  #section-transactions table tbody td:nth-child(5) { display: none; }

  /* Dashboard recent transactions: hide Cabang, Kasir, Metode */
  #section-dashboard table thead th:nth-child(3),
  #section-dashboard table thead th:nth-child(4),
  #section-dashboard table thead th:nth-child(5),
  #section-dashboard table tbody td:nth-child(3),
  #section-dashboard table tbody td:nth-child(4),
  #section-dashboard table tbody td:nth-child(5) { display: none; }

  /* Reports sales table: hide Cabang, Kasir, Metode */
  #report-sales-body tr td:nth-child(3),
  #report-sales-body tr td:nth-child(4),
  #report-sales-body tr td:nth-child(5),
  #section-reports #report-tab-sales table thead th:nth-child(3),
  #section-reports #report-tab-sales table thead th:nth-child(4),
  #section-reports #report-tab-sales table thead th:nth-child(5) { display: none; }

  /* Inventory logs: hide Stok detail & Keterangan */
  #inv-log-body tr td:nth-child(6),
  #inv-log-body tr td:nth-child(7),
  #section-inv-logs table thead th:nth-child(6),
  #section-inv-logs table thead th:nth-child(7) { display: none; }

  /* Branch pricing: hide total varian & varian override, keep aksi */
  #branch-pricing-body tr td:nth-child(2),
  #branch-pricing-body tr td:nth-child(3),
  #section-branch-pricing table thead th:nth-child(2),
  #section-branch-pricing table thead th:nth-child(3) { display: none; }
}

/* ── Admin: section actions full-width on mobile ─────────── */
@media (max-width: 600px) {
  .section-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  /* Primary action stretches full width */
  .section-actions .btn-primary {
    flex: 1 1 100%;
  }
  /* Secondary actions share row */
  .section-actions .btn:not(.btn-primary) {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
    justify-content: center;
  }
  /* If only one button, also full width */
  .section-actions .btn:only-child {
    flex: 1 1 100%;
  }
}

/* ── Admin: filters bar mobile stacking ──────────────────── */
@media (max-width: 768px) {
  .filters-bar {
    padding: var(--s3);
    gap: var(--s2);
  }
  .filters-bar .form-group { flex: 1 1 calc(50% - 4px); min-width: 120px; }
  .filters-bar .form-group.flex-none { flex: 1 1 calc(50% - 4px); }
  .filters-bar .pb-1 { flex: 1 1 100%; }
  .filters-bar .pb-1 .btn { width: 100%; }
  .filters-bar .quick-filters { gap: var(--s1); }
  .filters-bar .quick-filter-btn { padding: 5px 10px; font-size: 11px; }
}

/* ── Touch target minimum on mobile ──────────────────────── */
@media (max-width: 900px) {
  /* Ensure all interactive buttons hit 44×44 */
  .btn-sm {
    min-height: 38px;
    padding: 8px 14px;
  }
  .btn-icon { width: 40px; height: 40px; }
  .qty-btn { width: 40px; height: 40px; }
  .modal-close { width: 36px; height: 36px; font-size: 16px; }
  .quick-filter-btn { min-height: 36px; }
  /* Nav items in drawer: larger tap area */
  .drawer-btn { padding: var(--s3) var(--s4); min-height: 48px; }
}

/* ── Admin topbar: hide date on small mobile ─────────────── */
@media (max-width: 500px) {
  .topbar-date { display: none; }
}

/* ── Admin stat cards: single column on very small ───────── */
@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  .report-stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Admin dashboard grid: ensure card stacks on mobile ──── */
@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  /* Stat card hero: full width in 2-col grid */
  .stat-card-hero { grid-column: 1 / -1; }
}

/* ── POS header mobile: show branch name ─────────────────── */
@media (max-width: 900px) {
  .pos-branch-name { display: block !important; font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
  .pos-brand-name  { display: none !important; }
}

/* ── POS: staff name chip in header (mobile) ─────────────── */
#header-staff-chip {
  display: none;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--r-full);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
@media (max-width: 900px) {
  #header-staff-chip { display: flex; }
}

/* ── Admin inventory section actions: wrap tightly ───────── */
#section-inventory .section-actions {
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  #section-inventory .section-actions .btn { flex: 1 1 calc(50% - 4px); justify-content: center; }
  #section-inventory .section-actions .btn-primary { flex: 1 1 100%; }
}

/* ── Admin section header: better mobile layout ──────────── */
@media (max-width: 600px) {
  .section-title { font-size: 18px; }
  .section-header { margin-bottom: var(--s4); gap: var(--s3); }
}

/* ── Admin: cards in narrow view ─────────────────────────── */
@media (max-width: 400px) {
  .admin-list-card {
    padding: var(--s3) var(--s4);
    gap: var(--s3);
  }
  .list-card-actions { flex-wrap: wrap; }
  .product-admin-grid { grid-template-columns: repeat(2, 1fr); padding: var(--s3); }
}

/* ── POS alt panels: add bottom padding for FAB ──────────── */
.pos-alt-panel {
  padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom, 0px));
}

/* ── Cart page: larger touch on header actions ───────────── */
@media (max-width: 768px) {
  .cart-page-actions .btn-sm { min-height: 40px; min-width: 40px; }
  .cart-page-actions .btn-ghost { min-height: 40px; }
}

/* ── Payment modal: cash input larger on mobile ──────────── */
@media (max-width: 480px) {
  .input-hero { font-size: 20px; padding: 14px; }
  .change-value { font-size: 26px; }
  .quick-amounts { gap: var(--s1); }
  .quick-amount-btn { padding: 8px 10px; font-size: 11px; flex: 1 1 calc(33% - 4px); text-align: center; }
}

/* ── Modals on very small screens ───────────────────────────*/
@media (max-width: 380px) {
  .modal-body { padding: var(--s4) var(--s3); }
  .modal-footer { padding: var(--s3); gap: var(--s2); }
  .modal-header { padding: var(--s3) var(--s4); }
  .success-popup { padding: var(--s5) var(--s4) var(--s4); }
  .success-popup-btns { flex-direction: column; }
  .success-popup-btns .btn { min-width: unset; }
}

/* ── Shift summary modal: grid stack on mobile ───────────── */
@media (max-width: 480px) {
  .shift-stat-group { grid-template-columns: 1fr; }
  .shift-expected-box { flex-direction: column; align-items: flex-start; gap: var(--s2); }
}

/* ── Admin topbar: compact on mobile ─────────────────────── */
@media (max-width: 500px) {
  .admin-topbar { padding: 0 var(--s3); }
  .admin-topbar-title { font-size: 15px; }
  /* Hide "Buka POS" text, keep icon */
  .admin-topbar-right .btn span { display: none; }
}

/* ── Section-header wrap fix on mobile ───────────────────── */
@media (max-width: 768px) {
  .section-header { flex-direction: column; align-items: flex-start; }
  .section-actions { align-self: stretch; }
}

/* ── Bulk import steps: vertical on mobile ───────────────── */
@media (max-width: 600px) {
  .bulk-steps { flex-direction: column; gap: var(--s4); }
  .bulk-step-connector { display: none; }
}

/* ── inv-grid responsive ─────────────────────────────────── */
@media (max-width: 480px) {
  .inv-grid { grid-template-columns: 1fr 1fr; gap: var(--s3); }
}

/* ── cash balance card responsive ───────────────────────── */
@media (max-width: 480px) {
  .cash-balance-card { flex-direction: column; align-items: flex-start; }
  .cbc-amount { font-size: 1.5rem; }
  .cbc-formula { flex-direction: column; gap: var(--s2); }
  .cbf-op { display: none; }
}

/* ── trx-item responsive: smaller padding ───────────────── */
@media (max-width: 480px) {
  .trx-item { padding: 12px var(--s3); }
}

/* ── POS alt panel panels: compact stat grid ─────────────── */
@media (max-width: 480px) {
  .pos-summary-grid { grid-template-columns: 1fr 1fr; gap: var(--s2); }
  .pos-inv-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s2); padding: var(--s3); }
}
/* ── Transfer Notification Pop-up ──────────────────────── */
.transfer-notif-detail { background: var(--surface-2, #F9FAFB); border-radius: 12px; padding: 14px; }
.transfer-notif-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border, #E5E7EB); }
.transfer-notif-row:last-child { border-bottom: none; }
.transfer-notif-row .label { color: var(--text-muted); font-size: 13px; }
.transfer-notif-row .value { font-size: 13px; text-align: right; }

/* ── Product Search Toolbar (admin) ──────────────────────── */
.section-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }

/* ── Radio Toggle: Tipe Produk ────────────────────────────── */
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-option { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio-option input[type="radio"] { accent-color: var(--warning, #F97316); width: 16px; height: 16px; }

/* ═══════════════════════════════════════════════════════════════
   ONBOARDING TUTORIAL — Staff New User Guide v2
   Spotlight cutout + animated bouncing pointer + auto tab-switch
   ═══════════════════════════════════════════════════════════════ */

/* ── Entry Panel (bottom sheet) ────────────────────────────── */
#ob-entry-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 7500;
  background: var(--surface);
  border-top: 3px solid var(--warning);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: var(--s4) var(--s5) max(var(--s5), env(safe-area-inset-bottom, 20px));
  box-shadow: 0 -12px 50px rgba(0,0,0,0.18);
  transform: translateY(110%);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 560px;
  margin: 0 auto;
}
#ob-entry-panel.visible { transform: translateY(0); }

.ob-entry-header { display: flex; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s3); }
.ob-entry-icon {
  width: 46px; height: 46px; border-radius: var(--r-lg);
  background: var(--warning-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.ob-entry-text { flex: 1; min-width: 0; }
.ob-entry-title { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.ob-entry-desc  { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.ob-entry-progress {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; color: var(--warning);
  background: var(--warning-bg); border-radius: var(--r-full);
  padding: 3px 10px; margin-top: var(--s2);
}
.ob-entry-actions { display: flex; gap: var(--s2); margin-top: var(--s3); }
.ob-entry-actions .btn-ob-start {
  flex: 1; background: var(--warning); color: #fff;
  border: none; border-radius: var(--r-lg);
  padding: 13px 16px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: var(--t);
}
.ob-entry-actions .btn-ob-start:hover { background: var(--orange-dark); }
.ob-entry-actions .btn-ob-later {
  background: var(--bg-alt); color: var(--text-sub);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 13px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--t); white-space: nowrap;
}
.ob-entry-actions .btn-ob-later:hover { background: var(--border); }

/* ── Tour Overlay ──────────────────────────────────────────── */
#ob-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 7000;
  pointer-events: none;
}
#ob-overlay.visible { display: block; }

/* Scrim: only shown when no target (checklist/center mode) */
.ob-scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.50);
  pointer-events: auto;
  display: none;
}
#ob-overlay.ob-no-target .ob-scrim { display: block; }

/* ── Spotlight Cutout ──────────────────────────────────────── */
/* The key: box-shadow casts a massive shadow everywhere EXCEPT
   the highlight box itself — creating a natural cutout effect. */
#ob-highlight-box {
  display: none;
  position: absolute;
  /* box-shadow creates the dark overlay with a transparent hole */
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.52);
  border: 2.5px solid var(--warning);
  border-radius: var(--r-lg);
  pointer-events: none;
  z-index: 7100;
  transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
  animation: ob-spotlight-pulse 2.2s ease-in-out infinite;
}
@keyframes ob-spotlight-pulse {
  0%, 100% { border-color: var(--warning);       box-shadow: 0 0 0 9999px rgba(0,0,0,0.52), 0 0 0 3px rgba(249,115,22,0.25); }
  50%       { border-color: var(--orange-dark);   box-shadow: 0 0 0 9999px rgba(0,0,0,0.52), 0 0 0 7px rgba(249,115,22,0.15); }
}

/* ── Animated Bouncing Pointer ─────────────────────────────── */
#ob-pointer {
  display: none;
  position: absolute;
  z-index: 7200;
  font-size: 28px;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  animation: ob-bounce 0.7s ease-in-out infinite alternate;
  transform-origin: bottom center;
}
#ob-pointer.visible { display: block; }
@keyframes ob-bounce {
  from { transform: translateY(0px)   scale(1.0); }
  to   { transform: translateY(-14px) scale(0.92); }
}

/* ── Tooltip Card ──────────────────────────────────────────── */
#ob-tooltip {
  position: fixed;
  z-index: 7300;
  width: 340px; max-width: calc(100vw - 24px);
  box-sizing: border-box;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: 0 24px 60px rgba(0,0,0,0.22), 0 4px 12px rgba(0,0,0,0.1);
  border: 1.5px solid var(--border);
  overflow: hidden;
  pointer-events: auto;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
/* Bottom-sheet placement on mobile */
#ob-tooltip.ob-tooltip-bottom-sheet {
  border-radius: 18px;
  max-height: min(52dvh, 420px);
  display: flex;
  flex-direction: column;
}
#ob-tooltip.ob-tooltip-bottom-sheet .ob-tooltip-body {
  overflow-y: auto;
  flex: 1;
}
#ob-tooltip.ob-tooltip-bottom-sheet .ob-tooltip-footer {
  flex-shrink: 0;
}
#ob-tooltip.ob-tooltip-bottom-sheet.ob-tooltip-in  { transform: translateY(0); }
#ob-tooltip.ob-tooltip-bottom-sheet.ob-tooltip-out { transform: translateY(24px); }
/* JS adds/removes these for step-change animation */
#ob-tooltip.ob-tooltip-in  { opacity: 1; transform: scale(1); }
#ob-tooltip.ob-tooltip-out { opacity: 0; transform: scale(0.94) translateY(6px); }

.ob-tooltip-header {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  padding: 10px var(--s4);
  display: flex; align-items: center; justify-content: space-between;
}
.ob-step-module {
  font-size: 10px; font-weight: 800;
  color: rgba(255,255,255,0.88);
  text-transform: uppercase; letter-spacing: 0.7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: calc(100% - 36px);
}
.btn-ob-close-tour {
  background: rgba(255,255,255,0.22); border: none; color: #fff;
  width: 26px; height: 26px; border-radius: var(--r-full);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1; transition: var(--t);
}
.btn-ob-close-tour:hover { background: rgba(255,255,255,0.38); }

.ob-tooltip-body { padding: var(--s4); }
.ob-step-title {
  font-size: 15px; font-weight: 800; color: var(--text);
  margin-bottom: var(--s2); line-height: 1.3;
}
.ob-step-body {
  font-size: 13px; color: var(--text-sub);
  line-height: 1.7; margin-bottom: var(--s3);
  white-space: pre-line;
}
.ob-progress-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 5px;
}
.ob-progress-text { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.ob-progress-bar {
  height: 5px; background: var(--border); border-radius: var(--r-full); overflow: hidden;
}
.ob-progress-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--warning), var(--orange-dark));
  border-radius: var(--r-full); transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.ob-dots {
  display: flex; gap: 5px; align-items: center;
  justify-content: center; margin-top: var(--s2);
}
.ob-dot {
  width: 7px; height: 7px; border-radius: var(--r-full);
  background: var(--border); transition: all 0.2s ease;
}
.ob-dot-active { background: var(--warning); width: 20px; }
.ob-dot-done   { background: var(--success); }

.ob-tooltip-footer {
  padding: var(--s2) var(--s4) var(--s4);
  display: flex; gap: var(--s2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.btn-ob-back, .btn-ob-next, .btn-ob-done {
  border-radius: var(--r-lg);
  padding: 11px 16px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: var(--t);
  display: flex; align-items: center; justify-content: center;
  gap: 4px; white-space: nowrap;
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.btn-ob-back {
  min-width: 104px; flex-shrink: 0;
  background: var(--bg-alt); color: var(--text-sub); border: 1px solid var(--border);
}
.btn-ob-back:hover:not(:disabled) { background: var(--border); }
.btn-ob-back:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-ob-next, .btn-ob-done {
  flex: 1; background: var(--warning); color: #fff; border: none;
}
.btn-ob-next:hover:not(:disabled) { background: var(--orange-dark); }
.btn-ob-next:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ob-done { background: var(--success); }
.btn-ob-done:hover:not(:disabled) { background: var(--success-dark); }
.btn-ob-done:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Target element: lift above overlay spotlight ───────────── */
.ob-target-active {
  position: relative !important;
  z-index: 7150 !important;
}

/* ── Completion Banner ─────────────────────────────────────── */
#ob-complete-banner {
  position: fixed;
  top: var(--s4); left: 50%;
  transform: translateX(-50%) translateY(-140%);
  z-index: 7600;
  background: linear-gradient(135deg, var(--success) 0%, #15803d 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: var(--s3) var(--s5);
  box-shadow: var(--sh-lg);
  display: flex; align-items: center; gap: var(--s3);
  font-weight: 700; font-size: 14px;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap; max-width: calc(100vw - 32px);
  pointer-events: none;
}
#ob-complete-banner.visible { transform: translateX(-50%) translateY(0); }
.ob-complete-icon { font-size: 22px; }

/* ── Admin: Training Status Badge ──────────────────────────── */
.badge-training {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--r-full); white-space: nowrap;
}
.badge-training-not_started { background: var(--warning-bg); color: var(--warning); }
.badge-training-in_progress { background: var(--info-bg);    color: var(--info); }
.badge-training-completed   { background: var(--success-bg); color: var(--success); }
.badge-training-none        { background: var(--bg-alt);     color: var(--text-muted); }

/* ── Reopen FAB ────────────────────────────────────────────── */
#ob-reopen-btn {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  right: var(--s4);
  z-index: 7400;
  background: var(--warning); color: #fff;
  border: none; border-radius: var(--r-full);
  width: 50px; height: 50px;
  box-shadow: var(--sh-orange), 0 0 0 3px rgba(249,115,22,0.18);
  cursor: pointer;
  display: none; align-items: center; justify-content: center;
  font-size: 22px; transition: var(--t);
}
#ob-reopen-btn.visible { display: flex; animation: ob-fab-in 0.32s cubic-bezier(0.34,1.56,0.64,1); }
#ob-reopen-btn:hover   { background: var(--orange-dark); transform: scale(1.1); }
@keyframes ob-fab-in {
  from { opacity: 0; transform: scale(0.4) rotate(-20deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ── Mobile Responsive ─────────────────────────────────────── */
@media (max-width: 480px) {
  #ob-entry-panel    { border-radius: var(--r-xl) var(--r-xl) 0 0; }
  /* Tooltip width handled by JS (visualViewport); override only padding */
  .ob-tooltip-header { padding: var(--s2) var(--s3); }
  .ob-tooltip-body   { padding: var(--s3); line-height: 1.6; }
  .ob-tooltip-footer { padding: var(--s2) var(--s3) var(--s3); }
  .btn-ob-back       { min-width: 88px; padding: 10px 10px; font-size: 12px; }
  .btn-ob-next,
  .btn-ob-done       { padding: 10px 12px; font-size: 12px; }
  #ob-pointer        { font-size: 22px; }
}

/* ── Reduced Motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #ob-highlight-box,
  #ob-pointer,
  #ob-tooltip,
  #ob-entry-panel,
  #ob-complete-banner {
    animation: none !important;
    transition: none !important;
  }
}
