/* Silo de Bernardo : même grille et mêmes règles que le SILO de Nancy (silo-serveur/app/app.css), identité violette de Bernardo. */
:root {
  --fond: #f6f6f3; --surface: #ffffff; --surface-2: #efefea; --bord: #deddd6; --texte: #1d2321; --texte-2: #5d6662;
  --accent: #5b3fa8; --accent-fort: #46308a; --accent-doux: #ece6f8; --alerte: #b4501d; --alerte-doux: #fbeadf;
  --danger: #b3261e; --ok: #2e7d4f; --ok-doux: #e2f2e8; --rayon: 10px; --ombre: 0 1px 2px rgba(0,0,0,.06), 0 6px 24px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #131217; --surface: #1b1a20; --surface-2: #24232b; --bord: #312f39; --texte: #e9e8ee; --texte-2: #a19fab;
    --accent: #a58cf0; --accent-fort: #c3b2f7; --accent-doux: #2c2540; --alerte: #e8985f; --alerte-doux: #3a2a1e;
    --danger: #f0867f; --ok: #6fcf97; --ok-doux: #1d3328; --ombre: 0 1px 2px rgba(0,0,0,.4), 0 6px 24px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--fond); color: var(--texte); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.bandeau-maquette { background: #fff4cc; color: #6b5300; font-size: 12.5px; text-align: center; padding: 4px 10px; }
@media (prefers-color-scheme: dark) { .bandeau-maquette { background: #3a3218; color: #f0d98a; } }

.barre { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 5; }
.marque { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .14em; color: var(--accent); text-decoration: none; }
.marque i { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 13px/26px -apple-system, sans-serif; letter-spacing: 0; text-align: center; font-style: normal; }
.recherche { flex: 1; max-width: 620px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid transparent; border-radius: 999px; padding: 0 6px 0 14px; color: var(--texte-2); }
.recherche:focus-within { border-color: var(--accent); background: var(--surface); }
.recherche input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 0; outline: none; color: var(--texte); }
.demander { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--accent-doux); color: var(--accent-fort); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.bouton-depot { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.bouton-depot svg { stroke: #fff; }
.zone-depot { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 22px 16px; margin: 0 0 14px; border: 2px dashed var(--bord); border-radius: var(--rayon); background: var(--surface); color: var(--texte-2); cursor: pointer; }
.zone-depot:hover, .zone-depot:focus-visible { border-color: var(--accent); background: var(--accent-doux); color: var(--accent-fort); outline: none; }
.zone-depot svg { width: 26px; height: 26px; color: var(--accent); }
.zone-depot strong { color: var(--texte); font-weight: 600; }
.zone-depot span { font-size: 13px; }
.resultats-depot { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px 14px; margin: 0 0 14px; font-size: 13.5px; }
.resultats-depot ul { list-style: none; margin: 6px 0 0; padding: 0; }
.resultats-depot li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-top: 1px solid var(--bord); }
.resultats-depot .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etat-depot { white-space: nowrap; color: var(--texte-2); }
.etat-depot.ok { color: var(--ok); font-weight: 600; }
.etat-depot.ko { color: var(--danger); white-space: normal; text-align: right; }
.voile-depot { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(91, 63, 168, .18); backdrop-filter: blur(2px); pointer-events: none; }
.voile-depot > div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 40px; border: 2px dashed var(--accent); border-radius: 16px; background: var(--surface); color: var(--texte-2); box-shadow: var(--ombre); }
.voile-depot svg { width: 34px; height: 34px; color: var(--accent); }
.voile-depot strong { color: var(--texte); font-size: 16px; }
.utilisateur { color: var(--texte-2); font-size: 13px; white-space: nowrap; margin-left: auto; }
.lien-chat { color: var(--texte-2); font-size: 13px; text-decoration: underline; white-space: nowrap; }

.corps { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 82px); }
.corps.avec-apercu { grid-template-columns: 240px minmax(0, 1fr) minmax(360px, 40%); }
.lateral { padding: 16px 10px 28px; border-right: 1px solid var(--bord); background: var(--surface); overflow-y: auto; max-height: calc(100vh - 82px); position: sticky; top: 57px; }
.lateral h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--texte-2); margin: 18px 10px 6px; font-weight: 600; }
.lateral h2:first-child { margin-top: 2px; }
.item-lateral { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 8px; color: var(--texte); font-size: 14.5px; }
.item-lateral:hover { background: var(--surface-2); }
.item-lateral[aria-current="true"] { background: var(--accent-doux); color: var(--accent-fort); font-weight: 600; }
.item-lateral .nombre { margin-left: auto; font-size: 12px; color: var(--texte-2); }
.item-lateral.attention .nombre { background: var(--alerte); color: #fff; border-radius: 999px; padding: 0 7px; font-weight: 600; }
.point { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; margin: 0 5px; }
.point.orange { background: var(--alerte); } .point.rouge { background: var(--danger); }
.principal { padding: 18px 22px 40px; min-width: 0; }
.apercu { border-left: 1px solid var(--bord); background: var(--surface); padding: 16px 20px 28px; overflow-y: auto; max-height: calc(100vh - 82px); position: sticky; top: 57px; }

.titre-liste { margin: 0 0 12px; font-size: 19px; }
h2.titre-liste { font-size: 15px; margin-top: 26px; }
.sous { color: var(--texte-2); font-size: 13px; margin: -6px 0 14px; }

/* Accueil */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 8px; }
.tuile { text-align: left; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 14px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 4px; }
.tuile:hover { border-color: var(--accent); }
.tuile .tete { display: flex; align-items: center; gap: 8px; color: var(--texte-2); font-size: 13px; }
.tuile .tete .point { margin-left: auto; }
.tuile strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.tuile .detail { font-size: 12.5px; color: var(--texte-2); }
.tuile.attention { border-color: var(--alerte); }
.tuile.attention strong { color: var(--alerte); }

/* Listes */
.liste { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); }
.entete-liste, .ligne { display: grid; grid-template-columns: 92px minmax(0, 3fr) minmax(0, 1.3fr) 104px minmax(0, 1.2fr); gap: 12px; align-items: center; padding: 9px 14px; }
.entete-liste { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--texte-2); border-bottom: 1px solid var(--bord); background: var(--surface-2); }
.ligne { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--bord); }
.ligne:last-child { border-bottom: 0; }
.ligne:hover { background: var(--surface-2); }
.ligne[aria-selected="true"] { background: var(--accent-doux); }
.nature { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--texte-2); }
.nature svg { width: 16px; height: 16px; }
.cellule-nom { min-width: 0; }
.cellule-nom .titre { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.extrait { display: block; color: var(--texte-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
mark { background: var(--accent-doux); color: var(--accent-fort); border-radius: 3px; padding: 0 2px; }
.ligne-cadre { position: relative; border-bottom: 1px solid var(--bord); }
.ligne-cadre:last-child { border-bottom: 0; }
.ligne-cadre .ligne { border-bottom: 0; padding-right: 50px; }
.copier-ligne { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--bord); border-radius: 8px; background: var(--surface); color: var(--texte-2); font-size: 14px; cursor: pointer; }
.copier-ligne:hover { background: var(--accent-doux); border-color: transparent; }
.copier-ligne.copie, .bouton.copie { color: var(--accent-fort); background: var(--accent-doux); border-color: transparent; font-weight: 600; }
.ligne .col { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texte-2); font-size: 13.5px; }
.pastilles { display: flex; flex-wrap: wrap; gap: 4px; }
.pastille { --h: 260; display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 1.5; color: hsl(var(--h) 45% 32%); background: hsl(var(--h) 70% 93%); border: 1px solid hsl(var(--h) 40% 82%); white-space: nowrap; }
@media (prefers-color-scheme: dark) { .pastille { color: hsl(var(--h) 70% 82%); background: hsl(var(--h) 30% 22%); border-color: hsl(var(--h) 25% 34%); } }

.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; align-items: center; }
.puce { border: 1px solid var(--bord); background: var(--surface); border-radius: 999px; padding: 3px 11px; font-size: 13px; color: var(--texte-2); }
.puce[aria-pressed="true"] { background: var(--accent-doux); color: var(--accent-fort); border-color: transparent; font-weight: 600; }
.puce b { font-weight: 600; margin-left: 4px; }
.proposer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--accent-doux); color: var(--accent-fort); border-radius: var(--rayon); padding: 9px 14px; font-size: 13.5px; margin-bottom: 12px; }
.bouton { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 8px; border: 1px solid var(--bord); background: var(--surface); color: var(--texte); font-size: 13.5px; text-decoration: none; }
.bouton:hover { background: var(--surface-2); }
.bouton.plein { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

/* Fil */
.fil-jour { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--texte-2); margin: 16px 2px 6px; font-weight: 600; }
.evenement { display: grid; grid-template-columns: 52px 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--bord); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; }
.evenement:last-child { border-bottom: 0; }
.evenement:hover { background: var(--surface-2); }
.evenement .heure { font-variant-numeric: tabular-nums; color: var(--texte-2); font-size: 13px; }
.evenement .ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); color: var(--texte-2); }
.evenement .ic svg { width: 15px; height: 15px; }
.evenement .qui { color: var(--texte-2); font-size: 12.5px; }

/* Automatismes */
.pipeline { display: grid; grid-template-columns: 14px minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1.6fr); gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--bord); }
.pipeline:last-child { border-bottom: 0; }
.pipeline .nom strong { display: block; font-weight: 600; font-size: 14px; }
.pipeline .nom span, .pipeline .col { color: var(--texte-2); font-size: 13px; }
.pipeline code { font: 12px ui-monospace, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.pipeline .etat-txt.ok { color: var(--ok); } .pipeline .etat-txt.orange { color: var(--alerte); }
.entete-pipeline { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--texte-2); background: var(--surface-2); }

/* Aperçu */
.apercu-tete { display: flex; align-items: flex-start; gap: 10px; }
.apercu-tete h2 { margin: 0; font-size: 17px; line-height: 1.3; flex: 1; }
.fermer { background: none; border: 0; padding: 4px 8px; border-radius: 8px; color: var(--texte-2); font-size: 20px; line-height: 1; }
.fiche { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 14px 0; font-size: 13.5px; }
.fiche dt { color: var(--texte-2); } .fiche dd { margin: 0; }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bord); margin: 14px 0 12px; }
.onglets button { background: none; border: 0; padding: 7px 12px; border-bottom: 2px solid transparent; color: var(--texte-2); }
.onglets button[aria-selected="true"] { color: var(--accent-fort); border-bottom-color: var(--accent); font-weight: 600; }
.corps-apercu { font-size: 14px; line-height: 1.55; }
.corps-apercu h4 { margin: 14px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-2); }
.corps-apercu ul { margin: 4px 0; padding-left: 18px; }
.lecteur { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin-top: 10px; font-size: 13px; color: var(--texte-2); }
.lecteur .piste { flex: 1; height: 4px; border-radius: 2px; background: var(--bord); position: relative; }
.lecteur .piste i { position: absolute; inset: 0 70% 0 0; background: var(--accent); border-radius: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.motif { background: var(--alerte-doux); color: var(--alerte); border-radius: 8px; padding: 8px 12px; margin: 12px 0; font-size: 13.5px; }

@media (max-width: 1100px) { .corps.avec-apercu { grid-template-columns: 240px minmax(0, 1fr); } .apercu { position: fixed; inset: 57px 0 0 0; max-height: none; z-index: 4; border-left: 0; } }
@media (max-width: 760px) {
  .corps, .corps.avec-apercu { grid-template-columns: minmax(0, 1fr); }
  .lateral { display: none; }
  .utilisateur, .lien-chat, .demander span, .bouton-depot span { display: none; }
  .barre { gap: 8px; padding: 8px 10px; }
  .principal { padding: 14px 12px 40px; }
  .entete-liste, .entete-pipeline { display: none; }
  .ligne { grid-template-columns: minmax(0, 1fr) auto; }
  .ligne .col.qui, .ligne .pastilles { display: none; }
  .pipeline { grid-template-columns: 14px minmax(0, 1fr); }
  .pipeline .col { grid-column: 2; }
}

/* ── Compléments de la page réelle ── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.bouton-icone { display: none; background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--texte); }
.retour { display: inline-flex; align-items: center; gap: 6px; color: var(--texte-2); font-size: 13px; text-decoration: none; border: 1px solid var(--bord); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }
.retour:hover { background: var(--surface-2); color: var(--texte); }
.corps { min-height: calc(100vh - 57px); }
.lateral, .apercu { max-height: calc(100vh - 57px); }
.lateral .reserve { font-size: 11px; color: var(--texte-2); padding: 0 10px; margin: -2px 0 6px; }
.groupe { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--texte-2); margin: 20px 2px 6px; font-weight: 600; }
.groupe:first-of-type { margin-top: 4px; }
.filtre-local { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.filtre-local input { flex: 0 1 320px; min-width: 0; border: 1px solid var(--bord); background: var(--surface); border-radius: 8px; padding: 6px 10px; outline: none; }
.filtre-local input:focus { border-color: var(--accent); }
.filtre-local span { color: var(--texte-2); font-size: 13px; }
.vide { padding: 36px 20px; text-align: center; color: var(--texte-2); }
.deroule-recherche { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); margin: 0 0 14px; font-size: 13.5px; }
.deroule-recherche summary { padding: 9px 14px; cursor: pointer; color: var(--texte-2); font-weight: 600; }
.etapes-recherche { list-style: none; margin: 0; padding: 0 14px 10px; max-height: 260px; overflow-y: auto; }
.etapes-recherche li { display: flex; gap: 10px; padding: 4px 0; border-top: 1px solid var(--bord); overflow-wrap: anywhere; }
.etapes-recherche li:last-child { color: var(--texte); font-weight: 500; }
.quand-etape { flex: none; width: 38px; text-align: right; color: var(--texte-2); font-variant-numeric: tabular-nums; }
.chargement { padding: 30px 4px; color: var(--texte-2); display: flex; align-items: center; gap: 10px; }
.chargement::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bord); border-top-color: var(--accent); animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.etat-mot { font-size: 12px; font-weight: 600; color: var(--alerte); background: var(--alerte-doux); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.etat-mot.ok { color: var(--ok); background: var(--ok-doux); }
.non-lu .titre { font-weight: 700; }
.non-lu .titre::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.pastille.couleur { --h: 260; }
/* Aperçu : contenus des onglets */
.cadre { width: 100%; height: 68vh; border: 1px solid var(--bord); border-radius: 8px; background: #fff; }
.image-ap { max-width: 100%; border: 1px solid var(--bord); border-radius: 8px; }
.texte-lu { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border-radius: 8px; padding: 14px; max-height: 68vh; overflow: auto; margin: 0; }
.md { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.md h1 { font-size: 17px; margin: 6px 0 8px; } .md h2 { font-size: 15px; margin: 16px 0 6px; } .md h3, .md h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-2); margin: 14px 0 4px; }
.md ul, .md ol { padding-left: 20px; margin: 4px 0; } .md p { margin: 6px 0; }
.md table { border-collapse: collapse; font-size: 13px; margin: 8px 0; } .md td, .md th { border: 1px solid var(--bord); padding: 4px 8px; }
.md blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--accent); color: var(--texte-2); }
.md img { max-width: 100%; }
audio { width: 100%; margin-top: 10px; }
.liens-pj { display: flex; flex-direction: column; gap: 6px; }
.liens-pj a { color: var(--accent-fort); }
.jalons { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.jalons li { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--bord); }
.jalons li .marque-j { color: var(--texte-2); } .jalons li.fait .marque-j { color: var(--ok); } .jalons li.fait .t { color: var(--texte-2); text-decoration: line-through; }
.jalons li .r { grid-column: 2 / -1; color: var(--texte-2); font-size: 12.5px; }
.jalons li .e { color: var(--texte-2); font-size: 12.5px; }
.reponse { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 16px; margin-bottom: 14px; }
.etapes { color: var(--texte-2); font-size: 13px; }
.pipeline .col a { color: var(--accent-fort); }
@media (max-width: 760px) {
  .bouton-icone { display: inline-flex; }
  .marque span, .retour span { display: none; }
  .lateral { display: block; position: fixed; inset: 57px auto 0 0; width: 80vw; max-width: 300px; z-index: 6; transform: translateX(-102%); transition: transform .18s; box-shadow: var(--ombre); max-height: none; }
  .lateral.ouvert { transform: none; }
  .apercu { inset: 57px 0 0 0; }
}
@media (prefers-reduced-motion: reduce) { .lateral { transition: none; } .chargement::before { animation: none; } }

/* Panneau ouvert : la liste se resserre (titre + date), comme dans le SILO */
@media (min-width: 1101px) {
  .corps.avec-apercu .entete-liste, .corps.avec-apercu .ligne { grid-template-columns: 84px minmax(0, 1fr) 96px; }
  .corps.avec-apercu .ligne .col.qui, .corps.avec-apercu .ligne .pastilles, .corps.avec-apercu .entete-liste span:nth-child(3), .corps.avec-apercu .entete-liste span:nth-child(5) { display: none; }
  .corps.avec-apercu .tuiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 760px) { .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .tuile strong { font-size: 20px; } }
