:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e5e7eb;
  --pri:#0b5fff;
  --pri2:#0847c6;
  --danger:#dc2626;
  --ok:#16a34a;

  --r:16px;
  --shadow: 0 10px 30px rgba(2,6,23,.08);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app{
  min-height:100%;
  display:flex;
  flex-direction:column;
}

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  padding: calc(12px + var(--safe-t)) 14px 12px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.topbar-left{display:flex; align-items:center; gap:10px;}
.brand-dot{
  width:38px;height:38px;border-radius:12px;
  background: linear-gradient(135deg, var(--pri), #18a0fb);
  box-shadow: 0 8px 18px rgba(11,95,255,.25);
}
.brand-title{font-weight:800; letter-spacing:.3px; line-height:1.1}
.brand-sub{font-size:12px; color:var(--muted); margin-top:2px}

.icon-btn{
  border:1px solid var(--line);
  background:#fff;
  border-radius:12px;
  width:40px;height:40px;
  display:grid;place-items:center;
  color:#111827;
}
.icon-btn svg{width:22px;height:22px}

.main{
  flex:1;
  padding:14px 14px calc(90px + var(--safe-b));
}

.card{
  background: var(--card);
  border:1px solid rgba(229,231,235,.9);
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(2,6,23,.06);
  padding:14px;
}

.card + .card{margin-top:12px}

.h1{font-size:20px; font-weight:800; margin:0 0 10px}
.h2{font-size:16px; font-weight:800; margin:0 0 8px}
.p{margin:0; color:var(--muted); line-height:1.45}
.small{font-size:12px; color:var(--muted)}
.hr{height:1px;background:var(--line);margin:12px 0}

.field{margin:10px 0}
.label{display:block; font-size:12px; color:var(--muted); margin:0 0 6px}
.input, .select{
  width:100%;
  padding:12px 12px;
  border:1px solid rgba(229,231,235,.95);
  background:#fff;
  border-radius: 14px;
  font-size:14px;
  outline:none;
}
.input:focus, .select:focus{
  border-color: rgba(11,95,255,.55);
  box-shadow: 0 0 0 4px rgba(11,95,255,.10)
}
.btn{
  width:100%;
  border:0;
  border-radius: 14px;
  padding:12px 14px;
  font-weight:800;
  font-size:14px;
  cursor:pointer;
  transition: transform .06s ease, box-shadow .18s ease, background .18s ease;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: linear-gradient(135deg, var(--pri), #18a0fb);
  color:#fff;
  box-shadow: 0 12px 24px rgba(11,95,255,.22);
}
.btn-ghost{
  background:#fff;
  border:1px solid rgba(229,231,235,.95);
}
.row{display:flex; gap:10px}
.row .btn{width:auto; flex:1}

.center-muted{
  text-align:center;
  color:var(--muted);
  padding:30px 10px;
}

.tabbar{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(10px + var(--safe-b));
  width: min(480px, calc(100% - 20px));
  padding: 10px 10px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(229,231,235,.85);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  display:flex;
  gap:8px;
  z-index: 40;
  box-shadow: 0 16px 34px rgba(2,6,23,.10);
}

.tab{
  flex:1;
  text-decoration:none;
  color:#334155;
  border-radius:16px;
  padding:10px 6px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  border:1px solid transparent;
  transition: background .18s ease, transform .06s ease;
}
.tab:active{ transform: translateY(1px); }
.tab .tab-ico{font-size:18px; line-height:1}
.tab .tab-txt{font-size:11px; font-weight:900; letter-spacing:.2px}

.tab.active{
  background: rgba(11,95,255,.10);
  border-color: rgba(11,95,255,.18);
  color: var(--pri);
}

.fab{
  position: fixed;
  right: calc(14px + (50vw - min(240px, 50vw))); /* ikut frame app */
  bottom: calc(100px + var(--safe-b));
  width:48px;height:48px;
  border-radius: 20px;
  border:0;
  background: linear-gradient(135deg, var(--pri), #18a0fb);
  color:#fff;
  font-size:30px;
  box-shadow: 0 18px 40px rgba(11,95,255,.30);
  display:none;
  z-index:45;
}
.fab:active{transform: translateY(1px)}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background: #eef2ff;
  color:#3730a3;
  font-weight:800;
  font-size:12px;
  border:1px solid #e0e7ff;
}

.table{
  width:100%;
  border-collapse: collapse;
  font-size:13px;
}
.table th, .table td{
  padding:10px 8px;
  border-bottom:1px solid var(--line);
}
.table th{color:var(--muted); text-align:left; font-weight:800; font-size:12px}

.modal{
  position:fixed; inset:0;
  background: rgba(2,6,23,.45);
  display:none;
  align-items:flex-end;
  justify-content:center;
  padding: 14px 14px calc(14px + var(--safe-b));
  z-index:50;
}
.modal.show{display:flex}
.modal-card{
  width:100%;
  max-width:520px;
  background:#fff;
  border-radius: 20px;
  border:1px solid var(--line);
  box-shadow: 0 18px 45px rgba(2,6,23,.22);
  overflow:hidden;
}
.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 12px;
  border-bottom:1px solid var(--line);
}
.modal-title{font-weight:900}
.modal-body{padding:12px}
.modal-foot{
  padding:12px;
  border-top:1px solid var(--line);
  display:flex;
  gap:10px;
}
.modal-foot .btn{width:auto; flex:1}

.card-virtual{
  border-radius: 18px;
  padding:16px;
  color:#e2e8f0;
  background: linear-gradient(135deg, #0b1220, #111827);
  border:1px solid rgba(255,255,255,.08);
}
.card-virtual.disabled{
  filter: grayscale(1);
  opacity:.55;
}
.card-virtual .num{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: 2px;
  font-size:15px;
  margin-top:10px;
}
.card-virtual .meta{
  display:flex;
  justify-content:space-between;
  margin-top:14px;
  font-size:12px;
  color:#cbd5e1;
}
/* ===== IURAN: list ala mobile app ===== */
.iuran-tools{display:flex; gap:10px}
.iuran-tools .btn{flex:1}

.iuran-list{display:flex; flex-direction:column; gap:12px}

.iuran-item{
  background:#fff;
  border:1px solid rgba(229,231,235,.95);
  border-radius:18px;
  padding:14px;
  box-shadow: 0 10px 24px rgba(2,6,23,.06);
}

.iuran-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.iuran-date{font-weight:900}
.iuran-inv{font-size:12px; color:var(--muted); margin-top:3px}
.iuran-amt{font-weight:900; font-size:16px}

.iuran-bot{
  margin-top:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.btn-pay{width:auto; padding:10px 14px; border-radius:14px}

.status-pill{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  border:1px solid rgba(229,231,235,.9);
}
.st-pending{background:#fff7ed; color:#9a3412; border-color:#fed7aa}
.st-proses{background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe}
.st-paid{background:#ecfdf5; color:#047857; border-color:#bbf7d0}
.st-failed{background:#fef2f2; color:#b91c1c; border-color:#fecaca}

.empty-state{
  text-align:center;
  padding:26px 10px;
  color:var(--muted);
  border:1px dashed rgba(229,231,235,.95);
  border-radius:18px;
  background: rgba(255,255,255,.6);
}

.inv-box{
  margin-top:8px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(229,231,235,.95);
  background: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: .3px;
}

/* ===== Payment iframe in modal ===== */
.payframe{
  width:100%;
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(229,231,235,.95);
  background:#fff;
}
.payframe iframe{
  width:100%;
  height:65vh;
  border:0;
  display:block;
}

/* ===== DASHBOARD (lebih "app") ===== */
.dash-card{padding:14px}
.dash-head{display:flex; align-items:center; gap:12px}
.dash-avatar{
  width:44px;height:44px;border-radius:14px;
  background: linear-gradient(135deg, var(--pri), #18a0fb);
  color:#fff; font-weight:900;
  display:grid; place-items:center;
  box-shadow: 0 10px 24px rgba(11,95,255,.22);
  flex:0 0 auto;
}
.dash-meta{flex:1; min-width:0}
.dash-name{font-weight:900; font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.dash-sub{font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

.chip{
  font-weight:900; font-size:12px;
  padding:7px 10px; border-radius:999px;
  border:1px solid rgba(229,231,235,.95);
  background:#fff;
  flex:0 0 auto;
}
.chip-ok{background:#ecfdf5; color:#047857; border-color:#bbf7d0}
.chip-warn{background:#fff7ed; color:#9a3412; border-color:#fed7aa}

.dash-kv{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px}
.kv{
  background:#f8fafc;
  border:1px solid rgba(229,231,235,.95);
  border-radius:14px;
  padding:10px;
}
.kv-k{font-size:11px; color:var(--muted); font-weight:800}
.kv-v{margin-top:4px; font-weight:900; font-size:13px; color:#0f172a}

.stat-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:10px}
.stat{
  background:#ffffff;
  border:1px solid rgba(229,231,235,.95);
  border-radius:14px;
  padding:10px;
}
.stat-k{font-size:11px; color:var(--muted); font-weight:800}
.stat-v{margin-top:6px; font-weight:900; font-size:13px}

/* ===== NEWS LIST ===== */
.news-list{display:flex; flex-direction:column; gap:12px; margin-top:10px}
.news-item{
  width:100%;
  border:1px solid rgba(229,231,235,.95);
  background:#fff;
  border-radius:18px;
  padding:0;
  overflow:hidden;
  text-align:left;
  box-shadow: 0 10px 24px rgba(2,6,23,.06);
}
.news-item:active{transform: translateY(1px)}
.news-cover{height:120px; background:#eef2ff; position:relative}
.news-cover img{width:100%; height:100%; object-fit:cover; display:block}
.news-cover-ph{
  width:100%; height:100%;
  background: linear-gradient(135deg, rgba(11,95,255,.20), rgba(24,160,251,.10));
}
.news-body{padding:12px}
.news-title{font-weight:900; font-size:14px; line-height:1.25}
.news-ex{margin-top:6px; color:var(--muted); font-size:12px; line-height:1.4}
.news-date{margin-top:8px; font-size:11px; color:var(--muted); font-weight:800}

/* detail modal */
.news-detail-cover{width:100%; height:180px; object-fit:cover; border-radius:14px; border:1px solid rgba(229,231,235,.95)}
.news-detail-html{font-size:14px; line-height:1.6; color:#0f172a}
.news-detail-html img{max-width:100%; height:auto}
