/* Nouza Group — gestion et comptabilité. Couleurs du logo (bleu, turquoise, vert). Téléphone d'abord. */

:root {
  color-scheme: light;
  --fond: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --surface-3: #e4ebf3;
  --bord: #dde4ed;
  --bord-fort: #c5d0dd;
  --texte: #142133;
  --texte-2: #43536a;
  --texte-3: #66758a;
  --bleu: #2c81d4;
  --bleu-fonce: #1f64aa;
  --bleu-clair: #e6f0fb;
  --turquoise: #50c4b1;
  --vert: #88d58d;
  --degrade: linear-gradient(120deg, #2c81d4 0%, #2fa9d2 45%, #50c4b1 75%, #88d58d 100%);
  --accent: #2c81d4;
  --accent-fonce: #1f64aa;
  --accent-clair: #e6f0fb;
  --danger: #b3261e;
  --danger-fond: #fbe9e7;
  --attention: #8a5a00;
  --attention-fond: #fdf0d5;
  --succes: #1a7040;
  --succes-fond: #e2f4e9;
  --info-fond: #e8f1fc;
  --serie-1: #2c81d4;
  --serie-2: #e8743b;
  --serie-3: #1f9d6b;
  --grille: #e7ecf2;
  --axe: #c5d0dd;
  --critique: #b3261e;
  --rayon: 14px;
  --ombre: 0 1px 2px rgba(20, 33, 51, .06), 0 3px 12px rgba(20, 33, 51, .05);
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --barre-bas: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fond: #0f1722;
    --surface: #17212f;
    --surface-2: #1d2939;
    --surface-3: #243245;
    --bord: #2a384b;
    --bord-fort: #3a4a60;
    --texte: #e7edf5;
    --texte-2: #b7c3d3;
    --texte-3: #8b99ad;
    --accent: #5aa5ec;
    --accent-fonce: #8cc2f3;
    --accent-clair: #1c3350;
    --bleu-clair: #1c3350;
    --danger: #ff8a80;
    --danger-fond: #3a1c1b;
    --attention: #f3c46b;
    --attention-fond: #3a2e14;
    --succes: #7fd6a0;
    --succes-fond: #173424;
    --info-fond: #1a2c44;
    --grille: #243245;
    --axe: #3a4a60;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 3px 12px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--police);
  font-size: 15px;
  line-height: 1.45;
  color: var(--texte);
  background: var(--fond);
}
img, svg { max-width: 100%; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
p { margin: 0; }
.nombre, .montant { font-variant-numeric: tabular-nums; white-space: nowrap; }
.texte-2 { color: var(--texte-2); }
.texte-3 { color: var(--texte-3); }
.petit { font-size: 13px; }
.gras { font-weight: 650; }
.positif { color: var(--succes); }
.negatif { color: var(--danger); }

/* ---------- Démarrage et écran de connexion ---------- */

.demarrage { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--texte-3); }
.demarrage img { width: 84px; height: 84px; }
.porte {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--degrade);
}
.porte-carte {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(20, 33, 51, .22);
  padding: 28px 22px;
}
.porte-carte .logo { display: block; width: 84px; height: 84px; margin: 0 auto 8px; }
.porte-carte h1 { font-size: 22px; text-align: center; }
.porte-carte .sous-titre { text-align: center; color: var(--texte-3); margin: 4px 0 20px; }
.porte-carte form { display: grid; gap: 14px; }
.porte-pied { text-align: center; margin-top: 16px; font-size: 13px; color: var(--texte-3); }
.case { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--texte-2); cursor: pointer; }
.case input { flex: none; width: 18px; height: 18px; }

/* ---------- Structure ---------- */

.appli { min-height: 100vh; }
.entete {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--bord);
}
.entete::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--degrade); }
.marque { display: flex; align-items: center; gap: 9px; color: var(--texte); text-decoration: none; font-weight: 750; }
.marque img { width: 34px; height: 34px; }
.marque span { display: none; }
.titre-page { font-size: 17px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete .personne { display: none; font-size: 13px; color: var(--texte-3); white-space: nowrap; }
.puce-reseau { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 4px 9px; border-radius: 999px; background: var(--attention-fond); color: var(--attention); border: 0; cursor: pointer; }
.puce-reseau.hors-ligne { background: var(--danger-fond); color: var(--danger); }

.bandeau-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 14px;
  background: var(--attention-fond);
  color: var(--attention);
  font-size: 13.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--bord);
}
.bandeau-demo .bouton { padding: 4px 10px; min-height: 30px; font-size: 13px; }

.vue {
  padding: 16px 14px calc(var(--barre-bas) + 30px + env(safe-area-inset-bottom));
  max-width: 1240px;
  margin: 0 auto;
  outline: none;
}
.vue[aria-busy="true"] > * { opacity: .55; transition: opacity .15s; }
.menu-lateral { display: none; }

.barre-bas {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--barre-bas) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--bord);
}
.onglet {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--texte-3);
  font-size: 11.5px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  min-width: 0;
}
.onglet svg { width: 24px; height: 24px; }
.onglet.actif { color: var(--accent); }
.onglet-plus { align-content: start; }
.onglet-plus .rond {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-top: -18px;
  border-radius: 50%;
  background: var(--degrade);
  color: #fff;
  box-shadow: 0 6px 18px rgba(44, 129, 212, .4);
}
.onglet-plus .rond svg { width: 28px; height: 28px; stroke-width: 2.4; }

.pastille {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}
.onglet .pastille { position: absolute; top: 6px; left: calc(50% + 6px); }

@media (min-width: 960px) {
  .appli { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: auto auto 1fr; }
  .entete { grid-column: 1 / -1; padding: 10px 22px; }
  .bandeau-demo { grid-column: 1 / -1; padding: 8px 22px; }
  .marque span { display: inline; font-size: 17px; }
  .marque { width: 226px; }
  .entete .personne { display: block; }
  .menu-lateral {
    display: block;
    position: sticky;
    top: 62px;
    align-self: start;
    height: calc(100vh - 62px);
    overflow-y: auto;
    padding: 14px 12px 24px;
    border-right: 1px solid var(--bord);
    background: var(--surface);
  }
  .lien-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--texte-2);
    text-decoration: none;
    font-weight: 600;
    border: 0;
    background: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
  }
  .lien-menu svg { width: 20px; height: 20px; flex: none; }
  .lien-menu .pastille { margin-left: auto; }
  .lien-menu:hover { background: var(--surface-2); color: var(--texte); }
  .lien-menu.actif { background: var(--accent-clair); color: var(--accent-fonce); }
  .lien-menu .point { width: 10px; height: 10px; border-radius: 50%; margin: 0 5px; flex: none; }
  .menu-separateur { height: 1px; background: var(--bord); margin: 10px 4px; }
  .menu-titre { font-size: 11.5px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--texte-3); padding: 4px 12px 6px; }
  .bouton-saisie-rapide { width: 100%; margin-bottom: 10px; }
  .barre-bas { display: none; }
  .vue { padding: 24px 28px 48px; width: 100%; }
}

/* ---------- Blocs ---------- */

.pile { display: grid; gap: 16px; }
.carte { background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px; min-width: 0; }
.carte-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.carte-tete h2 { font-size: 16px; }
.carte-tete h3 { font-size: 15px; }
.carte-tete .detail { color: var(--texte-3); font-size: 13px; }
.deux-colonnes { display: grid; gap: 16px; }
.fiche, .trois-colonnes { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .deux-colonnes { grid-template-columns: 1fr 1fr; }
  .carte { padding: 18px 20px; }
}
@media (min-width: 1100px) {
  .fiche { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
  .trois-colonnes { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.colonne { display: grid; gap: 16px; align-content: start; min-width: 0; }

.tuiles { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .tuiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.tuile { background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 12px 14px; min-width: 0; text-decoration: none; color: inherit; display: block; position: relative; overflow: hidden; }
a.tuile:hover { box-shadow: 0 0 0 2px var(--accent-clair), var(--ombre); }
.tuile-libelle { font-size: 13px; color: var(--texte-2); display: flex; align-items: center; gap: 6px; }
.tuile-valeur { font-size: 21px; font-weight: 750; margin-top: 2px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tuile-valeur .devise { font-size: 13px; font-weight: 600; color: var(--texte-3); }
.tuile-detail { font-size: 12.5px; color: var(--texte-3); margin-top: 3px; }
.tuile.mise-en-avant { background: var(--degrade); color: #fff; }
.tuile.mise-en-avant .tuile-libelle, .tuile.mise-en-avant .tuile-detail, .tuile.mise-en-avant .devise { color: rgba(255, 255, 255, .88); }
.tuile .barre-couleur { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }

.pastille-couleur { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* ---------- Boutons ---------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}
.bouton svg { width: 18px; height: 18px; }
.bouton:disabled { opacity: .55; cursor: default; }
.bouton.principal { background: var(--accent); color: #fff; }
.bouton.principal:hover:not(:disabled) { background: var(--accent-fonce); }
.bouton.degrade { background: var(--degrade); color: #fff; }
.bouton.secondaire { background: var(--surface); color: var(--texte); border-color: var(--bord-fort); }
.bouton.secondaire:hover:not(:disabled) { background: var(--surface-2); }
.bouton.discret { background: none; color: var(--accent); padding-left: 8px; padding-right: 8px; }
.bouton.danger { background: var(--danger); color: #fff; }
.bouton.lien-danger { background: none; color: var(--danger); padding-left: 6px; padding-right: 6px; }
.bouton.petit { min-height: 34px; padding: 5px 11px; font-size: 13.5px; border-radius: 9px; }
.bouton.plein { width: 100%; }
.bouton-icone { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; color: var(--texte-2); cursor: pointer; font-size: 18px; }
.bouton-icone:hover { background: var(--surface-2); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.actions-gauche { justify-content: flex-start; }
.barre-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Formulaires ---------- */

.champ { display: grid; gap: 5px; min-width: 0; }
.champ > span, .champ-titre { font-size: 13.5px; font-weight: 650; color: var(--texte-2); }
.champ small { font-size: 12.5px; color: var(--texte-3); }
.champ input, .champ select, .champ textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--bord-fort);
  border-radius: 11px;
  background: var(--surface);
}
.champ textarea { min-height: 80px; resize: vertical; }
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.champ input[readonly] { background: var(--surface-2); }
.champ-compact input, .champ-compact select { min-height: 38px; padding: 6px 10px; }
.champ-montant input { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.grille-champs { display: grid; gap: 12px; }
@media (min-width: 620px) {
  .grille-champs.deux { grid-template-columns: 1fr 1fr; }
  .grille-champs.trois { grid-template-columns: repeat(3, 1fr); }
  .grille-champs .tout { grid-column: 1 / -1; }
}
.filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filtres .champ { min-width: 140px; }
.message-erreur { color: var(--danger); background: var(--danger-fond); padding: 9px 12px; border-radius: 10px; font-size: 14px; }
.aide { font-size: 13px; color: var(--texte-2); background: var(--info-fond); padding: 10px 12px; border-radius: 10px; }
.aide.attention { background: var(--attention-fond); color: var(--attention); }
.aide.succes { background: var(--succes-fond); color: var(--succes); }
.aide.danger { background: var(--danger-fond); color: var(--danger); }
.aide strong { font-weight: 700; }

/* Choix en pastilles (opérateur, type d'opération, catégorie). */
.segments { display: flex; flex-wrap: wrap; gap: 8px; }
.segments input { position: absolute; opacity: 0; pointer-events: none; }
.segments label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1.5px solid var(--bord-fort);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}
.segments input:checked + label { border-color: var(--accent); background: var(--accent-clair); color: var(--accent-fonce); box-shadow: inset 0 0 0 1px var(--accent); }
.segments input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.segments.larges label { flex: 1 1 calc(50% - 8px); justify-content: center; }
@media (min-width: 620px) { .segments.larges label { flex: 1 1 0; } }
.segments .pastille-couleur { width: 12px; height: 12px; }

/* ---------- Tableaux ---------- */

.tableau-conteneur { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--texte-3); padding: 8px 8px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
.tableau td { padding: 9px 8px; border-bottom: 1px solid var(--bord); vertical-align: top; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau .droite, .tableau th.droite { text-align: right; }
.tableau tfoot td { font-weight: 750; border-top: 2px solid var(--bord-fort); }
.tableau tr.total td { font-weight: 750; background: var(--surface-2); }
.tableau tr.sous-titre td { font-weight: 750; color: var(--texte-2); background: var(--surface-2); }
.tableau tr.cliquable { cursor: pointer; }
.tableau tr.cliquable:hover td { background: var(--surface-2); }
.tableau tr.annulee td { color: var(--texte-3); text-decoration: line-through; }
.tableau.compact td, .tableau.compact th { padding: 6px 6px; }

/* Listes en cartes (téléphone). */
.liste { display: grid; }
.ligne-liste {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--bord);
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.ligne-liste:last-child { border-bottom: 0; }
button.ligne-liste { width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.ligne-liste:hover { background: var(--surface-2); }
.ligne-liste .corps { flex: 1; min-width: 0; }
.ligne-liste .titre { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-liste .sous { font-size: 13px; color: var(--texte-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-liste .valeur { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ligne-liste .valeur .sous { font-weight: 500; }
/* Listes où le libellé compte plus que la densité (prêts) : le texte passe à la ligne au lieu d'être coupé. */
.liste.aeree .ligne-liste .titre { white-space: normal; }
@media (max-width: 600px) {
  /* Téléphone : le libellé passe à la ligne plutôt que d'être coupé, et la colonne
     des montants laisse de la place (seul le montant lui-même reste d'un bloc). */
  .ligne-liste .titre { white-space: normal; }
  .ligne-liste .valeur { max-width: 48%; }
  .ligne-liste .valeur .sous { white-space: normal; }
}
@media (max-width: 600px) { .liste.aeree .ligne-liste .sous { white-space: normal; } }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none; background: var(--surface-2); color: var(--texte-2); }
.avatar svg { width: 20px; height: 20px; }

/* ---------- Badges ---------- */

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-3); color: var(--texte-2); }
.badge svg { width: 13px; height: 13px; }
.badge.bleu { background: var(--accent-clair); color: var(--accent-fonce); }
.badge.vert { background: var(--succes-fond); color: var(--succes); }
.badge.orange { background: var(--attention-fond); color: var(--attention); }
.badge.rouge { background: var(--danger-fond); color: var(--danger); }

/* ---------- Onglets internes ---------- */

.onglets { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--bord); margin-bottom: 4px; scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglets a, .onglets button {
  padding: 10px 14px;
  border: 0;
  background: none;
  color: var(--texte-2);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
}
.onglets .actif { color: var(--accent-fonce); border-bottom-color: var(--accent); }
.onglets-bloc { border-bottom: 0; gap: 4px; padding: 4px; margin-bottom: 2px; background: var(--surface-2); border-radius: 13px; }
.onglets-bloc a { padding: 9px 14px; border-bottom: 0; border-radius: 9px; display: flex; align-items: center; gap: 7px; }
.onglets-bloc a:hover { color: var(--texte); }
.onglets-bloc .actif { background: var(--surface); color: var(--accent-fonce); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.onglets-bloc .point { width: 10px; height: 10px; border-radius: 50%; }

/* ---------- Messages, fenêtres ---------- */

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--barre-bas) + 16px + env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 8px; width: min(92vw, 440px); }
@media (min-width: 960px) { .toasts { bottom: 24px; } }
.toast { padding: 12px 16px; border-radius: 12px; background: #16263a; color: #fff; box-shadow: 0 8px 26px rgba(0, 0, 0, .25); font-size: 14px; transition: opacity .3s, transform .3s; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toast-succes { background: #155c35; }
.toast-erreur { background: #9c241c; }
.toast.sortie { opacity: 0; transform: translateY(8px); }

dialog.dialogue { border: 0; border-radius: 18px; padding: 0; width: min(560px, 94vw); max-height: 92vh; background: var(--surface); color: var(--texte); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog.dialogue.large { width: min(920px, 96vw); }
dialog.dialogue::backdrop { background: rgba(14, 22, 34, .55); }
.dialogue-corps { display: grid; gap: 14px; padding: 18px; }
.dialogue-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialogue-tete h2 { font-size: 18px; }
.dialogue-contenu { display: grid; gap: 12px; }
@media (max-width: 600px) {
  dialog.dialogue { width: 100vw; max-width: 100vw; max-height: 94vh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  dialog.dialogue.large { width: 100vw; }
}

.feuille-menu { display: grid; gap: 4px; }
.feuille-menu a, .feuille-menu button {
  display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 10px; color: var(--texte); text-decoration: none;
  font-weight: 600; border: 0; background: none; width: 100%; text-align: left; cursor: pointer;
}
.feuille-menu a:hover, .feuille-menu button:hover { background: var(--surface-2); }
.feuille-menu .titre-bloc {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 0 10px 4px;
  font-size: 12.5px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--texte-3);
}
.feuille-menu .titre-bloc svg { width: 17px; height: 17px; }
.feuille-menu .titre-bloc:first-child { margin-top: 0; }
.feuille-menu .sous-lien { padding-left: 22px; }
.feuille-menu svg { width: 22px; height: 22px; color: var(--texte-2); }
.feuille-menu .point { width: 12px; height: 12px; border-radius: 50%; margin: 0 5px; }

.grille-saisie { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grille-saisie button {
  display: grid; justify-items: start; gap: 6px; padding: 14px; border-radius: 14px; border: 1px solid var(--bord);
  background: var(--surface); text-align: left; cursor: pointer; min-height: 92px;
}
.grille-saisie button:hover { border-color: var(--accent); background: var(--accent-clair); }
.grille-saisie .avatar { width: 36px; height: 36px; }
.grille-saisie strong { font-size: 14.5px; }
.grille-saisie small { font-size: 12.5px; color: var(--texte-3); }

.vide { color: var(--texte-3); padding: 18px 4px; text-align: center; font-size: 14px; }

/* Alertes du tableau de bord. */
.alertes { display: grid; gap: 8px; }
.alerte { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; background: var(--info-fond); color: var(--texte); text-decoration: none; font-size: 14px; }
.alerte svg { width: 18px; height: 18px; margin-top: 1px; }
.alerte.attention { background: var(--attention-fond); color: var(--attention); }
.alerte.danger { background: var(--danger-fond); color: var(--danger); }

/* Jauges de budget. */
.jauge { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.jauge > span { display: block; height: 100%; border-radius: 99px; background: var(--succes); }
.jauge.attention > span { background: #d9a32a; }
.jauge.depassement > span { background: var(--danger); }

/* ---------- Graphiques ---------- */

.graphique { position: relative; min-height: 120px; }
.graphique svg { display: block; width: 100%; height: auto; }
.graphique .tick { font-size: 11px; fill: var(--texte-3); }
.graphique .valeur { font-size: 12px; font-weight: 700; fill: var(--texte); }
.graphique .zone-survol { fill: transparent; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--texte-2); margin-bottom: 6px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.cle-ligne { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.cle-barre, .cle-point { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cle-point { border-radius: 50%; }
.infobulle { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; box-shadow: var(--ombre); padding: 8px 10px; font-size: 12.5px; min-width: 150px; }
.infobulle .titre { font-weight: 700; margin-bottom: 4px; }
.infobulle .rang { display: flex; align-items: center; gap: 6px; }
.infobulle .rang b { font-variant-numeric: tabular-nums; }
.barres-h { display: grid; gap: 9px; }
.barre-h { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; }
.barre-h-libelle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texte-2); }
.barre-h-piste { height: 12px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.barre-h-marque { display: block; height: 100%; border-radius: 6px; }
.barre-h-valeur { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Saisie rapide des transferts ---------- */

.saisie-rapide { display: grid; gap: 14px; }
.saisie-rapide .montant-principal input { font-size: 30px; text-align: center; min-height: 58px; }
.commission-proposee { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--texte-2); }
.float-rangee { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.float-case { border-radius: 12px; padding: 10px 12px; background: var(--surface-2); border-left: 4px solid var(--bord-fort); }
.float-case .nom { font-size: 12.5px; color: var(--texte-2); font-weight: 650; }
.float-case .solde { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.float-case.bas { background: var(--attention-fond); }

.ecart-zero { color: var(--succes); font-weight: 700; }
.ecart-non-nul { color: var(--danger); font-weight: 700; }

/* ---------- Documents imprimables (factures, états) ---------- */

#zone-impression { display: none; }
body.impression > *:not(#zone-impression) { display: none !important; }
body.impression #zone-impression { display: block; }
.document { background: #fff; color: #142133; font-size: 12.5px; line-height: 1.4; max-width: 800px; margin: 0 auto; padding: 24px; }
.document h1 { font-size: 22px; letter-spacing: .02em; }
.document h2 { font-size: 15px; margin-top: 14px; }
.document .en-tete { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 3px solid; border-image: linear-gradient(120deg, #2c81d4, #50c4b1, #88d58d) 1; padding-bottom: 12px; margin-bottom: 14px; }
.document .en-tete img { width: 70px; height: 70px; }
.document .emetteur { font-size: 11.5px; color: #43536a; }
.document table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.document th { background: #eef3f8; text-align: left; padding: 6px 8px; font-size: 11.5px; }
.document td { padding: 6px 8px; border-bottom: 1px solid #dde4ed; vertical-align: top; }
.document .droite { text-align: right; }
.document .total td { font-weight: 800; background: #eef3f8; }
.document .mentions { font-size: 10.5px; color: #43536a; margin-top: 16px; border-top: 1px solid #dde4ed; padding-top: 8px; }
.document .cachet-fne { border: 1.5px solid #1f9d6b; color: #1a7040; border-radius: 8px; padding: 6px 10px; display: inline-block; font-size: 11px; font-weight: 700; }
.document .filigrane { border: 1.5px dashed #b3261e; color: #b3261e; border-radius: 8px; padding: 6px 10px; display: inline-block; font-size: 11px; font-weight: 700; }
.document .deux { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.document .avertissement { font-size: 10.5px; color: #8a5a00; background: #fdf0d5; padding: 6px 10px; border-radius: 6px; margin-top: 12px; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .document { padding: 0; max-width: none; }
  .document tr { break-inside: avoid; }
}

/* ---------- Divers ---------- */

.noscript { padding: 20px; text-align: center; }
.separateur { height: 1px; background: var(--bord); margin: 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--bord-fort); background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.exclu { opacity: .5; text-decoration: line-through; }
.chip input { display: none; }
.en-ligne-ok { color: var(--succes); }
.ligne-cle { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--bord); font-size: 14px; }
.ligne-cle:last-child { border-bottom: 0; }
.ligne-cle span:first-child { color: var(--texte-2); }
.ligne-cle strong { text-align: right; font-variant-numeric: tabular-nums; }
.etat-financier td.ref { width: 38px; color: var(--texte-3); font-size: 12px; font-weight: 700; }
.bandeau-avertissement { font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--attention-fond); color: var(--attention); display: flex; gap: 8px; align-items: flex-start; }
.bandeau-avertissement svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.cadenas { color: var(--succes); }
kbd { font-family: inherit; font-size: 12px; padding: 1px 6px; border: 1px solid var(--bord-fort); border-radius: 6px; background: var(--surface-2); }

/* Aperçu d'un devis ou d'une facture : réduit pour tenir sur un téléphone. */
.apercu-document { overflow-x: auto; }
.apercu-document .document-cadre { min-width: 500px; }
@media (max-width: 700px) {
  .fiche-document > .colonne { order: -1; }
  .apercu-document .document-cadre { zoom: .64; }
}
