/* ???????? ????? ??? ????? ????????? ? VECTOR PDD v3 */

@import url('./tokens.css');
@import url('./base.css');
@import url('./icons.css');
@import url('./admin-ui.css');
@import url('./pages-enhanced.css');
@import url('./dashboard-stats.css');
@import url('./admin-modals.css');
@import url('./admin-mobile.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* body typography ? see base.css */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ??????? ???? */
@media (min-width: 969px) {
    body:not(.no-sidebar) {
        padding-left: 280px;
        transition: padding-left 0.3s ease;
    }
    
    body:not(.no-sidebar).sidebar-collapsed {
        padding-left: 80px;
    }
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    transition: padding 0.3s;
}

.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-collapse-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--dark-color);
    transition: all 0.3s;
    padding: 0;
}

.sidebar-collapse-btn:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.sidebar-collapse-btn .icon {
    font-size: 1.25rem;
}

@media (min-width: 969px) {
    .sidebar-collapse-btn {
        display: flex;
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
    transition: transform 0.2s, gap 0.3s;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand:hover {
    transform: scale(1.05);
}

.sidebar-brand-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-weight: 700;
    transition: opacity 0.3s, width 0.3s;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-brand-text {
    width: 0;
    opacity: 0;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    gap: 0;
    margin: 0 auto;
}

.sidebar.collapsed .sidebar-header {
    padding: 1rem 0.5rem;
    justify-content: center;
}

.sidebar.collapsed .sidebar-header-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar.collapsed .sidebar-collapse-btn {
    width: 28px;
    height: 28px;
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.3s;
}

.sidebar-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    border-radius: 3px;
    transition: all 0.3s;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
    /* ????????? ?????? ????????? */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* ????????? ????????? ??? WebKit ????????? (Chrome, Safari, Edge) */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
    transition: background 0.2s;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu li {
    margin: 0.25rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar.collapsed .sidebar-menu a {
    padding: 0.875rem;
    justify-content: center;
    gap: 0;
}

.sidebar.collapsed .sidebar-menu a .sidebar-icon {
    margin: 0 auto;
}

.sidebar.collapsed .sidebar-menu li.active > a {
    border-left: none;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.15);
}

/* Tooltip ??? collapsed sidebar */
.sidebar.collapsed .sidebar-menu a::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--dark-color);
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar.collapsed .sidebar-menu a:hover::after {
    opacity: 1;
}

.sidebar.collapsed .theme-toggle::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--dark-color);
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar.collapsed .theme-toggle:hover::after {
    opacity: 1;
}

.sidebar-menu a:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-menu li.active > a {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.sidebar-menu-divider {
    margin: 1rem 0 0.5rem 0;
    padding: 0.5rem 1.5rem 0.25rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-menu-divider:first-child {
    margin-top: 0.5rem;
    border-top: none;
}

.sidebar-divider-text {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-color);
    margin-top: 0.5rem;
    transition: opacity 0.3s, height 0.3s;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-divider-text {
    height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.sidebar-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
}

.sidebar-text {
    flex: 1;
    transition: opacity 0.3s, width 0.3s, margin 0.3s;
    overflow: hidden;
    white-space: nowrap;
}

/* ???????? ??? ?????? ? collapsed ????????? */
.sidebar.collapsed .sidebar-text {
    width: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--light-color);
}

.sidebar.collapsed .sidebar-footer {
    padding: 1rem 0.5rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
    gap: 0;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    flex-direction: column;
}

.sidebar.collapsed .sidebar-user-avatar {
    margin: 0 auto;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    transition: opacity 0.3s, width 0.3s;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-user-info {
    width: 0;
    opacity: 0;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--danger-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
    width: 100%;
    position: relative;
}

.sidebar.collapsed .sidebar-logout {
    padding: 0.75rem;
    justify-content: center;
    gap: 0;
}

.sidebar.collapsed .sidebar-logout .sidebar-text {
    width: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.sidebar.collapsed .sidebar-logout .sidebar-icon {
    margin: 0 auto;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ?????? ?????? ????? ? ?????? ???????????? (??? ?????????) */
.sidebar-logout-icon {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--danger-color);
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s;
    flex-shrink: 0;
    margin-left: auto;
}

/* ?????????? ?????? ?????? ? collapsed ????????? ?? ???????? */
@media (min-width: 969px) {
    .sidebar.collapsed .sidebar-logout-icon {
        display: flex;
        margin: 0.5rem auto 0;
    }
    
    .sidebar.collapsed .sidebar-logout {
        display: none;
    }
}

.sidebar-logout-icon:hover {
    background: rgba(239, 68, 68, 0.1);
}

.sidebar-logout-icon .icon {
    font-size: 1.25rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ????????? ???? */
@media (max-width: 968px) {
    body {
        padding-left: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
        will-change: transform;
    }
    
    .sidebar.active {
        transform: translateX(0);
        visibility: visible;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .sidebar-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .sidebar-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .sidebar-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    /* ???????????: ?????? sidebar-nav ??????????????, ? footer ????????????? */
    /* ?? ????????? ?????????? sidebar-user ?????? */
    .sidebar-header {
        flex-shrink: 0;
        min-height: auto;
        order: 1;
    }
    
    .sidebar-footer {
        flex-shrink: 0;
        order: 2; /* ?????????? footer ??????, ????? header */
        margin-top: 0;
        margin-bottom: 0;
        padding: 1rem 1.5rem;
        background: var(--light-color);
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        max-height: 110px;
        overflow: hidden;
        min-height: 70px;
    }
    
    .sidebar-nav {
        flex: 1 1 0;
        order: 3; /* ????????? ???? ????? header ? footer */
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    /* ?? ?????????: ?????????? ?????? ?????? ????? ? ??????, ???????? ????????? ?????? */
    .sidebar-user {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        align-items: center;
        gap: 0.5rem;
        min-height: 50px;
        display: flex;
    }
    
    .sidebar-user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }
    
    .sidebar-user-info {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        display: flex;
        align-items: center;
    }
    
    .sidebar-user-name {
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: block;
    }
    
    .sidebar-logout-icon {
        display: flex !important; /* ????????????? ?????????? ?? ????????? */
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        background: rgba(239, 68, 68, 0.1);
        border-radius: 8px;
        color: var(--danger-color);
        text-decoration: none;
        transition: all 0.3s ease;
        cursor: pointer;
        margin-left: auto;
    }
    
    .sidebar-logout-icon:hover {
        background: var(--danger-color);
        color: white;
        transform: scale(1.1);
    }
    
    .sidebar-logout-icon:active {
        transform: scale(0.95);
    }
    
    .sidebar-logout-icon .icon {
        font-size: 1.2rem;
    }
    
    .sidebar-logout {
        display: none;
    }
}

/* ?????????????? ????? ??? ????? ????????? ??????? */
@media (max-width: 480px) {
    .sidebar-footer {
        padding: 0.75rem 1rem;
        max-height: 90px;
        min-height: 60px;
    }
    
    .sidebar-user {
        min-height: 40px;
        gap: 0.4rem;
    }
    
    .sidebar-user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .sidebar-user-name {
        font-size: 0.8rem;
    }
    
    .sidebar-logout-icon {
        width: 32px;
        height: 32px;
    }
    
    .sidebar-logout-icon .icon {
        font-size: 1rem;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .sidebar-nav {
        padding: 0.5rem 0;
    }
}

/* ?????? ???????? ???? ?? ????????? */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--dark-color);
    border-radius: 3px;
    margin: 4px 0;
    transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

@media (max-width: 968px) {
    .mobile-menu-toggle {
        display: block;
    }
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #059669;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ???????? */
.card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
}

/* ????? */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* ????? */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }

@media (max-width: 768px) {
    .col-6, .col-4, .col-3 {
        width: 100%;
    }
}

/* ?????????? */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

.stat-card.secondary {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* ????? */
.test-question {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.test-question-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.test-answers {
    list-style: none;
}

.test-answer {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.test-answer:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.test-answer.selected {
    border-color: var(--primary-color);
    background: #dbeafe;
}

.test-answer.correct {
    border-color: var(--secondary-color);
    background: #d1fae5;
}

.test-answer.incorrect {
    border-color: var(--danger-color);
    background: #fee2e2;
}

/* ????? */
.lesson-list {
    display: grid;
    gap: 1.5rem;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.lesson-item:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-lg);
}

.lesson-number {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.25rem;
}

.lesson-info {
    flex: 1;
}

.lesson-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.lesson-meta {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* ?????? */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--secondary-color);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary-color);
}

/* ???????? ??? */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

/* ??????? */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--light-color);
    font-weight: 600;
    color: var(--dark-color);
}

.table tr:hover {
    background: #f9fafb;
}

/* ????? */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

/* ???????????? */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ??????? */
/* Navbar ??? ???????? */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform 0.2s;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-nav li {
    margin: 0;
}

.navbar-nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

.navbar-nav a:hover {
    color: var(--primary-color);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.navbar-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    border-radius: 3px;
    transition: all 0.3s;
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.navbar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.navbar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 968px) {
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        transition: all 0.3s;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-nav.active {
        transform: translateY(0);
        opacity: 1;
    }
    
    .navbar-user {
        flex-direction: column;
        width: 100%;
    }
    
    .navbar-user .btn {
        width: 100%;
    }
}

/* Hero ?????? */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8rem 0 6rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease-out;
}

.hero p {
    font-size: 1.35rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1s ease-out;
}

.hero .btn {
    animation: fadeInUp 1.2s ease-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.hero .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 5rem 0 4rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
}

/* Features ?????? */
.features {
    padding: 6rem 0;
    background: var(--light-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: var(--shadow);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    color: white;
    transition: transform 0.3s;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.feature-card p {
    color: var(--gray-color);
    line-height: 1.6;
}

/* ?????? ???????? */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--gray-color);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Packages Section */
.packages-section {
    padding: 6rem 0;
    background: white;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.package-card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.package-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.package-card.featured {
    border-color: var(--secondary-color);
    transform: scale(1.05);
}

.package-card.featured:hover {
    transform: scale(1.08) translateY(-8px);
}

.package-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.package-card.featured .package-header {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
}

.package-name {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.package-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.package-badge.premium {
    background: rgba(255, 215, 0, 0.3);
    color: #ffd700;
}

.package-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.package-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.package-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.package-feature .icon {
    color: var(--secondary-color);
    flex-shrink: 0;
}

.package-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ?????? ?????? */
.courses-section {
    padding: 6rem 0;
    background: white;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.course-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
    position: relative;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.course-card.featured {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(30, 64, 175, 0.05));
}

.course-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.course-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    color: white;
    transition: transform 0.3s;
}

.course-card:hover .course-icon {
    transform: scale(1.1) rotate(5deg);
}

.course-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.course-description {
    color: var(--gray-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.course-features {
    list-style: none;
    text-align: left;
    margin: 0;
    padding: 0;
}

.course-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    color: var(--dark-color);
    border-bottom: 1px solid var(--border-color);
}

.course-features li:last-child {
    border-bottom: none;
}

.course-features .icon {
    color: var(--secondary-color);
    flex-shrink: 0;
}

/* ?????? ????????? */
.contact-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(30, 64, 175, 0.05));
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contact-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: var(--shadow);
}

.contact-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.contact-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    color: white;
    transition: transform 0.3s;
}

.contact-card:hover .contact-icon {
    transform: scale(1.1) rotate(5deg);
}

.contact-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.contact-card p {
    color: var(--gray-color);
    font-size: 1.1rem;
}

.contact-card a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-card a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ???????? ?????? */
.login-card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 500px;
    margin: 0 auto;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 3rem 2rem 2rem;
    text-align: center;
    position: relative;
}

.login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.login-form {
    padding: 2.5rem;
}

.login-form .form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

.login-form .form-label .icon {
    color: var(--primary-color);
}

.login-form .form-control {
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border-radius: 0.75rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border-radius: 0.75rem;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.login-footer {
    padding: 1.5rem 2.5rem 2.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--light-color);
}

.login-footer p {
    color: var(--gray-color);
    margin: 0;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .courses-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .login-form {
        padding: 2rem;
    }
    
    .login-header {
        padding: 2rem 1.5rem 1.5rem;
    }
}

/* ?????? ???? ? tokens in tokens.css; component overrides below */
.dark-theme body {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.dark-theme .sidebar {
    background: var(--sidebar-bg);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
}

.dark-theme .sidebar-header {
    border-bottom-color: var(--sidebar-border);
}

.dark-theme .sidebar-menu a {
    color: var(--dark-color);
}

.dark-theme .sidebar-menu a:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-color);
}

.dark-theme .sidebar-menu li.active > a {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-color);
}

.dark-theme .sidebar-menu-divider {
    border-top-color: var(--border-color);
}

.dark-theme .sidebar-divider-text {
    color: var(--gray-color);
}

.dark-theme .sidebar-nav {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.dark-theme .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.dark-theme .sidebar-nav:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
}

.dark-theme .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.dark-theme .sidebar-footer {
    background: var(--sidebar-bg);
    border-top-color: var(--sidebar-border);
}

/* ?????????????? ????? ??? ?????? ???? ?? ????????? */
@media (max-width: 968px) {
    .dark-theme .sidebar-footer {
        background: var(--sidebar-bg);
    }
}

.dark-theme .sidebar-user-name {
    color: var(--dark-color);
}

.dark-theme .sidebar-logout-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.dark-theme .sidebar-logout-icon:hover {
    background: var(--danger-color);
    color: white;
}

.dark-theme .sidebar-toggle span {
    background: var(--dark-color);
}

.dark-theme .sidebar-collapse-btn {
    color: var(--dark-color);
}

.dark-theme .sidebar-collapse-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-color);
}

.dark-theme .sidebar.collapsed .sidebar-menu a::after,
.dark-theme .sidebar.collapsed .theme-toggle::after {
    background: var(--card-bg);
    color: var(--dark-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.dark-theme .mobile-menu-toggle {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-theme .mobile-menu-toggle span {
    background: var(--dark-color);
}

.dark-theme .card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .card:hover {
    background: var(--card-hover-bg);
}

.dark-theme .card-title {
    color: var(--dark-color);
}

.dark-theme .card-header {
    border-bottom-color: var(--border-color);
}

.dark-theme .form-label {
    color: var(--dark-color);
}

.dark-theme .form-control {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--dark-color);
}

.dark-theme .form-control:focus {
    border-color: var(--primary-color);
    background: var(--card-bg);
}

.dark-theme .form-control::placeholder {
    color: var(--gray-color);
}

.dark-theme .table {
    background: var(--table-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .table th {
    background: var(--table-header-bg);
    color: var(--dark-color);
    border-bottom-color: var(--border-color);
}

.dark-theme .table td {
    border-bottom-color: var(--border-color);
    color: var(--dark-color);
}

.dark-theme .table tr:hover {
    background: var(--table-hover-bg);
}

.dark-theme .alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-left-color: var(--secondary-color);
}

.dark-theme .alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-left-color: var(--danger-color);
}

.dark-theme .alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-left-color: var(--primary-color);
}

.dark-theme .progress-bar {
    background: var(--border-color);
}

.dark-theme .test-question {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .test-question-title {
    color: var(--dark-color);
}

.dark-theme .test-answer {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--dark-color);
}

.dark-theme .test-answer:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
}

.dark-theme .test-answer.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary-color);
}

.dark-theme .lesson-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .lesson-item:hover {
    background: var(--card-hover-bg);
}

.dark-theme .lesson-title {
    color: var(--dark-color);
}

.dark-theme h1, .dark-theme h2, .dark-theme h3, .dark-theme h4, .dark-theme h5, .dark-theme h6 {
    color: var(--dark-color);
}

.dark-theme p {
    color: var(--dark-color);
}

/* ????????????? ???? ? ???? */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.theme-toggle:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.dark-theme .theme-toggle:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-color);
}

.theme-toggle .sidebar-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
}

.theme-toggle .sidebar-text {
    flex: 1;
    transition: opacity 0.3s, width 0.3s;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .theme-toggle .sidebar-text {
    width: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.sidebar.collapsed .theme-toggle {
    padding: 0.875rem;
    justify-content: center;
    gap: 0;
}

.sidebar.collapsed .theme-toggle .sidebar-icon {
    margin: 0 auto;
}

/* ?????????????? ????? ??? ?????? ???? */
.dark-theme select.form-control {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--dark-color);
}

.dark-theme select.form-control option {
    background: var(--card-bg);
    color: var(--dark-color);
}

.dark-theme .btn-outline {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.dark-theme .btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.dark-theme .empty-state {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .empty-state-title {
    color: var(--dark-color);
}

.dark-theme .empty-state-text {
    color: var(--gray-color);
}

.dark-theme .section-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .section-card:hover {
    background: var(--card-hover-bg);
}

/* ?????? ???? ??? ???????? */
.dark-theme .navbar {
    background: rgba(26, 26, 26, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.dark-theme .navbar-nav {
    background: var(--card-bg);
}

.dark-theme .navbar-nav a {
    color: var(--dark-color);
}

.dark-theme .navbar-toggle span {
    background: var(--dark-color);
}

.dark-theme .hero {
    background: linear-gradient(135deg, #4c6ef5 0%, #5f3dc4 100%);
}

.dark-theme .features {
    background: var(--light-color);
}

.dark-theme .feature-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-theme .feature-card:hover {
    background: var(--card-hover-bg);
    border-color: var(--primary-color);
}

.dark-theme .section-title {
    color: var(--dark-color);
}

.dark-theme .section-subtitle {
    color: var(--gray-color);
}

.dark-theme .packages-section {
    background: var(--card-bg);
}

.dark-theme .package-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-theme .package-card:hover {
    border-color: var(--primary-color);
}

.dark-theme .package-card.featured {
    border-color: var(--secondary-color);
}

.dark-theme .courses-section {
    background: var(--light-color);
}

.dark-theme .course-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-theme .course-card:hover {
    background: var(--card-hover-bg);
    border-color: var(--primary-color);
}

.dark-theme .course-card.featured {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.15));
    border-color: var(--primary-color);
}

.dark-theme .course-title {
    color: var(--dark-color);
}

.dark-theme .course-description {
    color: var(--gray-color);
}

.dark-theme .course-features li {
    color: var(--dark-color);
    border-bottom-color: var(--border-color);
}

.dark-theme .contact-section {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
}

.dark-theme .contact-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-theme .contact-card:hover {
    background: var(--card-hover-bg);
    border-color: var(--primary-color);
}

.dark-theme .contact-card h3 {
    color: var(--dark-color);
}

.dark-theme .contact-card p {
    color: var(--gray-color);
}

.dark-theme .contact-card a {
    color: var(--primary-color);
}

.dark-theme .login-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .login-form .form-label {
    color: var(--dark-color);
}

.dark-theme .login-form .form-control {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--dark-color);
}

.dark-theme .login-form .form-control:focus {
    border-color: var(--primary-color);
    background: var(--card-bg);
}

.dark-theme .login-footer {
    background: var(--light-color);
    border-top-color: var(--border-color);
}

.dark-theme .login-footer p {
    color: var(--gray-color);
}

.dark-theme .login-footer a {
    color: var(--primary-color);
}

.dark-theme .footer {
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border-color);
}

/* ????? ??? ?????-?????? ? ?????? ???? */
.dark-theme .page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dark-theme .stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .stat-card:hover {
    background: var(--card-hover-bg);
}

.dark-theme .action-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .action-card:hover {
    background: var(--card-hover-bg);
}

.dark-theme .action-card-header {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--input-bg) 100%);
    border-bottom-color: var(--border-color);
}

.dark-theme .action-card-title {
    color: var(--dark-color);
}

.dark-theme .action-card-description {
    color: var(--gray-color);
}

.dark-theme .section-header {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--input-bg) 100%);
    border-bottom-color: var(--border-color);
}

.dark-theme .section-title {
    color: var(--dark-color);
}

.dark-theme .activity-table thead,
.dark-theme .users-table thead,
.dark-theme .tests-table thead,
.dark-theme .lessons-table thead {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--input-bg) 100%);
}

.dark-theme .activity-table th,
.dark-theme .users-table th,
.dark-theme .tests-table th,
.dark-theme .lessons-table th {
    color: var(--dark-color);
    border-bottom-color: var(--border-color);
}

.dark-theme .activity-table td,
.dark-theme .users-table td,
.dark-theme .tests-table td,
.dark-theme .lessons-table td {
    border-bottom-color: var(--border-color);
    color: var(--dark-color);
}

.dark-theme .activity-table tbody tr:hover,
.dark-theme .users-table tbody tr:hover,
.dark-theme .tests-table tbody tr:hover,
.dark-theme .lessons-table tbody tr:hover {
    background: var(--table-hover-bg);
}

.dark-theme .user-cell,
.dark-theme .user-info-cell {
    color: var(--dark-color);
}

.dark-theme .role-badge,
.dark-theme .status-badge,
.dark-theme .category-badge,
.dark-theme .action-badge,
.dark-theme .resource-type,
.dark-theme .access-badge {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .btn-action {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--dark-color);
}

.dark-theme .btn-action:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.dark-theme .info-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .info-label {
    color: var(--gray-color);
}

.dark-theme .info-value {
    color: var(--dark-color);
}

.dark-theme .form-hint {
    color: var(--gray-color);
}

.dark-theme .checkbox-group {
    color: var(--dark-color);
}

.dark-theme .period-selector {
    background: var(--card-bg);
}

.dark-theme .period-grid input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: white;
}

.dark-theme .custom-date-input {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--dark-color);
}

.dark-theme .access-status-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .info-box {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
    color: var(--dark-color);
}

.dark-theme .stats-badge {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.dark-theme .empty-state {
    color: var(--gray-color);
}

.dark-theme .test-item,
.dark-theme .lesson-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .test-item:hover,
.dark-theme .lesson-item:hover {
    background: var(--card-hover-bg);
}

.dark-theme .test-title,
.dark-theme .lesson-title {
    color: var(--dark-color);
}

.dark-theme .test-meta,
.dark-theme .lesson-meta {
    color: var(--gray-color);
}

.dark-theme .test-description,
.dark-theme .lesson-description {
    color: var(--gray-color);
}

.dark-theme .category-badge-large {
    color: white;
}

.dark-theme .exam-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dark-theme .exam-feature {
    color: rgba(255, 255, 255, 0.95);
}

/* ?????????????? ????? ??? ?????? ???? */
.dark-theme .page-header-text h1,
.dark-theme .page-header-text p {
    color: white;
}

.dark-theme .stat-value {
    color: var(--dark-color);
}

.dark-theme .stat-card.secondary .stat-value,
.dark-theme .stat-card.warning .stat-value {
    color: white;
}

.dark-theme .order-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.dark-theme .category-badge {
    color: white;
}

.dark-theme .file-name {
    color: var(--gray-color);
    font-family: monospace;
}

.dark-theme .test-id,
.dark-theme .lesson-id,
.dark-theme .user-id,
.dark-theme .resource-id {
    color: var(--gray-color);
    font-family: monospace;
}

.dark-theme .phone-cell,
.dark-theme .date-cell,
.dark-theme .duration-cell,
.dark-theme .score-cell {
    color: var(--gray-color);
}

.dark-theme .description-cell {
    color: var(--dark-color);
}

.dark-theme .ip-address {
    color: var(--gray-color);
    font-family: monospace;
}

.dark-theme .btn-large {
    background: var(--primary-color);
    color: white;
}

.dark-theme .btn-large:hover {
    background: var(--primary-dark);
}

.dark-theme .access-checkbox-wrapper {
    color: var(--dark-color);
}

.dark-theme input[type="checkbox"] {
    accent-color: var(--primary-color);
}

.dark-theme input[type="radio"] {
    accent-color: var(--primary-color);
}

.dark-theme .period-grid label {
    background: var(--input-bg);
    border-color: var(--border-color);
    color: var(--dark-color);
}

.dark-theme .period-grid label:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

.dark-theme .switch-toggle {
    background: var(--border-color);
}

.dark-theme .switch-toggle.active {
    background: var(--primary-color);
}

.dark-theme .user-avatar-small,
.dark-theme .user-avatar-mini,
.dark-theme .user-avatar-large {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.dark-theme .progress-info {
    color: var(--dark-color);
}

.dark-theme .progress-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.dark-theme .lesson-status-badge,
.dark-theme .test-status-badge {
    background: rgba(16, 185, 129, 0.2);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.dark-theme .lesson-meta-item,
.dark-theme .test-meta-item {
    color: var(--gray-color);
}

.dark-theme .exam-info h2,
.dark-theme .exam-info p {
    color: white;
}

.dark-theme .category-header {
    border-bottom-color: var(--border-color);
}

.dark-theme .page-header-title {
    color: white;
}

.dark-theme .result-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dark-theme .result-score-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .result-status {
    color: var(--dark-color);
}

.dark-theme .result-stat-item {
    color: var(--gray-color);
}

.dark-theme .result-question-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .result-question-header {
    border-bottom-color: var(--border-color);
}

.dark-theme .result-question-number {
    color: var(--primary-color);
}

.dark-theme .result-question-status {
    color: var(--dark-color);
}

.dark-theme .profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dark-theme .profile-tabs {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .profile-tab {
    color: var(--gray-color);
}

.dark-theme .profile-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.dark-theme .info-row {
    border-bottom-color: var(--border-color);
}

.dark-theme .access-status {
    color: var(--dark-color);
}

.dark-theme .stat-mini-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .activity-item {
    border-bottom-color: var(--border-color);
}

/* ????? ??? ???? ????????? ? ????? ????? */
.dark-theme [style*="background: white"],
.dark-theme [style*="background:white"],
.dark-theme [style*="background:#ffffff"],
.dark-theme [style*="background:#fff"] {
    background: var(--card-bg) !important;
}

.dark-theme [style*="color: #1f2937"],
.dark-theme [style*="color:#1f2937"] {
    color: var(--dark-color) !important;
}

.dark-theme .result-score-value {
    color: white;
}

.dark-theme .result-stat-item {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.dark-theme .result-stat-value {
    color: white;
}

.dark-theme .result-stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.dark-theme .result-question-status.correct {
    background: rgba(16, 185, 129, 0.2);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.dark-theme .result-question-status.incorrect {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.dark-theme .profile-header-content {
    color: white;
}

.dark-theme .profile-name {
    color: white;
}

.dark-theme .profile-email {
    color: rgba(255, 255, 255, 0.9);
}

.dark-theme .profile-tab-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .info-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .info-card-item {
    border-bottom-color: var(--border-color);
}

.dark-theme .info-card-item-label {
    color: var(--gray-color);
}

.dark-theme .info-card-item-value {
    color: var(--dark-color);
}

.dark-theme .progress-circle-text {
    color: var(--primary-color);
}

.dark-theme .stat-mini-value {
    color: var(--dark-color);
}

.dark-theme .stat-mini-label {
    color: var(--gray-color);
}

.dark-theme .category-badge {
    background: var(--input-bg);
    border-color: var(--border-color);
    color: var(--dark-color);
}

.dark-theme .progress-bar-container {
    background: var(--border-color);
}

.dark-theme .progress-bar-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.dark-theme .dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dark-theme .quick-action-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .quick-action-card:hover {
    background: var(--card-hover-bg);
}

.dark-theme .result-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .result-item:hover {
    background: var(--card-hover-bg);
}

/**
 * VECTOR PDD ? Discord-inspired theme overrides (SaaS + Dark Premium)
 * Loaded after style.css to replace legacy gradients and unify surfaces.
 */

/* ??? Sidebar ??? */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: none;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

@media (min-width: 969px) {
    body:not(.no-sidebar) {
        padding-left: var(--sidebar-width);
    }

    body:not(.no-sidebar).sidebar-collapsed {
        padding-left: var(--sidebar-collapsed-width);
    }
}

.sidebar-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
}

.sidebar-brand {
    color: var(--text-normal);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
}

.sidebar-brand:hover {
    transform: none;
    color: var(--brand);
}

.sidebar-menu a,
.sidebar-menu .theme-toggle {
    color: var(--text-muted);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-md);
    margin: 2px var(--space-2);
    padding: var(--space-2) var(--space-3);
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-menu a:hover,
.sidebar-menu .theme-toggle:hover {
    background: var(--bg-modifier-hover);
    color: var(--text-normal);
}

.sidebar-menu li.active > a {
    background: var(--bg-modifier-selected);
    color: var(--text-normal);
    font-weight: var(--font-weight-semibold);
}

.sidebar-menu li.active > a .sidebar-icon {
    color: var(--brand);
}

.sidebar-footer {
    background: var(--sidebar-bg);
    border-top: 1px solid var(--sidebar-border);
    padding: var(--space-3) var(--space-4);
}

.sidebar-user-avatar {
    background: var(--brand);
    border-radius: var(--radius-full);
    font-weight: var(--font-weight-semibold);
}

.sidebar-collapse-btn:hover {
    background: var(--bg-modifier-hover);
    color: var(--text-normal);
}

.mobile-menu-toggle {
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.mobile-menu-toggle:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-md);
}

/* ??? Navbar (login/register) ??? */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-normal);
    box-shadow: none;
    backdrop-filter: none;
    padding: var(--space-3) 0;
}

.navbar-brand {
    color: var(--text-normal);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
}

.navbar-brand:hover {
    color: var(--brand);
}

.navbar-nav a {
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
}

.navbar-nav a:hover {
    background: var(--bg-modifier-hover);
    color: var(--text-normal);
}

/* ??? Buttons ??? */
.btn {
    font-family: var(--font-sans);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
    padding: 0.625rem 1rem;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    line-height: var(--line-height-tight);
}

.btn:hover {
    transform: none;
}

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

.btn-primary:hover {
    background: var(--brand-hover);
    box-shadow: none;
}

.btn-secondary {
    background: var(--success);
    color: var(--text-on-brand);
}

.btn-secondary:hover {
    background: #1a8f4a;
}

.btn-outline {
    border: 1px solid var(--border-strong);
    color: var(--text-normal);
    background: transparent;
}

.btn-outline:hover {
    background: var(--bg-modifier-hover);
    border-color: var(--border-strong);
    color: var(--text-normal);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #d83438;
}

/* ??? Cards ??? */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
    box-shadow: none;
    padding: var(--space-5);
}

.card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--border-strong);
}

.card-header {
    border-bottom: 1px solid var(--border-normal);
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-4);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-normal);
}

/* ??? Forms ??? */
.form-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.form-control {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: var(--text-normal);
    font-family: var(--font-sans);
    font-size: var(--font-size-md);
    padding: 0.625rem 0.75rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand);
}

.form-control::placeholder {
    color: var(--text-faint);
}

/* ??? Login / Register ??? */
.login-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    max-width: 440px;
}

.login-header {
    background: var(--bg-secondary);
    color: var(--text-normal);
    padding: var(--space-8) var(--space-6) var(--space-5);
    border-bottom: 1px solid var(--border-normal);
}

.login-icon {
    background: var(--bg-modifier-selected);
    border-radius: var(--radius-full);
    width: 64px;
    height: 64px;
    color: var(--brand);
}

.login-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-normal);
}

.login-subtitle {
    color: var(--text-muted);
    opacity: 1;
    font-size: var(--font-size-sm);
}

.login-form {
    padding: var(--space-6);
}

/* ??? Page headers (replace purple gradients) ??? */
.page-header,
.dashboard-header,
.profile-header,
.result-header {
    background: var(--bg-elevated) !important;
    color: var(--text-normal) !important;
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
    margin: 0 0 var(--space-6) 0 !important;
    padding: var(--space-6) var(--space-5) !important;
    box-shadow: none !important;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.page-header::before,
.dashboard-header::before {
    display: none !important;
}

.page-header-text h1,
.dashboard-header .welcome-text,
.page-header-text p,
.dashboard-header .welcome-subtitle,
.profile-header h1,
.profile-header p {
    color: var(--text-normal) !important;
}

.page-header-text p,
.dashboard-header .welcome-subtitle {
    color: var(--text-muted) !important;
}

.welcome-text {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

.welcome-subtitle {
    font-size: var(--font-size-md);
}

/* Kill inline gradient headers site-wide */
[style*="667eea"],
[style*="764ba2"],
[style*="linear-gradient(135deg, #667eea"],
[style*="linear-gradient(135deg, var(--primary"] {
    background: var(--bg-elevated) !important;
    color: var(--text-normal) !important;
    border: 1px solid var(--border-normal) !important;
    border-radius: var(--radius-lg) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ??? Stat cards ? flat, no gradients ??? */
.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    color: var(--text-normal);
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.stat-card.secondary,
.stat-card.warning {
    background: var(--bg-elevated);
    border-color: var(--border-normal);
    color: var(--text-normal);
}

.stat-card .stat-value {
    color: var(--brand);
    font-weight: var(--font-weight-bold);
}

.stat-card.secondary .stat-value {
    color: var(--success);
}

.stat-card.warning .stat-value {
    color: var(--warning);
}

.stat-label {
    color: var(--text-muted);
    opacity: 1;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.stat-mini-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
}

/* ??? Lists: lessons, tests ??? */
.lesson-item,
.test-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.lesson-item:hover,
.test-item:hover {
    transform: none;
    background: var(--bg-modifier-hover);
    border-color: var(--border-strong);
    box-shadow: none;
}

.lesson-number,
.test-number,
.order-badge {
    background: var(--brand) !important;
    background-image: none !important;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
}

.lesson-title,
.test-title {
    font-weight: var(--font-weight-semibold);
    color: var(--text-normal);
}

.lesson-meta,
.test-meta {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* ??? Quick action cards ??? */
.quick-action-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.quick-action-card:hover {
    transform: none;
    border-color: var(--brand);
    background: var(--bg-modifier-hover);
    box-shadow: none;
}

.quick-action-card p {
    color: var(--text-muted);
}

/* ??? Exam / practice cards on tests.php ??? */
.exam-card,
.practice-card {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-normal) !important;
    border-radius: var(--radius-lg) !important;
    color: var(--text-normal) !important;
    box-shadow: none !important;
}

.exam-card:hover,
.practice-card:hover {
    border-color: var(--brand) !important;
    background: var(--bg-modifier-hover) !important;
}

.exam-info h2,
.practice-info h2,
.exam-info p,
.practice-info p {
    color: var(--text-normal) !important;
}

.exam-feature {
    color: var(--text-muted) !important;
}

.exam-btn {
    background: var(--brand) !important;
    color: var(--text-on-brand) !important;
    border-radius: var(--radius-md) !important;
    font-weight: var(--font-weight-medium) !important;
    box-shadow: none !important;
}

.exam-btn:hover {
    background: var(--brand-hover) !important;
    transform: none !important;
}

/* ??? Tables ??? */
.table {
    background: var(--table-bg);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
    box-shadow: none;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.table th {
    background: var(--table-header-bg);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table td {
    color: var(--text-normal);
    border-bottom: 1px solid var(--border-subtle);
}

.table tr:hover {
    background: var(--table-hover-bg);
}

/* ??? Alerts ??? */
.alert {
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.alert-error {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

/* ??? Progress ??? */
.progress-bar,
.progress-bar-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    height: 8px;
}

.progress-fill,
.progress-bar-fill {
    background: var(--brand) !important;
    background-image: none !important;
    border-radius: var(--radius-full);
}

/* ??? Profile & statistics ??? */
.profile-tabs {
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
}

.profile-tab {
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
}

.profile-tab.active {
    color: var(--text-normal);
    border-bottom-color: var(--brand) !important;
}

.info-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
}

/* ??? AI Chat ??? */
.ai-chat-container {
    background: var(--bg-secondary) !important;
}

.ai-chat-sidebar {
    background: var(--bg-secondary) !important;
    border-right: 1px solid var(--border-normal) !important;
}

.ai-chat-main {
    background: var(--bg-primary) !important;
}

.ai-chat-header {
    background: var(--bg-elevated) !important;
    border-bottom: 1px solid var(--border-normal) !important;
}

/* ??? Category badges ??? */
.category-badge,
.category-badge-large {
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-xs);
}

/* User avatars ? layout + brand color */
.user-avatar-small {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    color: #fff;
    background: var(--brand) !important;
    background-image: none !important;
}

.user-avatar-mini {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
    color: #fff;
    background: var(--brand) !important;
    background-image: none !important;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    flex-shrink: 0;
    color: #fff;
    background: var(--brand) !important;
    background-image: none !important;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

/* ??? Autodrome page ??? */
.content-section {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
    box-shadow: none !important;
}

.content-section h2 {
    color: var(--text-normal) !important;
    border-bottom-color: var(--border-normal) !important;
}

/* ??? Dark theme body override (legacy block compatibility) ??? */
.dark-theme body {
    background-color: var(--bg-tertiary);
    color: var(--text-normal);
}

.dark-theme .sidebar {
    box-shadow: none;
}

.dark-theme .card:hover {
    border-color: var(--border-strong);
}

.dark-theme .exam-card {
    background: var(--bg-elevated) !important;
}

.dark-theme .dashboard-header,
.dark-theme .profile-header,
.dark-theme .result-header {
    background: var(--bg-elevated) !important;
}

.dark-theme .stat-card.secondary .stat-value,
.dark-theme .stat-card.warning .stat-value {
    color: var(--success);
}

.dark-theme .login-header {
    background: var(--bg-secondary);
    color: var(--text-normal);
}

.dark-theme .login-card {
    background: var(--bg-elevated);
    border-color: var(--border-normal);
}

.dark-theme .navbar {
    background: var(--bg-primary);
    border-bottom-color: var(--border-normal);
}

.dark-theme .mobile-menu-toggle {
    background: var(--bg-elevated);
    border-color: var(--border-normal);
}

.dark-theme .table tr:hover {
    background: var(--table-hover-bg);
}

/* ??? Mobile overflow fixes ??? */
@media (max-width: 968px) {
    .sidebar-footer {
        background: var(--sidebar-bg);
        border-color: var(--border-normal);
    }

    .page-header,
    .dashboard-header {
        padding: var(--space-5) var(--space-4) !important;
        margin-bottom: var(--space-4) !important;
    }

    .stats-grid,
    .quick-actions-grid {
        gap: var(--space-3);
    }

    .card {
        padding: var(--space-4);
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }

    .login-form {
        padding: var(--space-4);
    }

    .welcome-text {
        font-size: var(--font-size-xl);
    }
}

.no-overflow,
.test-main,
.dashboard-header-content,
.page-header-content {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}
/**
 * Page-specific layout (no colors/gradients ? tokens + discord-theme handle visuals)
 */

/* Dashboard */
.dashboard-header-content {
    position: relative;
    z-index: 1;
}

.quick-action-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.quick-action-card .card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.quick-action-card .card-header::before {
    font-size: 2rem;
}

.quick-action-card[data-action="lessons"] .card-header::before {
    content: '';
    display: inline-block;
    width: 2rem;
    height: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235865f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.quick-action-card[data-action="tests"] .card-header::before {
    content: '';
    display: inline-block;
    width: 2rem;
    height: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235865f2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.quick-action-card[data-action="ai_chat"] .card-header::before {
    content: '';
    display: inline-block;
    width: 2rem;
    height: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235865f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
}

.quick-action-card p {
    flex: 1;
    margin-bottom: 1.5rem;
}

.lesson-item,
.test-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    max-width: 100%;
}

.lesson-info,
.test-info {
    flex: 1;
    min-width: 0;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    max-width: 100%;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.score-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-md);
}

.score-badge.passed {
    background: var(--success-bg);
    color: var(--success);
}

.score-badge.failed {
    background: var(--danger-bg);
    color: var(--danger);
}

.empty-state {
    padding: 3rem 2rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Page header layout */
.page-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
}

.page-header-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.page-header-text h1 {
    margin: 0 0 0.5rem 0;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

.page-header-text p {
    margin: 0;
    font-size: var(--font-size-md);
}

@media (max-width: 768px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .welcome-text {
        font-size: var(--font-size-xl);
    }

    .lesson-item,
    .test-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .lesson-meta,
    .test-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-score {
        align-self: flex-end;
    }

    .page-header {
        margin-bottom: 1rem !important;
        padding: 1.25rem 1rem !important;
    }
}
/**
 * Final layout safety ? no horizontal overflow, no hover shift
 */
.lesson-item:hover,
.test-item:hover,
.card:hover,
.quick-action-card:hover,
.btn-primary:hover,
.btn:hover {
    transform: none !important;
}

.lesson-item:hover,
.test-item:hover {
    translate: none !important;
}

[style*="margin: -2rem"],
[style*="margin:-2rem"] {
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.test-layout,
.test-question-section,
.test-answers-section,
.questions-nav,
.test-navigation {
    max-width: 100%;
    box-sizing: border-box;
}

/* Tables in admin/manager ? scroll inside, not page */
.table-wrapper,
div:has(> .table) {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* pages.css patch ? result icons */
.result-icon { width: 40px; height: 40px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.result-icon.passed { background: var(--success-bg); }
.result-icon.failed { background: var(--danger-bg); }
.result-content { flex: 1; min-width: 0; }
.result-item { border-bottom: 1px solid var(--border-normal); }
.result-item:last-child { border-bottom: none; }
.result-title { font-weight: var(--font-weight-semibold); color: var(--text-normal); margin-bottom: 0.25rem; }
.result-meta { font-size: var(--font-size-sm); color: var(--text-muted); }
.empty-state-title { font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); margin-bottom: 0.5rem; color: var(--text-normal); }
.empty-state-text { font-size: var(--font-size-sm); color: var(--text-muted); }
/**
 * Page components ? extracted from PHP inline styles (v3)
 */



/* --- from lessons.php --- */

.page-header {
            background: var(--bg-elevated);
            color: var(--text-normal);
            padding: 2rem 0;
            margin: 0 0 var(--space-6) 0;
            border-radius: 0 0 16px 16px;
        }
        .page-header-content {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        .page-header-icon {
            font-size: 2.5rem;
        }
        .page-header-text h1 {
            margin: 0 0 0.5rem 0;
            font-size: 1.75rem;
            font-weight: 700;
        }
        .page-header-text p {
            margin: 0;
            opacity: 0.9;
            font-size: 1rem;
        }
        .lesson-list {
            display: grid;
            gap: 1.5rem;
        }
        .lesson-item {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            padding: 1.5rem;
            background: var(--bg-elevated);
            border-radius: 12px;
            border: 1px solid var(--border-normal);
            transition: all 0.3s;
            border: 2px solid transparent;
        }
        .lesson-item:hover {
            
            border: 1px solid var(--border-normal);
            border-color: var(--primary-color);
        }
        .lesson-number {
            width: 64px;
            height: 64px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-elevated);
            color: var(--text-normal);
            border-radius: 50%;
            font-weight: 700;
            font-size: 1.5rem;
            flex-shrink: 0;
            border: 1px solid var(--border-normal);
        }
        .lesson-number.completed {
            background: var(--bg-elevated);
            border: 1px solid var(--border-normal);
        }
        .lesson-info {
            flex: 1;
            min-width: 0;
        }
        .lesson-title {
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 0.75rem;
            color: var(--dark-color);
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-wrap: wrap;
        }
        .lesson-status-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.375rem 0.75rem;
            background: #d1fae5;
            color: #065f46;
            border-radius: 8px;
            font-weight: 600;
            font-size: 0.875rem;
        }
        .lesson-meta {
            display: flex;
            align-items: center;
            gap: 1rem;
            color: var(--gray-color);
            font-size: 0.9rem;
            margin-bottom: 0.75rem;
            flex-wrap: wrap;
        }
        .lesson-meta-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .lesson-description {
            margin-top: 0.75rem;
            color: var(--gray-color);
            font-size: 0.95rem;
            line-height: 1.6;
        }
        .progress-container {
            margin-top: 0.75rem;
        }
        .progress-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--dark-color);
        }
        .progress-bar {
            width: 100%;
            height: 10px;
            background: #e5e7eb;
            border-radius: 8px;
            overflow: hidden;
        }
        .progress-fill {
            height: 100%;
            background: var(--bg-elevated);
            transition: width 0.5s ease;
            border-radius: 8px;
        }
        .empty-state {
            text-align: center;
            padding: 4rem 2rem;
            background: var(--bg-elevated);
            border-radius: 12px;
            border: 1px solid var(--border-normal);
        }
        .empty-state-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
            opacity: 0.5;
        }
        .empty-state-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--dark-color);
            margin-bottom: 0.5rem;
        }
        .empty-state-text {
            color: var(--gray-color);
            font-size: 0.95rem;
        }
        @media (max-width: 768px) {
            .page-header-content {
                flex-direction: column;
                text-align: center;
            }
            .lesson-item {
                flex-direction: column;
                align-items: flex-start;
                gap: 1rem;
            }
            .lesson-number {
                align-self: center;
            }
            .lesson-meta {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.5rem;
            }
        }

/* --- from tests.php --- */

.page-header {
            background: var(--bg-elevated);
            color: var(--text-normal);
            padding: 2rem 0;
            margin: 0 0 var(--space-6) 0;
            border-radius: 0 0 16px 16px;
        }
        .page-header-content {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        .page-header-icon {
            font-size: 2.5rem;
        }
        .page-header-text h1 {
            margin: 0 0 0.5rem 0;
            font-size: 1.75rem;
            font-weight: 700;
        }
        .page-header-text p {
            margin: 0;
            opacity: 0.9;
            font-size: 1rem;
        }
        .exam-card {
            background: var(--bg-elevated);
            color: var(--text-normal);
            padding: 2rem;
            border-radius: 16px;
            border: 1px solid var(--border-normal);
            margin-bottom: 2rem;
            transition: all 0.3s;
        }
        .exam-card:hover {
            
            border: 1px solid var(--border-normal);
        }
        .exam-card-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 2rem;
            flex-wrap: wrap;
        }
        .exam-info h2 {
            margin: 0 0 0.75rem 0;
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--text-normal);
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        .exam-info p {
            margin: 0;
            opacity: 0.95;
            font-size: 1rem;
            line-height: 1.6;
        }
        .exam-features {
            display: flex;
            gap: 1.5rem;
            margin-top: 1rem;
            flex-wrap: wrap;
        }
        .exam-feature {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.95rem;
            opacity: 0.95;
        }
        .exam-btn {
            background: var(--bg-elevated);
            color: var(--brand);
            padding: 1rem 2rem;
            border-radius: 12px;
            font-weight: 700;
            font-size: 1.1rem;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.75rem;
            transition: all 0.3s;
            white-space: nowrap;
        }
        .exam-btn:hover {
            
            border: 1px solid var(--border-normal);
        }
        .category-tabs {
            display: flex;
            gap: 0.75rem;
            margin-bottom: 2rem;
            flex-wrap: wrap;
            border-bottom: 2px solid var(--border-color);
            padding-bottom: 0.5rem;
        }
        .category-tab {
            padding: 0.75rem 1.5rem;
            border-radius: 12px 12px 0 0;
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
            border-bottom: none;
            display: inline-flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0;
            color: var(--dark-color);
            background: var(--light-color);
            position: relative;
            bottom: -2px;
            white-space: nowrap;
            min-width: 140px;
        }
        .category-tab-inner {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }
        .category-tab:hover {
            background: var(--border-color);
            
        }
        .category-tab.active {
            background: var(--bg-elevated);
            border-color: var(--border-color);
            border-bottom-color: var(--text-normal);
            color: var(--dark-color);
            border: 1px solid var(--border-normal);
            z-index: 1;
        }
        .dark-theme .category-tab.active {
            background: var(--card-bg);
            border-color: var(--border-color);
            border-bottom-color: var(--card-bg);
        }
        .dark-theme .category-tab {
            background: var(--table-bg);
            color: var(--dark-color);
        }
        .dark-theme .category-tab:hover {
            background: var(--table-hover-bg);
        }
        .category-section {
            margin-bottom: 2.5rem;
            display: none;
        }
        .category-section.active {
            display: block;
        }
        .category-header {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 3px solid #e5e7eb;
        }
        .category-badge-large {
            display: inline-flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1.5rem;
            border-radius: 12px;
            font-weight: 700;
            font-size: 1.25rem;
            color: var(--text-normal);
        }
        .badge-category-A {
            background: var(--bg-elevated);
        }
        .badge-category-B {
            background: var(--bg-elevated);
        }
        .badge-category-C {
            background: var(--bg-elevated);
        }
        .badge-category-D {
            background: var(--bg-elevated);
        }
        .badge-category-E {
            background: var(--bg-elevated);
        }
        .test-list {
            display: grid;
            gap: 1.5rem;
        }
        .test-item {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            padding: 1.5rem;
            background: var(--bg-elevated);
            border-radius: 12px;
            border: 1px solid var(--border-normal);
            transition: all 0.3s;
            border: 2px solid transparent;
        }
        .test-item:hover {
            
            border: 1px solid var(--border-normal);
            border-color: var(--primary-color);
        }
        .test-number {
            width: 64px;
            height: 64px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-elevated);
            color: var(--text-normal);
            border-radius: 50%;
            font-weight: 700;
            font-size: 1.5rem;
            flex-shrink: 0;
            border: 1px solid var(--border-normal);
        }
        .test-info {
            flex: 1;
            min-width: 0;
        }
        .test-title {
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 0.75rem;
            color: var(--dark-color);
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-wrap: wrap;
        }
        .test-status-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.375rem 0.75rem;
            background: #d1fae5;
            color: #065f46;
            border-radius: 8px;
            font-weight: 600;
            font-size: 0.875rem;
        }
        .test-meta {
            display: flex;
            align-items: center;
            gap: 1rem;
            color: var(--gray-color);
            font-size: 0.9rem;
            margin-bottom: 0.75rem;
            flex-wrap: wrap;
        }
        .test-meta-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .test-meta-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.25rem 0.75rem;
            background: #eff6ff;
            color: var(--primary-color);
            border-radius: 6px;
            font-weight: 600;
            font-size: 0.875rem;
        }
        .test-description {
            margin-top: 0.75rem;
            color: var(--gray-color);
            font-size: 0.95rem;
            line-height: 1.6;
        }
        .empty-state {
            text-align: center;
            padding: 4rem 2rem;
            background: var(--bg-elevated);
            border-radius: 12px;
            border: 1px solid var(--border-normal);
        }
        .empty-state-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
            opacity: 0.5;
        }
        .empty-state-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--dark-color);
            margin-bottom: 0.5rem;
        }
        .empty-state-text {
            color: var(--gray-color);
            font-size: 0.95rem;
        }
        /* ????? ?????????? */
        .practice-card {
            background: var(--light-color);
            border: 2px solid var(--border-color);
            border-radius: 16px;
            margin-bottom: 2rem;
            overflow: hidden;
            transition: all 0.3s;
        }
        .practice-card:hover {
            border-color: var(--primary-color);
            border: 1px solid var(--border-normal);
        }
        .practice-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.5rem 2rem;
            background: var(--bg-elevated);
            color: var(--text-normal);
            cursor: pointer;
        }
        .practice-card-header:hover {
            background: var(--bg-elevated);
        }
        .practice-info h2 {
            margin: 0 0 0.5rem 0;
            font-size: 1.5rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            color: var(--text-normal);
        }
        .practice-info p {
            margin: 0;
            opacity: 0.95;
            font-size: 0.95rem;
        }
        .practice-toggle-btn {
            background: var(--bg-modifier-hover, rgba(255, 255, 255, 0.08));
            border: 1px solid var(--border-normal);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s;
            color: var(--text-normal);
            flex-shrink: 0;
        }
        .practice-toggle-btn:hover {
            background: var(--bg-modifier-active, rgba(255, 255, 255, 0.12));
            border-color: var(--brand);
        }
        .practice-toggle-btn.active .icon {
            transform: rotate(180deg);
        }
        .practice-toggle-btn .icon {
            transition: transform 0.3s;
        }
        .practice-panel {
            display: none;
            padding: 2rem;
            background: var(--bg-elevated);
        }
        .practice-panel.active {
            display: block;
        }
        .practice-topics-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }
        .practice-category {
            background: var(--light-color);
            border-radius: 12px;
            padding: 1rem;
            border: 1px solid var(--border-color);
        }
        .practice-category-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding-bottom: 0.75rem;
            margin-bottom: 0.75rem;
            border-bottom: 1px solid var(--border-color);
        }
        .practice-category-checkbox {
            display: flex;
            align-items: center;
            cursor: pointer;
        }
        .practice-category-checkbox input {
            display: none;
        }
        .checkbox-custom {
            width: 20px;
            height: 20px;
            border: 2px solid var(--border-color);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            background: var(--bg-elevated);
        }
        .checkbox-custom::after {
            content: '';
            width: 10px;
            height: 5px;
            border-left: 2px solid #fff;
            border-bottom: 2px solid #fff;
            transform: rotate(-45deg) translateY(-1px);
            opacity: 0;
            transition: opacity 0.2s;
        }
        input:indeterminate + .checkbox-custom {
            background: var(--primary-color);
            border-color: var(--primary-color);
        }
        input:indeterminate + .checkbox-custom::after {
            content: '';
            width: 10px;
            height: 0;
            border: none;
            border-top: 2px solid #fff;
            transform: none;
            opacity: 1;
        }
        input:checked + .checkbox-custom {
            background: var(--primary-color);
            border-color: var(--primary-color);
        }
        input:checked + .checkbox-custom::after {
            opacity: 1;
        }
        .category-badge-small {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.375rem 0.75rem;
            border-radius: 8px;
            font-weight: 600;
            font-size: 0.875rem;
            color: var(--text-normal);
        }
        .practice-topics-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            max-height: 200px;
            overflow-y: auto;
        }
        .practice-topic-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.5rem 0.75rem;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            background: var(--bg-elevated);
        }
        .practice-topic-item:hover {
            background: rgba(37, 99, 235, 0.05);
        }
        .practice-topic-item input {
            display: none;
        }
        .topic-number {
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--border-color);
            color: var(--gray-color);
            border-radius: 50%;
            font-size: 0.8rem;
            font-weight: 600;
            flex-shrink: 0;
        }
        .practice-topic-item input:checked ~ .topic-number {
            background: var(--primary-color);
            color: var(--text-normal);
        }
        .topic-title {
            font-size: 0.9rem;
            color: var(--dark-color);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .practice-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-top: 1.5rem;
            border-top: 1px solid var(--border-color);
            flex-wrap: wrap;
            gap: 1rem;
        }
        .practice-selected-count {
            font-size: 0.95rem;
            color: var(--gray-color);
        }
        .practice-selected-count strong {
            color: var(--primary-color);
            font-size: 1.1rem;
        }
        .practice-start-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.875rem 1.5rem;
            font-weight: 600;
        }
        .practice-start-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        @media (max-width: 768px) {
            .page-header-content {
                flex-direction: column;
                text-align: center;
            }
            .exam-card-content {
                flex-direction: column;
                text-align: center;
            }
            .exam-features {
                justify-content: center;
            }
            .exam-btn {
                width: 100%;
                justify-content: center;
            }
            .test-item {
                flex-direction: column;
                align-items: flex-start;
                gap: 1rem;
            }
            .test-number {
                align-self: center;
            }
            .test-meta {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.5rem;
            }
            .practice-card-header {
                padding: 1rem 1.5rem;
            }
            .practice-panel {
                padding: 1rem;
            }
            .practice-topics-grid {
                grid-template-columns: 1fr;
            }
            .practice-actions {
                flex-direction: column;
                align-items: stretch;
            }
            .practice-start-btn {
                width: 100%;
                justify-content: center;
            }
        }
        
        /* ?????? ???? */
        .dark-theme .practice-card {
            background: #1f2937;
            border-color: #374151;
        }
        .dark-theme .practice-card:hover {
            border-color: var(--primary-color);
        }
        .dark-theme .practice-panel {
            background: #1f2937;
        }
        .dark-theme .practice-category {
            background: #111827;
            border-color: #374151;
        }
        .dark-theme .practice-category-header {
            border-color: #374151;
        }
        .dark-theme .checkbox-custom {
            background: #374151;
            border-color: #4b5563;
        }
        .dark-theme .practice-topic-item {
            background: #1f2937;
        }
        .dark-theme .practice-topic-item:hover {
            background: rgba(37, 99, 235, 0.15);
        }
        .dark-theme .topic-number {
            background: #374151;
            color: #9ca3af;
        }
        .dark-theme .topic-title {
            color: #e5e7eb;
        }
        .dark-theme .practice-actions {
            border-color: #374151;
        }
        .dark-theme .practice-selected-count {
            color: #9ca3af;
        }

/* --- from statistics.php --- */

.profile-header {
            background: var(--bg-elevated);
            color: var(--text-normal);
            padding: 3rem 0 2rem;
            margin-bottom: 2rem;
            position: relative;
            overflow: hidden;
        }
        .profile-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
            opacity: 0.3;
        }
        .profile-header-content {
            position: relative;
            z-index: 1;
        }
        .profile-avatar {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            border: 4px solid white;
            background: var(--bg-elevated);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            font-weight: bold;
            margin: 0 auto 1.5rem;
            overflow: hidden;
            border: 1px solid var(--border-normal);
            color: var(--text-normal);
            transition: transform 0.3s;
        }
        .profile-avatar:hover {
            
        }
        .profile-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .profile-name {
            font-size: 1.75rem;
            font-weight: 700;
            text-align: center;
            margin-bottom: 0.5rem;
        }
        .profile-email {
            text-align: center;
            opacity: 0.95;
            font-size: 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        .profile-email::before {
            display: none;
        }
        .profile-tab::before {
            display: none;
        }
        .profile-tab[onclick*="info"]::before,
        .profile-tab[onclick*="edit"]::before,
        .profile-tab[onclick*="password"]::before,
        .profile-tab[onclick*="devices"]::before,
        .profile-tab[onclick*="stats"]::before {
            display: none;
        }
        .profile-tabs {
            display: flex;
            gap: 0.5rem;
            border-bottom: 2px solid var(--border-color);
            margin-bottom: 2rem;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        .profile-tabs::-webkit-scrollbar {
            height: 4px;
        }
        .profile-tabs::-webkit-scrollbar-thumb {
            background: var(--border-color);
            border-radius: 2px;
        }
        .profile-tab {
            padding: 1rem 1.5rem;
            background: none;
            border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer;
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--gray-color);
            transition: all 0.3s;
            white-space: nowrap;
            position: relative;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .profile-tab::before {
            display: none;
        }
        .profile-tab[onclick*="stats"]::before {
            display: none;
        }
        .profile-tabs {
            color: var(--primary-color);
            background: rgba(37, 99, 235, 0.05);
        }
        .profile-tab.active {
            color: var(--primary-color);
            border-bottom-color: var(--primary-color);
            background: rgba(37, 99, 235, 0.08);
        }
        .profile-tab-content {
            display: none;
            animation: fadeIn 0.3s ease-in;
        }
        .profile-tab-content.active {
            display: block;
        }
        .session-alert {
            margin-bottom: 1.5rem;
            padding: 1rem 1.25rem;
            background: #fef3c7;
            border: 1px solid #fcd34d;
            border-left: 4px solid #f59e0b;
            border-radius: 10px;
            color: #92400e;
        }
        .session-alert-title { font-weight: 700; margin-bottom: 0.35rem; }
        .session-alert-actions { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
        .device-session-list { display: grid; gap: 0.75rem; }
        .device-session-item {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 1rem 1.15rem;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            background: var(--light-color, #fff);
        }
        .device-session-item.current {
            border-color: var(--primary-color);
            background: #eff6ff;
        }
        .device-session-item.revoked { opacity: 0.65; }
        .device-session-name { font-weight: 600; }
        .device-session-meta { font-size: 0.8125rem; color: var(--gray-color); margin-top: 0.25rem; }
        .device-session-badge {
            display: inline-block;
            padding: 0.2rem 0.55rem;
            border-radius: 999px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        .device-session-badge.active { background: #dcfce7; color: #166534; }
        .device-session-badge.ended { background: #f3f4f6; color: #6b7280; }
        .device-session-badge.current { background: #dbeafe; color: #1e40af; }
        @keyframes fadeIn {
            from {
                opacity: 0;
                
            }
            to {
                opacity: 1;
                
            }
        }
        .form-group {
            margin-bottom: 1.5rem;
        }
        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: var(--dark-color);
            font-size: 0.95rem;
        }
        .form-group input {
            width: 100%;
            padding: 0.875rem 1rem;
            border: 2px solid var(--border-color);
            border-radius: 0.5rem;
            font-size: 1rem;
            transition: all 0.3s;
            background: var(--bg-elevated);
        }
        .form-group input:focus {
            outline: none;
            border-color: var(--primary-color);
            border: 1px solid var(--border-normal);
        }
        .form-group small {
            display: block;
            margin-top: 0.5rem;
            color: var(--gray-color);
            font-size: 0.875rem;
        }
        .info-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.25rem 1rem;
            border-bottom: 1px solid var(--border-color);
            transition: background 0.2s;
        }
        .info-row:hover {
            background: var(--light-color);
        }
        .info-row:last-child {
            border-bottom: none;
        }
        .info-label {
            color: var(--gray-color);
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .info-value {
            color: var(--dark-color);
            font-weight: 600;
            text-align: right;
        }
        .info-card {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1rem;
            margin-top: 1.5rem;
        }
        .info-card-item {
            padding: 1.25rem;
            background: var(--light-color);
            border-radius: 0.75rem;
            border-left: 4px solid var(--primary-color);
        }
        .info-card-item-label {
            font-size: 0.875rem;
            color: var(--gray-color);
            margin-bottom: 0.5rem;
            font-weight: 500;
        }
        .info-card-item-value {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--dark-color);
        }
        .access-status {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            font-weight: 600;
            font-size: 0.9rem;
        }
        .access-status.success {
            background: #d1fae5;
            color: #065f46;
        }
        .access-status.danger {
            background: #fee2e2;
            color: #991b1b;
        }
        .access-status.warning {
            background: #fef3c7;
            color: #92400e;
        }
        .category-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 0.75rem;
            background: var(--bg-elevated);
            border: 1px solid var(--border-color);
            border-radius: 0.5rem;
            font-size: 0.875rem;
            font-weight: 500;
        }
        .progress-circle {
            width: 120px;
            height: 120px;
            margin: 0 auto;
            position: relative;
        }
        .progress-circle svg {
            transform: rotate(-90deg);
        }
        .progress-circle-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary-color);
        }
        .stat-mini-card {
            background: var(--bg-elevated);
            padding: 1.5rem;
            border-radius: 0.75rem;
            border-left: 4px solid var(--primary-color);
            box-shadow: var(--shadow);
            transition: transform 0.3s, box-shadow 0.3s;
        }
        .stat-mini-card:hover {
            
            box-shadow: var(--shadow-lg);
        }
        .stat-mini-card.secondary {
            border-left-color: var(--secondary-color);
        }
        .stat-mini-card.warning {
            border-left-color: var(--warning-color);
        }
        .stat-mini-card.purple {
            border-left-color: #8b5cf6;
        }
        .stat-mini-value {
            font-size: 2rem;
            font-weight: 700;
            color: var(--dark-color);
            margin-bottom: 0.5rem;
        }
        .stat-mini-label {
            font-size: 0.875rem;
            color: var(--gray-color);
            font-weight: 500;
        }
        @media (max-width: 768px) {
            .profile-header {
                padding: 2rem 0 1.5rem;
            }
            .profile-avatar {
                width: 100px;
                height: 100px;
                font-size: 2.5rem;
            }
            .profile-name {
                font-size: 1.5rem;
            }
            .profile-tabs {
                gap: 0.25rem;
                padding-bottom: 0.5rem;
            }
            .profile-tab {
                padding: 0.875rem 1rem;
                font-size: 0.875rem;
            }
            .info-row {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.5rem;
            }
            .info-value {
                text-align: left;
            }
            .info-card {
                grid-template-columns: 1fr;
            }
            .stat-mini-card {
                padding: 1.25rem;
            }
        }

/* --- from lesson.php --- */

.lesson-complete-card {
            margin-top: 2rem;
            padding: 1.5rem;
            background: var(--bg-elevated);
            border-radius: 12px;
            border-left: 4px solid #10b981;
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        .complete-text {
            flex: 1;
        }
        .complete-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: #065f46;
            margin-bottom: 0.25rem;
        }
        .complete-date {
            font-size: 0.9rem;
            color: #047857;
        }
        .lesson-complete-prompt {
            margin-top: 2rem;
            padding: 1.5rem;
            background: #f9fafb;
            border-radius: 12px;
            border: 2px dashed #e5e7eb;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 1rem;
        }
        .prompt-text {
            flex: 1;
        }
        .prompt-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--dark-color);
            margin-bottom: 0.25rem;
        }
        .prompt-description {
            font-size: 0.9rem;
            color: var(--gray-color);
        }
        .dark-theme .lesson-complete-card {
            background: var(--bg-elevated);
            border-left-color: #10b981;
        }
        .dark-theme .complete-title {
            color: #10b981;
        }
        .dark-theme .complete-date {
            color: var(--gray-color);
        }
        .dark-theme .lesson-complete-prompt {
            background: var(--card-bg);
            border-color: var(--border-color);
        }
        .dark-theme .prompt-title {
            color: var(--dark-color);
        }
        .dark-theme .prompt-description {
            color: var(--gray-color);
        }
        .dark-theme .lesson-complete-prompt .btn-outline:hover {
            background: rgba(16, 185, 129, 0.2);
        }
        .dark-theme .lesson-complete-card .btn-outline {
            background: var(--card-bg);
            border-color: #10b981;
            color: #10b981;
        }
        .dark-theme .lesson-complete-card .btn-outline:hover {
            background: rgba(16, 185, 129, 0.2);
        }

        /* ????????? ?????????? */
        .custom-video-player {
            position: relative;
            width: 100%;
            background: #000;
            border-radius: 0.5rem;
            overflow: hidden;
        }

        .custom-video-player video {
            width: 100%;
            display: block;
            outline: none;
        }

        .custom-video-player video::-webkit-media-controls {
            display: none !important;
        }

        .custom-video-player video::-webkit-media-controls-enclosure {
            display: none !important;
        }

        .custom-video-player video::-webkit-media-controls-panel {
            display: none !important;
        }

        .custom-video-player video::-webkit-media-controls-play-button {
            display: none !important;
        }

        .custom-video-player video::-webkit-media-controls-current-time-display {
            display: none !important;
        }

        .custom-video-player video::-webkit-media-controls-time-remaining-display {
            display: none !important;
        }

        .custom-video-player video::-webkit-media-controls-timeline {
            display: none !important;
        }

        .custom-video-player video::-webkit-media-controls-volume-slider {
            display: none !important;
        }

        .custom-video-player video::-webkit-media-controls-mute-button {
            display: none !important;
        }

        .custom-video-player video::-webkit-media-controls-fullscreen-button {
            display: none !important;
        }

        .custom-video-player video::-webkit-media-controls-overlay-play-button {
            display: none !important;
        }

        .custom-video-player video::-webkit-media-controls-overlay-enclosure {
            display: none !important;
        }

        .video-controls {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: var(--bg-elevated);
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            opacity: 0;
            transition: opacity 0.3s;
            z-index: 5;
            pointer-events: none;
        }

        .video-controls * {
            pointer-events: auto;
        }

        .custom-video-player:hover .video-controls,
        .custom-video-player.controls-visible .video-controls {
            opacity: 1;
        }

        .video-progress-container {
            width: 100%;
            height: 6px;
            background: rgba(255, 255, 255, 0.3);
            border-radius: 3px;
            cursor: pointer;
            position: relative;
        }

        .video-progress-bar {
            height: 100%;
            background: var(--primary-color);
            border-radius: 3px;
            width: 0%;
            transition: width 0.1s;
        }

        .video-progress-buffer {
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            background: rgba(255, 255, 255, 0.5);
            border-radius: 3px;
            width: 0%;
        }

        .video-controls-bottom {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .video-controls-left {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex: 1;
        }

        .video-controls-right {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .video-btn {
            background: none;
            border: none;
            color: var(--text-normal);
            cursor: pointer;
            padding: 0.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            transition: opacity 0.2s;
            border-radius: 4px;
            position: relative;
            z-index: 10;
            pointer-events: auto;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
            -webkit-user-select: none;
        }

        .video-btn:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .video-btn:active {
            opacity: 0.7;
            
        }

        .video-btn:focus {
            outline: 2px solid rgba(255, 255, 255, 0.5);
            outline-offset: 2px;
        }

        .video-time {
            color: var(--text-normal);
            font-size: 0.9rem;
            font-family: monospace;
            white-space: nowrap;
        }

        .video-volume-container {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .video-volume-slider {
            width: 80px;
            height: 4px;
            background: rgba(255, 255, 255, 0.3);
            border-radius: 2px;
            cursor: pointer;
            position: relative;
        }

        .video-volume-fill {
            height: 100%;
            background: var(--bg-elevated);
            border-radius: 2px;
            width: 100%;
        }

        .video-loading {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: var(--text-normal);
            font-size: 1.5rem;
            display: none;
        }

        .video-loading.active {
            display: block;
        }

        .dark-theme .custom-video-player {
            background: #000;
        }

        /* ????????? ????????? */
        @media (max-width: 768px) {
            .container {
                padding: 0 1rem;
            }

            .card {
                padding: 1rem;
            }

            .card-header {
                flex-direction: column;
                align-items: flex-start !important;
            }

            .card-title {
                font-size: 1.5rem !important;
            }

            .lesson-lang-switcher {
                width: 100%;
                justify-content: center;
            }

            .lesson-complete-card,
            .lesson-complete-prompt {
                flex-direction: column;
                align-items: stretch;
                padding: 1rem !important;
            }

            .lesson-complete-prompt form,
            .lesson-complete-card form {
                width: 100%;
            }

            .lesson-complete-prompt .btn,
            .lesson-complete-card .btn {
                width: 100%;
                justify-content: center;
            }

            /* ?????????? ??? ????????? */
            .custom-video-player {
                border-radius: 0.25rem;
            }

            .custom-video-player video {
                max-height: 50vh;
                object-fit: contain;
            }

            .video-controls {
                padding: 0.75rem;
                gap: 0.5rem;
            }

            .video-progress-container {
                height: 8px;
                margin-bottom: 0.5rem;
            }

            .video-btn {
                padding: 0.75rem;
                font-size: 1.5rem;
                min-width: 44px;
                min-height: 44px;
                touch-action: manipulation;
            }

            .video-time {
                font-size: 0.85rem;
            }

            .video-volume-container {
                display: none;
            }

            .video-controls-bottom {
                gap: 0.5rem;
            }

            .video-controls-left {
                gap: 0.5rem;
            }

            /* ?????? ?????????? ???????? ?? ????????? ??? ??????? */
            .custom-video-player.controls-visible .video-controls,
            .custom-video-player:active .video-controls {
                opacity: 1;
            }

            /* ?????????? ?????? ?????????????? ?????? */
            .video-controls-right {
                flex-shrink: 0;
            }

            /* ??????????? ??? ????????? ??????? */
            @media (max-width: 480px) {
                .card-title {
                    font-size: 1.25rem !important;
                }

                .video-time {
                    font-size: 0.75rem;
                }

                .video-btn {
                    padding: 0.5rem;
                    font-size: 1.25rem;
                    min-width: 40px;
                    min-height: 40px;
                }

                .video-controls {
                    padding: 0.5rem;
                }
            }
        }

        /* ????????? ??? ????????? */
        @media (min-width: 769px) and (max-width: 1024px) {
            .video-volume-container {
                display: flex;
            }

            .video-volume-slider {
                width: 60px;
            }
        }

        /* ?????????????? ??????????????? ??? ??????? ??????? ?? ????? */
        .custom-video-player {
            touch-action: pan-y pinch-zoom;
        }

        .custom-video-player video {
            touch-action: pan-y pinch-zoom;
        }

        /* ????????????? ????? */
        .custom-video-player:fullscreen {
            width: 100vw;
            height: 100vh;
            border-radius: 0;
        }

        .custom-video-player:-webkit-full-screen {
            width: 100vw;
            height: 100vh;
            border-radius: 0;
        }

        .custom-video-player:-moz-full-screen {
            width: 100vw;
            height: 100vh;
            border-radius: 0;
        }

        .custom-video-player:-ms-fullscreen {
            width: 100vw;
            height: 100vh;
            border-radius: 0;
        }

        .custom-video-player:fullscreen video {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .custom-video-player:-webkit-full-screen video {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .custom-video-player:-moz-full-screen video {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .custom-video-player:-ms-fullscreen video {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        /* ????????? ???????? ?? ????????? ? ????????????? ?????? */
        @media (max-width: 768px) {
            .custom-video-player:fullscreen,
            .custom-video-player:-webkit-full-screen,
            .custom-video-player:-moz-full-screen,
            .custom-video-player:-ms-fullscreen {
                width: 100vw;
                height: 100vh;
                max-width: 100vw;
                max-height: 100vh;
            }

            .custom-video-player:fullscreen video,
            .custom-video-player:-webkit-full-screen video,
            .custom-video-player:-moz-full-screen video,
            .custom-video-player:-ms-fullscreen video {
                width: 100%;
                height: 100%;
                object-fit: contain;
            }
        }

        /* ???????????? ?????? ????????? */
        @media (max-width: 768px) {
            .card > div:last-child {
                flex-direction: column;
            }

            .card > div:last-child .btn {
                width: 100%;
            }

            /* ???????????? ???????? ? ???????? */
            .card > div p {
                font-size: 1rem !important;
            }

            .card > div[style*="line-height"] {
                font-size: 1rem !important;
            }
        }

/* --- from test_result.php --- */

.result-header {
            background: var(--bg-elevated);
            color: var(--text-normal);
            padding: 3rem 0 2rem;
            margin-bottom: 2rem;
            position: relative;
            overflow: hidden;
        }
        .result-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
            opacity: 0.3;
        }
        .result-header-content {
            position: relative;
            z-index: 1;
        }
        .result-score-card {
            text-align: center;
            padding: 2rem;
            background: <?php echo $attempt['is_passed'] ? 'linear-gradient(135deg, #10b981, #059669)' : 'linear-gradient(135deg, #ef4444, #dc2626)'; ?>;
            color: var(--text-normal);
            border-radius: 16px;
            margin-bottom: 2rem;
            border: 1px solid var(--border-normal);
        }
        .result-score-value {
            font-size: 4rem;
            font-weight: 700;
            margin-bottom: 1rem;
            line-height: 1;
        }
        .result-status {
            font-size: 1.75rem;
            font-weight: 600;
            margin-bottom: 1rem;
        }
        .result-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin-top: 1.5rem;
            opacity: 0.95;
        }
        .result-stat-item {
            padding: 1rem;
            background: rgba(255, 255, 255, 0.15);
            border-radius: 0.5rem;
            backdrop-filter: blur(10px);
        }
        .result-stat-label {
            font-size: 0.9rem;
            opacity: 0.9;
            margin-bottom: 0.5rem;
        }
        .result-stat-value {
            font-size: 1.5rem;
            font-weight: 700;
        }
        .result-question-card {
            margin-bottom: 3rem;
            background: var(--bg-elevated);
            border-radius: 12px;
            overflow: hidden;
            border: 1px solid var(--border-normal);
        }
        .result-question-header {
            padding: 1.5rem;
            border-bottom: 2px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 1rem;
        }
        .result-question-number {
            font-size: 1rem;
            font-weight: 600;
            color: var(--primary-color);
        }
        .result-question-status {
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            font-weight: 600;
            font-size: 0.9rem;
        }
        .result-question-status.correct {
            background: #d1fae5;
            color: #065f46;
        }
        .result-question-status.incorrect {
            background: #fee2e2;
            color: #991b1b;
        }
        @media (max-width: 768px) {
            .result-header {
                padding: 2rem 0 1.5rem;
            }
            .result-score-value {
                font-size: 3rem;
            }
            .result-status {
                font-size: 1.5rem;
            }
            .result-stats {
                grid-template-columns: 1fr;
            }
            .result-question-header {
                flex-direction: column;
            }
        }

/* --- from ai_chat.php --- */

.ai-chat-container {
            display: flex;
            height: calc(100vh - 80px);
            margin-top: 80px;
            background: var(--light-color);
        }
        
        .ai-chat-sidebar {
            width: 300px;
            background: var(--light-color);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            overflow-y: auto;
        }
        
        .ai-chat-main {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: var(--light-color);
            overflow: hidden;
        }
        
        .ai-chat-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border-color);
            background: var(--bg-elevated);
            color: var(--text-normal);
        }
        
        .ai-chat-header h2 {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
        }
        
        .ai-chat-header p {
            opacity: 0.9;
            font-size: 0.875rem;
        }
        
        .ai-chat-language-selector {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border-color);
        }
        
        .ai-chat-language-selector label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: var(--dark-color);
        }
        
        .ai-chat-language-selector select {
            width: 100%;
            padding: 0.75rem;
            border: 2px solid var(--border-color);
            border-radius: 8px;
            font-size: 1rem;
            background: var(--light-color);
            color: var(--dark-color);
        }
        
        .ai-chat-quick-actions {
            padding: 1.5rem;
            flex: 1;
        }
        
        .ai-chat-quick-actions h3 {
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 1rem;
            color: var(--dark-color);
        }
        
        .ai-chat-action-btn {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            background: var(--light-color);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            color: var(--dark-color);
            text-decoration: none;
            font-weight: 500;
            margin-bottom: 0.5rem;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .ai-chat-action-btn:hover {
            background: var(--primary-color);
            color: var(--text-normal);
            
            box-shadow: var(--shadow);
        }
        
        .ai-chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }
        
        .ai-message {
            display: flex;
            gap: 0.75rem;
            max-width: 80%;
            animation: slideIn 0.3s ease;
        }
        
        .ai-message.user {
            align-self: flex-end;
            flex-direction: row-reverse;
        }
        
        .ai-message-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-normal);
            flex-shrink: 0;
            font-size: 1.2rem;
        }
        
        .ai-message.user .ai-message-avatar {
            background: var(--bg-elevated);
        }
        
        .ai-message.assistant .ai-message-avatar {
            background: var(--bg-elevated);
        }
        
        .ai-message-content {
            background: var(--light-color);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 1rem;
            box-shadow: var(--shadow-sm);
        }
        
        .ai-message.user .ai-message-content {
            background: var(--bg-elevated);
            color: var(--text-normal);
            border-color: var(--primary-color);
        }
        
        .ai-message-text {
            line-height: 1.6;
            word-wrap: break-word;
        }
        
        .ai-message-text strong {
            font-weight: 700;
        }
        
        .ai-message-time {
            font-size: 0.75rem;
            color: var(--gray-color);
            margin-top: 0.5rem;
        }
        
        .ai-message.user .ai-message-time {
            color: rgba(255, 255, 255, 0.7);
        }
        
        .ai-chat-input-area {
            padding: 1.5rem;
            border-top: 1px solid var(--border-color);
            background: var(--light-color);
        }
        
        .ai-input-container {
            display: flex;
            gap: 0.75rem;
            align-items: flex-end;
        }
        
        .ai-chat-input {
            flex: 1;
            min-height: 48px;
            max-height: 120px;
            padding: 0.75rem 1rem;
            border: 2px solid var(--border-color);
            border-radius: 12px;
            font-family: inherit;
            font-size: 1rem;
            resize: none;
            transition: all 0.3s;
            background: var(--light-color);
            color: var(--dark-color);
        }
        
        .ai-chat-input:focus {
            outline: none;
            border-color: var(--primary-color);
            border: 1px solid var(--border-normal);
        }
        
        .ai-chat-input::placeholder {
            color: var(--gray-color);
        }
        
        .ai-send-btn {
            width: 48px;
            height: 48px;
            background: var(--bg-elevated);
            border: none;
            border-radius: 12px;
            color: var(--text-normal);
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
        }
        
        .ai-send-btn:hover:not(:disabled) {
            
            box-shadow: var(--shadow-md);
        }
        
        .ai-send-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .ai-input-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.75rem;
        }
        
        .ai-action-icon {
            width: 36px;
            height: 36px;
            background: var(--light-color);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: var(--gray-color);
            transition: all 0.3s;
        }
        
        .ai-action-icon:hover {
            background: var(--primary-color);
            color: var(--text-normal);
            border-color: var(--primary-color);
        }
        
        .ai-typing-indicator {
            display: none;
            align-items: center;
            gap: 0.5rem;
            padding: 1rem;
            color: var(--gray-color);
        }
        
        .ai-typing-indicator.active {
            display: flex;
        }
        
        .ai-typing-dot {
            width: 8px;
            height: 8px;
            background: var(--gray-color);
            border-radius: 50%;
            animation: typing 1.4s infinite;
        }
        
        .ai-typing-dot:nth-child(2) {
            animation-delay: 0.2s;
        }
        
        .ai-typing-dot:nth-child(3) {
            animation-delay: 0.4s;
        }
        
        @keyframes slideIn {
            from {
                opacity: 0;
                
            }
            to {
                opacity: 1;
                
            }
        }
        
        @keyframes typing {
            0%, 60%, 100% {
                
            }
            30% {
                
            }
        }
        
        .ai-not-right-button {
            background: var(--bg-elevated);
            border: none;
            color: var(--text-normal);
            padding: 0.75rem 1rem;
            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            margin-top: 0.75rem;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .ai-not-right-button:hover {
            
            box-shadow: var(--shadow-md);
        }
        
        /* Dark theme */
        .dark-theme .ai-chat-container {
            background: var(--card-bg);
        }
        
        .dark-theme .ai-chat-sidebar {
            background: var(--card-bg);
            border-right-color: var(--border-color);
        }
        
        .dark-theme .ai-chat-main {
            background: var(--card-bg);
        }
        
        .dark-theme .ai-chat-header {
            background: var(--bg-elevated);
            border-bottom-color: var(--border-color);
            color: var(--dark-color);
        }
        
        .dark-theme .ai-chat-header h2 {
            color: var(--dark-color);
        }
        
        .dark-theme .ai-chat-header p {
            opacity: 0.8;
            color: var(--gray-color);
        }
        
        .dark-theme .ai-chat-language-selector {
            border-bottom-color: var(--border-color);
        }
        
        .dark-theme .ai-chat-language-selector label {
            color: var(--dark-color);
        }
        
        .dark-theme .ai-chat-language-selector select {
            background: var(--input-bg);
            border-color: var(--input-border);
            color: var(--dark-color);
        }
        
        .dark-theme .ai-chat-language-selector select option {
            background: var(--card-bg);
            color: var(--dark-color);
        }
        
        .dark-theme .ai-chat-quick-actions {
            background: var(--card-bg);
        }
        
        .dark-theme .ai-chat-quick-actions h3 {
            color: var(--dark-color);
        }
        
        .dark-theme .ai-chat-action-btn {
            background: var(--card-bg);
            border-color: var(--border-color);
            color: var(--dark-color);
        }
        
        .dark-theme .ai-chat-action-btn:hover {
            background: rgba(59, 130, 246, 0.2);
            border-color: var(--primary-color);
        }
        
        .dark-theme .ai-chat-messages {
            background: var(--card-bg);
        }
        
        .dark-theme .ai-message-content {
            background: var(--card-bg);
            border-color: var(--border-color);
            color: var(--dark-color);
        }
        
        .dark-theme .ai-message.user .ai-message-content {
            background: var(--bg-elevated);
            border-color: var(--primary-color);
            color: var(--dark-color);
        }
        
        .dark-theme .ai-message.assistant .ai-message-avatar {
            background: var(--bg-elevated);
        }
        
        .dark-theme .ai-message.user .ai-message-avatar {
            background: var(--bg-elevated);
        }
        
        .dark-theme .ai-message-time {
            color: var(--gray-color);
        }
        
        .dark-theme .ai-chat-input-area {
            background: var(--card-bg);
            border-top-color: var(--border-color);
        }
        
        .dark-theme .ai-chat-input {
            background: var(--input-bg);
            border-color: var(--input-border);
            color: var(--dark-color);
        }
        
        .ai-chat-input:focus {
            outline: none;
            border-color: var(--primary-color);
            border: 1px solid var(--border-normal);
        }
        
        .dark-theme .ai-chat-input:focus {
            border: 1px solid var(--border-normal);
        }
        
        .dark-theme .ai-chat-input::placeholder {
            color: var(--gray-color);
        }
        
        .dark-theme .ai-send-btn {
            background: var(--bg-elevated);
        }
        
        .dark-theme .ai-action-icon {
            background: var(--card-bg);
            border-color: var(--border-color);
            color: var(--dark-color);
        }
        
        .dark-theme .ai-action-icon:hover {
            background: rgba(59, 130, 246, 0.2);
            border-color: var(--primary-color);
        }
        
        .dark-theme .ai-typing-indicator {
            color: var(--gray-color);
        }
        
        .dark-theme .ai-typing-dot {
            background: var(--gray-color);
        }
        
        .dark-theme .ai-not-right-button {
            background: var(--bg-elevated);
        }
        
        /* Mobile */
        @media (max-width: 768px) {
            .ai-chat-sidebar {
                position: fixed;
                left: -300px;
                top: 80px;
                height: calc(100vh - 80px);
                z-index: 999;
                transition: left 0.3s;
            }
            
            .ai-chat-sidebar.open {
                left: 0;
            }
            
            .ai-chat-main {
                width: 100%;
            }
            
            .ai-message {
                max-width: 90%;
            }
            
            .dark-theme .ai-chat-sidebar {
                background: var(--card-bg);
                border-right-color: var(--border-color);
            }
        }

/* --- from index.php --- */

.page-header {
            background: var(--bg-elevated);
            color: var(--text-normal);
            padding: 2rem 0;
            margin: 0 0 var(--space-6) 0;
            border-radius: 0 0 16px 16px;
        }
        .page-header-content {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        .page-header-icon {
            font-size: 2.5rem;
        }
        .page-header-text h1 {
            margin: 0 0 0.5rem 0;
            font-size: 1.75rem;
            font-weight: 700;
        }
        .page-header-text p {
            margin: 0;
            opacity: 0.9;
            font-size: 1rem;
        }
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        .stat-card {
            background: var(--bg-elevated);
            border-radius: 12px;
            padding: 1.5rem;
            border: 1px solid var(--border-normal);
            transition: all 0.3s;
            border: 2px solid transparent;
        }
        .dark-theme .stat-card {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
        }
        .stat-card:hover {
            
            border: 1px solid var(--border-normal);
        }
        .stat-card.secondary {
            background: var(--bg-elevated);
            color: var(--text-normal);
        }
        .stat-card.warning {
            background: var(--bg-elevated);
            color: var(--text-normal);
        }
        .stat-value {
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        .stat-icon {
            font-size: 2rem;
        }
        .stat-label {
            font-size: 0.95rem;
            opacity: 0.9;
            font-weight: 500;
        }
        .quick-actions-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        .action-card {
            background: var(--bg-elevated);
            border-radius: 12px;
            border: 1px solid var(--border-normal);
            overflow: hidden;
            transition: all 0.3s;
            border: 2px solid transparent;
        }
        .dark-theme .action-card {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
        }
        .action-card:hover {
            
            border: 1px solid var(--border-normal);
            border-color: var(--primary-color);
        }
        .action-card-header {
            padding: 1.5rem;
            background: var(--bg-elevated);
            border-bottom: 2px solid #e5e7eb;
        }
        .dark-theme .action-card-header {
            background: var(--table-header-bg);
            border-bottom-color: var(--border-color);
        }
        .action-card-title {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin: 0;
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--dark-color);
        }
        .action-card-icon {
            font-size: 1.5rem;
        }
        .action-card-content {
            padding: 1.5rem;
        }
        .action-card-description {
            color: var(--gray-color);
            margin-bottom: 1.5rem;
            font-size: 0.95rem;
            line-height: 1.6;
        }
        .activity-table {
            width: 100%;
            border-collapse: collapse;
        }
        .activity-table thead {
            background: var(--bg-elevated);
        }
        .activity-table th {
            padding: 1rem;
            text-align: left;
            font-weight: 700;
            color: var(--dark-color);
            font-size: 0.875rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 2px solid #e5e7eb;
        }
        .activity-table td {
            padding: 1rem;
            border-bottom: 1px solid #e5e7eb;
            vertical-align: middle;
        }
        .activity-table tbody tr {
            transition: all 0.2s;
        }
        .activity-table tbody tr:hover {
            background: #f8fafb;
        }
        .dark-theme .activity-table thead {
            background: var(--table-header-bg);
        }
        .dark-theme .activity-table th {
            border-bottom-color: var(--border-color);
            color: var(--dark-color);
        }
        .dark-theme .activity-table td {
            border-bottom-color: var(--border-color);
            color: var(--dark-color);
        }
        .dark-theme .activity-table tbody tr:hover {
            background: var(--table-hover-bg);
        }
        .user-cell-small {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        .user-avatar-mini {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--bg-elevated);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-normal);
            font-weight: 600;
            font-size: 0.875rem;
            flex-shrink: 0;
        }
        .action-badge-small {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.375rem 0.75rem;
            border-radius: 6px;
            font-weight: 600;
            font-size: 0.875rem;
        }
        .badge-login {
            background: #dbeafe;
            color: #1e40af;
        }
        .badge-logout {
            background: #f3f4f6;
            color: #6b7280;
        }
        .badge-lesson {
            background: #d1fae5;
            color: #065f46;
        }
        .badge-test {
            background: #fef3c7;
            color: #92400e;
        }
        .badge-profile {
            background: #e0e7ff;
            color: #3730a3;
        }
        .dark-theme .badge-login {
            background: rgba(59, 130, 246, 0.2);
            color: #3b82f6;
        }
        .dark-theme .badge-logout {
            background: rgba(107, 114, 128, 0.2);
            color: #9ca3af;
        }
        .dark-theme .badge-lesson {
            background: rgba(16, 185, 129, 0.2);
            color: #10b981;
        }
        .dark-theme .badge-test {
            background: rgba(245, 158, 11, 0.2);
            color: #f59e0b;
        }
        .dark-theme .badge-profile {
            background: rgba(99, 102, 241, 0.2);
            color: #818cf8;
        }
        .section-card {
            background: var(--bg-elevated);
            border-radius: 12px;
            border: 1px solid var(--border-normal);
            margin-bottom: 2rem;
            overflow: hidden;
            transition: all 0.3s;
        }
        .section-card:hover {
            border: 1px solid var(--border-normal);
        }
        .section-header {
            padding: 1.5rem;
            background: var(--bg-elevated);
            border-bottom: 2px solid #e5e7eb;
        }
        .dark-theme .section-card {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
        }
        .dark-theme .section-header {
            background: var(--table-header-bg);
            border-bottom-color: var(--border-color);
        }
        .section-title {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin: 0;
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--dark-color);
        }
        .section-icon {
            font-size: 1.5rem;
        }
        .empty-state {
            text-align: center;
            padding: 3rem;
            color: var(--gray-color);
        }
        .empty-state-icon {
            font-size: 3rem;
            margin-bottom: 1rem;
            opacity: 0.5;
        }
        @media (max-width: 768px) {
            .page-header-content {
                flex-direction: column;
                text-align: center;
            }
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .quick-actions-grid {
                grid-template-columns: 1fr;
            }
            .activity-table {
                font-size: 0.875rem;
            }
            .activity-table th,
            .activity-table td {
                padding: 0.75rem 0.5rem;
            }
        }
/**
 * Utility classes ? replace inline style attributes
 */

.mt-page { margin-top: var(--space-8); }
.mb-section { margin-bottom: var(--space-8); }
.mb-sm { margin-bottom: var(--space-4); }

.flex-row { display: flex; align-items: center; gap: var(--space-4); }
.flex-row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.flex-col-start { display: flex; flex-direction: column; align-items: flex-start; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-1-min { flex: 1; min-width: 0; }

.card-header-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.card-title-row { display: flex; align-items: center; gap: var(--space-2); }
.card-body-inner { padding: var(--space-2); }

.btn-self-start { align-self: flex-start; }
.btn-icon-row { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: var(--font-weight-semibold); }

.alert-row { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-8); }
.alert-icon { font-size: var(--font-size-xl); flex-shrink: 0; }
.alert-text-bold { font-weight: var(--font-weight-semibold); }

.page-header-content.between { justify-content: space-between; }

/* Language switcher (lessons, tests, etc.) */
.lang-switcher {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-shrink: 0;
}

.lang-btn {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border-normal);
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    font-family: var(--font-sans);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lang-btn:hover {
    background: var(--bg-modifier-hover);
    color: var(--text-normal);
}

.lang-btn.active {
    background: var(--bg-modifier-selected);
    border-color: var(--brand);
    color: var(--brand);
}

/* Progress bar dynamic width ? keep inline width only */
.progress-fill[data-width] {
    width: attr(data-width);
}

/* Text helpers */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.w-full { width: 100%; max-width: 100%; box-sizing: border-box; }

@media (max-width: 768px) {
    .page-header-content.between {
        flex-direction: column;
        align-items: flex-start;
    }

    .lang-switcher {
        width: 100%;
        justify-content: flex-end;
    }
}

/* layout fixes for extracted components */
.lesson-item:hover, .test-item:hover, .stat-card:hover, .action-card:hover, .exam-card:hover, .practice-card:hover, .category-tab:hover { transform: none !important; }
.practice-card-header { background: var(--bg-secondary) !important; color: var(--text-normal) !important; border-bottom: 1px solid var(--border-normal); }
.practice-card-header:hover { background: var(--bg-modifier-hover) !important; }
.practice-info h2, .practice-info p { color: var(--text-normal) !important; }
.badge-category-A { background: #f59e0b; }
.badge-category-B { background: var(--brand); }
.badge-category-C { background: var(--success); }
.badge-category-D { background: #8b5cf6; }
.badge-category-E { background: #ec4899; }
.exam-btn { background: var(--brand) !important; color: var(--text-on-brand) !important; }
.profile-header::before { display: none; }
.profile-avatar { background: var(--brand) !important; border-color: var(--border-normal); box-shadow: none; }
.profile-avatar:hover { transform: none; }

    .page-header-content.between {
        flex-direction: column;
        align-items: flex-start;
    }

    .lang-switcher {
        width: 100%;
        justify-content: flex-end;
    }
}

.exam-card--mistakes {
    border-color: var(--warning) !important;
    background: var(--warning-bg) !important;
}

.exam-card--mistakes .exam-info h2,
.exam-card--mistakes .exam-info p,
.exam-card--mistakes .exam-feature {
    color: var(--text-normal) !important;
}

.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.form-inline-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.form-inline-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.input-narrow {
    width: 100px;
    max-width: 100%;
}

.card-pad {
    padding: var(--space-6);
}

.card-mt {
    margin-top: var(--space-8);
}

.card-highlight {
    border: 2px solid var(--brand) !important;
}

.card-header-brand {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-normal);
}

.card-header-brand .card-title {
    color: var(--text-normal);
}
/**
 * Profile, statistics, test results, admin shared components
 */

/* Profile page */
.session-alert p { margin: 0; }
.session-alert p.note { margin: 0.5rem 0 0; font-size: var(--font-size-sm); }
.form-inline { display: inline; }

.info-card-item.secondary { border-left-color: var(--success); }
.info-card-item.warning { border-left-color: var(--warning); }

.package-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--brand);
    margin-bottom: var(--space-2);
}

.package-badge {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--text-on-brand);
}

.package-badge--premium { background: var(--warning); }
.package-badge--basic { background: var(--brand); }
.package-badge--standard { background: var(--success); }

.package-meta { color: var(--text-muted); font-size: var(--font-size-sm); margin-top: var(--space-2); }
.text-right { text-align: right; }
.text-sm-muted { font-size: var(--font-size-sm); color: var(--text-muted); }
.text-md-semibold { font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.access-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.stats-grid-mt { margin-top: var(--space-8); }
.row-mt { margin-top: var(--space-8); }

.stat-card--purple {
    background: var(--bg-elevated);
    border: 1px solid #8b5cf6;
}

.stat-card--purple .stat-value { color: #8b5cf6; }

.section-title {
    margin-bottom: var(--space-8);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.section-title-lg {
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-md);
    color: var(--text-normal);
}

.category-list { display: grid; gap: var(--space-3); }

.category-badge.is-expired { opacity: 0.6; }
.category-badge .badge-status { margin-left: auto; }

.progress-ring-wrap { padding: var(--space-8); text-align: center; }
.progress-ring-label { margin-top: var(--space-4); color: var(--text-muted); font-weight: var(--font-weight-semibold); }

.stats-detail-box {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-normal);
}

.stats-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.stats-detail-row:last-child { margin-bottom: 0; }

.mini-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.mini-stat-box {
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-normal);
}

.mini-stat-label { font-size: var(--font-size-sm); color: var(--text-muted); margin-bottom: var(--space-2); }
.mini-stat-value { font-size: var(--font-size-2xl); font-weight: var(--font-weight-bold); color: var(--text-normal); }
.mini-stat-value--success { color: var(--success); }

.progress-track {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.progress-track-fill { height: 100%; background: var(--brand); }
.progress-track-fill--success { background: var(--success); }

.activity-list { display: grid; gap: var(--space-4); }

.activity-item-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--brand);
}

.activity-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--brand);
    color: var(--text-on-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-bold);
    flex-shrink: 0;
}

.activity-body { flex: 1; min-width: 0; }
.activity-title { font-weight: var(--font-weight-semibold); color: var(--text-normal); margin-bottom: var(--space-1); }
.activity-meta { font-size: var(--font-size-sm); color: var(--text-muted); }

.activity-scores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    text-align: center;
}

.score-label-sm { font-size: var(--font-size-xs); color: var(--text-muted); margin-bottom: var(--space-1); }

.card-empty { padding: var(--space-8); text-align: center; color: var(--text-muted); }

.card-danger { margin-top: var(--space-8); border-left: 4px solid var(--danger); }
.card-danger .card-header { background: var(--danger-bg); border-bottom: 1px solid var(--danger); }
.card-danger .card-title { color: var(--danger); }

.card-success-accent { margin-top: var(--space-8); border-left: 4px solid var(--success); }
.card-success-accent .card-header { background: var(--success-bg); border-bottom: 1px solid var(--success); }
.card-success-accent .card-title { color: var(--success); }

.error-topic-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--danger);
}

.error-topic-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    color: var(--text-on-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-bold);
    flex-shrink: 0;
}

.error-topic-stats { text-align: right; min-width: 80px; }
.error-rate-bar { margin-top: var(--space-2); height: 4px; background: var(--bg-tertiary); border-radius: 2px; overflow: hidden; width: 80px; margin-left: auto; }

/* Test results */
.result-page-header {
    padding: var(--space-8) 0 var(--space-6);
    margin: 0 0 var(--space-6) 0;
    text-align: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
}

.result-page-header h1 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-2);
}

.result-page-header p { text-align: center; color: var(--text-muted); font-size: var(--font-size-lg); }

.result-page-header--exam { border-color: var(--brand); }
.result-page-header--mistakes { border-color: var(--warning); }
.result-page-header--practice { border-color: var(--success); }

.result-score-card {
    text-align: center;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-8);
    border: 1px solid var(--border-normal);
    color: var(--text-normal);
    background: var(--bg-elevated);
}

.result-score-card.is-passed {
    background: var(--success-bg);
    border-color: var(--success);
}

.result-score-card.is-failed {
    background: var(--danger-bg);
    border-color: var(--danger);
}

.result-score-value { font-size: 4rem; font-weight: var(--font-weight-bold); margin-bottom: var(--space-4); line-height: 1; }
.result-score-status { font-size: var(--font-size-2xl); font-weight: var(--font-weight-semibold); margin-bottom: var(--space-4); }

.result-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.result-stat-box {
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.result-stat-label { font-size: var(--font-size-sm); color: var(--text-muted); margin-bottom: var(--space-2); }
.result-stat-num { font-size: var(--font-size-2xl); font-weight: var(--font-weight-bold); }

.test-layout-pad { padding: var(--space-8); }
.test-nav-bordered { padding: var(--space-6); border-top: 1px solid var(--border-normal); }

.result-actions-bar {
    margin-top: var(--space-8);
    padding: var(--space-8);
    background: var(--bg-elevated);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.answer-checkmark-icon { margin-left: auto; color: var(--success); font-size: var(--font-size-2xl); font-weight: var(--font-weight-bold); }
.answer-wrong-icon { margin-left: auto; color: var(--danger); font-size: var(--font-size-2xl); font-weight: var(--font-weight-bold); }

.explanation-mt { margin-top: var(--space-6); }
.explanation-toggle-mt { margin-top: var(--space-4); }
.video-mt { margin-top: var(--space-4); }
.video-mt-sm { margin-top: var(--space-3); }

/* Lesson page */
.back-link {
    color: var(--brand);
    text-decoration: none;
    margin-bottom: var(--space-4);
    display: inline-block;
    padding: var(--space-2) 0;
    font-size: var(--font-size-md);
}

.lesson-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.lesson-title-row .card-title { margin: 0; flex: 1; min-width: 0; }

.lesson-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #000;
    max-width: 100%;
}

.lesson-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.lesson-desc-box {
    margin-bottom: var(--space-6);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-normal);
}

.lesson-content { line-height: var(--line-height-relaxed); font-size: var(--font-size-lg); word-wrap: break-word; }

.lesson-actions {
    margin-top: var(--space-8);
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.btn-flex { flex: 1; min-width: 150px; text-align: center; }

.form-reset { margin: 0; }

.mb-section-lg { margin-bottom: var(--space-8); }

/* Tests hub extras */
.practice-col { display: flex; flex-direction: column; gap: var(--space-4); flex: 1; }
.test-item-actions { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.input-xs { width: 70px; max-width: 100%; padding: 0.375rem; font-size: var(--font-size-sm); }

.category-badge-small,
.category-badge-large {
    background: var(--badge-color, var(--brand));
}

.category-tab-icon { font-size: var(--font-size-xl); color: var(--badge-color, inherit); }
.category-tab-count { font-size: var(--font-size-sm); opacity: 0.7; margin-left: var(--space-1); }
.category-header-meta { color: var(--text-muted); font-size: var(--font-size-sm); }

/* Admin / manager */
.admin-stat-icon { font-size: var(--font-size-2xl); }
.table-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-4); }
.p-0 { padding: 0; }
.m-0 { margin: 0; }
.hidden { display: none; }
.flex-1 { flex: 1; min-width: 0; }
.flex-col { display: flex; flex-direction: column; }
.flex-end { align-items: flex-end; }
.nowrap { white-space: nowrap; }
.w-100 { width: 100%; max-width: 100%; box-sizing: border-box; }

/* Public exam */
.exam-login-card { max-width: 480px; margin: var(--space-8) auto; }
.cam-preview { max-width: 100%; border-radius: var(--radius-lg); }

.error-topic-row--high { border-left-color: var(--danger); }
.error-topic-row--medium { border-left-color: var(--warning); }
.error-topic-row--low { border-left-color: var(--brand); }

.error-topic-avatar--high { background: var(--danger-bg); color: var(--danger); }
.error-topic-avatar--medium { background: var(--warning-bg, #fef3c7); color: var(--warning); }
.error-topic-avatar--low { background: rgba(88, 101, 242, 0.15); color: var(--brand); }

.error-rate-value--high { color: var(--danger); }
.error-rate-value--medium { color: var(--warning); }
.error-rate-value--low { color: var(--brand); }

.error-rate-fill--high { background: var(--danger); }
.error-rate-fill--medium { background: var(--warning); }
.error-rate-fill--low { background: var(--brand); }

.activity-meta-row { display: flex; gap: var(--space-4); flex-wrap: wrap; }

.text-brand { color: var(--brand); }
.stat-block { margin-bottom: var(--space-6); }

.lesson-content-body {
    line-height: 1.8;
    font-size: var(--font-size-lg);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.lesson-progress-box {
    margin-top: var(--space-8);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-normal);
}

.lesson-actions-row {
    margin-top: var(--space-8);
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.btn-flex-action {
    flex: 1;
    min-width: 150px;
    text-align: center;
}

.lesson-section-mt { margin-bottom: var(--space-8); }

.page-hero-title {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
}

.page-hero-desc {
    margin: 0;
    color: var(--text-muted);
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.card-mb { margin-bottom: var(--space-8); }
.table-mb { margin-bottom: var(--space-8); }
.h3-section { margin-bottom: var(--space-4); }


@media (max-width: 768px) {
    .result-score-value { font-size: 3rem; }
    .result-stats-grid { grid-template-columns: 1fr; }
    .mini-stat-grid { grid-template-columns: 1fr; }
    .lesson-actions { flex-direction: column; }
    .btn-flex { width: 100%; }
}

