/* ============================================================
   SIAR GBKP - STYLE UTAMA
   Versi: 2.6 - Integrasi No. KK Badge
   ============================================================
   Struktur:
   1. Reset & Base
   2. Header
   3. Main Content
   4. Form & Card
   5. Radio & Checkbox
   6. Bottom Nav
   7. Form Tabs
   8. Floating Nav (FAB: X, Prev, Next, Save)
   9. Data Card & Table
   10. Modal
   11. Toast
   12. Info Badge
   13. Mode Verifikasi
   14. Side Menu
   15. Beranda (Hero, Shortcut)
   16. View Toggle
   17. Admin Page
   18. Utility: Alert + Theme Toggle
   19. Dashboard Toolbar + Action Bar
   20. Accessibility
   21. Dark Mode (auto + manual)
   22. Statistik Page
   23. Modal: Alasan Hapus + Password
   24. Form Modal Layer (Modal + Fullpage)
   25. Responsive: Mobile, Tablet, Desktop, Large Desktop
   ============================================================ */

/* ============================================================
   1. RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

:root {
    --primary: #2d6a4f;
    --primary-light: #409f7a;
    --primary-gradient: linear-gradient(135deg, #1b4332, #2d6a4f, #409f7a);
    --bg: #f0f4f0;
    --white: #ffffff;
    --text: #1a2e2a;
    --gray: #6b7a76;
    --border: #d0ddd0;
    --shadow: 0 4px 20px rgba(45, 106, 79, 0.15);
    --radius: 16px;

    /* Heights */
    --header-height: 65px;
    --nav-height: 70px;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + 20px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes slideUpModal {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }
}

@keyframes bounce-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ============================================================
   2. HEADER
   ============================================================ */
.header {
    background: var(--white);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1200;
}
.header-center h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}
.header-left,
.header-right {
    font-size: 20px;
    color: var(--primary);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hamburger-btn,
.header-icon-btn,
.theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    text-decoration: none;
    padding: 0;
}
.hamburger-btn:hover,
.header-icon-btn:hover,
.theme-toggle-btn:hover {
    background: rgba(45, 106, 79, 0.1);
}

/* ============================================================
   3. MAIN CONTENT
   ============================================================ */
.main-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}
.app-view {
    display: none;
    padding: 16px;
    animation: fadeIn 0.4s ease;
}
.app-view.active {
    display: block;
}

/* ============================================================
   4. FORM & CARD
   ============================================================ */
.form-container,
.card-info {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.data-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.form-group label {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    flex-wrap: wrap;
}
.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    width: 100%;
    background: var(--bg);
    color: var(--text);
    transition: all 0.3s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
}
.form-group small {
    line-height: 1.4;
    display: block;
    margin-top: 2px;
}
.form-group input[readonly] {
    background: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    font-style: italic;
}

.submit-btn {
    background: var(--primary-gradient);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}
.submit-btn:hover {
    opacity: 0.9;
}

/* ============================================================
   5. RADIO & CHECKBOX
   ============================================================ */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    font-size: 14px;
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    border: 1px solid transparent;
    transition: 0.3s;
    min-height: 44px;
}
.radio-item:has(input:checked) {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary);
    font-weight: bold;
}
.radio-item input {
    width: auto;
    margin: 0;
    accent-color: var(--primary);
}

.checkbox-formal {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #e9ecef;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: 0.3s;
}
.checkbox-formal:hover {
    background: #e2e6ea;
}
.checkbox-formal input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary);
}
.checkbox-formal span {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    font-weight: 500;
}

.guide-list {
    list-style: none;
    padding: 0;
    text-align: left;
}
.guide-list li {
    background: var(--bg);
    margin-bottom: 10px;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

/* ============================================================
   6. BOTTOM NAV (Mobile + Desktop)
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--nav-height);
    border-top: 1px solid var(--border);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 -4px 12px rgba(45, 106, 79, 0.06);
}
.bottom-nav.nav-hidden {
    transform: translateY(100%);
}
.nav-item {
    color: var(--gray);
    text-decoration: none;
    font-size: 22px;
    transition: 0.3s;
    width: 20%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.nav-item.active {
    color: var(--primary);
}
.center-fab {
    position: relative;
    top: -22px;
}
.fab-button {
    background: var(--primary-gradient);
    color: white;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 20px rgba(45, 106, 79, 0.45);
    transition: transform 0.3s;
    border: 4px solid var(--bg);
}
.center-fab.active .fab-button {
    transform: scale(1.1);
}

/* ============================================================
   7. FORM TABS
   ============================================================ */
.form-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: var(--bg);
    border-radius: 12px;
    padding: 5px;
}
.form-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--gray);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}
.form-tab i {
    margin-right: 6px;
}
.form-tab:hover {
    background: rgba(45, 106, 79, 0.1);
    color: var(--primary);
}
.form-tab.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 10px rgba(45, 106, 79, 0.3);
}
.form-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}
.form-tab-content.active {
    display: block;
}

/* ============================================================
   8. FLOATING NAV (FAB: X, Prev, Next, Save)
   ============================================================ */
.form-nav-buttons {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000000;
    align-items: center;
}

.fab-nav {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(45, 106, 79, 0.4);
    flex-shrink: 0;
}

.fab-next {
    background: linear-gradient(135deg, #1b4332, #2d6a4f);
}
.fab-prev {
    background: #6c757d;
}
.fab-save {
    background: linear-gradient(135deg, #1b4332, #2d6a4f);
    font-size: 24px;
}
.fab-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fab-close {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.5);
    flex-shrink: 0;
}
.fab-close:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(220, 53, 69, 0.6);
}
.fab-close:active {
    transform: scale(0.95);
}

/* ============================================================
   9. DATA CARD & TABLE
   ============================================================ */
.data-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--primary);
}
.data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 10px;
    gap: 10px;
}
.data-card-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.data-card-subtitle {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
}
.data-card-detail p {
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--text);
}

.id-tampilan-badge {
    display: inline-block;
    background: var(--primary-light);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: monospace;
    letter-spacing: 0.5px;
}

/* Badge No. KK (BARU) */
.no-kk-badge {
    display: inline-block;
    background: #e0f2fe; /* biru muda */
    color: #0369a1; /* biru tua */
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: monospace;
    letter-spacing: 0.5px;
    border: 1px solid #bae6fd;
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.btn-edit {
    background: #ffc107;
    color: #000;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: 0.2s;
    min-width: 44px;
    min-height: 44px;
}
.btn-edit:hover {
    background: #e0a800;
}
.btn-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: 0.2s;
    min-width: 44px;
    min-height: 44px;
}
.btn-delete:hover {
    background: #b02a37;
}

/* TABLE VIEW */
.table-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 15px;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 700px;
}
.data-table thead {
    background: var(--primary-gradient);
    color: white;
    position: relative;
    z-index: 1;
}
.data-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.data-table th:last-child {
    border-right: none;
}
.data-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}
.data-table tbody tr {
    transition: background 0.15s;
}
.data-table tbody tr:hover {
    background: rgba(45, 106, 79, 0.05);
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}
.sektor-tag {
    display: inline-block;
    background: rgba(45, 106, 79, 0.12);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-table-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    margin: 0 2px;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-table-edit {
    background: #ffc107;
    color: #000;
}
.btn-table-edit:hover {
    background: #e0a800;
    transform: scale(1.05);
}
.btn-table-delete {
    background: #dc3545;
    color: white;
}
.btn-table-delete:hover {
    background: #b02a37;
    transform: scale(1.05);
}

.btn-pdf-sektor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
}
.btn-pdf-sektor:hover {
    background: #b02a37;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.35);
}
.btn-pdf-sektor:active {
    transform: scale(0.97);
}

/* ============================================================
   10. MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-content .form-group {
    margin-bottom: 12px;
}
.modal-content .form-group label {
    display: block;
    text-align: left;
    font-size: 13px;
    margin-bottom: 5px;
}
.modal-content .form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
}
.error-icon {
    font-size: 55px;
    color: #dc3545;
    margin-bottom: 15px;
}
.close-modal-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    transition: 0.3s;
}
.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}
.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.confirm-list {
    text-align: left;
    margin: 15px 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}
.confirm-list li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 8px;
}
.confirm-list li:last-child {
    border-bottom: none;
}
.confirm-list .label {
    color: var(--gray);
    min-width: 100px;
}
.confirm-list .value {
    font-weight: 600;
    color: var(--text);
}

#modalConfirmGlobal .modal-content {
    max-width: 400px;
}
#modalConfirmGlobal #confirmMessage {
    font-size: 14px;
    text-align: center;
}

/* ============================================================
   11. TOAST
   ============================================================ */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 12px;
    z-index: 99999;
    color: white;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: opacity 0.5s;
    max-width: 90%;
    text-align: center;
}
.toast.success { background: #2d6a4f; }
.toast.error { background: #dc3545; }
.toast.info { background: #17a2b8; }

/* ============================================================
   12. INFO BADGE
   ============================================================ */
.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 500;
    color: var(--primary);
    background: rgba(45, 106, 79, 0.1);
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 6px;
    cursor: help;
    white-space: nowrap;
}

/* ============================================================
   13. MODE VERIFIKASI
   ============================================================ */
.verify-progress {
    background: linear-gradient(135deg, #1b4332, #2d6a4f);
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 4px 15px rgba(45, 106, 79, 0.3);
}
.verify-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap;
}
.verify-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.verify-sektor {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}
.verify-exit {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    transition: 0.2s;
    white-space: nowrap;
}
.verify-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 600;
}
.verify-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    overflow: hidden;
}
.verify-bar-fill {
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.verify-nav {
    display: flex;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}
.verify-nav-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px;
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.verify-nav-btn:hover:not(.disabled) {
    background: var(--primary);
    color: white;
}
.verify-nav-btn.skip {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}
.verify-nav-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg);
    color: var(--gray);
    border-color: var(--border);
}

/* ============================================================
   14. SIDE MENU
   ============================================================ */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}
.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: var(--white);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.side-menu.active {
    transform: translateX(0);
}
.side-menu-header {
    padding: 20px;
    background: linear-gradient(135deg, #1b4332, #2d6a4f);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.side-menu-user {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.side-menu-avatar {
    font-size: 40px;
    opacity: 0.9;
    flex-shrink: 0;
}
.side-menu-username {
    font-weight: 700;
    font-size: 15px;
}
.side-menu-runggun {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 3px;
}
.side-menu-role-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}
.side-menu-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 10px;
    padding: 0;
}
.side-menu-body {
    flex: 1;
    padding: 15px 0;
}
.side-menu-group {
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
}
.side-menu-group:last-child {
    border-bottom: none;
}
.side-menu-group-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 10px 20px 5px;
}
.side-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.side-menu-item:hover {
    background: rgba(45, 106, 79, 0.08);
}
.side-menu-item > i:first-child {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--primary);
    flex-shrink: 0;
}
.side-menu-arrow {
    margin-left: auto;
    font-size: 11px !important;
    opacity: 0.4;
    color: var(--gray) !important;
    width: auto !important;
}
.side-menu-item-danger {
    color: #dc3545;
}
.side-menu-item-danger > i:first-child {
    color: #dc3545;
}
.side-menu-footer {
    padding: 15px 20px;
    font-size: 11px;
    color: var(--gray);
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.side-menu-badge {
    margin-left: auto;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    animation: pulse-badge 2s infinite;
}

#menuInstallApp {
    color: var(--primary);
    font-weight: 600;
}
#menuInstallApp:hover {
    background: rgba(45, 106, 79, 0.1);
}
#menuInstallApp > i:first-child {
    color: var(--primary);
    animation: bounce-icon 2s infinite;
}

/* ============================================================
   15. BERANDA (Hero + Shortcut)
   ============================================================ */
.beranda-hero {
    background: linear-gradient(135deg, #1b4332, #2d6a4f, #409f7a);
    border-radius: var(--radius);
    padding: 24px 20px;
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 6px 25px rgba(45, 106, 79, 0.35);
    position: relative;
    overflow: hidden;
}
.beranda-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}
.beranda-hero::after {
    content: "";
    position: absolute;
    bottom: -40%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}
.beranda-hero-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
    margin-bottom: 18px;
}
.beranda-hero-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}
.beranda-hero-text {
    flex: 1;
    min-width: 0;
}
.beranda-hero-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}
.beranda-hero-subtitle {
    font-size: 13px;
    opacity: 0.95;
    margin-bottom: 3px;
}
.beranda-hero-runggun {
    font-size: 13px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.beranda-role-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    margin-left: 4px;
}
.beranda-hero-stats {
    display: flex;
    justify-content: space-around;
    position: relative;
    z-index: 1;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.beranda-stat-item {
    text-align: center;
}
.beranda-stat-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}
.beranda-stat-label {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.beranda-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.beranda-section-title i {
    color: var(--primary);
    font-size: 14px;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}
.shortcut-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    background: var(--white);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 2px 10px rgba(45, 106, 79, 0.1);
    transition: all 0.25s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    min-height: 72px;
}
.shortcut-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 106, 79, 0.18);
    border-color: var(--border);
}
.shortcut-card:active {
    transform: scale(0.98);
}
.shortcut-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    color: white;
    transition: transform 0.2s;
}
.shortcut-card:hover .shortcut-icon {
    transform: scale(1.05);
}
.shortcut-text {
    flex: 1;
    min-width: 0;
}
.shortcut-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 3px;
    color: var(--text);
}
.shortcut-desc {
    font-size: 11px;
    color: var(--gray);
    line-height: 1.3;
}
.shortcut-primary .shortcut-icon { background: linear-gradient(135deg, #2d6a4f, #409f7a); }
.shortcut-warning .shortcut-icon { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.shortcut-info .shortcut-icon { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.shortcut-success .shortcut-icon { background: linear-gradient(135deg, #16a34a, #22c55e); }
.shortcut-excel .shortcut-icon { background: linear-gradient(135deg, #15803d, #16a34a); }
.shortcut-import .shortcut-icon { background: linear-gradient(135deg, #dc2626, #f87171); }
.shortcut-admin .shortcut-icon { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.shortcut-help .shortcut-icon { background: linear-gradient(135deg, #6b7280, #9ca3af); }

.beranda-panduan {
    margin-top: 16px;
    animation: fadeIn 0.3s ease;
}

/* ============================================================
   16. VIEW TOGGLE
   ============================================================ */
.view-toggle-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}
.view-toggle-group {
    display: inline-flex;
    background: var(--white);
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.1);
    border: 1px solid var(--border);
}
.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--gray);
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}
.view-toggle-btn:hover {
    color: var(--primary);
    background: rgba(45, 106, 79, 0.08);
}
.view-toggle-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.3);
}
.view-toggle-btn i {
    font-size: 14px;
}

/* ============================================================
   17. ADMIN PAGE
   ============================================================ */
.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* ============================================================
   18. UTILITY: ALERT + THEME TOGGLE
   ============================================================ */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    border-left: 4px solid transparent;
}
.alert i { margin-top: 2px; }
.alert-success { background: #d4edda; color: #155724; border-left-color: #28a745; }
.alert-error { background: #f8d7da; color: #721c24; border-left-color: #dc3545; }
.alert-warning { background: #fff3cd; color: #856404; border-left-color: #ffc107; }
.alert-info { background: #d1ecf1; color: #0c5460; border-left-color: #17a2b8; }

/* ============================================================
   19. DASHBOARD TOOLBAR + ACTION BAR
   ============================================================ */
.dashboard-toolbar {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 12px;
}
.dashboard-search {
    flex: 1;
}
.dashboard-search input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    background: var(--white);
    color: var(--text);
    transition: all 0.3s;
}
.dashboard-search input:focus {
    outline: none;
    border-color: var(--primary);
}
.dashboard-refresh-btn {
    background: var(--primary-light);
    color: white;
    border: none;
    padding: 0 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    min-width: 48px;
    justify-content: center;
}
.dashboard-refresh-btn:hover {
    background: var(--primary);
}
.dashboard-refresh-btn .refresh-label {
    display: none;
}

.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.action-bar-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.action-bar-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.data-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--white);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--gray);
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.05);
}
.data-count-badge strong {
    color: var(--primary);
    font-weight: 700;
}

/* ============================================================
   20. ACCESSIBILITY
   ============================================================ */
:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
    border-radius: 6px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

@media (hover: hover) {
    .data-card {
        transition: transform 0.2s, box-shadow 0.2s;
    }
    .data-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(45, 106, 79, 0.2);
    }
    .nav-item {
        transition: color 0.2s, background 0.2s;
        border-radius: 10px;
    }
    .nav-item:hover:not(.active) {
        color: var(--primary);
        background: rgba(45, 106, 79, 0.08);
    }
}

/* ============================================================
   21. DARK MODE (auto + manual)
   ============================================================ */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #121a16;
        --white: #1e2a24;
        --text: #e8f0ec;
        --border: #2d3f37;
        --gray: #8a9e96;
        --shadow: 0 4px 20px rgba(0,0,0,0.4);
    }
    :root:not([data-theme="light"]) .header,
    :root:not([data-theme="light"]) .bottom-nav,
    :root:not([data-theme="light"]) .form-container,
    :root:not([data-theme="light"]) .card-info,
    :root:not([data-theme="light"]) .data-card,
    :root:not([data-theme="light"]) .modal-content {
        background: var(--white);
    }
    :root:not([data-theme="light"]) .fab-button {
        border-color: var(--bg);
    }
    :root:not([data-theme="light"]) .form-group input,
    :root:not([data-theme="light"]) .form-group select,
    :root:not([data-theme="light"]) .form-group textarea {
        background: #2a3a32;
        border-color: var(--border);
        color: var(--text);
    }
    :root:not([data-theme="light"]) .form-group input:focus,
    :root:not([data-theme="light"]) .form-group select:focus,
    :root:not([data-theme="light"]) .form-group textarea:focus {
        background: #33473d;
    }
    :root:not([data-theme="light"]) .radio-item,
    :root:not([data-theme="light"]) .checkbox-formal,
    :root:not([data-theme="light"]) .guide-list li {
        background: #2a3a32;
        border-color: #33473d;
    }
    :root:not([data-theme="light"]) .info-badge {
        background: rgba(64, 159, 122, 0.2);
        color: #8fd3b6;
    }
    :root:not([data-theme="light"]) .form-group input[readonly] {
        background: #2a3a32 !important;
        color: #8a9e96 !important;
    }
    :root:not([data-theme="light"]) .id-tampilan-badge {
        background: #2d6a4f;
    }
    
    /* Dark mode untuk no_kk */
    :root:not([data-theme="light"]) .no-kk-badge {
        background: #0c4a6e;
        color: #7dd3fc;
        border-color: #075985;
    }

    :root:not([data-theme="light"]) .side-menu {
        background: #1e2a24;
    }
    :root:not([data-theme="light"]) .side-menu-item {
        color: #e8f0ec;
    }
    :root:not([data-theme="light"]) .side-menu-item:hover {
        background: rgba(64, 159, 122, 0.15);
    }
    :root:not([data-theme="light"]) .side-menu-item > i:first-child {
        color: #8fd3b6;
    }
    :root:not([data-theme="light"]) .side-menu-group {
        border-bottom-color: #2d3f37;
    }
    :root:not([data-theme="light"]) .side-menu-footer {
        background: #121a16;
        border-top-color: #2d3f37;
    }
    :root:not([data-theme="light"]) .modal-content {
        background: #1e2a24;
    }
    :root:not([data-theme="light"]) .modal-content h3 {
        color: #e8f0ec;
    }
    :root:not([data-theme="light"]) .modal-content .form-group input {
        background: #2a3a32;
        color: #e8f0ec;
        border-color: #2d3f37;
    }
    :root:not([data-theme="light"]) .alert-success { background: #1e3a2a; color: #a8e6b8; }
    :root:not([data-theme="light"]) .alert-error { background: #3a1e1e; color: #f5b7b1; }
    :root:not([data-theme="light"]) .alert-warning { background: #3a3320; color: #ffe8a1; }
    :root:not([data-theme="light"]) .alert-info { background: #1e2e3a; color: #a8d8ea; }
    :root:not([data-theme="light"]) .data-count-badge {
        background: #1e2a24;
        border-color: #2d3f37;
    }
    :root:not([data-theme="light"]) .stat-card,
    :root:not([data-theme="light"]) .chart-card,
    :root:not([data-theme="light"]) .statistik-filter-card {
        background: var(--white);
    }
    :root:not([data-theme="light"]) .form-modal-content {
        background: var(--bg);
    }
    :root:not([data-theme="light"]) .form-modal-header {
        background: var(--white);
        border-bottom-color: var(--border);
    }
}

:root[data-theme="dark"] {
    --bg: #121a16;
    --white: #1e2a24;
    --text: #e8f0ec;
    --border: #2d3f37;
    --gray: #8a9e96;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
}
:root[data-theme="dark"] .header,
:root[data-theme="dark"] .bottom-nav,
:root[data-theme="dark"] .form-container,
:root[data-theme="dark"] .card-info,
:root[data-theme="dark"] .data-card,
:root[data-theme="dark"] .modal-content {
    background: var(--white);
}
:root[data-theme="dark"] .fab-button {
    border-color: var(--bg);
}
:root[data-theme="dark"] .form-group input,
:root[data-theme="dark"] .form-group select,
:root[data-theme="dark"] .form-group textarea {
    background: #2a3a32;
    border-color: var(--border);
    color: var(--text);
}
:root[data-theme="dark"] .form-group input:focus,
:root[data-theme="dark"] .form-group select:focus,
:root[data-theme="dark"] .form-group textarea:focus {
    background: #33473d;
}
:root[data-theme="dark"] .radio-item,
:root[data-theme="dark"] .checkbox-formal,
:root[data-theme="dark"] .guide-list li {
    background: #2a3a32;
    border-color: #33473d;
}
:root[data-theme="dark"] .info-badge {
    background: rgba(64, 159, 122, 0.2);
    color: #8fd3b6;
}
:root[data-theme="dark"] .form-group input[readonly] {
    background: #2a3a32 !important;
    color: #8a9e96 !important;
}
:root[data-theme="dark"] .id-tampilan-badge {
    background: #2d6a4f;
}

/* Dark mode untuk no_kk */
:root[data-theme="dark"] .no-kk-badge {
    background: #0c4a6e;
    color: #7dd3fc;
    border-color: #075985;
}

:root[data-theme="dark"] .side-menu {
    background: #1e2a24;
}
:root[data-theme="dark"] .side-menu-item {
    color: #e8f0ec;
}
:root[data-theme="dark"] .side-menu-item:hover {
    background: rgba(64, 159, 122, 0.15);
}
:root[data-theme="dark"] .side-menu-item > i:first-child {
    color: #8fd3b6;
}
:root[data-theme="dark"] .side-menu-group {
    border-bottom-color: #2d3f37;
}
:root[data-theme="dark"] .side-menu-footer {
    background: #121a16;
    border-top-color: #2d3f37;
}
:root[data-theme="dark"] .modal-content {
    background: #1e2a24;
}
:root[data-theme="dark"] .modal-content h3 {
    color: #e8f0ec;
}
:root[data-theme="dark"] .modal-content .form-group input {
    background: #2a3a32;
    color: #e8f0ec;
    border-color: #2d3f37;
}
:root[data-theme="dark"] .alert-success { background: #1e3a2a; color: #a8e6b8; }
:root[data-theme="dark"] .alert-error { background: #3a1e1e; color: #f5b7b1; }
:root[data-theme="dark"] .alert-warning { background: #3a3320; color: #ffe8a1; }
:root[data-theme="dark"] .alert-info { background: #1e2e3a; color: #a8d8ea; }
:root[data-theme="dark"] .data-count-badge {
    background: #1e2a24;
    border-color: #2d3f37;
}
:root[data-theme="dark"] .stat-card,
:root[data-theme="dark"] .chart-card,
:root[data-theme="dark"] .statistik-filter-card {
    background: var(--white);
}
:root[data-theme="dark"] .form-modal-content {
    background: var(--bg);
}
:root[data-theme="dark"] .form-modal-header {
    background: var(--white);
    border-bottom-color: var(--border);
}
:root[data-theme="dark"] .side-menu-badge {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

/* ============================================================
   22. STATISTIK PAGE
   ============================================================ */
.statistik-filter-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.statistik-filter-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.statistik-filter-form .form-group {
    margin: 0;
}

.statistik-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--white);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    flex-shrink: 0;
}
.stat-content {
    flex: 1;
    min-width: 0;
}
.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 12px;
    color: var(--gray);
    line-height: 1.2;
}

.stat-card-primary .stat-icon { background: linear-gradient(135deg, #2d6a4f, #409f7a); }
.stat-card-info .stat-icon { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.stat-card-warning .stat-icon { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat-card-blue .stat-icon { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.stat-card-pink .stat-icon { background: linear-gradient(135deg, #db2777, #ec4899); }

.statistik-chart-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.chart-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.chart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.chart-header i {
    color: var(--primary);
    font-size: 18px;
}
.chart-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.chart-body {
    position: relative;
    width: 100%;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chart-body canvas {
    max-width: 100%;
    max-height: 320px;
}

.kelengkapan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
}
.kelengkapan-item {
    text-align: center;
}
.kelengkapan-item canvas {
    max-height: 120px;
    margin-bottom: 8px;
}
.kelengkapan-label {
    font-size: 12px;
    color: var(--gray);
    font-weight: 600;
}

.statistik-footer-note {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 13px;
    color: var(--gray);
    text-align: center;
    line-height: 1.6;
}
.statistik-footer-note i {
    color: var(--primary);
    margin-right: 4px;
}

/* ============================================================
   23. MODAL: ALASAN HAPUS + PASSWORD
   ============================================================ */
.reason-option {
    transition: all 0.2s ease;
}
.reason-option:hover {
    background: rgba(45, 106, 79, 0.05) !important;
}
.reason-option input[type="radio"] {
    cursor: pointer;
    flex-shrink: 0;
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}
.password-input-wrapper input {
    padding-right: 45px !important;
}
.password-eye-icon {
    transition: color 0.2s;
    user-select: none;
    z-index: 5;
}
.password-eye-icon:hover {
    color: var(--primary) !important;
}

/* ============================================================
   24. FORM MODAL LAYER
   ============================================================ */

.form-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.form-modal-wrapper.form-modal-mode {
    display: flex;
}

.form-modal-wrapper.form-fullpage-mode {
    position: relative;
    display: block;
    z-index: 1;
    padding: 0;
}

.form-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.form-fullpage-mode .form-modal-overlay {
    display: none;
}

.form-modal-content {
    position: relative;
    background: var(--bg);
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUpModal 0.3s ease;
    margin: auto;
}

@media (max-width: 767px) {
    .form-modal-wrapper {
        padding: 0;
    }
    .form-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }
}

.form-fullpage-mode .form-modal-content {
    max-width: 600px;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0 auto;
}

.form-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 20px 20px 0 0;
}
.form-fullpage-mode .form-modal-header {
    border-radius: 0;
}

.form-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}
.form-modal-title i {
    font-size: 18px;
}

.form-modal-close-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 20px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.form-modal-close-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}
.form-modal-close-btn:active {
    transform: scale(0.92);
}

.form-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px 100px 20px;
    -webkit-overflow-scrolling: touch;
    position: relative;
}
.form-modal-body::-webkit-scrollbar {
    width: 6px;
}
.form-modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.form-modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.form-modal-footer {
    display: none !important;
}

/* ============================================================
   25. RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
    .form-tab {
        font-size: 11px;
        padding: 8px 6px;
    }
    .form-tab i {
        margin-right: 3px;
    }
    .fab-nav {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    .fab-close {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    .form-nav-buttons {
        bottom: calc(var(--nav-height) + 15px);
        right: 15px;
        gap: 8px;
    }
    .modal-content {
        max-width: 320px;
        padding: 20px;
    }
    .data-card-header {
        flex-direction: column;
    }
    .card-actions {
        align-self: flex-end;
    }
    .side-menu {
        width: 300px;
    }
    .header-icon-btn,
    .hamburger-btn,
    .theme-toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .view-toggle-btn {
        padding: 10px 12px;
        min-height: 44px;
    }
    .view-toggle-btn span {
        display: none;
    }
    .view-toggle-btn i {
        font-size: 16px;
    }
    .data-table {
        font-size: 11px;
    }
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }

    .form-modal-header {
        padding: 12px 16px;
    }
    .form-modal-title {
        font-size: 15px;
    }
    .form-modal-body {
        padding: 14px 16px 100px 16px;
    }
}

@media (min-width: 768px) {
    .main-content {
        max-width: 720px;
        padding: 20px 24px;
    }
    .shortcut-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .modal-content {
        max-width: 440px;
    }
    .admin-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .statistik-filter-form {
        grid-template-columns: 1fr 1fr;
    }
    .statistik-summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .statistik-chart-grid {
        grid-template-columns: 1fr 1fr;
    }
    .chart-card-wide {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1024px) {
    body {
        padding-bottom: calc(var(--nav-height) + 30px);
    }

    .main-content {
        max-width: 1200px;
        padding: 24px 40px 30px;
    }

    .header {
        padding: 14px 40px;
        z-index: 1200;
    }
    .header-center h1 {
        font-size: 20px;
    }

    .bottom-nav {
        height: var(--nav-height);
        padding: 0 40px;
    }
    .nav-item {
        width: auto;
        padding: 0 16px;
        font-size: 16px;
    }
    .nav-item::after {
        font-size: 13px;
        font-weight: 600;
        margin-left: 6px;
    }
    .nav-item[title="Beranda"]::after { content: "Beranda"; }
    .nav-item[title="Dashboard"]::after { content: "Dashboard"; }
    .nav-item[title="Pencarian Sektor"]::after { content: "Pencarian"; }
    .nav-item[title="Tambah Data"]::after { content: "Tambah"; }
    .nav-item[title="Ekspor Data"]::after { content: "Export"; }
    .nav-item[title="Import Data"]::after { content: "Import"; }
    .nav-item[title="Kelola User"]::after { content: "Kelola User"; }

    .center-fab {
        top: -22px;
    }
    .center-fab .fab-button {
        width: 55px;
        height: 55px;
        border-radius: 50%;
        font-size: 22px;
    }

    #dataListContainer.card-mode {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 16px;
        align-items: start;
    }
    #dataListContainer.card-mode > .card-info {
        grid-column: 1 / -1;
    }

    #dataListContainer.table-mode {
        display: block;
        width: 100%;
    }
    #dataListContainer.table-mode .table-wrapper {
        width: 100%;
        overflow-x: visible;
        overflow-y: visible;
    }
    #dataListContainer.table-mode .data-table {
        width: 100%;
        min-width: auto;
    }

    .data-card {
        margin-bottom: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    .data-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .card-actions {
        align-self: stretch;
        margin-top: 10px;
        justify-content: flex-end;
    }

    .data-table {
        font-size: 13px;
    }
    .data-table th,
    .data-table td {
        padding: 12px 10px;
    }
    .data-table thead {
        position: relative;
        top: auto;
        z-index: 1;
    }

    .action-bar {
        flex-wrap: nowrap;
        min-height: 44px;
    }
    .action-bar-left {
        min-width: 180px;
    }

    .dashboard-refresh-btn .refresh-label {
        display: inline;
    }

    .beranda-hero {
        padding: 30px 40px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 40px;
    }
    .beranda-hero-content {
        margin-bottom: 0;
        flex: 1;
    }
    .beranda-hero-stats {
        padding-top: 0;
        border-top: none;
        border-left: 1px solid rgba(255, 255, 255, 0.2);
        padding-left: 40px;
        flex: 0 0 auto;
    }
    .beranda-hero-title { font-size: 26px; }
    .beranda-stat-value { font-size: 32px; }

    .form-container {
        max-width: 900px;
        margin: 0 auto;
        padding: 30px 40px;
    }
    .form-tab-content.active {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px 24px;
    }
    .form-tab-content.active .form-group:has(textarea),
    .form-tab-content.active .form-group:has(.checkbox-formal),
    .form-tab-content.active .form-group:has(.radio-group) {
        grid-column: 1 / -1;
    }

    .form-nav-buttons {
        bottom: calc(var(--nav-height) + 20px);
        right: 40px;
    }

    .toast {
        bottom: calc(var(--nav-height) + 20px);
        right: 30px;
        left: auto;
        transform: none;
        max-width: 400px;
        text-align: left;
    }

    .shortcut-grid { grid-template-columns: repeat(4, 1fr); }
    .modal-content { max-width: 480px; }
    .side-menu { width: 360px; }

    .statistik-summary-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .stat-value {
        font-size: 26px;
    }
    .chart-body {
        min-height: 300px;
    }
}

@media (min-width: 1440px) {
    .main-content {
        max-width: 1400px;
    }
    #dataListContainer.card-mode {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    }
}