@font-face { font-family: "Bebas Neue"; src: url("/fonts/bebas-neue-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Barlow"; font-weight: 500; src: url("/fonts/barlow-latin-500-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Barlow"; font-weight: 700; src: url("/fonts/barlow-latin-700-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-display: swap; }

/* Charte Mudo Kwan Challandais */
:root {
  --rouge: #c50c30;
  --rouge-clair: #fbe7eb;
  --bleu: #003478;
  --bleu-nuit: #00214d;
  --bleu-clair: #e6edf6;
  --gris: #a6b8ba;
  --gris-fonce: #211c1c;
  --orange: #fca508;
  --orange-clair: #fff3d9;
  --papier: #f2f4f6;
  --carte: #ffffff;
  --encre: #14202e;
  --encre-douce: #5a6874;
  --ligne: #dbe2e6;

  --titre: "Bebas Neue", Impact, sans-serif;
  --texte: "Barlow", system-ui, sans-serif;
  --etiquette: "Barlow Condensed", "Barlow", sans-serif;

  --rayon: 4px;
  --ombre: 0 1px 0 rgba(0, 33, 77, .06), 0 8px 24px -12px rgba(0, 33, 77, .25);
  --rapide: 150ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--papier); color: var(--encre); font: 500 16px/1.45 var(--texte); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- En-tête ---------- */
.entete { background: linear-gradient(160deg, var(--bleu) 0%, var(--bleu-nuit) 100%); color: #fff; position: relative; overflow: hidden; }
.entete::after { content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle at 50% 30%, rgba(197, 12, 48, .55), rgba(197, 12, 48, 0) 70%); pointer-events: none; }
.entete-haut { max-width: 1180px; margin: 0 auto; padding: 18px 20px 6px; display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.entete-haut img { width: 96px; margin-left: -10px; }
.entete-club { font-family: var(--titre); font-size: 34px; line-height: .9; letter-spacing: .01em; }
.entete-club small { display: block; font-family: var(--etiquette); font-weight: 600; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--gris); margin-top: 6px; }
.entete-outils { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.identite { display: flex; align-items: center; gap: 8px; font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--gris); }
.identite select { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .3); color: #fff; border-radius: var(--rayon); padding: 6px 10px; text-transform: none; letter-spacing: 0; font-family: var(--texte); }
.identite select option { color: var(--encre); }
.lien-sortie { color: var(--gris); font-size: 14px; text-decoration: none; border-bottom: 1px dashed currentColor; }
.lien-sortie:hover { color: #fff; }

.onglets { max-width: 1180px; margin: 0 auto; padding: 0 12px; display: flex; gap: 2px; overflow-x: auto; position: relative; z-index: 1; scrollbar-width: none; }
.onglets a { font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: 14px; color: #c9d4dd; text-decoration: none; padding: 14px 14px 12px; border-bottom: 4px solid transparent; white-space: nowrap; transition: color var(--rapide), border-color var(--rapide); }
.onglets a:hover { color: #fff; }
.onglets a[aria-current="page"] { color: #fff; border-bottom-color: var(--rouge); }

/* ---------- Mise en page ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }
.vue-titre { font-family: var(--titre); font-size: 44px; line-height: 1; color: var(--bleu); margin-bottom: 4px; }
.vue-intro { color: var(--encre-douce); margin-bottom: 24px; max-width: 70ch; }
.section-titre { font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; font-size: 14px; color: var(--encre-douce); margin: 36px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-titre::after { content: ""; flex: 1; height: 1px; background: var(--ligne); }
.grille-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; align-items: start; }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); box-shadow: var(--ombre); }
.vide { color: var(--encre-douce); font-style: italic; padding: 16px 0; }
.bandeau-info { background: var(--orange-clair); border-left: 4px solid var(--orange); padding: 10px 14px; margin-bottom: 20px; font-size: 15px; }

/* ---------- Tuile de date (comme sur les affiches) ---------- */
.tuile-date { flex: none; width: 64px; text-align: center; background: #fff; color: var(--bleu); border: 1px solid var(--ligne); border-bottom: 4px solid var(--rouge); padding: 6px 0 4px; }
.tuile-date .j { font-family: var(--etiquette); font-weight: 600; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--rouge); }
.tuile-date .n { font-family: var(--titre); font-size: 32px; line-height: .9; }
.tuile-date .m { font-family: var(--titre); font-size: 15px; line-height: 1; }

/* ---------- Accueil ---------- */
.prochain { display: flex; gap: 0; overflow: hidden; background: var(--bleu-nuit); color: #fff; border-radius: var(--rayon); position: relative; }
.prochain-date { background: #fff; color: var(--bleu); padding: 22px 28px; text-align: center; border-bottom: 8px solid var(--rouge); display: flex; flex-direction: column; justify-content: center; }
.prochain-date .j { font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--rouge); }
.prochain-date .n { font-family: var(--titre); font-size: 92px; line-height: .85; }
.prochain-date .m { font-family: var(--titre); font-size: 24px; }
.prochain-corps { padding: 22px 28px; display: flex; flex-direction: column; gap: 8px; }
.prochain-sur { font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; font-size: 13px; color: var(--gris); }
.prochain-titre { font-family: var(--titre); font-size: 46px; line-height: .95; }
.prochain-meta { color: #d5dee6; }
.compte-a-rebours { align-self: flex-start; margin-top: auto; background: var(--rouge); font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; padding: 4px 10px; transform: skewX(-8deg); }
.ensuite { list-style: none; display: grid; gap: 10px; margin-top: 14px; }
.ensuite li { display: flex; align-items: center; gap: 12px; }
.ensuite .tuile-date { width: 54px; }
.ensuite .tuile-date .n { font-size: 26px; }

.chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 24px; }
.chiffre { padding: 16px 18px; position: relative; }
.chiffre-libelle { font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--encre-douce); }
.chiffre-valeur { font-family: var(--titre); font-size: 48px; line-height: 1; color: var(--bleu); margin-top: 6px; }
.chiffre-valeur small { font-size: 22px; color: var(--encre-douce); }
.chiffre-detail { font-size: 14px; color: var(--encre-douce); margin-top: 2px; }
.jauge { height: 8px; background: var(--bleu-clair); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.jauge span { display: block; height: 100%; background: var(--bleu); }
.jauge.alerte span { background: var(--rouge); }

/* ---------- Agenda ---------- */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; }
.puce { border: 1px solid var(--ligne); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 14px; transition: background var(--rapide), border-color var(--rapide); }
.puce:hover { border-color: var(--bleu); }
.puce[aria-pressed="true"] { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.case { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--encre-douce); margin-left: auto; }
.mois { font-family: var(--titre); font-size: 30px; color: var(--bleu); margin: 28px 0 10px; }
.evenements { list-style: none; display: grid; gap: 10px; }
.evenement { display: flex; gap: 16px; padding: 14px 16px; align-items: flex-start; }
.evenement.passe { opacity: .55; }
.evenement.annule .evenement-titre { text-decoration: line-through; }
.evenement-corps { flex: 1; min-width: 0; }
.evenement-titre { font-weight: 700; font-size: 17px; }
.evenement-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--encre-douce); font-size: 14px; margin-top: 4px; }
.etiquette { display: inline-block; font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; padding: 2px 8px; border-radius: 2px; background: var(--bleu-clair); color: var(--bleu); }
.etiquette.rouge { background: var(--rouge-clair); color: var(--rouge); }
.etiquette.orange { background: var(--orange-clair); color: #8a5a00; }
.etiquette.fonce { background: var(--gris-fonce); color: #fff; }
.alerte-meme-jour { font-size: 13px; color: #8a5a00; margin-top: 6px; }
.evenement-budget { text-align: right; font-family: var(--titre); font-size: 22px; color: var(--encre-douce); white-space: nowrap; }
.evenement-budget.negatif { color: var(--rouge); }
.evenement-budget.positif { color: var(--bleu); }

/* ---------- Tâches ---------- */
.taches-groupe { margin-top: 26px; }
.taches-groupe > summary { cursor: pointer; list-style: none; }
.taches-groupe > summary::-webkit-details-marker { display: none; }
.taches-groupe h3 { font-family: var(--titre); font-size: 28px; color: var(--bleu); display: inline-flex; align-items: baseline; gap: 10px; }
.taches-groupe h3 .compte { font-family: var(--etiquette); font-size: 15px; color: var(--encre-douce); letter-spacing: .06em; }
.taches-groupe.retard h3 { color: var(--rouge); }
.taches { list-style: none; display: grid; gap: 8px; margin-top: 10px; }
.tache { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 12px 14px; border-left: 4px solid var(--gris); align-items: center; transition: border-color var(--rapide); }
.tache.en-cours { border-left-color: var(--orange); }
.tache.fait { border-left-color: var(--bleu); opacity: .7; }
.tache.fait .tache-titre { text-decoration: line-through; }
.tache.retard:not(.fait) { border-left-color: var(--rouge); }
.tache-titre { font-weight: 700; }
.tache-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: var(--encre-douce); grid-column: 1; }
.tache-qui { font-family: var(--etiquette); font-weight: 600; letter-spacing: .04em; }
.tache-qui.libre { color: var(--rouge); }
.tache-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bouton { border: 1px solid var(--bleu); background: #fff; color: var(--bleu); border-radius: var(--rayon); padding: 6px 12px; font-size: 14px; font-weight: 700; transition: background var(--rapide), color var(--rapide), transform var(--rapide); }
.bouton:hover { background: var(--bleu-clair); }
.bouton:active { transform: translateY(1px); }
.bouton.plein { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.bouton.plein:hover { background: #a60a28; }
.bouton.discret { border-color: transparent; color: var(--encre-douce); font-weight: 500; }
.bouton:disabled { opacity: .5; cursor: wait; }
.ajout-tache { margin-bottom: 8px; }
.ajout-tache > summary { display: inline-block; }
.formulaire { display: grid; grid-template-columns: 1fr 170px 170px auto; gap: 10px; padding: 14px; margin-top: 10px; align-items: end; }
.formulaire label { display: grid; gap: 4px; font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--encre-douce); }
.formulaire input, .formulaire select, .recherche { border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 8px 10px; background: #fff; text-transform: none; letter-spacing: 0; font-size: 15px; }
.recherche { min-width: 220px; }

/* ---------- Projets ---------- */
.projets { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.projet { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; border-top: 5px solid var(--bleu); }
.projet[data-statut="À faire"], .projet[data-statut="À préparer"] { border-top-color: var(--rouge); }
.projet[data-statut="En attente"], .projet[data-statut="À l'étude"] { border-top-color: var(--orange); }
.projet > .etiquette { align-self: flex-start; }
.projet h3 { font-family: var(--titre); font-size: 28px; line-height: 1; color: var(--bleu); }
.projet .etape { background: var(--papier); padding: 8px 10px; border-radius: var(--rayon); font-size: 15px; }
.projet .etape b { font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--rouge); display: block; }
.projet ul { padding-left: 18px; font-size: 14px; color: var(--encre-douce); }
.projet-pied { margin-top: auto; display: flex; justify-content: space-between; font-size: 14px; color: var(--encre-douce); border-top: 1px dashed var(--ligne); padding-top: 8px; }

/* ---------- Finances ---------- */
.barre-empilee { display: flex; height: 26px; border-radius: 3px; overflow: hidden; margin: 12px 0 8px; }
.barre-empilee span { display: block; height: 100%; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--encre-douce); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.tableau { width: 100%; border-collapse: collapse; font-size: 15px; }
.tableau th { text-align: left; font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--encre-douce); border-bottom: 2px solid var(--bleu); padding: 8px 6px; }
.tableau td { border-bottom: 1px solid var(--ligne); padding: 8px 6px; }
.tableau td.nb { text-align: right; font-variant-numeric: tabular-nums; }
.reperes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.repere { padding: 14px 16px; border-left: 4px solid var(--rouge); }
.repere b { font-family: var(--titre); font-size: 30px; color: var(--bleu); display: block; line-height: 1; margin-top: 4px; }
.repere small { color: var(--encre-douce); font-size: 13px; }
.histogramme { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; height: 200px; padding: 16px 16px 0; }
.histogramme .colonne { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 2px; }
.histogramme .paire { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.histogramme .b { width: 40%; max-width: 18px; border-radius: 2px 2px 0 0; min-height: 2px; }
.b.depenses { background: var(--rouge); }
.b.recettes { background: var(--bleu); }
.histogramme .mois-lib { font-family: var(--etiquette); font-weight: 600; font-size: 12px; text-transform: uppercase; color: var(--encre-douce); padding: 6px 0 10px; }

/* ---------- Affiches ---------- */
.astuce { padding: 14px 18px; margin-bottom: 20px; border-left: 4px solid var(--bleu); }
.astuce ol { padding-left: 20px; margin-top: 6px; color: var(--encre-douce); font-size: 15px; }
.affiches { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.affiche { overflow: hidden; display: flex; flex-direction: column; }
.affiche-apercu { display: block; background: var(--bleu-nuit); }
.affiche-apercu img { display: block; width: 100%; height: auto; transition: transform var(--rapide); }
.affiche-apercu:hover img { transform: scale(1.02); }
.affiche-corps { padding: 14px 16px 16px; display: grid; gap: 8px; }
.affiche-corps h3 { font-family: var(--titre); font-size: 30px; line-height: 1; color: var(--bleu); }
.affiche-brouillon { background: var(--orange-clair); border-left: 4px solid var(--orange); padding: 6px 10px; font-size: 14px; }
.affiche-boutons { display: flex; flex-wrap: wrap; gap: 6px; }
.affiche-boutons .bouton { text-decoration: none; }
.affiche-boutons .poids { font-weight: 500; opacity: .75; }
.lien-affiche { text-decoration: none; }

/* ---------- Comptes rendus ---------- */
.grille-cr { grid-template-columns: 300px 1fr; }
.cr-liste { list-style: none; display: grid; gap: 6px; }
.cr-liste button { width: 100%; text-align: left; background: #fff; border: 1px solid var(--ligne); border-left: 4px solid var(--gris); border-radius: var(--rayon); padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; transition: border-color var(--rapide); }
.cr-liste button:hover { border-left-color: var(--bleu); }
.cr-liste button[aria-current="true"] { border-left-color: var(--rouge); background: var(--bleu-clair); }
.cr-lecteur { padding: 24px 28px; max-height: 75vh; overflow: auto; }
.cr-lecteur h1, .cr-lecteur h2 { font-family: var(--titre); color: var(--bleu); font-size: 28px; margin: 18px 0 6px; line-height: 1; }
.cr-lecteur p { margin: 6px 0; }
.cr-lecteur ul { padding-left: 20px; margin: 6px 0; }
.cr-lecteur table { border-collapse: collapse; margin: 10px 0; width: 100%; font-size: 14px; }
.cr-lecteur td, .cr-lecteur th { border: 1px solid var(--ligne); padding: 6px 8px; }

.pied-page { max-width: 1180px; margin: 0 auto; padding: 0 20px 32px; font-size: 13px; color: var(--encre-douce); }
.notification { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--gris-fonce); color: #fff; padding: 10px 16px; border-radius: var(--rayon); box-shadow: var(--ombre); z-index: 10; }

/* ---------- Connexion ---------- */
.page-connexion { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--bleu) 0%, var(--bleu-nuit) 100%); padding: 16px; }
.connexion { width: 100%; max-width: 380px; background: #fff; border-bottom: 8px solid var(--rouge); padding: 28px; text-align: center; }
.connexion-logo { width: 160px; background: var(--bleu-nuit); border-radius: 50%; padding: 18px; }
.connexion h1 { font-family: var(--titre); font-size: 44px; color: var(--bleu); line-height: 1; margin-top: 12px; }
.connexion-sous-titre { font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--encre-douce); font-size: 13px; }
.connexion form { display: grid; gap: 10px; margin-top: 22px; text-align: left; }
.connexion label { font-size: 14px; color: var(--encre-douce); }
.connexion input { border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 10px 12px; font-size: 16px; }
.connexion button { background: var(--rouge); color: #fff; border: 0; border-radius: var(--rayon); padding: 11px; font-family: var(--etiquette); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: 16px; }
.connexion-erreur { color: var(--rouge); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grille-2, .grille-cr { grid-template-columns: 1fr; }
  .chiffres, .reperes { grid-template-columns: repeat(2, 1fr); }
  .formulaire { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  main { padding: 20px 16px 48px; }
  .entete-haut { padding: 14px 16px 4px; flex-wrap: wrap; }
  .entete-haut img { width: 64px; }
  .entete-club { font-size: 26px; }
  .entete-outils { width: 100%; justify-content: space-between; }
  .vue-titre { font-size: 36px; }
  .prochain { flex-direction: column; }
  .prochain-date { flex-direction: row; gap: 12px; align-items: baseline; justify-content: center; padding: 14px; }
  .prochain-date .n { font-size: 56px; }
  .prochain-titre { font-size: 36px; }
  .chiffres, .reperes { grid-template-columns: 1fr 1fr; gap: 10px; }
  .chiffre-valeur { font-size: 38px; }
  .tache { grid-template-columns: 1fr; }
  .tache-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .formulaire { grid-template-columns: 1fr; }
  .evenement { gap: 12px; padding: 12px; }
  .evenement-budget { font-size: 18px; }
  .recherche { min-width: 0; width: 100%; }
  .case { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
