:root {
  --bg: #f4f3ef; --card: #fff; --ink: #0b0b0b; --muted: #6b6862; --line: #e4e2dc;
  --brand: #0b0b0b; --brand-2: #fdf3e9; --accent: #eb8929; --danger: #b42318; --ok: #067647;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
header { background: var(--brand); color: #fff; padding: 10px 24px; border-bottom: 3px solid var(--accent); display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
header h1 { font-size: 18px; margin: 0; letter-spacing: .3px; display: flex; align-items: center; gap: 12px; }
header h1 img { height: 44px; display: block; }
header h1 small { font-weight: 400; color: #bdbab3; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; border-left: 1px solid #3a3a3a; padding-left: 12px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav button { background: transparent; border: 0; color: #fff; opacity: .8; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
nav button:hover { background: rgba(255,255,255,.08); opacity: 1; }
nav button.actif { opacity: 1; color: var(--accent); background: rgba(235,137,41,.12); }
.exercice { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.exercice select { padding: 6px 8px; border-radius: 6px; border: 0; max-width: 100%; }
.exercice { min-width: 0; flex-shrink: 1; }
main { max-width: 1200px; margin: 0 auto; padding: 24px; }
h2 { margin: 0 0 16px; font-size: 20px; }
.barre { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.barre .espace { flex: 1; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
textarea { min-height: 60px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.btn { background: var(--brand); color: #fff; border: 0; padding: 9px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.btn.sec { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #f4c7c3; }
.btn.petit { padding: 5px 9px; font-size: 13px; }
.carte { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi .lib { color: var(--muted); font-size: 13px; }
.kpi .val { font-size: 22px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi.fort { background: var(--brand-2); border-color: #f5d3ad; border-left: 4px solid var(--accent); }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { background: #fafbfc; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 650; background: #fafbfc; }
.vide { text-align: center; color: var(--muted); padding: 32px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: #eef0f3; color: var(--muted); }
.badge.ok { background: #dcfae6; color: var(--ok); } .badge.att { background: #fef0c7; color: #93370d; }
.badge.ko { background: #fee4e2; color: var(--danger); } .badge.bleu { background: #e0eaff; color: #2e47b0; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.modale-fond { position: fixed; inset: 0; background: rgba(16,24,40,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; z-index: 10; }
.modale { background: #fff; border-radius: 12px; width: 100%; max-width: 820px; padding: 22px; }
.modale h3 { margin: 0 0 16px; }
.modale .pied { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.lignes td { padding: 4px; } .lignes input { padding: 6px 8px; }
.note { color: var(--muted); font-size: 13px; }
.total-ligne { text-align: right; font-weight: 650; margin-top: 8px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 20; }
.case { display: flex; align-items: center; gap: 8px; } .case input { width: auto; }
a { color: #c96d12; }
.btn:hover { filter: brightness(1.15); } .btn.sec:hover { filter: none; border-color: var(--accent); }
h2 { font-weight: 650; letter-spacing: -.2px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(235,137,41,.45); border-color: var(--accent); }
.devise { color: var(--muted); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }
@media (max-width: 700px) { main { padding: 14px; } .exercice { margin-left: 0; } table { font-size: 13px; } }
button, input, select, textarea { font-family: inherit; }

/* Comptes et connexion */
.compte { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #bdbab3; }
.compte button { background: transparent; border: 1px solid #3a3a3a; color: #fff; border-radius: 6px; padding: 5px 10px; cursor: pointer; font: inherit; }
.compte button:hover { border-color: var(--accent); color: var(--accent); }
body.deconnecte nav, body.deconnecte .exercice, body.deconnecte .compte { display: none; }
.connexion { max-width: 380px; margin: 60px auto; padding: 28px; display: flex; flex-direction: column; gap: 6px; }
.connexion h2 { margin: 6px 0 8px; }
.connexion label { margin-top: 8px; }
.connexion .btn { margin-top: 14px; padding: 11px; }
.connexion-logo { width: 56px; height: 56px; border-radius: 14px; }
.connexion .erreur { color: var(--danger); min-height: 1.2em; margin: 6px 0 0; font-size: 14px; }
.mdp-boite { position: relative; }
.mdp-boite input { padding-right: 40px; }
.mdp-oeil { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: 0; padding: 4px; color: var(--muted); cursor: pointer; display: flex; border-radius: 6px; }
.mdp-oeil:hover { color: var(--ink); background: var(--bg); }

.choix-fne { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; }
.choix-fne h4 { margin: 0 0 6px; }
@media (max-width: 800px) { .choix-fne { grid-template-columns: 1fr; } }

.connexion .touchid { width: 100%; margin-top: 8px; padding: 11px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.connexion .case { display: flex; gap: 8px; align-items: center; font-size: 14px; }

.profils { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.profil { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.profil:hover { border-color: var(--accent); background: var(--brand-2); }
.profil .ico { font-size: 28px; } .profil b { font-size: 17px; }

/* Téléphone et tablette (version en ligne) */
@media (max-width: 700px) {
  header { padding: 8px 12px; gap: 8px 12px; }
  header h1 img { height: 34px; }
  header h1 small { font-size: 10px; letter-spacing: 2px; padding-left: 8px; }
  nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  nav button { white-space: nowrap; flex: none; padding: 8px 10px; }
  .compte { margin-left: auto; font-size: 12px; }
  .compte button { white-space: nowrap; padding: 4px 8px; }
  .exercice { order: 4; width: 100%; }
  .exercice select { flex: 1; }
  main table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modale-fond { padding: 8px; }
  .modale { padding: 16px; }
  .modale .pied { flex-wrap: wrap; }
  .toast { left: 12px; right: 12px; bottom: 12px; text-align: center; }
  .connexion { margin: 20px auto; padding: 20px; }
  .kpi .val { font-size: 19px; }
  input, select, textarea { font-size: 16px; } /* évite le zoom automatique sur iPhone */
}
