@font-face { font-family: "Rajdhani"; font-weight: 500; font-display: swap; src: url("fonts/rajdhani-500.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 600; font-display: swap; src: url("fonts/rajdhani-600.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 700; font-display: swap; src: url("fonts/rajdhani-700.woff2") format("woff2"); }

:root {
  --marine: #23272b; --marine2: #32373d; --marine3: #434a52;
  --rouge: #ae0018; --acier: #596069; --ciel: #ced3d9;
  --fond: #f0f1f3; --trait: #e5e7eb; --texte: #111827; --doux: #6b7280;
  --vert: #0f8a5f; --ambre: #c98a06;
  --gris1: #23272b; --gris2: #32373d; --gris3: #434a52;
  --titre: "Rajdhani", "Helvetica Neue", Arial, sans-serif;
  --corps: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --rayon: 14px;
  --ombre: 0 1px 2px rgba(35,39,43,.06), 0 8px 24px rgba(35,39,43,.06);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--corps); font-size: 14px; }
a { color: var(--acier); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--titre); font-weight: 700; color: var(--marine); letter-spacing: .03em; }

/* Bandeau */
.bandeau { --clair: #ced3d9;
           background: linear-gradient(100deg, var(--gris1) 0%, var(--gris2) 60%, var(--gris3) 100%);
           color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 6px 24px rgba(30,34,38,.22); }
.bandeau::after { content: ""; display: block; height: 3px; background: var(--rouge); }
.bandeau .in { display: flex; align-items: center; gap: 18px; height: 70px; padding: 0 26px; }
.bandeau .marque img { height: 34px; filter: brightness(0) invert(1); }
.bandeau .appli { font-family: var(--titre); font-weight: 700; font-size: 20px; letter-spacing: .14em;
                  text-transform: uppercase; line-height: 1; }
.bandeau .appli small { display: block; font-size: 11px; letter-spacing: .1em; color: var(--clair); font-weight: 600; margin-top: 4px; }
.bandeau .sep { width: 1px; height: 36px; background: rgba(255,255,255,.18); }
.bandeau nav { display: flex; gap: 2px; }
.bandeau nav a { color: rgba(255,255,255,.78); font-family: var(--titre); font-weight: 600; font-size: 16px;
                 letter-spacing: .08em; text-transform: uppercase; padding: 8px 13px; border-radius: 8px; }
.bandeau nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.bandeau nav a.on { color: #fff; background: rgba(255,255,255,.14); }
.bandeau .identite { margin-left: auto; display: flex; align-items: center; gap: 11px;
                     background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
                     border-radius: 999px; padding: 6px 14px 6px 6px; }
.bandeau .identite .jeton { width: 34px; height: 34px; border-radius: 50%; background: var(--rouge); color: #fff;
                            font-family: var(--titre); font-weight: 700; font-size: 14px; letter-spacing: .06em;
                            display: flex; align-items: center; justify-content: center; flex: none; }
.bandeau .identite .qui { display: flex; flex-direction: column; line-height: 1.15; }
.bandeau .identite .qui strong { font-family: var(--titre); font-weight: 700; font-size: 15px;
                                 letter-spacing: .04em; color: #fff; }
.bandeau .identite .qui small { font-size: 11px; color: var(--clair); letter-spacing: .04em; }
.bandeau .identite .tva { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; color: var(--clair);
                          background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.14);
                          border-radius: 999px; padding: 4px 9px; white-space: nowrap; }

main { padding: 26px 28px 60px; max-width: 1500px; margin: 0 auto; }
h1 { font-size: 26px; margin: 0 0 2px; text-transform: uppercase; letter-spacing: .05em; }
h2 { font-size: 16px; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .06em; }
.sub { color: var(--doux); margin: 0 0 18px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head .sub { margin: 0; }
.surtitre { font-family: var(--titre); font-weight: 700; font-size: 12px; letter-spacing: .18em;
            text-transform: uppercase; color: var(--rouge); }

.card { background: #fff; border-radius: var(--rayon); box-shadow: var(--ombre); padding: 20px 22px; margin-bottom: 18px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); }
.g21 { grid-template-columns: 2fr 1fr; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: #fff; border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px 18px; }
.kpi .l { font-family: var(--titre); font-size: 13px; font-weight: 700; text-transform: uppercase;
          letter-spacing: .1em; color: var(--acier); }
.kpi .v { font-family: var(--titre); font-size: 34px; font-weight: 700; color: var(--marine); line-height: 1.05; margin-top: 4px; }
.kpi .s { font-size: 12.5px; color: var(--doux); margin-top: 2px; }
.kpi.dark { background: linear-gradient(140deg, var(--gris1) 0%, var(--gris2) 70%, var(--gris3) 100%); }
.kpi.dark .l { color: #ced3d9; } .kpi.dark .v { color: #fff; } .kpi.dark .s { color: #a9b0b8; }
.kpi.alert .v { color: var(--rouge); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-family: var(--titre); font-size: 13px; font-weight: 700; text-transform: uppercase;
     letter-spacing: .06em; color: var(--acier); padding: 10px 12px; border-bottom: 1px solid var(--trait); }
td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
tr:hover td { background: #f9fafb; }
.r { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--doux); font-size: 12.5px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.empty { text-align: center; color: var(--doux); padding: 26px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 9px; border: 0;
       background: var(--marine); color: #fff; font-family: var(--titre); font-size: 15px; font-weight: 700;
       letter-spacing: .06em; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--marine2); text-decoration: none; color: #fff; }
.btn.gold { background: var(--rouge); } .btn.gold:hover { background: #d11a33; }
.btn.ghost { background: #fff; color: var(--marine); box-shadow: inset 0 0 0 1px var(--trait); }
.btn.ghost:hover { background: #f9fafb; color: var(--marine); }
.btn.danger { background: #fff; color: var(--rouge); box-shadow: inset 0 0 0 1px #f0d2d6; }
.btn.danger:hover { background: #fff5f6; color: var(--rouge); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

label { display: block; font-family: var(--titre); font-size: 13px; font-weight: 600; letter-spacing: .05em;
        text-transform: uppercase; color: var(--acier); margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--trait);
                          border-radius: 9px; background: #fff; color: var(--texte); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acier); box-shadow: 0 0 0 3px rgba(67,100,136,.15); }
textarea { resize: vertical; min-height: 60px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.fields .wide { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; font-family: var(--corps); font-weight: 500;
         text-transform: none; letter-spacing: 0; color: var(--texte); font-size: 13.5px; }
.check input { width: auto; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-family: var(--titre); font-size: 12px;
         font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.b-Brouillon { background: #f0f1f3; color: #6b7280; }
.b-Émise { background: #fdf3e0; color: var(--ambre); }
.b-Payée { background: #e3f4ec; color: var(--vert); }
.b-Annulée { background: #fbe9eb; color: var(--rouge); }
.b-late { background: var(--rouge); color: #fff; }

.statut-f { display: inline-block; margin: 0; }
.statut { appearance: none; -webkit-appearance: none; border: 1px solid transparent; cursor: pointer;
          font-family: var(--titre); font-size: 12px; font-weight: 700; letter-spacing: .06em;
          text-transform: uppercase; border-radius: 20px; padding: 4px 26px 4px 11px; width: auto;
          background-repeat: no-repeat; background-position: right 9px center; background-size: 9px 6px; }
.statut:focus { outline: none; box-shadow: 0 0 0 3px rgba(35,39,43,.12); }
.statut.s-Brouillon { background-color: #f0f1f3; color: #6b7280; border-color: #e2e4e7;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 6'%3E%3Cpath fill='%236b7280' d='M0 0h9L4.5 6z'/%3E%3C/svg%3E"); }
.statut.s-Émise { background-color: #fdf3e0; color: var(--ambre); border-color: #f3e3c4;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 6'%3E%3Cpath fill='%23c98a06' d='M0 0h9L4.5 6z'/%3E%3C/svg%3E"); }
.statut.s-Payée { background-color: #e3f4ec; color: var(--vert); border-color: #c6e6d6;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 6'%3E%3Cpath fill='%230f8a5f' d='M0 0h9L4.5 6z'/%3E%3C/svg%3E"); }
.statut.s-Annulée { background-color: #fbe9eb; color: var(--rouge); border-color: #f0d2d6;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 6'%3E%3Cpath fill='%23ae0018' d='M0 0h9L4.5 6z'/%3E%3C/svg%3E"); }

.flash { padding: 11px 16px; border-radius: 10px; margin-bottom: 16px; background: #e3f4ec; color: var(--vert);
         box-shadow: inset 0 0 0 1px #c6e6d6; }
.flash.err { background: #fbe9eb; color: var(--rouge); box-shadow: inset 0 0 0 1px #f0d2d6; }

/* Calendrier */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-radius: var(--rayon); overflow: hidden;
       background: #fff; box-shadow: var(--ombre); }
.cal .dh { background: var(--marine); color: var(--ciel); text-align: center; padding: 9px;
           font-family: var(--titre); font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cal .d { min-height: 104px; border-right: 1px solid #f3f4f6; border-bottom: 1px solid #f3f4f6; padding: 6px;
          cursor: pointer; position: relative; }
.cal .d:hover { background: #f9fafb; }
.cal .d.out { background: #fafbfc; color: #bfc3c8; cursor: default; }
.cal .d.we { background: #f8f9fa; }
.cal .d.has { background: #f4f5f7; }
.cal .d .n { display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center;
             font-family: var(--titre); font-weight: 700; font-size: 15px; }
.cal .d.today .n { background: var(--rouge); color: #fff; border-radius: 50%; }
.cal .d .add { position: absolute; right: 8px; top: 6px; font-size: 20px; color: var(--acier); opacity: 0; font-weight: 700; }
.cal .d:hover .add { opacity: .5; }
.chip { display: block; position: relative; margin-top: 5px; padding: 4px 22px 4px 9px; border-radius: 7px;
        font-size: 12px; line-height: 1.3; background: #eef0f2; border-left: 4px solid var(--marine);
        color: var(--texte); cursor: pointer; overflow: hidden; }
.chip:hover { filter: brightness(.97); }
.chip .t { font-family: var(--titre); font-weight: 700; letter-spacing: .04em; }
.chip .q { font-family: var(--titre); font-weight: 700; }
.chip .x { color: var(--doux); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .kill { position: absolute; right: 5px; top: 3px; color: var(--doux); font-size: 11px; opacity: 0; }
.chip:hover .kill { opacity: 1; }
.chip .st { float: right; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.chip .st.s-Brouillon { color: var(--doux); } .chip .st.s-Émise { color: var(--ambre); } .chip .st.s-Payée { color: var(--vert); }
.chip.paye { opacity: .58; }
.mode { display: inline-flex; border-radius: 9px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--trait); background: #fff; }
.mode button { border: 0; background: #fff; padding: 9px 16px; font-family: var(--titre); font-size: 15px;
               font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--acier); cursor: pointer; }
.mode button.on { background: var(--marine); color: #fff; }
.recap .l { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.hint { font-size: 13px; color: var(--doux); line-height: 1.6; }

/* Fenêtre */
.modal { position: fixed; inset: 0; background: rgba(35,39,43,.55); display: none; align-items: center;
         justify-content: center; z-index: 60; padding: 20px; }
.modal.open { display: flex; }
.modal .box { background: #fff; border-radius: var(--rayon); width: 580px; max-width: 100%; max-height: 92vh;
              overflow: auto; padding: 24px 26px; }

/* Facture */
.lines td { padding: 5px 4px; border: 0; }
.lines input, .lines textarea, .lines select { padding: 7px 9px; font-size: 13px; }
.lines textarea { min-height: 36px; }
.totals { margin-left: auto; width: 360px; }
.totals td { padding: 7px 10px; }
.totals tr.big td { background: var(--marine); color: #fff; font-family: var(--titre); font-weight: 700; font-size: 18px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.bars .m { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .pair { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.bars .b { width: 42%; max-width: 20px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b.ca { background: var(--marine); } .bars .b.ex { background: #cdd1d6; }
.bars .lb { font-family: var(--titre); font-weight: 600; font-size: 12px; color: var(--acier); text-transform: uppercase; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--doux); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

@media (max-width: 1100px) { .g2, .g3, .g21 { grid-template-columns: 1fr; } }
@media (max-width: 1150px) { .bandeau .identite .tva { display: none; } }
@media (max-width: 800px) { .bandeau .in { height: auto; flex-wrap: wrap; padding: 12px 16px; } .bandeau .identite { margin-left: 0; } main { padding: 16px; } }
@media print { .bandeau, .noprint { display: none !important; } }

.banque { border: 1px solid var(--trait); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fafbfc; }

/* Comptes : lien de déconnexion dans le bandeau, page de connexion */
.bandeau .identite .sortie { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; color: var(--clair);
                             border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 4px 9px;
                             white-space: nowrap; text-decoration: none; }
.bandeau .identite .sortie:hover { color: #fff; background: rgba(255,255,255,.10); }
.connexion { max-width: 400px; margin: 70px auto 0; }

/* Accueil : choix de l'interface */
.choix-comptes { display: grid; gap: 10px; margin-top: 14px; }
.choix { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--trait);
         border-radius: 12px; text-decoration: none; color: inherit; background: #fafbfc; }
.choix:hover { border-color: var(--or, #b8975a); background: #fff; }
.choix .jeton { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
                color: #fff; background: #1d2b44; font-size: 13px; }

/* ───────── Budget : lecture visuelle plutôt que tableur ───────── */
.bud-hero { display: grid; grid-template-columns: 220px 1fr; gap: 26px; align-items: center; }
.anneau { position: relative; width: 200px; height: 200px; }
.anneau svg { transform: rotate(-90deg); }
.anneau .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
               justify-content: center; text-align: center; }
.anneau .pc { font-family: var(--titre); font-weight: 700; font-size: 40px; line-height: 1; color: var(--marine); }
.anneau .lb { font-size: 12px; color: var(--doux); margin-top: 4px; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.tuile { background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: var(--ombre); }
.tuile .l { font-family: var(--titre); font-size: 12.5px; font-weight: 700; letter-spacing: .09em;
            text-transform: uppercase; color: var(--acier); }
.tuile .v { font-family: var(--titre); font-size: 27px; font-weight: 700; color: var(--marine); line-height: 1.1; margin-top: 2px; }
.tuile .s { font-size: 12px; color: var(--doux); }
.tuile.vert .v { color: var(--vert); } .tuile.rouge .v { color: var(--rouge); } .tuile.ambre .v { color: var(--ambre); }

.barres-cat { display: flex; flex-direction: column; gap: 10px; }
.barre-cat { display: grid; grid-template-columns: 150px 1fr 90px; gap: 12px; align-items: center; cursor: pointer; }
.barre-cat .nom { font-family: var(--titre); font-weight: 700; font-size: 13.5px; letter-spacing: .05em;
                  text-transform: uppercase; color: var(--marine); }
.barre-cat .piste { height: 14px; border-radius: 8px; background: #eef0f3; overflow: hidden; }
.barre-cat .piste i { display: block; height: 100%; border-radius: 8px; background: var(--marine); }
.barre-cat .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.barre-cat.off { opacity: .45; }

.ech-liste { display: flex; flex-direction: column; gap: 8px; }
.ech-ligne { display: grid; grid-template-columns: 44px 1fr 150px auto; gap: 14px; align-items: center;
             padding: 12px 14px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--trait); }
.ech-ligne:hover { box-shadow: inset 0 0 0 1px var(--acier); }
.ech-ligne.paye { background: #f6f8f7; box-shadow: inset 0 0 0 1px #dfe9e3; }
.ech-ligne.paye .titre { text-decoration: line-through; color: var(--doux); }
.ech-jour { width: 44px; height: 44px; border-radius: 12px; background: var(--marine); color: #fff;
            display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ech-jour b { font-family: var(--titre); font-size: 18px; line-height: 1; }
.ech-jour span { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.ech-ligne.paye .ech-jour { background: var(--vert); }
.ech-ligne.retard .ech-jour { background: var(--rouge); }
.titre { font-weight: 600; }
.ech-meta { font-size: 12px; color: var(--doux); }
.ech-montant { text-align: right; font-family: var(--titre); font-weight: 700; font-size: 19px; color: var(--marine); }
.mini-piste { height: 6px; border-radius: 4px; background: #eef0f3; margin-top: 5px; overflow: hidden; }
.mini-piste i { display: block; height: 100%; background: var(--ambre); }
.pastille { display: inline-block; padding: 2px 9px; border-radius: 999px; font-family: var(--titre);
            font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
            background: #eef1f5; color: var(--acier); }

.graph { width: 100%; height: 230px; }
.graph .mois { font-size: 10px; fill: var(--doux); }
.legende { display: flex; gap: 18px; font-size: 12.5px; color: var(--doux); margin-top: 8px; }
.legende i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.jauge-dette { height: 10px; border-radius: 6px; background: #eef0f3; overflow: hidden; margin-top: 6px; }
.jauge-dette i { display: block; height: 100%; background: var(--vert); }

.frise { position: relative; padding-left: 26px; }
.frise::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--trait); }
.frise .etape { position: relative; padding: 10px 0; }
.frise .etape::before { content: ""; position: absolute; left: -23px; top: 16px; width: 12px; height: 12px;
                        border-radius: 50%; background: var(--marine); box-shadow: 0 0 0 3px #fff; }
.frise .etape.passe::before { background: var(--trait); }
.frise .etape .q { font-family: var(--titre); font-weight: 700; font-size: 17px; color: var(--marine); float: right; }

details.bloc { background: #fff; border-radius: var(--rayon); box-shadow: var(--ombre); padding: 0 22px; margin-bottom: 18px; }
details.bloc > summary { list-style: none; cursor: pointer; padding: 18px 0; font-family: var(--titre);
                         font-weight: 700; font-size: 16px; letter-spacing: .06em; text-transform: uppercase;
                         color: var(--marine); display: flex; align-items: center; gap: 10px; }
details.bloc > summary::-webkit-details-marker { display: none; }
details.bloc > summary::after { content: "+"; margin-left: auto; font-size: 20px; color: var(--acier); }
details.bloc[open] > summary::after { content: "−"; }
details.bloc > div, details.bloc > form, details.bloc > table { margin-bottom: 20px; }
@media (max-width: 900px) { .bud-hero { grid-template-columns: 1fr; } .ech-ligne { grid-template-columns: 44px 1fr; } }
