/* ==========================================================================
   BEPI — Design System
   Dipakai bersama oleh halaman publik & panel admin.
   Prinsip: target sentuh besar, kontras cukup, konsisten, nyaman di HP.
   ========================================================================== */

:root {
  /* Warna brand */
  --bepi-orange: #f2994a;
  --bepi-orange-dark: #d97b1f;
  --bepi-orange-soft: #fdf0e0;
  --bepi-cream: #fdf6ec;
  --bepi-brown: #4a3222;
  --bepi-green: #4f7a33;
  --bepi-green-soft: #e6f4df;
  --bepi-red: #b3372a;
  --bepi-red-soft: #fbe0e0;
  --bepi-blue: #2f6fd6;
  --bepi-blue-soft: #e3edfb;

  /* Teks — muted dinaikkan kontrasnya agar nyaman dibaca */
  --text: #4a3222;
  --text-muted: #7a6753;
  --text-faint: #9a8570;

  /* Garis & permukaan */
  --line: #ece0d0;
  --line-strong: #ddcdb6;
  --surface: #ffffff;

  /* Bentuk & bayangan */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(74, 50, 34, .07);
  --shadow: 0 4px 14px rgba(74, 50, 34, .08);
  --shadow-lg: 0 8px 30px rgba(74, 50, 34, .14);

  /* Target sentuh */
  --tap: 42px;
  --tap-sm: 36px;

  --focus-ring: 0 0 0 3px rgba(242, 153, 74, .38);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bepi-cream);
  color: var(--text);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

/* Fokus keyboard terlihat jelas di seluruh aplikasi */
:focus-visible {
  outline: 2px solid var(--bepi-orange-dark);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   HALAMAN PUBLIK
   ========================================================================== */

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}

.navbar .logo {
  font-size: 26px;
  font-weight: 800;
  color: var(--bepi-orange);
  text-decoration: none;
  letter-spacing: 1px;
}

.navbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.navbar nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.navbar nav a:hover { background: var(--bepi-cream); color: var(--bepi-orange-dark); }

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 56px 24px;
  background: linear-gradient(135deg, var(--bepi-orange) 0%, #f7b267 100%);
  color: #fff;
  flex-wrap: wrap;
}

.hero-text h1 { font-size: clamp(32px, 6vw, 44px); margin: 0 0 12px; }
.hero-text p { font-size: 17px; max-width: 480px; line-height: 1.65; }

.hero-badge {
  background: #fff;
  color: var(--bepi-orange-dark);
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 16px;
}

section {
  padding: 48px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

section h2 {
  font-size: clamp(24px, 4vw, 30px);
  text-align: center;
  margin-bottom: 8px;
  color: var(--bepi-orange-dark);
}

section .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 32px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.product-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.product-card .product-photo {
  width: 96px; height: 96px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: block;
}

.product-card .icon {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--bepi-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 22px;
}

.product-card h3 { margin: 0 0 4px; font-size: 18px; }
.product-card .variant { color: var(--text-muted); font-size: 14px; margin-bottom: 10px; }

.stock-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.stock-pill.in { background: var(--bepi-green-soft); color: var(--bepi-green); }
.stock-pill.low { background: #fbeccb; color: #8a6414; }
.stock-pill.out { background: var(--bepi-red-soft); color: var(--bepi-red); }

.about-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  line-height: 1.75;
}

footer {
  background: var(--bepi-brown);
  color: #f0e4d7;
  padding: 28px 24px;
  text-align: center;
  font-size: 14px;
}

footer a { color: var(--bepi-orange); text-decoration: none; }

/* ==========================================================================
   TOMBOL
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 10px 18px;
  background: var(--bepi-orange);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
  white-space: nowrap;
}

.btn:hover { background: var(--bepi-orange-dark); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn[disabled], .btn.is-disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Sekunder: aksi pendukung, tidak bersaing dengan aksi utama */
.btn.secondary {
  background: #fff;
  color: var(--bepi-orange-dark);
  border-color: var(--line-strong);
}
.btn.secondary:hover { background: var(--bepi-cream); border-color: var(--bepi-orange); }

/* Netral: aksi tenang seperti Reset */
.btn.neutral { background: #8a7460; }
.btn.neutral:hover { background: #6f5c4b; }

/* Info: aksi sekunder bernuansa biru (mis. Barcode) */
.btn.info { background: var(--bepi-blue); }
.btn.info:hover { background: #2559ad; }

/* Sukses: aksi positif (mis. Export) */
.btn.success { background: var(--bepi-green); }
.btn.success:hover { background: #3f6228; }

/* Destruktif: sengaja dibuat kalem agar tidak mendominasi,
   memerah hanya saat disentuh supaya tidak terklik asal. */
.btn.danger {
  background: #fff;
  color: var(--bepi-red);
  border-color: #e8bdb7;
}
.btn.danger:hover { background: var(--bepi-red); color: #fff; border-color: var(--bepi-red); }

.btn.full { width: 100%; }

.btn.small {
  min-height: var(--tap-sm);
  padding: 7px 12px;
  font-size: 13px;
}

/* ==========================================================================
   PANEL ADMIN — header & navigasi
   ========================================================================== */

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.admin-header .logo {
  color: var(--bepi-orange);
  font-weight: 800;
  font-size: 22px;
  text-decoration: none;
  letter-spacing: .5px;
}

.admin-header .user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.admin-tabs {
  display: flex;
  gap: 2px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  position: sticky;
  top: 0;
  z-index: 15;
}

.admin-tabs::-webkit-scrollbar { height: 4px; }
.admin-tabs::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

.admin-tabs a {
  display: inline-block;
  padding: 14px 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.admin-tabs a:hover { color: var(--bepi-orange-dark); background: var(--bepi-cream); }

.admin-tabs a.active {
  color: var(--bepi-orange-dark);
  border-bottom-color: var(--bepi-orange);
}

.admin-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

/* Judul halaman & keterangannya — menggantikan style inline */
.page-title {
  color: var(--bepi-orange-dark);
  font-size: 22px;
  margin: 32px 0 6px;
}
.page-title:first-child, .admin-wrap > .page-title:first-of-type { margin-top: 0; }

.page-hint {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 18px;
  max-width: 780px;
  line-height: 1.6;
}

.section-title {
  color: var(--bepi-orange-dark);
  font-size: 17px;
  margin: 0 0 10px;
}

/* ==========================================================================
   KARTU / PANEL & FORM
   ========================================================================== */

.add-form,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.add-form .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  align-items: end;
}

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field textarea { min-height: 96px; resize: vertical; }

.field input:hover,
.field select:hover { border-color: var(--bepi-orange); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--bepi-orange);
  box-shadow: var(--focus-ring);
}

.field input[type="file"] { padding: 8px; font-size: 13px; }
.field input[type="checkbox"] { min-height: 0; width: auto; }

/* Keterangan kecil di bawah input */
.field .hint,
.field-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.45;
}

/* Awalan Rp di depan input uang */
.money-input { position: relative; }
.money-input input { padding-left: 34px; }
.money-input::before {
  content: "Rp";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

/* Baris tombol di bawah form */
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}

/* Toolbar pencarian / filter */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.toolbar .field { margin-bottom: 0; }

/* Penanda field wajib */
.req { color: var(--bepi-red); font-weight: 800; }

/* Panel yang bisa dibuka-tutup — menyembunyikan form panjang agar
   daftar data tetap jadi fokus utama halaman. */
.collapse {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  overflow: hidden;
}

.collapse > summary {
  cursor: pointer;
  padding: 14px 20px;
  font-weight: 800;
  font-size: 15px;
  color: var(--bepi-orange-dark);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  user-select: none;
}

.collapse > summary::-webkit-details-marker { display: none; }
.collapse > summary:hover { background: var(--bepi-orange-soft); }
.collapse > summary:focus-visible { outline: none; box-shadow: var(--focus-ring) inset; }
.collapse[open] > summary { border-bottom: 1px solid var(--line); background: var(--bepi-cream); }

.collapse-body { padding: 20px; }

/* Warna teks utilitas */
.text-danger { color: var(--bepi-red); }
.text-warn { color: #8a6414; }
.text-muted { color: var(--text-muted); }

.hint-inline { font-weight: 400; font-size: 12px; color: var(--text-muted); }

/* Panel scan barcode — dibuat menonjol karena jadi jalan pintas input tercepat */
.scan-panel {
  border-color: var(--bepi-orange);
  background: linear-gradient(180deg, var(--bepi-orange-soft) 0%, #fff 70%);
}

.scan-feedback {
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
  font-weight: 600;
}

/* Baris transaksi yang sudah dibatalkan — diredupkan & dicoret */
tr.row-void td { opacity: .6; }
tr.row-void td:nth-child(2) { text-decoration: line-through; }

/* Halaman form yang lebih nyaman dibaca dengan lebar terbatas */
.admin-wrap.narrow { max-width: 860px; }

/* Keterangan kecil mandiri (di luar .field) */
.hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.45;
}

/* Label dengan checkbox sejajar */
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  min-height: var(--tap-sm);
}
.check-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--bepi-orange); }

/* Blok ganti foto produk */
.photo-edit {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.photo-preview {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.photo-preview.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bepi-cream);
  color: var(--bepi-orange);
  font-size: 34px;
  font-weight: 800;
}

.photo-edit-form { flex: 1; min-width: 220px; }

/* Kolom id batch & keterangan kadaluarsa di tabel batch */
.batch-id { font-weight: 800; color: var(--text-muted); white-space: nowrap; }
.batch-hint { font-size: 11.5px; display: block; margin-top: 4px; }

/* Zona aksi berbahaya di bagian bawah halaman */
.danger-zone {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}

/* Pratinjau logo di Pengaturan Tampilan */
.logo-preview { height: 44px; width: auto; }
.logo-preview-wrap { margin-top: 8px; }

/* Form ganti password inline di tabel akun */
.pw-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.pw-form input { min-width: 150px; }

/* Dropdown pemilih di halaman Lokasi & Stok */
.lookup-field { max-width: 420px; }

/* Identitas batch di kolom kadaluarsa — supaya jelas batch MANA yang kadaluarsa */
.batch-chip {
  display: inline-block;
  background: var(--bepi-brown);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  margin-right: 5px;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.batch-name {
  font-weight: 700;
  font-size: 13px;
}

.batch-date {
  display: block;
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.45;
}

/* Penanda batch yang harus dijual lebih dulu (FEFO) */
.fefo-flag {
  display: inline-block;
  background: var(--bepi-orange);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .3px;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Baris batch yang sudah lewat kadaluarsa — ditandai jelas */
tr.batch-expired { background: #fdeceb !important; }
tr.batch-expired:hover { background: #fbe0e0 !important; }
tr.batch-soon { background: #fdf4e4 !important; }
tr.batch-soon:hover { background: var(--bepi-orange-soft) !important; }

/* ==========================================================================
   PESAN / NOTIFIKASI
   ========================================================================== */

.error-msg,
.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--bepi-red-soft);
  color: var(--bepi-red);
  border: 1px solid #f0c4bd;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
}

.notice.success {
  background: var(--bepi-green-soft);
  color: var(--bepi-green);
  border-color: #bfe0ac;
}

.notice.info {
  background: var(--bepi-blue-soft);
  color: var(--bepi-blue);
  border-color: #bed4f2;
}

/* ==========================================================================
   TABEL
   ========================================================================== */

/* Pembungkus: menjaga tabel lebar tetap bisa digeser tanpa merusak layout */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}

.table-wrap table.stock-table {
  margin-bottom: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Versi tinggi: header menempel saat digulir */
.table-wrap.sticky { max-height: 72vh; overflow-y: auto; }
.table-wrap.sticky thead th { position: sticky; top: 0; z-index: 2; }

table.stock-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 14px;
}

table.stock-table th,
table.stock-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.stock-table th {
  background: var(--bepi-cream);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}

table.stock-table tbody tr:nth-child(even) { background: #fdfaf5; }
table.stock-table tbody tr:hover { background: var(--bepi-orange-soft); }
table.stock-table tbody tr:last-child td { border-bottom: 0; }

table.stock-table tfoot td {
  background: var(--bepi-cream);
  font-weight: 800;
  border-top: 2px solid var(--line-strong);
  border-bottom: 0;
}

/* Angka & uang rata kanan + angka sejajar, agar mudah dibandingkan */
table.stock-table td.num,
table.stock-table th.num,
table.stock-table td.money,
table.stock-table th.money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.stock-table td.strong { font-weight: 700; }

/* Input di dalam tabel (edit inline) */
table.stock-table input,
table.stock-table select {
  min-height: var(--tap-sm);
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  max-width: 100%;
}

table.stock-table input:focus,
table.stock-table select:focus {
  outline: none;
  border-color: var(--bepi-orange);
  box-shadow: var(--focus-ring);
}

/* Kolom aksi: aksi hapus dipisahkan agar tidak salah klik */
.actions-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.actions-cell .btn.danger { margin-left: 6px; }

.inline-form { display: inline; }

/* ==========================================================================
   EMPTY STATE — memandu saat data masih kosong
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
  opacity: .75;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 17px;
  color: var(--text);
}

.empty-state p {
  margin: 0 auto 16px;
  max-width: 420px;
  font-size: 14px;
  line-height: 1.6;
}

/* Empty state di dalam tabel */
td .empty-state { padding: 32px 16px; }

/* ==========================================================================
   KARTU PRODUK (ADMIN)
   ========================================================================== */

.product-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.product-manage-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
}

.product-manage-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.product-manage-photo {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: var(--bepi-cream);
}

.product-manage-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bepi-orange);
  font-size: 40px;
  font-weight: 800;
}

.product-manage-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-manage-body h3 {
  margin: 0 0 2px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-manage-body .variant {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  min-height: 16px;
}

.product-manage-body .meta-row,
.product-manage-body .price-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.product-manage-body .price-row { font-variant-numeric: tabular-nums; }

.product-manage-body .stock-row {
  font-size: 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.product-manage-body .actions-cell { margin-top: auto; padding-top: 12px; }

/* ==========================================================================
   BLOK KATALOG vs INTERNAL (halaman edit produk)
   ========================================================================== */

.section-block {
  border-radius: var(--radius);
  padding: 20px 22px 24px;
  margin-bottom: 22px;
  border: 1px solid transparent;
}
.catalog-block { background: var(--bepi-orange-soft); border-color: #f2c98a; }
.internal-block { background: #eef4fb; border-color: #b8d0ee; }

.section-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.section-tag.catalog { background: var(--bepi-orange); color: #fff; }
.section-tag.internal { background: var(--bepi-blue); color: #fff; }

/* ==========================================================================
   PERINGATAN DASHBOARD
   ========================================================================== */

.alert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.alert-box {
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid transparent;
}

.alert-box h3 { margin: 0 0 8px; font-size: 15px; }
.alert-box ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.75; }
.alert-box.low { background: var(--bepi-orange-soft); border-color: #f2c98a; }
.alert-box.low h3 { color: #8a6414; }
.alert-box.expiry { background: #fbe6e6; border-color: #e6a9a9; }
.alert-box.expiry h3 { color: var(--bepi-red); }
.alert-box a { color: inherit; font-weight: 700; }

/* ==========================================================================
   BADGE & STATUS
   ========================================================================== */

.hidden-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  background: #8a7460;
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.move-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.move-badge.in { background: var(--bepi-green-soft); color: var(--bepi-green); }
.move-badge.out { background: var(--bepi-red-soft); color: var(--bepi-red); }
.move-badge.transfer { background: var(--bepi-blue-soft); color: var(--bepi-blue); }
.move-badge.warn { background: #fbeccb; color: #8a6414; }

.lead-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}
.status-baru { background: var(--bepi-red-soft); color: var(--bepi-red); }
.status-diproses { background: #fbeccb; color: #8a6414; }
.status-selesai { background: var(--bepi-green-soft); color: var(--bepi-green); }

/* ==========================================================================
   KARTU RINGKASAN (laporan)
   ========================================================================== */

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.summary-card .label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
}

.summary-card .value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.summary-card .value.positive { color: var(--bepi-green); }
.summary-card .value.negative { color: var(--bepi-red); }

.profit-cell.positive { color: var(--bepi-green); font-weight: 700; }
.profit-cell.negative { color: var(--bepi-red); font-weight: 700; }

.expiry-warning { color: #8a6414; font-weight: 700; }
td.negative { color: var(--bepi-red); font-weight: 700; }

/* ==========================================================================
   LOGIN
   ========================================================================== */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--bepi-orange) 0%, #f7b267 100%);
}

.auth-card {
  background: #fff;
  padding: 36px 32px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.auth-card h1 { text-align: center; color: var(--bepi-orange-dark); margin: 0 0 4px; }
.auth-card .sub { text-align: center; color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }

/* ==========================================================================
   TOMBOL WHATSAPP (katalog publik)
   ========================================================================== */

.btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  width: 100%;
  min-height: var(--tap);
  padding: 9px 14px;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background .15s ease, transform .05s ease;
}
.btn-wa:hover { background: #1ebe57; }
.btn-wa:active { transform: translateY(1px); }
.btn-wa:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 211, 102, .4); }
.btn-wa svg { flex: 0 0 auto; }

.btn-wa-lg {
  width: auto;
  padding: 12px 26px;
  font-size: 16px;
  margin: 4px auto 8px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, .35);
}

/* ==========================================================================
   FORM RESELLER (publik)
   ========================================================================== */

.lead-wrap { max-width: 560px; margin: 0 auto; }

.lead-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 26px;
  box-shadow: var(--shadow);
}

.lead-field { margin-bottom: 14px; text-align: left; }
.lead-field label { display: block; font-weight: 600; font-size: 14px; color: var(--text-muted); margin-bottom: 5px; }
.lead-field .req { color: var(--bepi-red); }

.lead-form input,
.lead-form textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
}

.lead-form textarea { min-height: 90px; resize: vertical; }

.lead-form input:focus,
.lead-form textarea:focus {
  outline: none;
  border-color: var(--bepi-orange);
  box-shadow: var(--focus-ring);
}

.lead-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.lead-ok {
  background: var(--bepi-green-soft);
  border: 1px solid #b7e2c6;
  color: var(--bepi-green);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 600;
  text-align: center;
}

/* ==========================================================================
   RESPONSIF
   ========================================================================== */

@media (max-width: 900px) {
  .admin-wrap { padding: 22px 16px 56px; }
  .add-form .row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .page-title { font-size: 20px; }
}

@media (max-width: 640px) {
  :root { --tap: 46px; --tap-sm: 40px; }

  .admin-header { padding: 12px 16px; }
  .admin-header .logo { font-size: 19px; }
  .admin-header .user-box { font-size: 13px; gap: 8px; }

  .admin-tabs { padding: 0 8px; }
  .admin-tabs a { padding: 13px 12px; font-size: 13.5px; }

  .admin-wrap { padding: 18px 12px 56px; }

  /* Form jadi satu kolom penuh agar tidak gepeng */
  .add-form .row { grid-template-columns: 1fr; gap: 12px; }
  .add-form, .panel { padding: 16px; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .btn { width: 100%; }

  .summary-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .summary-card { padding: 14px; }
  .summary-card .value { font-size: 19px; }

  .product-manage-grid { grid-template-columns: 1fr; }

  /* Tombol dalam kolom aksi jadi lebar penuh supaya gampang ditekan */
  .actions-cell { gap: 6px; }
  .actions-cell .btn { flex: 1 1 auto; }
  .actions-cell .btn.danger { margin-left: 0; }

  .form-actions .btn { width: 100%; }

  table.stock-table th,
  table.stock-table td { padding: 10px 12px; }

  .hero { padding: 40px 20px; }
  section { padding: 36px 18px; }
  .navbar { padding: 12px 16px; }
  .navbar .logo { font-size: 22px; }
}

/* ==========================================================================
   CETAK (label barcode & laporan)
   ========================================================================== */

@media print {
  .admin-header, .admin-tabs, .no-print, .btn { display: none !important; }
  body { background: #fff; }
  .admin-wrap { padding: 0; max-width: none; }
  table.stock-table { box-shadow: none; }
}
