/* ========================================
   jurys/mes_jurys.html
   ======================================== */

/* Grille miniature */
.jd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .6rem; }
.jd-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-decoration: none; color: var(--color-text);
    padding: .7rem .3rem; border-radius: 10px;
    transition: background .2s, transform .2s, box-shadow .2s;
    position: relative; text-align: center;
}
.jd-item:hover { background: var(--jury-hover, #f0f9ff); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.jd-item .jd-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: #fff; margin-bottom: .35rem;
    transition: transform .2s;
}
.jd-item:hover .jd-icon { transform: scale(1.12); }
.jd-item .jd-label { font-size: .78rem; font-weight: 600; line-height: 1.2; }
/* Tooltip au survol */
.jd-item .jd-tip {
    position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    background: #1e293b; color: #fff; font-size: .72rem; white-space: nowrap;
    padding: .3rem .6rem; border-radius: 5px; opacity: 0; pointer-events: none;
    transition: opacity .2s; z-index: 20;
}
.jd-item .jd-tip::after {
    content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 4px solid transparent; border-top-color: #1e293b;
}
.jd-item:hover .jd-tip { opacity: 1; }
/* Badge session */
.jd-badge { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; }
/* Sections */
.jd-section { margin-bottom: 1.2rem; }
.jd-section-title {
    font-size: .88rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    padding-bottom: .4rem; margin-bottom: .6rem; border-bottom: 2px solid var(--color-border, #e2e8f0);
    display: flex; align-items: center; gap: .4rem;
}
/* Stats compactes */
.jd-stats { display: flex; gap: .75rem; flex-wrap: wrap; }
.jd-stat {
    display: flex; align-items: center; gap: .4rem;
    background: var(--color-background-white, #fff); border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px; padding: .35rem .6rem; font-size: .72rem;
}
.jd-stat-num { font-weight: 700; font-size: .85rem; }
.jd-stat-label { color: var(--color-text-muted, #64748b); }
/* Progression compacte */
.jd-prog { display: flex; align-items: center; gap: .4rem; font-size: .68rem; margin-bottom: .25rem; }
.jd-prog-bar { flex: 1; height: 4px; background: var(--color-border, #e2e8f0); border-radius: 2px; overflow: hidden; }
.jd-prog-fill { height: 100%; border-radius: 2px; transition: width .6s; }
.jd-prog-code { width: 60px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jd-prog-pct { width: 28px; text-align: right; color: var(--color-text-muted, #64748b); }
/* Mobile */
@media (max-width: 575.98px) {
    .jd-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .4rem; }
    .jd-item { padding: .5rem .2rem; }
    .jd-item .jd-icon { width: 40px; height: 40px; font-size: .95rem; border-radius: 10px; }
    .jd-item .jd-label { font-size: .7rem; }
    .jd-item .jd-tip { display: none; }
    .jd-section-title { font-size: .8rem; }
    .jd-stats { gap: .4rem; }
    .jd-stat { padding: .25rem .4rem; font-size: .65rem; }
}

/* ========================================
   jurys/saisie_notes.html
   ======================================== */

.jurys-toast-container{position:fixed;top:70px;right:20px;z-index:1080;display:flex;flex-direction:column;gap:8px;max-width:420px;pointer-events:none}
.jurys-toast{pointer-events:auto;padding:10px 36px 10px 14px;border-radius:6px;font-size:.85rem;color:#fff;box-shadow:0 4px 12px rgba(0,0,0,.2);opacity:0;transform:translateX(40px);animation:toastIn .3s ease forwards;position:relative}
.jurys-toast.alert-success{background:#198754}
.jurys-toast.alert-warning{background:#ffc107;color:#333}
.jurys-toast.alert-error,.jurys-toast.alert-danger{background:#dc3545}
.jurys-toast.alert-info{background:#0d6efd}
.jurys-toast.toast-out{animation:toastOut .4s ease forwards}
.jurys-toast-close{position:absolute;top:6px;right:10px;background:none;border:none;color:inherit;font-size:1.1rem;cursor:pointer;opacity:.7;line-height:1}
.jurys-toast-close:hover{opacity:1}
@keyframes toastIn{to{opacity:1;transform:translateX(0)}}
@keyframes toastOut{to{opacity:0;transform:translateX(40px)}}

/* Mobile (lot D) : la colonne « Nom » reste visible pendant le défilement
   horizontal du tableau (le n° est masqué sous 768px, Nom est la 1re). */
@media (max-width: 767.98px) {
    #notes-table .saisie-col-nom {
        position: sticky;
        inset-inline-start: 0;
        z-index: 2;
        box-shadow: inset -1px 0 0 var(--color-border);
    }
    #notes-table thead .saisie-col-nom { z-index: 21; }
    /* noms lisibles (12px au lieu de 9-10px), sur deux lignes au besoin
       pour que la colonne figée ne mange pas l'écran */
    /* !important : l'ajustement automatique (saisie_notes.js) pose la
       largeur du nom le plus long en style en ligne */
    #notes-table .saisie-col-nom { width: 130px !important; min-width: 110px !important; max-width: 130px !important; }
    #notes-table .saisie-col-nom small { font-size: .75rem !important; white-space: normal; overflow-wrap: anywhere; }
}
/* Écrans tactiles : champs de note à 16px, sinon iOS zoome la page à
   chaque saisie ; cellules élargies en conséquence. */
@media (pointer: coarse) and (max-width: 991.98px) {
    #notes-table .note-input { font-size: 1rem; max-width: 64px; min-height: 40px; }
    #notes-table .saisie-col-input { width: 66px; min-width: 62px; max-width: 70px; }
}

/* ========================================
   jurys/valider_notes_jury.html
   ======================================== */

.multiselect-wrap { position: relative; }
.multiselect-box {
    display: flex; align-items: center; cursor: pointer;
    background: #fff; min-height: 31px;
}
.multiselect-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
    background: #fff; border: 1px solid #dee2e6; border-radius: 0 0 .25rem .25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.15); padding: 6px; max-height: 260px;
    overflow-y: auto;
}
.multiselect-option {
    display: flex; align-items: center; gap: 6px; padding: 3px 4px;
    cursor: pointer; font-size: .8rem; border-radius: 3px;
}
.multiselect-option:hover { background: #f0f0f0; }
.multiselect-option.ms-hidden { display: none; }
.multiselect-option input[type="checkbox"] { margin: 0; }
.multiselect-all { border-bottom: 1px solid #eee; margin-bottom: 2px; padding-bottom: 4px; }
.multiselect-badge {
    font-size: .6rem; padding: 1px 5px; border-radius: 8px;
    background: #e9ecef; color: #555; margin-left: auto; white-space: nowrap;
}

/* ========================================
   jurys/generation.html
   ======================================== */

/* ===== Page Génération — responsive PC / tablette / téléphone ===== */
.gen-head { display: flex; justify-content: space-between; align-items: flex-start;
    gap: .75rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.gen-head h1 { font-size: 1.3rem; font-weight: 700; margin: 0; line-height: 1.25; }
.gen-head .gen-sub { color: var(--color-text-muted, #64748b); font-size: .82rem; }

.gen-section { margin-bottom: 1.6rem; }
.gen-section__title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
    color: var(--color-text-secondary, #475569); padding-bottom: .4rem; margin-bottom: .9rem;
    border-bottom: 2px solid var(--color-border, #e2e8f0); display: flex; align-items: center; gap: .45rem; }

.gen-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.gen-card { background: var(--color-background-white, #fff); border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease; }
.gen-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0,0,0,.10); }
/* Cartes contenant des menus deroulants : autoriser le debordement du panneau */
.gen-card--drop { overflow: visible; }
.gen-card--drop .gen-card__head { border-radius: 14px 14px 0 0; }
.gen-card__head { display: flex; align-items: center; gap: .65rem; padding: .85rem 1rem; color: #fff; }
.gen-card__icon { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: flex;
    align-items: center; justify-content: center; background: rgba(255,255,255,.22); font-size: 1.1rem; }
.gen-card__title { font-weight: 700; font-size: .98rem; line-height: 1.2; }
.gen-card__body { padding: 1rem; display: flex; flex-direction: column; gap: .8rem; flex: 1 1 auto; }
.gen-card__desc { color: var(--color-text-muted, #64748b); font-size: .82rem; margin: 0; }
.gen-card__form { display: flex; flex-direction: column; gap: .85rem; margin-top: auto; }

.gen-field > label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
    color: var(--color-text-secondary, #475569); display: block; margin-bottom: .3rem; }

.gen-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%;
    min-height: 46px; border: none; border-radius: 10px; font-weight: 600; font-size: .9rem; cursor: pointer;
    color: #fff; text-decoration: none; transition: filter .15s ease, transform .1s ease; }
.gen-btn:hover { filter: brightness(1.07); color: #fff; }
.gen-btn:active { transform: scale(.985); }
.gen-btn.is-outline { background: transparent !important; border: 2px solid currentColor; }

.acc-primary { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.acc-amber   { background: linear-gradient(135deg, #b45309, #f59e0b); }
.acc-green   { background: linear-gradient(135deg, #15803d, #22c55e); }
.acc-cyan    { background: linear-gradient(135deg, #0e7490, #06b6d4); }

.btn-primary2 { background: #1d4ed8; }
.btn-amber2   { background: #b45309; }
.btn-dark2    { background: #334155; }
.btn-green2   { background: #15803d; }
.btn-cyan2    { background: #0e7490; }
.btn-red2     { background: #b91c1c; }
.gen-btn-row { display: flex; gap: .5rem; }
.gen-btn-row .gen-btn { flex: 1; }
.gen-btn.is-outline.btn-green2 { color: #15803d; }
.gen-btn.is-outline.btn-cyan2  { color: #0e7490; }

/* ===== Menu déroulant multi-sélection à cases à cocher ===== */
.ms { position: relative; }
.ms-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .5rem;
    min-height: 46px; padding: .5rem .8rem; border: 1px solid var(--color-border, #e2e8f0); border-radius: 10px;
    background: var(--color-background-white, #fff); color: var(--color-text, #1e293b); cursor: pointer;
    font-size: .9rem; text-align: left; }
.ms-toggle:hover { border-color: var(--color-primary, #066); }
.ms.open .ms-toggle { border-color: var(--color-primary, #066); box-shadow: 0 0 0 .18rem rgba(0,102,51,.15); }
.ms-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-value.is-empty { color: var(--color-text-muted, #94a3b8); }
.ms-toggle .fa-chevron-down { font-size: .72rem; color: var(--color-text-muted, #64748b);
    transition: transform .2s ease; flex-shrink: 0; }
.ms.open .ms-toggle .fa-chevron-down { transform: rotate(180deg); }
/* Panneau flottant (absolu) : n'agrandit PAS la carte -> boutons figés.
   Hauteur limitee a ~3 options puis defilement. */
.ms-panel { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
    max-height: 116px; overflow-y: auto; border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 10px; padding: .3rem; background: var(--color-background-white, #fff);
    box-shadow: 0 10px 26px rgba(0,0,0,.18); }
.ms-opt { display: flex; align-items: center; gap: .55rem; padding: .45rem .55rem; border-radius: 7px;
    cursor: pointer; font-size: .86rem; color: var(--color-text, #1e293b); }
.ms-opt:hover { background: var(--color-background-white, #fff); }
.ms-opt input { width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--color-primary, #066); }
.ms-opt--all { font-weight: 700; }
.ms-grp { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    color: var(--color-text-muted, #64748b); padding: .45rem .55rem .2rem; }
.ms--error .ms-toggle { border-color: #dc2626; }
.ms-err { display: none; font-size: .7rem; color: #dc2626; margin-top: .25rem; }
.ms--error .ms-err { display: block; }

/* Semestres / Niveaux (champs "driver") : options en ligne (chips) */
[data-ms-driver] .ms-opt:not(.ms-opt--all) { display: inline-flex; width: auto;
    margin: .12rem .2rem .12rem 0; padding: .35rem .5rem; }
[data-ms-driver] .ms-grp { display: block; }

/* Bannière relevés */
.gen-banner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: var(--color-background-white, #fff); border: 1px solid var(--color-border, #e2e8f0);
    border-left: 5px solid #334155; border-radius: 14px; padding: 1rem 1.1rem; }
.gen-banner__icon { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; display: flex;
    align-items: center; justify-content: center; background: linear-gradient(135deg,#1e293b,#475569);
    color: #fff; font-size: 1.2rem; }
.gen-banner__text { flex: 1 1 220px; }
.gen-banner__text strong { font-size: .95rem; }
.gen-banner__text p { margin: .1rem 0 0; font-size: .82rem; color: var(--color-text-muted,#64748b); }
.gen-banner .gen-btn { width: auto; padding: 0 1.1rem; }

@media (max-width: 575.98px) {
    .gen-grid { grid-template-columns: 1fr; gap: .8rem; }
    .gen-head h1 { font-size: 1.1rem; }
    .gen-card__body { padding: .85rem; }
    .gen-banner { flex-direction: column; align-items: flex-start; }
    .gen-banner .gen-btn { width: 100%; }
}

/* ========================================
   jurys/gestion_publications.html
   ======================================== */

.rapport-dialog { width: min(760px, 94vw); border: none; border-radius: .6rem;
    padding: 1.1rem 1.3rem; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.rapport-dialog.expanded { width: min(1200px, 98vw); }
.rapport-dialog::backdrop { background: rgba(0,0,0,.45); }
.rapport-dialog .chip { background:#eef2ff; color:#3730a3; border-radius:1rem;
    padding:.15rem .6rem; font-weight:600; white-space:nowrap; }
.rapport-dialog textarea { font-size:.82rem; line-height:1.35; }
.rapport-dialog.expanded textarea { font-size:.95rem; }
.rapport-dialog.expanded #dlgIntro, .rapport-dialog.expanded #dlgConcl { min-height: 220px; }

/* ========================================
   jurys/resultat_etudiant.html
   ======================================== */

@media (max-width: 575.98px) {
    .resultat-detail-table th,
    .resultat-detail-table td { font-size: .75rem; padding: .15rem .25rem !important; }
    /* la matière reste visible si le tableau défile horizontalement */
    .resultat-detail-table .col-matiere {
        position: sticky;
        inset-inline-start: 0;
        z-index: 1;
        background: var(--color-background-white);
    }
    .resultat-detail-table .col-matiere { white-space: normal; word-break: break-word; min-width: 90px; max-width: 140px; }
    .resultat-detail-table .col-obs { max-width: 32px; padding-left: 0 !important; padding-right: 0 !important; }
    .resultat-ue-header { font-size: .8rem; }
}
body.dark-mode #dd-filiere,
body.dark-mode #dd-niveau { background: var(--color-background-white) !important; color: var(--color-text); border-color: var(--color-border) !important; }
