/* Opname Gudang v3 — NEO-BRUTALISM (konsep Joe, 15 Jul 2026)
   Putih + aksen kuning #FACC15, border hitam tebal, hard shadow offset,
   heading Syne (tight tracking), body DM Sans. Layout sedikit asimetris.
   Class names dipertahankan dari v2 — logika app.js tidak berubah. */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --ink: #111111; --paper: #ffffff; --bg: #f7f6f2;
  --acc: #FACC15; --acc-dk: #eab308;
  --ok: #22c55e; --warn: #fb923c; --bad: #ef4444;
  --sph: #86efac; --bsc: #93c5fd;
  --bd: 2.5px solid var(--ink);
  --sh: 4px 4px 0 var(--ink);
  --sh-lg: 6px 6px 0 var(--ink);
  --r: 10px;
  --head: 'DM Sans', system-ui, sans-serif; /* heading = DM Sans Bold (Syne dianggap susah dibaca — feedback Joe) */
  --body: 'DM Sans', system-ui, sans-serif;
}
html { -webkit-text-size-adjust: 100%; }
body { font: 16px/1.5 var(--body); background: var(--bg); color: var(--ink); }

h1, h2, h3, .title, #brand { font-family: var(--head); font-weight: 800; letter-spacing: -0.015em; }
h1 { font-size: 34px; line-height: 1.1; }
h2 { font-size: 23px; line-height: 1.15; margin-bottom: 4px; }
h3 { font-size: 17px; margin-bottom: 6px; }

/* ---------- Kerangka ---------- */
#topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--paper); color: var(--ink); padding: 12px 16px;
  position: sticky; top: 0; z-index: 20; border-bottom: var(--bd); }
#brand { font-size: 15px; white-space: nowrap; }
#brand .mark { background: var(--acc); padding: 1px 6px; border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink); display: inline-block; transform: rotate(-1.5deg); }
#whoami { font-size: 12px; font-weight: 700; border: 2px solid var(--ink); background: var(--acc);
  padding: 4px 10px; box-shadow: 2.5px 2.5px 0 var(--ink); transform: rotate(1deg);
  white-space: nowrap; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
#whoami:empty { display: none; }
main { padding: 18px 14px 100px; max-width: 780px; margin: 0 auto; }

.card { background: var(--paper); border: var(--bd); border-radius: var(--r);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--sh); }
/* CATATAN: jangan rotasi .card — kartu tinggi (tabel ratusan baris) melenceng puluhan px
   keluar layar (tinggi × sin θ). Aksen miring cukup di elemen kecil (sticker, badge, stat). */
.mut { color: #4b5563; font-size: 13.5px; }
.sm { font-size: 13.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
hr.sep { border: 0; border-top: 2px dashed var(--ink); opacity: .25; margin: 14px 0; }

/* ---------- Kontrol ---------- */
button { font: 700 16px var(--body); border: var(--bd); border-radius: 8px;
  padding: 12px 18px; min-height: 48px; background: var(--acc); color: var(--ink);
  cursor: pointer; box-shadow: var(--sh); transition: transform .05s, box-shadow .05s; }
button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
button.sec { background: var(--paper); }
button.ok { background: var(--ok); }
button.warn { background: var(--warn); }
button.danger { background: var(--bad); color: #fff; }
button.ghost { border: none; box-shadow: none; background: none; color: var(--ink);
  text-decoration: underline 2.5px var(--acc); text-underline-offset: 4px;
  padding: 8px 10px; min-height: 0; }
button.ghost:active { transform: none; }
button.small { padding: 8px 14px; min-height: 42px; font-size: 14px; box-shadow: 3px 3px 0 var(--ink); }
button:disabled { opacity: .4; }
button.block { width: 100%; }

input, select { font: 500 16px var(--body); width: 100%; padding: 12px 14px; min-height: 48px;
  border: var(--bd); border-radius: 8px; background: var(--paper); color: var(--ink); }
input:focus, select:focus { outline: none; box-shadow: var(--sh); background: #fffdf2; }
input::placeholder { color: #9ca3af; font-weight: 500; }
label { font-size: 13px; font-weight: 700; display: block; margin: 12px 0 5px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Badge & status ---------- */
.badge { display: inline-block; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 6px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .3px; white-space: nowrap;
  vertical-align: middle; box-shadow: 2px 2px 0 var(--ink); background: var(--paper); }
.badge.sph { background: var(--sph); }
.badge.bsc { background: var(--bsc); }
.badge.both { background: linear-gradient(105deg, var(--sph) 50%, var(--bsc) 50%); }
.badge.none { background: #e5e7eb; }
.badge.red { background: var(--bad); color: #fff; }
.badge.st-open { background: var(--sph); }
.badge.st-review { background: var(--acc); }
.badge.st-closed { background: #e5e7eb; }

.syncline { display: flex; gap: 8px; align-items: center; font-size: 13px; color: #4b5563; font-weight: 500; }
.syncline.stale { color: var(--ink); background: var(--acc); border: 2px solid var(--ink);
  padding: 6px 10px; font-weight: 700; box-shadow: 3px 3px 0 var(--ink); }

/* ---------- Statistik ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--paper); border: var(--bd); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--sh); }
.stat:nth-child(2) { background: var(--acc); transform: rotate(0.6deg); }
.stat:nth-child(1) { transform: rotate(-0.5deg); }
.stat b { font-family: var(--head); font-size: 26px; display: block; line-height: 1.1; letter-spacing: -0.02em; }
.stat span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #374151; }

.progress { height: 14px; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px;
  overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: var(--acc);
  background-image: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(0,0,0,.12) 8px 16px);
  border-right: 2px solid var(--ink); transition: width .25s; }
.progress > div[style*="width:100"] , .progress > div[style*="width: 100"] { border-right: none; background: var(--ok); }

/* ---------- Daftar sesi ---------- */
.sess { border-top: 2px dashed #d1d5db; padding: 14px 0; }
.sess:first-of-type { border-top: 0; padding-top: 6px; }
.sess .title { font-size: 18px; }

/* ---------- Checklist ---------- */
.chk { border-top: 2px dashed #d1d5db; padding: 14px 0; }
.chk:first-of-type { border-top: 0; }
.chk.done { background: #f0fdf4; border-left: 5px solid var(--ok); margin: 0 -16px; padding: 14px 16px 14px 12px; }
.chk .pname { font-weight: 700; font-size: 15.5px; line-height: 1.35; }
.chk .bookline { font-size: 13.5px; color: #4b5563; margin: 4px 0 10px; }
.chk .bookline b { color: var(--ink); font-variant-numeric: tabular-nums; }
.lokchip { display: inline-block; background: var(--paper); border: 2px solid var(--ink);
  border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 800; color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink); margin-right: 4px; }
.qty-row { display: flex; gap: 10px; }
.qty-row input { flex: 1; max-width: 130px; text-align: center;
  font: 800 24px var(--head); letter-spacing: -0.02em; }
.qty-row input::placeholder { font: 500 14px var(--body); letter-spacing: 0; }
.counted-line { font-size: 14.5px; font-weight: 800; margin-bottom: 4px; }
.counted-line::before { content: ''; }
.chk.done .counted-line { color: #15803d; }

#bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: var(--paper); border-top: var(--bd); }
#bottombar .inner { max-width: 780px; margin: 0 auto; padding: 10px 14px; display: flex; gap: 10px; align-items: center; }
#bottombar .navbtn { white-space: nowrap; }
#bottombar select { max-width: 46vw; }
#bottombar b { font-family: var(--head); font-size: 20px; letter-spacing: -0.02em; }
#bottombar select { box-shadow: 3px 3px 0 var(--ink); font-weight: 700; }

/* ---------- Tabel review ---------- */
.tablewrap { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
/* Tabel sempit (mis. Belum Terzonasi): kunci lebar ke layar, jangan ikut isi sel */
table.tight { min-width: 0; table-layout: fixed; }
table.tight th.num, table.tight td.num { width: 62px; }
table.tight td { word-break: break-word; overflow-wrap: anywhere; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 2px solid #e5e7eb; vertical-align: top; }
th { font-family: var(--head); font-weight: 800; font-size: 12.5px; letter-spacing: 0;
  white-space: nowrap; position: sticky; top: 0; background: var(--paper);
  border-bottom: 2.5px solid var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.cut { background: #fef2f2; }
tr.cut td:first-child { border-left: 5px solid var(--bad); }
tr.appr td:first-child { border-left: 5px solid var(--ok); }
.var-plus { color: #15803d; font-weight: 800; }
.var-min { color: var(--bad); font-weight: 800; }
.alloc-input { width: 78px; padding: 7px 6px; min-height: 0; text-align: right; font-weight: 700;
  border-width: 2px; box-shadow: none; }
.alloc-input:focus { box-shadow: 3px 3px 0 var(--ink); }

.filters { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; }
.filters button { white-space: nowrap; }
.filters button.on { background: var(--ink); color: var(--acc); }
.filters button.off { background: var(--paper); }

/* ---------- Toast & login ---------- */
#toast { position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--acc); border: var(--bd); border-color: var(--ink);
  padding: 13px 18px; border-radius: 8px; font-size: 14.5px; font-weight: 700;
  box-shadow: var(--sh-lg); opacity: 0; pointer-events: none; transition: opacity .15s;
  max-width: 92vw; z-index: 50; }
#toast.show { opacity: 1; }
#toast.err { background: var(--bad); color: #fff; }

.login-wrap { max-width: 360px; margin: 8vh auto 0; }
.login-wrap .card { transform: rotate(-0.6deg); box-shadow: var(--sh-lg); }
.login-wrap h1 { font-size: 38px; margin-bottom: 2px; }
.login-wrap input { font: 800 30px var(--head); text-align: center; letter-spacing: 12px; }
.login-logo { width: 84px; height: 84px; margin: 0 0 -26px 18px; position: relative; z-index: 2;
  background: var(--acc); border: var(--bd); border-radius: 12px; box-shadow: var(--sh);
  display: flex; align-items: center; justify-content: center; font-size: 44px;
  transform: rotate(-4deg); }
.hidden { display: none !important; }
