/* =====================================================
   SI DATA KECAMATAN JEMBER — MODERN UI (PINK THEME)
   ===================================================== */

/* ---------- CSS VARIABLES ---------- */
:root {
    /* ===== PINK THEME ===== */
    --primary:        #db2777;
    --primary-dark:   #9d174d;
    --primary-light:  #fce7f3;
    --accent:         #f472b6;
    --accent-light:   #fdf2f8;

    /* ===== STATUS COLORS ===== */
    --success:        #16a34a;
    --success-light:  #f0fdf4;
    --danger:         #dc2626;
    --danger-light:   #fef2f2;
    --warning:        #f59e0b;
    --info:           #2563eb;
    --info-light:     #eff6ff;
    --purple:         #7c3aed;
    --purple-light:   #f5f3ff;

    /* ===== NEUTRAL ===== */
    --bg:             #fdf7fa;
    --card:           #ffffff;
    --text:           #1f1b24;
    --text-2:         #4b4453;
    --text-muted:     #9b93a3;
    --border:         #f0e4ea;
    --border-light:   #faf1f5;

    /* ===== SIDEBAR ===== */
    --sidebar-bg:     #1c0f1a;
    --sidebar-text:   #c4a8b8;
    --sidebar-active: #2d1825;
    --sidebar-w:      260px;

    /* ===== SHADOWS ===== */
    --shadow-xs: 0 1px 2px rgba(219,39,119,.05);
    --shadow-sm: 0 1px 3px rgba(219,39,119,.07), 0 1px 2px rgba(219,39,119,.04);
    --shadow:    0 4px 6px -1px rgba(219,39,119,.08), 0 2px 4px -2px rgba(219,39,119,.05);
    --shadow-md: 0 10px 15px -3px rgba(219,39,119,.10), 0 4px 6px -4px rgba(219,39,119,.05);
    --shadow-lg: 0 20px 25px -5px rgba(219,39,119,.12), 0 8px 10px -6px rgba(219,39,119,.06);

    /* ===== RADIUS & EASING ===== */
    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --ease: cubic-bezier(.4,0,.2,1);
}

/* ---------- RESET ---------- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
button { font-family: inherit; cursor: pointer; }

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background:
        radial-gradient(1200px 600px at 20% 10%, rgba(219,39,119,.55) 0%, transparent 60%),
        radial-gradient(900px 500px at 90% 90%, rgba(244,114,182,.45) 0%, transparent 55%),
        linear-gradient(135deg, #1a0d15 0%, #3d1a2f 55%, #4a1e3d 100%);
    position: relative; overflow: hidden;
}
.login-page::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255,255,255,.07) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 40px 40px, 60px 60px;
    pointer-events: none;
}
.login-card {
    width: 100%; max-width: 440px; position: relative; z-index: 2;
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 42px 36px 34px;
    box-shadow: 0 30px 60px -12px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.05);
    animation: popIn .45s var(--ease);
}
@keyframes popIn {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Logo fallback (inisial) */
.login-logo {
    width: 96px; height: 96px; border-radius: 24px;
    margin: 0 auto 22px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: #fff; font-weight: 800; font-size: 32px; letter-spacing: 1px;
    box-shadow: 0 12px 24px -6px rgba(219,39,119,.5);
}

/* Logo gambar — tanpa bingkai, ukuran besar */
.login-logo-img {
    background: transparent !important;
    padding: 0;
    width: 150px;
    height: 150px;
    border-radius: 0;
    box-shadow: none !important;
    margin: 0 auto 22px;
    overflow: visible;
}
.login-logo-img img {
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: 0;
    filter: drop-shadow(0 10px 24px rgba(219,39,119,.28));
}

.login-card h2 {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.3px;
    line-height: 1.25;
}
.login-card .sub {
    text-align: center;
    color: var(--primary);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .2px;
    margin-bottom: 28px;
    margin-top: 4px;
    line-height: 1.3;
}
.login-footer { text-align: center; margin-top: 22px; font-size: 12px; color: var(--text-muted); }

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

/* ---------- SIDEBAR ---------- */
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    transition: transform .3s var(--ease);
    will-change: transform;
    box-shadow: 2px 0 12px rgba(219,39,119,.06);
}
.sidebar.open { transform: translateX(0); }

.brand {
    display: flex; gap: 12px; align-items: center;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-logo {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: #fff; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; letter-spacing: .5px;
    box-shadow: 0 6px 14px -3px rgba(219,39,119,.55);
    overflow: hidden;
}
.brand-text { min-width: 0; flex: 1; }
.brand-text h1 {
    font-size: 14px; color: #fff; line-height: 1.25; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-text span {
    font-size: 11px; color: #8b6b7d; display: block;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- Logo gambar di sidebar ---- */
.brand-logo-img {
    background: #fff !important;
    padding: 4px;
    box-shadow: 0 6px 14px -3px rgba(219,39,119,.4) !important;
}
.brand-logo-img img {
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: #4a2a3a; border-radius: 4px; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 10px;
    color: var(--sidebar-text); font-weight: 500; font-size: 13.5px;
    transition: var(--ease); position: relative;
}
.nav-item:hover { background: var(--sidebar-active); color: #fce7f3; }
.nav-item.active {
    background: linear-gradient(90deg, #ec4899 0%, #db2777 100%);
    color: #fff;
    box-shadow: 0 8px 20px -6px rgba(219,39,119,.55);
}
.nav-item.active::before {
    content: ''; position: absolute; left: -12px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 24px; background: #f9a8d4; border-radius: 0 3px 3px 0;
}

/* =====================================================
   NAV GROUP (Menu dengan sub-menu)
   ===================================================== */
.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0;
}

/* ---- Parent (label grup, tidak bisa diklik) ---- */
.nav-parent {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--sidebar-text);
    font-weight: 600;
    font-size: 13.5px;
    border-radius: 10px;
    cursor: default;
    user-select: none;
    transition: var(--ease);
}
.nav-parent svg { opacity: .85; }
.nav-group.is-open .nav-parent {
    color: #fff;
}

/* ---- Sub-group container ---- */
.nav-subgroup {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 4px 0 8px 15px;
    padding-left: 12px;
    border-left: 2px solid rgba(255,255,255,.08);
    transition: var(--ease);
}
.nav-group.is-open .nav-subgroup {
    border-left-color: rgba(236,72,153,.5);
}

/* ---- Sub-menu items ---- */
.nav-item.nav-sub {
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    color: var(--sidebar-text);
    position: relative;
    gap: 10px;
}
.nav-item.nav-sub svg {
    width: 15px;
    height: 15px;
    opacity: .7;
    flex-shrink: 0;
}
.nav-item.nav-sub:hover {
    background: var(--sidebar-active);
    color: #fce7f3;
}
.nav-item.nav-sub:hover svg { opacity: 1; }

.nav-item.nav-sub.active {
    background: linear-gradient(90deg, #ec4899 0%, #db2777 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 16px -6px rgba(219,39,119,.55);
}
.nav-item.nav-sub.active svg { opacity: 1; }
.nav-item.nav-sub.active::before { display: none; }

/* ---- Badge jumlah data ---- */
.nav-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    padding: 0 7px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.85);
    line-height: 1;
    flex-shrink: 0;
    transition: var(--ease);
}
.nav-badge-success {
    background: rgba(22,163,74,.25);
    color: #86efac;
}
.nav-item.nav-sub.active .nav-badge {
    background: rgba(255,255,255,.25);
    color: #fff;
}
.nav-item.nav-sub:hover .nav-badge {
    background: rgba(255,255,255,.18);
}

.sidebar-footer {
    padding: 16px 20px; font-size: 11px; color: #6b4a5a;
    border-top: 1px solid rgba(255,255,255,.06);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- OVERLAY ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 15, 26, .55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 45;
    opacity: 0;
    transition: opacity .3s var(--ease);
    cursor: pointer;
}
.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ---------- MAIN ---------- */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

/* ---------- TOPBAR ---------- */
.topbar {
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    padding: 14px 28px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: 0 1px 0 rgba(219,39,119,.08);
    position: sticky; top: 0; z-index: 30;
}
.topbar-title {
    font-size: 17px; font-weight: 700; color: var(--text); flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
}

/* Logo mini di topbar */
.topbar-logo {
    width: 32px; height: 32px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
    background: #fff;
    padding: 2px;
    border: 1px solid var(--border-light);
}

/* ---------- HAMBURGER BUTTON ---------- */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-2);
    border-radius: 10px;
    transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease);
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.menu-toggle:hover,
.menu-toggle:focus-visible {
    background: var(--border-light);
    color: var(--primary);
    outline: none;
}
.menu-toggle:active { transform: scale(.94); }

.topbar-user { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: #fff; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    box-shadow: 0 4px 10px -2px rgba(219,39,119,.45);
    flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-info strong { font-size: 13px; color: var(--text); font-weight: 700; }
.user-info small { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

.content { padding: 28px 28px 60px; flex: 1; min-width: 0; }

/* =====================================================
   PAGE HEAD
   ===================================================== */
.page-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-head h3 {
    font-size: 20px; font-weight: 800; color: var(--text);
    letter-spacing: -.3px; line-height: 1.3;
}
.page-head p { font-size: 13.5px; color: var(--text-muted); margin-top: 2px; }

/* =====================================================
   TAB NAVIGASI (Camat Aktif / Arsip Nonaktif)
   ===================================================== */
.tab-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 22px;
    background: var(--card);
    padding: 6px;
    border-radius: 14px;
    box-shadow: var(--shadow-xs);
    border: 1px solid rgba(219,39,119,.06);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-2);
    transition: var(--ease);
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.tab-item svg { width: 16px; height: 16px; opacity: .75; }
.tab-item:hover { background: var(--border-light); color: var(--text); }
.tab-item.active {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: #fff;
    box-shadow: 0 6px 16px -4px rgba(219,39,119,.4);
}
.tab-item.active svg { opacity: 1; }

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 700;
    background: var(--border-light);
    color: var(--text-2);
    line-height: 1;
}
.tab-item.active .tab-badge {
    background: rgba(255,255,255,.25);
    color: #fff;
}
.tab-badge-success {
    background: var(--success-light);
    color: #15803d;
}

/* =====================================================
   CARD
   ===================================================== */
.card {
    background: var(--card); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px; overflow: hidden;
    border: 1px solid rgba(219,39,119,.06);
    transition: var(--ease);
}
.card:hover { box-shadow: var(--shadow); }
.card-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; flex-wrap: wrap;
}
.card-head h4 { font-size: 15px; font-weight: 700; color: var(--text); }
.card-body { padding: 22px; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border-radius: 10px; border: none;
    font-size: 13px; font-weight: 600; letter-spacing: -.1px;
    transition: var(--ease); white-space: nowrap; line-height: 1;
    font-family: inherit; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(219,39,119,.25); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(219,39,119,.35); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-secondary { background: var(--border-light); color: var(--text-2); }
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #1d4ed8; }
.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover { background: #1da851; }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }
.btn-logout {
    background: var(--primary-light); color: var(--primary-dark);
    padding: 8px 14px; font-size: 12.5px; font-weight: 600;
    border-radius: 8px; display: inline-flex; align-items: center;
    transition: var(--ease);
}
.btn-logout:hover { background: #fbcfe8; }

/* =====================================================
   FORM
   ===================================================== */
.form-group { margin-bottom: 18px; }
.form-group > label {
    display: block; font-weight: 600; margin-bottom: 7px;
    font-size: 13px; color: var(--text-2);
}
.form-group > label .req { color: var(--danger); }
.form-control {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border); border-radius: 10px;
    font-size: 13.5px; font-family: inherit;
    background: #fff; color: var(--text);
    transition: var(--ease); line-height: 1.5;
}
.form-control:hover:not(:focus) { border-color: #e5cbdb; }
.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(219,39,119,.12);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { min-height: 92px; resize: vertical; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}
.col-span-2 { grid-column: 1 / -1; }
.form-section-title {
    font-size: 12px; font-weight: 800; color: var(--primary);
    text-transform: uppercase; letter-spacing: .8px;
    padding-bottom: 10px; border-bottom: 2px solid var(--primary-light);
    margin: 26px 0 18px;
    display: flex; align-items: center; gap: 8px;
}
.form-section-title::before {
    content: ''; width: 4px; height: 14px;
    background: var(--primary); border-radius: 2px;
}
.form-section-title:first-child { margin-top: 0; }
.form-actions {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-top: 28px; padding-top: 22px;
    border-top: 1px solid var(--border-light);
}
.help-text { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }

/* =====================================================
   TABLE
   ===================================================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    background: var(--border-light); text-align: left;
    padding: 13px 16px; font-weight: 700; color: var(--text-2);
    font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
    border-bottom: 2px solid var(--border); white-space: nowrap;
}
tbody td {
    padding: 13px 16px; border-bottom: 1px solid var(--border-light);
    vertical-align: middle; color: var(--text);
}
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover { background: var(--border-light); }
tbody tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* =====================================================
   BADGE
   ===================================================== */
.badge {
    display: inline-block; padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; letter-spacing: .2px; line-height: 1.4;
}
.badge-success { background: var(--success-light); color: #15803d; }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: #1d4ed8; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-gray { background: var(--border-light); color: var(--text-2); }
.badge-ppats {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    color: #9d174d; border: 1px solid #f9a8d4;
}
.badge-non-ppats { background: var(--border-light); color: var(--text-muted); }

/* =====================================================
   ALERT
   ===================================================== */
.alert {
    padding: 14px 18px; border-radius: 12px; margin-bottom: 18px;
    font-size: 13.5px; font-weight: 500;
    display: flex; align-items: flex-start; gap: 10px;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-light); color: #15803d; border-color: #bbf7d0; }
.alert-danger { background: var(--danger-light); color: var(--danger); border-color: #fecaca; }
.alert-info { background: var(--info-light); color: #1d4ed8; border-color: #bfdbfe; }

/* =====================================================
   STAT CARDS
   ===================================================== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 22px;
}
.stat {
    background: var(--card); border-radius: var(--radius-lg);
    padding: 20px; display: flex; gap: 15px; align-items: center;
    box-shadow: var(--shadow-xs);
    border: 1px solid rgba(219,39,119,.06);
    transition: var(--ease); position: relative; overflow: hidden;
}
.stat::after {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px; background: var(--primary);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat.green::after { background: var(--success); }
.stat.orange::after { background: var(--warning); }
.stat.purple::after { background: var(--purple); }
.stat.info::after { background: var(--info); }

.stat-icon {
    width: 50px; height: 50px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-light); color: var(--primary);
    font-size: 22px; flex-shrink: 0;
}
.stat.green .stat-icon { background: var(--success-light); color: var(--success); }
.stat.orange .stat-icon { background: #fef3c7; color: var(--warning); }
.stat.purple .stat-icon { background: var(--purple-light); color: var(--purple); }
.stat.info .stat-icon { background: var(--info-light); color: var(--info); }

.stat-info { min-width: 0; }
.stat-info h4 {
    font-size: 22px; font-weight: 800; color: var(--text);
    line-height: 1.15; letter-spacing: -.5px;
}
.stat-info h4 small { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.stat-info p {
    font-size: 12px; color: var(--text-muted);
    font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
    margin-top: 3px;
}

/* =====================================================
   DETAIL
   ===================================================== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0 24px;
}
.detail-item { padding: 13px 0; border-bottom: 1px dashed var(--border); }
.detail-item:last-child { border-bottom: none; }
.detail-item .label {
    font-size: 11px; color: var(--text-muted);
    font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.detail-item .value {
    font-size: 14px; color: var(--text); font-weight: 600;
    margin-top: 3px; word-break: break-word;
}
.detail-item .value a { color: var(--primary); }
.detail-item .value a:hover { text-decoration: underline; }

.foto-profil {
    width: 130px; height: 165px; object-fit: cover;
    border-radius: 14px; border: 3px solid var(--primary-light);
    box-shadow: 0 4px 14px rgba(219,39,119,.14);
}
.foto-placeholder {
    width: 130px; height: 165px; border-radius: 14px;
    background: var(--border-light); border: 3px solid var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    color: #e5cbdb; font-size: 48px;
}

.peta-box {
    border-radius: 14px; overflow: hidden;
    border: 1px solid var(--border); background: var(--border-light);
    box-shadow: var(--shadow-sm);
}
.peta-box iframe { width: 100%; height: 420px; border: none; display: block; }

/* =====================================================
   FILTER BAR
   ===================================================== */
.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px; align-items: end;
}
.filter-bar .form-group { margin-bottom: 0; }

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty .icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }

/* =====================================================
   PROGRESS BAR
   ===================================================== */
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bar-label {
    width: 180px; font-size: 12.5px; color: var(--text-2);
    font-weight: 600; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; background: var(--border-light); border-radius: 20px;
    height: 22px; overflow: hidden;
}
.bar-fill {
    height: 100%; border-radius: 20px;
    background: linear-gradient(90deg, #be185d, #f472b6);
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: 8px; color: #fff; font-size: 11px; font-weight: 700;
    min-width: 30px; transition: width .8s var(--ease);
}
.bar-value { width: 40px; text-align: right; font-weight: 700; font-size: 13px; color: var(--text); }

/* =====================================================
   CONTACT LINKS
   ===================================================== */
.contact-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.contact-links a {
    padding: 8px 14px; border-radius: 9px; font-size: 12.5px;
    font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
    transition: var(--ease);
}
.contact-links .email { background: var(--info-light); color: #1d4ed8; }
.contact-links .email:hover { background: #dbeafe; }
.contact-links .wa { background: #dcfce7; color: #15803d; }
.contact-links .wa:hover { background: #bbf7d0; }
.contact-links .hp { background: #fef3c7; color: #b45309; }

/* =====================================================
   INFO PANEL (mutasi)
   ===================================================== */
.info-panel {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border: 1px solid #f9a8d4; border-radius: 14px;
    padding: 20px; margin-bottom: 22px;
    display: flex; gap: 16px; align-items: flex-start;
}
.info-panel .ip-icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    background: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 22px; box-shadow: var(--shadow-xs);
}
.info-panel .ip-body { flex: 1; min-width: 0; }
.info-panel .ip-body h5 {
    font-size: 14px; font-weight: 700; color: var(--primary-dark);
    margin-bottom: 4px;
}
.info-panel .ip-body p { font-size: 13px; color: #7f1d3f; line-height: 1.55; }
.info-panel .ip-body strong { color: var(--primary-dark); }

/* =====================================================
   SUMMARY CAMAT (mutasi)
   ===================================================== */
.summary-camat {
    display: flex; gap: 20px; align-items: center;
    padding: 18px; background: var(--border-light); border-radius: 14px;
    border: 1px solid var(--border); margin-bottom: 22px;
}
.summary-camat img,
.summary-camat .foto-placeholder-sm {
    width: 72px; height: 90px; border-radius: 10px;
    object-fit: cover; flex-shrink: 0;
    border: 2px solid var(--primary-light);
}
.summary-camat .foto-placeholder-sm {
    background: #fff; display: flex; align-items: center; justify-content: center;
    color: #e5cbdb; font-size: 32px;
}
.summary-camat .sc-info { flex: 1; min-width: 0; }
.summary-camat .sc-info h4 {
    font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 2px;
}
.summary-camat .sc-info p { font-size: 12.5px; color: var(--text-muted); }
.summary-camat .sc-info .sc-meta {
    display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px;
}

/* =====================================================
   MUTASI ARROW
   ===================================================== */
.mutasi-arrow {
    display: flex; align-items: center; justify-content: center;
    gap: 14px; flex-wrap: wrap; margin: 20px 0;
}
.mutasi-box {
    flex: 1; min-width: 200px; padding: 18px; border-radius: 14px;
    border: 2px dashed var(--border); text-align: center;
    background: var(--border-light);
}
.mutasi-box.active {
    border: 2px solid var(--primary); background: var(--primary-light);
    border-style: solid;
}
.mutasi-box .mb-label {
    font-size: 11px; text-transform: uppercase; font-weight: 700;
    letter-spacing: .5px; color: var(--text-muted); margin-bottom: 6px;
}
.mutasi-box .mb-value {
    font-size: 15px; font-weight: 700; color: var(--text);
}
.mutasi-box.active .mb-value { color: var(--primary-dark); }
.mutasi-box .mb-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.mutasi-arrow-icon {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
    box-shadow: 0 6px 16px -4px rgba(219,39,119,.5);
}

/* =====================================================
   SCROLL HINT
   ===================================================== */
.scroll-hint { display: none; }
.card.has-overflow .scroll-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    padding: 8px 16px 12px;
    font-style: italic;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1024px) {
    .content { padding: 22px 20px 50px; }
    .topbar { padding: 12px 20px; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: 4px 0 24px rgba(28,15,26,.35); }
    .sidebar.open { transform: translateX(0); }

    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex !important; }
    .user-info { display: none; }
    .topbar { padding: 12px 16px; }
    .content { padding: 18px 16px 50px; }
    .topbar-title { font-size: 15px; }
    .page-head h3 { font-size: 18px; }
    .card-head, .card-body { padding: 16px; }

    .form-grid { grid-template-columns: 1fr; }
    .col-span-2 { grid-column: auto; }
    .detail-grid { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: 1fr; }

    .stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat { padding: 16px; gap: 12px; }
    .stat-icon { width: 42px; height: 42px; font-size: 18px; }
    .stat-info h4 { font-size: 18px; }

    .peta-box iframe { height: 320px; }
    .bar-label { width: 110px; font-size: 11.5px; }

    .summary-camat { flex-direction: column; align-items: flex-start; text-align: left; }
    .summary-camat img,
    .summary-camat .foto-placeholder-sm { width: 100%; max-width: 130px; height: 160px; }

    .mutasi-arrow { flex-direction: column; }
    .mutasi-arrow-icon { transform: rotate(90deg); }

    /* Login: sedikit lebih kecil */
    .login-logo-img { width: 120px; height: 120px; }
    .login-logo { width: 84px; height: 84px; font-size: 28px; }
    .login-card h2 { font-size: 22px; }
    .login-card .sub { font-size: 15px; }
}

@media (max-width: 640px) {
    .stats { grid-template-columns: 1fr; }
    .foto-profil, .foto-placeholder { width: 110px; height: 140px; }

    thead th { padding: 10px 12px; font-size: 10px; }
    tbody td { padding: 10px 12px; font-size: 12.5px; }

    .table-actions { flex-direction: column; }
    .table-actions .btn { width: 100%; justify-content: center; }

    .page-head { flex-direction: column; align-items: stretch; }
    .page-head > div:last-child,
    .page-head .btn { width: 100%; justify-content: center; }

    .card-head { flex-direction: column; align-items: stretch; }
    .card-head form { flex-direction: column; }
    .card-head form input,
    .card-head form select,
    .card-head form .form-control { width: 100% !important; }
    .card-head form button { width: 100%; justify-content: center; }

    /* Login mobile */
    .login-logo-img { width: 100px; height: 100px; }
    .login-logo { width: 72px; height: 72px; font-size: 24px; }
    .login-card h2 { font-size: 20px; }
    .login-card .sub { font-size: 14px; }

    /* Tab navigasi mobile */
    .tab-nav {
        border-radius: 12px;
        padding: 5px;
        gap: 4px;
    }
    .tab-item {
        padding: 9px 14px;
        font-size: 12.5px;
        gap: 6px;
    }
    .tab-badge {
        min-width: 22px;
        height: 20px;
        font-size: 11px;
        padding: 0 6px;
    }
}

@media (max-width: 420px) {
    .content { padding: 14px 12px 50px; }
    .card-body { padding: 14px; }
    .page-head h3 { font-size: 16px; }
    .login-card { padding: 32px 24px 26px; }
    .login-logo-img { width: 90px; height: 90px; }
    .login-logo { width: 64px; height: 64px; font-size: 22px; }
    .login-card h2 { font-size: 18px; }
    .login-card .sub { font-size: 13px; }

    /* Tab navigasi sangat kecil */
    .tab-item { padding: 8px 11px; font-size: 12px; }
    .tab-item svg { width: 14px; height: 14px; }

    /* Sub-menu sidebar */
    .nav-subgroup { margin-left: 12px; padding-left: 10px; }
    .nav-item.nav-sub { padding: 8px 10px; font-size: 12.5px; }
    .nav-item.nav-sub svg { width: 14px; height: 14px; }
}

/* =====================================================
   PRINT
   ===================================================== */
@media print {
    .sidebar, .topbar, .no-print, .sidebar-overlay, .menu-toggle, .btn,
    .tab-nav { display: none !important; }
    .main { margin-left: 0; }
    .content { padding: 0; }
    body { background: #fff; font-size: 11px; }
    .card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; margin-bottom: 12px; }
    .stats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .stat { border: 1px solid #ddd; box-shadow: none; padding: 10px; }
    .stat::after { display: none; }
    .print-title { display: block !important; text-align: center; margin-bottom: 18px; }
    a { color: #000; text-decoration: none; }
    thead th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.print-title { display: none; }

/* Badge warning (untuk status menunggu) */
.badge-warning { background: #fef3c7; color: #b45309; }

/* =====================================================
   NAV SECTION LABEL (Group Header Sidebar)
   ===================================================== */
.nav-section {
    padding: 14px 14px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #64748b;
    font-weight: 700;
    opacity: .75;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-section::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,.1) 0%, transparent 100%);
}

/* Section pertama lebih rapat */
.nav > .nav-section:first-child {
    padding-top: 4px;
}

/* Responsive */
@media (max-width: 900px) {
    .nav-section {
        font-size: 9.5px;
        padding: 12px 14px 4px;
    }
}