/* Global look & feel */
* {
    font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 20% 20%, rgba(120, 141, 255, 0.15), transparent 25%),
                radial-gradient(circle at 80% 0%, rgba(87, 230, 200, 0.12), transparent 25%),
                #f7f9fc;
    color: #1f2a44;
    min-height: 100vh;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0d6efd, #2563eb);
    color: #fff;
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
    align-self: flex-start;
    min-height: 100vh;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease;
}

.sidebar-brand .brand-img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    background: #fff;
}

.brand-logo {
    background: #fff;
    color: #0d6efd;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
    display: inline-block;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-link {
    color: #e2e8f0;
    text-decoration: none;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.topbar {
    background: linear-gradient(120deg, #0d6efd, #5b8dee);
    padding: 0.65rem 1rem;
    box-shadow: 0 10px 30px rgba(13, 110, 253, 0.25);
    color: #fff;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    flex: 1;
}

.card {
    border: 1px solid #e5e9f2;
    border-radius: 14px;
    box-shadow: 0 15px 40px rgba(31, 42, 68, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
    background: #fff;
    padding: 0.5rem;
}
.card .card-body {
    padding: 1rem 1.25rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 48px rgba(31, 42, 68, 0.1);
}

.card-stat .icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.card-title {
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-gap {
    margin-top: 1.5rem;
}

.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 12px 26px rgba(30, 64, 175, 0.28);
}

.btn-outline-secondary {
    border-color: #d1d5db;
    color: #374151;
}
.btn:active {
    transform: scale(0.98);
}
.btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.nav-link {
    transition: color 0.15s ease, opacity 0.15s ease;
}
.nav-link:hover {
    opacity: 0.8;
}

.table thead th {
    background: #f0f4ff;
    color: #1f2a44;
    border-bottom: 1px solid #e5e9f2;
}

.badge {
    font-weight: 600;
}

.badge-it {
    background: #2563eb;
}

.badge-hukum {
    background: #d97706;
}

.badge-kesehatan {
    background: #10b981;
}

footer {
    background: #fff;
    border-top: 1px solid #e5e9f2;
    box-shadow: 0 -10px 30px rgba(31, 42, 68, 0.04);
}
.footer-line {
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, transparent, #d1d5db, transparent);
}

.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(31, 42, 68, 0.08);
}

.progress {
    height: 12px;
    border-radius: 999px;
}

.table-responsive {
    overflow-x: auto;
}

.avatar-circle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    border: 2px solid #fff;
}
.chart-wrapper {
    position: relative;
    min-height: 240px;
}
.chart-wrapper canvas {
    position: relative;
    z-index: 2;
}
.chart-empty {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.page-content {
    flex: 1;
}

.hero-login {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.08));
    border: 1px solid #e0e7ff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(31, 42, 68, 0.05);
    color: #1f2a44;
}

.auth-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Dark mode */
.dark-mode {
    background: #0b1220;
    color: #e5e7eb;
}
.dark-mode html,
.dark-mode body {
    background: #0b1220;
    background-image: none;
}
.dark-mode .layout,
.dark-mode .main-wrapper,
.dark-mode .page-content,
.dark-mode .container {
    background: #0b1220;
    color: #e5e7eb;
}
.dark-mode .card {
    background: #0f172a;
    border-color: #111827;
    box-shadow: 0 15px 35px rgba(0,0,0,0.45);
    color: #e5e7eb;
}
.dark-mode .navbar {
    background: linear-gradient(120deg, #111827, #0f172a);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.dark-mode .navbar-brand { color: #e5e7eb; }
.dark-mode .brand-logo { background: #1f2937; color: #38bdf8; }
.dark-mode .brand-img { box-shadow: 0 4px 10px rgba(0,0,0,0.35); }
.dark-mode .table thead th { background: #111827; color: #e5e7eb; border-color: #1f2937; }
.dark-mode .table {
    background-color: #0f172a;
}
.dark-mode .table tbody tr { color: #e5e7eb; }
.dark-mode .table>:not(caption)>*>* {
    background-color: #0f172a;
    border-color: #1f2937;
    color: #e5e7eb;
}
.dark-mode .table-striped > tbody > tr:nth-of-type(odd) { background-color: rgba(51, 65, 85, 0.35); }
.dark-mode .table-striped > tbody > tr:nth-of-type(even) { background-color: rgba(31, 41, 55, 0.4); }
.dark-mode .table-bordered>:not(caption)>* { border-color: #1f2937; }
.dark-mode .table-bordered>:not(caption)>*>* { border-color: #1f2937; background-color: #0f172a; }
.dark-mode .table td,
.dark-mode .table th {
    border-color: #1f2937 !important;
}
.dark-mode footer { background: #0f172a; border-top-color: #1f2937; }
.dark-mode .footer-line { background: linear-gradient(90deg, transparent, #334155, transparent); }
.dark-mode .alert { background: #1f2937; color: #e5e7eb; }
.dark-mode .card-title { color: #f3f4f6; }
.dark-mode .text-muted { color: #cbd5e1 !important; }
.dark-mode p { color: #e5e7eb; }
.dark-mode small { color: #d1d5db; }
.dark-mode .form-control,
.dark-mode .form-select {
    background: #0f172a;
    border-color: #1f2937;
    color: #e5e7eb;
    box-shadow: none;
}
.dark-mode .form-control::placeholder {
    color: #94a3b8;
}
.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
    background: #0f172a;
    border-color: #2563eb;
    color: #e5e7eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}
.dark-mode .form-label {
    color: #e5e7eb;
}
.dark-mode .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(51, 65, 85, 0.35);
}
.dark-mode .hero-login {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.12));
    border-color: #1f2937;
    color: #e5e7eb;
}
.dark-mode .hero-login p,
.dark-mode .hero-login li {
    color: #e5e7eb;
}
.dark-mode .card p {
    color: #e5e7eb;
}
.dark-mode .text-guide {
    color: #f3f4f6 !important;
}
.dark-mode .hero-login .text-muted {
    color: #cbd5e1 !important;
}
.dark-mode .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.28);
}
.dark-mode .btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.32);
}
.dark-mode .btn-outline-secondary {
    border-color: #475569;
    color: #e5e7eb;
}
.dark-mode .btn-outline-light {
    border-color: #e5e7eb;
    color: #e5e7eb;
}
.dark-mode .btn-outline-dark {
    border-color: #e5e7eb;
    color: #e5e7eb;
}
.dark-mode .section-title {
    color: #f3f4f6;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .card {
        padding: 0.75rem;
    }
    .card-title {
        margin-bottom: 0.75rem;
    }
    .display-6 {
        font-size: 1.75rem;
    }
    .table {
        font-size: 0.9rem;
    }
    .chart-wrapper {
        min-height: 200px;
    }
    .brand-logo {
        padding: 3px 6px;
    }
    .row.g-3 > [class*="col-"] {
        margin-bottom: 0.75rem;
    }
    .chart-wrapper {
        min-height: 180px;
    }
    .sidebar {
        position: fixed;
        z-index: 1050;
        transform: translateX(-110%);
    }
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
    .main-wrapper {
        flex: 1;
    }
}

.dark-mode .sidebar {
    background: linear-gradient(180deg, #0f172a, #111827);
    box-shadow: 4px 0 24px rgba(0,0,0,0.45);
}

.dark-mode .sidebar-link:hover {
    background: rgba(255,255,255,0.08);
}

.dark-mode .topbar {
    background: linear-gradient(120deg, #111827, #0f172a);
}
.dark-mode .page-content,
.dark-mode .container {
    background: transparent;
}
.dark-mode .list-group-item {
    background: #0f172a;
    color: #e5e7eb;
    border-color: #1f2937;
}
