/**
 * SISTEM DATA BERSEPADU DUN SABAH
 * CSS Ringan & Profesional (Tanpa Framework Luaran)
 * ~8KB minified
 */

/* ============================================================
   1. CSS VARIABLES & RESET
   ============================================================ */
:root {
    --primary: #1a56db;
    --primary-dark: #1244af;
    --primary-light: #e8effc;
    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --info: #0891b2;
    --info-light: #ecfeff;
    --secondary: #6b7280;
    --secondary-light: #f3f4f6;

    --text: #1f2937;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --bg: #f8fafc;
    --white: #ffffff;

    --sidebar-w: 250px;
    --topbar-h: 56px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
    --transition: .2s ease;

    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ============================================================
   2. LAYOUT — SIDEBAR + MAIN
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #cbd5e1;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-header h2 { color: #fff; font-size: 1rem; margin-bottom: .15rem; }
.sidebar-header small { color: #64748b; font-size: .75rem; }

.sidebar-nav { padding: .5rem 0; }
.nav-group-title {
    padding: .8rem 1rem .3rem;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #475569;
    font-weight: 600;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 1rem;
    color: #94a3b8;
    font-size: .85rem;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.nav-link:hover {
    background: rgba(255,255,255,.05);
    color: #e2e8f0;
    text-decoration: none;
}
.nav-link.active {
    background: rgba(26,86,219,.15);
    color: #93bbfd;
    border-left-color: var(--primary);
}
.nav-icon { font-size: 1rem; width: 1.2rem; text-align: center; }
.nav-logout { margin-top: .5rem; color: #f87171; border-top: 1px solid rgba(255,255,255,.08); padding-top: .75rem; }
.nav-logout:hover { background: rgba(239,68,68,.15); color: #fca5a5; }

/* Main Wrap */
.main-wrap {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.user-info { font-size: .85rem; }
.user-info small { color: var(--text-light); }

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1400px;
    width: 100%;
}

.main-footer {
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: .75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ============================================================
   3. LANDING PAGE
   ============================================================ */
.landing {
    font-family: var(--font);
    color: var(--text);
    overflow-x: hidden;
}

/* --- Container --- */
.landing-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #0a1628 0%, #132847 30%, #1a3a5c 50%, #0f2440 70%, #091525 100%);
    overflow: hidden;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 25% 45%, rgba(26,86,219,0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 25%, rgba(14,165,233,0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 55% 80%, rgba(99,102,241,0.08) 0%, transparent 45%);
    animation: heroPulse 8s ease-in-out infinite alternate;
}
@keyframes heroPulse {
    0% { opacity: .5; }
    100% { opacity: 1; }
}
.hero-bg-map {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.hero-bg-map img {
    width: min(85vw, 700px);
    height: auto;
    color: rgba(255,255,255,1);
    animation: mapFloat 14s ease-in-out infinite alternate;
}
@keyframes mapFloat {
    0% { transform: translateY(8px) scale(1); }
    100% { transform: translateY(-8px) scale(1.02); }
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
    padding: 2rem 1rem;
    animation: fadeUp .7s ease-out;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #93c5fd;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    padding: .35rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}
.hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: .8rem;
    letter-spacing: -.02em;
}
.hero-desc {
    font-size: clamp(.88rem, 1.5vw, 1.05rem);
    color: #94a3b8;
    line-height: 1.7;
    margin-bottom: 2rem;
}
.hero-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    padding: .7rem 1.8rem;
    background: linear-gradient(135deg, #1a56db, #3b82f6);
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(26,86,219,0.35);
    transition: all .25s ease;
    text-decoration: none;
}
.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(26,86,219,0.5);
    text-decoration: none;
    color: #fff;
}
.btn-hero-outline {
    display: inline-flex;
    align-items: center;
    padding: .7rem 1.8rem;
    background: transparent;
    color: #cbd5e1;
    font-weight: 600;
    font-size: .9rem;
    border-radius: 8px;
    border: 1.5px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all .25s ease;
    text-decoration: none;
}
.btn-hero-outline:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.35);
    color: #fff;
    text-decoration: none;
}

/* --- Stats Bar --- */
.landing-stats {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0;
}
.stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}
.stat-item {
    flex: 1;
    min-width: 140px;
    text-align: center;
    padding: 1.5rem 1rem;
}
.stat-num {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}
.stat-label {
    display: block;
    font-size: .75rem;
    color: var(--text-light);
    margin-top: .2rem;
    font-weight: 500;
}
.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
    flex-shrink: 0;
}

/* --- Section Header --- */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.section-tag {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .3rem .9rem;
    border-radius: 50px;
    margin-bottom: .7rem;
}
.section-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .4rem;
}
.section-header p {
    color: var(--text-light);
    font-size: .9rem;
}

/* --- Features --- */
.landing-features {
    padding: 4rem 0;
    background: var(--bg);
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.2rem;
}
.feature-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all .25s ease;
}
.feature-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.07);
    transform: translateY(-3px);
}
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: .8rem;
}
.fi-blue { background: #eff6ff; }
.fi-green { background: #ecfdf5; }
.fi-amber { background: #fffbeb; }
.fi-red { background: #fef2f2; }
.fi-purple { background: #f5f3ff; }
.fi-teal { background: #ecfeff; }
.feature-card h3 {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: .3rem;
}
.feature-card p {
    font-size: .82rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* --- Login Section --- */
.landing-login {
    padding: 4rem 0;
    background: #fff;
}
.login-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.login-info .section-tag { margin-bottom: .6rem; }
.login-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .6rem;
}
.login-info > p {
    color: var(--text-light);
    font-size: .88rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
}
.login-perks {
    list-style: none;
    padding: 0;
}
.login-perks li {
    font-size: .82rem;
    color: var(--text);
    padding: .35rem 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.login-perks li::first-letter { color: var(--success); }

.login-form-wrap {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
}

/* Input with icon */
.input-icon-wrap {
    position: relative;
}
.input-icon {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .9rem;
    color: var(--text-muted);
    pointer-events: none;
    line-height: 1;
}
.form-control-icon {
    padding-left: 2.4rem;
}

/* Auth form overrides */
.auth-form .form-group label {
    font-size: .8rem;
    color: #374151;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.auth-form .form-control {
    padding: .6rem .75rem;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    transition: all .2s ease;
}
.auth-form .form-control.form-control-icon {
    padding-left: 2.5rem;
}
.auth-form .form-control:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

/* Login button */
.btn-login {
    padding: .7rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a56db 0%, #2563eb 50%, #3b82f6 100%);
    box-shadow: 0 4px 12px rgba(26,86,219,0.3);
    margin-top: .5rem;
    transition: all .25s ease;
}
.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26,86,219,0.4);
    background: linear-gradient(135deg, #1244af 0%, #1a56db 50%, #2563eb 100%);
}
.btn-arrow {
    transition: transform .2s ease;
    display: inline-block;
}
.btn-login:hover .btn-arrow {
    transform: translateX(3px);
}

/* --- Landing Footer --- */
.landing-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 1.5rem 0;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}
.footer-brand strong {
    color: #e2e8f0;
    font-size: .85rem;
}
.footer-brand p {
    font-size: .72rem;
    color: #64748b;
    margin-top: .1rem;
}
.footer-copy {
    font-size: .72rem;
    color: #64748b;
}

/* --- Landing Responsive --- */
@media (max-width: 768px) {
    .login-split {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .stat-divider { display: none; }
    .stats-bar { gap: 0; }
    .stat-item { min-width: 50%; padding: 1rem .5rem; }
    .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .hero-content { padding: 1.5rem 1rem; }
    .hero-actions { flex-direction: column; }
    .btn-hero-primary, .btn-hero-outline { width: 100%; justify-content: center; }
    .login-form-wrap { padding: 1.5rem 1.2rem; }
    .hero-bg-map img { width: 130vw; }
}

/* ============================================================
   4. CARDS
   ============================================================ */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem 1.2rem;
    border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: .95rem; font-weight: 600; }
.card-body { padding: 1.2rem; }

/* ============================================================
   5. STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stats-grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}
.stat-card-sm { padding: .8rem 1rem; }
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-info h3 { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.stat-info p { font-size: .75rem; color: var(--text-light); margin-top: .1rem; }

.bg-primary { background: var(--primary-light); color: var(--primary); }
.bg-success { background: var(--success-light); color: var(--success); }
.bg-warning { background: var(--warning-light); color: var(--warning); }
.bg-danger { background: var(--danger-light); color: var(--danger); }
.bg-info { background: var(--info-light); color: var(--info); }
.bg-secondary { background: var(--secondary-light); color: var(--secondary); }

/* ============================================================
   6. GRID HELPERS
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 1.2rem; }
.mt-1 { margin-top: 1.2rem; }

/* ============================================================
   7. TABLES
   ============================================================ */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th, .table td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--text-light); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; background: var(--bg); }
.table tbody tr:hover { background: #f9fafb; }
.action-cell { white-space: nowrap; }

.table-detail { width: 100%; }
.table-detail th { width: 35%; padding: .5rem 0; color: var(--text-light); font-weight: 500; vertical-align: top; }
.table-detail td { padding: .5rem 0; }

/* ============================================================
   8. FORMS
   ============================================================ */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: .3rem; font-size: .85rem; }
.required { color: var(--danger); }

.form-control {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .85rem;
    font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--white);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
textarea.form-control { resize: vertical; }
select.form-control { cursor: pointer; }

/* ============================================================
   9. BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: .85rem;
    font-family: var(--font);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    gap: .4rem;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline { background: var(--white); color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); border-color: #d1d5db; }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-sm { padding: .3rem .6rem; font-size: .78rem; }
.btn-block { width: 100%; }

/* ============================================================
   10. BADGES
   ============================================================ */
.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.5;
    text-transform: capitalize;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-secondary { background: var(--secondary-light); color: var(--secondary); }

/* ============================================================
   11. ALERTS
   ============================================================ */
.alert {
    padding: .75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--info-light); color: #155e75; border: 1px solid #a5f3fc; }
.alert-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: inherit; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* ============================================================
   12. PROGRESS BAR
   ============================================================ */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--secondary-light);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width .4s ease;
}

/* ============================================================
   13. PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; }
.page-header p { color: var(--text-light); font-size: .85rem; width: 100%; }
.page-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.search-inline { display: flex; gap: .4rem; }
.search-inline .form-control { width: 200px; }

/* ============================================================
   14. TABS
   ============================================================ */
.tab-nav { display: flex; gap: .3rem; }
.tab-link {
    padding: .35rem .75rem;
    border-radius: 6px;
    font-size: .8rem;
    color: var(--text-light);
    background: var(--secondary-light);
    font-weight: 500;
}
.tab-link:hover { background: #e5e7eb; text-decoration: none; color: var(--text); }
.tab-link.active { background: var(--primary); color: #fff; }

/* ============================================================
   15. PROFILE ITEM
   ============================================================ */
.profile-item {
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
}
.profile-item:last-child { border-bottom: none; }

/* ============================================================
   16. PAGINATION
   ============================================================ */
.pagination { display: flex; gap: .3rem; margin-top: 1rem; justify-content: center; }
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 .5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .8rem;
    color: var(--text);
    background: var(--white);
}
.page-link:hover { background: var(--bg); text-decoration: none; }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================
   17. ERROR PAGES
   ============================================================ */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}
.error-page h1 { font-size: 4rem; color: var(--primary); }
.error-page p { color: var(--text-light); margin: .5rem 0 1.5rem; }

/* ============================================================
   18. UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* ============================================================
   19. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrap {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
    .main-content {
        padding: 1rem;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .page-actions {
        width: 100%;
    }
    .search-inline .form-control {
        width: 100%;
        flex: 1;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .stat-info h3 { font-size: 1.1rem; }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .tab-nav {
        flex-wrap: wrap;
    }
}

/* ============================================================
   20. PRINT
   ============================================================ */
@media print {
    .sidebar, .topbar, .sidebar-toggle, .btn, .page-actions { display: none !important; }
    .main-wrap { margin-left: 0; }
    .main-content { padding: 0; }
    .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
}

/* ============================================================
   21. MAP & INTERACTIVE ELEMENTS
   ============================================================ */
.map-filter-label {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .85rem;
    cursor: pointer;
}
.map-filter-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: .3rem;
}

/* ============================================================
   22. REPORT CARDS (Pusat Laporan)
   ============================================================ */
.report-card .card-body {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}
.report-desc {
    font-size: .85rem;
    color: var(--text-light);
    line-height: 1.5;
}
.report-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}
.report-actions {
    display: flex;
    gap: .5rem;
    margin-top: auto;
}

/* 3-column grid for dashboard */
@media (min-width: 1025px) {
    .grid-2[style*="grid-template-columns:1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr 1fr;
    }
}
@media (max-width: 1024px) {
    .grid-2[style*="grid-template-columns:1fr 1fr 1fr"] {
        grid-template-columns: 1fr;
    }
}

/* Leaflet popup overrides */
.leaflet-popup-content { font-family: var(--font); }
.leaflet-popup-content h4 { font-size: .95rem; }

/* ============================================================
   22. FILE UPLOAD
   ============================================================ */
input[type="file"].form-control {
    padding: .4rem .5rem;
    cursor: pointer;
}
input[type="file"].form-control::file-selector-button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: .3rem .8rem;
    border-radius: 4px;
    font-size: .8rem;
    cursor: pointer;
    margin-right: .6rem;
}
input[type="file"].form-control::file-selector-button:hover {
    background: var(--primary-dark);
}

/* ============================================================
   23. GRID-3 HELPER
   ============================================================ */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-bottom: 1.2rem; }
@media (max-width: 1024px) { .grid-3 { grid-template-columns: 1fr; } }

/* ============================================================
   24. PROJECTOR MODE — Tulisan Besar & Kontras Tinggi
   Diaktifkan melalui body.projector-mode (togol butang / kekunci P)
   ============================================================ */

/* ─── Toggle Button ─── */
.projector-toggle {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9999;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
    transition: all .3s;
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 6px;
}
.projector-toggle:hover { background: var(--primary-dark); transform: translateY(-1px); }
.projector-toggle.active { background: #d97706; }
@media print { .projector-toggle { display: none !important; } }

/* ─── Base Font Scale ─── */
body.projector-mode { font-size: 18px; }

/* ─── Sidebar ─── */
body.projector-mode .sidebar { --sidebar-w: 280px; width: 280px; }
body.projector-mode .sidebar-header h2 { font-size: 1.15rem; }
body.projector-mode .sidebar-header small { font-size: .85rem; }
body.projector-mode .nav-group-title { font-size: .78rem; }
body.projector-mode .nav-link { font-size: 1rem; padding: .55rem 1.2rem; }
body.projector-mode .nav-icon { font-size: 1.15rem; }
body.projector-mode .main-wrap { margin-left: 280px; }

/* ─── Topbar ─── */
body.projector-mode .topbar { height: 64px; }
body.projector-mode .user-info { font-size: 1rem; }
body.projector-mode .sidebar-toggle { font-size: 1.5rem; }

/* ─── Page Header / Titles ─── */
body.projector-mode .page-header h2,
body.projector-mode .page-title { font-size: 1.6rem; font-weight: 700; }
body.projector-mode .page-header p,
body.projector-mode .page-subtitle { font-size: 1.05rem; }

/* ─── Card ─── */
body.projector-mode .card-header h3 { font-size: 1.15rem; font-weight: 700; }
body.projector-mode .card-body { font-size: 1rem; padding: 1.4rem; }

/* ─── Stat Cards ─── */
body.projector-mode .stat-info h3 { font-size: 1.8rem; font-weight: 800; }
body.projector-mode .stat-info p { font-size: .9rem; font-weight: 500; }
body.projector-mode .stat-icon { font-size: 1.8rem; }

/* ─── Tables ─── */
body.projector-mode .table { font-size: 1rem; }
body.projector-mode .table th { font-size: .9rem; padding: .75rem 1rem; }
body.projector-mode .table td { padding: .7rem 1rem; }
body.projector-mode .table-detail th { font-size: .95rem; }
body.projector-mode .table-detail td { font-size: 1rem; }

/* ─── Forms ─── */
body.projector-mode .form-group label { font-size: 1rem; font-weight: 600; }
body.projector-mode .form-control { font-size: 1rem; padding: .6rem .8rem; }
body.projector-mode select.form-control { font-size: 1rem; }

/* ─── Buttons ─── */
body.projector-mode .btn { font-size: 1rem; padding: .55rem 1.2rem; }
body.projector-mode .btn-sm { font-size: .9rem; padding: .35rem .75rem; }

/* ─── Badges ─── */
body.projector-mode .badge { font-size: .85rem; padding: .2rem .7rem; font-weight: 700; }

/* ─── Alerts ─── */
body.projector-mode .alert { font-size: 1rem; padding: .9rem 1.2rem; }

/* ─── Pagination ─── */
body.projector-mode .page-link { font-size: 1rem; padding: .5rem .8rem; }

/* ─── Progress Bar ─── */
body.projector-mode .progress-bar { height: 12px; }

/* ─── Tabs ─── */
body.projector-mode .tab-link { font-size: 1rem; padding: .6rem 1.2rem; }

/* ─── Footer ─── */
body.projector-mode .main-footer { font-size: .9rem; }

/* ─── Map ─── */
body.projector-mode .map-filter-label { font-size: 1rem; }

/* ─── Report Cards ─── */
body.projector-mode .report-card h3 { font-size: 1.15rem; }
body.projector-mode .report-card p { font-size: .95rem; }

/* ─── Search Inline ─── */
body.projector-mode .search-inline .form-control { font-size: 1rem; }

/* ─── Override responsive sidebar for projector ─── */
@media (max-width: 1024px) {
    body.projector-mode .sidebar { width: 280px; left: -280px; }
    body.projector-mode .sidebar.open { left: 0; }
    body.projector-mode .main-wrap { margin-left: 0; }
}
