/* =====================================================================
   DNS TRANS 13 — antarmuka admin
   Bahasa visual: papan rambu jalan raya. Hijau tol untuk aksi utama,
   kuning pelat kendaraan sebagai penanda posisi, angka bergaya monospasi
   agar kolom rupiah selalu rata.
   ===================================================================== */

:root {
  --ink:        #12181C;
  --ink-2:      #1D262C;
  --ink-3:      #2C3941;
  --paper:      #F1F3F0;
  --card:       #FFFFFF;
  --line:       #DCE0DB;
  --line-2:     #EDEFEB;
  --text:       #1A2126;
  --muted:      #67757D;
  --accent:     #14503C;
  --accent-2:   #1C6B50;
  --signal:     #E3B23C;
  --pos:        #1B7A4D;
  --neg:        #A93B2B;
  --neg-soft:   #FBEDEA;
  --pos-soft:   #EAF4EE;
  --warn-soft:  #FCF4DF;

  --r:    6px;
  --r-lg: 10px;
  --rail: 244px;

  --shadow: 0 1px 2px rgba(18,24,28,.06), 0 6px 20px -12px rgba(18,24,28,.28);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  font-feature-settings: "cv05", "ss01";
}

h1, h2, h3, h4, .rail__brand, .kpi__value, .stat {
  font-family: Archivo, Inter, system-ui, sans-serif;
  letter-spacing: -0.015em;
}

h1 { font-size: 1.4rem; font-weight: 650; margin: 0; }
h2 { font-size: 1.05rem; font-weight: 650; margin: 0 0 .75rem; }
h3 { font-size: .85rem; font-weight: 650; margin: 0 0 .5rem; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.num, td.num, th.num, input.num, .money {
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: .85em;
  letter-spacing: -0.02em;
}

/* --- Kerangka halaman ---------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.rail {
  width: var(--rail);
  flex: 0 0 var(--rail);
  background: var(--ink);
  color: #C9D3D8;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.rail__brand {
  padding: 1.15rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.rail__mark {
  display: inline-block;
  background: var(--signal);
  color: var(--ink);
  font-weight: 700;
  font-size: .68rem;
  letter-spacing: .14em;
  padding: .18rem .45rem;
  border-radius: 3px;
  margin-bottom: .4rem;
}
.rail__name { color: #fff; font-size: 1.02rem; font-weight: 650; display: block; }
.rail__sub  { color: #7E8F98; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }

.rail__group { padding: .9rem 0 .3rem; }
.rail__label {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: #6B7C85;
  padding: 0 1.25rem .35rem;
}
.rail a.rail__item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .46rem 1.25rem;
  color: #C9D3D8;
  font-size: .855rem;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.rail a.rail__item:hover { background: rgba(255,255,255,.05); color: #fff; }
.rail a.rail__item.is-active {
  background: rgba(227,178,60,.1);
  border-left-color: var(--signal);
  color: #fff;
  font-weight: 550;
}
.rail__foot {
  margin-top: auto;
  padding: .9rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .78rem;
}
.rail__user { display: flex; align-items: center; gap: .55rem; }
.rail__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink-3); flex: 0 0 30px; object-fit: cover;
}
.rail__user strong { color: #fff; display: block; font-weight: 550; font-size: .8rem; }
.rail__user span   { color: #7E8F98; font-size: .7rem; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: .85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky; top: 0; z-index: 20;
}
.topbar__title { flex: 1 1 auto; min-width: 0; }
.topbar__title p { margin: .1rem 0 0; color: var(--muted); font-size: .78rem; }

.content { padding: 1.35rem 1.5rem 3rem; }

/* --- Tombol --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .44rem .85rem;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: inherit; font-size: .82rem; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--line-2); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn--danger { color: var(--neg); border-color: #E9CDC7; background: var(--neg-soft); }
.btn--danger:hover { background: #F6DFDA; }
.btn--sm { padding: .26rem .55rem; font-size: .76rem; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--line-2); color: var(--text); }

/* --- Kartu ---------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
}
.card__head {
  padding: .8rem 1.05rem;
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.card__head h2 { margin: 0; flex: 1 1 auto; }
.card__body { padding: 1.05rem; }
.card__body--flush { padding: 0; }

.grid { display: grid; gap: 1.1rem; }
.grid--kpi   { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--2     { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid--form  { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .9rem 1.1rem; }

/* --- KPI ------------------------------------------------------------ */
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: .9rem 1rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--accent);
}
.kpi--signal { border-top-color: var(--signal); }
.kpi--neg    { border-top-color: var(--neg); }
.kpi--muted  { border-top-color: var(--muted); }
.kpi__label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.kpi__value {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 1.42rem; font-weight: 600; margin: .18rem 0 0;
  letter-spacing: -0.03em;
}
.kpi__note { font-size: .74rem; color: var(--muted); margin-top: .1rem; }

/* --- Tabel ---------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.tbl th, table.tbl td {
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  vertical-align: top;
}
table.tbl thead th {
  background: #F7F8F6;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
  border-bottom: 1px solid var(--line);
}
table.tbl td.num, table.tbl th.num { text-align: right; white-space: nowrap; }
table.tbl tbody tr:hover { background: #FAFBF9; }
table.tbl tfoot td {
  background: #F7F8F6;
  font-weight: 650;
  border-top: 2px solid var(--ink-3);
  border-bottom: none;
}
tr.row-total td { background: #F7F8F6; font-weight: 650; }
tr.row-group td {
  background: var(--ink);
  color: #DCE3E6;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 650;
}
td.sticky-col, th.sticky-col {
  position: sticky; left: 0; z-index: 3;
  background: var(--card);
  border-right: 1px solid var(--line);
}
thead th.sticky-col { z-index: 4; background: #F7F8F6; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.dim { color: var(--muted); }

/* Penanda ketidakkonsistenan kategori pada lampiran asli */
.flag-pemeliharaan { background: var(--warn-soft); }

/* --- Badge ---------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: .1rem .42rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  background: var(--line-2);
  color: var(--muted);
  white-space: nowrap;
}
.badge--ok  { background: var(--pos-soft); color: var(--pos); }
.badge--off { background: var(--neg-soft); color: var(--neg); }
.badge--alt { background: #E9EFF4; color: #35617F; }

/* --- Formulir ------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: .28rem; }
.field label { font-size: .78rem; font-weight: 550; }
.field .req { color: var(--neg); }
.field .hint { font-size: .72rem; color: var(--muted); }

input[type=text], input[type=email], input[type=number], input[type=date],
input[type=search], select, textarea {
  width: 100%;
  padding: .44rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  color: var(--text);
  font: inherit; font-size: .85rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-2);
  outline-offset: -1px;
  border-color: var(--accent-2);
}
textarea { min-height: 62px; resize: vertical; }
select { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%2367757D' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; padding-right: 1.7rem;
}
.form-actions {
  display: flex; gap: .55rem; flex-wrap: wrap;
  padding-top: .9rem; margin-top: .3rem;
  border-top: 1px solid var(--line-2);
}
fieldset { border: none; margin: 0; padding: 0; }
.subform {
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: .9rem;
  background: #FAFBF9;
  margin-top: .3rem;
}
.subform > legend, .subform__title {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); font-weight: 650; margin-bottom: .6rem;
}
[hidden] { display: none !important; }

/* --- Filter bar ----------------------------------------------------- */
.filterbar {
  display: flex; gap: .55rem; flex-wrap: wrap; align-items: flex-end;
}
.filterbar .field { min-width: 130px; }
.periode {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: .25rem .3rem .25rem .55rem;
}
.periode__label { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.periode select { border: none; padding: .2rem .4rem; background-position: right .3rem center; padding-right: 1.4rem; }
.periode select:focus { outline-offset: -2px; }

/* --- Notifikasi ----------------------------------------------------- */
.flash { border-radius: var(--r); padding: .6rem .85rem; margin-bottom: .7rem; font-size: .84rem; border: 1px solid; }
.flash--success { background: var(--pos-soft); border-color: #BFDECC; color: #15563A; }
.flash--error   { background: var(--neg-soft); border-color: #E9CDC7; color: #8A2E20; }
.flash--info    { background: #EDF3F7; border-color: #CBDCE7; color: #2C5871; }

.empty { padding: 2.4rem 1rem; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: .95rem; margin-bottom: .2rem; }

/* --- Grafik --------------------------------------------------------- */
.chart { position: relative; height: 260px; }
.chart--tall { height: 320px; }

/* --- Halaman masuk -------------------------------------------------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--ink);
}
.auth__side {
  padding: 3rem;
  color: #C9D3D8;
  display: flex; flex-direction: column; justify-content: center;
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(227,178,60,.16) 46px 78px) bottom / 100% 6px no-repeat,
    var(--ink);
}
.auth__side h1 { color: #fff; font-size: 2rem; line-height: 1.15; margin-bottom: .6rem; }
.auth__side p { color: #8FA0A9; max-width: 42ch; }
.auth__panel {
  background: var(--paper);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.auth__box { width: 100%; max-width: 340px; }
.btn--google {
  width: 100%; justify-content: center; gap: .6rem;
  padding: .62rem 1rem; font-size: .9rem; font-weight: 550;
  background: #fff; border: 1px solid var(--line);
}
.btn--google:hover { background: #fff; border-color: var(--muted); }

/* --- Paginasi ------------------------------------------------------- */
.pager { display: flex; gap: .35rem; align-items: center; justify-content: flex-end; padding: .7rem 1.05rem; flex-wrap: wrap; }
.pager span { font-size: .78rem; color: var(--muted); margin-right: auto; }

/* --- Responsif ------------------------------------------------------ */
@media (max-width: 980px) {
  .shell { flex-direction: column; }
  .rail { width: 100%; flex: none; height: auto; position: static; }
  .rail__group { display: flex; flex-wrap: wrap; gap: .2rem; padding: .5rem .75rem; }
  .rail__label { width: 100%; padding-left: .5rem; }
  .rail a.rail__item { padding: .35rem .7rem; border-left: none; border-bottom: 3px solid transparent; border-radius: 4px; }
  .rail a.rail__item.is-active { border-left: none; border-bottom-color: var(--signal); }
  .rail__foot { margin-top: 0; }
  .auth { grid-template-columns: 1fr; }
  .auth__side { padding: 2rem 1.5rem; }
  .content { padding: 1rem .85rem 2.5rem; }
  .topbar { padding: .7rem .85rem; }
}

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

@media print {
  .rail, .topbar, .btn, .filterbar, .pager { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #CCC; break-inside: avoid; }
  .content { padding: 0; }
}
