/* ============================================================
   PANEL RT TOITURE — feuille de style
   Reprend la charte du site : ardoise graphite + cuivre.
   Pensée pour un artisan qui ouvre ça deux fois par mois :
   gros clics, libellés explicites, aucune icône sans texte.
   ============================================================ */

:root {
  --ink: #101418;
  --ink-soft: #171c21;
  --slate-deep: #1e252b;
  --slate-mid: #2b343c;
  --line: #38424b;

  --copper: #c08260;
  --copper-bright: #dfa37c;
  --copper-deep: #96603f;

  --paper: #f5f2ed;
  --muted: #99a3ac;
  --faint: #6b757e;

  --ok: #4ea87a;
  --warn: #d9a441;
  --danger: #d9614f;

  --radius: 4px;
  --sidebar-w: 268px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--copper);
  text-decoration: none;
}

a:hover {
  color: var(--copper-bright);
}

:focus-visible {
  outline: 2px solid var(--copper-bright);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
}

/* ============================================================
   MISE EN PAGE & NAVIGATION
   ------------------------------------------------------------
   Deux dispositions à partir d'un seul balisage :

   • Mobile  : barre du haut (☰ + titre de l'écran), menu latéral en
               tiroir, barre du bas à cinq raccourcis.
   • Desktop : le même menu, fixe à gauche ; barres du haut et du bas
               masquées.

   Toutes les zones tactiles font au moins 48 px de haut : le panel
   s'utilise sur un chantier, parfois avec des gants.
   ============================================================ */

:root {
  --barre-haut-h: 58px;
  --barre-bas-h: 64px;
  --menu-l: 300px;
  --tactile-min: 48px;
}

.layout {
  min-height: 100vh;
}

.main {
  padding: calc(var(--barre-haut-h) + 18px) 18px
           calc(var(--barre-bas-h) + 90px);
  max-width: 1080px;
}

/* ── Barre du haut (mobile) ──────────────────────────────── */

.barre-haut {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--barre-haut-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  background: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}

.bouton-menu,
.bouton-fermer,
.barre-haut-lien {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tactile-min);
  height: var(--tactile-min);
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  border-radius: var(--radius);
}

.bouton-menu:hover,
.bouton-fermer:hover,
.barre-haut-lien:hover {
  background: var(--slate-deep);
  color: var(--copper-bright);
}

.barre-haut-titre {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ico {
  width: 22px;
  height: 22px;
  display: block;
}

/* ── Menu latéral ────────────────────────────────────────── */

.menu-lateral {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  width: min(var(--menu-l), 88vw);
  background: var(--ink-soft);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;

  /* Fermé par défaut sur mobile ; la transition part de la gauche. */
  transform: translateX(-102%);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-lateral.ouvert {
  transform: none;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.menu-voile {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.menu-entete {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 14px 18px;
  border-bottom: 1px solid var(--line);
}

.menu-marque {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
}

.menu-marque img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.menu-marque strong {
  display: block;
  font-size: 15px;
}

.menu-marque span span {
  display: block;
  font-size: 11px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 2px;
}

.menu-liste {
  flex: 1;
  padding: 8px 0 14px;
}

.menu-groupe {
  margin: 0;
  padding: 20px 18px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Une ligne de menu : icône, libellé, phrase d'aide, chevron. */
.menu-ligne {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 14px 10px 18px;
  color: var(--paper);
  transition: background 0.14s;
}

.menu-ligne:hover {
  background: var(--slate-deep);
  color: var(--paper);
}

.menu-ligne.actif {
  background: rgba(192, 130, 96, 0.12);
  box-shadow: inset 3px 0 0 var(--copper);
}

.menu-ligne.actif .menu-ligne-ico,
.menu-ligne.actif .menu-ligne-titre {
  color: var(--copper-bright);
}

.menu-ligne-ico {
  flex-shrink: 0;
  color: var(--muted);
  display: flex;
}

.menu-ligne-texte {
  flex: 1;
  min-width: 0;
}

.menu-ligne-titre {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.menu-ligne-aide {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--faint);
}

.menu-ligne-chevron {
  flex-shrink: 0;
  color: var(--line);
  display: flex;
}

.menu-ligne-chevron .ico {
  width: 16px;
  height: 16px;
}

.menu-ligne-simple {
  min-height: var(--tactile-min);
}

.pastille {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
  line-height: 1.5;
}

.menu-pied {
  border-top: 1px solid var(--line);
  padding: 14px 0 18px;
}

.menu-pied-user {
  margin: 0 0 8px;
  padding: 0 18px;
  font-size: 13px;
}

.menu-pied-user strong {
  display: block;
}

.menu-pied-user span {
  color: var(--faint);
  font-size: 12px;
}

.menu-version {
  margin: 10px 18px 0;
  font-size: 11px;
  color: var(--faint);
  opacity: 0.7;
}

.menu-pied .signature-mydmc {
  margin: 14px 18px 0;
}

/* ── Barre du bas (mobile) ───────────────────────────────── */

.barre-bas {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  height: var(--barre-bas-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.barre-bas-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.14s;
}

.barre-bas-item:hover {
  color: var(--paper);
}

.barre-bas-item.actif {
  color: var(--copper);
}

.barre-bas-ico {
  position: relative;
  display: flex;
}

.barre-bas-libelle {
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pastille-flottante {
  position: absolute;
  top: -6px;
  right: -10px;
  font-size: 10px;
  padding: 0 5px;
  min-width: 17px;
}

/* ── Desktop : menu fixe, barres masquées ────────────────── */

@media (min-width: 900px) {
  .barre-haut,
  .barre-bas,
  .menu-voile,
  .bouton-fermer {
    display: none !important;
  }

  .menu-lateral {
    transform: none;
    box-shadow: none;
    width: var(--menu-l);
  }

  .main {
    margin-left: var(--menu-l);
    /* Sur un écran de travail, l'en-tête n'a pas besoin de respirer
       autant : ces pixels valent une demi-ligne de tableau. */
    padding: 20px 34px 90px;
  }

  .page-head {
    margin-bottom: 14px;
  }
}

/* ============================================================
   CARTES & FORMULAIRES
   ============================================================ */

/* L'attribut `hidden` doit toujours l'emporter.
   Sans cette règle, une classe qui pose `display: flex` — .actions-bar,
   .dz-preview — annule le `hidden` du navigateur : la barre « Ajouter
   ces photos » s'affichait alors en permanence, sans photo à ajouter. */
[hidden] {
  display: none !important;
}

.card {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.card > h2 {
  font-size: 17px;
  margin-bottom: 4px;
}

.card-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
  max-width: 72ch;
}

.form-field {
  margin-bottom: 17px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--paper);
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="url"],
.form-field input[type="password"],
.form-field input[type="number"],
.form-field select,
.form-field textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.16s;
}

.form-field textarea {
  resize: vertical;
  line-height: 1.65;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--copper);
  outline: none;
}

.form-field .hint {
  display: block;
  font-size: 12px;
  color: var(--faint);
  margin-top: 5px;
}

.form-row {
  display: grid;
  gap: 0 18px;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 720px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   BOUTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}

.btn-primary {
  background: var(--copper);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--copper-bright);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--paper);
}

.btn-ghost:hover {
  border-color: var(--copper);
  color: var(--copper-bright);
}

.btn-danger {
  background: transparent;
  border-color: rgba(217, 97, 79, 0.45);
  color: #e89484;
}

.btn-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 9px 14px;
  font-size: 13px;
}

/* Sur mobile, tout ce qui se touche fait au moins 48 px de haut. */
@media (max-width: 899px) {
  .btn {
    min-height: var(--tactile-min);
  }

  .btn-sm {
    min-height: 42px;
  }

  .form-field input,
  .form-field select,
  .form-field textarea {
    min-height: var(--tactile-min);
    font-size: 16px; /* en dessous de 16px, iOS zoome à la mise au point */
  }

  .arrow-btn {
    width: var(--tactile-min);
    height: 42px;
  }

  .actions-bar .btn {
    flex: 1 1 auto;
  }
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.actions-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Barre d'enregistrement collée en bas — toujours à portée de pouce.
   Sur mobile elle se cale AU-DESSUS de la barre de raccourcis, pour ne
   jamais être recouverte ni sortir de l'écran. */
.save-bar {
  position: sticky;
  bottom: calc(var(--barre-bas-h) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--ink) 62%, transparent);
  padding: 20px 0 16px;
  margin-top: 26px;
  z-index: 20;
}

.save-bar .btn {
  width: 100%;
  min-height: var(--tactile-min);
}

@media (min-width: 900px) {
  .save-bar {
    bottom: 0;
  }

  .save-bar .btn {
    width: auto;
  }
}

/* ============================================================
   ALERTES
   ============================================================ */

.alert {
  border-radius: var(--radius);
  padding: 13px 17px;
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid;
}

.alert-success {
  background: rgba(78, 168, 122, 0.12);
  border-color: rgba(78, 168, 122, 0.4);
  color: #9fdcbd;
}

.alert-error {
  background: rgba(217, 97, 79, 0.12);
  border-color: rgba(217, 97, 79, 0.4);
  color: #f0a99c;
}

.alert-info {
  background: rgba(192, 130, 96, 0.1);
  border-color: rgba(192, 130, 96, 0.35);
  color: var(--copper-bright);
}

/* ============================================================
   TABLEAUX
   ============================================================ */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.pill-ok {
  background: rgba(78, 168, 122, 0.16);
  color: #8fd3b2;
}

.pill-warn {
  background: rgba(217, 164, 65, 0.16);
  color: #e9c37c;
}

.pill-off {
  background: rgba(153, 163, 172, 0.14);
  color: var(--muted);
}

.pill-role {
  background: rgba(192, 130, 96, 0.16);
  color: var(--copper-bright);
}

/* ============================================================
   RÉALISATIONS — dépôt de photos + grille de cartes
   ============================================================ */

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 34px 24px;
  text-align: center;
  transition: border-color 0.18s, background 0.18s;
  cursor: pointer;
  display: block;
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--copper);
  background: rgba(192, 130, 96, 0.06);
}

.dropzone-icon {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 10px;
}

.dropzone strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

.dropzone span {
  color: var(--muted);
  font-size: 13px;
}

.dropzone input[type="file"] {
  display: none;
}

/* Aperçu des fichiers choisis, avant envoi */
.dz-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.dz-thumb {
  width: 84px;
  height: 84px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--line);
}

.realisations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 18px;
}

.rea-card {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.rea-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--slate-deep);
  overflow: hidden;
}

.rea-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rea-position {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(16, 20, 24, 0.88);
  color: var(--copper-bright);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.rea-body {
  padding: 15px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}

.rea-body .form-field {
  margin-bottom: 0;
}

.rea-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 4px;
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.arrow-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  width: 34px;
  height: 32px;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.16s, color 0.16s;
}

.arrow-btn:hover:not(:disabled) {
  border-color: var(--copper);
  color: var(--copper-bright);
}

.arrow-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.rea-tools .spacer {
  flex: 1;
}

/* État vide */
.empty-state {
  text-align: center;
  padding: 44px 24px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-soft);
}

.empty-state strong {
  display: block;
  color: var(--paper);
  font-size: 16px;
  margin-bottom: 7px;
}

/* ============================================================
   PRESTATIONS — liste dépliable + galerie par prestation
   ============================================================ */

.presta {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  margin-bottom: 12px;
  overflow: hidden;
}

.presta[open] {
  border-color: rgba(192, 130, 96, 0.45);
}

.presta summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.presta summary::-webkit-details-marker {
  display: none;
}

.presta summary:hover {
  background: var(--slate-deep);
}

.presta-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--copper);
  font-size: 13px;
  flex-shrink: 0;
}

.presta-titre {
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.presta-meta {
  font-size: 12px;
  color: var(--faint);
  flex-shrink: 0;
}

.presta-corps {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--line);
}

.presta-galerie {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  margin-top: 6px;
  background: var(--ink-soft);
}

.label-galerie {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.photo-item {
  position: relative;
  width: 104px;
  height: 78px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: grab;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Pastille indiquant qu'une vignette est une vidéo. */
.photo-video-marque {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(16, 20, 24, 0.85);
  color: var(--copper-bright);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.photo-suppr {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(16, 20, 24, 0.85);
  color: var(--paper);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s;
}

.photo-suppr:hover {
  background: var(--danger);
}

/* Élément en cours de glissement */
.est-glisse {
  opacity: 0.45;
}

/* ============================================================
   APERÇU D'IMAGE DANS UN CHAMP
   ============================================================ */

.img-preview {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 13px;
}

.img-preview img {
  width: 108px;
  height: 78px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--slate-deep);
}

.img-preview .path {
  font-size: 12px;
  color: var(--faint);
  word-break: break-all;
}

/* ============================================================
   TABLEAU DE BORD
   ============================================================ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.stat {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 19px 20px;
}

.stat .value {
  font-size: 30px;
  font-weight: 800;
  color: var(--copper);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat .label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.quick-link {
  display: block;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 19px;
  color: var(--paper);
  transition: border-color 0.16s, transform 0.16s;
}

.quick-link:hover {
  border-color: var(--copper);
  color: var(--paper);
  transform: translateY(-2px);
}

.quick-link strong {
  display: block;
  margin-bottom: 4px;
}

.quick-link span {
  font-size: 13px;
  color: var(--muted);
}

/* ============================================================
   MESSAGES REÇUS
   ============================================================ */

.msg {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-soft);
  margin-bottom: 13px;
  overflow: hidden;
}

/* Un message non lu est signalé par un badge « Non lu » explicite dans son
   en-tête (voir views/sections/messages.php) plutôt que par un simple
   liseré de couleur : c'est lisible sans avoir à deviner le code couleur. */
.msg.non-lu {
  border-color: rgba(192, 130, 96, 0.45);
}

.msg summary {
  padding: 15px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  list-style: none;
}

.msg summary::-webkit-details-marker {
  display: none;
}

.msg summary .who {
  font-weight: 600;
}

.msg summary .when {
  color: var(--faint);
  font-size: 13px;
  margin-left: auto;
}

.msg-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.msg-body dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 7px 14px;
  margin: 0 0 15px;
  font-size: 14px;
}

.msg-body dt {
  color: var(--faint);
}

.msg-body .texte {
  white-space: pre-wrap;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  line-height: 1.7;
}

/* ============================================================
   CONNEXION
   ============================================================ */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
}

.login-card img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  margin-bottom: 18px;
}

.login-card h1 {
  font-size: 21px;
  margin-bottom: 6px;
}

.login-card .sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 26px;
}

/* ============================================================
   CONNEXION EN DEUX ÉTAPES — saisie du code reçu par email
   ============================================================ */

.champ-code {
  font-size: 30px !important;
  letter-spacing: 0.42em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 14px 10px !important;
  font-weight: 700;
}

.champ-code::placeholder {
  letter-spacing: 0.3em;
  color: var(--faint);
  font-weight: 400;
}

.case-a-cocher {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin: 4px 0 20px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
}

.case-a-cocher input {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--copper);
  flex-shrink: 0;
  cursor: pointer;
}

.case-a-cocher em {
  display: block;
  font-style: normal;
  color: var(--faint);
  font-size: 12px;
  margin-top: 3px;
}

.liens-secondaires {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.lien-bouton {
  background: none;
  border: none;
  padding: 0;
  color: var(--copper);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lien-bouton:hover {
  color: var(--copper-bright);
}

/* ============================================================
   SOUS-BLOC REPLIABLE (réglages secondaires d'une carte)
   ============================================================ */

.sous-bloc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 4px 0 14px;
  background: var(--ink-soft);
}

.sous-bloc summary {
  padding: 12px 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  min-height: var(--tactile-min);
  display: flex;
  align-items: center;
}

.sous-bloc summary::-webkit-details-marker {
  display: none;
}

.sous-bloc summary::before {
  content: "▸";
  margin-right: 9px;
  color: var(--copper);
  transition: transform 0.16s;
  display: inline-block;
}

.sous-bloc[open] summary::before {
  transform: rotate(90deg);
}

.sous-bloc summary:hover {
  color: var(--paper);
}

.sous-bloc-corps {
  padding: 4px 15px 12px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   ONGLETS

   Écran « Page contact », d'après l'éditeur Duda : Champs /
   Soumission / Intégrations. Sans JavaScript, tous les volets
   restent visibles — on ne cache jamais un réglage derrière un
   script qui pourrait ne pas se charger.
   ============================================================ */

.onglets {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.onglet {
  flex-shrink: 0;
  padding: 12px 18px;
  min-height: var(--tactile-min);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--faint);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s, border-color 0.16s;
}

.onglet:hover {
  color: var(--paper);
}

.onglet.actif {
  color: var(--copper);
  border-bottom-color: var(--copper);
}

/* ============================================================
   TABLEAU COMPACT — « une information = une ligne »

   Règle générale du panel : un réglage tient sur une ligne, jamais
   dans une carte, sauf s'il porte une image. Sept champs de
   formulaire doivent tenir sur un écran sans défiler ; en cartes,
   il en fallait trois.
   ============================================================ */

/* Sur un écran de portable, chaque pixel au-dessus du tableau est une
   ligne de moins visible : on resserre l'en-tête de page et la carte qui
   entoure un tableau compact. */
.card:has(.tableau-compact) {
  padding: 16px 18px;
}

.card:has(.tableau-compact) > h2 {
  margin-bottom: 2px;
}

.tableau-compact {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* En-tête : le texte d'aide n'est écrit QU'UNE FOIS, ici. Répété sous
   chaque ligne, il triplait la hauteur du tableau pour ne rien
   apprendre de plus. */
.tableau-entete {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: var(--slate-deep);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.ligne-compacte {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}

.ligne-compacte:last-child {
  border-bottom: none;
}

.ligne-compacte:hover {
  background: var(--ink-soft);
}

/* Colonnes du tableau des champs.
   Type et largeur partagent une cellule : ils décrivent tous deux la
   FORME du champ, et les garder ensemble permet de les déplacer d'un
   bloc sur mobile. */
.grille-champs {
  grid-template-columns: 34px minmax(110px, 1fr) 218px 88px 96px 104px;
}

.grille-champs > .cellule-type {
  display: flex;
  gap: 6px;
}

.grille-champs > .cellule-type select:first-child {
  flex: 1 1 auto;
}

.grille-champs > .cellule-type select:last-child {
  flex: 0 0 84px;
}

/* Menus déroulants dans une ligne de tableau : même gabarit que les
   champs texte, sans la hauteur d'un champ de formulaire classique. */
.ligne-compacte select {
  width: 100%;
  padding: 8px 6px;
  font-size: 13px;
  background: var(--ink-soft);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--paper);
  font-family: inherit;
}

.ligne-compacte select:hover {
  border-color: var(--line);
}

.ligne-compacte select:focus {
  border-color: var(--copper);
  outline: none;
}

/* Ligne supplémentaire : options d'une liste, texte d'un consentement.
   Elle ne s'affiche que pour les types qui en ont besoin — les autres
   champs gardent leur ligne unique. */
.ligne-extra {
  padding: 10px 14px 12px 48px;
  border-bottom: 1px solid var(--line);
  background: var(--ink-soft);
}

.ligne-extra label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.ligne-extra textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.ligne-extra textarea:focus {
  border-color: var(--copper);
  outline: none;
}

.ligne-extra .hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--faint);
}

.ligne-extra code {
  background: var(--slate-deep);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

/* Les deux bascules sont groupées dans le balisage pour pouvoir être
   déplacées ensemble sur mobile. Sur desktop, `display: contents` les
   rend transparentes : leurs enfants redeviennent des cellules de la
   grille, chacune dans sa colonne. */
.grille-champs > .cellule-bascules {
  display: contents;
}

/* Colonnes d'une liste d'adresses : poignée · adresse · flèches + corbeille */
.grille-adresses {
  grid-template-columns: 34px 1fr 110px;
}

/* ── Éditeur de texte riche ────────────────────────────────── */

.champ-riche .editeur {
  background: var(--ink);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Quill pose ses propres bordures claires : on les repeint aux couleurs
   du panel plutôt que de charger un second thème. */
.champ-riche .ql-toolbar.ql-snow {
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--slate-deep);
  padding: 7px 8px;
}

.champ-riche .ql-container.ql-snow {
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: inherit;
  font-size: 14.5px;
}

.champ-riche .ql-editor {
  min-height: var(--editeur-h, 260px);
  max-height: 420px;
  color: var(--paper);
  line-height: 1.65;
  padding: 14px 16px;
}

.champ-riche .ql-editor.ql-blank::before {
  color: var(--faint);
  font-style: normal;
}

.champ-riche .ql-editor h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--paper);
}

.champ-riche .ql-editor h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 14px 0 6px;
  color: var(--paper);
}

.champ-riche .ql-editor a {
  color: var(--copper);
}

/* Icônes et libellés de la barre d'outils, en clair sur fond sombre. */
.champ-riche .ql-snow .ql-stroke { stroke: var(--muted); }
.champ-riche .ql-snow .ql-fill { fill: var(--muted); }
.champ-riche .ql-snow .ql-picker-label { color: var(--muted); }

.champ-riche .ql-snow .ql-toolbar button:hover .ql-stroke,
.champ-riche .ql-snow button.ql-active .ql-stroke,
.champ-riche .ql-snow .ql-picker-label:hover { stroke: var(--copper-bright); color: var(--copper-bright); }

.champ-riche .ql-snow .ql-toolbar button:hover .ql-fill,
.champ-riche .ql-snow button.ql-active .ql-fill { fill: var(--copper-bright); }

/* Les menus déroulants de Quill s'ouvrent en clair par défaut. */
.champ-riche .ql-snow .ql-picker-options {
  background: var(--slate-deep);
  border-color: var(--line);
}

.champ-riche .ql-snow .ql-picker-item { color: var(--muted); }
.champ-riche .ql-snow .ql-picker-item:hover { color: var(--copper-bright); }

/* La petite fenêtre d'ajout de lien. */
.champ-riche .ql-snow .ql-tooltip {
  background: var(--slate-deep);
  border-color: var(--line);
  color: var(--paper);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.champ-riche .ql-snow .ql-tooltip input[type="text"] {
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 6px 8px;
}

/* Le textarea reste dans le formulaire, mais devient invisible dès que
   l'éditeur a pris la main. */
.editeur-source.editeur-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Tableau de bord ───────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 720px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-carte {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: inherit;
  display: block;
}

a.stat-carte:hover {
  border-color: var(--copper);
}

.stat-valeur {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-copper {
  color: var(--copper-bright);
}

.stat-libelle {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--faint);
}

/* Courbe des visites : un SVG de trente points ne justifie pas
   d'embarquer une bibliothèque de graphiques. */
.courbe {
  width: 100%;
  height: 140px;
  display: block;
  margin-top: 10px;
}

.courbe-aire {
  fill: rgba(192, 130, 96, 0.14);
  stroke: none;
}

.courbe-trait {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.courbe-axe {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--faint);
  margin-top: 6px;
}

.grille-toppage {
  grid-template-columns: 1fr 120px 46px;
  min-height: 42px;
}

.toppage-nom {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toppage-barre {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--slate-deep);
  overflow: hidden;
}

.toppage-barre span {
  display: block;
  height: 100%;
  background: var(--copper);
}

.toppage-valeur {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.derniere-demande {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
}

.derniere-demande .hint {
  display: block;
  margin-top: 2px;
}

/* ── Écran Référencement ───────────────────────────────────── */

/* Page · titre · description, une ligne par page. */
.grille-seo {
  grid-template-columns: 190px 1fr 1fr;
  align-items: start;
}

.grille-seo.ligne-compacte {
  padding: 10px;
}

.cellule-page {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  padding-top: 6px;
}

.cellule-page a {
  font-size: 12px;
  color: var(--faint);
}

.cellule-page a:hover {
  color: var(--copper);
}

.cellule-seo {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Compteur de caractères : vert tant qu'on tient dans ce que Google
   affiche, orange au-delà. Pas de rouge — un titre long reste valide,
   il est seulement tronqué. */
.compteur {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.compteur-ok {
  color: var(--ok);
  background: rgba(78, 168, 122, 0.14);
}

.compteur-long {
  color: var(--warn);
  background: rgba(217, 164, 65, 0.16);
}

.compteur-auto {
  color: var(--faint);
  background: var(--slate-deep);
}

.liste-titre .compteur {
  margin-left: 8px;
  vertical-align: middle;
}

/* Aperçu du résultat Google : voir ce que verra l'internaute vaut
   mieux que compter des caractères dans sa tête. */
.apercu-google {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  max-width: 600px;
}

.apercu-url {
  font-size: 12px;
  color: #202124;
  margin-bottom: 2px;
}

.apercu-titre {
  font-size: 18px;
  line-height: 1.3;
  color: #1a0dab;
  margin-bottom: 3px;
}

.apercu-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #4d5156;
}

@media (max-width: 900px) {
  .grille-seo {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }
}

/* ── Écran Coordonnées ─────────────────────────────────────── */

/* Téléphones et emails : poignée · libellé · valeur · principal · actions */
.grille-tel {
  grid-template-columns: 34px 150px 1fr 104px 108px;
}

/* Adresses postales : quatre champs, donc une grille plus large. */
.grille-adr {
  grid-template-columns: 34px 96px 1fr 1fr 134px 104px 108px;
}

/* Réseaux : poignée · type · lien · libellé · actions */
.grille-res {
  grid-template-columns: 34px 136px 1fr 150px 108px;
}

/* Horaires : un jour par ligne. */
.grille-jour {
  grid-template-columns: 150px 1fr 132px;
}

.cellule-jour {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cellule-jour .bascule-compacte {
  justify-content: flex-start;
}

.jour-nom {
  font-size: 14px;
  font-weight: 600;
}

.cellule-plages {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.cellule-plages .plage {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.cellule-plages .plage input[type="time"] {
  min-width: 96px;
  flex: 0 0 auto;
}

.cellule-plages .bouton-corbeille {
  width: 30px;
  height: 30px;
}

@media (max-width: 900px) {
  /* En dessous, chaque tableau à colonnes multiples repasse en blocs :
     une grille à sept colonnes n'a pas de sens sur un téléphone. */
  .grille-tel,
  .grille-adr,
  .grille-res,
  .grille-jour {
    grid-template-columns: 34px 1fr;
    row-gap: 6px;
  }

  .grille-tel > *,
  .grille-adr > *,
  .grille-res > *,
  .grille-jour > * {
    grid-column: 2;
  }

  .grille-tel > .poignee,
  .grille-adr > .poignee,
  .grille-res > .poignee,
  .grille-jour > .cellule-jour {
    grid-column: 1 / -1;
  }

  .grille-jour > .cellule-jour {
    grid-column: 1 / -1;
  }
}

.ligne-compacte input[type="text"],
.ligne-compacte input[type="email"],
.ligne-compacte input[type="url"] {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  font-size: 14px;
  background: var(--ink-soft);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--paper);
  font-family: inherit;
}

.ligne-compacte input:hover {
  border-color: var(--line);
}

.ligne-compacte input:focus {
  border-color: var(--copper);
  background: var(--ink);
  outline: none;
}

.ligne-compacte .poignee {
  width: 34px;
  height: 40px;
}

.ligne-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.ligne-actions .arrow-btn,
.ligne-actions .bouton-corbeille {
  width: 32px;
  height: 32px;
}

/* Verrou : un champ que le client ne peut pas décocher. */
.cellule-verrou {
  font-size: 12px;
  color: var(--faint);
  text-align: center;
}

/* ── Bascule compacte ─────────────────────────────────────── */
/* Même mécanique que .bascule, sans le bloc de texte : dans un
   tableau, l'en-tête de colonne dit déjà de quoi il s'agit. */

.bascule-compacte {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  cursor: pointer;
}

.bascule-compacte input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bascule-compacte .bascule-piste {
  flex-shrink: 0;
}

.bascule-compacte-texte {
  font-size: 12px;
  color: var(--faint);
  /* Masqué sur desktop : l'en-tête de colonne le dit déjà. Réaffiché
     sur mobile, où le tableau n'a plus d'en-tête. */
  display: none;
}

@media (max-width: 720px) {
  .bascule-compacte-texte {
    display: inline;
  }

  .bascule-compacte {
    justify-content: flex-start;
  }
}

/* ── Deux colonnes côte à côte ────────────────────────────── */
.deux-colonnes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 860px) {
  .deux-colonnes {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ── Options avancées ─────────────────────────────────────── */
.avance {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 16px;
}

.avance > summary {
  cursor: pointer;
  padding: 13px 15px;
  font-size: 14px;
  font-weight: 600;
  color: var(--copper);
  list-style: none;
}

.avance > summary::-webkit-details-marker {
  display: none;
}

.avance > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s;
}

.avance[open] > summary::before {
  content: "▾ ";
}

.avance-corps {
  padding: 4px 15px 10px;
  border-top: 1px solid var(--line);
}

/* ── Mobile : l'intitulé au-dessus, les réglages en dessous ── */
@media (max-width: 720px) {
  .tableau-entete {
    display: none;
  }

  /* Sur mobile : intitulé en haut, type et largeur ensuite, bascules
     et flèches en bas. Une ligne de tableau à sept colonnes n'existe
     pas sur un téléphone. */
  .grille-champs {
    grid-template-columns: 34px 1fr auto;
    grid-template-areas:
      "poignee intitule fleches"
      ".       type     type"
      ".       reglages reglages";
    row-gap: 6px;
    padding: 10px;
  }

  .grille-champs > .poignee       { grid-area: poignee; }
  .grille-champs > .cellule-nom   { grid-area: intitule; }
  .grille-champs > .ligne-actions { grid-area: fleches; }
  .grille-champs > .cellule-type  { grid-area: type; display: flex; gap: 8px; }
  .grille-champs > .cellule-bascules {
    grid-area: reglages;
    display: flex;
    gap: 18px;
  }

  .ligne-extra {
    padding-left: 14px;
  }

  .grille-adresses {
    grid-template-columns: 34px 1fr auto;
  }
}

/* ============================================================
   LISTE DYNAMIQUE — socle partagé
   ------------------------------------------------------------
   Téléphones, emails, adresses, réseaux, champs de formulaire,
   plages horaires : même apparence et mêmes gestes partout.
   ============================================================ */

.liste-titre {
  font-size: 15px;
  margin: 22px 0 4px;
}

/* Dans une carte qui fait office d'écran entier, 22 px entre chaque
   sous-titre finissent par coûter une ligne de contenu. */
.volet .card > .liste-titre {
  margin: 14px 0 2px;
}

.volet .card > .liste-titre + .card-hint {
  margin-top: 0;
  margin-bottom: 6px;
}

.liste-dyn {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.liste-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  overflow: hidden;
}

.liste-item-barre {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 4px;
  border-bottom: 1px solid var(--line);
  background: var(--ink-soft);
}

.liste-item-resume {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.liste-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.liste-item-corps {
  padding: 14px 15px 4px;
}

/* La poignée : seule zone qui déclenche le déplacement. Le reste de la
   carte reste sélectionnable et défilable normalement. */
.poignee {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tactile-min);
  height: var(--tactile-min);
  flex-shrink: 0;
  color: var(--faint);
  cursor: grab;
  border-radius: var(--radius);
  touch-action: none; /* indispensable : sans cela iOS défile au lieu de glisser */
}

.poignee:hover {
  color: var(--copper);
  background: var(--slate-deep);
}

.poignee:active {
  cursor: grabbing;
}

.bouton-corbeille {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tactile-min);
  height: 40px;
  flex-shrink: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: color 0.16s, background 0.16s;
}

.bouton-corbeille:hover {
  color: #fff;
  background: var(--danger);
}

.bouton-modifier {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tactile-min);
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s;
}

.bouton-modifier:hover,
.bouton-modifier[aria-expanded="true"] {
  color: var(--copper);
  border-color: var(--copper);
}

/* ------------------------------------------------------------
   VUE COMPACTE DES RÉALISATIONS

   Une ligne de 80 px : vignette, titre, poignée. On trie d'abord,
   on légende ensuite — trier vingt-deux cartes plein écran au doigt
   est impraticable, on ne voit jamais où l'on va déposer.
   ------------------------------------------------------------ */

.rea-ligne {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  overflow: hidden;
}

.rea-ligne.masquee .rea-ligne-barre {
  opacity: 0.5;
}

.rea-ligne-barre {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 2px;
  min-height: 80px;
}

.rea-vignette {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--slate-deep);
}

.rea-vignette img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Le numéro de position : le client trie à l'aveugle sinon, surtout
   quand il remonte une photo de la vingtième à la deuxième place. */
.rea-position {
  position: absolute;
  inset: auto auto 0 0;
  z-index: 1;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--copper);
  border-radius: 0 var(--radius) 0 0;
}

.rea-ligne-texte {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rea-ligne-titre,
.rea-ligne-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rea-ligne-titre {
  font-size: 14px;
  font-weight: 600;
}

.rea-ligne-meta {
  font-size: 12px;
  color: var(--faint);
}

.rea-ligne-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.rea-ligne-detail {
  padding: 14px 15px 4px;
  border-top: 1px solid var(--line);
  background: var(--ink-soft);
}

/* Sur téléphone, les quatre boutons se rangent en carré 2×2 : en file
   ils rogneraient le titre, en colonne ils feraient une ligne de 130 px
   et l'on ne verrait plus que trois réalisations à l'écran. */
@media (max-width: 560px) {
  /* La liste déborde de la carte : sur un écran de 375 px, ces 2 × 14 px
     sont la différence entre un titre lisible et un « Photo s… ». */
  .liste-dyn.compacte {
    margin-left: -14px;
    margin-right: -14px;
  }

  .rea-ligne-actions {
    display: grid;
    grid-template-columns: repeat(2, 30px);
    gap: 4px;
  }

  .rea-ligne-actions .arrow-btn,
  .rea-ligne-actions .bouton-modifier,
  .rea-ligne-actions .bouton-corbeille {
    width: 30px;
    height: 30px;
  }

  .rea-vignette {
    width: 52px;
    height: 52px;
  }

  /* La poignée se rétrécit mais garde ses 44 px de haut : la cible
     tactile reste conforme, et le titre gagne la place perdue. */
  .rea-ligne-barre > .poignee {
    width: 30px;
  }

  .rea-ligne-barre {
    gap: 8px;
    padding-left: 0;
  }
}

/* Pendant un déplacement : on fige la sélection de texte et le
   défilement parasite. */
body.glisse-en-cours {
  user-select: none;
  -webkit-user-select: none;
}

.est-glisse {
  opacity: 0.55;
  outline: 2px dashed var(--copper);
  outline-offset: -2px;
}

/* ============================================================
   AFFICHER / MASQUER LE MOT DE PASSE

   L'enveloppe et le bouton sont créés par app.js autour de CHAQUE
   champ de type password. Sans les règles ci-dessous, le bouton
   tombait sous le champ, en carré blanc non stylé — c'est ce qu'on
   voyait sur l'écran de connexion.
   ============================================================ */

.champ-mdp {
  position: relative;
  display: block;
}

.champ-mdp input {
  width: 100%;
  /* Place réservée au bouton, pour que la saisie ne passe pas dessous. */
  padding-right: 52px;
}

.bouton-oeil {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tactile-min);
  height: var(--tactile-min);
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: color 0.16s;
}

.bouton-oeil svg {
  width: 20px;
  height: 20px;
}

.bouton-oeil:hover,
.bouton-oeil[aria-pressed="true"] {
  color: var(--copper);
}

.bouton-oeil:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: -2px;
}

/* ============================================================
   BASCULE OUI / NON
   ============================================================ */

.bascule {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  margin-bottom: 14px;
  min-height: var(--tactile-min);
  padding: 6px 0;
}

.bascule input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bascule-piste {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: var(--slate-mid);
  border: 1px solid var(--line);
  transition: background 0.18s, border-color 0.18s;
  margin-top: 2px;
}

.bascule-pastille {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--faint);
  transition: transform 0.18s, background 0.18s;
}

/* ⚠ Les DEUX variantes, .bascule et .bascule-compacte.
   Ce sélecteur ne couvrait que .bascule : les bascules compactes du
   tableau des champs restaient visuellement éteintes quel que soit
   leur état réel. La valeur changeait bien en base, mais rien ne le
   montrait — donc le client croyait que le clic ne marchait pas. */
.bascule input:checked + .bascule-piste,
.bascule-compacte input:checked + .bascule-piste {
  background: rgba(192, 130, 96, 0.3);
  border-color: var(--copper);
}

.bascule input:checked + .bascule-piste .bascule-pastille,
.bascule-compacte input:checked + .bascule-piste .bascule-pastille {
  transform: translateX(19px);
  background: var(--copper);
}

.bascule input:focus-visible + .bascule-piste,
.bascule-compacte input:focus-visible + .bascule-piste {
  outline: 2px solid var(--copper-bright);
  outline-offset: 2px;
}

.bascule-texte {
  font-size: 14px;
  line-height: 1.4;
  padding-top: 4px;
}

.bascule-texte em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--faint);
  margin-top: 2px;
}

/* ============================================================
   HORAIRES — un bloc par jour, façon Google Business
   ============================================================ */

.jour {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  padding: 10px 15px 14px;
  margin-bottom: 10px;
}

.jour-ouvert {
  border-color: rgba(192, 130, 96, 0.35);
}

.jour-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.jour-entete .bascule {
  margin-bottom: 0;
}

.jour-entete .bascule-texte {
  font-weight: 600;
}

.jour-plages {
  margin-top: 10px;
  padding-left: 57px; /* aligné sous le libellé du jour */
}

@media (max-width: 720px) {
  .jour-plages {
    padding-left: 0;
  }

  /* Sur un écran de 375 px, tout doit tenir sur une ligne : deux heures
     lisibles, la flèche, la corbeille. On resserre les écarts et la
     corbeille plutôt que de renvoyer celle-ci sur une deuxième ligne,
     où elle doublerait la hauteur de la semaine entière. */
  .plage {
    gap: 5px;
  }

  .plage input[type="time"] {
    min-width: 96px;
  }

  .plage .bouton-corbeille {
    width: 34px;
  }
}

.plage {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* Le champ « heure » natif dessine ses propres chiffres ET une petite
   horloge à droite. Trop étroit, il tronque l'heure en « 07:0 » sans
   rien dire — d'où un padding resserré et une largeur plancher. */
.plage input[type="time"] {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 9px 6px;
  font-size: 15px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  min-height: var(--tactile-min);
  flex: 1 1 auto;
  min-width: 108px;
}

.plage input[type="time"]:focus {
  border-color: var(--copper);
  outline: none;
}

.plage-tiret {
  color: var(--faint);
  flex-shrink: 0;
}
