/* -------------------------------------------------------------------------
   Détecteur de 404 — feuille de style unique.
   Dense et sobre : c'est un outil de travail, pas une vitrine. L'information
   doit tenir à l'écran sans défilement inutile.
   ------------------------------------------------------------------------- */

:root {
  --fond:        #f7f7f5;
  --surface:     #ffffff;
  --surface-2:   #fafaf9;
  --bord:        #e3e3df;
  --bord-fort:   #c9c9c3;
  --texte:       #1c1c1a;
  --texte-doux:  #6b6b65;
  --accent:      #2b5cd9;
  --accent-doux: #eaf0fd;
  --rouge:       #c0392b;
  --rouge-doux:  #fdecea;
  --ambre:       #a86a00;
  --ambre-doux:  #fdf3e2;
  --vert:        #2c7a4b;
  --vert-doux:   #e9f5ee;
  --rayon: 7px;
  --ombre: 0 1px 2px rgba(0,0,0,.05), 0 1px 8px rgba(0,0,0,.03);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond:        #17171a;
    --surface:     #1f1f23;
    --surface-2:   #26262b;
    --bord:        #33333a;
    --bord-fort:   #4a4a53;
    --texte:       #e8e8e6;
    --texte-doux:  #9a9a96;
    --accent:      #7aa2f7;
    --accent-doux: #23304d;
    --rouge:       #f07a70;
    --rouge-doux:  #3a2221;
    --ambre:       #e0a458;
    --ambre-doux:  #3a2f1c;
    --vert:        #6fce9a;
    --vert-doux:   #1e3328;
    --ombre: 0 1px 2px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ entête */

.entete {
  display: flex; align-items: center; gap: 26px;
  padding: 0 22px; height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--bord);
  position: sticky; top: 0; z-index: 20;
}
.marque {
  display: flex; align-items: center; gap: 9px;
  font-weight: 650; color: var(--texte); letter-spacing: -.01em;
}
.marque:hover { text-decoration: none; }
.pastille {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--rouge); box-shadow: 0 0 0 3px var(--rouge-doux);
}
.entete nav { display: flex; gap: 4px; }
.entete nav a {
  padding: 6px 11px; border-radius: var(--rayon);
  color: var(--texte-doux); font-weight: 500;
}
.entete nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--texte); }
.entete nav a.actif { background: var(--accent-doux); color: var(--accent); }
.fin { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.discret, .externe { color: var(--texte-doux); font-size: 13px; }

main { max-width: 1500px; margin: 0 auto; padding: 22px; }

footer {
  max-width: 1500px; margin: 0 auto; padding: 26px 22px 44px;
  color: var(--texte-doux); font-size: 12.5px;
}

/* ---------------------------------------------------------------- messages */

.messages { margin-bottom: 16px; display: grid; gap: 8px; }
.message {
  padding: 10px 14px; border-radius: var(--rayon);
  border: 1px solid var(--bord); background: var(--surface);
}
.message.ok     { background: var(--vert-doux);  border-color: var(--vert);  color: var(--vert); }
.message.erreur { background: var(--rouge-doux); border-color: var(--rouge); color: var(--rouge); }

/* ------------------------------------------------------------------ blocs */

.grille { display: grid; gap: 16px; }
.grille.quatre { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grille.deux   { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .grille.deux { grid-template-columns: 1fr; } }

.carte {
  background: var(--surface); border: 1px solid var(--bord);
  border-radius: var(--rayon); box-shadow: var(--ombre);
}
.carte > h2 {
  margin: 0; padding: 13px 16px; font-size: 13px; font-weight: 650;
  letter-spacing: .02em; text-transform: uppercase; color: var(--texte-doux);
  border-bottom: 1px solid var(--bord);
}
.carte > .corps { padding: 16px; }

.chiffre { padding: 16px 18px; }
.chiffre .valeur { font-size: 30px; font-weight: 660; letter-spacing: -.02em; line-height: 1.1; }
.chiffre .etiquette { color: var(--texte-doux); font-size: 12.5px; margin-top: 3px; }
.chiffre.alerte .valeur { color: var(--rouge); }
.chiffre.bien   .valeur { color: var(--vert); }

/* --------------------------------------------------------------- barre cycle */

.jauge { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--bord); }
.jauge > span { display: block; height: 100%; background: var(--accent); }
.legende { display: flex; justify-content: space-between; color: var(--texte-doux); font-size: 12.5px; margin-top: 7px; }

/* ------------------------------------------------------------------ tables */

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .02em;
  text-transform: uppercase; color: var(--texte-doux);
  padding: 9px 12px; border-bottom: 1px solid var(--bord); white-space: nowrap;
  background: var(--surface-2); position: sticky; top: 52px;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--bord); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.url {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px; word-break: break-all;
}
.titre-page { color: var(--texte-doux); font-size: 12.5px; margin-top: 2px; }

/* ------------------------------------------------------------- étiquettes */

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--texte-doux); border: 1px solid var(--bord);
}
.tag.forte   { background: var(--vert-doux);  color: var(--vert);  border-color: transparent; }
.tag.moyenne { background: var(--ambre-doux); color: var(--ambre); border-color: transparent; }
.tag.faible  { background: var(--rouge-doux); color: var(--rouge); border-color: transparent; }
.tag.aucune  { font-style: italic; }

/* --------------------------------------------------------------- contrôles */

.filtres {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--bord); background: var(--surface-2);
}
input[type=text], input[type=password], select {
  padding: 7px 10px; border: 1px solid var(--bord-fort); border-radius: 6px;
  background: var(--surface); color: var(--texte); font: inherit; font-size: 13.5px;
}
input[type=text] { min-width: 260px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

button, .bouton {
  padding: 7px 14px; border-radius: 6px; border: 1px solid var(--bord-fort);
  background: var(--surface); color: var(--texte); font: inherit; font-weight: 550;
  font-size: 13.5px; cursor: pointer;
}
button:hover, .bouton:hover { background: var(--surface-2); text-decoration: none; }
button.primaire {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
button.primaire:hover { filter: brightness(1.08); }
button.danger { color: var(--rouge); border-color: var(--rouge); background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }

.barre-action {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--bord); background: var(--surface-2);
  position: sticky; bottom: 0;
}
.compteur-selection { color: var(--texte-doux); font-size: 13px; margin-right: auto; }

.pagination { display: flex; gap: 6px; align-items: center; padding: 14px 16px; justify-content: center; }
.pagination a, .pagination span {
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--bord); font-size: 13px;
}
.pagination .courante { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------------------------------------ divers */

.vide { padding: 42px 20px; text-align: center; color: var(--texte-doux); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.connexion {
  max-width: 340px; margin: 90px auto; padding: 28px;
  background: var(--surface); border: 1px solid var(--bord);
  border-radius: var(--rayon); box-shadow: var(--ombre);
}
.connexion h1 { font-size: 17px; margin: 0 0 18px; }
.connexion input { width: 100%; margin-bottom: 12px; }
.connexion button { width: 100%; }

.courbe { display: flex; align-items: flex-end; gap: 3px; height: 74px; padding: 4px 0; }
.courbe > div { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
.courbe > div:hover { opacity: 1; }

.tache {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--accent-doux); color: var(--accent);
  border-radius: var(--rayon); font-size: 13px; margin-bottom: 16px;
}
.tache .jauge { flex: 1; }
