/* ================================================================
   SIPDA Bandung — Modern Theme v2
   Material Symbols (Google) + Bootstrap 5.3 Dark Mode
   ================================================================ */

/* ── Design Tokens ───────────────────────────────────────────── */
:root {
    --sipda-navy:       #0d1f3c;
    --sipda-navy-mid:   #162d4f;
    --sipda-navy-light: #1a3a6b;
}

/* ── Material Symbols Configuration ─────────────────────────── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 20px;
    vertical-align: middle;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    user-select: none;
    flex-shrink: 0;
}
.msf { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.ms-sm  { font-size: 16px; }
.ms-md  { font-size: 20px; }
.ms-lg  { font-size: 28px; }
.ms-xl  { font-size: 40px; }
.ms-xxl { font-size: 56px; }

/* ── Base & Scrollbar ────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: background-color 0.25s ease, color 0.25s ease;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* main fills all space between navbar and footer */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.55); }

/* ── Body Background ─────────────────────────────────────────── */
[data-bs-theme="light"] body { background: #ffffff; }
[data-bs-theme="dark"]  body { background: #0f172a; }

/* ── Bootstrap variable overrides (light mode) ───────────────── */
[data-bs-theme="light"] {
    --bs-secondary-bg: #f0f4ff;
    --bs-tertiary-bg: #f4f6ff;
}

/* Bootstrap bg-light → near-white tint */
[data-bs-theme="light"] .bg-light {
    background-color: #f4f6ff !important;
}

/* Bootstrap shadow-sm → more visible on white body */
[data-bs-theme="light"] .shadow-sm {
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.09), 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* ══════════════════════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════════════════════ */
.navbar-sipda {
    padding: 0.4rem 0;
    min-height: 62px;
    transition: background 0.25s, box-shadow 0.25s;
}

[data-bs-theme="light"] .navbar-sipda {
    background: linear-gradient(135deg, #0d1f3c 0%, #1a3a6b 100%) !important;
    box-shadow: 0 2px 24px rgba(13, 31, 60, 0.4);
}

[data-bs-theme="dark"] .navbar-sipda {
    background: linear-gradient(135deg, #020617 0%, #0d1f3c 100%) !important;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Brand */
.navbar-sipda .navbar-brand {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.2px;
    padding: 0.75rem 0;
}

.brand-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 193, 7, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Nav links — all same height for uniform button sizing */
.navbar-sipda .nav-link {
    font-weight: 500;
    height: 40px;
    padding: 0 1.1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.75) !important;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    border-radius: 8px;
    white-space: nowrap;
}

.navbar-sipda .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-sipda .nav-link.active {
    color: #fff !important;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.14);
}

/* Bottom indicator on active nav link */
.navbar-sipda .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #60a5fa;
    border-radius: 3px;
}

/* Daftar / Register button — matches nav-link height */
.navbar-sipda .btn-register {
    height: 40px;
    padding: 0 1.3rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
}

/* ── Theme Toggle Button ─────────────────────────────────────── */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 8px !important;
    width: 40px;
    height: 40px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    transform: scale(1.08);
}

/* Sidebar-context toggle: wider, left-aligned */
.sidebar .theme-toggle {
    width: 100% !important;
    height: 36px !important;
    justify-content: flex-start !important;
    padding: 0 0.75rem !important;
    border-radius: 8px !important;
    gap: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8) !important;
}
.sidebar .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: none !important;
}

/* Theme toggle icon/label: CSS-driven, no JS flash */
[data-bs-theme="light"] .theme-icon-light { display: none !important; }
[data-bs-theme="dark"]  .theme-icon-dark  { display: none !important; }
[data-bs-theme="light"] .theme-label-light { display: none !important; }
[data-bs-theme="dark"]  .theme-label-dark  { display: none !important; }

/* ── Footer ──────────────────────────────────────────────────── */
.sipda-footer {
    padding: 3rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-bs-theme="light"] .sipda-footer {
    background: linear-gradient(135deg, #0d1f3c 0%, #1e293b 100%);
    color: rgba(255, 255, 255, 0.88);
}

[data-bs-theme="dark"] .sipda-footer {
    background: linear-gradient(135deg, #020617 0%, #0d1f3c 100%);
    color: rgba(255, 255, 255, 0.8);
}

.footer-link {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.15s;
    font-size: 0.875rem;
}
.footer-link:hover { color: rgba(255, 255, 255, 0.9); }

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════════ */
.sidebar {
    min-height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

[data-bs-theme="light"] .sidebar {
    background: linear-gradient(180deg, #0d1f3c 0%, #162d4f 55%, #1a3a6b 100%);
    box-shadow: 3px 0 24px rgba(0, 0, 0, 0.22);
}

[data-bs-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #020617 0%, #0a1628 55%, #0d1f3c 100%);
    box-shadow: 3px 0 24px rgba(0, 0, 0, 0.55);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

/* ── Sidebar Header ──────────────────────────────────────────── */
.sidebar-header {
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.sidebar-header-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* ── Sidebar User Area ───────────────────────────────────────── */
.sidebar-user {
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    flex-shrink: 0;
    letter-spacing: -0.5px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
}

.sidebar-user-info {
    overflow: hidden;
    flex-grow: 1;
    min-width: 0;
}

.sidebar-user-name {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* ── Section Label ───────────────────────────────────────────── */
.sidebar-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.28);
    padding: 0.875rem 1.25rem 0.3rem;
}

/* ── Nav Links ───────────────────────────────────────────────── */
.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.66);
    padding: 0.6rem 1rem 0.6rem 1.25rem;
    margin: 0.1rem 0.5rem;
    border-radius: 10px;
    transition: all 0.18s ease;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

/* Left accent indicator */
.sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: transparent;
    transition: background 0.18s ease;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    transform: translateX(3px);
}
.sidebar .nav-link:hover::before {
    background: rgba(255, 255, 255, 0.3);
}

/* Active base */
.sidebar .nav-link.active {
    color: #fff;
    font-weight: 600;
    transform: none;
}

/* Admin active: indigo */
.sidebar-admin .nav-link.active {
    background: rgba(99, 102, 241, 0.18);
}
.sidebar-admin .nav-link.active::before {
    background: #818cf8;
}

/* Petugas active: sky */
.sidebar-petugas .nav-link.active {
    background: rgba(14, 165, 233, 0.18);
}
.sidebar-petugas .nav-link.active::before {
    background: #38bdf8;
}

/* Logout */
.sidebar .nav-link.text-danger {
    color: rgba(252, 129, 129, 0.75) !important;
}
.sidebar .nav-link.text-danger:hover {
    background: rgba(220, 53, 69, 0.14) !important;
    color: #fc8181 !important;
    transform: translateX(3px);
}
.sidebar .nav-link.text-danger::before { display: none; }

/* ── Sidebar Bottom Area ─────────────────────────────────────── */
.sidebar-bottom {
    padding: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sidebar-bottom .btn-outline-light {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.75) !important;
    border-radius: 8px;
}
.sidebar-bottom .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-card {
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    border-left: 4px solid;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

[data-bs-theme="light"] .stat-card {
    background: #fff;
    box-shadow: 0 2px 16px rgba(99, 102, 241, 0.08), 0 1px 4px rgba(0, 0, 0, 0.06);
}
[data-bs-theme="light"] .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.14), 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .stat-card {
    background: var(--bs-card-bg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
[data-bs-theme="dark"] .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

/* ── Content Card ────────────────────────────────────────────── */
.content-card {
    border-radius: 14px;
}

[data-bs-theme="light"] .content-card {
    background: #fff;
    box-shadow: 0 2px 16px rgba(99, 102, 241, 0.08), 0 1px 4px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .content-card {
    background: var(--bs-card-bg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* ── Bootstrap Card overrides ────────────────────────────────── */
[data-bs-theme="dark"] .card { border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .card-header.bg-white { background: var(--bs-card-bg) !important; }
[data-bs-theme="dark"] .table-light {
    --bs-table-bg:           rgba(255,255,255,0.05);
    --bs-table-color:        #e2e8f0;
    --bs-table-border-color: rgba(255,255,255,0.08);
    --bs-table-striped-bg:   rgba(255,255,255,0.04);
    --bs-table-striped-color:#e2e8f0;
    --bs-table-active-bg:    rgba(255,255,255,0.08);
    --bs-table-active-color: #f1f5f9;
    --bs-table-hover-bg:     rgba(255,255,255,0.07);
    --bs-table-hover-color:  #f1f5f9;
}

/* ── Tables ──────────────────────────────────────────────────── */
.table { vertical-align: middle; font-size: 0.9rem; }

/* Dark mode — seluruh tabel: teks, border, hover */
[data-bs-theme="dark"] .table {
    --bs-table-color:        #cbd5e1;
    --bs-table-bg:           transparent;
    --bs-table-border-color: rgba(255,255,255,0.08);
    --bs-table-striped-color:#cbd5e1;
    --bs-table-striped-bg:   rgba(255,255,255,0.03);
    --bs-table-active-color: #f1f5f9;
    --bs-table-active-bg:    rgba(255,255,255,0.08);
    --bs-table-hover-color:  #f1f5f9;
    --bs-table-hover-bg:     rgba(255,255,255,0.06);
    color: #cbd5e1;
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .table td,
[data-bs-theme="dark"] .table th { border-color: rgba(255,255,255,0.08); }
[data-bs-theme="dark"] .table .text-muted { color: #94a3b8 !important; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: 10px;
    font-size: 0.9rem;
    padding: 0.55rem 0.85rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-radius: 0 10px 10px 0;
}
.input-group > .input-group-text:first-child { border-radius: 10px 0 0 10px; }
.input-group > .btn:last-child { border-radius: 0 10px 10px 0; }
.input-group > .btn:only-child { border-radius: 10px; }

[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-control[readonly],
[data-bs-theme="dark"] .form-control.bg-light,
[data-bs-theme="dark"] .form-select:disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .bg-light {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
    border-radius: 12px;
    border: none;
    font-size: 0.9rem;
}
[data-bs-theme="dark"] .alert-info    { background: rgba(14, 165, 233, 0.15); color: #7dd3fc; }
[data-bs-theme="dark"] .alert-success { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
[data-bs-theme="dark"] .alert-danger  { background: rgba(239, 68, 68, 0.15);  color: #fca5a5; }
[data-bs-theme="dark"] .alert-warning { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn { font-weight: 500; border-radius: 10px; }
.btn-sm { border-radius: 8px; font-size: 0.8rem; }
.btn-lg { border-radius: 12px; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge { font-weight: 600; font-size: 0.72rem; letter-spacing: 0.3px; }

/* ── Status Badges ───────────────────────────────────────────── */
.badge-darurat { background: #dc3545 !important; color: #fff !important; }
.badge-siaga   { background: #3b82f6 !important; color: #fff !important; }
.badge-waspada { background: #f59e0b !important; color: #1a1a1a !important; }
.badge-aman    { background: #10b981 !important; color: #fff !important; }

/* ══════════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════════ */

/* Backdrop: darker + blurred */
[data-bs-theme="light"] .modal-backdrop.show {
    opacity: 1;
    background-color: rgba(13, 31, 60, 0.52);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
[data-bs-theme="dark"] .modal-backdrop.show {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Scale-in entrance animation */
.modal.fade .modal-dialog {
    transform: scale(0.93) translateY(-18px);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}
.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

/* Content card */
.modal-content {
    border: none !important;
    border-radius: 20px !important;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.08);
}
[data-bs-theme="dark"] .modal-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Header */
.modal-header {
    padding: 1.35rem 1.75rem 1.15rem;
    border-bottom: none !important;
    align-items: flex-start;
}

/* Gradient color variants */
.modal-header.bg-primary { background: linear-gradient(135deg, #1d4ed8 0%, #4f46e5 100%) !important; }
.modal-header.bg-success { background: linear-gradient(135deg, #047857 0%, #0284c7 100%) !important; }
.modal-header.bg-warning { background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%) !important; color: #fff !important; }
.modal-header.bg-danger  { background: linear-gradient(135deg, #9f1239 0%, #dc2626 100%) !important; }
.modal-header.bg-info    { background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%) !important; }

/* Icon container in header */
.modal-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Title & subtitle */
.modal-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.2px;
    line-height: 1.35;
}
.modal-subtitle {
    font-size: 0.76rem;
    opacity: 0.72;
    font-weight: 400;
    margin-top: 2px;
    line-height: 1.4;
}

/* Close button — spins 90deg on hover */
.modal-header .btn-close,
.modal-header .btn-close-white {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    border-radius: 8px !important;
    background-color: rgba(255, 255, 255, 0.14) !important;
    opacity: 1 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: background 0.15s, transform 0.22s ease;
    align-self: flex-start;
    flex-shrink: 0;
}
.modal-header .btn-close:hover,
.modal-header .btn-close-white:hover {
    background-color: rgba(255, 255, 255, 0.28) !important;
    transform: rotate(90deg);
}

/* Body */
/* Fix: form inside modal-content breaks Bootstrap's flex scroll chain.
   Make form a pass-through flex column so modal-body can still scroll. */
.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    overflow: hidden;
    min-height: 0;
}

/* Body — scrollable when needed via modal-dialog-scrollable */
.modal-body {
    padding: 1.5rem 1.75rem;
    overscroll-behavior: contain;
}

/* Smooth thin scrollbar inside modal body */
.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.55); }

/* Section dividers within modal body */
.modal-section {
    border-top: 1px solid var(--bs-border-color);
    margin-top: 1.25rem;
    padding-top: 1.25rem;
}

/* Section label: icon + text + trailing line */
.modal-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.modal-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--bs-border-color);
    opacity: 0.6;
}

/* Footer */
.modal-footer {
    padding: 1rem 1.75rem 1.5rem;
    border-top: 1px solid var(--bs-border-color) !important;
    gap: 0.625rem;
}

/* Form labels inside modals — subtle uppercase treatment */
.modal-body .form-label {
    font-size: 0.775rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--bs-secondary-color);
    margin-bottom: 0.35rem;
}

/* ── Hero Section ────────────────────────────────────────────── */
.hero-section {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

[data-bs-theme="light"] .hero-section {
    background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 50%, #eff6ff 100%);
    color: #0d1f3c;
}

/* In light mode, override hero text that was written for a dark background */
[data-bs-theme="light"] .hero-section .text-white-50 {
    color: rgba(13, 31, 60, 0.58) !important;
    -webkit-text-fill-color: rgba(13, 31, 60, 0.58) !important;
}

[data-bs-theme="light"] .hero-section .btn-outline-light {
    border-color: #6366f1 !important;
    color: #6366f1 !important;
    background: transparent !important;
}
[data-bs-theme="light"] .hero-section .btn-outline-light:hover {
    background: #6366f1 !important;
    color: #fff !important;
    border-color: #6366f1 !important;
}

/* Stat boxes and small labels in hero — adjust for light bg */
[data-bs-theme="light"] .hero-section .text-white-50,
[data-bs-theme="light"] .hero-section small.text-white-50 {
    color: rgba(13, 31, 60, 0.55) !important;
    -webkit-text-fill-color: rgba(13, 31, 60, 0.55) !important;
}

[data-bs-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e3a5f 100%);
    color: white;
}

/* ── Auth Cards ──────────────────────────────────────────────── */
.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem 2rem 1rem;
}

[data-bs-theme="light"] .auth-wrapper {
    background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 50%, #eff6ff 100%);
}

[data-bs-theme="dark"] .auth-wrapper {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
}

.auth-card {
    max-width: 440px;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    margin: 1rem;
}

[data-bs-theme="light"] .auth-card {
    background: #fff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .auth-card {
    background: #1e293b;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-header {
    padding: 2rem;
    text-align: center;
    color: white;
}

[data-bs-theme="light"] .auth-header {
    background: linear-gradient(135deg, #4338ca, #6366f1, #818cf8);
}

[data-bs-theme="dark"] .auth-header {
    background: linear-gradient(135deg, #1e1b4b, #4c1d95, #6d28d9);
}

.auth-body { padding: 2rem; }

/* ── Welcome Card (Dashboard) ────────────────────────────────── */
.welcome-card {
    border-radius: 18px;
    padding: 1.5rem 2rem;
    color: white;
}

[data-bs-theme="light"] .welcome-card-admin {
    background: linear-gradient(135deg, #1e1b4b, #4338ca, #6366f1);
}
[data-bs-theme="dark"] .welcome-card-admin {
    background: linear-gradient(135deg, #1e1b4b, #3730a3, #4338ca);
}

[data-bs-theme="light"] .welcome-card-petugas {
    background: linear-gradient(135deg, #0c4a6e, #0369a1, #0ea5e9);
}
[data-bs-theme="dark"] .welcome-card-petugas {
    background: linear-gradient(135deg, #082f49, #0369a1, #0284c7);
}

[data-bs-theme="light"] .welcome-card-user {
    background: linear-gradient(135deg, #0d1f3c, #1d4ed8, #3b82f6);
}
[data-bs-theme="dark"] .welcome-card-user {
    background: linear-gradient(135deg, #0d1f3c, #1e3a5f, #1d4ed8);
}

/* ── Section Backgrounds ─────────────────────────────────────── */
[data-bs-theme="light"] .section-light { background: #f8f9ff; }
[data-bs-theme="dark"]  .section-light { background: #1e293b; }

/* ── CTA Section ─────────────────────────────────────────────── */
[data-bs-theme="light"] .cta-section {
    background: linear-gradient(135deg, #4338ca 0%, #7c3aed 100%);
}
[data-bs-theme="dark"] .cta-section {
    background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 100%);
}

/* ── Pagination ──────────────────────────────────────────────── */
[data-bs-theme="dark"] .pagination .page-link {
    background: var(--bs-card-bg);
    border-color: var(--bs-border-color);
}

/* ── Dropdown ────────────────────────────────────────────────── */
[data-bs-theme="dark"] .dropdown-menu {
    border-color: var(--bs-border-color);
    background: #1e293b;
}
[data-bs-theme="dark"] .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] .dropdown-divider { border-color: var(--bs-border-color); }

/* ── Dashboard grid bg ───────────────────────────────────────── */
[data-bs-theme="light"] .dashboard-wrap { background: #f4f6ff; }
[data-bs-theme="dark"]  .dashboard-wrap { background: #0f172a; }

/* ── Berita card placeholder ─────────────────────────────────── */
[data-bs-theme="dark"] .berita-placeholder {
    background: linear-gradient(135deg, #1e1b4b, #3730a3) !important;
}

/* ── Layanan card icon container ─────────────────────────────── */
.layanan-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* ── Leaflet custom map pins ─────────────────────────────────── */
.map-pin {
    position: relative;
    width: 32px;
    height: 42px;
    cursor: pointer;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.28));
    transition: filter 0.18s;
}
.map-pin:hover { filter: drop-shadow(0 5px 16px rgba(0,0,0,0.38)); }

.map-pin-body {
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    background: var(--pin-color);
    transform: rotate(-45deg);
    border: 3px solid rgba(255,255,255,0.92);
    position: absolute;
    top: 0;
    left: 2px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.map-pin-body::after {
    content: '';
    width: 9px;
    height: 9px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    position: absolute;
    top: 5px;
    left: 4px;
}

.map-pin-pulse .map-pin-ring {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2.5px solid var(--pin-color);
    opacity: 0;
    animation: pinPulse 1.8s ease-out infinite;
    top: 0;
    left: 2px;
}
@keyframes pinPulse {
    0%   { transform: rotate(-45deg) scale(1);   opacity: 0.85; }
    100% { transform: rotate(-45deg) scale(2.4); opacity: 0; }
}

/* ── Leaflet Map ─────────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
    border-radius: 14px !important;
    border: none !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    padding: 14px 16px !important;
}
.leaflet-popup-content { margin: 0 !important; }
.leaflet-popup-tip-container { margin-top: -1px; }
.leaflet-popup-tip { box-shadow: none !important; }
.leaflet-popup-close-button {
    top: 8px !important;
    right: 10px !important;
    font-size: 18px !important;
    color: #94a3b8 !important;
}
.leaflet-popup-close-button:hover { color: #64748b !important; }

/* Styled tooltip class */
.leaflet-tooltip.sipda-tooltip {
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    padding: 11px 14px !important;
    background: #fff !important;
    color: #0f172a !important;
    pointer-events: none;
}
.leaflet-tooltip.sipda-tooltip.leaflet-tooltip-top::before {
    border-top-color: #fff !important;
}

[data-bs-theme="dark"] .leaflet-popup-content-wrapper {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}
[data-bs-theme="dark"] .leaflet-popup-tip { background: #1e293b !important; }

[data-bs-theme="dark"] .leaflet-tooltip.sipda-tooltip {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}
[data-bs-theme="dark"] .leaflet-tooltip.sipda-tooltip.leaflet-tooltip-top::before {
    border-top-color: #1e293b !important;
}

/* ── Utils ───────────────────────────────────────────────────── */
.rounded-16 { border-radius: 16px !important; }
.rounded-20 { border-radius: 20px !important; }
.rounded-24 { border-radius: 24px !important; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.4s ease-out; }
