/* L'Art du Compte-Rendu V2 — charte de la V1 Softr */
:root {
  --nuit: #0B2545;
  --bleu: #1E4FA0;
  --glacier: #EAF1FB;
  --or: #C9A227;
  --encre: #0F1B2D;
  --gris: #475467;
  --gris-clair: #667085;
  --texte: #344054;
  --bord: #C9D6EA;
  --rouge: #B42318;
  --rouge-fond: #FDECEC;
  --vert: #1E7B34;
  --vert-fond: #E6F4EA;
  --ambre: #8A6D0B;
  --ambre-fond: #FFF7E0;
  --fond: #F6F8FB;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06);
  --ombre-md: 0 4px 12px rgba(16, 24, 40, .10);
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fond); color: var(--encre); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[data-lucide], .lucide { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; }

/* ---------- Mise en page ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; background: #fff; border-right: 1px solid #E4EAF3;
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 18px 14px; z-index: 20;
}
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; }
.page { padding: 24px 16px 40px; }
.marque { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; border-bottom: 1px solid #EEF2F7; margin-bottom: 12px; }
.marque img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.marque b { display: block; color: var(--nuit); font-size: 15px; line-height: 1.2; }
.marque small { color: var(--gris-clair); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--gris); font-weight: 500; font-size: 14px;
}
.nav a:hover { background: #F2F6FC; color: var(--nuit); }
.nav a.actif { background: var(--glacier); color: var(--bleu); font-weight: 600; }
.nav .sep { height: 1px; background: #EEF2F7; margin: 10px 4px; }
.nav-bas { margin-top: auto; font-size: 12px; color: var(--gris-clair); padding: 8px; display: flex; align-items: center; gap: 8px; }
.nav-bas img { width: 26px; height: 26px; border-radius: 6px; }
.topbar { display: none; }
.bottombar { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: #fff; border-bottom: 1px solid #E4EAF3; padding: 10px 14px; position: sticky; top: 0; z-index: 15;
  }
  .topbar .marque { border: 0; padding: 0; margin: 0; }
  .topbar .marque img { width: 34px; height: 34px; }
  .page { padding: 16px 12px calc(96px + env(safe-area-inset-bottom)); }
  .bottombar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: #fff; border-top: 1px solid #E4EAF3; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottombar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--gris-clair); padding: 4px 2px; border-radius: 8px; text-align: center; }
  .bottombar a.actif { color: var(--bleu); font-weight: 600; }
  .bottombar a [data-lucide], .bottombar a .lucide { width: 22px; height: 22px; }
}

/* ---------- Conteneurs ---------- */
.contenu { margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.l2 { max-width: 672px; }
.l3 { max-width: 768px; }
.bandeau {
  border-radius: 16px; padding: 20px; color: #fff; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(135deg, var(--nuit), var(--bleu));
}
.bandeau.centre { text-align: center; padding: 32px 24px; align-items: center; }
.bandeau h1 { font-size: 24px; font-weight: 700; line-height: 1.25; }
.bandeau.centre h1 { font-size: 28px; }
.bandeau p { color: var(--glacier); font-size: 14px; }
.bandeau.centre p { font-size: 15px; }
.liseret { height: 4px; width: 64px; border-radius: 4px; background: var(--or); }
.bandeau .actions { display: flex; flex-wrap: wrap; gap: 8px; }

.carte {
  background: #fff; border: 1px solid var(--glacier); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre);
}
.carte.grande { border-radius: 16px; padding: 24px; }
.carte.cliquable { cursor: pointer; text-align: left; width: 100%; transition: box-shadow .15s; display: block; }
.carte.cliquable:hover { box-shadow: var(--ombre-md); }
.pile { display: flex; flex-direction: column; gap: 12px; }
.pile-l { display: flex; flex-direction: column; gap: 20px; }
.grille2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grille2 { grid-template-columns: 1fr 1fr; } }
.ligne { display: flex; align-items: flex-start; gap: 10px; }
.entre { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.min0 { min-width: 0; flex: 1; }
.titre-carte { font-weight: 600; color: var(--nuit); }
.tronque { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2, .clamp3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp2 { -webkit-line-clamp: 2; } .clamp3 { -webkit-line-clamp: 3; }
.muted { color: var(--gris-clair); font-size: 14px; }
.petit { font-size: 12px; }
.texte { color: var(--texte); font-size: 14px; }
.vide { background: #fff; border: 1px solid #E4EAF3; border-radius: var(--rayon); padding: 32px; text-align: center; color: var(--gris-clair); }
.erreur-texte { color: var(--rouge); }
.centre { text-align: center; }
.mt8 { margin-top: 8px; } .mt4 { margin-top: 4px; }

/* ---------- Formulaires ---------- */
.champ { display: flex; flex-direction: column; gap: 8px; }
.champ label, .label { font-size: 14px; font-weight: 500; color: var(--nuit); }
.input, .textarea {
  width: 100%; height: 48px; border: 1px solid #D0D5DD; border-radius: 8px; padding: 0 12px; background: #fff; font-size: 16px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus, .textarea:focus { border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(30, 79, 160, .15); }
.input.sm { height: 40px; font-size: 14px; }
.recherche { position: relative; }
.recherche [data-lucide], .recherche .lucide { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gris-clair); width: 16px; height: 16px; }
.recherche .input { padding-left: 36px; }
.zone-depot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  border: 2px dashed var(--bord); background: var(--glacier); border-radius: 12px; padding: 24px; cursor: pointer;
}
.zone-depot.pleine { border-color: var(--or); }
.zone-depot.survol { border-color: var(--bleu); background: #DDE8F8; }
.zone-depot [data-lucide], .zone-depot .lucide { width: 32px; height: 32px; color: var(--bleu); }
.info { border-radius: 8px; padding: 12px; font-size: 14px; }
.info.vert { background: var(--vert-fond); color: var(--vert); }
.info.ambre { background: var(--ambre-fond); color: var(--ambre); }
.info.rouge { background: var(--rouge-fond); color: var(--rouge); }
.info.bleu { background: var(--glacier); color: var(--nuit); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px;
  border-radius: 8px; border: 1px solid transparent; font-weight: 500; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: filter .15s, background .15s; background: transparent;
}
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.h48 { height: 48px; font-size: 16px; }
.btn.h36 { height: 36px; font-size: 14px; padding: 0 12px; }
.btn.plein { width: 100%; }
.btn.or { background: var(--or); color: var(--nuit); font-weight: 600; }
.btn.bleu { background: var(--bleu); color: #fff; }
.btn.contour { border-color: var(--bleu); color: var(--bleu); background: #fff; }
.btn.contour-blanc { border-color: rgba(255, 255, 255, .6); color: #fff; background: transparent; }
.btn.fantome { color: var(--gris); }
.btn.fantome:hover { background: #F2F4F7; }
.btn.danger { color: var(--rouge); }
.btn.danger-contour { border-color: var(--rouge); color: var(--rouge); background: #fff; }
.btn.danger-plein { background: var(--rouge); color: #fff; }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.boutons.droite { justify-content: flex-end; }
.boutons.col-sm { flex-direction: column; }
@media (min-width: 640px) { .boutons.col-sm { flex-direction: row; justify-content: center; } }
.grille-btn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 640px) { .grille-btn { grid-template-columns: repeat(3, 1fr); } }
.lien { color: var(--bleu); text-decoration: underline; text-underline-offset: 4px; background: none; border: 0; cursor: pointer; font-size: 14px; padding: 0; }
.tourne { animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- Badges, puces, filtres ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.sm { padding: 2px 8px; font-weight: 500; }
.badge [data-lucide], .badge .lucide { width: 12px; height: 12px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.filtres { display: flex; flex-wrap: wrap; gap: 8px; }
.filtre { border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 500; border: 1px solid var(--bord); background: #fff; color: var(--bleu); cursor: pointer; }
.filtre.actif { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.barre { height: 8px; width: 100%; border-radius: 999px; overflow: hidden; background: var(--glacier); }
.barre > div { height: 100%; border-radius: 999px; transition: width .4s; }

/* ---------- Onglets ---------- */
.onglets { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #F2F4F7; border-radius: 10px; padding: 4px; gap: 4px; }
.onglet { height: 40px; border: 0; border-radius: 8px; background: transparent; font-weight: 500; font-size: 14px; color: var(--gris); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.onglet.actif { background: #fff; color: var(--nuit); box-shadow: var(--ombre); }

/* ---------- Fenêtres ---------- */
.voile { position: fixed; inset: 0; background: rgba(11, 37, 69, .45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; animation: apparait .15s; }
.fenetre {
  background: #fff; border-radius: 14px; width: 100%; max-width: 672px; max-height: 90vh; overflow-y: auto; padding: 24px;
  box-shadow: 0 20px 50px rgba(11, 37, 69, .25); position: relative; display: flex; flex-direction: column; gap: 16px;
}
.fenetre.large { max-width: 780px; }
.fenetre.etroite { max-width: 480px; }
.fenetre h2 { font-size: 18px; font-weight: 600; color: var(--nuit); padding-right: 32px; }
.fermer { position: absolute; top: 14px; right: 14px; border: 0; background: none; cursor: pointer; color: var(--gris-clair); padding: 6px; border-radius: 6px; }
.fermer:hover { background: #F2F4F7; }
@keyframes apparait { from { opacity: 0; } }
@media (max-width: 640px) { .voile { padding: 0; align-items: flex-end; } .fenetre { max-height: 94vh; border-radius: 16px 16px 0 0; padding: 20px 16px; } }

.section { display: flex; flex-direction: column; gap: 8px; }
.section h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--nuit); }
.section h3 [data-lucide], .section h3 .lucide { width: 16px; height: 16px; color: var(--or); }
.encadre { background: var(--glacier); border-radius: 8px; padding: 12px; white-space: pre-wrap; line-height: 1.6; }
.encadre.metre { background: #FFFBEF; border: 1px solid var(--or); white-space: normal; display: flex; flex-direction: column; gap: 6px; }
.puces { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.taches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tache { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--glacier); border-radius: 8px; padding: 8px 10px; }
.tache .case { margin-top: 2px; width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--bleu); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: #fff; padding: 0; }
.tache .case.coche { background: var(--bleu); color: #fff; }
.tache .case [data-lucide], .tache .case .lucide { width: 13px; height: 13px; stroke-width: 3; }
.tache.faite .txt { text-decoration: line-through; color: var(--gris-clair); }
.tache .meta { font-size: 12px; color: var(--gris-clair); }
.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th { text-align: left; background: var(--glacier); color: var(--nuit); font-weight: 600; padding: 8px; font-size: 13px; }
.tableau td { border-top: 1px solid #EEF2F7; padding: 8px; vertical-align: top; }
.tableau td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau tr.total td { font-weight: 700; color: var(--nuit); border-top: 2px solid var(--or); }
.defile { overflow-x: auto; border: 1px solid var(--glacier); border-radius: 8px; }
.meta-cr { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--gris); }
.meta-cr span { display: inline-flex; align-items: center; gap: 5px; }
.meta-cr [data-lucide], .meta-cr .lucide { width: 14px; height: 14px; color: var(--bleu); }
.pied { position: sticky; bottom: -24px; background: #fff; padding: 12px 0 24px; margin-bottom: -24px; border-top: 1px solid #EEF2F7; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Étapes (installation) ---------- */
.etape-titre { display: flex; align-items: center; gap: 12px; }
.etape-titre h2 { font-size: 18px; font-weight: 600; color: var(--nuit); }
.etape-titre [data-lucide], .etape-titre .lucide { width: 24px; height: 24px; }
.ok { color: #1F7A4D; } .attente { color: var(--or); }
.sous-etape { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--glacier); }
.sous-etape:first-of-type { border-top: 0; }
.sous-etape .icone [data-lucide], .sous-etape .icone .lucide { width: 20px; height: 20px; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: #F2F4F7; border-radius: 6px; padding: 2px 6px; word-break: break-all; }
ol.guide { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--texte); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 100; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 40px); }
.toast { background: #fff; border: 1px solid #E4EAF3; border-radius: 10px; padding: 12px 16px; box-shadow: var(--ombre-md); font-size: 14px; display: flex; align-items: center; gap: 8px; animation: monte .2s; }
.toast.succes [data-lucide], .toast.succes .lucide { color: #1F7A4D; }
.toast.erreur [data-lucide], .toast.erreur .lucide { color: var(--rouge); }
@keyframes monte { from { transform: translateY(8px); opacity: 0; } }
@media (max-width: 900px) { .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); left: 12px; right: 12px; } }

.chargement { display: flex; align-items: center; gap: 8px; color: var(--gris-clair); }
.onglet { white-space: nowrap; }
@media (max-width: 480px) { .onglet [data-lucide], .onglet .lucide { display: none; } .onglet { font-size: 13px; } }
