/* ─── Google Font ──────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ─── Design Tokens (Dominan Putih / Clean White Theme) ───────── */
:root {
  /* Backgrounds */
  --bg-base:        #f1f5f9;      /* Slate 100: Soft modern background */
  --bg-surface:     #ffffff;      /* Pure White for headers, cards, panels */
  --bg-card:        #ffffff;      /* Pure White card */
  --bg-card-hover:  #f8fafc;      /* Very subtle slate 50 on hover */
  --bg-subtle:      #f8fafc;
  --bg-glass:       rgba(255, 255, 255, 0.94);

  /* Brand Accents */
  --accent:         #4f46e5;      /* Indigo 600 */
  --accent-light:   #4338ca;      /* Indigo 700: High readability on white */
  --accent-soft:    #eef2ff;      /* Indigo 50: Soft pill & chip background */
  --accent-glow:    rgba(79, 70, 229, 0.2);
  --accent2:        #0284c7;      /* Sky 600 */
  --accent2-glow:   rgba(2, 132, 199, 0.15);

  /* Status Colors */
  --success:        #059669;      /* Emerald 600 */
  --success-soft:   #ecfdf5;      /* Emerald 50 */
  --success-border: #a7f3d0;
  --warning:        #d97706;      /* Amber 600 */
  --warning-soft:   #fffbeb;
  --danger:         #dc2626;      /* Red 600 */
  --danger-soft:    #fef2f2;      /* Red 50 */
  --danger-border:  #fecaca;

  /* Typography Colors */
  --text-primary:   #0f172a;      /* Slate 900: High contrast, ultra crisp */
  --text-secondary: #475569;      /* Slate 600 */
  --text-muted:     #94a3b8;      /* Slate 400 */

  /* Borders & Dividers */
  --border:         #e2e8f0;      /* Slate 200: Crisp modern light border */
  --border-light:   #f1f5f9;      /* Slate 100 */
  --border-focus:   #6366f1;

  /* Border Radii */
  --radius-xs:      6px;
  --radius-sm:      10px;
  --radius-md:      14px;
  --radius-lg:      18px;
  --radius-xl:      24px;

  /* Elevation Shadows */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md:      0 4px 16px -2px rgba(15,23,42,0.06), 0 2px 6px -1px rgba(15,23,42,0.03);
  --shadow-lg:      0 12px 32px -4px rgba(15,23,42,0.08), 0 4px 12px -2px rgba(15,23,42,0.04);
  --shadow-glow:    0 0 24px var(--accent-glow);

  --scanner-h:      26vh;
  --data-h:         calc(100dvh - var(--scanner-h) - 56px);

  /* Safe Area Insets */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ─── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select { font-family: inherit; outline: none; }
.hidden { display: none !important; }

/* ─── Splash Screen ─────────────────────────────────────────────── */
#splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #ffffff;
  gap: 20px;
  transition: opacity 0.4s ease;
}
#splash-screen.fade-out { opacity: 0; pointer-events: none; }

.splash-logo {
  font-size: 56px;
  animation: float 2s ease-in-out infinite;
}
.splash-title {
  font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.splash-subtitle { color: var(--text-secondary); font-size: 14px; font-weight: 500; }

.splash-loader {
  width: 180px; height: 4px;
  background: #e2e8f0;
  border-radius: 99px; overflow: hidden;
  margin-top: 8px;
}
.splash-loader-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  animation: loadBar 1.2s ease forwards;
}

.splash-error { text-align: center; padding: 32px; background: #ffffff; border-radius: var(--radius-lg); }
.splash-error h2 { font-size: 20px; margin-bottom: 8px; color: var(--danger); font-weight: 700; }
.splash-error p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }
.splash-error button {
  background: var(--accent); color: white;
  padding: 10px 24px; border-radius: var(--radius-md);
  font-weight: 600; box-shadow: 0 4px 12px var(--accent-glow);
}

/* ─── App Shell (CSS Grid) ──────────────────────────────────────── */
#app {
  display: grid;
  grid-template-rows: 56px 26vh 1fr;
  grid-template-columns: 1fr;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background: #ffffff;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  box-shadow: 0 20px 40px -15px rgba(0,0,0,0.07);
  padding-bottom: var(--safe-bottom);
  overflow: hidden;
}
@media (min-height: 700px) {
  #app { grid-template-rows: 56px 28vh 1fr; }
}
@media (min-height: 900px) {
  #app { grid-template-rows: 56px 30vh 1fr; }
}

/* ─── Header ────────────────────────────────────────────────────── */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
  grid-row: 1;
  grid-column: 1;
}

.header-brand {
  display: flex; align-items: center; gap: 8px;
}
.header-brand .brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.header-brand .brand-name {
  font-size: 16px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Mode Switcher */
.mode-switcher {
  display: flex;
  background: #f1f5f9;
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
}
.mode-btn {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.01em;
}
.mode-btn.active {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.header-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: #ffffff;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 15px;
  transition: all 0.2s;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: #cbd5e1;
}

/* ─── Scanner Panel ─────────────────────────────────────────────── */
.scanner-panel {
  background: #090d16;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  grid-row: 2;
  grid-column: 1;
}

#scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#scanner-reader {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  padding: 0 !important;
  background: #090d16 !important;
  position: relative;
}

#scanner-reader__scan_region {
  width: 100% !important;
  height: 100% !important;
  min-height: unset !important;
  background: transparent !important;
}

#scanner-reader video,
#scanner-reader__scan_region video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

#scanner-reader__dashboard_section,
#scanner-reader__dashboard_section_csr,
#scanner-reader__dashboard_section_fsr,
#scanner-reader__dashboard,
#scanner-reader__header_message,
#scanner-reader__status_span,
#scanner-reader__filescan_input,
#scanner-reader__camera_selection,
#scanner-reader__torch_button,
div[id$="__header_message"],
div[id$="__dashboard_section"],
#scanner-reader img {
  display: none !important;
}

#qr-shaded-region {
  border-color: rgba(99, 102, 241, 0.4) !important;
  border-width: 2px !important;
}

#scan-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
}
#scan-overlay.flash { animation: scanFlash 0.3s ease; }

.scan-frame {
  position: relative;
  width: 190px; height: 95px;
}
.scan-corner {
  position: absolute;
  width: 20px; height: 20px;
  border-color: #38bdf8;
  border-style: solid;
  border-width: 0;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.6));
}
.scan-corner.tl { top: 0; left: 0;  border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 6px; }
.scan-corner.tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 6px; }
.scan-corner.bl { bottom: 0; left: 0;  border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 6px; }
.scan-corner.br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 6px; }

.scan-line {
  position: absolute;
  left: 4px; right: 4px; height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #818cf8, transparent);
  border-radius: 1px;
  animation: scanLine 1.8s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

.focus-ring {
  position: absolute;
  width: 50px;
  height: 50px;
  margin-left: -25px;
  margin-top: -25px;
  border: 2px solid #38bdf8;
  border-radius: 50%;
  pointer-events: none;
  z-index: 15;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
  animation: focusRingPulse 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scanner status bar */
.scanner-statusbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(9, 13, 22, 0.9) 0%, rgba(9, 13, 22, 0.6) 60%, transparent 100%);
  padding: 8px 12px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 10;
}
.scanner-status-left { display: flex; align-items: center; gap: 6px; }
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  transition: all 0.3s;
}
.dot.active {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  animation: dotPulse 1.5s ease-in-out infinite;
}
#scanner-status { font-size: 11px; font-weight: 600; color: #cbd5e1; white-space: nowrap; }

.scanner-actions { display: flex; gap: 5px; overflow-x: auto; }
.scanner-action-btn {
  padding: 5px 9px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-xs);
  color: #ffffff;
  font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.scanner-action-btn:hover { background: rgba(255,255,255,0.25); }
.scanner-action-btn:active { transform: scale(0.95); }
.scanner-action-btn.active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
}

#scan-feedback {
  position: absolute;
  top: 8px; left: 50%; transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: 99px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
#scan-feedback.visible { opacity: 1; }

/* ─── Data Panel (Dominan Putih) ────────────────────────────────── */
.data-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  grid-row: 3;
  grid-column: 1;
  min-height: 0;
  background: #ffffff;
}

/* ─── Price Check Panel (DEFAULT ACTIVE) ────────────────────────── */
#panel-pricecheck {
  display: flex; flex-direction: column;
  height: 100%;
  background: #ffffff;
}

.price-panel-title {
  font-size: 12px; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.08em;
}

#price-idle {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex: 1; gap: 12px;
  padding: 24px;
  color: var(--text-muted);
}
.price-idle-icon {
  font-size: 48px;
  opacity: 0.8;
  animation: float 2.5s ease-in-out infinite;
}
.price-idle-text { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.price-idle-hint { font-size: 13px; color: var(--text-secondary); text-align: center; line-height: 1.5; max-width: 260px; }

#price-result {
  flex: 1; display: flex; flex-direction: column; gap: 12px;
}

.price-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.price-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
}

.price-card-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 6px;
}
.price-product-name {
  font-size: 20px; font-weight: 800;
  color: var(--text-primary); line-height: 1.3;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.price-product-meta {
  display: flex; gap: 8px; align-items: center;
  font-size: 12px; color: var(--text-secondary); margin-bottom: 16px;
}
.price-category-badge {
  background: var(--accent-soft);
  color: var(--accent-light);
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  border: 1px solid rgba(79, 70, 229, 0.15);
}
.price-big {
  font-size: 38px; font-weight: 900;
  color: var(--success);
  letter-spacing: -0.03em;
  line-height: 1;
}

.price-add-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: var(--radius-md);
  color: #ffffff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px var(--accent-glow);
}
.price-add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.price-add-btn:active { transform: scale(0.98); }

/* ─── Transaction Panel ─────────────────────────────────────────── */
#panel-transaction {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
}

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px;
  flex-shrink: 0;
}
.cart-title-row {
  display: flex; align-items: center; gap: 8px;
}
.cart-title { font-size: 14px; font-weight: 800; color: var(--text-primary); }
.cart-badge {
  background: var(--accent); color: white;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
  min-width: 20px; text-align: center;
}
.cart-actions { display: flex; gap: 6px; }
.cart-action-btn {
  padding: 6px 11px; border-radius: var(--radius-xs);
  font-size: 11px; font-weight: 600;
  background: #f8fafc;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 4px;
  transition: all 0.2s;
}
.cart-action-btn:hover {
  color: var(--text-primary);
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.cart-items-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.cart-items-scroll::-webkit-scrollbar { width: 4px; }
.cart-items-scroll::-webkit-scrollbar-track { background: transparent; }
.cart-items-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.cart-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; padding: 32px 16px;
  color: var(--text-muted);
}
.cart-empty-icon { font-size: 40px; opacity: 0.7; }
.cart-empty-text { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.cart-empty-hint { font-size: 12px; color: var(--text-secondary); text-align: center; line-height: 1.5; }

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 8px;
  padding: 11px 13px;
  background: #ffffff;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  animation: slideIn 0.2s ease;
  transition: all 0.15s;
}
.cart-item:hover {
  border-color: #cbd5e1;
  background: #fafafa;
}

.cart-item-info {
  display: flex; flex-direction: column; gap: 2px;
  grid-column: 1;
}
.cart-item-name { font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.cart-item-price { font-size: 12px; color: var(--text-secondary); }

.cart-item-controls {
  display: flex; align-items: center; gap: 6px;
  grid-column: 2; grid-row: 1;
  align-self: center;
}
.qty-btn {
  width: 26px; height: 26px;
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  font-size: 14px;
}
.qty-btn.minus {
  background: var(--accent-soft);
  color: var(--accent-light);
}
.qty-btn.minus:hover { background: #e0e7ff; }
.qty-btn.plus {
  background: var(--accent-soft);
  color: var(--accent-light);
}
.qty-btn.plus:hover { background: #e0e7ff; }
.qty-value {
  font-size: 14px; font-weight: 700;
  min-width: 22px; text-align: center;
  color: var(--text-primary);
}
.delete-btn {
  width: 26px; height: 26px;
  border-radius: var(--radius-xs);
  background: var(--danger-soft);
  color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  margin-left: 2px;
}
.delete-btn:hover { background: #fee2e2; }

.cart-item-subtotal {
  font-size: 13px; font-weight: 700;
  color: var(--accent-light);
  grid-column: 1; grid-row: 2;
}

/* Cart Footer */
.cart-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.03);
}
.cart-total-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}
.cart-total-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.cart-total-amount {
  font-size: 24px; font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.btn-checkout {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: var(--radius-md);
  color: white;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 16px var(--accent-glow);
  letter-spacing: 0.01em;
}
.btn-checkout:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-checkout:disabled {
  opacity: 0.4; cursor: not-allowed;
  box-shadow: none;
}

/* ─── MODALS (Dominan Putih) ─────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-end;
  padding: 0;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  width: 100%; max-width: 480px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 8px 20px 32px;
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.modal-handle {
  width: 36px; height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
  margin: 12px auto 18px;
}

.modal-title {
  font-size: 18px; font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.modal-subtitle {
  font-size: 13px; color: var(--text-secondary);
  margin-bottom: 18px;
}

.modal-barcode-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.2);
  color: var(--accent-light);
  padding: 5px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 700;
  margin-bottom: 18px;
}

.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--text-secondary); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.form-input, .form-select {
  width: 100%; padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.form-input:focus, .form-select:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-select option { background: #ffffff; color: var(--text-primary); }

.form-input-prefix { position: relative; }
.form-input-prefix .prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 14px; font-weight: 700; color: var(--text-secondary);
}
.form-input-prefix .form-input { padding-left: 40px; }

.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.btn-primary {
  flex: 1; padding: 13px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: var(--radius-md);
  color: white; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  padding: 13px 18px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 14px; font-weight: 600;
  transition: all 0.2s;
}
.btn-secondary:hover { color: var(--text-primary); background: #e2e8f0; }

/* Payment Modal */
.payment-summary {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 4px;
}
.payment-summary-row {
  display: flex; justify-content: space-between; align-items: center;
}
.payment-summary-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.payment-summary-total {
  font-size: 22px; font-weight: 900;
  color: var(--text-primary);
}

.quick-nominal-wrap {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-top: 8px;
}
.quick-nominal-btn {
  padding: 6px 13px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-secondary);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}
.quick-nominal-btn:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}
.quick-nominal-btn.selected {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.kembalian-box {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 12px;
  min-height: 54px;
  transition: all 0.3s ease;
}
.kembalian-box.insufficient {
  background: var(--danger-soft);
  border-color: var(--danger-border);
}
.kembalian-label {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-secondary);
}
.kembalian-amount {
  font-size: 22px; font-weight: 900;
  color: var(--success);
  transition: all 0.3s;
}
.kembalian-amount.insufficient {
  color: var(--danger);
}

/* Receipt Modal */
.receipt-header {
  text-align: center; padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 16px;
}
.receipt-icon { font-size: 36px; margin-bottom: 8px; }
.receipt-items { max-height: 200px; overflow-y: auto; margin-bottom: 16px; }
.receipt-item {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 4px 12px; align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.receipt-item:last-child { border-bottom: none; }
.receipt-item-name { font-weight: 600; color: var(--text-primary); }
.receipt-item-detail { color: var(--text-secondary); font-size: 12px; }
.receipt-item-subtotal { font-weight: 700; color: var(--accent-light); }

.receipt-total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 0;
  border-top: 2px solid var(--border);
}
.receipt-total-label { font-size: 14px; font-weight: 700; color: var(--text-secondary); }
.receipt-total-amount {
  font-size: 24px; font-weight: 900;
  color: var(--text-primary);
}

.receipt-change-row {
  display: flex; justify-content: space-between;
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-top: 8px;
  gap: 12px;
}
.receipt-change-item { display: flex; flex-direction: column; gap: 2px; }
.receipt-change-item:last-child { align-items: flex-end; }
.receipt-change-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-secondary);
}
.receipt-change-value {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
}
.receipt-change-highlight {
  font-size: 18px; font-weight: 900;
  color: var(--success);
}

/* Catalog Modal */
.catalog-search-wrap {
  margin-bottom: 14px; position: relative;
}
.catalog-search-wrap .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--text-muted);
}
#catalog-search {
  width: 100%; padding: 11px 14px 11px 36px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary); font-size: 14px;
}
#catalog-search:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#catalog-list {
  max-height: 300px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
#catalog-list::-webkit-scrollbar { width: 4px; }
#catalog-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.catalog-empty { text-align: center; padding: 24px; color: var(--text-muted); font-size: 14px; }
.catalog-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: var(--radius-md);
  cursor: pointer; transition: all 0.15s;
  border: 1px solid transparent;
  margin-bottom: 4px;
  background: #ffffff;
}
.catalog-item:hover {
  background: #f8fafc;
  border-color: var(--border);
}
.catalog-item-main { display: flex; flex-direction: column; gap: 2px; }
.catalog-item-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.catalog-item-category { font-size: 11px; color: var(--text-secondary); }
.catalog-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.catalog-item-price { font-size: 13px; font-weight: 700; color: var(--accent-light); }
.catalog-item-barcode { font-size: 10px; color: var(--text-muted); font-family: monospace; }

/* ─── Toast Notifications ────────────────────────────────────────── */
#toast-container {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  z-index: 9000;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: min(92%, 460px);
}

.toast {
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 13px; font-weight: 700;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-10px);
  transition: all 0.3s ease;
  border: 1px solid transparent;
  pointer-events: auto;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.toast-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.toast-info    { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }

/* ─── Animations ─────────────────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
@keyframes loadBar {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes scanLine {
  0%, 100% { top: 4px; opacity: 1; }
  50%       { top: calc(100% - 6px); opacity: 0.7; }
}
@keyframes scanFlash {
  0%   { background: rgba(56, 189, 248, 0); }
  30%  { background: rgba(56, 189, 248, 0.3); }
  100% { background: rgba(56, 189, 248, 0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1; transform: scale(1.04); }
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Permission Screen ─────────────────────────────────────────── */
.permission-screen {
  position: absolute; inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.permission-content {
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  text-align: center; max-width: 260px;
}
.permission-icon { font-size: 40px; animation: float 2s ease-in-out infinite; }
.permission-title { font-size: 15px; font-weight: 700; color: #ffffff; }
.permission-hint { font-size: 12px; color: #cbd5e1; line-height: 1.5; }

.btn-grant-camera {
  margin-top: 4px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: var(--radius-md);
  color: white; font-size: 14px; font-weight: 700;
  border: none; cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-glow);
  transition: all 0.2s;
  width: 100%;
}
.btn-grant-camera:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 24px var(--accent-glow); }
.btn-grant-camera:disabled { opacity: 0.6; cursor: not-allowed; }

.permission-denied-hint {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 11px; color: #fca5a5;
  line-height: 1.5; margin-top: 4px;
}
