:root {
    --primary: #12355b;
    --primary2: #1d5d9b;
    --bg: #f4f7fb;
    --white: #ffffff;
    --success: #198754;
    --danger: #dc3545;
    --warning: #f39c12;
    --info: #0d6efd;
    --text: #263238;
    --muted: #718096;
    --border: #e7edf4;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; }
body { background: var(--bg); color: var(--text); }

/* ================= SIDEBAR & TOPBAR ================= */
.sidebar { position: fixed; width: 270px; height: 100vh; background: linear-gradient(180deg,#102f50,#081d33); color: white; overflow-y: auto; z-index: 1000; transition: .3s; }
.brand { padding: 22px 18px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand h2 { font-size: 18px; }
.brand p { font-size: 11px; opacity: .7; margin-top: 5px; }

.menu-section { font-size: 10px; letter-spacing: 1px; color: #8ca3b9; padding: 20px 18px 8px; font-weight: bold; }
.menu-item { margin: 3px 10px; padding: 12px 14px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 12px; font-size: 14px; transition: .2s; text-decoration: none; color: white; }
.menu-item:hover, .menu-item.active { background: var(--primary2); }
.menu-item i:first-child { width: 20px; text-align: center; }
.arrow { margin-left: auto; font-size: 11px; transition: .3s; }

/* Perbaikan Submenu (Kode digabung agar tidak bentrok) */
.submenu { display: none; flex-direction: column; gap: 4px; margin-top: 5px; padding-left: 20px; }
.submenu.open { display: flex; }
.submenu-item { padding: 10px 14px; color: #8ca3b9; font-size: 13px; cursor: pointer; border-radius: 6px; transition: .2s; text-decoration: none; display: block; }
.submenu-item:hover, .submenu-item.active { background: rgba(255,255,255,.1); color: white; }

/* ================= MAIN CONTENT ================= */
.main { margin-left: 270px; min-height: 100vh; }
.topbar { height: 70px; background: white; display: flex; justify-content: space-between; align-items: center; padding: 0 28px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.topbar-left { display: flex; align-items: center; gap: 15px; }
.mobile-menu { display: none; border: none; background: none; font-size: 20px; }
.user-box { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; background: var(--primary2); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.content { padding: 28px; }

/* ================= UTILITIES & CARDS ================= */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.page-header h1 { font-size: 24px; color: var(--primary); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 25px; }
.card { background: white; border-radius: 14px; padding: 20px; box-shadow: 0 4px 20px rgba(0,0,0,.04); position: relative; }
.card-icon { position: absolute; right: 18px; top: 18px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.green { background: #e4f7ec; color: var(--success); }
.red { background: #fde8e9; color: var(--danger); }
.blue { background: #e8f1ff; color: var(--info); }
.orange { background: #fff3df; color: var(--warning); }
.card-title { font-size: 13px; color: var(--muted); }
.card-value { margin-top: 12px; font-size: 22px; font-weight: bold; }

/* ================= BOX & TABLE ================= */
.box { background: white; border-radius: 14px; padding: 22px; box-shadow: 0 4px 20px rgba(0,0,0,.04); margin-bottom: 20px; }
.box-title h3 { color: var(--primary); margin-bottom: 18px; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #f5f8fb; padding: 13px; text-align: left; font-size: 12px; color: #5f6b76; }
td { padding: 13px; border-bottom: 1px solid var(--border); font-size: 13px; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.search { padding: 10px 13px; border: 1px solid #dce3ea; border-radius: 8px; min-width: 250px; outline: none; }
.search:focus { border-color: var(--primary2); }

/* ================= BUTTON & BADGE ================= */
.btn { border: none; padding: 10px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: .2s; }
.btn-primary { background: var(--primary2); color: white; }
.btn-primary:hover { opacity: .85; }
.btn-sm { padding: 7px 9px; font-size: 11px; }
.btn-light { background: #eef2f6; color: #333; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }

.badge { padding: 5px 9px; border-radius: 20px; font-size: 11px; display: inline-block; font-weight: bold; }
.badge-success { background: #dff5e8; color: #198754; }
.badge-danger { background: #fde2e2; color: #dc3545; }
.badge-warning { background: #fff0cf; color: #9a6500; }
.badge-info { background: #e1efff; color: #0d6efd; }

/* ================= MODAL & FORM ================= */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 3000; align-items: center; justify-content: center; padding: 15px; }
.modal.show { display: flex; }
.modal-content { width: min(700px, 100%); max-height: 90vh; overflow-y: auto; background: white; border-radius: 14px; padding: 25px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.close { cursor: pointer; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: bold; }
input, select, textarea { padding: 11px; border: 1px solid #dce3ea; border-radius: 8px; outline: none; }
textarea { min-height: 90px; resize: vertical; }

/* ================= LOGIN SCREEN ================= */
.login-container { height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { background: white; padding: 40px; border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.08); width: 100%; max-width: 400px; text-align: center; }
.login-box h2 { color: var(--primary); margin-bottom: 5px; font-size: 24px;}
.login-box input { width: 100%; padding: 13px; margin-bottom: 15px; border: 1px solid var(--border); border-radius: 8px; outline: none; font-size: 14px; }
.login-box input:focus { border-color: var(--primary2); }
.login-box .btn { width: 100%; padding: 13px; font-size: 15px; font-weight: bold; margin-top: 10px; }

/* ================= UTILITY ================= */
.hidden { display: none !important; }
body.role-guru .admin-only { display: none !important; }
.toast { position: fixed; right: 20px; bottom: 20px; background: #222; color: white; padding: 14px 18px; border-radius: 8px; display: none; z-index: 5000; }

/* ================= RESPONSIVE ================= */
@media(max-width: 900px){
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main { margin-left: 0; }
    .mobile-menu { display: block; }
}

/* ================= FIX Z-INDEX SWEETALERT2 ================= */
/* SweetAlert2 harus selalu muncul di atas modal & toast custom */
.swal2-container {
    z-index: 99999 !important;
}

/* Opsional: kalau ada stacking context lain (misal modal di dalam modal) */
.swal2-popup {
    z-index: 99999 !important;
}

/* ================= TAMBAHAN OPSIONAL ================= */

/* 1. Style tfoot agar konsisten dengan tabel (untuk baris TOTAL di modal perubahan) */
tfoot td { background: #f8fafc; font-weight: bold; border-top: 2px solid var(--border); }

/* 2. Scrollbar custom untuk modal-content & table-wrapper (lebih rapi dari default) */
.modal-content::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar { width: 8px; height: 8px; }
.modal-content::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
.modal-content::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.modal-content::-webkit-scrollbar-thumb:hover,
.table-wrapper::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 3. Button disabled state (dipakai tombol "Kirim Perubahan" saat total over plafon) */
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* 4. Text selection color agar selaras brand */
::selection { background: var(--primary2); color: white; }

/* 5. Perbaikan modal di layar kecil (form-grid jadi 1 kolom) */
@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .modal-content { padding: 18px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header h1 { font-size: 20px; }
}
 
/* ===== Hero Total Pendapatan ===== */
        .total-pendapatan-hero {
            background: linear-gradient(135deg, #1d5d9b 0%, #12355b 100%);
            color: white;
            padding: 22px 28px;
            border-radius: 14px;
            margin-bottom: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
            box-shadow: 0 6px 24px rgba(18, 53, 91, 0.15);
        }
        .total-pendapatan-hero .hero-label {
            font-size: 13px;
            opacity: 0.85;
            letter-spacing: 0.5px;
            margin-bottom: 6px;
        }
        .total-pendapatan-hero .hero-value {
            font-size: 28px;
            font-weight: bold;
        }
        .total-pendapatan-hero .hero-icon {
            width: 56px;
            height: 56px;
            background: rgba(255,255,255,0.15);
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
        }

        /* ===== Widget Kartu Per Kategori ===== */
        .kategori-widgets {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 15px;
            margin-bottom: 22px;
        }
        .kategori-widget {
            background: white;
            border-radius: 12px;
            padding: 16px 18px;
            box-shadow: 0 4px 15px rgba(0,0,0,.04);
            border-left: 4px solid var(--primary2);
            position: relative;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .kategori-widget:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0,0,0,.07);
        }
        .kategori-widget .kw-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 10px;
            gap: 10px;
        }
        .kategori-widget .kw-title {
            font-size: 13px;
            color: var(--muted);
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            line-height: 1.4;
            flex: 1;
        }
        .kategori-widget .kw-count {
            background: #e8f1ff;
            color: var(--primary2);
            padding: 3px 9px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: bold;
            white-space: nowrap;
        }
        .kategori-widget .kw-value {
            font-size: 19px;
            font-weight: bold;
            color: var(--success);
        }
        .kategori-widget .kw-bar {
            margin-top: 10px;
            height: 5px;
            background: #eef2f6;
            border-radius: 3px;
            overflow: hidden;
        }
        .kategori-widget .kw-bar-inner {
            height: 100%;
            background: linear-gradient(90deg, #198754, #22c55e);
            border-radius: 3px;
            transition: width 0.4s ease;
        }

        /* ===== Modal Kelola Kategori ===== */
        .kat-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 14px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            margin-bottom: 8px;
            background: white;
            transition: all 0.15s;
        }
        .kat-row:hover { background: #f8fafc; border-color: #cbd5e1; }
        .kat-row .kat-info { flex: 1; }
        .kat-row .kat-name { font-weight: bold; color: var(--text); font-size: 14px; }
        .kat-row .kat-usage { font-size: 12px; color: var(--muted); margin-top: 3px; }
        .kat-row .kat-actions { display: flex; gap: 6px; }
        .kat-empty {
            text-align: center;
            padding: 30px;
            color: var(--muted);
            font-size: 13px;
            background: #f8fafc;
            border-radius: 8px;
            border: 1px dashed #cbd5e1;
        }

        /* FIX: SweetAlert2 di atas modal */
        .swal2-container { z-index: 99999 !important; }

        /* ============================================================
   ANGGARAN PAGE — Hero, Widget, Filter, Realisasi
   ============================================================ */

/* FIX: SweetAlert2 di atas semua modal custom */
.swal2-container { z-index: 99999 !important; }

/* ---------- Hero Total Pendapatan ---------- */
.total-pendapatan-hero {
    background: linear-gradient(135deg, #1d5d9b 0%, #12355b 100%);
    color: white;
    padding: 22px 28px;
    border-radius: 14px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 6px 24px rgba(18, 53, 91, 0.15);
}
.total-pendapatan-hero .hero-label { font-size: 13px; opacity: 0.85; letter-spacing: 0.5px; margin-bottom: 6px; }
.total-pendapatan-hero .hero-value { font-size: 28px; font-weight: bold; }
.total-pendapatan-hero .hero-icon { width: 56px; height: 56px; background: rgba(255,255,255,0.15); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }

/* ---------- Widget Kategori Pendapatan ---------- */
.kategori-widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 15px; margin-bottom: 22px; }
.kategori-widget { background: white; border-radius: 12px; padding: 16px 18px; box-shadow: 0 4px 15px rgba(0,0,0,.04); border-left: 4px solid var(--primary2); }
.kategori-widget .kw-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 10px; }
.kategori-widget .kw-title { font-size: 13px; color: var(--muted); font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.4; flex: 1; }
.kategori-widget .kw-count { background: #e8f1ff; color: var(--primary2); padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: bold; white-space: nowrap; }
.kategori-widget .kw-value { font-size: 19px; font-weight: bold; color: var(--success); }
.kategori-widget .kw-bar { margin-top: 10px; height: 5px; background: #eef2f6; border-radius: 3px; overflow: hidden; }
.kategori-widget .kw-bar-inner { height: 100%; background: linear-gradient(90deg, #198754, #22c55e); border-radius: 3px; }

/* ---------- Modal Kelola Kategori ---------- */
.kat-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 8px; background: white; }
.kat-row:hover { background: #f8fafc; }
.kat-row .kat-info { flex: 1; }
.kat-row .kat-name { font-weight: bold; color: var(--text); font-size: 14px; }
.kat-row .kat-usage { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kat-row .kat-actions { display: flex; gap: 6px; }
.kat-empty { text-align: center; padding: 30px; color: var(--muted); font-size: 13px; background: #f8fafc; border-radius: 8px; border: 1px dashed #cbd5e1; }

/* ---------- Stat Top Row (Realisasi) ---------- */
.stat-top-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-top-card { background: white; border-radius: 14px; padding: 20px 22px; box-shadow: 0 4px 20px rgba(0,0,0,.04); display: flex; align-items: center; gap: 16px; border-left: 5px solid; }
.stat-top-card.income { border-color: #22c55e; }
.stat-top-card.saldo { border-color: #1d5d9b; }
.stat-top-card .stc-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-top-card.income .stc-icon { background: #dcfce7; color: #198754; }
.stat-top-card.saldo .stc-icon { background: #dbeafe; color: #1d5d9b; }
.stat-top-card .stc-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: bold; margin-bottom: 4px; }
.stat-top-card .stc-value { font-size: 22px; font-weight: bold; }
.stat-top-card.income .stc-value { color: #198754; }
.stat-top-card.saldo .stc-value { color: #1d5d9b; }

/* ---------- Widget Plafon Besar (Realisasi) ---------- */
.realisasi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; margin-bottom: 22px; }
.widget-plafon { background: white; border-radius: 16px; padding: 24px; box-shadow: 0 6px 24px rgba(0,0,0,.05); border-top: 5px solid; }
.widget-plafon.admin { border-color: #1d5d9b; }
.widget-plafon.guru { border-color: #f39c12; }
.wp-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.wp-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.widget-plafon.admin .wp-icon { background: #e8f1ff; color: #1d5d9b; }
.widget-plafon.guru .wp-icon { background: #fff3df; color: #f39c12; }
.wp-title { font-size: 12px; letter-spacing: 1px; color: var(--muted); font-weight: bold; text-transform: uppercase; margin-bottom: 4px; }
.wp-sub { font-size: 12px; color: var(--muted); }
.wp-main-value { font-size: 26px; font-weight: bold; margin-bottom: 18px; }
.widget-plafon.admin .wp-main-value { color: #1d5d9b; }
.widget-plafon.guru .wp-main-value { color: #f39c12; }
.wp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 15px; }
.wp-item { background: #f8fafc; padding: 12px 14px; border-radius: 10px; border: 1px solid #eef2f6; }
.wp-item .wp-label { font-size: 11px; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.wp-item .wp-value { font-size: 15px; font-weight: bold; }
.wp-item .wp-value.danger { color: var(--danger); }
.wp-item .wp-value.success { color: var(--success); }
.wp-item .wp-value.warning { color: var(--warning); }
.wp-bar { height: 8px; background: #eef2f6; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.wp-bar-inner { height: 100%; border-radius: 4px; transition: width 0.4s; }
.widget-plafon.admin .wp-bar-inner { background: linear-gradient(90deg, #1d5d9b, #3b82f6); }
.widget-plafon.guru .wp-bar-inner { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.wp-percent-text { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; }

/* ---------- Filter Bar (Tabel Pengeluaran) ---------- */
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; padding: 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; align-items: end; }
.filter-bar .fb-group { display: flex; flex-direction: column; gap: 4px; }
.filter-bar .fb-group label { font-size: 11px; color: var(--muted); font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.filter-bar input, .filter-bar select { padding: 8px 10px; border: 1px solid #dce3ea; border-radius: 6px; font-size: 13px; outline: none; background: white; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary2); }
.filter-bar .fb-actions { display: flex; gap: 6px; }

/* ---------- Pagination Bar ---------- */
.pagination-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; margin-top: 10px; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.pagination-bar .pg-buttons { display: flex; align-items: center; gap: 6px; }
.pagination-bar .pg-buttons button { padding: 5px 10px; border: 1px solid #dce3ea; background: white; border-radius: 6px; cursor: pointer; font-size: 12px; }
.pagination-bar .pg-buttons button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-bar .pg-buttons button:not(:disabled):hover { background: var(--primary2); color: white; border-color: var(--primary2); }

/* ============================================================
   ANGGARAN KEBUTUHAN GURU — Hero & Widget per Guru
   ============================================================ */
.akg-hero {
    background: linear-gradient(135deg, #f39c12 0%, #d97706 100%);
    color: white;
    padding: 24px 28px;
    border-radius: 14px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 6px 24px rgba(243, 156, 18, 0.25);
}
.akg-hero .akg-hero-label { font-size: 13px; opacity: 0.9; letter-spacing: 0.5px; margin-bottom: 6px; text-transform: uppercase; }
.akg-hero .akg-hero-value { font-size: 30px; font-weight: bold; }
.akg-hero .akg-hero-sub { font-size: 12px; opacity: 0.85; margin-top: 6px; }
.akg-hero .akg-hero-icon { width: 60px; height: 60px; background: rgba(255,255,255,0.2); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 26px; }

.guru-rab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.guru-rab-widget {
    background: white;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 4px 18px rgba(0,0,0,.05);
    border-left: 5px solid #f39c12;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.guru-rab-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,.09);
}
.guru-rab-widget.inactive {
    border-left-color: #94a3b8;
    opacity: 0.75;
}

.grw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}
.grw-name {
    font-size: 15px;
    font-weight: bold;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.grw-name .avatar-mini {
    width: 32px;
    height: 32px;
    background: #fff3df;
    color: #f39c12;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.grw-status {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: bold;
    text-transform: uppercase;
}
.grw-status.aktif { background: #dff5e8; color: #198754; }
.grw-status.nonaktif { background: #f1f5f9; color: #64748b; }

.grw-year {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 10px;
}

.grw-plafon {
    background: #fff8e6;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.grw-plafon .label { font-size: 10px; color: #92400e; text-transform: uppercase; letter-spacing: 0.5px; font-weight: bold; margin-bottom: 4px; }
.grw-plafon .value { font-size: 19px; font-weight: bold; color: #d97706; }

.grw-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}
.grw-mini {
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px 10px;
    border: 1px solid #eef2f6;
}
.grw-mini .label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 3px; }
.grw-mini .value { font-size: 12px; font-weight: bold; }
.grw-mini .value.primary { color: var(--primary2); }
.grw-mini .value.danger { color: var(--danger); }

.grw-progress {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eef2f6;
}
.grw-progress .labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 5px;
}
.grw-progress .labels strong { color: var(--text); }
.grw-progress-bar {
    height: 8px;
    background: #eef2f6;
    border-radius: 4px;
    overflow: hidden;
}
.grw-progress-inner {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s;
}
.grw-hint {
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* Modal Detail RAB */
.rab-detail-header {
    background: linear-gradient(135deg, #1d5d9b, #12355b);
    color: white;
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
    margin: -25px -25px 20px -25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.rab-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.rab-summary-item { text-align: center; }
.rab-summary-item .label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; font-weight: bold; }
.rab-summary-item .value { font-size: 15px; font-weight: bold; }
.rab-summary-item .value.primary { color: var(--primary2); }
.rab-summary-item .value.success { color: var(--success); }
.rab-summary-item .value.danger { color: var(--danger); }
.rab-summary-item .value.warning { color: var(--warning); }

/* ============================================================
   LAPORAN PAGE — Print, Detail Modal, Laba/Rugi Grid, Year Banner
   ============================================================ */

/* ---------- Year Banner (periode laporan aktif) ---------- */
.year-banner {
    background: linear-gradient(135deg, #1d5d9b 0%, #12355b 100%);
    color: white;
    padding: 14px 22px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 4px 18px rgba(18, 53, 91, 0.15);
}
.year-banner .yb-label { font-size: 12px; opacity: 0.85; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 4px; }
.year-banner .yb-value { font-size: 22px; font-weight: bold; }
.year-banner .yb-icon { width: 48px; height: 48px; background: rgba(255,255,255,0.15); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }

/* ---------- Detail Modal Custom ---------- */
.custom-detail-table { width: 100%; border-collapse: collapse; }
.custom-detail-table td { padding: 10px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.custom-detail-table td:first-child { color: var(--muted); width: 130px; font-weight: 500; }
.custom-detail-table tr:last-child td { border-bottom: none; }

/* ---------- Container Side-by-Side Laba Rugi ---------- */
.lr-grid { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 5px; }
.lr-col { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; margin-bottom: 0 !important; }

/* ---------- Print-Only: default tersembunyi di layar ---------- */
.print-only-table, .print-only-block, .print-only-flex { display: none; }

/* ---------- Print Media Query ---------- */
/* ---------- Print Media Query (Rapi & Estetik) ---------- */
@media print {
        /* Default kertas jika tidak di-override JS */
    @page {
        size: A4 portrait;
        margin: 1cm 1.5cm;
    }
    /* Sembunyikan elemen UI */
        .sidebar, .topbar, .btn, .mobile-menu, .user-box, .toolbar, .filter-box, .filter-bar, .no-print, .modal, .pagination-bar,
    .page-header, .year-banner, .toast,
    .lr-summary-grid, .lr-summary-card,
    .lr-table-block, .lr-table-header, .lr-filter-row,
    .stat-top-row, .stat-top-card,
    .realisasi-grid, .widget-plafon,
    .hero-mini-stats, .hero-mini-card,
    .kategori-widgets, .kategori-widget,
    .guru-rab-grid, .guru-rab-widget,
    .akg-hero, .total-pendapatan-hero, .page-hero,
    .sumber-dana-collapse, .pindah-kategori-grid,
    .cards, .card,
    canvas, .box-title { 
        display: none !important; 
    }

    /* Reset layout */
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    html, body { background: white !important; margin: 0 !important; padding: 0 !important; }
    body { font-family: 'Times New Roman', Times, serif; font-size: 11pt; color: #000; line-height: 1.4; }
    .main { margin-left: 0 !important; width: 100% !important; padding: 0 !important; }
    .content { padding: 0 !important; margin: 0 !important; }
    .box { box-shadow: none !important; border: none !important; padding: 0 !important; margin: 0 0 20px 0 !important; background: white !important; }
    
    /* Reset grid/flex jadi block saat print */
    .lr-grid, .lr-summary-grid, .cards, .realisasi-grid, .stat-top-row, .kategori-widgets, .guru-rab-grid {
        display: block !important;
    }
    .lr-col { display: block !important; width: 100% !important; margin-bottom: 20px !important; }

    /* ============ LAYOUT PRINT UTAMA ============ */
    .print-only-block { display: block !important; padding: 0 15mm !important; }
    .print-only-table { display: table-row-group !important; }
    .print-only-flex { display: flex !important; justify-content: space-between; margin-top: 40px; page-break-inside: avoid; }

    /* ============ HEADER LAPORAN ============ */
    .report-header {
        text-align: center;
        margin-bottom: 25px;
        padding-bottom: 15px;
        border-bottom: 3px double #000;
        line-height: 1.5;
        page-break-after: avoid;
    }
    .report-header h2 {
        font-size: 16pt;
        margin: 0 0 4px 0;
        text-transform: uppercase;
        font-weight: bold;
        letter-spacing: 1px;
    }
    .report-header p { margin: 2px 0; font-size: 11pt; }
    .report-header p:nth-of-type(1) { font-weight: bold; font-size: 13pt; text-transform: uppercase; }
    .report-header p:nth-of-type(2) { font-size: 10pt; font-style: italic; }

    /* ============ SECTION TITLE ============ */
    .print-section-title {
        font-size: 12pt;
        font-weight: bold;
        text-transform: uppercase;
        margin: 20px 0 10px 0;
        padding: 8px 12px;
        background: #e5e7eb !important;
        border-left: 4px solid #000;
        page-break-after: avoid;
    }

    /* ============ TABEL ============ */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-bottom: 15px !important;
        page-break-inside: auto;
        table-layout: fixed;
        font-size: 10pt;
    }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }
    tr { page-break-inside: avoid; page-break-after: auto; }
    
    th, td {
        border: 1px solid #333 !important;
        padding: 6px 8px !important;
        color: black !important;
        font-size: 10pt !important;
        vertical-align: top;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    th {
        background: #d1d5db !important;
        text-align: center !important;
        font-weight: bold;
        font-size: 10pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Kolom sempit */
    th:nth-child(1), td:nth-child(1) { width: 6%; text-align: center; }
    th:nth-child(2), td:nth-child(2) { width: 13%; }
    
    /* Text alignment */
    td[style*="text-align:right"], td[style*="text-align: right"] { text-align: right !important; font-variant-numeric: tabular-nums; }
    td[style*="text-align:center"], td[style*="text-align: center"] { text-align: center !important; }

    /* Baris total */
    tbody tr:last-child td { 
        font-weight: bold; 
        background: #f3f4f6 !important; 
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ============ HALAMAN BARU SETIAP SECTION ============ */
    .print-page-break { page-break-before: always; }

    /* ============ SURPLUS BOX ============ */
    .print-surplus-box {
        margin-top: 15px;
        padding: 12px 18px;
        border: 2px solid #000;
        background: #f9fafb !important;
        font-size: 12pt;
        font-weight: bold;
        display: flex;
        justify-content: space-between;
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ============ TANDA TANGAN ============ */
    .signature-section { display: flex !important; justify-content: space-between; margin-top: 50px; page-break-inside: avoid; }
    .signature-box { text-align: center; width: 250px; font-size: 11pt; }
    .signature-box p { margin: 3px 0; }
    .signature-space { height: 70px; }
    .signature-box p:last-child { font-weight: bold; text-decoration: underline; }

    /* ============ BKU ============ */
    .print-footer-table td { font-weight: bold !important; background: #f3f4f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .saldo-rincian td { font-weight: bold !important; background: #f3f4f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* ============ PAGE SIZE ============ */
    @page {
        size: A4 portrait;
        margin: 15mm 10mm 15mm 10mm;
    }
}

/* ============================================================
   PAGE HERO GENERIC — untuk semua sub menu anggaran
   ============================================================ */
.page-hero {
    padding: 22px 28px;
    border-radius: 14px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    color: white;
}
.page-hero.blue   { background: linear-gradient(135deg, #1d5d9b 0%, #12355b 100%); box-shadow: 0 6px 24px rgba(18, 53, 91, 0.15); }
.page-hero.red    { background: linear-gradient(135deg, #dc3545 0%, #a02c39 100%); box-shadow: 0 6px 24px rgba(220, 53, 69, 0.20); }
.page-hero.orange { background: linear-gradient(135deg, #f39c12 0%, #d97706 100%); box-shadow: 0 6px 24px rgba(243, 156, 18, 0.25); }
.page-hero.green  { background: linear-gradient(135deg, #198754 0%, #146c43 100%); box-shadow: 0 6px 24px rgba(25, 135, 84, 0.20); }

.page-hero .hero-label { font-size: 13px; opacity: 0.9; letter-spacing: 0.5px; margin-bottom: 6px; text-transform: uppercase; }
.page-hero .hero-value { font-size: 30px; font-weight: bold; }
.page-hero .hero-sub { font-size: 12px; opacity: 0.85; margin-top: 6px; }
.page-hero .hero-icon {
    width: 60px; height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

/* ---------- Mini Stats (kartu-kartu kecil di bawah hero) ---------- */
.hero-mini-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 22px;
}
.hero-mini-card {
    background: white;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 4px 15px rgba(0,0,0,.04);
    border-left: 4px solid;
    transition: transform 0.15s;
}
.hero-mini-card:hover { transform: translateY(-2px); }
.hero-mini-card.green  { border-color: #22c55e; }
.hero-mini-card.red    { border-color: #dc3545; }
.hero-mini-card.blue   { border-color: #1d5d9b; }
.hero-mini-card.orange { border-color: #f39c12; }

.hero-mini-card .hmc-label {
    font-size: 11px; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    font-weight: bold; margin-bottom: 6px;
}
.hero-mini-card .hmc-value { font-size: 18px; font-weight: bold; }
.hero-mini-card.green  .hmc-value { color: #198754; }
.hero-mini-card.red    .hmc-value { color: #dc3545; }
.hero-mini-card.blue   .hmc-value { color: #1d5d9b; }
.hero-mini-card.orange .hmc-value { color: #f39c12; }
.hero-mini-card .hmc-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- Sumber Dana Collapsible (Rencana Anggaran Admin) ---------- */
.sumber-dana-collapse {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,.04);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.sumber-dana-collapse .sdc-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #f8fafc;
    transition: background 0.15s;
    user-select: none;
}
.sumber-dana-collapse .sdc-header:hover { background: #f1f5f9; }
.sumber-dana-collapse .sdc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    color: var(--primary);
    font-size: 14px;
}
.sumber-dana-collapse .sdc-header-left i.sdc-chevron {
    transition: transform 0.25s;
    font-size: 12px;
    color: var(--primary2);
}
.sumber-dana-collapse.open .sdc-header-left i.sdc-chevron {
    transform: rotate(180deg);
}
.sumber-dana-collapse .sdc-badge-count {
    background: var(--primary2);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}
.sumber-dana-collapse .sdc-header-hint {
    font-size: 11px;
    color: var(--muted);
    font-style: italic;
}
.sumber-dana-collapse .sdc-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.sumber-dana-collapse.open .sdc-body {
    max-height: 800px;
}
.sumber-dana-collapse .sdc-body-inner {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    border-top: 1px solid #e2e8f0;
}
.sumber-dana-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    border-left: 4px solid var(--primary2);
    transition: transform 0.15s;
}
.sumber-dana-item:hover { transform: translateY(-2px); }
.sumber-dana-item .sd-name {
    font-size: 11px;
    color: var(--muted);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.sumber-dana-item .sd-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary);
}
.sumber-dana-item .sd-count {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}
.sumber-dana-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 13px;
}

/* ============================================================
   PEMINDAHAN KAS — Widget, Modal, Arah Pilihan
   ============================================================ */

.pindah-kategori-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.pindah-kategori-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0,0,0,.05);
    border-left: 5px solid #1d5d9b;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}
.pindah-kategori-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.09); }
.pindah-kategori-card.empty { border-left-color: #cbd5e1; cursor: default; opacity: 0.75; }

.pk-header {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eef2f6;
    background: #f8fafc;
}
.pk-title {
    font-weight: bold;
    font-size: 14px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.pk-total {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    background: white;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.pk-body {
    padding: 14px 16px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pk-balance {
    border-radius: 10px;
    padding: 12px 14px;
    position: relative;
}
.pk-balance.tunai {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
}
.pk-balance.transfer {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
}
.pk-balance .pk-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.pk-balance.tunai .pk-label { color: #166534; }
.pk-balance.transfer .pk-label { color: #1e40af; }
.pk-balance .pk-value {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 2px;
    word-break: break-word;
}
.pk-balance.tunai .pk-value { color: #15803d; }
.pk-balance.transfer .pk-value { color: #1d4ed8; }
.pk-balance .pk-mini {
    font-size: 10px;
    opacity: 0.75;
    margin-top: 3px;
}
.pk-balance.tunai .pk-mini { color: #166534; }
.pk-balance.transfer .pk-mini { color: #1e40af; }

/* Modal Pindah - Arah radio */
.pk-arah-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.pk-arah-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
    font-size: 12.5px;
    font-weight: 600;
    user-select: none;
}
.pk-arah-opt:hover { border-color: #cbd5e1; background: #f8fafc; }
.pk-arah-opt input[type="radio"] { display: none; }
.pk-arah-opt.selected {
    border-color: var(--primary2);
    background: #eff6ff;
    color: var(--primary2);
}
.pk-arah-opt .pk-arah-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.pk-arah-opt.tunai-ke-transfer .pk-arah-icon { background: #dcfce7; color: #16a34a; }
.pk-arah-opt.transfer-ke-tunai .pk-arah-icon { background: #dbeafe; color: #2563eb; }

/* Preview saldo di modal */
.pk-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.pk-preview-item {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
}
.pk-preview-item.tunai { background: #f0fdf4; }
.pk-preview-item.transfer { background: #eff6ff; }
.pk-preview-item .pkp-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.pk-preview-item.tunai .pkp-label { color: #166534; }
.pk-preview-item.transfer .pkp-label { color: #1e40af; }
.pk-preview-item .pkp-value {
    font-size: 14px;
    font-weight: bold;
}
.pk-preview-item.tunai .pkp-value { color: #15803d; }
.pk-preview-item.transfer .pkp-value { color: #1d4ed8; }

/* ============================================================
   LAPORAN — Widget Summary Cards (Pendapatan, Pengeluaran, Surplus)
   ============================================================ */
.lr-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.lr-summary-card {
    background: white;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 6px 22px rgba(0,0,0,.06);
    border-top: 5px solid;
    position: relative;
    transition: transform 0.15s;
}
.lr-summary-card:hover { transform: translateY(-2px); }
.lr-summary-card.income { border-color: #22c55e; }
.lr-summary-card.expense { border-color: #dc3545; }
.lr-summary-card.surplus { border-color: #1d5d9b; }
.lr-summary-card.surplus.negative { border-color: #f59e0b; }

.lr-summary-card .lsc-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.lr-summary-card.income .lsc-icon { background: #dcfce7; color: #15803d; }
.lr-summary-card.expense .lsc-icon { background: #fee2e2; color: #b91c1c; }
.lr-summary-card.surplus .lsc-icon { background: #dbeafe; color: #1d5d9b; }
.lr-summary-card.surplus.negative .lsc-icon { background: #fef3c7; color: #d97706; }

.lr-summary-card .lsc-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}
.lr-summary-card .lsc-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 14px;
    padding-right: 50px;
    word-break: break-word;
}
.lr-summary-card.income .lsc-value { color: #15803d; }
.lr-summary-card.expense .lsc-value { color: #b91c1c; }
.lr-summary-card.surplus .lsc-value { color: #1d5d9b; }
.lr-summary-card.surplus.negative .lsc-value { color: #d97706; }

.lr-summary-card .lsc-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
}
.lr-summary-card .lsc-bd-item {
    padding: 10px 12px;
    border-radius: 8px;
}
.lr-summary-card .lsc-bd-item.tunai { background: #f0fdf4; border: 1px solid #bbf7d0; }
.lr-summary-card .lsc-bd-item.transfer { background: #eff6ff; border: 1px solid #bfdbfe; }
.lr-summary-card .lsc-bd-label {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.lr-summary-card .lsc-bd-item.tunai .lsc-bd-label { color: #166534; }
.lr-summary-card .lsc-bd-item.transfer .lsc-bd-label { color: #1e40af; }
.lr-summary-card .lsc-bd-value {
    font-size: 13px;
    font-weight: bold;
    word-break: break-word;
}
.lr-summary-card .lsc-bd-item.tunai .lsc-bd-value { color: #15803d; }
.lr-summary-card .lsc-bd-item.transfer .lsc-bd-value { color: #1d4ed8; }

/* Table block — 3 tabel vertikal */
.lr-table-block {
    margin-bottom: 20px;
}
.lr-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.lr-table-header.income { border-bottom-color: #22c55e; }
.lr-table-header.expense { border-bottom-color: #dc3545; }
.lr-table-header.pindah { border-bottom-color: #f39c12; }

.lr-table-header h3 {
    margin: 0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lr-table-header.income h3 { color: #15803d; }
.lr-table-header.expense h3 { color: #b91c1c; }
.lr-table-header.pindah h3 { color: #d97706; }

.lr-table-header .lth-meta {
    font-size: 12px;
    color: var(--muted);
}

.lr-filter-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.lr-filter-row select,
.lr-filter-row input {
    padding: 6px 10px;
    border: 1px solid #dce3ea;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    background: white;
    transition: border-color 0.15s;
}
.lr-filter-row select:focus,
.lr-filter-row input:focus { border-color: var(--primary2); }
.lr-filter-row input { min-width: 140px; }

/* ============================================================
   KATEGORI BELANJA COLLAPSIBLE WIDGET (Rencana Anggaran & Pengeluaran)
   ============================================================ */
.kategori-belum-collapse {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,.04);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.kategori-belum-collapse .sdc-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #f8fafc;
    transition: background 0.15s;
    user-select: none;
}
.kategori-belum-collapse .sdc-header:hover { background: #f1f5f9; }
.kategori-belum-collapse .sdc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    color: var(--primary);
    font-size: 14px;
}
.kategori-belum-collapse .sdc-header-left i.sdc-chevron {
    transition: transform 0.25s;
    font-size: 12px;
    color: var(--primary2);
}
.kategori-belum-collapse.open .sdc-header-left i.sdc-chevron {
    transform: rotate(180deg);
}
.kategori-belum-collapse .sdc-badge-count {
    background: var(--primary2);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}
.kategori-belum-collapse .sdc-header-hint {
    font-size: 11px;
    color: var(--muted);
    font-style: italic;
}
.kategori-belum-collapse .sdc-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.kategori-belum-collapse.open .sdc-body {
    max-height: 1200px;
}
.kategori-belum-collapse .sdc-body-inner {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    border-top: 1px solid #e2e8f0;
}
.kategori-belum-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    border-left: 4px solid var(--primary2);
    transition: transform 0.15s;
}
.kategori-belum-item:hover { transform: translateY(-2px); }
.kategori-belum-item .kb-name {
    font-size: 11px;
    color: var(--muted);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.kategori-belum-item .kb-value {
    font-size: 15px;
    font-weight: bold;
    color: var(--primary);
    word-break: break-word;
}
.kategori-belum-item .kb-count {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

/* Warna variasi untuk kategori pengeluaran */
.kategori-belum-collapse.expense-style .kategori-belum-item {
    border-left-color: #dc3545;
}
.kategori-belum-collapse.expense-style .kategori-belum-item .kb-value {
    color: #b91c1c;
}
.kategori-belum-collapse.expense-style .sdc-badge-count {
    background: #dc3545;
}

   /* ==========================================
   PRINT-ONLY BLOCK — Format FORMAL (HANYA saat print)
   ========================================== */
/* ==========================================
   PRINT-ONLY BLOCK — Format FORMAL (HANYA saat print)
   ========================================== */
@media print {
    .print-only-block {
        padding: 0 !important;
    }

    /* RESET TABLE-LAYOUT agar kolom tidak dipaksa 6% / 13% */
    .print-only-block table {
        table-layout: auto !important;
        width: 100% !important;
        border-collapse: collapse !important;
        border: none !important;
        margin-bottom: 10px !important;
    }
    
    /* Reset semua border, background, padding */
    .print-only-block table,
    .print-only-block table th,
    .print-only-block table td {
        border: none !important;
        background: transparent !important;
        color: #000 !important;
        padding: 4px 0 !important;
        font-size: 11pt !important;
        box-shadow: none !important;
        vertical-align: top !important;
    }
    
    /* RESET kolom 1 & 2 yang dipaksa 6% / 13% oleh CSS global */
    .print-only-block table td:nth-child(1),
    .print-only-block table th:nth-child(1) {
        width: auto !important;
        text-align: left !important;
    }
    .print-only-block table td:nth-child(2),
    .print-only-block table th:nth-child(2) {
        width: 180px !important;
        text-align: right !important;
        white-space: nowrap !important;
    }
    
    /* Baris total pakai border-top saja */
    .print-only-block table tr[style*="border-top"] td {
        border-top: 1px solid #000 !important;
        padding-top: 8px !important;
    }
    .print-only-block table tr[style*="border-bottom"] td {
        border-bottom: 1px solid #000 !important;
        padding-bottom: 8px !important;
    }
    
    /* Pastikan tanda tangan tidak ke-page-break */
    .print-only-block [style*="margin-top:55px"],
    .print-only-block [style*="page-break-inside"] {
        page-break-inside: avoid !important;
    }

    /* Hide elemen layar yang mungkin masih lolos saat print */
    .info-callout,
    .year-banner,
    .hero-mini-stats,
    .stat-top-row,
    .lr-summary-grid,
    .lr-table-block,
    .box.no-print,
    .filter-box {
        display: none !important;
    }
}/* ============================================================
   DRAG & DROP KATEGORI
   ============================================================ */
.kat-row {
    cursor: grab;
    position: relative;
    padding-left: 36px !important;
    transition: all 0.15s;
}
.kat-row:active { cursor: grabbing; }
.kat-row.dragging {
    opacity: 0.4;
    background: #e8f1ff !important;
    border-color: #1d5d9b !important;
}
.kat-row.drag-over {
    border-top: 3px solid #1d5d9b !important;
    background: #f0f7ff !important;
}

.kat-drag-handle {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #cbd5e1;
    font-size: 14px;
    cursor: grab;
    transition: color 0.15s;
}
.kat-row:hover .kat-drag-handle { color: #1d5d9b; }
.kat-row:active .kat-drag-handle { cursor: grabbing; }

.kat-drag-hint {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    padding: 8px 0;
    font-style: italic;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px dashed #cbd5e1;
}

/* ============================================================
   DRAG & DROP KATEGORI
   ============================================================ */
.kat-row {
    cursor: grab;
    position: relative;
    padding-left: 36px !important;
    transition: all 0.15s;
}
.kat-row:active { cursor: grabbing; }
.kat-row.dragging {
    opacity: 0.4;
    background: #e8f1ff !important;
    border-color: #1d5d9b !important;
}
.kat-row.drag-over {
    border-top: 3px solid #1d5d9b !important;
    background: #f0f7ff !important;
}

.kat-drag-handle {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #cbd5e1;
    font-size: 14px;
    cursor: grab;
    transition: color 0.15s;
}
.kat-row:hover .kat-drag-handle { color: #1d5d9b; }
.kat-row:active .kat-drag-handle { cursor: grabbing; }

.kat-drag-hint {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    padding: 8px 0;
    font-style: italic;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px dashed #cbd5e1;
}

/* ============================================================
   WIDGET GURU — HORIZONTAL SCROLL + SEARCH
   ============================================================ */
.guru-rab-scroll-wrapper {
    position: relative;
    margin-bottom: 22px;
}

.guru-rab-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 4px 4px 16px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Scrollbar tipis & cantik */
.guru-rab-scroll::-webkit-scrollbar {
    height: 8px;
}
.guru-rab-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.guru-rab-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s;
}
.guru-rab-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Setiap widget fixed width */
.guru-rab-scroll .guru-rab-widget {
    flex: 0 0 320px;
    min-width: 320px;
    max-width: 320px;
}

/* Tombol scroll kiri/kanan */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    cursor: pointer;
    font-size: 14px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.scroll-btn:hover:not(:disabled) {
    background: var(--primary2);
    color: white;
    border-color: var(--primary2);
    box-shadow: 0 6px 18px rgba(29,93,155,0.3);
}
.scroll-btn:active:not(:disabled) {
    transform: translateY(-50%) scale(0.95);
}
.scroll-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.scroll-btn.left { left: -12px; }
.scroll-btn.right { right: -12px; }

/* Responsive: di layar kecil, tombol scroll tetap ada */
@media (max-width: 768px) {
    .scroll-btn { width: 34px; height: 34px; font-size: 12px; }
    .scroll-btn.left { left: -8px; }
    .scroll-btn.right { right: -8px; }
    .guru-rab-scroll .guru-rab-widget {
        flex: 0 0 280px;
        min-width: 280px;
        max-width: 280px;
    }
}

/* ============================================================
   BKU — Khusus PORTRAIT: angka jangan wrap ke baris baru
   Landscape dibiarkan seperti semula
   ============================================================ */
@media print and (orientation: portrait) {
    .bku-table {
        table-layout: fixed !important;
        font-size: 8pt !important;
    }
    
    .bku-table th {
        font-size: 8pt !important;
        padding: 4px 3px !important;
    }
    
    .bku-table td {
        font-size: 8pt !important;
        padding: 4px 3px !important;
        white-space: nowrap !important;         /* ⬅️ Kunci utama */
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Kolom Uraian boleh wrap */
    .bku-table td:nth-child(3) {
        white-space: normal !important;
        word-break: break-word;
    }
    
    /* Atur lebar kolom biar proporsional */
    .bku-table th:nth-child(1) { width: 10% !important; }  /* Tanggal */
    .bku-table th:nth-child(2) { width: 9% !important;  }  /* No. Bukti */
    .bku-table th:nth-child(3) { width: auto !important; } /* Uraian */
    .bku-table th:nth-child(4) { width: 14% !important; }  /* Penerimaan */
    .bku-table th:nth-child(5) { width: 14% !important; }  /* Pengeluaran */
    .bku-table th:nth-child(6) { width: 14% !important; }  /* Saldo */
    
    /* Padding kanan angka supaya tidak mepet garis */
    .bku-table td:nth-child(4),
    .bku-table td:nth-child(5),
    .bku-table td:nth-child(6) {
        padding-right: 6px !important;
        text-align: right;
    }
}

/* ============================================================
   DEMO BADGE DI SIDEBAR
   ============================================================ */
.demo-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #dc3545, #a02c39);
    color: #fff;
    border-radius: 20px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4);
    animation: pulseDemo 2s ease-in-out infinite;
}

.demo-badge i {
    animation: blinkDemo 1.2s ease-in-out infinite;
}

@keyframes pulseDemo {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.05); opacity: 0.9; }
}

@keyframes blinkDemo {
    0%, 100% { opacity: 1;   }
    50%      { opacity: 0.3; }
}

/* ============================================================
   OVERLAY UNTUK SIDEBAR MOBILE
   ============================================================ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;              /* ⬅️ di bawah sidebar (1000) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Hanya aktif di mobile */
@media (min-width: 901px) {
    .sidebar-overlay { display: none !important; }
}

/* Sembunyikan saat print */
@media print {
    .sidebar-overlay { display: none !important; }
}