:root {
  --egee-nuit: #0F2A3D;
  --egee: #1C4E6E;
  --airain: #B87A3D;
  --marbre: #F6F4F0;
  --terre-cuite: #B4441F;
  --olivier: #4A6B1E;
  --pierre: #5A636D;
  --texte: #1A1F24;
  --bord: #E4DFD7;
  --filet: #EEEAE3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--marbre);
  color: var(--texte);
  font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}

a { color: var(--egee); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: #F1EEE8; padding: 1px 6px; border-radius: 4px; }

.top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--bord);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--egee-nuit); }
/* Logotype Sentinelle (_Wordmark) : les lettres dans la couleur du texte, les deux « l » en airain. Pas de jambage :
   la hauteur va du haut du « l » à la ligne de base (le cadre fait 5,34 fois plus large que haut). */
.wordmark { display: block; width: auto; }
.wordmark .wm-lettres { fill: currentColor; }
.wordmark .wm-ll { fill: var(--wm-ll, var(--airain)); }
.brand .wordmark { height: 17px; }
.menu { display: flex; align-items: center; gap: 24px; flex: 1; min-width: 0; }
.menu form { margin: 0; }
.menu-toggle { display: none; }
.top nav { display: flex; gap: 18px; flex: 1; }
.top nav a { position: relative; text-decoration: none; font-weight: 600; }
/* La rubrique où l'on est (une application, ses comptes et son historique sont sous « Applications ») : soulignée
   d'airain au ras de l'en-tête, comme l'onglet ouvert. 17 px : du bas du lien (ligne de 22,5 px centrée sur le logo de
   32 px) au filet de l'en-tête. */
.top nav a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -17px; height: 3px; border-radius: 3px 3px 0 0; background: var(--airain); }
.top nav a[aria-current] { color: var(--egee-nuit); }

/* Pied de page collé en bas de l'écran quand la page est courte (4 novembre) : le contenu prend la place qui reste.
   Largeur explicite : en colonne flexible, les marges automatiques qui centrent la page la réduiraient à son contenu. */
body.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.app > .page { flex: 1 0 auto; width: 100%; }
.page { max-width: 1280px; margin: 0 auto; padding: 24px; }
.foot { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px 20px; color: var(--pierre); font-size: 12px; }
/* Logo, logotype Sentinelle et version, sous un filet ; le logo ramène à l'accueil, comme celui de l'en-tête. */
.foot-inner { display: flex; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--bord); }
.foot-brand { display: flex; align-items: center; gap: 8px; color: var(--egee-nuit); text-decoration: none; }
.foot-brand img { flex: none; width: 22px; height: 22px; }
.foot-brand .wordmark { height: 12px; }
.foot-sep { width: 1px; height: 14px; background: var(--bord); }
.foot-version { font-variant-numeric: tabular-nums; }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 4px 0; font-size: 28px; }

/* Fil d'Ariane : tout le chemin, chaque étape cliquable ; la page elle-même est le titre qui suit. Séparateur dessiné
   (comme .chevron) : le caractère « › » tombe au niveau des minuscules. */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; row-gap: 2px; margin: 0 0 8px; padding: 0; list-style: none; font-size: 13px; line-height: 20px; }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: ""; flex: none; width: 16px; height: 16px; margin: 0 4px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3.5 10.5 8 6 12.5' fill='none' stroke='%238C939B' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.crumbs a, .crumbs span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.crumbs span { color: var(--pierre); }
.crumbs a:hover { text-decoration: underline; }
.crumbs img { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--bord); background: #fff; object-fit: contain; }

/* Titre : l'icône de l'application à côté de son nom, comme dans la liste. */
.title-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.title-row .app-icon { width: 48px; height: 48px; border-radius: 12px; }
.page-head .title-row h1 { margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
.title-text { min-width: 0; }
.title-text p { margin: 2px 0 0; }

/* Onglets : les vues d'une même chose (l'application, un compte), pas des pages à part. */
.tabs { display: flex; gap: 28px; margin: 16px 0 0; border-bottom: 1px solid var(--bord); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 8px 0 10px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--pierre); font-weight: 600; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--egee); }
.tabs a[aria-current] { color: var(--egee-nuit); border-bottom-color: var(--airain); }
.tabs a:focus-visible { outline: 2px solid var(--egee); outline-offset: -2px; border-radius: 4px 4px 0 0; }
.muted { color: var(--pierre); font-size: 13px; }
.empty { color: var(--pierre); }

.columns { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.columns > :first-child { flex: 999 1 560px; min-width: 0; }
.columns > :last-child { flex: 1 1 320px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.card { background: #fff; border: 1px solid var(--bord); border-radius: 14px; padding: 20px; overflow-x: auto; }
.card h2 { margin: 0 0 12px; font-size: 17px; }
.card h3 { margin: 20px 0 8px; font-size: 14px; color: var(--pierre); }
.danger-zone { border-color: #E9C3B5; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--pierre); padding: 8px; border-bottom: 1px solid var(--bord); }
/* Cellules à 14 px, comme les fiches (4 novembre : à 15 px, sous des intitulés de 11 px, elles paraissaient trop grosses). */
td { padding: 10px 8px; border-bottom: 1px solid var(--filet); vertical-align: top; font-size: 14px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #3A424B; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; cursor: pointer; }
input, select, textarea { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid #CFC9C0; border-radius: 8px; background: #fff; color: var(--texte); }
/* Hauteur de ligne fixe, partagée avec .btn : champ et bouton côte à côte ont la même hauteur quelle que soit la taille du texte. */
input, select { line-height: 20px; }
select { height: 38px; } /* Chromium ignore line-height sur les listes : 20 + 2 × 8 de marge + 2 de bordure. */
/* Flèche dessinée, à 12 px du bord (4 novembre : celle de Chromium touchait presque la bordure), comme les cases à
   cocher ; le texte s'arrête avant elle. */
select:not([multiple]) {
  appearance: none; padding-right: 36px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%235A636D' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 14px no-repeat;
}
select:not([multiple]):hover { border-color: #B9B2A8; }
@media (forced-colors: active) { select:not([multiple]) { appearance: auto; padding-right: 10px; background-image: none; } }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--egee); outline-offset: 1px; }
/* Case à cocher dessinée (le bleu de Chromium détonne) : bordure des champs, cochée en Égée. Centrée sur les minuscules
   de la première ligne du libellé (13 px, interligne 1,5) : centrée sur la ligne, elle paraissait trop haute. */
input[type=checkbox] { appearance: none; flex: none; width: 18px; height: 18px; margin: 2px 0 0; padding: 0; border: 1.5px solid #B9B2A8; border-radius: 5px; background: #fff; cursor: pointer; }
input[type=checkbox]:hover { border-color: var(--egee); }
input[type=checkbox]:checked { border-color: var(--egee); background: var(--egee) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
input[type=checkbox]:checked:hover { border-color: #163F5A; background-color: #163F5A; }
input[type=checkbox]:focus { outline: none; }
input[type=checkbox]:focus-visible { outline: 2px solid var(--egee); outline-offset: 2px; }
@media (forced-colors: active) { input[type=checkbox] { appearance: auto; } }
form.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }

.btn { font: inherit; font-weight: 600; line-height: 20px; padding: 8px 16px; border-radius: 8px; border: 1px solid #DDD7CE; background: #fff; color: var(--texte); cursor: pointer; }
.btn:hover { background: #F8F7F4; }
.btn.primary { background: var(--egee); border-color: var(--egee); color: #fff; }
.btn.primary:hover { background: #163F5A; }
.btn.danger { background: var(--terre-cuite); border-color: var(--terre-cuite); color: #fff; }
.btn.danger:hover { background: #9A3819; }
.btn:focus-visible { outline: 2px solid var(--egee); outline-offset: 2px; }
a.btn { display: inline-block; text-decoration: none; text-align: center; }
.btn.small, input.small { padding: 5px 10px; font-size: 13px; }
button.link { font: inherit; background: none; border: 0; color: var(--egee); font-weight: 600; cursor: pointer; }
/* Grisé pendant une connexion bloquée (compte à rebours de admin.js). */
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: #fff; }
.btn.primary:disabled:hover { background: var(--egee); }
/* Connexion bloquée (_Lockout) : tuiles d'airain sur la nuit égéenne, retenues le 4 novembre parmi trois propositions
   (cadran, tuiles, bouton-compteur). Les chiffres défilent par admin.js (data-countdown). */
[data-countdown] [hidden] { display: none; }
.lockout-panel { display: flex; flex-direction: column; gap: 14px; padding: 20px 20px 18px; margin-bottom: 20px; border-radius: 14px; background: var(--egee-nuit); color: #D9E0E5; }
.lockout-title { display: flex; align-items: center; gap: 8px; margin: 0; color: #EBCB9F; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.lockout-title svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lockout-clock { display: flex; align-items: flex-start; justify-content: center; gap: 8px; }
.lockout-unit { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lockout-digits { display: flex; gap: 6px; }
.tile { display: flex; align-items: center; justify-content: center; width: 52px; height: 68px; border-radius: 10px; border: 1px solid #2B5674; background: #173B54; color: #EBCB9F; font-size: 42px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.lockout-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #C9D3DA; }
.lockout-colon { display: flex; align-items: center; height: 68px; font-size: 36px; font-weight: 700; color: var(--airain); }
.lockout-bar { height: 4px; border-radius: 2px; background: #22465F; overflow: hidden; }
.lockout-bar span { display: block; height: 100%; border-radius: 2px; background: var(--airain); transition: width .25s linear; }
.lockout-text { margin: 0; font-size: 13px; line-height: 1.45; }
/* Téléphone : à 52 px, les quatre tuiles dépassaient du bandeau de 10 px (mesuré à 390 px de large). */
@media (max-width: 480px) {
  .lockout-panel { padding: 18px 16px 16px; }
  .tile { width: 44px; height: 58px; font-size: 34px; }
  .lockout-colon { height: 58px; font-size: 30px; }
}
/* Les mêmes tuiles en petit, sur la page d'un administrateur bloqué. */
.lockout-inline { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.mini-clock { display: inline-flex; align-items: center; gap: 3px; margin: 4px 0 2px; }
.mini-clock .tile { width: 22px; height: 28px; border-radius: 6px; border-color: var(--egee-nuit); background: var(--egee-nuit); font-size: 17px; }
.mini-clock .lockout-colon { height: auto; padding: 0 1px; font-size: 17px; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: #E6EEF4; color: var(--egee-nuit); }
.flash.success { background: #E3EBD6; color: #2E4511; }
.flash.error { background: #F7DDD2; color: #7A2A10; }
/* Messages de résultat des actions : en bas de l'écran, ils disparaissent seuls (admin.js) ou au clic. */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100% - 32px)); }
.toasts .flash { margin: 0; box-shadow: 0 8px 24px rgba(15, 42, 61, .18); cursor: pointer; animation: toast-in .18s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
form[aria-busy="true"] button { opacity: .6; cursor: progress; pointer-events: none; }

/* Confirmation des actions irréversibles (admin.js) */
dialog.confirm { border: 0; padding: 0; border-radius: 14px; background: #fff; width: min(460px, calc(100% - 32px)); color: var(--texte); box-shadow: 0 16px 48px rgba(15, 42, 61, .28); }
dialog.confirm[open] { animation: toast-in .15s ease-out; }
dialog.confirm::backdrop { background: rgba(15, 42, 61, .35); }
dialog.confirm form { padding: 24px 24px 20px; }
.confirm-body { display: flex; gap: 16px; }
.confirm-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #F7DDD2; color: var(--terre-cuite); }
.confirm h2 { margin: 7px 0 0; font-size: 18px; }
.confirm p { margin: 8px 0 0; color: #3A424B; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.confirm-actions .btn { min-width: 96px; }

.icon-row { display: flex; gap: 14px; align-items: flex-start; }
.icon-row p { margin: 0; }
.app-icon { flex: none; border-radius: 14px; border: 1px solid var(--bord); background: #fff; object-fit: contain; }

/* Secret sur une ligne : tronqué à l'écran, copié en entier par son bouton. Un champ en lecture seule, blanc et bordé
   comme les champs de saisie, « Copier » dans le même cadre (4 novembre : en gris sur le bandeau crème d'un mot de
   passe provisoire, ses limites ne se voyaient pas). */
.secret { display: flex; align-items: stretch; border: 1px solid #CFC9C0; border-radius: 8px; background: #fff; overflow: hidden; }
/* contain : le texte, sur une seule ligne, n'élargit pas ce qui le contient (la page de connexion débordait de
   153 px sur téléphone, la clé de la double authentification élargissant sa grille). */
.secret code, .secret a { flex: 1; min-width: 0; contain: inline-size; display: block; padding: 8px 12px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secret code { background: none; border-radius: 0; font-size: 14px; letter-spacing: .02em; color: var(--texte); }
/* Secret à recopier à la main (clé de la double authentification) : en entier, sur plusieurs lignes s'il le faut. */
.secret.wrap code { white-space: normal; overflow-wrap: anywhere; }
.secret a { font-size: 13px; }
.secret .btn { flex: none; border: 0; border-left: 1px solid #CFC9C0; border-radius: 0; padding: 8px 16px; font-size: 13px; background: #FBFAF8; }
.secret .btn:hover { background: var(--marbre); }
.secret .btn:focus-visible { outline-offset: -2px; }
.recovery .secret { margin-top: 4px; }

/* Mot de passe : l'œil qui affiche ou masque la saisie (admin.js), dans le champ, à droite. Celui qu'Edge ajoute de
   lui-même est masqué : il en ferait deux. */
.password-field { position: relative; display: block; }
/* Sélecteur plus fort que « .auth-card input:not([type=checkbox]) » (pages de connexion), qui reprendrait la marge. */
.password-field input[data-reveal]:not([type=checkbox]) { width: 100%; padding-right: 42px; }
.reveal { position: absolute; top: 0; right: 0; bottom: 0; width: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0 8px 8px 0; background: none; color: var(--pierre); cursor: pointer; }
.reveal:hover { color: var(--egee); }
.reveal:focus-visible { outline: 2px solid var(--egee); outline-offset: -2px; }
.reveal svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
input::-ms-reveal, input::-ms-clear { display: none; }
/* Message joint au mot de passe provisoire : caché, montré seulement si le presse-papiers est indisponible (admin.js). */
.invitation { margin: 12px 0 0; padding: 12px; border: 1px solid #CFC9C0; border-radius: 8px; background: #fff; font-family: inherit; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }

/* Actions d'une carte (dépannage) : une ligne par action, ce qu'elle fait à gauche, le bouton à droite. */
.actions { list-style: none; margin: 0; padding: 0; }
.actions li { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--filet); }
.actions li:first-child { border-top: 0; padding-top: 0; }
.actions li:last-child { padding-bottom: 0; }
.actions form { flex: none; margin: 0; }
/* Même largeur quel que soit le libellé (Réinitialiser, Débloquer, Supprimer, Déconnecter). */
.actions form .btn { min-width: 104px; }
.action-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.action-text strong { font-size: 14px; }
.secret-label { margin: 12px 0 6px; }
.card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; margin-top: 12px; }
.card-foot form { margin: 0; }
button.link.small { font-size: 13px; padding: 0 4px; }
/* « Renommer » sous le nom d'un appareil : un lien qui déplie le champ, sans quitter la liste. */
details.rename summary { display: inline-block; list-style: none; cursor: pointer; color: var(--egee); font-size: 13px; font-weight: 600; }
details.rename summary::-webkit-details-marker { display: none; }
details.rename summary:focus-visible { outline: 2px solid var(--egee); outline-offset: 2px; border-radius: 4px; }
details.rename[open] summary { color: var(--pierre); }
details.rename form { margin-top: 6px; flex-wrap: nowrap; }
details.rename input { width: 200px; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; }
.inline-actions form { margin: 0; }
.file-button { display: inline-block; }
.file-button:focus-within { outline: 2px solid var(--egee); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Listes : en-têtes sur une ligne, titres de ligne soulignés au survol seulement. */
th { white-space: nowrap; }
td.num { white-space: nowrap; }
.row-title { font-weight: 600; text-decoration: none; }
.row-title:hover { text-decoration: underline; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: 12px; font-weight: 600; }
.pill.active { background: #E3EBD6; color: #3B5616; }
.pill.revoked { background: #F7DDD2; color: #8E3517; }
.pill.level-silent { background: #ECEAE6; color: #4A525B; }
.pill.level-normal { background: #E6EEF4; color: var(--egee); }
.pill.level-important { background: #F5E7CC; color: #6E480E; }
.pill.level-critical { background: #F7DDD2; color: #8E3517; }

.enrollment { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; margin-bottom: 16px; padding: 16px; background: var(--marbre); border-radius: 12px; }
/* À côté du QR code dès que la carte le permet : le lien tient sur une ligne au lieu d'imposer sa largeur. */
.enrollment-info { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.enrollment-info p { margin: 0; }
.qr svg { width: 200px; height: 200px; display: block; }
.code { display: block; font: 700 28px ui-monospace, Consolas, monospace; letter-spacing: .12em; color: var(--egee-nuit); }

/* Activité : chiffres clés, envois par jour, répartition par niveau */
.activity { margin-bottom: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--filet); border-radius: 12px; background: #FBFAF8; }
.kpi-label { font-size: 13px; color: var(--pierre); }
.kpi-value { font-size: 26px; font-weight: 600; color: var(--texte); line-height: 1.25; }
.kpi-note { font-size: 12px; color: var(--pierre); }
.activity-charts { display: flex; flex-wrap: wrap; gap: 28px; }
.activity-charts > .chart { flex: 1 1 240px; }
.activity-charts > .chart:first-child { flex: 3 1 420px; }
.chart { margin: 0; min-width: 0; }
.chart figcaption { font-weight: 600; font-size: 14px; margin-bottom: 12px; }

.daily { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 140px auto; column-gap: 8px; }
.y-axis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 11px; color: var(--pierre); font-variant-numeric: tabular-nums; transform: translateY(-6px); height: calc(100% + 12px); }
.plot { position: relative; display: grid; grid-template-columns: repeat(30, 1fr); align-items: end; border-bottom: 1px solid #D9D3CA; }
.gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--filet); }
.col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.col::before { content: ""; width: min(14px, 70%); height: var(--h); background: var(--egee); border-radius: 4px 4px 0 0; }
.col:hover::before, .col:focus-visible::before { background: #2D6B93; }
.col:focus-visible { box-shadow: inset 0 0 0 2px var(--egee); border-radius: 4px; }
.col .tip { display: none; position: absolute; bottom: calc(var(--h) + 8px); left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: var(--texte); color: #fff; font-size: 12px; }
.col .tip strong { font-size: 14px; margin-right: 4px; }
.col:nth-last-child(-n+4) .tip { left: auto; right: 0; transform: none; }
.col:hover .tip, .col:focus-visible .tip { display: block; }
.x-axis { grid-column: 2; display: grid; grid-template-columns: repeat(30, 1fr); font-size: 11px; color: var(--pierre); padding-top: 6px; font-variant-numeric: tabular-nums; }
.x-axis span { white-space: nowrap; text-align: center; overflow: visible; display: flex; justify-content: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.levels { display: grid; grid-template-columns: auto 1fr; gap: 14px 12px; align-items: center; }
.level-name { font-size: 13px; color: #3A424B; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.level-name { color: var(--egee); text-decoration: none; }
a.level-name:hover { text-decoration: underline; }
.level-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.level-bar { height: 12px; border-radius: 0 4px 4px 0; }
.level-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.level-bar.level-critical { background: var(--terre-cuite); }
.level-bar.level-important { background: #8A5A12; }
.level-bar.level-normal { background: var(--egee); }
.level-bar.level-silent { background: var(--pierre); }
.level-bar.volume { background: var(--egee); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.intro { margin: 0 0 14px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; }
.pager a { font-weight: 600; text-decoration: none; }
tr.link-row { cursor: pointer; }
tr.link-row:hover td { background: #FBFAF8; }
/* Fiche : intitulé et valeur dans la même police, à la même taille ; seule la couleur les distingue (4 novembre :
   l'intitulé plus petit que sa valeur choquait). Une propriété par ligne, un filet entre deux, comme un tableau. */
dl.facts { display: grid; grid-template-columns: minmax(150px, max-content) minmax(0, 1fr); margin: 0; font-size: 14px; line-height: 22px; }
dl.facts dt, dl.facts dd { margin: 0; padding: 9px 0; border-top: 1px solid var(--filet); }
dl.facts dt:first-of-type, dl.facts dt:first-of-type + dd { border-top: 0; padding-top: 2px; }
dl.facts dt { padding-right: 20px; color: var(--pierre); }
dl.facts dd { color: var(--texte); overflow-wrap: anywhere; }
/* Une pastille garde la hauteur de la ligne : plus haute, elle décalait sa valeur sous l'intitulé. */
dl.facts .pill { line-height: 18px; }
.body-text { white-space: pre-wrap; margin: 0 0 16px; }

/* Listes épurées : l'essentiel sur la ligne, le reste dans le détail. Toute la ligne est cliquable. */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--filet); }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 8px; margin: 0 -8px; border-radius: 10px; color: inherit; text-decoration: none; }
.row:hover { background: #FBFAF8; }
.row:focus-visible { outline: 2px solid var(--egee); outline-offset: -2px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main strong { color: var(--texte); }
.row:hover .row-main strong { color: var(--egee); }
.row-aside { white-space: nowrap; }
.row-aside.pills { display: flex; flex-wrap: wrap; gap: 6px; }
/* Icône plutôt que le caractère « › », dessiné au niveau des minuscules et donc plus bas que le centre de la ligne. */
.chevron { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--pierre); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.pill.warn { background: #F5E7CC; color: #6E480E; }
.pill.neutral { background: #ECEAE6; color: #4A525B; }
.list-filter { width: 100%; margin-bottom: 8px; }

/* Paramètres : activation de la double authentification et codes de secours */
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 18px; }
.steps li::marker { font-weight: 700; color: var(--egee); }
.totp-qr svg { width: 180px; height: 180px; margin: 12px 0 4px; border: 1px solid var(--bord); border-radius: 10px; }
input.otp { font: 600 20px ui-monospace, Consolas, monospace; letter-spacing: .2em; width: 11ch; }
.auth-card input.otp { width: 100%; text-align: center; }
/* Code à 6 chiffres en six cases (admin.js) : le vrai champ, transparent, couvre les cases ; trois et trois, comme
   l'affichent les applications d'authentification. La case à remplir est cernée d'Égée, avec un curseur. */
.otp-boxes { position: relative; display: inline-flex; gap: 8px; vertical-align: middle; }
.otp-boxes input.otp, .auth-card .otp-boxes input.otp {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; color: transparent; caret-color: transparent; font-size: 16px; letter-spacing: 0; outline: none; cursor: text;
}
.otp-boxes input.otp::selection { background: transparent; }
.otp-box { display: grid; place-items: center; width: 44px; height: 54px; border: 1.5px solid #CFC9C0; border-radius: 10px; background: #fff; font: 600 24px ui-monospace, Consolas, monospace; color: var(--texte); transition: border-color .12s, box-shadow .12s; }
.otp-box:nth-of-type(4) { margin-left: 10px; }
.otp-box.filled { border-color: #A9A196; }
.otp-box.current { border-color: var(--egee); box-shadow: 0 0 0 3px rgba(28, 78, 110, .16); }
.otp-box.current:empty::after { content: ""; width: 2px; height: 26px; border-radius: 1px; background: var(--egee); animation: otp-caret 1.1s steps(1) infinite; }
@keyframes otp-caret { 50% { opacity: 0; } }
.otp-boxes.error .otp-box { border-color: var(--terre-cuite); }
@media (prefers-reduced-motion: no-preference) {
  .otp-boxes.error { animation: otp-shake .32s ease-in-out; }
}
@keyframes otp-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.auth-card .otp-boxes { display: flex; justify-content: center; }
/* Code de secours, sous les cases : un lien qui déplie son propre champ. */
details.alt-login { margin-top: 14px; }
details.alt-login summary { display: inline-block; list-style: none; cursor: pointer; color: var(--egee); font-size: 13px; font-weight: 600; }
details.alt-login summary::-webkit-details-marker { display: none; }
details.alt-login summary:focus-visible { outline: 2px solid var(--egee); outline-offset: 2px; border-radius: 4px; }
details.alt-login[open] summary { color: var(--pierre); }
details.alt-login form { margin-top: 10px; }
.auth-card details.alt-login input { font: 600 17px ui-monospace, Consolas, monospace; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.auth-card details.alt-login input::placeholder { letter-spacing: .08em; }
.recovery { padding: 16px; margin-bottom: 16px; border-radius: 12px; background: #FBF4E6; border: 1px solid #EAD6AE; }
.recovery p { margin-top: 0; }
.recovery-codes { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.recovery-codes code { display: block; padding: 7px 10px; border: 1px solid #CFC9C0; border-radius: 8px; background: #fff; font-size: 14px; text-align: center; }
.mfa-disable { margin-top: 20px; }
.passkeys { margin-bottom: 16px; }
.passkey-hint { margin: 6px 0 0; }

/* Connexion : la première impression. Panneau de marque à gauche, formulaire à droite ; empilés sur téléphone. */
body.auth { background: var(--marbre); }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 48px; color: var(--marbre);
  background: radial-gradient(120% 90% at 50% 45%, #1C4E6E 0%, #123651 45%, #0B2132 100%);
}
.auth-waves { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-waves circle { fill: none; stroke: #EBCB9F; stroke-width: 1.5; opacity: .14; transform-origin: center; }
.auth-waves circle:nth-child(2) { opacity: .1; }
.auth-waves circle:nth-child(3) { opacity: .07; }
.auth-waves circle:nth-child(4) { opacity: .04; }
@media (prefers-reduced-motion: no-preference) {
  .auth-waves circle { animation: auth-wave 7s ease-out infinite; }
  .auth-waves circle:nth-child(2) { animation-delay: 1.75s; }
  .auth-waves circle:nth-child(3) { animation-delay: 3.5s; }
  .auth-waves circle:nth-child(4) { animation-delay: 5.25s; }
}
@keyframes auth-wave { 0% { transform: scale(.82); opacity: 0; } 25% { opacity: .16; } 100% { transform: scale(1.18); opacity: 0; } }
.auth-brand-inner { position: relative; text-align: center; }
.auth-logo { display: block; margin: 0 auto 22px; border-radius: 26px; box-shadow: 0 18px 48px rgba(0, 0, 0, .35), 0 0 0 1px rgba(235, 203, 159, .25); }
/* La cloche connectée sonne : elle se balance autour de son bouton, puis le signal part, l'onde courte et l'onde
   longue l'une après l'autre (planche 2 de la maquette du 11 novembre). Immobile si le système demande moins
   d'animations. */
@media (prefers-reduced-motion: no-preference) {
  .auth-logo .bell { transform-box: view-box; transform-origin: 50px 19px; animation: bell-ring 3s ease-in-out infinite; }
  .auth-logo .signal.near { animation: signal-near 3s ease-out infinite; }
  .auth-logo .signal.far { animation: signal-far 3s ease-out infinite; }
}
@keyframes bell-ring {
  0%, 40%, 100% { transform: rotate(0); }
  6% { transform: rotate(10deg); }
  14% { transform: rotate(-9deg); }
  22% { transform: rotate(6deg); }
  30% { transform: rotate(-3deg); }
}
@keyframes signal-near { 0%, 4% { opacity: .2; } 12%, 40% { opacity: 1; } 60%, 100% { opacity: .2; } }
@keyframes signal-far { 0%, 10% { opacity: .15; } 20%, 40% { opacity: .8; } 60%, 100% { opacity: .15; } }
.auth-brand-inner .wordmark { height: 34px; margin: 0 auto 4px; color: #F6F4F0; --wm-ll: #C98B4E; }
.auth-tagline { margin: 12px 0 0; font: italic 17px Georgia, serif; color: #EBCB9F; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 24px; }
.auth-card { width: min(400px, 100%); background: #fff; border: 1px solid var(--bord); border-radius: 18px; padding: 36px 32px; box-shadow: 0 18px 48px rgba(15, 42, 61, .08); }
.auth-card h1 { margin: 0 0 6px; font-size: 26px; }
.auth-card .lead { margin: 0 0 24px; color: var(--pierre); }
.auth-card form { margin-top: 4px; }
.auth-card input:not([type=checkbox]) { width: 100%; padding: 11px 12px; font-size: 15px; }
.auth-card .btn.primary { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.auth-card .totp-qr svg { width: 168px; height: 168px; }
/* Clé d'accès : sous le formulaire, après « ou » entre deux filets ; même largeur que « Se connecter », en blanc. */
.auth-card .or { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--pierre); }
.auth-card .or::before, .auth-card .or::after { content: ""; flex: 1; border-top: 1px solid var(--bord); }
.auth-card .btn.passkey { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 12px; font-size: 15px; }
.btn.passkey svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--egee); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-card .steps { gap: 14px; }
.auth-back { display: inline-block; margin-top: 18px; font-size: 13px; font-weight: 600; text-decoration: none; }
.auth-foot { margin: 20px 0 0; font-size: 12px; color: var(--pierre); letter-spacing: .04em; }
@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 40px 24px 32px; min-height: 0; }
  .auth-logo { width: 72px; height: 72px; margin-bottom: 14px; border-radius: 18px; }
  .auth-brand-inner .wordmark { height: 24px; }
  .auth-tagline { font-size: 15px; }
  .auth-panel { justify-content: flex-start; padding-top: 28px; }
}
/* Téléphone : « Se connecter avec une clé d'accès » tient sur une ligne. */
@media (max-width: 480px) {
  .auth-card { padding: 28px 22px; }
  .auth-card .btn.passkey { gap: 8px; padding: 11px 8px; font-size: 14px; }
  .otp-boxes { gap: 6px; }
  .otp-box { width: 40px; height: 50px; font-size: 22px; }
  .otp-box:nth-of-type(4) { margin-left: 6px; }
}

/* En-tête : l'administrateur connecté ; listes d'administrateurs */
.top .me { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; text-decoration: none; color: var(--texte); }
.top .me:hover { color: var(--egee); }
.me-hint { display: none; }
.initials { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--egee); color: #fff; font-weight: 700; font-size: 14px; }

/* Tablette et téléphone : le menu de l'en-tête se replie derrière un bouton (admin.js) et se déplie en liste. */
@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 0; padding: 10px 16px; }
  .menu-toggle { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 -10px 0 auto; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--egee-nuit); cursor: pointer; }
  .menu-toggle:hover { background: var(--marbre); }
  .menu-toggle:focus-visible { outline: 2px solid var(--egee); outline-offset: -2px; }
  .menu-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .menu-toggle .when-open, .top.open .menu-toggle .when-closed { display: none; }
  .top.open .menu-toggle .when-open { display: inline; }
  .menu { display: none; flex: 1 0 100%; flex-direction: column; align-items: stretch; gap: 0; margin-top: 10px; }
  .top.open .menu { display: flex; }
  .top nav { flex-direction: column; gap: 0; }
  .top nav a, .top .me, .menu button.link { display: block; width: 100%; max-width: none; padding: 12px 0; border-top: 1px solid var(--filet); text-align: left; }
  /* Menu déplié : la rubrique où l'on est, marquée d'un trait d'airain à gauche. */
  .top nav a[aria-current]::after { top: 12px; bottom: 12px; right: auto; left: -16px; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .me-hint { display: inline; float: right; margin-left: 12px; font-size: 13px; line-height: 22.5px; font-weight: 400; color: var(--pierre); } /* ligne du nom : 15 px × 1,5 */
}

/* Téléphone : marges resserrées, une colonne, et les tableaux en fiches (une par ligne, chaque valeur sous son
   intitulé, data-label) : en colonnes, le titre d'un message tenait en deux mots par ligne. */
@media (max-width: 640px) {
  .page { padding: 16px; }
  .foot { padding: 0 16px 16px; }
  .page-head h1 { font-size: 24px; }
  .title-row .app-icon { width: 40px; height: 40px; border-radius: 10px; }
  .tabs { gap: 22px; margin-top: 12px; }
  .card { padding: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Le résumé d'une ligne passe sous le nom : à côté, il écrasait la description. */
  .row { flex-wrap: wrap; row-gap: 2px; }
  .row-main { flex: 1 1 0; }
  .row-aside { order: 1; flex-basis: 100%; padding-left: 54px; white-space: normal; }
  details.rename input { width: auto; flex: 1; min-width: 0; }

  table.cards, table.cards tbody { display: block; }
  table.cards thead { display: none; }
  table.cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--filet); }
  table.cards tr:last-child { border-bottom: 0; }
  table.cards td { padding: 0; border: 0; text-align: left; }
  table.cards td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--pierre); }
  /* Sans intitulé : le titre de la fiche (placé en tête) et ses actions, sur toute la largeur. */
  table.cards td:not([data-label]), table.cards td.wide { grid-column: 1 / -1; }
  table.cards td.primary { order: -1; font-weight: 600; }

  /* Fiche : l'intitulé au-dessus de sa valeur, un filet entre deux propriétés. */
  dl.facts { grid-template-columns: minmax(0, 1fr); }
  dl.facts dt { padding: 10px 0 0; }
  dl.facts dd { padding: 0 0 10px; border-top: 0; }
  dl.facts dt:first-of-type { padding-top: 0; }
}
