:root {
    --primary: #0f172a;
    --accent: #0284c7;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Layout Responsive */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: white;
    height: 100vh;
    position: fixed;
    transition: 0.3s ease;
    z-index: 1000;
}

.main-stage {
    flex: 1;
    margin-inline-start: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header & Actions */
.header-pro {
    height: 70px;
    background: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-actions { display: flex; align-items: center; gap: 1.5rem; }

/* Profile & Dropdown */
.user-profile { position: relative; cursor: pointer; }
.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--border);
}

.dropdown-menu {
    position: absolute;
    top: 55px;
    right: 0;
    width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    display: none;
    overflow: hidden;
}

[dir="rtl"] .dropdown-menu { right: auto; left: 0; }
.dropdown-menu.active { display: block; animation: slideUp 0.2s ease; }

.dropdown-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
}
.dropdown-item:hover { background: #f8fafc; color: var(--accent); }

/* Notifications */
.notif-wrapper { position: relative; cursor: pointer; color: var(--text-muted); }
.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    [dir="rtl"] .sidebar { transform: translateX(100%); }
    .main-stage { margin-inline-start: 0; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ajoutez ceci à la fin de style.css */

/* État d'affichage pour le JS */
.dropdown-box.show {
    display: block;
    animation: slideUp 0.2s ease;
}

/* Structure du dropdown (correction des noms) */
.dropdown-box {
    position: absolute;
    top: 55px;
    right: 0;
    width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    display: none; /* Caché par défaut */
    overflow: hidden;
    z-index: 1001;
}

/* Support RTL pour le dropdown */
[dir="rtl"] .dropdown-box {
    right: auto;
    left: 0;
}

/* Style des liens dans le menu */
.dropdown-link {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
}

.dropdown-link:hover {
    background: #f8fafc;
    color: var(--accent);
}

.dropdown-header {
    padding: 12px 16px;
    font-weight: bold;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Correction Image */
.user-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--border);
}

.user-trigger {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

/* Ajoutez ceci à votre style.css */

/* Classe cruciale pour l'activation via JS */
.dropdown-box.show {
    display: block !important;
    animation: slideUp 0.2s ease forwards;
}

/* On harmonise avec les noms utilisés dans dashboard.php */
.dropdown-box {
    position: absolute;
    top: 60px;
    right: 0;
    width: 250px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    display: none; /* Caché par défaut */
    z-index: 1001;
    overflow: hidden;
}

[dir="rtl"] .dropdown-box {
    right: auto;
    left: 0;
}

/* Styles pour le contenu des menus */
.dropdown-header {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dropdown-link {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.2s;
}

.dropdown-link:hover {
    background: var(--bg-body);
    color: var(--accent);
}


/* --- Style des Tableaux Modernes --- */

/* Conteneur pour le scroll horizontal sur mobile */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
}

.table-pro {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    text-align: left;
    white-space: nowrap; /* Évite les retours à la ligne désordonnés */
}

/* En-tête du tableau */
.table-pro thead tr {
    background-color: #f8fafc;
    border-bottom: 2px solid var(--border);
}

.table-pro th {
    padding: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Corps du tableau */
.table-pro td {
    padding: 16px;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

/* Effet de survol sur les lignes */
.table-pro tbody tr {
    transition: background 0.2s ease;
}

.table-pro tbody tr:hover {
    background-color: rgba(2, 132, 199, 0.02); /* Très léger bleu (accent) */
}

/* Style pour les badges/étiquettes à l'intérieur des cellules */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-success { background: #dcfce7; color: var(--success); }
.status-danger { background: #fee2e2; color: var(--danger); }

/* Boutons d'action dans le tableau */
.btn-table {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.btn-table:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #f0f9ff;
}

.btn-table.edit:hover { color: var(--accent); border-color: var(--accent); }
.btn-table.delete:hover { color: var(--danger); border-color: var(--danger); }



.form-container {
    max-width: 550px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}


.form-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.icon-circle {
    width: 50px;
    height: 50px;
    background: rgba(2, 132, 199, 0.1);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.form-header h2 {
    margin: 0;
    color: var(--primary);
    font-size: 1.4rem;
}

.subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Éléments du formulaire */
.modern-form .form-group {
    margin-bottom: 1.5rem;
}

.modern-form label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-form input {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.modern-form input:focus {
    outline: none;
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.1);
}

.input-help {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Boutons d'action */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 2.5rem;
}

.btn-save {
    flex: 2;
    background: var(--accent); /* Utilise votre couleur accent */
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
}

.btn-save:hover {
    background: #0369a1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(2, 132, 199, 0.3);
}

.btn-cancel {
    flex: 1;
    background: #f1f5f9;
    color: var(--text-muted);
    text-decoration: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
}

.btn-cancel:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

/* Conteneur principal */
.bloc-container {
    padding: 1.5rem;
    margin: 1rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* En-tête de la liste */
.header-list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.title-section h2 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Style des cellules */
.id-cell {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.9rem;
}

.bloc-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bloc-icon {
    width: 32px;
    height: 32px;
    background: rgba(2, 132, 199, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* État vide */
.empty-msg {
    text-align: center;
    padding: 3rem !important;
    color: var(--text-muted);
    font-style: italic;
}

/* Ajustements boutons */
.btn-add {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* Mobile */
@media (max-width: 600px) {
    .btn-add span { display: none; }
    .header-list { margin-bottom: 1rem; }
}
.btn-save { background: var(--success); color: white; border: none; padding: 12px 25px; border-radius: 8px; cursor: pointer; font-weight: 600; flex: 1; }
.btn-cancel { background: var(--bg-body); color: var(--text-main); padding: 12px 25px; border-radius: 8px; text-decoration: none; text-align: center; flex: 1; }

/* Animation fluide pour le menu et le contenu */
.sidebar {
    transition: transform 0.3s ease;
}

.main-stage {
    transition: margin-inline-start 0.3s ease;
}

/* Style optionnel pour la flèche au survol */
#btn-toggle:hover {
    opacity: 1;
    color: var(--accent);
}

/* Gestion des marges pour le contenu central */
.page-content {
    padding-top: 20px;
    padding-bottom: 20px;
}:root {
    --student-primary: #6366f1; /* Violet indigo moderne */
    --student-success: #22c55e;
    --student-bg: #f8fafc;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--student-bg);
    display: flex; justify-content: center; align-items: center; min-height: 100vh;
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%; max-width: 450px;
}

.step-indicator {
    display: flex; justify-content: space-between; margin-bottom: 2rem;
}

.dot { width: 12px; height: 12px; border-radius: 50%; background: #e2e8f0; }
.dot.active { background: var(--student-primary); box-shadow: 0 0 8px var(--student-primary); }

.form-input {
    width: 100%; padding: 12px; border: 1.5px solid #e2e8f0; border-radius: 10px; margin-top: 8px;
}

.btn-student {
    background: var(--student-primary); color: white; border: none; padding: 14px;
    border-radius: 10px; width: 100%; cursor: pointer; font-weight: 600;
}