/* Compléments à la charte UGB (plateforme.css) propres au suivi des salles */
.logo { gap: 10px; }
.logo-titre { font-family: Georgia, serif; color: var(--marron-cuivre); font-weight: 700;
    font-size: 14px; line-height: 1.15; }
.nav-user { display: flex !important; align-items: center; gap: 6px; color: var(--marron-cuivre) !important; }
.nav-user i { font-size: 18px; }
.nav-user span { display: flex; flex-direction: column; line-height: 1.15; font-weight: 600; font-size: 13px; }
.nav-user small { font-weight: 400; font-size: 11px; color: var(--gris-fonce); }

.page { padding-top: 30px; padding-bottom: 50px; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
    gap: 12px; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 2px solid var(--beige-clair); }
.page-header h1 { margin: 0; font-size: 26px; }
.page-header .sous-titre { color: var(--gris-fonce); margin: 4px 0 0; font-size: .92rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.bandeau-hero { background: linear-gradient(135deg, var(--marron-cuivre), #6B3A1F); color: #fff;
    padding: 42px 0 36px; }
.bandeau-hero h1 { color: #fff; font-size: 30px; margin-bottom: 8px; }
.bandeau-hero p { color: rgba(255,255,255,.85); margin: 0; max-width: 720px; }
.bandeau-hero .actions { margin-top: 20px; }
.bandeau-hero .btn-light { background: #fff; color: var(--marron-cuivre); }

/* Filtres */
.filtres { background: var(--beige-tres-clair); border: 1px solid var(--beige-clair); border-radius: 10px;
    padding: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 18px; }
.filtres .champ { display: flex; flex-direction: column; gap: 3px; min-width: 150px; flex: 1 1 150px; }
.filtres label { font-size: .78rem; font-weight: 600; color: var(--gris-fonce); }
.filtres .form-control, .filtres .form-select { padding: 7px 10px; font-size: .9rem; }
.navigation-semaine { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.navigation-semaine strong { font-family: Georgia, serif; color: var(--marron-cuivre); }

/* Statuts des séances */
.statut { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: .76rem; font-weight: 600;
    white-space: nowrap; }
.statut-BROUILLON { background: #e9ecef; color: #495057; }
.statut-PREVUE { background: #d1ecf1; color: #0c5460; }
.statut-EFFECTUEE { background: #d4edda; color: #155724; }
.statut-NON_EFFECTUEE { background: #f8d7da; color: #721c24; }
.statut-SANS_REPONSE { background: #fff3cd; color: #856404; }
.statut-ANNULEE { background: #e2e3e5; color: #6c757d; text-decoration: line-through; }

/* Grille hebdomadaire */
.semaine-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.jour-col { background: #fff; border: 1px solid var(--beige-clair); border-radius: 10px; overflow: hidden; }
.jour-col.aujourdhui { border-color: var(--marron-cuivre); box-shadow: 0 0 0 2px rgba(160,90,44,.15); }
.jour-entete { background: var(--beige-clair); color: var(--marron-cuivre); padding: 8px 10px; font-weight: 700;
    font-size: .88rem; display: flex; justify-content: space-between; }
.jour-vide { padding: 14px 10px; color: var(--gris-argente); font-size: .82rem; text-align: center; }
.creneau { display: block; padding: 8px 10px; border-top: 1px solid #f0ebe0; color: var(--noir);
    text-decoration: none; font-size: .82rem; line-height: 1.35; border-left: 4px solid var(--info); }
a.creneau:hover { background: var(--beige-tres-clair); }
.creneau .heure { font-weight: 700; color: var(--marron-cuivre); }
.creneau .ligne2 { color: var(--gris-fonce); font-size: .78rem; }
.creneau.st-EFFECTUEE { border-left-color: var(--success); }
.creneau.st-NON_EFFECTUEE { border-left-color: var(--danger); }
.creneau.st-SANS_REPONSE { border-left-color: var(--warning); }
.creneau.st-ANNULEE { border-left-color: var(--gris-argente); opacity: .6; }
.creneau.st-ANNULEE .matiere { text-decoration: line-through; }

/* Légende */
.legende { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }

/* Cartes de salles (accueil public) */
.salles-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.salle-tuile { border-radius: 8px; padding: 9px 10px; font-size: .82rem; text-decoration: none; color: var(--noir);
    border: 1px solid #d9eedd; background: #f1faf3; display: block; }
.salle-tuile.occupee { background: #fbecec; border-color: #f2c6c6; }
.salle-tuile strong { display: block; font-size: .88rem; }
.salle-tuile small { color: var(--gris-fonce); }
.point { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; background: var(--success); }
.occupee .point { background: var(--danger); }

/* Tableaux */
.tableau { width: 100%; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.tableau td, .tableau th { padding: 9px 10px; font-size: .88rem; vertical-align: top; }
.tableau .num { text-align: right; white-space: nowrap; }
.ligne-alerte td { background: #fff7f7; }
.ligne-attention td { background: #fffbea; }
.brut { display: block; font-size: .72rem; color: var(--gris-fonce); font-style: italic; }
.non-reconnu { color: var(--danger); font-weight: 600; font-size: .75rem; }
.controle .form-control, .controle .form-select { padding: 5px 7px; font-size: .82rem; min-width: 90px; }
.controle input[type=time] { min-width: 88px; }

.barre { background: #eee; border-radius: 6px; height: 8px; overflow: hidden; min-width: 80px; }
.barre > span { display: block; height: 100%; background: var(--marron-cuivre); }
.barre.verte > span { background: var(--success); }

.carte { background: #fff; border-radius: 12px; box-shadow: 0 3px 15px rgba(0,0,0,.07); padding: 20px; margin-bottom: 20px; }
.carte h3 { font-size: 18px; margin-bottom: 12px; }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.grille-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 3px 15px rgba(0,0,0,.07);
    border-top: 4px solid var(--marron-cuivre); }
.kpi .valeur { font-size: 30px; font-weight: 700; color: var(--marron-cuivre); font-family: Georgia, serif; line-height: 1.1; }
.kpi .libelle { font-size: .84rem; color: var(--gris-fonce); }
.kpi.vert { border-top-color: var(--success); } .kpi.vert .valeur { color: var(--success); }
.kpi.rouge { border-top-color: var(--danger); } .kpi.rouge .valeur { color: var(--danger); }
.kpi.bleu { border-top-color: var(--info); } .kpi.bleu .valeur { color: var(--info); }

.fiche dt { font-weight: 600; color: var(--gris-fonce); font-size: .82rem; margin-top: 10px; }
.fiche dd { margin: 0; }
.vide { text-align: center; color: var(--gris-fonce); padding: 30px 10px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; white-space: pre-wrap; }

/* Délégués (mobile d'abord) */
.carte-delegue { max-width: 520px; margin: 0 auto; }
.choix-oui-non { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 14px; }
.choix-oui-non label { border: 2px solid var(--beige-clair); border-radius: 10px; padding: 14px; text-align: center;
    cursor: pointer; font-weight: 600; }
.choix-oui-non input { display: none; }
.choix-oui-non input:checked + span { color: var(--marron-cuivre); }
.choix-oui-non label:has(input:checked) { border-color: var(--marron-cuivre); background: var(--beige-tres-clair); }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-family: ui-monospace, Menlo, monospace; }

@media (max-width: 768px) {
    .page { padding: 20px 16px 40px; }
    .page-header h1 { font-size: 22px; }
    .bandeau-hero h1 { font-size: 24px; }
    .logo-titre { display: none; }
}

/* Étapes numérotées (import des salles) */
.etape { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
         margin-right: 6px; border-radius: 50%; background: var(--marron-cuivre); color: #fff; font-size: .85rem; }

/* Retours non lus dans la navigation */
.badge-retours { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--marron-cuivre);
  color: #fff; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; font-family: 'Open Sans', sans-serif; }

/* Listes déroulantes hors des barres de filtre : même apparence que les champs de saisie */
select.form-select { width: 100%; padding: 12px 40px 12px 16px; border: 1px solid var(--gris-argente); border-radius: 4px;
  font-size: 14px; background-color: var(--blanc); color: inherit; }
select.form-select:focus { outline: none; border-color: var(--marron-cuivre); box-shadow: 0 0 0 3px rgba(160, 90, 44, 0.1); }

/* Pagination côté serveur (liens) : même apparence que les boutons de pagination */
a.pg-btn, span.pg-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.journal-details { font-size: .85rem; word-break: break-word; min-width: 260px; }

/* ── Téléphone et tablette ─────────────────────────────────────────────── */
/* Navigation de semaine : les flèches restent sur une ligne (les boutons ne s'étirent pas) */
.navigation-semaine { justify-content: center; }
.navigation-semaine .btn { width: auto; flex: 0 0 auto; }
.navigation-semaine strong { text-align: center; }

@media (max-width: 640px) {
    /* Tableaux empilés en fiches : une carte par ligne, l'intitulé de colonne devant chaque valeur */
    table.tableau-fiches, .tableau-fiches tbody, .tableau-fiches tr, .tableau-fiches td { display: block; width: 100%; }
    .tableau-fiches thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .tableau-fiches tr { background: #fff; border: 1px solid var(--beige-clair); border-radius: 10px;
        margin-bottom: 10px; padding: 6px 12px; }
    .tableau-fiches tr.pg-hors-page { display: none; }
    .tableau-fiches td { position: relative; border: none !important; padding: 7px 0 7px 40%; min-height: 32px;
        text-align: left !important; word-break: break-word; }
    .tableau-fiches td + td { border-top: 1px dashed var(--beige-clair) !important; }
    .tableau-fiches td::before { content: attr(data-label); position: absolute; left: 0; top: 7px; width: 37%;
        font-weight: 600; font-size: .8rem; color: var(--marron-cuivre); }
    .tableau-fiches td:not([data-label])::before, .tableau-fiches td[data-label=""]::before { content: none; }
    .tableau-fiches td:not([data-label]), .tableau-fiches td[data-label=""], .tableau-fiches td.vide { padding-left: 0; }
    .tableau-fiches td .btn { width: auto; }
    .journal-details { min-width: 0; }

    /* Filtres : un champ par ligne, bouton pleine largeur */
    .filtres .champ { flex: 1 1 100%; min-width: 0; }
    .page-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .page-header .actions { justify-content: flex-start; flex-wrap: wrap; }
    .page-header .actions .btn { flex: 1 1 auto; }
    .carte { padding: 14px; }
    .retour-reponse { margin-left: 0 !important; margin-right: 0 !important; }
}

@media (min-width: 641px) and (max-width: 1024px) {
    /* Tablette : filtres sur deux colonnes */
    .filtres .champ { flex: 1 1 calc(50% - 10px); min-width: 0; }
}

/* Tablette en paysage et petits écrans d'ordinateur : menu compact (icônes pour le compte et la déconnexion) */
@media (min-width: 769px) and (max-width: 1280px) {
    .logo-titre { display: none; }
    .nav-menu { gap: 8px; }
    .nav-links { gap: 8px; }
    .nav-links a { font-size: 14px; }
    .nav-user span, .nav-texte { display: none !important; }
}
@media (min-width: 769px) and (max-width: 900px) {
    .nav-texte-etroit { display: none; }
    .nav-links { gap: 6px; }
    .nav-links a { font-size: 13px; }
}

/* Avis public : l'emploi du temps peut changer (en rouge) */
.avis-maj { color: #b02a37; background: #fdecee; border: 1px solid #f1aeb5; border-radius: 8px; padding: 10px 14px;
    font-weight: 600; font-size: .92rem; margin: 6px 0 14px; }
.avis-maj i { margin-right: 6px; }
@media (max-width: 640px) {
    .navigation-semaine { flex-wrap: nowrap; gap: 8px; }
    .navigation-semaine strong { flex: 1 1 auto; font-size: .95rem; }
}

/* Espace des responsables de classe : trois choix par séance */
.choix-trois { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choix-trois label:has(input:disabled) { opacity: .45; cursor: not-allowed; }
@media (max-width: 420px) { .choix-trois { grid-template-columns: 1fr; } }

/* ── Sous-menus de la navigation (ordinateur et tablette) ─────────────────────
   Le sous-menu était séparé de l'intitulé par 5 px vides : en y descendant, la souris quittait le survol
   et le menu se refermait. Pont invisible entre les deux, fermeture retardée (trajets en diagonale),
   ouverture aussi au clic et au clavier. */
@media (min-width: 769px) {
    .dropdown > .dropdown-menu {
        display: block; visibility: hidden; opacity: 0; transform: translateY(4px);
        top: 100%; margin-top: 6px;
        transition: opacity .15s ease, transform .15s ease, visibility 0s linear .3s;
    }
    .dropdown > .dropdown-menu::before {   /* pont : couvre l'espace entre l'intitulé et le sous-menu */
        content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px;
    }
    .dropdown:hover > .dropdown-menu,
    .dropdown:focus-within > .dropdown-menu,
    .dropdown.active > .dropdown-menu {
        visibility: visible; opacity: 1; transform: none; transition-delay: 0s;
    }
    .dropdown-toggle .fa-chevron-down { transition: transform .15s ease; }
    .dropdown:hover .dropdown-toggle .fa-chevron-down,
    .dropdown.active .dropdown-toggle .fa-chevron-down { transform: rotate(180deg); }
}

/* Écran de contrôle : début et fin l'un sous l'autre, dans leur colonne (ils débordaient sur « Salle ») */
.controle .cellule-horaire { display: flex; flex-direction: column; gap: 4px; min-width: 96px; }
.controle .cellule-horaire input { width: 100%; min-width: 0; }
.cours-commun { display: block; margin-top: 3px; font-size: .74rem; color: var(--info, #17a2b8); }

/* Écran de contrôle : barre de filtres */
.filtres-controle { align-items: flex-end; }
.filtres-controle .filtre-boutons { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.filtres-controle .filtre-boutons .btn { width: auto; }

/* Bandeau « Plateforme en mode test » (MODE_TEST=1), fixé au-dessus de l'en-tête */
.bandeau-test {
    position: fixed; top: 0; left: 0; right: 0; height: 32px; z-index: 1001;
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px;
    background: #c62828; color: #fff; font-size: .9rem; letter-spacing: .02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.mode-test header { top: 32px; }
body.mode-test > main { padding-top: 117px; }
body.mode-test .flash-messages { top: 112px; }
@media (max-width: 600px) { .bandeau-test-detail { display: none; } }
@media print { .bandeau-test { position: static; } body.mode-test header { top: 0; } }
