/* ============================================
   Creaton — UI Components
   Buttons, Cards, Forms, Tables, Modals, etc.
   ============================================ */

/* ====== BUTTONS ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.625rem 1.25rem;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn i {
    width: 18px;
    height: 18px;
}

/* Primary */
.btn--primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-colored);
}

.btn--primary:hover {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    color: #fff;
}

/* Secondary */
.btn--secondary {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn--secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

/* Danger */
.btn--danger {
    background: var(--danger-500);
    color: #fff;
}

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

/* Success */
.btn--success {
    background: var(--success-500);
    color: #fff;
}

.btn--success:hover {
    background: var(--success-600);
}

/* Ghost */
.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn--ghost:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

/* Sizes */
.btn--sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--text-xs);
}

.btn--lg {
    padding: 0.875rem 1.75rem;
    font-size: var(--text-base);
}

.btn--xl {
    padding: 1rem 2rem;
    font-size: var(--text-lg);
    border-radius: var(--radius-xl);
}

.btn--icon {
    padding: 0.625rem;
    width: 40px;
    height: 40px;
}

.btn--block {
    width: 100%;
}

/* ====== CARDS ====== */
.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.card__header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.card__footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
}

.card__title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0;
}

/* Glass Card */
.card--glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Stat Card */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-base);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
}

.stat-card__icon--primary {
    background: var(--primary-50);
    color: var(--primary-600);
}

.stat-card__icon--success {
    background: var(--success-50);
    color: var(--success-600);
}

.stat-card__icon--warning {
    background: var(--warning-50);
    color: var(--warning-600);
}

.stat-card__icon--danger {
    background: var(--danger-50);
    color: var(--danger-600);
}

.stat-card__icon--info {
    background: var(--info-50);
    color: var(--info-600);
}

.stat-card__value {
    font-size: var(--text-3xl);
    font-weight: 800;
    letter-spacing: var(--tracking-tight);
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.stat-card__label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card__trend {
    font-size: var(--text-xs);
    font-weight: 600;
    margin-top: var(--space-2);
}

.stat-card__trend--up {
    color: var(--success-500);
}

.stat-card__trend--down {
    color: var(--danger-500);
}

/* ====== FORMS ====== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-label span.required {
    color: var(--danger-500);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--surface);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.form-control--error {
    border-color: var(--danger-500);
}

.form-control--error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

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

.form-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--danger-500);
    margin-top: var(--space-1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-size: var(--text-sm);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-600);
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

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

/* ====== BADGES ====== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.125rem 0.625rem;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge--primary {
    background: var(--primary-50);
    color: var(--primary-700);
}

.badge--success {
    background: var(--success-50);
    color: var(--success-600);
}

.badge--danger {
    background: var(--danger-50);
    color: var(--danger-600);
}

.badge--warning {
    background: var(--warning-50);
    color: var(--warning-600);
}

.badge--info {
    background: var(--info-50);
    color: var(--info-600);
}

.badge--default {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ====== TABLES ====== */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background: var(--surface);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table thead {
    background: var(--gray-50);
}

.table th {
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ====== ALERTS / TOAST ====== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
    animation: slideDown 0.3s ease;
}

.alert--success {
    background: var(--success-50);
    color: var(--success-600);
    border: 1px solid var(--success-100);
}

.alert--danger,
.alert--error {
    background: var(--danger-50);
    color: var(--danger-600);
    border: 1px solid var(--danger-100);
}

.alert--warning {
    background: var(--warning-50);
    color: var(--warning-600);
    border: 1px solid var(--warning-100);
}

.alert--info {
    background: var(--info-50);
    color: var(--info-600);
    border: 1px solid var(--info-100);
}

.alert__close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.7;
    background: none;
    border: none;
    font-size: 18px;
    color: inherit;
}

.alert__close:hover {
    opacity: 1;
}

/* Toast container */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    position: relative;
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: bottom right;
    font-size: var(--text-sm);
    color: var(--text-primary);
    overflow: hidden;
    min-width: 320px;
}

[data-theme="dark"] .toast {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

@keyframes toastSlideIn {
    0% {
        transform: translateX(120%) scale(0.9);
        opacity: 0;
    }

    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.toast.toast-hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateX(120%) scale(0.9);
        opacity: 0;
    }
}

.toast__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    margin-top: 2px;
}

.toast__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast__title {
    font-weight: 700;
    font-size: var(--text-sm);
    line-height: var(--leading-tight);
}

.toast__message {
    font-weight: 500;
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
}

.toast__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    margin-top: 2px;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.toast__close:hover {
    opacity: 1;
}

.toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
}

[data-theme="dark"] .toast__progress {
    background: rgba(255, 255, 255, 0.1);
}

.toast__progress-bar {
    height: 100%;
    width: 0%;
    transition: width linear;
}

/* Toast Variants */
.toast--success .toast__icon {
    color: var(--success-500);
    background: var(--success-50);
}

.toast--success .toast__progress-bar {
    background: var(--success-500);
}

.toast--error .toast__icon,
.toast--danger .toast__icon {
    color: var(--danger-500);
    background: var(--danger-50);
}

.toast--error .toast__progress-bar,
.toast--danger .toast__progress-bar {
    background: var(--danger-500);
}

.toast--warning .toast__icon {
    color: var(--warning-500);
    background: var(--warning-50);
}

.toast--warning .toast__progress-bar {
    background: var(--warning-500);
}

.toast--info .toast__icon {
    color: var(--info-500);
    background: var(--info-50);
}

.toast--info .toast__progress-bar {
    background: var(--info-500);
}

/* ====== MODALS ====== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    animation: scaleIn 0.2s ease;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-color);
}

.modal__title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin: 0;
}

.modal__close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.modal__close:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.modal__body {
    padding: var(--space-6);
    overflow-y: auto;
    max-height: 60vh;
}

.modal__footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ====== PAGINATION ====== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-6) 0;
}

.pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.pagination__btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--text-primary);
}

.pagination__btn.active {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-colored);
}

.pagination__btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ====== PROGRESS BAR ====== */
.progress {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress__bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress__bar--success {
    background: var(--gradient-success);
}

.progress__bar--danger {
    background: var(--danger-500);
}

.progress__bar--warning {
    background: var(--warning-500);
}

/* ====== TABS ====== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: var(--space-6);
    overflow-x: auto;
}

.tab {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
}

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

.tab.active {
    color: var(--primary-600);
    border-bottom-color: var(--primary-600);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

/* ====== TOOLTIPS ====== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 500;
    color: #fff;
    background: var(--gray-800);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    z-index: var(--z-dropdown);
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* ====== DROPDOWN ====== */
.dropdown {
    position: relative;
}

.dropdown__menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    padding: var(--space-2);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-dropdown);
    animation: slideDown 0.15s ease;
}

.dropdown__menu.active {
    display: block;
}

.dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    background: none;
    width: 100;
    text-align: left;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.dropdown__item:hover {
    background: var(--gray-50);
    color: var(--text-primary);
}

.dropdown__divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-2) 0;
}

/* ====== AVATARS ====== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.avatar--sm {
    width: 32px;
    height: 32px;
}

.avatar--lg {
    width: 56px;
    height: 56px;
}

.avatar--xl {
    width: 80px;
    height: 80px;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-sm);
    color: #fff;
    background: var(--gradient-primary);
}

/* ====== EMPTY STATE ====== */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-6);
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state__title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.empty-state__text {
    color: var(--text-muted);
    margin-bottom: var(--space-6);
    max-width: 400px;
    margin-inline: auto;
}

/* ====== SPINNER ====== */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-600);
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}

.spinner--sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner--lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* ====== SEARCH BAR ====== */
.search-bar {
    flex-shrink: 0;
}

.search-bar__wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar__icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-bar__input {
    width: 280px;
    padding: 0.65rem 0.875rem 0.65rem 2.75rem;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--surface);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-xl);
    outline: none;
    transition: all var(--transition-fast);
}

.search-bar__input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    width: 340px;
}

@media (max-width: 768px) {

    .search-bar__input,
    .search-bar__input:focus {
        width: 100%;
    }
}

/* ====== FILTER BAR ====== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    padding: var(--space-4) 0;
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-color);
}

.filter-bar__label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: var(--space-1);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.375rem 0.875rem;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--gray-100);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border: 1.5px solid transparent;
}

.filter-chip:hover {
    background: var(--gray-200);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.filter-chip.active {
    background: var(--primary-50);
    color: var(--primary-700);
    border-color: var(--primary-200);
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.12);
}

/* ====== EXAM CARDS ====== */
.exam-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.exam-card:hover {
    box-shadow: 0 12px 40px rgba(79, 70, 229, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-4px);
    border-color: var(--primary-200);
}

.exam-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
}

.exam-card__category {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--primary-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exam-card__body {
    padding: var(--space-5);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.exam-card__title {
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
    margin: 0 0 var(--space-2);
    line-height: 1.3;
}

.exam-card__title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.exam-card__title a:hover {
    color: var(--primary-600);
}

.exam-card__desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 var(--space-4);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.exam-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-top: auto;
}

.exam-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 500;
}

.exam-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
}

.exam-card__teacher {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

/* ====== RESULT SUMMARY ====== */
.result-summary {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    padding: var(--space-8);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    flex-wrap: wrap;
}

.result-stat {
    text-align: center;
    min-width: 100px;
}

.result-stat__value {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-mono);
    letter-spacing: var(--tracking-tight);
    line-height: 1.2;
}

.result-stat__label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: 500;
    margin-top: var(--space-1);
}

/* ====== CHART CONTAINER ====== */
.chart-container {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.chart-container__header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-container__title {
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0;
}

.chart-container canvas {
    padding: var(--space-4);
}

/* ====== PAGE HEADER ====== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.page-header__title {
    font-size: var(--text-2xl);
    font-weight: 800;
    letter-spacing: var(--tracking-tight);
    margin: 0;
    color: var(--text-primary);
}

.page-header__subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: var(--space-1) 0 0;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
    }
}

/* ====== STATS GRID ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

/* ====== EXAM PROGRESS BAR ====== */
.exam-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.exam-progress-bar__fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}