:root {
  --bg: #0a0c16;
  --bg-2: #0d1020;
  --navy: #0d0f1c;
  --navy-2: #12152a;
  --card: #131629;
  --card-2: #171b33;
  --border: rgba(255,255,255,0.07);
  --gold: #e8b04b;
  --gold-soft: rgba(232,176,75,0.16);
  --cream: #eef0fb;
  --ink: #eef0fb;
  --muted: #8b90ad;
  --green: #22c55e;
  --green-soft: rgba(34,197,94,0.15);
  --orange: #f59e0b;
  --orange-soft: rgba(245,158,11,0.15);
  --red: #ef4444;
  --red-soft: rgba(239,68,68,0.15);
  --blue: #3b82f6;
  --blue-soft: rgba(59,130,246,0.15);
  --cyan: #22d3ee;
  --cyan-soft: rgba(34,211,238,0.15);
  --purple: #a855f7;
  --purple-soft: rgba(168,85,247,0.15);
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; color: var(--ink);
  background: radial-gradient(1200px 600px at 15% -10%, #1a2140 0%, transparent 60%),
              radial-gradient(1000px 500px at 100% 0%, #241a3a 0%, transparent 55%),
              var(--bg);
}

.er-shell { display: flex; min-height: 100vh; }

.er-sidebar {
  width: 254px; flex-shrink: 0; background: linear-gradient(180deg, var(--navy-2), var(--navy));
  color: var(--cream); display: flex; flex-direction: column; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--border);
}
.er-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 20px; }
.er-brand-mark {
  font-size: 20px; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold), #b8791f); box-shadow: 0 0 18px rgba(232,176,75,0.45);
}
.er-brand-name { font-weight: 800; letter-spacing: 1px; font-size: 14px; }
.er-brand-sub { font-size: 10px; letter-spacing: 3px; color: var(--gold); }

.er-nav { display: flex; flex-direction: column; gap: 2px; }
.er-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  color: #a9adc7; text-decoration: none; font-size: 13.5px; transition: background .15s, color .15s;
}
.er-nav-item:hover { background: rgba(255,255,255,0.06); color: var(--cream); }
.er-nav-item.active {
  background: linear-gradient(90deg, rgba(232,176,75,0.22), rgba(232,176,75,0.04));
  color: var(--gold); font-weight: 700; box-shadow: inset 2px 0 0 var(--gold);
}
.er-nav-icon { width: 18px; text-align: center; filter: saturate(1.3); }
.er-nav-divider { height: 1px; background: var(--border); margin: 14px 4px; }

.er-sidebar-footer {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px;
  border-top: 1px solid var(--border); padding-top: 16px;
}
.er-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), #b8791f); color: var(--navy);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex-shrink: 0;
  box-shadow: 0 0 12px rgba(232,176,75,0.4);
}
.er-footer-nama { font-size: 13px; font-weight: 700; }
.er-footer-role { font-size: 11px; color: var(--muted); text-transform: capitalize; }

.er-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.er-topbar {
  background: rgba(19,22,41,0.7); backdrop-filter: blur(10px); padding: 16px 28px; display: flex;
  justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.er-topbar-title { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.er-topbar-user { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.er-btn-ghost {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--ink); padding: 7px 16px;
  border-radius: 8px; cursor: pointer; font-size: 12px;
}
.er-btn-ghost:hover { background: rgba(255,255,255,0.08); }
.er-content { padding: 24px 28px; }

/* Hero banner */
.er-hero {
  position: relative; border-radius: 18px; padding: 26px 28px; margin-bottom: 20px; overflow: hidden;
  background: linear-gradient(120deg, #1a2244 0%, #241a3a 55%, #2a1730 100%);
  border: 1px solid var(--border);
}
.er-hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(500px 200px at 85% 0%, rgba(232,176,75,0.25), transparent 60%);
}
.er-hero-inner { position: relative; z-index: 1; }
.er-hero h1 { margin: 0 0 6px; font-size: 24px; font-weight: 800; }
.er-hero p { margin: 0; color: #c7cbe6; font-size: 13.5px; }

/* Cards & grid */
.er-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.er-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }
.er-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1000px) {
  .er-grid-4, .er-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .er-grid-2 { grid-template-columns: 1fr; }
}

.er-card {
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.er-card h3 { margin: 0 0 14px; font-size: 14px; font-weight: 700; color: var(--ink); }
.er-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.er-card-head h3 { margin: 0; }

.er-stat-tile { display: flex; align-items: center; gap: 14px; }
.er-stat-icon {
  width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0; background: var(--gold-soft); box-shadow: 0 0 0 1px var(--border);
}
.er-stat-icon.blue { background: var(--blue-soft); box-shadow: 0 0 18px rgba(59,130,246,0.25); }
.er-stat-icon.green { background: var(--green-soft); box-shadow: 0 0 18px rgba(34,197,94,0.25); }
.er-stat-icon.gold { background: var(--gold-soft); box-shadow: 0 0 18px rgba(232,176,75,0.3); }
.er-stat-icon.purple { background: var(--purple-soft); box-shadow: 0 0 18px rgba(168,85,247,0.25); }
.er-stat-label { font-size: 12.5px; color: var(--muted); }
.er-stat-value { font-size: 23px; font-weight: 800; color: var(--ink); }

.er-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 10px; }

/* Funnel */
.er-funnel { display: flex; gap: 8px; }
.er-funnel-step {
  flex: 1; text-align: center; background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-top: 3px solid var(--accent, var(--gold)); border-radius: 10px; padding: 12px 6px;
}
.er-funnel-step .n { font-size: 21px; font-weight: 800; color: var(--ink); }
.er-funnel-step .lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Table */
table.er-table { width: 100%; border-collapse: collapse; }
.er-table th, .er-table td { text-align: left; padding: 11px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.er-table th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.er-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.er-badge { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.er-badge.on_track { background: var(--green-soft); color: var(--green); box-shadow: 0 0 10px rgba(34,197,94,0.15); }
.er-badge.perlu_perhatian { background: var(--orange-soft); color: var(--orange); box-shadow: 0 0 10px rgba(245,158,11,0.15); }
.er-badge.terlambat { background: var(--red-soft); color: var(--red); box-shadow: 0 0 10px rgba(239,68,68,0.15); }

.er-progress { background: rgba(255,255,255,0.06); border-radius: 10px; height: 8px; width: 100%; overflow: hidden; }
.er-progress > div { background: linear-gradient(90deg, var(--gold), #f3cd7e); height: 100%; }

/* Bar chart (vertikal) */
.er-barchart { display: flex; align-items: flex-end; gap: 10px; height: 140px; }
.er-barchart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.er-barchart .bar { width: 60%; background: linear-gradient(180deg, var(--cyan), var(--blue)); border-radius: 4px 4px 0 0; min-height: 2px; box-shadow: 0 0 10px rgba(59,130,246,0.35); }
.er-barchart .bar-lbl { font-size: 10.5px; color: var(--muted); margin-top: 6px; }

/* Bar list horizontal (gaya desain) */
.er-barlist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12.5px; }
.er-barlist-row .name { width: 100px; flex-shrink: 0; color: var(--ink); }
.er-barlist-row .track { flex: 1; background: rgba(255,255,255,0.06); border-radius: 6px; height: 10px; overflow: hidden; }
.er-barlist-row .track > div { background: linear-gradient(90deg, var(--purple), #ec8ef9); height: 100%; }
.er-barlist-row .pct { width: 40px; text-align: right; color: var(--muted); }

/* Perlu perhatian list */
.er-alert-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.er-alert-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-top: 6px; flex-shrink: 0; box-shadow: 0 0 8px rgba(239,68,68,0.6); }
.er-alert-item.perlu_perhatian .er-alert-dot { background: var(--orange); box-shadow: 0 0 8px rgba(245,158,11,0.6); }
.er-alert-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.er-alert-sub { font-size: 12px; color: var(--muted); }

/* Form */
.er-form-row { margin-bottom: 14px; }
.er-form-row label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.er-form-row input, .er-form-row select {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--ink); font-size: 13.5px;
}
.er-form-row input::placeholder { color: #6a6f8c; }
.er-form-row select option { background: var(--card); color: var(--ink); }
.er-btn-primary {
  background: linear-gradient(135deg, var(--gold), #c98d2c); color: #1a1204; border: none; padding: 10px 18px; border-radius: 9px;
  font-weight: 800; cursor: pointer; font-size: 13px; box-shadow: 0 0 16px rgba(232,176,75,0.35);
}
.er-btn-danger {
  background: rgba(239,68,68,0.08); color: var(--red); border: 1px solid rgba(239,68,68,0.35); padding: 6px 12px;
  border-radius: 6px; cursor: pointer; font-size: 12px;
}
.er-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.er-tab {
  padding: 8px 16px; border-radius: 8px; background: rgba(255,255,255,0.04); color: var(--muted);
  font-size: 13px; cursor: pointer; border: 1px solid var(--border);
}
.er-tab.active { background: linear-gradient(135deg, var(--gold), #c98d2c); color: #1a1204; font-weight: 700; border-color: transparent; }

.er-placeholder {
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--border);
  border-radius: 16px; padding: 60px 30px; text-align: center; color: var(--muted);
}
.er-placeholder .icon { font-size: 36px; margin-bottom: 12px; }
.er-placeholder h3 { color: var(--ink); margin: 0 0 8px; }
