﻿body {
    background: #f4f6f9;
    font-family: 'Segoe UI', sans-serif;
}
/* Sidebar */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #1e3c72, #2a5298);
    color: #fff;
    position: fixed;
    /* ✅ AUTO SCROLL WHEN CONTENT EXCEEDS HEIGHT */
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

    .sidebar h4 {
        font-weight: 700;
    }

    .sidebar a {
        color: #dbe7ff;
        text-decoration: none;
        display: block;
        padding: 12px 18px;
        border-radius: 8px;
        margin-bottom: 6px;
    }

        .sidebar a:hover, .sidebar a.active {
            background: rgba(255,255,255,0.15);
            color: #fff;
        }

/* Main */
.main {
    margin-left: 260px;
}

/* Header */
.topbar {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 12px 25px;
}

    .topbar .profile {
        display: flex;
        align-items: center;
        gap: 10px;
    }

.avatar {
    width: 40px;
    height: 40px;
    background: #2a5298;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Cards */
.stat-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: 0.3s;
}

    .stat-card:hover {
        transform: translateY(-6px);
    }

/* TOGGLE SIDEBAR */
.sidebar {
    width: 240px;
    transition: all 0.3s ease;
}

.main {
    margin-left: 240px;
    transition: all 0.3s ease;
}

/* WHEN SIDEBAR HIDDEN */
body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .main {
    margin-left: 0;
}

/* MOBILE SUPPORT */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 1000;
    }
}


/* Footer */
footer {
    background: #fff;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    color: #666;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
    }

    .main {
        margin-left: 0;
    }
}

.auto-corrected {
    animation: flashGreen 1.2s ease-in-out;
}

@keyframes flashGreen {
    0% {
        box-shadow: 0 0 0 0 rgba(25,135,84,.8);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(25,135,84,.3);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(25,135,84,0);
    }
}

