* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-cyan: #06b6d4;
  --accent: #f59e0b;
  --accent-orange: #fb923c;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow: 0 4px 12px rgba(15,23,42,0.06), 0 2px 4px rgba(15,23,42,0.04);
  --gradient-blue: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #06b6d4 100%);
  --gradient-orange: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
  --gradient-green: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}
html, body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }

/* TOP NAV */
.topnav { position: sticky; top: 0; z-index: 50; background: var(--card); box-shadow: var(--shadow-sm); padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.topnav .logo-img { width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; }
.topnav .brand h1 { font-size: 14px; font-weight: 700; line-height: 1.2; }
.topnav .brand p { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.container { max-width: 1280px; margin: 0 auto; padding: 16px; }

/* FILTER BAR */
.filter-card { background: var(--card); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; box-shadow: var(--shadow-sm); display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.filter-card::-webkit-scrollbar { display: none; }
.filter-chip { padding: 8px 14px; background: #f1f5f9; border: 1px solid transparent; border-radius: 50px; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; white-space: nowrap; transition: all .2s; flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.filter-chip:hover { background: #e2e8f0; }
.filter-chip.active { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(30,64,175,0.25); }
.filter-meta { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; padding-left: 8px; }

/* HERO */
.hero { background: var(--gradient-blue); border-radius: var(--radius); padding: 22px 20px; color: #fff; margin-bottom: 16px; position: relative; overflow: hidden; box-shadow: 0 12px 30px rgba(30,64,175,0.25); }
.hero::before { content: ''; position: absolute; top: -50%; right: -20%; width: 60%; height: 200%; background: radial-gradient(ellipse, rgba(255,255,255,0.15) 0%, transparent 70%); pointer-events: none; }
.hero::after { content: ''; position: absolute; bottom: -30%; left: -10%; width: 40%; height: 100%; background: radial-gradient(ellipse, rgba(6,182,212,0.3) 0%, transparent 70%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 14px; position: relative; z-index: 1; }
.hero-label { font-size: 12px; opacity: .9; margin-bottom: 4px; font-weight: 500; }
.hero-amount { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; word-break: break-word; }
.hero-subgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-mini { background: rgba(255,255,255,0.15); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.2); border-radius: 12px; padding: 12px 14px; }
.hero-mini.orange { background: var(--gradient-orange); border: none; box-shadow: 0 6px 16px rgba(245,158,11,0.3); }
.hero-mini-label { font-size: 11px; opacity: .9; font-weight: 500; }
.hero-mini-amount { font-size: 18px; font-weight: 700; margin-top: 2px; letter-spacing: -0.01em; }
.hero-progress { margin-top: 16px; position: relative; z-index: 1; }
.hero-progress-labels { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; font-weight: 500; }
.hero-progress-bar { height: 12px; background: rgba(255,255,255,0.2); border-radius: 50px; overflow: hidden; display: flex; }
.hero-progress-fill { background: linear-gradient(90deg, #fff 0%, #e0f2fe 100%); border-radius: 50px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; color: var(--primary); font-size: 10px; font-weight: 700; position: relative; min-width: 32px; transition: width 1s ease-out; }
.hero-progress-fill::after { content: ''; position: absolute; right: -1px; top: 0; bottom: 0; width: 16px; background: rgba(255,255,255,0.4); border-radius: 50px; animation: shimmer 2s infinite; }
@keyframes shimmer { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
.hero-meta { font-size: 11px; opacity: .85; margin-top: 12px; position: relative; z-index: 1; }

/* STAT CARDS */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card { background: var(--card); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; right: 0; width: 60px; height: 60px; border-radius: 50%; background: var(--accent-color, var(--primary)); opacity: .08; transform: translate(20px, -20px); }
.stat-icon { width: 36px; height: 36px; background: var(--accent-color, var(--primary)); border-radius: 10px; display: grid; place-items: center; color: #fff; margin-bottom: 10px; box-shadow: 0 4px 10px var(--shadow-color, rgba(30,64,175,0.2)); }
.stat-icon svg { width: 18px; height: 18px; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 18px; font-weight: 700; margin-top: 2px; letter-spacing: -0.01em; }
.stat-trend { font-size: 11px; font-weight: 600; margin-top: 4px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* SECTION */
.section { background: var(--card); border-radius: var(--radius); padding: 18px 16px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 8px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.section-title .badge { background: #eff6ff; color: var(--primary); padding: 2px 8px; border-radius: 50px; font-size: 10px; font-weight: 700; }

.btn { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); font-size: 12px; font-weight: 500; cursor: pointer; color: var(--text); transition: all .15s; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-family: inherit; }
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

/* IKPA GAUGE */
.ikpa-wrap { display: grid; grid-template-columns: 1fr; gap: 16px; }
.gauge-container { text-align: center; padding: 8px 0; }
.gauge { position: relative; width: 220px; height: 130px; margin: 0 auto; }
.gauge svg { width: 100%; height: 100%; }
.gauge-track { fill: none; stroke: #e2e8f0; stroke-width: 18; stroke-linecap: round; }
.gauge-fill { fill: none; stroke: url(#gaugeGrad); stroke-width: 18; stroke-linecap: round; stroke-dasharray: 282; stroke-dashoffset: 282; transition: stroke-dashoffset 1.8s cubic-bezier(.16,1,.3,1); }
.gauge-text { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; }
.gauge-value { font-size: 32px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.gauge-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.gauge-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); width: 220px; margin: 0 auto; padding: 0 6px; }
.ikpa-indicators { display: flex; flex-direction: column; gap: 8px; }
.ikpa-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f8fafc; border-radius: 50px; font-size: 12px; }
.ikpa-pct { background: var(--gradient-blue); color: #fff; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; min-width: 64px; text-align: center; flex-shrink: 0; }
.ikpa-pct.warn { background: var(--gradient-orange); }
.ikpa-name { color: var(--text); font-weight: 500; }

/* TABS */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 6px; white-space: nowrap; transition: all .15s; text-decoration: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-count { background: #f1f5f9; color: var(--text-muted); padding: 1px 7px; border-radius: 50px; font-size: 10px; font-weight: 700; }
.tab.active .tab-count { background: var(--primary); color: #fff; }
.tab-count.warn { background: var(--accent); color: #fff; }
.tab-count.success { background: var(--success); color: #fff; }
.tab-count.danger { background: var(--danger); color: #fff; }

/* SEARCH */
.search { display: flex; gap: 8px; margin-bottom: 14px; }
.search-input { flex: 1; position: relative; }
.search-input input { width: 100%; padding: 11px 14px 11px 40px; border: 1px solid var(--border); border-radius: 12px; font-size: 13px; font-family: inherit; background: #f8fafc; transition: all .15s; }
.search-input input:focus { outline: none; background: var(--card); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,64,175,0.1); }
.search-input svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); }

/* SPM */
.spm-list { display: flex; flex-direction: column; gap: 10px; }
.spm-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; transition: all .15s; }
.spm-card:hover { background: var(--card); border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.spm-row1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.spm-tag { display: inline-block; background: #eff6ff; color: var(--primary); padding: 2px 8px; border-radius: 50px; font-size: 10px; font-weight: 700; margin-bottom: 4px; }
.spm-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; }
.spm-row2 { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 12px; gap: 8px; flex-wrap: wrap; }
.spm-meta { color: var(--text-muted); }
.spm-amount { font-weight: 700; color: var(--text); }

/* STATUS */
.status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status.proses { background: #fef3c7; color: #92400e; }
.status.proses::before { background: #f59e0b; animation: pulse 1.5s infinite; }
.status.berhasil { background: #d1fae5; color: #065f46; }
.status.berhasil::before { background: var(--success); }
.status.ditolak { background: #fee2e2; color: #991b1b; }
.status.ditolak::before { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.4); } }

/* DIPA */
.dipa-summary { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border: 1px solid #bfdbfe; border-radius: 12px; padding: 14px; margin-bottom: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dipa-summary-item .label { font-size: 11px; color: var(--primary); font-weight: 500; }
.dipa-summary-item .value { font-size: 16px; font-weight: 700; color: var(--text); margin-top: 2px; word-break: break-all; }
.dipa-summary-item.full { grid-column: 1 / -1; }
.dipa-list { display: flex; flex-direction: column; gap: 10px; }
.dipa-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.dipa-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.dipa-rev { background: var(--primary); color: #fff; padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; display: inline-block; }
.dipa-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.dipa-no { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.dipa-purpose { font-size: 12px; color: var(--text); margin-bottom: 10px; line-height: 1.4; }
.dipa-pagu { background: var(--card); border-top: 1px dashed var(--border); padding-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.dipa-pagu-label { font-size: 11px; color: var(--text-muted); }
.dipa-pagu-value { font-size: 14px; font-weight: 700; color: var(--text); }

/* CHART */
.chart-wrap { position: relative; height: 280px; }

/* DAK */
.dak-pills { display: flex; gap: 8px; margin-bottom: 14px; }
.dak-pill { padding: 8px 16px; background: #f1f5f9; border: 1px solid transparent; border-radius: 50px; font-size: 13px; font-weight: 500; cursor: pointer; flex: 1; color: var(--text-muted); text-align: center; transition: all .2s; text-decoration: none; }
.dak-pill:hover { background: #e2e8f0; }
.dak-pill.active { background: var(--gradient-blue); color: #fff; border-color: transparent; box-shadow: 0 4px 10px rgba(30,64,175,0.25); }
.dak-list { display: flex; flex-direction: column; gap: 10px; }
.dak-item { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.dak-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.dak-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.dak-name .kab-logo {
  width: 22px; height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}
.dak-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === Calendar Publik (FA Detail) === */
.cal-public { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fafbfc; }
.cal-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-row + .cal-row { border-top: 1px solid var(--border); }
.cal-head-row > div { background: #f1f5f9; padding: 10px 4px; text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cal-head-row > div + div { border-left: 1px solid var(--border); }
.cal-c { padding: 10px 8px; min-height: 64px; background: #fff; position: relative; display: flex; flex-direction: column; gap: 4px; }
.cal-c + .cal-c { border-left: 1px solid var(--border); }
.cal-c.empty { background: #fafbfc; }
.cal-c.today { background: #eff6ff; box-shadow: inset 0 0 0 2px var(--primary); }
.cal-c.has-files { cursor: pointer; transition: all .15s; }
.cal-c.has-files:hover { background: #ecfdf5; }
.cal-c.has-files.today:hover { background: #dbeafe; }
.cal-c .cal-d { font-size: 13px; font-weight: 700; color: var(--text); }
.cal-c.today .cal-d { color: var(--primary); }
.cal-c.empty .cal-d { display: none; }
.cal-c .cal-cnt {
  font-size: 10px;
  background: var(--gradient-green);
  color: #fff;
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 700;
  align-self: flex-start;
  text-align: center;
}
@media (max-width: 700px) {
  .cal-c { padding: 6px 4px; min-height: 50px; }
  .cal-c .cal-d { font-size: 11px; }
  .cal-c .cal-cnt { font-size: 9px; padding: 1px 6px; }
}
.dak-pct { font-size: 14px; font-weight: 800; color: var(--success); }
.dak-pct.warn { color: var(--warning); }
.dak-pct.bad { color: var(--text-muted); }
.dak-amounts { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; gap: 8px; flex-wrap: wrap; }
.dak-amounts span:last-child { font-weight: 600; color: var(--text); }
.progress-bar { background: #e2e8f0; height: 8px; border-radius: 50px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gradient-green); border-radius: 50px; transition: width 1s ease-out; }
.progress-fill.warn { background: var(--gradient-orange); }
.progress-fill.bad { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 100; align-items: flex-end; justify-content: center; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay.show { display: flex; }
.modal { background: var(--card); border-radius: 20px 20px 0 0; width: 100%; max-width: 540px; padding: 0; max-height: 85vh; overflow-y: auto; animation: slideUp .3s cubic-bezier(.16,1,.3,1); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle { width: 40px; height: 4px; background: var(--border); border-radius: 50px; margin: 12px auto 0; }
.modal-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: 10px; border: none; background: #f1f5f9; cursor: pointer; display: grid; place-items: center; color: var(--text); }
.modal-body { padding: 16px 20px 24px; }
.detail-group { margin-bottom: 18px; }
.detail-group:last-child { margin-bottom: 0; }
.detail-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; font-weight: 600; }
.detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; gap: 12px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .key { color: var(--text-muted); flex-shrink: 0; }
.detail-row .val { font-weight: 600; text-align: right; word-break: break-word; }

/* RESPONSIVE */
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .hero-amount { font-size: 32px; }
  .hero-mini-amount { font-size: 22px; }
}
@media (min-width: 768px) {
  .container { padding: 24px; }
  .topnav { padding: 14px 24px; }
  .topnav .logo-img { width: 48px; height: 48px; }
  .topnav .brand h1 { font-size: 16px; }
  .topnav .brand p { font-size: 12px; }
  .hero { padding: 28px; }
  .hero-grid { grid-template-columns: 1.4fr 1fr; align-items: center; }
  .ikpa-wrap { grid-template-columns: auto 1fr; align-items: center; gap: 28px; }
  .modal-overlay { align-items: center; }
  .modal { border-radius: 20px; max-width: 600px; }
  .modal-handle { display: none; }
}
@media (min-width: 1024px) {
  .hero-amount { font-size: 38px; }
}

.row-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.grow { flex: 1; }
