:root {
    --primary-color: #271a45;   /* Ungu utama STID */
    --accent-color: #6c5ce7;    /* Ungu terang / aksen */
    --secondary-color: #3b2a6a; /* Ungu lebih gelap */
    --dark-color: #0f172a;
    --light-bg: #f8fafc;
    --card-shadow: 0 10px 30px rgba(0,0,0,0.1);
    --border-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--light-bg);
    color: var(--dark-color);
    overflow-x: hidden;
}

/* Modern Navbar */
.navbar-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-modern.scrolled {
    padding: 0.5rem 0;
    background: white;
}

.navbar-brand-modern {
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-modern .nav-link {
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-modern .nav-link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    transform: translateY(-2px);
}

.btn-login {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(39, 26, 69, 0.4);
    color: white;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #271a45 0%, #3b2a6a 45%, #6c5ce7 100%);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-hero {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-hero-primary {
    background: white;
    color: var(--primary-color);
}

.btn-hero-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    color: var(--primary-color);
}

.btn-hero-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-hero-secondary:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
}

.hero-image {
    position: relative;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Section Styles */
.section-padding {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.section-title p {
    color: #64748b;
    font-size: 1.1rem;
}

/* Modern Cards */
.card-modern {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    height: 100%;
}

.card-modern:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
}

.card-header-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin: -2rem -2rem 1.5rem -2rem;
}

.card-header-modern h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.25rem;
}

/* Filter Section */
.filter-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.form-label-modern {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control-modern {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-control-modern:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(39, 26, 69, 0.12);
}

/* Modern Buttons */
.btn-modern {
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-modern-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(39, 26, 69, 0.4);
    color: white;
}

.btn-modern-secondary {
    background: #f1f5f9;
    color: var(--dark-color);
}

.btn-modern-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

/* Table Styles */
.table-modern {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.table-modern thead {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

.table-modern th {
    border: none;
    padding: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-modern td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.table-modern tbody tr:hover {
    background: #f8fafc;
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-top: 4px solid;
}

.stat-card:nth-child(1) { border-top-color: var(--primary-color); }
.stat-card:nth-child(2) { border-top-color: var(--accent-color); }
.stat-card:nth-child(3) { border-top-color: var(--primary-color); }
.stat-card:nth-child(4) { border-top-color: var(--accent-color); }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
}

.stat-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
}

.stat-card:nth-child(1) .stat-icon { background: rgba(108, 92, 231, 0.12); color: #6c5ce7; }
.stat-card:nth-child(2) .stat-icon { background: rgba(39, 26, 69, 0.12); color: #271a45; }
.stat-card:nth-child(3) .stat-icon { background: rgba(129, 140, 248, 0.16); color: #4f46e5; }
.stat-card:nth-child(4) .stat-icon { background: rgba(203, 213, 225, 0.45); color: #334155; }

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #64748b;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.chart-box {
    background: white;
    border-radius: 22px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,.06);
    margin-bottom: 30px;
}

.chart-container {
    width: 100%;
    height: 330px;
    position: relative;
}

#mapContainer {
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.06);
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Map Container */
.map-wrapper {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

#mapContainer {
    border-radius: 12px;
    overflow: hidden;
}

/* Footer Modern */
.footer-modern {
    background: linear-gradient(135deg, #271a45 0%, #3b2a6a 45%, #6c5ce7 100%);
    color: white;
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
}

.footer-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
}

.footer-content {
    position: relative;
    z-index: 1;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 1rem;
    padding-top: 1rem;
    text-align: center;
    color: rgba(255,255,255,0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .section-title h2 {
        font-size: 1.75rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

/* Loading Animation */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Badge Modern */
.badge-modern {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-block;
}

.badge-success {
    background: rgba(52, 211, 153, 0.12);
    color: #059669;
}

.badge-primary {
    background: rgba(108, 92, 231, 0.12);
    color: #6c5ce7;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* ============================= */
/* PATCH FIX — DO NOT REMOVE     */
/* ============================= */

/* Fix duplicate chart-container issues */
.chart-container {
    height: 330px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Atur ulang box chart agar tidak melar */
.chart-box canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 330px !important;
}

/* Navbar Toggler Icon (Bootstrap fix) */
.navbar-toggler {
    border: none;
}

.navbar-toggler-icon {
    width: 1.5rem;
    height: 1.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba%280,0,0,0.7%29' stroke-width='3' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Hero height fix for mobile */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 120px;
        min-height: 80vh;
    }
}

/* Prevent hero image overflow */
.hero-image img {
    max-width: 90%;
    height: auto;
}

/* Datamaps bubble fix */
.datamap path {
    vector-effect: non-scaling-stroke;
}

/* Back to top button fix */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;

    display: none;
    width: 50px !important;
    height: 50px !important;

    border-radius: 50% !important;
    line-height: 50px !important;
    padding: 0 !important;

    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
    z-index: 9999;
}
.back-to-top:hover {
    background: #1f1535;
}

/* Select2 height fix */
.select2-container--bootstrap-5 .select2-selection {
    min-height: 48px !important;
    padding: 8px !important;
    border-radius: 10px !important;
}

.select2-container--bootstrap-5 .select2-selection__rendered {
    line-height: 32px !important;
}

/* Fix card hover jitter */
.card-modern,
.stat-card {
    transform: translateZ(0);
}

.btn-detail {
    background: var(--primary-color) !important;
    color: white !important;
    padding: 6px 18px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    transition: 0.25s ease;
    text-decoration: none;
}

.btn-detail:hover {
    background: var(--accent-color) !important;
    color: #111827 !important;
    transform: translateY(-2px);
}

/* Ukuran Logo Hero Agar Tidak Terlalu Besar */
.hero-image img {
    width: 70%;
    max-width: 380px;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.15));
}

/* Mobile: kecilkan lagi */
@media (max-width: 768px) {
    .hero-image img {
        width: 60%;
        max-width: 260px;
    }
}
