/* Dashboard SPBU. Arah desain di DESIGN.md: panel operasional, satu warna merek (hijau petrol) untuk tombol utama,
   menu aktif, dan fokus. Warna produk BBM & status adalah sistem data terpisah (palet dataviz, sudah diuji buta warna). */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/vendor/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2-variations'),
    url('/vendor/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/vendor/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2') format('woff2-variations'),
    url('/vendor/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --page: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --raised: #ffffff;
  --ink: #15191c;
  --ink-2: #4b5156;
  --muted: #61676c;
  --axis-text: #6b7176;
  --grid: #e7e5df;
  --axis: #c9c6bd;
  --line: #e4e1da;
  --line-strong: #858a8f;
  --shadow-pop: 0 12px 32px rgba(21, 25, 28, 0.14), 0 1px 3px rgba(21, 25, 28, 0.08);
  --scrim: rgba(12, 16, 18, 0.45);

  --brand: #0e4f48;
  --brand-hover: #0a3e38;
  --brand-ink: #ffffff;
  --brand-wash: #e1eeeb;
  --brand-text: #0e4f48;
  --focus: #0e4f48;

  /* Batang data yang bukan produk (pompa, per SPBU): netral, agar tidak terbaca sebagai warna produk. */
  --mark: #737a7f;

  /* Status: selalu bersama ikon + label. */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --warning-wash: #fdeccb;
  --critical-wash: #f6d5d5;
  --good-text: #006300;
  --bad-text: #b42318;
  --flash-success: #e8f5e8;
  --flash-error: #fbe9e9;

  /* Warna produk BBM (urutan & pemetaan nama ada di src/util.js → FUEL_ORDER, fuelKey). */
  --fuel-pertalite: #008300;
  --fuel-turbo: #e34948;
  --fuel-pertamax: #2a78d6;
  --fuel-dexlite: #1baf7a;
  --fuel-biosolar: #eda100;
  --fuel-green: #e87ba4;
  --fuel-dex: #6250d6;
  --fuel-premium: #eb6834;
  --fuel-other: #898781;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --gutter: 16px;
  --bottom-nav: 0px;
}

/* Mode gelap: mengikuti perangkat bila pengguna belum memilih, atau dipilih lewat tombol tema.
   Dua blok di bawah ini harus selalu sama isinya. */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme='light'])) {
    color-scheme: dark;
    --page: #0f1213;
    --surface: #171b1d;
    --surface-2: #202628;
    --raised: #20262a;
    --ink: #eceeee;
    --ink-2: #b8bec1;
    --muted: #99a0a4;
    --axis-text: #959ca0;
    --grid: #263033;
    --axis: #3a4447;
    --line: #273033;
    --line-strong: #6b767b;
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --scrim: rgba(0, 0, 0, 0.6);
    --brand: #4fb3a5;
    --brand-hover: #67c3b6;
    --brand-ink: #0a1715;
    --brand-wash: #15302c;
    --brand-text: #6cc7ba;
    --focus: #6cc7ba;
    --mark: #a3a29b;
    --warning-wash: #4a3a12;
    --critical-wash: #4d1f1f;
    --good-text: #0ca30c;
    --bad-text: #f08080;
    --flash-success: #132a13;
    --flash-error: #3a1717;
    --fuel-pertalite: #008300;
    --fuel-turbo: #e66767;
    --fuel-pertamax: #3987e5;
    --fuel-dexlite: #199e70;
    --fuel-biosolar: #c98500;
    --fuel-green: #d55181;
    --fuel-dex: #9085e9;
    --fuel-premium: #d95926;
    --fuel-other: #898781;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #0f1213;
  --surface: #171b1d;
  --surface-2: #202628;
  --raised: #20262a;
  --ink: #eceeee;
  --ink-2: #b8bec1;
  --muted: #99a0a4;
  --axis-text: #959ca0;
  --grid: #263033;
  --axis: #3a4447;
  --line: #273033;
  --line-strong: #6b767b;
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --scrim: rgba(0, 0, 0, 0.6);
  --brand: #4fb3a5;
  --brand-hover: #67c3b6;
  --brand-ink: #0a1715;
  --brand-wash: #15302c;
  --brand-text: #6cc7ba;
  --focus: #6cc7ba;
  --mark: #a3a29b;
  --warning-wash: #4a3a12;
  --critical-wash: #4d1f1f;
  --good-text: #0ca30c;
  --bad-text: #f08080;
  --flash-success: #132a13;
  --flash-error: #3a1717;
  --fuel-pertalite: #008300;
  --fuel-turbo: #e66767;
  --fuel-pertamax: #3987e5;
  --fuel-dexlite: #199e70;
  --fuel-biosolar: #c98500;
  --fuel-green: #d55181;
  --fuel-dex: #9085e9;
  --fuel-premium: #d95926;
  --fuel-other: #898781;
}

/* Kelas pembawa warna produk: elemen di dalamnya memakai var(--fuel). */
.fuel-pertalite { --fuel: var(--fuel-pertalite); }
.fuel-turbo { --fuel: var(--fuel-turbo); }
.fuel-pertamax { --fuel: var(--fuel-pertamax); }
.fuel-dexlite { --fuel: var(--fuel-dexlite); }
.fuel-biosolar { --fuel: var(--fuel-biosolar); }
.fuel-green { --fuel: var(--fuel-green); }
.fuel-dex { --fuel: var(--fuel-dex); }
.fuel-premium { --fuel: var(--fuel-premium); }
.fuel-other { --fuel: var(--fuel-other); }

/* ---------- Dasar ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  font-feature-settings: 'ss01' off;
  -webkit-font-smoothing: antialiased;
}

/* Transisi halus hanya saat tema diganti (kelas dipasang sebentar oleh common.js). */
.theme-anim,
.theme-anim *,
.theme-anim *::before,
.theme-anim *::after {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease !important;
}

a {
  color: var(--ink);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

a:hover { text-decoration-color: currentColor; }

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

h1 { font-size: clamp(22px, 1.6vw + 14px, 30px); font-weight: 720; letter-spacing: -0.022em; }
h2 { font-size: 17px; font-weight: 680; }
h3 { font-size: 15px; font-weight: 650; }

p,
figure { margin: 0; }

code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Atribut hidden harus menang atas display dari kelas komponen (mis. .banner { display: flex }). */
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 60;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 650;
}

.skip-link:focus { top: 12px; }

/* ---------- Kerangka aplikasi ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-inner,
.tabs-inner,
.page,
.lp-wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 8px 16px;
  min-height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-weight: 720;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand);
  color: var(--brand-ink);
}

.brand-mark svg { width: 18px; height: 18px; }

.topbar-context {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.site-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.site-picker select { max-width: 300px; min-height: 40px; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.topbar-user form { margin: 0; }

.user-link {
  display: inline-block;
  max-width: 180px;
  padding: 9px 8px;
  overflow: hidden;
  color: var(--ink-2);
  font-weight: 550;
  line-height: 22px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: var(--radius-sm);
}

/* Laptop kecil & tablet: bilah atas dirampingkan agar nama SPBU & status agen tetap muat. */
@media (min-width: 760px) and (max-width: 1099px) {
  .brand-text,
  .status-ago { display: none; }
  .site-picker select { max-width: 260px; }
  .user-link { max-width: 120px; }
}

.user-link:hover { color: var(--ink); background: var(--surface-2); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}

.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }

/* Tombol tema: bulan saat terang (ganti ke gelap), matahari saat gelap (ganti ke terang). */
.theme-toggle .icon-sun { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-sun { display: block; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme='light']) .theme-toggle .icon-moon { display: none; }
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

/* Menu utama di layar lebar. */
.tabs { border-top: 1px solid var(--line); }

.tabs-inner {
  display: flex;
  gap: 4px;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 560;
}

.tabs a:hover { color: var(--ink); }

.tabs a[aria-current='page'] {
  color: var(--brand-text);
  font-weight: 700;
  border-bottom-color: var(--brand);
}

/* Navigasi bawah & menu lengkap: hanya di layar sempit. */
.bottom-nav { display: none; }

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 26px;
  border-radius: 999px;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page {
  display: grid;
  gap: 20px;
  padding-top: 24px;
  padding-bottom: calc(56px + var(--bottom-nav));
}

/* Lembar menu (dialog). Escape & tombol Tutup menutupnya; klik di luar juga (common.js). */
dialog.sheet {
  width: min(100%, 420px);
  max-height: min(85dvh, 720px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--raised);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
  overflow: auto;
}

dialog.sheet::backdrop { background: var(--scrim); }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.sheet-head p { font-size: 13px; color: var(--ink-2); }

.sheet-body {
  display: grid;
  gap: 16px;
  padding: 12px 16px 20px;
}

.sheet-nav {
  display: grid;
  gap: 2px;
}

.sheet-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 560;
  text-decoration: none;
}

.sheet-nav a:hover { background: var(--surface-2); }

.sheet-nav a[aria-current='page'] {
  background: var(--brand-wash);
  color: var(--brand-text);
  font-weight: 700;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sheet-actions form { margin: 0; }

@media (max-width: 759px) {
  :root { --bottom-nav: calc(60px + env(safe-area-inset-bottom)); }

  /* Bilah atas ikut tergulir (tidak menempel) agar layar HP tidak tersita; menu ada di navigasi bawah. */
  .topbar { position: static; }
  .topbar-inner { flex-wrap: wrap; min-height: 56px; gap: 6px 10px; }

  .topbar-context {
    order: 3;
    flex-basis: 100%;
    justify-content: space-between;
    padding-bottom: 4px;
  }

  .topbar-context-role { order: 0; flex-basis: auto; padding-bottom: 0; }
  .site-picker { flex: 1 1 auto; min-width: 0; }
  .site-picker select { max-width: none; }
  .status-ago { display: none; }

  .tabs,
  .topbar-user .user-link,
  .topbar-user .logout-form { display: none; }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 4px 4px env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
  }

  .bottom-nav a,
  .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    padding: 0 2px;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 11.5px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
  }

  .bottom-nav [aria-current='page'] { color: var(--brand-text); }
  .bottom-nav [aria-current='page'] .nav-icon { background: var(--brand-wash); }

  dialog.sheet {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ---------- Judul halaman & bagian ---------- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}

.page-head > div:first-child { min-width: 0; }

.page-sub {
  margin-top: 4px;
  color: var(--ink-2);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumb { font-size: 14px; }
.breadcrumb a { color: var(--ink-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }

.section-title {
  font-size: 15px;
  font-weight: 680;
  margin: 22px 0 10px;
}

.card {
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
}

.card-head > div:first-child { min-width: 0; }

.card-sub {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--brand-text);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
}

.card-link:hover { text-decoration: underline; }

.grid-2 {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

/* Grafik utama lebar + panel samping. */
.grid-main {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1040px) {
  .grid-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
}

/* ---------- Tombol, chip, filter, formulir ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 620;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.btn:hover { background: var(--surface-2); }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn-danger { color: var(--bad-text); }
.btn-sm { min-height: 36px; padding: 4px 12px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 50px; padding: 10px 22px; font-size: 15.5px; }

.actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions form { margin: 0; }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.filters-meta { font-size: 13.5px; margin-left: auto; }

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 560;
  text-decoration: none;
  white-space: nowrap;
}

.chip:hover { background: var(--surface-2); color: var(--ink); }

.chip[aria-current='true'] {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 650;
}

.chip-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* Pengalih satuan (mis. Liter / Rupiah). */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.segmented button {
  min-height: 36px;
  padding: 4px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 620;
  cursor: pointer;
}

.segmented button:hover { color: var(--ink); }

.segmented button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.field > span { font-weight: 620; }

.field-hint { font-size: 12.5px; color: var(--muted); }

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.filter-form input,
.filter-form select { width: auto; max-width: 100%; }

input[type='checkbox'],
input[type='radio'] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--brand);
}

input:hover,
select:hover { border-color: var(--ink-2); }

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}

input:disabled,
select:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

.stack { display: grid; gap: 16px; }

.form-grid {
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  align-items: end;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.field-wide { grid-column: 1 / -1; }

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.inline-form .field { min-width: 180px; }

.checklist {
  display: grid;
  gap: 4px 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  margin: 0;
  padding: 12px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.checklist legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.checklist .hint { grid-column: 1 / -1; margin: 4px 0 0; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 10px 0;
  font-size: 14.5px;
  cursor: pointer;
}

.check input { margin-top: 2px; flex: none; }
.check small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.field-check { align-self: end; }

/* Formulir tambah yang bisa dibuka-tutup (Tambah SPBU, Tambah akun). */
.disclosure {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 20px;
  cursor: pointer;
  list-style: none;
  font-weight: 680;
  font-size: 16px;
}

.disclosure > summary::-webkit-details-marker { display: none; }

.disclosure > summary::after {
  content: '';
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  flex: none;
}

.disclosure[open] > summary::after { transform: rotate(225deg); }
.disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.disclosure-body { padding: 18px 20px 20px; display: grid; gap: 14px; }

/* ---------- Pesan, catatan, state ---------- */

.flash {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.flash-success { background: var(--flash-success); }
.flash-error { background: var(--flash-error); }

.flash-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 600;
}

.flash-title .status-icon { margin-top: 4px; }

.secret {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.secret code { font-size: 16px; padding: 8px 12px; background: var(--surface); }

.snippet {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.snippet pre {
  flex: 1 1 280px;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 14px;
}

.note-line { font-size: 13.5px; }

.hint {
  color: var(--ink-2);
  font-size: 13.5px;
  margin-top: 8px;
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14px;
}

.banner .status-icon { margin-top: 4px; }
.banner-warning { background: var(--warning-wash); border-color: transparent; }
.banner-error { background: var(--flash-error); border-color: transparent; }
.banner .btn { margin-left: auto; }

/* State kosong: menyebut penyebab dan langkah berikutnya. */
.empty {
  color: var(--ink-2);
  padding: 14px 0;
}

.empty strong { color: var(--ink); }

.empty-state {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 28px;
}

.empty-state h1,
.empty-state h2 { font-size: 20px; }

.empty-state p { max-width: 60ch; color: var(--ink-2); }

.overview { display: grid; gap: 20px; transition: opacity 0.2s; }
.is-loading { opacity: 0.6; transition: opacity 0.2s; }

/* ---------- Readout (motif layar dispenser) ---------- */

.readout {
  display: grid;
  border-top: 1px solid var(--line);
}

/* Angka yang tidak muat di samping label turun ke baris sendiri (rata kanan) daripada meluber. */
.readout-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.readout-label {
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 650;
}

.readout-value {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: clamp(22px, 1.4vw + 16px, 30px);
  font-weight: 720;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
}

.readout-unit {
  margin-right: 6px;
  color: var(--muted);
  font-size: 0.5em;
  font-weight: 650;
  letter-spacing: 0;
}

.readout-unit-after { margin: 0 0 0 6px; }

.readout-main .readout-value {
  font-size: clamp(32px, 4.2vw + 14px, 56px);
  letter-spacing: -0.03em;
}

.readout-note {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-top: 10px;
  font-size: 13.5px;
}

/* Kartu Penjualan hari ini: readout di kiri, angka pendukung di kanan. */
.sales-card {
  display: grid;
  gap: 18px 32px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .sales-card { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); }
}

.sales-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 12px;
}

.stat-list {
  display: grid;
  gap: 0;
  align-content: start;
  margin: 0;
}

.stat {
  display: grid;
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.stat:first-child { padding-top: 0; }
.stat:last-child { border-bottom: 0; }

.stat dt {
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 620;
}

.stat dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
}

.stat-value {
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.delta { font-size: 13.5px; font-weight: 600; }
.delta-up { color: var(--good-text); }
.delta-down { color: var(--bad-text); }
.delta .muted { font-weight: 450; }

/* Kotak angka sederhana (beranda admin, rekap, semua SPBU). */
.kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.tile {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 16px 18px;
}

.tile-label {
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 620;
}

.tile-value {
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 720;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tile-of {
  color: var(--muted);
  font-size: 15px;
  font-weight: 560;
}

.tile-alert .tile-value { color: var(--bad-text); }

/* ---------- Grafik ---------- */

.chart-box {
  position: relative;
  height: 280px;
}

.chart-box-sm { height: 200px; }

.chart-box canvas:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Tooltip grafik: nilai di depan, nama di belakang; kunci berupa garis pendek warna seri. */
.chart-tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  min-width: 170px;
  max-width: 280px;
  padding: 10px 12px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  color: var(--ink-2);
  font-size: 12.5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.chart-tip.is-visible { opacity: 1; }
.chart-tip-title { white-space: nowrap; }

.chart-tip-value {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.chart-tip-sub { margin-top: 1px; }

.chart-tip-rows {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 4px 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--grid);
}

.chart-tip-key {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--fuel, var(--mark));
}

.chart-tip-row-value {
  color: var(--ink);
  font-weight: 650;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-tip-row-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Legenda: tombol untuk menampilkan/menyembunyikan produk di grafik. */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 3px 12px 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.legend-item:hover { background: var(--surface-2); }

.legend-swatch {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--fuel, var(--mark));
}

.legend-value { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.legend-item[aria-pressed='false'] { color: var(--muted); }
.legend-item[aria-pressed='false'] .legend-name { text-decoration: line-through; }

.legend-item[aria-pressed='false'] .legend-swatch {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--fuel, var(--mark));
}

.table-view { margin-top: 12px; font-size: 14px; }

.table-view summary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.table-view summary:hover { color: var(--ink); }
.table-view[open] summary { margin-bottom: 8px; }

/* ---------- Tabel ---------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data th,
table.data td {
  padding: 10px 10px;
  text-align: left;
  border-bottom: 1px solid var(--grid);
  vertical-align: middle;
}

table.data th:first-child,
table.data td:first-child { padding-left: 0; }

table.data th:last-child,
table.data td:last-child { padding-right: 0; }

table.data thead th {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 650;
  border-bottom-color: var(--axis);
  white-space: nowrap;
}

table.data tbody th { font-weight: 600; }

table.data tfoot th,
table.data tfoot td {
  font-weight: 700;
  border-top: 1px solid var(--axis);
  border-bottom: none;
}

table.data .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.data tbody tr { transition: background-color 0.12s; }
table.data tbody tr:hover { background: var(--surface-2); }

.cell-sub {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 450;
}

/* Tabel lebar dengan kolom pertama tetap terlihat saat digeser (Rekap). */
.table-sticky th:first-child,
.table-sticky td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  padding-right: 12px;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

/* Di HP & tablet, baris tabel .data-cards ditampilkan sebagai daftar: label kolom di kiri, nilai di kanan. */
@media (max-width: 899px) {
  table.data-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  table.data-cards,
  table.data-cards tbody,
  table.data-cards tr,
  table.data-cards td,
  table.data-cards tbody th { display: block; width: 100%; }

  table.data-cards tbody tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  table.data-cards tbody tr:hover { background: transparent; }

  table.data-cards tbody th,
  table.data-cards td {
    padding: 3px 0;
    border: 0;
  }

  table.data-cards tbody th {
    padding-bottom: 6px;
    font-size: 15px;
    white-space: normal;
  }

  table.data-cards td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    text-align: right;
    white-space: normal;
  }

  table.data-cards td.num { white-space: nowrap; }

  table.data-cards td::before {
    content: attr(data-label);
    flex: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 560;
    text-align: left;
  }

  table.data-cards td:not([data-label])::before,
  table.data-cards td[data-label='']::before { content: none; }

  table.data-cards td > div { min-width: 0; text-align: right; }
  table.data-cards td > div .actor { justify-content: flex-end; }

  /* Isi panjang (mis. rincian aktivitas): label di atas, isi rata kiri di bawahnya. */
  table.data-cards td.cell-block { display: block; text-align: left; }
  table.data-cards td.cell-block > div { text-align: left; }
  table.data-cards td.cell-block::before { display: block; margin-bottom: 2px; }

  table.data-cards td.cell-actions { justify-content: flex-start; padding-top: 8px; }
  table.data-cards td.cell-actions .btn { min-height: 44px; }
  table.data-cards tfoot { display: block; }
  table.data-cards tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 12px; }
  table.data-cards td.bar-cell { display: none; }
}

/* Di tablet daftar itu dibagi 2 kolom supaya jarak label ke nilai tidak terlalu lebar. */
@media (min-width: 600px) and (max-width: 899px) {
  table.data-cards tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }
}

/* Tabel dengan batang horizontal (per pompa, per SPBU). */
.bar-cell { width: 34%; min-width: 90px; }
.bar-track { height: 8px; position: relative; }

.bar {
  height: 100%;
  min-width: 2px;
  background: var(--fuel, var(--mark));
  border-radius: 0 4px 4px 0;
}

/* Nama produk dengan titik warna (tabel transaksi, penerimaan, rekap). */
.fuel-dot {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fuel, var(--fuel-other));
}

.fuel-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

table.data thead .fuel-name { justify-content: flex-end; }

/* Daftar per produk: nama, porsi, batang porsi, lalu angka. */
.product-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.product-row { display: grid; gap: 6px; }

.product-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.product-share { font-weight: 700; font-variant-numeric: tabular-nums; }

.product-track {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}

.product-fill {
  height: 100%;
  min-width: 2px;
  background: var(--fuel);
  border-radius: 0 4px 4px 0;
  transition: width 0.5s ease;
}

.product-meta { font-size: 13.5px; color: var(--ink-2); }

/* ---------- Status (ikon + label) ---------- */

.status-pill,
.status-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
}

.status-pill {
  flex: none;
  flex-wrap: nowrap;
  min-height: 32px;
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  white-space: nowrap;
}

.status-icon {
  display: inline-flex;
  flex: none;
  width: 14px;
  height: 14px;
}

.status-icon svg { width: 100%; height: 100%; fill: currentColor; }
.status-ok { color: var(--good); }
.status-warning { color: var(--warning); }
.status-critical { color: var(--critical); }
.status-unknown { color: var(--axis-text); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.status-chip-warning { background: var(--warning-wash); border-color: transparent; }
.status-chip-critical { background: var(--critical-wash); border-color: transparent; }

.status-stack {
  display: grid;
  gap: 6px;
  justify-items: start;
}

table.data .status-line { flex-wrap: nowrap; white-space: nowrap; }

/* ---------- Tangki ---------- */

.tank-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}

.tank {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.tank-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.tank-product {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.tank-body {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* Gauge tangki: isi berwarna produk; latar = warna produk yang dipudarkan. */
.gauge {
  position: relative;
  height: 112px;
  border-radius: 10px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}

@supports (background: color-mix(in srgb, red 50%, blue)) {
  .gauge { background: color-mix(in srgb, var(--fuel) 15%, var(--surface)); }
}

.gauge-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--fuel);
  transition: height 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Garis batas stok rendah. */
.gauge-mark {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px solid var(--ink);
  opacity: 0.6;
}

.tank-figures {
  display: grid;
  gap: 2px;
  align-content: start;
  min-width: 0;
}

.tank-volume {
  font-size: 24px;
  font-weight: 720;
  letter-spacing: -0.015em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.tank-capacity { color: var(--ink-2); font-size: 13.5px; }
.tank-eta { font-size: 13.5px; margin-top: 6px; font-weight: 600; }
.tank-reading { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.tank-water {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13.5px;
}

.tank-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--grid);
  font-size: 13.5px;
}

.tank-meta dt { color: var(--ink-2); }
.tank-meta dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* Halaman Tangki: satu panel per tangki, status di kiri, riwayat di kanan. */
.tank-history {
  display: grid;
  gap: 20px;
  transition: opacity 0.2s;
}

.tank-panel {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
}

.tank-panel .tank { border: none; padding: 0; }

.tank-chart-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
}

@media (min-width: 900px) {
  .tank-panel { grid-template-columns: 300px minmax(0, 1fr); gap: 28px; }
}

/* ---------- Panel pengelolaan ---------- */

.meta-list {
  display: grid;
  grid-template-columns: minmax(110px, auto) 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 14.5px;
}

.meta-list dt { color: var(--ink-2); }
.meta-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  vertical-align: 1px;
}

.tag-self { border-color: var(--brand); color: var(--brand-text); }

.steps {
  margin: 0 0 14px;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  font-size: 14.5px;
}

.steps code { overflow-wrap: anywhere; }

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--grid);
}

.inline-actions form { margin: 0; }

.error-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--bad-text);
  font-size: 13.5px;
}

.perm-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.perm-list li::marker { color: var(--muted); }

.admin-only {
  color: var(--ink-2);
  font-size: 13.5px;
}

/* Daftar perlu perhatian di beranda: tiap baris = satu SPBU + alasannya. */
.attention-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attention-item {
  display: grid;
  gap: 4px 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.attention-item:first-child { padding-top: 0; }
.attention-item:last-child { border-bottom: 0; }
.attention-reasons { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* Aktivitas: siapa, apa, kapan. Catatan yang perlu dicek admin diberi tanda peringatan + teks. */
.activity-what { display: grid; gap: 2px; min-width: 0; }
.activity-label { font-weight: 650; }
.activity-detail { color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }

.activity-flag {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--warning-wash);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.activity-flag .status-icon { margin-top: 3px; }
.actor { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

/* ---------- Masuk ---------- */

.auth {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 60px);
  padding: 32px var(--gutter) 48px;
}

.auth-card {
  display: grid;
  gap: 18px;
  width: min(100%, 420px);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.auth-card h1 { font-size: 26px; }
.auth-help { color: var(--ink-2); font-size: 14px; }

.auth-foot {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
}

.push-right { margin-left: auto; }

/* ---------- Landing page ---------- */

.lp-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--page) 92%, transparent);
  border-bottom: 1px solid var(--line);
}

.lp-header .lp-wrap {
  display: flex;
  align-items: center;
  gap: 12px 24px;
  min-height: 64px;
}

.lp-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.lp-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 580;
  text-decoration: none;
  border-radius: 8px;
}

.lp-nav a:hover { color: var(--ink); background: var(--surface-2); }

.lp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lp-hero {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding-top: 56px;
  padding-bottom: 64px;
}

@media (min-width: 980px) {
  .lp-hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; padding-top: 80px; padding-bottom: 88px; }
}

.lp-hero h1 {
  font-size: clamp(32px, 3.4vw + 16px, 56px);
  line-height: 1.08;
  letter-spacing: -0.026em;
  font-weight: 760;
  text-wrap: balance;
}

.lp-lead {
  max-width: 54ch;
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.6;
  text-wrap: pretty;
}

.lp-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 28px;
}

.lp-cta-note { margin-top: 14px; color: var(--ink-2); font-size: 14px; }
.lp-chart-note { margin-top: 10px; }

/* Contoh tampilan produk: komponen readout & tangki yang sama dengan dashboard, dengan angka contoh. */
.lp-sample {
  display: grid;
  gap: 18px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.lp-sample-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.lp-sample-note {
  color: var(--muted);
  font-size: 12.5px;
}

.lp-meters { display: grid; gap: 12px; }
.lp-meter { display: grid; gap: 6px; }

.lp-meter-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}

.lp-meter-top span:last-child { font-variant-numeric: tabular-nums; color: var(--ink-2); }

.lp-meter-track {
  height: 10px;
  border-radius: 5px;
  background: var(--surface-2);
  overflow: hidden;
}

@supports (background: color-mix(in srgb, red 50%, blue)) {
  .lp-meter-track { background: color-mix(in srgb, var(--fuel) 16%, var(--surface)); }
}

.lp-meter-fill {
  height: 100%;
  background: var(--fuel);
  border-radius: 0 5px 5px 0;
}

.lp-section {
  padding-top: 64px;
  padding-bottom: 64px;
  border-top: 1px solid var(--line);
}

.lp-section-head {
  display: grid;
  gap: 10px;
  max-width: 640px;
  margin-bottom: 32px;
}

.lp-section-head h2 {
  font-size: clamp(24px, 1.6vw + 16px, 34px);
  letter-spacing: -0.025em;
  font-weight: 740;
}

.lp-section-head p { color: var(--ink-2); font-size: 16px; }

/* Fitur utama tampil lebar dengan visual; fitur pendukung sebagai daftar. */
.lp-feature-main {
  display: grid;
  gap: 24px 48px;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

@media (min-width: 900px) {
  .lp-feature-main { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); padding: 36px; }
}

.lp-feature-main h3,
.lp-feature h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }

.lp-feature-main p,
.lp-feature p { color: var(--ink-2); margin-top: 8px; }

/* Batang dibagi rata selebar sumbu, jadi label 06.00 dan 18.00 sejajar dengan batang pertama dan terakhir. */
.lp-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
  height: 140px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--axis);
}

.lp-bar {
  display: flex;
  flex: 1 1 0;
  flex-direction: column-reverse;
  gap: 2px;
  max-width: 22px;
}

.lp-bar > span { min-height: 2px; background: var(--fuel); }
.lp-bar > span:last-child { border-radius: 4px 4px 0 0; }

.lp-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--axis-text);
  font-size: 12px;
}

.lp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 12px;
  color: var(--ink-2);
  font-size: 13px;
}

.lp-legend span { display: inline-flex; align-items: center; gap: 6px; }

.lp-features {
  display: grid;
  gap: 32px 48px;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 40px;
}

@media (min-width: 760px) {
  .lp-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.lp-feature { padding-top: 18px; border-top: 2px solid var(--ink); }

.lp-more {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr);
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .lp-more { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
}

.lp-more li {
  display: grid;
  gap: 4px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.lp-more strong { font-weight: 680; }
.lp-more span { color: var(--ink-2); font-size: 14.5px; }

/* Jalur data: komputer SPBU, agen, server dashboard, perangkat pemilik. */
.lp-flow {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 980px) {
  .lp-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.lp-node {
  position: relative;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 18px 20px 18px 0;
}

.lp-node h3 { font-size: 16px; font-weight: 700; }
.lp-node p { color: var(--ink-2); font-size: 14.5px; }

.lp-node-where {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

/* Garis penghubung antar-simpul: vertikal di HP, horizontal di layar lebar. */
.lp-node::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.lp-node { padding-left: 20px; }

.lp-node::after {
  content: '';
  position: absolute;
  left: -4px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--page);
  border: 2px solid var(--brand);
}

@media (min-width: 980px) {
  .lp-node { padding: 26px 24px 0 0; }
  .lp-node::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 2px; }
  .lp-node::after { left: 0; top: -4px; }
}

.lp-facts {
  display: grid;
  gap: 12px 32px;
  grid-template-columns: minmax(0, 1fr);
  margin: 32px 0 0;
  padding: 20px 24px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

@media (min-width: 760px) {
  .lp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.lp-facts li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.lp-facts .status-icon { margin-top: 5px; }

.lp-faq {
  display: grid;
  gap: 0;
  max-width: 820px;
  border-top: 1px solid var(--line);
}

.lp-faq details { border-bottom: 1px solid var(--line); }

.lp-faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.lp-faq summary::-webkit-details-marker { display: none; }

.lp-faq summary::after {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
}

.lp-faq details[open] summary::after { transform: rotate(225deg); }
.lp-faq details p { max-width: 70ch; padding: 0 0 18px; color: var(--ink-2); }

.lp-footer {
  padding-top: 28px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
}

.lp-footer .lp-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.lp-footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.lp-footer-links a { color: var(--ink-2); }

/* Layar sangat sempit: logo saja, agar tombol tema & Masuk tetap muat. */
@media (max-width: 359px) {
  .lp-brand-text { display: none; }
}

@media (max-width: 759px) {
  .lp-nav { display: none; }
  .lp-actions { margin-left: auto; }
  .lp-hero { padding-top: 32px; padding-bottom: 40px; gap: 28px; }
  .lp-lead { font-size: 16px; }
  .lp-section { padding-top: 44px; padding-bottom: 44px; }
  .lp-section-head { margin-bottom: 24px; }
  .lp-feature-main,
  .lp-sample { padding: 18px; }
  .lp-features,
  .lp-more { margin-top: 28px; }
}

/* ---------- Ukuran layar ---------- */

@media (min-width: 760px) {
  :root { --gutter: 24px; }
  .page { padding-top: 28px; gap: 24px; }
}

@media (min-width: 1100px) {
  :root { --gutter: 32px; }
}

/* Area sentuh minimal 44 px di HP (jempol tidak sepresisi kursor). */
@media (max-width: 759px) {
  .btn-sm,
  .chip,
  .legend-item,
  .card-link,
  .table-view summary,
  .segmented button,
  .site-picker select { min-height: 44px; }

  .icon-btn { width: 44px; height: 44px; }
}

@media (max-width: 759px) {
  .page { gap: 16px; padding-top: 18px; }
  .card { padding: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 14px; }
  .tile-value { font-size: 23px; }
  .filters-meta { margin-left: 0; width: 100%; }
  .chart-box { height: 240px; }
  .filter-form { width: 100%; }
  .filter-form .field { flex: 1 1 140px; }
  .filter-form input,
  .filter-form select { width: 100%; }
  .page-head .page-actions { width: 100%; }
  table.data { font-size: 13.5px; }
  .meta-list { grid-template-columns: 1fr; gap: 2px; }
  .meta-list dd { margin-bottom: 8px; }
  .auth-card { padding: 22px 18px; }
}

/* Di layar sempit batang disembunyikan; angka di kolom tetap lengkap. */
@media (max-width: 480px) {
  .bar-cell { display: none; }
}

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

@media (forced-colors: active) {
  .bar,
  .product-fill,
  .gauge-fill,
  .legend-swatch,
  .fuel-dot,
  .chart-tip-key,
  .lp-bar > span,
  .lp-meter-fill { background: CanvasText; }
  .gauge,
  .product-track,
  .lp-meter-track { border: 1px solid CanvasText; }
}

@media print {
  .topbar,
  .tabs,
  .bottom-nav,
  .lp-header,
  .filters,
  .page-actions { display: none !important; }
  body { background: #fff; }
  .card { border-color: #ccc; }
}
