/* =========================================================
   Monitoring Manufacturing Order — stylesheet
   Arah visual: lantai produksi. Tiap section punya warna
   kode sendiri (Filling biru, Labelling ungu, Packing toska,
   Siap Pack hijau) dan warna itu dipakai konsisten sebagai
   informasi, bukan hiasan. Angka qty adalah tokoh utama.
   ========================================================= */

:root {
  --bg: #E9EDF1;
  --surface: #FFFFFF;
  --surface-2: #F3F5F8;
  --ink: #16202A;
  --ink-2: #3F4C5A;
  --muted: #687584;
  --line: #D3D9E0;
  --line-2: #E3E8ED;

  --c-filling: #2459C4;
  --c-labelling: #7445C8;
  --c-packing: #0A7E86;
  --c-siappack: #3B7A22;
  --c-admin: #4338CA;
  --c-mixing: #B45309;
  --c-ppic: #0E7490;
  --st-wait: #BE185D; /* Belum diterima */

  --st0: #687584;   /* Antri   */
  --st1: #B06A00;   /* Proses  */
  --st2: #2E7D4A;   /* Selesai */
  --k-wait: #B06A00;
  --k-ok: #2E7D4A;
  --k-part: #2459C4;
  --k-back: #8A4B4B;

  --danger: #B42318;
  --focus: #2459C4;

  --r-s: 6px;
  --r: 12px;
  --r-l: 20px;
  --shadow-1: 0 1px 2px rgba(22, 32, 42, .06), 0 0 0 1px rgba(22, 32, 42, .05);
  --shadow-2: 0 10px 30px rgba(22, 32, 42, .18);

  --tabbar-h: 64px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F151B;
    --surface: #17202A;
    --surface-2: #1E2833;
    --ink: #E6EBF0;
    --ink-2: #C1CAD3;
    --muted: #8E9AA7;
    --line: #2B3745;
    --line-2: #233040;

    --c-filling: #79A2FF;
    --c-labelling: #B697FF;
    --c-packing: #45C7CD;
    --c-siappack: #8FCB6E;
    --c-admin: #8E96FF;
    --c-mixing: #F0A35E;
    --c-ppic: #5CC8DE;
    --st-wait: #F472B6;

    --st0: #95A1AE;
    --st1: #F0A93F;
    --st2: #62C487;
    --k-wait: #F0A93F;
    --k-ok: #62C487;
    --k-part: #79A2FF;
    --k-back: #D89494;

    --danger: #F2837A;
    --focus: #79A2FF;
    --shadow-1: 0 0 0 1px rgba(255, 255, 255, .05);
    --shadow-2: 0 12px 34px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.noscroll { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.muted { color: var(--muted); }
.num, .tabnum { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------
   Gate (setup & login)
   --------------------------------------------------------- */
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}
.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--r-l);
  padding: 28px 22px;
  box-shadow: var(--shadow-1);
}
.gate-mark { width: 52px; height: 52px; border-radius: 14px; display: block; margin-bottom: 18px; }
.gate h1 { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.gate .lead { color: var(--ink-2); margin: 8px 0 22px; }
.gate .hint { margin-top: 16px; }

/* ---------------------------------------------------------
   Shell
   --------------------------------------------------------- */
.shell { min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; min-width: 0; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.topbar .brand { margin-right: auto; }

.sync {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 5px 11px;
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
}
.sync .long { display: none; }
@media (min-width: 420px) { .sync .long { display: inline; } }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st2); flex: none; }
.sync.busy .dot { background: var(--st1); animation: pulse 1s ease-in-out infinite; }
.sync.off .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  border: none; background: var(--ink); color: var(--surface);
  font-weight: 600; font-size: 14px;
}

/* Cegah konten panjang (nama produk, tombol periode) melebarkan halaman */
main, .page, .panel, .flow, .flow-sections, .dash-grid > *, .cards > *, .hlist, .hrow, .toolbar > *, .panel-head > * { min-width: 0; }
.panel-head .seg { max-width: 100%; }

main {
  padding: 16px 16px calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom));
  max-width: 1180px;
  margin: 0 auto;
  outline: none;
}

/* Bottom tab bar (mobile) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(var(--n, 5), 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  --accent: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tabbar-h);
  border: none; background: none; color: var(--muted);
  font-size: 11.5px; font-weight: 500;
  position: relative; min-width: 0; padding: 0;
}
.tab span:not(.count) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--accent); font-weight: 600; }
.tab.active::before {
  content: ""; position: absolute; top: 0; left: 22%; right: 22%;
  height: 3px; border-radius: 0 0 3px 3px; background: var(--accent);
}
.tab .count {
  position: absolute; top: 7px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--st-wait); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}

/* Side rail (desktop) */
.rail { display: none; }

.fab {
  --accent: var(--ink);
  position: fixed; z-index: 25;
  right: 16px; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px;
  height: 54px; padding: 0 20px 0 16px;
  border: none; border-radius: 16px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow-2);
}
.fab svg { width: 22px; height: 22px; }
@media (prefers-color-scheme: dark) { .fab { color: #0F151B; } }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 236px 1fr; grid-template-rows: auto 1fr; }
  .rail {
    display: flex; flex-direction: column; gap: 6px;
    grid-row: 1 / span 2;
    position: sticky; top: 0; height: 100dvh;
    padding: 20px 14px;
    background: var(--surface);
    border-right: 1px solid var(--line);
  }
  .rail .brand { padding: 4px 8px 18px; }
  .rail-nav { display: flex; flex-direction: column; gap: 2px; }
  .rail-link {
    --accent: var(--ink);
    display: flex; align-items: center; gap: 12px;
    border: none; background: none; text-align: left;
    padding: 10px 12px; border-radius: 10px;
    color: var(--ink-2); font-weight: 500;
  }
  .rail-link svg { width: 20px; height: 20px; color: var(--accent); }
  .rail-link:hover { background: var(--surface-2); }
  .rail-link.active { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
  .rail-link .count {
    margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--st-wait); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center;
  }
  .rail-user {
    margin-top: auto; display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
    padding: 10px; text-align: left;
  }
  .rail-user small { display: block; color: var(--muted); font-size: 12px; }
  .topbar { grid-column: 2; padding-top: 14px; padding-bottom: 14px; }
  .topbar .brand, .topbar .avatar { display: none; }
  .topbar .sync { margin-left: auto; }
  main { grid-column: 2; padding: 24px 32px 120px; width: 100%; }
  .tabbar { display: none; }
  .fab { bottom: 28px; right: 32px; }
}

/* ---------------------------------------------------------
   Page & generic blocks
   --------------------------------------------------------- */
.page-head { margin: 4px 0 16px; }
.page-head h1 { font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.015em; }
.page-head .sub { color: var(--ink-2); margin-top: 4px; }
.page[style*="--accent"] .page-head h1 { color: var(--accent); }

.panel {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  padding: 16px;
}
.panel h2 { font-size: 16px; font-weight: 600; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }

.empty {
  text-align: center; padding: 36px 16px; color: var(--muted);
  border: 1.5px dashed var(--line); border-radius: var(--r);
}
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

.loading-block { padding: 48px 0; text-align: center; color: var(--muted); }
.spin {
  display: inline-block; width: 16px; height: 16px; vertical-align: -3px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------
   Buttons, inputs, chips
   --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14.5px;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { --accent: var(--ink); background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0F151B; } }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  border: none; background: transparent; color: var(--ink-2);
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }

.lbl { display: block; font-weight: 600; font-size: 14px; margin: 18px 0 7px; }
.lbl:first-child { margin-top: 0; }
.lbl .opt { font-weight: 400; color: var(--muted); }

.input, select.input, textarea.input {
  width: 100%; min-height: 46px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); padding: 10px 12px;
  font-size: 16px; /* cegah zoom otomatis di iOS */
}
textarea.input { min-height: 72px; resize: vertical; }
.input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.input.manual { margin-top: 10px; }

.search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 0 12px; min-height: 44px;
}
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { border: none; outline: none; background: transparent; width: 100%; font-size: 16px; padding: 10px 0; }
.search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }

.check { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14.5px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 500; line-height: 1.25;
}
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip-btn {
  border: 1px dashed var(--line); background: transparent; border-radius: 999px;
  padding: 7px 13px; font-size: 13.5px; color: var(--ink-2); margin-top: 8px;
}

.seg {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  background: var(--surface-2); border-radius: 11px; padding: 4px;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto; border: none; background: transparent; color: var(--ink-2);
  padding: 7px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.seg button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.seg button .n { color: var(--muted); font-weight: 500; margin-left: 4px; }

.stepper { display: flex; align-items: stretch; gap: 8px; }
.stepper .input { text-align: center; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; min-height: 54px; }
.step {
  width: 54px; flex: none; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 24px; font-weight: 500; line-height: 1;
}

.form-err { color: var(--danger); font-size: 14px; margin-top: 12px; min-height: 0; }
.form-err:empty { display: none; }
.hint { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.callout {
  background: var(--surface-2); border-radius: 10px; padding: 12px 14px;
  font-size: 14px; color: var(--ink-2); margin-top: 14px;
}
.callout.warn { background: color-mix(in srgb, var(--k-wait) 12%, var(--surface)); color: var(--ink); }

/* ---------------------------------------------------------
   Section page: stats, toolbar, cards
   --------------------------------------------------------- */
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1);
  padding: 12px; border-top: 3px solid var(--c);
}
.stat .k { font-size: 13px; color: var(--ink-2); }
.stat .v { font-size: 24px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .q { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.toolbar { display: grid; gap: 10px; margin-bottom: 14px; }
@media (min-width: 720px) { .toolbar { grid-template-columns: minmax(260px, 1fr) auto; align-items: center; } }

.cards { display: grid; gap: 10px; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; } }

.card {
  display: block; width: 100%; text-align: left;
  background: var(--surface); border: none; border-radius: var(--r);
  box-shadow: var(--shadow-1);
  padding: 14px 14px 14px 16px;
  position: relative; overflow: hidden;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--edge, var(--line)); }
.card:hover { box-shadow: var(--shadow-1), 0 4px 14px rgba(22, 32, 42, .07); }
.card.s0 { --edge: var(--st0); }
.card.s1 { --edge: var(--st1); }
.card.s2 { --edge: var(--st2); }
.card.k-wait { --edge: var(--k-wait); }
.card.k-ok { --edge: var(--k-ok); }
.card.k-part { --edge: var(--k-part); }
.card.k-back { --edge: var(--k-back); }

.card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.card-top .time { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.card-title { font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); margin-top: 3px; }
.defect { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.defect::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--accent, var(--muted)); margin-right: 7px; vertical-align: 1px; }

.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; color: var(--b); background: color-mix(in srgb, var(--b) 13%, transparent);
}
.badge.st0 { --b: var(--st0); }
.badge.st1 { --b: var(--st1); }
.badge.st2 { --b: var(--st2); }
.badge.k-wait { --b: var(--k-wait); }
.badge.k-ok { --b: var(--k-ok); }
.badge.k-part { --b: var(--k-part); }
.badge.k-back { --b: var(--k-back); }

.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line);
}
.tag .sw { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.tally { display: flex; align-items: baseline; gap: 6px; margin-top: 10px; }
.tally .big { font-size: 26px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tally .of { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.figline { font-size: 13px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.transition { font-size: 13px; margin-top: 6px; color: var(--ink-2); }

.bar { height: 8px; border-radius: 4px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--edge, var(--accent, var(--ink))); transition: width .3s ease; }
.bar.lg { height: 12px; border-radius: 6px; }

.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.card-actions:empty { display: none; }

.more { display: flex; justify-content: center; margin-top: 14px; }

/* ---------------------------------------------------------
   Dashboard
   --------------------------------------------------------- */
.flow { display: grid; gap: 10px; margin-bottom: 16px; }
.flow-sections { display: grid; gap: 8px; }
.station {
  --accent: var(--ink);
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px;
  width: 100%; text-align: left;
  background: var(--surface); border: none; border-radius: var(--r);
  box-shadow: var(--shadow-1); padding: 14px 16px;
  border-left: 5px solid var(--accent);
}
.station .st-name { font-weight: 600; color: var(--accent); }
.station .st-foot { grid-column: 1; font-size: 13px; color: var(--muted); }
.station .st-num { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.station .st-num small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.station .st-split { grid-column: 1 / -1; display: flex; gap: 3px; height: 6px; margin-top: 10px; border-radius: 3px; overflow: hidden; background: var(--surface-2); }
.station .st-split i { display: block; height: 100%; }
.station .st-split .a { background: color-mix(in srgb, var(--accent) 38%, var(--surface-2)); }
.station .st-split .p { background: var(--accent); }
.station.siap { border-left-width: 0; border-top: 5px solid var(--accent); padding-top: 16px; }
.station.batch { --accent: var(--ink-2); background: var(--surface-2); box-shadow: none; border-left: none; border: 1.5px dashed var(--line); cursor: default; }

.flow-arrow { display: flex; justify-content: center; color: var(--muted); }
.flow-arrow svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .flow { grid-template-columns: 1.35fr auto 1fr auto 0.8fr; align-items: center; }
  .flow-arrow svg { transform: rotate(-90deg); }
  .station.siap, .station.batch { align-self: stretch; grid-template-columns: 1fr; align-content: center; }
  .station.siap .st-num, .station.batch .st-num { grid-column: 1; grid-row: auto; text-align: left; margin-top: 10px; }
  .station.siap .st-foot, .station.batch .st-foot { margin-top: 8px; }
}

.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.figures div { border-left: 2px solid var(--line); padding-left: 10px; }
.figures .fig { display: block; font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figures span:not(.fig) { font-size: 12.5px; color: var(--muted); }

.custom-range { display: flex; gap: 8px; margin: -4px 0 14px; }
.custom-range label { flex: 1; font-size: 12.5px; color: var(--muted); }
.custom-range .input { min-height: 40px; padding: 6px 10px; font-size: 15px; }

.dash-grid { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 1fr 1fr; align-items: start; } }

.hlist { display: grid; gap: 12px; }
.hrow .top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.hrow .top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .top span { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hrow .bar { margin-top: 6px; height: 7px; }
.hrow .bar i { background: var(--ink-2); }
.hrow.batch .bar i { background: var(--c-siappack); }
.hrow .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.activity li:first-child { border-top: none; padding-top: 0; }
.activity .pip { width: 8px; height: 8px; border-radius: 50%; background: var(--accent, var(--muted)); margin-top: 6px; }
.activity .when { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------
   Bottom sheet / dialog
   --------------------------------------------------------- */
#sheet-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#sheet-root.open { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: rgba(10, 16, 22, .45); opacity: 0; transition: opacity .2s ease; }
#sheet-root.open .scrim { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--r-l) var(--r-l) 0 0;
  box-shadow: var(--shadow-2);
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
#sheet-root.open .sheet { transform: none; }
@media (min-width: 720px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(560px, calc(100vw - 48px)); max-height: 86dvh;
    border-radius: var(--r-l);
    transform: translate(-50%, -46%); opacity: 0;
    transition: transform .2s ease, opacity .2s ease;
  }
  #sheet-root.open .sheet { transform: translate(-50%, -50%); opacity: 1; }
}
.sheet-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 6px;
  padding: 10px 8px 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-2);
}
.sheet-head::before {
  content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px;
  border-radius: 2px; background: var(--line);
}
@media (min-width: 720px) { .sheet-head::before { display: none; } }
.sheet-title { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; padding-top: 4px; }
.sheet-body { padding: 16px 18px 6px; }
.sheet-body .d-title { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.sheet-body .lead { font-weight: 600; }

.d-progress { margin: 16px 0 6px; }
.d-progress .tally .big { font-size: 34px; }
.d-progress .bar i { background: var(--accent); }

.facts { margin: 14px 0 0; display: grid; gap: 0; }
.facts > div { display: grid; grid-template-columns: 40% 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.actions { margin-top: 18px; display: grid; gap: 10px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-grid .btn { font-weight: 500; }


.form .btn.block[type="submit"] { margin-top: 20px; }
#tujuan-detail .lbl { margin-top: 18px; }

.results { display: grid; gap: 6px; margin-top: 8px; max-height: 300px; overflow-y: auto; }
.results:empty { display: none; }
.result {
  display: block; width: 100%; text-align: left;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 9px 12px;
}
.result:hover, .result:focus-visible { border-color: var(--focus); }
.result b { display: block; font-weight: 500; font-size: 14px; line-height: 1.3; }
.result small { color: var(--muted); font-size: 12.5px; }
.results .none { color: var(--muted); font-size: 14px; padding: 8px 2px; }

.picked {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--ink); border-radius: 10px; padding: 10px 8px 10px 12px;
}
.picked > div { flex: 1; min-width: 0; }
.picked-name { font-weight: 600; font-size: 14.5px; line-height: 1.3; }

.loglist { list-style: none; margin: 0; padding: 0; }
.loglist li { padding: 11px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.loglist li:first-child { border-top: none; }
.loglist .row1 { display: flex; justify-content: space-between; gap: 10px; }
.loglist .row1 b { font-weight: 600; }
.loglist .q { font-variant-numeric: tabular-nums; font-weight: 600; }
.loglist .q.neg { color: var(--danger); }
.loglist .ket { color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.loglist .by { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.alloc { list-style: none; margin: 8px 0 0; padding: 0; }
.alloc li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.alloc li > div { flex: 1; }
.alloc small { display: block; color: var(--muted); font-size: 12.5px; }

.menu-list { display: grid; gap: 8px; margin-top: 16px; }

/* ---------------------------------------------------------
   Toast
   --------------------------------------------------------- */
#toast-root {
  position: fixed; left: 0; right: 0; z-index: 60; pointer-events: none;
  top: calc(env(safe-area-inset-top, 0px) + 62px);
  display: grid; justify-items: center; gap: 8px; padding: 0 16px;
}
@media (min-width: 960px) { #toast-root { top: 64px; left: 236px; } }
.toast {
  max-width: 460px; background: var(--ink); color: var(--surface);
  padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-2); animation: toast-in .2s ease;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.warn { background: #8A5300; color: #fff; pointer-events: auto; cursor: pointer; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }

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


/* =========================================================
   v2: peran, konfirmasi terima, due date, kendala,
   stock receh, admin
   ========================================================= */
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.stats4 .stat { padding: 10px; }
.stats4 .stat .k { font-size: 12px; line-height: 1.25; min-height: 2.5em; }
.stats4 .stat .v { font-size: 22px; }
.stats4 .stat .q { font-size: 12px; }
@media (min-width: 720px) { .stats4 .stat .k { min-height: 0; } }
.stats4:has(> .stat:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }

.seg.big { background: var(--surface); box-shadow: var(--shadow-1); }
.seg.big button { flex: 1 1 0; font-size: 14.5px; padding: 9px 12px; }
.seg.big button.active { background: var(--accent, var(--ink)); color: #fff; box-shadow: none; }
@media (prefers-color-scheme: dark) { .seg.big button.active { color: #0F151B; } }
.seg.big button.active .n { color: inherit; opacity: .8; }
.pill {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px;
  border-radius: 10px; background: var(--st-wait); color: #fff; font-size: 11.5px; font-weight: 700; vertical-align: 1px;
}

.card.s-wait, .card.rc-wait { --edge: var(--st-wait); }
.card.s-reject, .card.rc-reject { --edge: var(--k-back); opacity: .8; }
.card.rc-ok { --edge: var(--st2); }
.card.rc-empty { --edge: var(--st0); }
.badge.st-wait { --b: var(--st-wait); }
.badge.st-reject { --b: var(--k-back); }

.due {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  color: var(--ink-2); background: var(--surface-2);
}
.due.late { color: #fff; background: var(--danger); }
.due.today { color: var(--ink); background: color-mix(in srgb, var(--st1) 30%, var(--surface)); }
.due.soon { color: var(--st1); background: color-mix(in srgb, var(--st1) 13%, transparent); }
@media (prefers-color-scheme: dark) { .due.late { color: #0F151B; } }

.delay-note {
  margin-top: 10px; font-size: 13px; color: var(--ink-2);
  border-left: 3px solid var(--st1); padding: 2px 0 2px 9px;
}
.delay-note b { font-weight: 600; color: var(--ink); }
.delay-box {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  background: color-mix(in srgb, var(--st1) 12%, var(--surface));
}
.delay-box .when { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.link { border: none; background: none; padding: 0 2px; color: var(--focus); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.danger-text { color: var(--danger); }
.chip.danger input:checked + span { background: var(--danger); border-color: var(--danger); color: #fff; }
.callout.ok { background: color-mix(in srgb, var(--st2) 14%, var(--surface)); color: var(--ink); margin: 0 0 12px; }
.callout.ok a { font-weight: 600; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.callout.ok svg, .files svg { width: 15px; height: 15px; }
ul.plain { margin: 6px 0 6px 18px; padding: 0; }

.banner {
  display: block; width: 100%; text-align: left; margin-bottom: 14px;
  border: 1.5px solid var(--c-admin); border-radius: var(--r); background: color-mix(in srgb, var(--c-admin) 8%, var(--surface));
  color: var(--ink); padding: 12px 14px; font-weight: 500;
}

.station .st-split .w { background: var(--st-wait); }

.priority { margin-bottom: 12px; }
.prio-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.prio { border-radius: 10px; padding: 10px; background: var(--surface-2); }
.prio .fig { display: block; font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.prio span:not(.fig) { font-size: 12.5px; color: var(--ink-2); }
.prio.late { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.prio.late .fig { color: var(--danger); }
.prio.today .fig { color: var(--st1); }
.prio.wait .fig { color: var(--st-wait); }
.mini-list { list-style: none; margin: 12px 0 0; padding: 0; }
.mini-list li { border-top: 1px solid var(--line-2); }
.mini-list button {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  border: none; background: none; padding: 9px 0; font-size: 14px;
}
.mini-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.figures.four { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
@media (min-width: 720px) { .figures.four { grid-template-columns: repeat(4, 1fr); } }

/* Admin: due date */
.select-all { margin: 4px 0 10px; }
.due-list { list-style: none; margin: 0; padding: 0 0 180px; display: grid; gap: 8px; }
.due-item {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 12px 14px;
  border-left: 4px solid var(--accent);
}
.due-item input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--c-admin); }
.due-item:has(input:checked) { box-shadow: 0 0 0 2px var(--c-admin); }
.due-item .body { display: grid; gap: 4px; min-width: 0; }
.due-item .row1 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.due-item .nm { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.due-item .delay-note { margin-top: 2px; }

.due-bar {
  position: fixed; left: 0; right: 0; z-index: 26;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  transform: translateY(calc(100% + 40px)); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s;
  padding: 0 10px 10px;
  pointer-events: none;
}
.due-bar.show { transform: none; visibility: visible; pointer-events: auto; transition: transform .2s ease; }
.due-bar-in {
  max-width: 760px; margin: 0 auto;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-2); border: 1px solid var(--line);
  padding: 12px; display: grid; gap: 10px;
}
.due-count { font-size: 14px; }
.due-count b { font-size: 18px; font-variant-numeric: tabular-nums; }
.chips.quick .chip-btn { margin-top: 0; }
.due-actions { display: flex; gap: 8px; }
.due-actions .btn.primary { flex: 1; }
@media (min-width: 960px) {
  .due-bar { bottom: 16px; left: 236px; }
  .due-bar-in { grid-template-columns: auto auto 180px auto; align-items: center; }
}

/* Admin: arsip */
.arch-list { display: grid; gap: 8px; }
.arch-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px;
}
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; }
.files { list-style: none; margin: 0; padding: 0; }
.files li { padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.files li:first-child { border-top: none; }
.files a { color: inherit; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.files a:hover b { text-decoration: underline; }

/* Fab saat ada due bar tidak relevan; di halaman section fab tetap */

/* 6 menu (akun Admin): label lebih rapat agar tidak terpotong */
.tabbar[style*="--n:6"] .tab { font-size: 10.5px; letter-spacing: -.01em; }
.tabbar[style*="--n:6"] .tab svg { width: 21px; height: 21px; }
.tabbar[style*="--n:6"] .tab .count { left: calc(50% + 4px); }

@media (max-width: 520px) { .prio-tiles { grid-template-columns: repeat(2, 1fr); } }

@media (min-width: 960px) {
  .due-bar-in { max-width: 980px; grid-template-columns: auto auto 170px auto; }
  .chips.quick { flex-wrap: nowrap; }
  .due-actions .btn { white-space: nowrap; }
}

/* =========================================================
   v3: Ringkasan informatif & pencarian global
   ========================================================= */
/* Tombol cari di rail (desktop) & topbar (HP) */
.rail-search {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  border-radius: 10px; padding: 9px 12px; text-align: left; font-size: 13.5px;
}
.rail-search svg { width: 17px; height: 17px; flex: none; }
.rail-search.active { border-color: var(--focus); color: var(--ink); }
.top-search { color: var(--ink-2); }
.top-search.active { background: var(--surface-2); color: var(--ink); }
@media (min-width: 960px) { .top-search { display: none; } }

.search.fake { width: 100%; cursor: text; color: var(--muted); margin-bottom: 14px; font-size: 15px; text-align: left; }
.search.fake span { padding: 11px 0; }
.search.big { min-height: 52px; border-radius: 12px; box-shadow: var(--shadow-1); }
.search.big input { font-size: 17px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); gap: 12px; } }
.kpi {
  display: flex; flex-direction: column; gap: 2px; text-align: left; border: none;
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 12px 14px;
}
.kpi .k { font-size: 13px; color: var(--ink-2); }
.kpi .v { font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .v small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi .s { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.kpi.alert { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.kpi.alert .v { color: var(--danger); }

.legend-line { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin: -6px 0 14px; }
.legend-line span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line i { width: 12px; height: 6px; border-radius: 2px; display: inline-block; }
.legend-line .lg-w { background: var(--st-wait); }
.legend-line .lg-a { background: color-mix(in srgb, var(--ink-2) 38%, var(--surface-2)); }
.legend-line .lg-p { background: var(--ink-2); }

.mini-list .nm small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tabel kinerja */
.perf { margin-bottom: 12px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.perf-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.perf-table th, .perf-table td { padding: 8px 6px; text-align: right; border-top: 1px solid var(--line-2); }
.perf-table thead th { border-top: none; padding-top: 0; }
.perf-table thead th button { border: none; background: none; padding: 0; font-weight: 700; color: var(--accent); font-size: 13.5px; }
.perf-table thead th { box-shadow: inset 0 -3px 0 var(--accent, transparent); }
.perf-table tbody th { text-align: left; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.perf-table .t-wait { color: var(--st-wait); }
.perf-table .t-late { color: var(--danger); }
.perf-table .t-delay { color: var(--st1); }

/* Grafik tren */
.trend { margin-bottom: 12px; }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 170px; align-items: end; }
.bar-col { display: grid; grid-template-rows: 16px 1fr 30px; height: 100%; min-width: 0; text-align: center; }
.bar-val { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: visible; align-self: end; }
.bar-stack { align-self: end; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 2px 2px; overflow: hidden; min-height: 0; background: transparent; }
.bar-stack i { display: block; min-height: 2px; }
.bar-lbl { font-size: 11px; color: var(--ink-2); line-height: 1.1; padding-top: 4px; font-variant-numeric: tabular-nums; }
.bar-lbl small { display: block; font-size: 9.5px; color: var(--muted); }
.bar-col.today .bar-lbl { font-weight: 700; color: var(--ink); }
.bar-col.today .bar-stack { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--ink-2); }
@media (max-width: 520px) { .bar-val { font-size: 9px; } .bars { gap: 2px; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.figures.five { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
@media (min-width: 720px) { .figures.five { grid-template-columns: repeat(5, 1fr); } }

.hrow.age .bar i { background: var(--ink-2); }
.hrow.age.a2 .bar i { background: var(--st1); }
.hrow.age.a3 .bar i { background: var(--danger); }
.bar.split { display: flex; }
.bar.split i { border-radius: 0; }

.mini-figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mini-figs div { border-top: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 0 8px 8px; padding: 8px; min-width: 0; }
.mini-figs b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.mini-figs span { font-size: 11.5px; color: var(--muted); line-height: 1.25; display: block; }

/* Halaman Cari */
.gs-block { margin-top: 16px; }
.gs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.gs-sum { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
@media (min-width: 720px) { .gs-sum { grid-template-columns: repeat(4, 1fr); } }
.gs-sum div { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-1); padding: 10px 12px; }
.gs-sum b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.gs-sum span { font-size: 12.5px; color: var(--muted); }
.gs-sum.tight { grid-template-columns: repeat(3, 1fr); margin-top: 12px; }
.gs-sum.tight div { box-shadow: none; background: var(--surface-2); }
.gs-card { --edge: var(--st1); }
.gs-card.done { --edge: var(--st2); }
.badge.st-late { --b: var(--danger); }
.pos-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pos {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 7px;
  background: var(--surface-2); font-size: 12.5px; color: var(--ink-2);
}
.pos b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pos .sw { width: 7px; height: 7px; border-radius: 50%; background: var(--accent, var(--muted)); }
.pos.muted-pos { background: transparent; border: 1px dashed var(--line); }

.into-list, .mini-list.rel { list-style: none; margin: 0; padding: 0; }
.into-list li, .mini-list.rel li { border-top: 1px solid var(--line-2); }
.into-list li:first-child, .mini-list.rel li:first-child { border-top: none; }
.into-list button, .mini-list.rel button {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: none; background: none; padding: 10px 0; font-size: 14px;
}
.into-list .nm, .mini-list.rel .nm { flex: 1; min-width: 0; }
.into-list .nm small, .mini-list.rel .nm small { display: block; font-size: 12.5px; color: var(--muted); }
.into-list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 4px 14px; }

.pos-table { list-style: none; margin: 0; padding: 0; }
.pos-table li { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.pos-table li:first-child { border-top: none; }
.pos-table small { display: block; color: var(--muted); font-size: 12.5px; }

/* Timeline riwayat pergerakan */
.tl-day { margin-top: 6px; }
.tl-date { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; border-left: 2px solid var(--line-2); }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 8px; padding: 7px 0 7px 0; position: relative; font-size: 14px; }
.timeline .pip { width: 10px; height: 10px; border-radius: 50%; background: var(--accent, var(--muted)); margin: 5px 0 0 -10px; box-shadow: 0 0 0 3px var(--surface); }
.tl-ket { font-size: 13px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.timeline .when { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.timeline .q { font-weight: 600; color: var(--ink); margin-left: 6px; font-variant-numeric: tabular-nums; }
.timeline .q.neg { color: var(--danger); }

.topbar .brand span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .topbar .brand span { display: none; } }

.perf-table { table-layout: fixed; }
.perf-table tbody th { white-space: normal; width: 40%; line-height: 1.3; }
.perf-table td { white-space: nowrap; }
@media (max-width: 520px) { .perf-table { font-size: 12.5px; } .perf-table thead th button { font-size: 12.5px; } .perf-table th, .perf-table td { padding: 7px 4px; } }

.pos-table li > .tag { justify-self: start; }

.perf-table thead th:first-child { width: 42%; }

/* =========================================================
   v4: 5 menu, Kontrol WIP, Stok, Lainnya
   ========================================================= */
.sec-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.sec-switch button {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 6px;
  font-weight: 600; font-size: 14.5px; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.sec-switch button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .sec-switch button.active { color: #0F151B; } }
.sec-switch .pill { margin-left: 4px; }

.back-link { display: inline-block; margin: 0 0 6px; text-decoration: none; font-size: 14px; }

.stok-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stok-figs > * {
  text-align: left; border: none; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1);
  border-top: 3px solid var(--accent); padding: 10px 12px; min-width: 0;
}
.stok-figs b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stok-figs span { font-size: 12.5px; color: var(--muted); }
.chip-btn.on { background: var(--ink); color: var(--surface); border-style: solid; border-color: var(--ink); }

.menu-cards { display: grid; gap: 8px; }
.menu-cards button {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  border: none; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 14px 16px;
}
.menu-cards svg { width: 22px; height: 22px; color: var(--ink-2); flex: none; }
.menu-cards b { display: block; font-weight: 600; font-size: 15px; }
.menu-cards small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

/* Kontrol WIP */
.wip-card { --edge: var(--c-admin); }
.wip-card.w-over { --edge: var(--danger); }
.wip-card.w-closed { --edge: var(--st2); }
.wip-card.w-need { --edge: var(--st0); }
.wip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.wip-grid > div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; border-top: 3px solid var(--accent, var(--line)); min-width: 0; }
.wip-grid span { display: block; font-size: 12px; color: var(--muted); }
.wip-grid b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.wip-grid small { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wip-grid.big { margin: 14px 0 4px; }
.wip-grid.big b { font-size: 24px; }
.wip-line { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; font-variant-numeric: tabular-nums; }
.wip-line .t-late, .facts .t-late { color: var(--danger); }
.wip-pb { font-size: 13px; color: var(--ink-2); margin-top: 6px; padding: 6px 9px; background: color-mix(in srgb, var(--c-siappack) 9%, transparent); border-radius: 7px; }
.wip-link {
  display: grid; gap: 2px; width: 100%; text-align: left; margin-top: 12px;
  border: 1.5px solid var(--c-admin); background: color-mix(in srgb, var(--c-admin) 6%, var(--surface)); border-radius: 10px; padding: 10px 12px; font-size: 13.5px;
}
.wip-link span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Beranda */
.wip-sum { margin-bottom: 12px; }
.mini-figs.five { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .mini-figs.five { grid-template-columns: repeat(4, 1fr); } }
.wip-flags { font-size: 13.5px; color: var(--ink-2); margin-top: 10px; }
.more-toggle { margin: 4px 0 14px; font-weight: 500; color: var(--ink-2); }

.gs-sum.tight.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 520px) { .gs-sum.tight.four { grid-template-columns: repeat(4, 1fr); } }

/* =========================================================
   v5: akun lihat saja & muatan data
   ========================================================= */
.view-pill {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  color: var(--c-admin); background: color-mix(in srgb, var(--c-admin) 12%, var(--surface));
}
.banner.danger { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.store-bar { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.store-bar i { display: block; height: 100%; border-radius: 6px; background: var(--st2); }
.store-bar.perhatian i { background: var(--st1); }
.store-bar.kritis i { background: var(--danger); }
.store-line { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; }
.store-line b { font-size: 20px; font-variant-numeric: tabular-nums; }
.store-badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; color: var(--st2); background: color-mix(in srgb, var(--st2) 13%, transparent); }
.store-badge.perhatian { color: var(--st1); background: color-mix(in srgb, var(--st1) 13%, transparent); }
.store-badge.kritis { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
.store-detail { margin-top: 10px; font-size: 14px; }
.store-detail summary { cursor: pointer; color: var(--ink-2); font-weight: 500; }
.store-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; font-size: 13px; }
.store-table th, .store-table td { padding: 6px 4px; border-top: 1px solid var(--line-2); text-align: right; }
.store-table th:first-child, .store-table td:first-child { text-align: left; }
.store-table thead th { border-top: none; color: var(--muted); font-weight: 500; }
@media (max-width: 400px) { .view-pill { display: none; } }

/* =========================================================
   v6: karton, inventory aging, laporan batch
   ========================================================= */
.ktn { display: inline-block; margin-left: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2); border-radius: 6px; padding: 2px 7px; font-variant-numeric: tabular-nums; vertical-align: 2px; }
.tally .ktn { margin-left: 4px; }

.age { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.age.a0 { color: var(--st2); background: color-mix(in srgb, var(--st2) 13%, transparent); }
.age.a1 { color: var(--st1); background: color-mix(in srgb, var(--st1) 13%, transparent); }
.age.a2 { color: #C2410C; background: color-mix(in srgb, #C2410C 14%, transparent); }
.age.a3 { color: #fff; background: var(--danger); }
@media (prefers-color-scheme: dark) { .age.a2 { color: #FB923C; } .age.a3 { color: #0F151B; } }
.age-row { margin-top: 8px; }

.aging-panel { margin-bottom: 12px; }
.age-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.age-bar i, .age-legend i { display: block; }
.age-bar i.a0, .age-legend i.a0 { background: var(--st2); }
.age-bar i.a1, .age-legend i.a1 { background: var(--st1); }
.age-bar i.a2, .age-legend i.a2 { background: #EA580C; }
.age-bar i.a3, .age-legend i.a3 { background: var(--danger); }
.age-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 10px; }
@media (min-width: 720px) { .age-legend { grid-template-columns: repeat(4, 1fr); } }
.age-legend button { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; align-items: center; text-align: left;
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.age-legend i { width: 10px; height: 10px; border-radius: 3px; grid-row: 1 / span 2; }
.age-legend b { font-size: 17px; font-variant-numeric: tabular-nums; }
.age-legend small { grid-column: 2; color: var(--muted); font-size: 12px; }
.mini-list .age { flex: none; }

.ktn-input { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.ktn-input .lbl { margin-top: 0; }
.ktn-input .input { text-align: center; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ktn-input .x { padding-bottom: 14px; color: var(--muted); font-size: 14px; white-space: nowrap; }

/* Laporan batch */
.batch-report .page-head h1 { font-size: 30px; }
.eyebrow { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.report-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.report-actions .back-link { margin: 0; }
.batch-report .panel { margin-bottom: 12px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.report-table th, .report-table td { padding: 8px 6px; border-top: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.report-table tr:first-child th, .report-table tr:first-child td { border-top: none; }
.report-table tbody th { font-weight: 500; color: var(--ink-2); width: 46%; }
.report-table.cols thead th { color: var(--muted); font-weight: 500; font-size: 12.5px; border-top: none; white-space: nowrap; }
.report-table.cols tbody th { width: auto; color: var(--ink); white-space: nowrap; }
.report-table.cols td { white-space: nowrap; }
.report-table.cols tbody tr:first-child th, .report-table.cols tbody tr:first-child td { border-top: 1px solid var(--line-2); }
.sw-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; }
.report-kpis .kpi { cursor: default; }

@media print {
  .rail, .topbar, .tabbar, .fab, #toast-root, #sheet-root, .no-print, .more-toggle { display: none !important; }
  body { background: #fff; }
  .shell { display: block; }
  main { padding: 0 !important; max-width: none; }
  .panel, .kpi { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .batch-report .mini-list.rel { display: none; }
  .table-wrap { overflow: visible; }
  a, .link { color: inherit; text-decoration: none; }
}

/* v6.1: pemberitahuan versi baru */
#update-bar {
  position: fixed; z-index: 60; left: 12px; right: 12px;
  bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2);
  animation: toast-in .2s ease;
}
#update-bar span { flex: 1; display: flex; flex-direction: column; line-height: 1.3; font-size: 14px; }
#update-bar small { color: var(--muted); font-size: 12.5px; }
#update-bar .btn { flex: none; }
@media (min-width: 960px) { #update-bar { left: auto; right: 24px; bottom: 24px; width: 360px; } }
@media print { #update-bar { display: none !important; } }

/* v6.2: logo Gondowangi & credit di halaman login */
.gate-logo { display: flex; justify-content: center; margin: 2px 0 22px; }
.gate-logo img { width: 184px; height: auto; display: block; }
@media (prefers-color-scheme: dark) {
  .gate-logo img { background: #fff; padding: 10px 14px; border-radius: 12px; box-sizing: content-box; }
}
.gate-credit { margin: 22px 0 0; text-align: right; font-size: 12px; color: var(--muted); letter-spacing: .01em; }

/* v6.4: Kontrol WIP tampilan tabel (seperti Excel) */
.wip-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wip-filters select.input.sm { width: auto; min-width: 0; max-width: 100%; min-height: 36px; padding: 0 30px 0 10px; font-size: 13.5px; }
.wip-filters .wip-mode { margin-left: auto; }
.wip-table-box { display: block; }
.xl-wrap {
  overflow: auto; max-height: calc(100dvh - 260px); min-height: 220px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 959px) { .xl-wrap { max-height: calc(100dvh - var(--tabbar-h) - 220px); } }
table.xl { border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 100%; }
table.xl th, table.xl td { padding: 7px 10px; white-space: nowrap; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
table.xl th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--ink-2);
  font-weight: 600; font-size: 12px; cursor: pointer; user-select: none;
}
table.xl th:hover { color: var(--ink); }
table.xl .num { text-align: right; }
table.xl td.wrap { white-space: normal; min-width: 220px; max-width: 300px; }
table.xl .rn { color: var(--muted); text-align: right; width: 1%; font-size: 12px; }
table.xl .stick { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
table.xl th.stick { z-index: 3; background: var(--surface-2); }
table.xl tbody tr { cursor: pointer; }
table.xl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
table.xl tbody tr:hover td, table.xl tbody tr:focus td { background: color-mix(in srgb, var(--c-admin) 9%, var(--surface)); }
table.xl tbody tr.r-over td.stick { box-shadow: inset 3px 0 0 var(--danger), 1px 0 0 var(--line); }
table.xl tfoot td { position: sticky; bottom: 0; z-index: 1; background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--line); }
table.xl tfoot td.stick { z-index: 3; }
table.xl .t-late { color: var(--danger); font-weight: 600; }
table.xl .t-warn { color: #B45309; }
@media (prefers-color-scheme: dark) { table.xl .t-warn { color: #FBBF24; } }
table.xl .badge { font-size: 11.5px; }
@media print { .xl-wrap { max-height: none; overflow: visible; } }
.toolbar > .wip-filters { grid-column: 1 / -1; }
@media (max-width: 719px) { table.xl td.wrap { min-width: 170px; } }

/* v6.6: input packing karton / pcs */
.pk-mode { margin-bottom: 4px; }
.pk-mode label { flex: 1 0 auto; text-align: center; cursor: pointer; color: var(--ink-2); padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.pk-mode label.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.pk-mode input { position: absolute; opacity: 0; pointer-events: none; }
.conv { margin: 8px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14.5px; font-variant-numeric: tabular-nums; }

/* v6.6: semua menu tampil; menu bawah HP bisa digeser bila lebih dari 6 */
.tabbar.many {
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(78px, 1fr);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.tabbar.many::-webkit-scrollbar { display: none; }
.tabbar.many .tab { font-size: 11px; }

/* v7: stok per batch */
.tag.warn { color: #B45309; background: color-mix(in srgb, #F59E0B 16%, transparent); border-color: transparent; }
@media (prefers-color-scheme: dark) { .tag.warn { color: #FBBF24; } }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.ledger-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-table td.muted { font-size: 12.5px; }
.ledger-table tr.total th, .ledger-table tr.total td { border-top: 2px solid var(--line); font-weight: 700; color: var(--ink); }
.stok-tabs button { font-size: 13.5px; }
.stok-tabs .pill, .seg .pill { margin-left: 6px; }

/* ---------------------------------------------------------
   v7.1 — penyesuaian kemudahan pakai (tampilan saja)
   --------------------------------------------------------- */
/* Tab Stok: 2 × 2 di HP agar semua tab terlihat */
@media (max-width: 560px) {
  .stok-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; overflow: visible; }
  .stok-tabs button { padding: 10px 8px; font-size: 14px; }
}
/* Deretan chip satu baris yang bisa digeser */
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; align-items: center; margin-left: -2px; padding: 0 2px; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chips.scroll-x .chip-btn { flex: none; margin-top: 0; white-space: nowrap; }
.chips-sep { flex: none; width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.chips-lbl { flex: none; font-size: 13px; }
/* Sub-tab: isi lebar penuh bila muat */
#siap-tabs button { flex: 1 0 auto; }

/* Ringkasan: tabel di komputer, daftar di HP */
.ring-list { display: none; }
@media (max-width: 719px) {
  #siap-list .xl-wrap { display: none; }
  .ring-list { display: grid; gap: 8px; }
}
.ring-item {
  display: flex; gap: 12px; align-items: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m, 12px);
  padding: 12px 14px; box-shadow: var(--shadow-1);
  border-left: 4px solid var(--c-siappack);
}
.ring-item:active { transform: scale(.995); }
.ring-main { flex: 1; min-width: 0; }
.ring-batch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.ring-name { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ring-figs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.ring-figs b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ring-sp { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.ring-sp .big { font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-sp small { font-size: 11.5px; color: var(--muted); }

/* Tabel rincian: keterangan di bawah label, 2 kolom */
.ledger-table th small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
.ledger-table th { font-weight: 500; }
.ledger-table tr.total th small { font-weight: 500; color: var(--ink-2); }
.ledger-table td.num { font-size: 15px; }

/* Rincian batch: tombol aksi langsung di bawah angka utama */
.spb-actions { margin: 4px 0 14px; }

/* Tombol simpan form selalu terlihat di bagian bawah lembar */
.sheet .form > button[type="submit"].btn.primary.block {
  position: sticky; bottom: 10px; z-index: 3;
  box-shadow: 0 6px 18px rgba(10, 16, 22, .18), 0 0 0 6px var(--surface);
}
.wip-sp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: 14px; }
.wip-sp b { font-variant-numeric: tabular-nums; }

/* Beranda: Perlu dikerjakan */
.todo { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l, 16px); box-shadow: var(--shadow-1); padding: 12px 12px 6px; margin: 0 0 14px; }
.todo h2 { font-size: 15px; font-weight: 700; margin: 2px 4px 8px; }
.todo-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: color-mix(in srgb, var(--accent, var(--ink)) 7%, transparent);
  border: none; border-left: 4px solid var(--accent, var(--ink)); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 6px; color: var(--ink); cursor: pointer;
}
.todo-item:active { transform: scale(.995); }
.todo-n { flex: none; min-width: 34px; font-size: 22px; font-weight: 800; color: var(--accent, var(--ink)); font-variant-numeric: tabular-nums; text-align: center; }
.todo-t { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.todo-t small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-go { flex: none; font-size: 22px; color: var(--muted); }
.todo-empty { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); background: color-mix(in srgb, var(--c-siappack) 9%, transparent); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }

/* Inventory aging: susun dua baris di HP */
@media (max-width: 560px) {
  .aging-list button { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; }
  .aging-list button .tag { grid-column: 1; justify-self: start; }
  .aging-list button > :last-child { grid-column: 2; grid-row: 1; }
  .aging-list button .nm { grid-column: 1 / -1; white-space: normal; }
}

/* v7.2 — Banded / 2in1 */
.banded-box { margin-top: 12px; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: color-mix(in srgb, var(--c-siappack) 6%, transparent); }
.banded-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
.banded-box .lbl { margin-top: 10px; }
.banded-table tr.limit th, .banded-table tr.limit td { color: var(--ink); }
.banded-table tr.limit td.num { font-weight: 700; }
.banded-table th .muted { font-weight: 400; font-size: 12.5px; }
.row-btns { display: flex; gap: 6px; flex: none; }
.banded-pick { margin: 8px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }

/* v8 — Mixing, Plotting Extract, alur batch, Tarik Data */
.flow-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; margin-top: 8px; }
.flow-line .flow { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.flow-line .flow.ok { color: var(--c-siappack); background: color-mix(in srgb, var(--c-siappack) 12%, transparent); }
.flow-line .flow.warn { color: #B45309; background: color-mix(in srgb, #F59E0B 18%, transparent); }
.flow-line .flow.wait { color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); }
.flow-sep { color: var(--muted); font-size: 13px; padding: 0 1px; }
@media (prefers-color-scheme: dark) { .flow-line .flow.warn { color: #FBBF24; } }
.tag.mix { color: var(--c-mixing); background: color-mix(in srgb, var(--c-mixing) 12%, transparent); border-color: transparent; }
.callout.mix-wait { border-left: 4px solid var(--c-mixing); background: color-mix(in srgb, var(--c-mixing) 8%, transparent); }
.mix-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.mix-figs > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.mix-figs span { display: block; font-size: 11.5px; color: var(--muted); }
.mix-figs b { font-size: 16px; font-variant-numeric: tabular-nums; }
.input.big-num { font-size: 22px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.date-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.date-filter .input.sm { width: auto; min-width: 0; }
@media (max-width: 560px) { .date-filter { width: 100%; } .date-filter select { flex: 1 1 100%; } .date-filter input[type=date] { flex: 1 1 0; } }
.exp-sets { display: grid; gap: 8px; }
.exp-set { border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.exp-set > label { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; cursor: pointer; }
.exp-set > label input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--ink); }
.exp-set b { display: block; font-size: 14.5px; }
.exp-set small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.exp-set .exp-n { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.exp-cols { padding: 0 14px 12px 42px; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.exp-cols label { font-size: 12.5px; display: inline-flex; gap: 5px; align-items: center; color: var(--ink-2); }
.exp-cols-toggle { margin: 0 14px 10px 42px; font-size: 12.5px; }
.exp-filter { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
.exp-filter .full { grid-column: 1 / -1; }
.exp-bar { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); margin-top: 14px; z-index: 5; display: flex; gap: 10px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow-2); }
@media (min-width: 900px) { .exp-bar { bottom: 16px; } }

/* =========================================================
   v9: Rekap MO (PPIC) — tabel/kartu, form banyak baris, konfirmasi Admin
   ========================================================= */
.toolbar:has(.mode-seg) { grid-template-columns: 1fr auto; align-items: center; }
.mode-seg { flex: 0 0 auto; }
.mode-seg button { flex: 0 0 auto; padding: 7px 14px; }
.rm-figs { grid-template-columns: 1.2fr 1fr 1fr; }
.rm-figs b { font-size: 15px; word-break: break-word; }
.rm-ck { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; margin: -6px 2px -6px -6px; cursor: pointer; }
.rm-ck input { width: 20px; height: 20px; accent-color: var(--c-admin); cursor: pointer; }
.rm-all { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); padding: 4px 2px 2px; grid-column: 1 / -1; cursor: pointer; }
.rm-all input { width: 20px; height: 20px; accent-color: var(--c-admin); }
.card.picked-card { box-shadow: 0 0 0 2px var(--c-admin), var(--shadow-1); }
table.xl tbody tr.r-picked td { background: color-mix(in srgb, var(--c-admin) 12%, var(--surface)); }
table.rm-table td.stick { white-space: nowrap; }
table.rm-table td small { font-size: 11.5px; }
.rm-bar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rm-bar-in > b { margin-right: auto; font-size: 14px; }
body.has-rm-bar .page { padding-bottom: 90px; }
@media (min-width: 900px) { .rm-bar { bottom: 16px; left: 236px; } }
/* form banyak baris */
.rm-row { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 12px 0 0; min-width: 0; background: var(--surface); }
.rm-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.rm-row-head b { font-size: 14.5px; }
.rm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.rm-grid > label, .rm-grid > div { min-width: 0; }
.rm-grid .lbl { display: block; }
.rm-full { grid-column: 1 / -1; }
.rm-info { font-size: 13px; color: var(--ink-2); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rm-info:empty { display: none; }
.rm-add-row { margin-top: 12px; border-style: dashed; }
.rm-kg li { align-items: center; }
@media (max-width: 360px) { .rm-grid { grid-template-columns: 1fr; } }

/* v9.2: form Rekap MO bentuk tabel (laptop) */
@media (min-width: 720px) {
  .sheet.wide { width: min(1240px, calc(100vw - 48px)); }
}
.rm-tw { overflow: visible; }
.rm-wide .rm-tw { overflow: visible; border: 0; box-shadow: none; }
table.rm-entry { min-width: 0; width: 100%; }
table.rm-entry th, table.rm-entry td { white-space: normal; }
table.rm-entry td { vertical-align: top; padding: 6px 6px; }
table.rm-entry th { white-space: nowrap; }
table.rm-entry td.num { padding-top: 14px; color: var(--muted); }
table.rm-entry .input.sm { width: 100%; min-width: 0; height: 38px; padding: 6px 10px; font-size: 14px; }
table.rm-entry .input.num { text-align: right; }
table.rm-entry td:nth-child(2) { width: 120px; }
table.rm-entry td:nth-child(3) { width: 130px; }
table.rm-entry td:nth-child(5) { width: 110px; }
table.rm-entry td:nth-child(6), table.rm-entry td:nth-child(7) { width: 100px; }
table.rm-entry td:last-child { width: 64px; }
table.rm-entry .rm-prod { position: relative; min-width: 260px; }
table.rm-entry .rm-res { position: absolute; left: 6px; right: 6px; top: 44px; z-index: 5; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); max-height: 260px; }
.rm-picked { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 4px 4px 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.rm-picked > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.rm-entry tr.rm-tr-info td { padding: 0 6px; border-top: 0; }
table.rm-entry tr.rm-tr-info .rm-info:not(:empty) { padding: 0 0 6px; font-size: 13px; }
table.rm-entry tr.rm-tr-info:has(.rm-info:empty) { display: none; }
table.rm-entry tbody tr.rm-tr td { border-bottom: 0; }
table.rm-entry td:last-child .btn { height: 38px; }
table.rm-entry td:nth-child(7) .input:disabled::placeholder { text-align: center; }

/* v10: Beranda fokus produksi */
:root { --viz-1: #2459C4; --viz-2: #C2410C; }
@media (prefers-color-scheme: dark) { :root { --viz-1: #4F86F7; --viz-2: #E0702F; } }
.mo-flow { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; }
.mo-flow .station { min-height: 0; }
.mo-flow .station:last-child { grid-column: 1 / -1; }
@media (min-width: 720px) { .mo-flow { grid-template-columns: repeat(5, minmax(0, 1fr)); } .mo-flow .station:last-child { grid-column: auto; } }
.dash-sec { font-size: 15px; margin: 22px 0 10px; color: var(--ink-2); text-transform: none; }
.mini-h { font-size: 13.5px; margin: 14px 0 8px; color: var(--ink-2); }
.dash-grid.two { display: grid; gap: 4px 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .dash-grid.two { grid-template-columns: 1fr 1fr; } }
.prod-an .figures { margin-bottom: 14px; }
.pc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; font-size: 13.5px; margin: 6px 0 8px; }
.pc-legend { display: flex; gap: 14px; color: var(--ink-2); font-size: 12.5px; }
.pc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.pc-legend i.b1, .pc-bars i.b1 { background: var(--viz-1); }
.pc-legend i.b2, .pc-bars i.b2 { background: var(--viz-2); }
.pc-chart { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding: 6px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.pc-col { flex: 1 0 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; outline: none; border-radius: 6px; }
.pc-col:hover, .pc-col:focus-visible { background: var(--surface-2); }
.pc-bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; }
.pc-bars i { width: 7px; min-height: 0; border-radius: 4px 4px 0 0; display: block; }
.pc-x { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rj-box { display: grid; gap: 8px; }
.rj-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 10px; margin: 0; min-width: 0; }
.rj-row[disabled] { opacity: .75; }
.rj-row .rm-row-head .tag { white-space: normal; }
.ledger-table tr.info th, .ledger-table tr.info td { font-weight: 400; color: var(--muted); font-size: 12.5px; border-top: 0; }
.mix-filters { margin-top: 0; }
.quick-dates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mo-flow .station { grid-template-columns: 1fr; align-content: start; gap: 4px; }
.mo-flow .station .st-num { grid-column: 1; grid-row: auto; text-align: left; font-size: 26px; }
.mo-flow .station .st-foot { grid-column: 1; }

/* v10.1: tautan menu yang tidak tersedia untuk akun */
.no-nav { cursor: default; }
.no-nav:hover, .no-nav:active { transform: none !important; filter: none !important; }

/* v10.2: notifikasi kiriman perbaikan */
#inbox-bar {
  position: fixed; z-index: 61; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top));
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c-filling);
  box-shadow: var(--shadow-2); animation: toast-in .2s ease;
}
#inbox-bar[hidden] { display: none; }
#inbox-bar .ib-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--c-filling); background: color-mix(in srgb, var(--c-filling) 12%, transparent); }
#inbox-bar .ib-ic svg { width: 20px; height: 20px; }
#inbox-bar .ib-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.35; }
#inbox-bar .ib-tx small { color: var(--ink-2, var(--muted)); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#inbox-bar .ib-act { flex: none; display: flex; align-items: center; gap: 4px; }
#inbox-bar .icon-btn { font-size: 22px; line-height: 1; width: 34px; height: 34px; }
@media (min-width: 960px) { #inbox-bar { left: auto; right: 24px; top: 72px; width: 420px; } }
@media print { #inbox-bar { display: none !important; } }
.notif-panel, .notif-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.notif-panel b, .notif-prompt b { display: block; }
.notif-panel small, .notif-prompt small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.notif-panel { flex-direction: column; align-items: flex-start; }
.notif-prompt > span { flex: 1 1 220px; }
