/* WMS — tema bersih & profesional. Nama class lama dipertahankan agar semua halaman tetap kompatibel. */
:root {
  --ink: #151a23;
  --ink-2: #4a5262;
  --muted: #6b7385;
  --ink-3: #8a92a2;
  --line: #e6e8ec;
  --line-2: #eef0f3;
  --card: #ffffff;
  --bg: #f6f7f9;
  --brand: #4338ca;
  --brand-2: #3730a3;
  --brand-soft: #eef0ff;
  --accent: #c46a12;
  --danger: #b42318;
  --ok: #0f7b4f;
  --warn: #a15c07;
  --radius: 12px;
  --radius-sm: 8px;
  /* permukaan & teks yang berubah antar tema */
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --hover: #f3f4f7;
  --hover-btn: #f6f7f9;
  --row-hover: #fafaff;
  --line-strong: #d8dbe2;
  --brand-text: #3730a3;
  --link: #4338ca;
  --bad: #b42318;
  --av-bg: #dfe3ff;
  --shadow-login: 0 8px 30px rgba(16, 24, 40, .06);
  /* warna status */
  --ok-bg: #e8f6ef; --ok-line: #c5e8d6;
  --bad-bg: #fdecea; --bad-line: #f5c9c4;
  --warn-bg: #fdf3e2; --warn-card-bg: #fffaf0; --warn-card-line: #f0d9b0;
  --info-bg: #e6eeff; --info-ink: #1d4ed8;
  --admin-bg: #fdf0dc; --admin-ink: #9a5b06;
  --neutral-bg: #eef0f3; --neutral-ink: #4a5262;
  color-scheme: light;
}

/* ===== Mode gelap ===== */
html[data-theme="dark"] {
  --ink: #e7e9ef;
  --ink-2: #b6bccb;
  --muted: #98a0b1;
  --ink-3: #7c8496;
  --line: #262b36;
  --line-2: #1f242d;
  --card: #171b23;
  --bg: #0e1116;
  --brand: #5b54e6;
  --brand-2: #4a43d4;
  --brand-soft: #23264d;
  --danger: #c93c31;
  --ok: #4cc38a;
  --warn: #e0a24a;
  --surface: #171b23;
  --surface-2: #1b202a;
  --hover: #1f2430;
  --hover-btn: #1f2430;
  --row-hover: #1c2130;
  --line-strong: #343a48;
  --brand-text: #b4b8ff;
  --link: #a5aaff;
  --bad: #f38078;
  --av-bg: #2b2f63;
  --shadow-login: 0 8px 30px rgba(0, 0, 0, .4);
  --ok-bg: #13291f; --ok-line: #1f4634;
  --bad-bg: #31171a; --bad-line: #5a2a2e;
  --warn-bg: #30240f; --warn-card-bg: #241d10; --warn-card-line: #4d3a16;
  --info-bg: #1a2745; --info-ink: #8fb0ff;
  --admin-bg: #33260f; --admin-ink: #f0b968;
  --neutral-bg: #232936; --neutral-ink: #b6bccb;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Ikon */
svg.i {
  width: 17px; height: 17px; flex: none;
  stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.btn svg.i { width: 15px; height: 15px; stroke-width: 1.8; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(380px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow-login);
}
.login-card .logo { width: 46px; height: 46px; border-radius: 13px; margin-bottom: 18px; }
.login-card .logo .logo-mark { width: 26px; height: 26px; }
.login-card h1 { margin: 0 0 4px; font-size: 20px; font-weight: 650; }
.login-card p { margin: 0 0 20px; color: var(--muted); }
.login-card .btn { width: 100%; justify-content: center; height: 40px; }

/* Layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  color: var(--ink-2);
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 16px; }
.logo {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 58%, #312e81 100%);
  display: grid; place-items: center;
  box-shadow: 0 4px 10px rgba(67, 56, 202, .32), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.logo-mark { width: 20px; height: 20px; display: block; }
.brand strong { color: var(--ink); font-size: 15px; font-weight: 650; letter-spacing: -.2px; line-height: 1.25; display: block; }
.brand small { display: block; color: var(--ink-3); font-size: 12px; }
nav a {
  display: flex; align-items: center; gap: 11px;
  color: var(--ink-2); text-decoration: none;
  padding: 5px 10px 5px 6px; border-radius: 10px; margin-bottom: 2px; font-size: 14px;
}
nav a:hover { background: var(--hover); color: var(--ink); }
nav a.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }

/* Ikon menu berwarna: tile lembut, jadi gradasi penuh saat aktif */
.ni {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--tb); color: var(--tf);
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.ni svg.i { width: 16px; height: 16px; stroke-width: 1.9; }
nav a:hover .ni { transform: scale(1.06); }
nav a.active .ni { background: var(--tg); color: #fff; box-shadow: 0 3px 8px var(--ts); }
.ni-indigo  { --tb: rgba(79, 70, 229, .12);  --tf: #4338ca; --tg: linear-gradient(135deg, #818cf8, #4338ca); --ts: rgba(67, 56, 202, .35); }
.ni-blue    { --tb: rgba(37, 99, 235, .12);  --tf: #1d5fd1; --tg: linear-gradient(135deg, #60a5fa, #1d4ed8); --ts: rgba(29, 78, 216, .35); }
.ni-cyan    { --tb: rgba(8, 145, 178, .13);  --tf: #0e7490; --tg: linear-gradient(135deg, #22d3ee, #0e7490); --ts: rgba(14, 116, 144, .35); }
.ni-orange  { --tb: rgba(234, 108, 18, .13); --tf: #c2570c; --tg: linear-gradient(135deg, #fb923c, #c2410c); --ts: rgba(194, 65, 12, .35); }
.ni-amber   { --tb: rgba(217, 158, 11, .15); --tf: #a16207; --tg: linear-gradient(135deg, #fbbf24, #b45309); --ts: rgba(180, 83, 9, .35); }
.ni-rose    { --tb: rgba(225, 29, 72, .11);  --tf: #be123c; --tg: linear-gradient(135deg, #fb7185, #be123c); --ts: rgba(190, 18, 60, .35); }
.ni-red     { --tb: rgba(220, 38, 38, .11);  --tf: #b91c1c; --tg: linear-gradient(135deg, #f87171, #b91c1c); --ts: rgba(185, 28, 28, .35); }
.ni-violet  { --tb: rgba(124, 58, 237, .12); --tf: #6d28d9; --tg: linear-gradient(135deg, #a78bfa, #6d28d9); --ts: rgba(109, 40, 217, .35); }
.ni-emerald { --tb: rgba(5, 150, 105, .13);  --tf: #047857; --tg: linear-gradient(135deg, #34d399, #047857); --ts: rgba(4, 120, 87, .35); }
.ni-slate   { --tb: rgba(71, 85, 105, .11);  --tf: #475569; --tg: linear-gradient(135deg, #94a3b8, #475569); --ts: rgba(71, 85, 105, .35); }
html[data-theme="dark"] .ni-indigo  { --tb: rgba(129, 140, 248, .17); --tf: #a5b4fc; }
html[data-theme="dark"] .ni-blue    { --tb: rgba(96, 165, 250, .17);  --tf: #7db4fb; }
html[data-theme="dark"] .ni-cyan    { --tb: rgba(34, 211, 238, .15);  --tf: #5ddcf0; }
html[data-theme="dark"] .ni-orange  { --tb: rgba(251, 146, 60, .17);  --tf: #fdab6b; }
html[data-theme="dark"] .ni-amber   { --tb: rgba(251, 191, 36, .16);  --tf: #fcd05c; }
html[data-theme="dark"] .ni-rose    { --tb: rgba(251, 113, 133, .16); --tf: #fd97a7; }
html[data-theme="dark"] .ni-red     { --tb: rgba(248, 113, 113, .16); --tf: #fa9494; }
html[data-theme="dark"] .ni-violet  { --tb: rgba(167, 139, 250, .17); --tf: #c0aafc; }
html[data-theme="dark"] .ni-emerald { --tb: rgba(52, 211, 153, .15);  --tf: #62dfae; }
html[data-theme="dark"] .ni-slate   { --tb: rgba(148, 163, 184, .16); --tf: #b3bfd0; }
nav .group { margin: 0; padding: 16px 10px 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); }

.main { min-width: 0; }
.topbar {
  height: 56px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.crumb { color: var(--ink-3); font-size: 13px; }
.crumb b { color: var(--ink); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.theme-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.theme-switch button {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
  border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--ink-2);
  font-size: 13px; cursor: pointer;
}
.theme-switch button:last-child { border-right: 0; }
.theme-switch button:hover { background: var(--hover-btn); }
.theme-switch svg.i { width: 15px; height: 15px; }
html:not([data-theme="dark"]) .theme-switch [data-theme-set="light"],
html[data-theme="dark"] .theme-switch [data-theme-set="dark"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.userchip { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.2; }
.userchip .av {
  width: 32px; height: 32px; border-radius: 50%; background: var(--av-bg); color: var(--brand-text);
  display: grid; place-items: center; font-weight: 600; font-size: 12px;
}
.userchip b { display: block; font-weight: 600; }
.userchip span { color: var(--ink-3); font-size: 12px; }
.content { padding: 24px 28px 40px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.2px; }

/* Kartu & angka ringkasan */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card .k { color: var(--ink-3); font-size: 13px; }
.card .v { font-size: 26px; font-weight: 650; margin-top: 4px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.card.warn { border-color: var(--warn-card-line); background: var(--warn-card-bg); }
.card.warn .v { color: var(--warn); }
.card .v .u { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.card .s { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.card .s.good { color: var(--ok); }

/* Kartu aging perbaikan (menumpuk > N hari) */
.aging-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stage-list { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 11px; }
.stage-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: center; font-size: 13px; }
.stage-row .t { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-row .t em { font-style: normal; font-size: 11.5px; font-weight: 600; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.stage-row .n { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.stage-row .bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.stage-row .bar i { display: block; height: 100%; border-radius: 999px; background: var(--ink-3); opacity: .55; }
.stage-row.top .t { color: var(--ink); font-weight: 600; }
.stage-row.top .bar i { background: linear-gradient(90deg, #fbbf24, #d97706); opacity: 1; }

/* Toolbar & form */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 11px; background: var(--surface); color: var(--ink); min-height: 36px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
.toolbar input, .toolbar select { width: auto; min-width: 140px; }
.date-filter { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.date-filter input[type=date] { min-width: 140px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px;
  background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: var(--radius-sm);
  padding: 0 14px; cursor: pointer; text-decoration: none; font-weight: 550; font-size: 13.5px;
}
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(16, 24, 40, .03); }
.btn.secondary:hover { background: var(--hover-btn); border-color: var(--line-strong); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

/* Tabel */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
th { font-size: 12.5px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: var(--row-hover); }
th:hover { background: var(--surface-2); }
td a { text-decoration: none; font-weight: 550; }
td a:hover { text-decoration: underline; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 8px; margin-top: 14px; align-items: center; color: var(--muted); font-size: 13px; }

/* Badge / status */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 550; }
.badge { white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.admin { background: var(--admin-bg); color: var(--admin-ink); }
.badge.operator { background: var(--info-bg); color: var(--info-ink); }
.badge.viewer { background: var(--neutral-bg); color: var(--neutral-ink); }
.badge.mekanik { background: var(--warn-bg); color: var(--warn); }
.badge.stok-ok, .badge.mutasi-masuk { background: var(--ok-bg); color: var(--ok); }
.badge.stok-rendah { background: var(--bad-bg); color: var(--bad); }
.badge.mutasi-keluar { background: var(--warn-bg); color: var(--warn); }

/* Status berwarna (Perbaikan) */
.badge.st-info { background: var(--info-bg); color: var(--info-ink); }
.badge.st-brand { background: var(--brand-soft); color: var(--brand-text); }
.badge.st-warn { background: var(--warn-bg); color: var(--warn); }
.badge.st-ok { background: var(--ok-bg); color: var(--ok); }
.badge.st-neutral { background: var(--neutral-bg); color: var(--neutral-ink); }

/* Notifikasi */
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid transparent; font-size: 13.5px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.alert.err { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }

/* Grafik */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; margin-bottom: 16px; }
.chart-card.full { grid-column: 1 / -1; }
.chart-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 650; }
.chart-card .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.chart-card .chart-wrap { position: relative; height: 300px; }
.chart-card.full .chart-wrap { height: 260px; }

/* Filter tahun (segmented) */
.filter-pills { display: inline-flex; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.filter-pills a { padding: 7px 14px; color: var(--ink-2); text-decoration: none; font-size: 13px; border-right: 1px solid var(--line); }
.filter-pills a:last-child { border-right: 0; }
.filter-pills a:hover { background: var(--hover-btn); }
.filter-pills a.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }

/* Dialog konfirmasi */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(15, 18, 24, .5); animation: fade-in .15s ease;
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  animation: pop-in .15s ease;
}
.modal-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bad-bg); color: var(--bad); margin-bottom: 14px; }
.modal-icon svg.i { width: 20px; height: 20px; }
.modal h2 { margin: 0 0 6px; font-size: 17px; font-weight: 650; }
.modal p { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Modal lebar berisi tabel (detail aging) */
.modal.modal-lg { width: min(760px, 100%); position: relative; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--ink-3); cursor: pointer;
  display: grid; place-items: center;
}
.modal-close:hover { background: var(--hover); color: var(--ink); }
.modal-close svg.i { width: 16px; height: 16px; }
.modal-table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.modal-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal-table-wrap th { position: sticky; top: 0; background: var(--surface-2); font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.modal-table-wrap td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.modal-table-wrap td:nth-child(1), .modal-table-wrap td:nth-child(2) { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.modal-table-wrap tr:last-child td { border-bottom: 0; }
.modal-table-wrap td.empty { text-align: center; color: var(--muted); padding: 24px 10px; white-space: normal; }
.modal-table-wrap a.row-open { font-weight: 550; }

/* Detail aging tanpa JS: <details> native per kelompok umur */
.aging-detail-card .aging-accordion-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.aging-accordion-col h4 { margin: 0 0 10px; font-size: 14px; font-weight: 650; }
.aging-details { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; overflow: hidden; background: var(--surface); }
.aging-details[open] { border-color: var(--line-strong); }
.aging-details summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; cursor: pointer; font-size: 13.5px; font-weight: 550; color: var(--ink-2);
  list-style: none;
}
.aging-details summary::-webkit-details-marker { display: none; }
.aging-details summary::before { content: '›'; font-size: 16px; font-weight: 700; color: var(--ink-3); transition: transform .15s ease; margin-right: 2px; }
.aging-details[open] summary::before { transform: rotate(90deg); }
.aging-details summary .count { margin-left: auto; color: var(--ink-3); font-weight: 550; font-variant-numeric: tabular-nums; }
.aging-details.warn summary .count { color: var(--warn); }
.aging-details.warn summary { background: var(--warn-bg); }
.aging-details .modal-table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; max-height: 280px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

/* Transisi halus (150 ms) untuk hover, fokus, dan pergantian tema */
body, a, .btn, nav a, .filter-pills a, .theme-switch button, input, select, textarea,
.sidebar, .topbar, .card, .table-wrap, th, td, .badge, .alert, .login-card, .userchip .av {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: relative; border-right: 0; border-bottom: 1px solid var(--line); }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .theme-switch button span { display: none; }
  .topbar-right { gap: 10px; }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Battery Repair Frequency Tracker */
a.badge-link { text-decoration: none; }
a.badge-link:hover .badge { filter: brightness(.94); }
tr.row-freq-high td:first-child { box-shadow: inset 3px 0 0 var(--bad); }

/* Pilihan bahasa IND / ENG */
.lang-switch { display: inline-flex; margin-top: 7px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface); }
.lang-switch a { padding: 2px 10px; font-size: 11px; font-weight: 600; letter-spacing: .5px; line-height: 1.6; color: var(--ink-3); text-decoration: none; border-right: 1px solid var(--line); }
.lang-switch a:last-child { border-right: 0; }
.lang-switch a:hover { background: var(--hover-btn); color: var(--ink); }
.lang-switch a.on { background: var(--brand-soft); color: var(--brand-text); }
.lang-floating { position: fixed; top: 14px; right: 16px; z-index: 50; margin-top: 0; }

/* Inbound / Outbound — layar scan */
.wh-scan-input { font-size: 20px; padding: 14px 16px; letter-spacing: .3px; }
.wh-feed { margin-top: 10px; padding: 10px 14px; border-radius: 10px; font-weight: 600; min-height: 22px; background: var(--neutral-bg); color: var(--neutral-ink); }
.wh-feed.ok { background: var(--ok-bg); color: var(--ok); }
.wh-feed.warn { background: var(--warn-bg); color: var(--warn); }
.wh-feed.err { background: var(--bad-bg); color: var(--bad); }
.wh-cam { position: fixed; inset: 0; background: rgba(0, 0, 0, .86); z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.wh-cam video { width: min(100%, 520px); max-height: 60vh; border-radius: 14px; background: #000; }
.wh-cam .wh-cam-msg { color: #fff; font-size: 14px; text-align: center; min-height: 20px; max-width: 520px; }
.wh-qr { width: 92px; line-height: 0; }
.wh-qr svg { display: block; border-radius: 4px; border: 1px solid var(--line); background: #fff; }
