[hidden] { display: none !important; }
/* AutoCare — CSS biasa, mode gelap otomatis, responsif. Tanpa inline style (CSP style-src 'self'). */
:root {
  --bg: #eef1f6; --surface: #ffffff; --surface-2: #f5f7fb; --ink: #121b2b; --muted: #5a6578; --line: #d9dfe9;
  --brand: #12305c; --brand-ink: #ffffff; --brand-soft: #dfe8f6; --accent: #e9a100; --accent-soft: #fdf1d2;
  --ok: #1d7f47; --ok-soft: #dff2e6; --warn: #9a6400; --warn-soft: #fbefd4; --bad: #b4372b; --bad-soft: #f8e1de;
  --info: #0e6e86; --info-soft: #dcf0f4; --overlay: rgba(8, 14, 28, .45);
  --shadow: 0 1px 2px rgba(18, 27, 43, .06), 0 8px 24px rgba(18, 27, 43, .06);
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, Menlo, monospace;
  --r: 10px;
  color-scheme: light;
}
/* Mode gelap: ikut sistem, kecuali pengguna memilih sendiri lewat tombol tema (data-theme di <html>, lihat i18n.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #121a2b; --surface-2: #172136; --ink: #e6ebf3; --muted: #94a0b3; --line: #24304a;
    --brand: #7ea8ea; --brand-ink: #071226; --brand-soft: #1a2c4d; --accent: #f3b52b; --accent-soft: #3a2f12;
    --ok: #55c486; --ok-soft: #163525; --warn: #e9b04a; --warn-soft: #3a2d12; --bad: #ef7a6c; --bad-soft: #3d1c18;
    --info: #5cc3d6; --info-soft: #12303a; --overlay: rgba(0, 0, 0, .6);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0b1120; --surface: #121a2b; --surface-2: #172136; --ink: #e6ebf3; --muted: #94a0b3; --line: #24304a;
    --brand: #7ea8ea; --brand-ink: #071226; --brand-soft: #1a2c4d; --accent: #f3b52b; --accent-soft: #3a2f12;
    --ok: #55c486; --ok-soft: #163525; --warn: #e9b04a; --warn-soft: #3a2d12; --bad: #ef7a6c; --bad-soft: #3d1c18;
    --info: #5cc3d6; --info-soft: #12303a; --overlay: rgba(0, 0, 0, .6);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0; }
.ic { width: 18px; height: 18px; flex: none; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.boot { display: grid; place-items: center; height: 100%; color: var(--muted); }

/* tombol & isian */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #1d1600; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .ic { width: 16px; height: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--muted); }
.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 11px; }
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { resize: vertical; min-height: 70px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.hint { font-size: 12px; color: var(--muted); }

/* label status */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-ok { background: var(--ok-soft); color: var(--ok); } .p-warn { background: var(--warn-soft); color: var(--warn); }
.p-bad { background: var(--bad-soft); color: var(--bad); } .p-info { background: var(--info-soft); color: var(--info); }
.p-mute { background: var(--surface-2); color: var(--muted); }
.plate { display: inline-block; font-family: var(--f-mono); font-weight: 600; font-size: 12px; letter-spacing: .04em; border: 1.5px solid var(--ink); border-radius: 4px; padding: 0 6px; background: var(--surface); white-space: nowrap; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 9px 12px; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: flex-start; }
.notice { background: var(--info-soft); color: var(--info); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.secret { font-family: var(--f-mono); font-size: 22px; font-weight: 700; letter-spacing: .12em; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px; text-align: center; user-select: all; }

/* ---------- LOGIN (panel brand kiri + kartu gelap kanan; warna lewat --auth-*: biru navy + kuning) ---------- */
.auth {
  --auth-1: #1f4682; --auth-2: #12305c; --auth-3: #081a38;   /* gradasi panel kiri (biru navy) */
  --auth-hi: #f5c35a;                                         /* teks sorotan di judul (kuning logo) */
  --auth-btn: #1f4682; --auth-btn-2: #12305c;                 /* tombol Masuk */
  --auth-dark: #05080e;                                       /* latar panel kanan */
  --auth-glow-1: rgba(61, 115, 196, .20); --auth-glow-2: rgba(245, 195, 90, .09);
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--auth-dark); color-scheme: dark;
}
.auth-side { position: relative; overflow: hidden; color: #fff; display: flex; align-items: center; padding: 56px clamp(24px, 6vw, 72px);
  background:
    radial-gradient(circle at 4% 6%, rgba(255, 255, 255, .14), transparent 18%),
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(160deg, var(--auth-1), var(--auth-2) 48%, var(--auth-3)); }
.auth-inner { position: relative; z-index: 1; max-width: 540px; display: flex; flex-direction: column; gap: 22px; }
.auth-org { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .92; }
.auth-tile-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); }
.auth-tile-ic .ic { width: 19px; height: 19px; }
.auth-side h1 { margin: 0; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.12; font-weight: 800; letter-spacing: -.01em; }
.auth-side h1 span { display: block; color: var(--auth-hi); }
.auth-lead { margin: 0; font-size: 16px; line-height: 1.6; opacity: .9; max-width: 48ch; }
.auth-feats { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 16px; }
.auth-feats li { display: flex; gap: 14px; align-items: flex-start; }
.auth-feats .auth-tile-ic { width: 34px; height: 34px; border-radius: 9px; }
.auth-feats .auth-tile-ic .ic { width: 16px; height: 16px; }
.auth-feats b { display: block; font-size: 15px; } .auth-feats small { font-size: 13px; opacity: .78; }
.auth-credit { display: flex; align-items: center; gap: 12px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .18); font-size: 13px; }
.auth-credit small { display: block; font-size: 11.5px; opacity: .75; }
.auth-float { position: absolute; border-radius: 22px; background: linear-gradient(150deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .06)); border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25); backdrop-filter: blur(4px); animation: authFloat 9s ease-in-out infinite; pointer-events: none; }
.auth-float.a { width: 104px; height: 132px; right: 8%; top: 4%; transform: rotate(22deg); }
.auth-float.b { width: 62px; height: 84px; right: 9%; top: 54%; border-radius: 14px; transform: rotate(-12deg); animation-delay: -4s; }
@keyframes authFloat { 50% { translate: 0 -10px; } }
.auth-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 16px;
  background: radial-gradient(circle at 100% 0%, var(--auth-glow-1), transparent 42%), radial-gradient(circle at 75% 100%, var(--auth-glow-2), transparent 45%), var(--auth-dark);
  /* token gelap untuk isi kartu */
  --surface: #0c111a; --surface-2: #111826; --ink: #e8edf5; --muted: #95a1b4; --line: #222e40;
  --brand: #8db3ee; --brand-ink: #050b16; --brand-soft: rgba(141, 179, 238, .22); --bad: #ef7a6c; --bad-soft: #3d1c18; --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  color: var(--ink); }
.auth-card { width: min(420px, 100%); background: rgba(12, 17, 26, .84); border: 1px solid rgba(255, 255, 255, .08); border-radius: 22px; padding: 36px 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05); display: flex; flex-direction: column; gap: 16px; }
.auth-card h2 { margin: 0; font-size: 25px; font-weight: 800; } .auth-card .sub { margin: 4px 0 0; color: var(--muted); }
.auth-card .input { border-radius: 10px; padding: 11px 12px; background: var(--surface); }
.auth-card .input:focus { box-shadow: 0 0 0 3px var(--brand-soft); }
.auth-card .btn.primary { border: 0; border-radius: 10px; padding: 12px 14px; color: #fff; font-size: 15px; background: linear-gradient(180deg, var(--auth-btn), var(--auth-btn-2)); box-shadow: 0 8px 22px rgba(18, 48, 92, .28); }
.auth-card .btn.ghost { color: var(--muted); }
.auth-card .seg { background: #090d14; }
.auth-card .seg button[aria-pressed="true"] { background: #1a2436; color: var(--ink); }
.auth-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: #090d14; border: 1px solid rgba(255, 255, 255, .07); }
.auth-tabs button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px 9px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.auth-tabs button .ic { width: 18px; height: 18px; }
.auth-tabs button:hover { color: var(--ink); }
.auth-tabs button[aria-selected="true"] { background: #1a2436; color: var(--ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 2px 8px rgba(0, 0, 0, .35); }
.auth-tabs button[aria-selected="true"] .ic { color: var(--brand); }
.auth-tabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
:root[data-theme="light"] .auth-tabs { background: #eef1f6; border-color: #dde3ee; }
:root[data-theme="light"] .auth-tabs button[aria-selected="true"] { background: #ffffff; box-shadow: 0 1px 3px rgba(20, 30, 50, .14); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .auth-tabs { background: #eef1f6; border-color: #dde3ee; }
  :root:not([data-theme]) .auth-tabs button[aria-selected="true"] { background: #ffffff; box-shadow: 0 1px 3px rgba(20, 30, 50, .14); }
}
.auth-forgot { text-align: center; font-size: 13.5px; }
.auth-forgot summary { cursor: pointer; color: var(--brand); font-weight: 600; list-style: none; display: inline-block; }
.auth-forgot summary::-webkit-details-marker { display: none; }
.auth-forgot p { margin: 8px 0 0; color: var(--muted); }
.auth-foot { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .auth-float { animation: none; } }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 20px 30px; }
  .auth-inner { gap: 14px; }
  .auth-side h1 { font-size: 28px; } .auth-lead { font-size: 14px; }
  .auth-feats, .auth-float.b { display: none; }
  .auth-float.a { width: 64px; height: 82px; right: 6%; top: 10%; }
    .auth-credit { padding-top: 14px; }
  .auth-main { padding: 28px 16px 36px; justify-content: flex-start; }
  .auth-card { padding: 26px 20px 22px; }
}
.brandmark { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #1d1600; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; padding: 8px; border-radius: 7px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- SHELL ADMIN ---------- */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-weight: 600; color: var(--muted); text-decoration: none; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.side-foot { margin-top: auto; display: grid; gap: 8px; font-size: 12px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--warn); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.main { padding-block: 22px 48px; padding-inline: 24px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.topbar h2 { font-size: 22px; font-weight: 800; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-h h3 { font-size: 15px; font-weight: 700; }
.panel-b { padding: 16px; }
.panel-f { padding: 12px 16px; border-top: 1px solid var(--line); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.kpi b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi small { color: var(--muted); font-size: 12px; }
.meter { height: 5px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .4s; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.empty { color: var(--muted); text-align: center; padding: 28px 12px; }
tr.bad td { background: var(--bad-soft); }
.route { display: grid; gap: 1px; } .route small { color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 72px 1fr; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed .t { font-family: var(--f-mono); color: var(--muted); font-size: 12px; line-height: 1.35; }
.feed .t small { font-size: 11px; }
.feed li.new { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.livedot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ok); }
.livedot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.livedot.off { color: var(--muted); } .livedot.off::before { background: var(--muted); }
.chart-box { position: relative; height: 220px; }
.bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(22px, 1fr)); gap: 4px; align-items: end; height: 180px; }
.bars div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; font-size: 10px; color: var(--muted); }
.bars i { display: block; flex: none; width: 100%; max-height: calc(100% - 18px); background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.msg { display: block; font-size: 11.5px; margin-top: 3px; } .msg.e { color: var(--bad); } .msg.w { color: var(--warn); }
.tabs { display: inline-flex; gap: 2px; flex-wrap: wrap; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; transition: background .15s, color .15s, box-shadow .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .18), inset 0 -2px 0 var(--brand); }
.tabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.tabs button > .mono.small { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; text-align: center; opacity: 1; }
.tabs button[aria-pressed="true"] > .mono.small { background: var(--brand); color: var(--brand-ink, #fff); }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 32px 16px; display: grid; justify-items: center; gap: 8px; text-align: center; cursor: pointer; background: var(--surface-2); position: relative; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop .ic { width: 34px; height: 34px; color: var(--brand); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.cols-list { display: flex; flex-wrap: wrap; gap: 5px; }
.cols-list code { font-family: var(--f-mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.cols-list code.req { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.schema-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.schema { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 8px; align-content: start; }

.kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi b .of { font-size: 16px; font-weight: 600; color: var(--muted); }
.cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.alist { list-style: none; margin: 0; padding: 0; }
.alist li { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.alist li:last-child { border-bottom: 0; }
.formgrid.narrow { grid-template-columns: repeat(auto-fit, minmax(180px, 220px)); }
.input:disabled { opacity: .6; }
.only-mobile { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side, .main { min-width: 0; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 10px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .nav a { white-space: nowrap; padding: 8px 10px; }
  .side-foot { display: none; }
  .only-mobile { display: inline-flex; }
  .main { padding-inline: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .cols.even { grid-template-columns: 1fr; }
}

/* ---------- MODAL ---------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 16px; }
.modal-b { padding: 16px; display: grid; gap: 12px; }
.modal-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 9px; font-weight: 600; font-size: 13px; z-index: 50; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

/* ---------- TAMPILAN DRIVER (web) ---------- */
.dv { max-width: 460px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.dv-bar { background: var(--brand); color: var(--brand-ink); padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 18px; display: grid; gap: 2px; }
.dv-bar .row { justify-content: space-between; }
.dv-bar small { opacity: .85; font-size: 12px; }
.dv-bar strong { font-size: 19px; }
.dv-bar .btn { background: transparent; color: var(--brand-ink); border-color: rgba(255, 255, 255, .35); }
.dv-body { padding: 12px 12px 32px; display: flex; flex-direction: column; gap: 10px; }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.mcard h4 { font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.chk { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 8px 0; text-align: left; cursor: pointer; font-size: 14px; width: 100%; }
.chk .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: #fff; }
.chk .box .ic { width: 14px; height: 14px; opacity: 0; }
.chk[aria-pressed="true"] .box { background: var(--ok); border-color: var(--ok); }
.chk[aria-pressed="true"] .box .ic { opacity: 1; }
.trip { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; background: var(--surface); }
.trip.cur { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.trip .time { font-family: var(--f-mono); font-weight: 700; font-size: 17px; }
.tline { display: grid; grid-template-columns: 14px 1fr; gap: 6px; font-size: 13px; }
.tline i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--brand); margin-top: 5px; }
.tline i.end { background: var(--brand); }
.danger-zone { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; }
.plates { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.vlist { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0; gap: 6px; }
.vlist legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.vcheck { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; font-size: 13px; }
.vcheck input { width: 16px; height: 16px; accent-color: var(--brand); }
.split { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Daftar sederhana di ringkasan import & P2H */
ul.plain { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
ul.plain li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.warnbox { background: var(--warn-soft, #fff4e0); color: var(--ink, inherit); border-left: 3px solid var(--warn); border-radius: 8px; padding: 9px 12px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.warnbox > svg { color: var(--warn); flex: none; margin-top: 2px; }
.p2h-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.p2h-row .chk { flex: 1 1 200px; }
.p2h-row .msg { flex-basis: 100%; margin: -2px 0 4px 34px; }
.infobox { background: var(--brand-soft); border-radius: 8px; padding: 9px 12px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.infobox > svg { color: var(--brand); flex: none; margin-top: 2px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
tr.multi td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
tr.dim td { color: var(--muted); }
table.km td, table.km th { white-space: nowrap; }
.input.sm { padding: 4px 8px; font-size: 13px; width: auto; }
.km-rules { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
table.km td:last-child { white-space: normal; min-width: 220px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.warnbox ul.plain li { gap: 6px 8px; }

/* ---------- bahasa & tema ---------- */
.tools { display: inline-flex; align-items: center; gap: 6px; }
.seg.mini { display: inline-grid; grid-template-columns: auto auto; padding: 2px; gap: 2px; border-radius: 8px; }
.seg.mini button { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.auth-tools { position: absolute; top: 16px; right: 16px; z-index: 2; }
.auth-tools .seg { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }
.auth-tools .btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); color: var(--ink); }
.dv-bar .tools .seg { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); }
.dv-bar .tools .seg button { color: var(--brand-ink); opacity: .8; }
.dv-bar .tools .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); opacity: 1; }
@media (max-width: 860px) { .auth-tools { top: 12px; right: 12px; } .auth-main { padding-top: 64px; } }

/* Login pada mode terang: panel brand tetap berwarna, panel kanan terang dengan kartu putih. */
:root[data-theme="light"] .auth { --auth-dark: #f3f5f9; --auth-glow-1: rgba(61, 115, 196, .12); --auth-glow-2: rgba(245, 195, 90, .12); color-scheme: light; }
:root[data-theme="light"] .auth-main { --surface: #ffffff; --surface-2: #f5f7fb; --ink: #121b2b; --muted: #5a6578; --line: #d9dfe9; --brand: #12305c; --brand-ink: #ffffff; --brand-soft: rgba(27, 70, 130, .14); --shadow: 0 1px 2px rgba(18, 27, 43, .08); }
:root[data-theme="light"] .auth-card { background: #ffffff; border-color: #dfe5ee; box-shadow: 0 24px 60px rgba(18, 27, 43, .12); }
:root[data-theme="light"] .auth-card .seg { background: #eef1f6; }
:root[data-theme="light"] .auth-card .seg button[aria-pressed="true"] { background: #ffffff; }
:root[data-theme="light"] .auth-tools .seg, :root[data-theme="light"] .auth-tools .btn { background: #ffffff; border-color: #d9dfe9; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .auth { --auth-dark: #f3f5f9; --auth-glow-1: rgba(61, 115, 196, .12); --auth-glow-2: rgba(245, 195, 90, .12); color-scheme: light; }
  :root:not([data-theme]) .auth-main { --surface: #ffffff; --surface-2: #f5f7fb; --ink: #121b2b; --muted: #5a6578; --line: #d9dfe9; --brand: #12305c; --brand-ink: #ffffff; --brand-soft: rgba(27, 70, 130, .14); --shadow: 0 1px 2px rgba(18, 27, 43, .08); }
  :root:not([data-theme]) .auth-card { background: #ffffff; border-color: #dfe5ee; box-shadow: 0 24px 60px rgba(18, 27, 43, .12); }
  :root:not([data-theme]) .auth-card .seg { background: #eef1f6; }
  :root:not([data-theme]) .auth-card .seg button[aria-pressed="true"] { background: #ffffff; }
  :root:not([data-theme]) .auth-tools .seg, :root:not([data-theme]) .auth-tools .btn { background: #ffffff; border-color: #d9dfe9; }
}

/* ---------- solar & servis ---------- */
.modal.wide { max-width: 880px; }
.chkgrid { display: grid; gap: 6px; margin-top: 6px; }
.chkrow { display: grid; grid-template-columns: 170px auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.chkrow b { font-size: 13px; }
.seg.sm { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; }
.segopt { position: relative; }
.segopt input { position: absolute; opacity: 0; pointer-events: none; }
.segopt span { display: inline-block; padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.segopt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.segopt.ok input:checked + span { background: var(--ok-soft); color: var(--ok); }
.segopt.repair input:checked + span { background: var(--bad-soft); color: var(--bad); }
.segopt.na input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.workrow { display: grid; grid-template-columns: minmax(0, 2.2fr) 130px 64px auto minmax(0, 1.4fr) auto; gap: 6px; align-items: center; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px; font-size: 13px; padding: 3px 0; }
.kv span { color: var(--muted); } .kv b { font-weight: 600; white-space: pre-wrap; }
.svc-sec { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }
.svc-sec h4 { font-size: 14px; }
table.compact td, table.compact th { padding: 6px 8px; }
.fuelrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 700px) {
  .chkrow { grid-template-columns: 1fr; }
  .workrow { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- grafik laporan (public/charts.js) ---------- */
.gc { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; min-width: 0; }
.gc-plot { position: relative; height: 200px; margin-left: 40px; }
.gc-grid { position: absolute; inset: 0; pointer-events: none; }
.gc-grid span { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.gc-grid span:first-child { border-top-style: solid; }
.gc-grid em { position: absolute; right: calc(100% + 6px); transform: translateY(-50%); font-style: normal; font-size: 10px; color: var(--muted); font-family: var(--f-mono); white-space: nowrap; }
.gc-cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 3px; }
.gc-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.gc-col:hover { background: var(--surface-2); }
.gc-stack { width: min(100%, 40px); height: 100%; display: flex; flex-direction: column-reverse; }
.gc-stack i { display: block; width: 100%; flex: none; }
.gc-stack i:last-child { border-radius: 3px 3px 0 0; }
.gc-group { width: min(100%, 56px); height: 100%; display: flex; align-items: flex-end; gap: 2px; }
.gc-group i { display: block; flex: 1; border-radius: 3px 3px 0 0; min-height: 0; }
.gc-x { display: flex; gap: 3px; margin-left: 40px; font-size: 10px; color: var(--muted); }
.gc-x span { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-x.tilt { height: 44px; align-items: flex-start; }
.gc-x.tilt span { overflow: visible; transform: rotate(-40deg) translateX(-30%); transform-origin: top center; text-overflow: clip; }
.gc-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.gc-svg path { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.gc-dots { position: absolute; inset: 0; }
.gc-dot { position: absolute; width: 9px; height: 9px; margin: 0 0 -4.5px -4.5px; border-radius: 50%; border: 2px solid var(--surface); }
.gc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.gc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gc-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
/* warna seri */
.s1 { background: var(--brand); } .s2 { background: var(--accent); } .s3 { background: var(--info); } .s4 { background: var(--bad); }
.s5 { background: var(--line); } .s6 { background: var(--brand-soft); } .s7 { background: var(--ok); } .s8 { background: var(--warn); }
.gc-svg .s1 { stroke: var(--brand); } .gc-svg .s2 { stroke: var(--accent); } .gc-svg .s3 { stroke: var(--info); } .gc-svg .s4 { stroke: var(--bad); }
.gc-svg .s7 { stroke: var(--ok); } .gc-svg path { background: none; }
/* batang mendatar */
.hb { display: grid; gap: 6px; }
.hb-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 52px; gap: 10px; align-items: center; font-size: 13px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-l small { display: block; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.hb-b { display: grid; gap: 2px; background: var(--surface-2); border-radius: 4px; padding: 2px; }
.hb-b i { display: block; height: 9px; border-radius: 3px; min-width: 0; }
.hb-v { text-align: right; font-size: 12px; }
/* halaman laporan */
.rep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rep-grid .wide { grid-column: 1 / -1; }
.kpis.rep { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.delta { font-size: 12px; font-weight: 600; font-family: var(--f-mono); }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }
.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.minis div { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; display: grid; gap: 2px; }
.minis b { font-size: 18px; font-variant-numeric: tabular-nums; }
.minis small { color: var(--muted); font-size: 11px; }
@media (max-width: 900px) { .rep-grid { grid-template-columns: minmax(0, 1fr); } .kpis.rep { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* hanya saat dicetak */
.print-only { display: none; }
@media print {
  .print-only { display: block; margin-bottom: 12px; }
  .side, .topbar, .rep-noprint, .toast, #modal-root { display: none !important; }
  .shell { display: block !important; } .main { padding: 0 !important; }
  .panel, .kpi { break-inside: avoid; box-shadow: none !important; }
  .rep-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body { background: #fff !important; }
}

/* ---------- log aktivitas (per hari / minggu / bulan) ---------- */
.loglabel { min-width: 0; text-align: center; padding: 0 4px; }
.logbars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 4px; }
.logbar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); font: inherit; }
.logbar i { display: block; width: min(100%, 34px); background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.logbar:hover i, .logbar:focus-visible i { background: var(--accent); }
.logbar .n { font-size: 10px; line-height: 1; }
.logbar small { font-size: 10px; white-space: nowrap; overflow: hidden; max-width: 100%; }
.logbar.future { opacity: .35; cursor: default; }
.logday { margin-bottom: 12px; overflow: hidden; }
.logday > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 12px 16px; }
.logday > summary::-webkit-details-marker, .logrow > summary::-webkit-details-marker { display: none; }
.logday > summary::before { content: "▸"; color: var(--muted); margin-right: -6px; transition: transform .15s; }
.logday[open] > summary::before { transform: rotate(90deg); }
.logday[open] > summary { border-bottom: 1px solid var(--line); }
.ld-h { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.ld-k { display: flex; flex-wrap: wrap; gap: 4px; }
.logrow { border-bottom: 1px solid var(--line); }
.logrow:last-child { border-bottom: 0; }
.logrow > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 52px minmax(120px, 190px) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 16px; }
.logrow > summary:hover { background: var(--surface-2); }
.logrow[open] > summary { background: var(--brand-soft); }
.logrow .lu { display: flex; flex-direction: column; min-width: 0; }
.logrow .lu b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logrow .ls { min-width: 0; overflow-wrap: anywhere; }
.logrow .ld { padding: 8px 16px 12px 80px; display: grid; gap: 8px; background: var(--surface-2); }
.logrow .ld dl.kv { margin: 0; } .logrow .ld dd { margin: 0; overflow-wrap: anywhere; } .logrow .ld dt { color: var(--muted); }
.logpre { white-space: pre-wrap; font-size: 12px; margin: 0; }
.row.end { justify-content: flex-end; margin-bottom: 8px; }
@media (max-width: 700px) {
  .logrow > summary { grid-template-columns: 46px minmax(0, 1fr); gap: 4px 10px; }
  .logrow .lu { grid-column: 2; } .logrow .ls { grid-column: 2; } .logrow .lk { grid-column: 2; justify-self: start; }
  .logrow .lt { grid-row: 1 / span 3; align-self: start; padding-top: 2px; }
  .logrow .ld { padding-left: 16px; }
  .logrow .ld dl.kv { grid-template-columns: 110px minmax(0, 1fr); }
}

/* Tombol lonceng notifikasi kendala */
.btn[data-action="notify"] { position: relative; }
.btn[data-action="notify"][aria-pressed="true"] { border-color: var(--brand); color: var(--brand); }
.btn[data-action="notify"] .dot-on { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: #1f9d63; }
.auth-foot a { color: inherit; text-decoration: underline; }

/* Daftar staff & permintaan mobil */
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.seg button { white-space: nowrap; }

/* Tab halaman Staff: kartu bertanda warna */
.ptabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ptabs + .row.end { margin-top: -6px; }
.ptab { --c: var(--brand); --cs: var(--brand-soft); display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.ptab.blue { --c: #3d73c4; --cs: rgba(61, 115, 196, .16); }
.ptab.amber { --c: #d99a1e; --cs: rgba(217, 154, 30, .16); }
.ptab.green { --c: #1f9d63; --cs: rgba(31, 157, 99, .15); }
.ptab.violet { --c: #7b5fd6; --cs: rgba(123, 95, 214, .15); }
.ptab.rose { --c: #d0505f; --cs: rgba(208, 80, 95, .15); }
.ptab:hover { border-color: var(--c); }
.ptab[aria-selected="true"] { border-color: var(--c); background: var(--cs); box-shadow: inset 0 -3px 0 var(--c); }
.ptab:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.ptab-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--cs); color: var(--c); }
.ptab-ic .ic { width: 20px; height: 20px; }
.ptab-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .ptab-t small { color: var(--muted); font-size: 12.5px; }
.ptab-n { min-width: 34px; padding: 3px 10px; border-radius: 999px; background: var(--c); color: #fff; font-weight: 800; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }

/* Judul halaman dan tab kartu tetap di atas saat digulir */
.main > .topbar { position: sticky; top: 0; z-index: 30; margin: -22px -24px 0; padding: 18px 24px 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s, padding .2s; }
.scrolled .main > .topbar { border-bottom-color: var(--line); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); padding-block: 10px 10px; }
.scrolled .main > .topbar .label { display: none; }
.main > .ptabs { position: sticky; top: var(--topbar-h, 0px); z-index: 29; margin-inline: -24px; padding: 8px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.scrolled .main > .ptabs .ptab { padding-block: 8px; }
.scrolled .main > .ptabs .ptab-t small { display: none; }
.scrolled .main > .ptabs .ptab-ic { width: 32px; height: 32px; }
@media (max-width: 900px) {
  .main > .topbar { margin: -22px -16px 0; padding-inline: 16px; }
  .main > .ptabs { margin-inline: -16px; padding-inline: 16px; }
}
@media (max-width: 700px) { .main > .ptabs { position: static; margin-inline: 0; padding-inline: 0; background: none; backdrop-filter: none; } }
@media print { .main > .topbar, .main > .ptabs { position: static !important; } }
.topbar > .row { flex-wrap: wrap; justify-content: flex-end; }
.topbar #date-pick { width: auto; min-width: 150px; padding-block: 6px; }
