/* ================================================================
   ALWIS — Kasir & Stok · style.css
   Modern Retail POS · Tema Merah (Red Theme) · Vanilla CSS
   ================================================================ */

:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --border-focus: #DC2626;
  --text: #0F172A;
  --text-2: #64748B;
  --text-3: #94A3B8;

  /* Red Theme */
  --primary: #DC2626;
  --primary-hover: #B91C1C;
  --primary-light: #FEF2F2;
  --primary-ring: rgba(220, 38, 38, 0.16);

  --dark: #0F172A;
  --success: #059669;
  --success-light: #ECFDF5;
  --warning: #D97706;
  --warning-light: #FFFBEB;
  --danger: #DC2626;
  --danger-light: #FEF2F2;

  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, .16);
  --nav-h: 68px;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-num: 'Outfit', 'Plus Jakarta Sans', sans-serif;
}

/* ============ DARK THEME ============ */
[data-theme="dark"] {
  --bg: #0B1120;
  --surface: #1E293B;
  --surface-2: #0F172A;
  --border: #334155;
  --border-focus: #EF4444;
  --text: #F8FAFC;
  --text-2: #94A3B8;
  --text-3: #64748B;

  --primary-light: rgba(220, 38, 38, 0.2);
  --success-light: rgba(5, 150, 105, 0.22);
  --warning-light: rgba(217, 119, 6, 0.22);
  --danger-light: rgba(220, 38, 38, 0.22);

  --dark: #020617;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .7);
}

[data-theme="dark"] .app-header {
  background: rgba(30, 41, 59, 0.95);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .bottom-nav {
  background: rgba(30, 41, 59, 0.96);
  border-top-color: var(--border);
}

[data-theme="dark"] .login-screen {
  background: linear-gradient(135deg, #1E1B4B 0%, #0F172A 50%, #1E293B 100%);
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
}

[data-theme="dark"] .modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
}

[data-theme="dark"] .bar-zero {
  background: var(--surface-2);
}

[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .search-box,
[data-theme="dark"] .cat-add-box input,
[data-theme="dark"] .report-filters input[type="date"],
[data-theme="dark"] .report-filters select {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}
[data-theme="dark"] .btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

[data-theme="dark"] .chip {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}
[data-theme="dark"] .chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

[data-theme="dark"] .quick-cash button {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .tf-details {
  background: var(--surface-2);
  border-color: var(--border);
}

[data-theme="dark"] .receipt-paper {
  background: #ffffff;
  color: #0f172a;
}
[data-theme="dark"] .receipt-paper .r-store,
[data-theme="dark"] .receipt-paper .r-row.big {
  color: #0f172a;
}
[data-theme="dark"] .receipt-paper .r-address,
[data-theme="dark"] .receipt-paper .r-sub-line,
[data-theme="dark"] .receipt-paper .r-sub,
[data-theme="dark"] .receipt-paper .r-meta,
[data-theme="dark"] .receipt-paper .r-thanks {
  color: #475569;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  min-height: 100vh;
  transition: background .2s, color .2s;
}

/* No bottom nav padding for kasir & stok roles */
body.role-kasir,
body.role-stok {
  padding-bottom: 0;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }
b, strong { font-variant-numeric: tabular-nums; }

/* ============ LOGIN SCREEN ============ */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FEF2F2 0%, #F8FAFC 50%, #EFF6FF 100%);
  padding: 16px;
  overflow-y: auto;
}
.login-screen.hidden { display: none; }

.login-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 34px 28px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: popIn .3s cubic-bezier(.2, .9, .3, 1.2);
}

.login-logo {
  width: 68px; height: 68px; border-radius: 18px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(220, 38, 38, .3);
  overflow: hidden;
}

.login-title {
  font-family: var(--font-num);
  font-size: 32px; font-weight: 800;
  letter-spacing: -1px; margin-bottom: 2px;
  color: var(--text);
}

.login-subtitle {
  color: var(--text-3); font-weight: 600;
  font-size: 13.5px; margin-bottom: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.captcha-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.captcha-row input {
  flex: 1;
}
.captcha-question {
  color: var(--primary);
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 800;
}

.login-hint {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 10px;
  text-align: center;
}
.login-hint code {
  background: var(--surface-2);
  padding: 2px 5px;
  border-radius: 5px;
  font-weight: 700;
  color: var(--primary);
}

/* ============ HEADER ============ */
.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 0; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-num); font-size: 22px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(220, 38, 38, .32);
  overflow: hidden; flex-shrink: 0;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-text h1 { font-family: var(--font-num); font-size: 20px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; white-space: nowrap; }
.brand-text h1 span { color: var(--primary); }
.brand-text p { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--primary); white-space: nowrap; }

.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Theme toggle button in header */
.theme-toggle-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border);
  transition: all .15s;
}
.theme-toggle-btn:hover {
  background: var(--primary-light); color: var(--primary); border-color: var(--primary);
}
.theme-toggle-btn svg { width: 18px; height: 18px; }

/* ============ BUTTONS ============ */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  border: 1px solid var(--border); background: var(--surface);
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn-ghost svg { width: 15px; height: 15px; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost:active { transform: scale(.97); }
.btn-ghost.danger:hover { background: var(--danger-light); color: var(--danger); border-color: #fecaca; }
.btn-ghost.btn-sm { padding: 6px 12px; font-size: 12px; cursor: pointer; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px;
  background: var(--primary); color: #fff;
  font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(220, 38, 38, .3);
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn-primary svg { width: 18px; height: 18px; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px;
  background: var(--surface-2); color: var(--text);
  font-size: 15px; font-weight: 700; border: 1px solid var(--border);
  transition: background .15s, transform .1s;
}
.btn-secondary svg { width: 17px; height: 17px; }
.btn-secondary:hover { background: var(--border); }
.btn-secondary:active { transform: scale(.98); }

.btn-danger {
  padding: 12px 20px; border-radius: 12px;
  background: var(--danger); color: #fff; font-size: 15px; font-weight: 700;
  transition: background .15s, transform .1s;
}
.btn-danger:hover { background: #b91c1c; }
.btn-danger:active { transform: scale(.98); }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 16px; color: var(--text-3); background: var(--surface-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--border); color: var(--text); }
.icon-btn.del:hover { background: var(--danger-light); color: var(--danger); }

/* ============ LAYOUT ============ */
main { max-width: 1280px; margin: 0 auto; padding: 18px; }
.screen { display: none; animation: fadeIn .18s ease-out; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Extra bottom spacing on mobile kasir so mobile-cart-bar doesn't cover lowest items */
@media (max-width: 959px) {
  body.role-kasir #screen-kasir .kasir-left {
    padding-bottom: 100px;
  }
}

/* ============ SEARCH & CHIPS ============ */
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 0 14px; height: 46px;
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-ring); }
.search-box svg { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
.search-box input { flex: 1; border: none; outline: none; background: none; font-size: 15px; color: var(--text); height: 100%; }
.search-box input::placeholder { color: var(--text-3); }

.chips-wrap { position: relative; }
.chips { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 14px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: all .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--dark); border-color: var(--dark); color: #fff; }

/* ============ KASIR PRODUCT GRID ============ */
.product-grid {
  display: grid; gap: 12px; padding: 12px 0 8px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.product-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .1s;
  cursor: pointer; user-select: none; text-align: left; width: 100%;
}
.product-card:hover { border-color: #f87171; box-shadow: var(--shadow-md); }
.product-card:active { transform: scale(.97); }
.product-card.out { opacity: .55; cursor: not-allowed; }

/* Product Image: Square 1:1 */
.pc-img-square {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
}
.pc-img-square img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.pc-avatar-letter {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: var(--font-num); font-size: 36px; font-weight: 800;
}

/* Hover-only add to cart overlay */
.pc-hover-add {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(220, 38, 38, .75);
  color: #fff; font-size: 32px; font-weight: 700;
  border-radius: 10px;
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
@media (hover: hover) {
  .product-card:not(.out):hover .pc-hover-add { opacity: 1; }
}
.product-card.out .pc-hover-add { display: none; }

.pc-name { font-size: 14px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pc-price { font-family: var(--font-num); font-size: 15px; font-weight: 700; }

/* Stock number in product card foot */
.pc-stock-num {
  font-family: var(--font-num); font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
}
.pc-stock-num.stock-ok { background: var(--success-light); color: var(--success); }
.pc-stock-num.stock-low { background: var(--warning-light); color: var(--warning); }
.pc-stock-num.stock-out { background: var(--danger-light); color: var(--danger); }

.empty-note { text-align: center; color: var(--text-3); padding: 40px 0; font-weight: 600; }

.stock-ok { background: var(--success-light); color: var(--success); }
.stock-low { background: var(--warning-light); color: var(--warning); }
.stock-out { background: var(--danger-light); color: var(--danger); }

/* ============ CART PANEL ============ */
.cart-panel {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column;
  position: sticky; top: 80px; max-height: calc(100vh - 160px);
}
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cart-head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; }
.cart-head h2 svg { width: 18px; height: 18px; color: var(--primary); }
.cart-head-actions { display: flex; align-items: center; gap: 8px; }

/* Minimize button (mobile) */
.btn-minimize-cart {
  display: none;
  background: var(--surface-2); color: var(--text-2);
}
.btn-minimize-cart:hover { background: var(--primary-light); color: var(--primary); }

.cart-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-num); font-size: 12px; font-weight: 800;
}
.cart-count.bump { animation: bump .35s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }

.cart-items { flex: 1; overflow-y: auto; padding: 6px 16px; min-height: 120px; }
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  animation: fadeIn .18s ease-out;
}
.cart-item:last-child { border-bottom: none; }
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-price { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.qty-ctrl, .ci-qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 9px;
  padding: 3px 5px;
  flex-shrink: 0;
}
.qty-btn {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 15px; font-weight: 700; color: var(--text-2);
  display: grid; place-items: center; line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.qty-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.qty-val, .qty-num {
  min-width: 24px;
  text-align: center;
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.ci-total, .ci-subtotal {
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 700;
  min-width: 85px;
  text-align: right;
  flex-shrink: 0;
}
.ci-remove { width: 26px; height: 26px; border-radius: 7px; color: var(--text-3); display: grid; place-items: center; font-size: 14px; }
.ci-remove:hover { background: var(--danger-light); color: var(--danger); }

.cart-empty { text-align: center; color: var(--text-3); font-weight: 600; padding: 28px 16px; line-height: 1.6; }
.cart-summary { border-top: 1.5px solid var(--border); padding: 14px 16px; background: var(--surface); border-radius: 0 0 16px 16px; }
.sum-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-size: 13.5px; color: var(--text-2); }
.sum-row b { font-family: var(--font-num); font-size: 14px; color: var(--text); }
.sum-row.total { padding-top: 8px; font-size: 15px; font-weight: 700; color: var(--text); }
.sum-row.total b { font-size: 22px; font-weight: 800; color: var(--primary); }
.btn-pay { width: 100%; margin-top: 10px; padding: 14px; font-size: 16px; }

/* ============ MOBILE CART BAR (Hanya di Kasir) ============ */
.mobile-cart-bar {
  position: fixed; left: 16px; right: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 35; display: flex; align-items: center; gap: 12px;
  background: var(--dark); color: #fff;
  border-radius: 14px; padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 15px; font-weight: 700;
  animation: slideUp .25s ease-out;
}
.mobile-cart-bar:active { transform: scale(.98); }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.mcb-badge {
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: var(--primary); display: grid; place-items: center;
  font-family: var(--font-num); font-size: 13px;
}
.mcb-label { flex: 1; text-align: left; }
.mobile-cart-bar b { font-family: var(--font-num); font-size: 16px; }

/* Strictly hide mobile-cart-bar if not role-kasir */
body:not(.role-kasir) .mobile-cart-bar {
  display: none !important;
}
.modal-backdrop.open ~ .mobile-cart-bar,
.modal-backdrop.open .mobile-cart-bar {
  display: none !important;
}

/* ============ STOK & TOKO LIST ============ */
.page-wrap { max-width: 920px; margin: 0 auto; }
.stock-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm);
  min-width: 0;
}
.stat-card .v { font-family: var(--font-num); font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-card .l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-3); margin-top: 3px; }
.stat-card.warn .v { color: var(--warning); }
.stat-card.bad .v { color: var(--danger); }

.stock-toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.stock-toolbar .search-box { flex: 1; }
.stock-toolbar .btn-primary { flex-shrink: 0; }

.stock-list { display: flex; flex-direction: column; gap: 10px; }
.stock-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow-sm);
  transition: border-color .15s; animation: fadeIn .18s ease-out;
}
.stock-row:hover { border-color: #f87171; }
.stock-row.store-active-row { border-color: var(--primary); background: var(--primary-light); }

/* Bigger stock/store avatar */
.stock-avatar-lg {
  width: 72px; height: 72px; border-radius: 12px;
  object-fit: cover; flex-shrink: 0; background: var(--surface-2);
}
.stock-letter-lg {
  width: 72px; height: 72px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
  font-family: var(--font-num); font-size: 26px; font-weight: 800;
}

.sr-info { flex: 1; min-width: 0; }
.sr-name { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.sr-cat { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.sr-prices { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.sr-prices b { font-family: var(--font-num); color: var(--text); }

.sr-stock { text-align: center; min-width: 64px; }
.sr-stock .n { font-family: var(--font-num); font-size: 20px; font-weight: 800; line-height: 1.1; }
.sr-stock .badge { margin-top: 3px; display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.sr-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.sr-actions .icon-btn { border: 1px solid var(--border); }
.sr-actions .icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.sr-actions .icon-btn.del:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }

/* ============ LAPORAN (RESPONSIVE DENGAN RATUSAN JUTA) ============ */
.report-filters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.report-filters .field { min-width: 0; }
.report-filters .field label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; color: var(--text-2); margin-bottom: 5px;
}
.report-filters input[type="date"],
.report-filters select {
  width: 100%; height: 42px; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 0 12px; font-size: 14px; font-weight: 600; color: var(--text); background: var(--surface-2);
  outline: none; transition: border-color .15s;
}
.report-filters input[type="date"]:focus,
.report-filters select:focus { border-color: var(--primary); }

/* Grid metric-cards: 3 kolom di desktop, adaptif untuk puluhan & ratusan juta */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.metric-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  min-width: 0; /* Hindari overflow flex/grid */
}
.metric-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--primary); opacity: 0; transition: opacity .2s;
}
.metric-card:hover::before { opacity: 1; }
.metric-card .m-ico {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px;
}
.metric-card .m-ico svg { width: 19px; height: 19px; }

/* Nilai angka nominal: otomatis rapi jika puluhan/ratusan juta */
.metric-card .m-val {
  font-family: var(--font-num);
  font-size: clamp(15px, 2.1vw, 23px);
  font-weight: 800;
  letter-spacing: -.4px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-card .m-label {
  font-size: 11.5px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-2);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ico-red { background: var(--primary-light); color: var(--primary); }
.ico-green { background: var(--success-light); color: var(--success); }
.ico-blue { background: #EFF6FF; color: #2563EB; }
.ico-yellow { background: #FEF3C7; color: #D97706; }

.report-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.report-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.report-card-head h2 { font-size: 16px; font-weight: 800; }
.report-card-head .hint { font-size: 11.5px; color: var(--text-3); font-weight: 600; }

/* CSS bar chart with Red Theme */
.chart { display: flex; align-items: flex-end; gap: clamp(6px, 2vw, 14px); height: 170px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar {
  width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #f87171, var(--primary));
  min-height: 4px; position: relative;
  transition: filter .15s, transform .15s;
  animation: growBar .6s cubic-bezier(.2, .8, .3, 1) backwards;
}
.bar:hover { filter: brightness(1.1); transform: scaleY(1.02); transform-origin: bottom; }
.bar.peak { box-shadow: 0 4px 14px rgba(220, 38, 38, .4); }
@keyframes growBar { from { height: 0 !important; } }
.bar-zero { background: var(--surface-2); }
.chart-col .val { font-family: var(--font-num); font-size: 11px; font-weight: 800; color: var(--text-2); white-space: nowrap; }
.chart-col .day { font-size: 11px; font-weight: 700; color: var(--text-3); }
.chart-col.today .day { color: var(--primary); }

.report-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; }
.best-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.best-item:last-child { border-bottom: none; }
.best-rank {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary);
  display: grid; place-items: center; font-family: var(--font-num); font-size: 13px; font-weight: 800;
}
.best-item:first-child .best-rank { background: var(--primary); color: #fff; }
.best-info { flex: 1; min-width: 0; }
.best-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.best-sub { font-size: 12px; color: var(--text-2); }
.best-qty { font-family: var(--font-num); font-weight: 800; font-size: 14px; color: var(--primary); }

.history-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 12px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--surface); margin-bottom: 8px;
  transition: border-color .15s, background .15s; animation: fadeIn .18s ease-out;
}
.history-item:hover { border-color: #f87171; background: var(--primary-light); }
.hi-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--success-light); color: var(--success); display: grid; place-items: center; flex-shrink: 0; }
.hi-ico svg { width: 18px; height: 18px; }
.hi-info { flex: 1; min-width: 0; }
.hi-id { font-family: var(--font-num); font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.hi-method {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.hi-sub { font-size: 12px; color: var(--text-2); }
.hi-total { font-family: var(--font-num); font-size: 14.5px; font-weight: 800; }
.history-empty { text-align: center; color: var(--text-3); font-weight: 600; padding: 24px 0; }

/* ============ BOTTOM NAV (ADMIN) ============ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch; justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, .05);
}
/* Hide bottom nav for kasir & stok */
body.role-kasir .bottom-nav,
body.role-stok .bottom-nav { display: none !important; }

.nav-item {
  flex: 1; max-width: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; font-weight: 700; color: var(--text-3);
  border-radius: 12px; margin: 8px 4px;
  transition: color .15s, background .15s;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item:hover { color: var(--text-2); }
.nav-item.active { color: var(--primary); background: var(--primary-light); }

/* ============ MODALS ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 23, 42, .55); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop.open { display: flex; animation: fadeIn .15s ease-out; }
.modal-card {
  background: var(--surface); border-radius: 20px;
  width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  padding: 20px; box-shadow: var(--shadow-lg);
  animation: popIn .2s cubic-bezier(.2, .9, .3, 1.2);
}
.modal-card.small { max-width: 360px; }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { font-size: 18px; font-weight: 800; }
.modal-subtitle { font-size: 13px; color: var(--text-2); margin-top: -8px; margin-bottom: 14px; }

/* Payment Methods Selector (3 Kolom Tetap) */
.pay-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.pay-method-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  transition: all .15s;
}
.pay-method-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.pay-method-btn:hover { border-color: var(--primary); color: var(--primary); }
.pay-method-btn.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, .3);
}

.pay-total {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--dark); color: #fff;
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
}
.pay-total span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; }
.pay-total b { font-family: var(--font-num); font-size: 30px; font-weight: 800; letter-spacing: -.5px; }

.pay-form label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-2); margin-bottom: 6px; }
#cash-input {
  width: 100%; height: 52px; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 0 16px; font-family: var(--font-num); font-size: 22px; font-weight: 800; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
#cash-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-ring); }
.quick-cash { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 14px; }
.quick-cash button {
  flex: 1; min-width: calc(33% - 8px); padding: 10px 6px;
  border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface);
  font-family: var(--font-num); font-size: 13px; font-weight: 700; color: var(--text-2);
  transition: all .15s;
}
.quick-cash button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.quick-cash button:active { transform: scale(.96); }
.change-row {
  display: flex; justify-content: space-between; align-items: center;
  border-radius: 12px; padding: 13px 16px;
  background: var(--surface-2); font-weight: 700; font-size: 14px;
}
.change-row b { font-family: var(--font-num); font-size: 20px; font-weight: 800; }
.change-row.ok { background: var(--success-light); color: var(--success); }
.change-row.bad { background: var(--danger-light); color: var(--danger); }
.btn-confirm { width: 100%; margin-top: 16px; padding: 15px; font-size: 16px; }

/* QRIS view */
.qris-box {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--surface-2); border-radius: 14px; padding: 18px; border: 1.5px dashed var(--border);
}
.qris-qr-mock {
  width: 140px; height: 140px; border-radius: 12px; background: #fff;
  padding: 8px; box-shadow: var(--shadow-sm); margin-bottom: 12px;
}
.qr-svg { width: 100%; height: 100%; }
.qris-hint { font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 8px; }
.badge-auto-paid {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--success-light); color: var(--success);
}

/* Transfer view */
.transfer-box {
  background: var(--surface-2); border-radius: 14px; padding: 18px;
  text-align: center; border: 1.5px dashed var(--border);
}
.tf-icon { font-size: 32px; margin-bottom: 6px; }
.tf-title { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.tf-details {
  background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 12px;
  border: 1px solid var(--border);
}
.tf-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.tf-row b { font-family: var(--font-num); color: var(--primary); }

/* ============ PRODUCT & STORE FORM ============ */
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 5px; }
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field select {
  width: 100%; height: 46px; border: 1.5px solid var(--border); border-radius: 11px;
  padding: 0 14px; font-size: 15px; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s; background: var(--surface);
}
.field input:focus, .field select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-ring); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Image upload box & preview */
.img-upload-box {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border-radius: 12px; padding: 10px 14px;
  border: 1.5px dashed var(--border);
}
.img-preview {
  width: 72px; height: 72px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden; position: relative;
  flex-shrink: 0;
}
.img-preview.square { width: 64px; height: 64px; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder { font-size: 10px; font-weight: 600; color: var(--text-3); text-align: center; padding: 4px; }
.btn-remove-img {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px;
  border-radius: 999px; background: rgba(15, 23, 42, .75); color: #fff;
  display: grid; place-items: center; font-size: 10px; font-weight: 800;
}
.img-upload-ctrl { display: flex; flex-direction: column; gap: 4px; }
.img-hint { font-size: 11px; color: var(--text-3); }

/* Category List in Modal */
.cat-add-box { display: flex; gap: 8px; margin-bottom: 12px; }
.cat-add-box input {
  flex: 1; height: 42px; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 0 12px; font-size: 14px; outline: none; background: var(--surface-2);
}
.cat-add-box input:focus { border-color: var(--primary); }
.cat-add-box button { flex-shrink: 0; padding: 0 16px; height: 42px; font-size: 13.5px; }

.cat-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; padding: 2px; }
.cat-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); border-radius: 10px; padding: 10px 12px;
  border: 1px solid var(--border);
}
.cat-info { display: flex; flex-direction: column; }
.cat-info b { font-size: 14px; font-weight: 700; }
.cat-count { font-size: 11.5px; color: var(--text-2); }
.cat-actions { display: flex; gap: 6px; align-items: center; }
.settings-divider { height: 1px; background: var(--border); margin: 6px 0; }
.modal-foot-actions { margin-top: 16px; }

/* Adjust modal */
.adjust-info {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-2); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px;
  font-size: 14px;
}
.adjust-info b:first-child { font-size: 15px; }
.adjust-info span { color: var(--text-2); }
.adjust-info span b { color: var(--primary); font-family: var(--font-num); }
.adjust-controls { display: flex; gap: 8px; align-items: stretch; }
.adjust-controls input {
  flex: 1; min-width: 0; text-align: center;
  border: 1.5px solid var(--border); border-radius: 11px;
  font-family: var(--font-num); font-size: 20px; font-weight: 800; color: var(--text);
  outline: none; height: 50px; transition: border-color .15s;
}
.adjust-controls input:focus { border-color: var(--border-focus); }
.qty-btn.big {
  width: 54px; height: 50px; border-radius: 11px; flex-shrink: 0;
  background: var(--surface); border: 1.5px solid var(--border);
  font-family: var(--font-num); font-size: 14px; font-weight: 800; color: var(--text-2);
  transition: all .15s;
}
.qty-btn.big:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.qty-btn.big:active { transform: scale(.94); }

/* Confirm modal */
.confirm-msg { color: var(--text-2); font-size: 14px; margin-bottom: 18px; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions button { flex: 1; }

/* ============ PENGATURAN APLIKASI (ADMIN) ============ */
.settings-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}
.settings-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.settings-sub { font-size: 13px; color: var(--text-2); margin-top: 3px; }

.settings-form-grid { display: flex; flex-direction: column; gap: 16px; }

.color-picker-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.color-picker-box input[type="color"] {
  width: 48px;
  height: 44px;
  padding: 2px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: var(--surface-2);
}
.color-picker-box input[type="text"] {
  flex: 1;
  height: 44px;
  font-family: var(--font-num);
  font-weight: 700;
  text-transform: uppercase;
}

.color-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.color-preset {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  transition: transform .15s, box-shadow .15s;
}
.color-preset:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--primary);
}

.settings-preview-card {
  background: var(--surface-2);
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.sp-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  overflow: hidden;
}
.sp-logo img { width: 100%; height: 100%; object-fit: cover; }
.sp-title { font-size: 20px; font-weight: 800; }
.sp-sub { font-size: 13px; color: var(--text-2); }
.sp-btn {
  margin-top: 6px;
  padding: 8px 18px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ============ RECEIPT ============ */
.modal-card.receipt { max-width: 360px; padding: 16px; }
.receipt-paper {
  background: #fff; border: 1.5px dashed var(--border);
  border-radius: 12px; padding: 18px 16px;
  font-family: var(--font-num); font-size: 13px; color: #0f172a;
}
.r-center { text-align: center; }
.r-store { font-size: 20px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #0f172a; }
.r-address { font-size: 12px; color: #475569; margin-top: 3px; font-weight: 600; line-height: 1.35; }
.r-sub-line { font-size: 11px; color: #475569; margin-top: 3px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-sub { font-size: 11px; color: #475569; margin-top: 2px; }
.r-div { border-top: 1.5px dashed #cbd5e1; margin: 10px 0; }
.r-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: #475569; }
.r-item { display: flex; gap: 8px; padding: 2px 0; }
.r-item .nm { flex: 1; }
.r-item .pr { text-align: right; font-variant-numeric: tabular-nums; }
.r-item .qt { color: #64748b; font-size: 12px; }
.r-row { display: flex; justify-content: space-between; padding: 2px 0; font-variant-numeric: tabular-nums; }
.r-row.big { font-size: 16px; font-weight: 800; padding-top: 4px; color: #0f172a; }
.r-thanks { text-align: center; font-size: 11.5px; color: #64748b; margin-top: 4px; }
.receipt-actions { display: flex; gap: 10px; margin-top: 14px; }
.receipt-actions button { flex: 1; padding: 13px; font-size: 14px; }

/* ============ TOAST ============ */
.toast-root {
  position: fixed; top: 16px; right: 16px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--dark); color: #fff;
  border-radius: 12px; padding: 12px 18px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn .22s ease-out;
}
.toast.out { animation: toastOut .2s ease-in forwards; }
.toast .dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; }
.toast.success .dot { background: #34d399; }
.toast.warn .dot { background: #fbbf24; }
.toast.error .dot { background: #f87171; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

/* ============ RESPONSIVE ============ */
@media (min-width: 960px) {
  #screen-kasir.active { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
  .mobile-cart-bar { display: none !important; }
}
@media (min-width: 760px) {
  .report-grid { grid-template-columns: 1fr 1.4fr; }
}
@media (max-width: 850px) {
  .metric-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 759px) {
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 959px) {
  .cart-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 45;
    max-height: 82vh; border-radius: 20px 20px 0 0;
    transform: translateY(105%); transition: transform .28s cubic-bezier(.3, .9, .3, 1);
    box-shadow: 0 -12px 40px rgba(15, 23, 42, .25);
  }
  .cart-panel.open { transform: translateY(0); }
  .btn-minimize-cart { display: grid !important; }

  .stock-summary { grid-template-columns: repeat(3, 1fr); }
  .stock-toolbar { flex-wrap: wrap; }
  .stock-toolbar .btn-primary { width: 100%; }
}
@media (max-width: 520px) {
  .metric-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .metric-card { padding: 12px 10px; }
  .metric-card .m-val { font-size: clamp(13px, 3.8vw, 17px); }
}
@media (max-width: 480px) {
  main { padding: 12px; }
  .header-right .btn-text { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .report-filters { gap: 8px; padding: 10px 12px; }
  .report-filters input[type="date"],
  .report-filters select { font-size: 13px; padding: 0 8px; height: 38px; }
  .stock-summary { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .sr-stock { min-width: 54px; }
  .sr-actions { flex-direction: column; }
  .quick-cash button { min-width: calc(50% - 8px); }
  .stock-avatar-lg, .stock-letter-lg { width: 56px; height: 56px; }
  .stock-letter-lg { font-size: 20px; }
}

/* ============ PRINT (STRUK) ============ */
@media print {
  body { background: #fff !important; padding: 0 !important; color: #000 !important; }
  .app-header, main, .bottom-nav, .toast-root, .modal-backdrop, .login-screen, .mobile-cart-bar { display: none !important; }
  .modal-backdrop#modal-receipt { display: flex !important; position: static; background: #fff; padding: 0; backdrop-filter: none; }
  .modal-card.receipt { box-shadow: none; border: none; max-width: 100%; padding: 0; background: #fff; }
  .receipt-paper { border: none; border-radius: 0; }
  .receipt-paper img {
    display: block !important;
    max-width: 140px !important;
    max-height: 140px !important;
    margin: 8px auto !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
  }
  .receipt-actions { display: none !important; }
}

/* ================================================================
   OFFLINE SYNC & PAYMENT PROOF STYLES
   ================================================================ */
.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}
.network-badge .net-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: background-color .2s;
}
.network-badge.online {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
  background: var(--success-light);
}
.network-badge.online .net-dot {
  background: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}
.network-badge.offline {
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.3);
  background: #fef3c7;
}
.network-badge.offline .net-dot {
  background: #d97706;
  box-shadow: 0 0 6px rgba(217, 119, 6, 0.6);
}
.network-badge .sync-count {
  background: #d97706;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 2px;
}

/* Payment Proof Button & Preview */
.proof-upload-section {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}
.btn-proof-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 11px;
  border: 1.5px dashed var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.btn-proof-trigger:hover {
  background: var(--primary);
  color: #fff;
}
.btn-proof-trigger svg {
  flex-shrink: 0;
}

.pay-proof-box {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.pay-proof-thumb-wrap {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.pay-proof-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pay-proof-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pay-proof-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
}
.pay-proof-actions {
  display: flex;
  gap: 6px;
}
.btn-xs {
  padding: 4px 8px !important;
  font-size: 11px !important;
  height: auto !important;
  min-height: auto !important;
}

/* Proof in Report / History List */
.hi-proof-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-ring);
  cursor: pointer;
  transition: all .15s;
  margin-left: 6px;
  vertical-align: middle;
}
.hi-proof-badge:hover {
  background: var(--primary);
  color: #fff;
}
.hi-proof-thumb-mini {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  vertical-align: middle;
}

/* Modal Proof View */
.proof-view-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.proof-img-frame {
  width: 100%;
  max-height: 52vh;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.proof-img-frame img {
  max-width: 100%;
  max-height: 52vh;
  object-fit: contain;
}
.proof-view-meta {
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.proof-view-meta b {
  color: var(--text);
}
