
/* ============ WMS design system (PART 5A) ============ */
:root {
  --bg: #f1f5f9; --card: #ffffff; --text: #0f172a; --muted: #64748b; --border: #e2e8f0;
  --primary: #2563eb; --primary-dark: #1d4ed8; --primary-soft: #dbeafe;
  --side: #0f172a; --side-text: #cbd5e1; --side-active: #1e293b;
  --ok: #16a34a; --warn: #d97706; --crit: #dc2626; --info: #0284c7;
  --empty: #22c55e; --partial: #eab308; --full: #ef4444; --blocked: #374151; --inactive: #9ca3af; --occupied: #3b82f6;
  --radius: 12px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
/* v3.12.80: di HP (iPhone) kolom isian di bawah 16px membuat layar otomatis membesar saat diketik lalu tetap terpotong di kanan.
   Kolom isian dibuat 16px di layar kecil, dan halaman tidak bisa bergeser ke samping. */
html, body { max-width: 100%; overflow-x: clip; }
@media (max-width: 900px) { input, select, textarea, .input, .select { font-size: 16px !important; } }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ico svg { display: block; }
.muted { color: var(--muted); }
.right { margin-left: auto; }

/* ---- indikator proses, offline, toast ---- */
.busy { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3000; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
.busy.on { opacity: 1; }
.busy::after { content: ""; position: absolute; top: 0; left: -40%; width: 40%; height: 100%; background: var(--primary); animation: busy 1s linear infinite; }
@keyframes busy { from { left: -40%; } to { left: 100%; } }
.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 3100; background: var(--crit); color: #fff; text-align: center; padding: 8px; font-weight: 600; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 3200; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: #0f172a; color: #fff; padding: 12px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(15,23,42,.25); animation: tin .2s ease; }
.toast.success { background: #166534; } .toast.error { background: #991b1b; } .toast.warning { background: #92400e; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .25s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- tombol ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; background: var(--primary); color: #fff; transition: background .15s; text-decoration: none; }
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: #f8fafc; }
.btn.danger { background: var(--crit); } .btn.danger:hover { background: #b91c1c; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.icon { width: 42px; padding: 0; }
.btn.block { width: 100%; }
.btn.is-busy { opacity: .85; cursor: progress; }
.btn:disabled.gated, .btn.gated { opacity: .5; cursor: not-allowed; }
.btn.req-star::after { content: ' *'; color: #dc2626; font-weight: 700; }
.field.req > label::after { content: ' *'; color: #dc2626; font-weight: 700; }
.field.field-bad input, .field.field-bad select, .field.field-bad textarea, .field.field-bad .ev-photos { outline: 2px solid #dc2626; outline-offset: 2px; border-radius: 8px; }
.field.field-bad { animation: fbad .35s ease 2; }
@keyframes fbad { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---- form ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-weight: 600; font-size: 14px; }
.input, .select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.input:focus, .select:focus { outline: 3px solid var(--primary-soft); border-color: var(--primary); }
.input-group { position: relative; }
.input-group .input { padding-right: 46px; }
.input-group .peek { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.hint { font-size: 13px; color: var(--muted); }
.msg { padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; border: 1px solid; }
.msg.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.msg.info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.msg.ok { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.msg.warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }   /* v3.13.5 */

/* ---- login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); }
.login-card { width: 100%; max-width: 410px; background: #fff; border-radius: 18px; padding: 30px 28px; box-shadow: 0 24px 64px rgba(0,0,0,.35); }
.login-card .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-card .logo .mark { width: 44px; height: 44px; border-radius: 12px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.login-card h1 { font-size: 20px; margin: 0; }
.login-card .sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ---- layout aplikasi ---- */
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding-bottom: 0; display: flex; flex-direction: column; }
.side > * { flex-shrink: 0; }
.side-ver { position: sticky; bottom: 0; display: block; width: 100%; text-align: left; background: var(--side); color: var(--side-text); border: 0; border-top: 1px solid rgba(255,255,255,.08); padding: 10px 18px; margin-top: auto; font: inherit; font-size: 12px; cursor: pointer; }
.side-ver span { opacity: .7; }
.side-ver:hover span { opacity: 1; }   /* v3.13.198 */
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 8px; color: #fff; font-weight: 700; font-size: 18px; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; }
.nav-section { padding: 16px 18px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
.nav-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; background: transparent; border: 0; cursor: pointer; text-align: left; font-family: inherit; }
.nav-toggle:hover { color: #cbd5e1; }
.nav-toggle .chev { transition: transform .15s; transform: rotate(-90deg); font-size: 12px; }
.nav-toggle.open .chev { transform: none; }
.nav-group[hidden] { display: none; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 2px 10px; border-radius: 10px; color: var(--side-text); cursor: pointer; border: 0; background: transparent; width: calc(100% - 20px); text-align: left; font-size: 15px; }
.nav-item:hover { background: var(--side-active); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 10px 20px; min-height: 62px; flex-wrap: wrap; }
.top h1 { font-size: 18px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .whsel { width: 220px; }
.hamb { display: none; }
.scrim { display: none; }
#page { padding: 20px; max-width: 1400px; width: 100%; margin: 0 auto; }

.userwrap { position: relative; }
.userbtn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; border-radius: 12px; padding: 4px 8px; cursor: pointer; min-height: 44px; color: var(--text); }
.userbtn:hover, .iconbtn:hover { background: var(--primary-soft); }
.iconbtn { position: relative; border: 0; background: transparent; width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; cursor: pointer; color: var(--primary); }
.userbtn > .ico { color: var(--primary); }   /* v3.12.71: ikon atas ikut warna biru WMS */
.ntfwrap { position: relative; margin-left: auto; }
.ntf-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--crit); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.bug-ov { position: fixed; inset: 0; z-index: 2600; background: rgba(15,23,42,.55); }
.bug-ov iframe { width: 100%; height: 100%; border: 0; display: block; background: #f1f5f9; }
@media (min-width: 900px) { .bug-ov { padding: 24px; } .bug-ov iframe { max-width: 1040px; margin: 0 auto; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); } }
.ntf-dot { position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; }
.ntf-panel { position: absolute; right: 0; top: 46px; width: min(400px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,.18); z-index: 200; padding: 10px; }
.ntf-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 4px 4px 8px; }
.ntf-list { display: flex; flex-direction: column; gap: 8px; }
.ntf-item { border: 1px solid var(--border); border-left: 4px solid var(--info); border-radius: 10px; padding: 8px 10px; background: var(--card); }
.ntf-item.link { cursor: pointer; } .ntf-item.link:hover { background: #f8fafc; }
.ntf-item.ntf-act { border-left-color: var(--warn); } .ntf-item.ntf-warn { border-left-color: var(--crit); } .ntf-item.ntf-info { border-left-color: var(--primary); }
.ntf-head { display: flex; justify-content: space-between; gap: 8px; }
.ntf-n { background: var(--primary-soft); color: var(--primary-dark); border-radius: 999px; padding: 0 8px; font-weight: 700; font-size: 13px; }
.ntf-item ul { margin: 4px 0 2px; padding-left: 18px; font-size: 13px; color: #334155; }
.ntf-empty { padding: 10px 4px; }
.ntf-card { margin-bottom: 16px; }
.ntf-card .ntf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
/* v3.12.70: tema gelap = warna dibalik (inversi) supaya semua halaman ikut gelap; foto, QR, dan sidebar dikembalikan ke warna asli */
html.theme-dark { filter: invert(.92) hue-rotate(180deg); background: #fff; }
/* v3.13.165: Stok - warna per status (kolom tabel + kartu ringkasan) */
.stq { display: inline-block; padding: 1px 8px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.stq.zero { background: none; color: #9ca3af; font-weight: 400; padding: 1px 0; }
.stq.st-in { background: #dcfce7; color: #166534; } .stq.st-hold { background: #fef3c7; color: #92400e; } .stq.st-titip { background: #ede9fe; color: #5b21b6; }
.stq.st-dmg { background: #fee2e2; color: #991b1b; } .stq.st-pick { background: #dbeafe; color: #1e40af; }
.card.stk { border-top: 4px solid transparent; } .card.stk.st-in { border-top-color: #16a34a; } .card.stk.st-hold { border-top-color: #d97706; } .card.stk.st-titip { border-top-color: #7c3aed; }
.card.stk.st-dmg { border-top-color: #dc2626; } .card.stk.st-pick { border-top-color: #2563eb; }
.card.stk.st-in .val { color: #166534; } .card.stk.st-hold .val { color: #92400e; } .card.stk.st-titip .val { color: #5b21b6; } .card.stk.st-dmg .val { color: #991b1b; } .card.stk.st-pick .val { color: #1e40af; }
html.theme-dark img, html.theme-dark video, html.theme-dark canvas, html.theme-dark .side, html.theme-dark .keep-color, html.theme-dark .btn.primary, html.theme-dark .ntf-badge, html.theme-dark .chip.on { filter: invert(1) hue-rotate(180deg); }
html.theme-dark .side img, html.theme-dark .side canvas { filter: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.uname { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.uname small { color: var(--muted); font-size: 12px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.18); padding: 6px; z-index: 60; }
.menu .mi { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 8px; cursor: pointer; width: 100%; border: 0; background: transparent; text-align: left; }
.menu .mi:hover { background: #f1f5f9; }
.menu .mhead { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu .mhead small { color: var(--muted); }

/* ---- kartu, KPI, bar ---- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 22px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card > h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { display: flex; gap: 12px; align-items: flex-start; }
.kpi .ico-box { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.kpi .lbl { color: var(--muted); font-size: 13px; }
.kpi .val { font-size: 26px; font-weight: 700; line-height: 1.15; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi .bar { margin-top: 8px; }
.tone-ok .ico-box { background: #dcfce7; color: #15803d; }
.tone-warn .ico-box { background: #fef3c7; color: #b45309; }
.tone-crit .ico-box { background: #fee2e2; color: #b91c1c; }
.tone-gray .ico-box { background: #e2e8f0; color: #475569; }
.bar { height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--ok); transition: width .4s; }
.bar.warn > span { background: var(--warn); }
.bar.crit > span { background: var(--crit); }
.bar.blue > span { background: var(--primary); }
.row-bar { display: grid; grid-template-columns: minmax(70px, 130px) 1fr auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 8px; }
.row-bar.click { cursor: pointer; } .row-bar.click:hover { background: #f8fafc; }
.row-bar .val { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 70px; }
.stack { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: #e2e8f0; }
.stack > span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 13px; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.c-EMPTY { background: var(--empty); } .c-PARTIAL { background: var(--partial); } .c-FULL { background: var(--full); }
.c-BLOCKED { background: var(--blocked); } .c-INACTIVE { background: var(--inactive); } .c-OCCUPIED { background: var(--occupied); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.stat .n { font-size: 20px; font-weight: 700; } .stat .l { font-size: 12px; color: var(--muted); }
.stat.bad .n { color: var(--crit); } .stat.warn .n { color: var(--warn); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; border: 1px solid; }
.alert.critical { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert.click { cursor: pointer; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e2e8f0; color: #334155; }
.b-INBOUND { background: #dbeafe; color: #1d4ed8; } .b-PUTAWAY { background: #cffafe; color: #0e7490; }
.b-MOVE { background: #ede9fe; color: #6d28d9; } .b-PICKING { background: #fef3c7; color: #b45309; }
.b-OUTBOUND { background: #ffedd5; color: #c2410c; } .b-ADJUSTMENT { background: #fce7f3; color: #be185d; }
.b-HOLD { background: #fef9c3; color: #854d0e; } .b-RELEASE { background: #dcfce7; color: #15803d; }
.b-DAMAGE { background: #fee2e2; color: #b91c1c; }
.b-stk { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.b-stk-Habis { background: #fee2e2; color: #b91c1c; } .b-stk-Kritis { background: #ffedd5; color: #c2410c; } .b-stk-Rendah { background: #fef9c3; color: #854d0e; }
.b-SPLIT { background: #ede9fe; color: #5b21b6; }
.b-TRANSFER_OUT { background: #fef3c7; color: #92400e; } .b-TRANSFER_IN { background: #dcfce7; color: #166534; } .b-TRANSFER_RETURN { background: #e5e7eb; color: #4b5563; }

.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th { background: #f8fafc; text-align: left; padding: 10px 12px; font-weight: 600; color: #475569; white-space: nowrap; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.tbl tr.grp-row td { background: #eef2ff; color: #1e3a8a; font-weight: 600; cursor: pointer; border-top: 1px solid #c7d2fe; }
.tbl tr.grp-row td small { font-weight: 400; color: #475569; margin-left: 6px; }
.soft-load { opacity: .55; pointer-events: none; transition: opacity .15s; }
.wh-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.wh-sum .chip { cursor: pointer; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafcff; }

.empty, .errbox { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .ico, .errbox .ico { color: #94a3b8; margin-bottom: 8px; }
.errbox { color: #991b1b; } .errbox .ico { color: var(--crit); }
.errbox .btn { margin-top: 12px; }
.skel { background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 37%, #e2e8f0 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 10px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- modal ---- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(15,23,42,.35); }
.modal.sm { max-width: 400px; } .modal.lg { max-width: 860px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-h h3 { margin: 0; font-size: 17px; }
.modal-b { padding: 20px; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.x { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.x:hover { background: #f1f5f9; }

/* ---- responsif ---- */
@media (max-width: 1100px) { .grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 1000; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .25s; }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 900; }
  .hamb { display: inline-flex; }
  .grid.g2, .grid.g3, .grid.g21 { grid-template-columns: minmax(0, 1fr); }
  .grid.g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #page { padding: 14px; }
  .top { padding: 8px 12px; }
  .toasts { right: 12px; left: 12px; top: 12px; bottom: auto; width: auto; }
}
@media (max-width: 700px) {
  .top .whsel { order: 5; flex: 1 1 100%; width: 100%; }
  .uname { display: none; }
  .userbtn { padding: 4px; }
  .nav-item { padding: 13px 14px; }
  .btn { min-height: 46px; }
  .modal-f .btn { flex: 1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .val { font-size: 22px; }
  .row-bar { grid-template-columns: minmax(60px, 90px) 1fr auto; }
}
/* ---- v3.12.81: tombol scan di dalam kolom (pojok kanan) ---- */
.cam-in { position: relative; flex: 1 1 auto; min-width: 0; width: 100%; }
.cam-in > .input, .cam-in > input, .cam-in > textarea { width: 100%; padding-right: 50px; }
.cam-in-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 36px; height: 34px; border: 0; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; cursor: pointer; padding: 0; }
.cam-in-btn:hover { filter: brightness(.95); }
.cam-in.ta .cam-in-btn { top: 6px; transform: none; }
.scan-row > .cam-in { flex: 1 1 auto; }
/* ---- v3.12.81: tabel jadi kartu di HP (dibuat otomatis oleh U.table) ---- */
.tbl td.m-tog { display: none; }
.m-filt-btn { display: none; }
@media (max-width: 700px) {
  .table-wrap { border: 0; border-radius: 0; overflow: visible; }
  table.tbl, .tbl tbody { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tbody tr { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
  .tbl tbody tr:hover td { background: none; }
  .tbl td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; border: 0 !important; white-space: normal; text-align: right !important; min-height: 26px; overflow-wrap: anywhere; }
  .tbl td::before { content: attr(data-l); color: var(--muted); font-size: 13px; text-align: left; flex: 0 0 auto; max-width: 46%; }
  .tbl td.m-title { order: -1; justify-content: flex-start; text-align: left !important; font-size: 15px; font-weight: 600; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid #f1f5f9 !important; }
  .tbl td.m-title::before, .tbl td.m-nolab::before, .tbl td.m-act::before { display: none; }
  .tbl td.m-nolab { justify-content: flex-start; text-align: left !important; }
  .tbl td.m-more, .tbl td.m-hide, .tbl td.m-empty { display: none; }
  .tbl tr.m-open td.m-more:not(.m-empty) { display: flex; }
  .tbl td.m-act { order: 9; justify-content: flex-start; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
  .tbl td.m-act:empty { display: none; }
  .tbl td.m-tog { display: flex; order: 8; justify-content: flex-start; padding-top: 2px; }
  .m-tog-b { border: 0; background: none; color: var(--primary); font-weight: 600; font-size: 13px; padding: 4px 0; cursor: pointer; }
  .tbl tr.grp-row { display: block; padding: 8px 12px; background: #eef2ff; border-color: #c7d2fe; }
  .tbl tr.grp-row td { display: block; text-align: left !important; background: none; padding: 0; }
  .tbl tr.grp-row td::before { display: none; }
  /* ---- tata letak umum di HP ---- */
  body .page-head h2 { flex: 1 1 100%; font-size: 20px; }
  body .page-head .btn { flex: 1 1 auto; }
  body .filters .field { flex: 1 1 calc(50% - 6px); min-width: 0; max-width: none; }
  body .filters .field:has(.cam-in) { flex-basis: 100%; }   /* kolom Cari + scan selebar layar */
  body .filters.m-filt:not(.m-open) > .field:not(:has(.cam-in)), body .filters.m-filt:not(.m-open) > .chk { display: none; }
  .m-filt-btn { display: inline-flex; width: 100%; margin-bottom: 10px; justify-content: center; }
  .card .table-wrap .tbl tbody tr { box-shadow: none; }
  /* kartu angka ringkasan (KPI) dua kolom, bukan satu kolom panjang */
  .grid.g3:has(> .card > .kpi), .grid.g5:has(> .card > .kpi), .grid.g2:has(> .card > .kpi) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid > .card > .kpi .val { font-size: 22px; }
  .grid > .card:has(> .kpi) { padding: 12px; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.sm, .modal.lg { max-width: none; border-radius: 16px 16px 0 0; max-height: 94vh; }
  .modal-b { padding: 16px; }
  .modal-h { padding: 12px 16px; } .modal-f { padding: 12px 16px; flex-wrap: wrap; }
  body .pager { flex-direction: column; align-items: stretch; gap: 8px; text-align: center; }
  body .pager .btns { justify-content: space-between; flex-wrap: wrap; }
  .card { padding: 14px; }
}
/* ---- v3.12.82: penyempurnaan tampilan HP ---- */
.top2 { display: none; }
@media (max-width: 700px) {
  /* header: hanya baris judul + tombol yang menempel; kotak cari + warehouse ikut tergulung */
  .top { gap: 2px; min-height: 56px; flex-wrap: nowrap; padding: 6px 8px; }
  .top h1 { font-size: 17px; line-height: 1.2; white-space: normal; display: flex; align-items: center; margin-left: 6px; overflow: visible; }
  .top .iconbtn, .top .langbtn.inhead { width: 38px; height: 40px; flex: 0 0 auto; }
  .top2 { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px 10px; background: var(--card); border-bottom: 1px solid var(--border); }
  .top2 .gs { order: 0; flex: none; width: 100%; min-width: 0; }
  .top2 .whsel { width: 100%; min-height: 42px; }
  /* panel notifikasi selebar layar, tidak terpotong di kiri */
  .ntfwrap { position: static; }
  .ntf-panel { position: fixed; left: 8px; right: 8px; top: 58px; width: auto; max-height: calc(100vh - 76px); }
  /* judul halaman yang sama dengan judul header tidak ditampilkan dua kali */
  #page h2.m-dup { display: none; }
  body .page-head:has(> h2.m-dup) { justify-content: flex-end; }
  /* tombol aksi di kartu: turun ke baris berikutnya, teks tombol tidak terpecah per huruf */
  .tbl td .actions, .tbl td.m-act > div { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
  .tbl td.m-act .btn, .tbl td .actions .btn { white-space: nowrap; flex: 0 0 auto; }
  /* filter dengan 1-2 isian: selebar layar */
  body .filters:not(.m-filt) > .field { flex-basis: 100%; }
  :is(.pkr-bar, .usr-bar, .cus-bar, .sup-bar, .flt-bar, .ttp-bar) > .field { flex: 1 1 100%; min-width: 0; max-width: none; width: 100%; }
  :is(.pkr-bar, .usr-bar, .cus-bar, .sup-bar, .flt-bar, .ttp-bar) > .field :is(.input, .select, input, select) { width: 100%; max-width: none; }
  .pku-tabs .btn { flex: 1 1 0; white-space: nowrap; font-size: 14px; padding-left: 8px; padding-right: 8px; min-width: 0; }
  /* kartu angka ganjil terakhir dibuat selebar baris, tidak menyisakan lubang */
  .grid:has(> .card > .kpi) > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.mark img{width:100%;height:100%;display:block;border-radius:inherit}
