/* einzu — direction C « classique net » (spec/3-apparence.md).
   Austère, très condensé, blocs carrés : aucun arrondi, aucune ombre, aucun dégradé,
   aucune animation. Clair uniquement, écran d'ordinateur seulement.
   Feuille unique, sans dépendance externe (CSP : style-src 'self', polices 'self'). */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../polices/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../polices/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../polices/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../polices/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../polices/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
}

:root {
  --encre: #111111;
  --fond: #e4e4e4;
  --papier: #ffffff;
  --barre: #d6d6d6;
  --outil: #f4f4f4;
  --discret: #555555;
  --filet: #e2e2e2;
  --filet-fort: #bdbdbd;
  --inactif: #a8a8a8;
  --erreur: #b91c1c;
  --succes: #1e7a3c;
  --sans: "IBM Plex Sans", Arial, Helvetica, sans-serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --ligne: 1.7em;
  --marge: 0.5em;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-width: 1280px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.35;
  color: var(--encre);
  background: var(--fond);
}

:focus-visible {
  outline: 2px solid var(--encre);
  outline-offset: 1px;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Bandeau ───────────────────────────────────────────────── */

.bandeau {
  display: flex;
  align-items: stretch;
  min-height: 2.2em;
  color: var(--papier);
  background: var(--encre);
}

.bandeau :focus-visible {
  outline-color: var(--papier);
}

.bandeau__marque {
  display: flex;
  align-items: center;
  padding: 0 1em;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.18em;
}

.bandeau__nav {
  display: flex;
  align-items: stretch;
}

.bandeau__entree {
  display: flex;
  align-items: center;
  padding: 0 1em;
  color: var(--inactif);
}

.bandeau__entree[aria-current="page"] {
  font-weight: 500;
  color: var(--encre);
  background: var(--papier);
}

.bandeau__droite {
  display: flex;
  align-items: center;
  gap: 1em;
  margin-left: auto;
  padding: 0 0.6em;
}

.bandeau__droite form {
  display: flex;
}

.bandeau__version {
  font-family: var(--mono);
  font-size: 0.9em;
  color: #cfcfcf;
}

/* ── Page ──────────────────────────────────────────────────── */

.page {
  flex: 1;
  padding: var(--marge);
}

.page--centree {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

/* ── Barre d'état ──────────────────────────────────────────── */

.etat {
  display: flex;
  align-items: center;
  gap: 1.5em;
  min-height: 1.8em;
  padding: 0 0.6em;
  font-family: var(--mono);
  font-size: 0.85em;
  color: #444444;
  background: var(--outil);
  border-top: 1px solid var(--encre);
}

.etat__message--erreur {
  color: var(--erreur);
}

.etat__droite {
  margin-left: auto;
}

/* ── Fenêtres (connexion, erreurs, plus tard éditions) ────────── */

.fenetre {
  width: 22em;
  background: var(--papier);
  border: 1px solid var(--encre);
}

.fenetre--erreur {
  width: 28em;
}

.fenetre__titre {
  display: flex;
  align-items: center;
  min-height: 1.9em;
  margin: 0;
  padding: 0 0.5em;
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--barre);
  border-bottom: 1px solid var(--encre);
}

.fenetre__corps {
  padding: 0.5em 0.6em;
}

.fenetre__corps p {
  margin: 0.4em 0;
}

/* ── Formulaires ───────────────────────────────────────────── */

.formulaire {
  display: flex;
  flex-direction: column;
  padding: 0.6em;
}

.formulaire__etiquette {
  margin: 0.5em 0 0.2em;
  font-weight: 500;
}

.formulaire__etiquette:first-of-type {
  margin-top: 0;
}

.formulaire__envoi {
  align-self: flex-start;
  margin-top: 0.8em;
}

.champ {
  height: 1.9em;
  padding: 0 0.5em;
  font: inherit;
  color: var(--encre);
  background: var(--papier);
  border: 1px solid var(--encre);
  border-radius: 0;
}

.champ--code {
  width: 8em;
  font-family: var(--mono);
  letter-spacing: 0.1em;
}

.message {
  margin: 0 0 0.5em;
}

.message--erreur {
  color: var(--erreur);
}

.lien {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* ── Boutons ───────────────────────────────────────────────── */

.bouton {
  height: 1.9em;
  padding: 0 0.7em;
  font: inherit;
  color: var(--encre);
  background: var(--papier);
  border: 1px solid var(--encre);
  border-radius: 0;
  cursor: pointer;
}

.bouton:hover {
  color: var(--papier);
  background: var(--encre);
}

.bouton--bandeau {
  height: 1.6em;
  color: var(--papier);
  background: var(--encre);
  border-color: var(--papier);
}

.bouton--bandeau:hover {
  color: var(--encre);
  background: var(--papier);
}

.bouton--danger {
  color: var(--erreur);
  border-color: var(--erreur);
}

.bouton--danger:hover {
  color: var(--papier);
  background: var(--erreur);
}

/* ── Passkeys ──────────────────────────────────────────────── */

.cle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5em;
  padding: 0.6em 0.6em 0;
}

.cle__ou {
  margin: 0;
  color: var(--discret);
}

.fenetre--large {
  width: 48em;
}

.tableau {
  width: 100%;
  border-collapse: collapse;
}

.tableau th,
.tableau td {
  height: var(--ligne);
  padding: 0 0.5em;
  text-align: left;
  border-bottom: 1px solid var(--filet);
}

.tableau th {
  font-weight: 500;
  background: var(--outil);
}

.tableau__action {
  width: 1%;
  white-space: nowrap;
}

.tableau__action form {
  display: flex;
  padding: 0.2em 0;
}

.ajout-cle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
  padding: 0.6em;
  border-top: 1px solid var(--encre);
}

.ajout-cle .formulaire__etiquette {
  margin: 0;
}

.ajout-cle .message {
  flex-basis: 100%;
  margin: 0;
}

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

.invisible {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Board ─────────────────────────────────────────────────── */

.page--board {
  padding: var(--marge);
}

.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));  /* 3 liens, watch, kanban, fichiers, supervision */
  gap: var(--marge);
  align-items: start;
}

.colonne {
  display: flex;
  flex-direction: column;
  gap: var(--marge);
  min-width: 0;
}

/* Liste à plat ; les boîtes se dessinent par les bordures : une ligne ouvre une boîte
   en tête de colonne ou après un séparateur, la ferme avant un séparateur ou en fin. */
.colonne__liste {
  display: flex;
  flex-direction: column;
  min-height: var(--ligne);
}

.ligne {
  display: flex;
  align-items: center;
  gap: 0.45em;
  min-width: 0;
  min-height: var(--ligne);
  padding: 0 0.4em 0 0.5em;
  background: var(--papier);
  border: 1px solid var(--encre);
  border-top: 0;
  border-bottom-color: var(--filet);
}

.colonne__liste > .ligne:first-child,
.separateur + .ligne {
  border-top: 1px solid var(--encre);
}

.ligne:last-child,
.ligne:has(+ .separateur) {
  border-bottom-color: var(--encre);
}

.ligne:hover {
  background: var(--outil);
}

.separateur {
  height: var(--marge);
  cursor: grab;
}

.separateur:hover,
.separateur:focus-visible {
  outline: 1px dashed var(--filet-fort);
  outline-offset: 0;
}

/* En tête ou en fin de colonne, un séparateur n'ouvre ni ne ferme aucune boîte : il ne
   prend pas de place (les colonnes restent alignées) et se saisit dans la marge, juste
   au-dessus (en tête) ou au-dessous (en fin). */
.colonne__liste > .separateur:first-child,
.colonne__liste > .separateur:last-child {
  position: relative;
  height: 0;
}

.colonne__liste > .separateur:first-child::before,
.colonne__liste > .separateur:last-child::before {
  position: absolute;
  right: 0;
  left: 0;
  height: var(--marge);
  content: "";
}

.colonne__liste > .separateur:first-child::before {
  bottom: 0;
}

.colonne__liste > .separateur:last-child::before {
  top: 0;
}

.ligne__libelle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ligne__domaine {
  flex-shrink: 1;
  max-width: 45%;
  margin-left: auto;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--discret);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ligne--tache {
  align-items: flex-start;
  padding-top: 0.25em;
  padding-bottom: 0.25em;
}

.ligne--tache .pastille {
  margin-top: 0.35em;
}

.ligne__tache {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.ligne__tache .ligne__libelle {
  font-weight: 500;
}

.ligne__apercu {
  overflow: hidden;
  font-size: 0.9em;
  color: var(--discret);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poignee {
  flex: none;
  align-self: center;
  width: 6px;
  height: 0.9em;
  margin-left: auto;
  border-right: 2px dotted var(--discret);
  border-left: 2px dotted var(--discret);
  cursor: grab;
  visibility: hidden;
}

.ligne__domaine + .poignee {
  margin-left: 0;
}

.ligne:hover .poignee {
  visibility: visible;
}

.glisse {
  opacity: 0.4;
}

.repere-avant {
  box-shadow: inset 0 2px 0 var(--encre);
}

.repere-apres {
  box-shadow: inset 0 -2px 0 var(--encre);
}

.repere-fin {
  outline: 1px dashed var(--encre);
  outline-offset: -1px;
}

.colonne__pied {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.bouton--discret {
  height: 1.6em;
  color: var(--discret);
  background: transparent;
  border-color: var(--filet-fort);
}

.ajout {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  padding: 0.4em;
  background: var(--papier);
  border: 1px solid var(--encre);
}

.ajout__actions,
.formulaire__actions {
  display: flex;
  gap: 0.4em;
}

.formulaire__actions {
  margin-top: 0.8em;
}

/* ── Colonne watch ─────────────────────────────────────────── */

/* Une boîte par section (à regarder, bientôt, en attente), dessinée comme les boîtes du
   board. La pastille dit la sorte d'œuvre (watch.js). */
.watch__bloc {
  display: flex;
  flex-direction: column;
}

.watch__bloc > .ligne:first-child {
  border-top: 1px solid var(--encre);
}

.ligne--watch {
  color: var(--encre);
  text-decoration: none;
}

.watch__texte {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.15em 0;
  line-height: 1.25;
}

.watch__decompte {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--discret);
}

.watch__decompte--proche {
  font-weight: 600;
  color: var(--encre);
}

.watch__note {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--discret);
}

.ligne--vide {
  color: var(--discret);
  cursor: default;
}

.watch__etat {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--discret);
}

.watch__etat--erreur {
  color: var(--erreur);
}

.pastille--fixe {
  cursor: default;
}

/* ── Colonne fichiers ──────────────────────────────────────── */

/* Une boîte : une tuile par fichier (icône, nom coupé au milieu, décompte ou ∞ à droite),
   puis les envois en cours, et « + Fichier » avec le stockage utilisé (fichiers.js). */
.fichiers__liste {
  display: flex;
  flex-direction: column;
}

.fichiers__liste > .ligne:first-child {
  border-top: 1px solid var(--encre);
}

.ligne--fichier {
  cursor: pointer;
}

.ligne--fichier:focus-visible {
  outline: 1px dashed var(--encre);
  outline-offset: -2px;
}

.fichier__icone {
  flex: none;
  font-size: 0.9em;
  line-height: 1;
}

/* Coupé au milieu : le début se réduit avec « … », la fin (extension comprise) reste. */
.fichier__nom {
  display: flex;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.fichier__debut {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fichier__fin {
  flex: none;
}

.fichier__champ {
  flex: 1;
  min-width: 0;
  height: 1.4em;
}

.fichier__reste {
  flex: none;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--discret);
  white-space: nowrap;
}

.fichier__reste--permanent {
  font-family: var(--sans);
  font-size: 1.1em;
  color: var(--encre);
}

.fichiers__envois:empty {
  display: none;
}

.fichiers__envois {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.fichiers__envoi {
  display: flex;
  gap: 0.5em;
  font-size: 0.9em;
}

.fichiers__envoi-nom {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fichiers__envoi-etat {
  flex: none;
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--discret);
}

.fichiers__envoi--erreur .fichiers__envoi-etat {
  flex-shrink: 1;
  color: var(--erreur);
}

/* Stockage utilisé / quota : discret, à droite de « + Fichier ». */
.fichiers__quota {
  align-self: center;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--discret);
}

/* Fichiers glissés au-dessus de la colonne : elle les recevra. */
.colonne--depot {
  outline: 1px dashed var(--encre);
  outline-offset: 2px;
}

/* ── Colonne supervision ───────────────────────────────────── */

/* Une boîte par app (Orkfar, Einzu…), titrée ; une tuile par source (Healthcheck,
   Service, CI). La pastille dit l'état (supervision.js), l'âge s'aligne à droite comme la
   note de la colonne watch. */
.supervision__apps {
  display: flex;
  flex-direction: column;
  gap: var(--marge);
}

.supervision__bloc {
  display: flex;
  flex-direction: column;
}

/* Titre dans la boîte : première ligne, fond gris clair (rouge ou orange clair selon les
   tuiles), texte noir, corps des tuiles. */
.supervision__titre {
  display: flex;
  align-items: center;
  min-height: var(--ligne);
  margin: 0;
  padding: 0 0.4em 0 0.5em;
  font-size: inherit;
  font-weight: inherit;
  color: var(--encre);
  background: var(--barre);
  border: 1px solid var(--encre);
}

/* La boîte prend l'état de sa tuile la plus grave ; teintes claires, texte noir. */
.supervision__titre--rouge { background: #f28b82; }
.supervision__titre--orange { background: #fdba74; }

.ligne--supervision {
  color: var(--encre);
  text-decoration: none;
  cursor: default;
}

a.ligne--supervision {
  cursor: pointer;
}

/* ── Pastilles et palette ──────────────────────────────────── */

.pastille {
  flex: none;
  width: 0.6em;
  height: 0.6em;
  padding: 0;
  border: 1px solid var(--encre);
  border-radius: 0;
  cursor: pointer;
}

.pastille--grande {
  width: 1.3em;
  height: 1.3em;
}

.couleur-aucune { background: var(--papier); }
.couleur-rouge { background: #c62828; }
.couleur-orange { background: #d9480f; }
.couleur-jaune { background: #e0b000; }
.couleur-vert { background: #2e7d32; }
.couleur-bleu { background: #1f5fbf; }
.couleur-violet { background: #6a1b9a; }
.couleur-rose { background: #c2185b; }
.couleur-gris { background: #bdbdbd; }
.couleur-noir { background: #111111; }
.couleur-sarcelle { background: #2a8475; }

.palette,
.menu {
  position: fixed;
  z-index: 10;
  background: var(--papier);
  border: 1px solid var(--encre);
}

.palette {
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 0.35em;
  padding: 0.4em;
}

.menu {
  min-width: 8em;
}

.menu__entree {
  display: block;
  width: 100%;
  padding: 0.3em 0.6em;
  font: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.menu__entree:hover,
.menu__entree:focus-visible {
  background: var(--outil);
}

.menu__entree--danger {
  color: var(--erreur);
}

/* ── Fenêtre de tâche ──────────────────────────────────────── */

.fenetre--tache {
  width: 36em;
  padding: 0;
  color: var(--encre);
}

.fenetre--tache::backdrop {
  background: rgb(0 0 0 / 15%);
}

.champ--zone {
  height: auto;
  padding: 0.4em 0.5em;
  font-family: inherit;
  resize: vertical;
}
