:root {
  --blue-deep: #073b4c;
  --blue: #118ab2;
  --teal: #06d6a0;
  --sand: #ffd166;
  --coral: #ef476f;
  --violet: #7b5cd6;
  --weekend-bg: #e6f3f8;
  --bg: #f4f9fb;
  --text: #0d2b36;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  color: white;
  padding: 1.5rem 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
header a { color: inherit; }

header h1 { margin: 0; font-size: 1.5rem; }
.subtitle { margin: 0.3rem 0 0; opacity: 0.85; font-size: 0.9rem; }

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  gap: 1.5rem;
}

.controls {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(7, 59, 76, 0.08);
}

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--blue-deep); }
select, input[type="date"] {
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #cfe3ea;
  font-size: 0.95rem;
}
input[type="range"] { accent-color: var(--blue); }

button#search {
  grid-column: 1 / -1;
  background: var(--teal);
  color: var(--blue-deep);
  border: none;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.1s ease;
}
button#search:hover { transform: translateY(-1px); }

.results { display: grid; gap: 0.75rem; }
#status { color: var(--blue-deep); font-size: 0.9rem; }

/* ---- Tableau des créneaux ---- */
.table-wrap {
  overflow-x: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(7, 59, 76, 0.08);
}

table.windows {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.windows th,
.windows td {
  padding: 0.4rem 0.6rem;
  text-align: left;
}

/* sticky sur le thead entier : les deux lignes (titres + filtres) restent collées */
.windows thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.windows thead th {
  background: var(--blue-deep);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
}
.windows thead abbr { text-decoration: none; cursor: help; border-bottom: 1px dotted rgba(255,255,255,0.6); }

.windows .num { text-align: right; }

/* ---- Ligne de filtres ---- */
.windows tr.filters th {
  padding-top: 0;
  vertical-align: top;
  font-weight: 400;
}
.windows .filters select,
.windows .filters input {
  font: inherit;
  font-size: 0.78rem;
  padding: 0.2rem 0.3rem;
  border: 1px solid #cfe3ea;
  border-radius: 4px;
  background: white;
  color: var(--text);
}
/* filtre actif : liseré turquoise */
.windows .filters .is-active {
  outline: 2px solid var(--teal);
  outline-offset: -1px;
}
.windows .filters .range { display: flex; gap: 0.25rem; justify-content: flex-end; }
.windows .filters .range.stack { flex-direction: column; }
.windows .filters input[type="number"] { width: 4.2em; }
.windows .filters input[type="time"] { width: 6.5em; }

.reset-filters {
  font: inherit;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  background: transparent;
  color: white;
  cursor: pointer;
}
.reset-filters:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); }
.reset-filters:disabled { opacity: 0.35; cursor: default; }

.windows td.empty {
  padding: 1.2rem;
  text-align: center;
  color: #607d8b;
  white-space: normal;
}

/* séparation entre jours, pas entre créneaux d'un même jour */
.windows tbody tr.day-start { border-top: 1px solid #d8e8ee; }
.windows tbody tr:first-child { border-top: none; }

.windows .c-date {
  font-weight: 700;
  color: var(--blue-deep);
  vertical-align: top;
}
.windows .c-sun {
  color: #4a6572;
  vertical-align: top;
}
.windows .c-win { color: #4a6572; }
.windows .sep { margin: 0 0.2em; color: #a3bcc6; }

.kind {
  display: inline-block;
  width: 2.2em;
  margin-right: 0.35em;
  padding: 0.05rem 0;
  border-radius: 4px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.kind.PM { background: var(--teal); color: var(--blue-deep); }
.kind.BM { background: var(--sand); color: var(--blue-deep); }

.coef {
  display: inline-block;
  min-width: 2.2em;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
}
.coef.ve { background: var(--coral); color: white; }
.coef.me { background: #d8e8ee; color: var(--blue-deep); }

.veille {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--coral);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin: 0.6rem 0 0;
  font-size: 0.75rem;
  color: #607d8b;
}
.legend .coef { font-size: 0.7rem; min-width: 0; }

@media (max-width: 600px) {
  main { padding: 1rem 0.5rem; }
  table.windows { font-size: 0.8rem; }
  .windows th, .windows td { padding: 0.35rem 0.4rem; }
}

/* --- Nature du jour ------------------------------------------------ */

/* Week-end : lignes teintées, date en bleu */
.windows tbody tr.weekend { background: var(--weekend-bg); }
.windows tr.weekend .c-date { color: var(--blue); }

/* Jour férié : date en corail + nom sous la date (prioritaire sur le week-end) */
.windows tr.ferie .c-date { color: var(--coral); }
.ferie-name {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Vacances scolaires : filet violet à gauche de la date (libellé en infobulle) */
.windows tr.vacances .c-date { box-shadow: inset 4px 0 0 var(--violet); }

.swatch {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.3em;
  border-radius: 3px;
  vertical-align: -0.1em;
}
.swatch-weekend { background: var(--weekend-bg); border: 1px solid var(--blue); }
.swatch-ferie { background: var(--coral); }
.swatch-vacances { background: var(--violet); }

footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
  font-size: 0.78rem;
  color: #607d8b;
}

/* --- Compte (en-tête) ---------------------------------------------- */

.account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}
.account-name { font-weight: 700; margin-right: 0.3rem; }
.account-btn {
  font: inherit;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  background: transparent;
  color: white;
  text-decoration: none;
  cursor: pointer;
}
.account-btn:hover { background: rgba(255, 255, 255, 0.15); }

/* --- Boutons génériques -------------------------------------------- */

.btn-primary,
.btn-secondary,
.btn-quiet,
.btn-danger {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
}
.btn-primary { background: var(--teal); color: var(--blue-deep); border: none; font-weight: 700; }
.btn-secondary { background: white; color: var(--blue-deep); border: 2px solid var(--teal); font-weight: 600; }
.btn-quiet { background: transparent; color: var(--blue-deep); border: 1px solid #cfe3ea; }
.btn-danger { background: transparent; color: var(--coral); border: 1px solid var(--coral); }
.btn-quiet:hover:not(:disabled) { background: var(--bg); }
.btn-danger:hover { background: var(--coral); color: white; }
button:disabled { opacity: 0.45; cursor: default; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* --- Préférences (sous le bouton de recherche) --------------------- */

.prefs-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding-top: 0.25rem;
  border-top: 1px dashed #cfe3ea;
}
.prefs-bar[hidden] { display: none; }
.prefs-status { font-size: 0.8rem; color: #607d8b; }

/* --- Dialogues (connexion, mot de passe) --------------------------- */

.account-dialog {
  border: none;
  border-radius: 12px;
  padding: 1.5rem;
  width: min(24rem, calc(100vw - 2rem));
  box-shadow: 0 12px 40px rgba(7, 59, 76, 0.25);
  color: var(--text);
}
.account-dialog::backdrop { background: rgba(7, 59, 76, 0.45); }
.account-dialog h2 { margin: 0 0 1rem; font-size: 1.1rem; color: var(--blue-deep); }
.account-dialog label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-deep);
}
.account-dialog input {
  font: inherit;
  font-weight: 400;
  padding: 0.5rem;
  border: 1px solid #cfe3ea;
  border-radius: 8px;
}
.dialog-error { min-height: 1.2em; margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--coral); }
.dialog-hint { margin: -0.4rem 0 0.4rem; font-size: 0.8rem; color: #607d8b; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }

/* --- Page d'administration ----------------------------------------- */

.admin { display: grid; gap: 1.5rem; }
.admin[hidden] { display: none; }

.panel {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(7, 59, 76, 0.08);
}
.panel h2 { margin: 0 0 1rem; font-size: 1.05rem; color: var(--blue-deep); }
.panel .table-wrap { box-shadow: none; border: 1px solid #d8e8ee; }

.create-user {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: end;
}
.create-user h2,
.create-user .form-status { grid-column: 1 / -1; margin-bottom: 0; }
.create-user input[type="text"],
.create-user input:not([type]) {
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #cfe3ea;
  font-size: 0.95rem;
  min-width: 0;
}
.with-action { display: flex; gap: 0.4rem; }
.with-action input { flex: 1; }
.check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; padding-bottom: 0.5rem; }
.form-status { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--blue-deep); }

table.users { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.users th, .users td { padding: 0.5rem 0.6rem; text-align: left; white-space: nowrap; }
.users thead th { background: var(--blue-deep); color: white; font-size: 0.8rem; font-weight: 600; }
.users tbody tr + tr { border-top: 1px solid #d8e8ee; }
.users tbody th { color: var(--blue-deep); }
.users .actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.users .actions button { font-size: 0.78rem; padding: 0.25rem 0.55rem; }

.tag {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #d8e8ee;
  color: var(--blue-deep);
}
.tag-admin { background: var(--sand); }

.gate {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.gate[hidden] { display: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Administration : mise en page, onglets ------------------------ */

main.admin-main { max-width: 1100px; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 2px solid #cfe3ea;
}
.tabs [role="tab"] {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  margin-bottom: -2px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #4a6572;
  cursor: pointer;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--blue-deep); border-bottom-color: var(--teal); }
.tabs [role="tab"]:hover { color: var(--blue-deep); }
.tab-panel { display: grid; gap: 1.5rem; }
.tab-panel[hidden] { display: none; }

.count {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.35em;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-size: 0.72rem;
  text-align: center;
}
.count[hidden] { display: none; }

.flash { margin: -0.75rem 0 0; min-height: 1.2em; font-size: 0.88rem; color: var(--blue-deep); }
.flash a { color: var(--blue); }

.banner {
  margin: 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--coral);
  border-radius: 8px;
  background: #fde8ed;
  font-size: 0.9rem;
}
.banner[hidden] { display: none; }

code {
  font-size: 0.85em;
  padding: 0.05em 0.3em;
  border-radius: 4px;
  background: #e6f0f4;
}

.hint { margin: 0.5rem 0 0; font-size: 0.8rem; color: #607d8b; }
.muted { color: #607d8b; }

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}
.panel-head h2 { margin: 0; }

.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.inline-form input[type="number"] { width: 5.5em; }
.inline-form input,
.inline-form select,
.port-form input,
.port-form select {
  font: inherit;
  padding: 0.45rem 0.5rem;
  border: 1px solid #cfe3ea;
  border-radius: 8px;
  min-width: 0;
}

/* --- Ports ---------------------------------------------------------- */

.port-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  align-items: end;
}
.port-form h2 { grid-column: 1 / -1; margin-bottom: 0; }
.port-form .span-all { grid-column: 1 / -1; }
.port-form .hint { margin: 0; }
.port-form .form-status { display: inline; margin-left: 0.75rem; }

.users td.empty { padding: 1.2rem; text-align: center; color: #607d8b; white-space: normal; }
.users .num { text-align: right; }
.users .actions { align-items: center; }
.year-input {
  width: 5.2em;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.3rem;
  border: 1px solid #cfe3ea;
  border-radius: 6px;
}
.ports .tag { margin: 0.05rem 0; }

/* --- Données et tâches ---------------------------------------------- */

.sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.source { display: flex; flex-direction: column; gap: 0.75rem; }
.source h2 { margin-bottom: 0; }
.source .hint { margin: 0; }
.source > button { align-self: flex-start; }
.source-body p { margin: 0 0 0.4rem; font-size: 0.9rem; }
ul.plain { margin: 0; padding: 0; list-style: none; font-size: 0.85rem; display: grid; gap: 0.2rem; }

.tag.job-queued { background: #e6f0f4; color: #4a6572; }
.tag.job-running { background: var(--blue); color: white; }
.tag.job-succeeded { background: var(--teal); color: var(--blue-deep); }
.tag.job-failed { background: var(--coral); color: white; }
.tag.job-cancelled { background: transparent; color: #607d8b; border: 1px solid #a3bcc6; }

.jobs tr.is-open { background: var(--weekend-bg); }

.job-log { margin-top: 1rem; }
.job-log[hidden] { display: none; }
.job-log-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.job-log h3 { margin: 0; font-size: 0.95rem; color: var(--blue-deep); }
.job-log pre {
  margin: 0;
  max-height: 24rem;
  overflow: auto;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--blue-deep);
  color: #d8eef5;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Créneaux choisis ------------------------------------------------ */

:root { --picked-bg: #eef1f2; --picked-text: #9aabb2; }

/* colonne « Choix » : seulement pour un utilisateur connecté */
.results:not(.can-pick) .c-pick,
.results:not(.can-pick) .c-pick-head { display: none; }

.windows .c-pick { white-space: nowrap; }
.windows .c-pick select {
  font: inherit;
  font-size: 0.78rem;
  padding: 0.15rem 0.3rem;
  border: 1px solid #cfe3ea;
  border-radius: 4px;
  max-width: 11rem;
}

/* Ligne déjà choisie par l'utilisateur : grisée. La date et les heures de
   soleil (fusionnées sur plusieurs lignes) gardent leur couleur. */
.windows tbody tr.is-picked > td:not(.c-sun):not(.c-pick) {
  background: var(--picked-bg);
  color: var(--picked-text);
}
.windows tr.is-picked .kind,
.windows tr.is-picked .coef { filter: grayscale(1); opacity: 0.55; }
.windows tr.is-picked .c-pick { background: var(--picked-bg); }
.swatch-picked { background: var(--picked-bg); border: 1px solid var(--picked-text); }

.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.05rem 0.5rem 0.05rem 0.4rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--type-color) 45%, white);
  background: color-mix(in srgb, var(--type-color) 12%, white);
  color: var(--blue-deep);
  font-size: 0.75rem;
  font-weight: 600;
}
.type-pill::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--type-color);
}

.unpick {
  margin-left: 0.25rem;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #607d8b;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.unpick:hover:not(:disabled) { border-color: var(--coral); color: var(--coral); }

/* --- Page « Mes créneaux » ------------------------------------------- */

.picks-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.88rem;
}
.picks-bar select {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid #cfe3ea;
  border-radius: 8px;
}
.picks-summary { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.picks-summary b { margin-left: 0.25em; }

table.picks .c-type select,
.slot-card .c-type select {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid #cfe3ea;
  border-radius: 6px;
  border-left: 4px solid var(--type-color, #cfe3ea);
}
table.picks tr.past > :not(.c-date) { color: var(--picked-text); }
table.picks .c-port { color: #4a6572; }

/* --- Administration : types de créneaux ------------------------------ */

.settings-form {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: start;
  gap: 0.75rem 1rem;
  align-items: end;
}
.settings-form h2, .settings-form .hint, .settings-form .form-status { grid-column: 1 / -1; margin-bottom: 0; }
.settings-form button { justify-self: start; }
.lock-days { display: inline-flex; align-items: center; gap: 0.5rem; }
.lock-days input {
  font: inherit;
  width: 5rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid #cfe3ea;
  border-radius: 8px;
}
@media (max-width: 600px) {
  .settings-form { grid-template-columns: 1fr; }
}

.type-form {
  display: grid;
  grid-template-columns: minmax(12rem, 2fr) auto auto auto;
  gap: 0.75rem 1rem;
  align-items: end;
}
.type-form h2, .type-form .form-status { grid-column: 1 / -1; margin-bottom: 0; }
.type-form input[type="text"] {
  font: inherit;
  padding: 0.45rem 0.5rem;
  border: 1px solid #cfe3ea;
  border-radius: 8px;
  min-width: 0;
}
input[type="color"] {
  width: 2.6rem;
  height: 2.2rem;
  padding: 0.1rem;
  border: 1px solid #cfe3ea;
  border-radius: 8px;
  background: white;
}
.types .order { display: inline-flex; gap: 0.2rem; }
.types .order button { font-size: 0.75rem; padding: 0.15rem 0.4rem; }
.types tr.inactive th, .types tr.inactive td:not(.actions) { color: var(--picked-text); }

@media (max-width: 600px) {
  .type-form { grid-template-columns: 1fr auto; }
}
.btn-small { font-size: 0.78rem; padding: 0.25rem 0.55rem; }
.results[hidden] { display: none; }

/* 9 colonnes avec « Choix » : un peu plus large, et le tableau défile dans
   son cadre au lieu d'élargir la page (min-width: 0 sur l'élément de grille) */
main:not(.admin-main), footer { max-width: 1100px; }
.results, .results > * { min-width: 0; }
.windows .filters select[data-f="day"] { max-width: 7.5rem; }
.windows .c-pick select { max-width: 8.5rem; }
.picks-bar .check { padding-bottom: 0; }

/* --- Structures et rôles ---------------------------------------------- */

/* « hidden » l'emporte sur les display: grid/flex des composants */
[hidden] { display: none !important; }

.account-structure { font-weight: 400; color: rgba(255, 255, 255, 0.8); }
.h1-sub { font-weight: 400; font-size: 0.8em; color: rgba(255, 255, 255, 0.8); }

.inline-panel h2 { margin-bottom: 0.75rem; }
.inline-panel input:not([type]) { min-width: 18rem; }

.scope-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}
.scope-bar label { font-weight: 600; color: var(--blue-deep); }
.scope-bar select { font: inherit; padding: 0.35rem 0.5rem; border-radius: 8px; border: 1px solid #cfe3ea; }
.scope-bar strong { color: var(--blue-deep); }

.create-user select { font: inherit; padding: 0.45rem 0.5rem; border-radius: 8px; border: 1px solid #cfe3ea; }
.tag.role-manager { background: var(--teal); color: var(--blue-deep); }
.tag.role-viewer { background: #e6f0f4; color: #4a6572; }

table.picks .c-by { color: #4a6572; font-size: 0.85rem; }
body.read-only table.picks .c-actions { display: none; }

/* Inscriptions sur les créneaux choisis */
table.picks .c-regs { white-space: nowrap; }
.regs { display: flex; align-items: center; gap: 0.4rem; }
.reg-count {
  display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.7rem; padding: 0 0.4rem;
  border: 1px solid #cfe3ea; border-radius: 999px; background: #e3eef3; color: #264653;
  font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.reg-count:hover, .reg-count[aria-expanded="true"] { background: #cde3ec; }
.reg-locked { font-size: 0.78rem; color: #607d8b; cursor: help; }
.reg-count.reg-me { background: #d8f3dc; border-color: #95d5b2; color: #1b4332; }
.regs-pop {
  position: fixed; z-index: 50; min-width: 11rem; max-width: 18rem; max-height: 50vh; overflow-y: auto;
  padding: 0.6rem 0.75rem; background: #fff; color: #263238; border: 1px solid #cfe3ea; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(7, 59, 76, 0.18); font-size: 0.85rem;
}
.regs-pop-title { margin: 0 0 0.35rem; font-weight: 700; color: var(--blue-deep); }
.regs-pop p { margin: 0; }
.regs-pop ul { list-style: none; margin: 0; padding: 0; }
.regs-pop li { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.15rem 0; }
.regs-pop li.me { font-weight: 600; color: #1b4332; }
.chip-remove {
  border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0.2rem;
  font-size: 1rem; line-height: 1; opacity: 0.55;
}
.chip-remove:hover, .chip-remove:focus-visible { opacity: 1; color: #c62828; }

/* Sélecteur de structure du super administrateur (en-tête) */
.account-structure-select {
  margin-left: 0.3rem; max-width: 14rem; padding: 0.15rem 0.4rem; font: inherit; font-size: 0.85rem;
  color: #fff; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 6px;
}
.account-structure-select option { color: #1d3557; background: #fff; }

/* --- Comptes : profil, mots de passe, import ------------------------- */

.account-dot {
  display: inline-grid;
  place-items: center;
  width: 1.1em;
  height: 1.1em;
  margin-left: 0.2em;
  border-radius: 50%;
  background: var(--sand);
  color: var(--blue-deep);
  font-size: 0.8em;
  font-weight: 700;
}

.account-dialog { max-height: calc(100vh - 2rem); overflow-y: auto; }
.account-dialog select {
  font: inherit;
  font-weight: 400;
  padding: 0.45rem 0.5rem;
  border: 1px solid #cfe3ea;
  border-radius: 8px;
}
.account-dialog label.check { flex-direction: row; font-weight: 400; margin-bottom: 0.4rem; }
.account-dialog label.check input { padding: 0; }
.field-hint { font-weight: 400; font-size: 0.78rem; color: #607d8b; }
.dialog-links { margin: -0.3rem 0 0.6rem; font-size: 0.85rem; }
.dialog-message p { margin: 0 0 0.75rem; font-size: 0.92rem; }
.dialog-notice {
  margin: 0 0 0.9rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: #fff6db;
  font-size: 0.85rem;
}

.link-btn {
  font: inherit;
  padding: 0;
  border: none;
  background: none;
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}

/* Liste de contrôle du mot de passe */
.pw-rules {
  list-style: none;
  margin: -0.4rem 0 0.8rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
  font-size: 0.78rem;
  color: #8a9ba3;
}
.pw-rules li.ok { color: #0a7d5a; }
.pw-rules li span[aria-hidden] { display: inline-block; width: 1em; font-weight: 700; }
.password-block .pw-rules { margin: 0.4rem 0; }

/* Formulaire de création */
.create-user .password-mode,
.create-user .form-actions { grid-column: 1 / -1; }
.create-user input[type="email"],
.create-user input[type="tel"] {
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #cfe3ea;
  font-size: 0.95rem;
  min-width: 0;
}
.optional { font-weight: 400; font-size: 0.75rem; color: #607d8b; }
.password-mode {
  margin: 0;
  padding: 0.75rem 1rem 0.5rem;
  border: 1px solid #d8e8ee;
  border-radius: 10px;
}
.password-mode legend { padding: 0 0.3rem; font-size: 0.85rem; font-weight: 600; color: var(--blue-deep); }
.password-mode .check { padding-bottom: 0.35rem; }
.password-mode .check.disabled { opacity: 0.5; }
.password-block { margin: 0.3rem 0 0.2rem 1.6rem; max-width: 30rem; }
.password-block .with-action input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.03em; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.form-status .warn, .err { color: var(--coral); }

/* Liste des comptes */
.users-list th[scope="row"] { white-space: normal; min-width: 11rem; }
.user-name { font-weight: 700; }
.user-sub { display: block; font-weight: 400; font-size: 0.78rem; color: #607d8b; margin-bottom: 0.15rem; }
.users td.contact { font-size: 0.82rem; line-height: 1.4; }
.users td.contact a { color: var(--blue-deep); text-decoration: none; }
.users td.contact a:hover { text-decoration: underline; }
.tag-pending { background: #e6f3f8; color: var(--blue); }
.tag-warn { background: #fde8ed; color: #b3264a; }
#users-search { min-width: 16rem; }

/* Import CSV */
.import-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  align-items: end;
}
.import-grid select,
.import-grid input[type="file"] {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid #cfe3ea;
  border-radius: 8px;
  min-width: 0;
  background: white;
}
.import-preview { margin-top: 1rem; display: grid; gap: 0.75rem; }
.import-summary { margin: 0; font-size: 0.9rem; }
.import-table td, .import-table th { vertical-align: top; }
.import-table tr.row-error { background: #fff5f7; }
.import-table .check-cell { white-space: normal; min-width: 14rem; font-size: 0.8rem; }
.ok-mark { color: #0a7d5a; font-weight: 600; }
.import-result { margin-top: 1rem; padding: 0.75rem 1rem; border-radius: 10px; background: var(--bg); font-size: 0.9rem; }
.import-result p { margin: 0 0 0.5rem; }
.err-list { margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--coral); }

/* Page « choisir un mot de passe » */
main.narrow-main { max-width: 32rem; }
.reset-panel h2 { margin-bottom: 0.5rem; }
.reset-panel .hint { font-size: 0.88rem; margin-bottom: 1rem; }
.reset-form label:not(.check) {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-deep);
}
.reset-form input[type="password"],
.reset-form input[type="text"] {
  font: inherit;
  font-weight: 400;
  padding: 0.55rem;
  border: 1px solid #cfe3ea;
  border-radius: 8px;
}
.reset-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.reset-actions a { text-decoration: none; }
.account-dialog { width: min(26rem, calc(100vw - 2rem)); }
.account-dialog h2 + .dialog-hint { margin: -0.5rem 0 0.9rem; }
.dialog-actions button { white-space: nowrap; }

/* --- Créneaux choisis : calendrier, fiches, responsive ------------------ */

.view-switch {
  display: inline-flex;
  margin-left: auto;
  border: 1px solid #cfe3ea;
  border-radius: 8px;
  overflow: hidden;
}
.view-switch button {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.8rem;
  border: 0;
  background: white;
  color: var(--blue-deep);
  cursor: pointer;
}
.view-switch button + button { border-left: 1px solid #cfe3ea; }
.view-switch button[aria-pressed="true"] { background: var(--blue-deep); color: white; font-weight: 600; }

.picks-empty { margin: 0; }
.picks-empty[hidden] { display: none; }

.cal {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(7, 59, 76, 0.08);
}

.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.cal-title { margin: 0; min-width: 9.5rem; text-align: center; font-size: 1.15rem; color: var(--blue-deep); }
.cal-nav {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid #cfe3ea;
  border-radius: 50%;
  background: white;
  color: var(--blue-deep);
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.cal-nav:hover { background: var(--bg); }
.cal-count { font-size: 0.85rem; color: #607d8b; }
.cal-today { margin-left: auto; }

/* grille : les filets sont le fond de la grille, visible entre les cases */
.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
}
.cal-weekdays span {
  padding: 0.3rem 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue-deep);
}
.cal-weekdays span:nth-child(n+6) { color: var(--blue); }
.cal-grid {
  background: #d8e8ee;
  border: 1px solid #d8e8ee;
  border-radius: 8px;
  overflow: hidden;
}

.cal-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  min-height: 6rem;
  padding: 0.3rem;
  border: 0;
  background: white;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cal-cell:hover { background: #f0f7fa; }
.cal-cell.weekend { background: var(--weekend-bg); }
.cal-cell.out { background: #f7fafb; color: #a3bcc6; }
.cal-cell.is-past .cal-chip { filter: grayscale(1); opacity: 0.55; }
.cal-cell[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--blue); }
.cal-cell:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }

.cal-num {
  display: inline-grid;
  place-items: center;
  align-self: flex-start;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cal-cell[aria-current="date"] .cal-num { background: var(--blue); color: white; }

.cal-slots { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-chip {
  display: block;
  overflow: hidden;
  padding: 0.1rem 0.3rem;
  border-left: 3px solid var(--type-color);
  border-radius: 3px;
  background: color-mix(in srgb, var(--type-color) 14%, white);
  color: var(--blue-deep);
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.cal-chip.mine { background: color-mix(in srgb, var(--type-color) 32%, white); }
.cal-chip.mine b::before { content: "✓ "; }
.cal-more { font-size: 0.7rem; font-weight: 600; color: #607d8b; }

/* détail du jour sélectionné */
.day-panel { display: grid; gap: 0.6rem; padding-top: 0.4rem; scroll-margin-top: 0.5rem; }
.day-title { margin: 0; font-size: 1rem; color: var(--blue-deep); }
.day-empty { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; color: #607d8b; font-size: 0.9rem; }

.slot-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.slot-card {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  background: white;
  border: 1px solid #d8e8ee;
  border-left: 5px solid var(--type-color);
  border-radius: 8px;
  font-size: 0.88rem;
}
.slot-card p { margin: 0; }
.slot-card.mine { background: #f3fbf5; }
.slot-card.past { color: var(--picked-text); }
.slot-card.past .kind,
.slot-card.past .coef { filter: grayscale(1); opacity: 0.55; }

.slot-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2rem 0.75rem; }
.slot-rdv { color: var(--blue-deep); font-size: 0.8rem; font-weight: 600; }
.slot-rdv abbr { text-decoration: none; cursor: help; }
.slot-rdv strong { font-size: 1.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.slot-card.past .slot-rdv { color: inherit; }
.slot-port { color: #4a6572; font-weight: 600; }
.slot-tide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 1rem;
  font-variant-numeric: tabular-nums;
}
.slot-row .regs { flex-wrap: wrap; }
.slot-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding-top: 0.45rem;
  border-top: 1px solid #eef4f7;
}
.slot-by { font-size: 0.78rem; color: #607d8b; }

.list-cards { display: grid; gap: 1rem; }
.day-group { display: grid; gap: 0.5rem; }

/* --- Mobile ---------------------------------------------------------- */

@media (max-width: 700px) {
  header { padding: 1rem; }
  header h1 { font-size: 1.25rem; }

  .picks-bar { gap: 0.5rem 0.75rem; }
  .picks-bar > label:first-child { flex: 1 1 100%; display: flex; align-items: center; gap: 0.5rem; }
  .picks-bar > label:first-child select { flex: 1; }
  .view-switch { flex: 1 1 100%; margin-left: 0; }
  .view-switch button { flex: 1; padding: 0.5rem; }

  .cal { padding: 0.6rem; }
  .cal-title { font-size: 1.05rem; min-width: 0; flex: 1; }
  .cal-count { order: 5; flex-basis: 100%; text-align: center; }
  .cal-today { margin-left: 0; }

  /* cases compactes : numéro + pastilles de couleur du type */
  .cal-cell { min-height: 3.4rem; align-items: center; padding: 0.25rem 0.1rem; }
  .cal-num { align-self: center; }
  .cal-slots { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .cal-chip {
    width: 0.55rem;
    height: 0.55rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--type-color);
    font-size: 0;
  }
  .cal-chip.mine { box-shadow: 0 0 0 1.5px white, 0 0 0 3px var(--type-color); }
  .cal-chip.mine b::before { content: none; }
  .cal-more { font-size: 0.62rem; line-height: 0.55rem; }

  .slot-cards { grid-template-columns: 1fr; }
  .slot-row .btn-small { padding: 0.45rem 0.8rem; font-size: 0.85rem; }   /* cibles tactiles */
  .reg-count { min-width: 2.1rem; height: 2.1rem; }
}

/* --- Page de choix des créneaux : responsive ------------------------------
   ≤ 700 px : le tableau devient une liste de cartes (une par créneau),
   la ligne de filtres un bloc de champs étiquetés. Les libellés viennent des
   attributs data-label posés par app.js. */

@media (max-width: 700px) {
  /* Formulaire de recherche : cibles tactiles, 16 px pour éviter le zoom iOS */
  .controls { padding: 1rem; gap: 0.75rem; }
  .controls select,
  .controls input[type="date"] { min-height: 2.75rem; font-size: 16px; }
  button#search { min-height: 3rem; }
  .prefs-bar { flex-wrap: wrap; }

  /* Le cadre du tableau disparaît : chaque carte a son propre fond */
  .results .table-wrap { overflow: visible; background: none; box-shadow: none; border-radius: 0; }
  table.windows, .windows tbody { display: block; white-space: normal; font-size: 0.9rem; }

  /* Filtres : bloc sombre, deux champs par ligne (plus de sticky : trop haut) */
  .windows thead {
    display: block;
    position: static;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: var(--blue-deep);
  }
  .windows thead tr:first-child { display: none; }          /* titres de colonnes */
  .windows tr.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .windows tr.filters th {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0;
    text-align: left;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
  }
  .windows tr.filters th[data-label]::before { content: attr(data-label); }
  .windows tr.filters th[colspan] { grid-column: 1 / -1; }
  .windows .filters select,
  .windows .filters input { width: 100%; min-width: 0; min-height: 2.5rem; font-size: 16px; }
  .windows .filters select[data-f="day"] { max-width: none; }
  .windows .filters .range,
  .windows .filters .range.stack { flex-direction: row; }
  .reset-filters { min-height: 2.5rem; font-size: 0.85rem; }

  /* Cartes */
  .windows tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 1rem;
    margin-bottom: 0.6rem;
    padding: 0.75rem;
    border: 0;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(7, 59, 76, 0.08);
  }
  .windows tbody tr.weekend { background: var(--weekend-bg); }
  .windows tbody tr.is-picked { background: var(--picked-bg); }   /* après weekend : le grisé l'emporte */
  .windows tbody tr.is-picked > td:not(.c-sun):not(.c-pick) { background: none; }

  .windows tbody th,
  .windows tbody td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0;
    text-align: left;
  }
  .windows tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--blue-deep);
  }

  /* Date en titre de carte ; répétée (via data-day) quand la ligne n'est pas la 1re du jour */
  .windows .c-date { grid-column: 1 / -1; display: block; font-size: 1rem; }
  .windows tr.vacances .c-date { padding-left: 0.5rem; }
  .windows tbody tr:not(.day-start)::before {
    content: attr(data-day);
    grid-column: 1 / -1;
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-deep);
  }
  .windows .c-win { grid-column: 1 / -1; }
  .windows td.empty { grid-column: 1 / -1; justify-content: center; }

  /* Choix du créneau : pleine largeur, gros boutons */
  .windows td.c-pick {
    grid-column: 1 / -1;
    margin-top: 0.2rem;
    padding-top: 0.6rem;
    border-top: 1px solid #eef4f7;
    background: none;
  }
  .windows td.c-pick::before { content: none; }
  .windows td.c-pick select { flex: 1; max-width: none; min-height: 2.75rem; font-size: 16px; }
  .windows td.c-pick .unpick { min-width: 2.75rem; min-height: 2.75rem; }
}

/* --- Administration : responsive -------------------------------------------
   ≤ 700 px : onglets défilants, formulaires confortables au doigt, et les
   tableaux (structures, ports, tâches, types, comptes, aperçu d'import)
   deviennent des cartes. Libellés fournis par les attributs data-label
   posés dans admin.js. */

@media (max-width: 700px) {
  main.admin-main { padding: 1rem 0.5rem; }
  .panel { padding: 1rem; }
  .account-btn { display: inline-flex; align-items: center; min-height: 2.5rem; }

  /* Onglets : une seule ligne qui défile (le filet du bas passe en ombre interne
     pour ne pas être rogné par le défilement) */
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    border-bottom: 0;
    box-shadow: inset 0 -2px 0 #cfe3ea;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs [role="tab"] { flex: 0 0 auto; margin-bottom: 0; padding: 0.7rem 0.8rem; white-space: nowrap; }

  /* Champs : 16 px (pas de zoom iOS) et hauteur tactile */
  .admin-main :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]), select),
  .account-dialog :is(input:not([type="checkbox"]):not([type="radio"]), select) {
    font-size: 16px;
    min-height: 2.6rem;
  }
  .admin-main input[type="checkbox"],
  .admin-main input[type="radio"] { width: 1.3rem; height: 1.3rem; flex: none; }
  .admin-main .check { align-items: flex-start; }
  .btn-primary, .btn-secondary, .btn-quiet, .btn-danger { min-height: 2.5rem; }
  .dialog-actions button { min-height: 2.6rem; }
  .account-dialog { padding: 1.1rem; }

  /* Formulaires en ligne : le libellé prend la ligne, champs et boutons s'étirent */
  .inline-form > label { flex: 1 1 100%; }
  .inline-form input:not([type="number"]),
  .inline-form select { flex: 1 1 12rem; }
  .inline-form button { flex: 1 1 auto; }
  .panel-head .inline-form { width: 100%; }
  .panel-head .inline-form [data-super] { display: flex; flex: 1 1 100%; min-width: 0; align-items: center; gap: 0.5rem; }
  .panel-head .inline-form [data-super] select { flex: 1; }
  #users-search { flex: 1 1 100%; min-width: 0; }
  .scope-bar select { flex: 1 1 12rem; }
  .password-block { margin-left: 0; }
  .import-grid button { width: 100%; }

  /* Données et tâches */
  .sources { grid-template-columns: 1fr; }
  .source > button { align-self: stretch; }
  .job-log-head { flex-wrap: wrap; }
  .job-log pre { max-height: 60vh; font-size: 0.75rem; }

  /* Tableaux → cartes */
  .panel .table-wrap { overflow: visible; border: 0; background: none; }
  table.users, .users tbody { display: block; white-space: normal; font-size: 0.9rem; }
  .users thead { display: none; }

  .users tbody tr,
  .users tbody tr + tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    margin-bottom: 0.6rem;
    padding: 0.75rem;
    border: 1px solid #d8e8ee;
    border-radius: 12px;
    background: white;
  }
  .users tbody th,
  .users tbody td {
    display: block;
    min-width: 0;
    padding: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .users tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.1rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #607d8b;
  }
  .users .num { text-align: left; }

  /* Le titre de la carte (cellule d'en-tête de ligne) passe en premier */
  .users tbody th[scope="row"] { order: -1; grid-column: 1 / -1; min-width: 0; font-size: 1rem; }
  .users td.contact,
  .users td.check-cell { grid-column: 1 / -1; min-width: 0; }
  .users td.empty { grid-column: 1 / -1; text-align: center; }

  /* Actions : ligne en bas de carte, boutons tactiles */
  .users tbody td.actions {
    order: 99;
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
    padding-top: 0.6rem;
    border-top: 1px solid #eef4f7;
  }
  .users tbody td.actions button { flex: 1 1 auto; min-height: 2.5rem; padding: 0.4rem 0.8rem; font-size: 0.85rem; }
  .users .year-input { width: 5.2em; min-height: 2.5rem; font-size: 16px; }
  .types .order button { min-width: 2.5rem; min-height: 2.5rem; }
}

/* Administration : les éléments de grille peuvent rétrécir sous la largeur de leur
   contenu ; sans cela, un tableau (white-space: nowrap) ou une liste déroulante à
   longues options élargit toute la page au lieu de défiler dans son cadre. */
.admin, .admin > *, .tab-panel > * { min-width: 0; }

@media (max-width: 700px) {
  .admin-main select { max-width: 100%; min-width: 0; }
  .admin-main .field { min-width: 0; }
  .admin-main .field :is(input:not([type="checkbox"]):not([type="radio"]), select) { width: 100%; max-width: 100%; }
}
