:root {
  --papier: #f6f2ea;
  --surface: #fffdf8;
  --encre: #1f1d1a;
  --encre-douce: #6b645a;
  --trait: #e2dacb;
  --vermillon: #a8382a;
  --vermillon-doux: #f3e1dc;
  --idee: #8a8378;
  --prevu: #3f6b8a;
  --en_cours: #b07a1c;
  --fait: #3c7a4e;
  --abandonne: #b3aca1;
  --ombre: 0 1px 2px rgb(40 30 20 / 6%), 0 4px 14px rgb(40 30 20 / 6%);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --papier: #171513;
    --surface: #211e1b;
    --encre: #eee8de;
    --encre-douce: #a59c8f;
    --trait: #36312b;
    --vermillon: #e0705c;
    --vermillon-doux: #3a2420;
    --idee: #a39c90;
    --prevu: #79a8c9;
    --en_cours: #dba646;
    --fait: #74b386;
    --abandonne: #6c665d;
    --ombre: 0 1px 2px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--papier); color: var(--encre); font: 15px/1.5 var(--sans); }
[hidden] { display: none !important; }
h1, h2, h3, .marque strong, .titre-bloc { font-family: var(--serif); font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--trait); border-radius: 8px;
  background: var(--surface);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--vermillon); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; }
label { display: grid; gap: .3rem; font-size: .85rem; color: var(--encre-douce); }

.bouton {
  border: 1px solid var(--trait); background: var(--surface); padding: .5rem .9rem;
  border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.bouton:hover { border-color: var(--encre-douce); }
.bouton.plein { background: var(--vermillon); border-color: var(--vermillon); color: #fff; }
.bouton.plein:hover { filter: brightness(1.08); }
.bouton.discret { background: transparent; border-color: transparent; color: var(--encre-douce); }
.bouton.danger { color: var(--vermillon); }
.erreur { color: var(--vermillon); min-height: 1.2em; margin: 0; font-size: .9rem; }

.sceau {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 14px;
  background: var(--vermillon); color: #fff; font: 38px/1 var(--serif);
}
.sceau.petit { width: 36px; height: 36px; font-size: 22px; border-radius: 9px; }

/* Connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.carte-connexion {
  width: min(380px, 100%); display: grid; gap: .9rem; padding: 2rem; background: var(--surface);
  border: 1px solid var(--trait); border-radius: 16px; box-shadow: var(--ombre); text-align: center;
}
.carte-connexion label { text-align: left; }
.carte-connexion h1 { margin: .2rem 0 0; font-size: 1.8rem; }
.carte-connexion .sous { margin: 0 0 .5rem; color: var(--encre-douce); }
.carte-connexion .sceau { justify-self: center; }

/* En-tete */
.entete {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.5rem;
  padding: .8rem clamp(16px, 3vw, 32px); background: color-mix(in srgb, var(--papier) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--trait);
}
.marque { display: flex; align-items: center; gap: .7rem; }
.marque div { display: grid; line-height: 1.2; }
.marque strong { font-size: 1.15rem; }
.marque span { font-size: .8rem; color: var(--encre-douce); }
.onglets { display: flex; gap: .2rem; flex-wrap: wrap; }
.onglets button {
  border: 0; background: none; padding: .45rem .8rem; border-radius: 999px; cursor: pointer; color: var(--encre-douce);
}
.onglets button.actif { background: var(--encre); color: var(--papier); }
.actions-entete { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.etat { font-size: .8rem; color: var(--encre-douce); }

.vue { padding: 1.2rem clamp(16px, 3vw, 32px) 3rem; }

/* Filtres */
.filtres { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.puce {
  border: 1px solid var(--trait); background: var(--surface); padding: .25rem .7rem; border-radius: 999px;
  font-size: .82rem; cursor: pointer; color: var(--encre-douce);
}
.puce.actif { border-color: var(--vermillon); color: var(--vermillon); background: var(--vermillon-doux); }

/* Colonnes */
.colonnes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .colonnes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .colonnes { grid-template-columns: 1fr; } }
.colonne { background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1px solid var(--trait); border-radius: 14px; padding: .8rem; min-height: 140px; }
.colonne.survol { outline: 2px dashed var(--vermillon); }
.colonne h2 { margin: 0; font-size: 1.05rem; display: flex; justify-content: space-between; align-items: baseline; }
.colonne h2 small { font: .78rem var(--sans); color: var(--encre-douce); }
.colonne .detail { margin: 0 0 .7rem; font-size: .8rem; color: var(--encre-douce); }
.colonne .vide { color: var(--encre-douce); font-size: .85rem; font-style: italic; padding: .5rem 0; }
.ajout-rapide { width: 100%; margin-top: .4rem; border: 1px dashed var(--trait); background: none; border-radius: 10px; padding: .45rem; color: var(--encre-douce); cursor: pointer; }
.ajout-rapide:hover { border-color: var(--vermillon); color: var(--vermillon); }

.carte {
  background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; padding: .75rem .8rem;
  box-shadow: var(--ombre);
}
.objectif { display: grid; gap: .35rem; margin-bottom: .6rem; cursor: pointer; border-left: 4px solid var(--statut, var(--idee)); }
.objectif:hover { border-color: var(--encre-douce); border-left-color: var(--statut); }
.objectif.abandonne .titre { text-decoration: line-through; color: var(--encre-douce); }
.objectif .titre { font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; gap: .3rem .6rem; font-size: .76rem; color: var(--encre-douce); }
.statut { display: inline-flex; align-items: center; gap: .3rem; }
.statut::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--statut); }
.progres { height: 4px; background: var(--trait); border-radius: 4px; overflow: hidden; }
.progres span { display: block; height: 100%; background: var(--fait); }

/* Par axe */
.axe { margin-bottom: 1.4rem; }
.axe-entete { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.axe-entete h2 { margin: 0; font-size: 1.15rem; }
.axe-entete input { max-width: 320px; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.axe-entete .compte { font-size: .8rem; color: var(--encre-douce); }
.axe-entete .espace { flex: 1; }
.axe .objectifs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .6rem; }
.axe .objectif { margin: 0; }
.ajout-ligne { display: flex; gap: .5rem; max-width: 560px; }

/* Vision */
.vision { display: grid; gap: 1.5rem; max-width: 820px; }
.bloc-texte { gap: .4rem; }
.titre-bloc { font-size: 1.4rem; color: var(--encre); }
.aide { font-size: .88rem; }
.vision textarea { font: 1.05rem/1.65 var(--serif); padding: 1rem 1.1rem; }

/* Journal */
.journal-form { display: grid; gap: .6rem; max-width: 720px; margin-bottom: 1.5rem; }
.journal-form .ligne { display: flex; gap: .5rem; }
.journal-form .ligne > * { width: auto; }
.journal-form .bouton { justify-self: start; }
.journal { list-style: none; padding: 0; margin: 0; max-width: 720px; display: grid; gap: .6rem; }
.journal li { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: .8rem; align-items: start; }
.journal time { font-size: .82rem; color: var(--encre-douce); padding-top: .15rem; }
.journal .type { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--vermillon); display: block; }
.journal .texte { white-space: pre-wrap; }
.journal .bouton { padding: .2rem .5rem; }
@media (max-width: 640px) { .journal li { grid-template-columns: 1fr auto; } .journal time { grid-column: 1 / -1; } }

/* Dialogue */
dialog {
  width: min(620px, calc(100vw - 32px)); border: 1px solid var(--trait); border-radius: 16px; padding: 0;
  background: var(--surface); color: var(--encre); box-shadow: 0 20px 60px rgb(0 0 0 / 25%);
}
dialog::backdrop { background: rgb(20 15 10 / 45%); }
.form-objectif { display: grid; gap: .8rem; padding: 1.4rem; }
.form-objectif h2 { margin: 0; }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@media (max-width: 520px) { .grille2 { grid-template-columns: 1fr; } }
.etapes { border: 1px solid var(--trait); border-radius: 10px; padding: .6rem .8rem .8rem; margin: 0; }
.etapes legend { font-size: .85rem; color: var(--encre-douce); padding: 0 .3rem; }
.etapes ul { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .3rem; }
.etapes li { display: flex; align-items: center; gap: .5rem; }
.etapes li input[type="checkbox"] { width: auto; }
.etapes li span { flex: 1; }
.etapes li.faite span { text-decoration: line-through; color: var(--encre-douce); }
.etapes li button { border: 0; background: none; cursor: pointer; color: var(--encre-douce); }
.pied-dialogue { display: flex; gap: .5rem; align-items: center; }
.pied-dialogue .espace { flex: 1; }

@media (max-width: 760px) {
  .actions-entete { margin-left: 0; width: 100%; }
  .actions-entete .etat { flex: 1; }
}
