/* Conservatoire Marcel Landowski — feuille de style.
   Les tons reprennent ceux de MDB Spectacle pour que les deux applications se
   ressemblent, sans partager de fichier : ce sont deux applications distinctes. */
:root {
  --bg:        #0d1117;
  --bg-2:      #161b22;
  --bg-3:      #1c2128;
  --border:    #30363d;
  --texte:     #e6edf3;
  --texte-mut: #8b949e;
  --accent:    #58a6ff;
  --vert:      #3fb950;
  --orange:    #e3b341;
  --rouge:     #f85149;
  --violet:    #a371f7;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--texte);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Barre du haut ── */
.topbar {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: .7rem 1.2rem; background: var(--bg-2); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .6rem; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; font-weight: 800; font-size: .8rem;
  background: linear-gradient(135deg, #a371f7, #58a6ff); color: #fff; letter-spacing: .02em;
}
.brand-txt { font-weight: 700; }
.tabs { display: flex; gap: .3rem; flex: 1; flex-wrap: wrap; }
.tabs a {
  padding: .4rem .8rem; border-radius: 7px; color: var(--texte-mut); font-size: .9rem; font-weight: 600;
}
.tabs a:hover { background: var(--bg-3); color: var(--texte); text-decoration: none; }
.tabs a.actif { background: var(--bg-3); color: var(--accent); }
.user { font-size: .84rem; color: var(--texte-mut); display: flex; align-items: center; gap: .55rem; }
.user .role {
  padding: .1rem .45rem; border-radius: 5px; font-size: .7rem; font-weight: 700;
  background: rgba(163,113,247,.15); color: var(--violet);
}
.deco { font-size: .8rem; }

main { padding: 1.3rem 1.2rem 4rem; max-width: 1500px; margin: 0 auto; }
h1 { font-size: 1.2rem; margin: 0 0 .2rem; }
.sous-titre { color: var(--texte-mut); font-size: .85rem; margin: 0 0 1.1rem; }

/* ── Barre d'outils ── */
.barre {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: .6rem .8rem; margin-bottom: 1rem;
}
.barre .semaine { font-weight: 700; }

select, input[type=text], input[type=date], input[type=time], input[type=number],
input[type=email], input[type=password], textarea {
  background: var(--bg); color: var(--texte); border: 1px solid var(--border);
  border-radius: 7px; padding: .4rem .55rem; font-size: .88rem; font-family: inherit;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { font-size: .78rem; color: var(--texte-mut); display: block; margin-bottom: .18rem; }

.btn {
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  padding: .42rem .85rem; border-radius: 7px; font-size: .86rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-3); color: var(--texte);
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primaire { background: linear-gradient(135deg, #a371f7, #58a6ff); border: 0; color: #fff; }
.btn-fantome { background: transparent; }
.btn-danger { color: var(--rouge); border-color: rgba(248,81,73,.4); }

/* ── Grille du planning ── */
.grille { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: .5rem; }
.jour { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: .5rem; min-height: 120px; }
.jour.aujourdhui { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(88,166,255,.25); }
.jour-titre { font-size: .78rem; font-weight: 700; color: var(--texte-mut); margin-bottom: .45rem;
              display: flex; justify-content: space-between; align-items: baseline; }
.jour.aujourdhui .jour-titre { color: var(--accent); }
.jour-vide { color: var(--texte-mut); font-size: .78rem; font-style: italic; padding: .5rem 0; }

.seance {
  border-left: 3px solid var(--accent); background: var(--bg-3); border-radius: 6px;
  padding: .35rem .5rem; margin-bottom: .35rem; font-size: .8rem;
}
.seance .h { font-weight: 700; font-variant-numeric: tabular-nums; }
.seance .n { display: block; }
.seance .m { color: var(--texte-mut); font-size: .74rem; }
.seance.annulee { opacity: .55; }
.seance.annulee .n { text-decoration: line-through; }
.seance.remplacee { border-left-color: var(--orange); }

.puce { display: inline-block; padding: .05rem .4rem; border-radius: 5px; font-size: .68rem; font-weight: 700; }
.puce-annulee   { background: rgba(248,81,73,.16); color: var(--rouge); }
.puce-remplacee { background: rgba(227,179,65,.16); color: var(--orange); }

/* ── Tableaux ── */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tableau-wrap { overflow-x: auto; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
     color: var(--texte-mut); padding: .6rem .7rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: .55rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-3); }

.carte { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.carte h2 { font-size: .95rem; margin: 0 0 .8rem; }
.ligne { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-end; }
.champ { display: flex; flex-direction: column; }

.msg { padding: .6rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .88rem; }
.msg-ok    { background: rgba(63,185,80,.12);  border: 1px solid var(--vert);  color: var(--vert); }
.msg-err   { background: rgba(248,81,73,.12);  border: 1px solid var(--rouge); color: var(--rouge); }
.msg-avert { background: rgba(227,179,65,.12); border: 1px solid var(--orange); color: var(--orange); }

/* ── Connexion ── */
.connexion { max-width: 380px; margin: 8vh auto; }
.connexion .carte { padding: 1.6rem; }
.connexion .brand-mark { width: 46px; height: 46px; font-size: .95rem; margin-bottom: .9rem; }
.connexion h1 { font-size: 1.05rem; margin-bottom: 1.1rem; }
.connexion .champ { margin-bottom: .8rem; }
.connexion input { width: 100%; }
.connexion .btn { width: 100%; justify-content: center; margin-top: .4rem; }

@media (max-width: 1100px) { .grille { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grille { grid-template-columns: 1fr; } .topbar { gap: .7rem; } }

/* ── Sélecteur d'échelle (jour / semaine / mois) et onglets internes ── */
.segments { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segments a {
  padding: .4rem .8rem; font-size: .85rem; font-weight: 600; color: var(--texte-mut);
  background: var(--bg); border-right: 1px solid var(--border);
}
.segments a:last-child { border-right: 0; }
.segments a:hover { background: var(--bg-3); color: var(--texte); text-decoration: none; }
.segments a.actif { background: var(--accent); color: #08111f; }

/* ── Vue mois ── */
.grille-mois { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.entete-jour { font-size: .72rem; font-weight: 700; color: var(--texte-mut); text-transform: uppercase;
               letter-spacing: .04em; padding: .2rem .3rem; }
.case { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: .35rem; min-height: 92px; }
.case.hors-mois { opacity: .4; }
.case.aujourdhui { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(88,166,255,.25); }
.case-num { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .25rem; }
.case-num a { font-size: .8rem; font-weight: 700; color: var(--texte-mut); }
.case.aujourdhui .case-num a { color: var(--accent); }
.case-nb { font-size: .68rem; color: var(--texte-mut); }
.case .seance { padding: .18rem .3rem; margin-bottom: .18rem; font-size: .7rem; }
.case .seance .m { display: none; }
.case-plus { display: block; font-size: .68rem; color: var(--texte-mut); padding-left: .3rem; }

/* Une séance est cliquable : elle mène à sa feuille d'appel. */
a.seance { display: block; color: inherit; }
a.seance:hover { text-decoration: none; border-color: var(--accent); background: #1f2630; }

/* ── Appel ── */
.segments-appel { display: inline-flex; gap: .25rem; flex-wrap: wrap; border: 0; }
.segments-appel .opt {
  display: inline-flex; align-items: center; cursor: pointer; user-select: none;
  padding: .25rem .6rem; border-radius: 6px; font-size: .8rem; font-weight: 600;
  border: 1px solid var(--border); color: var(--texte-mut); background: var(--bg);
}
.segments-appel .opt input { display: none; }
.segments-appel .opt:hover { border-color: var(--accent); }
.segments-appel .opt.actif.opt-present { background: rgba(63,185,80,.18);  color: var(--vert);   border-color: var(--vert); }
.segments-appel .opt.actif.opt-retard  { background: rgba(227,179,65,.18); color: var(--orange); border-color: var(--orange); }
.segments-appel .opt.actif.opt-absent  { background: rgba(248,81,73,.18);  color: var(--rouge);  border-color: var(--rouge); }
.segments-appel .opt.actif.opt-excuse  { background: rgba(163,113,247,.18);color: var(--violet); border-color: var(--violet); }

.puce-mineur  { background: rgba(163,113,247,.16); color: var(--violet); }
.puce-fait    { background: rgba(63,185,80,.16);   color: var(--vert); }
.puce-attente { background: rgba(227,179,65,.16);  color: var(--orange); }

details.carte > summary { cursor: pointer; font-weight: 700; font-size: .95rem; list-style: none; }
details.carte > summary::-webkit-details-marker { display: none; }
details.carte > summary::before { content: '▸ '; color: var(--texte-mut); }
details.carte[open] > summary::before { content: '▾ '; }

@media (max-width: 900px) { .grille-mois { grid-template-columns: repeat(7, minmax(52px, 1fr)); font-size: .9em; } }

/* Le retour depuis une fiche : la fiche occupe l'écran, ce lien en sort. */
.retour { display: inline-block; font-size: .85rem; font-weight: 600; margin-bottom: .7rem; }

/* ══ Tableaux : des classes, plus de style au cas par cas ═══════════════════
   GLC 2026-08-09 : « revoir l'alignement des colonnes… essaye de factoriser et
   d'homogénéiser ». Les mêmes réglages étaient répétés en `style=` sur chaque
   cellule, d'un écran à l'autre et d'un jour à l'autre — donc jamais tout à
   fait pareils. Ils vivent ici, une fois. */

/* Une colonne d'heures ou de dates : chiffres alignés, jamais coupés. */
.num, td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Une colonne de boutons : à droite, sur une seule ligne. */
td.actions, th.actions { text-align: right; white-space: nowrap; }
/* La seconde ligne d'une cellule — professeur, horaire, précision. */
.sous { display: block; font-size: .78rem; color: var(--texte-mut); }
/* La pastille de couleur d'une salle. */
.pastille { display: inline-block; width: 9px; height: 9px; border-radius: 3px;
            margin-right: .45rem; vertical-align: baseline; }

/* ⚠️ Une table par jour = des largeurs différentes à chaque jour, et rien ne
   s'aligne verticalement. Une seule table pour toute la période, avec des
   largeurs FIXES : les colonnes se répondent d'un bout à l'autre. */
table.fixe { table-layout: fixed; width: 100%; }
table.fixe th, table.fixe td { overflow-wrap: anywhere; }
/* Une ligne de séparation de jour à l'intérieur de la table. */
tr.jour-sep td {
  background: var(--bg-3); font-weight: 700; font-size: .84rem;
  padding: .5rem .7rem; border-top: 1px solid var(--border); position: sticky; top: 0;
}
tr.jour-sep:first-child td { border-top: 0; }
