:root {
    --primary-color: #003366;
    /* Deep Navy Blue */
    --secondary-color: #FFCC00;
    /* Gold/Yellow */
    --accent-color: #E63946;
    /* Red Accent */
    --text-color: #333333;
    --bg-light: #f4f7f6;
    --white: #ffffff;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

[data-theme="dark"] {
    --primary-color: #64b5f6;
    /* Lighter Blue */
    --secondary-color: #ffd54f;
    /* Lighter Gold */
    --accent-color: #e57373;
    --text-color: #e0e0e0;
    --bg-light: #121212;
    --white: #1e1e1e;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

body {
    transition: background-color 0.3s, color 0.3s;
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navbar */
body>header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

[data-theme="dark"] body>header {
    background-color: rgba(30, 30, 30, 0.9);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 3px;
    letter-spacing: -0.5px;
}

.logo ion-icon {
    font-size: 1.8rem;
}

.nav-menu {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-left: 20px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-link {
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-color);
    padding: 8px 12px;
}

.login-link:hover {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links li a {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    padding: 8px 10px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--primary-color);
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

[data-theme="dark"] .nav-links li a:hover,
[data-theme="dark"] .nav-links li a.active {
    background-color: rgba(100, 181, 246, 0.1);
}

.search-form {
    display: flex;
    align-items: center;
    background-color: var(--bg-light);
    border-radius: 20px;
    padding: 5px 15px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.search-form input {
    border: none;
    background: transparent;
    padding: 5px;
    font-size: 0.9rem;
    color: var(--text-color);
    outline: none;
    width: 100px;
    transition: width 0.3s;
}

.search-form input:focus {
    width: 150px;
}

.search-form button {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    padding: 5px;
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.8rem;
    color: var(--primary-color);
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

/* Mobile Menu */
@media (max-width: 1100px) {
    .navbar {
        padding: 1.25rem 0;
    }

    .desktop-only {
        display: none;
    }

    .logo {
        font-size: 1.15rem;
        gap: 8px;
    }

    .logo img {
        height: 34px !important;
    }

    .mobile-only {
        display: flex;
        align-items: center;
        gap: 18px;
    }

    .hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: var(--bg-light);
        transition: background-color 0.3s;
    }

    .hamburger:active {
        background-color: rgba(0, 0, 0, 0.05);
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--white);
        background-image: radial-gradient(circle at 10% 20%, rgba(0, 51, 102, 0.02) 0%, transparent 20%),
            radial-gradient(circle at 90% 80%, rgba(255, 204, 0, 0.05) 0%, transparent 20%);
        flex-direction: column;
        justify-content: center;
        padding: 80px 30px 40px;
        gap: 25px;
        transform: translateX(100%);
        transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, visibility 0.4s ease;
        z-index: 999;
        overflow-y: auto;
        margin-left: 0;
        display: flex !important;
        visibility: hidden;
        opacity: 0;
    }

    .nav-menu.active {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 5px;
        align-items: center;
    }

    .nav-links li {
        width: 100%;
        max-width: 300px;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease;
    }

    .nav-menu.active .nav-links li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered animation for nav links */
    .nav-menu.active .nav-links li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-menu.active .nav-links li:nth-child(2) {
        transition-delay: 0.15s;
    }

    .nav-menu.active .nav-links li:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-menu.active .nav-links li:nth-child(4) {
        transition-delay: 0.25s;
    }

    .nav-menu.active .nav-links li:nth-child(5) {
        transition-delay: 0.3s;
    }

    .nav-menu.active .nav-links li:nth-child(6) {
        transition-delay: 0.35s;
    }

    .nav-menu.active .nav-links li:nth-child(7) {
        transition-delay: 0.4s;
    }

    .nav-links li a {
        display: block;
        padding: 10px 20px;
        text-align: center;
        width: 100%;
        font-size: 1.2rem;
        font-weight: 700;
        border-radius: 50px;
        color: var(--primary-color);
        border: 2px solid transparent;
        transition: all 0.3s ease;
    }

    .nav-links li a.active,
    .nav-links li a:hover {
        background-color: var(--secondary-color);
        color: var(--primary-color);
        border-color: var(--secondary-color);
        transform: scale(1.05);
    }

    .nav-right {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        gap: 15px;
        margin-top: 5px;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease 0.45s;
    }

    .nav-menu.active .nav-right {
        opacity: 1;
        transform: translateY(0);
    }

    .search-form {
        width: 100%;
        padding: 12px 20px;
        background-color: var(--bg-light);
        border-radius: 50px;
    }

    .search-form input {
        width: 100%;
        font-size: 1rem;
    }

    .login-link {
        width: 100%;
        justify-content: center;
        background: rgba(0, 51, 102, 0.05);
        border-radius: 50px;
        padding: 15px;
        font-size: 1rem;
        font-weight: 700;
    }

    .nav-right .btn {
        width: 100%;
        text-align: center;
        padding: 15px;
        font-size: 1rem;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 51, 102, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    background-color: #002244;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 51, 102, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: #e6b800;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0 20px;
    margin-top: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.footer-section p ion-icon {
    font-size: 1.2rem;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* --- Pages Styles --- */

/* Slider Section */
.slider-container {
    position: relative;
    max-width: 100%;
    height: 90vh;
    /* Responsive height */
    max-height: 700px;
    min-height: 400px;
    overflow: hidden;
}

.slider {
    height: 100%;
    position: relative;
}

.slide {
    display: none;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    animation: fade 1.5s;
}

.slide.active {
    display: block;
}

.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    width: 90%;
    max-width: 800px;
    z-index: 2;
}

.slide-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
    line-height: 1.2;
}

.slide-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation Buttons */
.prev-btn,
.next-btn {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.3s ease;
    border-radius: 50%;
    user-select: none;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    margin: 0 20px;
}

.prev-btn:hover,
.next-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.prev-btn {
    left: 0;
}

.next-btn {
    right: 0;
}

/* Dots */
.dots-container {
    text-align: center;
    position: absolute;
    bottom: 30px;
    width: 100%;
    z-index: 5;
}

.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease;
}

.active,
.dot:hover {
    background-color: var(--secondary-color);
    transform: scale(1.2);
}

@keyframes fade {
    from {
        opacity: .4
    }

    to {
        opacity: 1
    }
}

@media (max-width: 768px) {
    .slider-container {
        height: 500px;
        /* Smaller for mobile */
    }

    .slide-content h1 {
        font-size: 2rem;
    }

    .slide-content p {
        font-size: 1rem;
    }

    .prev-btn,
    .next-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin: 0 10px;
    }
}

/* Stats Section */
.stats {
    background-color: var(--white);
    padding: 30px 20px;
    margin-top: -50px;
    /* Overlap effect */
    position: relative;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 20px;
    text-align: center;
}

.stat-item {
    flex: 1;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-item ion-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0;
}

.stat-item h3 {
    font-size: 2rem;
    margin-top: 2px;
    margin-bottom: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.stat-item p {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

@media (max-width: 768px) {
    .stat-item ion-icon {
        font-size: 2rem;
    }

    .stat-item h3 {
        font-size: 1.5rem;
    }

    .stats {
        margin-top: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 40px 20px;
        background-color: var(--bg-light);
    }

    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* General Layout */
.section-padding {
    padding: 60px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.split-layout {
    display: flex;
    align-items: center;
    gap: 60px;
}

.split-layout>div {
    flex: 1;
}

.image-content {
    position: relative;
    z-index: 1;
}

.image-content::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    border-radius: 20px;
    top: 20px;
    right: -20px;
    z-index: -1;
    opacity: 0.1;
}

.image-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    /* Batasi lebar maksimal agar tidak terlalu besar */
    height: 350px;
    /* Kurangi tinggi agar lebih proporsional */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 51, 102, 0.15);
    border: 5px solid white;
    margin: 0 auto;
    /* Tengahkan jika lebar dibatasi */
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.image-wrapper:hover img {
    transform: scale(1.08);
}

@media (max-width: 768px) {
    .section-padding {
        padding: 40px 0;
    }

    .split-layout {
        flex-direction: column;
        gap: 30px;
    }

    .image-wrapper {
        height: 300px;
    }

    .image-content::before {
        display: none;
    }
}

/* News Grid */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header a {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 16px;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.section-header a:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.news-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.news-img {
    height: 220px;
    background-color: #eee;
    width: 100%;
}

.news-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.date {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-content h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.news-content p {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex: 1;
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.read-more:hover {
    color: var(--secondary-color);
    gap: 8px;
    /* animation effect */
}

@media (max-width: 576px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* Gallery Section */
.gallery-section {
    position: relative;
    overflow: hidden;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 250px;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h4 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
}

/* WhatsApp Float Button */
.wa-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.wa-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* ==========================================================================
   E-LEARNING UI COMPONENTS (Non-layout)
   ========================================================================== */

/* Badge counts */
.badge-count {
    background: #ff4757;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: auto;
    font-weight: 700;
}

/* Welcome Header (legacy) */
.welcome-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #edf2f7;
    background: transparent !important;
    box-shadow: none !important;
    position: static !important;
}

.welcome-header h1 {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 5px;
}

.welcome-header h1 span {
    color: var(--text-color);
    font-weight: 500;
}

.welcome-header p {
    color: #718096;
    font-size: 1.1rem;
}

/* Section Styling */
.content-section {
    margin-bottom: 50px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: transparent !important;
    box-shadow: none !important;
    position: static !important;
}

.section-header h3 {
    font-size: 1.3rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.section-header h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--secondary-color);
    border-radius: 2px;
}

/* Tugas Card */
.tugas-card {
    background: #ffffff;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #edf2f7;
    transition: all 0.3s ease;
}

/* UI Components */
.btn-premium {
    background: var(--primary-color);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-premium:hover {
    background: #002244;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 51, 102, 0.2);
    color: #ffffff;
}

.materi-info,
.tugas-info {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 25px;
}

.materi-info span,
.tugas-info span {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.materi-info ion-icon,
.tugas-info ion-icon {
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* Profile Page Styles */
.profile-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
    max-width: 900px;
    display: flex;
    gap: 50px;
    border: 1px solid rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.profile-img-container {
    text-align: center;
    width: 240px;
    flex-shrink: 0;
    background: #fcfdfe;
    padding: 30px 20px;
    border-radius: 20px;
    border: 1px solid #f0f4f8;
}

.profile-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.info-pill {
    background: white;
    padding: 15px;
    border-radius: 16px;
    border: 1px solid #edf2f7;
    text-align: left;
    margin-top: 20px;
}

.info-item {
    margin-bottom: 12px;
}

.info-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    font-weight: 700;
}

.info-value {
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 700;
}

.profile-form {
    flex: 1;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #444;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #f0f0f0;
    border-radius: 14px;
    background: #f8f9fa;
    transition: 0.3s;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.05);
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.security-section {
    background: #fff8f0;
    padding: 25px;
    border-radius: 20px;
    border: 1px solid #ffe8cc;
    margin-top: 20px;
}

.security-title {
    color: #af5300;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #edf2f7;
    border-left: 6px solid #4caf50;
    transition: 0.3s ease;
}

.result-card:hover {
    transform: translateX(10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.score-box {
    background: #f0f7ff;
    color: var(--primary-color);
    width: 80px;
    height: 80px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border: 2px solid #e3f2fd;
}

.score-value {
    font-size: 1.8rem;
    line-height: 1;
}

.score-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    color: #444;
}

.score-pending {
    background: #f8f9fa;
    color: #94a3b8;
    border-color: #e2e8f0;
    width: auto;
    min-width: 100px;
    padding: 10px 15px;
}

/* Responsive for profile/forms */
@media (max-width: 480px) {
    .welcome-header h1 {
        font-size: 1.6rem;
    }
}

/* =========================================
   MODERN DASHBOARD SYSTEM (PREMIUM)
   ========================================= */

:root {
    /* --- Dashboard Layout --- */
    --dashboard-bg: #f8fafc;
    --sidebar-width: 280px;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* --- Theme Fallback Defaults (overridden by theme_loader.php) --- */
    --primary-color: #003366;
    --secondary-color: #FFCC00;
    --accent-color: #E63946;
    --text-color: #333333;
    --bg-light: #f4f7f6;
}

/* --- Layout --- */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: var(--dashboard-bg);
    overflow-x: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--primary-color);
    color: white;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 30px;
    background: var(--dashboard-bg);
}

/* --- Top Navbar (HIDDEN on desktop, visible on mobile) --- */
.dashboard-navbar {
    display: none;
    height: 60px;
    background: white;
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1100;
}

/* --- Sidebar Brand Header --- */
.sidebar-header {
    padding: 24px 20px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--secondary-color);
    color: #001f3f;
}

.brand-icon ion-icon {
    font-size: 1.2rem;
}

.brand-text {
    font-size: 1.08rem;
    font-weight: 800;
    color: white;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* --- Mobile Close (default hidden, shown via media query) --- */
.mobile-close {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.mobile-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* --- Menu Container & Groups --- */
.menu-container {
    flex: 1;
    padding: 12px 12px;
    overflow-y: auto;
}

.menu-group {
    margin-bottom: 20px;
}

.menu-label {
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0 14px;
    margin-bottom: 8px;
    display: block;
    letter-spacing: 1.5px;
}

/* --- Sidebar Menu Links (legacy flat) --- */
.sidebar-menu {
    padding: 12px 12px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu a,
.menu-container a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    position: relative;
}

.sidebar-menu a ion-icon,
.menu-container a ion-icon {
    font-size: 1.18rem;
    flex-shrink: 0;
}

.sidebar-menu a:hover,
.menu-container a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-menu a.active,
.menu-container a.active {
    background: var(--secondary-color);
    color: #001f3f;
    font-weight: 600;
}

/* --- Sidebar Footer --- */
.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.sidebar-footer a ion-icon {
    font-size: 1.18rem;
    flex-shrink: 0;
}

.sidebar-footer a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.sidebar-footer a.active {
    background: var(--secondary-color);
    color: #001f3f;
    font-weight: 600;
}

.logout-btn {
    color: #ff6b6b !important;
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.12) !important;
    color: #ff4444 !important;
}

/* --- Notification Badge --- */
.sidebar-badge {
    margin-left: auto;
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.4;
}

/* --- Scrollbar --- */
.sidebar-menu::-webkit-scrollbar,
.menu-container::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb,
.menu-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* --- Sidebar Light Variant (for Siswa) --- */
.sidebar.sidebar-light {
    background: #ffffff !important;
    color: #334155 !important;
    border-right: 1px solid #e2e8f0;
}

.sidebar-light .sidebar-header {
    border-bottom-color: #f1f5f9;
}

.sidebar-light .brand-icon {
    background: var(--primary-color) !important;
    color: white !important;
}

.sidebar-light .brand-text {
    color: var(--primary-color);
}

.sidebar-light .brand-subtitle {
    color: #94a3b8;
}

.sidebar-light .mobile-close {
    color: #64748b;
}

.sidebar-light .mobile-close:hover {
    background: #f1f5f9;
    color: #334155;
}

.sidebar-light .menu-label {
    color: #94a3b8;
}

.sidebar-light .menu-container a,
.sidebar-light .sidebar-menu a {
    color: #64748b;
}

.sidebar-light .menu-container a:hover,
.sidebar-light .sidebar-menu a:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.sidebar-light .menu-container a.active,
.sidebar-light .sidebar-menu a.active {
    background: var(--primary-color);
    color: white;
}

.sidebar-light .sidebar-footer {
    border-top-color: #f1f5f9;
}

.sidebar-light .sidebar-footer a {
    color: #64748b;
}

.sidebar-light .sidebar-footer a:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.sidebar-light .sidebar-footer .logout-btn {
    color: #ef4444 !important;
}

.sidebar-light .sidebar-footer .logout-btn:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

.sidebar-light .menu-container::-webkit-scrollbar-thumb,
.sidebar-light .sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
}

/* --- Sidebar Overlay (always in DOM, hidden by default) --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1400;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
}

/* --- FAB Toggle (hidden by default) --- */
.menu-toggle {
    display: none;
}

/* --- Grids --- */
.grid-container,
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

/* --- Cards --- */
.card,
.materi-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    background: rgba(0, 51, 102, 0.05);
    padding: 12px;
    border-radius: 14px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.card:hover .stat-icon {
    background: var(--primary-color);
    color: white;
}

/* --- Welcome Banner --- */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    padding: 40px;
    border-radius: 20px;
    color: white;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 51, 102, 0.1);
}

.welcome-banner::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    bottom: -30px;
    right: 100px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.welcome-banner h1 {
    color: white;
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
}

.welcome-banner p {
    opacity: 0.85;
    margin-top: 10px;
    font-size: 1rem;
}

/* --- Responsive: Tablet --- */
@media (max-width: 1024px) {

    .grid-container {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .welcome-banner {
        padding: 32px 24px;
    }

    .welcome-banner h1 {
        font-size: 1.5rem;
    }
}

/* --- Responsive: Mobile (<=768px) --- */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .dashboard-navbar {
        display: flex !important;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 1500;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        visibility: hidden;
        transition: left 0.3s ease, visibility 0.3s ease;
    }

    .sidebar.active {
        left: 0;
        visibility: visible;
    }

    .mobile-close {
        display: flex;
        align-items: center;
    }

    .main-content {
        padding: 16px;
    }

    .welcome-banner {
        padding: 28px 18px;
        border-radius: 16px;
    }

    .welcome-banner h1 {
        font-size: 1.3rem;
    }

    .welcome-banner p {
        font-size: 0.85rem;
    }

    .grid-container,
    .grid-3,
    .grid-2,
    .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .grid-container>* {
        grid-column: span 1 !important;
    }

    /* Table Responsiveness */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Status Badges --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge-success {
    background: #dcfce7;
    color: #166534;
}

.status-badge-warning {
    background: #fef9c3;
    color: #854d0e;
}

.status-badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge-info {
    background: #e0f2fe;
    color: #075985;
}