/* Tayssir Academy — Espace Étudiant Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
    --primary: #0f766e;
    --primary-dark: #0d5c56;
    --primary-light: #14b8a6;
    --accent: #b45309;
    --accent-light: #fbbf24;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --success: #059669;
    --success-bg: #ecfdf5;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --info: #2563eb;
    --info-bg: #eff6ff;
    --sidebar-width: 280px;
    --header-height: 64px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 20px 40px -12px rgba(15, 23, 42, 0.15);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body.student-app {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--surface-2);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─── */
.student-shell {
    display: flex;
    min-height: 100vh;
}

.student-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, #0f766e 0%, #134e4a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
    overflow: hidden;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    backdrop-filter: blur(8px);
}

.sidebar-logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text h1 {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-brand-text span {
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.nav-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.5;
    padding: 0.75rem 0.75rem 0.375rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-link.active {
    background: rgba(255,255,255,0.18);
    color: white;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.nav-link.active svg { opacity: 1; }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.6875rem;
    opacity: 0.6;
}

.student-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.student-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    color: var(--text);
}

.menu-toggle:hover { background: var(--surface-3); }

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.page-breadcrumb {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.student-content {
    flex: 1;
    min-width: 0;
    padding: 1.5rem;
    max-width: 1400px;
    width: 100%;
}

/* ─── Cards ─── */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.card-header h2, .card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.card-body { padding: 1.5rem; }

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--surface-2);
}

/* ─── Stat Cards ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card--teal::before { background: var(--primary); }
.stat-card--green::before { background: var(--success); }
.stat-card--red::before { background: var(--danger); }
.stat-card--amber::before { background: var(--warning); }
.stat-card--blue::before { background: var(--info); }
.stat-card--purple::before { background: #7c3aed; }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg { width: 22px; height: 22px; }

.stat-icon--teal { background: #ccfbf1; color: var(--primary); }
.stat-icon--green { background: var(--success-bg); color: var(--success); }
.stat-icon--red { background: var(--danger-bg); color: var(--danger); }
.stat-icon--amber { background: var(--warning-bg); color: var(--warning); }
.stat-icon--blue { background: var(--info-bg); color: var(--info); }
.stat-icon--purple { background: #f3e8ff; color: #7c3aed; }

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.125rem;
}

/* ─── Hero / Banner ─── */
.hero-banner {
    background: linear-gradient(135deg, #0f766e 0%, #134e4a 50%, #1e3a5f 100%);
    border-radius: var(--radius-xl);
    padding: 2rem;
    color: white;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-banner h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    position: relative;
}

.hero-banner p {
    opacity: 0.85;
    font-size: 0.9375rem;
    max-width: 600px;
    position: relative;
}

.hero-motivation {
    opacity: 1 !important;
    font-size: 0.875rem !important;
    font-weight: 600;
    font-style: italic;
    color: #fde68a;
    margin-bottom: 0.75rem !important;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
    position: relative;
}

.hero-tag {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

/* ─── Next Course Widget ─── */
.next-course {
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.5s ease;
}

.next-course--upcoming { background: linear-gradient(135deg, #ecfdf5, #f0fdfa); border-color: #99f6e4; }
.next-course--soon { background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fcd34d; }
.next-course--urgent { background: linear-gradient(135deg, #fef2f2, #fee2e2); border-color: #fca5a5; }
.next-course--live { background: linear-gradient(135deg, #fef3c7, #fde68a); border-color: #fbbf24; animation: pulse-border 2s infinite; }

@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(251, 191, 36, 0); }
}

.next-course-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
    min-width: 0;
}

.next-course-grid > * {
    min-width: 0;
}

.countdown {
    text-align: center;
    min-width: 160px;
}

.countdown-time {
    font-size: 2.25rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.countdown-label {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.course-info-box {
    background: white;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    min-width: 0;
}

.course-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.375rem;
    word-break: break-word;
}

.course-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.course-meta span {
    min-width: 0;
    word-break: break-word;
}

/* ─── Grid Layouts ─── */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

/* ─── Course List Items ─── */
.course-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    transition: background var(--transition);
}

.course-item:last-child { border-bottom: none; }

.course-item:hover { background: var(--surface-2); margin: 0 -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; }

.course-time {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover { background: var(--surface-2); }

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--surface-3); color: var(--text-muted); }

/* ─── Notice Strips (notifications compactes) ─── */
.notice-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.notice-strip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    line-height: 1.3;
    text-decoration: none;
    border: 1px solid transparent;
}

.notice-strip svg { width: 17px; height: 17px; flex-shrink: 0; }

.notice-strip span:not(.notice-link) { flex: 1; }

.notice-strip--danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.25);
    font-weight: 600;
}

.notice-strip--info {
    background: var(--info-bg);
    color: var(--info);
    font-weight: 500;
}

.notice-strip--warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: rgba(217, 119, 6, 0.25);
    font-weight: 500;
}

.notice-strip--success {
    background: var(--success-bg);
    color: var(--success);
    font-weight: 500;
}

.notice-link {
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: underline;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--surface-3); }

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover { background: #b91c1c; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem;
}

.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-sm { padding: 0.4375rem 0.875rem; font-size: 0.8125rem; }

.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

.btn-block { width: 100%; }

/* ─── Forms ─── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.form-label .required { color: var(--danger); }

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--danger);
    margin-top: 0.25rem;
}

/* ─── Alerts ─── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--info-bg); color: #1e40af; border: 1px solid #bfdbfe; }

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--surface-3);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.empty-state-icon svg { width: 32px; height: 32px; }

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* ─── Grade Display ─── */
.grade-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 auto 1rem;
    border: 4px solid;
}

.grade-circle--pass { background: var(--success-bg); color: var(--success); border-color: #6ee7b7; }
.grade-circle--fail { background: var(--danger-bg); color: var(--danger); border-color: #fca5a5; }

/* ─── Progress Ring ─── */
.progress-ring-wrap {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-ring-wrap svg { transform: rotate(-90deg); }

.progress-ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 6; }
.progress-ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.progress-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
}

/* ─── Modal ─── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 1.125rem; font-weight: 700; }

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 8px;
    color: var(--text-muted);
    transition: all var(--transition);
}

.modal-close:hover { background: var(--surface-3); color: var(--text); }

.modal-body { padding: 1.5rem; }

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ─── Info Box ─── */
.info-box {
    background: var(--info-bg);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.info-box h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 0.75rem;
}

.payment-method {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    border-left: 4px solid;
    margin-bottom: 0.75rem;
}

.payment-method--wave { border-color: #3b82f6; }
.payment-method--orange { border-color: #f97316; }
.payment-method--mtn { border-color: #fbbf24; }

/* ─── Resource Cards ─── */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.resource-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.resource-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.resource-card-title {
    font-weight: 700;
    font-size: 0.9375rem;
}

.resource-card-course {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ─── Course Cards (for courses/programs pages) ─── */
.item-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all var(--transition);
}

.item-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.item-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
}

.item-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* ─── Vote Cards ─── */
.vote-day {
    position: relative;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.vote-day:hover { border-color: var(--primary-light); background: var(--surface-2); }

.vote-day.selected {
    border-color: var(--primary);
    background: #f0fdfa;
}

.vote-bar {
    height: 8px;
    background: var(--surface-3);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.vote-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 999px;
    transition: width 0.6s ease;
}

/* ─── Profile ─── */
.profile-header {
    background: linear-gradient(135deg, #0f766e, #134e4a);
    border-radius: var(--radius-xl);
    padding: 2rem;
    color: white;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.profile-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.profile-grade-badge {
    margin-left: auto;
    text-align: center;
    background: rgba(255,255,255,0.15);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
}

.profile-grade-badge .stat-value { color: white; }
.profile-grade-badge .stat-label { color: rgba(255,255,255,0.7); }

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.info-row:last-child { border-bottom: none; }

.info-row-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.info-row-value {
    font-size: 0.875rem;
    font-weight: 600;
    text-align: right;
}

/* ─── Login Page ─── */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.login-brand-panel {
    background: linear-gradient(135deg, #0f766e 0%, #134e4a 50%, #1e3a5f 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::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%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-brand-content { position: relative; max-width: 420px; }

.login-brand-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.15;
}

.login-brand-content p {
    opacity: 0.85;
    font-size: 1.0625rem;
    line-height: 1.7;
}

.login-features {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    opacity: 0.9;
}

.login-feature-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--surface-2);
}

.login-form-container {
    width: 100%;
    max-width: 420px;
}

.login-form-container h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.375rem;
}

.login-form-container > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-checkbox input { width: auto; accent-color: var(--primary); }

.form-checkbox label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ─── Sidebar Overlay (mobile) ─── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

/* ─── Quick Actions ─── */
.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.125rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all var(--transition);
}

.quick-action:hover {
    border-color: var(--primary);
    background: #f0fdfa;
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.quick-action svg { width: 18px; height: 18px; color: var(--primary); }

.quick-action.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.quick-action.active svg { color: white; }

/* ─── CTA Banner ─── */
.cta-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.cta-banner h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e40af;
}

.cta-banner p {
    font-size: 0.875rem;
    color: #3b82f6;
    margin-top: 0.25rem;
}

/* ─── Vote day groups ─── */
.day-group {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: all var(--transition);
}

.day-group:hover { border-color: var(--primary-light); }

.time-slots-container label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--surface);
}

.time-slots-container label:hover {
    border-color: var(--primary);
    background: #f0fdfa;
}

.time-slots-container input[type="radio"]:checked + div,
.time-slots-container label:has(input:checked) {
    border-color: var(--primary);
    background: #f0fdfa;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .student-sidebar {
        transform: translateX(-100%);
    }

    .student-sidebar.open {
        transform: translateX(0);
    }

    .student-main {
        margin-left: 0;
    }

    .menu-toggle { display: flex; }

    .login-page {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .student-content { padding: 1rem; }

    .student-header { padding: 0 0.75rem; gap: 0.5rem; }
    .header-left { min-width: 0; gap: 0.5rem; }
    .header-left > div { min-width: 0; }
    .page-title { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page-breadcrumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .header-actions { flex-shrink: 0; }
    .header-actions .btn { padding: 0.5rem 0.75rem; font-size: 0.75rem; gap: 0.375rem; }
    .header-actions .btn svg { width: 15px; height: 15px; }

    .next-course-grid {
        grid-template-columns: 1fr;
    }

    .next-course { padding: 1rem; margin-bottom: 1rem; }
    .course-info-box { padding: 0.75rem 1rem; }

    .countdown { min-width: auto; }
    .countdown-time { font-size: 1.75rem; }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.625rem;
    }

    .stat-card { padding: 0.875rem; gap: 0.625rem; }
    .stat-icon { width: 36px; height: 36px; border-radius: 10px; }
    .stat-icon svg { width: 18px; height: 18px; }
    .stat-value { font-size: 1.375rem; }
    .stat-label { font-size: 0.75rem; }

    .card-header { padding: 1rem 1.125rem; }
    .card-body { padding: 1.125rem; }

    .hero-banner { padding: 1.25rem; margin-bottom: 1.25rem; }
    .hero-banner h2 { font-size: 1.25rem; }
    .hero-banner p { font-size: 0.875rem; }

    .quick-actions { gap: 0.5rem; margin-bottom: 1.25rem; }
    .quick-action { padding: 0.625rem 0.875rem; font-size: 0.75rem; }

    .profile-header { flex-direction: column; text-align: center; }
    .profile-grade-badge { margin-left: 0; }

    .data-table thead { display: none; }

    .data-table tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 0.75rem;
        background: var(--surface);
    }

    .data-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-light);
    }

    .data-table tbody td:last-child { border-bottom: none; }

    .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        margin-right: 1rem;
    }
}

@media (max-width: 480px) {
    .student-content { padding: 0.75rem; }

    /* Garde 2 colonnes (plutôt que 1) pour rester compact sur petit écran */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .stat-card { padding: 0.75rem; }
    .stat-value { font-size: 1.25rem; }

    .grid-2 { grid-template-columns: 1fr; gap: 1rem; }

    .hero-banner { padding: 1rem; }
    .hero-banner p:not(.hero-motivation) { display: none; }

    .hero-tags {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-top: 0.75rem;
        padding-bottom: 0.125rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .hero-tags::-webkit-scrollbar { display: none; }
    .hero-tag { flex: 0 0 auto; white-space: nowrap; }

    .quick-actions { justify-content: space-between; }
    .quick-action { flex: 1 1 calc(50% - 0.25rem); justify-content: center; }
}
