/* Stok Mondylia — UI */
:root {
  --navy: #101a4a;
  --navy-2: #1b2670;
  --indigo: #3b3bd6;
  --primary: #2b2fa8;
  --primary-soft: #ecebff;
  --sky: #38bdf8;
  --bg: #f4f6fc;
  --card: #ffffff;
  --ink: #131b38;
  --muted: #6b7490;
  --line: #e6e9f4;
  --green: #0e9f6e;
  --green-soft: #e3f8ee;
  --amber: #b45309;
  --amber-soft: #fdf1dc;
  --red: #d92d20;
  --red-soft: #fde8e6;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(16, 26, 74, .08);
  --shadow-sm: 0 2px 10px rgba(16, 26, 74, .06);
}

* { box-sizing: border-box; }

/* cegah geser ke samping tanpa merusak sticky header (clip != scroll container) */
body { overflow-x: clip; max-width: 100%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--primary); text-decoration: none; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; background: #f1f3fb; padding: 1px 6px; border-radius: 6px; color: #2b2fa8; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: .35rem 0; }
.muted { color: var(--muted); }
.tiny { font-size: .74rem; }
.inline { display: inline; }
.hide-sm { display: none; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(115deg, #0d1540 0%, #1c2470 48%, #2f3aa8 100%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(13, 21, 64, .25);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, #4f7cff, #7dd3fc);
  color: #0b1235;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: .95rem; letter-spacing: .01em; }
.brand-text small {
  font-size: .68rem;
  color: #b9c4f5;
  text-transform: uppercase;
  letter-spacing: .08em;
  max-width: 48vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }

.topnav { display: none; gap: 4px; }
.topnav a {
  color: #c3cdf5;
  font-size: .85rem;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 10px;
  transition: background .15s ease, color .15s ease;
}
.topnav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.topnav a.is-active { background: rgba(255,255,255,.18); color: #fff; }
.is-hidden { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 12px;
  padding: 10px 15px;
  font: inherit;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  color: #fff;
  box-shadow: 0 8px 20px rgba(43, 47, 168, .28);
}
.btn-primary:hover { box-shadow: 0 12px 26px rgba(43, 47, 168, .36); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.btn-light { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.btn-light-outline { background: #fff; color: var(--primary); border: 1px solid #d9ddf0; }
.btn-block { width: 100%; justify-content: center; padding: 13px; }
.btn-sm { padding: 8px 12px; font-size: .8rem; gap: 5px; }

/* ---------- Layout ---------- */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px 104px;
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 4px 0 16px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { margin: 26px 0 12px; font-size: 1.02rem; }

.alert {
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 14px;
  font-size: .88rem;
  border: 1px solid transparent;
}
.alert-ok { background: var(--green-soft); color: #0a6b4c; border-color: #bfeeda; }
.alert-err { background: var(--red-soft); color: #8f1d14; border-color: #f7c9c4; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #121a4e 0%, #262e93 52%, #3f6ff0 100%);
  color: #fff;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(18, 26, 78, .28);
  margin-bottom: 16px;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.hero::after {
  content: "";
  position: absolute;
  right: -70px; top: -80px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 211, 252, .5), transparent 65%);
}
.hero h1 { font-size: 1.4rem; margin: 2px 0 2px; }
.hero-kicker {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #a9b8ff;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-sub { color: #cfd8ff; font-size: .84rem; margin: 0; max-width: 46ch; }
.hero > * { position: relative; z-index: 1; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stats-2, .stats-3 { grid-template-columns: 1fr; }
.stat {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--indigo), var(--sky));
}
.stat-green::before { background: linear-gradient(180deg, #12b981, #6ee7b7); }
.stat-amber::before { background: linear-gradient(180deg, #f59e0b, #fcd34d); }
.stat-red::before { background: linear-gradient(180deg, #ef4444, #fca5a5); }
.stat-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.stat-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
.stat-rp { font-size: 1.2rem; }
.stat-note { font-size: .72rem; color: var(--muted); }

.nilai-card { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; background: linear-gradient(160deg, #ffffff, #f7f9ff); }
.big-nilai { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; color: #1a1f5c; }
.nilai-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.nilai-split div { display: flex; flex-direction: column; min-width: 0; }
.nilai-split strong { overflow-wrap: anywhere; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.card.pad { padding: 16px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; color: #1b2350; }
.card-head h3 svg { color: var(--indigo); }
.link { font-size: .8rem; font-weight: 600; }

.split-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.split-2 > * { min-width: 0; }

.kat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.kat-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease;
}
.kat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(16, 26, 74, .1); border-color: #cdd4f0; }
.kat-nama { font-size: .72rem; font-weight: 700; letter-spacing: .05em; color: var(--indigo); }
.kat-card strong { font-size: 1.15rem; }
.kat-card strong small { font-size: .72rem; font-weight: 500; color: var(--muted); }
.kat-nilai { font-size: .76rem; color: var(--muted); }

/* ---------- List / items ---------- */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  box-shadow: var(--shadow-sm);
  color: var(--muted);
}
.search input { border: 0; outline: 0; font: inherit; width: 100%; background: transparent; color: var(--ink); }
.search input::placeholder { color: #98a0b8; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: #45506e;
  padding: 7px 13px;
  border-radius: 999px;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.chip.is-active { background: linear-gradient(135deg, var(--primary), var(--indigo)); color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(43,47,168,.25); }

.toolbar-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; color: #45506e; background: #fff; border: 1px solid var(--line); padding: 7px 11px; border-radius: 11px; cursor: pointer; }
.switch input { accent-color: var(--primary); width: 15px; height: 15px; }
.select { font: inherit; font-size: .82rem; padding: 8px 11px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: #45506e; }

.result-count { font-size: .8rem; color: var(--muted); margin: 0 0 10px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease;
  content-visibility: auto;
  contain-intrinsic-size: 74px;
}
.item:hover { transform: translateX(2px); border-color: #ccd4f2; box-shadow: 0 10px 22px rgba(16, 26, 74, .09); }
.item-main { min-width: 0; }
.item-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-title strong { font-size: .92rem; font-weight: 650; }
.item-meta { display: flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.item-meta .dot { opacity: .5; }
.trx-mark { color: var(--indigo); font-weight: 600; }
.item-right { text-align: right; display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.item-harga { font-weight: 700; font-size: .86rem; color: #1a1f5c; }
.item-stok { font-size: .74rem; color: var(--green); font-weight: 600; }
.item-stok.is-empty { color: var(--red); }

.badge {
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .05em;
  padding: 3px 7px;
  border-radius: 6px;
  text-transform: uppercase;
}
.badge-ada { background: var(--green-soft); color: #0a6b4c; }
.badge-tipis { background: var(--amber-soft); color: var(--amber); }
.badge-habis { background: var(--red-soft); color: #a01c12; }

.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini-list li { min-width: 0; }
.mini-list li { border-bottom: 1px solid #f0f2fa; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; color: var(--ink); min-width: 0; }
.mini-list a:hover { color: var(--primary); }
.mini-list a > span:first-child { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.mini-list strong { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list small { font-size: .72rem; color: var(--muted); }
.sisa-pill { flex: 0 0 auto; background: var(--amber-soft); color: var(--amber); font-weight: 800; font-size: .76rem; padding: 3px 9px; border-radius: 999px; }
.sisa-kosong { background: var(--red-soft); color: var(--red); }
.qty-pill { flex: 0 0 auto; font-weight: 800; font-size: .8rem; padding: 3px 9px; border-radius: 999px; background: var(--green-soft); color: #0a6b4c; }
.trx-out .qty-pill { background: var(--red-soft); color: #a01c12; }

.foot-note { margin-top: 18px; text-align: center; }

/* ---------- Detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; margin-bottom: 12px; color: var(--muted); }
.back:hover { color: var(--primary); }
.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  background: linear-gradient(150deg, #ffffff, #f6f8ff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.kat-tag { display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .08em; color: var(--indigo); background: var(--primary-soft); padding: 3px 9px; border-radius: 6px; margin-bottom: 6px; }
.detail-head h1 { font-size: 1.3rem; }
.detail-stok { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 18px; box-shadow: var(--shadow-sm); }
.detail-stok strong { display: block; font-size: 2rem; line-height: 1.1; }
.detail-stok span { font-size: .74rem; color: var(--muted); }

.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kv-2 { grid-template-columns: repeat(2, 1fr); }
.kv div { background: #f7f9ff; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.kv span { font-size: .73rem; color: var(--muted); }
.kv strong { font-size: 1.05rem; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 11px; }
.field > span { font-size: .78rem; font-weight: 600; color: #45506e; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input, .field select {
  font: inherit;
  font-size: .92rem;
  padding: 11px 12px;
  border: 1px solid #dfe3f2;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus { outline: 0; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(59, 59, 214, .12); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px;
  border-radius: 12px;
  border: 1px solid #dfe3f2;
  background: #fff;
  font-size: .87rem;
  font-weight: 600;
  color: #45506e;
  transition: all .15s ease;
}
.seg input:checked + span { background: linear-gradient(135deg, var(--primary), var(--indigo)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(43,47,168,.25); }
.seg input[value="out"]:checked + span { background: linear-gradient(135deg, #b42318, #ef4444); box-shadow: 0 8px 18px rgba(180,35,24,.25); }

.stok-info { background: var(--primary-soft); color: #2b2fa8; border-radius: 11px; padding: 9px 12px; font-size: .84rem; }
.tips { margin: 0; padding-left: 18px; font-size: .84rem; color: #45506e; }
.tips li { margin-bottom: 6px; }

/* ---------- Riwayat ---------- */
.trx-list { display: flex; flex-direction: column; gap: 4px; }
.trx-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f2fa; }
.trx-row:last-child { border-bottom: 0; }
.trx-badge { font-size: .62rem; font-weight: 800; letter-spacing: .05em; padding: 3px 7px; border-radius: 6px; }
.trx-badge.in { background: var(--green-soft); color: #0a6b4c; }
.trx-badge.out { background: var(--red-soft); color: #a01c12; }
.trx-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trx-body strong { font-size: .87rem; }
.trx-body small { font-size: .73rem; color: var(--muted); }

.trx-table { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.trx-table-head { display: none; }
.trx-table-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "tgl qty"
    "barang barang"
    "jenis aksi"
    "ket ket";
  gap: 6px 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef1f9;
  font-size: .84rem;
  align-items: center;
}
.trx-table-row:last-child { border-bottom: 0; }
.col-tgl { grid-area: tgl; font-weight: 600; font-size: .82rem; display: flex; flex-direction: column; }
.col-tgl small { font-weight: 400; color: var(--muted); font-size: .7rem; }
.col-barang { grid-area: barang; display: flex; flex-direction: column; }
.col-barang small { color: var(--muted); font-size: .72rem; }
.col-jenis { grid-area: jenis; }
.col-qty { grid-area: qty; font-weight: 800; text-align: right; }
.col-ket { grid-area: ket; }
.col-aksi { grid-area: aksi; text-align: right; }
.col-aksi form { display: inline; }
.icon-btn { background: #f4f6fc; border: 1px solid var(--line); border-radius: 9px; padding: 6px; color: #8a1c1c; cursor: pointer; line-height: 0; transition: all .15s ease; }
.icon-btn:hover { background: var(--red-soft); border-color: #f6c9c4; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); background: #fff; border: 1px dashed #d8ddef; border-radius: var(--radius); }
.empty.big { padding: 40px 18px; }
.empty h3 { color: var(--ink); margin: 8px 0 4px; }
.empty svg { color: #b9c2e0; }

/* ---------- Login ---------- */
.login-wrap { min-height: 78vh; display: grid; place-items: center; }
.login-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 22px;
  padding: 28px 22px;
  box-shadow: 0 24px 60px rgba(16, 26, 74, .14);
  border: 1px solid var(--line);
  text-align: center;
}
.login-logo {
  width: 52px; height: 52px; margin: 0 auto 12px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #1b2670, #3f6ff0);
  color: #fff; font-weight: 800; font-size: 1.4rem;
  box-shadow: 0 10px 24px rgba(27, 38, 112, .3);
}
.login-card h1 { font-size: 1.25rem; }
.login-card form { margin-top: 18px; text-align: left; }
.login-card .field input { text-align: center; letter-spacing: .2em; }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  gap: 2px;
  padding: 6px;
  border-radius: 20px;
  background: rgba(13, 21, 64, .96);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px rgba(13, 21, 64, .32);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 14px;
  color: #a8b3e0;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .02em;
  transition: all .16s ease;
  white-space: nowrap;
}
.tab.is-active { background: linear-gradient(135deg, #4f7cff, #7dd3fc); color: #0b1235; }
.tab:hover { color: #fff; }

/* ---------- Pencarian cepat ---------- */
.hero-wrap { position: relative; margin-bottom: 16px; }
.hero-wrap .hero { margin-bottom: 0; }
.hero-cari { flex: 1 0 100%; margin-top: 10px; }
.cari-hasil-hero { top: calc(100% + 6px); z-index: 70; }
.search-hero {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.32);
  color: #dbe3ff;
  box-shadow: none;
  padding: 13px 15px;
}
.search-hero:focus-within { border-color: rgba(125,211,252,.85); background: rgba(255,255,255,.2); }
.search-hero input { color: #fff; font-size: .95rem; }
.search-hero input::placeholder { color: #c3cdf5; }
.kbd {
  font-family: ui-monospace, monospace;
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,.18);
  color: #dbe3ff;
  border: 1px solid rgba(255,255,255,.25);
}

.cari-hasil {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  color: var(--ink);
  border-radius: 16px;
  box-shadow: 0 22px 50px rgba(10, 17, 50, .28);
  border: 1px solid var(--line);
  overflow: hidden;
  z-index: 60;
  max-height: 62vh;
  overflow-y: auto;
}
.cari-hint { padding: 14px 16px; margin: 0; font-size: .82rem; color: var(--muted); }
.cari-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid #f0f2fa;
  color: var(--ink);
}
.cari-item:last-child { border-bottom: 0; }
.cari-item:hover, .cari-item.is-aktif { background: #f4f7ff; }
.cari-main { display: flex; flex-direction: column; min-width: 0; }
.cari-main strong { font-size: .87rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cari-main small { font-size: .72rem; color: var(--muted); }
.cari-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.cari-harga { font-size: .78rem; font-weight: 700; color: #1a1f5c; }
.cari-sisa { font-size: .72rem; font-weight: 700; }
.cari-sisa.ada { color: var(--green); }
.cari-sisa.tipis { color: var(--amber); }
.cari-sisa.habis { color: var(--red); }
.cari-foot {
  padding: 10px 14px;
  font-size: .76rem;
  color: var(--muted);
  background: #f8faff;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.cari-foot a { font-weight: 600; }

.cari-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(9, 14, 40, .55);
  backdrop-filter: blur(4px);
  padding: 8vh 14px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.cari-overlay[hidden] { display: none; }
.cari-card { width: 100%; max-width: 620px; position: relative; }
.search-lg { padding: 14px 16px; box-shadow: 0 18px 40px rgba(9, 14, 40, .3); }
.search-lg input { font-size: 1rem; }
.cari-tutup {
  border: 0;
  background: #eef1fa;
  color: #45506e;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 9px;
  cursor: pointer;
}
.cari-card .cari-hasil { position: static; margin-top: 10px; max-height: 64vh; }

@media (max-width: 639px) {
  .kbd { display: none; }
}

@media (max-width: 479px) {
  .hide-xs { display: none; }
}

@media (max-width: 359px) {
  .stat-label { font-size: .66rem; letter-spacing: .04em; }
  .stat-value { font-size: 1.35rem; }
  .big-nilai { font-size: 1.5rem; }
  .nilai-split { grid-template-columns: 1fr; gap: 10px; }
  .tab { padding: 8px 10px; font-size: .6rem; }
}

@media (min-width: 640px) {
  .hide-sm { display: inline; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stats-2 { grid-template-columns: repeat(2, 1fr); }
  .stats-3 { grid-template-columns: repeat(3, 1fr); }
  .kat-grid { grid-template-columns: repeat(3, 1fr); }
  .split-2 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: repeat(4, 1fr); }
  .kv.kv-2 { grid-template-columns: repeat(2, 1fr); }
  .trx-table-head {
    display: grid;
    grid-template-columns: 110px 1fr 90px 70px 1fr 44px;
    gap: 10px;
    padding: 11px 14px;
    background: #f6f8ff;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
  }
  .trx-table-row {
    grid-template-columns: 110px 1fr 90px 70px 1fr 44px;
    grid-template-areas: "tgl barang jenis qty ket aksi";
    gap: 10px;
    align-items: center;
  }
  .col-qty { text-align: left; }
}

@media (min-width: 900px) {
  h1 { font-size: 1.7rem; }
  .wrap { padding: 26px 24px 116px; }
  .hero { padding: 28px 30px; }
  .hero h1 { font-size: 1.7rem; }
  .kat-grid { grid-template-columns: repeat(6, 1fr); }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .wrap { padding-bottom: 60px; }
}
