/*
 * Administration des sites du réseau, dans l'esprit de Linear : barre latérale
 * fixe, listes denses regroupées par statut, fiches à panneau de propriétés,
 * palette de commandes. Thème clair et sombre selon le système.
 * Aucun style en ligne : la politique de contenu de l'administration l'interdit.
 */

:root {
  --fond: #fcfcfd;
  --nav: #f6f6f8;
  --surface: #ffffff;
  --survol: #f0f0f3;
  --actif: #e9e9ee;
  --trait: #e6e6ea;
  --trait-fort: #d4d4da;
  --texte: #1c1d22;
  --doux: #6b6f78;
  --tres-doux: #9a9ea8;
  --accent: #5f8a1e;
  --accent-texte: #ffffff;
  --accent-doux: rgba(95, 138, 30, .12);
  --ok: #2f7a2a;
  --ok-fond: #e8f4e3;
  --erreur: #c2352b;
  --erreur-fond: #fbebe9;
  --alerte: #a16207;
  --alerte-fond: #fdf3dc;
  --violet: #6e56cf;
  --ombre: 0 8px 30px rgba(20, 20, 30, .14), 0 1px 3px rgba(20, 20, 30, .08);
  --rayon: 6px;
  --police: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --fond: #111114;
    --nav: #0c0c0e;
    --surface: #17171b;
    --survol: #1e1e23;
    --actif: #26262c;
    --trait: #26272d;
    --trait-fort: #34353c;
    --texte: #e6e7ea;
    --doux: #9a9da6;
    --tres-doux: #6c7079;
    --accent: #8cc63f;
    --accent-texte: #111114;
    --accent-doux: rgba(140, 198, 63, .14);
    --ok: #7fcf74;
    --ok-fond: rgba(127, 207, 116, .1);
    --erreur: #ff7b70;
    --erreur-fond: rgba(255, 123, 112, .1);
    --alerte: #e3b34c;
    --alerte-fond: rgba(227, 179, 76, .1);
    --violet: #9d8cf2;
    --ombre: 0 12px 40px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

/* Thème choisi dans la barre latérale : il l'emporte sur celui du système. */
:root[data-theme="sombre"] {
  --fond: #111114;
  --nav: #0c0c0e;
  --surface: #17171b;
  --survol: #1e1e23;
  --actif: #26262c;
  --trait: #26272d;
  --trait-fort: #34353c;
  --texte: #e6e7ea;
  --doux: #9a9da6;
  --tres-doux: #6c7079;
  --accent: #8cc63f;
  --accent-texte: #111114;
  --accent-doux: rgba(140, 198, 63, .14);
  --ok: #7fcf74;
  --ok-fond: rgba(127, 207, 116, .1);
  --erreur: #ff7b70;
  --erreur-fond: rgba(255, 123, 112, .1);
  --alerte: #e3b34c;
  --alerte-fond: rgba(227, 179, 76, .1);
  --violet: #9d8cf2;
  --ombre: 0 12px 40px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 14px/1.5 var(--police); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1 { margin: 0 0 16px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
h2 { margin: 28px 0 10px; font-size: 15px; font-weight: 600; }
h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
code, kbd { font-family: var(--mono); font-size: 13px; }
kbd {
  display: inline-block; min-width: 18px; padding: 0 4px; border: 1px solid var(--trait-fort); border-radius: 4px;
  background: var(--surface); color: var(--doux); font-size: 12px; line-height: 16px; text-align: center;
}
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Icônes (masques SVG, couleur du texte) ---------- */

.ic { display: inline-block; flex: none; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ic-loupe { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
.ic-accueil { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5V21h-6v-6H9v6H3z'/%3E%3C/svg%3E"); }
.ic-plus { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.ic-liste { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3.5 6h.01M3.5 12h.01M3.5 18h.01'/%3E%3C/svg%3E"); }
.ic-etiquette { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 12V3h9l9 9-9 9z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.2'/%3E%3C/svg%3E"); }
.ic-reglages { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0'/%3E%3Ccircle cx='16' cy='6' r='2'/%3E%3Ccircle cx='10' cy='12' r='2'/%3E%3Ccircle cx='18' cy='18' r='2'/%3E%3C/svg%3E"); }
.ic-personnes { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14.5a6.5 6.5 0 0 1 3.5 5.5'/%3E%3C/svg%3E"); }
.ic-horloge { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.ic-cle { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='m11 12 9-9M17 6l3 3M14 9l2 2'/%3E%3C/svg%3E"); }
.ic-sortie { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E"); }
.ic-theme-systeme { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E"); }
.ic-theme-clair { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E"); }
.ic-theme-sombre { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z'/%3E%3C/svg%3E"); }
.ic-personne { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3Cpath d='M7.5 18a4.5 4.5 0 0 1 9 0'/%3E%3C/svg%3E"); }
.ic-batiment { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 21V5l8-2v18M12 8h8v13M2 21h20M7.5 8h1M7.5 12h1M7.5 16h1M15.5 12h1M15.5 16h1'/%3E%3C/svg%3E"); }
.ic-bouclier { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3 4 6v6c0 4.5 3.4 8.2 8 9 4.6-.8 8-4.5 8-9V6z'/%3E%3C/svg%3E"); }
.ic-texte { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 10h16M4 14h10M4 18h12'/%3E%3C/svg%3E"); }
.ic-externe { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E"); }

/* ---------- Charpente : barre latérale et zone principale ---------- */

.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.nav {
  position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 10px 8px;
  border-right: 1px solid var(--trait); background: var(--nav); overflow-y: auto;
}
.nav-tete { padding: 4px 6px 10px; }
.espace { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; }
.espace-marque {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  background: var(--accent); color: var(--accent-texte); font-size: 13px; font-weight: 700;
}
.recherche {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 10px; padding: 5px 8px;
  border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface);
  color: var(--doux); cursor: pointer; font: inherit; text-align: left;
}
.recherche kbd { margin-left: auto; }
.recherche:hover { border-color: var(--trait-fort); }
.nav-liens { display: flex; flex-direction: column; gap: 1px; }
.nav-lien {
  display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: var(--rayon);
  color: var(--texte); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-lien .ic { color: var(--doux); }
.nav-lien:hover { background: var(--survol); }
.nav-lien[aria-current="page"] { background: var(--actif); font-weight: 500; }
.nav-section { margin: 16px 8px 4px; color: var(--tres-doux); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.nav-site summary {
  display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: var(--rayon);
  cursor: pointer; list-style: none; white-space: nowrap;
}
.nav-site summary::-webkit-details-marker { display: none; }
.nav-site summary:hover { background: var(--survol); }
.nav-site-nom { overflow: hidden; text-overflow: ellipsis; }
.nav-brouillon { margin-left: auto; color: var(--tres-doux); }
.nav-sous { padding-left: 30px; }
.nav-pied {
  display: flex; align-items: center; gap: 6px; margin-top: auto; padding: 10px 6px 2px;
  border-top: 1px solid var(--trait);
}
.nav-pied form { margin: 0; }
.nav-compte { flex: 1; overflow: hidden; color: var(--doux); text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--actif); color: var(--doux); font-size: 11px; font-weight: 600;
}
.nav-icone {
  display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--rayon);
  background: none; color: var(--doux); cursor: pointer;
}
.nav-icone:hover { background: var(--survol); color: var(--texte); }

.pastille-site { flex: none; width: 9px; height: 9px; border-radius: 3px; background: var(--tres-doux); }
.pastille-Vert { background: #a2ca3f; }
.pastille-Rouge { background: #e02b20; }

.principal { min-width: 0; }
.contenu { max-width: 1180px; margin: 0 auto; padding: 0 28px 60px; }
.seul { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.contenu-seul { width: 100%; max-width: 380px; }

/* ---------- En-tête de vue, fil d'Ariane, onglets ---------- */

.vue-tete {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; margin: 0 -28px 14px; padding: 8px 28px; border-bottom: 1px solid var(--trait);
  background: color-mix(in srgb, var(--fond) 88%, transparent); backdrop-filter: blur(8px);
}
.fil { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 10px; color: var(--doux); }
.vue-tete .fil { margin: 0; color: var(--texte); font-weight: 500; }
.fil a { color: var(--doux); text-decoration: none; }
.fil a:hover { color: var(--texte); }
.fil-sep { color: var(--tres-doux); }
.vue-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vue-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.onglets { display: flex; flex-wrap: wrap; gap: 4px; }
.onglet {
  padding: 3px 10px; border: 1px solid var(--trait); border-radius: 999px; background: var(--surface);
  color: var(--doux); cursor: pointer; font: inherit;
}
.onglet:hover { color: var(--texte); }
.onglet[aria-selected="true"] { border-color: var(--trait-fort); background: var(--actif); color: var(--texte); }
.compte { margin-left: 4px; color: var(--tres-doux); font-variant-numeric: tabular-nums; }
.filtre-texte {
  display: flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--trait);
  border-radius: var(--rayon); background: var(--surface); color: var(--doux);
}
.filtre-texte input { width: 200px; border: 0; background: none; color: var(--texte); font: inherit; outline: none; }

/* ---------- Listes (offres, sites) ---------- */

.liste { border: 1px solid var(--trait); border-radius: 8px; background: var(--surface); overflow: hidden; }
.liste .groupe + .groupe { border-top: 1px solid var(--trait); }
.groupe-tete {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 14px; border: 0;
  background: var(--nav); color: var(--texte); cursor: pointer; font: inherit; font-weight: 500; text-align: left;
}
.groupe-tete-fixe { cursor: default; }
.groupe-tete[aria-expanded="false"] + .lignes { display: none; }
.lignes { margin: 0; padding: 0; list-style: none; }
.ligne { display: flex; align-items: center; border-top: 1px solid var(--trait); }
.ligne:first-child { border-top: 0; }
.ligne:hover { background: var(--survol); }
.ligne-lien {
  display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; min-height: 38px; padding: 6px 14px;
  color: var(--texte); text-decoration: none;
}
.ligne-ref { flex: none; width: 104px; color: var(--tres-doux); font-family: var(--mono); font-size: 12.5px; }
.ligne-titre { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.ligne-meta { display: flex; flex: none; align-items: center; gap: 6px; margin-left: auto; color: var(--doux); }
.ligne-lieu { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-date { width: 84px; color: var(--tres-doux); text-align: right; font-variant-numeric: tabular-nums; }
.ligne-voir { display: grid; place-items: center; width: 34px; align-self: stretch; color: var(--tres-doux); }
.ligne-voir:hover { color: var(--texte); }
.vide { padding: 24px; color: var(--doux); text-align: center; }
.vide-grand { padding: 60px 20px; border: 1px dashed var(--trait-fort); border-radius: 8px; color: var(--doux); text-align: center; }

.puce {
  display: inline-flex; align-items: center; padding: 0 7px; border: 1px solid var(--trait); border-radius: 999px;
  color: var(--doux); font-size: 12.5px; line-height: 19px; white-space: nowrap;
}
.puce-contrat { border-color: transparent; background: var(--actif); }
.puce-urgent { border-color: transparent; background: var(--accent-doux); color: var(--accent); font-weight: 600; }
.puce-attente { border-style: dashed; }
.puce-alerte { border-color: transparent; background: var(--alerte-fond); color: var(--alerte); }

/* États d'une offre, dessinés en CSS (à la manière des statuts d'une issue). */
.etat { position: relative; flex: none; width: 13px; height: 13px; border-radius: 50%; border: 1.6px solid var(--tres-doux); }
.etat-brouillon { border-style: dashed; }
.etat-publiee { border-color: var(--accent); background: var(--accent); }
.etat-publiee::after, .etat-pourvue::after {
  content: ""; position: absolute; left: 3.3px; top: 1.2px; width: 3px; height: 6px;
  border: solid var(--surface); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.etat-pourvue { border-color: var(--violet); background: var(--violet); }
.etat-archivee { border-color: var(--tres-doux); background: var(--tres-doux); }
.etat-archivee::after { content: ""; position: absolute; left: 2px; top: 4.5px; width: 6px; height: 1.6px; background: var(--surface); }

/* ---------- Fiche d'une offre : corps et panneau de propriétés ---------- */

.fiche { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.titre-champ {
  width: 100%; margin: 4px 0 12px; padding: 4px 0; border: 0; background: none; color: var(--texte);
  font: 600 24px/1.25 var(--police); letter-spacing: -.015em; outline: none;
}
.titre-champ::placeholder { color: var(--tres-doux); }
.proprietes {
  position: sticky; top: 64px; padding: 10px 12px; border: 1px solid var(--trait); border-radius: 8px; background: var(--surface);
}
.prop { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 32px; }
.prop > label, .prop-nom { color: var(--doux); }
.prop input:not([type=checkbox]), .prop select {
  width: 100%; padding: 4px 6px; border: 1px solid transparent; border-radius: 5px; background: none;
  color: var(--texte); font: inherit;
}
.prop input:not([type=checkbox]):hover, .prop select:hover { background: var(--survol); }
.prop input:not([type=checkbox]):focus, .prop select:focus { border-color: var(--trait-fort); background: var(--surface); outline: none; }
.prop-note { margin: -2px 0 6px 104px; color: var(--tres-doux); font-size: 13px; }
.prop-sep { margin: 8px 0; border: 0; border-top: 1px solid var(--trait); }
.prop-case { cursor: pointer; }
.prop-case input { position: absolute; opacity: 0; }
.interrupteur { position: relative; width: 28px; height: 16px; border-radius: 999px; background: var(--trait-fort); transition: background .15s; }
.interrupteur::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s; }
.prop-case input:checked + .interrupteur { background: var(--accent); }
.prop-case input:checked + .interrupteur::after { transform: translateX(12px); }
.prop-case input:focus-visible + .interrupteur { outline: 2px solid var(--accent); outline-offset: 2px; }
.choix { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0; }
.choix-puce { cursor: pointer; }
.choix-puce input { position: absolute; opacity: 0; }
.choix-puce span {
  display: inline-block; padding: 1px 8px; border: 1px solid var(--trait); border-radius: 999px;
  color: var(--doux); font-size: 13px;
}
.choix-puce input:checked + span { border-color: transparent; background: var(--accent-doux); color: var(--accent); font-weight: 500; }
.choix-puce input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Éditeur de la description */
.editeur-barre { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--trait); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--nav); }
.editeur-barre button { padding: 2px 9px; border: 0; border-radius: 5px; background: none; color: var(--doux); cursor: pointer; font: inherit; }
.editeur-barre button:hover { background: var(--survol); color: var(--texte); }
.editeur {
  min-height: 380px; padding: 14px 16px; border: 1px solid var(--trait); border-radius: 0 0 8px 8px;
  background: var(--surface); font-size: 15px; line-height: 1.6; outline: none;
}
.editeur:focus { border-color: var(--trait-fort); }
.formulaire .editeur { margin-bottom: 20px; }
.editeur h3 { font-size: 16px; }

/* ---------- Formulaires des autres écrans (réglages, comptes…) ---------- */

.formulaire { max-width: 860px; }
.formulaire label { display: block; margin: 0 0 20px; color: var(--doux); font-weight: 500; }
.formulaire input:not([type=checkbox]):not([type=radio]):not([type=color]), .formulaire select, .formulaire textarea,
.prop-bloc input, .ligne-edition input {
  display: block; width: 100%; margin-top: 7px; padding: 9px 12px; border: 1px solid var(--trait-fort);
  border-radius: var(--rayon); background: var(--surface); color: var(--texte); font: 400 14px/1.4 var(--police);
}
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-doux); }
.formulaire input[readonly] { background: var(--nav); color: var(--doux); }
.formulaire input[readonly]:focus { border-color: var(--trait-fort); outline: none; }
.formulaire fieldset { margin: 0 0 28px; }
.formulaire fieldset:not(.carte) { padding: 0; border: 0; }
.formulaire legend { padding: 0 6px; margin-bottom: 6px; color: var(--texte); font-size: 15px; font-weight: 600; }
.formulaire .case { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; color: var(--texte); font-weight: 400; }
.formulaire .case input { margin-top: 3px; accent-color: var(--accent); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.carte { margin: 0 0 24px; padding: 24px 28px 8px; border: 1px solid var(--trait); border-radius: 10px; background: var(--surface); }
/* Nouvelle agence : les unités n'apparaissent qu'avec le modèle B. */
.si-modele-b { display: none; }
form:has(input[name="structure"][value="B"]:checked) .si-modele-b { display: block; }
.carte-etroite { max-width: 380px; margin: 0 auto; }
.carte-legere { margin: 0 0 12px; padding: 8px 12px 2px; border: 1px solid var(--trait); border-radius: var(--rayon); }
.formulaire .groupe { margin: 8px 0 22px; padding: 14px 18px 4px; border-left: 3px solid var(--trait); }
.sous-titre { margin: 0 0 8px; color: var(--texte); font-weight: 600; }
.aide { display: block; margin-top: 5px; color: var(--tres-doux); font-size: 13px; font-weight: 400; }
label .aide { display: inline; }
label > .aide:last-child { display: block; }
.message { margin: 14px 0; padding: 8px 12px; border-radius: var(--rayon); }
.message p { margin: 0 0 4px; }
.message-ok { background: var(--ok-fond); color: var(--ok); }
.message-erreur { background: var(--erreur-fond); color: var(--erreur); }
.secret { display: inline-block; padding: 2px 6px; border-radius: 4px; background: var(--actif); letter-spacing: .5px; user-select: all; }
.secret-long { display: block; margin-top: 4px; overflow-wrap: anywhere; letter-spacing: 0; }
.etapes li { margin-bottom: 6px; }
.etiquette { display: inline-block; padding: 0 7px; border-radius: 999px; background: var(--actif); color: var(--doux); font-size: 12.5px; }
.etiquette-alerte { background: var(--alerte-fond); color: var(--alerte); }
.etiquette-brouillon { border: 1px dashed var(--trait-fort); background: none; }

/* Boutons */
.bouton, button.bouton {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 1px solid transparent;
  border-radius: var(--rayon); background: var(--accent); color: var(--accent-texte); cursor: pointer;
  font: 500 14px var(--police); text-decoration: none; white-space: nowrap;
}
.bouton:hover { filter: brightness(1.06); }
.bouton kbd { border-color: rgba(255, 255, 255, .35); background: transparent; color: inherit; opacity: .8; }
.bouton-discret, .bouton-second, button.bouton-discret, button.bouton-second {
  border-color: var(--trait); background: var(--surface); color: var(--texte);
}
.bouton-discret:hover, .bouton-second:hover { background: var(--survol); filter: none; }
.bouton-large { width: 100%; justify-content: center; height: 34px; }
button.lien { padding: 0; border: 0; background: none; color: var(--doux); cursor: pointer; font: inherit; text-decoration: underline; }
button.lien:hover { color: var(--texte); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.titre-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.titre-actions h1 { margin-bottom: 8px; }

/* Tableaux (comptes, journal, référentiels) */
.tableau { width: 100%; margin-bottom: 20px; border: 1px solid var(--trait); border-collapse: separate; border-spacing: 0; border-radius: 8px; background: var(--surface); overflow: hidden; }
.tableau th, .tableau td { padding: 8px 12px; border-top: 1px solid var(--trait); text-align: left; vertical-align: middle; }
.tableau thead th { border-top: 0; background: var(--nav); color: var(--doux); font-size: 13px; font-weight: 500; }
.tableau tbody tr:hover { background: var(--survol); }
.tableau a { text-decoration: none; font-weight: 500; }
.tableau a:hover { text-decoration: underline; }
.actions-ligne { display: flex; gap: 12px; white-space: nowrap; }
.actions-ligne form { margin: 0; }
.tableau-saisie td { padding: 6px 8px; }
.ligne-edition { display: flex; gap: 8px; align-items: center; margin: 0; }
.ligne-edition input[type=text] { width: 14em; margin: 0; }
.ligne-edition input[type=number] { width: 4.5em; margin: 0; }

/* Création d'agence : palette de couleurs */
.palette { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.pastille { align-items: center; }
.echantillon { display: inline-block; width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, .12); }
.echantillon-Vert { background: #a2ca3f; }
.echantillon-Rouge { background: #e02b20; }
.pastille input[type=color] { width: 40px; height: 26px; padding: 0; border: 1px solid var(--trait-fort); border-radius: 5px; background: none; }

/* ---------- Palette de commandes (⌘K) ---------- */

.palette-commandes {
  width: min(620px, calc(100vw - 32px)); margin-top: 12vh; padding: 0; border: 1px solid var(--trait-fort); border-radius: 12px;
  background: var(--surface); color: var(--texte); box-shadow: var(--ombre);
}
.palette-commandes::backdrop { background: rgba(0, 0, 0, .25); }
.palette-saisie {
  width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--trait); background: none;
  color: var(--texte); font: 16px var(--police); outline: none;
}
.palette-liste { max-height: 50vh; margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.palette-liste li { padding: 7px 10px; border-radius: var(--rayon); cursor: pointer; }
.palette-liste li[aria-selected="true"] { background: var(--actif); }
.palette-liste .palette-site { color: var(--tres-doux); }
.palette-aide { margin: 0; padding: 8px 14px; border-top: 1px solid var(--trait); color: var(--tres-doux); font-size: 13px; }
.palette-aide kbd { margin: 0 1px; }

/* ---------- Petits écrans ---------- */

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--trait); }
  .fiche, .duo { grid-template-columns: 1fr; }
  .proprietes { position: static; }
  .ligne-meta .puce, .ligne-lieu, .ligne-ref { display: none; }
  .contenu { padding: 0 16px 40px; }
  .vue-tete { margin: 0 -16px 14px; padding: 8px 16px; }
}

/* ---------- Candidatures et demandes d'entreprise (lot 4) ---------- */
.nav-nombre {
  margin-left: auto; padding: 0 6px; border-radius: 999px; background: var(--accent-doux); color: var(--accent);
  font-size: 12px; font-weight: 600; line-height: 18px; font-variant-numeric: tabular-nums;
}
.point-lecture { flex: none; width: 7px; height: 7px; margin: 0 10px 0 2px; border-radius: 50%; }
.ligne-nonlue .point-lecture { background: var(--accent); }
.ligne-nonlue .ligne-titre { font-weight: 650; }
.ligne-objet { overflow: hidden; margin-left: 10px; color: var(--doux); text-overflow: ellipsis; white-space: nowrap; }
.puce-erreur { border-color: transparent; background: var(--erreur-fond); color: var(--erreur); }
button.bouton-danger, .bouton-danger { color: var(--erreur); }
button.bouton-danger:hover, .bouton-danger:hover { background: var(--erreur-fond); }
.titre-fiche { margin: 4px 0 2px; font-size: 24px; font-weight: 600; letter-spacing: -.015em; }
.titre-bloc { margin: 28px 0 8px; color: var(--doux); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.champs-recus { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px 16px; margin: 20px 0 0; }
.champs-recus dt { color: var(--doux); }
.champs-recus dd { margin: 0; overflow-wrap: anywhere; }
.texte-saisi { white-space: pre-line; }
.pieces { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.piece {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--trait); border-radius: var(--rayon);
  background: var(--surface); color: var(--texte); text-decoration: none;
}
.piece:hover { border-color: var(--trait-fort); background: var(--survol); }
.piece-type { color: var(--doux); }
.piece-nom { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.piece-taille { margin-left: auto; color: var(--tres-doux); font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 13px; }
@media (max-width: 900px) {
  .champs-recus { grid-template-columns: 1fr; gap: 2px; }
  .champs-recus dd { margin-bottom: 10px; }
  .ligne-objet { display: none; }
}

/* ---------- Données personnelles (lot 6) ---------- */
.recherche-rgpd { display: flex; gap: 8px; max-width: 640px; margin: 0 0 16px; }
.recherche-rgpd input { flex: 1; padding: 6px 9px; border: 1px solid var(--trait-fort); border-radius: var(--rayon); background: var(--surface); color: var(--texte); font: inherit; }
.tableau td.case-ligne, .tableau th.case-ligne { width: 32px; }
.tableau input[type=checkbox] { accent-color: var(--accent); }
.actions-rgpd { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 24px; }

/* Comptes : site confié, et agence quand le site en a plusieurs */
.site-confie { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.formulaire .agence-confiee { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-weight: 400; }
.formulaire .agence-confiee select { width: auto; margin-top: 0; }

/* ---------- Contenus : textes des pages ---------- */
a.onglet { text-decoration: none; color: inherit; }
a.onglet[aria-current="page"] { background: var(--actif); font-weight: 500; }
.contenus-portee { max-width: 860px; margin: 0 0 12px; }
.marqueurs { max-width: 860px; }
.marqueurs summary { cursor: pointer; color: var(--doux); }
.marqueurs dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0 8px; }
.marqueurs dd { margin: 0; color: var(--doux); }
.bloc-contenu { max-width: 860px; margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--trait); border-radius: 8px; background: var(--surface); scroll-margin-top: 70px; }
.bloc-contenu:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }
.bloc-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.formulaire .bloc-libelle { margin: 0; color: var(--texte); font-weight: 600; }
.bloc-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 10px; }
.formulaire .champ-court { width: 160px; }
.versions { flex-basis: 100%; }
.versions summary { cursor: pointer; color: var(--doux); font-size: 13px; }
.versions ul { margin: 8px 0 0; padding: 0; list-style: none; }
.versions li { display: grid; grid-template-columns: 200px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--trait); font-size: 13.5px; }
.versions-date { color: var(--doux); }
.versions-texte { overflow: hidden; color: var(--texte); text-overflow: ellipsis; white-space: nowrap; }
.editeur a { color: var(--accent); text-decoration: underline; }
.media-apercu { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; }
.media-apercu img, .media-apercu video { max-width: 360px; max-height: 200px; border: 1px solid var(--trait); border-radius: var(--rayon); object-fit: cover; background: var(--nav); }
.onglets-unites { margin-top: 8px; }
.pastille-unite { width: 8px; height: 8px; margin-right: 6px; vertical-align: middle; }
