:root {
  --navy: #14274a;
  --navy-2: #1d3868;
  --teal: #0f766e;
  --teal-soft: #d9efec;
  --amber: #b45309;
  --amber-soft: #fdf1dc;
  --red: #b42318;
  --red-soft: #fde8e6;
  --green: #1a7f37;
  --green-soft: #dcf3e2;
  --ink: #1f2937;
  --muted: #667085;
  --line: #e3e7ee;
  --bg: #f4f6fa;
  --card: #ffffff;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; font-size: 14px; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--teal); }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 16px 0 6px; }
small, .muted { color: var(--muted); }
code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

/* kerangka */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #cfd8ea; padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 4px 10px 16px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 12px; }
.brand b { display: block; color: #fff; font-size: 15px; line-height: 1.25; }
.brand span { font-size: 11.5px; color: #9fb0cf; }
.nav a { display: block; padding: 9px 12px; margin: 2px 0; border-radius: 8px; color: #cfd8ea; text-decoration: none; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.aktif { background: var(--teal); color: #fff; font-weight: 600; }
.nav .grup { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8497bb; padding: 14px 12px 4px; }
.user { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; }
.user b { color: #fff; display: block; }
.user button { margin-top: 8px; }
.main { padding: 22px 28px 40px; min-width: 0; }
.main.penuh { padding: 0; }
.kepala { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.kepala p { margin: 0; color: var(--muted); }

/* komponen */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.angka { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.angka b { display: block; font-size: 22px; line-height: 1.2; }
.angka span { color: var(--muted); font-size: 12.5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.aktif { color: var(--teal); border-color: var(--teal); font-weight: 600; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef1f6; color: #475467; white-space: nowrap; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.info { background: var(--teal-soft); color: var(--teal); }
.notif { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.notif.info { background: var(--teal-soft); border-color: #a9d8d2; color: #0b4f49; }
.notif.warn { background: var(--amber-soft); border-color: #f0d49c; color: #7a3a07; }
.notif.bad { background: var(--red-soft); border-color: #f4b8b2; color: #7d1a12; }
.notif ul { margin: 4px 0 0 18px; padding: 0; }

/* tabel */
.tabel { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f0f3f8; font-weight: 600; font-size: 12.5px; position: sticky; top: 0; white-space: nowrap; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:hover td { background: #fafbfd; }
tfoot td { font-weight: 700; background: #f7f9fc; }
.kosong { color: var(--muted); padding: 22px; text-align: center; }

/* formulir */
label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #c9d0dc; border-radius: 7px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 62px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #8fd0c9; border-color: var(--teal); }
.baris { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 12px; }
.help { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 400; }
.salah { color: var(--red); font-size: 12.5px; margin-top: 3px; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--teal); background: var(--teal); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.alt { background: #fff; color: var(--teal); }
.btn.bahaya { background: var(--red); border-color: var(--red); }
.btn.kecil { padding: 4px 10px; font-size: 12.5px; }
.btn.abu { background: #fff; border-color: #c9d0dc; color: var(--ink); }
.aksi { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
details > summary { cursor: pointer; color: var(--teal); font-weight: 600; }

/* masuk */
.masuk { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy) 0%, #1f4a7a 60%, var(--teal) 140%); padding: 20px; }
.masuk .kotak { background: #fff; border-radius: 14px; padding: 30px 30px 24px; width: 100%; max-width: 400px; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.masuk h1 { font-size: 21px; line-height: 1.25; }
.masuk p { color: var(--muted); margin: 6px 0 18px; }

/* peta */
.peta-wrap { display: grid; grid-template-columns: 1fr 330px; height: 100vh; }
#peta { height: 100%; background: #dbe7f0; }
.panel { background: var(--card); border-left: 1px solid var(--line); padding: 16px; overflow-y: auto; }
.legenda { background: rgba(255,255,255,.94); padding: 8px 10px; border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.25); font-size: 12px; line-height: 1.6; }
.legenda i { display: inline-block; width: 16px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.2); }
.daftar { list-style: none; margin: 0; padding: 0; }
.daftar li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.daftar li:hover { background: #f3f7fb; }
.daftar .bar { height: 4px; background: #f1c40f; border-radius: 2px; margin-top: 3px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .peta-wrap { grid-template-columns: 1fr; height: auto; }
  #peta { height: 60vh; }
  .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
