/* GA Driver Ops — CSS biasa, mode gelap otomatis, responsif. Tanpa inline style (CSP style-src 'self'). */
:root {
  --bg: #eef2f0; --surface: #ffffff; --surface-2: #f6f8f7; --ink: #14231f; --muted: #5b6a65; --line: #dbe2df;
  --brand: #0f5c4d; --brand-ink: #ffffff; --brand-soft: #dcece7; --accent: #e9a100; --accent-soft: #fdf1d2;
  --ok: #1d7f47; --ok-soft: #dff2e6; --warn: #9a6400; --warn-soft: #fbefd4; --bad: #b4372b; --bad-soft: #f8e1de;
  --info: #245d9e; --info-soft: #e0eaf6; --overlay: rgba(10, 20, 17, .45);
  --shadow: 0 1px 2px rgba(20, 35, 31, .06), 0 8px 24px rgba(20, 35, 31, .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;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1513; --surface: #15201d; --surface-2: #1a2723; --ink: #e4ece9; --muted: #93a39e; --line: #26342f;
    --brand: #3db097; --brand-ink: #06201a; --brand-soft: #173a32; --accent: #f3b52b; --accent-soft: #3a2f12;
    --ok: #55c486; --ok-soft: #163525; --warn: #e9b04a; --warn-soft: #3a2d12; --bad: #ef7a6c; --bad-soft: #3d1c18;
    --info: #74a8e6; --info-soft: #17283d; --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 ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding-block: 32px; padding-inline: 16px; }
.login-card { width: 100%; max-width: 900px; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.login-side { background: var(--brand); color: var(--brand-ink); padding: 36px; display: flex; flex-direction: column; gap: 20px; position: relative; overflow: hidden; }
.login-side::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: 40px; height: 6px; background: repeating-linear-gradient(90deg, var(--accent) 0 34px, transparent 34px 58px); }
.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; }
.login-side h1 { font-size: 28px; line-height: 1.15; font-weight: 800; }
.login-side p { opacity: .85; max-width: 34ch; }
.login-side ul { margin: 0; padding: 0 0 50px; list-style: none; display: grid; gap: 8px; font-size: 13px; opacity: .9; }
.login-side li { display: flex; gap: 8px; } .login-side li::before { content: "→"; color: var(--accent); font-weight: 700; }
.login-form { padding: 36px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.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); }
@media (max-width: 760px) {
  .login-card { grid-template-columns: 1fr; }
  .login-side { padding: 24px 24px 40px; } .login-side ul { display: none; } .login-side::after { bottom: 16px; }
  .login-form { padding: 24px; }
}

/* ---------- 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: 48px 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; }
.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: grid; gap: 4px; justify-items: center; align-content: end; height: 100%; font-size: 10px; color: var(--muted); }
.bars i { display: block; width: 100%; 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: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tabs button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.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: 1fr; }
  .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; } }
