/* CSS extracted from dist.html - LMS App */

    /* --- BIẾN MÀU CHỦ ĐẠO (GIỮ NGUYÊN BẢN SẮC BI'S MART) --- */
    :root {
        --brand-primary: #FF6F00;
        --brand-gradient: linear-gradient(135deg, #FF6F00 0%, #FF9800 100%);
        --bg-color: #FFFFFF;
        --text-main: #1F2937;
        --text-sub: #6B7280;
        --radius: 8px;
        --sidebar-width: 260px;
    }

    * {
        box-sizing: border-box;
        outline: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* --- BODY: MỞ LẠI THANH CUỘN CHO CÁC TRANG KHÁC --- */
    body {
        font-family: 'Inter', sans-serif;
        margin: 0;
        padding: 0;
        min-height: 100vh;
        background: #F8FAFC;
        color: var(--text-main);
        /* ĐÃ XÓA overflow: hidden ở đây để trang Video và Đăng nhập không bị cắt xén */
    }

    /* --- CẤU TRÚC ĐỘC QUYỀN CHO TRANG CHỦ (HOME PAGE) --- */
    .app-layout {
        display: flex;
        width: 100%;
        height: 100vh;
        overflow: hidden;
        background: #F8FAFC;
    }

    .app-main-content {
        flex: 1;
        height: 100vh;
        overflow-y: auto;
        background: #F8FAFC;
        transition: margin-left 0.3s ease;
        position: relative;
    }

    /* --- KHUNG CHUẨN MỚI CHO TRANG ĐĂNG NHẬP (UI MODERN) --- */
    .login-layout {
        display: flex;
        width: 100%;
        height: 100vh;
        background: #F8FAFC;
    }

    .login-hero {
        flex: 1;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        position: relative;
    }

    .hero-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(to right, rgba(0,0,0,0.4), rgba(0,0,0,0.1));
    }

    .login-form-container {
        width: 100%;
        max-width: 500px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #FFFFFF;
        box-shadow: -10px 0 30px rgba(0,0,0,0.05);
        z-index: 10;
        padding: 40px 30px;
    }

    .login-form-box {
        width: 100%;
        max-width: 400px;
    }

    .input-with-icon {
        position: relative;
        display: flex;
        align-items: center;
    }

    .input-with-icon i {
        position: absolute;
        left: 15px;
        color: #9CA3AF;
        font-size: 1.1rem;
    }

    .input-with-icon input {
        padding-left: 45px !important;
        border-radius: 12px !important;
        height: 52px;
        background: #F9FAFB !important;
        border: 1px solid #E5E7EB !important;
    }

    .input-with-icon input:focus {
        border-color: var(--brand-primary) !important;
        box-shadow: 0 0 0 3px rgba(255, 111, 0, 0.1);
    }

    .login-support-box {
        margin-top: 35px;
        background: #E0F2FE;
        border-radius: 12px;
        padding: 15px 20px;
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .support-icon {
        font-size: 1.5rem;
        color: #0284C7;
    }

    /* Mobile Responsive for Login */
    @media (max-width: 768px) {
        .login-layout {
            flex-direction: column;
        }
        .login-hero {
            height: 35vh;
            flex: none;
            background-position: top;
        }
        .login-form-container {
            max-width: 100%;
            flex: 1;
            border-radius: 30px 30px 0 0;
            margin-top: -30px; /* Overlap effect */
            padding: 35px 25px;
            box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
        }
    }

    /* --- KHUNG CHUẨN CHO HỌC TẬP VÀ BÀI TEST --- */
    .app-card {
        width: 100%;
        min-height: 100vh;
        padding: 30px 5%;
        background: var(--bg-color);
        display: flex;
        flex-direction: column;
    }

    /* --- KHUNG RIÊNG CHO NỘI DUNG TRANG CHỦ --- */
    .home-wrapper {
        background: transparent;
        padding: 25px;
        min-height: 100vh;
        margin: 0;
        border: none;
        border-radius: 0;
    }

    .home-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 25px;
    }

    @keyframes skeletonLoading {
        0% { background-color: #E5E7EB; }
        50% { background-color: #F3F4F6; }
        100% { background-color: #E5E7EB; }
    }
    .skeleton-card {
        animation: skeletonLoading 1.5s infinite;
    }

    /* --- 1. SIDEBAR DESKTOP BÊN TRÁI --- */
    .sidebar {
        width: var(--sidebar-width);
        background: white;
        height: 100vh;
        border-right: 1px solid #E5E7EB;
        display: flex;
        flex-direction: column;
        z-index: 90;
        transition: width 0.3s ease;
    }

    .sidebar.collapsed { width: 80px; }
    .sidebar.collapsed .menu-text { display: none; }
    .sidebar.collapsed .sidebar-logo { display: none; }

    .sidebar-header {
        padding: 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #F3F4F6;
    }

    .sidebar-logo {
        height: 35px;
    }

    .btn-toggle-sidebar {
        background: none;
        border: none;
        font-size: 1.2rem;
        color: var(--text-sub);
        cursor: pointer;
        padding: 5px;
    }

    .sidebar-menu {
        flex: 1;
        padding: 15px 10px;
        overflow-y: auto;
    }

    .menu-item {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 12px 15px;
        color: var(--text-sub);
        border-radius: var(--radius);
        font-weight: 500;
        transition: 0.2s;
        cursor: pointer;
        background: none;
        border: none;
        width: 100%;
        text-align: left;
    }

    .menu-item:hover {
        background: #F3F4F6;
        color: var(--text-main);
    }

    .menu-item.active {
        background: #FFF7ED;
        color: var(--brand-primary);
        font-weight: 600;
    }

    .menu-icon {
        font-size: 1.2rem;
        width: 24px;
        text-align: center;
        opacity: 0.7;
    }

    .menu-item.active .menu-icon {
        opacity: 1;
        font-weight: 900;
    }

    .menu-text {
        white-space: nowrap;
    }

    /* --- TYPOGRAPHY & FORMS --- */
    h1,
    h2,
    h3,
    h4 {
        font-family: 'Montserrat', sans-serif;
        color: var(--text-main);
        margin-top: 0;
    }

    .text-brand {
        color: var(--brand-primary);
    }

    .form-group {
        margin-bottom: 20px;
        text-align: left;
        width: 100%;
    }

    label {
        font-weight: 600;
        font-size: 0.9rem;
        margin-bottom: 8px;
        display: block;
        color: var(--text-main);
    }

    input[type="text"],
    input[type="password"] {
        width: 100%;
        padding: 14px;
        border: 1px solid #D1D5DB;
        border-radius: var(--radius);
        background: #F9FAFB;
        font-size: 16px;
        color: var(--text-main);
        font-weight: 500;
        transition: 0.2s;
    }

    input:focus {
        background: #FFFFFF;
        border-color: var(--brand-primary);
    }

    .input-error {
        border-color: #DC2626 !important;
        background: #FEF2F2 !important;
    }

    /* --- NÚT BẤM --- */
    .btn {
        width: 100%;
        padding: 14px;
        border: none;
        border-radius: var(--radius);
        background: var(--brand-gradient);
        color: white;
        font-weight: 700;
        font-size: 1rem;
        cursor: pointer;
        transition: 0.2s;
    }

    .btn:hover {
        opacity: 0.9;
    }

    .btn:active {
        transform: scale(0.98);
    }

    .btn-outline {
        background: #FFFFFF;
        color: var(--text-main);
        border: 1px solid #D1D5DB;
        padding: 10px 20px;
        border-radius: var(--radius);
        font-weight: 500;
        cursor: pointer;
        transition: 0.2s;
    }

    .btn-outline:hover {
        background: #F3F4F6;
    }

    .hidden {
        display: none !important;
    }

    .spinner {
        width: 30px;
        height: 30px;
        border: 3px solid rgba(255, 111, 0, 0.3);
        border-top-color: var(--brand-primary);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
        margin: 0 auto;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    /* Tùy chỉnh thanh cuộn */
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-track {
        background: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background: #D1D5DB;
        border-radius: 10px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #9CA3AF;
    }

    /* --- NỘI DUNG TAB --- */
    .tab-pane {
        display: none;
        animation: fadeInTab 0.3s ease;
    }

    .tab-pane.active {
        display: block;
    }

    @keyframes fadeInTab {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .content-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }

    /* --- THIẾT KẾ KHÓA HỌC & THÔNG BÁO --- */
    .course-card {
        background: #FFFFFF;
        border-radius: var(--radius);
        overflow: hidden;
        border: 1px solid #E5E7EB;
        display: flex;
        flex-direction: column;
        cursor: pointer;
        transition: 0.2s;
        height: 100%;
    }

    .course-card:hover {
        border-color: var(--brand-primary);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
        transform: translateY(-3px);
    }

    .c-thumb {
        width: 100%;
        aspect-ratio: 16/9;
        object-fit: cover;
        background: #F3F4F6;
    }

    .c-body {
        padding: 15px;
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .c-title {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text-main);
        margin: 0 0 8px 0;
        line-height: 1.4;
    }

    .c-desc {
        font-size: 0.85rem;
        color: var(--text-sub);
        line-height: 1.5;
        margin-bottom: 15px;
        flex: 1;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        box-orient: vertical;
        overflow: hidden;
    }

    .c-progress-bg {
        width: 100%;
        background: #E5E7EB;
        border-radius: 20px;
        height: 18px;
        position: relative;
        overflow: hidden;
    }

    .c-progress-fill {
        height: 100%;
        background: var(--brand-primary);
        border-radius: 20px;
        display: flex;
        align-items: center;
        padding-left: 10px;
        transition: width 0.5s ease-out;
    }

    .announce-card-grid {
        background: #FFFFFF;
        border: 1px solid #E5E7EB;
        border-radius: var(--radius);
        padding: 20px;
        cursor: pointer;
        position: relative;
        transition: 0.2s;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .announce-card-grid:hover {
        border-color: var(--brand-primary);
    }

    .announce-pin {
        position: absolute;
        top: -10px;
        left: 15px;
        background: #EF4444;
        color: white;
        font-size: 0.7rem;
        font-weight: 800;
        padding: 3px 8px;
        border-radius: 4px;
    }

    .announce-date {
        font-size: 0.75rem;
        color: var(--text-sub);
        font-weight: 600;
    }

    .announce-title {
        margin: 8px 0;
        font-size: 1rem;
        color: var(--text-main);
        font-weight: 700;
    }

    .announce-desc {
        margin: 0;
        font-size: 0.85rem;
        color: var(--text-sub);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        box-orient: vertical;
        overflow: hidden;
    }

    /* --- LAYOUT HỌC TẬP (ĐÃ ĐƯỢC PHỤC HỒI HOÀN TOÀN) --- */
    .yt-layout {
        display: grid;
        grid-template-columns: 320px 1fr;
        gap: 40px;
        align-items: flex-start;
        text-align: left;
        height: auto;
    }

    .yt-main {
        display: flex;
        flex-direction: column;
    }

    .yt-sidebar {
        padding: 0;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        position: sticky;
        top: 20px;
    }

    .course-sidebar-header {
        margin-bottom: 20px;
    }

    .course-sidebar-title {
        font-size: 1.15rem;
        font-weight: 700;
        color: var(--text-main);
        margin: 0 0 10px 0;
    }

    .playlist-items {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .playlist-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        padding: 14px 15px;
        border-radius: var(--radius);
        transition: 0.2s;
        background: #FFFFFF;
        border: 1px solid transparent;
    }

    .playlist-item:hover {
        background: #F3F4F6;
    }

    .playlist-item.active {
        background: #FFF7ED;
        font-weight: 600;
        border-color: #FED7AA;
    }

    .playlist-item.active .pl-number {
        color: var(--brand-primary);
    }

    .pl-info {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        flex: 1;
        padding-right: 10px;
    }

    .pl-number {
        font-weight: 600;
        color: var(--text-sub);
        margin-top: 2px;
    }

    .pl-title {
        font-size: 0.95rem;
        color: var(--text-main);
        margin: 0;
        line-height: 1.4;
    }

    .check-icon {
        width: 22px;
        height: 22px;
        min-width: 22px;
        background: #10B981;
        color: white;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 12px;
        font-weight: bold;
    }

    .check-icon.pending {
        background: #E5E7EB;
        color: transparent;
    }

    .secure-video-wrapper {
        position: relative;
        width: 100%;
        border-radius: var(--radius);
        overflow: hidden;
        background: #000;
        margin-bottom: 15px;
        aspect-ratio: 16/9;
    }

    .video-container {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .video-container iframe {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: none;
    }

    .dynamic-watermark {
        position: absolute;
        z-index: 6;
        color: rgba(255, 255, 255, 0.35);
        font-size: 1.2rem;
        font-weight: 800;
        font-family: monospace;
        pointer-events: none;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
        animation: floatWatermark 25s infinite alternate ease-in-out;
    }

    @keyframes floatWatermark {
        0% {
            top: 5%;
            left: 5%;
            transform: rotate(-5deg) scale(1);
        }

        50% {
            top: 40%;
            left: 80%;
            transform: rotate(-5deg) scale(0.9);
        }

        100% {
            top: 60%;
            left: 10%;
            transform: rotate(-5deg) scale(1.1);
        }
    }

    /* ===== CUSTOM VIDEO CONTROLS V2 ===== */
    .custom-controls-v2 {
        position: absolute;
        bottom: 0; left: 0; right: 0;
        background: linear-gradient(transparent, rgba(0,0,0,0.85));
        z-index: 10;
        padding: 0 12px 8px;
        opacity: 1;
        transition: opacity 0.35s ease;
    }

    /* Progress bar row */
    .ctrl-progress-row {
        position: relative;
        padding: 10px 0 4px;
        cursor: pointer;
    }
    .ctrl-track {
        position: relative;
        width: 100%;
        height: 5px;
        background: rgba(255,255,255,0.2);
        border-radius: 3px;
        overflow: visible;
        transition: height 0.15s;
    }
    .ctrl-progress-row:hover .ctrl-track { height: 7px; }
    .ctrl-buffered {
        position: absolute;
        height: 100%;
        background: rgba(255,255,255,0.35);
        border-radius: 3px;
        pointer-events: none;
    }
    .ctrl-played {
        position: absolute;
        height: 100%;
        background: var(--brand-primary);
        border-radius: 3px;
        pointer-events: none;
        transition: width 0.1s linear;
    }
    .ctrl-thumb {
        position: absolute;
        right: -6px; top: 50%;
        transform: translateY(-50%) scale(0);
        width: 14px; height: 14px;
        background: white;
        border-radius: 50%;
        transition: transform 0.15s;
        pointer-events: none;
    }
    .ctrl-progress-row:hover .ctrl-thumb { transform: translateY(-50%) scale(1); }
    .ctrl-prog-tooltip {
        position: absolute;
        bottom: 16px;
        background: rgba(0,0,0,0.8);
        color: white;
        padding: 2px 8px;
        border-radius: 4px;
        font-size: 0.72rem;
        font-weight: 600;
        pointer-events: none;
        transform: translateX(-50%);
        white-space: nowrap;
    }

    /* Bottom controls row */
    .ctrl-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        height: 38px;
    }
    .ctrl-left-grp, .ctrl-right-grp {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    .ctrl-btn {
        background: none;
        border: none;
        color: white;
        font-size: 1.1rem;
        cursor: pointer;
        padding: 6px;
        border-radius: 4px;
        display: flex;
        align-items: center;
        gap: 2px;
        transition: background 0.15s;
        line-height: 1;
    }
    .ctrl-btn:hover { background: rgba(255,255,255,0.15); }
    .ctrl-btn small { font-size: 0.65rem; font-weight: 700; line-height: 1; }
    .ctrl-play-btn { font-size: 1.2rem; }

    /* Volume */
    .ctrl-vol-grp {
        display: flex;
        align-items: center;
        gap: 2px;
    }
    .ctrl-vol-slider {
        -webkit-appearance: none;
        appearance: none;
        width: 0;
        max-width: 0;
        height: 4px;
        border-radius: 2px;
        background: rgba(255,255,255,0.4);
        outline: none;
        cursor: pointer;
        overflow: hidden;
        transition: max-width 0.25s, width 0.25s;
        opacity: 0;
    }
    .ctrl-vol-grp:hover .ctrl-vol-slider,
    .ctrl-vol-slider:focus {
        max-width: 70px;
        width: 70px;
        opacity: 1;
    }
    .ctrl-vol-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 12px; height: 12px;
        border-radius: 50%;
        background: white;
        cursor: pointer;
        box-shadow: -70px 0 0 68px var(--brand-primary);
    }

    /* Time display */
    .ctrl-time {
        color: white;
        font-size: 0.78rem;
        font-weight: 600;
        white-space: nowrap;
        padding: 0 4px;
    }

    /* Speed menu */
    .ctrl-speed-wrap { position: relative; }
    .ctrl-speed-menu {
        position: absolute;
        bottom: calc(100% + 8px);
        right: 0;
        background: rgba(20,20,20,0.97);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 10px;
        padding: 6px;
        min-width: 160px;
        z-index: 50;
        backdrop-filter: blur(6px);
    }
    .ctrl-speed-menu .speed-menu-title {
        color: rgba(255,255,255,0.5);
        font-size: 0.7rem;
        font-weight: 700;
        padding: 4px 8px 6px;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }
    .ctrl-speed-menu button {
        display: block;
        width: 100%;
        background: none;
        border: none;
        color: white;
        text-align: left;
        padding: 8px 12px;
        font-size: 0.88rem;
        border-radius: 6px;
        cursor: pointer;
        transition: background 0.15s;
    }
    .ctrl-speed-menu button:hover { background: rgba(255,255,255,0.1); }
    .ctrl-speed-menu button.spd-active {
        color: var(--brand-primary);
        font-weight: 700;
        background: rgba(255,111,0,0.1);
    }

    /* Quality badge */
    .ctrl-quality-badge {
        color: rgba(255,255,255,0.7);
        font-size: 0.7rem;
        font-weight: 700;
        border: 1px solid rgba(255,255,255,0.3);
        border-radius: 3px;
        padding: 1px 5px;
        letter-spacing: 0.02em;
    }

    .learning-tabs-container {
        margin-top: 15px;
        background: #FFFFFF;
        border-radius: var(--radius);
        border: 1px solid #E5E7EB;
        padding: 20px;
    }

    .l-tab-menu {
        display: flex;
        gap: 25px;
        border-bottom: 2px solid #F3F4F6;
        margin-bottom: 20px;
        overflow-x: auto;
    }

    .l-tab-btn {
        background: none;
        border: none;
        padding: 10px 0 15px 0;
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--text-sub);
        cursor: pointer;
        border-bottom: 3px solid transparent;
        transition: 0.2s;
        white-space: nowrap;
        margin-bottom: -2px;
    }

    .l-tab-btn.active {
        color: var(--brand-primary);
        border-bottom-color: var(--brand-primary);
    }

    /* --- BÀI TEST / QUIZ --- */
    .sticky-timer {
        position: sticky;
        top: -30px;
        background: rgba(255, 255, 255, 0.95);
        z-index: 50;
        padding: 15px 0;
        margin-bottom: 20px;
        border-bottom: 1px solid #E5E7EB;
    }

    .quiz-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 10px;
    }

    #timer {
        font-weight: 800;
        color: #DC2626;
        background: #FEF2F2;
        padding: 6px 15px;
        border-radius: var(--radius);
        border: 1px solid #FCA5A5;
    }

    #quiz-list {
        position: relative;
        width: 100%;
        min-height: 300px;
        overflow: hidden;
    }

    .q-card {
        background: #FFFFFF;
        padding: 30px;
        border-radius: var(--radius);
        border: 1px solid #E5E7EB;
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    .q-card.active {
        opacity: 1;
        visibility: visible;
        position: relative;
    }

    .option-label {
        display: flex;
        align-items: center;
        padding: 18px;
        border: 1px solid #E5E7EB;
        border-radius: var(--radius);
        margin-bottom: 12px;
        cursor: pointer;
        background: #F9FAFB;
        font-weight: 500;
        transition: 0.2s;
    }

    .option-label.selected {
        border-color: var(--brand-primary);
        background: #FFF7ED;
        font-weight: 600;
    }

    .option-label input {
        margin-right: 15px;
        accent-color: var(--brand-primary);
        width: 20px;
        height: 20px;
    }

    /* --- 2. GIAO DIỆN TAB "TÔI" (UI/UX 2.0) --- */
    .profile-container {
        max-width: 600px;
        margin: 0 auto;
        padding-bottom: 20px;
    }

    /* Khối Thông tin cá nhân (Căn giữa hiện đại) */
    .profile-header-modern {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 30px 20px 20px 20px;
        background: white;
        border-bottom: 1px solid #E5E7EB;
        text-align: center;
    }

    .profile-avatar-modern {
        width: 85px;
        height: 85px;
        border-radius: 50%;
        background: var(--brand-gradient);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2.5rem;
        font-weight: 800;
        border: 4px solid white;
        box-shadow: 0 4px 10px rgba(255, 111, 0, 0.25);
        z-index: 1;
        margin-bottom: 12px;
    }

    .profile-name-modern {
        margin: 0 0 8px 0;
        font-size: 1.35rem;
        font-weight: 800;
        color: var(--text-main);
        z-index: 1;
        text-align: center;
    }

    .profile-id-modern {
        margin: 0;
        font-size: 0.85rem;
        color: var(--text-sub);
        background: #F3F4F6;
        padding: 4px 12px;
        border-radius: 20px;
        font-weight: 600;
        z-index: 1;
    }

    /* Khối Thống kê dạng Lưới (Grid) phẳng */
    .stats-grid-modern {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 15px 20px;
        background: white;
        border-bottom: 1px solid #E5E7EB;
        margin-bottom: 20px;
    }

    .stat-card-modern {
        background: #F9FAFB;
        border: 1px solid #E5E7EB;
        border-radius: 12px;
        padding: 15px 5px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .stat-icon-modern {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .stat-icon-modern.done {
        background: #ECFDF5;
        color: #10B981;
    }

    .stat-icon-modern.prog {
        background: #FFF7ED;
        color: var(--brand-primary);
    }

    .stat-icon-modern.new {
        background: #F3F4F6;
        color: #6B7280;
    }

    .stat-num-modern {
        font-size: 1.4rem;
        font-weight: 800;
        color: var(--text-main);
        line-height: 1.2;
        margin-bottom: 2px;
    }

    .stat-label-modern {
        font-size: 0.75rem;
        color: var(--text-sub);
        font-weight: 600;
    }

    /* Khối Lịch sử học tập */
    .history-card-modern {
        background: white;
        border-radius: var(--radius);
        border: 1px solid #E5E7EB;
        padding: 20px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
        margin-bottom: 25px;
    }

    .history-title-modern {
        font-size: 1.05rem;
        color: var(--text-main);
        font-weight: 700;
        margin: 0 0 15px 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .history-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .history-item {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 15px;
        border-radius: 10px;
        border: 1px solid #F3F4F6;
        background: #FAFAFA;
        transition: 0.2s;
    }

    .history-item:hover {
        border-color: #E5E7EB;
        background: white;
    }

    .his-title {
        margin: 0 0 6px 0;
        font-size: 0.95rem;
        color: var(--text-main);
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Nút Đăng xuất kiểu mới (Soft Danger) */
    .btn-logout-modern {
        width: 100%;
        background: #FEF2F2;
        color: #EF4444;
        border: 1px solid #FEE2E2;
        padding: 14px;
        border-radius: var(--radius);
        font-weight: 600;
        font-size: 0.95rem;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        transition: 0.2s;
    }

    .btn-logout-modern:hover {
        background: #FEE2E2;
    }

    /* MOBILE HEADER & BOTTOM NAV */
    .mobile-header {
        display: none;
        background: white;
        padding: 15px 20px;
        border-bottom: 1px solid #E5E7EB;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 80;
    }

    .mobile-logo {
        height: 28px;
    }

    .mobile-user-name {
        font-weight: 600;
        font-size: 0.9rem;
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .bottom-nav {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #E5E7EB;
        justify-content: space-evenly;
        padding: 10px 15px;
        padding-bottom: calc(env(safe-area-inset-bottom, 12px) + 10px);
        z-index: 100;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #6B7280;
        font-size: 0.7rem;
        font-weight: 500;
        gap: 5px;
        background: none;
        border: none;
        flex: 1;
        padding: 8px 4px;
        cursor: pointer;
        min-width: 0;
        transition: all 0.2s ease;
    }

    .nav-item span {
        white-space: nowrap;
        font-size: 0.65rem;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        margin-top: 2px;
    }

    .nav-item.active {
        color: var(--brand-primary);
        font-weight: 600;
    }

    .nav-icon {
        font-size: 1.5rem;
        opacity: 0.8;
        transition: all 0.2s ease;
    }

    .nav-item.active .nav-icon {
        opacity: 1;
        font-weight: 900;
        transform: scale(1.1);
    }

    /* --- ĐIỀU CHỈNH GIAO DIỆN KHI THU NHỎ (MOBILE & TABLET) --- */
    @media screen and (max-width: 1024px) {
        .sidebar {
            display: none;
        }

        .mobile-header {
            display: flex;
        }

        .home-header {
            display: none;
        }

        .bottom-nav {
            display: flex;
        }

        .app-main-content {
            padding-bottom: 80px;
        }

        .home-wrapper {
            padding: 20px 15px;
            margin: 0;
            min-height: calc(100vh - 80px);
            border: none;
            border-radius: 0;
            padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        }
    }

    @media screen and (max-width: 768px) {
        .yt-layout {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .yt-main {
            order: 1;
            width: 100%;
        }

        .yt-sidebar {
            order: 2;
            width: 100%;
            position: static;
            max-height: none;
            margin-top: 10px;
        }

        .content-grid {
            grid-template-columns: 1fr;
        }

        .l-tab-menu {
            overflow-x: auto;
            white-space: nowrap;
            -webkit-overflow-scrolling: touch;
            padding-bottom: 5px;
        }

        .stats-flex {
            flex-wrap: wrap;
        }

        .stat-box {
            flex: none;
            width: 100%;
        }

        .profile-info {
            position: absolute;
            left: 100px;
            bottom: -30px;
            color: var(--text-main);
            text-shadow: none;
            width: max-content;
        }

        .profile-body {
            padding-top: 50px;
        }
    }

    @media (max-width: 600px) {
        .app-card {
            padding: 15px 15px;
        }

        .q-card {
            padding: 20px;
        }
    }

    .review-item.correct {
        border-left: 4px solid #10B981 !important;
        background: #ECFDF5 !important;
    }
    .review-item.wrong {
        border-left: 4px solid #EF4444 !important;
        background: #FEF2F2 !important;
    }
    .nav-avatar-wrapper {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        border: 1px solid #111827; /* Viền đen mỏng */
        background: #E5E7EB;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        font-weight: 700;
        color: #1F2937;
        margin: 0 auto;
        overflow: hidden;
    }
    
    .sidebar-menu .menu-item {
        display: flex;
        align-items: center;
        text-align: left;
    }
    
    .sidebar-menu .nav-avatar-wrapper {
        margin: 0;
        flex-shrink: 0;
        width: 24px;
        height: 24px;
    }
    
    .nav-item.active .nav-avatar-wrapper, .menu-item.active .nav-avatar-wrapper {
        border: 2px solid var(--brand-primary);
    }

    /* COMMUNITY FEED STYLES */
    .community-subnav {
        display: flex;
        background: white;
        border-bottom: 1px solid #E5E7EB;
        overflow-x: auto;
        padding: 0 15px;
    }

    .community-subnav .subnav-btn {
        flex: 1;
        background: none;
        border: none;
        padding: 15px 10px;
        font-size: 0.95rem;
        font-weight: 600;
        color: #6B7280;
        cursor: pointer;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        text-align: center;
    }

    .community-subnav .subnav-btn.active {
        color: var(--brand-primary);
        border-bottom-color: var(--brand-primary);
    }

    .community-layout {
        padding: 15px;
        display: flex;
        gap: 20px;
        align-items: flex-start;
    }

    .community-main-col {
        flex: 1;
        min-width: 0;
    }

    .community-side-col {
        width: 35%;
        position: sticky;
        top: 15px;
    }

    .desktop-only { display: none; }
    .mobile-only { display: flex; }

    .filter-pill {
        padding: 6px 15px;
        background: white;
        border: 1px solid #D1D5DB;
        border-radius: 20px;
        font-size: 0.85rem;
        font-weight: 600;
        color: #4B5563;
        cursor: pointer;
        white-space: nowrap;
    }

    .filter-pill.active {
        background: var(--brand-primary);
        color: white;
        border-color: var(--brand-primary);
    }

    @media (min-width: 1024px) {
        .desktop-only { display: block; }
        .mobile-only { display: none; }
        .mobile-only-tab { display: none !important; }
        .community-layout { padding: 20px 0; }
    }

    @media (max-width: 1023px) {
        .community-side-col { display: none; }
        .community-layout { padding: 15px 0; }
    }

    .announce-list-sidebar {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    /* CALENDAR STYLES */
    .calendar-grid-header {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        text-align: center;
        font-weight: 700;
        color: var(--text-sub);
        margin-bottom: 10px;
        font-size: 0.9rem;
    }
    .calendar-days-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 5px;
    }
    .cal-day {
        aspect-ratio: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        font-size: 0.95rem;
        cursor: pointer;
        position: relative;
        background: #F9FAFB;
        border: 1px solid transparent;
        transition: all 0.2s;
    }
    .cal-day:hover {
        border-color: #D1D5DB;
        background: white;
    }
    .cal-day.empty {
        background: transparent;
        cursor: default;
    }
    .cal-day.has-event {
        font-weight: 700;
        color: var(--brand-primary);
        background: #EFF6FF;
    }
    .cal-day.active {
        background: var(--brand-primary);
        color: white;
        box-shadow: 0 4px 10px rgba(59,130,246,0.3);
    }
    .cal-day.active .event-dot {
        background: white;
    }
    .event-dot {
        width: 6px;
        height: 6px;
        background: var(--brand-primary);
        border-radius: 50%;
        margin-top: 4px;
    }
    .event-list-card {
        background: white;
        border-radius: 12px;
        padding: 15px;
        border: 1px solid #E5E7EB;
        margin-bottom: 10px;
        display: flex;
        align-items: flex-start;
        gap: 15px;
        transition: transform 0.2s;
    }
    .event-list-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    }
    .event-icon-box {
        width: 48px;
        height: 48px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        color: white;
        flex-shrink: 0;
    }


    .modal-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999999;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .modal-overlay.hidden {
        display: none !important;
    }
    .modal-content {
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2);
        display: flex;
        flex-direction: column;
    }
    .modal-header {
        padding: 20px 25px;
        border-bottom: 1px solid #E5E7EB;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .modal-header h3 {
        margin: 0;
        font-size: 1.25rem;
        color: var(--text-main);
    }
    .modal-close {
        font-size: 1.5rem;
        cursor: pointer;
        color: #9CA3AF;
        line-height: 1;
    }
    .modal-close:hover {
        color: #ef4444;
    }
    .modal-body {
        padding: 25px;
    }
    .admin-tab {
        padding: 15px 0;
        font-weight: 600;
        color: var(--text-sub);
        cursor: pointer;
        border-bottom: 3px solid transparent;
        transition: all 0.3s;
    }
    .admin-tab.active {
        color: var(--brand-primary);
        border-bottom-color: var(--brand-primary);
    }
    .admin-tab:hover {
        color: var(--brand-primary);
    }
    .admin-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 700px;
    }
    .admin-table th {
        text-align: left;
        padding: 12px 15px;
        background: #F9FAFB;
        color: var(--text-sub);
        font-weight: 600;
        font-size: 0.85rem;
        border-bottom: 2px solid #E5E7EB;
    }
    .admin-table td {
        padding: 12px 15px;
        border-bottom: 1px solid #F3F4F6;
        font-size: 0.9rem;
        color: var(--text-main);
    }
    .form-group {
        margin-bottom: 15px;
    }
    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: 500;
        font-size: 0.9rem;
        color: var(--text-main);
    }
    .form-group input, .form-group textarea, .form-group select {
        width: 100%;
        padding: 10px;
        border: 1px solid #D1D5DB;
        border-radius: 8px;
        font-size: 0.95rem;
    }
