/* --- PILIHAN TEMA WARNA (THEME SWITCHER) --- */
:root {
    --bg-main: #f4f6f9;
    --sidebar-bg: #1b4332;
    --header-bg: #ffffff;
    --text-color: #333333;
    --card-bg: #ffffff;
    --primary-color: #2b9348;
    --border-color: #e2e8f0;
    --table-hover: #f1f5f9;
    --th-bg: #f8f9fa;
    --th-color: #333333;
}

body.theme-dark {
    --bg-main: #121212;
    --sidebar-bg: #1e1e1e;
    --header-bg: #1f1f1f;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --primary-color: #40916c;
    --border-color: #333333;
    --table-hover: #2a2a2a;
    --th-bg: #181818;
    --th-color: #f1f5f9;
}

body.theme-ocean {
    --bg-main: #f0f4f8;
    --sidebar-bg: #03045e;
    --header-bg: #ffffff;
    --text-color: #1d3557;
    --card-bg: #ffffff;
    --primary-color: #0077b6;
    --border-color: #90e0ef;
    --table-hover: #e0f2fe;
    --th-bg: #bae6fd;
    --th-color: #03045e;
}

body.theme-sunset {
    --bg-main: #fffaf0;
    --sidebar-bg: #780000;
    --header-bg: #ffffff;
    --text-color: #2b2d42;
    --card-bg: #ffffff;
    --primary-color: #d62828;
    --border-color: #f77f00;
    --table-hover: #ffedd5;
    --th-bg: #fed7aa;
    --th-color: #780000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-color);
    display: flex;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Halaman Login Dinamis & Estetik */
#pageLoginContainer {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background: linear-gradient(135deg, #f77f00 0%, #fcbf49 40%, #2b9348 100%);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; overflow: hidden;
}

.login-bg-animation {
    position: absolute; width: 100%; height: 100%; top: 0; left: 0; overflow: hidden; z-index: 1;
}

.login-bg-animation span {
    position: absolute; display: block; width: 20px; height: 20px;
    background: rgba(255, 255, 255, 0.25);
    animation: moveMorningBubbles 12s linear infinite;
    bottom: -150px; border-radius: 50%;
}

.login-bg-animation span:nth-child(1) { left: 12%; width: 70px; height: 70px; animation-duration: 10s; }
.login-bg-animation span:nth-child(2) { left: 30%; width: 40px; height: 40px; animation-duration: 15s; animation-delay: 2s; }
.login-bg-animation span:nth-child(3) { left: 55%; width: 90px; height: 90px; animation-duration: 8s; animation-delay: 4s; }
.login-bg-animation span:nth-child(4) { left: 75%; width: 55px; height: 55px; animation-duration: 14s; animation-delay: 1s; }
.login-bg-animation span:nth-child(5) { left: 88%; width: 65px; height: 65px; animation-duration: 18s; animation-delay: 3s; }

@keyframes moveMorningBubbles {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    50% { opacity: 0.9; }
    100% { transform: translateY(-1000px) rotate(720deg); opacity: 0; }
}

.login-card-wrapper {
    background: rgba(255, 255, 255, 0.96);
    padding: 40px 35px; border-radius: 16px;
    width: 100%; max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: fadeInUp 0.6s ease-out forwards;
    position: relative; z-index: 2;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header-brand { text-align: center; margin-bottom: 25px; }
.login-logo-icon {
    font-size: 40px; margin-bottom: 8px; display: inline-block;
    background: #fff8e8; width: 70px; height: 70px; line-height: 70px;
    border-radius: 50%; box-shadow: 0 4px 15px rgba(247, 127, 0, 0.25);
}
.login-header-brand h2 { margin: 0; font-size: 26px; color: #1b4332; font-weight: 700; }
.login-header-brand p { margin: 5px 0 0 0; font-size: 13px; color: #6c757d; }

.login-form-group { margin-bottom: 18px; text-align: left; }
.login-form-group label { display: block; font-size: 13px; font-weight: 600; color: #2d3748; margin-bottom: 6px; }

.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon .icon { position: absolute; left: 12px; font-size: 16px; color: #666; }
.input-with-icon input {
    width: 100%; padding: 12px 12px 12px 40px;
    border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px;
    outline: none; background: #f8fafc; transition: all 0.3s ease;
}
.input-with-icon input:focus { border-color: #f77f00; background: #ffffff; box-shadow: 0 0 0 4px rgba(247, 127, 0, 0.15); }

.btn-login-action {
    width: 100%; padding: 13px; background: linear-gradient(135deg, #f77f00 0%, #d62828 100%);
    color: white; border: none; border-radius: 8px; font-size: 15px; font-weight: 600;
    cursor: pointer; box-shadow: 0 4px 15px rgba(247, 127, 0, 0.35); transition: all 0.3s ease; margin-top: 10px;
}
.btn-login-action:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(247, 127, 0, 0.45); }
.login-footer-info { text-align: center; margin-top: 22px; border-top: 1px solid #edf2f7; padding-top: 12px; }
.login-footer-info p { margin: 0; font-size: 11px; color: #a0aec0; }

/* Layout Utama */
#appContainer { display: none; width: 100%; height: 100%; overflow: hidden; }

/* Sidebar Responsif & Modern */
.sidebar {
    width: 260px; height: 100vh; background-color: var(--sidebar-bg); color: white;
    display: flex; flex-direction: column; flex-shrink: 0; transition: width 0.3s ease-in-out, background-color 0.3s ease; position: relative; z-index: 100;
}
.sidebar-header { padding: 20px; background-color: rgba(0, 0, 0, 0.15); text-align: center; }
.sidebar-menu { list-style: none; padding: 10px 0; flex: 1; overflow-y: auto; overflow-x: hidden; }
.sidebar-menu li {
    padding: 14px 20px; cursor: pointer; transition: all 0.2s ease-in-out;
    font-size: 14px; display: flex; align-items: center; gap: 12px; white-space: nowrap; margin: 4px 10px; border-radius: 8px;
}
.sidebar-menu li:hover, .sidebar-menu li.active { background-color: var(--primary-color); transform: translateX(4px); }
.sidebar-menu li i { font-size: 16px; width: 24px; text-align: center; }

/* Sidebar Collapsed Mode */
.sidebar-collapsed .sidebar { width: 75px !important; }
.sidebar-collapsed .sidebar-header .sidebar-brand-text { display: none !important; }
.sidebar-collapsed .sidebar-header { justify-content: center !important; padding: 20px 10px !important; }
.sidebar-collapsed .sidebar-menu li { justify-content: center !important; padding: 16px 0 !important; gap: 0 !important; }
.sidebar-collapsed .sidebar-menu li .menu-text { display: none !important; }
.sidebar-collapsed .sidebar-menu li i { font-size: 18px; }

/* Main Content Area */
.main-content { flex: 1; display: flex; flex-direction: column; overflow-x: auto; transition: all 0.3s ease-in-out; }
.header {
    background: var(--header-bg); padding: 15px 30px; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center; min-width: 700px;
    color: var(--text-color); transition: background-color 0.3s ease, border-color 0.3s ease;
}
.header h2 { font-size: 20px; color: var(--text-color); }
.content-body { padding: 30px; overflow-y: auto; flex: 1; min-width: 700px; }
.page-section { display: none; }
.page-section.active { display: block; }

/* Dashboard Cards & Widgets */
.welcome-banner {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white; padding: 25px 30px; border-radius: 16px; margin-bottom: 25px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px;
}
.welcome-banner h3 { font-size: 22px; margin-bottom: 5px; }
.welcome-banner p { font-size: 14px; opacity: 0.9; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 25px; }
.card {
    background: var(--card-bg); padding: 20px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color); border-left: 5px solid var(--primary-color);
    display: flex; justify-content: space-between; align-items: center; transition: all 0.3s ease;
    color: var(--text-color);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 25px -5px rgba(16, 185, 129, 0.15); }
.card-info h4 { font-size: 13px; color: #888; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.card-info p { font-size: 22px; font-weight: bold; color: var(--text-color); }
.card-icon { width: 45px; height: 45px; border-radius: 10px; background: rgba(43, 147, 72, 0.1); color: var(--primary-color); display: flex; align-items: center; justify-content: center; font-size: 22px; }

.dashboard-row { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 25px; }
@media (max-width: 1024px) { .dashboard-row { grid-template-columns: 1fr; } }

.dash-box { background: var(--card-bg); padding: 25px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); color: var(--text-color); border: 1px solid var(--border-color); }
.dash-box h4 { font-size: 16px; color: var(--primary-color); margin-bottom: 15px; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; display: flex; align-items: center; gap: 8px; }

.quick-actions-grid { display: flex; flex-direction: column; gap: 12px; }
.quick-btn {
    background: var(--card-bg); border: 1px solid var(--border-color); padding: 12px 15px; border-radius: 12px;
    text-align: left; cursor: pointer; font-weight: 600; color: var(--text-color); display: flex; align-items: center; gap: 12px; transition: all 0.2s;
}
.quick-btn span { width: 32px; height: 32px; border-radius: 8px; background: rgba(43, 147, 72, 0.1); color: var(--primary-color); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.quick-btn:hover { background: var(--primary-color); color: white; border-color: var(--primary-color); transform: translateX(5px); }

/* --- STYLING MASTER-DETAIL KARTU LEMBAGA DESA --- */
.lembaga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.lembaga-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lembaga-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px -5px rgba(43, 147, 72, 0.15);
    border-color: var(--primary-color, #2b9348);
}

.lembaga-card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 18px;
}

.lembaga-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(43, 147, 72, 0.1);
    color: var(--primary-color, #2b9348);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.lembaga-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color, #333);
    margin-bottom: 4px;
    line-height: 1.4;
}

.lembaga-info p {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.lembaga-card-footer {
    border-top: 1px solid var(--border-color, #e2e8f0);
    padding-top: 15px;
    display: flex;
    justify-content: flex-end;
}

/* Tombol & Aksi */
.btn {
    padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer;
    font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: all 0.25s ease-in-out;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1); }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { opacity: 0.9; }
.btn-success { background-color: #2b9348; color: white; }
.btn-success:hover { background-color: #195c30; }
.btn-warning { background-color: #ffb703; color: #333; }
.btn-warning:hover { background-color: #fb8500; color: white; }
.btn-danger { background-color: #d90429; color: white; }
.btn-danger:hover { background-color: #8d0801; }

.action-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 10px; flex-wrap: wrap; }

/* Filter Panel */
.filter-panel { background: var(--card-bg); padding: 20px; border-radius: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 20px; border: 1px solid var(--border-color); color: var(--text-color); }
.filter-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.filter-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-color); margin-bottom: 4px; opacity: 0.8; }
.filter-group input, .filter-group select { width: 100%; padding: 7px 10px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 13px; background: var(--card-bg); color: var(--text-color); }

/* Tabel Responsif Modern */
.table-container { background: var(--card-bg); border-radius: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); overflow-x: auto; width: 100%; border: 1px solid var(--border-color); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; min-width: 1000px; color: var(--text-color); }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
th { background-color: var(--th-bg); color: var(--th-color); font-weight: 600; }
tr { transition: background-color 0.15s ease-in-out; }
tr:hover { background-color: var(--table-hover) !important; }

.table-footer {
    display: flex; justify-content: space-between; align-items: center; padding: 15px 20px;
    background: var(--card-bg); border-top: 1px solid var(--border-color); border-radius: 0 0 12px 12px; font-size: 13px; color: var(--text-color); flex-wrap: wrap; gap: 10px;
}
.pagination-controls { display: flex; align-items: center; gap: 10px; }

/* Form & Modals */
.form-container-box { background: var(--card-bg); padding: 25px; border-radius: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 20px; border: 1px solid var(--border-color); color: var(--text-color); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin-bottom: 15px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text-color); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 14px; background: var(--card-bg); color: var(--text-color); }

.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper input { width: 100%; padding-right: 40px; }
.toggle-password { position: absolute; right: 12px; cursor: pointer; font-size: 16px; color: #666; user-select: none; }

/* Tab Arsip */
.tab-buttons { display: flex; gap: 10px; margin-bottom: 15px; }
.tab-btn { padding: 8px 16px; border: none; background: #e2e8f0; color: #333; font-weight: 600; border-radius: 8px; cursor: pointer; }
.tab-btn.active { background: var(--primary-color); color: white; }
.archive-section { display: none; }
.archive-section.active { display: block; }

/* Pratinjau Surat */
.preview-surat {
    background: white; margin: 0 auto; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: #000; width: 210mm; min-height: 297mm; padding: 20mm; position: relative; font-size: 12pt; line-height: 1.65;
}
.kop-surat { display: flex; align-items: center; padding-bottom: 12px; margin-bottom: 20px; gap: 15px; width: 100%; border-bottom: 3px double #000; }
.kop-logo { width: 75px; height: 75px; object-fit: contain; }
.kop-text { flex: 1; text-align: center; }

/* Sembunyikan container cetak di layar normal */
#hiddenPrintContainer {
    display: none;
}

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); justify-content: center; align-items: center; z-index: 1000; }
.modal.active { display: flex; }
.modal-content { background: var(--card-bg); color: var(--text-color); padding: 30px; border-radius: 12px; width: 700px; max-width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 25px rgba(0,0,0,0.15); border: 1px solid var(--border-color); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Media Print */
@media print {
    @page {
        size: A4 portrait;
        margin: 15mm;
    }

    html, body {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #ffffff !important;
        color: #000000 !important;
    }

    #appContainer,
    #pageLoginContainer,
    .sidebar,
    .header,
    .modal,
    .custom-alert-overlay,
    .no-print {
        display: none !important;
    }

    body * {
        visibility: hidden !important;
    }

    #hiddenPrintContainer,
    #hiddenPrintContainer * {
        visibility: visible !important;
    }

    #hiddenPrintContainer {
        position: static !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        height: auto !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 12pt !important;
        line-height: 1.6 !important;
        color: #000000 !important;
        background: #ffffff !important;
        transform: none !important;
        zoom: 1 !important;
    }

    #hiddenPrintContainer > div,
    #hiddenPrintContainer .preview-surat {
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    #hiddenPrintContainer table {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 12pt !important;
        line-height: 1.5 !important;
    }

    #hiddenPrintContainer p,
    #hiddenPrintContainer div,
    #hiddenPrintContainer span,
    #hiddenPrintContainer td,
    #hiddenPrintContainer th {
        font-size: inherit;
        line-height: inherit;
    }
}

@media (max-width: 768px) {
    .header { padding: 10px 15px; min-width: 100%; }
    .content-body { padding: 15px; min-width: 100%; }
    .card-grid { grid-template-columns: 1fr; }
}

/* --- TEMA: EMERALD (HIJAU BERLIAN) --- */
body.theme-emerald {
    --primary-color: #059669;
    --primary-hover: #047857;
    --bg-main: #ecfdf5;
    --card-bg: #ffffff;
    --text-color: #064e3b;
    --sidebar-bg: #065f46;
    background-color: var(--bg-main);
    color: var(--text-color);
}

/* --- TEMA: ROYAL PURPLE (UNGU MEWAH) --- */
body.theme-purple {
    --primary-color: #7c3aed;
    --primary-hover: #6d28d9;
    --bg-main: #f5f3ff;
    --card-bg: #ffffff;
    --text-color: #3b0764;
    --sidebar-bg: #581c87;
    background-color: var(--bg-main);
    color: var(--text-color);
}

/* --- TEMA: MIDNIGHT BLUE (BIRU MALAM) --- */
body.theme-midnight {
    --primary-color: #38bdf8;
    --primary-hover: #0ea5e9;
    --bg-main: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --sidebar-bg: #090d16;
    background-color: var(--bg-main);
    color: var(--text-color);
}

/* --- TEMA: TRANSPARAN (GLASSMORPHISM) --- */
body.theme-transparent {
    --primary-color: #0284c7;
    --primary-hover: #0369a1;
    --bg-main: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.75);
    --text-color: #0f172a;
    --sidebar-bg: rgba(15, 23, 42, 0.85);
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    background-attachment: fixed;
    color: var(--text-color);
}

body.theme-transparent .card,
body.theme-transparent .dash-box,
body.theme-transparent .form-container-box,
body.theme-transparent .filter-panel,
body.theme-transparent .table-container,
body.theme-transparent .modal-content {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

body.theme-transparent .header {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
}

/* --- Styling Khusus Keterangan Surat & Checkbox Sejajar --- */
.keterangan-surat-box {
    background: var(--bg-main, #f8fafc);
    border: 1px solid var(--border-color, #cbd5e1);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.keterangan-surat-box textarea {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #cbd5e1);
    margin-top: 6px;
    margin-bottom: 12px;
}

.keterangan-checkbox-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color, #cbd5e1);
}

.keterangan-checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color, #2b9348);
    cursor: pointer;
    margin: 0;
}

/* ==========================================
   STYLING SUB-MENU SIDEBAR (ACCORDION)
   ========================================== */
.sidebar-menu li.has-submenu {
    justify-content: space-between;
}

.sidebar-menu li .submenu-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.sidebar-menu li.submenu-open .submenu-arrow {
    transform: rotate(90deg);
}

.sidebar-submenu {
    list-style: none;
    background-color: rgba(0, 0, 0, 0.22);
    margin: 0 10px 6px 10px;
    border-radius: 8px;
    padding: 4px 0;
    display: none;
    overflow: hidden;
}

.sidebar-submenu.open {
    display: block;
    animation: fadeInSubmenu 0.25s ease-out;
}

@keyframes fadeInSubmenu {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar-submenu li {
    padding: 10px 15px 10px 38px !important;
    font-size: 13px !important;
    margin: 2px 6px !important;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-submenu li:hover,
.sidebar-submenu li.active {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    transform: translateX(3px);
}

/* Penyesuaian saat sidebar diperkecil (collapsed) */
.sidebar-collapsed .sidebar-submenu,
.sidebar-collapsed .submenu-arrow {
    display: none !important;
}

/* ==========================================
   PERCANTIK TAMPILAN FILTER MODERN
   ========================================== */
.filter-panel .filter-group input,
.filter-panel .filter-group select {
    height: 38px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.filter-panel .filter-group input:focus,
.filter-panel .filter-group select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(43, 147, 72, 0.15);
    outline: none;
}

/* ==========================================
   MODAL NOTIFIKASI KUSTOM DI TENGAH LAYAR
   ========================================== */
.custom-alert-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    animation: fadeInOverlay 0.2s ease-in-out;
}

.custom-alert-overlay.active {
    display: flex;
}

.custom-alert-box {
    background: var(--card-bg, #ffffff);
    color: var(--text-color, #212529);
    border: 1px solid var(--border-color, #e2e8f0);
    width: 90%;
    max-width: 390px;
    padding: 30px 25px 25px 25px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    transform: scale(0.75);
    animation: scaleUpModal 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.custom-alert-icon {
    font-size: 50px;
    color: #f77f00;
    margin-bottom: 14px;
}

.custom-alert-box h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: var(--text-color, #212529);
    font-weight: 700;
}

.custom-alert-box p {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: var(--text-color, #555555);
    opacity: 0.85;
    line-height: 1.5;
    word-break: break-word;
}

.custom-alert-box button {
    width: 100%;
    padding: 11px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background-color: var(--primary-color, #2b9348);
    color: #ffffff;
    justify-content: center;
    transition: opacity 0.2s, transform 0.1s;
}

.custom-alert-box button:hover {
    opacity: 0.9;
}

.custom-alert-box button:active {
    transform: scale(0.98);
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUpModal {
    to { transform: scale(1); }
}

/* Styling Tambahan untuk Modal Konfirmasi */
.custom-confirm-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.custom-confirm-actions button {
    flex: 1;
    padding: 11px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    justify-content: center;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-confirm-cancel {
    background-color: #e2e8f0;
    color: #334155;
}

.btn-confirm-cancel:hover {
    background-color: #cbd5e1;
}

.btn-confirm-yes {
    background-color: #d90429;
    color: #ffffff;
}

.btn-confirm-yes:hover {
    background-color: #b00321;
}