/* Gudang Playhard — mobile-first untuk HP Android staf.
   Bahasa visual: label thermal gudang (kode = chip monospace kontras tinggi),
   tinta gelap + aksen amber merek PH. Tanpa webfont/framework — cepat di HP murah. */

:root {
  --tinta: #0f172a;        /* bar & nav */
  --tinta-2: #334155;
  --latar: #f1f5f9;
  --permukaan: #ffffff;
  --garis: #e2e8f0;
  --redup: #64748b;
  --amber: #f59e0b;        /* merek / lokasi */
  --amber-tua: #92400e;
  --amber-muda: #fef3c7;
  --primer: #1d4ed8;       /* aksi */
  --primer-tua: #1e40af;
  --hijau: #15803d;
  --hijau-muda: #f0fdf4;
  --merah: #b91c1c;
  --merah-muda: #fef2f2;
  --radius: 12px;
  --nav-tinggi: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.5;
  background: var(--latar); color: var(--tinta);
  -webkit-tap-highlight-color: rgba(29, 78, 216, .12);
  padding-bottom: calc(var(--nav-tinggi) + env(safe-area-inset-bottom, 0px) + 8px);
}
a { color: var(--primer); text-decoration: none; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

/* ===== Bar atas tipis ===== */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .65rem;
  background: var(--tinta); color: #fff;
  padding: .6rem .9rem;
  padding-top: calc(.6rem + env(safe-area-inset-top, 0px));
}
.merek {
  font-weight: 800; color: var(--amber); font-size: 1rem; letter-spacing: .02em;
  font-family: ui-monospace, monospace;
}
.merek span { color: #fff; font-weight: 600; }
.bar .judul-halaman {
  flex: 1; text-align: right;
  font-size: .95rem; font-weight: 600; color: #cbd5e1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.isi { padding: .8rem .8rem 1rem; max-width: 44rem; margin: 0 auto; }
@media (min-width: 900px) { .isi { max-width: 62rem; } }

/* ===== Navigasi bawah (tanda tangan: rak jempol) ===== */
.nav-bawah {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: stretch;
  background: var(--tinta);
  height: calc(var(--nav-tinggi) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 10px rgba(15, 23, 42, .25);
}
.nav-bawah a, .nav-bawah button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-width: 0;
  background: none; border: none; cursor: pointer;
  color: #94a3b8; font-size: .68rem; font-weight: 600; letter-spacing: .01em;
  padding: 6px 2px 8px; position: relative;
}
.nav-bawah svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.nav-bawah .aktif { color: #fff; }
.nav-bawah .aktif::before {
  content: ""; position: absolute; top: 0; left: 25%; right: 25%;
  height: 3px; border-radius: 0 0 3px 3px; background: var(--amber);
}

/* ===== Sheet "Lainnya" ===== */
.sheet-latar {
  position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .5);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--permukaan); border-radius: 18px 18px 0 0;
  padding: .5rem .8rem calc(1rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(105%); transition: transform .22s ease;
  max-height: 75vh; overflow-y: auto;
}
body.sheet-buka .sheet { transform: translateY(0); }
body.sheet-buka .sheet-latar { opacity: 1; pointer-events: auto; }
.sheet::before {
  content: ""; display: block; width: 42px; height: 4px; border-radius: 2px;
  background: var(--garis); margin: .3rem auto .7rem;
}
.sheet a, .sheet button.item-sheet {
  display: flex; align-items: center; gap: .8rem; width: 100%;
  padding: .85rem .6rem; min-height: 48px;
  border: none; background: none; cursor: pointer; text-align: left;
  font-size: 1rem; color: var(--tinta); border-radius: 10px;
}
.sheet a:active, .sheet button.item-sheet:active { background: var(--latar); }
.sheet svg { width: 22px; height: 22px; stroke: var(--tinta-2); fill: none; stroke-width: 1.8; flex: none; }
.sheet .keluar-item { color: var(--merah); }
.sheet .keluar-item svg { stroke: var(--merah); }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-latar { transition: none; } }

/* ===== Kartu & form ===== */
.kartu {
  background: var(--permukaan); border-radius: var(--radius);
  padding: 1rem; margin-bottom: .8rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.kartu h1 { font-size: 1.15rem; margin: 0 0 .7rem; letter-spacing: -.01em; }
label { display: block; margin-bottom: .8rem; font-weight: 600; font-size: .88rem; color: var(--tinta-2); }
input[type=text], input[type=password], input[type=search], input[type=number],
input[type=file], select, textarea {
  display: block; width: 100%; margin-top: .3rem;
  padding: .75rem .8rem; font-size: 1rem; /* ≥16px: cegah zoom otomatis */
  border: 1.5px solid var(--garis); border-radius: 10px; background: var(--permukaan);
  color: var(--tinta); min-height: 48px;
}
input:focus, select:focus, textarea:focus, .tombol:focus-visible, a:focus-visible {
  outline: 2px solid var(--primer); outline-offset: 1px; border-color: var(--primer);
}
.tombol {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 46px; padding: .55rem 1rem; border-radius: 10px;
  border: 1.5px solid var(--garis); background: var(--permukaan); color: var(--tinta);
  font-size: .95rem; font-weight: 600; cursor: pointer;
}
.tombol:active { transform: translateY(1px); }
.tombol.utama { background: var(--primer); border-color: var(--primer); color: #fff; }
.tombol.utama:active { background: var(--primer-tua); }
.tombol.bahaya { background: var(--merah); border-color: var(--merah); color: #fff; }
.tombol.lebar { width: 100%; }
.galat { background: var(--merah-muda); color: var(--merah); padding: .65rem .8rem; border-radius: 10px; font-size: .95rem; }
.sukses { background: var(--hijau-muda); color: var(--hijau); padding: .65rem .8rem; border-radius: 10px; font-size: .95rem; }
.login-kartu { max-width: 22rem; margin: 15vh auto 0; }
.petunjuk { color: var(--redup); font-size: .84rem; margin: .4rem .1rem; }

/* ===== Chip kode (bahasa label thermal) ===== */
.sku {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 700; letter-spacing: .01em;
}
.lencana {
  display: inline-block; padding: .18rem .55rem; border-radius: 7px;
  font-size: .8rem; font-weight: 700; margin-right: .3rem;
  font-family: ui-monospace, monospace; letter-spacing: .01em;
}
.lencana.qty { background: #dbeafe; color: var(--primer-tua); }
.lencana.qty.kosong { background: var(--merah-muda); color: var(--merah); }
.lencana.lokasi { background: var(--amber-muda); color: var(--amber-tua); border: 1px solid #fcd34d; }
.lencana.mati { background: var(--garis); color: var(--tinta-2); }

/* ===== Pencarian ===== */
.cari-wadah { position: relative; margin: .2rem 0 .8rem; }
#kotak-cari {
  font-size: 1.1rem; padding: .95rem 1rem; min-height: 54px;
  border-radius: 14px; border: 2px solid var(--primer);
}
.hasil-cari {
  list-style: none; margin: .4rem 0 0; padding: 0;
  background: var(--permukaan); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .16);
  max-height: 55vh; overflow-y: auto;
}
.hasil-cari li { border-bottom: 1px solid var(--latar); }
.hasil-cari li:last-child { border-bottom: none; }
.hasil-cari a { display: block; padding: .8rem .85rem; min-height: 56px; color: inherit; }
.hasil-cari .sku { font-size: 1rem; }
.hasil-cari .nama { display: block; font-size: .88rem; color: var(--tinta-2); margin-top: .15rem; }

/* ===== Statistik ===== */
.ringkas { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.kartu.stat { text-align: center; padding: .8rem .3rem; margin: 0; }
.kartu.stat b { display: block; font-size: 1.35rem; letter-spacing: -.02em; }
.kartu.stat span { font-size: .76rem; color: var(--redup); }
@media (max-width: 380px) { .ringkas { grid-template-columns: repeat(2, 1fr); } }

/* ===== Tabel → kartu di HP (pola data-label) ===== */
.tabel-wadah { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--permukaan); font-size: .92rem; border-radius: var(--radius); }
th, td { text-align: left; padding: .65rem .7rem; border-bottom: 1px solid var(--latar); vertical-align: top; }
th { background: #f8fafc; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--redup); }
td.angka, th.angka { text-align: right; font-variant-numeric: tabular-nums; }
td .tombol { min-height: 40px; padding: .35rem .7rem; font-size: .85rem; }

@media (max-width: 640px) {
  .sembunyi-hp { display: none; }
  table.responsif, table.responsif tbody, table.responsif tr, table.responsif td { display: block; width: 100%; }
  table.responsif { background: none; }
  table.responsif thead { display: none; }
  table.responsif tr {
    background: var(--permukaan); border-radius: var(--radius);
    margin-bottom: .55rem; padding: .55rem .8rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  }
  table.responsif td { border: none; padding: .28rem 0; text-align: left; }
  table.responsif td.angka { text-align: left; }
  table.responsif td[data-label]::before {
    content: attr(data-label);
    display: inline-block; min-width: 6.2rem;
    font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--redup); font-weight: 600;
  }
  table.responsif td.td-utama { padding-bottom: .4rem; font-size: 1rem; }
  table.responsif td.td-utama::before { display: none; }
  table.responsif td.td-aksi { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .5rem; }
  table.responsif td.td-aksi::before { display: none; }
}

/* ===== Utilitas tata letak ===== */
.baris-aksi { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; margin: .5rem 0; }
.baris-aksi .spasi { flex: 1; }
.dua-kolom { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@media (max-width: 480px) { .dua-kolom { grid-template-columns: 1fr; } }
.halaman-nav { display: flex; gap: .5rem; justify-content: center; margin: .9rem 0; }
.halaman-nav .tombol { min-width: 44%; }

/* Video kamera scan */
#kamera { width: 100%; border-radius: var(--radius); background: #000; }
