/* ===================================
   Variables CSS - Thème global
   =================================== */
:root {
    --primary-color: #059669;
    --primary-hover: #047857;
    --error-color: #dc2626;
    --success-color: #16a34a;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --background: #f9fafb;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ===================================
   Reset et styles de base
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
}

/* ===================================
   Container de connexion
   =================================== */
.login-container {
    width: 100%;
    max-width: 420px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

/* ===================================
   Header
   =================================== */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===================================
   Formulaire
   =================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

/* ===================================
   Messages d'erreur
   =================================== */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--error-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

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

/* ===================================
   Boutons
   =================================== */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: inline-block;
}

/* ===================================
   Footer
   =================================== */
.login-footer {
    margin-top: 24px;
    text-align: center;
}

.link-secondary {
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.link-secondary:hover {
    color: var(--primary-color);
}

/* ===================================
   Responsive - Mobile
   =================================== */
@media (max-width: 480px) {
    .login-box {
        padding: 30px 24px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .form-group input {
        font-size: 16px;
    }
}

/* ===================================
   Classes utilitaires globales
   =================================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* =====================================================
   EMPLOI DU TEMPS — CSS
   ===================================================== */

/* --- Contrôles de navigation --- */
.calendar-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-nav, .btn-today {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-nav {
    background: var(--primary-color);
    color: white;
}

.btn-nav:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-today {
    background: var(--background);
    color: var(--text-primary);
    border: 2px solid var(--primary-color);
}

.btn-today:hover {
    background: var(--primary-color);
    color: white;
}

.desktop-text { display: inline; }
.mobile-text  { display: none; }

@media (max-width: 768px) {
    .desktop-text { display: none; }
    .mobile-text  { display: inline; }
}

/* --- Affichage semaine --- */
.week-display {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* --- Calendrier --- */
.calendar {
    background: white;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: var(--shadow);
}

.calendar-grid {
    display: grid;
    min-width: 900px;
}

.calendar-grid.desktop {
    grid-template-columns: 80px repeat(5, 1fr);
    grid-template-rows: auto;
}

.calendar-grid.mobile {
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto;
}

.calendar-header {
    background: var(--primary-color);
    color: white;
    padding: 16px 8px;
    text-align: center;
    font-weight: 700;
    border-bottom: 2px solid white;
    position: sticky;
    top: 0;
    z-index: 10;
    grid-row: 1;
}

.calendar-header.time { background: #4338ca; }

.time-slot {
    padding: 8px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: var(--background);
    font-weight: 600;
}

.day-column {
    position: relative;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
}

.day-column-full {
    position: relative;
    border-right: 1px solid var(--border-color);
}

/* --- Événements --- */
.event {
    position: absolute;
    left: 2px;
    right: 2px;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.3;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid rgba(0,0,0,0.2);
    z-index: 10;
}

.event:hover {
    transform: translateX(2px) scale(1.01);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 20;
}

.event-title {
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-time {
    font-size: 10px;
    opacity: 0.9;
}

/* Badge indiquant si un Cdt a déjà été saisi */
.event-badge {
    position: absolute;
    top: 3px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    border: 1px solid rgba(255,255,255,0.6);
}

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.modal-container {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* En-tête du modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-matiere {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.modal-horaire {
    font-size: 13px;
    color: #64748b;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    color: #475569;
    transition: background 0.2s;
    flex-shrink: 0;
}

.modal-close:hover { background: #e2e8f0; }

/* Onglets */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #f8fafc;
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--primary-color); background: #f1f5f9; }

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
}

/* Corps des onglets */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Formulaires */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group textarea,
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half { flex: 1; }

/* Bouton de sauvegarde */
.modal-actions { margin-top: 8px; }

.btn-save {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-save:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.save-status {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    min-height: 20px;
    text-align: center;
}

.save-status.ok    { color: #16a34a; }
.save-status.error { color: #dc2626; }

/* =====================================================
   APPEL
   ===================================================== */
.appel-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.appel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    transition: background 0.15s;
}

.appel-item:hover { background: #f1f5f9; }

.appel-item .etudiant-nom {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.appel-radio-group {
    display: flex;
    gap: 6px;
}

.appel-radio-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

/* Présent */
.appel-radio-group label.type-1  { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.appel-radio-group label.type-1:has(input:checked) { background: #16a34a; color: white; }

/* Absent justifié */
.appel-radio-group label.type-2  { background: #fef9c3; color: #a16207; border-color: #fde68a; }
.appel-radio-group label.type-2:has(input:checked) { background: #ca8a04; color: white; }

/* Absent non justifié */
.appel-radio-group label.type-3  { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.appel-radio-group label.type-3:has(input:checked) { background: #dc2626; color: white; }

/* Retard */
.appel-radio-group label.type-4  { background: #ede9fe; color: #7c3aed; border-color: #ddd6fe; }
.appel-radio-group label.type-4:has(input:checked) { background: #7c3aed; color: white; }

.appel-radio-group input[type="radio"] { display: none; }

.loading-msg {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    padding: 20px 0;
}

/* =====================================================
   TRAVAUX À FAIRE — historique
   ===================================================== */
.taf-history {
    margin-bottom: 16px;
}

.taf-item {
    padding: 12px 14px;
    border-left: 3px solid var(--primary-color);
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
    margin-bottom: 10px;
}

.taf-item-date {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.taf-item-desc {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
}

.taf-sep {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .calendar-controls { flex-direction: column; }
    .btn-nav, .btn-today { width: 100%; }
    .week-display { font-size: 16px; }
    .calendar { overflow-x: visible; }
    .calendar-grid { min-width: auto; }
    .event { font-size: 11px; padding: 4px 6px; }
    .event-title { font-size: 11px; }
    .event-time { font-size: 9px; }

    .modal-container { max-height: 95vh; border-radius: 12px 12px 0 0; align-self: flex-end; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .tab-btn { font-size: 11px; padding: 10px 4px; }
    .form-row { flex-direction: column; }
}

/* Indicateur de statut inline par étudiant (appel auto) */
.appel-item-status {
    font-size: 14px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

/* Message bloquant dans l'onglet appel (Cdt non encore enregistré) */
.appel-blocker {
    text-align: center;
    padding: 32px 20px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    margin: 8px 0;
}

.appel-blocker-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.appel-blocker p {
    color: #92400e;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.btn-goto-cdt {
    padding: 9px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-goto-cdt:hover { background: var(--primary-hover); }

/* =====================================================
   TRAVAIL À FAIRE — édition inline
   ===================================================== */
.taf-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.taf-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.taf-btn-edit,
.taf-btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 5px;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.2s, background 0.2s;
}

.taf-btn-edit:hover   { opacity: 1; background: #e0f2fe; }
.taf-btn-delete:hover { opacity: 1; background: #fee2e2; }

.taf-item-form {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.taf-edit-desc,
.taf-edit-date {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.taf-edit-desc:focus,
.taf-edit-date:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.taf-edit-actions {
    display: flex;
    gap: 8px;
}

.taf-btn-save-edit {
    padding: 7px 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.taf-btn-save-edit:hover    { background: var(--primary-hover); }
.taf-btn-save-edit:disabled { opacity: 0.6; cursor: not-allowed; }

.taf-btn-cancel-edit {
    padding: 7px 14px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.taf-btn-cancel-edit:hover { background: #e2e8f0; }

.taf-edit-status {
    font-size: 12px;
    font-weight: 600;
    min-height: 16px;
}

/* =====================================================
   CAHIER DE TEXTE — Bouton nouveau cours
   ===================================================== */
.btn-nouveau {
    padding: 10px 20px;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nouveau:hover { background: #15803d; transform: translateY(-2px); }

/* Checkboxes sections */
.sections-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}

.section-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #1e293b;
    transition: background 0.15s;
}

.section-checkbox:hover { background: #f1f5f9; }

.section-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.section-annee-wrapper {
    padding: 6px 10px 6px 34px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -7px;
}

.section-annee-wrapper label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    display: block;
}

/* Checkboxes d'années (sélection multiple) */
.annees-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.annee-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}

.annee-checkbox:hover { background: #ede9fe; border-color: #c4b5fd; }

.annee-checkbox:has(input:checked) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.annee-checkbox input[type="checkbox"] {
    display: none;
}

/* =====================================================
   SAISIE DES NOTES
   ===================================================== */
.notes-toolbar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 16px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.notes-select-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 200px;
}

.notes-select-group label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notes-select-group select {
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 14px;
    color: #1e293b;
    background: white;
    cursor: pointer;
}

.notes-select-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.btn-charger {
    padding: 10px 22px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-charger:hover:not(:disabled)  { background: var(--primary-hover); transform: translateY(-1px); }
.btn-charger:disabled { opacity: 0.5; cursor: not-allowed; }

.notes-status {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    padding: 8px 0;
    min-height: 24px;
}

/* Barre de commentaire */
.notes-comment-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.notes-comment-label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    white-space: nowrap;
}

.notes-comment-bar input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}

.notes-comment-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.btn-save-comment {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-save-comment:hover { background: var(--primary-hover); }

.comment-status {
    font-size: 13px;
    font-weight: 700;
    min-width: 80px;
}

/* Wrapper tableau scrollable */
.notes-table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
    background: white;
}

/* Tableau des notes */
.notes-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    font-size: 13px;
}

.notes-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
}

.notes-table th {
    background: var(--primary-color);
    color: white;
    padding: 0;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.15);
    vertical-align: bottom;
}

/* Colonne étudiant */
.nt-col-etudiant {
    min-width: 200px;
    position: sticky;
    left: 0;
    z-index: 11 !important;
    background: var(--primary-color) !important;
    text-align: left !important;
    padding: 12px 14px !important;
    font-size: 13px;
    font-weight: 700;
}

/* En-tête devoir */
.nt-col-note { min-width: 120px; max-width: 150px; }

.nt-devoir-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 6px 4px;
    gap: 2px;
    position: relative;
}

.nt-devoir-nom  { font-size: 12px; font-weight: 700; line-height: 1.2; text-align: center; }
.nt-devoir-meta { font-size: 10px; opacity: 0.85; }
.nt-devoir-date { font-size: 10px; opacity: 0.7; }

.nt-btn-supp-devoir {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    opacity: 0.5;
    padding: 1px 3px;
    transition: opacity 0.2s;
    position: absolute;
    top: 4px;
    right: 4px;
}
.nt-btn-supp-devoir:hover { opacity: 1; }

/* Colonne + (ajouter devoir) */
.nt-col-add {
    width: 48px;
    background: #4338ca !important;
}

.nt-btn-add-devoir {
    display: block;
    width: 28px;
    height: 28px;
    margin: 8px auto 2px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 700;
}

.nt-btn-add-devoir:hover { background: rgba(255,255,255,0.35); transform: scale(1.1); }

.nt-matiere-label {
    font-size: 9px;
    opacity: 0.8;
    padding: 0 2px 6px;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 auto;
}

/* Colonne moyenne */
.nt-col-moy {
    width: 60px;
    background: #1e40af !important;
    font-size: 11px;
    padding: 8px 6px !important;
}

/* ── Corps du tableau ── */
.notes-table tbody tr { transition: background 0.1s; }
.notes-table tbody tr:hover { background: #f8fafc; }
.notes-table tbody tr:nth-child(even) { background: #fafafa; }
.notes-table tbody tr:nth-child(even):hover { background: #f1f5f9; }

.notes-table td {
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
    vertical-align: middle;
}

/* Cellule étudiant */
.nt-cell-etudiant {
    position: sticky;
    left: 0;
    background: white;
    z-index: 5;
    padding: 6px 12px !important;
    display: flex !important;
    align-items: center;
    gap: 8px;
    min-width: 200px;
}

.notes-table tbody tr:nth-child(even) .nt-cell-etudiant { background: #fafafa; }
.notes-table tbody tr:hover .nt-cell-etudiant { background: #f8fafc; }

.nt-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e5e7eb;
    /* PhotosEtud : style de la photo de profil */
}

.nt-etudiant-nom {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* Cellule note */
.nt-cell-note { min-width: 120px; }
.nt-cell-add  { width: 48px; background: #f8fafc; }

.nt-note-inner {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 6px;
}

.nt-note-input {
    width: 48px;
    padding: 5px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.nt-note-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

.nt-note-input.nt-input-error {
    border-color: #dc2626;
    background: #fee2e2;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.nt-note-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nt-abs, .nt-nr {
    padding: 1px 5px;
    border: none;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
}

.nt-abs { background: #fee2e2; color: #b91c1c; }
.nt-abs:hover { background: #dc2626; color: white; }

.nt-nr  { background: #fef3c7; color: #92400e; }
.nt-nr:hover  { background: #d97706; color: white; }

/* États note spéciaux */
.note-absent .nt-note-input { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; font-weight: 700; }
.note-nr     .nt-note-input { background: #fef3c7; color: #92400e; border-color: #fde68a; font-weight: 700; }

/* Cellule moyenne */
.nt-cell-moy {
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    color: #1e40af;
    background: #eff6ff;
    width: 60px;
}

/* Responsive */
@media (max-width: 768px) {
    .notes-toolbar { flex-direction: column; }
    .notes-select-group { min-width: 100%; }
    .btn-charger { width: 100%; }
    .notes-comment-bar { flex-direction: column; align-items: stretch; }
}

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.modal-container {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* En-tête du modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-matiere {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.modal-horaire {
    font-size: 13px;
    color: #64748b;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    color: #475569;
    transition: background 0.2s;
    flex-shrink: 0;
}

.modal-close:hover { background: #e2e8f0; }

/* Onglets */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #f8fafc;
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--primary-color); background: #f1f5f9; }

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
}

/* Corps des onglets */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Formulaires */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group textarea,
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half { flex: 1; }

/* Bouton de sauvegarde */
.modal-actions { margin-top: 8px; }

.btn-save {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-save:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.save-status {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    min-height: 20px;
    text-align: center;
}

.save-status.ok    { color: #16a34a; }
.save-status.error { color: #dc2626; }

/* =====================================================
   APPEL
   ===================================================== */
.appel-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.appel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    transition: background 0.15s;
}

.appel-item:hover { background: #f1f5f9; }

.appel-item .etudiant-nom {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.appel-radio-group {
    display: flex;
    gap: 6px;
}

.appel-radio-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

/* Présent */
.appel-radio-group label.type-1  { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.appel-radio-group label.type-1:has(input:checked) { background: #16a34a; color: white; }

/* Absent justifié */
.appel-radio-group label.type-2  { background: #fef9c3; color: #a16207; border-color: #fde68a; }
.appel-radio-group label.type-2:has(input:checked) { background: #ca8a04; color: white; }

/* Absent non justifié */
.appel-radio-group label.type-3  { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.appel-radio-group label.type-3:has(input:checked) { background: #dc2626; color: white; }

/* Retard */
.appel-radio-group label.type-4  { background: #ede9fe; color: #7c3aed; border-color: #ddd6fe; }
.appel-radio-group label.type-4:has(input:checked) { background: #7c3aed; color: white; }

.appel-radio-group input[type="radio"] { display: none; }

.loading-msg {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    padding: 20px 0;
}

/* =====================================================
   TRAVAUX À FAIRE — historique
   ===================================================== */
.taf-history {
    margin-bottom: 16px;
}

.taf-item {
    padding: 12px 14px;
    border-left: 3px solid var(--primary-color);
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
    margin-bottom: 10px;
}

.taf-item-date {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.taf-item-desc {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
}

.taf-sep {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .calendar-controls { flex-direction: column; }
    .btn-nav, .btn-today { width: 100%; }
    .week-display { font-size: 16px; }
    .calendar { overflow-x: visible; }
    .calendar-grid { min-width: auto; }
    .event { font-size: 11px; padding: 4px 6px; }
    .event-title { font-size: 11px; }
    .event-time { font-size: 9px; }

    .modal-container { max-height: 95vh; border-radius: 12px 12px 0 0; align-self: flex-end; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .tab-btn { font-size: 11px; padding: 10px 4px; }
    .form-row { flex-direction: column; }
}

/* Indicateur de statut inline par étudiant (appel auto) */
.appel-item-status {
    font-size: 14px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

/* Message bloquant dans l'onglet appel (Cdt non encore enregistré) */
.appel-blocker {
    text-align: center;
    padding: 32px 20px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    margin: 8px 0;
}

.appel-blocker-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.appel-blocker p {
    color: #92400e;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.btn-goto-cdt {
    padding: 9px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-goto-cdt:hover { background: var(--primary-hover); }

/* =====================================================
   TRAVAIL À FAIRE — édition inline
   ===================================================== */
.taf-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.taf-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.taf-btn-edit,
.taf-btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 5px;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.2s, background 0.2s;
}

.taf-btn-edit:hover   { opacity: 1; background: #e0f2fe; }
.taf-btn-delete:hover { opacity: 1; background: #fee2e2; }

.taf-item-form {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.taf-edit-desc,
.taf-edit-date {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.taf-edit-desc:focus,
.taf-edit-date:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.taf-edit-actions {
    display: flex;
    gap: 8px;
}

.taf-btn-save-edit {
    padding: 7px 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.taf-btn-save-edit:hover    { background: var(--primary-hover); }
.taf-btn-save-edit:disabled { opacity: 0.6; cursor: not-allowed; }

.taf-btn-cancel-edit {
    padding: 7px 14px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.taf-btn-cancel-edit:hover { background: #e2e8f0; }

.taf-edit-status {
    font-size: 12px;
    font-weight: 600;
    min-height: 16px;
}

/* =====================================================
   CAHIER DE TEXTE — Bouton nouveau cours
   ===================================================== */
.btn-nouveau {
    padding: 10px 20px;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nouveau:hover { background: #15803d; transform: translateY(-2px); }

/* Checkboxes sections */
.sections-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}

.section-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #1e293b;
    transition: background 0.15s;
}

.section-checkbox:hover { background: #f1f5f9; }

.section-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.section-annee-wrapper {
    padding: 6px 10px 6px 34px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -7px;
}

.section-annee-wrapper label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    display: block;
}

/* Checkboxes d'années (sélection multiple) */
.annees-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.annee-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}

.annee-checkbox:hover { background: #ede9fe; border-color: #c4b5fd; }

.annee-checkbox:has(input:checked) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.annee-checkbox input[type="checkbox"] {
    display: none;
}
/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.modal-container {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* En-tête du modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-matiere {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.modal-horaire {
    font-size: 13px;
    color: #64748b;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    color: #475569;
    transition: background 0.2s;
    flex-shrink: 0;
}

.modal-close:hover { background: #e2e8f0; }

/* Onglets */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #f8fafc;
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--primary-color); background: #f1f5f9; }

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
}

/* Corps des onglets */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Formulaires */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group textarea,
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half { flex: 1; }

/* Bouton de sauvegarde */
.modal-actions { margin-top: 8px; }

.btn-save {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-save:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.save-status {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    min-height: 20px;
    text-align: center;
}

.save-status.ok    { color: #16a34a; }
.save-status.error { color: #dc2626; }

/* =====================================================
   APPEL
   ===================================================== */
.appel-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.appel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    transition: background 0.15s;
}

.appel-item:hover { background: #f1f5f9; }

.appel-item .etudiant-nom {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.appel-radio-group {
    display: flex;
    gap: 6px;
}

.appel-radio-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

/* Présent */
.appel-radio-group label.type-1  { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.appel-radio-group label.type-1:has(input:checked) { background: #16a34a; color: white; }

/* Absent justifié */
.appel-radio-group label.type-2  { background: #fef9c3; color: #a16207; border-color: #fde68a; }
.appel-radio-group label.type-2:has(input:checked) { background: #ca8a04; color: white; }

/* Absent non justifié */
.appel-radio-group label.type-3  { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.appel-radio-group label.type-3:has(input:checked) { background: #dc2626; color: white; }

/* Retard */
.appel-radio-group label.type-4  { background: #ede9fe; color: #7c3aed; border-color: #ddd6fe; }
.appel-radio-group label.type-4:has(input:checked) { background: #7c3aed; color: white; }

.appel-radio-group input[type="radio"] { display: none; }

.loading-msg {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    padding: 20px 0;
}

/* =====================================================
   TRAVAUX À FAIRE — historique
   ===================================================== */
.taf-history {
    margin-bottom: 16px;
}

.taf-item {
    padding: 12px 14px;
    border-left: 3px solid var(--primary-color);
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
    margin-bottom: 10px;
}

.taf-item-date {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.taf-item-desc {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
}

.taf-sep {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .calendar-controls { flex-direction: column; }
    .btn-nav, .btn-today { width: 100%; }
    .week-display { font-size: 16px; }
    .calendar { overflow-x: visible; }
    .calendar-grid { min-width: auto; }
    .event { font-size: 11px; padding: 4px 6px; }
    .event-title { font-size: 11px; }
    .event-time { font-size: 9px; }

    .modal-container { max-height: 95vh; border-radius: 12px 12px 0 0; align-self: flex-end; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .tab-btn { font-size: 11px; padding: 10px 4px; }
    .form-row { flex-direction: column; }
}

/* Indicateur de statut inline par étudiant (appel auto) */
.appel-item-status {
    font-size: 14px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

/* Message bloquant dans l'onglet appel (Cdt non encore enregistré) */
.appel-blocker {
    text-align: center;
    padding: 32px 20px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    margin: 8px 0;
}

.appel-blocker-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.appel-blocker p {
    color: #92400e;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.btn-goto-cdt {
    padding: 9px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-goto-cdt:hover { background: var(--primary-hover); }

/* =====================================================
   TRAVAIL À FAIRE — édition inline
   ===================================================== */
.taf-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.taf-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.taf-btn-edit,
.taf-btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 5px;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.2s, background 0.2s;
}

.taf-btn-edit:hover   { opacity: 1; background: #e0f2fe; }
.taf-btn-delete:hover { opacity: 1; background: #fee2e2; }

.taf-item-form {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.taf-edit-desc,
.taf-edit-date {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.taf-edit-desc:focus,
.taf-edit-date:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.taf-edit-actions {
    display: flex;
    gap: 8px;
}

.taf-btn-save-edit {
    padding: 7px 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.taf-btn-save-edit:hover    { background: var(--primary-hover); }
.taf-btn-save-edit:disabled { opacity: 0.6; cursor: not-allowed; }

.taf-btn-cancel-edit {
    padding: 7px 14px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.taf-btn-cancel-edit:hover { background: #e2e8f0; }

.taf-edit-status {
    font-size: 12px;
    font-weight: 600;
    min-height: 16px;
}

/* =====================================================
   CAHIER DE TEXTE — Bouton nouveau cours
   ===================================================== */
.btn-nouveau {
    padding: 10px 20px;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nouveau:hover { background: #15803d; transform: translateY(-2px); }

/* Checkboxes sections */
.sections-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}

.section-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #1e293b;
    transition: background 0.15s;
}

.section-checkbox:hover { background: #f1f5f9; }

.section-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.section-annee-wrapper {
    padding: 6px 10px 6px 34px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -7px;
}

.section-annee-wrapper label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    display: block;
}

.section-annee {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 13px;
    box-sizing: border-box;
}


/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.modal-container {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* En-tête du modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-matiere {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.modal-horaire {
    font-size: 13px;
    color: #64748b;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    color: #475569;
    transition: background 0.2s;
    flex-shrink: 0;
}

.modal-close:hover { background: #e2e8f0; }

/* Onglets */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #f8fafc;
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--primary-color); background: #f1f5f9; }

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
}

/* Corps des onglets */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Formulaires */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group textarea,
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half { flex: 1; }

/* Bouton de sauvegarde */
.modal-actions { margin-top: 8px; }

.btn-save {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-save:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.save-status {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    min-height: 20px;
    text-align: center;
}

.save-status.ok    { color: #16a34a; }
.save-status.error { color: #dc2626; }

/* =====================================================
   APPEL
   ===================================================== */
.appel-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.appel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    transition: background 0.15s;
}

.appel-item:hover { background: #f1f5f9; }

.appel-item .etudiant-nom {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.appel-radio-group {
    display: flex;
    gap: 6px;
}

.appel-radio-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

/* Présent */
.appel-radio-group label.type-1  { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.appel-radio-group label.type-1:has(input:checked) { background: #16a34a; color: white; }

/* Absent justifié */
.appel-radio-group label.type-2  { background: #fef9c3; color: #a16207; border-color: #fde68a; }
.appel-radio-group label.type-2:has(input:checked) { background: #ca8a04; color: white; }

/* Absent non justifié */
.appel-radio-group label.type-3  { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.appel-radio-group label.type-3:has(input:checked) { background: #dc2626; color: white; }

/* Retard */
.appel-radio-group label.type-4  { background: #ede9fe; color: #7c3aed; border-color: #ddd6fe; }
.appel-radio-group label.type-4:has(input:checked) { background: #7c3aed; color: white; }

.appel-radio-group input[type="radio"] { display: none; }

.loading-msg {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    padding: 20px 0;
}

/* =====================================================
   TRAVAUX À FAIRE — historique
   ===================================================== */
.taf-history {
    margin-bottom: 16px;
}

.taf-item {
    padding: 12px 14px;
    border-left: 3px solid var(--primary-color);
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
    margin-bottom: 10px;
}

.taf-item-date {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.taf-item-desc {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
}

.taf-sep {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .calendar-controls { flex-direction: column; }
    .btn-nav, .btn-today { width: 100%; }
    .week-display { font-size: 16px; }
    .calendar { overflow-x: visible; }
    .calendar-grid { min-width: auto; }
    .event { font-size: 11px; padding: 4px 6px; }
    .event-title { font-size: 11px; }
    .event-time { font-size: 9px; }

    .modal-container { max-height: 95vh; border-radius: 12px 12px 0 0; align-self: flex-end; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .tab-btn { font-size: 11px; padding: 10px 4px; }
    .form-row { flex-direction: column; }
}

/* Indicateur de statut inline par étudiant (appel auto) */
.appel-item-status {
    font-size: 14px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

/* Message bloquant dans l'onglet appel (Cdt non encore enregistré) */
.appel-blocker {
    text-align: center;
    padding: 32px 20px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    margin: 8px 0;
}

.appel-blocker-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.appel-blocker p {
    color: #92400e;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.btn-goto-cdt {
    padding: 9px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-goto-cdt:hover { background: var(--primary-hover); }

/* =====================================================
   TRAVAIL À FAIRE — édition inline
   ===================================================== */
.taf-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.taf-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.taf-btn-edit,
.taf-btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 5px;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.2s, background 0.2s;
}

.taf-btn-edit:hover   { opacity: 1; background: #e0f2fe; }
.taf-btn-delete:hover { opacity: 1; background: #fee2e2; }

.taf-item-form {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.taf-edit-desc,
.taf-edit-date {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.taf-edit-desc:focus,
.taf-edit-date:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.taf-edit-actions {
    display: flex;
    gap: 8px;
}

.taf-btn-save-edit {
    padding: 7px 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.taf-btn-save-edit:hover    { background: var(--primary-hover); }
.taf-btn-save-edit:disabled { opacity: 0.6; cursor: not-allowed; }

.taf-btn-cancel-edit {
    padding: 7px 14px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.taf-btn-cancel-edit:hover { background: #e2e8f0; }

.taf-edit-status {
    font-size: 12px;
    font-weight: 600;
    min-height: 16px;
}
/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.modal-container {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* En-tête du modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-matiere {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.modal-horaire {
    font-size: 13px;
    color: #64748b;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    color: #475569;
    transition: background 0.2s;
    flex-shrink: 0;
}

.modal-close:hover { background: #e2e8f0; }

/* Onglets */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #f8fafc;
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--primary-color); background: #f1f5f9; }

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
}

/* Corps des onglets */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Formulaires */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group textarea,
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half { flex: 1; }

/* Bouton de sauvegarde */
.modal-actions { margin-top: 8px; }

.btn-save {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-save:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.save-status {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    min-height: 20px;
    text-align: center;
}

.save-status.ok    { color: #16a34a; }
.save-status.error { color: #dc2626; }

/* =====================================================
   APPEL
   ===================================================== */
.appel-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.appel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    transition: background 0.15s;
}

.appel-item:hover { background: #f1f5f9; }

.appel-item .etudiant-nom {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.appel-radio-group {
    display: flex;
    gap: 6px;
}

.appel-radio-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

/* Présent */
.appel-radio-group label.type-1  { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.appel-radio-group label.type-1:has(input:checked) { background: #16a34a; color: white; }

/* Absent justifié */
.appel-radio-group label.type-2  { background: #fef9c3; color: #a16207; border-color: #fde68a; }
.appel-radio-group label.type-2:has(input:checked) { background: #ca8a04; color: white; }

/* Absent non justifié */
.appel-radio-group label.type-3  { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.appel-radio-group label.type-3:has(input:checked) { background: #dc2626; color: white; }

/* Retard */
.appel-radio-group label.type-4  { background: #ede9fe; color: #7c3aed; border-color: #ddd6fe; }
.appel-radio-group label.type-4:has(input:checked) { background: #7c3aed; color: white; }

.appel-radio-group input[type="radio"] { display: none; }

.loading-msg {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    padding: 20px 0;
}

/* =====================================================
   TRAVAUX À FAIRE — historique
   ===================================================== */
.taf-history {
    margin-bottom: 16px;
}

.taf-item {
    padding: 12px 14px;
    border-left: 3px solid var(--primary-color);
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
    margin-bottom: 10px;
}

.taf-item-date {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.taf-item-desc {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
}

.taf-sep {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .calendar-controls { flex-direction: column; }
    .btn-nav, .btn-today { width: 100%; }
    .week-display { font-size: 16px; }
    .calendar { overflow-x: visible; }
    .calendar-grid { min-width: auto; }
    .event { font-size: 11px; padding: 4px 6px; }
    .event-title { font-size: 11px; }
    .event-time { font-size: 9px; }

    .modal-container { max-height: 95vh; border-radius: 12px 12px 0 0; align-self: flex-end; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .tab-btn { font-size: 11px; padding: 10px 4px; }
    .form-row { flex-direction: column; }
}

/* Indicateur de statut inline par étudiant (appel auto) */
.appel-item-status {
    font-size: 14px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

/* Message bloquant dans l'onglet appel (Cdt non encore enregistré) */
.appel-blocker {
    text-align: center;
    padding: 32px 20px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    margin: 8px 0;
}

.appel-blocker-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.appel-blocker p {
    color: #92400e;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.btn-goto-cdt {
    padding: 9px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-goto-cdt:hover { background: var(--primary-hover); }
/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.modal-container {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* En-tête du modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-matiere {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.modal-horaire {
    font-size: 13px;
    color: #64748b;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    color: #475569;
    transition: background 0.2s;
    flex-shrink: 0;
}

.modal-close:hover { background: #e2e8f0; }

/* Onglets */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #f8fafc;
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--primary-color); background: #f1f5f9; }

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
}

/* Corps des onglets */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Formulaires */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group textarea,
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half { flex: 1; }

/* Bouton de sauvegarde */
.modal-actions { margin-top: 8px; }

.btn-save {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-save:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.save-status {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    min-height: 20px;
    text-align: center;
}

.save-status.ok    { color: #16a34a; }
.save-status.error { color: #dc2626; }

/* =====================================================
   APPEL
   ===================================================== */
.appel-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.appel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    transition: background 0.15s;
}

.appel-item:hover { background: #f1f5f9; }

.appel-item .etudiant-nom {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.appel-radio-group {
    display: flex;
    gap: 6px;
}

.appel-radio-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

/* Présent */
.appel-radio-group label.type-1  { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.appel-radio-group label.type-1:has(input:checked) { background: #16a34a; color: white; }

/* Absent justifié */
.appel-radio-group label.type-2  { background: #fef9c3; color: #a16207; border-color: #fde68a; }
.appel-radio-group label.type-2:has(input:checked) { background: #ca8a04; color: white; }

/* Absent non justifié */
.appel-radio-group label.type-3  { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.appel-radio-group label.type-3:has(input:checked) { background: #dc2626; color: white; }

/* Retard */
.appel-radio-group label.type-4  { background: #ede9fe; color: #7c3aed; border-color: #ddd6fe; }
.appel-radio-group label.type-4:has(input:checked) { background: #7c3aed; color: white; }

.appel-radio-group input[type="radio"] { display: none; }

.loading-msg {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    padding: 20px 0;
}

/* =====================================================
   TRAVAUX À FAIRE — historique
   ===================================================== */
.taf-history {
    margin-bottom: 16px;
}

.taf-item {
    padding: 12px 14px;
    border-left: 3px solid var(--primary-color);
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
    margin-bottom: 10px;
}

.taf-item-date {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.taf-item-desc {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
}

.taf-sep {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .calendar-controls { flex-direction: column; }
    .btn-nav, .btn-today { width: 100%; }
    .week-display { font-size: 16px; }
    .calendar { overflow-x: visible; }
    .calendar-grid { min-width: auto; }
    .event { font-size: 11px; padding: 4px 6px; }
    .event-title { font-size: 11px; }
    .event-time { font-size: 9px; }

    .modal-container { max-height: 95vh; border-radius: 12px 12px 0 0; align-self: flex-end; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .tab-btn { font-size: 11px; padding: 10px 4px; }
    .form-row { flex-direction: column; }
}

/* Indicateur de statut inline par étudiant (appel auto) */
.appel-item-status {
    font-size: 14px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.2s;
}


/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.modal-container {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* En-tête du modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-matiere {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.modal-horaire {
    font-size: 13px;
    color: #64748b;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    color: #475569;
    transition: background 0.2s;
    flex-shrink: 0;
}

.modal-close:hover { background: #e2e8f0; }

/* Onglets */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #f8fafc;
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--primary-color); background: #f1f5f9; }

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
}

/* Corps des onglets */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Formulaires */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group textarea,
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half { flex: 1; }

/* Bouton de sauvegarde */
.modal-actions { margin-top: 8px; }

.btn-save {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-save:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.save-status {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    min-height: 20px;
    text-align: center;
}

.save-status.ok    { color: #16a34a; }
.save-status.error { color: #dc2626; }

/* =====================================================
   APPEL
   ===================================================== */
.appel-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.appel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    transition: background 0.15s;
}

.appel-item:hover { background: #f1f5f9; }

.appel-item .etudiant-nom {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.appel-radio-group {
    display: flex;
    gap: 6px;
}

.appel-radio-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

/* Présent */
.appel-radio-group label.type-1  { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.appel-radio-group label.type-1:has(input:checked) { background: #16a34a; color: white; }

/* Absent justifié */
.appel-radio-group label.type-2  { background: #fef9c3; color: #a16207; border-color: #fde68a; }
.appel-radio-group label.type-2:has(input:checked) { background: #ca8a04; color: white; }

/* Absent non justifié */
.appel-radio-group label.type-3  { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.appel-radio-group label.type-3:has(input:checked) { background: #dc2626; color: white; }

/* Retard */
.appel-radio-group label.type-4  { background: #ede9fe; color: #7c3aed; border-color: #ddd6fe; }
.appel-radio-group label.type-4:has(input:checked) { background: #7c3aed; color: white; }

.appel-radio-group input[type="radio"] { display: none; }

.loading-msg {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    padding: 20px 0;
}

/* =====================================================
   TRAVAUX À FAIRE — historique
   ===================================================== */
.taf-history {
    margin-bottom: 16px;
}

.taf-item {
    padding: 12px 14px;
    border-left: 3px solid var(--primary-color);
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
    margin-bottom: 10px;
}

.taf-item-date {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.taf-item-desc {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
}

.taf-sep {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .calendar-controls { flex-direction: column; }
    .btn-nav, .btn-today { width: 100%; }
    .week-display { font-size: 16px; }
    .calendar { overflow-x: visible; }
    .calendar-grid { min-width: auto; }
    .event { font-size: 11px; padding: 4px 6px; }
    .event-title { font-size: 11px; }
    .event-time { font-size: 9px; }

    .modal-container { max-height: 95vh; border-radius: 12px 12px 0 0; align-self: flex-end; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .tab-btn { font-size: 11px; padding: 10px 4px; }
    .form-row { flex-direction: column; }
}
/* ===================================
   Dashboard - Layout Principal
   =================================== */
.dashboard-body {
    background: var(--background);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===================================
   Header
   =================================== */
.dashboard-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    font-size: 14px;
    color: var(--text-secondary);
    display: none;
}

/* Bouton menu burger */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: space-around;
    transition: transform 0.3s ease;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.btn-logout {
    padding: 8px 16px;
    background: var(--error-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* ===================================
   Container Principal
   =================================== */
.dashboard-container {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ===================================
   Sidebar / Menu Latéral
   =================================== */
.sidebar {
    width: 260px;
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 20px 0;
    transition: transform 0.3s ease;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--background);
    color: var(--primary-color);
}

.nav-item.active {
    background: rgba(5, 150, 105, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 24px;
}

/* ===================================
   Contenu Principal
   =================================== */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    background: var(--background);
}

#pageContent {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 32px;
    min-height: 500px;
}

/* ===================================
   Loading Spinner
   =================================== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    margin-top: 16px;
    color: var(--text-secondary);
}

/* ===================================
   Overlay pour mobile
   =================================== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* ===================================
   Responsive - Tablet
   =================================== */
@media (max-width: 1024px) {
    .main-content {
        padding: 24px;
    }
    
    #pageContent {
        padding: 24px;
    }
}

/* ===================================
   Responsive - Mobile
   =================================== */
@media (max-width: 768px) {
    .header-title {
        font-size: 18px;
    }
    
    .user-name {
        display: none !important;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        z-index: 95;
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        padding: 16px;
    }
    
    #pageContent {
        padding: 20px;
    }
    
    .btn-logout {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 16px;
    }
    
    .header-title {
        font-size: 16px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    #pageContent {
        padding: 16px;
        border-radius: 8px;
    }
}

/* ===================================
   Responsive - Desktop Large
   =================================== */
@media (min-width: 769px) {
    .user-name {
        display: inline;
    }
}
.accueil-header {
    margin-bottom: 32px;
    text-align: center;
}

.accueil-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.date-info {
    font-size: 16px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.date-icon, .heure-icon {
    font-size: 18px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.card {
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .accueil-header h1 {
        font-size: 24px;
    }
    
    .date-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Optimisation de l'ergonomie du tableau des notes (Scroll & En-tête Fixe)
   ========================================================================== */

/* 1. Conteneur permettant le scroll horizontal n'importe où sur le tableau */
.notes-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible; /* Laisse le scroll vertical se gérer au niveau de la page */
    max-height: 70vh;    /* Optionnel: si vous voulez aussi limiter la hauteur du tableau */
    overflow-y: auto;    /* Optionnel: si vous préférez un scroll vertical interne au tableau */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
    margin-top: 16px;
}

/* 2. Fixer l'en-tête vert lors du scroll vertical */
.notes-table {
    width: 100%;
    border-collapse: separate; /* Requis pour que le sticky border fonctionne bien */
    border-spacing: 0;
}

.notes-table thead th {
    position: sticky;
    top: 0;
    z-index: 10; /* Reste au-dessus des lignes d'étudiants */
    background-color: #047857; /* Assure que le fond reste bien vert opaque */
    color: var(--white);
    border-bottom: 2px solid #03543f;
}

/* 3. Ajustement esthétique des bordures à cause du "border-collapse: separate" */
.notes-table th, 
.notes-table td {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.notes-table th:last-child, 
.notes-table td:last-child {
    border-right: none;
}

/* 4. Verrouiller la première colonne (Étudiant) sur le côté lors du scroll horizontal */
/* Optionnel mais ultra-confortable : le nom de l'étudiant reste visible même si on scrolle loin à droite */
.notes-table th.nt-col-etudiant,
.notes-table td.nt-cell-etudiant {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: var(--white); /* Couleur opaque pour masquer les notes qui glissent dessous */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05); /* Petite ombre pour marquer la séparation */
}

/* L'en-tête de la colonne étudiant doit être au-dessus de tout (intersection horizontal/vertical) */
.notes-table thead th.nt-col-etudiant {
    z-index: 12;
    background-color: #047857;
}

/* Ajustement de la ligne de commentaire pour qu'elle ne casse pas le sticky latéral */
.notes-table tr.nt-row-comment td {
    background-color: #f8fafc;
}
