/* LA BELLE HISTOIRE compta — prototype */
* { box-sizing: border-box; margin: 0; }
body { font: 15px/1.5 "Segoe UI", system-ui, sans-serif; background: #f2f4f8; color: #1c2333; }
main { max-width: 1180px; margin: 18px auto; padding: 0 16px; }
main.center { max-width: 860px; text-align: center; }
h1 { margin: 22px 0 10px; } h2 { margin-bottom: 10px; font-size: 1.15rem; }
h3 { margin: 14px 0 6px; font-size: 1rem; }
.hint, .mini { color: #5b6478; font-size: .85rem; }
code { background: #e9edf5; padding: 1px 5px; border-radius: 4px; }

.topbar { display: flex; align-items: center; gap: 14px; background: #14213d; color: #fff; padding: 9px 16px; flex-wrap: wrap; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 10px; letter-spacing: .06em; }
.brand-logo { height: 40px; width: auto; filter: invert(1) brightness(2); } /* sceau noir → blanc sur bandeau foncé */
.brand-sub { font-weight: 400; opacity: .8; letter-spacing: .12em; text-transform: lowercase; }

/* Écran de connexion — habillage marque */
main.center.login { max-width: 500px; margin-top: 4vh; }
.login .logo { width: 340px; max-width: 80vw; height: auto; margin: 0 auto 10px; display: block; }
.login .wordmark { font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; letter-spacing: .22em;
  color: #14213d; margin-bottom: 4px; }
.login .tagline { font-family: Georgia, serif; letter-spacing: .22em; text-transform: uppercase;
  font-size: .78rem; color: #8a6d3b; margin-bottom: 22px; }
.proto { background: #fca311; color: #14213d; border-radius: 4px; padding: 1px 7px; font-size: .72rem; margin-left: 6px; }
.bandeau { background: #fca311; color: #14213d; border-radius: 6px; padding: 4px 12px; font-size: .9rem; }
.userchip { margin-left: auto; font-size: .88rem; display: flex; gap: 10px; align-items: center; }
.role { opacity: .75; font-size: .8rem; }
.lnk { background: none; border: none; color: #7ea8ff; cursor: pointer; font-size: .85rem; text-decoration: underline; }
.lnk.home { text-decoration: none; border: 1px solid rgba(255,255,255,.35); border-radius: 7px; padding: 3px 10px; color: #fff; }
.lnk.home:hover { background: rgba(255,255,255,.12); }
.bandeau .lnk { color: #14213d; }
.lnk.danger { color: #ff8f8f; } .bandeau ~ .userchip .lnk.danger { color: #ff8f8f; }

.cards { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 18px 0; }
.card { background: #fff; border: 1px solid #dde3ee; border-radius: 12px; padding: 18px; min-width: 210px; cursor: pointer; text-align: center; font: inherit; box-shadow: 0 1px 4px rgba(20,33,61,.06); }
.card:hover { border-color: #fca311; }
.card.user { display: flex; gap: 12px; align-items: center; text-align: left; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #14213d; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.card.module { position: relative; width: 250px; min-height: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
/* Cartes société : TOUTES identiques ; seule la raison sociale adapte sa police */
.card.soc { width: 240px; height: 118px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; overflow: hidden; }
.card.soc .soc-code { font-size: 1.05rem; letter-spacing: .04em; }
.card.soc .soc-rs { line-height: 1.15; max-height: 2.3em; overflow: hidden; }
.micon { font-size: 1.8rem; }
.card.off { opacity: .45; cursor: default; }
.badge { background: #d90429; color: #fff; border-radius: 10px; padding: 0 8px; font-size: .78rem; }
.chip { border: 1px solid #cbd4e4; background: #fff; border-radius: 14px; padding: 3px 12px; cursor: pointer; }
#search { width: 100%; max-width: 480px; padding: 10px 14px; border-radius: 10px; border: 1px solid #cbd4e4; font-size: 1rem; margin-bottom: 8px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 0; }
.tab { border: 1px solid #dde3ee; border-bottom: none; background: #e8ecf4; padding: 8px 16px; border-radius: 9px 9px 0 0; cursor: pointer; font: inherit; }
.tab.on { background: #fff; font-weight: 600; }
.tabbody { background: #fff; border: 1px solid #dde3ee; border-radius: 0 10px 10px 10px; padding: 16px; }
.panel { margin-bottom: 18px; }
.panel + .panel { border-top: 1px solid #e6eaf2; padding-top: 14px; }

.checkrow { display: flex; gap: 14px; align-items: center; padding: 11px; border: 1px solid #e6eaf2; border-radius: 10px; margin-bottom: 9px; }
.checkrow > div:nth-child(2) { flex: 1; }
.cicon { font-size: 1.5rem; }
.balise { font-family: Consolas, monospace; background: #fff8e6; border: 1px dashed #fca311; padding: 6px 12px; border-radius: 6px; margin-top: 5px; display: inline-block; }
.light { border-radius: 14px; padding: 3px 12px; font-size: .85rem; white-space: nowrap; }
.light.green { background: #d8f3dc; color: #1b4332; }
.light.red { background: #ffd7d7; color: #9d0208; }
.launch { margin-top: 14px; display: flex; gap: 12px; align-items: center; }

.btn { border: 1px solid #cbd4e4; background: #fff; border-radius: 8px; padding: 7px 14px; cursor: pointer; font: inherit; }
.btn.primary { background: #14213d; color: #fff; border-color: #14213d; }
.btn.big { font-size: 1.05rem; padding: 11px 26px; }
.btn.off { opacity: .4; cursor: not-allowed; }
.btn.red { background: #ffd7d7; border-color: #e5989b; }
.btn.green { background: #d8f3dc; border-color: #95d5b2; }
.btn.yellow { background: #fff3cd; border-color: #ffd60a; }

.result { border: 1px solid #d8f3dc; background: #f6fff8; border-radius: 10px; padding: 14px; }
.result.warn { border-color: #ffd60a; background: #fffbea; }
.scan1 { color: #40516d; font-style: italic; }
.big-ok { font-size: 1.05rem; margin: 8px 0; }
.warnline { background: #fff3cd; border-radius: 8px; padding: 8px 12px; }

.doute { border: 1px solid #e6eaf2; border-radius: 10px; padding: 12px; margin: 12px 0; }
.doute.anomalie { border-color: #fca311; background: #fffaf0; }
.dmotif { font-weight: 600; margin-bottom: 8px; }
.side { display: flex; gap: 14px; flex-wrap: wrap; }
.fcard { flex: 1; min-width: 260px; border: 1px solid #dde3ee; border-radius: 8px; padding: 10px; background: #fafbfe; }
.fcard.cible { background: #fff8e6; }
.fcard h4 { margin-bottom: 6px; font-size: .9rem; }
.meta td { padding: 2px 8px 2px 0; } .meta td:first-child { color: #5b6478; font-size: .85rem; }
.dbtns { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rectif { display: flex; gap: 6px; align-items: center; }
.rectif input { padding: 6px 10px; border: 1px solid #cbd4e4; border-radius: 7px; width: 300px; }

.tbl { border-collapse: collapse; width: 100%; font-size: .88rem; margin: 8px 0; }
.tbl th { background: #eef1f7; text-align: left; }
.tbl th, .tbl td { border: 1px solid #e2e7f0; padding: 5px 9px; }
.tbl.nowrap th, .tbl.nowrap td { white-space: nowrap; } /* chaque ligne reste sur UNE ligne, le tableau défile horizontalement si besoin */
.tbl tr.st-àcomptabiliser { background: #fffdf2; }
.tbl tr.st-disparu { background: #ffecec; }

.tree { list-style: none; padding-left: 8px; } .tree ul { list-style: none; padding-left: 24px; }
.tree li { padding: 2px 0; }

.lights { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.report { border: 1px solid #dde3ee; border-radius: 10px; padding: 12px; margin-top: 10px; }
.agroup { margin: 8px 0; } .agroup summary { cursor: pointer; }
.agroup ul { margin: 6px 0 8px 22px; } .agroup li.fixed { color: #2d6a4f; text-decoration: line-through; }

#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: 420px; }
.toast { background: #14213d; color: #fff; border-radius: 10px; padding: 11px 15px; box-shadow: 0 4px 14px rgba(0,0,0,.25); animation: pop .25s; }
.toast.warn { background: #9d5b03; }
.toast.learn { background: #3a0ca3; }
@keyframes pop { from { transform: translateY(12px); opacity: 0; } }

/* Textes d'AIDE (notices) : masqués par défaut, bouton ❓ du bandeau pour les afficher */
body.sans-aide .hint, body.sans-aide .aide { display: none; }

/* Puce de filtre par type SÉLECTIONNÉE : foncée (re-clic pour désélectionner) */
.chip.on { background: #14213d; color: #fff; border-color: #14213d; font-weight: 600; }
