/*
 * Console de flotte : copie des jetons et des classes de la charte Tesseract du socle
 * (src/app/globals.css, maquettes validées par MaxG le 30/10/2026). La console est une app
 * séparée : elle ne dépend pas du build Next du socle. À resynchroniser à la main si la charte
 * change. Polices (ENG-94) : Outfit (titres) et Hanken Grotesk (le reste), servies par la console
 * elle-même (public/fonts, licence OFL), aucune requête vers Google ; aucune autre famille.
 */

@font-face {
  font-family: "Outfit";
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/outfit-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Outfit";
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/outfit-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/hanken-grotesk-latin-600-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* Charte */
  --fond: #f5f3ef;
  --surface: #ffffff;
  --surface-2: #eeede9;
  --surface-3: #faf9f7;
  --filet: #e2e1dc;
  --filet-2: #eeede9;
  --filet-btn: #cfcdc6;
  --encre: #18181b;
  --encre-survol: #2a2a2f;
  --encre-2: #5e5e64;
  --encre-3: #3f3f46;
  --gris: #8a8a92;
  --nuit: #08080a;
  --filet-nuit: #26262b;
  --clair: #ededef;
  --clair-2: #a1a1a9;
  --rouge: #da291c;
  --rouge-texte: #b71f12;
  --rouge-survol: #c2210f;
  --rouge-vif: #ff5a4b;

  /* États : fond de champ, filet, texte, point, fond de pastille, filet d'encadré */
  --ok-fond: #f4faf6;
  --ok-filet: #a9d5ba;
  --ok-texte: #17663e;
  --ok-point: #1f8a50;
  --ok-pill: #e6f3eb;
  --warn-fond: #fff8ec;
  --warn-filet: #e3b25e;
  --warn-texte: #8a5300;
  --warn-point: #d98a0b;
  --warn-pill: #fdf1de;
  --warn-chk: #f0d6a6;
  --err-fond: #fef3f1;
  --err-filet: #e3867c;
  --err-texte: #b71f12;
  --err-point: #da291c;
  --err-pill: #fdecea;
  --err-chk: #f2c1bb;

  --r: 10px;
  --r-s: 6px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);

  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --titre: "Outfit", system-ui, sans-serif;
  /* Nom historique : plus de chasse fixe, chiffres tabulaires (body) */
  --mono: var(--sans);
}

/* ------------------------------------------------------------------------------------------ */
/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: var(--encre);
  text-underline-offset: 3px;
  transition: color 0.15s var(--ease);
}
a:hover {
  color: var(--rouge-texte);
}
:focus-visible {
  outline: 2px solid var(--rouge);
  outline-offset: 2px;
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--titre);
  font-weight: 500;
}
code,
kbd,
pre,
samp {
  font-family: var(--mono);
}
h1 {
  font-size: clamp(26px, 3vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
h2 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 16px;
}
p {
  margin: 0;
}
strong {
  font-weight: 600;
}
code,
kbd,
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
code {
  font-size: 0.86em;
  overflow-wrap: anywhere;
}
img,
svg {
  flex: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.muted {
  color: var(--encre-2);
  font-size: 14px;
}
.lede {
  max-width: 640px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--encre-2);
}
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* Étiquette : capitales mono (charte v2 du socle, ENG-43 : plus aucun carré rouge) */
.lab {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--encre-2);
}
.card {
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--r);
}
.card-pad {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
}
.sec {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 36px;
  border-top: 1px solid var(--filet);
}

/* ------------------------------------------------------------------------------------------ */
/* Boutons */

:where(button) {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-s);
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.15s var(--ease),
    color 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}
.btn-s {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
  gap: 8px;
}
.btn-xs {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  gap: 6px;
}
.btn-rouge {
  background: var(--rouge);
  color: #fff;
  padding: 0 26px;
}
.btn-rouge:hover {
  background: var(--rouge-survol);
  color: #fff;
}
.btn-ligne {
  background: var(--surface);
  color: var(--encre);
  box-shadow: inset 0 0 0 1px var(--filet-btn);
}
.btn-ligne:hover {
  background: var(--fond);
  color: var(--encre);
}
.btn-encre {
  background: var(--encre);
  color: #fff;
}
.btn-encre:hover {
  background: var(--encre-survol);
  color: #fff;
}
.btn-ico {
  width: 40px;
  min-height: 40px;
  padding: 0;
  background: var(--surface);
  color: var(--encre);
  box-shadow: inset 0 0 0 1px var(--filet-btn);
}
.btn-ico:hover {
  background: var(--fond);
  color: var(--encre);
}
/* Sur fond sombre (bandeau d'accueil) */
.btn-verre {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: var(--clair);
}
.btn-verre:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.btn-lien {
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  font: 500 14px/1.4 var(--sans);
  color: var(--encre);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-lien:hover {
  color: var(--rouge-texte);
}
.btn-full {
  width: 100%;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.kbd {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  border: 1px solid currentColor;
  opacity: 0.7;
}
.btn-rouge .kbd {
  opacity: 0.85;
}
/* Repli pour un bouton sans classe (écrans pas encore restylés) */
:where(button:not([class])) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-s);
  background: var(--encre);
  color: #fff;
  font: 500 14.5px/1 var(--sans);
}
:where(button:not([class])):hover {
  background: var(--encre-survol);
}
button.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--encre);
  box-shadow: inset 0 0 0 1px var(--filet-btn);
  font: 500 14.5px/1 var(--sans);
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--r-s);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--filet-btn);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
}

/* ------------------------------------------------------------------------------------------ */
/* Pastilles : verdict des contrôles et cycle de vie (.pill + .dot + .p-<niveau>) */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.pill-s {
  height: 24px;
  padding: 0 9px;
  font-size: 12.5px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex: none;
}
.dot-ok {
  background: var(--ok-point);
}
.p-wait {
  background: var(--surface-2);
  color: var(--encre-3);
}
.p-wait .dot {
  background: var(--gris);
}
.p-run {
  background: var(--surface);
  color: var(--encre-3);
  box-shadow: inset 0 0 0 1px var(--filet-btn);
}
.p-run .dot {
  background: var(--gris);
}
.p-ok {
  background: var(--ok-pill);
  color: var(--ok-texte);
}
.p-ok .dot {
  background: var(--ok-point);
}
.p-edit {
  background: var(--ok-pill);
  color: var(--ok-texte);
  box-shadow: inset 0 0 0 1px var(--ok-filet);
}
.p-edit .dot {
  background: var(--ok-point);
}
.p-warn {
  background: var(--warn-pill);
  color: var(--warn-texte);
}
.p-warn .dot {
  background: var(--warn-point);
}
.p-err {
  background: var(--err-pill);
  color: var(--err-texte);
}
.p-err .dot {
  background: var(--err-point);
}
.p-done {
  background: var(--encre);
  color: #fff;
}
.p-done .dot {
  background: #fff;
}
.p-fail {
  background: var(--surface);
  color: var(--err-texte);
  box-shadow: inset 0 0 0 1px var(--err-filet);
}
.p-fail .dot {
  background: var(--err-point);
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ------------------------------------------------------------------------------------------ */
/* Champs : .f (conteneur) + état s-ok / s-warn / s-err / s-def ; .f-wide sur toute la ligne */

.grp {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.inp,
:where(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select) {
  width: 100%;
  height: 42px;
  border-radius: var(--r-s);
  padding: 0 12px;
  font: 400 15px var(--sans);
  color: var(--encre);
  border: 1px solid var(--filet);
  background: var(--surface);
  transition:
    border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}
:where(textarea) {
  width: 100%;
  border-radius: var(--r-s);
  padding: 10px 12px;
  font: 400 15px/1.5 var(--sans);
  color: var(--encre);
  border: 1px solid var(--filet);
  background: var(--surface);
  resize: vertical;
}
:where(select) {
  padding-right: 32px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2318181B' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.inp:focus,
:where(input, select, textarea):focus {
  outline: none;
  border-color: var(--encre);
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.12);
}
/* Champ de saisie : le filet encre et le halo suffisent, sans contour rouge à chaque clic */
.inp:focus-visible,
:where(input, select, textarea):focus-visible {
  outline: none;
}
:where(input[type="checkbox"], input[type="radio"]):focus-visible {
  outline: 2px solid var(--rouge);
  outline-offset: 2px;
}
:where(input, select, textarea):disabled {
  background: var(--surface-3);
  color: var(--encre-2);
  cursor: not-allowed;
}
::placeholder {
  color: var(--gris);
}
.msg {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.45;
}
.s-ok .inp {
  border-color: var(--ok-filet);
  background: var(--ok-fond);
}
.s-ok .f-tag,
.s-ok .msg {
  color: var(--ok-texte);
}
.s-warn .inp {
  border-color: var(--warn-filet);
  background: var(--warn-fond);
}
.s-warn .f-tag,
.s-warn .msg {
  color: var(--warn-texte);
}
.s-err .inp {
  border-color: var(--err-filet);
  background: var(--err-fond);
  border-width: 1.5px;
}
.s-err .f-tag,
.s-err .msg {
  color: var(--err-texte);
}
.s-def .f-tag,
.s-def .msg {
  color: var(--encre-2);
}
/* Focus d'un champ coloré : les règles d'état ci-dessus ont la même spécificité que .inp:focus
   et l'écraseraient. Le filet repasse en encre (contraste de plus de 15:1 avec les fonds
   d'état, contre environ 1,3:1 pour le seul halo) et le halo est renforcé, pour que le champ
   actif reste repérable au clavier. */
.f .inp:focus,
.f .inp:focus-visible {
  border-color: var(--encre);
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.35);
}

/* Formulaires simples : libellé au-dessus du champ */
:where(label:not([class])) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--encre-3);
}
form.stack,
form:not([class]) {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
form.inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
}
form.inline select {
  width: auto;
  height: 40px;
}
form.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 14px 16px;
  align-items: end;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ------------------------------------------------------------------------------------------ */
/* Alertes (messages de page : p.alert, lus par les tests e2e) */

.alert {
  display: block;
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--r-s);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.alert-error {
  background: var(--err-fond);
  color: var(--err-texte);
  box-shadow: inset 0 0 0 1px var(--err-chk);
}
.alert-ok {
  background: var(--ok-fond);
  color: var(--ok-texte);
  box-shadow: inset 0 0 0 1px var(--ok-filet);
}
.alert-warn {
  background: var(--warn-fond);
  color: var(--warn-texte);
  box-shadow: inset 0 0 0 1px var(--warn-chk);
}
.alert code {
  color: var(--encre);
}

/* ------------------------------------------------------------------------------------------ */
/* Tableaux : en-têtes mono capitales ; .tbl = carte à défilement horizontal */

:where(table) {
  width: 100%;
  border-collapse: collapse;
}
th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--encre-2);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--filet);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--filet-2);
  font-size: 14px;
  vertical-align: middle;
}
td code {
  font-size: 12.5px;
}
.tbl {
  overflow-x: auto;
}
.tbl tbody tr:last-child td {
  border-bottom: 0;
}
.tbl-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--encre-2);
  border-top: 1px solid var(--filet-2);
}
tr.inactive td {
  color: var(--encre-2);
}
tr.tr-on td {
  background: var(--surface-3);
}
td.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--encre-2);
}

/* Pages hors session (connexion, activation) : centrées, avec le logo */
.solo {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 40px 16px;
}
.solo-logo img {
  display: block;
  width: 148px;
  height: auto;
}
.auth {
  width: min(420px, 100%);
}
.auth-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-card h1 {
  font-size: 26px;
}
.auth-card p {
  color: var(--encre-3);
}
.auth-foot {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--encre-2);
  text-align: center;
}
.qr {
  display: flex;
  justify-content: center;
}
.qr svg {
  width: 200px;
  height: 200px;
  background: #fff;
  border-radius: var(--r-s);
  box-shadow: inset 0 0 0 1px var(--filet);
}

/* Contenu d'une page de l'application */
.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.page-head-txt {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.page-head-aside {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ------------------------------------------------------------------------------------------ */
/* Propre à la console */

.fl-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 14px clamp(16px, 3vw, 40px);
  background: var(--surface);
  border-bottom: 1px solid var(--filet);
}
.fl-logo img {
  display: block;
  width: 120px;
  height: auto;
}
.fl-nav {
  display: flex;
  gap: 16px;
  font-size: 14px;
  font-weight: 500;
}
.fl-nav a {
  text-decoration: none;
}
.fl-out {
  margin-left: auto;
}
.late {
  color: var(--rouge-texte);
}
.ok-txt {
  color: var(--ok-texte);
}
.warn-txt {
  color: var(--warn-texte);
  font-size: 13px;
}
.fl-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
  gap: 22px;
  align-items: start;
}
.fl-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
ul.card.fl-list {
  padding-left: 38px;
}
.fl-dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 18px 22px;
  margin: 0;
  padding: 20px 22px;
}
.fl-dl dt {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--encre-2);
  margin-bottom: 4px;
}
.fl-dl dd {
  margin: 0;
  font-size: 14px;
}
.fl-wrap {
  overflow-wrap: anywhere;
}
.fl-pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--nuit);
  color: var(--clair);
  border-radius: var(--r-s);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}
.fl-pre code {
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
