@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;500;600;700;800;900&display=swap');

/**
 * AqlSkill Duolingo 2.5D Design System
 * Theme-aware via CSS variables from SiteSetting::buildThemeCss()
 */

html, body, input, button, select, textarea, [lang="ar"], .font-sans, .font-tech {
    font-family: 'Alexandria', 'Cairo', sans-serif !important;
}

/* ── Semantic tokens (derived from theme) ── */
:root {
    --duo-radius: 14px;
    --duo-radius-sm: 10px;
    --duo-radius-lg: 18px;
    --duo-depth: 4px;
    --duo-success: #58CC02;
    --duo-success-dark: #46A302;
    --duo-danger: #FF4B4B;
    --duo-danger-dark: #D33131;
    --duo-warning: #FFC800;
    --duo-warning-dark: #E5A800;
    --duo-info: #58CC02;
    --duo-info-dark: #46A302;
    --duo-overlay: color-mix(in srgb, var(--bg-main) 15%, rgba(0, 0, 0, 0.75));
    --duo-input-bg: color-mix(in srgb, var(--card-bg) 92%, var(--border-color));
    --duo-stat-indigo: #58CC02;
    --duo-stat-emerald: #46A302;
    --duo-stat-orange: #78C800;
    --duo-stat-red: var(--duo-danger);
}

/* ── Legacy Tailwind → theme mapping (panel-wide) ── */
[data-theme] .bg-slate-950,
[data-theme] .bg-slate-950\/80 { background-color: var(--duo-overlay) !important; }
[data-theme] .bg-slate-900 { background-color: var(--card-bg) !important; }
[data-theme] .bg-slate-800,
[data-theme] .bg-slate-800\/50,
[data-theme] .bg-slate-800\/20 { background-color: var(--duo-input-bg) !important; }
[data-theme] .bg-slate-700,
[data-theme] .bg-slate-700\/50 { background-color: color-mix(in srgb, var(--border-color) 40%, var(--card-bg)) !important; }
[data-theme] .border-slate-700,
[data-theme] .border-slate-700\/50,
[data-theme] .border-slate-600 { border-color: var(--border-color) !important; }

/* 1. General text-white adapts to theme (--text-main) for titles, headings, and body text */
[data-theme] .text-white { color: var(--text-main) !important; }

/* 2. Inputs, textareas, selects always use --text-main for high contrast in light/dark themes */
[data-theme] input,
[data-theme] select,
[data-theme] textarea,
[data-theme] input.text-white,
[data-theme] select.text-white,
[data-theme] textarea.text-white {
    color: var(--text-main) !important;
}

/* 3. Solid filled buttons, links, and badges keep crisp #ffffff white text */
.duo-btn-primary,
.duo-btn-accent,
.duo-btn-danger,
[data-theme] button.bg-indigo-600,
[data-theme] button.bg-indigo-500,
[data-theme] button.bg-emerald-600,
[data-theme] button.bg-emerald-500,
[data-theme] button.bg-red-600,
[data-theme] button.bg-red-500,
[data-theme] button.bg-green-600,
[data-theme] a.bg-indigo-600,
[data-theme] a.bg-indigo-500,
[data-theme] a.bg-emerald-600,
[data-theme] a.bg-emerald-500,
[data-theme] a.bg-red-600,
[data-theme] a.bg-red-500,
[data-theme] .bg-indigo-600,
[data-theme] .bg-indigo-500,
[data-theme] .bg-emerald-600,
[data-theme] .bg-emerald-500,
[data-theme] .bg-red-600,
[data-theme] .bg-red-500,
[data-theme] .bg-green-600,
[data-theme] .bg-blue-600,
[data-theme] .bg-purple-600 {
    color: #ffffff !important;
}

[data-theme] .text-slate-300 { color: color-mix(in srgb, var(--text-main) 85%, var(--text-muted)) !important; }
[data-theme] .text-slate-400,
[data-theme] .text-slate-500,
[data-theme] .text-slate-600 { color: var(--text-muted) !important; }
[data-theme] .bg-indigo-600,
[data-theme] .bg-indigo-500 { background-color: var(--primary) !important; }
[data-theme] .hover\:bg-indigo-500:hover { background-color: color-mix(in srgb, var(--primary) 85%, white) !important; }
[data-theme] .text-indigo-400,
[data-theme] .text-indigo-300 { color: var(--text-active) !important; }
[data-theme] .border-indigo-500,
[data-theme] .border-indigo-400\/50,
[data-theme] .border-indigo-500\/20 { border-color: color-mix(in srgb, var(--primary) 50%, var(--border-color)) !important; }
[data-theme] .bg-indigo-500\/10,
[data-theme] .bg-indigo-500\/15 { background-color: var(--nav-bg-active) !important; }
[data-theme] .focus\:border-indigo-500:focus { border-color: var(--text-active) !important; }
[data-theme] .accent-indigo-500 { accent-color: var(--primary) !important; }
[data-theme] .from-indigo-500 { --tw-gradient-from: var(--primary) !important; }
[data-theme] .to-purple-600 { --tw-gradient-to: var(--accent) !important; }
[data-theme] .shadow-indigo-500\/20 { --tw-shadow-color: color-mix(in srgb, var(--primary) 25%, transparent) !important; }

/* ── Page shell (Scaled down for optimal 100% zoom) ── */
.duo-page {
    padding: 0.85rem;
    color: var(--text-main);
}
@media (min-width: 768px) {
    .duo-page { padding: 1rem 1.25rem; }
}

.duo-page-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.duo-page-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* ── 2.5D Cards ── */
.duo-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--duo-radius);
    box-shadow: 0 3px 0 var(--border-color);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.duo-card:hover {
    transform: translateY(-2px);
}
.duo-card-flat {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--duo-radius);
}

.duo-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (min-width: 768px) {
    .duo-stat-grid { grid-template-columns: repeat(4, 1fr); }
}
.duo-stat {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--duo-radius);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 0 var(--border-color);
    transition: transform 0.15s ease;
}
.duo-stat:hover {
    transform: translateY(-2px);
}
.duo-stat-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--duo-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    border: 2px solid transparent;
    border-bottom-width: 3px;
}
.duo-stat-icon.primary { background: var(--nav-bg-active); color: var(--text-active); border-bottom-color: var(--nav-border-active); }
.duo-stat-icon.success { background: color-mix(in srgb, var(--duo-success) 15%, transparent); color: var(--duo-success); border-bottom-color: var(--duo-success-dark); }
.duo-stat-icon.warning { background: color-mix(in srgb, var(--duo-warning) 15%, transparent); color: var(--duo-warning-dark); border-bottom-color: var(--duo-warning-dark); }
.duo-stat-icon.danger { background: color-mix(in srgb, var(--duo-danger) 15%, transparent); color: var(--duo-danger); border-bottom-color: var(--duo-danger-dark); }
.duo-stat-value { font-size: 1.15rem; font-weight: 900; color: var(--text-main); line-height: 1.1; }
.duo-stat-label { font-size: 0.65rem; font-weight: 700; color: var(--text-muted); }

/* ── 2.5D Buttons ── */
.duo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 800;
    border-radius: var(--duo-radius);
    border: 2px solid transparent;
    border-bottom-width: var(--duo-depth);
    cursor: pointer;
    transition: transform 0.08s ease, border-bottom-width 0.08s ease, margin-top 0.08s ease, filter 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.duo-btn:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
    margin-top: 2px;
}
.duo-btn-primary {
    background: #58CC02 !important;
    color: #FFFFFF !important;
    border-color: #58CC02 !important;
    border-bottom-color: #46A302 !important;
    box-shadow: 0 4px 0 #46A302 !important;
}
.duo-btn-primary:hover {
    background: #61E002 !important;
    filter: brightness(1.04);
}
.duo-btn-secondary {
    background: #E5F8D0 !important;
    color: #2B7000 !important;
    border-color: #58CC02 !important;
    border-bottom-color: #46A302 !important;
    box-shadow: 0 4px 0 #46A302 !important;
}
.duo-btn-accent {
    background: #FF9600 !important;
    color: #FFFFFF !important;
    border-bottom-color: #E08400 !important;
    box-shadow: 0 4px 0 #E08400 !important;
}
.duo-btn-ghost {
    background: var(--card-bg);
    color: var(--text-main);
    border-color: var(--border-color);
    border-bottom-color: var(--border-color);
}
.duo-btn-danger {
    background: var(--duo-danger);
    color: #fff;
    border-bottom-color: var(--duo-danger-dark);
}
.duo-btn-sm { padding: 0.4rem 0.75rem; font-size: 0.75rem; border-radius: var(--duo-radius-sm); }
.duo-btn-lg { padding: 0.7rem 1.25rem; font-size: 0.95rem; }
.duo-btn-icon {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: var(--duo-radius-sm);
}

/* ── Inputs ── */
.duo-input,
.duo-select,
.duo-textarea {
    width: 100%;
    background: var(--duo-input-bg);
    border: 2px solid var(--border-color);
    border-bottom-width: 3px;
    border-radius: var(--duo-radius);
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s;
}
.duo-input:focus,
.duo-select:focus,
.duo-textarea:focus {
    border-color: var(--text-active);
}
.duo-input::placeholder { color: var(--text-muted); }
.duo-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Table ── */
.duo-table-wrap {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--duo-radius-lg);
    box-shadow: 0 var(--duo-depth) 0 var(--border-color);
    overflow: hidden;
}
.duo-table {
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-main);
    text-align: right;
}
.duo-table thead {
    background: color-mix(in srgb, var(--bg-main) 60%, var(--border-color));
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.duo-table th,
.duo-table td { padding: 0.65rem 1rem; }
.duo-table tbody tr {
    border-bottom: 2px solid var(--border-color);
    transition: background 0.12s;
}
.duo-table tbody tr:hover { background: var(--nav-bg-active); }
.duo-table tbody tr:last-child { border-bottom: none; }

/* ── Badges ── */
.duo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    border: 2px solid transparent;
    border-bottom-width: 2px;
}
.duo-badge-success { background: color-mix(in srgb, var(--duo-success) 12%, transparent); color: var(--duo-success); border-color: color-mix(in srgb, var(--duo-success) 25%, transparent); border-bottom-color: var(--duo-success-dark); }
.duo-badge-danger { background: color-mix(in srgb, var(--duo-danger) 12%, transparent); color: var(--duo-danger); border-color: color-mix(in srgb, var(--duo-danger) 25%, transparent); border-bottom-color: var(--duo-danger-dark); }
.duo-badge-primary { background: var(--nav-bg-active); color: var(--text-active); border-color: var(--nav-border-active); }
.duo-badge-warning { background: color-mix(in srgb, var(--duo-warning) 15%, transparent); color: var(--duo-warning-dark); border-color: color-mix(in srgb, var(--duo-warning) 30%, transparent); }

/* ── Modals (fixed overflow) ── */
.duo-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--duo-overlay);
    backdrop-filter: blur(4px);
}
.duo-modal {
    width: 100%;
    max-width: 28rem;
    max-height: min(90vh, 720px);
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--duo-radius-lg);
    box-shadow: 0 8px 0 var(--border-color);
    overflow: hidden;
}
.duo-modal.duo-modal-lg { max-width: 36rem; }
.duo-modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border-color);
}
.duo-modal-title {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--text-main);
}
.duo-modal-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--duo-radius-sm);
    color: var(--text-muted);
    background: transparent;
    border: 2px solid var(--border-color);
    border-bottom-width: 3px;
    cursor: pointer;
    transition: color 0.12s, background 0.12s;
}
.duo-modal-close:hover { color: var(--text-main); background: var(--nav-bg-active); }
.duo-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    min-height: 0;
}
.duo-modal-footer {
    flex-shrink: 0;
    padding: 0.85rem 1.25rem 1.25rem;
    border-top: 2px solid var(--border-color);
    background: color-mix(in srgb, var(--card-bg) 95%, var(--border-color));
}

/* ── Permission chips ── */
.duo-check-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    background: var(--duo-input-bg);
    border: 2px solid var(--border-color);
    border-bottom-width: 3px;
    border-radius: var(--duo-radius);
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.duo-check-card:hover { border-color: var(--text-active); }
.duo-check-card input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.duo-check-card span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
}

/* ── Empty state ── */
.duo-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    border: 2px dashed var(--border-color);
    border-radius: var(--duo-radius-lg);
    background: color-mix(in srgb, var(--card-bg) 80%, var(--bg-main));
}
.duo-empty i { font-size: 2.5rem; opacity: 0.2; margin-bottom: 0.75rem; }
.duo-empty p { color: var(--text-muted); font-weight: 700; }

/* ── Alert ── */
.duo-alert {
    padding: 0.65rem 1rem;
    border-radius: var(--duo-radius);
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid transparent;
    border-bottom-width: 3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
        .duo-alert-success { background: color-mix(in srgb, var(--duo-success) 12%, transparent); color: var(--duo-success); border-color: color-mix(in srgb, var(--duo-success) 30%, transparent); border-bottom-color: var(--duo-success-dark); }

/* Stat icon legacy tailwind colors */
[data-theme] .bg-indigo-500\/15 { background: var(--nav-bg-active) !important; }
[data-theme] .text-indigo-400 { color: var(--text-active) !important; }
[data-theme] .bg-emerald-500\/15 { background: color-mix(in srgb, var(--duo-success) 15%, transparent) !important; }
[data-theme] .text-emerald-400 { color: var(--duo-success) !important; }
[data-theme] .bg-orange-500\/15 { background: color-mix(in srgb, var(--secondary) 15%, transparent) !important; }
[data-theme] .text-orange-400 { color: var(--secondary) !important; }
[data-theme] .bg-red-500\/15 { background: color-mix(in srgb, var(--duo-danger) 15%, transparent) !important; }
[data-theme] .text-red-400 { color: var(--duo-danger) !important; }
[data-theme] .bg-pink-500\/10 { background: color-mix(in srgb, var(--accent) 12%, transparent) !important; }
[data-theme] .text-pink-400 { color: var(--accent) !important; }
[data-theme] .bg-blue-500\/10 { background: var(--nav-bg-active) !important; }
[data-theme] .text-blue-400 { color: var(--text-active) !important; }

/* Wide data tables + inline student directory */
.duo-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.duo-table.students-table { min-width: 120rem; table-layout: auto; }
.duo-table.students-table th,
.duo-table.students-table td { padding: 0.75rem 1rem; vertical-align: middle; white-space: nowrap; }
.duo-table.students-table .col-student { min-width: 13rem; white-space: nowrap; }
.duo-table.students-table .col-phone { min-width: 9.5rem; }
.duo-table.students-table .col-stage { min-width: 11rem; }
.duo-table.students-table .col-group { min-width: 18rem; }
.duo-table.students-table .col-type { min-width: 7.5rem; }
.duo-table.students-table .col-devices { min-width: 5.5rem; }
.duo-table.students-table .col-balance { min-width: 7rem; }
.duo-table.students-table .col-attendance { min-width: 6.5rem; }
.duo-table.students-table .col-exam-avg { min-width: 10rem; }
.duo-table.students-table .col-attempts { min-width: 8rem; }
.duo-table.students-table .col-streak { min-width: 4.5rem; }
.duo-table.students-table .col-status { min-width: 8.5rem; }
.duo-table.students-table .col-joined { min-width: 8.5rem; }
.duo-table.students-table .col-actions { min-width: 18rem; width: 18rem; }

.stu-dir-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stu-th-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    color: var(--text-muted);
    font-weight: 800;
}
.stu-th-icon {
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.45rem;
    background: var(--nav-bg-active);
    color: var(--text-active);
    font-size: 0.68rem;
    flex-shrink: 0;
}
.stu-dir-table .col-streak .stu-th-icon { background: color-mix(in srgb, #f97316 15%, transparent); }
.stu-inline {
    cursor: pointer; border-bottom: 1px dashed transparent; padding: 2px 6px; margin: -2px -6px;
    border-radius: 6px; display: inline-block; white-space: nowrap;
}
.stu-inline:hover { background: var(--nav-bg-active); border-bottom-color: var(--text-active); color: var(--text-active); }
.stu-inline-input {
    width: 100%; min-width: 110px; padding: 4px 8px; font-size: 0.82rem; font-weight: 700;
    border: 1.5px solid var(--text-active); border-radius: 8px; background: var(--card-bg); color: var(--text-main); outline: none;
}
.stu-perf { width: 56px; height: 6px; background: rgba(0,0,0,0.12); border-radius: 999px; overflow: hidden; display: inline-block; vertical-align: middle; }
.stu-perf-fill { display: block !important; height: 100%; background: #58CC02; background: linear-gradient(90deg, var(--primary, #1CB0F6), var(--secondary, #58CC02)); border-radius: 999px; }
.stu-status { padding: 2px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: 800; display: inline-flex; }
.stu-status--on { background: color-mix(in srgb, var(--secondary) 18%, transparent); color: var(--secondary); }
.stu-status--off { background: color-mix(in srgb, #ef4444 15%, transparent); color: #ef4444; }
.stu-actions-inline {
    display: flex; flex-direction: row; flex-wrap: nowrap; gap: 4px; align-items: center; justify-content: flex-start;
}
.stu-act-form { display: inline-flex; margin: 0; padding: 0; flex-shrink: 0; }
.stu-act {
    width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-muted); font-size: 0.72rem;
    transition: all 0.15s; flex-shrink: 0; cursor: pointer; text-decoration: none; padding: 0;
}
.stu-act:hover { border-color: var(--text-active); color: var(--text-active); background: var(--nav-bg-active); }
.stu-act--danger:hover { border-color: #ef4444; color: #ef4444; }
.stu-avatar { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border-color); }

/* Teacher directory toolbar */
.stu-dir-toolbar {
    position: relative;
    z-index: 10;
    overflow: visible;
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: 0 4px 0 color-mix(in srgb, var(--border-color) 80%, transparent);
}
.stu-dir-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}
.stu-dir-search {
    position: relative;
    flex: 1 1 14rem;
    min-width: 0;
}
.stu-dir-search__icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    inset-inline-end: 0.85rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    pointer-events: none;
}
.stu-dir-search__input {
    width: 100%;
    padding-inline: 0.85rem 2.25rem !important;
}
.stu-dir-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}
.stu-dir-badge {
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 900;
    min-width: 1.05rem;
    height: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0 0.25rem;
}
.stu-dir-badge--muted {
    background: var(--text-active);
}
.stu-dir-filter-panel {
    margin-top: 0.85rem;
    border-radius: 0.85rem;
    border: 1px solid var(--border-color);
    background: var(--nav-bg-active);
    overflow: hidden;
}
.stu-dir-filter-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}
.stu-dir-filter-panel__body {
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.stu-dir-filter-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
}
.stu-dir-filter-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}
.stu-preset-chip {
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--nav-bg-active);
    color: var(--text-main);
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
}
.stu-preset-chip:hover {
    border-color: var(--text-active);
    color: var(--text-active);
    background: color-mix(in srgb, var(--text-active) 10%, transparent);
}
.stu-filter-row {
    display: grid;
    grid-template-columns: auto minmax(7rem, 1.2fr) minmax(5rem, 0.7fr) minmax(6rem, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}
@media (max-width: 768px) {
    .stu-filter-row {
        grid-template-columns: 1fr 1fr;
    }
    .stu-filter-input--val { grid-column: 1 / -1; }
    .stu-filter-remove { justify-self: end; }
}
.stu-filter-where {
    font-size: 0.72rem;
    font-weight: 900;
    color: var(--text-muted);
    padding-inline: 0.25rem;
    white-space: nowrap;
}
.stu-filter-input {
    width: 100%;
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 0.55rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    outline: none;
}
.stu-filter-input:focus { border-color: var(--text-active); }
.stu-filter-remove {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    border: 1px solid color-mix(in srgb, #ef4444 30%, var(--border-color));
    background: color-mix(in srgb, #ef4444 8%, var(--card-bg));
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.stu-filter-remove:hover {
    background: color-mix(in srgb, #ef4444 15%, var(--card-bg));
}
.stu-dir-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}
.stu-dir-count {
    margin-top: 0.65rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
}
.stu-dir-count strong { color: var(--text-active); }
.stu-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    background: color-mix(in srgb, var(--text-active) 12%, transparent);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.stu-filter-chip button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0 0.1rem;
}
.stu-filter-chip button:hover { color: #ef4444; }
.stu-col-move {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 0.35rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.stu-col-move:hover:not(:disabled) { border-color: var(--text-active); color: var(--text-active); }
.stu-dir-col-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}
.stu-dir-col-panel {
    position: relative;
    width: min(92vw, 24rem);
    max-height: min(80vh, 34rem);
    padding: 0;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.stu-dir-col-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.stu-dir-col-close {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    border: 1px solid var(--border-color);
    background: var(--nav-bg-active);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.stu-dir-col-close:hover { color: var(--text-main); border-color: var(--text-active); }
.stu-dir-col-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 0.5rem;
}
.stu-dir-col-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem;
    border-radius: 0.55rem;
}
.stu-dir-col-item:hover { background: var(--nav-bg-active); }
.duo-table.students-table .col-exam-score { min-width: 7rem; }
.duo-table.students-table .col-highest { min-width: 6.5rem; }
.duo-table.students-table .col-video { min-width: 7rem; }
.duo-table.students-table .col-enrollments { min-width: 6rem; }

/* Course unlock / payment modal */
.course-pay-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.course-pay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}
.course-pay-modal {
    position: relative;
    z-index: 1;
    width: min(96vw, 26rem);
    max-height: min(92vh, 40rem);
    overflow-y: auto;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 1.25rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.course-pay-close {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    border: 1px solid var(--border-color);
    background: var(--nav-bg-active);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.course-pay-hero { text-align: center; padding: 0.5rem 0 1rem; }
.course-pay-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 0.75rem;
    border-radius: 999px;
    border: 3px solid #1CB0F6;
    background: color-mix(in srgb, #1CB0F6 12%, transparent);
    color: #1CB0F6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 5px 0 #1899D6;
}
.course-pay-title { font-size: 1.35rem; font-weight: 900; color: var(--text-main); }
.course-pay-sub { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); margin-top: 0.25rem; }
.course-pay-price-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.85rem;
    border-radius: 1rem;
    background: var(--nav-bg-active);
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}
.course-pay-divider { width: 1px; height: 2.5rem; background: var(--border-color); }
.course-pay-label { font-size: 0.65rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; }
.course-pay-value { font-size: 1.25rem; font-weight: 900; color: var(--text-main); }
.course-pay-value--green { color: #58CC02; }
.course-pay-validity {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.65rem;
    background: color-mix(in srgb, #FF9600 10%, transparent);
}
.course-pay-methods { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 0.85rem; }
.course-pay-method {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 0.85rem;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    text-align: right;
    cursor: pointer;
    transition: all 0.15s;
}
.course-pay-method--active {
    border-color: #1CB0F6;
    background: color-mix(in srgb, #1CB0F6 8%, var(--card-bg));
    box-shadow: 0 3px 0 #1899D6;
}
.course-pay-method--disabled { opacity: 0.55; cursor: not-allowed; }
.course-pay-method__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.course-pay-method__icon--kashier { background: color-mix(in srgb, #1CB0F6 15%, transparent); color: #1CB0F6; }
.course-pay-method__icon--fawry { background: color-mix(in srgb, #FF9600 15%, transparent); color: #FF9600; }
.course-pay-method__icon--coupon { background: color-mix(in srgb, #CE82FF 15%, transparent); color: #CE82FF; }
.course-pay-method__icon--wallet { background: color-mix(in srgb, #58CC02 15%, transparent); color: #58CC02; }
.course-pay-method__text { flex: 1; min-width: 0; }
.course-pay-method__text strong { display: block; font-size: 0.78rem; font-weight: 900; color: var(--text-main); }
.course-pay-method__text small { display: block; font-size: 0.65rem; font-weight: 700; color: var(--text-muted); margin-top: 0.1rem; }
.course-pay-method__check { color: #1CB0F6; opacity: 0; font-size: 0.9rem; }
.course-pay-method--active .course-pay-method__check { opacity: 1; }
.course-pay-soon {
    font-size: 0.62rem;
    font-weight: 900;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: var(--nav-bg-active);
    color: var(--text-muted);
}
.course-pay-coupon { margin-bottom: 0.85rem; }
.course-pay-input {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    border: 2px solid var(--border-color);
    background: var(--nav-bg-active);
    color: var(--text-main);
    font-weight: 800;
    text-align: center;
    font-family: ui-monospace, monospace;
    text-transform: uppercase;
    outline: none;
}
.course-pay-input:focus { border-color: #1CB0F6; }
.course-pay-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.course-pay-submit {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border: none;
    background: #1CB0F6;
    color: #fff;
    font-weight: 900;
    font-size: 0.95rem;
    box-shadow: 0 5px 0 #1899D6;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: transform 0.1s;
}
.course-pay-submit:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #1899D6; }
.course-pay-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.course-pay-cancel {
    width: 100%;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 800;
    cursor: pointer;
    border-radius: 0.75rem;
}
.course-pay-cancel:hover { background: var(--nav-bg-active); }
