:root {
  color-scheme: light;
  --fond: #f4f6f5;
  --encre: #14211e;
  --carte: #ffffff;
  --accent: #08342f;
  --bouton: #08342f;
  --sur-bouton: #ffffff;
  --filet: #8a4e22;
  --ligne: #d5ddd8;
  --erreur: #8d1d18;
  --mention: #3e514c;
  --ombre: 0 10px 28px rgba(16, 32, 30, 0.07);
  --aiguille-nord: #9c2f2f;
  --aiguille-sud: #c4b8a5;
  --rayon: 14px;
  --espace: 16px;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --fond: #101816;
  --encre: #f3f7f4;
  --carte: #1a2421;
  --accent: #9ed9cf;
  --bouton: #9ed9cf;
  --sur-bouton: #10211e;
  --filet: #e2b48a;
  --ligne: #2c3a36;
  --erreur: #ffb4ab;
  --mention: #c5d0cb;
  --ombre: none;
  --aiguille-nord: #e07a72;
  --aiguille-sud: #8d8274;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="systeme"] {
    color-scheme: dark;
    --fond: #101816;
    --encre: #f3f7f4;
    --carte: #1a2421;
    --accent: #9ed9cf;
    --bouton: #9ed9cf;
    --sur-bouton: #10211e;
    --filet: #e2b48a;
    --ligne: #2c3a36;
    --erreur: #ffb4ab;
    --mention: #c5d0cb;
    --aiguille-nord: #e07a72;
    --aiguille-sud: #8d8274;
  }
}
body { margin: 0; background: var(--fond); color: var(--encre); }
.barre, main { max-width: 1100px; margin: 0 auto; padding: var(--espace); }
.barre { display: flex; gap: 16px 24px; align-items: center; flex-wrap: wrap; }
nav { display: flex; gap: 16px; flex-wrap: wrap; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; }
nav a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 3px; }
h1, h2 { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-weight: 500; letter-spacing: -0.02em; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--espace); }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 20px; }
.etroite { max-width: 420px; }
label { display: block; margin: 12px 0; }
input, select { width: 100%; box-sizing: border-box; padding: 10px 12px; margin-top: 4px; font: inherit; color: var(--encre); background: var(--fond); border: 1px solid var(--ligne); border-radius: 8px; }
button { background: var(--bouton); color: var(--sur-bouton); border: 2px solid var(--encre); border-radius: 8px; padding: 8px 14px; font: inherit; cursor: pointer; }
button.secondaire { background: transparent; color: var(--encre); }
.erreur { color: var(--erreur); border: 1px solid var(--erreur); border-left-width: 4px; padding: 8px 12px; background: var(--carte); }
.erreur::before { content: "! "; font-weight: 700; }
:focus-visible { outline: 3px solid var(--filet); outline-offset: 2px; }
.qr { display: block; width: 220px; height: 220px; background: #fff; padding: 8px; margin: 8px 0 12px; }
.mention { color: var(--mention); font-size: 0.9rem; }
.chiffre { font-size: 2rem; margin: 0; }
.entete-bord { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 20px; }
.entete-bord h1 { margin-top: 8px; }
.compas { margin: 0; width: max-content; }
.compas svg { width: 96px; height: 96px; display: block; margin: 0 auto; }
.cadran { fill: var(--carte); stroke: var(--ligne); stroke-width: 1.25; }
.anneau { fill: none; stroke: var(--ligne); stroke-width: 0.75; }
.reperes { stroke: var(--mention); stroke-width: 1.25; stroke-linecap: round; }
.lettre-nord { fill: var(--encre); font-size: 11px; font-family: Georgia, "Iowan Old Style", serif; }
.aiguille {
  transform-box: view-box;
  transform-origin: center;
  transform: rotate(var(--compas, 0deg));
  transition: transform 0.7s ease;
}
.pointe-nord { fill: var(--aiguille-nord); }
.pointe-sud { fill: var(--aiguille-sud); }
.pivot { fill: var(--encre); }
.pivot-centre { fill: var(--carte); }
.compas figcaption {
  margin: 6px 0 0;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mention);
  white-space: nowrap;
}
.manques { list-style: none; margin: 8px 0 0; padding: 0; text-align: center; font-size: 0.8rem; color: var(--mention); }
table { width: 100%; border-collapse: collapse; background: var(--carte); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--ligne); }
.mono { font-family: ui-monospace, monospace; word-break: break-all; }
.sous-onglets { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sous-onglets a[aria-current="page"] { font-weight: 700; }
.pastille {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--ligne);
  background: var(--carte);
}
.pastille.vert { background: #1f7a4d; color: #fff; }
.pastille.orange { background: #a15c07; color: #fff; }
.pastille.rouge { background: #8d1d18; color: #fff; }
.pastille.gris { background: var(--ligne); color: var(--encre); }
.pastille.perime {
  color: var(--encre);
  background: repeating-linear-gradient(45deg, var(--ligne), var(--ligne) 4px, var(--carte) 4px, var(--carte) 8px);
}
html[data-theme="dark"] .pastille.vert { background: #7dcea0; color: #14261c; }
html[data-theme="dark"] .pastille.orange { background: #f0c27a; color: #2a2112; }
html[data-theme="dark"] .pastille.rouge { background: #ffb4ab; color: #3b0907; }
.icone { width: 1.1rem; height: 1.1rem; vertical-align: text-bottom; }
.barre { display: inline-block; width: 6rem; height: 0.55rem; background: var(--ligne); border-radius: 999px; vertical-align: middle; overflow: hidden; }
.barre > span { display: block; height: 100%; background: var(--encre); }
.exports { display: flex; gap: 12px; }
.filtres { display: flex; gap: 8px; align-items: end; }
.filtres input { width: auto; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
header.barre {
  display: flex;
  width: auto;
  max-width: none;
  height: auto;
  margin: 0;
  padding: 12px 24px;
  background: var(--carte);
  border: 0;
  border-bottom: 3px solid var(--filet);
  border-radius: 0;
  box-sizing: border-box;
  align-items: center;
  gap: 16px 24px;
  flex-wrap: wrap;
  overflow: visible;
  vertical-align: baseline;
}
.marque-lien { display: inline-flex; align-items: center; gap: 10px; color: var(--encre); text-decoration: none; font-weight: 700; }
.logo-puce { display: inline-flex; background: #fff; border: 1px solid var(--ligne); border-radius: 10px; padding: 3px 8px; }
.logo { height: 36px; width: auto; display: block; }
body.auth main.auth-main { max-width: none; margin: 0; padding: 0; }
.auth-scene { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 1.15fr) minmax(320px, 0.9fr); }
.auth-visuel { position: relative; min-height: 280px; background: #071311; }
.auth-visuel .oeil { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
.plaque {
  position: absolute;
  left: 24px;
  bottom: 24px;
  display: flex;
  gap: 14px;
  align-items: center;
  max-width: calc(100% - 48px);
  background: #fff;
  color: #10211e;
  border-radius: 16px;
  padding: 10px 20px 10px 12px;
}
.plaque .logo { height: 56px; flex-shrink: 0; }
.marque-lockup {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid rgba(16, 33, 30, 0.18);
}
.marque-produit, .marque-kicker { margin: 0; color: #10211e; }
.marque-produit {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.marque-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
}
.auth-panneau { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--fond); }
.auth-carte { width: min(480px, 100%); }
.auth-carte h1 { margin-top: 0; }
.auth-carte form + form { margin-top: 16px; }
.vide, .annonce { border: 1px solid var(--encre); background: var(--carte); padding: 12px 14px; }
.vide { border-style: dashed; }
.prose { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 8px 20px 16px; }
.prose a { text-decoration: underline; }
.grille-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 4px 16px; align-items: end; }
.actions form { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
td .barre { padding: 0; margin: 4px 0 0; max-width: 6rem; }
main { overflow-x: auto; }
td a { display: inline-block; padding: 4px 0; }
@media (max-width: 860px) {
  .auth-scene { grid-template-columns: 1fr; }
  .auth-visuel { min-height: 240px; }
}
.compteur { margin-left: 6px; }
.carte-alerte { margin-bottom: 12px; }
.spark { width: 100%; max-width: 18rem; height: 3.2rem; display: block; }
.spark .seuil { stroke: var(--mention); stroke-dasharray: 3 3; }
.spark .c1 { stroke: var(--mention); fill: none; }
.spark .c5 { stroke: var(--encre); fill: none; }
.spark .c15 { stroke: var(--filet); fill: none; }
.alerte-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-top: 8px; }
.alerte-actions form { display: flex; gap: 8px; align-items: end; margin: 0; }
.module-finance { display: grid; grid-template-columns: 14rem 1fr; gap: 24px; align-items: start; }
.finance-nav { display: flex; flex-direction: column; gap: 8px; }
.finance-nav a[aria-current="page"] { font-weight: 700; }
.finance-entete, .finance-filtres { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; }
.finance-filtres label { margin: 0; min-width: 10rem; }
.montant-credit { color: #0b6b3a; font-variant-numeric: tabular-nums; }
.montant-debit { color: #8d1d18; font-variant-numeric: tabular-nums; }
html[data-theme="dark"] .montant-credit { color: #8ee0b0; }
html[data-theme="dark"] .montant-debit { color: #ffb4ab; }
.spark-solde { width: 100%; height: 2.4rem; }
.spark-solde polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.bandeau-finance { border: 2px solid var(--filet); background: var(--carte); padding: 8px 12px; }
.piece img { max-width: 240px; background: #fff; }
.palette { border: 1px solid var(--ligne); background: var(--carte); color: var(--encre); width: min(32rem, 100%); }
@media (max-width: 720px) {
  .module-finance { grid-template-columns: 1fr; }
  .finance-nav { flex-direction: row; flex-wrap: wrap; }
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
  .table-wrap thead { position: absolute; left: -9999px; }
}
.fiche360 { display: flex; flex-direction: column; gap: 28px; }
.fiche360-ages { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 0 0 12px; }
.fiche360-ages li { border: 1px solid var(--ligne); background: var(--carte); padding: 8px 12px; min-width: 7rem; }
.fiche360-ages a { font-variant-numeric: tabular-nums; }
.fiche-volet { border: 1px solid var(--ligne); background: var(--carte); padding: 12px; }
.fiche-volet iframe { width: 100%; min-height: 24rem; border: 0; background: var(--fond); }
.fiche-probable { display: inline-block; margin-left: 8px; font-size: 0.85rem; }
.fiche360 textarea { width: min(40rem, 100%); min-height: 5rem; }
.badge-simulation { display: inline-block; border: 1px solid var(--encre); font-weight: 700; letter-spacing: 0.04em; padding: 0 0.35em; background: var(--carte); }
.simulation-hachure { background-image: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(138, 78, 34, 0.35) 4px, rgba(138, 78, 34, 0.35) 6px); }
html[data-theme="dark"] .simulation-hachure { background-image: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(226, 180, 138, 0.45) 4px, rgba(226, 180, 138, 0.45) 6px); }
.bandeau-scenario { border: 2px solid var(--encre); background: var(--carte); padding: 8px 12px; font-weight: 700; }
.kanban { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; }
.colonne-kanban { min-width: 16rem; flex: 1; }
.carte-dossier { border: 1px solid var(--ligne); background: var(--carte); padding: 12px; margin: 0 0 12px; }
.cashplan { max-width: 100%; }
.cashplan th, .cashplan td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.segment-journalier { background: var(--carte); }
.segment-mensuel { background: var(--fond); box-shadow: inset 3px 0 0 var(--filet); }
.segment-annuel { background: var(--carte); box-shadow: inset 3px 0 0 var(--encre); }
.partiel { font-style: italic; }
.ferie { color: var(--mention); }
.negatif { color: var(--erreur); font-weight: 700; }
.graphique-tresorerie { width: 100%; height: 8rem; background: var(--carte); border: 1px solid var(--ligne); }
.graphique-tresorerie .panneau { fill: transparent; stroke: var(--ligne); }
.serie-reel { fill: none; stroke: var(--encre); stroke-width: 1.4; }
.serie-simulation { fill: none; stroke: var(--filet); stroke-width: 1.4; stroke-dasharray: 3 2; }
.timeline { list-style: none; padding: 0; }
.synthese { border-bottom: 3px solid var(--filet); margin-bottom: 16px; }
@media (max-width: 720px) {
  .kanban { flex-direction: column; }
  .tresorerie .graphique-tresorerie { height: 6rem; }
}
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.pied {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: baseline;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px var(--espace) 24px;
  color: var(--mention);
  font-size: 0.85rem;
  border-top: 1px solid var(--ligne);
}
.pied p { margin: 0; }
.pied-sha { font-family: ui-monospace, monospace; }
.pied a { color: var(--mention); }
.preferences {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.preferences a { color: var(--mention); text-decoration: none; }
.preferences a[aria-current="true"] { color: var(--encre); font-weight: 700; text-decoration: underline; }
.auth-preferences {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: flex-end;
  width: min(480px, 100%);
  margin: 0 0 12px;
}
body.auth .pied { max-width: none; margin: 0; padding: 12px 24px 20px; }
.recherche-barre { position: relative; flex: 1 1 16rem; min-width: 12rem; }
.recherche-barre input { margin: 0; }
.recherche-panneau { position: absolute; z-index: 5; top: 4.5rem; right: var(--espace); width: min(32rem, calc(100% - 2rem)); background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); box-shadow: var(--ombre); }
.recherche-panneau:empty { display: none; }
.annuaire-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--espace); }
.avatar { width: 3rem; height: 3rem; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: var(--sur-bouton); font-weight: 700; margin: 0; }
.actions-contact { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-contact .bouton-action, .fiche-personne .bouton-action { display: inline-block; background: var(--bouton); color: var(--sur-bouton); border: 2px solid var(--encre); border-radius: 8px; padding: 8px 14px; text-decoration: none; }
.fiche-personne dl { display: grid; grid-template-columns: 10rem 1fr; gap: 8px 12px; }
.fiche-personne dt { color: var(--mention); }
.fiche-personne dd { margin: 0; }
header.barre { position: relative; }
@media (max-width: 720px) {
  .annuaire-cartes { grid-template-columns: 1fr; }
  .actions-contact .bouton-action, .actions-contact button { display: block; width: 100%; text-align: center; padding: 14px; font-size: 1.05rem; }
  .fiche-personne dl { grid-template-columns: 1fr; }
}
