/* ===== NASMO PLATFORM – MAIN STYLESHEET v3 ===== */
/* Colors: White base · #1ebed6 cyan · #ecb830 gold · #317ad6 blue · #1d3956 navy */
@import url('https://fonts.googleapis.com/css2?family=Lateef:wght@200;300;400;500;600;700;800&display=swap');

:root {
    /* Brand palette */
    --cyan:      #1ebed6;
    --cyan-dark: #15a0b8;
    --cyan-light:#6dd8e8;
    --cyan-bg:   #e8f9fc;
    --gold:      #ecb830;
    --gold-dark: #d4a520;
    --gold-light:#f5d060;
    --gold-bg:   #fdf6e0;
    --blue:      #317ad6;
    --blue-dark: #2565bb;
    --blue-light:#6aaaf0;
    --blue-bg:   #e8f0fb;
    --navy:      #1d3956;
    --navy-light:#2a5278;
    --navy-xlight:#3a6b8a;

    /* Semantic */
    --primary:        #1ebed6;
    --primary-dark:   #15a0b8;
    --secondary:      #317ad6;
    --accent:         #ecb830;
    --dark:           #1d3956;

    /* Light theme base */
    --bg:             #f4f7fb;
    --bg-card:        #ffffff;
    --bg-card2:       #f8fafd;
    --border:         #dde4ef;
    --border-strong:  #c0cfe0;
    --text:           #1d3956;
    --text-muted:     #6b84a0;
    --text-light:     #ffffff;

    /* Status */
    --success:   #1ebed6;
    --warning:   #ecb830;
    --danger:    #e05252;
    --green:     #2cb87a;

    --radius:    14px;
    --radius-sm: 8px;
    --shadow:    0 2px 16px rgba(29,57,86,0.09);
    --shadow-md: 0 4px 24px rgba(29,57,86,0.13);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    /* font-family: 'Lateef', 'Scheherazade New', 'Tahoma', serif; */
    font-size: 20px;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    overflow-x: hidden;
    min-height: 100vh;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ===== LAYOUT ===== */
.page-wrap { min-height: 100vh; display: flex; flex-direction: column; }

/* ===== NAVBAR ===== */
.navbar {
    position: sticky; top: 0; z-index: 200;
    background: var(--navy);
    border-bottom: 3px solid var(--cyan);
    padding: 0 1.5rem;
    box-shadow: 0 2px 16px rgba(29,57,86,0.18);
}
.navbar-inner {
    max-width: 1300px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 66px; gap: 1rem;
}
.nav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-logo-mark {
    width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.4rem; font-weight: 700;
    box-shadow: 0 3px 12px rgba(30,190,214,0.4);
}
.nav-logo-text { color: white; font-weight: 700; font-size: 1.2rem; line-height: 1.2; }
.nav-logo-text small { color: var(--cyan-light); font-weight: 400; font-size: 0.85rem; display: block; }

.nav-links { display: flex; align-items: center; gap: 0.2rem; }
.nav-link {
    padding: 7px 15px; border-radius: 50px; font-size: 1.05rem; font-weight: 600;
    color: rgba(255,255,255,0.75); text-decoration: none; transition: all 0.2s;
    display: flex; align-items: center; gap: 7px;
}
.nav-link i { color: var(--cyan-light); font-size: 1rem; }
.nav-link:hover i, .nav-link.active i { color: var(--gold); }
.nav-link:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-link.active { color: white; background: rgba(30,190,214,0.18); }

.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.95rem; color: white; cursor: pointer;
    border: 2px solid rgba(255,255,255,0.25); transition: border-color 0.2s;
}
.nav-avatar:hover { border-color: var(--gold); }
.nav-role-badge {
    padding: 3px 10px; border-radius: 50px; font-size: 0.8rem;
    background: rgba(30,190,214,0.2); border: 1px solid rgba(30,190,214,0.5);
    color: var(--cyan-light); font-weight: 600;
}
.nav-role-badge.teacher { background: rgba(236,184,48,0.2); border-color: rgba(236,184,48,0.5); color: var(--gold-light); }
.nav-toggle { display: none; background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; padding: 8px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 22px; border-radius: 50px; font-size: 0.98rem; font-weight: 600;
    font-family: inherit; cursor: pointer; transition: all 0.2s; text-decoration: none;
    border: none; white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
    color: white; box-shadow: 0 3px 12px rgba(30,190,214,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(30,190,214,0.5); }
.btn-secondary {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: white; box-shadow: 0 3px 12px rgba(49,122,214,0.25);
}
.btn-secondary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(49,122,214,0.4); }
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--navy); box-shadow: 0 3px 12px rgba(236,184,48,0.3);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(236,184,48,0.45); }
.btn-outline {
    background: transparent; color: var(--text-muted);
    border: 1.5px solid var(--border-strong);
}
.btn-outline:hover { color: var(--navy); border-color: var(--navy); background: var(--bg-card2); }
.btn-danger { background: rgba(224,82,82,0.1); color: #c03030; border: 1.5px solid rgba(224,82,82,0.3); }
.btn-danger:hover { background: rgba(224,82,82,0.18); }
.btn-sm  { padding: 5px 14px; font-size: 0.88rem; }
.btn-lg  { padding: 12px 30px; font-size: 1.05rem; }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.w-full { width: 100%; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.card-title { font-size: 1.2rem; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--cyan); font-size: 1.1rem; }

/* ===== STATS GRID ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 1.1rem 1.4rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: var(--shadow); transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 52px; height: 52px; border-radius: 13px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.stat-icon.cyan   { background: var(--cyan-bg);  color: var(--cyan); }
.stat-icon.blue   { background: var(--blue-bg);  color: var(--blue); }
.stat-icon.gold   { background: var(--gold-bg);  color: var(--gold-dark); }
.stat-icon.navy   { background: rgba(29,57,86,0.08); color: var(--navy); }
.stat-icon.green  { background: rgba(44,184,122,0.1); color: var(--green); }
/* fa icon colors by context */
.text-cyan  { color: var(--cyan)  !important; }
.text-gold  { color: var(--gold)  !important; }
.text-blue  { color: var(--blue)  !important; }
.text-navy  { color: var(--navy)  !important; }
.text-green { color: var(--green) !important; }
.text-red   { color: #e05252      !important; }
.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 2.1rem; font-weight: 800; line-height: 1; color: var(--navy); }
.stat-label { font-size: 0.97rem; color: var(--text-muted); margin-top: 3px; }

/* ===== TABLE ===== */
.table-wrap {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap thead th {
    background: var(--navy); padding: 13px 16px; text-align: right;
    font-size: 0.92rem; font-weight: 700; color: white;
}
.table-wrap thead th:first-child { border-radius: 0; }
.table-wrap tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.98rem; vertical-align: middle; }
.table-wrap tbody tr:last-child td { border-bottom: none; }
.table-wrap tbody tr:hover { background: var(--bg-card2); }

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 50px; font-size: 0.82rem; font-weight: 700;
}
.badge-cyan   { background: var(--cyan-bg);  color: var(--cyan-dark);  border: 1px solid rgba(30,190,214,0.3); }
.badge-blue   { background: var(--blue-bg);  color: var(--blue-dark);  border: 1px solid rgba(49,122,214,0.3); }
.badge-gold   { background: var(--gold-bg);  color: var(--gold-dark);  border: 1px solid rgba(236,184,48,0.4); }
.badge-navy   { background: rgba(29,57,86,0.08); color: var(--navy);   border: 1px solid rgba(29,57,86,0.2); }
.badge-green  { background: rgba(44,184,122,0.1); color: #1e8a58;      border: 1px solid rgba(44,184,122,0.3); }
.badge-red    { background: rgba(224,82,82,0.1);  color: #c03030;      border: 1px solid rgba(224,82,82,0.3); }
/* ===== QUIZ NAV BTN (updated colors) ===== */
.quiz-nav-btn {
    width: 40px; height: 40px; border-radius: 8px;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-card2); color: var(--text-muted);
    font-size: 0.88rem; font-weight: 700; cursor: pointer;
    transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.quiz-nav-btn.answered { background: var(--blue-bg); border-color: var(--blue); color: var(--blue-dark); }
.quiz-nav-btn.current  { background: var(--cyan); border-color: var(--cyan-dark); color: white; }
.badge-teal   { background: var(--cyan-bg); color: var(--cyan-dark); border: 1px solid rgba(30,190,214,0.3); }

/* ===== MEDALS ===== */
.medal { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 50px; font-size: 0.88rem; font-weight: 700; }
.medal-platinum { background: linear-gradient(135deg,rgba(120,180,255,0.15),rgba(200,200,255,0.08)); color: #4a90d0; border: 1px solid rgba(120,180,255,0.4); }
.medal-gold     { background: var(--gold-bg); color: var(--gold-dark); border: 1px solid rgba(236,184,48,0.4); }
.medal-silver   { background: rgba(180,180,200,0.15); color: #707090; border: 1px solid rgba(180,180,200,0.4); }
.medal-bronze   { background: rgba(200,130,80,0.12); color: #a06030; border: 1px solid rgba(200,130,80,0.35); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; margin-bottom: 6px; font-size: 0.95rem; font-weight: 600; color: var(--text-muted); }
.form-control {
    width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1.5px solid var(--border);
    color: var(--text); font-family: inherit; font-size: 0.98rem;
    transition: border-color 0.2s, box-shadow 0.2s; outline: none; direction: rtl;
}
.form-control:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(30,190,214,0.15); }
.form-control::placeholder { color: #b0bece; }
select.form-control option { background: white; color: var(--text); }
textarea.form-control { resize: vertical; min-height: 90px; }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 1rem;
    display: flex; align-items: flex-start; gap: 10px; font-size: 0.98rem;
    border-right: 4px solid;
}
.alert-success { background: var(--cyan-bg);  border-color: var(--cyan);  color: var(--cyan-dark); }
.alert-danger   { background: rgba(224,82,82,0.08); border-color: #e05252; color: #c03030; }
.alert-warning  { background: var(--gold-bg);  border-color: var(--gold);  color: var(--gold-dark); }
.alert-info     { background: var(--blue-bg);  border-color: var(--blue);  color: var(--blue-dark); }

/* ===== LEADERBOARD ===== */
.leaderboard-item {
    display: flex; align-items: center; gap: 1rem;
    padding: 12px 16px; border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.leaderboard-item:hover { background: var(--bg-card2); }
.leaderboard-rank {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem;
}
.rank-1 { background: linear-gradient(135deg,#f0c040,#d49000); color: white; }
.rank-2 { background: linear-gradient(135deg,#c0c0d0,#909090); color: white; }
.rank-3 { background: linear-gradient(135deg,#d09060,#a06030); color: white; }
.rank-other { background: var(--bg-card2); color: var(--text-muted); border: 1px solid var(--border); }
.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-name { font-weight: 700; font-size: 1rem; color: var(--navy); }
.leaderboard-meta { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.leaderboard-score { font-size: 1.5rem; font-weight: 800; color: var(--cyan-dark); text-align: left; min-width: 60px; }
.leaderboard-score small { font-size: 0.75rem; color: var(--text-muted); display: block; font-weight: 400; }

/* ===== PROGRESS ===== */
.progress { background: var(--border); border-radius: 50px; height: 7px; overflow: hidden; }
.progress-bar {
    height: 100%; border-radius: 50px;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    transition: width 0.6s ease;
}
.progress-bar.gold  { background: linear-gradient(90deg, var(--gold), var(--gold-dark)); }
.progress-bar.green { background: linear-gradient(90deg, var(--green), #1ebed6); }

/* ===== FILIÈRE CARDS ===== */
.filiere-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.1rem; }
.filiere-card {
    background: var(--bg-card); border: 1.5px solid var(--border);
    border-radius: var(--radius); padding: 1.4rem; cursor: pointer;
    transition: all 0.22s; text-decoration: none; display: block;
    position: relative; overflow: hidden;
}
.filiere-card::before {
    content: ''; position: absolute; top: 0; right: 0;
    width: 80px; height: 80px;
    background: radial-gradient(circle at top right, rgba(30,190,214,0.1), transparent 70%);
    border-radius: 0 var(--radius) 0 100%;
}
.filiere-card:hover { border-color: var(--cyan); transform: translateY(-3px); box-shadow: 0 8px 28px rgba(30,190,214,0.15); }
.filiere-num {
    font-size: 2.5rem; font-weight: 800; line-height: 1; margin-bottom: 0.4rem;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.filiere-name  { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: 0.3rem; }
.filiere-meta  { font-size: 0.85rem; color: var(--text-muted); display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.filiere-meta span { display: flex; align-items: center; gap: 4px; }
.filiere-status { position: absolute; top: 13px; left: 13px; width: 9px; height: 9px; border-radius: 50%; }
.status-done     { background: var(--green); box-shadow: 0 0 7px rgba(44,184,122,0.6); }
.status-progress { background: var(--gold); box-shadow: 0 0 7px rgba(236,184,48,0.6); }
.status-locked   { background: var(--border-strong); }

/* ===== QUIZ OPTIONS ===== */
.quiz-question-text { font-size: 1.12rem; font-weight: 700; margin-bottom: 1.1rem; line-height: 1.65; color: var(--navy); }
.quiz-options { display: flex; flex-direction: column; gap: 0.6rem; }
.quiz-option {
    padding: 12px 16px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: var(--bg-card2);
    cursor: pointer; transition: all 0.18s; display: flex; align-items: center; gap: 12px;
}
.quiz-option:hover  { border-color: var(--cyan); background: var(--cyan-bg); }
.quiz-option.selected { border-color: var(--cyan); background: var(--cyan-bg); }
.quiz-option.correct  { border-color: var(--green); background: rgba(44,184,122,0.08); color: #1e7a48; }
.quiz-option.wrong    { border-color: #e05252; background: rgba(224,82,82,0.07); color: #c03030; }
.quiz-option-letter {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: var(--navy); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.88rem;
}

/* ===== PDF VIEWER ===== */
.pdf-viewer-wrap {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; height: 78vh; display: flex; flex-direction: column;
    box-shadow: var(--shadow);
}
.pdf-toolbar {
    background: var(--navy); padding: 9px 14px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.pdf-toolbar span { color: var(--cyan-light); font-weight: 700; }
.pdf-frame { flex: 1; width: 100%; border: none; background: #f4f4f4; }

/* ===== AUTH PAGE ===== */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem; background: linear-gradient(150deg, var(--navy) 0%, #254a6e 50%, #1d3956 100%);
}
.auth-card {
    width: 100%; max-width: 430px;
    background: white; border-radius: var(--radius);
    padding: 2.5rem; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo-mark {
    width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 2rem; font-weight: 700;
    box-shadow: 0 6px 22px rgba(30,190,214,0.4);
}
.auth-title    { font-size: 1.7rem; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.auth-subtitle { color: var(--text-muted); font-size: 0.95rem; }
.auth-divider {
    text-align: center; color: var(--text-muted); font-size: 0.88rem; margin: 1.25rem 0;
    position: relative;
}
.auth-divider::before { content:''; position:absolute; top:50%; right:0; left:0; height:1px; background:var(--border); }
.auth-divider span { background: white; padding: 0 1rem; position: relative; }

/* ===== DASHBOARD ===== */
.dash-header { padding: 1.75rem 0 1.25rem; }
.dash-greeting { font-size: 1.9rem; font-weight: 800; color: var(--navy); margin-bottom: 0.2rem; }
.dash-greeting span { color: var(--cyan-dark); }
.dash-sub { color: var(--text-muted); font-size: 1.05rem; }
.section-title {
    font-size: 1.25rem; font-weight: 800; color: var(--navy);
    margin-bottom: 1.1rem; display: flex; align-items: center; gap: 8px;
    padding-bottom: 0.6rem; border-bottom: 2px solid var(--border);
}
.section-title i { color: var(--cyan); font-size: 1.1rem; }

/* ===== ACTIVITY ===== */
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.dot-cyan   { background: var(--cyan); }
.dot-blue   { background: var(--blue); }
.dot-gold   { background: var(--gold); }
.dot-green  { background: var(--green); }
.dot-navy   { background: var(--navy); }
/* compat */
.dot-teal   { background: var(--cyan); }
.dot-purple { background: var(--blue); }
.dot-sand   { background: var(--gold); }
.activity-body { flex: 1; }
.activity-text { font-size: 0.95rem; color: var(--text); }
.activity-time { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

/* ===== ONLINE INDICATOR ===== */
.online-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; color: var(--green); }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pdot 2s infinite; }
@keyframes pdot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.8)} }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; padding: 0 1.5rem 3rem; }
.container { max-width: 1300px; margin: 0 auto; }

/* ===== COMPETE BANNER ===== */
.compete-banner {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    border-radius: var(--radius); padding: 1.4rem 1.75rem; margin-bottom: 2rem;
    display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
    color: white; box-shadow: var(--shadow-md);
}
.compete-banner-icon { font-size: 2.2rem; }
.compete-banner-body { flex: 1; }
.compete-banner-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 0.2rem; color: white; }
.compete-banner-text  { color: rgba(255,255,255,0.75); font-size: 0.92rem; }

/* ===== PUBLISH TOGGLE ===== */
.publish-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 13px; border-radius: 50px; font-size: 0.85rem; font-weight: 700;
    cursor: pointer; border: none; font-family: inherit; transition: all 0.2s;
}
.publish-toggle.published   { background: rgba(44,184,122,0.12); color: #1e8a58; border: 1px solid rgba(44,184,122,0.35); }
.publish-toggle.unpublished { background: var(--bg-card2); color: var(--text-muted); border: 1px solid var(--border); }

/* ===== EXAM TIMER BANNER ===== */
.exam-timer-banner {
    position: sticky; top: 66px; z-index: 100;
    background: var(--navy); color: white;
    padding: 10px 1.5rem; text-align: center;
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    border-bottom: 3px solid var(--gold); box-shadow: 0 3px 14px rgba(29,57,86,0.2);
    flex-wrap: wrap;
}
.exam-timer-display {
    font-size: 2.2rem; font-weight: 800; letter-spacing: 2px;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}
.exam-timer-display.danger { color: #e05252; animation: blink 1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.5} }
.exam-timer-label { font-size: 0.95rem; color: rgba(255,255,255,0.75); }

/* ===== COMMENT / Q&A ===== */
.qa-list { display: flex; flex-direction: column; gap: 1rem; }
.qa-item {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
}
.qa-item.teacher-reply {
    background: var(--cyan-bg); border-color: rgba(30,190,214,0.3);
    margin-right: 2rem;
}
.qa-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 0.5rem; flex-wrap: wrap; }
.qa-author { font-weight: 700; color: var(--navy); font-size: 0.95rem; }
.qa-time   { font-size: 0.82rem; color: var(--text-muted); }
.qa-badge-teacher { background: var(--gold-bg); color: var(--gold-dark); border: 1px solid rgba(236,184,48,0.4); padding: 2px 8px; border-radius: 50px; font-size: 0.75rem; font-weight: 700; }
.qa-text   { color: var(--text); font-size: 0.98rem; line-height: 1.6; }
.qa-actions { margin-top: 0.6rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.qa-reply-form { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }

/* ===== FOOTER ===== */
footer {
    text-align: center; padding: 1.25rem; color: var(--text-muted); font-size: 0.88rem;
    border-top: 1px solid var(--border); background: var(--bg-card);
}

/* ===== MOBILE DRAWER ===== */
.mobile-drawer { display: none; position: fixed; inset: 0; z-index: 300; }
.mobile-drawer.open { display: flex; }
.drawer-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.drawer-panel {
    position: relative; z-index: 1; width: 270px; max-width: 85vw;
    margin-right: auto; background: var(--navy); height: 100%;
    padding: 2rem 1.25rem; display: flex; flex-direction: column; gap: 0.35rem;
    border-left: 1px solid rgba(255,255,255,0.1); box-shadow: 4px 0 24px rgba(0,0,0,0.3);
}
.drawer-close { position: absolute; top: 1rem; left: 1rem; background: none; border: none; color: rgba(255,255,255,0.6); font-size: 1.4rem; cursor: pointer; }
.drawer-link {
    display: flex; align-items: center; gap: 11px; padding: 11px 13px;
    border-radius: var(--radius-sm); color: rgba(255,255,255,0.7);
    text-decoration: none; font-size: 0.98rem; font-weight: 500; transition: all 0.2s;
}
.drawer-link:hover, .drawer-link.active { background: rgba(255,255,255,0.1); color: white; }
.drawer-link.active { color: var(--cyan-light); }
.drawer-link i { width: 18px; text-align: center; color: var(--cyan-light); }

/* ===== UTILITIES ===== */
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}.mb-4{margin-bottom:2rem}
.flex{display:flex}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}
.gap-1{gap:.5rem}.gap-2{gap:1rem}
.grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}
.text-center{text-align:center}.text-muted{color:var(--text-muted)}.text-success{color:var(--green)}.text-danger{color:#c03030}
.font-bold{font-weight:700}.rounded{border-radius:var(--radius-sm)}.rounded-full{border-radius:50px}

/* ===== RESPONSIVE ===== */
@media(max-width:900px){
    .nav-links{display:none}
    .nav-toggle{display:flex}
    .stats-grid{grid-template-columns:repeat(2,1fr)}
    .grid-3{grid-template-columns:1fr}
}
@media(max-width:600px){
    body{font-size:18px}
    .navbar-inner{height:58px}
    .stats-grid{grid-template-columns:1fr 1fr}
    .card{padding:1rem}
    .auth-card{padding:1.5rem 1.1rem}
    .dash-greeting{font-size:1.4rem}
    .main-content{padding:0 .9rem 2rem}
    .compete-banner{padding:1rem;flex-direction:column;text-align:center}
    .table-wrap{overflow-x:auto}
    .grid-2{grid-template-columns:1fr}
    .filiere-grid{grid-template-columns:1fr}
    .pdf-viewer-wrap{height:58vh}
    .exam-timer-display{font-size:1.7rem}
}
@media(max-width:400px){
    .stats-grid{grid-template-columns:1fr}
}

/* ── Gold progress bar ── */
.progress-bar.gold { background: linear-gradient(90deg, var(--gold), var(--gold-dark)); }

/* ── Score color helpers ── */
.score-high   { color: var(--green) !important; }
.score-mid    { color: var(--gold-dark) !important; }
.score-low    { color: #e05252 !important; }
