:root {
  /* Palet AHA Finger Test: biru navy–royal + emas dari logo */
  --navy: #0a2a6b;
  --royal: #123f9e;
  --blue-aha: #1b57d6;
  --blue-bright: #3f9bff;
  --gold: #a8730a;
  --gold-bright: #f7b500;
  --gold-soft: #fff6dd;

  --bg: #f3f7ff;
  --surface: #ffffff;
  --surface-2: #f7fafe;
  --border: #e1e9f6;
  --border-strong: #cbd9ef;
  --text: #0d1b3e;
  --muted: #5b6b8c;
  --muted-2: #8c9ab8;
  --accent: #1b57d6;
  --accent-dark: #123f9e;
  --accent-soft: #e8f0ff;
  --green: #067647;
  --green-soft: #ecfdf3;
  --amber: #a8730a;
  --amber-soft: #fff6dd;
  --red: #b42318;
  --red-soft: #fef3f2;
  --blue: #175cd3;
  --blue-soft: #eaf3ff;
  --indigo: #1b4fd8;
  --indigo-soft: #e9f0ff;
  --gray-soft: #eef3fb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(10, 42, 107, 0.05), 0 12px 30px -22px rgba(10, 42, 107, 0.35);
  --sidebar: 250px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #f7faff 0%, #f1f6ff 320px, #f3f7ff 100%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4, p { margin: 0; }
svg { width: 100%; height: 100%; display: block; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, #0a2a6b 0%, #123f9e 58%, #1749b8 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #eaf1ff;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  gap: 20px;
  z-index: 40;
  overflow: hidden; /* hanya area menu yang scroll, footer tetap terlihat */
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 0; flex: 0 0 auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(140deg, #1b57d6, #123f9e);
  color: #fff; font-weight: 700; font-size: 16px;
  letter-spacing: -0.02em; line-height: 1;
  box-shadow: 0 2px 6px rgba(4, 20, 52, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; color: #fff; }
.brand-sub { font-size: 11px; color: rgba(226, 236, 255, 0.72); letter-spacing: 0.02em; text-transform: uppercase; }

/* Menu bisa di-scroll sendiri; brand & tombol Keluar selalu terlihat */
.nav {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -6px; padding: 0 6px;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--surface); }
.nav::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
.nav-item {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
  padding: 9px 10px; border-radius: 8px;
  color: rgba(233, 241, 255, 0.82); font-weight: 500; font-size: 13.5px;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(247, 181, 0, 0.22), rgba(247, 181, 0, 0.05));
  color: #ffd970; font-weight: 650;
  box-shadow: inset 3px 0 0 var(--gold-bright);
}
.nav-icon { width: 17px; height: 17px; flex: 0 0 17px; color: currentColor; opacity: 0.9; }

.sidebar-foot {
  margin-top: auto; display: flex; flex-direction: column; gap: 10px;
  flex: 0 0 auto;
  padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.14);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(140deg, #ffd970, #f7b500); color: #3a2703;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; flex: 0 0 32px;
}
.user-meta { min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(226, 236, 255, 0.72); }
.logout-form { margin: 0; }

.main { margin-left: var(--sidebar); display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 32px;
  background: rgba(247, 250, 255, 0.88);
  backdrop-filter: blur(10px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); }
.topbar-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.menu-btn { display: none; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 16px; line-height: 1; cursor: pointer; color: var(--text);
}
.nav-backdrop { display: none; }

.content {
  padding: 26px 32px 56px;
  display: flex; flex-direction: column; gap: 24px;
  width: 100%; max-width: 1400px;
}

.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards & KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.kpi-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.kpi-icon { width: 18px; height: 18px; color: var(--blue-aha); opacity: 0.85; }
.kpi-value { font-size: 24px; font-weight: 650; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-hint { font-size: 12px; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head { background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
.card-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.card-body.pad { padding: 20px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sections { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 600; font-size: 11px;
  letter-spacing: 0.045em; text-transform: uppercase; color: var(--muted);
  background: var(--surface-2);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl th.num { text-align: right; }
.tbl th.center { text-align: center; }
.tbl td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbfd; }
.tbl .cell-main { font-weight: 600; color: var(--text); }
.tbl .cell-sub { font-size: 11.5px; color: var(--muted); }
.tbl .t-right { text-align: right; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.5;
  white-space: nowrap;
}
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--amber { background: var(--amber-soft); color: var(--amber); }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--blue { background: var(--blue-soft); color: var(--blue); }
.badge--indigo { background: var(--indigo-soft); color: var(--indigo); }
.badge--gray { background: var(--gray-soft); color: #475467; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 600;
  line-height: 1.4; cursor: pointer; white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover { background: var(--gray-soft); color: var(--text); }
.btn-primary {
  background: linear-gradient(135deg, #1b57d6 0%, #123f9e 100%);
  border-color: #123f9e; color: #fff;
  box-shadow: 0 1px 2px rgba(10, 42, 107, 0.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #123f9e 0%, #0a2a6b 100%);
  border-color: #0a2a6b; color: #fff;
}
.btn-ghost { border-color: transparent; background: transparent; color: #475467; }
.btn-ghost:hover { background: var(--gray-soft); }
/* Tombol Keluar di dalam sidebar gelap */
.sidebar .btn-ghost { color: rgba(233, 241, 255, 0.9); border-color: rgba(255, 255, 255, 0.22); }
.sidebar .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-danger { color: var(--red); border-color: #fecdca; background: var(--surface); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn svg { width: 15px; height: 15px; }
.inline-form { display: inline; margin: 0; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: #344054; }
.field .hint { font-size: 11.5px; color: var(--muted); }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='date'], input[type='search'], select, textarea {
  font-family: inherit; font-size: 13.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 8px 11px; width: 100%;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
textarea { resize: vertical; min-height: 78px; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; }
.form-actions .left { margin-right: auto; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1 1 240px; min-width: 180px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted-2); }
.toolbar .search input { padding-left: 33px; }
.toolbar select { width: auto; min-width: 140px; }

/* ---------- Flash ---------- */
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
}
.flash--ok { background: var(--green-soft); color: var(--green); border-color: #abefc6; }
.flash--error { background: var(--red-soft); color: var(--red); border-color: #fecdca; }
.flash-x { margin-left: auto; background: none; border: 0; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; opacity: 0.6; }
.flash-x:hover { opacity: 1; }

/* ---------- Auth ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 20px;
  background:
    radial-gradient(900px 420px at 8% -12%, #dce9ff 0%, rgba(220, 233, 255, 0) 62%),
    radial-gradient(720px 420px at 102% -6%, #fff2d0 0%, rgba(255, 242, 208, 0) 58%),
    linear-gradient(180deg, #f7faff 0%, #eef4ff 100%);
}
.auth-frame { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; }
.auth-brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; font-size: 18px; }
.auth-brand .brand-name { color: var(--navy); font-size: 16px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow);
  padding: 26px 24px; display: flex; flex-direction: column; gap: 18px;
}
.auth-title { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }
.auth-desc { font-size: 13px; line-height: 1.55; color: var(--muted); margin-top: -6px; }
.auth-foot { text-align: center; font-size: 11.5px; color: var(--muted-2); }

/* ---------- Misc ---------- */
.dl { display: grid; grid-template-columns: 128px 1fr; gap: 10px 16px; font-size: 13px; }
.dl dt { color: var(--muted); font-weight: 500; }
.dl dd { margin: 0; font-weight: 500; }
.stat-list { display: flex; flex-direction: column; }
/* Label kelompok kecil di atas baris KPI (mis. "Ringkasan tim") */
.group-label { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.group-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.group-label:first-child { margin-top: 0; }
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row .label { color: var(--muted); }
.stat-row .value { font-weight: 650; font-variant-numeric: tabular-nums; }
.note { font-size: 12.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (max-width: 1240px) {
  .kpi-grid--5, .kpi-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2--even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: 22px 20px 48px; }
  .topbar { padding: 16px 20px; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.18s ease; box-shadow: 0 20px 40px -20px rgba(16,24,40,.35); }
  .sidebar.is-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .nav-backdrop.is-open { display: block; position: fixed; inset: 0; background: rgba(16,24,40,.28); z-index: 35; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .kpi-grid, .kpi-grid--2, .kpi-grid--3, .kpi-grid--4, .kpi-grid--5 { grid-template-columns: minmax(0, 1fr); }
  .kpi-value { font-size: 21px; }
  .topbar-title h1 { font-size: 16px; }
  .topbar-actions { gap: 6px; }
  .dl { grid-template-columns: 100px 1fr; }
}

/* ---------- Charts ---------- */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: #eef0f4; stroke-width: 1; }
.ch-ylabel { font-size: 10px; fill: var(--muted-2); font-family: inherit; }
.ch-xlabel { font-size: 10px; fill: var(--muted); font-family: inherit; }
.ch-area { fill: rgba(79, 70, 229, 0.09); stroke: none; }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: #fff; stroke: var(--accent); stroke-width: 1.6; }
.ch-dot-hit { fill: transparent; }
.ch-hit:hover .ch-dot { r: 4; fill: var(--accent); }
.ch-bar { fill: #c7d2fe; transition: fill 0.12s ease; }
.ch-bar--now { fill: var(--blue-aha); }
.ch-bar-hit { fill: transparent; }
.ch-hit:hover .ch-bar { fill: #a5b4fc; }
.ch-hit:hover .ch-bar--now { fill: var(--accent-dark); }

/* ---------- Progress (jenjang) ---------- */
.progress-wrap { display: flex; flex-direction: column; gap: 7px; }
.progress { height: 8px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; }
.progress-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #123f9e, #3f9bff); transition: width 0.3s ease; }
.progress-fill--gray { background: linear-gradient(90deg, #98a2b3, #667085); }
.progress-fill--blue { background: linear-gradient(90deg, #60a5fa, #175cd3); }
.progress-fill--indigo { background: linear-gradient(90deg, #123f9e, #3f9bff); }
.progress-fill--amber { background: linear-gradient(90deg, #d99400, #ffd24a); }
.progress-fill--green { background: linear-gradient(90deg, #6ce9a6, #067647); }
.progress-fill--red { background: linear-gradient(90deg, #fda29b, #b42318); }
.progress-ket { font-size: 11.5px; color: var(--muted); }

/* Grafik tetap terbaca di layar kecil: geser horizontal, bukan diperkecil ekstrem */
@media (max-width: 620px) {
  .chart { overflow-x: auto; overflow-y: hidden; }
  .chart svg { min-width: 520px; }
  .progress-ket { font-size: 11px; }
}

/* ---------- Struktur jaringan ---------- */
.tree { padding: 6px 0; }
.tree-node { position: relative; }
.tree-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px 10px calc(20px + (var(--depth) * 22px));
  border-bottom: 1px solid var(--border);
  position: relative;
}
.tree-node:last-child > .tree-row { }
.tree-row:hover { background: #fafbfd; }
.tree-rail { display: none; }
.tree-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.tree-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tree-num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 760px) {
  .tree-row { flex-wrap: wrap; padding-left: calc(14px + (var(--depth) * 14px)); }
  .tree-meta { width: 100%; justify-content: flex-start; gap: 8px; }
}
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #344054; cursor: pointer; }
.check input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

/* ---------- Harga, promo, katalog ---------- */
.harga { display: flex; flex-direction: column; gap: 2px; }
.harga-baris { display: flex; align-items: center; gap: 8px; }
.harga-coret { font-size: 12.5px; color: var(--muted-2); text-decoration: line-through; }
.harga-coret--tabel { color: var(--muted-2); text-decoration: line-through; }
.harga-utama { font-size: 14.5px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.harga-hemat { font-size: 11.5px; font-weight: 600; color: var(--green); }
.harga-badge {
  display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px;
  background: var(--green-soft); color: var(--green); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.harga--lg .harga-utama { font-size: 24px; letter-spacing: -0.03em; }
.harga--lg .harga-coret { font-size: 14px; }
.harga--lg .harga-hemat { font-size: 12.5px; }
.harga--sm .harga-utama { font-size: 13px; }

.produk-judul { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.pratinjau-note { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }

.katalog-grup { display: flex; flex-direction: column; gap: 16px; }
.katalog-head { display: flex; flex-direction: column; gap: 2px; }
.katalog-judul { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }
.katalog-desc { font-size: 12.5px; color: var(--muted); }
.pcards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.pcard {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; box-shadow: var(--shadow);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}
.pcard:hover { border-color: var(--border-strong); box-shadow: 0 2px 4px rgba(16,24,40,.05), 0 18px 32px -24px rgba(16,24,40,.35); transform: translateY(-1px); }
.pcard--off { background: var(--surface-2); }
.pcard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard-kat { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pcard-tag { font-size: 11px; font-weight: 600; color: var(--gold); background: var(--gold-soft); padding: 2px 8px; border-radius: 999px; }
.pcard-nama { font-size: 15px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.35; }
.pcard-desc { font-size: 12.5px; color: var(--muted); line-height: 1.55; min-height: 38px; }
.pcard-harga { margin-top: 2px; }
.pcard-meta { font-size: 11px; color: var(--muted); min-height: 14px; }
.pcard-aksi { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.pcard-aksi .btn { flex: 1; }

@media (max-width: 1080px) { .pcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .pcards { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pcard { padding: 16px; }
  .pcard-desc { min-height: 0; }
  .harga--lg .harga-utama { font-size: 21px; }
}

/* Tombol nonaktif (mis. aksi yang belum boleh dijalankan) */
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.btn:disabled:hover, .btn[disabled]:hover { background: var(--surface-2); color: var(--muted); }

/* Modal (Hubungi WhatsApp pada Peringatan Nonaktif) */
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, 0.42); backdrop-filter: blur(2px); }
.modal-card {
  position: relative; width: 100%; max-width: 520px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 24px 60px -24px rgba(16, 24, 40, 0.45); padding: 22px 22px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-title { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; margin: 0; }
.modal-desc { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.modal-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-x:hover { color: var(--text); }
.modal-label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.modal-textarea {
  width: 100%; font-family: inherit; font-size: 13px; line-height: 1.6; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 14px; resize: vertical;
  background: var(--surface-2);
}
.modal-textarea:focus { outline: 2px solid var(--indigo-soft); border-color: var(--indigo); }
.modal-hint { font-size: 11.5px; color: var(--muted); margin: 0; line-height: 1.55; }
.modal-aksi { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.modal-aksi .btn.is-disabled { opacity: 0.55; pointer-events: none; }
body.modal-open { overflow: hidden; }
@media (max-width: 560px) {
  .modal-card { padding: 18px; }
  .modal-aksi .btn { flex: 1; }
}

/* ---------- Peta Jejaring (pohon interaktif) ---------- */
.peta-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.peta-search { display: flex; gap: 8px; flex: 1 1 260px; min-width: 0; }
.peta-search input {
  flex: 1 1 auto; min-width: 0;
  padding: 9px 12px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-family: inherit; font-size: 13px; color: var(--text);
}
.peta-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.peta-zoom { display: flex; align-items: center; gap: 6px; }
.peta-zoom-val { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.peta-legenda { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 14px 0 4px; font-size: 11.5px; color: var(--muted); }
.peta-legenda-item { display: inline-flex; align-items: center; gap: 6px; }
.peta-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.peta-dot--pramitra { background: #f7b500; }
.peta-dot--associate { background: #8c9ab8; }
.peta-dot--associate_plus { background: #64748b; }
.peta-dot--advisor { background: #1b57d6; }
.peta-dot--advisor_plus { background: #0a2a6b; }
.peta-dot--principal { background: #6d28d9; }
.peta-dot--principal_plus { background: #4c1d95; }

.peta-stage {
  position: relative; margin-top: 14px;
  height: min(62vh, 620px); min-height: 340px;
  border: 1px solid var(--border); border-radius: 14px;
  background:
    radial-gradient(1200px 400px at 10% -10%, #eef4ff 0%, rgba(238,244,255,0) 60%),
    linear-gradient(180deg, #fbfdff, #f5f9ff);
  overflow: hidden; cursor: grab; touch-action: none;
  outline: none;
}
.peta-stage:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.peta-stage.is-geser { cursor: grabbing; }
.peta-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.peta-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.peta-lines path { stroke-linecap: round; }

.peta-node {
  position: absolute; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(10, 42, 107, .06), 0 8px 18px -14px rgba(10, 42, 107, .45);
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  cursor: pointer; transition: box-shadow .12s ease, transform .12s ease, border-color .12s ease;
  border-left: 4px solid #8c9ab8;
}
.peta-node:hover { box-shadow: 0 2px 4px rgba(10,42,107,.1), 0 14px 26px -16px rgba(10,42,107,.5); transform: translateY(-1px); }
.peta-node.is-pilih { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 14px 26px -16px rgba(10,42,107,.5); }
.peta-node--pramitra { border-left-color: #f7b500; background: linear-gradient(180deg, #fffdf4, #ffffff 60%); }
.peta-node--associate { border-left-color: #8c9ab8; }
.peta-node--associate_plus { border-left-color: #64748b; background: linear-gradient(180deg, #f8fafc, #ffffff 60%); }
.peta-node--advisor { border-left-color: #1b57d6; background: linear-gradient(180deg, #f4f8ff, #ffffff 60%); }
.peta-node--advisor_plus { border-left-color: #0a2a6b; background: linear-gradient(180deg, #eff5ff, #ffffff 60%); }
.peta-node--principal { border-left-color: #6d28d9; background: linear-gradient(180deg, #f7f3ff, #ffffff 60%); }
.peta-node--principal_plus { border-left-color: #4c1d95; background: linear-gradient(180deg, #f5f0ff, #ffffff 60%); }
.peta-node--komunitas { border-left-color: #067647; background: linear-gradient(180deg, #f2fdf6, #ffffff 60%); }

.peta-node-top { display: flex; align-items: center; gap: 6px; }
.peta-node-nama { font-size: 12.5px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.peta-node-sub { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.peta-node-id { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.peta-node-jen { font-size: 10px; font-weight: 650; color: var(--indigo); background: var(--indigo-soft); padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.peta-node-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.peta-node-anak { font-size: 10.5px; color: var(--muted); }
.peta-status { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.peta-status--on { background: #12b76a; }
.peta-status--soft { background: #f7b500; }
.peta-status--warn { background: #f59e0b; }
.peta-status--off { background: #98a2b3; }
.peta-toggle {
  width: 24px; height: 24px; min-width: 24px; border-radius: 7px; padding: 0;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 14px; font-weight: 700; line-height: 1; color: var(--accent-dark);
  cursor: pointer; display: grid; place-items: center;
}
.peta-toggle:hover { background: var(--accent-soft); border-color: var(--accent); }
.peta-toggle--kosong { border: 0; background: none; pointer-events: none; }

.peta-loading {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.95); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px; font-size: 12px; color: var(--muted);
  box-shadow: var(--shadow); z-index: 5;
}
.peta-loading[hidden] { display: none; }
.peta-spinner {
  width: 13px; height: 13px; border-radius: 50%; display: inline-block;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  animation: petaSpin .7s linear infinite;
}
@keyframes petaSpin { to { transform: rotate(360deg); } }
.peta-kosong { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.peta-hint { margin-top: 12px; font-size: 11.5px; color: var(--muted); }

.peta-cari-hasil { margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.peta-cari-hasil[hidden] { display: none; }
.peta-cari-info { padding: 10px 14px; font-size: 12px; color: var(--muted); background: var(--surface-2); display: flex; align-items: center; gap: 8px; }
.peta-cari-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%;
  padding: 10px 14px; border: 0; border-top: 1px solid var(--border);
  background: var(--surface); text-align: left; cursor: pointer; font-family: inherit;
}
.peta-cari-item:hover { background: var(--accent-soft); }
.peta-cari-nama { font-size: 13px; font-weight: 650; color: var(--text); }
.peta-cari-meta { font-size: 11.5px; color: var(--muted); grid-column: 1; }
.peta-cari-jalur { grid-column: 1 / -1; font-size: 11px; color: var(--muted-2); }

.peta-panel {
  position: fixed; z-index: 60; right: 18px; bottom: 18px;
  width: min(360px, calc(100vw - 36px)); max-height: min(70vh, 560px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 20px 48px -24px rgba(10,42,107,.55);
  overflow: hidden;
}
.peta-panel[hidden] { display: none; }
.peta-panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg,#fbfdff,#fff); }
.peta-panel-title { font-size: 13.5px; font-weight: 650; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peta-panel-body { padding: 14px; overflow-y: auto; }
.peta-dl { grid-template-columns: 132px 1fr; gap: 9px 14px; font-size: 12.5px; }
.peta-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.peta-badge--pramitra { background: var(--gold-soft); color: var(--gold); }
.peta-badge--associate, .peta-badge--associate_plus { background: var(--gray-soft); color: #475467; }
.peta-badge--advisor, .peta-badge--advisor_plus { background: var(--blue-soft); color: var(--blue); }
.peta-badge--principal, .peta-badge--principal_plus { background: var(--indigo-soft); color: var(--indigo); }
.peta-badge--komunitas { background: var(--green-soft); color: var(--green); }
.peta-jalur-item { font-weight: 600; }

@media (max-width: 760px) {
  .peta-stage { height: 58vh; min-height: 300px; }
  .peta-toolbar { flex-direction: column; align-items: stretch; }
  .peta-zoom { justify-content: flex-start; }
  .peta-toggle { width: 30px; height: 30px; min-width: 30px; }
  .peta-panel { right: 8px; left: 8px; bottom: 8px; width: auto; max-height: 62vh; }
}
.peta-info { margin-top: 10px; padding: 8px 12px; border-radius: 9px; font-size: 11.5px;
  background: var(--gold-soft); color: var(--gold); border: 1px solid #f6e3ab; }
.peta-info[hidden] { display: none; }

/* ---------- Landing page referal (publik) ---------- */
.ref-body {
  background:
    radial-gradient(900px 420px at 10% -10%, #e6efff 0%, rgba(230, 239, 255, 0) 62%),
    radial-gradient(700px 380px at 100% 0%, #fff4d6 0%, rgba(255, 244, 214, 0) 58%),
    linear-gradient(180deg, #f7faff 0%, #eef4ff 100%);
  min-height: 100vh;
}
.ref-wrap { max-width: 1080px; margin: 0 auto; padding: 28px 18px 44px; }

.ref-hero {
  background: linear-gradient(135deg, #0a2a6b 0%, #123f9e 55%, #1749b8 100%);
  color: #fff; border-radius: 20px; padding: 26px 24px 30px;
  box-shadow: 0 20px 44px -26px rgba(10, 42, 107, 0.65);
}
.ref-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.ref-brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; font-size: 18px; }
.ref-brand-nama { font-weight: 700; font-size: 15px; }
.ref-brand-sub { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: rgba(226,236,255,.72); }
.ref-eyebrow { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: #ffd970; font-weight: 650; }
.ref-nama { font-size: 27px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 12px; }
.ref-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ref-chip {
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); color: #eaf1ff;
}
.ref-chip--gold { background: rgba(247,181,0,.22); border-color: rgba(255,215,112,.45); color: #ffd970; }
.ref-desc { font-size: 13.5px; line-height: 1.6; color: rgba(233,241,255,.9); max-width: 60ch; }
.ref-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ref-cta .btn { min-height: 40px; }
.ref-cta .btn-primary { background: linear-gradient(135deg, #ffd970, #f7b500); border-color: #f7b500; color: #3a2703; font-weight: 700; }
.ref-cta .btn-primary:hover { background: linear-gradient(135deg, #ffe79a, #ffc321); border-color: #ffc321; color: #3a2703; }
.ref-cta .btn:not(.btn-primary) { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); color: #fff; }
.ref-cta .btn:not(.btn-primary):hover { background: rgba(255,255,255,.2); color: #fff; }

.ref-section { margin-top: 26px; }
.ref-section-head h2 { font-size: 17px; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.ref-section-head p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 16px; }
.ref-produk {
  background: rgba(255,255,255,.82); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 12px 30px -24px rgba(10,42,107,.5);
}
.ref-produk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ref-kat { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--blue-aha); }
.ref-badge { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); }
.ref-produk-nama { font-size: 14.5px; font-weight: 700; color: var(--text); }
.ref-produk-desc { font-size: 12px; color: var(--muted); line-height: 1.55; flex: 1 1 auto; }
.ref-produk-harga { display: flex; flex-direction: column; gap: 2px; }
.ref-harga-coret { font-size: 12px; color: var(--muted-2); text-decoration: line-through; }
.ref-harga { font-size: 21px; font-weight: 700; color: var(--navy); letter-spacing: -.02em; }
.ref-hemat { font-size: 11.5px; font-weight: 600; color: var(--green); }
.ref-produk .btn { margin-top: 4px; }

.ref-cara { background: rgba(255,255,255,.8); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.ref-langkah { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--text); }
.ref-kode {
  margin-top: 18px; padding: 14px 16px; border-radius: 12px;
  background: var(--gold-soft); border: 1px dashed #e8c96a;
  display: flex; flex-direction: column; gap: 2px;
}
.ref-kode span { font-size: 11.5px; color: var(--gold); font-weight: 600; }
.ref-kode strong { font-size: 19px; letter-spacing: .04em; color: #7a5200; }
.ref-kode-hint { font-size: 11.5px; color: var(--muted) !important; font-weight: 400 !important; }

.ref-foot { margin-top: 28px; text-align: center; font-size: 11.5px; color: var(--muted-2); display: flex; flex-direction: column; gap: 4px; }
.ref-kosong { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 40px 24px; text-align: center; }
.ref-kosong h1 { font-size: 19px; margin-bottom: 8px; color: var(--navy); }
.ref-kosong p { font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  .ref-wrap { padding: 16px 12px 32px; }
  /* Target sentuh nyaman di HP: tombol pesan/CTA minimal 44px tinggi */
  .ref-produk .btn, .ref-cta .btn { min-height: 44px; font-size: 13.5px; }
  .ref-hero { border-radius: 16px; padding: 20px 16px 24px; }
  .ref-nama { font-size: 21px; }
  .ref-grid { grid-template-columns: 1fr; gap: 14px; }
  .ref-cta .btn { flex: 1 1 100%; }
  .ref-cara { padding: 16px; }
}

/* Tombol salin kode referal di landing page */
.ref-kode { position: relative; padding-right: 16px; }
.ref-kode .btn { align-self: flex-start; margin-top: 4px; background: #fff; border-color: #e8c96a; color: #7a5200; }
.ref-kode .btn:hover { background: #fffaf0; border-color: var(--gold-bright); color: #5c3d00; }
