/* ===================== RESET & BASE ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #0F766E;
    --primary-dark: #0B5A54;
    --primary-light: #5EEAD4;
    --secondary: #134E4A;
    --accent: #F59E0B;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --dark: #0F172A;
    --dark-2: #1E293B;
    --dark-3: #334155;
    --text: #1E293B;
    --text-2: #475569;
    --text-3: #94A3B8;
    --border: #E2E8F0;
    --bg: #F8FAFC;
    --bg-2: #F1F5F9;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: .2s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    font-size: 15px;
}

/* ===================== NAVBAR ===================== */
.navbar {
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 24px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--dark);
    font-weight: 700;
    font-size: 16px;
    transition: opacity var(--transition);
}
.navbar-brand:hover { opacity: .8; }

.brand-logo svg { width: 36px; height: 36px; }
.brand-text { white-space: nowrap; line-height: 1.35; }
.brand-text small { display: block; font-size: 11px; font-weight: 500; color: var(--text-2); }

.navbar-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-link:hover { background: var(--bg-2); color: var(--primary); }

.nav-logout { color: var(--danger); }
.nav-logout:hover { background: #FEF2F2; color: var(--danger); }

.nav-cta {
    background: var(--primary);
    color: white !important;
    box-shadow: 0 2px 8px rgba(15,118,110,.35);
}
.nav-cta:hover { background: var(--primary-dark) !important; color: white !important; transform: translateY(-1px); }

/* ===================== MAIN ===================== */
.main-content { flex: 1; padding: 32px 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===================== ALERTS ===================== */
.alerts-wrapper { margin-bottom: 24px; display: flex; flex-direction: column; gap: 10px; }

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    animation: slideDown .3s ease;
    transition: opacity .3s;
    border: 1px solid transparent;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.alert-icon {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}

.alert-success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.alert-success .alert-icon { background: #10B981; color: white; }
.alert-danger { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.alert-danger .alert-icon { background: var(--danger); color: white; }
.alert-warning { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.alert-warning .alert-icon { background: var(--warning); color: white; }
.alert-info { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.alert-info .alert-icon { background: #3B82F6; color: white; }

.alert span { flex: 1; }
.alert-close {
    background: none; border: none; cursor: pointer;
    font-size: 18px; color: inherit; opacity: .6;
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    border-radius: 4px; transition: opacity var(--transition);
}
.alert-close:hover { opacity: 1; }

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none; cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px; font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(15,118,110,.3); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,118,110,.4); }

.btn-success { background: var(--success); color: white; box-shadow: 0 2px 8px rgba(16,185,129,.3); }
.btn-success:hover { background: #059669; transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: white; box-shadow: 0 2px 8px rgba(239,68,68,.3); }
.btn-danger:hover { background: #DC2626; transform: translateY(-1px); }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #D97706; }

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

.btn-ghost { background: var(--bg-2); color: var(--text-2); }
.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ===================== FORM ===================== */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; margin-bottom: 7px;
    font-size: 13px; font-weight: 600;
    color: var(--text-2);
    letter-spacing: .01em;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    transition: all var(--transition);
    outline: none;
    direction: rtl;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}
.form-control::placeholder { color: var(--text-3); }

.form-row { display: flex; gap: 12px; align-items: flex-start; }
.form-row .form-control { flex: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

/* ===================== BADGE ===================== */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px; font-weight: 600;
    letter-spacing: .02em;
}
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-secondary { background: var(--bg-2); color: var(--text-2); }

/* ===================== CARDS ===================== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.card-header h2 { font-size: 17px; font-weight: 700; color: var(--dark); }
.card-body { padding: 24px; }

.section-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}
.section-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
}
.section-card-header h2 {
    font-size: 16px; font-weight: 700;
    color: var(--dark);
    display: flex; align-items: center; gap: 8px;
}
.section-card-body { padding: 24px; }

/* ===================== TABLE ===================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table thead tr {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
}
.admin-table th {
    padding: 14px 16px;
    text-align: right;
    font-weight: 600;
    font-size: 13px;
    color: rgba(255,255,255,.85);
    white-space: nowrap;
    letter-spacing: .02em;
}
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--bg-2);
    vertical-align: middle;
    color: var(--text);
}
.admin-table tbody tr { transition: background var(--transition); }
.admin-table tbody tr:hover { background: var(--bg); }
.admin-table tbody tr:last-child td { border-bottom: none; }

/* ===================== INDEX PAGE ===================== */
.hero {
    min-height: 85vh;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0F172A 0%, #134E4A 55%, #0F766E 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 60px;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content {
    position: relative; z-index: 1;
    text-align: center;
    padding: 60px 24px;
    max-width: 700px;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius-full);
    padding: 8px 18px;
    font-size: 13px; font-weight: 500;
    color: rgba(255,255,255,.85);
    margin-bottom: 28px;
}
.hero h1 {
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -.02em;
}
.hero h1 span {
    background: linear-gradient(135deg, #5EEAD4, #FBBF24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 17px;
    color: rgba(255,255,255,.65);
    margin-bottom: 40px;
    line-height: 1.8;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn { padding: 14px 30px; font-size: 15px; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}
.feature-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.feature-card::before {
    content: '';
    position: absolute; top: 0; right: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card:hover::before { opacity: 1; }
.feature-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(15,118,110,.1), rgba(245,158,11,.12));
}
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; color: var(--dark); }
.feature-card p { font-size: 14px; color: var(--text-2); line-height: 1.7; }

/* ===================== AUTH ===================== */
.auth-wrapper {
    min-height: calc(100vh - 160px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%; max-width: 480px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-icon {
    width: 64px; height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 20px rgba(15,118,110,.35);
}
.auth-icon svg { width: 30px; height: 30px; color: white; }
.auth-header h2 { font-size: 22px; font-weight: 800; color: var(--dark); margin-bottom: 8px; }
.auth-header p { font-size: 14px; color: var(--text-2); }

.auth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 24px 0; color: var(--text-3); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-2); }
.auth-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ===================== DASHBOARD ===================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
}
.user-profile-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    position: sticky; top: 84px;
}
.profile-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 32px 24px;
    text-align: center;
    position: relative;
}
.profile-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    border: 3px solid rgba(255,255,255,.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 800;
    color: white; margin: 0 auto 14px;
    backdrop-filter: blur(8px);
}
.profile-header h2 { font-size: 18px; font-weight: 700; color: white; margin-bottom: 6px; }
.profile-header p { font-size: 13px; color: rgba(255,255,255,.7); }

.profile-body { padding: 20px; }
.profile-info-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-2);
    font-size: 13px;
}
.profile-info-item:last-child { border-bottom: none; }
.info-label { color: var(--text-3); min-width: 90px; font-weight: 500; }
.info-value { color: var(--text); font-weight: 600; }

.status-indicator {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600;
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
}
.status-dot.approved { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.pending { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.status-dot.rejected { background: var(--danger); box-shadow: 0 0 6px var(--danger); }

/* ===================== EXAM ===================== */
.exam-page {
    max-width: 900px;
    margin: 0 auto;
}
.exam-topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.exam-progress-wrap { flex: 1; }
.exam-progress-label {
    display: flex; justify-content: space-between;
    font-size: 13px; color: var(--text-2); margin-bottom: 8px; font-weight: 500;
}
.progress-track {
    height: 8px; background: var(--border);
    border-radius: var(--radius-full); overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    transition: width .5s ease;
}
.exam-timer {
    display: flex; align-items: center; gap: 8px;
    background: var(--white); border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 18px;
    font-size: 20px; font-weight: 800;
    color: var(--dark);
    font-variant-numeric: tabular-nums;
    box-shadow: var(--shadow-sm);
    min-width: 100px; justify-content: center;
}
.exam-timer.warning { border-color: var(--warning); color: var(--warning); }
.exam-timer.danger { border-color: var(--danger); color: var(--danger); animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.question-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.question-card::before {
    content: '';
    position: absolute; top: 0; right: 0; left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.question-num {
    font-size: 12px; font-weight: 700; letter-spacing: .08em;
    color: var(--primary); text-transform: uppercase;
    margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
}
.question-text {
    font-size: 20px; font-weight: 700;
    color: var(--dark); line-height: 1.6;
}

/* FACE FRAME */
.video-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.video-stage {
    position: relative;
    background: #0F172A;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    max-height: 420px;
    margin-bottom: 16px;
}
#preview, #recorded {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}
#recorded { display: none; }

.face-frame {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    width: min(240px, 40%);
    aspect-ratio: 3/4;
    pointer-events: none;
    z-index: 5;
}
.face-frame-inner {
    width: 100%; height: 100%;
    border: 2.5px dashed rgba(94,234,212,.75);
    border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
    box-shadow:
        0 0 0 1px rgba(15,118,110,.2),
        inset 0 0 40px rgba(15,118,110,.05);
    animation: faceFramePulse 3s ease-in-out infinite;
}
@keyframes faceFramePulse {
    0%,100% { border-color: rgba(94,234,212,.75); box-shadow: 0 0 0 1px rgba(15,118,110,.2), inset 0 0 40px rgba(15,118,110,.05); }
    50% { border-color: rgba(251,191,36,.9); box-shadow: 0 0 0 2px rgba(245,158,11,.3), inset 0 0 50px rgba(245,158,11,.1); }
}
.face-frame-label {
    position: absolute;
    bottom: -28px; left: 50%;
    transform: translateX(-50%);
    font-size: 11px; font-weight: 600;
    color: rgba(255,255,255,.7);
    white-space: nowrap;
    text-align: center;
    letter-spacing: .04em;
    background: rgba(0,0,0,.5);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.rec-indicator {
    position: absolute; top: 12px; right: 12px;
    display: flex; align-items: center; gap: 6px;
    background: rgba(0,0,0,.7);
    border-radius: var(--radius-full);
    padding: 5px 12px;
    font-size: 12px; font-weight: 600;
    color: white; z-index: 10;
}
.rec-dot {
    width: 8px; height: 8px;
    background: var(--danger); border-radius: 50%;
    animation: recPulse 1s infinite;
}
@keyframes recPulse { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.video-overlay {
    position: absolute; inset: 0;
    background: rgba(15,23,42,.85);
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius);
    z-index: 4;
}
.video-overlay-inner { text-align: center; color: white; }
.camera-icon-large {
    width: 64px; height: 64px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    border: 2px dashed rgba(255,255,255,.3);
}
.camera-icon-large svg { width: 28px; height: 28px; }
.video-overlay-inner p { font-size: 14px; color: rgba(255,255,255,.7); }

.video-controls {
    display: flex; gap: 12px; flex-wrap: wrap;
    justify-content: center;
}
.video-controls .btn { min-width: 130px; justify-content: center; }

/* ===================== TRIAL ===================== */
.trial-page { max-width: 800px; margin: 0 auto; }
.trial-header { text-align: center; margin-bottom: 32px; }
.trial-header h1 { font-size: 26px; font-weight: 800; color: var(--dark); margin-bottom: 10px; }
.trial-header p { font-size: 15px; color: var(--text-2); }

.trial-questions { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.trial-q-item {
    background: var(--bg-2);
    border-radius: var(--radius);
    padding: 16px 20px;
    border: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.trial-q-num {
    width: 28px; height: 28px;
    background: var(--primary); color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.trial-q-text { font-size: 15px; font-weight: 500; color: var(--text); }

/* ===================== ADMIN ===================== */
.admin-header {
    margin-bottom: 32px;
}
.admin-title {
    font-size: 26px; font-weight: 800; color: var(--dark);
    margin-bottom: 6px;
}
.admin-subtitle { font-size: 14px; color: var(--text-2); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
    transition: all var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::after {
    content: '';
    position: absolute; bottom: 0; right: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0; transition: opacity var(--transition);
}
.stat-card:hover::after { opacity: 1; }
.stat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px; font-size: 18px;
}
.stat-num {
    font-size: 28px; font-weight: 800;
    color: var(--dark); line-height: 1;
    margin-bottom: 6px;
}
.stat-label { font-size: 13px; color: var(--text-2); font-weight: 500; }

.stat-card.s-total .stat-icon { background: #EFF6FF; }
.stat-card.s-pending .stat-icon { background: #FFFBEB; }
.stat-card.s-approved .stat-icon { background: #ECFDF5; }
.stat-card.s-done .stat-icon { background: #F5F3FF; }

.user-list-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.user-list-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg);
}
.user-list-header h2 { font-size: 16px; font-weight: 700; color: var(--dark); }

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    flex-shrink: 0;
}
.user-avatar.lg {
    width: 60px; height: 60px;
    font-size: 22px;
}

.user-name { font-weight: 600; font-size: 14px; }
.user-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Admin User Detail */
.user-detail-hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    display: flex; align-items: center; gap: 24px;
    color: white;
}
.user-detail-info h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.user-detail-info p { font-size: 14px; color: rgba(255,255,255,.6); margin-bottom: 4px; }

.grading-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.grading-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow); }
.grading-card-header {
    padding: 16px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.grading-q-num {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.grading-q-text { font-size: 15px; font-weight: 600; color: var(--dark); flex: 1; }
.grading-card-body { padding: 20px; }

.score-input-row {
    display: flex; align-items: center; gap: 12px;
    margin-top: 16px; flex-wrap: wrap;
}
.score-input {
    width: 80px; text-align: center;
    font-size: 18px; font-weight: 700;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    font-family: 'Vazirmatn', sans-serif;
    transition: border-color var(--transition);
}
.score-input:focus { border-color: var(--primary); outline: none; }

.score-display {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    background: #D1FAE5; color: #065F46;
    border-radius: var(--radius-full);
    font-size: 15px; font-weight: 800;
}

.answer-video-wrap {
    position: relative;
    background: #0F172A;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
}
.answer-video-wrap video {
    width: 100%; max-height: 280px;
    display: block; border-radius: var(--radius);
}

/* Question bank */
.question-bank-grid {
    display: flex; flex-direction: column; gap: 12px;
}
.question-bank-item {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px 20px;
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px;
    transition: all var(--transition);
}
.question-bank-item:hover { border-color: var(--primary-light); background: var(--bg); }
.qb-text { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.6; }
.qb-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.qb-actions { display: flex; gap: 8px; flex-shrink: 0; }

.assign-form { display: flex; gap: 10px; align-items: center; }
.assign-select {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    background: var(--white);
    color: var(--text);
    direction: rtl;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    flex: 1;
}
.assign-select:focus { border-color: var(--primary); }

/* ===================== EMPTY STATE ===================== */
.empty-state {
    text-align: center; padding: 60px 24px;
    color: var(--text-2);
}
.empty-icon {
    width: 80px; height: 80px;
    background: var(--bg-2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}
.empty-icon svg { width: 36px; height: 36px; color: var(--text-3); }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 300px; margin: 0 auto; }

/* ===================== FOOTER ===================== */
.footer {
    border-top: 1px solid var(--border);
    background: var(--white);
    margin-top: auto;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-3);
}
.footer-brand { font-weight: 600; color: var(--text-2); }

/* ===================== UTILITIES ===================== */
.hidden { display: none !important; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-3); font-size: 13px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .user-profile-card { position: static; }
    .form-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .navbar-container { padding: 0 16px; }
    .container { padding: 0 16px; }
    .auth-card { padding: 28px 20px; }
    .user-detail-hero { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 26px; }
    .navbar-links .nav-link span { display: none; }
}
