/* =========================================================
   PERUMDA Tirta Musi — SPK Perluasan Jaringan (Weighted Product)
   Tema institusional: biru tua, biru langit, putih, kuning muda.
   Font: Plus Jakarta Sans (didesain untuk Kota Jakarta) + Fraunces (cetak).
   ========================================================= */

:root {
  --navy:        #0a2f54;
  --navy-700:    #0b3d6e;
  --navy-600:    #134b82;
  --sky:         #2e9be6;
  --sky-400:     #4fb3f0;
  --sky-100:     #e6f3fd;
  --yellow:      #ffd23f;
  --yellow-soft: #fff4cc;
  --ink:         #16263a;
  --muted:       #5f7186;
  --line:        #e3e9f0;
  --bg:          #f4f7fb;
  --card:        #ffffff;
  --ok:          #18794e;
  --ok-bg:       #e7f6ee;
  --warn:        #9a6700;
  --warn-bg:     #fff4d6;
  --bad:         #b42318;
  --bad-bg:      #fdeceb;
  --info:        #134b82;
  --info-bg:     #e6f0fa;
  --radius:      14px;
  --radius-sm:   9px;
  --shadow:      0 1px 2px rgba(10,47,84,.06), 0 8px 24px rgba(10,47,84,.07);
  --shadow-lg:   0 18px 50px rgba(10,47,84,.16);
  --sidebar-w:   260px;
  --font:        'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --serif:       'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 15px;
}
a { color: var(--navy-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.2; margin: 0 0 .4em; color: var(--navy); font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }

/* ---------- Utilities ---------- */
.container { width: min(1180px, 92%); margin-inline: auto; }
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.center { display: flex; align-items: center; gap: .6rem; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mt0{margin-top:0}.mb0{margin-bottom:0}.mt1{margin-top:.6rem}.mt2{margin-top:1.2rem}.mb1{margin-bottom:.6rem}.mb2{margin-bottom:1.2rem}
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--navy-700);
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--b); color: #fff; border: 1px solid var(--b);
  padding: .55rem .95rem; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer;
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; box-shadow: 0 4px 14px rgba(11,61,110,.25); }
.btn:active { transform: translateY(1px); }
.btn.sky { --b: var(--sky); }
.btn.ghost { background: #fff; color: var(--navy-700); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--sky); background: var(--sky-100); }
.btn.ok { --b: var(--ok); }
.btn.bad { --b: var(--bad); }
.btn.warn { --b: var(--warn); }
.btn.yellow { --b: var(--yellow); color: var(--navy); border-color: #e8bd24; }
.btn.sm { padding: .38rem .6rem; font-size: .78rem; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.2rem 1.3rem;
}
.card + .card { margin-top: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2,1fr); }
.g3 { grid-template-columns: repeat(3,1fr); }
.g4 { grid-template-columns: repeat(4,1fr); }
@media (max-width: 900px){ .g2,.g3,.g4{ grid-template-columns: 1fr; } }

/* ---------- Stat cards ---------- */
.stat {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-600) 100%);
  color: #fff; border: none; border-radius: var(--radius); padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.stat::after{
  content:""; position:absolute; right:-30px; top:-30px; width:120px; height:120px;
  background: radial-gradient(circle, rgba(255,210,63,.35), transparent 70%); border-radius:50%;
}
.stat .n { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.stat .l { font-size: .8rem; opacity: .85; text-transform: uppercase; letter-spacing: .05em; }
.stat.sky { background: linear-gradient(135deg, var(--sky) 0%, var(--sky-400) 100%); }
.stat.yellow { background: linear-gradient(135deg, #f6c324 0%, var(--yellow) 100%); color: var(--navy); }
.stat.yellow::after{ background: radial-gradient(circle, rgba(10,47,84,.18), transparent 70%); }
.stat.plain { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.stat.plain .n { color: var(--navy); }
.stat.plain::after{ display:none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.tbl th, table.tbl td { padding: .62rem .7rem; text-align: left; border-bottom: 1px solid var(--line); }
table.tbl thead th {
  background: var(--sky-100); color: var(--navy-700); font-weight: 700;
  font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
table.tbl tbody tr:hover { background: #fafcff; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tr.rank1 td { background: var(--yellow-soft); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: 999px; font-size: .73rem; font-weight: 700;
  background: var(--info-bg); color: var(--info); white-space: nowrap; line-height: 1.4;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.sky { background: var(--sky-100); color: var(--navy-700); }
.badge.yellow { background: var(--yellow-soft); color: #7a5b00; }
.badge.dot::before { content:""; width:7px;height:7px;border-radius:50%;background:currentColor; }

/* prioritas pill */
.pri-tinggi{ background: var(--ok-bg); color: var(--ok); }
.pri-sedang{ background: var(--warn-bg); color: var(--warn); }
.pri-rendah{ background: var(--bad-bg); color: var(--bad); }

/* ---------- Forms ---------- */
label.field { display: block; margin-bottom: .9rem; }
label.field > span { display: block; font-weight: 600; font-size: .84rem; margin-bottom: .3rem; color: var(--navy-700); }
.input, input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(46,155,230,.18);
}
textarea { min-height: 90px; resize: vertical; }
.help { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.err { color: var(--bad); font-size: .8rem; margin-top: .25rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 700; color: var(--navy-700); padding: 0 .4rem; font-size: .85rem; }

/* radio cards */
.radio-cards { display: flex; gap: .7rem; flex-wrap: wrap; }
.radio-card { flex: 1; min-width: 150px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .8rem; cursor: pointer; transition: .15s; }
.radio-card:hover { border-color: var(--sky); }
.radio-card input { margin-right: .4rem; }
.radio-card.sel, .radio-card:has(input:checked) { border-color: var(--sky); background: var(--sky-100); }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius-sm); padding: .7rem .9rem; margin-bottom: 1rem; font-size: .88rem; border: 1px solid transparent; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe6cf; }
.alert.bad { background: var(--bad-bg); color: var(--bad); border-color: #f3c6c2; }
.alert.info { background: var(--info-bg); color: var(--info); border-color: #c6dbf2; }
.alert ul { margin: .3rem 0 0; padding-left: 1.1rem; }

/* =========================================================
   APP SHELL (sidebar + header)
   ========================================================= */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--navy);
  color: #cdddf0; padding: 1.1rem .9rem; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; display: flex; flex-direction: column;
}
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: .2rem .4rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: .8rem; }
.sidebar .brand img { width: 38px; height: 38px; border-radius: 9px; background: #fff; padding: 3px; object-fit: contain; }
.sidebar .brand b { color: #fff; font-size: .98rem; display: block; line-height: 1.1; }
.sidebar .brand small { color: var(--yellow); font-size: .68rem; letter-spacing: .03em; }
.nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #6f93b8; margin: 1rem .6rem .35rem; }
.nav a {
  display: flex; align-items: center; gap: .6rem; color: #cdddf0; padding: .55rem .65rem;
  border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500; margin-bottom: 2px; text-decoration: none;
}
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, var(--sky), var(--sky-400)); color: #fff; box-shadow: 0 6px 16px rgba(46,155,230,.35); }
.nav a.active svg { opacity: 1; }
.sidebar .foot { margin-top: auto; padding-top: 1rem; font-size: .72rem; color: #6f93b8; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: .7rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: 1.02rem; font-weight: 700; color: var(--navy); }
.topbar .page-title small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }
.userchip { display: flex; align-items: center; gap: .55rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--sky-100); color: var(--navy-700); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.content { padding: 1.4rem; flex: 1; }

/* mobile sidebar toggle */
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .35rem .5rem; cursor: pointer; }
#nav-toggle { display: none; }
@media (max-width: 860px){
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  #nav-toggle:checked ~ .shell .sidebar { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .content { padding: 1rem; }
}

/* =========================================================
   LANDING PAGE
   ========================================================= */
.lp-nav { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.lp-nav .inner { display: flex; align-items: center; justify-content: space-between; padding: .7rem 0; }
.lp-logo { display: flex; align-items: center; gap: .6rem; }
.lp-logo img { width: 42px; height: 42px; object-fit: contain; }
.lp-logo b { color: var(--navy); font-size: 1.05rem; line-height: 1; }
.lp-logo small { color: var(--sky); font-size: .72rem; }

.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-600) 55%, var(--sky) 140%);
}
.hero::before{
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(255,210,63,.22), transparent 60%),
    radial-gradient(600px 400px at 10% 110%, rgba(79,179,240,.35), transparent 60%);
}
.hero .inner { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; padding: 3.4rem 0 3.8rem; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: .6rem; }
.hero h1 .hl { color: var(--yellow); }
.hero p.lead { color: #d4e4f5; font-size: 1.05rem; max-width: 46ch; }
.hero .cta { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; }
.hero-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 18px; padding: 1.2rem; backdrop-filter: blur(6px); }
.hero-photo { width: 100%; height: 230px; object-fit: cover; border-radius: 12px; border: 3px solid rgba(255,255,255,.25); }
.hero-photo.placeholder { display:grid; place-items:center; background: rgba(255,255,255,.08); color:#cfe2f5; font-size:.85rem; text-align:center; }
@media (max-width: 860px){ .hero .inner { grid-template-columns: 1fr; } }

.section { padding: 3rem 0; }
.section h2.t { font-size: 1.7rem; text-align: center; }
.section p.sub { text-align: center; color: var(--muted); max-width: 60ch; margin: 0 auto 2rem; }
.feature { text-align: left; }
.feature .ic { width: 44px; height: 44px; border-radius: 11px; background: var(--sky-100); color: var(--navy-700); display: grid; place-items: center; margin-bottom: .7rem; }
.feature .ic svg { width: 24px; height: 24px; }
.step-num { width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); color: var(--navy); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }

.logos-row { display: flex; gap: 2rem; align-items: center; justify-content: center; flex-wrap: wrap; }
.logos-row img { height: 64px; width: auto; object-fit: contain; }
.logos-row .ph { height: 64px; min-width: 120px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: .72rem; padding: 0 .8rem; text-align: center; }

footer.site {
  background: var(--navy); color: #b9cde2; padding: 2.4rem 0 1.4rem; margin-top: 0;
}
footer.site .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.6rem; }
footer.site h4 { color: #fff; font-size: .95rem; margin-bottom: .6rem; }
footer.site a { color: #b9cde2; }
footer.site a:hover { color: var(--yellow); }
footer.site .logos { display: flex; gap: .8rem; align-items: center; margin-bottom: .8rem; }
footer.site .logos img { height: 40px; background: #fff; border-radius: 8px; padding: 4px; }
footer.site .logos .ph { height: 40px; width: 40px; background: rgba(255,255,255,.1); border-radius: 8px; display:grid; place-items:center; font-size:.6rem; color:#8fb0d4; }
footer.site .copy { border-top: 1px solid rgba(255,255,255,.12); margin-top: 1.6rem; padding-top: 1rem; font-size: .78rem; color: #8fb0d4; text-align: center; }
@media (max-width: 760px){ footer.site .cols { grid-template-columns: 1fr; } }

/* chart container */
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 220px; }

/* auth pages */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside {
  position: relative; overflow: hidden; color: #fff; padding: 3rem;
  background: linear-gradient(150deg, var(--navy), var(--navy-600) 60%, var(--sky));
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside::before{ content:""; position:absolute; inset:0; background: radial-gradient(700px 300px at 80% 0%, rgba(255,210,63,.25), transparent 60%); }
.auth-aside .a-logo { position: relative; display:flex; gap:.7rem; align-items:center; }
.auth-aside .a-logo img { width: 52px; height:52px; background:#fff; border-radius:12px; padding:5px; object-fit:contain; }
.auth-aside h2 { color:#fff; position: relative; font-size: 1.8rem; }
.auth-aside p { color:#d4e4f5; position: relative; }
.auth-main { display: grid; place-items: center; padding: 2rem; }
.auth-box { width: min(420px, 100%); }
.auth-box h1 { font-size: 1.5rem; }
.divider { display:flex; align-items:center; gap:.7rem; color:var(--muted); font-size:.8rem; margin:1rem 0; }
.divider::before,.divider::after{ content:""; height:1px; background:var(--line); flex:1; }
.code-input { letter-spacing: .5em; text-align: center; font-size: 1.6rem; font-weight: 700; }
@media (max-width: 820px){ .auth-wrap { grid-template-columns: 1fr; } .auth-aside { display:none; } }

/* misc */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: .3rem 1rem; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--line); }
.timeline li::before { content:""; position:absolute; left:-6px; top:3px; width:10px; height:10px; border-radius:50%; background: var(--sky); }
.timeline li.done::before { background: var(--ok); }

/* =========================================================
   ANIMASI (reveal saat scroll, hover, hitung-naik)
   ========================================================= */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
/* stagger ringan untuk kartu fitur & langkah */
.section .grid .card:nth-child(2).reveal, .section .grid .feature:nth-child(2).reveal { transition-delay: .08s; }
.section .grid .card:nth-child(3).reveal, .section .grid .feature:nth-child(3).reveal { transition-delay: .16s; }
.section .grid .card:nth-child(4).reveal, .section .grid .feature:nth-child(4).reveal { transition-delay: .24s; }

.stat { transition: transform .18s ease, box-shadow .2s ease; }
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature { transition: transform .18s ease, box-shadow .2s ease; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.hero .btn { transition: transform .12s ease, filter .15s ease, box-shadow .15s ease; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .stat:hover, .feature:hover { transform: none; }
}

/* =========================================================
   PAGINATION RINGKAS (ukuran menyesuaikan teks)
   ========================================================= */
.pager-wrap { display:flex; align-items:center; justify-content:space-between; gap:.8rem; flex-wrap:wrap; margin-top:.4rem; }
.pager-summary { white-space:nowrap; }
.pager { display:flex; flex-wrap:wrap; gap:.3rem; align-items:center; font-size:.82rem; }
.pager-btn {
  display:inline-flex; align-items:center; justify-content:center; line-height:1;
  padding:.34rem .58rem; min-width:1.9rem; border:1px solid var(--line); border-radius:8px;
  color:var(--navy-700); background:#fff; text-decoration:none; font-weight:600;
}
.pager-btn:hover { border-color:var(--sky); background:var(--sky-100); text-decoration:none; }
.pager-btn.active { background:var(--sky); color:#fff; border-color:var(--sky); }
.pager-btn.disabled { color:var(--muted); background:#f3f6fa; cursor:default; }
.pager-ellipsis { padding:0 .25rem; color:var(--muted); }
/* paksa SVG paginator bawaan (jika muncul) tetap kecil */
.pager svg, nav[role="navigation"] svg { width:1em; height:1em; }
