/* ==========================================================================
   Stoka 3 — design system
   Dua ruang kerja, dua warna: ATK memakai "tinta" biru-ungu, RTG memakai "verdigris"
   hijau-toska. Warna modul adalah penunjuk arah, bukan hiasan. Status stok selalu
   hijau (aman), kuning (menipis), merah (habis). Satu keluarga huruf: Plus Jakarta Sans.
   ========================================================================== */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Netral (terang) ---------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f6;
  --border: #e3e7ef;
  --border-strong: #cfd5e1;
  --text: #141a2e;
  --text-2: #39415a;
  --muted: #5d6580;
  --placeholder: #98a0b5;

  --success: #12a06a;
  --success-soft: #e6f6ef;
  --success-text: #0b7a50;
  --warning: #e09a12;
  --warning-soft: #fdf4e1;
  --warning-text: #925b04;
  --danger: #df3f4a;
  --danger-soft: #fdeced;
  --danger-text: #b4232f;
  --info-soft: #e9f1fd;
  --info-text: #1f55b8;
  --bin-empty: #d7dce7;

  --shadow-sm: 0 1px 2px rgba(20, 26, 46, 0.05);
  --shadow: 0 1px 2px rgba(20, 26, 46, 0.04), 0 6px 18px rgba(20, 26, 46, 0.07);
  --shadow-lg: 0 18px 48px rgba(20, 26, 46, 0.2);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 64px;
  --top-h: 60px;
  --sidebar-w: 256px;
  --rail-w: 84px;
  --content-max: 1180px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Warna modul: ATK (tinta) — bawaan ---------------------------- */
:root, [data-tape="atk"] {
  --primary: #3a37cf;
  --primary-hover: #2f2cb8;
  --primary-press: #26239a;
  --primary-soft: #ecebfd;
  --primary-soft-2: #dddcfb;
  --primary-text: #2a279e;
  --on-primary: #ffffff;
  --accent: #6c4ee6;
  --accent-soft: #f1edfe;
  --accent-text: #5233c4;
  --tape: #2c29a8;
  --tape-ink: #ffffff;
  --tape-muted: rgba(255, 255, 255, 0.74);
  --brand-gradient: linear-gradient(140deg, var(--tape) 0%, var(--primary) 100%);
  --focus: 0 0 0 3px rgba(58, 55, 207, 0.32);
  --glow: rgba(58, 55, 207, 0.28);
}

/* ---------- Warna modul: RTG (verdigris) --------------------------------- */
:root[data-module="rtg"], [data-tape="rtg"] {
  --primary: #0b7d71;
  --primary-hover: #096b61;
  --primary-press: #075a52;
  --primary-soft: #e2f4f1;
  --primary-soft-2: #c9ebe5;
  --primary-text: #075e55;
  --on-primary: #ffffff;
  --accent: #0e8fa0;
  --accent-soft: #e1f3f6;
  --accent-text: #0a6b78;
  --tape: #07564f;
  --tape-ink: #ffffff;
  --tape-muted: rgba(255, 255, 255, 0.76);
  --brand-gradient: linear-gradient(140deg, var(--tape) 0%, var(--primary) 100%);
  --focus: 0 0 0 3px rgba(11, 125, 113, 0.32);
  --glow: rgba(11, 125, 113, 0.26);
}

/* ---------- Gelap --------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1020;
    --surface: #151a2e;
    --surface-2: #1a2036;
    --surface-3: #222943;
    --border: #2a3150;
    --border-strong: #3a4366;
    --text: #eef1f8;
    --text-2: #c9cfe0;
    --muted: #9aa3bd;
    --placeholder: #6b7390;
    --success-soft: rgba(52, 211, 153, 0.13);
    --success-text: #6ee7b7;
    --warning-soft: rgba(251, 191, 36, 0.13);
    --warning-text: #fcd34d;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --danger-text: #fca5a5;
    --info-soft: rgba(96, 165, 250, 0.13);
    --info-text: #93c5fd;
    --bin-empty: #2c3453;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
  }
  :root:not([data-theme="light"]), :root:not([data-theme="light"]) [data-tape="atk"] {
    --primary: #8f8cff; --primary-hover: #a9a7ff; --primary-press: #c4c3ff;
    --primary-soft: rgba(143, 140, 255, 0.15); --primary-soft-2: rgba(143, 140, 255, 0.24);
    --primary-text: #cbcaff; --on-primary: #0d1020;
    --accent: #a993ff; --accent-soft: rgba(169, 147, 255, 0.14); --accent-text: #d9cfff;
    --tape: #2a2896; --focus: 0 0 0 3px rgba(143, 140, 255, 0.45); --glow: rgba(0, 0, 0, 0.45);
  }
  :root:not([data-theme="light"])[data-module="rtg"], :root:not([data-theme="light"]) [data-tape="rtg"] {
    --primary: #3cc8b4; --primary-hover: #5ad6c4; --primary-press: #8ae5d8;
    --primary-soft: rgba(60, 200, 180, 0.14); --primary-soft-2: rgba(60, 200, 180, 0.24);
    --primary-text: #a6eadf; --on-primary: #06201d;
    --accent: #47c3d4; --accent-soft: rgba(71, 195, 212, 0.14); --accent-text: #b2ecf3;
    --tape: #0a5a52; --focus: 0 0 0 3px rgba(60, 200, 180, 0.45); --glow: rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1020;
  --surface: #151a2e;
  --surface-2: #1a2036;
  --surface-3: #222943;
  --border: #2a3150;
  --border-strong: #3a4366;
  --text: #eef1f8;
  --text-2: #c9cfe0;
  --muted: #9aa3bd;
  --placeholder: #6b7390;
  --success-soft: rgba(52, 211, 153, 0.13);
  --success-text: #6ee7b7;
  --warning-soft: rgba(251, 191, 36, 0.13);
  --warning-text: #fcd34d;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --danger-text: #fca5a5;
  --info-soft: rgba(96, 165, 250, 0.13);
  --info-text: #93c5fd;
  --bin-empty: #2c3453;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
}
:root[data-theme="dark"], :root[data-theme="dark"] [data-tape="atk"] {
  --primary: #8f8cff; --primary-hover: #a9a7ff; --primary-press: #c4c3ff;
  --primary-soft: rgba(143, 140, 255, 0.15); --primary-soft-2: rgba(143, 140, 255, 0.24);
  --primary-text: #cbcaff; --on-primary: #0d1020;
  --accent: #a993ff; --accent-soft: rgba(169, 147, 255, 0.14); --accent-text: #d9cfff;
  --tape: #2a2896; --focus: 0 0 0 3px rgba(143, 140, 255, 0.45); --glow: rgba(0, 0, 0, 0.45);
}
:root[data-theme="dark"][data-module="rtg"], :root[data-theme="dark"] [data-tape="rtg"] {
  --primary: #3cc8b4; --primary-hover: #5ad6c4; --primary-press: #8ae5d8;
  --primary-soft: rgba(60, 200, 180, 0.14); --primary-soft-2: rgba(60, 200, 180, 0.24);
  --primary-text: #a6eadf; --on-primary: #06201d;
  --accent: #47c3d4; --accent-soft: rgba(71, 195, 212, 0.14); --accent-text: #b2ecf3;
  --tape: #0a5a52; --focus: 0 0 0 3px rgba(60, 200, 180, 0.45); --glow: rgba(0, 0, 0, 0.45);
}

/* ---------- Base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 1.625rem; line-height: 1.2; font-weight: 750; letter-spacing: -0.025em; }
h2 { font-size: 1.0625rem; line-height: 1.35; font-weight: 700; letter-spacing: -0.012em; }
h3 { font-size: 0.9375rem; font-weight: 650; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
.icon { flex: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.8125rem; }
.tiny { font-size: 0.75rem; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.stack-lg { display: grid; gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Boot ---------------------------------------------------------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--primary); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.92); opacity: 0.7; } }

/* ---------- Shell --------------------------------------------------------- */
.shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar-title { font-size: 1.0625rem; font-weight: 650; letter-spacing: -0.01em; }
.topbar .back { margin-left: -8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 1.0625rem; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--text); display: grid; place-items: center; color: var(--surface); }
.brand small { display: block; font-size: 0.6875rem; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: -2px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 0.8125rem; color: var(--primary-text); background: var(--primary-soft-2); border: 0; }

.main { padding: 8px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); max-width: var(--content-max); margin: 0 auto; }

.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--border);
}
.nav-item {
  border: 0; background: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 0.6875rem; font-weight: 550; min-height: 48px; position: relative; text-decoration: none !important;
}
.nav-item .nav-pill { width: 56px; height: 30px; border-radius: 999px; display: grid; place-items: center; transition: background 0.2s var(--ease); }
.nav-item.active { color: var(--primary-text); }
.nav-item.active .nav-pill { background: var(--primary-soft-2); }
.nav-item .nav-badge { position: absolute; top: 6px; left: calc(50% + 10px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.6875rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.nav-fab .nav-pill { width: 54px; height: 54px; margin-top: -20px; border-radius: 18px; background: var(--primary); color: var(--on-primary); box-shadow: 0 10px 24px var(--glow); transition: transform 0.2s var(--ease-out); }
.nav-fab:active .nav-pill { transform: scale(0.94); }
.nav-fab.active .nav-pill { background: var(--primary-hover); }
.nav-fab { color: var(--text-2); }

.side-nav { display: none; }

@media (min-width: 640px) {
  .main { padding: 8px 28px 48px; }
  .bottom-nav { display: none; }
  .side-nav {
    display: flex; flex-direction: column; gap: 4px;
    position: fixed; inset: 0 auto 0 0; z-index: 25;
    width: var(--rail-w); padding: 16px 10px;
    background: var(--surface); border-right: 1px solid var(--border);
    /* Menu admin bisa lebih tinggi dari layar: gulir di dalam rail, bukan terpotong. */
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
  }
  .side-nav > * { flex-shrink: 0; }
  .shell { padding-left: var(--rail-w); }
  .side-nav .brand { justify-content: center; margin-bottom: 18px; }
  .side-nav .brand-text { display: none; }
  .side-link {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px;
    border-radius: var(--radius); color: var(--muted); font-size: 0.6875rem; font-weight: 550; text-decoration: none !important; position: relative;
  }
  .side-link:hover { background: var(--surface-3); color: var(--text); }
  .side-link.active { background: var(--primary-soft); color: var(--primary-text); }
  .side-link .nav-badge { position: absolute; top: 4px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.6875rem; font-weight: 700; display: grid; place-items: center; }
  .side-spacer { flex: 1; }
  .side-section { display: none; }
}

@media (min-width: 1024px) {
  .side-nav { width: var(--sidebar-w); padding: 20px 14px; }
  .shell { padding-left: var(--sidebar-w); }
  .side-nav .brand { justify-content: flex-start; padding: 0 8px; }
  .side-nav .brand-text { display: block; }
  .side-link { flex-direction: row; gap: 12px; padding: 10px 12px; font-size: 0.875rem; }
  .side-link .nav-badge { position: static; margin-left: auto; }
  .side-section { display: block; padding: 18px 12px 6px; font-size: 0.75rem; font-weight: 650; color: var(--muted); }
  .side-cta { margin: 6px 0 10px; }
  .topbar { padding-left: 28px; padding-right: 28px; }
}
@media (min-width: 1024px) and (max-height: 860px) {
  .side-link { padding: 8px 12px; }
  .side-section { padding-top: 12px; }
  .side-nav .brand { margin-bottom: 10px; }
}
.side-nav .side-cta { display: none; }
@media (min-width: 1024px) { .side-nav .side-cta { display: flex; } }
@media (max-width: 1023px) { .side-nav .side-name { display: none; } }

/* ---------- Page header --------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 20px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.eyebrow { font-size: 0.8125rem; font-weight: 650; color: var(--accent-text); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }

/* ---------- Cards --------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.card-flush { padding: 0; overflow: hidden; }
.card-pad-sm { padding: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-body { padding: 16px 18px; }
.card-hero { background: var(--tape); color: #fff; border: 0; box-shadow: 0 14px 38px var(--glow); position: relative; overflow: hidden; }
.card-hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -80px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%); pointer-events: none; }
.card-hero .muted { color: rgba(255, 255, 255, 0.78); }

.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid-3, .grid-4 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.dash-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) {
  .dash-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .span-all { grid-column: 1 / -1; }
}

/* ---------- Stat ---------------------------------------------------------- */
.stat { display: grid; gap: 4px; }
.stat-label { font-size: 0.8125rem; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-value.lg { font-size: 1.875rem; }
.stat-sub { font-size: 0.8125rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 0.8125rem; padding: 1px 8px; border-radius: 999px; }
.delta.up { color: var(--warning-text); background: var(--warning-soft); }
.delta.down { color: var(--success-text); background: var(--success-soft); }
.delta.flat { color: var(--muted); background: var(--surface-3); }
.card-hero .delta { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ---------- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 0.9375rem; white-space: nowrap; text-decoration: none !important;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px var(--glow); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-gradient { background: var(--primary); border: 0; color: var(--on-primary); box-shadow: 0 8px 22px var(--glow); }
.btn-gradient:hover { background: var(--primary-hover); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-text); }
.btn-soft:hover { background: var(--primary-soft-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.95); background: var(--danger); }
.btn-danger-soft { background: var(--danger-soft); border-color: transparent; color: var(--danger-text); }
.btn-white { background: #fff; border-color: #fff; color: var(--tape); }
.btn-white:hover { background: var(--primary-soft); }
.btn-glass { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.24); color: #fff; }
.btn-glass:hover { background: rgba(255, 255, 255, 0.26); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.875rem; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; padding: 0; border-radius: 12px; border: 0; background: transparent; color: var(--text-2); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 10px; }
.btn .spinner, .icon-btn .spinner { width: 18px; height: 18px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick-action { display: grid; justify-items: center; gap: 8px; padding: 14px 8px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 0.8125rem; text-align: center; text-decoration: none !important; box-shadow: var(--shadow-sm); }
.quick-action:hover { border-color: var(--primary-soft-2); background: var(--surface-2); }
.quick-action .qa-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; }
.qa-out .qa-icon { background: var(--danger-soft); color: var(--danger-text); }
.qa-in .qa-icon { background: var(--success-soft); color: var(--success-text); }
.qa-opname .qa-icon { background: var(--accent-soft); color: var(--accent-text); }
@media (min-width: 768px) {
  .quick-action { grid-template-columns: auto 1fr; justify-items: start; align-items: center; text-align: left; padding: 14px 16px; font-size: 0.9375rem; }
}

/* ---------- Forms --------------------------------------------------------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 0.8125rem; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 0.75rem; color: var(--muted); }
.field .error-text { font-size: 0.8125rem; color: var(--danger-text); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s; font-size: 1rem;
}
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
.textarea { min-height: 88px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 42px; }
.input-group .icon { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 70px; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.875rem; pointer-events: none; }
.form-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) {
  .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .full { grid-column: 1 / -1; }
}
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9375rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.picker-btn { width: 100%; min-height: 56px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.picker-btn:hover { border-color: var(--primary); }
.picker-btn .placeholder { color: var(--placeholder); }
.picker-btn[aria-invalid="true"] { border-color: var(--danger); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 0.875rem; font-weight: 550;
}
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .count { font-size: 0.75rem; font-weight: 700; opacity: 0.75; }
.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-3); width: 100%; }
.segmented button, .segmented a { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; font-size: 0.875rem; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; padding: 0 10px; }
.segmented a { text-decoration: none !important; }
.segmented button.active, .segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented.compact { width: auto; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.stepper button { width: 44px; height: 44px; border: 0; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; }
.stepper button:hover { background: var(--surface-3); }
.stepper input { width: 76px; height: 44px; border: 0; text-align: center; font-weight: 650; font-size: 1rem; background: transparent; font-variant-numeric: tabular-nums; }
.stepper input:focus { outline: none; background: var(--primary-soft); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .input-group { flex: 1 1 240px; }
.month-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px; }
.month-nav strong { min-width: 140px; text-align: center; font-size: 0.9375rem; }

/* ---------- Badges -------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--success-soft); color: var(--success-text); }
.badge.low { background: var(--warning-soft); color: var(--warning-text); }
.badge.out { background: var(--danger-soft); color: var(--danger-text); }
.badge.info { background: var(--info-soft); color: var(--info-text); }
.badge.primary { background: var(--primary-soft); color: var(--primary-text); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.neutral { background: var(--surface-3); color: var(--muted); }
.badge.lg { height: 28px; padding: 0 12px; font-size: 0.8125rem; }
.badge-on-hero { background: rgba(255, 255, 255, 0.18); color: #fff; }
.type-pill { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.type-pill.in { background: var(--success-soft); color: var(--success-text); }
.type-pill.out { background: var(--danger-soft); color: var(--danger-text); }
.type-pill.adj { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- Lists --------------------------------------------------------- */
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none !important; min-height: 60px; background: transparent; width: 100%; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover, button.list-row:hover { background: var(--surface-2); }
.list-row .title { font-weight: 600; font-size: 0.9375rem; }
.list-row .meta { font-size: 0.8125rem; color: var(--muted); }
.list-row .end { margin-left: auto; text-align: right; display: grid; justify-items: end; gap: 2px; flex: none; }
.list-row .qty { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1rem; }
.list-row .chev { color: var(--placeholder); flex: none; }
.list-compact .list-row { min-height: 52px; padding: 10px 14px; }
.menu-group { display: grid; gap: 8px; }
.menu-group h3 { font-size: 0.8125rem; font-weight: 700; color: var(--muted); padding: 0 4px; }
.menu-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.menu-icon.accent { background: var(--accent-soft); color: var(--accent-text); }
.menu-icon.danger { background: var(--danger-soft); color: var(--danger-text); }
.menu-icon.success { background: var(--success-soft); color: var(--success-text); }
.menu-icon.warning { background: var(--warning-soft); color: var(--warning-text); }

/* ---------- Progress & bars ----------------------------------------------- */
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--primary); transition: width 0.5s var(--ease); }
.progress.ok > span { background: var(--success); }
.progress.low > span { background: var(--warning); }
.progress.out > span { background: var(--danger); }
.progress.thin { height: 5px; }
.progress.on-hero { background: rgba(255, 255, 255, 0.22); }
.progress.on-hero > span { background: #fff; }
.bar-list { display: grid; gap: 12px; }
.bar-row { display: grid; gap: 6px; }
.bar-row .bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 0.875rem; }
.bar-row .bar-label span:first-child { font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.6s var(--ease); }
.mini-bars { display: flex; align-items: flex-end; gap: 8px; height: 96px; }
.mini-bars .mb { flex: 1; display: grid; gap: 6px; justify-items: center; align-content: end; height: 100%; }
.mini-bars .mb-bar { width: 100%; max-width: 36px; border-radius: 8px 8px 4px 4px; background: var(--primary-soft-2); min-height: 4px; height: 4px; transition: height 0.6s var(--ease); }
.mini-bars .mb.current .mb-bar { background: linear-gradient(180deg, var(--accent), var(--primary)); }
.mini-bars .mb-label { font-size: 0.6875rem; color: var(--muted); }

/* ---------- Checklist stepper --------------------------------------------- */
.steps { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 32px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
.step:last-child::before { display: none; }
.step-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); position: relative; z-index: 1; }
.step.done .step-dot { background: var(--success-soft); color: var(--success-text); }
.step.todo .step-dot { background: var(--primary-soft); color: var(--primary-text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); }
.step.waiting .step-dot { background: var(--surface-3); color: var(--muted); }
.step.blocked .step-dot { background: var(--surface-3); color: var(--placeholder); }
.step.done::before { background: var(--success); opacity: 0.35; }
.step-body { padding-top: 4px; display: grid; gap: 2px; }
.step-body .title { font-weight: 600; }
.step-body .detail { font-size: 0.8125rem; color: var(--muted); }
.step-body .btn { justify-self: start; margin-top: 6px; }

/* ---------- Table --------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th { text-align: left; font-size: 0.8125rem; font-weight: 650; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table .num { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); }
.only-desktop { display: none; }
@media (min-width: 768px) {
  .only-mobile { display: none !important; }
  .only-desktop { display: block; }
  table.only-desktop { display: table; }
}

/* ---------- Empty, skeleton, banners -------------------------------------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 32px 16px; color: var(--muted); }
.empty .empty-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); margin-bottom: 4px; }
.empty.ok .empty-icon { background: var(--success-soft); color: var(--success-text); }
.empty h3 { color: var(--text); }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-line { height: 14px; border-radius: 6px; }
.sk-card { height: 120px; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--info-soft); color: var(--info-text); font-size: 0.9rem; }
.banner .icon { margin-top: 1px; }
.banner.warning { background: var(--warning-soft); color: var(--warning-text); }
.banner.danger { background: var(--danger-soft); color: var(--danger-text); }
.banner.success { background: var(--success-soft); color: var(--success-text); }
.banner.primary { background: var(--primary-soft); color: var(--primary-text); }
.banner strong { color: inherit; }
.banner .btn { margin-top: 8px; }
.offline-bar { position: sticky; top: 0; z-index: 40; background: var(--warning); color: #111827; text-align: center; font-size: 0.8125rem; font-weight: 600; padding: 6px 12px; }

/* ---------- Sheet / dialog ------------------------------------------------ */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(9, 9, 20, 0.5); backdrop-filter: blur(2px); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.18s var(--ease); }
.sheet {
  width: 100%; max-height: 92vh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg);
  animation: slide-up 0.25s var(--ease);
}
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 999px; background: var(--border-strong); margin: 4px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h2 { font-size: 1.125rem; }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); background: var(--surface); padding: 12px 0 0; }
.sheet-actions .btn { flex: 1; }
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: var(--radius-xl); padding: 22px 24px 24px; animation: pop 0.2s var(--ease); }
  .sheet.wide { max-width: 760px; }
  .sheet::before { display: none; }
  .sheet-actions { position: static; justify-content: flex-end; }
  .sheet-actions .btn { flex: 0 0 auto; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0.6; } }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }

/* ---------- Toast --------------------------------------------------------- */
.toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 640px) { .toasts { bottom: 24px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #1f1f2e; color: #fff; box-shadow: var(--shadow-lg); font-size: 0.9rem; font-weight: 500; animation: slide-up 0.25s var(--ease); }
.toast.success .icon { color: #6ee7b7; }
.toast.error { background: #7f1d1d; }
.toast .btn { margin-left: auto; min-height: 32px; }

/* ---------- Login ------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--bg); }
.auth-hero { background: var(--tape); color: #fff; padding: calc(32px + env(safe-area-inset-top)) 24px 80px; position: relative; overflow: hidden; }
.auth-hero .brand-mark { background: rgba(255, 255, 255, 0.16); color: #fff; }
.auth-hero .brand { color: #fff; }
.auth-card h2 { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; }
.auth-hero h1 { font-size: 1.75rem; margin-top: 28px; max-width: 420px; }
.auth-hero p { color: rgba(255, 255, 255, 0.82); margin-top: 10px; max-width: 420px; }
.auth-points { display: none; }
.auth-main { padding: 0 16px 32px; margin-top: -44px; position: relative; z-index: 1; }
.auth-card { max-width: 420px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 24px; box-shadow: var(--shadow-lg); }
@media (min-width: 900px) {
  .auth { grid-template-columns: 1.1fr 1fr; }
  .auth-hero { padding: 48px 56px; display: flex; flex-direction: column; }
  .auth-hero h1 { font-size: 2.75rem; line-height: 1.08; letter-spacing: -0.035em; margin-top: auto; max-width: 520px; }
  .auth-points { display: grid; gap: 14px; margin-top: 32px; margin-bottom: auto; }
  .auth-point { display: flex; gap: 12px; align-items: center; color: rgba(255, 255, 255, 0.9); }
  .auth-point .icon-wrap { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, 0.16); display: grid; place-items: center; }
  .auth-main { margin: 0; display: grid; place-items: center; padding: 48px; }
  .auth-card { width: 100%; box-shadow: var(--shadow); }
}

/* ---------- Misc components ---------------------------------------------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 0.9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 550; font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--border); margin: 4px 0; }
.group-card { display: grid; gap: 6px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.group-card .code { font-size: 0.75rem; font-weight: 700; color: var(--accent-text); }
.status-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.sticky-bottom { position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); z-index: 15; }
@media (min-width: 640px) { .sticky-bottom { bottom: 16px; } }
.action-bar { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.diff { font-weight: 700; font-variant-numeric: tabular-nums; }
.diff.plus { color: var(--success-text); }
.diff.minus { color: var(--danger-text); }
.count-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.count-row:last-child { border-bottom: 0; }
.count-row.counted { background: color-mix(in srgb, var(--success-soft) 45%, transparent); }
.count-row.has-diff { background: color-mix(in srgb, var(--warning-soft) 60%, transparent); }
.count-row .count-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.8125rem; color: var(--muted); align-items: center; }
.count-row .note-input { grid-column: 1 / -1; }
.audit-diff { font-size: 0.8125rem; display: grid; gap: 4px; margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
.audit-diff code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.radio-card { display: grid; gap: 4px; padding: 14px; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; }
.radio-card:hover { border-color: var(--border-strong); }
.radio-card.active { border-color: var(--primary); background: var(--primary-soft); }
.radio-card .title { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.radio-card .desc { font-size: 0.8125rem; color: var(--muted); }
.fade-in { animation: fade 0.25s var(--ease); }
.link-btn { border: 0; background: none; color: var(--primary); font-weight: 600; padding: 0; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; position: relative; z-index: 1; }

/* ---------- Details (accordion laporan) ----------------------------------- */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details:not([open]) > summary { border-bottom: 0; }
details > summary:hover { background: var(--surface-2); }
.list-row input[type="checkbox"], .radio-card input[type="radio"] { width: 20px; height: 20px; accent-color: var(--primary); flex: none; margin: 0; }
.theme-options .radio-card { justify-items: center; text-align: center; }

/* ---------- Penyempurnaan hasil QA visual --------------------------------- */
.card-head h2, .section-head h2 { display: flex; align-items: center; gap: 8px; }
.list-row .grow > .title, .list-row .grow > .meta { display: block; }
a.card { color: inherit; text-decoration: none !important; transition: border-color 0.15s, box-shadow 0.15s; }
a.card:hover { border-color: var(--primary-soft-2); box-shadow: var(--shadow); }
.stats-inline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 480px) { .stats-inline .stat-value { font-size: 1.125rem; } .stats-inline .stat-label { font-size: 0.75rem; } }
[data-balance]:empty { display: none; }
input[list]::-webkit-calendar-picker-indicator { display: none !important; }
.divider { margin: 8px 0; }
.topbar-date { color: var(--muted); font-size: 0.875rem; font-weight: 500; }
.row > div, .row > .stack-sm, .row > .stack { min-width: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
.stack, .stack-sm, .stack-lg { grid-template-columns: minmax(0, 1fr); }
.action-bar .btn { padding: 0 14px; }
@media (max-width: 479px) { .action-bar [data-dirty] { visibility: hidden; } }


/* ==========================================================================
   Stoka 3: ruang kerja, rak status, asisten, pengingat, memo
   ========================================================================== */

/* ---------- Pita modul (penanda ruang kerja) ------------------------------ */
.tape-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.module-tape {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border: 0; border-radius: var(--radius); background: var(--tape); color: var(--tape-ink);
  box-shadow: 0 6px 16px var(--glow); transition: transform 0.15s var(--ease);
}
.module-tape:active { transform: scale(0.98); }
.module-tape .tape-mark { background: rgba(255, 255, 255, 0.16); color: #fff; }
.module-tape .tape-text { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.module-tape strong { font-size: 0.9375rem; font-weight: 750; letter-spacing: -0.01em; }
.module-tape small { font-size: 0.75rem; color: var(--tape-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-tape .tape-chev { opacity: 0.8; }
.module-tape.compact { width: auto; padding: 6px 10px 6px 6px; gap: 8px; border-radius: 12px; box-shadow: none; }
.module-tape.compact .tape-mark { width: 28px; height: 28px; border-radius: 8px; }
.module-tape.compact strong { font-size: 0.9375rem; }
.side-nav .module-tape { margin-bottom: 4px; }
@media (min-width: 640px) and (max-width: 1023px) {
  .side-nav .module-tape { padding: 8px; justify-content: center; }
  .side-nav .module-tape .tape-text, .side-nav .module-tape .tape-chev { display: none; }
}
.module-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); flex: none; display: inline-block; }
.side-module .module-dot { width: 12px; height: 12px; }
.module-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.module-chip:not([data-tape]) { background: var(--surface-3); color: var(--muted); }
.module-chip.wa-on { background: var(--success-soft); color: var(--success-text); }
.module-check { padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--border); align-items: center; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }

.switch-list { display: grid; gap: 10px; }
.switch-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius-lg); border: 1.5px solid var(--border); color: var(--text); text-decoration: none !important; }
.switch-card .grow { display: grid; }
.switch-card:hover { border-color: var(--primary); }
.switch-card.active { border-color: var(--primary); background: var(--primary-soft); }
.switch-card .tape-mark { background: var(--tape); color: #fff; }

/* ---------- Navigasi bawah tanpa modul (4 kolom) -------------------------- */
.bottom-nav.four { grid-template-columns: repeat(4, 1fr); }

/* ---------- Tombol asisten ------------------------------------------------ */
.assist-fab {
  position: fixed; z-index: 28; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface); color: var(--primary-text); font-weight: 700; font-size: 0.875rem;
  box-shadow: var(--shadow-lg); transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.assist-fab:hover { transform: translateY(-2px); }
.assist-fab .assist-label { display: none; }
.shell.hide-assist .assist-fab { display: none; }
@media (max-width: 639px) { .shell.no-module .assist-fab { display: none; } }
@media (min-width: 640px) { .assist-fab { bottom: 24px; right: 24px; } .assist-fab .assist-label { display: inline; } }

/* ---------- Transisi halaman (respons atas navigasi) --------------------- */
.view-enter { animation: view-in 0.32s var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Rak status (shelf gauge) -------------------------------------- */
.gauge { display: grid; grid-template-columns: repeat(auto-fill, minmax(12px, 1fr)); gap: 4px; }
.bin { display: block; height: 22px; border-radius: 4px; background: var(--bin-empty); }
.bin.ok { background: var(--success); }
.bin.low { background: var(--warning); }
.bin.out { background: var(--danger); }
.bin.none { background: var(--bin-empty); }
.gauge.fill-in .bin { animation: bin-in 0.42s var(--ease-out) both; }
@keyframes bin-in { from { transform: scaleY(0.15); transform-origin: bottom; opacity: 0; } }

/* ---------- Hub (pilih ruang kerja) --------------------------------------- */
.hub { max-width: 1040px; margin: 0 auto; padding-top: 8px; }
.hub-head { display: grid; gap: 6px; }
.display { font-size: 2.25rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; }
@media (min-width: 768px) { .display { font-size: 3rem; } }
.hub-lead { color: var(--muted); font-size: 1rem; }
.ws-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .ws-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ws-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.ws-tape { display: flex; align-items: center; gap: 12px; padding: 18px 20px; background: var(--tape); color: var(--tape-ink); text-decoration: none !important; }
.ws-tape .tape-mark { width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 255, 255, 0.16); color: #fff; }
.ws-tape strong { display: block; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.ws-tape small { display: block; color: var(--tape-muted); font-size: 0.8125rem; }
.ws-tape:hover { filter: brightness(1.08); }
.ws-body { display: grid; gap: 16px; padding: 18px 20px 20px; }
.ws-body .gauge .bin { height: 26px; }
.ws-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ws-stat { display: grid; gap: 0; }
.ws-stat b { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; white-space: nowrap; }
.ws-stat span { font-size: 0.75rem; color: var(--muted); }
.ws-stat.is-out b { color: var(--danger-text); }
.ws-stat.is-low b { color: var(--warning-text); }
@media (max-width: 420px) { .ws-stat b { font-size: 1.125rem; } }
.ws-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.static { min-height: 28px; padding: 0 10px; font-size: 0.75rem; background: var(--primary-soft); border-color: transparent; color: var(--primary-text); cursor: default; }
.ws-next { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.ws-next .grow { display: grid; }
.ws-next-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.ws-next.done .ws-next-icon { background: var(--success-soft); color: var(--success-text); }
.ws-empty { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius); border: 1.5px dashed var(--border-strong); color: var(--muted); }

.ask-bar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.ask-bar:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.ask-icon { color: var(--primary); display: grid; }
.ask-input { flex: 1; min-width: 0; border: 0; background: transparent; min-height: 44px; font-size: 1rem; }
.ask-input:focus, .ask-input:focus-visible { outline: none; box-shadow: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.hub-links { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .hub-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hub-link { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.hub-link > span:last-child { display: grid; }
.hub-link:hover { border-color: var(--border-strong); }

/* ---------- Beranda modul -------------------------------------------------- */
.mod-hero { display: grid; gap: 16px; padding: 22px 20px; border-radius: var(--radius-xl); background: var(--tape); color: var(--tape-ink); box-shadow: 0 16px 40px var(--glow); }
.mod-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mod-hero-top .small { color: var(--tape-muted); }
.mod-hero h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.035em; }
@media (min-width: 768px) { .mod-hero { padding: 28px; } .mod-hero h1 { font-size: 2.25rem; } }
.hero-period { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 0.8125rem; font-weight: 650; }
.mod-hero .gauge { gap: 3px; grid-template-columns: repeat(auto-fill, minmax(10px, 1fr)); }
.mod-hero .bin { height: 30px; border-radius: 3px; }
.mod-hero .bin.none { background: rgba(255, 255, 255, 0.18); }
.mod-hero-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.875rem; font-weight: 600; align-items: center; }
.mod-hero-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.mod-hero-legend .bin, .auth-legend .bin { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.muted-on-hero { color: var(--tape-muted); font-weight: 500; }
.mod-hero-empty { color: var(--tape-muted); }
.quick-actions { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
@media (max-width: 480px) { .quick-action { font-size: 0.75rem; padding: 12px 4px; } }
.qa-memo .qa-icon { background: var(--primary-soft); color: var(--primary-text); }

/* ---------- Login: rak ilustratif ----------------------------------------- */
.shelf-art { display: grid; gap: 10px; margin-top: 28px; max-width: 460px; }
.shelf-row { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; padding-bottom: 8px; border-bottom: 3px solid rgba(255, 255, 255, 0.22); }
.shelf-art .bin { height: 26px; }
.auth-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 0.8125rem; color: rgba(255, 255, 255, 0.8); }
.auth-legend > span { display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 900px) { .shelf-art { margin-top: 40px; } .shelf-art .bin { height: 34px; } }
@media (max-width: 899px) { .shelf-art { margin-top: 20px; } .shelf-art .shelf-row:nth-child(n+2), .auth-legend { display: none; } .shelf-art .bin { height: 14px; } .shelf-row { border-bottom-width: 2px; padding-bottom: 6px; } }

/* ---------- Asisten (chat) ------------------------------------------------ */
.chat { display: grid; gap: 12px; }
.chat-log { display: flex; flex-direction: column; gap: 10px; min-height: 260px; max-height: 58vh; overflow-y: auto; padding: 4px 2px; overscroll-behavior: contain; }
.chat-page .chat-log { max-height: none; min-height: 50vh; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 0.9375rem; line-height: 1.5; display: grid; gap: 2px; overflow-wrap: anywhere; animation: pop 0.2s var(--ease-out); }
.msg.me { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--surface-3); color: var(--text); border-bottom-left-radius: 6px; }
.msg.error { background: var(--danger-soft); color: var(--danger-text); display: flex; align-items: center; gap: 8px; }
.msg.attach { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg-line { display: block; }
.msg-gap { display: block; height: 6px; }
.msg.typing { display: flex; gap: 4px; padding: 14px; }
.msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite ease-in-out; }
.msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-intro { display: grid; gap: 12px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); }
.intro-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 6px; border-radius: 18px; border: 1px solid var(--border-strong); background: var(--surface); }
.chat-form:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.chat-input { flex: 1; min-width: 0; border: 0; resize: none; background: transparent; padding: 10px; min-height: 44px; max-height: 140px; font-size: 1rem; }
.chat-input:focus, .chat-input:focus-visible { outline: none; box-shadow: none; }
.chat-send { min-width: 44px; padding: 0 12px; border-radius: 14px; }
.chat-form.is-busy .chat-send { opacity: 0.5; pointer-events: none; }
.chat-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pending-card { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius-lg); border: 1.5px solid var(--warning); background: var(--warning-soft); }
.pending-card .row { color: var(--warning-text); }
.pending-summary { font-size: 0.9375rem; }
.sheet.sheet-chat { height: min(92dvh, 760px); max-height: 92dvh; display: flex; flex-direction: column; overflow: hidden; }
.sheet-chat .sheet-body { flex: 1; min-height: 0; display: flex; }
.sheet-chat .chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sheet-chat .chat-log { flex: 1; max-height: none; min-height: 0; }

/* ---------- Pengingat ------------------------------------------------------ */
.wa-status { display: flex; align-items: center; gap: 14px; }
.wa-status .grow > p { margin-top: 2px; }
.reminder-list { display: grid; gap: 12px; }
@media (min-width: 900px) { .reminder-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.reminder { display: grid; gap: 14px; align-content: start; transition: opacity 0.2s; }
.reminder.off .reminder-controls { opacity: 0.55; }
.reminder-head { display: flex; gap: 14px; align-items: flex-start; }
.reminder-head h2 { font-size: 1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reminder-head p { margin-top: 4px; }
.reminder-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.select-sm { min-height: 36px; padding: 4px 34px 4px 10px; font-size: 0.875rem; width: auto; border-radius: 10px; }
.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { width: 46px; height: 28px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background 0.2s var(--ease); }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.22s var(--ease-out); }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--focus); }
.wa-bubble { white-space: pre-wrap; padding: 12px 14px; border-radius: 14px 14px 14px 4px; background: #e7f8dc; color: #12261a; font-size: 0.9rem; line-height: 1.5; max-height: 50vh; overflow: auto; }
:root[data-theme="dark"] .wa-bubble { background: #1d3a2b; color: #e6f5ea; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-bubble { background: #1d3a2b; color: #e6f5ea; } }

/* ---------- AI & WhatsApp -------------------------------------------------- */
.provider-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .provider-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.provider-grid .radio-card { align-content: start; }
.provider-grid .badge { justify-self: start; }
.toggle-list { display: grid; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.toggle-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; cursor: pointer; }
.toggle-row + .toggle-row { border-top: 1px solid var(--border); }
.toggle-row .grow { display: grid; }
.secret-list { display: grid; gap: 8px; }
.secret-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82em; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); overflow-wrap: anywhere; }
.copy-field { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.copy-field code { flex: 1; background: none; padding: 0; }

/* ---------- Memo pembelian ------------------------------------------------- */
.memo-tabs { overflow-x: auto; scrollbar-width: none; }
.memo-tabs::-webkit-scrollbar { display: none; }
.memo-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .memo-layout { grid-template-columns: minmax(0, 1fr) 380px; } .memo-layout aside { position: sticky; top: calc(var(--top-h) + 12px); } }
.memo-lines { display: grid; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.memo-line { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; padding: 12px 14px; align-items: center; transition: opacity 0.15s, background 0.15s; }
.memo-line + .memo-line { border-top: 1px solid var(--border); }
.memo-line.excluded { opacity: 0.5; background: var(--surface-2); }
.memo-check input { width: 20px; height: 20px; accent-color: var(--primary); margin: 0; }
.memo-item { display: grid; gap: 2px; justify-items: start; }
.memo-num { display: grid; gap: 2px; }
.memo-num .input { min-height: 40px; padding: 6px 10px; text-align: right; }
.memo-sub { text-align: right; }
.memo-line { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.3fr); }
.memo-line > .memo-item { grid-column: 2 / -1; }
.memo-line > :nth-child(3) { grid-column: 2; }
.memo-line > :nth-child(4) { grid-column: 3; }
.memo-line > .memo-sub { grid-column: 2 / -1; }
@media (min-width: 640px) {
  .memo-line { grid-template-columns: auto minmax(0, 1fr) 96px 130px 120px; }
  .memo-line > .memo-item, .memo-line > :nth-child(3), .memo-line > :nth-child(4), .memo-line > .memo-sub { grid-column: auto; }
}
.memo-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary-text); font-weight: 650; }
.memo-total strong { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; }
.memo-more > summary { padding: 10px 0; font-weight: 650; color: var(--primary-text); }
.memo-more[open] > summary { margin-bottom: 10px; }
.memo-paper {
  background: #fffefa; color: #1d2333; border-radius: 6px; padding: 26px 24px 20px; font-size: 0.8125rem; line-height: 1.6;
  box-shadow: 0 1px 0 #e7e3d6, 0 12px 32px rgba(20, 26, 46, 0.12); border: 1px solid #ebe7da; display: grid; gap: 12px;
}
.paper-head { text-align: center; font-weight: 800; letter-spacing: 0.04em; font-size: 0.9375rem; text-decoration: underline; text-underline-offset: 3px; }
.paper-meta { display: grid; grid-template-columns: 72px 1fr; gap: 2px 8px; margin: 0; padding-bottom: 10px; border-bottom: 1.5px solid #1d2333; }
.paper-meta dt { color: #4b5368; }
.paper-meta dd { margin: 0; }
.paper-meta dd::before { content: ": "; }
.paper-body { display: grid; gap: 8px; text-align: justify; }
.paper-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px dashed #c9c4b3; color: #4b5368; }
.paper-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Kelompok (master) ----------------------------------------------- */
.category-card { text-align: left; color: inherit; font: inherit; cursor: pointer; }
.category-card:hover { border-color: var(--primary); }
.category-card .kv dd { text-align: left; }

/* ==========================================================================
   Stoka 3.1 — foto bukti, gambar barang, login tersimpan, data & penyimpanan
   ========================================================================== */
.text-success { color: var(--success-text); display: inline-flex; align-items: center; gap: 6px; }
.text-danger { color: var(--danger-text); display: inline-flex; align-items: center; gap: 6px; }
.text-warning { color: var(--warning-text); }

/* Thumbnail: ukuran tetap → tidak ada pergeseran tata letak saat gambar dimuat. */
.thumb-box { position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 12px; background: var(--surface-3); color: var(--placeholder); }
.thumb-box.t40 { width: 40px; height: 40px; border-radius: 11px; }
.thumb-box.t48 { width: 48px; height: 48px; }
.thumb-box.t56 { width: 56px; height: 56px; border-radius: 14px; }
.thumb-box.t96 { width: 96px; height: 96px; border-radius: 18px; }
.thumb-box .thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-box.broken .thumb { visibility: hidden; }
.thumb-box.broken::after { content: ""; position: absolute; inset: 30%; border-radius: 4px; border: 2px dashed var(--border-strong); }
.thumb-slot { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-3); color: var(--placeholder); display: grid; place-items: center; flex: none; }
.thumb-slot.t56 { width: 56px; height: 56px; border-radius: 14px; }
.media-pill { position: relative; flex: none; display: inline-grid; }
.media-pill .type-dot { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center; border: 2px solid var(--surface); }
.media-pill .type-dot.out { background: var(--danger-soft); color: var(--danger-text); }
.media-pill .type-dot.in { background: var(--success-soft); color: var(--success-text); }
.media-pill .type-dot.adj { background: var(--accent-soft); color: var(--accent-text); }
.badge.photo-need { background: var(--warning-soft); color: var(--warning-text); }
button.thumb-btn { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 12px; }
button.thumb-btn:focus-visible { box-shadow: var(--focus); outline: none; }

/* Field foto */
.photo-field .photo-empty { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius); border: 1.5px dashed var(--border-strong); background: var(--surface-2); }
.photo-field[aria-invalid="true"] .photo-empty, .photo-field[aria-invalid="true"] .photo-card { border-color: var(--danger); background: var(--danger-soft); }
.photo-empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.photo-field .button-row { margin-top: 8px; }
.photo-card { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.photo-preview { width: 72px; height: 72px; border-radius: 12px; overflow: hidden; border: 0; padding: 0; background: var(--surface-3); color: var(--placeholder); display: grid; place-items: center; flex: none; cursor: zoom-in; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-field.is-working .photo-preview img { opacity: 0.7; }
.photo-actions { display: flex; gap: 4px; align-items: center; flex: none; }
.photo-field .progress { max-width: 220px; }
.photo-field .progress > span { transition: width 0.2s linear; }

/* Foto di detail transaksi / barang */
.photo-proof { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.photo-proof.missing { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.item-hero { display: flex; gap: 16px; align-items: flex-start; }
.item-image { position: relative; flex: none; }
.item-image .thumb-box, .item-image .thumb-slot { width: 96px; height: 96px; border-radius: 18px; }
.item-image .image-edit { position: absolute; right: -6px; bottom: -6px; width: 34px; height: 34px; border-radius: 11px; border: 2px solid var(--surface); background: var(--primary); color: var(--on-primary); display: grid; place-items: center; cursor: pointer; padding: 0; }
.item-image .image-edit:hover { background: var(--primary-hover); }
.item-image .uploading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(9, 9, 20, 0.45); border-radius: 18px; color: #fff; font-size: 0.75rem; font-weight: 700; }
@media (max-width: 479px) { .item-image .thumb-box, .item-image .thumb-slot { width: 76px; height: 76px; } }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(6, 7, 14, 0.94); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #fff; animation: fade 0.18s var(--ease); }
.lightbox-open { overflow: hidden; }
.lightbox-bar { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px 18px; }
.lightbox-caption { color: rgba(255, 255, 255, 0.7); }
.lightbox-btn { color: #fff; background: rgba(255, 255, 255, 0.12); }
.lightbox-btn:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-stage { display: grid; place-items: center; padding: 8px 12px; min-height: 0; overflow: auto; }
.lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; transition: filter 0.25s var(--ease); image-orientation: from-image; }
.lightbox-img.loading { filter: blur(6px); }
.lightbox-msg { display: grid; justify-items: center; gap: 10px; max-width: 320px; text-align: center; color: rgba(255, 255, 255, 0.82); font-size: 0.9rem; }
.lightbox-actions { display: flex; gap: 10px; justify-content: center; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }

/* Login tersimpan */
.saved-accounts { display: grid; gap: 10px; }
.saved-account { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: var(--radius-lg); border: 1.5px solid var(--border); background: var(--surface); }
.saved-account:hover { border-color: var(--primary-soft-2); }
.saved-account .avatar { width: 42px; height: 42px; font-size: 0.9rem; flex: none; }
.saved-account .btn { flex: none; }
.saved-account .grow { min-width: 0; }
@media (max-width: 479px) {
  .saved-account { gap: 10px; padding: 10px; }
  .saved-account .avatar { width: 36px; height: 36px; font-size: 0.8125rem; }
  .saved-account .btn { padding: 0 12px; min-height: 40px; }
}
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.8125rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Data & penyimpanan */
.usage { display: grid; gap: 8px; }
.usage-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.usage .progress { height: 10px; }
.usage .progress.warn > span { background: var(--warning); }
.usage .progress.danger > span { background: var(--danger); }
.month-table td .badge { height: 22px; }
.purge-box { border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); background: color-mix(in srgb, var(--danger-soft) 55%, var(--surface)); border-radius: var(--radius-lg); padding: 16px; }
.setting-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.setting-row .grow { min-width: 0; }
.readonly-note { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 0.8125rem; }
.card { scroll-margin-top: calc(var(--top-h) + 12px); }
