/* =========================================================
   TUMU Logistic Operation System — tema enterprise
   ========================================================= */
:root {
  --nav: #0B1533;
  --nav2: #142554;
  --nav-ink: #b9c6dc;
  --navy: #0E1A44;
  --navy2: #1A2E6E;
  --blue: #1D4ED8;
  --blue2: #2563EB;
  --sky: #38A8E0;
  --sky-l: #A9C7FF;
  --amber: #e3a21a;
  --yellow: #7FB2FF;
  --bg: #eef2fb;
  --card: #ffffff;
  --ink: #1c2636;
  --ink2: #475569;
  --muted: #7b8798;
  --line: #e2e8f3;
  --line2: #d3dbe6;
  --ok: #138a52;
  --ok-bg: #e3f6ec;
  --warn: #a96500;
  --warn-bg: #fff3d6;
  --err: #c62828;
  --err-bg: #fde7e7;
  --sel: #ffe4bf;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 64, .05), 0 1px 8px rgba(16, 32, 64, .04);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 13.5px; -webkit-font-smoothing: antialiased; }
a { color: var(--blue2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; }
small, .muted { color: var(--muted); }
.hidden { display: none !important; }
svg.ic { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.2em; }
code { font-family: ui-monospace, Consolas, monospace; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--nav); color: var(--nav-ink); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; border-right: 1px solid #08142a; transition: width .18s; z-index: 60;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.logo { width: 40px; height: 40px; flex-shrink: 0; display: block; }
.logo svg { width: 100%; height: 100%; display: block; border-radius: 10px; box-shadow: 0 2px 8px rgba(29, 78, 216, .35); }
.brand b { font-size: 17px; letter-spacing: 2px; display: block; color: #fff; }
.brand span { font-size: 11px; color: var(--nav-ink); display: block; white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; padding: 8px 10px 14px; scrollbar-width: thin; scrollbar-color: #2a3d62 transparent; }
.nav-sec { margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.nav-sec:last-child { border-bottom: 0; }
/* MENU (grup): kapital tebal, ikon berwarna per grup, garis aksen kiri */
.nav-head {
  all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; border-radius: 9px; cursor: pointer;
  font-size: 11px; letter-spacing: .5px; text-transform: uppercase; font-weight: 800; color: #E6EDFF; position: relative;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gc) 16%, transparent), transparent 85%);
}
.nav-head::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--gc); }
.nav-head .gi { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; color: var(--gc);
  background: color-mix(in srgb, var(--gc) 20%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gc) 35%, transparent); }
.nav-head .gi svg.ic { width: 15px; height: 15px; }
.nav-head .gt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-head .gn { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0; color: var(--gc); background: rgba(255, 255, 255, .06); border-radius: 9px; padding: 0 6px; line-height: 17px; }
.nav-head:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--gc) 26%, transparent), transparent 90%); }
.nav-head .chev { color: #7f90ad; transition: transform .15s; width: 15px; height: 15px; }
.nav-sec.closed .chev { transform: rotate(-90deg); }
.nav-sec.closed .nav-items { display: none; }
/* SUB MENU: lebih kecil, huruf normal, menjorok dengan garis panduan */
.nav-items { margin: 4px 0 2px 22px; padding-left: 8px; border-left: 1px dashed color-mix(in srgb, var(--gc) 40%, rgba(255, 255, 255, .1)); }
.nav-items a {
  display: flex; align-items: center; gap: 10px; color: #A9B6CE; padding: 6px 10px 6px 10px; margin: 1px 0; border-radius: 7px; font-size: 12.8px; font-weight: 450;
  position: relative; text-decoration: none; white-space: nowrap;
}
.nav-items a::after { content: ''; position: absolute; left: -9px; top: 50%; width: 7px; border-top: 1px dashed color-mix(in srgb, var(--gc) 40%, rgba(255, 255, 255, .1)); }
.nav-items a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-items a.active { background: color-mix(in srgb, var(--gc) 26%, transparent); color: #fff; font-weight: 650; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gc) 45%, transparent); }
.nav-items a.active::before { content: ''; position: absolute; left: -11px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--gc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gc) 30%, transparent); }
.nav-items a svg.ic { width: 16px; height: 16px; opacity: .75; }
.nav-items a.active svg.ic { opacity: 1; color: var(--gc); }
.cnt { margin-left: auto; background: var(--err); color: #fff; border-radius: 10px; font-size: 10.5px; padding: 1px 7px; font-style: normal; font-weight: 700; line-height: 1.5; }
.nav-mini { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; margin: 8px 10px 12px; padding: 9px 12px; border-radius: 8px; color: #7f90ad; cursor: pointer; font-size: 12.5px; border: 1px solid rgba(255, 255, 255, .08); }
.nav-mini:hover { color: #fff; background: rgba(255, 255, 255, .05); }
/* mode ringkas */
.app.mini .sidebar { width: 66px; }
.app.mini .brand .bt, .app.mini .nav-head, .app.mini .nav-items a span, .app.mini .nav-mini span { display: none; }
.app.mini .nav-sec.closed .nav-items { display: block; }
.app.mini .nav-items { margin: 0; padding: 0; border: 0; }
.app.mini .nav-items a::after, .app.mini .nav-items a.active::before { display: none; }
.app.mini .nav-items a { justify-content: center; padding: 10px 0; }
.app.mini .nav-items a .cnt { position: absolute; top: 2px; right: 4px; padding: 0 5px; }
.app.mini .brand { justify-content: center; padding: 16px 0 14px; }
.app.mini .nav-sec { border-bottom: 1px solid rgba(255, 255, 255, .05); padding: 4px 0; }
.app.mini .nav-mini { justify-content: center; margin: 8px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 8px 22px; display: flex; align-items: center; gap: 8px;
  position: sticky; top: 0; z-index: 40; min-height: 60px;
}
.crumb small { display: block; font-size: 11.5px; color: var(--muted); }
.crumb h1 { font-size: 17.5px; color: var(--ink); line-height: 1.25; }
.spacer { flex: 1; }
.tb-btn { all: unset; box-sizing: border-box; position: relative; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; color: var(--ink2); cursor: pointer; }
.tb-btn:hover { background: var(--bg); color: var(--blue); text-decoration: none; }
.tb-btn svg.ic { width: 20px; height: 20px; }
.tb-btn .cnt { position: absolute; top: 3px; right: 1px; }
.burger { display: none; }
.usermenu { position: relative; margin-left: 6px; }
.ubtn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 10px; cursor: pointer; color: var(--ink2); }
.ubtn:hover { background: var(--bg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--blue2), var(--navy2)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.un { display: flex; flex-direction: column; line-height: 1.25; }
.un b { font-size: 13px; color: var(--ink); }
.un small { font-size: 11px; }
.udrop { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(16, 32, 64, .14); min-width: 230px; padding: 6px; z-index: 50; }
.udrop .uhead { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.udrop .uhead b { display: block; }
.udrop button { all: unset; box-sizing: border-box; width: 100%; display: flex; gap: 9px; align-items: center; padding: 9px 10px; border-radius: 7px; cursor: pointer; color: var(--ink2); }
.udrop button:hover { background: var(--bg); color: var(--ink); }
.content { padding: 20px 22px 30px; flex: 1; }
.appfoot { padding: 10px 22px 16px; font-size: 11.5px; color: var(--muted); }
.scrim { display: none; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line2); border-top-color: var(--blue2); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Komponen ---------- */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 16px 18px; }
.card h3 { font-size: 14px; margin-bottom: 10px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.card h3 svg.ic { color: var(--blue2); }
.card h3 small { font-weight: 400; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

button, .btn {
  font: inherit; font-size: 13px; border: 1px solid var(--blue2); background: var(--blue2); color: #fff; border-radius: 7px; padding: 7px 13px; min-height: 34px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 550; text-decoration: none; white-space: nowrap; transition: background .12s, box-shadow .12s;
}
button:hover, .btn:hover { background: var(--blue); border-color: var(--blue); text-decoration: none; }
button:focus-visible, .btn:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.ghost, .btn.ghost { background: #fff; color: var(--ink2); border-color: var(--line2); }
button.ghost:hover, .btn.ghost:hover { background: #f4f7fb; color: var(--blue); border-color: var(--blue2); }
button.ok, .btn.ok { background: var(--ok); border-color: var(--ok); }
button.ok:hover, .btn.ok:hover { background: #0f7444; }
button.warn, .btn.warn { background: var(--amber); border-color: var(--amber); color: #2a1d00; }
button.danger, .btn.danger { background: var(--err); border-color: var(--err); }
button.danger.ghost { background: #fff; color: var(--err); border-color: #f1b8b8; }
button.sm, .btn.sm { padding: 3px 9px; font-size: 12px; min-height: 28px; border-radius: 6px; }
button.lg, .btn.lg { padding: 10px 18px; font-size: 15px; min-height: 44px; }
button.block { width: 100%; }

input, select, textarea {
  font: inherit; font-size: 13.5px; border: 1px solid var(--line2); border-radius: 7px; padding: 7px 10px; background: #fff; color: var(--ink); width: 100%; min-height: 34px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue2); box-shadow: 0 0 0 3px rgba(31, 111, 178, .15); }
input:disabled, select:disabled { background: #f4f6fa; color: var(--muted); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--blue2); }
label.f { display: block; font-size: 12px; color: var(--ink2); font-weight: 600; }
label.f > input, label.f > select, label.f > textarea, label.f > .inp { margin-top: 5px; font-weight: 400; }
.form { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.form .wide { grid-column: 1 / -1; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

/* ---------- Data grid ---------- */
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.t th { text-align: left; background: #f5f7fb; color: var(--ink2); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid #edf1f6; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
table.t th:last-child { border-right: 0; }
table.t td { padding: 8px 10px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
table.t tbody tr:nth-child(even) td { background: #fafbfd; }
table.t tbody tr:hover td { background: #eef5fd; }
table.t tbody tr.sel td { background: var(--sel) !important; }
table.t tr.click { cursor: pointer; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow: auto; max-height: 66vh; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.dt-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dt-search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line2); border-radius: 7px; padding: 0 10px; background: #fff; min-width: 240px; color: var(--muted); }
.dt-search input { border: 0; padding: 7px 0; min-height: 32px; box-shadow: none !important; }
.dt-title { border: 1px solid var(--line2); border-radius: 20px; padding: 4px 14px; font-weight: 650; font-size: 12.5px; color: var(--ink2); background: #f8fafc; }
.ibtn { background: #fff; color: var(--ink2); border-color: var(--line2); }
.ibtn:hover { background: #f4f7fb; color: var(--blue); border-color: var(--blue2); }
.ibtn.primary { background: var(--blue2); color: #fff; border-color: var(--blue2); }
.ibtn.primary:hover { background: var(--blue); color: #fff; }
.th { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
th.n .th { justify-content: flex-end; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--blue); }
.sortable i { font-style: normal; font-size: 10px; color: var(--blue2); }
.fbtn { all: unset; cursor: pointer; color: #a3afc0; display: inline-grid; place-items: center; padding: 2px; border-radius: 4px; }
.fbtn:hover { color: var(--blue2); background: #e6eef8; }
.fbtn svg.ic { width: 13px; height: 13px; }
.dt-frow th { background: #fbfcfe; padding: 5px 6px; top: 37px; }
.dt-frow input { min-height: 28px; padding: 3px 7px; font-size: 12px; font-weight: 400; }
.dt-act { width: 44px; text-align: center !important; }
.abtn { all: unset; cursor: pointer; width: 30px; height: 28px; border: 1px solid var(--line2); border-radius: 6px; display: inline-grid; place-items: center; background: #fff; color: var(--ink2); }
.abtn.edit:hover { color: var(--blue2); border-color: var(--blue2); background: #eef5fd; }
.abtn.del { color: var(--err); }
.abtn.del:hover { border-color: var(--err); background: var(--err-bg); }
.dt-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.pbtn, .pnum { all: unset; cursor: pointer; min-width: 28px; height: 28px; border-radius: 6px; display: inline-grid; place-items: center; color: var(--ink2); font-size: 12.5px; }
.pbtn:hover, .pnum:hover { background: var(--bg); }
.pnum.on { background: var(--blue2); color: #fff; font-weight: 700; }

.badge { display: inline-block; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 20px; background: #e8eef6; color: var(--ink2); white-space: nowrap; letter-spacing: .2px; }
.b-DRAFT { background: #eceff3; color: #5b6673; }
.b-CONFIRMED, .b-PLANNED, .b-LABELED, .b-OPEN { background: #e3effc; color: #1a5fa8; }
.b-RECEIVING, .b-RECEIVED, .b-LOADING, .b-LOADED, .b-WASPADA, .b-PACKING { background: var(--warn-bg); color: var(--warn); }
.b-IN_WAREHOUSE, .b-STORED, .b-CLOSED, .b-READY, .b-PACKED { background: #e6f4fb; color: #0f6f9a; }
.b-SHIPPED, .b-DEPARTED, .b-ARRIVED, .b-UNLOADING { background: #ece6fb; color: #5b3fb0; }
.b-DELIVERED, .b-COMPLETED, .b-NORMAL, .b-OK { background: var(--ok-bg); color: var(--ok); }
.b-CANCELLED, .b-KRITIS, .b-ERR { background: var(--err-bg); color: var(--err); }
.b-OVERSTOCK { background: #efe7fb; color: #6b3fb0; }
.mode { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 4px; color: #fff; letter-spacing: .4px; }
.mode.TRUCK { background: #1D4ED8; }
.mode.SEA { background: #0284C7; }
.mode.AIR { background: #c98a08; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; background: rgba(255, 255, 255, .14); font-size: 12px; font-weight: 600; }

.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .v { font-size: 24px; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--muted); }
.qrc { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.qrc code { font-size: 12px; background: #f1f5fa; padding: 2px 6px; border-radius: 5px; border: 1px solid #e3e9f1; }
.qrc button.sm { padding: 1px 5px; min-height: 24px; font-size: 12px; }

/* toast & modal */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: 400px; animation: slide .2s; border-left: 4px solid var(--sky); }
.toast.err { background: #fff; color: var(--err); border-left-color: var(--err); }
.toast.ok { background: #fff; color: var(--ok); border-left-color: var(--ok); }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(12, 26, 51, .45); z-index: 500; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 12px; width: min(720px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.modal header { padding: 13px 18px; background: #fff; color: var(--ink); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; font-size: 15px; }
.modal header button { background: none; border: 0; font-size: 22px; padding: 0 6px; color: var(--muted); min-height: 0; }
.modal header button:hover { color: var(--ink); background: none; }
.modal .body { padding: 18px; }

/* ---------- Beranda ---------- */
.welcome { background: linear-gradient(120deg, var(--navy) 0%, #1A3A99 60%, #1D4ED8 100%); color: #fff; border-radius: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); overflow: hidden; min-height: 210px; }
.welcome-text { padding: 26px 30px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.welcome-text small { color: var(--sky-l); }
.welcome-text h2 { font-size: 24px; }
.welcome-text p { margin: 0; opacity: .85; max-width: 560px; line-height: 1.55; }
.welcome-text .pill { align-self: flex-start; margin-top: 6px; }
.welcome-art { width: 100%; height: 100%; display: block; }
.flow { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.flow-tile { flex: 1; min-width: 120px; border: 1px solid var(--line); border-radius: 10px; padding: 14px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--ink); background: #fbfcfe; position: relative; transition: all .15s; }
.flow-tile:hover { border-color: var(--blue2); background: #eef5fd; text-decoration: none; transform: translateY(-1px); }
.flow-tile .fi { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: #e6effa; color: var(--blue); }
.flow-tile .fi svg.ic { width: 22px; height: 22px; }
.flow-tile b { position: absolute; top: 7px; left: 10px; font-size: 11px; color: var(--muted); }
.flow-tile span:last-child { font-size: 12.5px; font-weight: 600; }
.flow-tile.off { opacity: .45; pointer-events: none; }
.flow-arrow { display: grid; place-items: center; color: var(--line2); }
.stat { display: flex; gap: 14px; align-items: center; color: var(--ink); }
.stat:hover { text-decoration: none; border-color: var(--blue2); }
.stat .si { width: 46px; height: 46px; border-radius: 11px; background: #e6effa; color: var(--blue); display: grid; place-items: center; flex-shrink: 0; }
.stat .si.red { background: var(--err-bg); color: var(--err); }
.stat .si svg.ic { width: 22px; height: 22px; }
.stat .v { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat .l { font-weight: 600; font-size: 12.5px; }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.dash > .grid { align-content: start; }
.hero {
  background: radial-gradient(ellipse at 75% 15%, #2a4fc4 0%, var(--navy) 62%); color: #fff; border-radius: 12px; padding: 22px 24px;
  position: relative; overflow: hidden; min-height: 150px; max-height: 200px; display: flex; justify-content: space-between; gap: 16px;
}
.hero h2 { font-size: 24px; font-weight: 600; }
.hero p { margin: 4px 0 0; opacity: .8; font-size: 14px; }
.hero .routes { text-align: right; font-size: 13px; color: var(--sky-l); line-height: 1.75; z-index: 1; }
.hero svg.map { position: absolute; right: 240px; top: 0; height: 100%; opacity: .6; }
.filters { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.chip { padding: 4px 11px; border-radius: 6px; background: #fff; border: 1px solid var(--line2); color: var(--ink2); font-size: 12px; cursor: pointer; font-weight: 600; min-height: 28px; }
.chip:hover { background: #f4f7fb; color: var(--blue); border-color: var(--blue2); }
.chip.on { background: var(--blue2); color: #fff; border-color: var(--blue2); }
.gauge-card { display: flex; align-items: center; gap: 14px; }
.gauge-card .v, .gauge-card h3 { white-space: nowrap; }
.gauge { width: 88px; height: 88px; position: relative; flex-shrink: 0; }
.gauge span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--ink2); }
.sign { border-radius: 10px; background: var(--blue); color: #fff; text-align: center; padding: 14px 10px; display: flex; flex-direction: column; justify-content: center; }
.sign:hover { text-decoration: none; filter: brightness(1.08); }
.sign .v { font-size: 26px; font-weight: 700; }
.sign .l { font-size: 12px; opacity: .9; }
.side-panel { display: flex; flex-direction: column; gap: 16px; }
.hbar { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; margin: 7px 0; }
.hbar .track { background: #eef2f7; border-radius: 4px; height: 10px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.alert-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: flex-start; }
.alert-item:last-child { border-bottom: 0; }

/* stepper */
.stepper { display: flex; overflow-x: auto; padding: 8px 0 2px; }
.step { flex: 1; min-width: 92px; text-align: center; position: relative; font-size: 11.5px; color: var(--muted); }
.step::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line2); z-index: 0; }
.step:first-child::before { display: none; }
.step .dot { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line2); color: var(--muted); display: grid; place-items: center; margin: 0 auto 5px; position: relative; z-index: 1; font-weight: 700; font-size: 12px; }
.step.done { color: var(--ink); }
.step.done .dot { background: var(--blue2); border-color: var(--blue2); color: #fff; }
.step.done::before { background: var(--blue2); }
.step.cur { color: var(--ink); font-weight: 600; }
.step.cur .dot { background: var(--yellow); border-color: var(--yellow); color: var(--navy); box-shadow: 0 0 0 4px rgba(127, 178, 255, .35); }

/* ---------- Scan station ---------- */
.station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.station { border-radius: 12px; padding: 18px 18px 16px; color: #fff; text-decoration: none !important; display: block; box-shadow: var(--shadow); min-height: 140px; position: relative; overflow: hidden; }
.station:hover { filter: brightness(1.07); }
.station .n { font-size: 44px; font-weight: 800; opacity: .18; position: absolute; right: 14px; top: 2px; }
.station > span:nth-child(2) svg.ic { width: 30px; height: 30px; }
.station b { font-size: 16px; display: block; margin-top: 14px; }
.station span { font-size: 12.5px; opacity: .92; }
.scan-wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
.scan-input { font-size: 20px; padding: 12px 14px; border: 2px solid var(--blue2); border-radius: 10px; font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; min-height: 52px; }
.flash { border-radius: 12px; padding: 18px; font-size: 17px; font-weight: 600; min-height: 72px; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px dashed var(--line2); color: var(--ink2); }
.flash.ok { background: var(--ok); color: #fff; border: 0; }
.flash.err { background: var(--err); color: #fff; border: 0; animation: shake .3s; }
.flash .big { font-size: 30px; display: inline-flex; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.ctx { border: 1px dashed #b9cde3; border-radius: 10px; padding: 12px 14px; background: #f7faff; }
.ctx.set { border-style: solid; border-color: #9fd8b9; background: var(--ok-bg); }
.ctx b { font-size: 15px; }
#reader { width: 100%; border-radius: 10px; overflow: hidden; background: #000; }
.loglist { max-height: 340px; overflow: auto; font-size: 12.5px; }
.loglist > div { padding: 7px 8px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.loglist .x { color: var(--err); font-weight: 700; }
.loglist .v { color: var(--ok); font-weight: 700; }
.progress { height: 8px; background: #e6edf5; border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: var(--ok); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); background: #fff; }
.auth-art { background: linear-gradient(160deg, var(--navy) 0%, #1A3584 55%, #1D4ED8 100%); color: #fff; padding: 34px 44px; display: flex; flex-direction: column; gap: 22px; position: relative; overflow: hidden; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand b { font-size: 20px; letter-spacing: 3px; display: block; }
.auth-brand span { font-size: 12px; opacity: .75; }
.auth-brand.dark { color: var(--ink); margin-bottom: 26px; }
.auth-brand.dark span { color: var(--muted); opacity: 1; }
.auth-ill { width: 100%; max-width: 640px; border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); align-self: center; }
.auth-copy h1 { font-size: 28px; margin-bottom: 8px; }
.auth-copy p { opacity: .82; line-height: 1.6; max-width: 560px; margin: 0 0 14px; }
.auth-copy ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.auth-copy li { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.auth-copy li svg.ic { color: var(--yellow); }
.auth-foot { margin-top: auto; color: rgba(255, 255, 255, .5); }
.auth-form { display: grid; place-items: center; padding: 30px; background: #f7f9fc; }
.login { width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px 30px; box-shadow: 0 10px 40px rgba(16, 32, 64, .08); display: grid; gap: 14px; }
.login h2 { font-size: 21px; }
.login p { margin: -8px 0 4px; }
.inp { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line2); border-radius: 8px; padding: 0 10px; color: var(--muted); background: #fff; }
.inp:focus-within { border-color: var(--blue2); box-shadow: 0 0 0 3px rgba(31, 111, 178, .15); }
.inp input { border: 0; box-shadow: none !important; padding: 10px 0; min-height: 42px; }
.eye { all: unset; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.eye:hover { color: var(--blue2); }
.auth-links { text-align: center; font-size: 12.5px; }
.auth-links a { display: inline-flex; gap: 6px; align-items: center; }
/* halaman lacak (track.html) tetap pakai gaya lama */
.login-bg { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--navy) 0%, #1D4ED8 100%); }
.login-bg .brand { color: var(--ink); border-color: var(--line); padding: 0 0 14px; margin-bottom: 8px; }
.login-bg .brand b { color: var(--ink); }
.login-bg .brand span { color: var(--muted); }

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero svg.map { display: none; }
  .welcome { grid-template-columns: 1fr; }
  .welcome-art { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: -260px; transition: left .2s; width: 248px !important; }
  .app.nav-open .sidebar { left: 0; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(12, 26, 51, .4); z-index: 55; }
  .app.mini .brand .bt, .app.mini .nav-head, .app.mini .nav-items a span, .app.mini .nav-mini span { display: revert; }
  .burger { display: grid; }
  .content { padding: 14px; }
  .g2, .g3, .scan-wrap { grid-template-columns: 1fr; }
  .topbar { padding: 8px 12px; }
  .un, .crumb small { display: none; }
  .crumb h1 { font-size: 15.5px; }
  .flow-arrow { display: none; }
  .flow-tile { min-width: 46%; }
}
@media print {
  .sidebar, .topbar, .noprint, .appfoot, .dt-foot { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; }
}
table.t td b, table.t td code { white-space: nowrap; }

/* Pratinjau data QR (metode copy-paste) */
.qprev { margin-top: 12px; border: 1px solid #b9d3ee; border-radius: 10px; background: #f6faff; overflow: hidden; }
.qp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; background: #e9f2fc; border-bottom: 1px solid #d3e3f5; }
.qp-head b { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); }
.qp-list { max-height: 260px; overflow: auto; }
.qp-item { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #e3ecf6; align-items: flex-start; background: #fff; }
.qp-item code { font-size: 13.5px; font-weight: 700; }
.qp-item small { color: var(--ink2); }
.qp-item.bad { background: var(--err-bg); }
.qp-item.bad .qp-ic, .qp-item.bad small { color: var(--err); }
.qp-ic { width: 32px; height: 32px; border-radius: 8px; background: #e6effa; color: var(--blue); display: grid; place-items: center; flex-shrink: 0; }
.qp-more { padding: 8px 12px; font-size: 12px; }
.qp-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; font-size: 13px; color: var(--ink); }
kbd { font-family: inherit; font-size: 11.5px; font-weight: 700; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; background: #fff; }

/* ===== v3 komponen ===== */
.pill-l { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: #eef3f9; border: 1px solid var(--line); font-size: 12px; color: var(--ink2); }
.mini-tile { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; color: var(--ink); }
.mini-tile:hover { border-color: var(--blue2); text-decoration: none; }
.mini-tile b { font-size: 22px; color: var(--blue); }
.mini-tile span { font-size: 12px; color: var(--muted); }
.formula { display: grid; gap: 6px; font-size: 13px; }
.formula span { padding: 7px 10px; background: #f5f8fc; border-left: 3px solid var(--blue2); border-radius: 4px; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 10px; }
.unit-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fbfcfe; display: grid; gap: 6px; }
.ub { display: grid; grid-template-columns: 56px 1fr 40px; gap: 8px; align-items: center; font-size: 12px; }
.ub b { text-align: right; }
.pchips { display: flex; flex-wrap: wrap; gap: 4px; }
.pchips span { font-size: 11px; padding: 2px 7px; border-radius: 5px; background: #e6effa; color: var(--blue); font-weight: 600; }
.pchips span.on { background: var(--ok); color: #fff; }
.area-flow { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.area-flow > .card { flex: 1; min-width: 180px; }
.pick-row { padding: 9px 0; border-bottom: 1px solid var(--line); }
.pick-lot { font-size: 12.5px; padding: 3px 0 0 8px; color: var(--ink2); display: flex; gap: 6px; align-items: center; }
.pick-lot.first { color: var(--ink); font-weight: 600; }
.pick-lot code { background: #f1f5fa; padding: 1px 5px; border-radius: 4px; }
.timeline { display: grid; gap: 0; }
.tl { display: flex; gap: 12px; padding: 0 0 14px 0; position: relative; }
.tl::before { content: ''; position: absolute; left: 6px; top: 14px; bottom: 0; width: 2px; background: var(--line2); }
.tl:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--blue2); border: 3px solid #dbe8f6; flex-shrink: 0; margin-top: 2px; }
.tl:first-child .tl-dot { background: var(--blue2); border-color: #c7d7fb; }

/* ===== Login dengan foto gudang penuh ===== */
.auth2 { min-height: 100vh; position: relative; display: flex; flex-direction: column; color: #fff;
  background: #0B1533 url('/img/login-bg.jpg') center / cover no-repeat; }
.auth2::before { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(8, 20, 44, .86) 0%, rgba(10, 32, 66, .62) 45%, rgba(10, 32, 66, .35) 100%); }
.auth2 > * { position: relative; }
.auth2-top { display: flex; justify-content: space-between; align-items: center; padding: 22px 34px; }
.auth2-top .tag { text-align: right; font-size: 12.5px; opacity: .85; line-height: 1.4; }
.auth2-top .tag b { display: block; font-size: 15px; letter-spacing: .5px; opacity: 1; }
.auth2-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 420px; align-items: center; gap: 40px; padding: 10px 6vw 30px; }
.auth2-copy h1 { font-size: 40px; line-height: 1.15; margin-bottom: 14px; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.auth2-copy p { font-size: 16px; opacity: .88; max-width: 560px; line-height: 1.6; margin: 0 0 20px; }
.auth2-copy .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.auth2-copy .chips span { display: inline-flex; gap: 7px; align-items: center; padding: 7px 12px; border-radius: 22px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); font-size: 13px; backdrop-filter: blur(4px); }
.auth2-copy .chips svg.ic { color: var(--yellow); }
.auth2 .login { background: rgba(255, 255, 255, .94); color: var(--ink); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .6); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.auth2 .login h2 { font-size: 22px; }
.auth2 .login .sys { font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--blue2); text-transform: uppercase; }
.auth2-foot { padding: 14px 34px; font-size: 12px; opacity: .7; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 900px) {
  .auth2-main { grid-template-columns: 1fr; padding: 10px 18px 24px; }
  .auth2-copy { display: none; }
  .auth2-top { padding: 16px 18px; }
  .auth2-top .tag { display: none; }
}
/* grid data: sel satu baris (scroll horizontal), kecuali kolom teks panjang */
.dt table.t td, .card > .tbl-wrap table.t td { white-space: nowrap; }
.dt table.t td.wrap, table.t td.wrap { white-space: normal; min-width: 220px; }
.unit-card .between b { white-space: nowrap; }

/* ---- v4: efisiensi muatan ---- */
.eff { display: inline-flex; align-items: baseline; gap: 5px; padding: 2px 8px; border-radius: 12px; font-size: 12px; white-space: nowrap; border: 1px solid transparent; }
.eff b { font-size: 12.5px; }
.eff small { color: inherit; opacity: .8; }
.eff.good { background: #E7F7EE; color: #11733E; border-color: #BFE8CF; }
.eff.mid { background: #FFF4DC; color: #8A5A00; border-color: #F5DCA3; }
.eff.low { background: #FDE8E8; color: #B42318; border-color: #F6C2C2; }
.eff.air { background: #FFF4DC; color: #8A5A00; }
.eff-good { background: #22A35A !important; } .eff-mid { background: #E3A21A !important; } .eff-low { background: #DC3B3B !important; }
.eff-big { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 10px; }
.eff-big b { font-size: 34px; line-height: 1; font-weight: 800; }
.eff-big.good b { color: #11733E; } .eff-big.mid b { color: #B07400; } .eff-big.low b { color: #B42318; }
.eff-big span { color: var(--muted); font-size: 12.5px; }
.sup-welcome { background: linear-gradient(120deg, #0E1A44, #1D4ED8); }
.gate { border-left: 5px solid var(--amber, #e3a21a); }
.gate.ok { border-left-color: var(--ok, #16a34a); }
.gate ul { margin: 6px 0 0; padding-left: 4px; list-style: none; }
.gate li { margin: 2px 0; }
.gate li.done { color: #11733E; } .gate li.todo { color: #B42318; }

.ctx.err { background: #FDECEC; border-color: #F6C2C2; color: #8F1D1D; }

/* ---- upload order sederhana ---- */
.upl-steps { display: flex; gap: 8px; margin: -4px 0 12px; flex-wrap: wrap; }
.upl-steps span { font-size: 12px; color: var(--muted); background: #F1F5FB; border-radius: 14px; padding: 3px 10px 3px 4px; }
.upl-steps b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--blue2, #2563EB); color: #fff; font-size: 11px; margin-right: 4px; }
.upl-more summary { cursor: pointer; font-weight: 600; font-size: 13px; color: #33415a; }
.upl-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px; border: 2px dashed #BFD0EE; border-radius: 10px; background: #F7FAFF; cursor: pointer; text-align: center; }
.upl-drop:hover { border-color: var(--blue2, #2563EB); background: #EEF4FF; }
.upl-drop b { color: var(--blue2, #2563EB); font-size: 14px; }
.upl-drop span { font-size: 12.5px; }
