/* Emplacement : monpensebete/espace-client/assets/css/app.css (remplace la version du M3, v14)
   Tokens de la maquette C (Semainier) : gris froid, bleu de Prusse, titres condensés. Desktop d'abord, mobile sous 768 px. */

:root {
  --bg: #F3F4F7; --paper: #FFFFFF; --line: #DFE2E8; --line-soft: #ECEEF2;
  --ink: #1B1E26; --muted: #5D6472; --faint: #9AA1AE;
  --blue: #1F3A6B; --blue-soft: #E7EDF7; --blue-mid: #3E5F9E;
  --red: #C0392B; --red-soft: #FBE9E7;
  --green: #2C7A45; --green-soft: #E4F3E8;
  --amber: #B7791F;
  --display: "Bahnschrift SemiCondensed", "Bahnschrift", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --body: "Segoe UI", "Avenir Next", "Helvetica Neue", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/20px var(--body); }
a { color: var(--blue); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue-mid); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
small { font-size: 12px; color: var(--muted); }

/* Messages */
.flash { border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.flash-succes { background: var(--green-soft); color: var(--green); }
.flash-erreur { background: var(--red-soft); color: var(--red); }
.flash-info { background: var(--blue-soft); color: var(--blue); }
.erreurs { margin: 0 0 14px; padding: 10px 14px 10px 30px; border-radius: 8px; background: var(--red-soft); color: var(--red); }
.erreurs li { margin: 2px 0; }
.vide { color: var(--muted); margin: 6px 0 10px; }

/* Formulaires */
.champ { display: block; margin-bottom: 14px; }
.champ > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.champ input[type="text"], .champ input[type="email"], .champ input[type="password"], .champ input[type="date"], .champ input[type="time"], .champ input[type="url"], .champ input[type="search"], .champ select, .champ textarea,
.capture input[type="text"], .capture input[type="search"], .capture input[type="date"], .capture textarea, .ligne-form input[type="text"], .ligne-form select, .ajout-sous-tache input {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); font: inherit; color: var(--ink);
}
.champ textarea { resize: vertical; }
.champ input:focus, .champ select:focus, .champ textarea:focus, .capture input:focus, .capture textarea:focus { border-color: var(--blue-mid); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.champ small { display: block; margin-top: 4px; color: var(--faint); font-size: 12px; }
.case { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 16px; color: var(--muted); white-space: nowrap; }
.case input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.bouton { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px;
  border-radius: 8px; background: var(--blue); color: #fff; font-weight: 600; width: 100%; text-decoration: none; }
.bouton:hover { background: var(--blue-mid); }
.bouton-court { width: auto; flex: none; }
.bouton-lien { color: var(--blue); font-weight: 600; padding: 0; }
.bouton-lien:hover { text-decoration: underline; }
.bouton-lien.danger, .rb.danger { color: var(--red); }
.annuler { margin-left: 14px; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.inline { display: inline; }
.grille-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.deux-colonnes { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.formulaire { max-width: none; }
.ligne-form { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.ligne-form input[type="text"] { flex: 1; min-width: 160px; }
.ligne-form select { width: auto; }
.ligne-form .case { margin: 0; }
.ligne-tag.archive { opacity: .6; }
.pastille { width: 12px; height: 12px; border-radius: 6px; flex: none; }

/* Mode connexion : carte centrée */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 14px; }
.auth-carte { width: 100%; max-width: 420px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 28px 28px 24px; }
.auth-marque { display: flex; align-items: center; gap: 10px; font: 600 26px/1 var(--display); color: var(--blue); margin-bottom: 18px; }
.auth-marque .logo { width: 34px; height: 34px; flex: none; }
.auth h1 { font: 600 22px/1.2 var(--display); margin: 0 0 4px; }
.auth .sous-titre { color: var(--muted); margin: 0 0 18px; }
.auth-liens { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 13px; }

/* Barre du haut (maquette Semainier) */
.barre { display: flex; align-items: center; gap: 18px; height: 58px; padding: 0 28px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.marque { display: inline-flex; align-items: center; gap: 9px; font: 600 22px/1 var(--display); color: var(--blue); text-decoration: none; letter-spacing: .3px; white-space: nowrap; }
.marque .logo { width: 30px; height: 30px; flex: none; }
.menu { display: flex; gap: 4px; }
.menu a { padding: 19px 10px 17px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.menu a[aria-current] { color: var(--blue); border-bottom-color: var(--blue); }
.menu a:hover { color: var(--ink); }
.recherche { margin-left: auto; }
.recherche input { height: 34px; width: 240px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font: inherit; color: var(--ink); }
.noter { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 600; text-decoration: none; }
.loupe { display: none; }
.noter:hover { background: var(--blue-mid); }
.deconnexion { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.deconnexion .prenom { color: var(--muted); }

.page { padding: 22px 28px 60px; max-width: 1440px; }
.head { display: flex; align-items: flex-end; gap: 14px; margin: 4px 0 14px; flex-wrap: wrap; }
.head h1 { font: 600 40px/1 var(--display); margin: 0; }
.head .range { color: var(--muted); padding-bottom: 4px; }
.head .ctl { margin-left: auto; display: flex; gap: 6px; padding-bottom: 2px; flex-wrap: wrap; }
.rb { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); text-decoration: none; font-size: 18px; }
.rb.txt { font-size: 14px; font-weight: 500; color: var(--blue); padding: 0 12px; }
.rb:hover { background: var(--blue-soft); }
.blk { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 10px; margin-bottom: 18px; }
.blk h2 { font: 600 22px/1 var(--display); margin: 0 0 10px; color: var(--ink); }
.blk h2 small { font: 500 13px/1 var(--body); color: var(--muted); margin-left: 8px; }

/* Saisie rapide */
.capture { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; }
.capture input[type="text"], .capture input[type="search"], .capture textarea { flex: 1; }
.capture input[type="date"] { width: 170px; flex: none; }
.capture textarea { resize: vertical; min-height: 40px; }
.capture .case { margin: 0; }
.capture-note { align-items: flex-start; }

/* Espace "À signaler" : une phrase */
.signal { background: var(--blue-soft); border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; color: var(--blue); font-size: 15px; }
.signal.calme { background: var(--green-soft); color: var(--green); }
.signal b { font-weight: 700; }
.signal a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(31, 58, 107, .35); }
.signal .r { color: var(--red); }

/* Semainier */
.week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, .7fr); gap: 10px; margin-bottom: 22px; }
.day { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 8px; min-height: 240px; display: flex; flex-direction: column; }
.day.today { border-color: var(--blue); box-shadow: inset 0 3px 0 var(--blue); }
.day .dh { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.day .dh .n { font: 600 30px/1 var(--display); color: var(--ink); }
.day.today .dh .n { color: var(--blue); }
.day .dh .w { color: var(--muted); font-weight: 500; }
.day .dh .c { margin-left: auto; font-size: 12px; color: var(--faint); }
.sous-jour { font-size: 12px; font-weight: 600; color: var(--muted); margin: 8px 0 2px; }
.it { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 13px; line-height: 18px; }
.it:first-of-type { border-top: 0; }
.it .x { min-width: 0; overflow-wrap: anywhere; }
.it .x a { color: var(--ink); text-decoration: none; }
.it .x a:hover { text-decoration: underline; }
.it .h { color: var(--muted); font-size: 12px; }
.it .g { color: var(--faint); font-size: 12px; margin-top: 2px; flex: none; width: 14px; text-align: center; }
.it.rem .g { color: var(--amber); }
.it.memo .x, .it.memo .x a { color: var(--muted); }
.it.faite .x a { color: var(--faint); text-decoration: line-through; }
.it.late .x > a { color: var(--red); }
.it small { display: block; color: var(--faint); }
.cb { appearance: none; width: 15px; height: 15px; border: 1.5px solid var(--faint); border-radius: 3px; margin: 2px 0 0; flex: none; display: grid; place-items: center; cursor: pointer; background: var(--paper); }
.cb:checked { background: var(--blue); border-color: var(--blue); }
.cb:checked::after { content: ""; width: 7px; height: 4px; border: 1.5px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.tag { font-size: 11px; font-weight: 600; border-bottom: 2px solid; line-height: 12px; display: inline-block; margin: 2px 6px 0 0; text-decoration: none; }
.late-lbl { font-size: 11px; color: var(--red); font-weight: 600; }
.late-lbl.attente { color: var(--amber); }
.add { margin-top: auto; padding-top: 8px; color: var(--faint); font-size: 13px; text-decoration: none; }
.add:hover { color: var(--blue); }

/* Bas de l'accueil */
.low { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 18px; align-items: start; }
.low .blk:first-child { max-height: none; }
.separateur-jour.petit { font-size: 15px; margin: 12px 0 4px; color: var(--muted); }
.separateur-jour.petit:first-child { margin-top: 2px; }
.wait { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.wait:first-of-type { border-top: 0; }
.wait .who { font-weight: 600; }
.wait .what { color: var(--muted); font-size: 13px; }
.wait .what a { color: inherit; }
.wait .since { font-size: 12px; color: var(--muted); }
.wait .since.over { color: var(--red); font-weight: 600; }
.rl { height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--blue); background: var(--paper); }
.rl:hover { background: var(--blue-soft); }
.pin { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.pin:first-of-type { border-top: 0; }
.pin .k { font-size: 12px; color: var(--muted); }
.pin .v { font-weight: 500; }
.icb { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); text-decoration: none; font-size: 20px; }
.icb:hover { background: var(--bg); }

/* Filtres et listes */
.filtres { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 14px; }
.filtres a { padding: 5px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); text-decoration: none; font-weight: 500; }
.filtres a[aria-current] { background: var(--blue); border-color: var(--blue); color: #fff; }
.filtre-recherche { height: 32px; width: 260px; border: 1px solid var(--line); border-radius: 16px; padding: 0 12px; font: inherit; background: var(--paper); color: var(--ink); }
.filtres select { height: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); padding: 0 10px; font: inherit; color: var(--ink); margin-left: 6px; }
.liste { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px; }
.ligne-tache { display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.ligne-tache:first-child, .blk .ligne-tache:first-of-type { border-top: 0; }
.ligne-tache .cb { width: 18px; height: 18px; margin-top: 2px; }
.ligne-tache .titre { font-size: 15px; color: var(--ink); text-decoration: none; }
.ligne-tache .titre:hover { text-decoration: underline; }
.ligne-tache.faite .titre { color: var(--faint); text-decoration: line-through; }
/* Fond ou épingle : le cadre déborde de 10 px de chaque côté, le contenu reste aligné avec les autres lignes */
.ligne-tache.epinglee, .ligne-tache.colore { margin-left: -10px; margin-right: -10px; padding-left: 10px; padding-right: 10px; border-radius: 8px; }
.ligne-tache.epinglee { box-shadow: inset 3px 0 0 var(--blue-mid); }
.ligne-tache.epinglee.colore { box-shadow: inset 3px 0 0 var(--blue-mid); }
.ligne-tache .meta, .sous-tache .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.meta .late { color: var(--red); font-weight: 600; }
.meta .importante { color: var(--amber); font-weight: 600; }
.meta .attente { color: var(--muted); }
.meta .attente.over { color: var(--red); font-weight: 600; }
.compteur { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 2px 8px; }
.ligne-tache .fin { display: flex; align-items: center; justify-content: flex-end; gap: 10px; white-space: nowrap; min-width: 0; }
.ligne-tache .fin .palette { order: 9; }
.ligne-tache .fin .bouton-lien { font-size: 12px; opacity: 0; }
.ligne-tache:hover .fin .bouton-lien, .ligne-tache .fin .bouton-lien:focus-visible { opacity: 1; }
@media (hover: none) { .ligne-tache .fin .bouton-lien { opacity: 1; } }
.ligne-actions { padding: 0 0 8px 30px; }
.sous-tache { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.sous-tache:first-of-type { border-top: 0; }
.sous-tache .cb { width: 16px; height: 16px; margin-top: 2px; }
.sous-tache.faite .corps { color: var(--faint); text-decoration: line-through; }
.sous-tache.faite .meta { text-decoration: none; }
.ajout-sous-tache { display: grid; grid-template-columns: 1fr 150px 150px auto; gap: 8px; margin-top: 10px; }

/* Notes */
.fil { max-width: 860px; }
.separateur-jour { font: 600 20px/1 var(--display); margin: 18px 0 8px; color: var(--ink); }
.note { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; }
.note.epinglee { border-color: var(--blue-mid); }
.note-h { font-size: 12px; color: var(--faint); margin-bottom: 4px; }
.etiquette { display: inline-block; background: var(--bg); border-radius: 6px; padding: 0 6px; color: var(--muted); text-decoration: none; }
.note-t { font-weight: 600; margin-bottom: 2px; }
.note-c { overflow-wrap: anywhere; }
.note-b { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; font-size: 12px; }
.note-b .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.note-b .actions a, .note-b .actions button { font-size: 12px; font-weight: 600; color: var(--blue); text-decoration: none; }
.note-b .actions button.danger { color: var(--red); }
.blk .note { border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; padding: 8px 0; margin: 0; }
.blk .note:first-of-type { border-top: 0; }
.blk .ligne-tache { padding-top: 8px; padding-bottom: 8px; }
/* Dans le fil, une note s'aligne sur les tâches : un crayon occupe la colonne des cases à cocher */
.blk .note { position: relative; padding-left: 30px; }
.blk .note::before { content: "\270E"; position: absolute; left: 1px; top: 8px; color: var(--faint); font-size: 14px; line-height: 20px; }
.blk .note.colore { margin-left: -10px; margin-right: -10px; padding-left: 40px; padding-right: 10px; border-radius: 8px; border-top-color: transparent; }
.blk .note.colore::before { left: 11px; }
.blk .note.epinglee { box-shadow: inset 3px 0 0 var(--blue-mid); margin-left: -10px; margin-right: -10px; padding-left: 40px; padding-right: 10px; border-radius: 8px; }
.blk .note.epinglee::before { left: 11px; }

/* Choix des tags dans les formulaires */
.choix-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-case { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 16px; color: var(--c, var(--blue)); font-weight: 600; font-size: 13px; cursor: pointer; }
.tag-case:has(input:checked) { background: var(--c, var(--blue)); color: #fff; border-color: var(--c, var(--blue)); }
.tag-case input { width: 14px; height: 14px; margin: 0; accent-color: currentColor; }
.tag-nouveau { display: inline-flex; gap: 6px; }
.tag-nouveau input { width: 150px; min-height: 32px; padding: 4px 10px; border: 1px dashed var(--line); border-radius: 16px; font: inherit; }
.tag-nouveau select { min-height: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); font: inherit; padding: 0 8px; }

/* Infos utiles : fiches */
.fiches { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.fiche { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.fiche.epinglee { border-color: var(--blue-mid); }
.fiche-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 8px; }
.fiche-t { font: 600 18px/1.2 var(--display); color: var(--ink); text-decoration: none; }
.fiche-t:hover { text-decoration: underline; }
.type { font-size: 11px; font-weight: 600; color: var(--blue); background: var(--blue-soft); border-radius: 6px; padding: 1px 7px; }
.etiquette.vieille { color: var(--red); }
.champs { margin: 0; }
.ligne-champ { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 8px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.ligne-champ:first-child { border-top: 0; }
.ligne-champ dt { font-size: 12px; color: var(--muted); }
.ligne-champ dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.copier { font-size: 11px; font-weight: 600; color: var(--blue); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; background: var(--paper); white-space: nowrap; }
.copier:hover { background: var(--blue-soft); }
.copier.copie { color: var(--green); border-color: var(--green); }
.fiche-c { white-space: normal; margin: 8px 0; overflow-wrap: anywhere; }
.pin .v .lib { color: var(--muted); font-weight: 400; margin-right: 4px; }
.pin .v .copier { margin-left: 6px; vertical-align: 1px; }
.champs-kv .kv { display: grid; grid-template-columns: minmax(120px, 36%) 1fr; gap: 8px; margin-bottom: 6px; }
.champs-kv input { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.champ-large { grid-column: span 2; }

/* Calendrier mois */
.mois { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mois-entete { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px 2px; }
.mois-jour { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; min-height: 104px; padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 3px; }
.mois-jour.hors { background: transparent; border-style: dashed; }
.mois-jour.hors .mois-num { color: var(--faint); }
.mois-jour.today { border-color: var(--blue); box-shadow: inset 0 3px 0 var(--blue); }
.mois-num { font: 600 18px/1 var(--display); color: var(--ink); text-decoration: none; margin-bottom: 3px; }
.mois-jour.today .mois-num { color: var(--blue); }
.mois-item { display: block; font-size: 12px; line-height: 16px; color: var(--ink); text-decoration: none; border-left: 3px solid var(--c, var(--faint)); padding-left: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mois-item.faite { color: var(--faint); text-decoration: line-through; }
.mois-item.late { color: var(--red); }
.mois-plus, .mois-rappel { font-size: 11px; color: var(--muted); text-decoration: none; }
.mois-rappel { color: var(--amber); font-weight: 600; margin-top: auto; }

/* Bilan */
.bilan-ligne { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.bilan-ligne:first-of-type { border-top: 0; }
.bilan-date { font-size: 12px; color: var(--muted); min-width: 130px; }
.bilan-date.late { color: var(--red); font-weight: 600; }
.bilan-ligne a { color: var(--ink); text-decoration: none; }
.bilan-ligne a:hover { text-decoration: underline; }

/* Récurrence, étapes, modèles */
.meta .recur { color: var(--blue); font-weight: 600; }
.it.sous .x a { color: var(--ink); }
.it.sous .x small { display: block; color: var(--faint); font-size: 11px; }
.mois-item.sous { border-left-style: dotted; color: var(--muted); }
.etapes .etape { display: grid; grid-template-columns: 1fr 140px 150px; gap: 8px; margin-bottom: 6px; }
.etapes .etape.entete span { font-size: 12px; color: var(--muted); font-weight: 600; }
.etapes input { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.instancier { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; margin: 10px 0 6px; }
.instancier input { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; width: 100%; }
.fiche.modele .ligne-champ { grid-template-columns: 80px 1fr; }

/* Réunions : archive et compte rendu */
.archive { max-width: 1000px; }
.cr { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.cr-date { text-align: center; color: var(--blue); }
.cr-date .j { display: block; font: 600 24px/1 var(--display); }
.cr-date .m { font-size: 11px; color: var(--muted); }
.cr-t { font: 600 18px/1.2 var(--display); color: var(--ink); text-decoration: none; }
.cr-t:hover { text-decoration: underline; }
.cr-actions { display: flex; gap: 6px; align-items: center; }
.cr-actions .rl { text-decoration: none; display: inline-flex; align-items: center; }

.reunion-form .theme-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.theme-nom { flex: 1; min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: 600 20px/1 var(--display); color: var(--ink); background: var(--bg); }
.theme-nom:focus { background: var(--paper); border-color: var(--blue-mid); outline: none; }
.theme-outils { display: flex; gap: 6px; align-items: center; }
.theme-outils .rb[disabled] { opacity: .35; cursor: default; }
.point { border-top: 1px solid var(--line-soft); padding: 10px 0 12px; }
.point:first-of-type { border-top: 0; }
.point.decision { border-left: 3px solid var(--amber); padding-left: 10px; }
.point.action { border-left: 3px solid var(--blue-mid); padding-left: 10px; }
.point-h { display: grid; grid-template-columns: minmax(120px, 1fr) 150px minmax(120px, 1fr) 150px auto auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.point-h input, .point-h select { min-height: 34px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--paper); color: var(--ink); width: 100%; }
.point-h .rl { text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; }
/* Sans JavaScript, tous les champs restent visibles ; avec, ils n'apparaissent que pour une action */
.js .point:not(.est-action) .point-h input[name^="point_responsable"],
.js .point:not(.est-action) .point-h input[name^="point_echeance"] { visibility: hidden; }
.point.est-decision { border-left: 3px solid var(--amber); padding-left: 10px; }
.point.est-action { border-left: 3px solid var(--blue-mid); padding-left: 10px; }
.point textarea { width: 100%; min-height: 62px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; resize: vertical; }
.point textarea:focus, .point-h input:focus, .point-h select:focus { border-color: var(--blue-mid); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.barre-enregistrer { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; box-shadow: 0 -4px 12px rgba(27, 30, 38, .06); z-index: 4; }

/* Fond de couleur d'une tâche ou d'une note, et palette de choix */
.ligne-tache.colore, .blk .ligne-tache.colore { margin-top: 2px; margin-bottom: 2px; border-top-color: transparent; }
.note.colore { border-color: transparent; }
.it.colore { border-radius: 6px; padding-left: 6px; padding-right: 6px; border-top-color: transparent; }
.palette { position: relative; display: inline-block; }
.palette summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; padding: 2px; border-radius: 12px; }
.palette summary::-webkit-details-marker { display: none; }
.palette summary:hover { background: rgba(27, 30, 38, .06); }
.pastille-fond { display: inline-block; width: 16px; height: 16px; border-radius: 8px; border: 1.5px solid var(--faint); box-shadow: inset 0 0 0 2px #fff; }
.palette-choix { position: absolute; right: 0; top: 24px; z-index: 6; display: flex; gap: 6px; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 18px rgba(27, 30, 38, .12); }
.swatch { width: 24px; height: 24px; border-radius: 12px; border: 1.5px solid rgba(27, 30, 38, .12); padding: 0; cursor: pointer; }
.swatch:hover { transform: scale(1.12); }
.swatch.active { border: 2px solid var(--blue); }
.swatch.aucune { background: var(--paper); color: var(--muted); font-size: 16px; line-height: 1; }
.ligne-tache .fin .palette { opacity: 1; }
.note-b .actions .palette { margin-left: 4px; }

/* Modèles de mails */
.fiches.mails { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); margin-bottom: 6px; }
.fiche.mail { display: flex; flex-direction: column; }
.fiche.mail .note-b { margin-top: auto; padding-top: 6px; }
.fiche.mail .mail-objet { margin: 2px 0 8px; font-weight: 600; }
.fiche.mail .mail-objet .lib { font-weight: 400; color: var(--muted); font-size: 12px; margin-right: 6px; }
.fiche.mail .mail-corps { white-space: normal; color: var(--ink); background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 19px; max-height: 190px; overflow: hidden; position: relative; }
.fiche.mail .mail-corps::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 28px; background: linear-gradient(rgba(243, 244, 247, 0), var(--bg)); }
.fiche.mail .mail-infos, .fiche.mail .mail-champs { font-size: 12px; color: var(--muted); margin-top: 8px; }
.fiche.mail .mail-champs { color: var(--blue); font-weight: 600; }
.fiche.mail .mail-boutons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 4px; }
.fiche.mail .mail-boutons .bouton { min-height: 32px; padding: 0 12px; font-size: 13px; }
.fiche.mail .mail-boutons .copier { min-height: 32px; padding: 0 10px; font-size: 12px; }
code { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: 12px; }
.modale-champs { position: fixed; inset: 0; background: rgba(27, 30, 38, .45); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.modale-champs[hidden] { display: none !important; }
.modale-carte { background: var(--paper); border-radius: 12px; padding: 20px 22px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; box-shadow: 0 16px 40px rgba(27, 30, 38, .25); }
.modale-carte h2 { font: 600 22px/1 var(--display); margin: 0 0 6px; }
.modale-carte .champ { margin-bottom: 10px; }
.modale-carte .champ input { width: 100%; min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

/* Barre mobile */
.mobilebar { display: none; }

@media print {
  .barre, .mobilebar, .capture, .ctl, .filtres, .add, .actions, .copier, .flash, .rb, form.inline, .champ .js-ajouter-champ,
  .barre-enregistrer, .theme-outils, .cr-actions, .point-h select, .point-h .rl, .point-h .bouton-lien { display: none !important; }
  .theme-nom { border: 0; background: transparent; padding: 0; font-size: 16pt; }
  .point textarea, .point-h input { border: 0; padding: 0; background: transparent; resize: none; }
  .point-h { grid-template-columns: 1fr; gap: 0; }
  html, body { background: #fff; color: #000; font-size: 11px; line-height: 15px; }
  .page { padding: 0; max-width: none; }
  .head h1 { font-size: 24px; }
  .signal { border: 1px solid #999; background: #fff; color: #000; }
  .week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, .7fr); gap: 6px; }
  .day, .blk, .fiche, .note, .liste, .mois-jour { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
  .day { min-height: 0; }
  .low { grid-template-columns: 1fr 1fr 1fr; }
  .cb { border-color: #666; }
  .it.late .x > a, .late-lbl, .meta .late, .bilan-date.late, .mois-item.late { color: #000; font-weight: 700; }
  a { color: #000; text-decoration: none; }
  .fiches { grid-template-columns: 1fr 1fr; }
}

/* Écrans très étroits : le nom complet passe avant le raccourci Noter, qui disparaît du bandeau
   (la saisie rapide reste en haut de l'accueil et des notes, la barre du bas garde la navigation) */
@media (max-width: 400px) {
  .marque { font-size: 17px; gap: 5px; }
  .marque .logo { width: 22px; height: 22px; }
  .barre .noter { display: none; }
  .loupe { width: 30px; height: 30px; font-size: 19px; }
  .deconnexion { font-size: 11px; }
}

@media (max-width: 768px) {
  .barre { height: 52px; padding: 0 12px; gap: 8px; }
  .menu, .deconnexion .prenom, .recherche { display: none; }
  .loupe { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); color: var(--blue); text-decoration: none; font-size: 22px; line-height: 1; transform: rotate(-45deg); }
  .deconnexion { font-size: 12px; }
  .page { padding: 14px max(12px, env(safe-area-inset-left)) calc(104px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right)); }
  .barre { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .marque { gap: 6px; font-size: 19px; letter-spacing: 0; min-width: 0; }
  .barre { gap: 6px; }
  .marque .logo { width: 24px; height: 24px; }
  .marque .mot { overflow: hidden; text-overflow: ellipsis; }
  .noter { padding: 0 11px; font-size: 13px; }
  .deconnexion { font-size: 12px; gap: 8px; }
  .auth { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .head h1 { font-size: 30px; }
  .head .ctl { margin-left: 0; width: 100%; }
  .grille-3, .deux-colonnes, .low { grid-template-columns: 1fr; }
  .ajout-sous-tache { grid-template-columns: 1fr 1fr; }
  .cr { grid-template-columns: 44px 1fr; }
  .cr-actions { grid-column: 1 / -1; }
  .point-h { grid-template-columns: 1fr 1fr; }
  .point-h textarea { grid-column: 1 / -1; }
  .barre-enregistrer { position: static; box-shadow: none; }
  .fiches, .fiches.mails { grid-template-columns: 1fr; }
  .mois { gap: 3px; }
  .mois-jour { min-height: 64px; padding: 4px; }
  .mois-item { display: none; }
  .mois-jour::after { content: ""; }
  .champ-large { grid-column: auto; }
  .ligne-champ { grid-template-columns: 1fr auto; }
  .etapes .etape { grid-template-columns: 1fr 1fr; }
  .etapes .etape input:first-child { grid-column: 1 / -1; }
  .etapes .etape.entete { display: none; }
  .instancier { grid-template-columns: 1fr; }
  .ligne-champ dt { grid-column: 1 / -1; padding-top: 2px; }
  .capture { flex-wrap: wrap; }
  .capture input[type="date"] { width: 100%; }
  .week { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 6px; margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .day { flex: 0 0 82vw; scroll-snap-align: start; min-height: 200px; }
  .day.today { order: -1; }
  .mobilebar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; align-items: center; min-height: 56px;
    padding: 8px max(6px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right));
    background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -6px 14px rgba(27, 30, 38, .07); justify-content: space-around; z-index: 5; }
  .mobilebar a { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; padding: 0 2px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .mobilebar { justify-content: space-between; padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
}

/* Tout petits écrans : après le bloc 768 px pour avoir le dernier mot */
@media (max-width: 340px) {
  .mobilebar a { font-size: 9.5px; padding: 0 1px; }
  .marque { font-size: 15px; }
}
