/* WAJIB: atribut hidden harus menang atas display:flex/grid di bawahnya.
   Tanpa baris ini .login-wrap{display:flex} mengalahkan [hidden] bawaan
   browser -> kartu login TIDAK PERNAH bisa disembunyikan (bug 2026-11-24). */
[hidden] { display: none !important; }
* { box-sizing: border-box; }
.boot-error {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%);
  z-index: 999; max-width: 88vw; text-align: center;
  background: #14213d; color: #fff; border: 1px solid #e63946;
  border-radius: 12px; padding: 20px 22px;
}
.boot-error p { margin: 0 0 12px; font-size: 15px; line-height: 1.45; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #0f1420; color: #e8ecf3; }
a { color: #7ab3ff; }
.muted { color: #93a0b4; font-size: .9em; }
.error { color: #ff8a8a; }
.w100 { width: 100%; }
.brand { font-weight: 800; letter-spacing: .3px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: #171e2e; border: 1px solid #26314a; border-radius: 14px; padding: 28px; width: 100%; max-width: 380px; }
.login-card h1 { font-size: 1.25rem; margin: 8px 0; }
.login-card input { width: 100%; margin: 12px 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: #171e2e; border-bottom: 1px solid #26314a; position: sticky; top: 0; z-index: 5; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 18px 0; }
.tabs button { background: #171e2e; color: #c7d0e0; border: 1px solid #26314a; border-bottom: none; border-radius: 10px 10px 0 0; padding: 9px 14px; cursor: pointer; font-size: .95rem; }
.tabs button.active { background: #1d2740; color: #fff; font-weight: 700; }
main { padding: 16px 18px 40px; }
.tab { display: none; }
.tab.active { display: block; }
.card { background: #171e2e; border: 1px solid #26314a; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.card h2 { margin-top: 0; font-size: 1.1rem; }
.cards { display: grid; gap: 12px; }
.qcard { background: #171e2e; border: 1px solid #26314a; border-radius: 12px; padding: 14px; }
.qcard h3 { margin: 0 0 4px; font-size: 1.05rem; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #26314a; color: #cfe0ff; }
.badge.hot { background: #5a1f1f; color: #ffb3b3; }
.badge.medium { background: #5a4a1f; color: #ffe1a3; }
.badge.low { background: #1f3a5a; color: #a9ccff; }
.badge.ok { background: #1f5a34; color: #a9ffc4; }
.badge.warn { background: #5a4a1f; color: #ffe1a3; }
.badge.bad { background: #5a1f1f; color: #ffb3b3; }
.faktor { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 8px 0; }
.faktor .f { background: #10182a; border-radius: 8px; padding: 8px; font-size: .85rem; }
.faktor .bar { height: 6px; background: #26314a; border-radius: 3px; overflow: hidden; margin: 4px 0; }
.faktor .bar i { display: block; height: 100%; background: #4d8dff; }
.btn { background: #26314a; color: #e8ecf3; border: 1px solid #35466a; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: .92rem; text-decoration: none; display: inline-block; }
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 700; }
.btn.danger { background: #7a2323; border-color: #a33; color: #ffd7d7; }
.btn.ghost { background: transparent; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
label { display: block; font-size: .9rem; color: #c7d0e0; }
label.check { display: flex; gap: 8px; align-items: center; }
input, select, textarea { width: 100%; margin-top: 4px; background: #10182a; border: 1px solid #35466a; border-radius: 8px; color: #e8ecf3; padding: 9px; font: inherit; }
textarea { resize: vertical; }
.form label { margin-bottom: 8px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #26314a; vertical-align: top; }
th { color: #93a0b4; font-weight: 600; }
.ai-box { background: #10182a; border: 1px dashed #35466a; border-radius: 10px; padding: 12px; margin-bottom: 12px; }
details { margin-top: 8px; }
summary { cursor: pointer; color: #7ab3ff; }
pre { white-space: pre-wrap; word-break: break-word; background: #10182a; padding: 10px; border-radius: 8px; font-size: .85rem; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.kv .k { background: #171e2e; border: 1px solid #26314a; border-radius: 12px; padding: 14px; }
.kv .k .n { font-size: 1.6rem; font-weight: 800; }
.mono { font-family: ui-monospace, monospace; font-size: .85em; word-break: break-all; }

/* FIT LAYAR HP — perintah Boss 2026-11-24 ("ukuran layar ga fit", "UI berantakan"):
   tab jadi kisi 2 kolom sama lebar (bukan tombol nempel acak), tabel bisa
   digeser menyamping alih-alih meledak keluar layar, padding diperkecil. */
@media (max-width: 700px) {
  .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 12px 0; }
  .tabs button { border: 1px solid #26314a; border-radius: 10px; padding: 11px 6px; width: 100%; text-align: center; font-size: .92rem; }
  .topbar { padding: 12px; }
  main { padding: 14px 12px 40px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { white-space: nowrap; }
  .qcard a, .card a { overflow-wrap: anywhere; }
  /* Tabel status Dashboard: tumpuk jadi blok berlabel di HP — tidak ada
     lagi geser menyamping untuk baca status (perbaikan UI 2026-11-24). */
  table.stack { display: block; overflow-x: visible; }
  table.stack tr:first-child { display: none; }
  table.stack tr { display: block; padding: 8px 0; border-bottom: 1px solid #26314a; }
  table.stack td { display: flex; justify-content: space-between; gap: 12px; white-space: normal; border-bottom: none; padding: 5px 8px; text-align: right; }
  table.stack td::before { content: attr(data-label); color: #93a0b4; font-weight: 600; text-align: left; }
  table.stack td:first-child { font-weight: 700; }
}

/* Daftar klien aktif + arsip (2026-11-30) */
.klien { padding: 10px 0; border-bottom: 1px solid #26314a; }
.klien:last-child { border-bottom: none; }
.klien-atas { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 2px; }

/* Arsip terlipat (2026-11-30) */
.fold-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 1.1rem; font-weight: 700; padding: 2px 0; }
.fold-arrow { color: #93a0b4; font-size: 1rem; }
