/* ===== CSS VARIABLES BERBASIS 6 WARNA LOGO RT 06 ===== */
:root {
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --primary-light: #eff6ff;
    --secondary: #f1f5f9;
    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --info: #0284c7;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgb(0 0 0/0.06);
    --shadow-md: 0 4px 14px rgb(0 0 0/0.08);
    --shadow-lg: 0 12px 32px rgb(0 0 0/0.12);
    --font-sans: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --sidebar-width: 270px;
    --header-height: 68px;
    --radius: 14px;
    --transition: all 0.25s cubic-bezier(0.16,1,0.3,1);

    /* 6 Warna Karakter Logo RT 06 (Guyub Rukun) */
    --logo-blue: #1d4ed8;
    --logo-cyan: #0284c7;
    --logo-purple: #7e22ce;
    --logo-green: #059669;
    --logo-amber: #d97706;
    --logo-red: #dc2626;
    --rt-spectrum: linear-gradient(90deg, #1d4ed8 0%, #0284c7 18%, #7e22ce 38%, #059669 58%, #d97706 78%, #dc2626 100%);
    --rt-conic: conic-gradient(from 0deg, #1d4ed8, #0284c7, #7e22ce, #059669, #d97706, #dc2626, #1d4ed8);
}
* { margin:0; padding:0; box-sizing:border-box; }
html, body { height: 100%; width: 100%; }
@keyframes pageEntrance {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
body { font-family:var(--font-sans); background:var(--bg-main); color:var(--text-main); line-height:1.6; overflow:hidden; animation: pageEntrance 0.15s ease-out; }
body.page-leaving { opacity:0; transition:opacity 0.1s ease-out; }
h1,h2,h3,h4 { font-family:var(--font-heading); font-weight:700; }
button { font-family:inherit; cursor:pointer; border:none; outline:none; }
input,select,textarea { font-family:inherit; }
textarea { resize:vertical; }

/* ===== LOGIN SCREEN ULTRA-MODERN (6-COLOR LOGO THEMED) ===== */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: radial-gradient(circle at 80% 20%, rgba(56, 189, 248, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(126, 34, 206, 0.2) 0%, transparent 50%),
                linear-gradient(135deg, #070d1e 0%, #0f172a 50%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    overflow-y: auto;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 28px;
    padding: 2.2rem 2rem 1.85rem;
    width: 420px;
    max-width: 95%;
    text-align: center;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border-top: 3px solid transparent;
    background-image: linear-gradient(rgba(255,255,255,0.96), rgba(255,255,255,0.96)), var(--rt-spectrum);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.login-logo-img {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: contain;
    margin: 0 auto 0.65rem;
    display: block;
    background: white;
    padding: 5px;
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.35);
    border: 3px solid transparent;
    background-image: linear-gradient(white, white), var(--rt-conic);
    background-origin: border-box;
    background-clip: content-box, border-box;
    animation: rotateLoginHalo 8s linear infinite;
}
@keyframes rotateLoginHalo {
    100% { transform: rotate(360deg); }
}

.login-logo-icon {
    width: 84px;
    height: 84px;
    background: linear-gradient(135deg, #1d4ed8, #7e22ce);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: white;
    margin: 0 auto 0.65rem;
    box-shadow: 0 10px 28px rgba(29, 78, 216, 0.4);
}

.login-main-title {
    font-family: 'Outfit', 'Orbitron', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    color: #0d47a1;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
    line-height: 1.1;
}

/* Futuristic Tech/Robotic Acronym Badge */
.tech-sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.35rem 0.9rem;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.08) 0%, rgba(37, 99, 235, 0.16) 100%);
    border: 1.5px solid rgba(37, 99, 235, 0.35);
    border-radius: 30px;
    margin-bottom: 0.65rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.tech-chip-icon {
    color: #2563eb;
    font-size: 0.82rem;
    animation: pulseGlow 2.5s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); color: #0284c7; }
}

.tech-text {
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    font-size: 0.74rem;
    font-weight: 800;
    color: #1d4ed8;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}



.login-tagline {
    font-size: 0.78rem;
    color: #7b1fa2;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.login-sub {
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.login-instruction-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pin-display {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0 !important;
    color: transparent !important;
    text-indent: -9999px !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    line-height: 0 !important;
    overflow: hidden !important;
}

.pin-dot.filled {
    background: #1565C0;
    border-color: #1565C0;
    transform: scale(1.18);
    box-shadow: 0 0 10px rgba(21, 101, 192, 0.45);
}

/* Proteksi Masking Tuntas Input PIN & Password */
input[type="password"],
input[id*="Pin"],
input[id*="pin"],
input[id*="PIN"] {
    -webkit-text-security: disc !important;
    text-security: disc !important;
}

/* GPU Hardware Acceleration untuk respon instan <40ms & transisi 60 FPS bebas lag */
.view-section, .modal-content, .stat-card, .card {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.login-error {
    color: var(--danger);
    font-size: 0.84rem;
    font-weight: 600;
    background: var(--danger-light);
    padding: 0.45rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.85rem;
    animation: shake 0.4s ease;
    border: 1px solid #fca5a5;
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    width: 100%;
    margin-bottom: 0.75rem;
}

.pin-key {
    background: #f8fafc;
    border-radius: 14px;
    height: 52px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.pin-key:hover {
    background: #1565C0;
    color: white;
    border-color: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(21, 101, 192, 0.3);
}

.pin-key:active {
    transform: scale(0.94);
    background: #0d47a1;
    color: white;
}

.pin-key-clear {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
    font-size: 1.1rem;
}
.pin-key-clear:hover {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.pin-key-del {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
    font-size: 1.15rem;
}
.pin-key-del:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.login-security-card {
    margin-top: 0.65rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.14) 100%);
    border: 1.5px solid rgba(16, 185, 129, 0.35);
    border-radius: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
    width: 100%;
}

.login-security-card .security-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 800;
    color: #065f46;
    letter-spacing: 0.5px;
}

.login-security-card .security-title i {
    color: #059669;
    font-size: 1rem;
}

.login-security-card .security-sub {
    font-size: 0.7rem;
    color: #047857;
    font-weight: 600;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.4rem 1.15rem 1.15rem;
        width: 100%;
        border-radius: 20px;
    }
    .login-logo-img {
        width: 76px;
        height: 76px;
    }
    .login-main-title {
        font-size: 1.6rem;
    }
    .tech-text {
        font-size: 0.68rem;
        letter-spacing: 1.1px;
    }
    .pin-key {
        height: 48px;
        font-size: 1.2rem;
    }
}

/* ===== LAYOUT ===== */
.app-container { display:flex; height:100vh; width:100%; }

/* ===== SIDEBAR ===== */
.sidebar {
    width:var(--sidebar-width); background:var(--bg-card);
    border-right:1px solid var(--border);
    display:flex; flex-direction:column;
    transition:transform var(--transition);
    z-index:50; overflow-y:auto;
}
.sidebar-header {
    height:var(--header-height); display:flex;
    align-items:center; justify-content:space-between;
    padding:0 1.25rem; border-bottom:1px solid var(--border);
    position:sticky; top:0; background:var(--bg-card); z-index:10;
}
.logo { display:flex; align-items:center; gap:0.75rem; }
.logo i { font-size:1.6rem; color:var(--logo-blue); }
.logo-title { display:block; font-family:var(--font-heading); font-weight:700; font-size:1.05rem; color:var(--text-main); line-height:1.2; }
.logo-sub { display:block; font-size:0.72rem; color:var(--text-muted); }
.logo-img-sidebar { width:40px; height:40px; border-radius:50%; object-fit:contain; flex-shrink:0; border:2px solid #e3f2fd; background:white; padding:2px; }
.close-sidebar-btn { display:none; background:none; font-size:1.25rem; color:var(--text-muted); }
.sidebar-nav { flex:1; padding:1rem 0.75rem; display:flex; flex-direction:column; gap:0.2rem; }
.nav-section-label { font-size:0.7rem; font-weight:700; letter-spacing:0.08em; color:var(--text-muted); padding:0.75rem 0.75rem 0.3rem; text-transform:uppercase; }
.nav-item {
    display:flex; align-items:center; gap:0.875rem;
    padding:0.75rem 1rem; border-radius:10px;
    color:var(--text-muted); text-decoration:none; font-weight:500;
    font-size:0.9rem; transition:var(--transition);
}
.nav-item i { font-size:1rem; width:20px; text-align:center; }
.nav-item:hover { background:var(--secondary); color:var(--primary); }
.nav-item.active { background:var(--logo-blue); color:white; box-shadow:0 4px 10px rgba(21,101,192,0.35); }
.sidebar-footer { padding:1rem; border-top:1px solid var(--border); }
.security-badge {
    display:flex; align-items:center; justify-content:center; gap:0.5rem;
    background:#e8f5e9; color:#2e7d32;
    padding:0.625rem 1rem; border-radius:10px;
    font-size:0.78rem; font-weight:600; border:1px solid #a5d6a7;
}

/* ===== MAIN CONTENT ===== */
.main-content { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.top-header {
    height:var(--header-height); background:var(--bg-card);
    border-bottom:1px solid var(--border);
    display:flex; align-items:center; justify-content:space-between;
    padding:0 1.75rem; gap:1rem;
}
.menu-toggle { display:none; background:none; font-size:1.25rem; color:var(--text-main); }
.header-title h1 { font-size:1.2rem; margin:0; }
.header-actions { display:flex; align-items:center; gap:0.75rem; }
.date-display {
    font-size:0.8rem; color:var(--text-muted); font-weight:500;
    background:var(--secondary); padding:0.5rem 1rem; border-radius:20px;
}
.btn-lock {
    width:38px; height:38px; border-radius:10px; background:var(--secondary);
    display:flex; align-items:center; justify-content:center;
    font-size:1rem; color:var(--text-muted); transition:var(--transition);
}
.btn-lock:hover { background:var(--danger); color:white; }
.views-container { flex:1; overflow-y:auto; padding:1.75rem; scroll-behavior:smooth; }
.view-section { display:none; will-change:opacity, transform; }
.view-section.active { display:block; animation:fastViewTransition 0.16s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes fastViewTransition { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeInUp { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }


/* ===== TOP HEADER ACTION BUTTONS ===== */
.btn-header-action {
    padding: 0.45rem 0.85rem;
    font-weight: 700;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.84rem;
    transition: var(--transition);
}
.btn-header-portal {
    background: #059669;
    color: white;
    border: none;
}
.btn-header-portal:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(5,150,105,0.25);
}
.btn-header-diag {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.btn-header-diag:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.btn-header-sync {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.btn-header-sync:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

/* ===== STATS GRID ===== */
.stats-grid {
    display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:1.25rem; margin-bottom:1.5rem;
}
.iuran-top-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:1.25rem; margin-bottom:1.5rem; }
.stat-card {
    background:var(--bg-card); border-radius:var(--radius);
    padding:1.25rem 1.5rem; display:flex; align-items:center; gap:1.25rem;
    box-shadow:var(--shadow-sm); border:1px solid var(--border); transition:var(--transition);
}
.stat-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.stat-icon { width:56px; height:56px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:1.5rem; color:white; flex-shrink:0; }
.bg-blue { background:linear-gradient(135deg,#42a5f5,#1565C0); }
.bg-green { background:linear-gradient(135deg,#66bb6a,#2e7d32); }
.bg-purple { background:linear-gradient(135deg,#ce93d8,#9C27B0); }
.bg-orange { background:linear-gradient(135deg,#ffa726,#f57f17); }
.bg-red { background:linear-gradient(135deg,#ef9a9a,#c62828); }
.stat-details h3 { font-size:0.8rem; color:var(--text-muted); margin-bottom:0.15rem; font-weight:500; text-transform:capitalize; }
.stat-number { font-size:1.6rem; font-weight:700; color:var(--text-main); font-family:var(--font-heading); }

/* ===== CHARTS ===== */
.charts-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(290px,1fr)); gap:1.25rem; margin-bottom:1.5rem; }
.chart-card { display:flex; flex-direction:column; justify-content:space-between; }
.chart-card .card-body { display:flex; align-items:center; justify-content:center; padding:0.85rem 1rem; }
.chart-body { height:210px; max-height:210px; width:100%; position:relative; }
.chart-footer-summary {
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
}
.chart-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: white;
    border: 1px solid var(--border);
    color: #334155;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-user-select: none;
    user-select: none;
}
.chart-pill:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(37,99,235,0.18);
}
.chart-pill:active {
    transform: scale(0.95);
}
.chart-pill strong { font-weight: 700; color: var(--primary); }
.stat-card { cursor: pointer; transition: all 0.2s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.dashboard-bottom-grid { display:grid; grid-template-columns:1fr 1fr; gap:1.25rem; }

/* ===== GENERIC CARD ===== */
.card { background:var(--bg-card); border-radius:var(--radius); box-shadow:var(--shadow-sm); border:1px solid var(--border); overflow:hidden; }
.card-header { padding:1rem 1.5rem; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; background:#fafbfc; }
.card-header h2 { font-size:1rem; display:flex; align-items:center; gap:0.5rem; text-transform:capitalize; }
.card-body { padding:1.5rem; }
.empty-state { text-align:center; padding:2.5rem 1rem; color:var(--text-muted); }
.empty-state i { font-size:2.5rem; margin-bottom:0.75rem; color:#cbd5e1; display:block; }

/* ===== TOOLBAR ===== */
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:1.25rem; gap:1rem; flex-wrap:wrap; }
.toolbar-actions { display:flex; gap:0.75rem; flex-wrap:wrap; }
.search-box { position:relative; flex:1; min-width:200px; max-width:380px; }
.search-box i { position:absolute; left:1rem; top:50%; transform:translateY(-50%); color:var(--text-muted); pointer-events:none; }
.search-box input { width:100%; padding:0.7rem 1rem 0.7rem 2.5rem; border:1px solid var(--border); border-radius:10px; font-size:0.9rem; background:var(--bg-card); transition:var(--transition); }
.search-box input:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(37,99,235,0.1); outline:none; }

/* ===== BUTTONS ===== */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:0.5rem; padding:0.7rem 1.25rem; border-radius:10px; font-size:0.875rem; font-weight:500; transition:var(--transition); white-space:nowrap; }
.btn-primary { background:var(--logo-blue); color:white; }
.btn-primary:hover { background:var(--primary-hover); box-shadow:var(--shadow-md); }
.btn-secondary { background:var(--secondary); color:var(--text-main); }
.btn-secondary:hover { background:#e2e8f0; }
.btn-danger { background:var(--danger); color:white; }
.btn-danger:hover { background:#dc2626; }
.btn-success { background:var(--success); color:white; }
.btn-success:hover { background:#059669; }
.btn-sm { padding:0.45rem 0.875rem; font-size:0.8rem; }
.btn-icon { padding:0.5rem; border-radius:8px; font-size:0.875rem; }

/* ===== TABLE ===== */
.table-container { background:var(--bg-card); border-radius:var(--radius); box-shadow:var(--shadow-sm); border:1px solid var(--border); overflow-x:auto; }
.data-table { width:100%; border-collapse:collapse; min-width:600px; }
.data-table th, .data-table td { padding:0.875rem 1.25rem; text-align:left; border-bottom:1px solid var(--border); }
.data-table th { background:#f8fafc; font-weight:600; color:var(--text-muted); font-size:0.78rem; text-transform:uppercase; letter-spacing:0.04em; }
.data-table td { text-transform:capitalize; }
.data-table tbody tr:hover { background:var(--secondary); }
.data-table tbody tr:last-child td { border-bottom:none; }
.action-buttons { display:flex; gap:0.4rem; }

/* ===== BADGES ===== */
.badge { padding:0.25rem 0.625rem; border-radius:20px; font-size:0.72rem; font-weight:600; display:inline-flex; align-items:center; gap:0.25rem; }
.badge.kepala-keluarga,.badge.bg-blue { background:#dbeafe; color:#1e40af; }
.badge.istri { background:#fce7f3; color:#be185d; }
.badge.anak { background:#dcfce7; color:#166534; }
.badge.orangtua { background:#ede9fe; color:#6d28d9; }
.badge.famili { background:#ffedd5; color:#9a3412; }
.badge.lainnya { background:#f3f4f6; color:#374151; }
.badge.warga-tetap { background:#e0f2fe; color:#0369a1; border:1px solid #bae6fd; }
.badge.warga-domisili { background:#fef3c7; color:#b45309; border:1px solid #fde68a; }
.badge.pengontrak { background:#f3e8ff; color:#7e22ce; border:1px solid #e9d5ff; }
.badge.serumah { background:#dcfce7; color:#15803d; border:1px solid #bbf7d0; }
.badge.merantau { background:#fef3c7; color:#b45309; border:1px solid #fde68a; }
.badge.wafat { background:#f1f5f9; color:#64748b; border:1px solid #cbd5e1; }
.badge.bg-green,.badge.lunas { background:#d1fae5; color:#065f46; }
.badge.bg-red,.badge.belum { background:#fee2e2; color:#991b1b; }
.badge.bg-orange { background:#ffedd5; color:#9a3412; }
.badge.baik { background:#d1fae5; color:#065f46; }
.badge.cukup { background:#fef3c7; color:#92400e; }
.badge.perlu { background:#ffedd5; color:#9a3412; }
.badge.rusak { background:#fee2e2; color:#991b1b; }
.badge-text-short { display: none; }
.badge-text-full { display: inline; }

/* ===== MODAL ===== */
.modal-overlay {
    position:fixed; inset:0;
    background:rgba(15,23,42,0.65); -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display:flex; align-items:center; justify-content:center;
    z-index:999999; opacity:0; visibility:hidden; pointer-events:none; transition:all 0.25s ease;
}
.modal-overlay.active { opacity:1 !important; visibility:visible !important; pointer-events:auto !important; display:flex !important; z-index:999999 !important; }
.modal-content {
    background:var(--bg-card); width:100%; max-width:680px;
    border-radius:16px; box-shadow:var(--shadow-lg);
    transform:scale(0.95) translateY(20px); transition:all 0.25s ease;
    max-height:90vh; display:flex; flex-direction:column;
}
.modal-sm { max-width:460px; }
.modal-overlay.active .modal-content { transform:scale(1) translateY(0); }
.modal-header { padding:1.25rem 1.5rem; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; }
.modal-header h2 { font-size:1.1rem; }
.close-modal-btn { 
    background: rgba(255, 255, 255, 0.2); 
    width: 34px; 
    height: 34px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    border: none;
    outline: none;
    cursor: pointer !important; 
    transition: var(--transition); 
    flex-shrink: 0; 
    z-index: 10;
}
.close-modal-btn:hover { 
    background: rgba(255, 255, 255, 0.35); 
    transform: scale(1.08); 
    color: white; 
}
.close-modal-btn:active { 
    transform: scale(0.92); 
}
.modal-body { padding:1.5rem; overflow-y:auto; }

/* ===== FORMS ===== */
.form-row { display:flex; gap:1.25rem; margin-bottom:1.1rem; }
.form-group { flex:1; display:flex; flex-direction:column; gap:0.4rem; }
.form-group label { font-size:0.85rem; font-weight:500; }
.form-group input,.form-group select,.form-group textarea {
    padding:0.7rem 0.875rem; border:1px solid var(--border); border-radius:8px;
    font-size:0.9rem; background:var(--bg-main); transition:var(--transition);
}
.form-group input:focus,.form-group select:focus,.form-group textarea:focus {
    border-color:var(--primary); box-shadow:0 0 0 3px rgba(37,99,235,0.1);
    outline:none; background:white;
}
#wargaForm input[type="text"], #wargaForm textarea { text-transform: uppercase; }
#wargaForm input#nik, #wargaForm input#noKk, #wargaForm input#noHp { text-transform: none; }
.form-actions { display:flex; justify-content:flex-end; gap:0.75rem; margin-top:1.5rem; padding-top:1.25rem; border-top:1px solid var(--border); }
.form-select-inline { padding:0.6rem 0.875rem; border:1px solid var(--border); border-radius:8px; font-size:0.875rem; background:white; }
.checkbox-label { display:flex; align-items:center; gap:0.5rem; font-size:0.875rem; cursor:pointer; padding-bottom:0.2rem; }
.checkbox-label input { width:16px; height:16px; cursor:pointer; }
.settings-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:1.5rem; }

/* ===== PER KK ===== */
.kk-group { background:var(--bg-card); border-radius:var(--radius); border:1px solid var(--border); box-shadow:var(--shadow-sm); margin-bottom:1.5rem; overflow:hidden; }
.kk-header { padding:1.1rem 1.4rem; background:linear-gradient(135deg,#1565C0,#2E7D32); color:white; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:0.75rem; transition: filter 0.2s ease; }
.kk-header:hover { filter: brightness(1.05); }
.kk-header-info { display:flex; flex-direction:column; gap:0.2rem; }
.kk-header h3 { font-size:1.05rem; font-weight:600; display:flex; align-items:center; gap:0.5rem; color:white; }
.kk-subinfo { font-size:0.8rem; opacity:0.9; display:flex; gap:0.75rem; flex-wrap:wrap; }
.kk-members { padding:0.25rem 0; }
.kk-accordion-toggle {
    margin: 0.6rem 1.2rem 0.5rem;
    padding: 0.65rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: all 0.2s ease;
}
.kk-accordion-toggle:hover {
    background: #edf2f7;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.kk-members-content {
    transition: all 0.3s ease;
}
.kk-member { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:0.85rem 1.4rem; border-bottom:1px solid var(--border); transition:var(--transition); }
.kk-member:hover { background:#f8fafc; }
.kk-member:last-child { border-bottom:none; }
.kk-member-main { display:flex; align-items:center; gap:1rem; flex:1; }
.kk-avatar { width:38px; height:38px; border-radius:50%; background:var(--primary-light); color:var(--primary); font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:0.95rem; }
.kk-member-info .name { font-weight:600; font-size:0.92rem; color:var(--text-main); text-transform:capitalize; word-break:break-word; }
.kk-member-info .sub { font-size:0.78rem; color:var(--text-muted); margin-top:2px; text-transform:capitalize; }
.kk-member-badges { display:flex; gap:0.4rem; align-items:center; flex-wrap:wrap; }
.kk-footer { padding:0.75rem 1.4rem; background:#f8fafc; border-top:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; font-size:0.82rem; color:var(--text-muted); }
.kk-member:last-child { border-bottom:none; }
.kk-avatar { width:36px; height:36px; border-radius:50%; background:var(--secondary); display:flex; align-items:center; justify-content:center; font-size:0.875rem; color:var(--text-muted); font-weight:600; flex-shrink:0; }
.kk-member-info { flex:1; }
.kk-member-info .name { font-weight:500; font-size:0.9rem; text-transform:capitalize; word-break:break-word; }
.kk-member-info .sub { font-size:0.75rem; color:var(--text-muted); text-transform:capitalize; }

/* ===== KONTAK GRID ===== */
.kontak-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:1rem; }
.kontak-card { background:var(--bg-card); border-radius:var(--radius); border:1px solid var(--border); box-shadow:var(--shadow-sm); padding:1.25rem; display:flex; flex-direction:column; gap:0.5rem; transition:var(--transition); }
.kontak-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.kontak-card-header { display:flex; align-items:center; gap:0.75rem; }
.kontak-avatar { width:44px; height:44px; border-radius:12px; background:linear-gradient(135deg,var(--logo-blue),#9C27B0); display:flex; align-items:center; justify-content:center; font-size:1.1rem; color:white; font-weight:700; flex-shrink:0; }
.kontak-name { font-weight:600; font-size:0.95rem; text-transform:capitalize; word-break:break-word; }
.kontak-ket { font-size:0.75rem; color:var(--text-muted); text-transform:capitalize; }
.kontak-hp { font-size:0.875rem; color:var(--primary); font-weight:500; }
.kontak-alamat { font-size:0.8rem; color:var(--text-muted); }
.kontak-actions { display:flex; gap:0.5rem; margin-top:0.25rem; }

/* ===== KEGIATAN GRID ===== */
.kegiatan-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:1.25rem; }
.kegiatan-card { background:var(--bg-card); border-radius:var(--radius); border:1px solid var(--border); box-shadow:var(--shadow-sm); overflow:hidden; transition:var(--transition); }
.kegiatan-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.kegiatan-card-header { padding:1rem 1.25rem; background:linear-gradient(135deg,#1b5e20,#2e7d32); color:white; }
.kegiatan-card-header .date { font-size:0.78rem; opacity:0.85; }
.kegiatan-card-header h3 { font-size:1rem; margin-top:0.2rem; }
.kegiatan-card-body { padding:1rem 1.25rem; }
.kegiatan-meta { display:flex; gap:1rem; flex-wrap:wrap; margin-bottom:0.5rem; }
.kegiatan-meta span { font-size:0.78rem; color:var(--text-muted); display:flex; align-items:center; gap:0.3rem; }
.kegiatan-desc { font-size:0.85rem; color:var(--text-muted); }
.kegiatan-actions { padding:0.75rem 1.25rem; border-top:1px solid var(--border); display:flex; gap:0.5rem; }

/* ===== PENGUMUMAN ===== */
.pengumuman-list { display:flex; flex-direction:column; gap:1rem; }
.pengumuman-card { background:var(--bg-card); border-radius:var(--radius); border:1px solid var(--border); border-left:4px solid var(--logo-blue); box-shadow:var(--shadow-sm); padding:1.25rem 1.5rem; transition:var(--transition); }
.pengumuman-card.penting { border-left-color:var(--logo-red); }
.pengumuman-card:hover { box-shadow:var(--shadow-md); }
.pengumuman-header { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; margin-bottom:0.5rem; }
.pengumuman-judul { font-weight:600; font-size:1rem; }
.pengumuman-isi { color:var(--text-muted); font-size:0.875rem; line-height:1.7; margin-bottom:0.75rem; white-space:pre-wrap; }
.pengumuman-footer { display:flex; justify-content:space-between; align-items:center; }
.pengumuman-tanggal { font-size:0.78rem; color:var(--text-muted); }

/* ===== PENGURUS GRID ===== */
.pengurus-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:1.25rem; }
.pengurus-card { background:var(--bg-card); border-radius:var(--radius); border:1px solid var(--border); box-shadow:var(--shadow-sm); padding:1.5rem; text-align:center; transition:var(--transition); }
.pengurus-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.pengurus-avatar { width:64px; height:64px; border-radius:50%; background:linear-gradient(135deg,var(--logo-blue),#9C27B0); display:flex; align-items:center; justify-content:center; font-size:1.5rem; color:white; font-weight:700; margin:0 auto 1rem; }
.pengurus-jabatan { font-size:0.75rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--logo-blue); background:#e3f2fd; padding:0.3rem 0.75rem; border-radius:20px; display:inline-block; margin-bottom:0.5rem; }
.pengurus-nama { font-weight:600; font-size:1rem; margin-bottom:0.25rem; text-transform:capitalize; word-break:break-word; }
.pengurus-hp { font-size:0.8rem; color:var(--text-muted); margin-bottom:0.75rem; }
.pengurus-actions { display:flex; gap:0.5rem; justify-content:center; }

/* ===== SURAT ===== */
.surat-type-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:1rem; margin-bottom:1.5rem; }
.surat-type-card {
    background:var(--bg-card); border-radius:var(--radius);
    border:2px solid var(--border); padding:1.75rem 1rem;
    text-align:center; cursor:pointer; transition:var(--transition);
    display:flex; flex-direction:column; align-items:center; gap:0.75rem;
}
.surat-type-card:hover,.surat-type-card.active { border-color:var(--logo-blue); background:#e3f2fd; color:var(--logo-blue); }
.surat-type-card i { font-size:2rem; }
.surat-type-card span { font-weight:600; font-size:0.875rem; }
.surat-preview-wrapper { margin-top:1.5rem; }
.surat-preview-actions { display:flex; gap:1rem; margin-bottom:1rem; }
.surat-preview {
    background:white; padding:60px 80px;
    box-shadow:var(--shadow-md); border-radius:4px;
    font-family:'Times New Roman',serif; font-size:12pt; line-height:1.8;
    max-width:800px; margin:0 auto;
}
.kop-resmi { border-bottom: 3.5px double #000000; padding-bottom: 8px; margin-bottom: 15px; font-family: 'Plus Jakarta Sans', Arial, sans-serif; }
.surat-preview .kop { text-align:center; border-bottom:3.5px double #000000; padding-bottom:10px; margin-bottom:16px; }
.surat-preview .kop h2 { font-size:14pt; text-transform:uppercase; letter-spacing:0.5px; }
.surat-preview .kop p { font-size:9pt; }
@media screen and (max-width: 600px) {
    .kop-resmi table td:first-child img { width: 46px !important; }
    .kop-resmi table td:first-child, .kop-resmi table td:last-child { width: 50px !important; }
    .kop-resmi div { font-size: 80% !important; }
}
.surat-preview .nomor { margin-bottom:20px; }
.surat-preview .perihal { margin-bottom:20px; }
.surat-preview .pembuka { margin-bottom:12px; }
.surat-preview .isi-surat table { width:100%; border-collapse:collapse; margin-bottom:12px; }
.surat-preview .isi-surat td { padding:2px 8px; vertical-align:top; }
.surat-preview .isi-surat td:first-child { width:180px; }
.surat-preview .ttd { margin-top:40px; display:flex; justify-content:flex-end; text-align:center; }
.surat-preview .ttd-name { margin-top:4px; padding-top:2px; font-weight:bold; }

/* ===== IURAN TABS ===== */
.iuran-tabs { display:flex; gap:0.5rem; margin-bottom:1.25rem; background:var(--bg-card); padding:0.5rem; border-radius:12px; border:1px solid var(--border); width:fit-content; }
.tab-btn { padding:0.6rem 1.25rem; border-radius:8px; font-size:0.875rem; font-weight:500; background:transparent; color:var(--text-muted); transition:var(--transition); cursor:pointer; }
.tab-btn.active { background:var(--logo-blue); color:white; box-shadow:0 2px 8px rgba(21,101,192,0.35); }
.tab-content { display:none; }
.tab-content.active { display:block !important; }
/* ===== BULLETPROOF UNIVERSAL PRINT ENGINE (100% ANTI-BLANK) ===== */
@media screen {
    #globalPrintContainer, #__rt06_inline_print_container__ {
        display: none !important;
    }
}

@media print {
    /* 1. Sembunyikan SEMUA elemen root di body KECUALI globalPrintContainer */
    body > *:not(#globalPrintContainer):not(#__rt06_inline_print_container__) {
        display: none !important;
    }
    /* 2. Tampilkan HANYA globalPrintContainer dengan standar cetak dokumen kedinasan */
    #globalPrintContainer, #__rt06_inline_print_container__ {
        display: block !important;
        position: static !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        color: #000000 !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 9999999 !important;
        overflow: visible !important;
    }
    #globalPrintContainer *, #__rt06_inline_print_container__ * {
        visibility: visible !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    body, html {
        background: #ffffff !important;
        color: #000000 !important;
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        font-family: 'Plus Jakarta Sans', Arial, sans-serif !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    @page {
        size: auto;
        margin: 12mm 15mm;
    }
    /* Standarisasi Tabel, Pembagian Halaman, & Tanda Tangan */
    table {
        page-break-inside: auto !important;
        border-collapse: collapse !important;
        width: 100% !important;
    }
    thead { display: table-header-group !important; }
    tfoot { display: table-footer-group !important; }
    tbody { display: table-row-group !important; }
    tr, td, th {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    .sign-area, .ttd, .signature-section, .signature-box, .kop-resmi, .title-box, .table-summary, .summary-box, .summary-item {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    .no-print, button, .btn {
        display: none !important;
    }
}

/* ===== MOBILE BOTTOM NAVIGATION BAR ===== */
.mobile-bottom-nav {
    display: none;
}

/* ===== RESPONSIVE DESIGN SYSTEM ===== */

/* ===== TABLET & COMPACT LAPTOP RESPONSIVE (769px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 210px;
    }
    .views-container {
        padding: 1rem;
    }
    .top-header {
        padding: 0 1rem;
        height: 58px;
        gap: 0.5rem;
    }
    .header-title {
        min-width: 0;
        flex: 1 1 auto;
    }
    .header-title h1 {
        font-size: 1.05rem;
        line-height: 1.25;
        word-break: normal;
        overflow-wrap: break-word;
    }
    .header-actions {
        gap: 0.4rem;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }
    .header-actions .btn span,
    #currentDate,
    .date-display {
        display: none !important;
    }
    .header-actions .btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px;
    }
    #roleBadge {
        font-size: 0.72rem;
        padding: 0.35rem 0.55rem;
        border-radius: 8px;
        white-space: nowrap;
    }
    .sidebar-nav {
        padding: 0.75rem 0.5rem;
    }
    .nav-item {
        padding: 0.6rem 0.7rem;
        font-size: 0.84rem;
        gap: 0.5rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }
    .toolbar {
        gap: 0.65rem;
    }
    .table-container {
        border-radius: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .surat-type-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important;
        gap: 0.75rem !important;
    }
}

/* ===== BASE STYLES FOR CARDS (DESKTOP DEFAULT) ===== */
.iuran-mobile-view,
.warga-mobile-view,
.usaha-mobile-view,
.surat-mobile-view,
.aset-mobile-view,
.pinjam-aset-mobile-view,
.tamu-mobile-view,
.patroli-mobile-view {
    display: none;
}

.aset-card-mobile,
.pinjam-aset-card-mobile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.aset-tabs-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 1.15rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.6rem;
}

.iuran-mobile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.warga-card-mobile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wcm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.wcm-avatar-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
}

.wcm-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wcm-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
    text-transform: capitalize;
    word-break: break-word;
}

.wcm-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 3px;
}

.wcm-body {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.6rem;
    font-size: 0.78rem;
    color: var(--text-main);
}

.wcm-body .wcm-full-col {
    grid-column: 1 / -1;
}

.wcm-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wcm-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
    margin-top: 0.15rem;
    flex-wrap: wrap;
}

.wcm-actions .btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ===== EXTRACTED MEMBERS TABLE & RESPONSIVE CARDS ===== */
.extracted-members-container {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    -webkit-overflow-scrolling: touch;
}
.extracted-members-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.extracted-members-table th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    padding: 0.65rem 0.6rem;
    font-size: 0.78rem;
    border-bottom: 1.5px solid #cbd5e1;
    white-space: nowrap;
    text-align: left;
}
.extracted-members-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}
.extracted-members-table input,
.extracted-members-table select {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.84rem;
    background: #f8fafc;
    color: #0f172a;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 38px;
}
.extracted-members-table input:focus,
.extracted-members-table select:focus {
    background: #ffffff;
    border-color: #059669;
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}
.scan-card-header, .scan-field-label {
    display: none;
}

/* ===== RONDA & SARAN GRID BASE (DESKTOP) ===== */
.ronda-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}
.saran-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* ===== UNIFIED MOBILE RESPONSIVE (< 768px) ===== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        text-size-adjust: 100%;
        -webkit-text-size-adjust: 100%;
    }
    
    /* Layout, Safe Areas & Viewport */
    .app-container {
        height: 100dvh;
        width: 100%;
        overflow: hidden;
    }
    .main-content {
        overflow-y: auto;
        overflow-x: hidden;
        height: 100dvh;
        -webkit-overflow-scrolling: touch;
    }
    .views-container {
        padding: 0.75rem 0.75rem calc(76px + env(safe-area-inset-bottom, 0px)) !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Global Anti-Zoom on iOS: 16px minimum on all form controls */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Utility hide on mobile */
    .hide-mobile { display: none !important; }

    /* Mobile Bottom Navigation Bar */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
        background: rgba(255, 255, 255, 0.98) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        backdrop-filter: blur(16px) !important;
        border-top: 1px solid var(--border) !important;
        justify-content: space-around !important;
        align-items: center !important;
        z-index: 999 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    }
    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 600;
        padding: 6px 0;
        cursor: pointer;
        transition: var(--transition);
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-nav-item i {
        font-size: 1.25rem;
        transition: transform 0.2s;
    }
    .mobile-nav-item.active {
        color: var(--primary);
        font-weight: 800;
    }
    .mobile-nav-item.active i {
        transform: scale(1.15);
    }

    /* Off-Canvas Sidebar */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: min(300px, 85vw);
        z-index: 1000;
        box-shadow: none;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
    }
    .close-sidebar-btn { display: block; }
    .menu-toggle { display: block; font-size: 1.3rem; }
    .sidebar-nav .nav-item {
        min-height: 44px;
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    /* Top Header */
    .top-header {
        padding: 0 0.75rem !important;
        height: 56px !important;
        min-height: 56px !important;
        max-height: 56px !important;
        gap: 0.5rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        background: #ffffff !important;
        box-sizing: border-box !important;
    }
    .header-title {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }
    .header-title h1 {
        font-size: clamp(0.85rem, 3.2vw, 1.05rem) !important;
        font-weight: 800 !important;
        color: #0f172a !important;
        line-height: 1.25 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        letter-spacing: -0.2px !important;
        margin: 0 !important;
    }
    .header-actions {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 0.35rem !important;
        flex-wrap: nowrap !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
    }
    .badge-text-full {
        display: none !important;
    }
    .badge-text-short {
        display: inline !important;
    }
    .header-actions .badge {
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        padding: 0.35rem 0.55rem !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
        max-width: none !important;
    }
    
    /* Header action buttons become uniform 36x36 touch icon buttons */
    .header-actions .btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        padding: 0 !important;
        display: inline-flex;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
        flex-shrink: 0 !important;
    }
    .header-actions .btn[style*="display: none"],
    .header-actions .btn[style*="display:none"] {
        display: none !important;
    }
    #btnHeaderBroadcast,
    #btnOpenPortalModal,
    #btnHeaderLogAktivitas,
    #btnHeaderDiagnostik {
        display: none !important;
    }
    .header-actions .btn span {
        display: none !important;
    }
    .header-actions .btn-lock {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        border-radius: 8px !important;
        flex-shrink: 0 !important;
    }
    .date-display { display: none !important; }

    /* Toolbar & Search across all views */
    .toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
        margin-bottom: 1rem !important;
    }
    .search-box {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .search-box input {
        min-height: 44px !important;
        font-size: 16px !important;
        border-radius: 10px !important;
    }
    .filters-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.45rem !important;
        width: 100% !important;
    }
    .filters-group select,
    .form-select-inline {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 16px !important;
    }
    .toolbar-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    .toolbar-actions .btn {
        min-height: 44px !important;
        padding: 0.5rem 0.65rem !important;
        font-size: 0.84rem !important;
        font-weight: 600 !important;
        display: inline-flex;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.35rem !important;
    }
    .toolbar-actions .btn[style*="display: none"],
    .toolbar-actions .btn[style*="display:none"],
    .toolbar-actions [style*="display: none"],
    .toolbar-actions [style*="display:none"] {
        display: none !important;
    }
    .toolbar-actions .btn-primary-action {
        grid-column: 1 / -1 !important;
        min-height: 46px !important;
        font-size: 0.92rem !important;
        font-weight: 700 !important;
    }

    /* Dashboard on Mobile */
    #dashboardSyncStatus {
        padding: 0.75rem 0.85rem !important;
        font-size: 0.82rem !important;
        gap: 0.65rem !important;
        border-radius: 14px !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    #dashboardSyncStatus > div:first-child {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 0.5rem !important;
        flex-wrap: wrap !important;
    }
    #dashboardSyncStatus > div:last-child {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 0.5rem !important;
        padding-top: 0.45rem !important;
        border-top: 1px dashed rgba(16, 185, 129, 0.25) !important;
        flex-wrap: wrap !important;
    }
    #dashboardSyncStatus > div:last-child button {
        flex: 1 1 auto !important;
        min-height: 38px !important;
        justify-content: center !important;
    }
    .dashboard-bottom-grid {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.65rem !important;
    }
    .stat-card {
        padding: 0.85rem 0.65rem !important;
        border-radius: 12px !important;
        flex-direction: column !important;
        text-align: center !important;
        gap: 0.35rem !important;
    }
    .stat-icon {
        margin: 0 auto !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 1.15rem !important;
    }
    .stat-details h3 {
        font-size: 0.74rem !important;
        color: #64748b !important;
        font-weight: 600 !important;
    }
    .stat-number {
        font-size: clamp(0.92rem, 3.4vw, 1.15rem) !important;
        font-weight: 800 !important;
        color: #0f172a !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        width: 100% !important;
        letter-spacing: -0.2px !important;
    }

    /* Charts */
    .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }
    .chart-box {
        height: 195px !important;
    }
    .chart-footer-summary {
        justify-content: center !important;
        gap: 0.35rem !important;
    }
    .chart-pill {
        font-size: 0.72rem !important;
        padding: 0.28rem 0.55rem !important;
        text-align: center !important;
    }

    /* ALL FEATURE GRIDS FORCED TO RESPONSIVE 1-COLUMN */
    .ronda-days-grid,
    #rondaDaysGrid,
    .saran-grid,
    #saranGrid,
    .kegiatan-grid,
    #kegiatanGrid,
    .kontak-grid,
    #kontakGrid,
    .pengurus-grid,
    #pengurusGrid,
    .settings-grid,
    .dashboard-stats {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
        width: 100% !important;
    }

    /* Subtabs Aset Navigation Responsive 50/50 */
    .aset-tabs-nav {
        display: flex !important;
        gap: 6px !important;
        margin-bottom: 0.85rem !important;
        padding-bottom: 0.5rem !important;
        width: 100% !important;
    }
    .aset-tabs-nav .btn {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 0.55rem 0.35rem !important;
        font-size: 0.78rem !important;
        white-space: normal !important;
        text-align: center !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        line-height: 1.25 !important;
        border-radius: 10px !important;
    }

    /* Ronda & Saran Tabs Nav: Sleek Horizontal Scrollable Pills */
    .ronda-tabs-nav,
    .saran-tabs-nav {
        display: flex !important;
        gap: 8px !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        margin-bottom: 0.85rem !important;
        padding-bottom: 0.4rem !important;
        width: 100% !important;
        border-bottom: 1.5px solid var(--border) !important;
    }
    .ronda-tabs-nav::-webkit-scrollbar,
    .saran-tabs-nav::-webkit-scrollbar {
        display: none !important;
    }
    .ronda-tabs-nav .btn,
    .saran-tabs-nav .btn {
        flex: 0 0 auto !important;
        min-width: max-content !important;
        padding: 0.55rem 0.95rem !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
        border-radius: 999px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
    }

    /* Ronda Banner Actions Mobile */
    #containerRondaJadwal .btn {
        flex: 1 1 calc(50% - 0.5rem) !important;
        font-size: 0.78rem !important;
        padding: 0.55rem 0.65rem !important;
        min-height: 42px !important;
        justify-content: center !important;
        text-align: center !important;
    }
    #btnBroadcastRondaHariIni {
        flex: 1 1 100% !important;
    }

    /* WhatsApp Broadcast Center Mobile */
    .broadcast-hero {
        padding: 1.1rem 0.9rem !important;
        border-radius: 14px !important;
    }
    .broadcast-hero h2 {
        font-size: 1.15rem !important;
    }
    .broadcast-hero p {
        font-size: 0.82rem !important;
    }
    #broadcastDateTimeRow,
    #broadcastPersonalBox {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }
    #broadcastTargetGrid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    /* WhatsApp Broadcast Tabs on Mobile: Elegant 2-Column Grid */
    .broadcast-template-tabs {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        overflow-x: visible !important;
        padding-bottom: 0 !important;
        width: 100% !important;
    }
    .btn-template-tab {
        width: 100% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        padding: 0.6rem 0.75rem !important;
        font-size: 0.76rem !important;
        font-weight: 700 !important;
        white-space: normal !important;
        line-height: 1.25 !important;
        text-align: left !important;
        border-radius: 10px !important;
        box-sizing: border-box !important;
    }
    .btn-template-tab:last-child {
        grid-column: span 2 !important;
        justify-content: center !important;
        text-align: center !important;
    }
    .wa-simulator-frame {
        border-width: 4px !important;
        border-radius: 16px !important;
    }
    .wa-sim-body {
        min-height: 200px !important;
        max-height: 380px !important;
        padding: 12px 10px !important;
    }
    .wa-sim-bubble {
        max-width: 100% !important;
        font-size: 0.8rem !important;
        padding: 8px 10px !important;
    }

    /* Kop Surat Resmi Laporan Kelurahan di Layar Mobile (Responsive Flexbox) */
    .kop-resmi {
        padding-bottom: 6px !important;
        margin-bottom: 12px !important;
    }
    .kop-container {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
    }
    .kop-logo-wrapper {
        flex-shrink: 0 !important;
    }
    .kop-logo-img {
        width: 44px !important;
        height: auto !important;
        max-height: 55px !important;
        object-fit: contain !important;
    }
    .kop-text-wrapper {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        text-align: center !important;
    }
    .kop-title-1 {
        font-size: 8.8pt !important;
        line-height: 1.2 !important;
        letter-spacing: 0 !important;
    }
    .kop-title-2 {
        font-size: 8.2pt !important;
        line-height: 1.2 !important;
        letter-spacing: 0 !important;
    }
    .kop-title-3 {
        font-size: 8.2pt !important;
        line-height: 1.2 !important;
        letter-spacing: 0 !important;
    }
    .kop-title-4 {
        font-size: 9.2pt !important;
        line-height: 1.25 !important;
        letter-spacing: 0 !important;
    }
    .kop-subtext {
        font-size: 6.8pt !important;
        line-height: 1.25 !important;
        margin-top: 2px !important;
    }

    /* Laporan Kelurahan Subtabs & Tables Mobile */
    .laporan-subtab .card-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    .laporan-subtab .card-header > div:last-child {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.5rem !important;
    }
    .laporan-subtab .card-header .btn {
        width: 100% !important;
        min-height: 44px !important;
        justify-content: center !important;
    }
    #printAreaLaporanDemografi {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 0.5rem !important;
    }
    #modalUniversalPrintDoc .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px !important;
    }
    #modalUniversalPrintDoc .modal-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        padding: 0.85rem 1rem !important;
    }
    #modalUniversalPrintDoc .modal-header > div:last-child {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        width: 100% !important;
    }
    #modalUniversalPrintDoc .modal-header > div:last-child button {
        width: 100% !important;
        min-height: 40px !important;
        justify-content: center !important;
        font-size: 0.78rem !important;
        padding: 0.4rem 0.6rem !important;
    }
    #modalUniversalPrintDoc .modal-header > div:last-child .close-modal-btn {
        grid-column: span 2 !important;
        background: rgba(255, 255, 255, 0.25) !important;
        min-height: 36px !important;
    }
    #docPrintBody,
    #modalPrintDocBody {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0.65rem !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    #modalUniversalPrintDoc > .modal-content > div:last-child {
        flex-direction: column !important;
        gap: 0.65rem !important;
        padding: 0.75rem 1rem !important;
    }
    #modalUniversalPrintDoc > .modal-content > div:last-child > div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        width: 100% !important;
    }
    #modalUniversalPrintDoc > .modal-content > div:last-child > div:last-child button {
        width: 100% !important;
        min-height: 42px !important;
        justify-content: center !important;
    }
    #modalUniversalPrintDoc > .modal-content > div:last-child > div:last-child button:last-child {
        grid-column: span 2 !important;
    }

    /* Table Responsive Wrapper & Horizonal Scrolling Guards */
    .table-responsive-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 10px !important;
        border: 1px solid var(--border) !important;
    }
    .table-responsive-wrapper .data-table {
        min-width: 920px !important;
        width: max-content !important;
    }
    .table-responsive-wrapper .data-table th,
    .table-responsive-wrapper .data-table td {
        white-space: nowrap !important;
        padding: 8px 10px !important;
    }
    .table-responsive-wrapper .data-table td:nth-child(2) {
        white-space: normal !important;
        min-width: 140px !important;
    }

    /* Desktop Views hidden, Mobile cards visible */
    .warga-desktop-view,
    .iuran-desktop-view,
    .usaha-desktop-view,
    .surat-desktop-table,
    .aset-desktop-table,
    .pinjam-aset-desktop-table,
    .tamu-desktop-view,
    .patroli-desktop-view {
        display: none !important;
    }
    .warga-mobile-view,
    .iuran-mobile-view,
    .usaha-mobile-view,
    .surat-mobile-view,
    .aset-mobile-view,
    .pinjam-aset-mobile-view,
    .tamu-mobile-view,
    .patroli-mobile-view {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }

    /* Tablet 2-Column Responsive Card Grid (580px - 768px) */
    @media (min-width: 580px) and (max-width: 768px) {
        .warga-mobile-view,
        .iuran-mobile-view,
        .usaha-mobile-view,
        .aset-mobile-view,
        .pinjam-aset-mobile-view,
        .tamu-mobile-view,
        .patroli-mobile-view {
            display: grid !important;
            grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
            gap: 0.85rem !important;
        }
    }

    /* Toolbar Button Groups on Mobile & Tablet */
    .toolbar-btn-group {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        align-items: center;
    }
    .toolbar-btn-group .btn {
        min-height: 42px;
    }
    @media (max-width: 768px) {
        .toolbar-btn-group {
            display: grid !important;
            grid-template-columns: 1fr 1fr !important;
            gap: 0.5rem !important;
            width: 100% !important;
        }
        .toolbar-btn-group .btn {
            width: 100% !important;
            min-height: 42px !important;
            font-size: 0.8rem !important;
            padding: 0.45rem 0.5rem !important;
            justify-content: center !important;
            text-align: center !important;
        }
        .toolbar-btn-group .btn-primary-action,
        .toolbar-btn-group .btn-full-mobile {
            grid-column: 1 / -1 !important;
        }
    }

    /* Word wrapping guards to prevent clipping across all components */
    .view-section, .card, .stat-card, .kk-group, .warga-card-mobile, .iuran-mobile-card, .usaha-mobile-card, .aset-card-mobile, .pinjam-aset-card-mobile, .kontak-card, .kegiatan-card, .pengumuman-card, .ronda-card, .saran-card, .modal-content, .modal-body, .wcm-item, .wcm-name, .wcm-body, .wcm-badges, .form-group, .badge {
        max-width: 100% !important;
        box-sizing: border-box !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }
    h1, h2, h3, h4, .pengumuman-judul, .stat-number, .card-header, .kop-resmi {
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }

    /* Pengumuman Card Layout di Mobile: Judul Full Width di Atas, Tombol Aksi di Bawah Rapi */
    .pengumuman-card {
        padding: 1rem 1.1rem !important;
    }
    .pengumuman-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
        margin-bottom: 0.75rem !important;
    }
    .pengumuman-judul {
        font-size: 1.05rem !important;
        font-weight: 800 !important;
        color: var(--text-main) !important;
        line-height: 1.4 !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        width: 100% !important;
    }
    .pengumuman-header .action-buttons {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.45rem !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding-top: 0.25rem !important;
    }
    .pengumuman-header .action-buttons .btn-icon {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        border-radius: 10px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .pengumuman-isi {
        font-size: 0.88rem !important;
        line-height: 1.6 !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }
    .warga-card-mobile i, .iuran-mobile-card i, .usaha-mobile-card i, .kontak-card i, .kegiatan-card i, .pengumuman-card i, .btn i, .badge i, .stat-card i, .header-actions i, .mobile-bottom-nav i {
        flex-shrink: 0 !important;
    }
    .wcm-body {
        grid-template-columns: 1fr !important;
        gap: 0.4rem !important;
    }
    .wcm-item {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        min-width: 0 !important;
        word-break: break-word !important;
    }
    .wcm-item span {
        min-width: 0 !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }

    /* Tables for sections without card views (Aset, Laporan, Log) */
    .table-container {
        border-radius: 12px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border: 1px solid var(--border) !important;
        max-width: 100% !important;
    }
    table {
        min-width: 520px !important;
        font-size: 0.82rem !important;
    }
    th {
        padding: 0.65rem 0.5rem !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
    }
    td {
        padding: 0.65rem 0.5rem !important;
        line-height: 1.4 !important;
    }

    /* KK Group Cards */
    .kk-group {
        border-radius: 14px !important;
        margin-bottom: 0.85rem !important;
        border: 1.5px solid var(--border) !important;
    }
    .kk-header {
        padding: 0.85rem 1rem !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.6rem !important;
    }
    .kk-header h3 {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
    }
    .kk-subinfo {
        font-size: 0.8rem !important;
    }
    .kk-member-card {
        padding: 0.85rem 1rem !important;
    }

    /* Laporan Kelurahan Tabs on Mobile */
    .laporan-tabs {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.45rem !important;
        width: 100% !important;
    }
    .laporan-tabs .tab-btn {
        width: 100% !important;
        text-align: left !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.85rem !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        border-radius: 10px !important;
        line-height: 1.35 !important;
        white-space: normal !important;
    }

    /* Kas & Iuran Tabs on Mobile */
    .iuran-tabs:not(.laporan-tabs) {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.35rem !important;
    }
    .iuran-top-stats {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
        margin-bottom: 1rem !important;
    }

    /* Surat Pengantar on Mobile */
    .surat-type-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.65rem !important;
        margin-bottom: 1rem !important;
    }
    .surat-type-card {
        padding: 0.85rem 0.5rem !important;
        border-radius: 12px !important;
        gap: 0.35rem !important;
        min-height: 78px !important;
    }
    .surat-type-card i {
        font-size: 1.35rem !important;
    }
    .surat-type-card span {
        font-size: 0.76rem !important;
        font-weight: 600 !important;
        line-height: 1.25 !important;
    }
    .surat-preview-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0.25rem 0 !important;
    }
    .surat-preview {
        min-width: 320px !important;
        max-width: 100% !important;
        padding: 16px 12px !important;
        font-size: 8.5pt !important;
        line-height: 1.45 !important;
        box-sizing: border-box !important;
    }
    .surat-preview-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    .surat-preview-actions .btn {
        width: 100% !important;
        min-height: 46px !important;
        font-size: 0.92rem !important;
        font-weight: 700 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Auditor Activity & Problem Log Views Mobile Ergonomics */
    .view-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    #logAktivitasView .view-header > div:last-child,
    #logProblemView .view-header > div:last-child {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        width: 100% !important;
    }
    #logAktivitasView .view-header > div:last-child .btn,
    #logProblemView .view-header > div:last-child .btn {
        width: 100% !important;
        min-height: 42px !important;
        justify-content: center !important;
        font-size: 0.8rem !important;
        padding: 0.45rem 0.6rem !important;
    }
    #logAktivitasView .view-header > div:last-child .btn:last-child,
    #logProblemView .view-header > div:last-child .btn:last-child {
        grid-column: span 2 !important;
    }

    /* Filter Toolbars in Auditor Views on Mobile */
    #logAktivitasView .card > div,
    #logProblemView .card > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
        width: 100% !important;
    }
    #filterAuditSearch, #filterAuditSource, #filterAuditActor,
    #filterProblemSearch, #filterProblemSeverity {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 16px !important;
        box-sizing: border-box !important;
    }
    #logAktivitasView .card > div > div,
    #logProblemView .card > div > div {
        min-width: 100% !important;
        width: 100% !important;
    }

    /* Banner Cloud Notice in Auditor View */
    #bannerSupabaseAuditLogNotice {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    #bannerSupabaseAuditLogNotice .btn {
        width: 100% !important;
        min-height: 42px !important;
        justify-content: center !important;
    }

    /* Matriks Diagnostik 6 RT 1 RW Mobile Responsive */
    #auditorHealthMatrixGrid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100% !important;
    }
    #btnRefreshMatrix, #btnTestTgAlert {
        width: 100% !important;
        min-height: 42px !important;
        justify-content: center !important;
    }

    /* Floating Error Monitor Badge Mobile Safe Positioning */
    #errorMonitorBadge {
        bottom: calc(74px + env(safe-area-inset-bottom, 16px)) !important;
        right: 12px !important;
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
        border-radius: 25px !important;
        box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45) !important;
    }

    /* Error Monitor Modal Mobile Footer 2-Column Grid */
    #errorMonitorModal .modal-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
        padding: 0.85rem 1rem !important;
    }
    #errorMonitorModal .modal-footer > div:first-child,
    #errorMonitorModal .modal-footer > div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        width: 100% !important;
    }
    #errorMonitorModal .modal-footer .btn {
        width: 100% !important;
        min-height: 42px !important;
        justify-content: center !important;
        font-size: 0.82rem !important;
        padding: 0.4rem 0.6rem !important;
    }

    /* Scan KK Modal Mobile Dropzone & Enhancements */
    #scanKkDropzone {
        padding: 1.25rem 0.85rem !important;
        border-radius: 14px !important;
    }
    #scanKkDropzone > div:nth-child(4) {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    #scanKkDropzone .btn {
        width: 100% !important;
        min-height: 44px !important;
        justify-content: center !important;
    }
    #scanKkPreviewContainer > div:first-child {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
    }
    #scanKkPreviewContainer > div:first-child > div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        width: 100% !important;
    }
    #scanKkPreviewContainer > div:first-child > div:last-child .btn {
        width: 100% !important;
        min-height: 38px !important;
        justify-content: center !important;
    }
    #btnProcessKkOcr {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 0.95rem !important;
        padding: 0.75rem 1rem !important;
        justify-content: center !important;
    }

    /* Modal SQL Helper Mobile */
    #modalSqlHelper .modal-footer {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        width: 100% !important;
    }
    #modalSqlHelper .modal-footer .btn {
        width: 100% !important;
        min-height: 44px !important;
        justify-content: center !important;
    }

    /* Kontrakan/Pemilik Rumah row on mobile */
    #rowPemilikRumah {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .log-table-wrapper {
        border-radius: 12px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Modals on Mobile: full fit, sticky header, scrollable body, zero clipping */
    .modal-overlay {
        padding: 0.4rem !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .modal-content {
        max-height: 94dvh !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 18px !important;
        margin: auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    .modal-header {
        flex-shrink: 0 !important;
        padding: 0.85rem 1.1rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
    }
    .modal-header h2, .modal-header h3 {
        font-size: clamp(0.92rem, 3.6vw, 1.12rem) !important;
        line-height: 1.3 !important;
        word-break: break-word !important;
        min-width: 0 !important;
        flex: 1 !important;
    }
    .modal-body {
        flex: 1 1 auto !important;
        padding: 1rem !important;
        max-height: none !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }
    .modal-footer, .form-actions {
        flex-shrink: 0 !important;
        display: flex !important;
        flex-direction: row-reverse !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .form-actions .btn, .modal-footer .btn {
        flex: 1 1 calc(50% - 0.5rem) !important;
        min-width: 120px !important;
        min-height: 44px !important;
        font-size: 0.88rem !important;
        font-weight: 700 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }
    .form-actions .btn:only-child, .modal-footer .btn:only-child {
        flex: 1 1 100% !important;
    }
    .form-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    .form-group label {
        font-size: 0.82rem !important;
        font-weight: 600 !important;
        margin-bottom: 0.3rem !important;
        color: #334155 !important;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px !important;
        font-size: 16px !important;
        border-radius: 10px !important;
    }

    /* Scanner KK & OCR Form on Mobile Gadgets */
    .extracted-members-container {
        background: transparent !important;
        border: none !important;
        overflow: visible !important;
    }
    .extracted-members-table,
    .extracted-members-table thead,
    .extracted-members-table tbody,
    .extracted-members-table tr,
    .extracted-members-table td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .extracted-members-table thead {
        display: none !important;
    }
    .extracted-members-table tr.scan-member-row {
        background: #ffffff !important;
        border: 1.5px solid #cbd5e1 !important;
        border-radius: 14px !important;
        padding: 0.9rem !important;
        margin-bottom: 0.85rem !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.55rem !important;
    }
    .extracted-members-table td {
        padding: 0 !important;
        border: none !important;
    }
    .scan-card-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding-bottom: 0.5rem !important;
        margin-bottom: 0.35rem !important;
        border-bottom: 1.5px solid #f1f5f9 !important;
    }
    .scan-badge-num {
        background: #ecfdf5 !important;
        color: #065f46 !important;
        font-weight: 800 !important;
        font-size: 0.82rem !important;
        padding: 4px 12px !important;
        border-radius: 20px !important;
        border: 1px solid #a7f3d0 !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
    .scan-btn-delete {
        padding: 0.35rem 0.75rem !important;
        font-size: 0.78rem !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
    }
    .scan-field-label {
        display: block !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        color: #475569 !important;
        margin-bottom: 0.25rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
    }
    .scan-col-action {
        display: none !important;
    }
    .scan-col-head {
        display: block !important;
    }
    .extracted-members-table input,
    .extracted-members-table select {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 16px !important;
        border-radius: 10px !important;
        border: 1.5px solid #cbd5e1 !important;
        padding: 0.55rem 0.85rem !important;
        background: #f8fafc !important;
        color: #0f172a !important;
    }
    .extracted-members-table input:focus,
    .extracted-members-table select:focus {
        background: #ffffff !important;
        border-color: #059669 !important;
        box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15) !important;
    }
    .scan-kk-footer-actions {
        flex-direction: column-reverse !important;
        width: 100% !important;
        gap: 0.5rem !important;
    }
    .scan-kk-footer-actions .btn {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 0.95rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Telegram Incident Hub & Pusat Komando RW Responsive */
    #cardTelegramAlertSetting .card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    #cardTelegramAlertSetting .card-header h2 {
        font-size: clamp(0.92rem, 3.8vw, 1.1rem) !important;
        line-height: 1.3 !important;
    }
    #cardTelegramAlertSetting .card-body {
        padding: 0.85rem !important;
    }
    #cardTelegramAlertSetting [style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    #cardTelegramAlertSetting .card-body > div:last-child {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    #cardTelegramAlertSetting .card-body > div:last-child button {
        width: 100% !important;
        min-height: 44px !important;
        justify-content: center !important;
    }

    /* Form Rows Responsive Utilities */
    .form-row-responsive {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }
    .toolbar-actions {
        grid-template-columns: 1fr 1fr !important;
    }
    .tab-btn {
        text-align: center !important;
        padding: 0.55rem 0.25rem !important;
        font-size: 0.78rem !important;
    }
    .wcm-body {
        grid-template-columns: 1fr !important;
    }
    
    /* Extra touch size on small phones */
    .btn {
        min-height: 44px !important;
        padding: 0.6rem 0.85rem !important;
        font-size: 0.88rem !important;
    }
    .btn-sm, .wcm-actions .btn, .btn-action-icon {
        min-height: 36px !important;
        padding: 0.35rem 0.65rem !important;
        font-size: 0.78rem !important;
    }
    .wcm-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.4rem !important;
        justify-content: flex-start !important;
        align-items: center !important;
    }
    .search-box input {
        min-height: 44px !important;
        font-size: 16px !important;
        padding: 0.6rem 0.85rem 0.6rem 2.5rem !important;
    }
    .stat-card {
        padding: 0.75rem 0.5rem !important;
    }
    .stat-number {
        font-size: clamp(0.85rem, 3.2vw, 1.05rem) !important;
    }
    .pin-key {
        height: 48px !important;
        font-size: 1.2rem !important;
    }
    .login-screen {
        padding: 0.75rem 0.5rem calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
        align-items: center !important;
    }
    .login-card {
        padding: 1.65rem 1.25rem 1.35rem !important;
        border-radius: 22px !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .login-logo-img {
        width: 76px !important;
        height: 76px !important;
    }
}

/* ===== ULTRA-COMPACT MOBILE PHONES (<= 380px) ===== */
@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    .toolbar-actions {
        grid-template-columns: 1fr !important;
    }
    .toolbar-btn-group {
        grid-template-columns: 1fr !important;
    }
    .form-actions .btn, .modal-footer .btn {
        flex: 1 1 100% !important;
        width: 100% !important;
    }
    .header-title h1 {
        font-size: 0.95rem !important;
    }
}

/* ===== LANDSCAPE ROTATION (HP Miring <= 550px Height) ===== */
@media (orientation: landscape) and (max-height: 550px) {
    .login-screen {
        min-height: 100vh !important;
        padding: 0.75rem !important;
        align-items: flex-start !important;
        overflow-y: auto !important;
    }
    .login-card {
        margin: auto !important;
        padding: 1rem !important;
    }
    .top-header {
        padding: 0.35rem 0.85rem !important;
        min-height: 46px !important;
    }
    .top-header h1 {
        font-size: 1rem !important;
    }
    .views-container {
        padding: 0.5rem 0.85rem calc(55px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .mobile-bottom-nav {
        height: calc(48px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .mobile-nav-item {
        padding: 2px 0 !important;
        font-size: 0.68rem !important;
    }
    .mobile-nav-item i {
        font-size: 1rem !important;
    }
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.5rem !important;
    }
    .stat-card {
        padding: 0.5rem 0.6rem !important;
    }
    .modal-content {
        max-height: 96dvh !important;
    }
}




/* ===== TOMBOL LIHAT KK & KELUARGA (DATA WARGA) ===== */
.btn-lihat-kk-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
    outline: none;
    text-decoration: none;
}
.btn-lihat-kk-pill:hover {
    background: #1e40af;
    border-color: #1e40af;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.25);
}
.btn-lihat-kk-pill:active {
    transform: scale(0.96);
}

/* ===== AUDITOR LOG AKTIVITAS & PROBLEM MONITOR STYLES ===== */
.badge-source {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}
.badge-source-warga {
    background: #ecfeff;
    color: #0e7490;
    border: 1px solid #a5f3fc;
}
.badge-source-web {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.badge-source-desktop {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.badge-severity {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-severity-critical {
    background: #450a0a;
    color: #fecaca;
    border: 1px solid #991b1b;
}
.badge-severity-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.badge-severity-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.badge-severity-info {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.log-table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.log-row-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
    word-break: break-word;
}
.log-code-box {
    background: #0f172a;
    color: #38bdf8;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    overflow-x: auto;
    border: 1px solid #1e293b;
    margin-top: 6px;
}
.auditor-only-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #f59e0b;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ===== PUSAT BROADCAST WHATSAPP ===== */
.broadcast-layout {
    display: grid;
    grid-template-columns: 1.12fr 0.88fr;
    gap: 1.25rem;
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.broadcast-layout > * {
    min-width: 0;
    max-width: 100%;
}
@media (max-width: 960px) {
    .broadcast-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }
}
.broadcast-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.broadcast-template-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    padding-bottom: 6px;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.broadcast-template-tabs::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
.table-scroll-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #0369a1;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 5px 10px;
    margin-bottom: 6px;
}
/* Mutasi & Penghapusan Warga Action Cards */
.btn-mutasi-action {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    white-space: normal !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.btn-mutasi-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.btn-mutasi-action:active {
    transform: translateY(0);
}
.btn-template-tab {
    padding: 0.55rem 0.95rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.btn-template-tab:hover {
    border-color: #10b981;
    color: #047857;
    background: #ecfdf5;
}
.btn-template-tab.active {
    border-color: #059669;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(5,150,105,0.25);
}

/* WhatsApp Phone & Chat Simulator */
.wa-simulator-frame {
    background: #0b141a;
    border-radius: 20px;
    border: 8px solid #1f2c34;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.wa-sim-header {
    background: #202c33;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e9edef;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    min-width: 0;
    box-sizing: border-box;
}
.wa-sim-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #25d366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.wa-sim-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    color: #e9edef;
}
.wa-sim-sub {
    font-size: 0.72rem;
    color: #8696a0;
}
.wa-sim-body {
    background: #0b141a;
    background-image: radial-gradient(#1f2c34 1px, transparent 1px);
    background-size: 18px 18px;
    padding: 16px 12px;
    min-height: 320px;
    max-height: 520px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-sizing: border-box;
}
.wa-sim-bubble {
    align-self: flex-end;
    background: #005c4b;
    color: #e9edef;
    border-radius: 12px 0px 12px 12px;
    padding: 10px 12px;
    max-width: 94%;
    font-size: 0.83rem;
    line-height: 1.45;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    font-family: inherit;
    box-sizing: border-box;
}
.wa-sim-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    color: #8696a0;
    margin-top: 4px;
}
.wa-sim-meta i {
    color: #53bdeb;
    font-size: 0.75rem;
}

/* Responsif Pusat Broadcast WhatsApp di Mobile HP */
@media (max-width: 640px) {
    .broadcast-hero {
        padding: 1rem 1.1rem !important;
        border-radius: 12px !important;
    }
    .broadcast-hero h2 {
        font-size: 1.15rem !important;
    }
    .broadcast-card {
        padding: 0.95rem !important;
    }
    #broadcastDateTimeRow {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }
    #broadcastPersonalBox > div {
        grid-template-columns: 1fr !important;
    }
    .broadcast-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.6rem !important;
    }
    .broadcast-actions .btn-broadcast-send {
        width: 100% !important;
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }
    .broadcast-actions .btn-broadcast-copy {
        flex: 1 !important;
    }
    .wa-simulator-frame {
        border-width: 4px !important;
        border-radius: 14px !important;
    }
    .wa-sim-body {
        padding: 12px 8px !important;
    }
    .wa-sim-bubble {
        max-width: 100% !important;
    }
}

/* ===== HIGH-PRIORITY PENGURUS NOTIFICATION SYSTEM & MENU BADGES ===== */

/* 1. Lencana Menu Sidebar (Unified Menu Badge System) */
.nav-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid rgba(2, 132, 199, 0.25);
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    letter-spacing: -0.2px;
}

.nav-item.active .nav-badge {
    background: #ffffff;
    color: #1d4ed8;
    border-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.nav-badge-urgent {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.45) !important;
    animation: pulseUrgentBadge 2.2s infinite ease-in-out;
}

.nav-badge-warning {
    background: #f59e0b !important;
    color: #ffffff !important;
    border-color: #d97706 !important;
    box-shadow: 0 1px 6px rgba(245, 158, 11, 0.35) !important;
}

.nav-badge-success {
    background: #10b981 !important;
    color: #ffffff !important;
    border-color: #059669 !important;
}

.nav-badge-purple {
    background: #8b5cf6 !important;
    color: #ffffff !important;
    border-color: #7c3aed !important;
}

.nav-badge-wa {
    background: #25d366 !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
    font-weight: 900 !important;
}

@keyframes pulseUrgentBadge {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* 2. Lencana Tombol Mobile Bottom Bar */
.mobile-nav-item {
    position: relative;
}

.mobile-nav-badge {
    position: absolute;
    top: 3px;
    right: calc(50% - 19px);
    background: #ef4444;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    z-index: 10;
}

.mobile-nav-badge-total {
    background: #dc2626;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.6);
    animation: pulseUrgentBadge 2s infinite ease-in-out;
}

/* 3. Floating Heads-Up Actionable Notification Container & Cards */
.heads-up-container {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: calc(100vw - 36px);
    pointer-events: none;
}

.heads-up-card {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: headsUpSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transition: transform 0.25s ease, opacity 0.25s ease;
    position: relative;
    overflow: hidden;
}

.heads-up-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4.5px;
    background: linear-gradient(180deg, #ef4444 0%, #f59e0b 50%, #3b82f6 100%);
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.heads-up-card.leaving {
    animation: headsUpSlideOut 0.3s ease forwards;
}

@keyframes headsUpSlideIn {
    0% { opacity: 0; transform: translate3d(40px, -15px, 0) scale(0.94); }
    100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes headsUpSlideOut {
    0% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
    100% { opacity: 0; transform: translate3d(40px, -15px, 0) scale(0.92); }
}

.heads-up-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.heads-up-content {
    flex: 1;
    min-width: 0;
}

.heads-up-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

.heads-up-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.88rem;
    color: #f8fafc;
    letter-spacing: -0.2px;
    line-height: 1.25;
    word-break: normal;
    overflow-wrap: break-word;
}

.heads-up-time {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 600;
    flex-shrink: 0;
}

.heads-up-body {
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.35;
    margin-bottom: 8px;
    word-break: break-word;
}

.heads-up-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.heads-up-btn-open {
    background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%);
    color: #ffffff;
    border: none;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.73rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
    transition: transform 0.15s ease;
}

.heads-up-btn-open:hover {
    transform: scale(1.03);
}

.heads-up-btn-close {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #94a3b8;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.72rem;
    cursor: pointer;
}

.heads-up-btn-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* ===== QUICK FILTER PILLS (BANSOS, DTKS, LANSIA, DISABILITAS) ===== */
.quick-filter-pills {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
    padding: 0.5rem 0.75rem;
    background: #f1f5f9;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 100%;
}

.quick-filter-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 0.25rem;
}

.filter-pill {
    padding: 0.42rem 0.85rem;
    border-radius: 20px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.filter-pill:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.06);
}

.filter-pill.active {
    background: linear-gradient(135deg, #1d4ed8, #0284c7);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.35);
    font-weight: 700;
}

.filter-pill.active .pill-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.pill-count {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 2px;
    transition: all 0.2s ease;
}

.filter-pill.pill-bansos.active {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    box-shadow: 0 3px 10px rgba(217, 119, 6, 0.35);
}

.filter-pill.pill-lansia.active {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.35);
}

.filter-pill.pill-disabilitas.active {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.35);
}

.filter-pill.pill-balita.active {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.35);
}

.filter-pill.pill-sewa.active {
    background: linear-gradient(135deg, #ea580c, #f97316);
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.35);
}

.filter-pill.pill-pemilu.active {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.35);
}

/* Stiker QR Rumah Card & Grid */
.stiker-rumah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 10px 0;
}
.stiker-rumah-card {
    background: #ffffff;
    border: 2px solid #1e3a8a;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    page-break-inside: avoid;
    break-inside: avoid;
    box-sizing: border-box;
}
.stiker-rumah-header {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1.5px solid #1e3a8a;
    padding-bottom: 6px;
    margin-bottom: 8px;
}
.stiker-rumah-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.stiker-rumah-nomor {
    font-size: 1.6rem;
    font-weight: 900;
    color: #1e3a8a;
    line-height: 1.1;
    font-family: 'Outfit', sans-serif;
}
.stiker-rumah-kk {
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    margin-top: 4px;
}
.stiker-rumah-footer {
    border-top: 1px dashed #cbd5e1;
    margin-top: 8px;
    padding-top: 5px;
    font-size: 0.68rem;
    color: #64748b;
    text-align: center;
    font-weight: 600;
}

/* Print Optimization (Desktop & Mobile Friendly) */
@media print {
    .hide-print, .no-print {
        display: none !important;
    }
    .stiker-rumah-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .stiker-rumah-card {
        border: 2px solid #000000 !important;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .data-table, table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9pt !important;
    }
    .data-table th, .data-table td, table th, table td {
        border: 1px solid #333333 !important;
        padding: 4px 6px !important;
        color: #000000 !important;
    }
}

/* ==========================================================================
   UNIVERSAL DISPLAY GUARD:
   Elemen yang disembunyikan oleh JavaScript atau inline style WAJIB
   tetap tersembunyi 100% pada semua ukuran layar (Mobile/Tablet/Desktop).
   ========================================================================== */
[style*="display: none"],
[style*="display:none"],
.btn[style*="display: none"],
.btn[style*="display:none"],
.toolbar-actions .btn[style*="display: none"],
.toolbar-actions .btn[style*="display:none"],
.toolbar-actions label[style*="display: none"],
.toolbar-actions label[style*="display:none"],
.toolbar-actions [style*="display: none"],
.toolbar-actions [style*="display:none"],
.toolbar-btn-group .btn[style*="display: none"],
.toolbar-btn-group .btn[style*="display:none"],
.toolbar-btn-group [style*="display: none"],
.toolbar-btn-group [style*="display:none"],
.header-actions .btn[style*="display: none"],
.header-actions .btn[style*="display:none"] {
    display: none !important;
}
