:root {
  --texte: #1c2430;
  --discret: #5d6978;
  --trait: #d5dbe3;
  --fond: #f4f6f9;
  --carte: #ffffff;
  --accent: #1f4e8c;
  --danger: #a32626;
}

* { box-sizing: border-box; }

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

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  background: var(--carte);
  border-bottom: 1px solid var(--trait);
}

h1 { margin: 0; font-size: 20px; }
h2 { margin: 0 0 12px; font-size: 18px; }

main { max-width: 1040px; margin: 0 auto; padding: 24px; }

.carte {
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

#formulaire-connexion { max-width: 380px; margin: 40px auto; }
label { display: block; margin: 12px 0 4px; font-weight: 600; }
input:not([type="file"]) {
  width: 100%;
  padding: 9px 10px;
  font: inherit;
  border: 1px solid var(--trait);
  border-radius: 6px;
}

button, .bouton {
  display: inline-block;
  padding: 7px 14px;
  font: inherit;
  color: var(--texte);
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .bouton:hover { border-color: var(--accent); }
button:focus-visible, .bouton:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.principal { margin-top: 16px; width: 100%; color: #fff; background: var(--accent); border-color: var(--accent); }
.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.discret { margin-left: 10px; }
.lien { padding: 0; border: 0; background: none; color: var(--accent); text-align: left; }
.lien:hover { text-decoration: underline; }
.dossier { font-weight: 600; margin-right: 10px; }

.zone {
  padding: 28px 20px;
  margin-bottom: 20px;
  text-align: center;
  background: var(--carte);
  border: 2px dashed #9aa7b8;
  border-radius: 10px;
}
.zone.survol { border-color: var(--accent); background: #eaf1fa; }
.zone-titre { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.zone-choix { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.aide { margin: 4px 0; color: var(--discret); font-size: 14px; }
.erreur { color: var(--danger); }

progress { width: 100%; height: 14px; }

#fil { margin-bottom: 10px; overflow-wrap: anywhere; }
.separateur { margin: 0 8px; color: var(--discret); }

.tableau { overflow-x: auto; background: var(--carte); border: 1px solid var(--trait); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--trait); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { font-size: 14px; color: var(--discret); white-space: nowrap; }
td:first-child { overflow-wrap: anywhere; min-width: 220px; }
td:nth-child(2), td:nth-child(3) { white-space: nowrap; }
.actions { white-space: nowrap; text-align: right; }
.actions > * + * { margin-left: 8px; }

#bilan-echecs { margin: 8px 0; padding-left: 20px; overflow-wrap: anywhere; }
#bilan-echecs:empty { display: none; }

footer { margin-top: 20px; }
footer p { margin: 2px 0; }

dialog { max-width: 460px; padding: 22px; border: 1px solid var(--trait); border-radius: 10px; }
dialog::backdrop { background: rgba(20, 28, 40, 0.45); }
.dialogue-boutons { display: flex; justify-content: flex-end; gap: 10px; margin: 18px 0 0; }

#apercu { width: 96vw; height: 94vh; max-width: none; max-height: none; padding: 0; overflow: hidden; }
#apercu[open] { display: flex; flex-direction: column; }
.apercu-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--trait);
}
#apercu-nom { overflow-wrap: anywhere; }
.apercu-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
#apercu-corps {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #525659;
}
#apercu-corps iframe { width: 100%; height: 100%; border: 0; background: #fff; }
#apercu-corps img { max-width: 100%; max-height: 100%; object-fit: contain; }

[hidden] { display: none !important; }
