/* ============================================================
   style.css — VALORIS
   Feuille de style globale unique.
   Règle absolue : aucune classe définie ici ne doit être
   redéfinie dans un template. Les surcharges spécifiques à
   une page vont dans un bloc <style> du template concerné,
   mais uniquement pour des classes qui n'existent pas ici.
   ============================================================ */


/* ============================================================
   1. TOKENS DE DESIGN — SOURCE DE VÉRITÉ UNIQUE
   Tous les templates utilisent ces alias courts.
   Les anciens noms longs (--bleu-nuit, etc.) sont supprimés.
   ============================================================ */

:root {
  /* ── Palette bleue ── */
  --bn:  #1a2b45;   /* bleu nuit — titres, navbar */
  --bp:  #1e3a5f;   /* bleu principal — boutons, headers */
  --bc:  #2d6a9f;   /* bleu clair — accents, focus */
  --ba:  #3b82c4;   /* bleu accent — hover, gradients */

  /* ── Or ── */
  --or:  #c9a84c;   /* or Valoris — onglet actif, soulignement */
  --orf: #a07830;   /* or foncé — libellés de section */

  /* ── Nuances de gris ── */
  --gf:  #f5f6f8;   /* fond de page */
  --gl:  #eef0f3;   /* fond léger — alternances, hover */
  --gb:  #d8dce3;   /* bordures */
  --gt:  #6b7280;   /* texte secondaire, labels */

  /* ── Texte et blanc ── */
  --tx:  #1f2937;   /* texte principal */
  --wh:  #ffffff;   /* blanc */

  /* ── Sémantique ── */
  --red: #dc2626;   /* erreur, suppression */
  --grn: #059669;   /* succès, positif */
  --amb: #d97706;   /* avertissement, ambre */

  /* ── Géométrie ── */
  --r:   6px;       /* rayon standard */
  --rl:  10px;      /* rayon large — cards */

  /* ── Ombres ── */
  --sh:  0 1px 4px rgba(0,0,0,.07), 0 3px 10px rgba(0,0,0,.05);

  /* ── Navigation ── */
  --nav-h: 54px;    /* hauteur de la navbar */
  --footer-h: 53px; /* hauteur du footer */
}

.footer {
  margin-top: auto;
  flex-shrink: 0;
  background: #1a2332;
  border-top: 2px solid #c9a84c;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  font-size: 12px;
  color: #b0bcc9;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-brand {
  display: flex;
  align-items: center;
}

.footer .brand-v {
  color: #c9a84c;
}

.footer .brand-rest {
  color: #d4dae0;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 600;
}

.footer-copy {
  opacity: .4;
  margin-left: 8px;
  font-size: 12px;
  color: #b0bcc9;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: #b0bcc9;
  text-decoration: none;
}

.footer-links a:hover {
  color: #c9a84c;
}


/* ============================================================
   2. RESET ET BASE
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scrollbar-gutter: stable;
}

body {
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

body:hover {
  scrollbar-color: rgba(0,0,0,0.12) transparent;
}

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--gf);
  color: var(--tx);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}


/* ============================================================
   3. NAVIGATION
   ============================================================ */

.navbar {
  background: var(--bn);
  height: var(--nav-h);
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
  flex-shrink: 0;
  box-sizing: border-box;
}

.gold-bar {
  height: 2px;
  background: linear-gradient(90deg, var(--or), #e8c96a, var(--or));
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Logo */
.brand-v {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 23px;
  font-weight: 700;
  color: var(--or);
  line-height: 1;
}

.brand-rest {
  font-size: 17px;
  font-weight: 700;
  color: var(--wh);
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1;
}

.nav-sep {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,.28);
  margin: 0 16px;
}

.nav-bp {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.42);
}

/* Liens de navigation */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nlinks {
  display: flex;
  gap: 2px;
}

.nl {
  font-size: 12px;
  color: rgba(255,255,255,.7);
  padding: 6px 14px 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  border-bottom: 2px solid transparent;
}

.nl:hover {
  color: var(--wh);
  background: rgba(255,255,255,.06);
}

.nl.active {
  color: var(--wh);
  font-weight: 600;
  border-bottom-color: var(--or);
}

/* Avatar et dropdown */
.nav-account { position: relative; }

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--bn);
  cursor: pointer;
  transition: all .18s;
  border: 2px solid rgba(255,255,255,.2);
  user-select: none;
}

.nav-avatar:hover,
.nav-avatar.open {
  border-color: rgba(255,255,255,.55);
  transform: scale(1.05);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 256px;
  background: var(--wh);
  border: 1px solid var(--gb);
  border-radius: var(--rl);
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  display: none;
  overflow: hidden;
  z-index: 300;
  animation: dropIn .18s ease;
}

.nav-dropdown.open { display: block; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* Flèche du dropdown */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -5px;
  right: 12px;
  width: 10px;
  height: 10px;
  background: var(--wh);
  border-left: 1px solid var(--gb);
  border-top: 1px solid var(--gb);
  transform: rotate(45deg);
}

.dd-user {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--gl);
  background: linear-gradient(135deg, #f8faff, #f0f4fb);
}

.dd-user-name  { font-size: 13px; font-weight: 700; color: var(--bp); margin-bottom: 2px; }
.dd-user-email { font-size: 11px; color: var(--gt); margin-bottom: 8px; }

.dd-plan {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: #f0f4ff;
  color: var(--bc);
  border: 1px solid #c7d9f5;
}

.dd-plan .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.dd-section {
  padding: 6px 0;
  border-bottom: 1px solid var(--gl);
}

.dd-section:last-child { border-bottom: none; }

.dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx);
  cursor: pointer;
  transition: background .12s;
  text-decoration: none;
}

.dd-item:hover           { background: var(--gl); }
.dd-item.danger          { color: var(--red); }
.dd-item.danger:hover    { background: #fff1f1; }

.dd-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  background: var(--gl);
}

.dd-item.danger .dd-icon { background: #fff1f1; }

.dd-item-label { display: block; line-height: 1.2; }
.dd-item-sub   { display: block; font-size: 10px; font-weight: 400; color: var(--gt); margin-top: 1px; }

/* Overlay de fermeture du dropdown */
.dd-overlay { display: none; position: fixed; inset: 0; z-index: 199; }
.dd-overlay.open { display: block; }


/* ============================================================
   4. LAYOUT PRINCIPAL
   ============================================================ */

.main-content {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================================
   5. ALERTES FLASH
   ============================================================ */

.alert {
  padding: 0.75rem 1.1rem;
  border-radius: var(--r);
  margin-bottom: 1rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}


/* ============================================================
   6. CARDS
   ============================================================ */

.card {
  background: var(--wh);
  border: 1px solid var(--gb);
  border-radius: var(--rl);
  padding: 16px 18px;
  box-shadow: var(--sh);
  margin-bottom: 16px;
}

/* Label de section à l'intérieur d'une card */
.ct {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tx);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gl);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ct .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  background: #e8f4ff;
  color: var(--bc);
  letter-spacing: 0;
  text-transform: none;
}

.ct-right {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Séparateur de section avec titre */
.sl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--orf);
  margin: 16px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sl:first-child { margin-top: 0; }

.sl::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gb);
}

/* Boîte d'information */
.insight {
  border: 1px solid #dce8ff;
  border-left: 3px solid var(--bc);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--bp);
  margin-bottom: 14px;
  line-height: 1.6;
  background: linear-gradient(135deg, #eff4ff, #edfdf7);
}

.insight strong { color: var(--bn); }
.insight a { color: var(--bc); font-weight: 600; }

.insight.warn {
  border-left-color: var(--amb);
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  border-color: #fde68a;
  color: #92400e;
}

.insight.warn strong { color: #78350f; }

.insight.bad {
  border-left-color: var(--red);
  background: linear-gradient(135deg, #fff1f1, #fef2f2);
  border-color: #fecaca;
  color: #991b1b;
}

/* ══════════════════════════════════════════════════════════
   TOOLTIP INFO — réutilisable sur toutes les pages
   Usage : <span class="tooltip-info" data-tip="Mon texte">i</span>
══════════════════════════════════════════════════════════ */
.tooltip-info {
  position: relative;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--bn);
  color: var(--bn);
  font-size: 9px;
  font-weight: 700;
  font-style: italic;
  opacity: .7;
  transition: opacity .15s;
  vertical-align: middle;
  margin-left: 3px;
  font-family: Georgia, serif;
  flex-shrink: 0;
  text-transform: none;
}

.tooltip-info:hover { opacity: 1; }

.tooltip-info::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bp);
  color: var(--wh);
  font-size: 10px;
  font-weight: 400;
  font-style: normal;
  font-family: 'Inter', sans-serif;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 100;
}

.tooltip-info:hover::after { opacity: 1; }

/* ============================================================
   7. ONGLETS
   ============================================================ */

/* Barre d'onglets horizontale */
.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--gb);
  margin-bottom: 20px;
  margin-top: 20px;
}

.tab-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--gt);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
  white-space: nowrap;
  font-family: inherit;
}

.tab-btn.active {
  color: var(--bn);
  border-bottom-color: var(--or);
  font-weight: 800;
  font-size: 14px;
}

.tab-btn:hover:not(.active) {
  color: var(--tx);
  background: var(--gl);
}

.tab-content { display: none; animation: fadeIn .22s ease; width: 100%; box-sizing: border-box; }
.tab-content.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.card {
  background: var(--wh);
  border: 1px solid var(--gb);
  border-radius: var(--rl);
  padding: 16px 18px;
  box-shadow: var(--sh);
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}


/* ============================================================
   8. FORMULAIRES
   ============================================================ */

/* Groupe de champ générique */
.fg {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fg label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gt);
}

.fg small {
  font-size: 11px;
  color: var(--gt);
  line-height: 1.4;
}

/* Tous les inputs et selects partagent la même hauteur */
.fg input,
.fg select {
  height: 38px;
  border: 1px solid var(--gb);
  border-radius: var(--r);
  padding: 0 12px;
  font-size: 14px;
  color: var(--tx);
  background: var(--wh);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  -moz-appearance: textfield;
}

.fg input[type=number]::-webkit-inner-spin-button,
.fg input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.fg input:focus,
.fg select:focus {
  border-color: var(--bc);
  box-shadow: 0 0 0 3px rgba(45,106,159,.1);
}

.fg input::placeholder { color: var(--gb); }

/* Lecture seule : fond grisé */
.fg input[readonly] {
  background: var(--gl);
  color: var(--bp);
  font-weight: 700;
  cursor: default;
}

/* Grilles de champs */
.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.fgrid-2  { grid-template-columns: repeat(2, 1fr); }
.fgrid-3  { grid-template-columns: repeat(3, 1fr); }

/* Grille sur 5 colonnes — une par exercice */
.fgrid-annees {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

/* Rangée d'actions sous un formulaire */
.actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}


/* ============================================================
   9. TABLEAUX
   ============================================================ */

.tw {
  overflow-x: auto;
  margin-bottom: 2px;
}

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

table.tbl thead tr {
  background: var(--bp);
  color: var(--wh);
}

table.tbl thead th {
  padding: 9px 11px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .03em;
  white-space: nowrap;
}

table.tbl thead th.r { text-align: right; }
table.tbl thead th.c { text-align: center; }

table.tbl tbody tr {
  border-bottom: 1px solid var(--gl);
}

table.tbl tbody tr:hover { background: #fafbff; }

table.tbl tbody td {
  padding: 8px 11px;
  vertical-align: middle;
  font-size: 13px;
}

table.tbl tbody td.r {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.tbl tbody td.c { text-align: center; }

table.tbl .total-row td {
  background: var(--gl);
  font-weight: 700;
  color: var(--bp);
  border-top: 1px solid var(--gb);
}

/* Ligne d'édition inline dans un tableau */
table.tbl .edit-row td {
  background: #f7faff;
  padding: 12px 11px;
}

/* Input dans une cellule de tableau */
.it {
  width: 100%;
  min-width: 72px;
  border: 1px solid var(--gb);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 13px;
  text-align: right;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  outline: none;
  background: var(--wh);
  -moz-appearance: textfield;
  transition: border-color .15s, background .15s;
}

.it::-webkit-inner-spin-button,
.it::-webkit-outer-spin-button { -webkit-appearance: none; }

.it:focus {
  border-color: var(--bc);
  background: #f7faff;
}

.it-left { text-align: left; }


/* ============================================================
   10. BOUTONS
   ============================================================ */

/* Bouton principal — bleu */
.btn-p {
  background: var(--bp);
  color: var(--wh);
  border: none;
  border-radius: var(--r);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-p:hover { background: var(--bc); }

/* Bouton secondaire — blanc bordé */
.btn-s {
  background: var(--wh);
  color: var(--tx);
  border: 1px solid var(--gb);
  border-radius: var(--r);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-s:hover { border-color: var(--bc); color: var(--bc); }

/* Bouton d'édition inline (icône) */
.btn-edit {
  background: none;
  border: 1px solid var(--gb);
  border-radius: 4px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gt);
  transition: all .15s;
  font-size: 13px;
  line-height: 1;
}

.btn-edit:hover {
  background: var(--gl);
  color: var(--bp);
  border-color: var(--bc);
}

/* Bouton de suppression inline (icône) */
.btn-del {
  background: none;
  border: 1px solid #fecaca;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--red);
  transition: all .15s;
  font-size: 13px;
  line-height: 1;
}

.btn-del:hover { background: #fff1f1; }

/* Bouton danger (suppression compte, etc.) */
.btn-danger {
  background: var(--wh);
  color: var(--red);
  border: 1px solid #fecaca;
  border-radius: var(--r);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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


/* ============================================================
   11. AUTOCOMPLETE VILLES
   ============================================================ */

.ac-wrap { position: relative; }

.ac-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--wh);
  border: 1px solid var(--bc);
  border-radius: var(--r);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  z-index: 100;
  display: none;
  overflow: hidden;
}

.ac-dropdown.open { display: block; }

.ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--gl);
  font-size: 13px;
  transition: background .1s;
}

.ac-item:last-child { border-bottom: none; }
.ac-item:hover      { background: #f0f6ff; }

.ac-item-name { color: var(--tx); font-weight: 600; }

.ac-item-dept {
  font-size: 11px;
  color: var(--gt);
  background: var(--gl);
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}

.ac-status {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--gt);
  text-align: center;
}


/* ============================================================
   12. PAGE D'ACCUEIL — PROJETS
   ============================================================ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

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

/* Card projet existant */
.project-card {
  background: var(--wh);
  border: 1px solid var(--gb);
  border-radius: var(--rl);
  box-shadow: var(--sh);
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s, transform .18s;
  overflow: hidden;
}

.project-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.1);
  transform: translateY(-2px);
}

.pc-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--bp), var(--bc));
}

.pc-body {
  padding: 16px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pc-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--bp);
  margin-bottom: 5px;
  line-height: 1.3;
}

.pc-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pc-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--gl);
  color: var(--gt);
}

.pc-tag.stat { background: #e8f4ff; color: var(--bc); }

.pc-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  flex: 1;
}

.pc-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--gt);
}

.pc-meta-row svg { flex-shrink: 0; opacity: .5; }
.pc-meta-row strong { color: var(--tx); }

.pc-progress { margin-bottom: 14px; }

.pc-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--gt);
  margin-bottom: 4px;
}

.pc-progress-bar {
  height: 4px;
  background: var(--gl);
  border-radius: 2px;
  overflow: hidden;
}

.pc-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--bc), var(--ba));
  transition: width .4s;
}

.pc-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--gl);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pc-date { font-size: 10px; color: var(--gt); }

.btn-open {
  font-size: 11px;
  font-weight: 700;
  color: var(--bp);
  background: var(--gl);
  border: 1px solid var(--gb);
  padding: 5px 14px;
  border-radius: var(--r);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  display: inline-block;
}

.btn-open:hover { background: var(--bp); color: var(--wh); border-color: var(--bp); }

/* Card nouveau projet */
.project-card-new {
  background: var(--wh);
  border: 2px dashed var(--gb);
  border-radius: var(--rl);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all .18s;
  text-decoration: none;
  min-height: 220px;
}

.project-card-new:hover {
  border-color: var(--bc);
  background: #f0f6ff;
}

.pcn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--bc);
  transition: all .18s;
}

.project-card-new:hover .pcn-icon { background: var(--bc); color: var(--wh); }

.pcn-title { font-size: 14px; font-weight: 700; color: var(--bp); }

.pcn-sub {
  font-size: 11px;
  color: var(--gt);
  text-align: center;
  line-height: 1.5;
}

.pcn-limit {
  font-size: 10px;
  color: var(--gt);
  background: var(--gl);
  padding: 3px 10px;
  border-radius: 20px;
}


/* ============================================================
   13. MODALS
   ============================================================ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,25,40,.55);
  backdrop-filter: blur(3px);
  z-index: 400;
  align-items: center;
  justify-content: center;
  animation: fadeOverlay .2s ease;
}

.modal-overlay.open { display: flex; }

@keyframes fadeOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--wh);
  border-radius: var(--rl);
  width: 100%;
  max-width: 680px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  overflow: hidden;
  animation: slideUp .22s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.modal-head {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--gl);
  position: relative;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--bp);
  margin-bottom: 3px;
}

.modal-sub {
  font-size: 12px;
  color: var(--gt);
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 28px;
  height: 28px;
  border-radius: var(--r);
  border: 1px solid var(--gb);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gt);
  font-size: 16px;
  transition: all .14s;
  line-height: 1;
}

.modal-close:hover { background: var(--gl); color: var(--tx); }

.modal-body {
  padding: 24px 28px;
  overflow-y: scroll;
  max-height: calc(90vh - 80px);
}

.modal-foot {
  padding: 16px 28px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--gl);
}

/* Variante danger (suppression compte) */
.modal.modal-danger .modal-head {
  border-top: 4px solid var(--red);
}

.modal.modal-danger .modal-title { color: var(--red); }


/* ============================================================
   14. PAGE HYPOTHÈSES — SPÉCIFIQUE
   ============================================================ */

/* En-tête avec bandeau projet */
.ph {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0;
  gap: 12px;
  flex-wrap: wrap;
}

.ptitle {
  font-size: 22px;
  font-weight: 700;
  color: var(--bp);
  margin-bottom: 4px;
}

.psub { font-size: 12px; color: var(--gt); }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gt);
  background: var(--wh);
  border: 1px solid var(--gb);
  padding: 5px 12px;
  border-radius: var(--r);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  margin-bottom: 16px;
}

.btn-back:hover { border-color: var(--bc); color: var(--bc); }

.btn-projections {
  font-size: 12px;
  font-weight: 700;
  color: var(--bp);
  background: var(--wh);
  border: 1px solid var(--gb);
  padding: 8px 20px;
  border-radius: var(--r);
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: 4px;
  text-decoration: none;
}

.btn-projections:hover { background: var(--bp); color: var(--wh); border-color: var(--bp); }

/* Tags méta projet */
.proj-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }

/* Barre de progression complétion */
.pc-progress-bar-hyp {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* Ligne capacité de rémunération (lecture seule, fond vert) */
.renum-max-row td {
  background: #f0f8f0;
  color: #065f46;
  font-size: 12px;
  font-style: italic;
}

.renum-max-row input {
  background: #dcfce7;
  color: #065f46;
  font-weight: 700;
  font-size: 12px;
  border: none;
  text-align: right;
  width: 100%;
  padding: 3px 6px;
  border-radius: 3px;
  cursor: default;
}

/* Lignes fiscales calculées — onglet Rémunération */
.fiscal-row td {
  background: #f0f4ff;
  color: var(--bp);
  font-size: 12px;
}
.fiscal-net-row td {
  background: #e0ebff;
  color: var(--bp);
  font-size: 12px;
  font-weight: 700;
}

/* Alerte CA micro dépassé */
.warn-box {
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  border: 1px solid #fde68a;
  border-left: 3px solid var(--amb);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 10px 14px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 14px;
}

.warn-box a { color: var(--orf); font-weight: 600; }


/* ============================================================
   15. PAGE RÉSULTATS
   ============================================================ */

/* Wrapper de tableau Excel */
.xl-wrap { padding: 16px; overflow-x: auto; }

table.xl {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  width: 100%;
  border: 1px solid #000000;
  border-radius: var(--r);
  overflow: hidden;
}

table.xl thead th {
  background: var(--bp);
  color: var(--wh);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  text-align: center;
  border-left: 1px solid rgba(255,255,255,.2);
  white-space: nowrap;
}

table.xl thead th:first-child { text-align: left; border-left: none; padding-left: 10px; }
table.xl thead th.th-left     { text-align: left; }
table.xl thead th + th        { border-left: 1px solid rgba(255,255,255,.2); }

/* Catégorie (bandeau bleu clair) */
table.xl tr.cat td {
  background: #dce6f1;
  color: var(--bp);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-top: 1px solid #c8d4e0;
  border-bottom: 1px solid #c8d4e0;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Ligne normale */
table.xl tr.item td:not(.vl) {
  background: var(--wh);
  color: var(--tx);
  padding: 6px 10px;
}

table.xl tr.item td:first-child       { padding-left: 18px; }
table.xl tr.item.sub td:first-child   { padding-left: 30px; color: #555; }
table.xl tr.item:hover td:not(.vl)    { background: #f0f4fa; }

/* Total bleu foncé */
table.xl tr.tot td {
  background: var(--bp);
  color: var(--wh);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-top: 1px solid #b8c4d4;
  border-bottom: 1px solid #b8c4d4;
}

table.xl tr.tot td:first-child { text-align: right; padding-right: 10px; }

/* Résultat net — or sur bleu */
table.xl tr.res-gold td {
  background: var(--bp);
  color: var(--or);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-top: 1px solid #b8c4d4;
}

table.xl tr.res-gold td:first-child { text-align: right; padding-right: 10px; }

/* Sous-total fond gris clair */
table.xl tr.tot-w td:not(.vl) {
  background: #f0f3f7;
  color: var(--bp);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-top: 1px solid #c8d4e0;
  border-bottom: 1px solid #c8d4e0;
}

table.xl tr.tot-w td:not(.vl):first-child { text-align: right; padding-right: 10px; }

/* EBE */
table.xl tr.ebe-row td {
  background: var(--bp) !important;
  color: var(--wh) !important;
  font-weight: 700;
}

/* Colonnes numériques */
table.xl td.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  border-left: 1px solid #d0d8e4;
}

/* Valeurs négatives */
td.neg { color: var(--red) !important; }

/* Valeurs négatives sur fond bleu */
table.xl tr.tot     td.neg,
table.xl tr.res-gold td.neg,
table.xl tr.ebe-row  td.neg { color: #fca5a5 !important; }

/* Label vertical (catégorie en rotation) */
td.vl {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--wh);
  background: var(--bp);
  text-align: center;
  vertical-align: middle;
  padding: 4px 2px;
  white-space: nowrap;
  width: 20px;
  border-right: 1px solid rgba(255,255,255,.2);
  border-bottom: none !important;
  border-top: none !important;
}

/* Note de bas de tableau */
.tnote {
  font-size: 10.5px;
  color: var(--gt);
  padding: 6px 16px 4px;
  font-style: italic;
}

/* Section card (résultats) */
.section-card {
  background: var(--wh);
  border: 1px solid var(--gb);
  border-radius: var(--r);
  box-shadow: var(--sh);
  margin-bottom: 16px;
  overflow: hidden;
}

.section-head {
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--gl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--bp);
}

/* Bouton plein écran */
.btn-expand {
  font-size: 11px;
  font-weight: 600;
  color: var(--gt);
  background: var(--gl);
  border: 1px solid var(--gb);
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
}

.btn-expand:hover { background: var(--gb); }

/* Toggle de format (vue simplifiée / PCG) */
.toggle-format, .bilan-toggle {
  display: flex;
  gap: 3px;
  background: var(--gl);
  border-radius: 5px;
  padding: 3px;
}

.tf-btn, .btog {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--gt);
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.tf-btn.active, .btog.active { background: var(--bp); color: var(--wh); }

/* Ratios — codes couleur par seuil */
.ratio-ok   { color: #059669 !important; font-weight: 700; }
.ratio-warn { color: #d97706 !important; font-weight: 700; }
.ratio-bad  { color: var(--red) !important; font-weight: 700; }
.ratio-na   { color: var(--gt); }


/* ============================================================
   16. PAGE DASHBOARD — SPÉCIFIQUE
   ============================================================ */

/* Layout principal dashboard */
.db-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-h) - 2px - var(--footer-h, 53px));
  margin: 0;
  width: 100%;
}

.db-main {
  flex: 1;
  min-width: 0;
  padding: 18px 22px 32px 256px;
}

/* Grilles KPI */
.krow5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.krow3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

/* Carte KPI */
.kpi {
  background: var(--wh);
  border: 1px solid var(--gb);
  border-radius: var(--rl);
  padding: 10px 12px;
  min-height: unset;
  box-shadow: var(--sh);
  transition: box-shadow .15s, transform .15s;
}

.kpi-inner {
  display: flex;
  gap: 12px;
  min-height: 90px;
  height: 100%;
}
.kpi-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-right {
  width: 60%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 4px 0;
}

.sparkline-v {
  width: 100%;
  height: 100%;
  min-height: 90px;
  max-height: 130px;
  display: block;
}


.kpi:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-1px); }

.kpi.blue { background: #f0f7ff; }
.kpi.grn  { background: #f0faf5; }
.kpi.red  { background: #fff5f5; }
.kpi.amb  { background: #fffbf0; }

.kl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tx);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kv {
  font-size: 26px;
  font-weight: 700;
  color: var(--bn);
  line-height: 1;
  margin-bottom: 4px;
  transition: all .3s;
}

.kv.mod { color: var(--orf); }

.ke { font-size: 10px; font-weight: 600; margin-bottom: 6px; }
.eu { color: var(--grn); }
.ed { color: var(--red); }
.en { color: var(--gt); }

.sparkline { display: block; width: 100%; height: 40px; margin-top: 4px; }

/* Bullet charts */
.bullet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.bullet-label {
  font-size: 11px;
  color: var(--tx);
  width: 185px;
  flex-shrink: 0;
  line-height: 1.3;
}

.bullet-wrap { flex: 1; position: relative; height: 16px; }
.b-bg { position: absolute; top: 4px; left: 0; right: 0; height: 8px; border-radius: 4px; background: var(--gl); }
.b-zone { position: absolute; top: 4px; height: 8px; border-radius: 4px; }
.b-fill { position: absolute; top: 5px; height: 6px; border-radius: 3px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.b-tgt  { position: absolute; top: 2px; width: 2px; height: 12px; border-radius: 1px; background: #9b2335; }

.bullet-val {
  font-size: 11px;
  font-weight: 700;
  width: 58px;
  text-align: right;
  flex-shrink: 0;
}

.bullet-desc {
  font-size: 9px;
  color: var(--gt);
  margin-top: -5px;
  margin-bottom: 7px;
  padding-left: 193px;
  line-height: 1.4;
}

/* Décomposition DuPont */
.dup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: nowrap;
  padding: 8px 0;
}

.dup-box {
  background: var(--gl);
  border: 1px solid var(--gb);
  border-radius: var(--r);
  padding: 9px 12px;
  text-align: center;
  min-width: 88px;
}

.dup-box.hi { background: var(--bp); border-color: var(--bp); }

.dup-t {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gt);
  margin-bottom: 3px;
}

.dup-box.hi .dup-t { color: rgba(255,255,255,.55); }

.dup-v {
  font-size: 16px;
  font-weight: 700;
  color: var(--bn);
  transition: all .3s;
}

.dup-box.hi .dup-v { color: var(--wh); }

.dup-op { font-size: 18px; color: var(--gt); padding: 0 6px; font-weight: 300; }
.dup-eq { font-size: 18px; color: var(--or); padding: 0 6px; font-weight: 700; }

/* Frise calendaire — Point mort */
.frise-pm     { margin: 6px 0 2px; }
.frise-svg    { width: 100%; height: 10px; display: block; }
.frise-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--gt); /* ← corrigé : --txt-muted n'existe pas */
  margin-top: 2px;
}

/* Badge statut KPI (marge de sécurité) */
.kpi-badge { font-size: 10px; font-weight: 600; padding: 1px 6px;
             border-radius: 20px; margin-left: 6px; vertical-align: middle; }
.kpi-badge.solide  { background: #d1fae5; color: #065f46; }
.kpi-badge.correct { background: #fef3c7; color: #92400e; }
.kpi-badge.fragile { background: #fee2e2; color: #991b1b; }

/* ── Bullet chart viabilité enrichi ── */

/* Ligne bullet avec colonne trend */
.viab-bullet-row { margin-bottom: 16px; }
.viab-bullet-row:last-child { margin-bottom: 0; }

/* Colonne flèche + delta N-1 */
.bullet-trend {
  font-size: 11px;
  font-weight: 700;
  width: 72px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* Colonne valeur duale "réel / seuil" */
.bullet-val-dual {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 130px;
  flex-shrink: 0;
  font-size: 11px;
}

/* Séparateur / entre réel et seuil */
.bvd-sep {
  color: var(--gt);
  font-weight: 400;
  font-size: 10px;
}

/* Wrapper frise point mort dans le bullet */
.viab-frise-wrap {
  height: auto !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding-top: 4px;
}

/* Fix : hauteur bullet-wrap pour la ligne frise point mort */
.viab-bullet-row .bullet-wrap {
  height: auto;
}

/* Fix : labels "1 jan" / "31 déc" espacés correctement */
.viab-frise-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--gt);
  width: 100%;
}

/* Espacement uniforme entre toutes les lignes du bullet viabilité */
.viab-bullet-row {
  margin-bottom: 20px;
}
.viab-bullet-row:last-child {
  margin-bottom: 0;
}

/* Alignement label au départ de la barre — cohérent sur toutes les lignes */
.viab-bullet-row {
  align-items: flex-start;
  margin-bottom: 20px;
}
.viab-bullet-row:last-child { margin-bottom: 0; }

.viab-bullet-row .bullet-label {
  padding-top: 3px;
}

.viab-bullet-row .bullet-wrap,
.viab-bullet-row .viab-frise-wrap {
  padding-top: 0;
}

.viab-bullet-row .bullet-val-dual,
.viab-bullet-row .bullet-trend {
  padding-top: 2px;
}

/* Alignement vertical cohérent sur toutes les lignes du bullet viabilité */
.viab-bullet-row {
  align-items: flex-start;
  margin-bottom: 20px;
}

.viab-bullet-row:last-child { margin-bottom: 0; }

.viab-bullet-row .bullet-label     { padding-top: 3px; }
.viab-bullet-row .bullet-val-dual  { padding-top: 2px; }
.viab-bullet-row .bullet-trend     { padding-top: 2px; }

/* Alignement gauche de la colonne Résultat / Seuil */
.bullet-val-dual {
  justify-content: flex-start;
  min-width: 140px;
  padding-left: 16px;
}

/* Espace entre le bullet chart et l'insight en dessous */
#bullet-viab {
  margin-bottom: 14px;
}


/* ============================================================
   17. PAGE MON COMPTE — SIDEBAR
   ============================================================ */

.account-layout {
  display: flex;
  flex-direction: row;
  gap: 28px;
  align-items: flex-start;
  padding: 36px 0 56px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.account-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-h) + 2px + 24px);
}

.sidebar-card {
  background: var(--wh);
  border: 1px solid var(--gb);
  border-radius: var(--rl);
  box-shadow: var(--sh);
  overflow: hidden;
}

.sb-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 18px;
  border-bottom: 1px solid var(--gl);
  background: linear-gradient(160deg, #f8faff 0%, var(--wh) 100%);
  text-align: center;
}

.sb-av {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  transition: background .2s;
  flex-shrink: 0;
}

.sb-name  { font-size: 14px; font-weight: 700; color: var(--bp); margin-bottom: 2px; }
.sb-email { font-size: 11px; color: var(--gt); margin-bottom: 10px; }

.sb-plan {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  background: #f0f4ff;
  color: var(--bc);
  border: 1px solid #c7d9f5;
}

.sb-plan .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.sb-nav { display: flex; flex-direction: column; }

.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all .14s;
  border-left: 3px solid transparent;
  text-decoration: none;
  color: var(--tx);
  border-bottom: 1px solid var(--gl);
}

.sb-item:last-child { border-bottom: none; }
.sb-item:hover      { background: var(--gl); }

.sb-item.active {
  background: #f0f4ff;
  border-left-color: var(--bc);
}

.sb-item.active .sb-lbl { color: var(--bp); font-weight: 700; }

.sb-icon { font-size: 15px; width: 18px; flex-shrink: 0; text-align: center; opacity: .65; }
.sb-item.active .sb-icon { opacity: 1; }

.sb-lbl { font-size: 13px; font-weight: 600; color: var(--gt); transition: color .14s; }
.sb-item:hover .sb-lbl { color: var(--tx); }

.sb-item.is-danger:hover { background: #fff5f5; }
.sb-item.is-danger .sb-lbl { color: var(--red); }

.account-content { flex: 1; min-width: 0; }

/* Sélecteur couleur avatar */
.color-grid { display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 0; }

.c-opt {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all .15s;
}

.c-opt:hover { transform: scale(1.12); }
.c-opt.sel { box-shadow: 0 0 0 2px var(--wh), 0 0 0 4px var(--bp); }

/* Indicateur force mot de passe */
.pwd-bar-wrap {
  height: 4px;
  background: var(--gl);
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
}

.pwd-bar {
  height: 100%;
  border-radius: 2px;
  width: 0;
  transition: width .3s, background .3s;
}

/* Zone de danger */
.danger-card {
  background: var(--wh);
  border: 1px solid #fecaca;
  border-radius: var(--rl);
  padding: 20px 22px;
  box-shadow: var(--sh);
  margin-bottom: 16px;
}

.danger-head { font-size: 13px; font-weight: 700; color: var(--red); margin-bottom: 4px; }
.danger-desc { font-size: 12px; color: var(--gt); margin-bottom: 18px; line-height: 1.5; }

.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: #fff5f5;
  border-radius: var(--r);
  border: 1px solid #fecaca;
}

.danger-row-lbl { font-size: 13px; font-weight: 600; color: var(--tx); margin-bottom: 2px; }
.danger-row-sub { font-size: 12px; color: var(--gt); }

/* Card Pro */
.pro-card {
  background: linear-gradient(135deg, #fffbeb, #fef9ee);
  border: 1px solid #f5d78c;
  border-radius: var(--rl);
  padding: 20px 22px;
  box-shadow: var(--sh);
  margin-bottom: 16px;
}

.pro-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--orf);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f5d78c;
}

.pro-features { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

.pro-feat {
  font-size: 13px;
  color: var(--tx);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pro-feat::before { content: '✓'; color: var(--or); font-weight: 700; flex-shrink: 0; }

.btn-pro {
  background: linear-gradient(135deg, var(--or), #e8c96a);
  color: var(--bn);
  border: none;
  border-radius: var(--r);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: .6;
  cursor: not-allowed;
}


/* ============================================================
   18. PAGES D'AUTHENTIFICATION
   ============================================================ */

.auth-body {
  background: var(--bn);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-logo { text-align: center; margin-bottom: 2rem; }

.auth-logo .brand-v    { font-size: 2.5rem; }
.auth-logo .brand-rest { font-size: 1.5rem; letter-spacing: 4px; }

.auth-logo-sub {
  color: rgba(255,255,255,.45);
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 0.4rem;
}

.auth-card {
  background: var(--wh);
  border-radius: var(--rl);
  padding: 2.5rem;
  box-shadow: 0 8px 40px rgba(0,0,0,.3);
}

.auth-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--bp);
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-card .fg { margin-bottom: 1rem; }

.btn-full {
  width: 100%;
  justify-content: center;
  height: 44px;
  font-size: 0.95rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--gt);
}

.auth-footer a { color: var(--bc); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--gt);
  cursor: pointer;
}

.checkbox-label input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

/* ============================================================
   19. PAGES LÉGALES
   ============================================================ */

.legal-page {
  max-width: 760px;
  margin: 3rem auto;
  padding: 0 2rem;
  color: var(--tx);
  line-height: 1.75;
}

.legal-page h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--dblue);
  border-bottom: 2px solid #c9a84c;
  padding-bottom: .5rem;
  margin-bottom: .3rem;
}

.legal-page h1 + .text-muted {
  font-size: .8rem;
  color: var(--gt);
  margin-bottom: 2.5rem;
  display: block;
}

.legal-page h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--dblue);
  margin-top: 2.2rem;
  margin-bottom: .6rem;
  padding-left: .75rem;
  border-left: 3px solid #c9a84c;
}

.legal-page h3 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--tx);
  margin-top: 1.4rem;
  margin-bottom: .4rem;
}

.legal-page p {
  font-size: .88rem;
  margin-bottom: .8rem;
}

.legal-page ul {
  font-size: .88rem;
  padding-left: 1.2rem;
  margin-bottom: 1rem;
}

.legal-page li {
  margin-bottom: .35rem;
}

.legal-page a {
  color: #c9a84c;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-page a:hover {
  color: var(--dblue);
}

.legal-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  margin: 1rem 0;
  table-layout: auto;
}

.legal-page th:first-child,
.legal-page td:first-child {
  white-space: nowrap;
}

.legal-page th {
  background: #1a2332;
  color: #ffffff;
  text-align: left;
  padding: .55rem .75rem;
  font-weight: 500;
  font-size: .8rem;
}

.legal-page td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--gb);
  color: var(--tx);
  background: #fff;
}

.legal-page tr:nth-child(even) td {
  background: #f7f7f5;
}

.legal-page code {
  background: #edecea;
  color: #1a2332;
  padding: .15rem .4rem;
  border-radius: 3px;
  font-size: .82rem;
}

.legal-page strong {
  color: var(--dblue);
}

/* ============================================================
   20. BANNIÈRE COOKIES
   ============================================================ */

.cookie-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-card {
  background: #1a2332;
  border: 1px solid rgba(201, 168, 76, .3);
  border-radius: 12px;
  padding: 24px 28px;
  max-width: 380px;
  width: 90%;
}

.cookie-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 18px;
}

.cookie-title {
  color: #d4dae0;
  font-size: 15px;
  font-weight: 600;
}

.cookie-text {
  color: #8a97a6;
  font-size: .82rem;
  line-height: 1.6;
  margin: 0 0 16px;
}

.cookie-text a {
  color: #c9a84c;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-actions {
  display: flex;
  gap: 10px;
}

.cookie-btn {
  flex: 1;
  padding: 9px 0;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .2s;
}

.cookie-btn:hover {
  opacity: .85;
}

.cookie-refuse {
  background: transparent;
  color: #8a97a6;
  border: 1px solid rgba(255, 255, 255, .15);
}

.cookie-accept {
  background: #c9a84c;
  color: #1a2332;
  border: none;
}


/* ============================================================
   21. STATUT DE SAUVEGARDE
   ============================================================ */

.save-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #ffffff;
  color: #26261F;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 8px;
  border: 1px solid #e0ddd5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 9000;
}

.save-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.save-toast.saved::before {
  content: '✓';
  color: #2e7d32;
  font-size: 14px;
}

.save-toast.error::before {
  content: '✕';
  color: #c62828;
  font-size: 14px;
}

.save-toast.pending::before {
  content: '●';
  color: #e6a817;
  font-size: 10px;
}

.save-toast.saving::before {
  content: '↻';
  color: #8a8678;
  font-size: 14px;
}

/* ============================================================
   22. PAGE ENTITÉS (AJOUT / FORMULAIRE)
   ============================================================ */

.entity-add-wrap {
  margin-top: 14px;
  text-align: center;
}

.btn-add-outline {
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid #c9a84c;
  background: transparent;
  color: var(--tx);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background .15s, color .15s;
}

.btn-add-outline:hover {
  background: rgba(201, 168, 76, .08);
}

.entity-empty {
  text-align: center;
  padding: 20px;
  color: var(--gt);
  font-size: 13px;
}

.entity-form {
  overflow: hidden;
  transition: max-height .3s ease, opacity .3s ease;
}

.entity-form.closed {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

.entity-form.open {
  max-height: 800px;
  opacity: 1;
}