:root {
    --primary-color: #1abc9c;
    /* Green Sea - More vibrant & Fresh */
    --secondary-color: #16a085;
    /* Darker Green Sea */
    --accent-color: #f1c40f;
    /* Sunflower Gold - More Pop */
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --bg-color: #ecfcf9;
    /* Very light mint/cream mix */
    --text-color: #2c3e50;
    /* Midnight Blue for sharp text */
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #d1eff2;
    --shadow: 0 4px 15px rgba(26, 188, 156, 0.15);
    /* Minty Shadow */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Dark Mode Variables - Premium Deep Emerald */
body.dark-mode {
    --bg-color: #041C18;
    /* Deepest Jungle Green */
    --text-color: #E8F5E9;
    /* Soft White */
    --sidebar-bg: #072924;
    /* Dark Emerald */
    --card-bg: #0A332C;
    /* Slightly lighter Emerald for cards */
    --border-color: #145248;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    /* Deeper shadow for depth */
}

/* Dark Mode Overrides for Specific Elements */
body.dark-mode {
    background: linear-gradient(135deg, #041C18 0%, #072924 100%);
    /* Deep Emerald Gradient */
    color: var(--text-color);
}

body.dark-mode .top-header {
    background: linear-gradient(to right, #0A332C, #041C18);
    border-left-color: var(--accent-color);
    /* Gold border in dark mode */
}

body.dark-mode .nav-link:hover,
body.dark-mode .nav-link.active {
    background: linear-gradient(to right, #16a085, #00695c);
    box-shadow: 0 4px 15px rgba(22, 160, 133, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    /* Subtle clean gradient */
    background-color: var(--bg-color);
    /* Fallback */
    color: var(--text-color);
    transition: var(--transition);
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    color: var(--secondary-color);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: #fff;
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(77, 182, 172, 0.3);
}

.nav-link:hover i,
.nav-link.active i {
    color: var(--accent-color);
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.8rem;
    text-align: center;
    opacity: 0.7;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    width: calc(100% - 260px);
}

/* --- HEADER --- */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 25px;
    background: linear-gradient(to right, #ecfcf9, #ffffff);
    /* Subtle Mint Gradient Header */
    border-left: 5px solid var(--primary-color);
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

#sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    display: none;
    /* Only show on mobile */
}

/* Aesthetic Clock Design */
.datetime-display {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    padding: 10px 25px;
    border-radius: 50px;
    border: 2px solid var(--accent-color);
    /* Gold Border */
    box-shadow: 0 4px 15px rgba(77, 182, 172, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: transform 0.3s ease;
}

.datetime-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(77, 182, 172, 0.5);
}

.datetime-display span {
    position: relative;
}

/* Add separators if needed via CSS or leave as text */

/* --- SECTIONS --- */
.page-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- DASHBOARD --- */
.welcome-card {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 35px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(22, 160, 133, 0.4);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.welcome-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-20deg);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card.blue .icon {
    background-color: #4361ee;
}

.stat-card.green .icon {
    background-color: #2ecc71;
}

.stat-card.orange .icon {
    background-color: #f39c12;
}

.stat-card .info h4 {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

.stat-card .info h2 {
    font-size: 2rem;
    font-weight: 700;
}

.dashboard-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-container {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.stats-list {
    list-style: none;
    margin-top: 15px;
}

.stats-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.badge {
    background-color: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* --- FORMS --- */
.form-container {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.form-container h3 {
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group.half {
    width: 50%;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: border 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px 25px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary {
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    color: white;
    box-shadow: 0 4px 10px rgba(26, 188, 156, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(26, 188, 156, 0.4);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

/* --- TABLE --- */
.table-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.search-box input {
    padding-left: 40px;
}

.table-responsive {
    overflow-x: auto;
    background-color: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.student-table {
    width: 100%;
    border-collapse: collapse;
}

.student-table th,
.student-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.student-table th {
    background-color: rgba(67, 97, 238, 0.05);
    font-weight: 600;
    color: var(--primary-color);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    color: white;
}

/* --- SETTINGS --- */
.settings-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* --- ABOUT --- */
.about-card {
    text-align: center;
    background-color: var(--card-bg);
    padding: 50px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.about-header i {
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* --- FOOTER --- */
.main-footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    #sidebar-toggle {
        display: block;
    }

    .dashboard-charts-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group.half {
        width: 100%;
    }
}