﻿/* ===== SIDEBAR LAYOUT CSS - WHITE BROWN THEME ===== */
:root {
    --sidebar-width: 280px;
    --sidebar-bg: #ffffff;
    --sidebar-hover: rgba(13, 71, 161, 0.08);
    /* Blue tint hover */
    --header-bg: #0d47a1;
    /* Deep Blue Header */
    --header-height: 55px;
    --content-bg: #f8f8f8;
    --card-bg: #ffffff;
    --text-dark: #333333;
    --text-light: #ffffff;
    --text-muted: #777777;
    --primary: #0d47a1;
    /* Deep Blue Primary */
    --primary-light: #5472d3;
    --secondary: #FFD700;
    /* Gold */
    --success: #2e7d32;
    /* Green */
    --warning: #f57f17;
    /* Orange/Gold */
    --danger: #d32f2f;
    /* Red */
    --purple: #7b1fa2;
    --teal: #00796b;
    --border-color: #0d47a1;
    /* Blue border */
    --border-light: #cfd8dc;
    /* Light blue-grey border */
    --footer-height: 127px;
}

body.dark-mode {
    --header-bg: #2c3e50;
    --content-bg: #34495e;
    --card-bg: #2c3e50;
    --text-dark: #ecf0f1;
    --sidebar-bg: #1a1a2e;
    --menu-text-color: #00BFFF;
}

body.dark-mode .menu-header span,
body.dark-mode .menu-item,
body.dark-mode .menu-direct-link span {
    color: var(--menu-text-color);
}

body.dark-mode .menu-header i,
body.dark-mode .menu-item i,
body.dark-mode .menu-direct-link i:first-child {
    color: #00BFFF;
}

body.dark-mode .sidebar {
    background: var(--sidebar-bg);
    border-right-color: #333;
}

body.dark-mode .menu-header,
body.dark-mode .menu-direct-link {
    background: #1a1a2e;
}

body.dark-mode .menu-header:hover,
body.dark-mode .menu-direct-link:hover {
    background: #2a2a4e;
}

body.dark-mode .menu-items {
    background: #151525;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: var(--content-bg);
    color: var(--text-dark);
    overflow: hidden;
    height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: transform 0.3s;
    border-right: 2px solid var(--border-color);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.sidebar::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}


/* Sidebar Banner */
.sidebar-banner {
    width: 100%;
    overflow: hidden;
    max-height: 137px;
    /* ~90% of original 85px + 60px */
}

.sidebar-banner img {
    width: 100%;
    max-height: 137px;
    /* ~90% of original 85px + 60px */
    object-fit: cover;
    display: block;
}

/* Online Section - compact single row */
.online-section {
    background: var(--card-bg);
    border-radius: 4px;
    padding: 4px 10px;
    margin-bottom: 5px;
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.online-title {
    color: var(--success);
    font-size: 9px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    white-space: nowrap;
}

.online-title i {
    font-size: 6px;
    animation: pulse 1.5s infinite;
}

.online-users-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    overflow: hidden;
    flex: 1;
}

/* Animation disabled - static display */
/*
@keyframes scrollUsers {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}
*/

.online-user-tag {
    background: rgba(76, 175, 80, 0.12);
    color: #388E3C;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 8px;
    border: 1px solid rgba(76, 175, 80, 0.25);
    flex-shrink: 0;
    white-space: nowrap;
}

/* Show count when many users */
.online-more-tag {
    background: rgba(33, 150, 243, 0.15);
    color: #1976D2;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 8px;
    border: 1px solid rgba(33, 150, 243, 0.3);
    font-weight: 600;
    flex-shrink: 0;
}

/* Deduction stat card */
.deduction-stat-card {
    cursor: default !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.deduction-count {
    font-size: 24px;
    font-weight: 700;
    color: var(--danger);
    line-height: 1.1;
    margin: 3px 0;
}

@media (max-width: 768px) {
    .deduction-count {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .deduction-count {
        font-size: 16px;
        margin: 2px 0;
    }
}

/* ===== MENU ===== */
.sidebar-menu {
    padding: 10px 0 30px 0;
}

.menu-category {
    padding: 15px 15px 8px;
    color: var(--text-light);
    background: var(--primary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    margin: 5px 0 0 0;
}

.menu-section {
    border-bottom: 1px solid var(--border-light);
}

.menu-header {
    display: flex;
    align-items: center;
    padding: 7px 15px 7px 12px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.menu-header:hover {
    background: #f9f6f2;
}

.menu-header i {
    width: 20px;
    margin-right: 6px;
    font-size: 14px;
    color: var(--primary);
    flex-shrink: 0;
}

.menu-header span {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
}

.menu-arrow {
    transition: transform 0.3s;
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.menu-section.active .menu-header {
    background: #f9f6f2;
    border-left: 3px solid var(--primary);
}

.menu-section.active .menu-arrow {
    transform: rotate(180deg);
}

.menu-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #fafafa;
}

.menu-section.active .menu-items {
    max-height: 500px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 7px 12px 7px 34px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.menu-item:hover {
    background: #f5f0e8;
    color: var(--primary);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item i {
    width: 18px;
    margin-right: 6px;
    font-size: 12px;
    color: var(--primary);
    opacity: 0.8;
    flex-shrink: 0;
}

/* Direct link menu item */
.menu-direct-link {
    display: flex;
    align-items: center;
    padding: 7px 15px 7px 12px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    background: #fff;
    border-bottom: 1px solid var(--border-light);
}

.menu-direct-link:hover {
    background: #f9f6f2;
    color: var(--primary);
}

.menu-direct-link i:first-child {
    width: 20px;
    margin-right: 6px;
    font-size: 14px;
    color: var(--primary);
    flex-shrink: 0;
}

.menu-direct-link span {
    flex: 1;
}

.menu-direct-link i:last-child {
    font-size: 9px;
    color: var(--text-muted);
    margin-left: auto;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== HEADER ===== */
.header {
    background: var(--primary);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.header h1 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-theme {
    background: #fff;
    color: var(--text-dark);
}

.btn-fullscreen {
    background: #6c757d;
    color: white;
}

.btn-fullscreen:hover {
    background: #5a6268;
}

.btn-notification {
    background: var(--warning);
    color: white;
    position: relative;
}

.btn-profile {
    background: #17a2b8;
    color: white;
}

.btn-admin {
    background: var(--warning);
    color: white;
}

.btn-feedback {
    background: var(--success);
    color: white;
}

.btn-logout {
    background: var(--danger);
    color: white;
}

.header-btn:hover {
    opacity: 0.9;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    font-size: 11px;
    color: #fff;
}

.user-info i {
    color: #fff;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #fff;
}

/* ===== TICKER ===== */
.notification-ticker-container {
    background: #4CAF50;
    padding: 0 12px;
    height: 24px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid #388E3C;
}

@media (max-width: 768px) {
    .notification-ticker-container {
        height: 22px;
        padding: 0 8px;
    }

    .notification-ticker-content {
        font-size: 10px;
        line-height: 22px;
    }
}

@media (max-width: 480px) {
    .notification-ticker-container {
        height: 20px;
    }

    .notification-ticker-content {
        font-size: 9px;
        line-height: 20px;
    }
}

.notification-ticker {
    width: 100%;
    overflow: hidden;
}

.notification-ticker-content {
    color: #ffffff;
    font-size: 11px;
    white-space: nowrap;
    animation: ticker 45s linear infinite;
    line-height: 26px;
    font-weight: 500;
}

@keyframes ticker {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* ===== CONTENT AREA ===== */
.content-area {
    flex: 1;
    padding: 6px 10px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--content-bg);
    max-height: calc(100vh - var(--header-height) - var(--footer-height) - 24px);
}

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-bottom: 2px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 6px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
    transition: all 0.2s;
    min-height: 48px;
}

.stat-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.stat-card.blue {
    border-top: 3px solid var(--primary);
}

.stat-card.teal {
    border-top: 3px solid var(--teal);
}

.stat-card.green {
    border-top: 3px solid var(--success);
}

.stat-card.orange {
    border-top: 3px solid var(--warning);
}

.stat-card.red {
    border-top: 3px solid var(--danger);
}

.stat-card.purple {
    border-top: 3px solid var(--purple);
}

.stat-icon {
    width: 32px;
    /* Reduced from 38px */
    height: 32px;
    /* Reduced from 38px */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    /* Reduced from 16px */
    color: white;
    flex-shrink: 0;
}

.stat-card.blue .stat-icon {
    background: var(--primary);
}

.stat-card.teal .stat-icon {
    background: var(--teal);
}

.stat-card.green .stat-icon {
    background: var(--success);
}

.stat-card.orange .stat-icon {
    background: var(--warning);
}

.stat-card.red .stat-icon {
    background: var(--danger);
}

.stat-card.purple .stat-icon {
    background: var(--purple);
}

.stat-info h3 {
    font-size: 20px;
    /* Reduced from 23px */
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.1;
}

.stat-info p {
    font-size: 11px;
    /* Reduced from 12px */
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 1px;
    white-space: normal;
    /* Allow text wrapping */
    font-style: italic;
    /* Italic text */
}

/* Quick Access */
.section-title {
    font-size: 13px;
    font-weight: bold;
    margin: 1px 0 3px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-dark);
    padding-bottom: 3px;
    border-bottom: 2px solid var(--primary);
}

.section-title i {
    color: var(--primary);
}

.quick-access-grid {
    display: flex;
    align-items: stretch;
    /* Ensure all items are equal height */
    /* Use Flexbox for equal sizing depending on quantity */
    /* grid-template-columns: repeat(7, 1fr); - Removed */
    gap: 5px;
    /* Reduced gap slightly to fit 6 items */
    margin-bottom: 4px;
}

.quick-card {
    background: var(--card-bg);
    border-radius: 6px;
    padding: 5px 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-light);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.2s;
    display: flex;
    /* Flex to organize content vertically */
    flex-direction: column;
    height: auto;
    /* Allow stretch to control height */
    /* Fill grid cell height */
    /* Removed min/max width to let Grid handle it */
    flex: 1;
    min-width: 0;
    /* Allow shrinking below content size if needed */
}

.quick-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
    transform: translateY(-5px) scale(1.02);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.quick-card:hover .quick-card-icon {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.quick-card:hover .quick-card-title {
    color: var(--primary);
}

.quick-card-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-card-title {
    transition: color 0.2s ease;
}

.quick-card-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
}

.quick-card-icon {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: white;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.quick-card.type-1 .quick-card-icon {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 50%, #0D47A1 100%);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4), inset 0 -2px 6px rgba(0, 0, 0, 0.2);
}

.quick-card.type-2 .quick-card-icon {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 50%, #1B5E20 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4), inset 0 -2px 6px rgba(0, 0, 0, 0.2);
}

.quick-card.type-3 .quick-card-icon {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 50%, #E65100 100%);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4), inset 0 -2px 6px rgba(0, 0, 0, 0.2);
}

.quick-card.type-4 .quick-card-icon {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 50%, #4A148C 100%);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.4), inset 0 -2px 6px rgba(0, 0, 0, 0.2);
}

.quick-card.type-5 .quick-card-icon {
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 50%, #B71C1C 100%);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4), inset 0 -2px 6px rgba(0, 0, 0, 0.2);
}

.quick-card.type-6 .quick-card-icon {
    background: linear-gradient(135deg, #00BCD4 0%, #0097A7 50%, #006064 100%);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.4), inset 0 -2px 6px rgba(0, 0, 0, 0.2);
}

.quick-card.type-7 .quick-card-icon {
    background: linear-gradient(135deg, #FF5722 0%, #E64A19 50%, #BF360C 100%);
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.4), inset 0 -2px 6px rgba(0, 0, 0, 0.2);
}

.quick-card-title {
    font-weight: bold;
    font-size: 11px;
}

.quick-card-desc {
    font-size: 10px;
    font-style: italic;
    opacity: 0.9;
    color: var(--text-muted);
    line-height: 1.2;
    margin-top: 3px;
    /* Line clamping to optimize height */
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--card-bg);
    padding: 0;
    margin-top: auto;
    height: var(--footer-height);
    overflow: hidden;
}

.footer-image-full {
    width: 100%;
    height: var(--footer-height);
}

.footer-image-full img {
    width: 100%;
    height: var(--footer-height);
    object-fit: cover;
    display: block;
}

/* Giảm chiều cao footer trên mobile */
@media (max-width: 768px) {
    :root {
        --footer-height: 72px;
    }
}

.user-scroll-container {
    flex: 1;
    min-width: 250px;
}

.user-scroll-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-scroll-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.user-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ===== RESPONSIVE ===== */
/* Fullscreen mode */
body.fullscreen-mode .sidebar {
    transform: translateX(-100%);
}

body.fullscreen-mode .main-content {
    margin-left: 0;
}

body.fullscreen-mode .mobile-menu-toggle {
    display: block;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .header-btn span {
        display: none;
    }

    /* Ẩn nút fullscreen trên mobile */
    .btn-fullscreen {
        display: none !important;
    }

    /* Header layout cho mobile: hamburger trái, logo+title giữa, controls phải */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 10px;
        height: var(--header-height);
    }

    /* Hamburger menu - sát mép trái */
    .mobile-menu-toggle {
        order: 1;
        flex-shrink: 0;
        margin-right: 5px;
    }

    /* Logo + tiêu đề - căn trái */
    .header-title {
        order: 2;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        gap: 8px;
        padding-left: 0;
        margin-left: 0;
    }

    .header-title .header-logo {
        height: 36px;
        flex-shrink: 0;
    }

    .header-title h1 {
        font-size: 13px;
        line-height: 1.4;
        text-align: left;
        max-width: 200px;
    }

    /* Controls - bên phải */
    .header-controls {
        order: 3;
        display: flex;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
    }

    /* Hiển thị theme toggle và notification trên mobile */
    .btn-theme,
    .btn-notification {
        display: flex !important;
        padding: 6px 8px;
    }

    /* Ẩn user info và các nút khác trên mobile để gọn */
    .user-info {
        display: none;
    }

    .btn-admin span,
    .btn-logout span {
        display: none;
    }

    /* Fix nội dung bị che bởi header fixed */
    .notification-ticker-container {
        margin-top: var(--header-height);
    }

    /* Nếu không có ticker, content-area cũng cần padding */
    .content-area {
        padding-top: 12px;
    }

    /* Section title đầu tiên không bị che */
    .content-area>.section-title:first-of-type {
        margin-top: 0;
    }

    /* Đảm bảo main-content không bị che */
    .main-content {
        padding-top: var(--header-height);
    }
}

@media (max-width: 1200px) {
    .quick-access-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .quick-card {
        min-width: 0;
        /* Allow grid to handle width */
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
        --header-height: 50px;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
        margin-bottom: 5px;
    }

    .quick-card {
        min-width: 48%;
        max-width: 48%;
        padding: 10px 8px;
    }

    .stat-card {
        padding: 10px 8px;
        min-height: auto;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .stat-info h3 {
        font-size: 18px;
    }

    .stat-info p {
        font-size: 11px;
        font-weight: 600;
    }

    .content-area {
        padding: 6px 8px;
    }

    .header h1 {
        font-size: 11px;
        max-width: 120px;
    }

    .section-title {
        font-size: 14px;
        margin: 6px 0 5px;
        padding-bottom: 4px;
    }

    .quick-access-grid {
        gap: 5px;
        margin-bottom: 5px;
    }

    .quick-card-title {
        font-size: 13px;
    }

    .quick-card-desc {
        font-size: 11px;
    }

    .online-section {
        padding: 5px 6px;
        margin-bottom: 3px;
    }

    .online-title {
        font-size: 8px;
    }

    /* Header title nhỏ hơn */
    .header-title .header-logo {
        height: 28px;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 48px;
        --footer-height: 54px;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
        margin-bottom: 4px;
    }

    .quick-card {
        min-width: 100%;
        max-width: 100%;
        padding: 10px 8px;
    }

    .stat-card {
        padding: 8px 6px;
        min-height: auto;
    }

    .stat-icon {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .stat-info h3 {
        font-size: 16px;
    }

    .stat-info p {
        font-size: 10px;
        font-weight: 600;
    }

    .header-btn {
        padding: 5px 6px;
        font-size: 10px;
    }

    .section-title {
        font-size: 13px;
        margin: 5px 0 4px;
        padding-bottom: 3px;
    }

    .quick-card-title {
        font-size: 13px;
    }

    .quick-card-desc {
        font-size: 11px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .quick-card-icon {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .quick-access-grid {
        gap: 4px;
        margin-bottom: 4px;
    }

    .online-section {
        padding: 4px 5px;
        margin-bottom: 3px;
    }

    .online-title {
        font-size: 7px;
        margin-bottom: 3px;
    }

    .content-area {
        padding: 5px 6px;
        padding-top: 10px;
    }

    /* Section title đầu tiên không bị che */
    .content-area>.section-title:first-of-type {
        margin-top: 0;
    }

    /* Tiêu đề header rút gọn trên điện thoại nhỏ */
    .header-title h1 {
        font-size: 12px;
        max-width: 180px;
        line-height: 1.4;
    }

    .header-title .header-logo {
        height: 32px;
    }

    /* Hamburger và controls nhỏ hơn */
    .mobile-menu-toggle {
        font-size: 18px;
        padding: 5px;
    }

    .btn-theme,
    .btn-notification {
        padding: 5px 6px;
    }

    .btn-theme i,
    .btn-notification i {
        font-size: 14px;
    }

    /* Ẩn thêm các nút không cần thiết */
    .btn-admin,
    .btn-logout {
        padding: 5px 8px;
    }

    .btn-admin i,
    .btn-logout i {
        font-size: 12px;
    }
}

/* ===== POPUP ===== */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.popup {
    width: 99.5%;
    height: 99.5%;
    background: white;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid #ccc;
}

.popup-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 0;
    /* Không bo góc để khớp cạnh */
    color: white;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    background: linear-gradient(135deg, #C84C3C, #b03a2e);
}

.popup-close:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #b03a2e, #8e2d24);
}

.popup-content {
    width: 100%;
    height: 100%;
}

.popup-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== OVERLAY for sidebar mobile ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar.active+.sidebar-overlay {
    display: block;
}