/* Style « Cockpit » (maquette C2 retenue) : fond bleu nuit, police Sora,
   la course vers l'objectif en tête de tableau de bord. */
@font-face { font-family: Sora; src: url(polices/sora-latin-wght-normal.woff2) format('woff2'); font-weight: 100 800; font-display: swap; }
:root {
  color-scheme: dark;
  --fond: #0B1226; --carte: #121B36; --carte-2: #172245; --champ: #0F1730;
  --texte: #E8EDFF; --texte-2: #B7C1E6; --muted: #7D89B5; --trait: rgba(255,255,255,.07); --trait-2: rgba(255,255,255,.12);
  --bleu: #4C7DFF; --cyan: #2BD4F0; --vert: #3DD68C; --rouge: #FF6B70; --ambre: #F5B544; --violet: #9B7BFF;
  --rayon: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--texte); font: 14.5px/1.5 Sora, system-ui, sans-serif; font-variant-numeric: tabular-nums;
  background: radial-gradient(900px 500px at 85% -10%, rgba(76,125,255,.20), transparent 60%), radial-gradient(700px 400px at -10% 30%, rgba(43,212,240,.08), transparent 60%), var(--fond);
  background-attachment: fixed; min-height: 100vh; -webkit-text-size-adjust: 100%;
}
::selection { background: rgba(76,125,255,.4); color: #fff; }
[hidden] { display: none !important; }
h1, h2 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 1.7rem; font-weight: 700; }
h2 { font-size: 1rem; font-weight: 700; }
a { color: var(--cyan); }
.muted { color: var(--muted); margin: 0 0 .6rem; }
.erreur { color: var(--rouge); min-height: 1.2em; margin: .4rem 0 0; }
.note { color: var(--texte-2); font-size: .88rem; margin: .7rem 0 0; }
.num { text-align: right; white-space: nowrap; }
.h { color: var(--vert); } .b { color: var(--rouge); }

/* ---------- contrôles */
.btn { border: 0; border-radius: 12px; padding: .6rem 1rem; font: 600 .9rem Sora, sans-serif; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; }
.btn-primaire { background: var(--bleu); color: #fff; }
.btn-primaire:hover { background: #5E8BFF; }
.btn-secondaire { background: rgba(76,125,255,.16); color: #CFDBFF; }
.btn-secondaire:hover { background: rgba(76,125,255,.26); }
.btn-fantome { background: transparent; color: var(--texte-2); }
.btn-danger { background: rgba(255,107,112,.14); color: #FFB3B6; }
.btn:disabled { opacity: .5; cursor: progress; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
input, select { font: 500 .92rem Sora, sans-serif; color: var(--texte); background: var(--champ); border: 1px solid var(--trait-2); border-radius: 11px; padding: .55rem .75rem; min-height: 42px; width: 100%; }
input::placeholder { color: #5D6894; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--bleu); }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--texte-2); }
label.case { flex-direction: row; align-items: center; gap: .5rem; }
.form-colonne { display: flex; flex-direction: column; gap: .8rem; }
.form-ligne { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-end; }
.form-ligne > label { flex: 1 1 120px; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .8rem; align-items: center; }
.espace { flex: 1; }

/* ---------- connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.connexion-carte { width: min(380px, 100%); display: flex; flex-direction: column; gap: .7rem; text-align: center; }
.connexion-carte label { text-align: left; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--bleu), var(--cyan)); display: grid; place-items: center; font-weight: 800; color: #fff; box-shadow: 0 0 24px rgba(76,125,255,.45); flex: none; }
.connexion-carte .logo { width: 52px; height: 52px; margin: 0 auto .4rem; font-size: 1.3rem; }

/* ---------- en-tête */
.cadre { max-width: 1320px; margin: 0 auto; padding: 22px 28px 60px; }
.entete-app { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.entete-app .titre b { display: block; font-size: 1.02rem; letter-spacing: -.01em; }
.entete-app .titre small { color: var(--muted); font-size: .7rem; letter-spacing: .2em; font-weight: 700; }
.nav { display: flex; gap: 4px; background: rgba(255,255,255,.04); border: 1px solid var(--trait); border-radius: 14px; padding: 4px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .86rem; padding: 8px 14px; border-radius: 10px; display: flex; align-items: center; gap: 7px; }
.nav a svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a.actif { background: var(--carte-2); color: var(--texte); box-shadow: inset 0 0 0 1px rgba(76,125,255,.35); }
.nav a:hover { color: var(--texte); }
#btn-deconnexion { min-height: 38px; padding: .4rem .8rem; }
.entete-page { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 18px; }
.entete-page p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.choix-exercice select { min-width: 150px; }

/* ---------- cartes */
.carte { background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)), var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 20px 22px; min-width: 0; margin-bottom: 18px; }
.entete-carte { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.grille { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 18px; }
.c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }

/* ---------- la course vers l'objectif */
.carte.course { padding: 0; }
.nav .court { display: none; }
.course { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); padding: 0; overflow: hidden; }
.course .texte { padding: 28px 28px 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; background: linear-gradient(180deg, rgba(76,125,255,.10), rgba(76,125,255,0)); }
.course .phrase { font-size: 1.62rem; line-height: 1.28; font-weight: 600; letter-spacing: -.02em; color: var(--texte-2); margin: 0; }
.course .phrase b { color: #fff; font-weight: 700; }
.course .phrase .h, .course .phrase .b { white-space: nowrap; font-weight: 700; }
.course .reste { font-size: .92rem; color: var(--texte-2); }
.course .reste b.gros { color: #fff; font-size: 1.55rem; display: block; letter-spacing: -.02em; margin: 2px 0; }
.course .graph-grand { padding: 18px 18px 10px 0; }
#g-cumul { height: 380px; }

/* ---------- instruments */
.instruments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 4px 0 22px; }
.instruments > div { padding-top: 14px; border-top: 2px solid var(--trait-2); }
.instruments > div:first-child { border-top-color: var(--bleu); }
.instruments .lib { font-size: .84rem; color: var(--muted); font-weight: 500; }
.instruments .chiffre { font-size: 1.8rem; font-weight: 700; letter-spacing: -.03em; margin: 2px 0; }
.instruments .comp { font-size: .8rem; color: var(--muted); }
.evol { font-weight: 800; font-size: .78rem; padding: 2px 7px; border-radius: 7px; margin-right: 6px; white-space: nowrap; }
.evol.hausse { color: var(--vert); background: rgba(61,214,140,.12); }
.evol.baisse { color: var(--rouge); background: rgba(255,107,112,.12); }

/* ---------- alertes */
.alertes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.alerte { display: flex; gap: .7rem; align-items: baseline; padding: .65rem 1rem; border-radius: 12px; font-size: .88rem; background: rgba(76,125,255,.10); border: 1px solid rgba(76,125,255,.25); color: #CFDBFF; }
.alerte.attention { background: rgba(245,181,68,.08); border-color: rgba(245,181,68,.32); color: #F7D9A3; }
.alerte.important { background: rgba(255,107,112,.08); border-color: rgba(255,107,112,.32); color: #FFC9CB; }
.alerte b { white-space: nowrap; color: #fff; }

/* ---------- graphiques */
.graph { width: 100%; height: 290px; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; color: var(--texte-2); margin: 8px 0 2px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.lg-trait { width: 18px; border-top: 3px solid; display: inline-block; border-radius: 2px; }
.lg-trait.fin { border-top-width: 2px; } .lg-trait.pointille { border-top: 2px dashed; }
.lg-bande, .lg-carre { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.vue-tableau summary { cursor: pointer; color: var(--cyan); font-size: .82rem; margin-top: .3rem; }

/* ---------- projection, dépendance */
.lignes { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; font-size: .9rem; color: var(--texte-2); margin-top: 12px; }
.lignes b { color: var(--texte); text-align: right; white-space: nowrap; }
.lignes .total { border-top: 1px solid var(--trait-2); padding-top: 8px; color: #fff; font-weight: 700; }
.encadre { margin-top: 14px; border-radius: 14px; padding: 12px 14px; font-size: .88rem; }
.encadre.manque { background: rgba(255,107,112,.08); border: 1px solid rgba(255,107,112,.25); color: #FFC9CB; }
.encadre.ok { background: rgba(61,214,140,.08); border: 1px solid rgba(61,214,140,.25); color: #BDF3D7; }
.encadre b { color: #fff; }
.gros-pct { font-size: 3.1rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; color: #fff; margin: 12px 0 4px; }
.niveau { font-weight: 800; font-size: .76rem; padding: 3px 10px; border-radius: 7px; white-space: nowrap; }
.niveau.rouge { color: var(--rouge); background: rgba(255,107,112,.12); }
.niveau.orange { color: var(--ambre); background: rgba(245,181,68,.12); }
.niveau.vert { color: var(--vert); background: rgba(61,214,140,.12); }
.bc { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; font-size: .82rem; margin-top: 16px; }
.bc-ex { color: var(--muted); white-space: nowrap; } .bc-ex.sel { color: var(--texte); font-weight: 700; }
.bc-barre { display: flex; height: 22px; border-radius: 6px; overflow: hidden; gap: 2px; background: rgba(255,255,255,.05); }
.bc-barre span { display: flex; align-items: center; padding-left: 7px; font-size: .74rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; }
.leg-clients { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--texte-2); margin-top: 14px; }
.leg-clients span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- tables */
.table-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { border-collapse: collapse; width: 100%; font-size: .86rem; }
.table th { text-align: left; font-size: .76rem; color: var(--muted); font-weight: 600; padding: .55rem .6rem; border-bottom: 1px solid var(--trait-2); white-space: nowrap; }
.table td { padding: .55rem .6rem; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.attenue td { color: var(--muted); }
.table tr.attenue td.barre { text-decoration: line-through; }
.table input { min-height: 36px; padding: .35rem .55rem; }
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 7px; font-size: .74rem; font-weight: 700; background: rgba(255,255,255,.07); color: var(--texte-2); white-space: nowrap; }
.badge.ok { background: rgba(61,214,140,.12); color: var(--vert); }
.badge.ko { background: rgba(255,107,112,.12); color: var(--rouge); }
.badge.info { background: rgba(76,125,255,.16); color: #AFC4FF; }
.lien-bouton { background: none; border: 0; color: var(--cyan); font: 600 .86rem Sora, sans-serif; cursor: pointer; padding: .3rem; }
.filtres { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; align-items: center; }
.filtres input[type=search] { flex: 2 1 220px; }
.filtres select { flex: 1 1 160px; width: auto; }

/* ---------- import */
.depot { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 26px 16px; border: 2px dashed rgba(76,125,255,.35); border-radius: var(--rayon); cursor: pointer; text-align: center; margin-bottom: 18px; background: rgba(76,125,255,.04); }
.depot svg { width: 34px; height: 34px; fill: none; stroke: var(--cyan); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.depot.survol { background: rgba(76,125,255,.14); border-color: var(--bleu); }

/* ---------- jours */
.grille-mois { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.case-mois { background: var(--champ); border-radius: 14px; padding: .65rem .7rem; display: flex; flex-direction: column; gap: .3rem; border: 1px solid var(--trait); }
.case-mois .nom { font-weight: 700; font-size: .85rem; color: var(--texte); }
.case-mois .detail span { white-space: nowrap; }
.case-mois .detail { font-size: .74rem; color: var(--muted); min-height: 1.1em; }
.case-mois.futur { background: repeating-linear-gradient(135deg, rgba(43,212,240,.05) 0 6px, transparent 6px 12px), var(--champ); }
.case-mois.futur .valeur-plan { font-weight: 700; font-size: 1.25rem; color: #fff; }
.case-mois .reprendre { font-size: .74rem; padding: 0; text-align: left; }
.seances { list-style: none; margin: 8px 0 0; padding: 0; max-height: 320px; overflow-y: auto; }
.seances li { display: grid; grid-template-columns: 7.5em 6.5em minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--trait); font-size: .84rem; color: var(--texte-2); }
.seances li b { color: var(--texte); font-weight: 600; }
.seances li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- paramètres */
.ligne-client { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.ligne-client .case { font-size: .78rem; white-space: nowrap; }

/* ---------- dialogue et toast */
.dialogue { border: 1px solid var(--trait-2); border-radius: var(--rayon); padding: 22px; width: min(520px, calc(100% - 32px)); background: var(--carte); color: var(--texte); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.dialogue::backdrop { background: rgba(5, 9, 22, .7); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(150%); background: var(--texte); color: var(--fond); font-weight: 600; padding: .7rem 1.1rem; border-radius: 12px; transition: transform .2s, visibility .2s; z-index: 50; max-width: calc(100% - 32px); visibility: hidden; }
.toast.visible { transform: translateX(-50%) translateY(0); visibility: visible; }

/* ---------- tablette */
@media (max-width: 1100px) {
  .course { grid-template-columns: minmax(0, 1fr); }
  .course .graph-grand { padding: 0 14px 12px; }
  .instruments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c4, .c5, .c6, .c7, .c8 { grid-column: span 12; }
  .nav a span { display: none; }
  .grille-mois { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- téléphone : navigation en bas */
@media (max-width: 640px) {
  .cadre { padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); }
  .entete-app { margin-bottom: 16px; }
  .nav { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); margin: 0; justify-content: space-around; background: rgba(18,27,54,.96); border-radius: 18px; padding: 6px; z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
  .nav a { flex-direction: column; gap: 2px; font-size: .66rem; padding: 6px 4px; flex: 1; }
  .nav a span { display: block; white-space: nowrap; }
  .nav .long { display: none !important; }
  .nav .court { display: block; }
  .nav a svg { width: 21px; height: 21px; }
  #btn-deconnexion { margin-left: auto; }
  h1 { font-size: 1.35rem; }
  .carte { padding: 16px; border-radius: 18px; }
  .course .texte { padding: 20px 18px; }
  .course .phrase { font-size: 1.25rem; }
  #g-cumul { height: 270px; }
  .graph { height: 240px; }
  .instruments { gap: 14px; }
  .instruments .chiffre { font-size: 1.35rem; }
  .gros-pct { font-size: 2.4rem; }
  .grille-mois { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ligne-client { grid-template-columns: 1fr 1fr; }
  .seances li { grid-template-columns: 6.5em minmax(0, 1fr); }
  .seances li span:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
