/* ══════════════════════════════════════════════════════════════════════
   APP JURYS - STYLES
   Grille 2x2, tableaux, formulaires, saisie notes
   Dark mode, RTL, responsive
   ══════════════════════════════════════════════════════════════════════ */

/* --- Variables specifiques jurys --- */
:root {
    --jury-card-actions: #006633;
    --jury-card-params: #4a5568;
    --jury-card-data: #c68a00;
    --jury-card-stats: #0e7490;
    --jury-accent-red: #97233f;
    --jury-hover: rgba(0, 102, 51, 0.05);
}

/* --- Page container --- */
.jurys-page { min-height: 80vh; }
.jurys-page .container { max-width: 1140px; }

/* --- En-tete --- */
.jurys-header {
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--color-primary);
    margin-bottom: var(--space-lg);
}
.jurys-header h1 { color: var(--color-text); font-weight: 700; }
.jurys-header .text-muted { color: var(--color-text-muted) !important; }
.jurys-header .btn-outline-secondary {
    border-color: var(--color-border);
    color: var(--color-text-secondary);
    transition: all 0.25s ease;
}
.jurys-header .btn-outline-secondary:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* --- Alerte sessions actives --- */
.jurys-session-alert {
    background: linear-gradient(135deg, rgba(0, 102, 51, 0.08), rgba(0, 102, 51, 0.03));
    border: 1px solid rgba(0, 102, 51, 0.2);
    border-radius: 8px;
    color: var(--color-text);
}
.jurys-session-alert .badge { background: var(--color-primary) !important; }

/* --- Info bar --- */
.jurys-info-bar {
    background: var(--color-background-light);
    border-radius: 8px;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
}
.jurys-info-bar .badge { transition: transform 0.25s ease; }
.jurys-info-bar .badge:hover { transform: scale(1.05); }

/* --- Grille 2x2 - Cartes principales --- */
.jurys-grid .card {
    background: var(--color-background-white);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.jurys-grid .card:hover, .jurys-grid .card:active { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.jurys-grid .card-header { border-bottom: none; padding: 0.65rem 1rem; font-weight: 600; }
.jurys-grid .card-header h6 { font-weight: 600; letter-spacing: 0.3px; }

.jurys-card-actions .card-header { background: linear-gradient(135deg, var(--jury-card-actions), #008040); color: #fff; }
.jurys-card-params .card-header { background: linear-gradient(135deg, var(--jury-card-params), #5a6577); color: #fff; }
.jurys-card-data .card-header { background: linear-gradient(135deg, var(--jury-card-data), #d4a017); color: #1a1a1a; }
.jurys-card-stats .card-header { background: linear-gradient(135deg, var(--jury-card-stats), #0891b2); color: #fff; }

/* --- List-group items --- */
.jurys-grid .list-group-item {
    background: var(--color-background-white);
    border: none;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    transition: background 0.25s ease, padding-inline-start 0.25s ease;
}
.jurys-grid .list-group-item:last-child { border-bottom: none; }
.jurys-grid .list-group-item-action:hover,
.jurys-grid .list-group-item-action:active {
    background: var(--jury-hover);
    padding-inline-start: calc(0.5rem + 4px);
}
.jurys-grid .list-group-item .fw-bold { color: var(--color-text); }
.jurys-grid .list-group-item .text-muted { color: var(--color-text-muted) !important; }

/* --- Pictogrammes (icones dans cercles colores) --- */
.jurys-picto {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #fff;
    margin-right: 0.6rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.list-group-item-action:hover .jurys-picto {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.jurys-picto-green  { background: linear-gradient(135deg, #198754, #20c997); }
.jurys-picto-blue   { background: linear-gradient(135deg, #0d6efd, #6ea8fe); }
.jurys-picto-amber  { background: linear-gradient(135deg, #c68a00, #f0ad4e); }
.jurys-picto-teal   { background: linear-gradient(135deg, #0e7490, #22d3ee); }
.jurys-picto-purple { background: linear-gradient(135deg, #6f42c1, #a78bfa); }
.jurys-picto-rose   { background: linear-gradient(135deg, #d63384, #f06292); }
.jurys-picto-gray   { background: linear-gradient(135deg, #4a5568, #94a3b8); }
.jurys-picto-red    { background: linear-gradient(135deg, #97233f, #ef5350); }
.jurys-picto-indigo { background: linear-gradient(135deg, #3730a3, #818cf8); }

/* Stat picto (plus petit, pour les chiffres stats) */
.jurys-stat-picto {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.7rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

/* Icones list-items (fallback pour icones sans picto) */
.jurys-grid .list-group-item .fa-tasks { color: var(--color-accent-yellow); }

/* --- Barres de progression --- */
.jurys-grid .progress { background: var(--color-border); border-radius: 4px; overflow: hidden; }
.jurys-grid .progress-bar { transition: width 0.6s ease; }

/* --- Carte statistiques --- */
.jurys-stats-section {
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border);
}
.jurys-stats-section:last-child { border-bottom: none; margin-bottom: 0; }
.jurys-stats-section .fw-bold { color: var(--color-text); }
.jurys-stats-section .text-muted { color: var(--color-text-muted) !important; }
.jurys-stats-section .table { color: var(--color-text); }
.jurys-stats-section .table td { border-color: var(--color-border); }

/* Section verrouillee */
.jurys-locked {
    background: var(--color-background-light);
    border-radius: 8px;
    padding: var(--space-lg);
}
.jurys-locked i, .jurys-locked p { color: var(--color-text-muted); }

/* --- Tableaux --- */
.jurys-table {
    background: var(--color-background-white);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}
.jurys-table .table { margin-bottom: 0; color: var(--color-text); }
.jurys-table .table thead { background: linear-gradient(135deg, var(--color-primary), #008040); }
.jurys-table .table thead th {
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    border: none;
    white-space: nowrap;
}
.jurys-table .table tbody tr {
    transition: background-color 0.25s ease;
    border-bottom: 1px solid var(--color-border);
}
.jurys-table .table tbody tr:hover, .jurys-table .table tbody tr:active { background: var(--jury-hover); }
.jurys-table .table tbody tr:last-child { border-bottom: none; }
.jurys-table .table td { padding: 0.65rem 1rem; vertical-align: middle; color: var(--color-text); }

/* --- Formulaires --- */
.jurys-form .form-control,
.jurys-form .form-select {
    background: var(--color-background-white);
    border-color: var(--color-border);
    color: var(--color-text);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.jurys-form .form-control:focus,
.jurys-form .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 51, 0.15);
}
.jurys-form .form-label { color: var(--color-text-secondary); font-weight: 500; }
.jurys-form .input-group .form-control { border-color: var(--color-border); }

/* --- Boutons --- */
.jurys-page .btn-primary { background: var(--color-primary); border-color: var(--color-primary); }
.jurys-page .btn-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.jurys-page .btn-warning { background: var(--color-accent-yellow); border-color: var(--color-accent-yellow); color: #1a1a1a; }
.jurys-page .btn-outline-primary { color: var(--color-primary); border-color: var(--color-primary); }
.jurys-page .btn-outline-primary:hover { background: var(--color-primary); color: #fff; }

/* --- Badges --- */
.jurys-page .badge.bg-success { background: var(--color-primary) !important; }
.jurys-page .badge.bg-light {
    background: var(--color-background-light) !important;
    color: var(--color-text) !important;
    border: 1px solid var(--color-border) !important;
}

/* --- Carte apercu filieres --- */
.jurys-filiere-card {
    background: var(--color-background-white);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: visible;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.jurys-filiere-card .card-header { border-radius: 10px 10px 0 0; }
.jurys-filiere-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.jurys-filiere-card .card-header { border-bottom: none; padding: 0.5rem 1rem; }
.jurys-filiere-card .card-body { color: var(--color-text); }
.jurys-filiere-card .text-muted { color: var(--color-text-muted) !important; }
.jurys-filiere-card .progress { background: var(--color-border); }

/* --- Accordion semestres dans filiere-card --- */
.filiere-semestres-accordion {
    border-top: 1px solid var(--color-border);
    padding-top: 0.4rem;
}
.filiere-semestre-item { border-bottom: 1px solid var(--color-border); }
.filiere-semestre-item:last-child { border-bottom: none; }
.filiere-semestre-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.35rem 0;
    background: none;
    border: none;
    font-size: 0.8rem;
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    transition: color 0.2s ease;
}
.filiere-semestre-btn::before {
    content: "\f0da";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.65rem;
    margin-right: 0.4rem;
    transition: transform 0.2s ease;
    color: var(--color-text-muted);
}
.filiere-semestre-btn:not(.collapsed)::before { transform: rotate(90deg); }
.filiere-semestre-btn:hover { color: var(--color-primary); }
.filiere-semestre-content { padding: 0.25rem 0 0.4rem 0.5rem; }
.filiere-ue-item {
    padding: 0.2rem 0;
    border-bottom: 1px dashed var(--color-border);
}
.filiere-ue-item:last-child { border-bottom: none; }
.filiere-matiere-item {
    padding-left: 1.2rem;
    font-size: 0.72rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* --- Barres de progression CC/ET/SR par semestre --- */
.filiere-notes-bars { font-size: 0.72rem; }
.filiere-note-bar-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
}
.filiere-note-label {
    width: 1.6rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}
.filiere-note-val {
    width: 5.5rem;
    text-align: right;
    color: var(--color-text-muted);
    flex-shrink: 0;
}
.filiere-sem-pct { font-size: 0.7rem; font-weight: 600; flex-shrink: 0; }

/* --- Chevron rotation on accordion open --- */
.filiere-semestre-btn[aria-expanded="true"] .filiere-chevron {
    transform: rotate(180deg);
}

/* Validation actions bar */
.validation-actions-bar {
    position: sticky;
    bottom: 0;
    z-index: 100;
    background: var(--color-background-white);
}

/* --- Saisie des notes : barre sticky fusionnée --- */
.jurys-saisie-sticky-bar {
    position: sticky;
    top: var(--header-height, 70px);
    z-index: calc(var(--z-sticky) - 1);
    background: var(--color-background-white);
    border-bottom: 1px solid var(--color-border);
    padding: .25rem .75rem;
    margin: 0 -.75rem;
    box-shadow: var(--shadow-sm);
}
body.dark-mode .jurys-saisie-sticky-bar {
    background: var(--color-background-white);
}

/* --- Saisie des notes : table wrapper --- */
.jurys-saisie-table-wrapper {
    overflow-x: clip;   /* clip ne crée PAS de scroll context → sticky thead OK */
    max-width: 100%;
}
@media (max-width: 991.98px) {
    .jurys-saisie-table-wrapper {
        overflow-x: auto; /* mobile : scroll horizontal */
    }
}
.jurys-saisie-thead-sticky th {
    position: sticky;
    top: 0;  /* sera recalculé par JS */
    z-index: 20;
    background-color: var(--color-primary-dark, #004d26);
    color: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

/* --- Saisie : table font & vertical alignment --- */
.saisie-table-striped {
    font-family: 'Calibri', sans-serif;
    font-size: 12pt;
}
.saisie-table-striped td,
.saisie-table-striped th {
    vertical-align: middle !important;
}

/* --- Saisie : colonnes --- */
.saisie-col-num {
    width: 2.5rem;
    min-width: 2rem;
    max-width: 3rem;
}
.saisie-col-nom {
    width: auto;
    min-width: 100px;
    max-width: 180px;
    position: relative;
}
.saisie-col-input {
    width: 4.5rem;
    min-width: 3.5rem;
    max-width: 5rem;
}
.saisie-col-recap {
    width: 3rem;
    min-width: 2.5rem;
    max-width: 4rem;
}
.saisie-col-moy {
    width: 3.5rem;
    min-width: 3rem;
    max-width: 4.5rem;
}

/* Resize handle on name column header */
.saisie-col-nom .col-resizer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    background: transparent;
}
.saisie-col-nom .col-resizer:hover,
.saisie-col-nom .col-resizer.resizing {
    background: var(--color-primary);
    opacity: .4;
}

/* Saisie rows compactes (-40% hauteur) */
.saisie-table-striped .student-row td { padding: .1rem .25rem !important; line-height: 1.1; }
.saisie-table-striped .student-row .saisie-col-nom small { font-size: 1.1rem; line-height: 1.1; font-family: inherit; }
.saisie-table-striped .student-row .saisie-col-nom { padding-right: .1rem !important; }
.jurys-saisie-thead-sticky th { padding: .2rem .25rem !important; font-size: .7rem; }

/* Note input sizing */
.note-input {
    width: 100% !important;
    max-width: 64px;
    margin: 0 auto;
    text-align: center;
    padding: .15rem .25rem;
    font-size: 14pt;
    min-height: 1.7rem;
    height: 1.7rem;
}
.note-sr-input {
    color: #dc3545 !important;
    font-weight: 600;
}
.saisie-col-frozen .cell-sr {
    color: #dc3545 !important;
}
body.dark-mode .note-sr-input {
    color: #ff6b6b !important;
}
body.dark-mode .saisie-col-frozen .cell-sr {
    color: #ff6b6b !important;
}
.note-input.is-invalid {
    border-color: var(--bs-danger) !important;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.25);
}

/* Locked (verrouille) row indicator */
.row-verrouille {
    background-color: rgba(108, 117, 125, 0.06);
}
.row-verrouille td:first-child {
    border-left: 3px solid var(--bs-secondary);
}
.row-verrouille .note-input[readonly] {
    background-color: rgba(108, 117, 125, 0.08);
    cursor: not-allowed;
    opacity: .65;
}

/* Requete column */
.saisie-col-frozen {
    background: var(--color-background-light) !important;
    color: var(--color-text-muted);
    text-align: center;
    font-size: 12pt;
}
.saisie-th-frozen {
    opacity: 0.45;
}

/* Neutraliser Bootstrap table — box-shadow inset overlay + hover variables */
.saisie-table-striped > :not(caption) > * > *,
.saisie-table-striped > :not(caption) > *:hover > * {
    box-shadow: none !important;
    --bs-table-bg-state: transparent !important;
    --bs-table-color-state: var(--color-text, #212529) !important;
    --bs-table-accent-bg: transparent !important;
    color: var(--color-text, #212529) !important;
}

/* Alternance de couleurs entre lignes de saisie */
.saisie-table-striped tbody tr.student-row:nth-child(odd) > td {
    background: var(--color-background-white, #ffffff) !important;
}
.saisie-table-striped tbody tr.student-row:nth-child(even) > td {
    background: var(--color-background-light, #f5f5f5) !important;
}


.saisie-col-obs {
    width: 36px;
    min-width: 32px;
    max-width: 40px;
}
.saisie-col-req {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
}
.req-tag {
    font-size: .6rem;
    padding: .15em .4em;
}

/* Hide spinner arrows on number inputs */
.note-input::-webkit-outer-spin-button,
.note-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.note-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Tag selector (gestion groupes) */
.tag-item {
    font-size: .75rem;
    padding: .25rem .5rem;
    border-radius: .25rem;
}
.tag-item .tag-remove {
    opacity: .7;
    transition: opacity .15s;
    margin-left: 2px;
}
.tag-item .tag-remove:hover {
    opacity: 1;
}
.tag-container {
    min-height: 28px;
}

/* ══════════════════════════════════════════════════════════════════════
   NOTES PAGE - Scroll horizontal au niveau du parent (comme organigramme)
   Le header/footer de base restent fixes ; seul le tableau deborde.
   ══════════════════════════════════════════════════════════════════════ */

/* Quand la page notes-scroll est active, le parent gere le scroll */
.notes-scroll-page .right-main-content {
    overflow-x: auto !important;
    overflow-y: auto !important;
}
.notes-scroll-page .main-content,
.notes-scroll-page #main-content {
    overflow: visible !important;
    min-width: max-content;
}

/* Elements qui restent fixes horizontalement (sticky left) */
.notes-sticky-left {
    position: sticky;
    inset-inline-start: 0;
    width: calc(100vw - var(--sidebar-width, 260px) - 2rem);
    max-width: calc(100vw - var(--sidebar-width, 260px) - 2rem);
    background: var(--color-background, #f8f9fa);
    z-index: 10;
}

/* Le wrapper du tableau : pas de scroll propre, laisse le parent gerer */
.notes-freeze-wrapper {
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 4px;
}
.notes-freeze-wrapper table {
    border-collapse: separate;
    border-spacing: 0;
}

/* Sticky first 3 columns (N, MAT, NOM) */
.notes-freeze-wrapper tbody td:nth-child(1),
.notes-freeze-wrapper tbody td:nth-child(2),
.notes-freeze-wrapper tbody td:nth-child(3),
.notes-freeze-wrapper thead th.col-freeze {
    position: sticky;
    z-index: 4;
}
.notes-freeze-wrapper thead th.col-freeze {
    z-index: 6;
}
.notes-freeze-wrapper tbody td:nth-child(1) { left: 0; min-width: 30px; background: var(--color-background, #f8f9fa); }
.notes-freeze-wrapper tbody td:nth-child(2) { left: 30px; min-width: 72px; background: var(--color-background, #f8f9fa); }
.notes-freeze-wrapper tbody td:nth-child(3) { left: 102px; min-width: 140px; background: var(--color-background, #f8f9fa); border-right: 2px solid var(--color-border, #adb5bd); }

/* Dark mode overrides for notes table (prefers-color-scheme) */
@media (prefers-color-scheme: dark) {
    .notes-freeze-wrapper { border-color: var(--color-border); }
    .notes-freeze-wrapper tbody td:nth-child(1),
    .notes-freeze-wrapper tbody td:nth-child(2),
    .notes-freeze-wrapper tbody td:nth-child(3) { background: #1e293b !important; }
    .notes-freeze-wrapper tbody td:nth-child(3) { border-right-color: #475569; }
    .notes-freeze-wrapper .table-light td { background: #263548 !important; }

    /* UE header colors — dark mode readable versions */
    .notes-freeze-wrapper th[data-ue-header] { color: #f1f5f9 !important; }
    .notes-freeze-wrapper th[data-ue-blue] { background: #1a3a5c !important; color: #93c5fd !important; }
    .notes-freeze-wrapper th[data-ue-lightblue] { background: #1e3a4f !important; color: #bae6fd !important; }
    .notes-freeze-wrapper th[data-ue-orange] { background: #5c3a1a !important; color: #fed7aa !important; }
    .notes-freeze-wrapper th[data-ue-cream] { background: #3d3520 !important; color: #fef3c7 !important; }
    .notes-freeze-wrapper th[data-ue-purple] { background: #3b1f5c !important; color: #d8b4fe !important; }
    .notes-freeze-wrapper th[data-ue-darkblue] { background: #1e293b !important; color: #e2e8f0 !important; }
    .notes-freeze-wrapper th[data-ue-darkorange] { background: #5c2d0e !important; color: #fdba74 !important; }
    .notes-freeze-wrapper th[data-ue-darkpurple] { background: #4c1d6e !important; color: #c084fc !important; }
    .notes-freeze-wrapper td[data-cell-ue] { background: #2a2520 !important; }
    .notes-freeze-wrapper td[data-cell-res] { background: #2a2040 !important; }
}

/* body.dark-mode overrides for notes table */
body.dark-mode .notes-freeze-wrapper { border-color: var(--color-border); }
body.dark-mode .notes-freeze-wrapper tbody td:nth-child(1),
body.dark-mode .notes-freeze-wrapper tbody td:nth-child(2),
body.dark-mode .notes-freeze-wrapper tbody td:nth-child(3) { background: #1e293b !important; }
body.dark-mode .notes-freeze-wrapper tbody td:nth-child(3) { border-right-color: #475569; }
body.dark-mode .notes-freeze-wrapper .table-light td { background: #263548 !important; }

body.dark-mode .notes-freeze-wrapper th[data-ue-header] { color: #f1f5f9 !important; }
body.dark-mode .notes-freeze-wrapper th[data-ue-blue] { background: #1a3a5c !important; color: #93c5fd !important; }
body.dark-mode .notes-freeze-wrapper th[data-ue-lightblue] { background: #1e3a4f !important; color: #bae6fd !important; }
body.dark-mode .notes-freeze-wrapper th[data-ue-orange] { background: #5c3a1a !important; color: #fed7aa !important; }
body.dark-mode .notes-freeze-wrapper th[data-ue-cream] { background: #3d3520 !important; color: #fef3c7 !important; }
body.dark-mode .notes-freeze-wrapper th[data-ue-purple] { background: #3b1f5c !important; color: #d8b4fe !important; }
body.dark-mode .notes-freeze-wrapper th[data-ue-darkblue] { background: #1e293b !important; color: #e2e8f0 !important; }
body.dark-mode .notes-freeze-wrapper th[data-ue-darkorange] { background: #5c2d0e !important; color: #fdba74 !important; }
body.dark-mode .notes-freeze-wrapper th[data-ue-darkpurple] { background: #4c1d6e !important; color: #c084fc !important; }
body.dark-mode .notes-freeze-wrapper td[data-cell-ue] { background: #2a2520 !important; }
body.dark-mode .notes-freeze-wrapper td[data-cell-res] { background: #2a2040 !important; }

/* Row hover highlight */
.notes-freeze-wrapper tbody tr:hover td { background: rgba(0, 102, 51, 0.06) !important; }
.notes-freeze-wrapper tbody tr:hover td[data-cell-ue] { background: rgba(0, 102, 51, 0.12) !important; }
.notes-freeze-wrapper tbody tr:hover td[data-cell-res] { background: rgba(102, 0, 102, 0.1) !important; }
@media (prefers-color-scheme: dark) {
    .notes-freeze-wrapper tbody tr:hover td { background: rgba(100, 200, 150, 0.1) !important; }
    .notes-freeze-wrapper tbody tr:hover td[data-cell-ue] { background: rgba(100, 200, 150, 0.15) !important; }
    .notes-freeze-wrapper tbody tr:hover td[data-cell-res] { background: rgba(150, 100, 200, 0.15) !important; }
}
body.dark-mode .notes-freeze-wrapper tbody tr:hover td { background: rgba(100, 200, 150, 0.1) !important; }
body.dark-mode .notes-freeze-wrapper tbody tr:hover td[data-cell-ue] { background: rgba(100, 200, 150, 0.15) !important; }
body.dark-mode .notes-freeze-wrapper tbody tr:hover td[data-cell-res] { background: rgba(150, 100, 200, 0.15) !important; }

/* --- Page generation --- */
.jurys-generation .card {
    background: var(--color-background-white);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.25s ease;
}
.jurys-generation .card:hover { box-shadow: var(--shadow-md); }
.jurys-generation .card-header { border-bottom: none; }
.jurys-generation .card-body { color: var(--color-text); }
.jurys-generation .form-select,
.jurys-generation .form-control {
    background: var(--color-background-white);
    border-color: var(--color-border);
    color: var(--color-text);
}
.jurys-generation .form-select:focus,
.jurys-generation .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 51, 0.15);
}
.jurys-generation .form-label { color: var(--color-text-secondary); }

/* --- Gestion sessions --- */
.jurys-sessions .form-check-label { color: var(--color-text); }
.jurys-sessions .form-check-input:checked { background-color: var(--color-primary); border-color: var(--color-primary); }

/* --- Saisie notes --- */
.jurys-note-input { text-align: center; font-weight: 600; transition: border-color 0.25s ease, background 0.25s ease; }
.jurys-note-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 0.2rem rgba(0, 102, 51, 0.15); }
.jurys-note-valid { background: rgba(0, 102, 51, 0.05) !important; border-color: var(--color-primary) !important; }
.jurys-note-invalid { background: rgba(151, 35, 63, 0.05) !important; border-color: var(--jury-accent-red) !important; }

/* --- Alertes jurys --- */
.jurys-page .alert-info {
    background: rgba(0, 102, 51, 0.06);
    border-color: rgba(0, 102, 51, 0.15);
    color: var(--color-text);
}


/* ──────────────────────────────────────────────────────────────────────
   APP JURYS - RECHERCHE / DETAIL ETUDIANT - DARK MODE
   ────────────────────────────────────────────────────────────────────── */

/* Accordion semestres (recherche + detail) */
body.dark-mode .jurys-page #accordionSemestres .border {
    border-color: var(--color-border) !important;
}
body.dark-mode .jurys-page #accordionSemestres .bg-light {
    background: var(--color-background-light) !important;
    color: var(--color-text);
}
body.dark-mode .jurys-page #accordionSemestres .border-bottom {
    border-color: var(--color-border) !important;
}
body.dark-mode .jurys-page #accordionSemestres .text-muted {
    color: var(--color-text-muted) !important;
}
body.dark-mode .jurys-page #accordionSemestres .text-primary {
    color: #66bb6a !important;
}
body.dark-mode .jurys-page #accordionSemestres .text-info {
    color: #4dd0e1 !important;
}
body.dark-mode .jurys-page #accordionSemestres .text-secondary {
    color: #90a4ae !important;
}
body.dark-mode .jurys-page #accordionSemestres .table {
    color: var(--color-text);
}
body.dark-mode .jurys-page #accordionSemestres .table th {
    color: var(--color-text-muted);
}

/* Card identite etudiant (recherche) */
body.dark-mode .jurys-page .card {
    background: var(--color-background-white);
    border-color: var(--color-border);
    color: var(--color-text);
}
body.dark-mode .jurys-page .card .text-muted {
    color: var(--color-text-muted) !important;
}
body.dark-mode .jurys-page .card-body {
    color: var(--color-text);
}
body.dark-mode .jurys-page .card-header {
    border-color: var(--color-border);
    color: #fff;
}
body.dark-mode .jurys-page .card-header h6 {
    color: #fff;
}

/* Formulaire recherche */
body.dark-mode .jurys-page .form-control {
    background: var(--color-background-white);
    border-color: var(--color-border);
    color: var(--color-text);
}
body.dark-mode .jurys-page .form-control::placeholder {
    color: var(--color-text-muted);
}
body.dark-mode .jurys-page .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 51, 0.25);
}

/* Table des resultats multiples */
body.dark-mode .jurys-page .table-hover tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}
body.dark-mode .jurys-page .table-light {
    background: var(--color-background-light) !important;
}
body.dark-mode .jurys-page .table-light th {
    background: var(--color-background-light) !important;
    color: var(--color-text) !important;
}

/* Alerts */
body.dark-mode .jurys-page .alert-info {
    background: rgba(0, 102, 51, 0.12);
    border-color: rgba(0, 102, 51, 0.25);
    color: var(--color-text);
}
body.dark-mode .jurys-page .alert-warning {
    background: rgba(198, 138, 0, 0.15);
    border-color: rgba(198, 138, 0, 0.3);
    color: var(--color-text);
}

/* Statistiques cards (detail etudiant) */
body.dark-mode .jurys-page .card.border-0 {
    background: var(--color-background-light) !important;
    border-color: var(--color-border) !important;
}


/* ──────────────────────────────────────────────────────────────────────
   APP JURYS - RTL
   ────────────────────────────────────────────────────────────────────── */

[dir="rtl"] .jurys-header { text-align: right; }
[dir="rtl"] .jurys-header .d-flex { flex-direction: row-reverse; }
[dir="rtl"] .jurys-info-bar .d-inline-flex { flex-direction: row-reverse; }
[dir="rtl"] .jurys-grid .list-group-item .d-flex { flex-direction: row-reverse; }
[dir="rtl"] .jurys-grid .list-group-item-action:hover { padding-inline-start: 0.5rem; padding-inline-end: calc(0.5rem + 4px); }
[dir="rtl"] .jurys-grid .list-group-item .me-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
[dir="rtl"] .jurys-picto { margin-right: 0; margin-left: 0.6rem; }
[dir="rtl"] .jurys-grid .ms-auto { margin-left: 0 !important; margin-right: auto !important; }
[dir="rtl"] .jurys-stats-section .d-flex { flex-direction: row-reverse; }
[dir="rtl"] .jurys-table .table { text-align: right; }
[dir="rtl"] .jurys-filiere-card .d-flex { flex-direction: row-reverse; }
[dir="rtl"] .jurys-form .input-group { flex-direction: row-reverse; }


/* ──────────────────────────────────────────────────────────────────────
   APP JURYS - RESPONSIVE
   ────────────────────────────────────────────────────────────────────── */

@media (max-width: 991.98px) {
    .jurys-grid .col-md-6 { margin-bottom: 1rem; }
    .jurys-header h1 { font-size: 1.15rem; }
}

@media (max-width: 767.98px) {
    .jurys-page .container { padding-left: 0.75rem; padding-right: 0.75rem; }
    .jurys-header { flex-direction: column; gap: 0.5rem; text-align: center; }
    .jurys-header .d-flex { flex-direction: column !important; align-items: center !important; }
    .jurys-header .btn { width: 100%; margin-top: 0.5rem; }
    .jurys-info-bar { text-align: center; }
    .jurys-info-bar .d-inline-flex { display: flex !important; justify-content: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
    .jurys-grid .card-header h6 { font-size: 0.85rem; }
    .jurys-grid .list-group-item { padding: 0.5rem; }
    .jurys-grid .list-group-item .small.fw-bold { font-size: 0.8rem; }
    .jurys-stats-section .row .col-4 { margin-bottom: 0.5rem; }
    .jurys-filiere-card .row .col-4 { margin-bottom: 0.25rem; }
}

@media (max-width: 575.98px) {
    .jurys-page .container { padding-left: 0.5rem; padding-right: 0.5rem; }
    .jurys-grid .card { border-radius: 8px; }
    .jurys-table .table td, .jurys-table .table th { padding: 0.5rem; font-size: 0.75rem; }
    .jurys-grid .list-group-item .text-muted small, .jurys-grid .list-group-item small { font-size: 0.7rem; }
    .jurys-stats-section .row { gap: 0; }
    .jurys-generation .col-lg-6 { margin-bottom: 1rem; }
    .jurys-picto { width: 28px; height: 28px; min-width: 28px; font-size: 0.75rem; border-radius: 6px; }
}

@media (max-width: 360px) {
    .jurys-grid .list-group-item .d-flex { flex-direction: column; align-items: flex-start !important; }
    .jurys-grid .list-group-item .ms-auto { margin-left: 0 !important; margin-top: 0.25rem; }
}

/* ──────────────────────────────────────────────────────────────────────
   SAISIE NOTES - RESPONSIVE
   ────────────────────────────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 991.98px) {
    .jurys-saisie-sticky-bar { padding: .25rem .5rem; }
    .jurys-saisie-sticky-bar .d-flex { gap: .25rem !important; }
    .saisie-col-nom { width: 200px; min-width: 140px; max-width: 300px; }
    .note-input { max-width: 58px; font-size: .75rem; padding: .15rem .25rem; }
    .saisie-col-moy { width: 48px; min-width: 48px; max-width: 48px; }
}

/* Mobile */
@media (max-width: 767.98px) {
    .jurys-saisie-sticky-bar .saisie-resume-line { font-size: .7rem; }
    .jurys-saisie-sticky-bar .saisie-resume-line .badge { font-size: .55rem !important; }
    .saisie-col-num { display: none !important; }
    .saisie-col-moy { display: none !important; }
    .saisie-col-req { display: none !important; }
    .saisie-col-obs { display: none !important; }
    .saisie-col-sit { display: none !important; }
    .saisie-col-nom { width: 120px; min-width: 100px; max-width: 160px; }
    .saisie-col-nom small { font-size: .65rem !important; }
    .saisie-col-input { width: 58px; min-width: 52px; max-width: 64px; }
    .note-input { max-width: 52px; font-size: .7rem; padding: .1rem .2rem; }
    .saisie-col-frozen { font-size: .65rem; }
    #search-input { width: 100px !important; }
    .jurys-saisie-sticky-bar .d-flex { flex-wrap: wrap; }
}

/* Small mobile */
@media (max-width: 575.98px) {
    .saisie-col-nom { width: 100px; min-width: 80px; max-width: 130px; }
    .saisie-col-nom small { font-size: .6rem !important; }
    .saisie-col-input { width: 50px; min-width: 46px; max-width: 56px; }
    .note-input { max-width: 46px; font-size: .65rem; }
    .jurys-saisie-sticky-bar { padding: .2rem .35rem; }
    .jurys-saisie-sticky-bar .btn { font-size: .6rem; padding: 0 .2rem !important; }
    #search-input { width: 80px !important; font-size: .65rem; }
}

/* ── Touch screen laptops ── */
@media (pointer: coarse) {
    .jurys-picto { min-width: 44px; min-height: 44px; width: 44px; height: 44px; }
    .jurys-grid .list-group-item { min-height: 44px; }
    .jurys-grid .list-group-item-action:active {
        background: var(--jury-hover);
    }
    .jurys-table .table tbody tr:active { background: var(--jury-hover); }
    /* Saisie rows compactes sur touch (même que desktop) */
    .saisie-table-striped .student-row td { padding: .1rem .25rem !important; line-height: 1.1; }
    .saisie-table-striped .student-row .saisie-col-nom small { font-size: .85rem; line-height: 1.1; }
    .jurys-saisie-thead-sticky th { padding: .2rem .25rem !important; font-size: .7rem; }
    .note-input { min-height: 1.7rem; height: 1.7rem; padding: .15rem .25rem; font-size: .85rem; }
}

/* ── HiDPI laptops (effective 1280px) ── */
@media (max-width: 1280px) and (min-width: 992px) {
    .saisie-col-nom { min-width: 100px; }
    .saisie-col-input { width: 3.5rem; min-width: 3rem; max-width: 4rem; }
    .saisie-col-recap { width: 2.5rem; min-width: 2rem; max-width: 3rem; }
    .saisie-col-moy { width: 3rem; min-width: 2.5rem; max-width: 3.5rem; }
    .saisie-col-req { width: 36px; min-width: 36px; max-width: 36px; }
    .note-input { max-width: 52px; font-size: .75rem; }
    .saisie-col-num { width: 2rem; min-width: 1.5rem; }
}
