/* ==========================================================================
   SILAYAK — Dinas Perkim Kabupaten Sukabumi
   Luxury Glassmorphism + Bold Spatial UI Stylesheet
   ========================================================================== */

:root {
    --sl-emerald-950: #022c22;
    --sl-emerald-900: #064e3b;
    --sl-emerald-700: #0f766e;
    --sl-emerald-500: #10b981;
    --sl-ocean-700: #0369a1;
    --sl-ocean-500: #0284c7;
    --sl-gold-500: #d97706;
    --sl-gold-400: #f59e0b;
    --sl-navy-900: #0f172a;
    --sl-slate-700: #334155;
    --sl-slate-400: #94a3b8;
    --sl-glass-bg: rgba(255, 255, 255, 0.78);
    --sl-glass-bg-strong: rgba(255, 255, 255, 0.90);
    --sl-glass-border: rgba(15, 23, 42, 0.16);
    --sl-glass-shadow: 0 18px 42px -12px rgba(6, 78, 59, 0.16), 0 4px 16px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: var(--sl-navy-900);
    background:
        radial-gradient(circle at 8% 12%, rgba(16, 185, 129, 0.14), transparent 38%),
        radial-gradient(circle at 92% 18%, rgba(2, 132, 199, 0.15), transparent 40%),
        radial-gradient(circle at 75% 88%, rgba(217, 119, 6, 0.10), transparent 36%),
        linear-gradient(135deg, #eef6f4 0%, #e7f0f8 50%, #f4f7f5 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.font-mono-code {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.03em;
}

/* ---------- Glassmorphism Cards & Panels ---------- */
.glass-card {
    background: var(--sl-glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 2px solid var(--sl-glass-border);
    border-top: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 20px;
    box-shadow: var(--sl-glass-shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.glass-card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 48px -12px rgba(6, 78, 59, 0.22), 0 8px 20px rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 118, 110, 0.35);
}

.glass-panel {
    background: var(--sl-glass-bg-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(15, 23, 42, 0.15);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.glass-header-bar {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.95), rgba(15, 118, 110, 0.92), rgba(3, 105, 161, 0.92));
    color: #fff;
    border-radius: 18px 18px 0 0;
    padding: 1rem 1.35rem;
    border-bottom: 3px solid var(--sl-gold-400);
}

/* ---------- App Layout: Glass Sidebar & Topbar ---------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.glass-sidebar {
    width: 278px;
    flex-shrink: 0;
    background: linear-gradient(175deg, rgba(2, 44, 34, 0.96) 0%, rgba(6, 78, 59, 0.94) 55%, rgba(15, 23, 42, 0.96) 100%);
    backdrop-filter: blur(22px);
    border-right: 2px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1040;
    transition: transform 0.28s ease;
    box-shadow: 8px 0 32px rgba(2, 44, 34, 0.22);
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.14);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem 0.85rem;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(167, 243, 208, 0.7);
    padding: 0.75rem 0.85rem 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.68rem 0.95rem;
    margin-bottom: 0.28rem;
    border-radius: 12px;
    color: rgba(241, 245, 249, 0.88);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.11);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateX(3px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(2, 132, 199, 0.28));
    color: #ffffff;
    border: 1.5px solid rgba(250, 204, 21, 0.65);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.sidebar-link i {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.glass-topbar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 2px solid rgba(15, 23, 42, 0.14);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

.app-content {
    padding: 1.4rem 1.5rem 5.5rem;
    flex: 1;
}

@media (max-width: 991.98px) {
    .glass-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-105%);
    }
    .glass-sidebar.show {
        transform: translateX(0);
    }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.55);
        backdrop-filter: blur(4px);
        z-index: 1035;
    }
    .sidebar-backdrop.show {
        display: block;
    }
}

/* ---------- KPI Glass Stat Cards ---------- */
.kpi-card {
    position: relative;
    overflow: hidden;
    padding: 1.15rem 1.2rem;
}

.kpi-card::after {
    content: '';
    position: absolute;
    right: -18px;
    bottom: -18px;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.07;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.kpi-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
}

/* ---------- Bold & Tebal Tables & Lists ---------- */
.table-silayak-wrap {
    border: 2.5px solid #334155;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.table-silayak {
    margin-bottom: 0;
    border-collapse: collapse;
    width: 100%;
}

.table-silayak thead th {
    background: linear-gradient(135deg, #064e3b 0%, #0f766e 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.88rem 0.85rem;
    border: 2px solid #064e3b;
    border-bottom: 3.5px solid #f59e0b;
    vertical-align: middle;
    white-space: nowrap;
}

.table-silayak tbody td {
    padding: 0.78rem 0.85rem;
    border: 2px solid #94a3b8;
    vertical-align: middle;
    font-size: 0.88rem;
    color: #0f172a;
    font-weight: 500;
}

.table-silayak tbody tr:nth-child(even) {
    background-color: rgba(241, 245, 249, 0.72);
}

.table-silayak tbody tr:hover {
    background-color: rgba(16, 185, 129, 0.10);
}

.table-silayak tfoot td,
.table-silayak tfoot th {
    background: #e2e8f0;
    font-weight: 800;
    border: 2.5px solid #334155;
    padding: 0.78rem 0.85rem;
}

.list-bold {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 2px solid #64748b;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.85);
}

.list-bold > li {
    padding: 0.78rem 1rem;
    border-bottom: 2px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.list-bold > li:last-child {
    border-bottom: none;
}

/* ---------- Form Controls & Bold Inputs ---------- */
.form-label-bold {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1e293b;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border: 2px solid #94a3b8;
    border-radius: 12px;
    padding: 0.58rem 0.85rem;
    font-weight: 600;
    font-size: 0.9rem;
    background-color: rgba(255, 255, 255, 0.92);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sl-emerald-700);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.18);
    background-color: #ffffff;
}

/* ---------- Select2 Luxury Glass Theme ---------- */
.select2-container--default .select2-selection--single {
    height: 44px;
    border: 2px solid #94a3b8;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--sl-emerald-700);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.18);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #0f172a;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 40px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
    right: 8px;
}

.select2-dropdown {
    border: 2px solid var(--sl-emerald-700);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid #94a3b8;
    border-radius: 10px;
    padding: 0.45rem 0.7rem;
    font-weight: 600;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: linear-gradient(135deg, #064e3b, #0f766e);
    color: #ffffff;
    font-weight: 700;
}

/* ---------- Status Pill Badges ---------- */
.badge-pill-bold {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.36rem 0.72rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.74rem;
    border: 1.8px solid transparent;
    white-space: nowrap;
}

.badge-menunggu { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.badge-terverifikasi { background: #dbeafe; color: #1e40af; border-color: #3b82f6; }
.badge-sedang { background: #cffafe; color: #155e75; border-color: #06b6d4; }
.badge-sudah { background: #d1fae5; color: #065f46; border-color: #10b981; }
.badge-ditolak { background: #fee2e2; color: #991b1b; border-color: #ef4444; }
.badge-spam { background: #e0f2fe; color: #075985; border-color: #0284c7; }
.badge-sanitasi { background: #ede9fe; color: #5b21b6; border-color: #7c3aed; }

/* ---------- Buttons ---------- */
.btn-luxury {
    background: linear-gradient(135deg, #064e3b 0%, #0f766e 60%, #0284c7 100%);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-weight: 700;
    padding: 0.56rem 1.15rem;
    box-shadow: 0 10px 24px rgba(6, 78, 59, 0.25);
    transition: all 0.2s ease;
}

.btn-luxury:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(6, 78, 59, 0.35);
}

.btn-gold {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #0f172a;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 12px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.28);
}

.btn-gold:hover {
    color: #022c22;
    transform: translateY(-2px);
}

/* ---------- Map Containers ---------- */
.silayak-map-box {
    width: 100%;
    height: 490px;
    border-radius: 18px;
    border: 3px solid #0f766e;
    box-shadow: 0 16px 36px rgba(6, 78, 59, 0.16);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.silayak-map-picker {
    height: 430px;
}

.map-legend-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 2px solid #0f766e;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 11.5px;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
    min-width: 175px;
}

.legend-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1.5px rgba(15, 23, 42, 0.4);
    margin-right: 6px;
    vertical-align: middle;
}

/* ---------- Global Glass Loading Screen ---------- */
#silayak-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(2, 44, 34, 0.62);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

#silayak-loader.active {
    display: flex;
}

.loader-glass-box {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.90);
    border: 2.5px solid rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 2rem 1.75rem;
    text-align: center;
    box-shadow: 0 28px 60px rgba(2, 44, 34, 0.45);
}

.loader-spinner-ring {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    border: 5px solid rgba(15, 118, 110, 0.18);
    border-top-color: #0f766e;
    border-right-color: #d97706;
    animation: slSpin 0.85s linear infinite;
}

@keyframes slSpin {
    to { transform: rotate(360deg); }
}

.loader-progress-wrap {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    border: 1.5px solid #94a3b8;
    margin-top: 0.9rem;
}

.loader-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #064e3b, #10b981, #f59e0b);
    transition: width 0.2s ease;
}

/* ---------- Unique Spatial Glass Login Page ---------- */
.login-stage {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 15% 20%, rgba(16, 185, 129, 0.35) 0%, transparent 42%),
        radial-gradient(circle at 85% 25%, rgba(14, 165, 233, 0.35) 0%, transparent 45%),
        radial-gradient(circle at 75% 85%, rgba(245, 158, 11, 0.25) 0%, transparent 40%),
        linear-gradient(135deg, #021c16 0%, #05362c 45%, #0b2545 100%);
}

.login-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 42px 42px;
    pointer-events: none;
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.55;
    animation: slFloat 9s ease-in-out infinite alternate;
    pointer-events: none;
}

.login-orb-1 { width: 320px; height: 320px; background: #10b981; top: -80px; left: -60px; }
.login-orb-2 { width: 360px; height: 360px; background: #0284c7; bottom: -100px; right: -80px; animation-delay: 2s; }
.login-orb-3 { width: 220px; height: 220px; background: #f59e0b; top: 45%; left: 42%; opacity: 0.25; animation-delay: 4s; }

@keyframes slFloat {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(24px, -22px) scale(1.08); }
}

.login-shell {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1080px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 2px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.52);
    overflow: hidden;
}

.login-showcase {
    background: linear-gradient(160deg, rgba(6, 78, 59, 0.72), rgba(15, 23, 42, 0.80));
    padding: 2.5rem;
    color: #f8fafc;
    position: relative;
    border-right: 2px solid rgba(255, 255, 255, 0.14);
}

.login-form-panel {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    padding: 2.5rem 2.3rem;
}

.login-stat-chip {
    background: rgba(255, 255, 255, 0.11);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    padding: 0.8rem 1rem;
    backdrop-filter: blur(10px);
}

/* ---------- Timeline Audit ---------- */
.audit-timeline {
    position: relative;
    padding-left: 1.65rem;
    border-left: 3px solid #0f766e;
}

.audit-timeline-item {
    position: relative;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid #cbd5e1;
    border-radius: 12px;
}

.audit-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.92rem;
    top: 0.95rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f59e0b;
    border: 3px solid #064e3b;
}

/* ---------- Upload Preview Box ---------- */
.upload-preview-box {
    border: 2px dashed #64748b;
    border-radius: 14px;
    padding: 0.75rem;
    background: rgba(248, 250, 252, 0.85);
    transition: border-color 0.2s ease;
}

.upload-preview-box:hover {
    border-color: #0f766e;
}

.upload-preview-thumb {
    max-height: 140px;
    width: 100%;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #94a3b8;
    margin-top: 0.5rem;
}

/* ---------- Floating WhatsApp Consultation Button ---------- */
.floating-wa-btn {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1060;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.72rem 1.1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #ffffff !important;
    font-weight: 800;
    font-size: 0.88rem;
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 28px rgba(22, 163, 74, 0.42);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: waPulse 2.8s infinite;
}

.floating-wa-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 16px 34px rgba(22, 163, 74, 0.55);
}

.floating-wa-btn i {
    font-size: 1.35rem;
    line-height: 1;
}

@keyframes waPulse {
    0%, 100% { box-shadow: 0 12px 28px rgba(22, 163, 74, 0.42), 0 0 0 0 rgba(34, 197, 94, 0.45); }
    50% { box-shadow: 0 12px 28px rgba(22, 163, 74, 0.42), 0 0 0 10px rgba(34, 197, 94, 0); }
}

@media (max-width: 576px) {
    .floating-wa-btn {
        right: 14px;
        bottom: 14px;
        padding: 0.65rem 0.9rem;
    }
    .floating-wa-btn .wa-label {
        display: none;
    }
}

@media print {
    .floating-wa-btn {
        display: none !important;
    }
}

/* ---------- Gatekeeper Duplicate Check & Form Lock ---------- */
.gate-card-highlight {
    border: 2px solid rgba(15, 118, 110, 0.35);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.gate-lock-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.gate-lock-fieldset.is-locked {
    opacity: 0.56;
    transition: opacity 0.2s ease;
}

.gate-lock-fieldset.is-locked .silayak-map-box {
    pointer-events: none;
    filter: grayscale(0.4);
}

.gate-lock-banner {
    border: 2px dashed #f59e0b;
    background: rgba(254, 243, 199, 0.85);
    color: #92400e;
    border-radius: 14px;
}
