/* ============================================================
   FWA Portal — iOS-style UI
   Palet: navy #12275B · blue #1F4E9C · red #D6001C · soft #E8EEF9
   ============================================================ */
:root {
  --navy: #12275B;
  --blue: #1F4E9C;
  --blue-soft: #E8EEF9;
  --red: #D6001C;
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --text: #16213E;
  --muted: #5B6478;
  --line: #DDE3EE;
  --ok: #0E7C4A;
  --warn: #B76E00;
  --radius: 10px;
  --header-h: 52px;
  --side-w: 250px;
  --shadow: 0 2px 12px rgba(18, 39, 91, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ================= HEADER ================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-shadow: 0 2px 10px rgba(18, 39, 91, 0.35);
}

.hdr-side {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.hdr-side-right { justify-content: flex-end; }

.hdr-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.hdr-btn:hover { background: rgba(255, 255, 255, 0.25); }
.hdr-btn:active { transform: scale(0.94); }

/* icon grid (apps) — 4 kotak (2×2) */
.hdr-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  grid-template-rows: repeat(2, 6px);
  gap: 3px;
  width: 16px;
  height: 16px;
}
.hdr-btn-grid i {
  display: block;
  background: currentColor;
  border-radius: 2px;
}

/* icon list (pages) */
.hdr-btn-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 16px;
}
.hdr-btn-list::before,
.hdr-btn-list::after {
  content: "";
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.hdr-btn-list::after { width: 70%; align-self: flex-end; }

.hdr-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.hdr-logo {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 3px;
}
.hdr-logo:hover { opacity: 0.9; }

.hdr-side-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.95;
  min-width: 22px;
  text-align: center;
}

/* ================= 3-COL BODY ================= */
.app-body {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--side-w);
  height: calc(100vh - var(--header-h));
}

.side {
  background: var(--surface);
  overflow-y: auto;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
}
.side-right {
  border-right: none;
  border-left: 1px solid var(--line);
}

.side-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 8px 10px;
}

.main {
  overflow-y: auto;
  padding: 22px 24px 60px;
  background: var(--bg);
  scrollbar-gutter: stable;
}
/* Spacer anti-collapse: memastikan konten punya ruang luas di bawah
   (padding-bottom pada scroll container kadang diabaikan browser) */
.main::after {
  content: "";
  display: block;
  height: 400px;
}

/* ================= IOS APP GRID (kiri) ================= */
.ios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 8px;
  padding: 4px 2px;
}

.ios-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 8px 2px;
  border-radius: 14px;
  transition: transform 0.12s, background 0.12s;
}
.ios-app:hover { background: var(--blue-soft); transform: translateY(-1px); }
.ios-app:active { transform: scale(0.93); }

.ios-app-active .ios-icon { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--blue); }

.ios-icon {
  width: 58px;
  height: 58px;
  /* Radius 30% dari ukuran ikon — sesuai Google Play icon spec (Uniformed) */
  border-radius: 30%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  overflow: hidden;
  /* Shadow sangat halus — bukan drop shadow pada asset, hanya kedalaman UI */
  box-shadow: 0 1px 4px rgba(18, 39, 91, 0.18);
}
.ios-icon-img {
  padding: 0;
  background: transparent;
}
.ios-icon-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ios-label {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}

.side-footer {
  margin-top: 20px;
  padding: 10px 8px;
  font-size: 10px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  text-align: center;
}

/* ================= PAGE NAV (kanan) ================= */
.page-nav { display: flex; flex-direction: column; gap: 4px; }
.page-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.12s;
}
.page-nav-item:hover { background: var(--blue-soft); }
.page-nav-active { background: var(--navy); color: #fff; }
.page-nav-active:hover { background: var(--navy); }
.page-nav-ico { font-size: 15px; }
.page-nav-empty { font-size: 12.5px; color: var(--muted); padding: 8px; }

.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(18, 39, 91, 0.4);
  z-index: 900;
}

/* ================= COMPONENTS ================= */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.card .card-sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }

.step-badge {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  margin-right: 8px;
}
.step-label {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.12s;
}
.chip:hover { border-color: var(--blue); }
.chip-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.kpi .kpi-label {
  font-size: 10.5px; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.kpi .kpi-value { font-size: 19px; font-weight: 700; color: var(--navy); }
.kpi .kpi-note { font-size: 10.5px; color: var(--muted); margin-top: 4px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bar-chart .bar {
  flex: 1;
  background: var(--blue-soft);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  position: relative;
}
.bar-chart .bar.hit { background: var(--red); }

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.data th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
table.data td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
table.data tr:hover td { background: var(--blue-soft); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.badge-ok { background: #E3F4EA; color: var(--ok); }
.badge-warn { background: #FBF1E0; color: var(--warn); }

.muted { color: var(--muted); font-size: 12px; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.page-desc { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }

/* Badge versi halaman — tampil di samping judul page */
.version-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

/* ================= MOBILE / TABLET ================= */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .three-col { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  body { overflow: hidden; }
  .app-body { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    width: min(78vw, 290px);
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(18, 39, 91, 0.25);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    border-right: none;
  }
  .side-left { left: 0; }
  .side-right { right: 0; transform: translateX(105%); border-left: none; }
  .side.open { transform: translateX(0); }
  .drawer-overlay.show { display: block; }
  .hdr-side-label { max-width: 110px; }
}

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .main { padding: 16px 14px 50px; }
  .main::after { height: 320px; }
  .ios-grid { grid-template-columns: repeat(3, 1fr); }
}
