/* Page d'affichage ESH25 : par-dessus ve2cuy.css (thème des sites de cours). */

.wrap { max-width: 1200px; }
.c-red { color: var(--red); }

/* En-tête et tableau de bord (repris du tableau de la session des sites de cours) */
.hero.esh { padding: 48px 0 8px; }
.hero.esh .wrap.hero-row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 28px 40px; }
.hero.esh .hero-text { flex: 4 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.hero.esh h1 { font-size: clamp(32px, 4vw, 50px); }
.meter {
  flex: 6 1 480px; min-width: 0; padding: 20px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel);
  box-shadow: 0 40px 80px -40px rgba(242, 169, 59, .16); display: flex; flex-direction: column; gap: 16px;
}
.meter-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.meter-head .title { letter-spacing: .12em; text-transform: uppercase; }
.readouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.readout { padding: 16px; border-radius: 12px; background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.readout .lbl { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.readout .val { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.05; font-variant-numeric: tabular-nums; }
.readout .sub { font-family: var(--mono); font-size: 12px; color: var(--muted); }
#etat-maj::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--green); vertical-align: 1px; }
@media (max-width: 480px) { .readouts { grid-template-columns: 1fr; } }

main.wrap { padding-top: 28px; padding-bottom: 64px; }

/* Filtres */
.filtres {
  display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 16px 24px; align-items: start;
  padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
}
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ > span, .types legend { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
select, .bouton {
  height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--fg); font: 500 14.5px var(--body);
}
.bouton { cursor: pointer; }
.bouton:hover, .type:hover { border-color: var(--amber); }
.types { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.types legend { margin-bottom: 6px; padding: 0; }
.type {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 500 13.5px var(--body); cursor: pointer;
}
.type i, .badge i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.type .n { font-family: var(--mono); font-size: 12px; opacity: .8; }
.type[aria-pressed="true"] { background: color-mix(in srgb, currentColor 15%, transparent); border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; font-weight: 600; }
.type.c-neutre i { background: var(--muted); }
.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px; }
.actions .champ { flex-direction: row; align-items: center; gap: 10px; }
.bascule { display: inline-flex; align-items: center; gap: 8px; height: 40px; font-size: 14.5px; color: var(--muted); cursor: pointer; }
.bascule input { width: 18px; height: 18px; accent-color: var(--amber); }
#f-effacer { margin-left: auto; }

/* Couleurs des types d'événements */
.c-rouge { color: var(--red); } .c-vert { color: var(--green); } .c-ambre { color: var(--amber); }
.c-violet { color: var(--violet); } .c-neutre { color: var(--muted); } .type.c-cyan { color: var(--cyan); }

.resume { margin: 18px 2px 10px; font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* Liste des événements : une grille par ligne, des cartes sur un petit écran */
.table-evt { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.ligne {
  display: grid; grid-template-columns: 64px minmax(150px, 1.1fr) minmax(190px, 1.4fr) minmax(150px, 1fr) 236px 176px;
  gap: 4px 16px; align-items: center; padding: 10px 16px; width: 100%;
}
.ligne.entete { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line); }
.evt {
  border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent;
  background: transparent; color: var(--fg); font: 15px/1.4 var(--body); text-align: left; cursor: pointer;
}
.evt:last-child { border-bottom: 0; }
.evt:hover { background: var(--panel-2); }
.evt.c-rouge { border-left-color: var(--red); background: color-mix(in srgb, var(--red) 9%, transparent); }
.evt.c-violet { border-left-color: var(--violet); background: color-mix(in srgb, var(--violet) 9%, transparent); }
.evt.c-vert { border-left-color: var(--green); }
.evt.c-ambre { border-left-color: var(--amber); }
.evt.c-cyan { border-left-color: var(--cyan); }
.evt.neuf { animation: neuf 2.4s ease-out; }
@keyframes neuf { from { background: color-mix(in srgb, var(--amber) 22%, transparent); } }
@media (prefers-reduced-motion: reduce) { .evt.neuf { animation: none; } }
.evt > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--fg); }
.evt small { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt .no { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.evt .sys b { font-family: var(--mono); font-weight: 500; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.evt.c-rouge .badge { color: var(--red); } .evt.c-vert .badge { color: var(--green); } .evt.c-ambre .badge { color: var(--amber); }
.evt.c-cyan .badge { color: var(--cyan); } .evt.c-violet .badge { color: var(--violet); } .evt.c-neutre .badge i { background: var(--muted); }
.mes .m1 { font-size: 14.5px; color: var(--muted); }
.mes small { white-space: normal; }
.mes b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.hr b { font-family: var(--mono); font-weight: 500; }
.vide { margin: 0; padding: 28px 16px; color: var(--muted); text-align: center; }

/* État des appareils : une puce par bit, allumée si le bit vaut 1 */
.puces { display: flex; gap: 3px; }
.puce {
  min-width: 26px; height: 22px; padding: 0 4px; display: inline-grid; place-items: center; border-radius: 6px;
  border: 1px solid var(--line-2); font: 500 10.5px var(--mono); color: var(--muted); opacity: .55;
}
.puce.on { opacity: 1; color: var(--bg); background: var(--green); border-color: var(--green); }
.puce.on.alerte { background: var(--red); border-color: var(--red); }

@media (max-width: 1100px) {
  .ligne { grid-template-columns: 56px 1fr 1.3fr 236px; }
  .ligne .mes, .ligne .hr, .entete span:nth-child(4), .entete span:nth-child(6) { grid-column: auto; }
  .ligne .mes { grid-column: 2 / 4; grid-row: 2; }
  .ligne .hr { grid-column: 4; grid-row: 2; }
  .entete span:nth-child(4), .entete span:nth-child(6) { display: none; }
}
@media (max-width: 720px) {
  .filtres { grid-template-columns: 1fr; }
  #f-effacer { margin-left: 0; }
  .ligne.entete { display: none; }
  .ligne { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 14px; }
  .ligne .no { grid-column: 2; grid-row: 1; text-align: right; }
  .ligne .sys { grid-column: 1; grid-row: 1; }
  .ligne .type-evt { grid-column: 1 / -1; grid-row: 2; }
  .ligne .mes { grid-column: 1 / -1; grid-row: 3; }
  .ligne .app { grid-column: 1 / -1; grid-row: 4; }
  .ligne .hr { grid-column: 1 / -1; grid-row: 5; }
}

/* Détail d'un événement */
.detail {
  width: min(560px, calc(100vw - 32px)); padding: 24px; border-radius: 16px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--fg);
}
.detail::backdrop { background: rgba(5, 8, 12, .6); }
.detail h2 { margin: 0 0 16px; font: 600 22px/1.2 var(--display); }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 20px; font-size: 14.5px; }
.detail dt { color: var(--muted); font-family: var(--mono); font-size: 12.5px; padding-top: 2px; }
.detail dd { margin: 0; overflow-wrap: anywhere; }

/* Section de l'API */
.api { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.api h2 { margin: 0 0 8px; font: 600 26px var(--display); }
.api p { color: var(--muted); }
.api code { font-family: var(--mono); font-size: .88em; }
.api pre { overflow-x: auto; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; line-height: 1.6; }
.api a { color: var(--link); }

.pied { border-top: 1px solid var(--line); padding: 20px 0; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
