/* ============================================
   SIGMA GENERAL — BPR Sinergi Utama Dashboard
   ============================================ */

:root {
    /* Brand gradient family — Sinergi Utama (indigo -> blue -> cyan) */
    --grad-1: #5b52e8;
    --grad-2: #4a8ef0;
    --grad-3: #35c3e8;
    --brand-gradient: linear-gradient(135deg, var(--grad-1) 0%, var(--grad-2) 52%, var(--grad-3) 100%);
    --brand-gradient-soft: linear-gradient(135deg, rgba(91,82,232,0.12) 0%, rgba(74,142,240,0.12) 52%, rgba(53,195,232,0.12) 100%);
    --brand-gradient-vert: linear-gradient(180deg, #241f5e 0%, #1c2b63 45%, #124a6b 100%);

    --primary: #1c1852;
    --primary-light: #241f5e;
    --accent: #4a52e0;
    --accent-light: #6a6ff0;
    --gold: #35c3e8;
    --gold-light: #7ee0f4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #4a8ef0;
    --text-primary: #1a1e2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg-primary: #f5f7fc;
    --bg-secondary: #eef1fa;
    --bg-card: #ffffff;
    --border: #e4e8f5;
    --border-light: #f1f3fb;
    --shadow-sm: 0 1px 2px 0 rgb(76 71 168 / 0.06);
    --shadow: 0 4px 6px -1px rgb(76 71 168 / 0.1), 0 2px 4px -2px rgb(76 71 168 / 0.08);
    --shadow-lg: 0 10px 15px -3px rgb(76 71 168 / 0.12), 0 4px 6px -4px rgb(76 71 168 / 0.1);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

#app { display: flex; height: 100vh; width: 100vw; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--brand-gradient-vert);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}
.sidebar.collapsed { width: 70px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-icon {
    width: 40px; height: 40px;
    background: var(--brand-gradient);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    flex-shrink: 0;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(53,195,232,0.35);
}
.sidebar.collapsed .brand-icon { width: 36px; height: 36px; }
.brand-text h1 { font-size: 18px; font-weight: 700; letter-spacing: 2px; color: #fff; line-height: 1; }
.brand-text span { font-size: 10px; color: var(--gold); letter-spacing: 3px; font-weight: 500; }
.sidebar.collapsed .brand-text { display: none; }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}
.nav-section { display: flex; flex-direction: column; gap: 4px; }
.nav-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4); padding: 12px 12px 4px; font-weight: 600;
}
.sidebar.collapsed .nav-label { display: none; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65); text-decoration: none;
    font-size: 13px; font-weight: 500;
    transition: var(--transition); position: relative; white-space: nowrap;
}
.nav-item svg { flex-shrink: 0; transition: var(--transition); }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
    background: linear-gradient(90deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06)); color: #fff;
    box-shadow: 0 2px 8px rgba(10,20,60,0.35);
}
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; background: var(--brand-gradient); border-radius: 0 3px 3px 0;
}
.nav-badge {
    margin-left: auto; background: linear-gradient(135deg,#ef4444,#f59e0b); color: #fff;
    font-size: 10px; font-weight: 600; padding: 2px 7px;
    border-radius: 10px; min-width: 20px; text-align: center;
}
.sidebar.collapsed .nav-item span:not(.nav-badge) { display: none; }
.sidebar.collapsed .nav-badge {
    position: absolute; top: 6px; right: 6px;
    font-size: 9px; padding: 1px 4px; min-width: 16px;
}
.nav-logout { color: rgba(255,255,255,0.5); }
.nav-logout:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

.sidebar-user {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); margin-top: auto;
}
.user-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--brand-gradient); display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; border: 2px solid rgba(255,255,255,0.5);
}
.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.5); white-space: nowrap; }
.sidebar.collapsed .user-info { display: none; }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* Topbar */
.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 24px; background: var(--bg-card);
    border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.menu-toggle {
    display: none; width: 36px; height: 36px;
    border: none; background: var(--bg-secondary);
    border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text-primary); align-items: center; justify-content: center;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h2 { font-size: 18px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.page-date { font-size: 12px; color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.role-switcher {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; background: var(--brand-gradient-soft);
    border: 1px solid rgba(74,142,240,0.18);
    border-radius: var(--radius-sm); font-size: 13px;
}
.role-label { color: var(--text-secondary); font-weight: 500; }
.role-select {
    border: none; background: transparent; font-size: 13px;
    font-weight: 600; color: var(--text-primary); cursor: pointer;
    outline: none; font-family: var(--font);
}

.icon-btn {
    width: 36px; height: 36px; border: 1px solid var(--border);
    background: var(--bg-card); border-radius: var(--radius-sm);
    cursor: pointer; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); position: relative;
}
.icon-btn:hover { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--text-muted); }
.notif-dot {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; background: var(--danger);
    border-radius: 50%; border: 2px solid var(--bg-card);
}

.content-wrapper { flex: 1; overflow-y: auto; padding: 24px; }

/* ===== PAGES ===== */
.page { display: none; animation: fadeIn 0.35s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 { font-size: 22px; font-weight: 600; }
.page-subtitle { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

/* ===== WELCOME BANNER ===== */
.welcome-banner {
    background: var(--brand-gradient);
    border-radius: var(--radius-lg); padding: 28px 32px;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; position: relative; overflow: hidden;
}
.welcome-banner::before {
    content: ''; position: absolute; top: -50%; right: -10%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
    border-radius: 50%;
}
.welcome-banner::after {
    content: ''; position: absolute; bottom: -60%; left: 10%;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.welcome-text h2 { color: #fff; font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.welcome-text p { color: rgba(255,255,255,0.7); font-size: 13px; }
.welcome-chart { width: 160px; height: 60px; flex-shrink: 0; }

/* ===== KPI GRID ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.kpi-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    transition: var(--transition); position: relative; overflow: hidden;
}
.kpi-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: var(--brand-gradient); opacity: 0; transition: var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.kpi-card:hover::before { opacity: 1; }

.kpi-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.kpi-icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.kpi-icon.blue { background: rgba(74,142,240,0.12); color: var(--grad-2); }
.kpi-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.kpi-icon.orange { background: rgba(245,158,11,0.1); color: var(--warning); }
.kpi-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }
.kpi-icon.purple { background: rgba(91,82,232,0.12); color: var(--grad-1); }
.kpi-icon.gold { background: rgba(53,195,232,0.12); color: var(--grad-3); }

.kpi-value {
    font-size: 26px; font-weight: 700; color: var(--text-primary);
    line-height: 1.1; margin-bottom: 8px; font-variant-numeric: tabular-nums;
}
.kpi-change { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }
.kpi-change.neutral { color: var(--text-muted); }
.kpi-change svg { width: 14px; height: 14px; }

/* ===== CHARTS ===== */
.dashboard-charts {
    display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 24px;
}
.dashboard-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.chart-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; transition: var(--transition);
}
.chart-card:hover { box-shadow: var(--shadow); }
.chart-card.wide { grid-column: span 1; }
.chart-card.full { grid-column: 1 / -1; }

.chart-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.chart-header h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; }
.chart-body { height: 240px; position: relative; }
.chart-body.large { height: 320px; }
.chart-actions { display: flex; gap: 8px; }
.link-small { font-size: 12px; color: var(--info); text-decoration: none; font-weight: 500; }
.link-small:hover { text-decoration: underline; }

/* SVG Charts */
.chart-svg { width: 100%; height: 100%; }
.chart-grid-line { stroke: var(--border); stroke-width: 0.5; }
.chart-axis-text { font-size: 10px; fill: var(--text-muted); font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { opacity: 0.08; }
.chart-bar { rx: 3; ry: 3; transition: opacity 0.2s; }
.chart-bar:hover { opacity: 0.8; }
.chart-dot { transition: r 0.2s; cursor: pointer; }
.chart-dot:hover { r: 5; }

/* Gauge */
.gauge-container { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gauge-value { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.gauge-label { font-size: 12px; color: var(--text-secondary); text-align: center; }
.gauge-status { font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 20px; }
.gauge-status.good { background: rgba(16,185,129,0.1); color: var(--success); }
.gauge-status.warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.gauge-status.danger { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ===== TABLES ===== */
.table-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; overflow: hidden;
}
.table-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.table-header h3 { font-size: 15px; font-weight: 600; }
.search-input {
    padding: 8px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px;
    font-family: var(--font); width: 220px; outline: none; transition: var(--transition);
}
.search-input:focus { border-color: var(--info); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.table-responsive { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    text-align: left; padding: 12px 14px; color: var(--text-secondary);
    font-weight: 600; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.5px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.data-table td {
    padding: 12px 14px; border-bottom: 1px solid var(--border-light);
    color: var(--text-primary); font-variant-numeric: tabular-nums;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--bg-secondary); }

.status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.status-pill.success { background: rgba(16,185,129,0.1); color: var(--success); }
.status-pill.warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.status-pill.danger { background: rgba(239,68,68,0.1); color: var(--danger); }
.status-pill.info { background: rgba(59,130,246,0.1); color: var(--info); }

/* Label kecil buat nandain angka yang bukan hasil resmi (mis. KPMM/ATMR
   estimasi dari TblToDWH, bukan submisi OJK asli) - dipakai di chart-header
   sebelah judul, jangan sampai ketuker sama status-pill (itu buat status). */
.estimasi-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 20px; font-size: 10px; font-weight: 700;
    letter-spacing: 0.3px; text-transform: uppercase;
    background: rgba(245,158,11,0.1); color: var(--warning);
    border: 1px solid rgba(245,158,11,0.25);
    cursor: help;
}

/* Tombol rentang tanggal (7/30/90/Semua) buat chart tren historis -
   dipakai di dashboard operasional & eksekutif, jangan diduplikat inline. */
.range-btn {
    border: none; background: none; padding: 6px 12px; font-size: 12px; font-weight: 600;
    color: var(--text-secondary); cursor: pointer; border-radius: 6px; font-family: inherit;
}
.range-btn.active { background: var(--bg-card, #fff); color: var(--primary, #1c1852); box-shadow: var(--shadow-sm); }


.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-neutral { color: var(--text-muted); }

/* ===== NEWS ===== */
.news-preview { display: flex; flex-direction: column; gap: 12px; }
.news-item-preview {
    display: flex; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid var(--border-light); cursor: pointer; transition: var(--transition);
}
.news-item-preview:last-child { border-bottom: none; }
.news-item-preview:hover { opacity: 0.8; }
.news-thumb {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    background: var(--bg-secondary); display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.news-meta { flex: 1; min-width: 0; }
.news-title { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.news-date { font-size: 11px; color: var(--text-muted); }
.news-tag {
    font-size: 10px; font-weight: 600; padding: 2px 8px;
    border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.news-tag.social { background: rgba(59,130,246,0.1); color: var(--info); }
.news-tag.audit { background: rgba(245,158,11,0.1); color: var(--warning); }
.news-tag.sop { background: rgba(16,185,129,0.1); color: var(--success); }
.news-tag.internal { background: rgba(91,82,232,0.12); color: var(--grad-1); }

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.news-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: var(--transition); cursor: pointer;
}
.news-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.news-image {
    height: 140px; background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; position: relative;
}
.news-image .news-tag { position: absolute; top: 12px; left: 12px; }
.news-content { padding: 16px; }
.news-content h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; color: var(--text-primary); }
.news-content p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-footer { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-muted); }

.news-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.news-filter {
    padding: 6px 16px; border: 1px solid var(--border); background: var(--bg-card);
    border-radius: 20px; font-size: 13px; font-weight: 500;
    color: var(--text-secondary); cursor: pointer; transition: var(--transition); font-family: var(--font);
}
.news-filter:hover { border-color: var(--text-muted); color: var(--text-primary); }
.news-filter.active { background: var(--brand-gradient); color: #fff; border-color: transparent; }

/* ===== REPORT TABS ===== */
.report-tabs {
    display: flex; gap: 4px; margin-bottom: 20px;
    background: var(--bg-secondary); padding: 4px;
    border-radius: var(--radius-sm); width: fit-content;
}
.report-tab {
    padding: 8px 18px; border: none; background: transparent;
    border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
    color: var(--text-secondary); cursor: pointer; transition: var(--transition); font-family: var(--font);
}
.report-tab:hover { color: var(--text-primary); }
.report-tab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.report-content { display: none; }
.report-content.active { display: block; animation: fadeIn 0.3s ease; }
.report-period { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ===== PERIOD SELECTOR ===== */
.period-selector { display: flex; gap: 4px; background: var(--bg-secondary); padding: 4px; border-radius: var(--radius-sm); }
.period-btn {
    padding: 6px 16px; border: none; background: transparent;
    border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
    color: var(--text-secondary); cursor: pointer; transition: var(--transition); font-family: var(--font);
}
.period-btn:hover { color: var(--text-primary); }
.period-btn.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* ===== RATIO GRID ===== */
.ratio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.ratio-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; text-align: center; transition: var(--transition);
}
.ratio-card:hover { box-shadow: var(--shadow); }
.ratio-ring { width: 80px; height: 80px; margin: 0 auto 12px; }
.ratio-value { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.ratio-name { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.ratio-desc { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== BUTTONS ===== */
.btn-sm {
    padding: 6px 14px; border: 1px solid var(--border); background: var(--bg-card);
    border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;
    color: var(--text-primary); cursor: pointer; transition: var(--transition); font-family: var(--font);
}
.btn-sm:hover { background: var(--bg-secondary); border-color: var(--text-muted); }
.btn-primary {
    padding: 10px 24px; border: none; background: var(--brand-gradient);
    color: #fff; border-radius: var(--radius-sm); font-size: 14px;
    font-weight: 600; cursor: pointer; transition: var(--transition); font-family: var(--font);
    box-shadow: 0 4px 12px rgba(74,142,240,0.28);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; filter: none; }
.btn-secondary {
    padding: 10px 24px; border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text-primary); border-radius: var(--radius-sm); font-size: 14px;
    font-weight: 600; cursor: pointer; transition: var(--transition); font-family: var(--font);
}
.btn-secondary:hover { background: var(--bg-secondary); }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg-card); border-radius: var(--radius-lg); padding: 32px;
    text-align: center; max-width: 360px; width: 90%; box-shadow: var(--shadow-lg);
    transform: scale(0.95); transition: transform 0.25s ease;
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-icon { font-size: 40px; margin-bottom: 12px; }
.modal h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.modal p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ===== TOAST ===== */
.toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 1001;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; font-weight: 500;
    animation: slideInRight 0.3s ease; min-width: 280px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOutRight { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .dashboard-charts { grid-template-columns: 1fr; }
    .dashboard-bottom { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -260px; height: 100vh; }
    .sidebar.open { left: 0; }
    .menu-toggle { display: flex; }
    .content-wrapper { padding: 16px; }
    .welcome-banner { padding: 20px; flex-direction: column; text-align: center; gap: 16px; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .ratio-grid { grid-template-columns: repeat(2, 1fr); }
    .news-grid { grid-template-columns: 1fr; }
    .role-switcher { display: none; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .ratio-grid { grid-template-columns: 1fr; }
    .chart-body { height: 180px; }
}

/* ============================================
   LOGIN PAGE
   ============================================ */
html.login-html, .login-html body { overflow: auto; }
.login-page {
    min-height: 100vh; width: 100%;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    background: linear-gradient(160deg, #14103c 0%, #1c2b63 45%, #0d3d54 100%);
    padding: 24px;
}
.login-blob {
    position: absolute; border-radius: 50%; filter: blur(80px);
    opacity: 0.55; animation: floatBlob 14s ease-in-out infinite;
}
.login-blob.b1 { width: 480px; height: 480px; background: #5b52e8; top: -140px; left: -120px; }
.login-blob.b2 { width: 420px; height: 420px; background: #35c3e8; bottom: -160px; right: -100px; animation-delay: 3s; }
.login-blob.b3 { width: 320px; height: 320px; background: #4a8ef0; bottom: 10%; left: 8%; animation-delay: 6s; }
@keyframes floatBlob {
    0%, 100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(30px,-30px) scale(1.08); }
}
.login-grid-overlay {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
}

.login-shell {
    position: relative; z-index: 2; width: 100%; max-width: 960px;
    display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 22px; overflow: hidden;
    backdrop-filter: blur(18px);
    box-shadow: 0 30px 80px -20px rgba(5,10,40,0.6);
}

.login-side {
    padding: 44px 40px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
    background: linear-gradient(160deg, rgba(91,82,232,0.35), rgba(53,195,232,0.18));
    border-right: 1px solid rgba(255,255,255,0.1);
}
.login-side .brand-row { display: flex; align-items: center; gap: 12px; }
.login-side .brand-row .brand-icon { box-shadow: 0 6px 18px rgba(53,195,232,0.4); }
.login-side .brand-row h1 { font-size: 19px; letter-spacing: 2px; font-weight: 700; }
.login-side .brand-row span { display: block; font-size: 10px; letter-spacing: 3px; color: rgba(255,255,255,0.7); }
.login-side .tagline { font-size: 26px; font-weight: 700; line-height: 1.3; margin-top: 36px; }
.login-side .tagline .grad-text {
    background: linear-gradient(90deg, #a5b4fc, #67e8f9);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-side .sub { font-size: 13px; color: rgba(255,255,255,0.65); margin-top: 12px; line-height: 1.6; max-width: 340px; }
.login-side .feature-list { display: flex; flex-direction: column; gap: 10px; margin-top: 32px; }
.login-side .feature-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: rgba(255,255,255,0.82); }
.login-side .feature-item .dot { width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(135deg,#a5b4fc,#67e8f9); flex-shrink: 0; }
.login-side .foot-note { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 30px; }

.login-form-area { padding: 44px 40px; background: rgba(10,12,32,0.35); display: flex; flex-direction: column; }
.login-form-area h2 { color: #fff; font-size: 21px; font-weight: 700; margin-bottom: 4px; }
.login-form-area .sub-label { color: rgba(255,255,255,0.55); font-size: 13px; margin-bottom: 22px; }

.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.role-card {
    border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.05);
    border-radius: 12px; padding: 12px 10px; text-align: center; cursor: pointer;
    transition: var(--transition); color: rgba(255,255,255,0.75);
}
.role-card .role-icon { font-size: 18px; margin-bottom: 4px; }
.role-card .role-card-label { font-size: 11.5px; font-weight: 600; }
.role-card:hover { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.09); }
.role-card.selected {
    border-color: transparent; color: #fff;
    background: var(--brand-gradient);
    box-shadow: 0 8px 20px -6px rgba(53,195,232,0.5);
    transform: translateY(-1px);
}

.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 11.5px; color: rgba(255,255,255,0.6); margin-bottom: 6px; font-weight: 600; letter-spacing: 0.3px; }
.login-field input {
    width: 100%; padding: 11px 14px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.06);
    color: #fff; font-size: 13.5px; font-family: var(--font); outline: none; transition: var(--transition);
}
.login-field input::placeholder { color: rgba(255,255,255,0.35); }
.login-field input:focus { border-color: #67e8f9; box-shadow: 0 0 0 3px rgba(103,232,249,0.15); background: rgba(255,255,255,0.09); }

.login-row-between { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; font-size: 12px; color: rgba(255,255,255,0.6); }
.login-row-between label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.login-row-between a { color: #a5b4fc; text-decoration: none; }
.login-row-between a:hover { text-decoration: underline; }

.btn-login-submit {
    width: 100%; padding: 13px; border: none; border-radius: 10px;
    background: var(--brand-gradient); color: #fff; font-size: 14px; font-weight: 700;
    cursor: pointer; letter-spacing: 0.3px; transition: var(--transition);
    box-shadow: 0 10px 24px -8px rgba(53,195,232,0.55);
}
.btn-login-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-login-submit:active { transform: translateY(0); }

.login-error { display: none; font-size: 12px; color: #fca5a5; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; }
.login-error.show { display: block; }

.login-demo-note { margin-top: auto; padding-top: 18px; font-size: 11px; color: rgba(255,255,255,0.4); text-align: center; }

@media (max-width: 760px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-side { display: none; }
}

/* ============================================
   COMPLIANCE / OJK REPORTING ALERT
   ============================================ */
.compliance-modal .modal { max-width: 480px; text-align: left; padding: 0; overflow: hidden; }
.compliance-header {
    background: var(--brand-gradient); color: #fff; padding: 22px 24px;
    display: flex; align-items: center; gap: 12px;
}
.compliance-header .icon { font-size: 26px; }
.compliance-header h3 { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.compliance-header p { font-size: 12px; color: rgba(255,255,255,0.85); margin: 0; }
.compliance-body { padding: 18px 22px; max-height: 340px; overflow-y: auto; }
.compliance-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 0;
    border-bottom: 1px solid var(--border-light);
}
.compliance-item:last-child { border-bottom: none; }
.compliance-badge {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; color: #fff;
}
.compliance-badge.overdue { background: linear-gradient(135deg,#ef4444,#f87171); }
.compliance-badge.soon { background: linear-gradient(135deg,#f59e0b,#fbbf24); }
.compliance-badge.ok { background: linear-gradient(135deg,var(--grad-2),var(--grad-3)); }
.compliance-info { flex: 1; min-width: 0; }
.compliance-info .name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.compliance-info .desc { font-size: 11.5px; color: var(--text-secondary); margin-top: 1px; }
.compliance-status { font-size: 11px; font-weight: 700; text-align: right; white-space: nowrap; }
.compliance-status.overdue { color: var(--danger); }
.compliance-status.soon { color: var(--warning); }
.compliance-status.ok { color: var(--success); }
.compliance-footer { padding: 14px 22px 20px; }
.compliance-footer .btn-primary { width: 100%; }
.compliance-footer .footnote { font-size: 10.5px; color: var(--text-muted); text-align: center; margin-top: 10px; }

/* ============================================
   NEWS UPLOAD MODAL
   ============================================ */
.upload-modal .modal { max-width: 460px; text-align: left; }
.upload-modal .modal h3 { text-align: center; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px; font-family: var(--font);
    color: var(--text-primary); outline: none; transition: var(--transition); background: var(--bg-card);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--grad-2); box-shadow: 0 0 0 3px rgba(74,142,240,0.12);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.file-drop {
    border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
    padding: 18px; text-align: center; cursor: pointer; transition: var(--transition);
    background: var(--bg-secondary); font-size: 12.5px; color: var(--text-secondary);
}
.file-drop:hover { border-color: var(--grad-2); background: var(--brand-gradient-soft); }
.file-drop.has-file { border-color: var(--success); color: var(--success); background: rgba(16,185,129,0.06); border-style: solid; }
.file-drop input { display: none; }

.news-btn-upload {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border: none; border-radius: var(--radius-sm);
    background: var(--brand-gradient); color: #fff; font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: var(--font); box-shadow: 0 4px 12px rgba(74,142,240,0.25);
    transition: var(--transition);
}
.news-btn-upload:hover { filter: brightness(1.08); transform: translateY(-1px); }

.news-dept-tag {
    font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
    background: rgba(91,82,232,0.1); color: var(--grad-1); text-transform: uppercase; letter-spacing: 0.4px;
}
.news-card.is-new::after {
    content: 'BARU'; position: absolute; top: 12px; right: 12px;
    background: var(--brand-gradient); color: #fff; font-size: 9px; font-weight: 800;
    padding: 3px 8px; border-radius: 20px; letter-spacing: 0.5px;
}
.news-card { position: relative; }
.news-attachment {
    display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--grad-2);
    margin-top: 8px; text-decoration: none; font-weight: 600;
}
.news-attachment:hover { text-decoration: underline; }

/* Compliance widget on dashboard */
.compliance-widget-list { display: flex; flex-direction: column; gap: 10px; }
.compliance-widget-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border-radius: var(--radius-sm); background: var(--bg-secondary);
}
.compliance-widget-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.compliance-widget-item .dot.overdue { background: var(--danger); }
.compliance-widget-item .dot.soon { background: var(--warning); }
.compliance-widget-item .dot.ok { background: var(--success); }
.compliance-widget-item .txt { flex: 1; font-size: 12.5px; color: var(--text-primary); font-weight: 500; }
.compliance-widget-item .due { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* Topbar brand pill for role */
.role-pill-btn {
    display: flex; align-items: center; gap: 6px; padding: 6px 14px;
    border-radius: 20px; background: var(--brand-gradient); color: #fff;
    font-size: 12px; font-weight: 600; border: none; cursor: pointer; font-family: var(--font);
    box-shadow: 0 3px 10px rgba(74,142,240,0.3);
}
