/* CR NeuroVeto — charte de tuto.neuroveto.fr (Manrope, encre, accent bleu) */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(polices/manrope-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(polices/manrope-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --paper: #ffffff; --surface: #f6f7f8; --ink: #1a1d23; --muted-ink: #6b7280; --line: #e8eaed; --champ: #c9cdd3; --survol: #d4d7dc;
  --accent: #1d4ed8; --accent-fort: #1e40af; --accent-soft: #eaf0fd; --accent-ink: #1e3a8a; --primaire-survol: #2a2e36;
  --danger: #b42318; --danger-soft: #fbe9e8; --success: #166534; --success-soft: #e7f3ea; --alerte: #8a5a1f; --alerte-soft: #fdf3ea;
  --sur-plein: #ffffff; --feuille: #ffffff;
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #15171c; --surface: #1e2128; --ink: #e7e9ee; --muted-ink: #9ca3af; --line: #2c3039; --champ: #4b5160; --survol: #3a3f4a;
    --accent: #8db0ff; --accent-fort: #b3caff; --accent-soft: #1c2742; --accent-ink: #c7d7ff; --primaire-survol: #c9ccd3;
    --danger: #f28b82; --danger-soft: #3a1d1c; --success: #6fd394; --success-soft: #16301f; --alerte: #f2c48a; --alerte-soft: #33271a;
    --sur-plein: #15171c; --feuille: #1b1e24;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Manrope', system-ui, sans-serif; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.6; overflow-x: clip; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.6px; line-height: 1.25; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
h3 { font-size: 15px; font-weight: 700; }
h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted-ink); }
.petit { font-size: 12.5px; }
.discret { color: var(--muted-ink); }
.fort { font-weight: 700; }
.lien { color: var(--accent); }
.lien:hover { text-decoration: underline; }
.cache { display: none; }
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--accent); margin-bottom: 4px; }

/* en-tête */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { max-width: 1480px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 700; letter-spacing: -.3px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #1a1d23; color: #fff; flex-shrink: 0; }
.brand small { display: block; font-size: 10px; font-weight: 500; letter-spacing: .3px; color: var(--muted-ink); }
.main-nav { display: flex; gap: 4px; font-size: 14px; font-weight: 500; margin-right: auto; }
.main-nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted-ink); }
.main-nav a:hover { background: var(--surface); color: var(--ink); }
.main-nav a.active { color: var(--ink); background: var(--surface); }
.sortir { display: flex; align-items: center; gap: 10px; }
.moi { font-size: 13px; font-weight: 600; }
.moi:hover { color: var(--accent); }
.contenu { max-width: 1480px; margin: 0 auto; padding: 28px 24px 80px; }

/* boutons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 17px; border-radius: 8px; font-size: 14px; font-weight: 600; border: 1px solid transparent; transition: background .15s, border-color .15s; white-space: nowrap; }
.button:active { transform: scale(.98); }
.button-primary { background: var(--ink); color: var(--paper); }
.button-primary:hover { background: var(--primaire-survol); }
.button-secondary { border-color: var(--line); background: var(--paper); }
.button-secondary:hover { background: var(--surface); border-color: var(--survol); }
.button-ghost { color: var(--muted-ink); }
.button-ghost:hover { background: var(--surface); color: var(--ink); }
.button-danger-ghost { color: var(--danger); }
.button-danger-ghost:hover { background: var(--danger-soft); }
.button-sm { min-height: 34px; padding: 5px 11px; font-size: 13px; }
.boutons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ligne { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ligne > input { flex: 1; min-width: 160px; }

/* formulaires */
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { width: 100%; background: var(--paper); border: 1px solid var(--champ); padding: 8px 11px; min-height: 40px; border-radius: 8px; font-size: 14.5px; font-weight: 500; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.pile { display: flex; flex-direction: column; gap: 14px; }
.etroite { max-width: 520px; }
.form-msg { font-size: 13.5px; font-weight: 600; min-height: 0; }
.form-msg:empty { display: none; }
.form-msg.erreur { color: var(--danger); background: var(--danger-soft); padding: 9px 12px; border-radius: 8px; }
.form-msg.ok { color: var(--success); background: var(--success-soft); padding: 9px 12px; border-radius: 8px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); margin-left: 6px; vertical-align: middle; white-space: nowrap; }
.badge.discret { background: var(--surface); color: var(--muted-ink); }
.badge.alerte { background: var(--alerte-soft); color: var(--alerte); }

/* cartes, accueil, connexion */
.carte { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.connexion { max-width: 420px; margin: 40px auto; display: flex; flex-direction: column; gap: 14px; }
.hero { padding: 18px 0 26px; max-width: 720px; display: flex; flex-direction: column; gap: 8px; }
.hero h1 { font-size: 34px; letter-spacing: -1px; }
.grille-outils { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.outil { display: flex; gap: 14px; align-items: center; transition: border-color .15s, box-shadow .15s; }
.outil:hover { border-color: var(--survol); box-shadow: 0 2px 12px rgba(26, 29, 35, .07); }
.outil > span:last-child { display: flex; flex-direction: column; }
.outil-icone { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 22px; font-weight: 700; flex-shrink: 0; }
.titre-page { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.barre-recherche { margin-bottom: 14px; max-width: 560px; }
.vide { color: var(--muted-ink); text-align: center; padding: 40px; }
.espace { margin: 28px 0 12px; }

/* tableaux */
.table-defile { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted-ink); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover { background: var(--surface); }
.table td.actions { text-align: right; }
.table select { min-height: 34px; padding: 4px 8px; font-size: 13px; width: auto; }

/* saisie : formulaire à gauche, aperçu à droite */
.editeur { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.formulaire { display: flex; flex-direction: column; gap: 12px; }
.section-form { padding: 0; }
.section-form > summary { list-style: none; cursor: pointer; padding: 16px 20px; display: flex; align-items: center; gap: 8px; }
.section-form > summary::-webkit-details-marker { display: none; }
.section-form > summary::before { content: '›'; font-size: 20px; line-height: 1; color: var(--muted-ink); transition: transform .15s; width: 12px; }
.section-form[open] > summary::before { transform: rotate(90deg); }
.section-form[open] { padding-bottom: 14px; }
.section-form > :not(summary) { margin: 0 20px; }
.champ { display: flex; flex-direction: column; gap: 7px; padding: 10px 0; border-top: 1px solid var(--line); font-weight: 500; }
.champ-nom { font-size: 13px; font-weight: 700; }
.intertitre { margin-top: 14px !important; padding-top: 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--accent); }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { min-height: 34px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--champ); background: var(--paper); font-size: 13.5px; font-weight: 600; transition: background .12s, border-color .12s, color .12s; }
.puce:hover { border-color: var(--accent); }
.puce.actif { background: var(--accent); border-color: var(--accent); color: var(--sur-plein); }
.puce.petite { min-height: 30px; padding: 3px 10px; font-size: 12.5px; }
.sous { margin-left: 14px; padding-left: 14px; border-left: 2px solid var(--accent-soft); display: flex; flex-direction: column; }
.sous > .champ { border-top: 0; padding: 6px 0; }
.sous-nom { color: var(--accent); font-weight: 700; padding-top: 4px; }
.grille-signal { border-collapse: collapse; }
.grille-signal th { text-align: left; font-size: 13px; padding: 4px 12px 4px 0; white-space: nowrap; }
.grille-signal td { padding: 3px 4px 3px 0; }
.lesion { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 10px; background: var(--surface); }
.lesion .puce:not(.actif) { background: var(--paper); }
.lesion-tete { display: flex; justify-content: space-between; align-items: center; padding: 8px 0 4px; gap: 8px; flex-wrap: wrap; }
.lesions > .button { align-self: flex-start; }
.note-auto { padding: 10px 0; border-top: 1px solid var(--line); }

.apercu { position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow-y: auto; background: var(--feuille); border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; box-shadow: 0 2px 16px rgba(26, 29, 35, .05); }
.apercu-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.apercu-titre { font-size: 19px; margin-bottom: 8px; }
.cr-section { padding: 10px 0 12px; border-bottom: 1px dashed var(--line); }
.cr-section:last-of-type { border-bottom: 0; }
.cr-section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .7px; color: var(--accent); margin-bottom: 6px; }
.cr-section.modifiee { border-left: 3px solid var(--alerte); padding-left: 10px; }
.cr-st { font-size: 14px; margin: 10px 0 2px; }
.cr-p { margin: 4px 0; }
.cr-liste { margin: 4px 0 6px; padding-left: 20px; }
.cr-liste li { margin: 2px 0; }
.cr-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 16px; margin: 0; }
.cr-kv div { display: flex; flex-direction: column; }
.cr-kv dt { font-size: 11.5px; color: var(--muted-ink); font-weight: 600; }
.cr-kv dd { margin: 0; font-weight: 600; }
.outils-section { margin-top: 6px; opacity: .85; }
.edition { font-size: 14px; min-height: 220px; }
.journal { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.journal summary { cursor: pointer; color: var(--muted-ink); font-weight: 600; }
.journal ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted-ink); }
.etat { margin-right: 6px; }

/* administration */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.onglet { padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--muted-ink); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.onglet.actif { color: var(--ink); border-bottom-color: var(--accent); }
.grille-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 12px 0; }
.grille-form .pleine { grid-column: 1 / -1; }
.barre-modele { position: sticky; top: 64px; z-index: 10; display: flex; flex-direction: column; gap: 10px; margin: 12px 0 16px; padding: 14px 16px; box-shadow: 0 2px 12px rgba(26, 29, 35, .06); }
.arbre { display: flex; flex-direction: column; gap: 8px; }
.noeud { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.noeud > summary { cursor: pointer; padding: 8px 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; list-style: none; }
.noeud > summary::-webkit-details-marker { display: none; }
.noeud > summary::before { content: '›'; color: var(--muted-ink); transition: transform .15s; width: 10px; }
.noeud[open] > summary::before { transform: rotate(90deg); }
.noeud[open] > summary { border-bottom: 1px solid var(--line); background: var(--surface); border-radius: 10px 10px 0 0; }
.noeud-titre { font-weight: 600; font-size: 14px; }
.noeud-corps { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.outils-noeud { margin-left: auto; display: flex; gap: 2px; }
.mini { width: 28px; height: 28px; border-radius: 6px; color: var(--muted-ink); font-size: 14px; }
.mini:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.mini.danger:hover { background: var(--danger-soft); color: var(--danger); }
.props { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.prop small { font-weight: 500; font-size: 11.5px; line-height: 1.4; }
.cases { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.case { flex-direction: row; align-items: center; gap: 7px; font-weight: 500; }
.sous-liste { display: flex; flex-direction: column; gap: 6px; padding-left: 12px; border-left: 2px solid var(--accent-soft); }
.sous-liste > .button { align-self: flex-start; }

/* impression */
.barre-impression { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; max-width: 820px; margin: 0 auto 16px; }
.feuille { max-width: 820px; margin: 0 auto; background: var(--feuille); border: 1px solid var(--line); border-radius: 6px; padding: 40px 48px; font-size: 14px; line-height: 1.55; }
.feuille-tete { display: flex; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 10px; font-size: 12.5px; }
.feuille-tete strong { font-size: 14px; }
.feuille-titre { font-size: 20px; text-align: center; margin: 18px 0 10px; letter-spacing: -.3px; }
.feuille .cr-section { border-bottom: 0; padding: 6px 0; break-inside: auto; }
.feuille .cr-section h2 { border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.feuille-pied { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; }
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  :root { --paper: #fff; --feuille: #fff; --ink: #000; --accent: #1e3a8a; --line: #ccc; --muted-ink: #444; }
  body { background: #fff; font-size: 11pt; }
  .site-header, .pas-imprime { display: none !important; }
  .contenu { padding: 0; max-width: none; }
  .feuille { border: 0; padding: 0; max-width: none; font-size: 10.5pt; }
  .cr-section h2 { break-after: avoid; }
  .cr-p, .cr-liste li { orphans: 3; widows: 3; }
}

/* téléphone et tablette */
@media (max-width: 980px) {
  .editeur { grid-template-columns: 1fr; }
  .apercu { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .header-inner { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .brand small { display: none; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .contenu { padding: 18px 16px 60px; }
  .section-form > summary { padding: 14px 16px; }
  .section-form > :not(summary) { margin: 0 16px; }
  .apercu { padding: 16px; }
  .feuille { padding: 22px 16px; }
  h1 { font-size: 22px; }
  .hero h1 { font-size: 27px; }
}
.mini.texte { width: auto; padding: 0 7px; font-size: 12px; font-weight: 600; }
.ligne > input.mesure { flex: 0 0 110px; min-width: 0; }
.unite { font-weight: 600; color: var(--muted-ink); }
