:root {
  --ink: #0c2340;
  --muted: #5b6d82;
  --line: #d4e0ef;
  --paper: #eef4fb;
  --surface: #f8fbff;
  --brand: #1a4fbf;
  --brand-deep: #0d3a8c;
  --accent: #2ec6f0;
  --aktif: #1a4fbf;
  --historis: #d0891f;
  --kosong: #7a8790;
  --shadow: 0 18px 40px rgba(13, 58, 140, 0.12);
  --radius: 18px;
  --font-display: "Sora", sans-serif;
  --font-body: "Figtree", sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -8%, rgba(46, 198, 240, 0.18), transparent 36%),
    radial-gradient(circle at 90% 0%, rgba(26, 79, 191, 0.16), transparent 42%),
    linear-gradient(180deg, #e5eef9 0%, var(--paper) 28%, #f5f8fc 100%);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: min(var(--max), calc(100% - 2rem));
  max-width: 100%;
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  backdrop-filter: blur(14px);
  background: rgba(248, 251, 255, 0.88);
  border-bottom: 1px solid rgba(212, 224, 239, 0.9);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand__logo {
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  display: block;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.brand span {
  min-width: 0;
}

/* Tabel panjang: jangan disembunyikan animasi reveal */
.table-wrap.reveal,
.related-list.reveal {
  opacity: 1;
  transform: none;
}

.brand__mark {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.7rem;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}

.hero { padding: 2.8rem 0 1.4rem; }

.hero__grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 1.5rem;
  align-items: end;
}

.eyebrow {
  display: inline-block;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 0.8rem;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  max-width: 12ch;
}

.hero__lead {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 40ch;
}

.hero__panel {
  background-image: linear-gradient(160deg, var(--brand-deep), var(--brand));
  color: #f4f9ff;
  border-radius: calc(var(--radius) + 4px);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero__panel strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero__panel span { opacity: 0.9; }

.section { padding: 1.5rem 0 0.4rem; }

.section__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.section__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  letter-spacing: -0.03em;
}

.section__head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 56ch;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem;
  box-shadow: var(--shadow);
  transition: transform 280ms ease, box-shadow 280ms ease;
}

.stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 40px rgba(8, 40, 84, 0.14);
}

.stat__label { color: var(--muted); font-size: 0.88rem; }

.stat__value {
  margin-top: 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
}

.stat__meta {
  margin-top: 0.35rem;
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 600;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  min-width: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.panel h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.panel__hint {
  margin: -0.4rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.chart-wrap {
  position: relative;
  height: 280px;
  width: 100%;
  max-width: 100%;
  cursor: pointer;
  overflow: hidden;
}

.chart-wrap--tall { height: 340px; }

.bar-list { display: grid; gap: 0.75rem; }

.bar-item { display: grid; gap: 0.35rem; }

.bar-item__top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.92rem;
}

.bar-item__track {
  height: 10px;
  border-radius: 999px;
  background: #dde8f5;
  overflow: hidden;
}

.bar-item__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 900ms cubic-bezier(.2,.7,.2,1);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

table.data th,
table.data td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

table.data th {
  background: #e8f0fa;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

table.data tbody tr {
  cursor: pointer;
  transition: background 180ms ease;
}

table.data tbody tr:hover { background: #eef5fc; }

table.data tbody tr.is-static { cursor: default; }

.link-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(26, 79, 191, 0.1);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 160ms ease, transform 160ms ease;
}

.link-icon:hover {
  background: rgba(26, 79, 191, 0.18);
  transform: translateY(-1px);
}

.link-icon svg { flex-shrink: 0; }

.td-action {
  width: 1%;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge--aktif { background: rgba(11, 107, 203, 0.14); color: var(--aktif); }
.badge--historis { background: rgba(208, 137, 31, 0.16); color: var(--historis); }
.badge--kosong { background: rgba(122, 135, 144, 0.16); color: var(--kosong); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 0.9rem;
}

.detail-hero { padding: 2.2rem 0 1rem; }

.detail-hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 1rem;
}

.detail-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.kpi strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.kpi small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.source-box {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #eaf2fb;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.source-box a { color: var(--brand); font-weight: 600; }

.related-list { display: grid; gap: 0.55rem; }

.related-item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: background 180ms ease, transform 180ms ease;
}

.related-item:hover {
  background: #eef5fc;
  transform: translateX(3px);
}

.site-footer {
  margin-top: 3rem;
  padding: 1.6rem 0 2.2rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 650ms ease, transform 650ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 920px) {
  .hero__grid,
  .chart-grid,
  .detail-hero__grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 { max-width: none; }

  .container {
    width: calc(100% - 1.5rem);
  }

  .brand__logo {
    width: 2.2rem;
    height: 2.2rem;
  }

  .brand span {
    font-size: 0.95rem;
    line-height: 1.2;
  }

  .detail-kpis {
    grid-template-columns: 1fr;
  }

  .related-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .chart-wrap {
    height: 240px;
  }

  .chart-wrap--tall {
    height: 280px;
  }

  .panel {
    padding: 1rem;
  }
}

/* Tabel → kartu di mobile */
@media (max-width: 760px) {
  .table-wrap {
    overflow: visible;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  table.data {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  table.data thead {
    display: none;
  }

  table.data tbody {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
  }

  table.data tbody tr {
    display: block;
    margin: 0;
    padding: 0.95rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(13, 58, 140, 0.08);
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
  }

  table.data tbody tr:hover {
    background: #f3f8ff;
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(13, 58, 140, 0.12);
  }

  table.data tbody tr + tr {
    margin-top: 0;
  }

  table.data td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed rgba(212, 224, 239, 0.95);
    font-size: 0.92rem;
  }

  table.data td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  table.data td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    max-width: 9.5rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.35;
    padding-top: 0.12rem;
  }

  table.data td > * {
    text-align: right;
  }

  table.data td.td-primary {
    display: block;
    padding-top: 0;
    padding-bottom: 0.7rem;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -0.02em;
    line-height: 1.25;
    text-align: left;
  }

  table.data td.td-primary::before {
    display: none;
  }

  table.data td.td-primary > * {
    text-align: left;
  }

  table.data td.td-primary strong {
    display: block;
    font-family: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    line-height: inherit;
  }

  table.data td.td-num {
    justify-content: flex-start;
    gap: 0.5rem;
    padding-top: 0;
    padding-bottom: 0.35rem;
    border-bottom: none;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
  }

  table.data td.td-num::before {
    content: "#";
    flex: none;
    max-width: none;
    letter-spacing: 0;
    text-transform: none;
    font-size: inherit;
    padding-top: 0;
  }

  table.data td code {
    word-break: break-all;
    text-align: right;
  }

  table.data td.td-action {
    display: flex;
    justify-content: flex-end;
    width: auto;
    padding-top: 0.7rem;
    border-bottom: none;
  }

  table.data td.td-action::before {
    display: none;
  }

  table.data td.td-action .link-icon {
    width: 100%;
    justify-content: center;
  }
}
