/* admin-login.css - Complete Version with Stat Card Fix */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #43a047 0%, #1b5e20 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ---------- FONT CLAMPING ---------- */

.login-header h1,
.welcome-section h2,
.module-card h3,
.stat-card h4 {
    font-size: clamp(16px, 4vw, 28px);
}

.login-header p,
.module-card p,
.stat-card p,
.header-text p {
    font-size: clamp(12px, 2.5vw, 16px);
}


/* Login Page Styles */

.login-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
    text-align: center;
    transform: translateY(-20px);
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(-20px);
    }
}

.login-header {
    margin-bottom: 30px;
}

.login-header h1 {
    color: #1b5e20;
    margin-bottom: 10px;
    font-weight: 700;
}

.login-header p {
    color: #666;
}

.company-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #66bb6a, #2e7d32);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    font-weight: bold;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #66bb6a;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 187, 106, 0.1);
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #66bb6a, #2e7d32);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 187, 106, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}


/* Admin Dashboard Styles */

.admin-dashboard {
    display: none;
    background: white;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

.dashboard-header {
    background: linear-gradient(135deg, #66bb6a, #2e7d32);
    color: white;
    padding: 25px 20px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: 80px;
    flex: 1;
}

.header-text h4,
.header-text p {
    margin: 0;
    line-height: 1.4;
}

.header-text h4 {
    font-size: clamp(18px, 3vw, 26px);
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-text p {
    font-size: clamp(12px, 2vw, 16px);
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 15px;
}

.fixed-top-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.fixed-top-right span {
    font-size: clamp(12px, 2vw, 16px);
    font-weight: 500;
}

.logout-btn {
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: clamp(12px, 2vw, 16px);
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.dashboard-content {
    padding: 30px;
    max-width: 100%;
    margin: 0 auto;
}

.welcome-section {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.welcome-section h2 {
    color: #1b5e20;
    margin-bottom: 10px;
}

.welcome-section p {
    color: #2e7d32;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.module-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient( 90deg, transparent, rgba(102, 187, 106, 0.1), transparent);
    transition: left 0.5s;
}

.module-card:hover::before {
    left: 100%;
}

.module-card:hover {
    border-color: #66bb6a;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 187, 106, 0.2);
}

.module-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #66bb6a, #2e7d32);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    transition: all 0.3s;
}

.module-card:hover .module-icon {
    transform: scale(1.1) rotate(5deg);
}

.module-card h3 {
    color: #1b5e20;
    margin-bottom: 10px;
    font-weight: 700;
}

.module-card p {
    color: #666;
    line-height: 1.5;
}


/* =================== ENHANCED STAT CARD STYLES - FIX XUỐNG DÒNG =================== */

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px 25px;
    border-radius: 12px;
    border-left: 4px solid #66bb6a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-width: 280px;
}

.stat-card h4 {
    color: #66bb6a;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(20px, 3vw, 24px);
    font-weight: 600;
}

.stat-card p {
    color: #666;
    font-size: clamp(12px, 2vw, 14px);
}


/* Đặc biệt cho datetime card */

.stat-card.datetime-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 100px;
}

.stat-card.datetime-card h4 {
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-card.datetime-card p {
    margin: 0;
    font-weight: 500;
}


/* Đặc biệt cho format ngày dài tiếng Việt */

.stat-card h4.long-date {
    white-space: nowrap;
    font-size: clamp(16px, 2.5vw, 16px);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Error Message */

.error-message {
    color: #c62828;
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    padding: 10px;
    background: #ffebee;
    border-radius: 8px;
    border: 1px solid #ffcdd2;
}


/* Loading Animation */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #66bb6a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.fixed-top-left {
    position: absolute;
    top: 35px;
    left: 100px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.fixed-top-left .company-logo {
    width: 60px;
    height: 60px;
    font-size: 24px;
    background: linear-gradient(135deg, #66bb6a, #2e7d32);
    border-radius: 50%;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.fixed-top-left .header-text {
    color: white;
    line-height: 1.3;
    margin-bottom: 15px;
}

.fixed-top-left .header-text h4 {
    margin: 0;
    font-weight: 700;
}

.fixed-top-left .header-text p {
    margin: 0;
    opacity: 0.9;
}


/* Sidebar Styles */

.sidebar {
    background-color: #ffffff;
    color: rgb(0, 0, 0);
    padding: 15px;
    width: 280px;
    height: 100vh;
    font-family: "Segoe UI", sans-serif;
    position: fixed;
    top: 0;
    left: -100%;
    transition: left 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.open {
    left: 0;
}

.sidebar .menu-nav {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.sidebar .menu-nav>li>a {
    color: rgb(0, 0, 0);
    font-weight: 555;
    text-decoration: none;
    font-size: 16px;
    display: block;
    padding: 11px 15px;
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar .menu-nav>li>a:hover {
    background-color: #71c562;
    color: #000000;
}

.sidebar .dropdown-menu {
    list-style: none;
    padding-left: 0;
    margin-top: 5px;
    background-color: rgba(206, 206, 206, 0.399);
    border-radius: 8px;
    display: none;
    transition: all 0.3s ease;
}

.sidebar .dropdown:hover .dropdown-menu {
    display: block;
}

.sidebar .dropdown-menu li a {
    display: block;
    padding: 8px 20px 8px 35px;
    color: #000000;
    text-decoration: none;
    font-size: 15px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.sidebar .dropdown-menu li a:hover {
    background-color: #8686865c;
    transform: scale(1.06);
}

.menu-btn {
    position: absolute;
    top: 30px;
    left: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.menu-btn:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.menu-btn img {
    width: 45px;
    height: 45px;
    filter: brightness(0) invert(1);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}


/* Prevent body scroll when sidebar is open */

body.sidebar-open {
    overflow: hidden;
}

.menu-nav .home-menu-item {
    margin-bottom: 0;
}

.menu-nav .home-link {
    color: rgb(0, 0, 0);
    font-weight: 555;
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}


/* Menu icon styling */

.menu-nav .menu-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}


/* Menu divider - làm mỏng hơn */

.menu-nav .menu-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 8px 15px;
    border: none;
    list-style: none;
}


/* =================== HIỆU ỨNG SWEEP CHO TẤT CẢ NÚT SIDEBAR =================== */


/* Thêm sweep effect cho tất cả menu items */

.sidebar .menu-nav>li>a {
    position: relative;
    overflow: hidden;
}

.sidebar .menu-nav>li>a::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient( 90deg, transparent, rgba(113, 197, 98, 0.3), transparent);
    transition: left 0.5s ease;
    z-index: 0;
}

.sidebar .menu-nav>li>a:hover::before {
    left: 100%;
}


/* Đảm bảo text và icon nằm trên sweep effect */

.sidebar .menu-nav>li>a>* {
    position: relative;
    z-index: 1;
}


/* Sweep effect cho dropdown menu items */

.sidebar .dropdown-menu li a {
    position: relative;
    overflow: hidden;
}

.sidebar .dropdown-menu li a::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient( 90deg, transparent, rgba(134, 134, 134, 0.2), transparent);
    transition: left 0.4s ease;
    z-index: 0;
}

.sidebar .dropdown-menu li a:hover::before {
    left: 100%;
}


/* Đảm bảo text dropdown nằm trên sweep effect */

.sidebar .dropdown-menu li a>* {
    position: relative;
    z-index: 1;
}


/* =================== HOVER EFFECTS THỐNG NHẤT =================== */


/* Home link hover - giống các nút khác */

.menu-nav .home-link:hover {
    background-color: #71c562;
    color: #000000;
}

.menu-nav .home-link:hover .menu-icon {
    transform: scale(1.05);
}


/* Enhanced hover cho menu chính */

.sidebar .menu-nav>li>a:hover {
    background-color: #71c562;
    color: #000000;
    transform: translateX(3px);
}


/* Enhanced hover cho dropdown */

.sidebar .dropdown-menu li a:hover {
    background-color: #8686865c;
    transform: scale(1.06) translateX(2px);
}


/* =================== RESPONSIVE DESIGN WITH MOBILE HEADER FIX =================== */

@media (max-width: 768px) {
    body {
        padding: 0;
        align-items: flex-start;
    }
    .login-container {
        padding: 20px 15px;
        width: 95%;
        max-width: 400px;
        margin: 20px auto;
    }
    .company-logo {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    .admin-dashboard {
        width: 100%;
        min-height: 100vh;
    }
    /* ⬆️ FIX DASHBOARD HEADER RESPONSIVE */
    .dashboard-header {
        padding: 15px 10px;
        min-height: 80px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        position: relative;
    }
    .dashboard-title {
        margin-left: 50px;
        justify-content: flex-start;
        text-align: left;
        gap: 12px;
        width: calc(100% - 120px);
        /* ⬆️ Space cho logout button */
        order: 2;
        max-width: none;
    }
    .fixed-top-left {
        position: static;
        top: auto;
        left: auto;
        order: 1;
        gap: 12px;
        width: 100%;
        max-width: calc(100% - 60px);
        /* ⬆️ Space cho menu button */
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
    .fixed-top-left .company-logo {
        width: 45px;
        height: 45px;
        font-size: 18px;
        flex-shrink: 0;
        /* ⬆️ Logo không shrink */
    }
    /* ⬆️ CRITICAL FIX CHO HEADER TEXT TRÊN MOBILE */
    .header-text {
        flex: 1;
        min-width: 0;
        /* ⬆️ Critical for text truncation */
        margin-left: 10px;
    }
    .header-text h4 {
        font-size: clamp(14px, 4vw, 18px);
        /* ⬆️ Giảm font size */
        font-weight: 600;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .header-text p {
        font-size: clamp(10px, 3vw, 14px);
        /* ⬆️ Giảm font size */
        opacity: 0.9;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .fixed-top-right {
        position: absolute;
        top: 10px;
        right: 10px;
        flex-direction: column;
        align-items: flex-end;
        gap: 5px;
        z-index: 10;
    }
    .fixed-top-right span {
        font-size: 11px;
    }
    .logout-btn {
        padding: 8px 12px;
        font-size: 11px;
    }
    .menu-btn {
        position: absolute;
        top: 15px;
        left: 10px;
        padding: 5px;
    }
    .menu-btn img {
        width: 35px;
        height: 35px;
    }
    .dashboard-content {
        padding: 20px 15px;
    }
    .welcome-section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    /* ⬆️ MOBILE STAT CARD ADJUSTMENTS */
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
        margin-bottom: 20px;
    }
    .stat-card {
        padding: 18px 20px;
        min-width: 200px;
    }
    /* Cho phép xuống dòng trên mobile nếu cần */
    .stat-card h4 {
        white-space: normal;
        line-height: 1.3;
    }
    .stat-card h4.long-date {
        white-space: normal;
        word-break: keep-all;
        hyphens: none;
        line-height: 1.3;
    }
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .module-card {
        padding: 20px 15px;
    }
    .module-icon {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
    .sidebar {
        width: 280px;
    }
    /* Menu responsive adjustments */
    .menu-nav .home-link {
        padding: 10px 12px;
        font-size: 15px;
    }
    .menu-nav .menu-icon {
        width: 16px;
        height: 16px;
    }
    .menu-nav .menu-divider {
        margin: 6px 12px;
    }
}


/* Mobile nhỏ - Additional fixes */

@media (max-width: 480px) {
    .login-container {
        padding: 15px 10px;
        width: 98%;
        margin: 10px auto;
    }
    .dashboard-header {
        padding: 12px 8px;
        min-height: 70px;
    }
    .dashboard-title {
        margin-left: 45px;
        width: calc(100% - 100px);
        /* ⬆️ More space cho logout */
    }
    .fixed-top-left {
        max-width: calc(100% - 50px);
    }
    .fixed-top-left .company-logo {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    /* ⬆️ SMALLER FONT SIZES CHO MOBILE NHỎ */
    .header-text h4 {
        font-size: clamp(12px, 3.5vw, 16px);
        /* ⬆️ Nhỏ hơn nữa */
        font-weight: 600;
    }
    .header-text p {
        font-size: clamp(9px, 2.5vw, 12px);
        /* ⬆️ Nhỏ hơn nữa */
    }
    .fixed-top-right {
        top: 8px;
        right: 8px;
        gap: 3px;
    }
    .fixed-top-right span {
        font-size: 10px;
    }
    .logout-btn {
        padding: 6px 10px;
        font-size: 10px;
    }
    .menu-btn {
        top: 12px;
        left: 8px;
        padding: 4px;
    }
    .menu-btn img {
        width: 30px;
        height: 30px;
    }
    .dashboard-content {
        padding: 15px 10px;
    }
    .welcome-section {
        padding: 15px 10px;
    }
    /* ⬆️ MOBILE NHỎ STAT CARD ADJUSTMENTS */
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 10px;
    }
    .stat-card {
        padding: 15px 18px;
        min-width: 180px;
    }
    .stat-card h4 {
        font-size: clamp(11px, 2.5vw, 14px);
        line-height: 1.2;
    }
    .stat-card p {
        font-size: clamp(10px, 2vw, 12px);
    }
    .module-card {
        padding: 15px 12px;
    }
    .module-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    .sidebar {
        width: 250px;
    }
    /* Menu responsive adjustments */
    .menu-nav .home-link {
        padding: 9px 10px;
        font-size: 14px;
    }
    .menu-nav .menu-icon {
        width: 15px;
        height: 15px;
    }
}


/* Mobile rất nhỏ - Extreme fixes */

@media (max-width: 360px) {
    .dashboard-header {
        padding: 10px 6px;
        min-height: 65px;
    }
    .dashboard-title {
        margin-left: 40px;
        width: calc(100% - 80px);
    }
    .fixed-top-left {
        gap: 8px;
        max-width: calc(100% - 45px);
    }
    .fixed-top-left .company-logo {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    /* ⬆️ VERY SMALL FONT SIZES */
    .header-text h4 {
        font-size: clamp(11px, 3vw, 14px);
        /* ⬆️ Rất nhỏ */
        font-weight: 600;
        line-height: 1.2;
    }
    .header-text p {
        font-size: clamp(8px, 2vw, 11px);
        /* ⬆️ Rất nhỏ */
        line-height: 1.2;
    }
    .fixed-top-right {
        top: 6px;
        right: 6px;
    }
    .fixed-top-right span {
        font-size: 9px;
    }
    .logout-btn {
        padding: 5px 8px;
        font-size: 9px;
    }
    .menu-btn {
        top: 10px;
        left: 6px;
        padding: 3px;
    }
    .menu-btn img {
        width: 28px;
        height: 28px;
    }
    /* ⬆️ MOBILE RẤT NHỎ - CHUYỂN SANG 2 CỘT */
    .stats-overview {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stat-card {
        padding: 12px 15px;
        min-width: auto;
    }
    .sidebar {
        width: 220px;
    }
}


/* =================== ALTERNATIVE LAYOUT CHO MOBILE RẤT NHỎ =================== */

@media (max-width: 320px) {
    /* Cho phép text xuống dòng nếu cần thiết */
    .header-text h4,
    .header-text p {
        white-space: normal;
        /* ⬆️ Allow line breaks */
        word-break: keep-all;
        /* ⬆️ Không cắt từ */
        hyphens: none;
        line-height: 1.3;
    }
    .header-text h4 {
        font-size: clamp(10px, 2.8vw, 13px);
        margin-bottom: 1px;
    }
    .header-text p {
        font-size: clamp(8px, 2vw, 10px);
    }
    /* Tăng min-height để accommodate multiline text */
    .dashboard-header {
        min-height: 75px;
    }
}


/* =================== LANDSCAPE ORIENTATION FIX =================== */

@media (max-width: 768px) and (orientation: landscape) {
    .dashboard-header {
        min-height: 60px;
        /* ⬆️ Thấp hơn trong landscape */
        padding: 10px 8px;
    }
    .header-text h4 {
        font-size: clamp(12px, 2.5vw, 16px);
    }
    .header-text p {
        font-size: clamp(9px, 2vw, 12px);
    }
}


/* Tablet */

@media (min-width: 769px) and (max-width: 1024px) {
    .modules-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    /* ⬆️ TABLET STAT CARD ADJUSTMENTS */
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .stat-card {
        min-width: 250px;
        padding: 20px 22px;
    }
    .dashboard-content {
        padding: 25px 20px;
    }
}


/* Desktop */

@media (min-width: 1025px) {
    .modules-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    /* ⬆️ DESKTOP STAT CARD ADJUSTMENTS */
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    .stat-card {
        padding: 25px 30px;
        min-width: 320px;
    }
}


/* =================== ACCESSIBILITY ENHANCEMENTS =================== */


/* Focus states cho keyboard navigation */

.sidebar .menu-nav>li>a:focus,
.menu-nav .home-link:focus {
    outline: 2px solid #71c562;
    outline-offset: 2px;
    background-color: rgba(113, 197, 98, 0.1);
}

.sidebar .dropdown-menu li a:focus {
    outline: 2px solid #71c562;
    outline-offset: 1px;
    background-color: rgba(134, 134, 134, 0.1);
}


/* Smooth transitions cho tất cả */

.sidebar .menu-nav>li>a,
.sidebar .dropdown-menu li a,
.menu-nav .home-link {
    transition: all 0.3s ease, transform 0.2s ease;
}


/* Active states */

.sidebar .menu-nav>li>a:active,
.menu-nav .home-link:active {
    transform: translateX(1px) scale(0.98);
}

.sidebar .dropdown-menu li a:active {
    transform: scale(1.02) translateX(1px);
}


/* =================== ADDITIONAL ENHANCEMENTS =================== */


/* Subtle shadow on hover */

.sidebar .menu-nav>li>a:hover,
.menu-nav .home-link:hover {
    box-shadow: 0 2px 8px rgba(113, 197, 98, 0.2);
}

.sidebar .dropdown-menu li a:hover {
    box-shadow: 0 1px 4px rgba(134, 134, 134, 0.2);
}


/* Improved dropdown styling */

.sidebar .dropdown-menu {
    border-left: 3px solid transparent;
    transition: all 0.3s ease, border-color 0.3s ease;
}

.sidebar .dropdown:hover .dropdown-menu {
    border-left-color: #71c562;
}


/* Menu item icons alignment */

.sidebar .menu-nav>li>a,
.menu-nav .home-link {
    display: flex;
    align-items: center;
}


/* Text selection prevention for better UX */

.sidebar .menu-nav>li>a,
.sidebar .dropdown-menu li a,
.menu-nav .home-link {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}


/* =================== DARK MODE SUPPORT (Optional) =================== */

@media (prefers-color-scheme: dark) {
    .sidebar .menu-nav>li>a::before {
        background: linear-gradient( 90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    }
    .sidebar .dropdown-menu li a::before {
        background: linear-gradient( 90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    }
    .menu-nav .menu-divider {
        background: rgba(255, 255, 255, 0.1);
    }
}