/* Palette du site : nuit #15173f sur papier #f2f0fa, cobalt #2632a6 sur lait #f7f5ff. Police système. */
:root {
  --cobalt: #2632a6;
  --lait: #f7f5ff;
  --papier: #f2f0fa;
  --nuit: #15173f;
  --nuit-douce: #3d4073;
  --rose: #ffbdd0;
  --filet: rgb(21 23 63 / 0.25);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--nuit);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--cobalt); text-underline-offset: 0.2em; }
a, button, select, input { min-height: 44px; }
a { display: inline-flex; align-items: center; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }

.evitement {
  position: absolute; left: 1rem; top: 0.5rem; z-index: 10;
  padding: 0.75rem 1rem; background: var(--rose); color: var(--nuit);
  transform: translateY(-200%);
}
.evitement:focus { transform: none; }

.entete, main, .pied { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.entete { padding-top: 1rem; }
.bandeau { margin: 0; padding: 0.75rem 1rem; background: var(--cobalt); color: var(--lait); }
.bandeau :focus-visible { outline-color: var(--rose); }
h1 { margin: 1rem 0 0.25rem; font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); line-height: 1.2; }
h2 { margin: 0 0 0.75rem; color: var(--cobalt); font-size: 1.3rem; line-height: 1.25; }
/* Un nom de colonne ne se coupe jamais ; une ligne sans espace défile dans son cadre */
code { font-size: 0.9em; overflow-wrap: normal; word-break: normal; hyphens: none; display: inline-block; max-width: 100%; overflow-x: auto; vertical-align: bottom; }
.tableau th, .tableau td[data-titre]::before { overflow-wrap: normal; word-break: normal; hyphens: none; }

.panneau {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--lait);
  border: 1px solid var(--filet);
}
.panneau p { margin: 0 0 0.75rem; }
.champ { display: grid; gap: 0.35rem; margin: 0 0 0.75rem; max-width: 100%; }
label { font-weight: 600; }
input, select {
  max-width: 100%;
  font: inherit;
  color: var(--nuit);
  background: #fff;
  border: 1px solid var(--nuit-douce);
  padding: 0.4rem 0.5rem;
}
input[type="file"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0.5rem;
  overflow: hidden;
}
/* Chrome découpe le champ date en plusieurs arrêts. Le dernier n'a pas toujours
   :focus-visible : le contour suit donc aussi :focus et :focus-within. */
input[type="date"]:focus,
.champ-date:focus-within {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.75rem; }
button {
  font: inherit;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border: 2px solid var(--cobalt);
  background: var(--cobalt);
  color: var(--lait);
  cursor: pointer;
  max-width: 100%;
}
button:hover { background: var(--nuit); border-color: var(--nuit); }
button.secondaire { background: var(--lait); color: var(--cobalt); }
button.secondaire:hover { background: var(--rose); color: var(--nuit); border-color: var(--nuit); }

.rejets, .historique { margin: 0; padding-left: 1.25rem; }
.rejets li, .historique li { margin: 0 0 0.35rem; }
.message:empty { display: none; }
.message { font-weight: 600; }

.tableau { width: 100%; border-collapse: collapse; }
.tableau th, .tableau td { padding: 0.5rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--filet); }
.tableau thead th { background: var(--papier); }
.tableau tr.retard td:first-child { box-shadow: inset 4px 0 0 var(--nuit); }
.changer { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.badge { display: inline-block; padding: 0.15rem 0.5rem; background: var(--rose); color: var(--nuit); font-weight: 700; }
.invisible {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Écrans étroits : une carte par opération, aucun défilement horizontal */
@media (max-width: 52rem) {
  .tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tableau, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau tr { margin: 0 0 0.75rem; padding: 0.5rem; border: 1px solid var(--filet); background: #fff; }
  .tableau tr.retard { box-shadow: inset 4px 0 0 var(--nuit); }
  .tableau tr.retard td:first-child { box-shadow: none; }
  .tableau td { border: 0; padding: 0.25rem 0.25rem 0.25rem 0.5rem; }
  .tableau td[data-titre]::before { content: attr(data-titre) " : "; font-weight: 700; }
}

.pied { padding-bottom: 2rem; }
