/* ==========================================================================
   Dashboard du bureau — styles
   Clair et aéré le matin, sombre le soir. Cartes arrondies, couleurs douces.
   ========================================================================== */

/* --- Couleurs --------------------------------------------------------------
   Il n'y a qu'une seule palette : elle est dans la section « Thème Bureau »
   plus bas. Deux blocs de jetons se superposaient ici et se contredisaient ;
   celui-ci a été retiré pour qu'on ne se demande plus lequel gagne. */

/* --- Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 130px; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "tnum" 0;
  transition: background-color .25s ease, color .25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0 0 .6em; }
code, kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .86em;
  background: var(--surface-2);
  border: 1px solid var(--bord);
  border-radius: 5px;
  padding: .05em .35em;
}
kbd { box-shadow: inset 0 -1px 0 var(--bord); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.icone { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.aller-contenu { position: absolute; left: -999px; }
.aller-contenu:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

.discret { color: var(--discret); font-weight: 400; }
.fort { font-weight: 650; font-variant-numeric: tabular-nums; }
.petit-texte { font-size: .82rem; }
.texte-alerte { color: var(--alerte); }
.texte-attention { color: var(--attention); }
.texte-ok { color: var(--ok); }
.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.note-discrete { color: var(--discret); font-size: .82rem; margin: .8em 0 0; }
.lien-discret { color: var(--discret); font-size: .86rem; white-space: nowrap; }
.lien-discret:hover { color: var(--accent); }

/* --- En-tête ------------------------------------------------------------- */
.entete {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--fond) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--bord);
}
.entete-ligne {
  max-width: 1320px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 24px 6px;
}
.marque { display: flex; align-items: center; gap: 9px; color: var(--encre); font-weight: 700; font-size: 1.05rem; }
.marque:hover { text-decoration: none; }
/* Repère discret de l'encaissé du mois : petit, gris, sans cadre */
.mini-ca { display: flex; gap: 10px; font-size: .78rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini-ca a { color: var(--encre-2); opacity: .8; transition: opacity .15s ease; }
.mini-ca a:hover { opacity: 1; text-decoration: none; color: var(--encre); }
/* Fil d'Ariane : Accueil › Compta › 3D'Clypse */
.ariane ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; font-size: .84rem; color: var(--encre-2); }
.ariane li + li::before { content: "›"; margin-right: 6px; color: var(--discret); }
.ariane a { color: var(--encre-2); }
.ariane a:hover { color: var(--encre); }
.ariane [aria-current] { color: var(--encre); font-weight: 550; }
.marque-logo {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .95rem;
}
[data-theme="sombre"] .marque-logo { color: #10141a; }
.marque-logo.grand { width: 56px; height: 56px; border-radius: 16px; font-size: 1.6rem; }

.recherche { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; }
.recherche .icone { position: absolute; left: 11px; color: var(--discret); pointer-events: none; }
.recherche input {
  width: 100%; height: 38px;
  padding: 0 38px 0 36px;
  border: 1px solid var(--bord); border-radius: 11px;
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.recherche input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }
.recherche input::-webkit-search-cancel-button { display: none; }
.raccourci-indice { position: absolute; right: 9px; color: var(--discret); pointer-events: none; }
.recherche input:focus ~ .raccourci-indice { opacity: 0; }

.resultats {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  max-height: min(70vh, 520px); overflow: auto;
  background: var(--surface); border: 1px solid var(--bord); border-radius: 14px;
  box-shadow: var(--ombre-haute); padding: 6px;
  animation: apparition .14s ease-out;
}
.resultat { display: block; padding: 9px 11px; border-radius: 9px; color: var(--encre); }
.resultat:hover, .resultat.actif { background: var(--surface-2); text-decoration: none; }
.resultat-type { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 650; }
.resultat-titre { display: block; font-weight: 550; }
.resultat-extrait { display: block; font-size: .84rem; color: var(--discret); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resultat-extrait mark, .resultat-titre mark { background: var(--attention-doux); color: inherit; border-radius: 3px; padding: 0 1px; }
.resultats-vide { padding: 14px; color: var(--discret); }

.raccourcis { display: flex; gap: 4px; margin-left: auto; }
.raccourci {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 10px; border: 0; background: none;
  color: var(--encre-2); font-size: .9rem; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.raccourci:hover, .raccourci.actif { background: var(--surface); color: var(--encre); text-decoration: none; box-shadow: var(--ombre); }

.bouton-theme {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--bord); border-radius: 11px; background: var(--surface);
  color: var(--encre-2); cursor: pointer; transition: color .15s ease;
}
.bouton-theme:hover { color: var(--encre); }
[data-theme="clair"] .bouton-theme .soleil, [data-theme="sombre"] .bouton-theme .lune { display: none; }

.navigation {
  max-width: 1320px; margin: 0 auto;
  display: flex; gap: 2px; padding: 2px 20px 0;
  overflow-x: auto; scrollbar-width: none;
}
.navigation::-webkit-scrollbar { display: none; }
.navigation a {
  padding: 9px 12px 11px; color: var(--encre-2); white-space: nowrap; font-size: .93rem;
  border-bottom: 2px solid transparent; transition: color .15s ease, border-color .15s ease;
}
.navigation a:hover { color: var(--encre); text-decoration: none; }
.navigation a.actif { color: var(--encre); border-bottom-color: var(--accent); font-weight: 600; }
.navigation .separateur { width: 1px; background: var(--bord); margin: 9px 8px 11px; flex: none; }

/* --- Mise en page ------------------------------------------------------------ */
.contenu { width: 100%; max-width: 1320px; margin: 0 auto; padding: 26px 24px 40px; flex: 1; animation: apparition .25s ease-out; }
@keyframes apparition { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.grille-2.large-gauche { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.grille-accueil { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grille-bas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; align-items: start; margin-top: 8px; }
.pile { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pile > .bloc { margin-bottom: 0; }
.colonne-docs { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.colonne-docs .bloc { margin-bottom: 0; }

/* --- Blocs ------------------------------------------------------------------- */
.bloc {
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--ombre);
  margin-bottom: 18px;
  min-width: 0;
}
.grille-2 > .bloc, .grille-accueil > .bloc { margin-bottom: 0; }
#mails { align-self: start; }
.bloc-entete { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.bloc-entete h2 { font-size: 1.05rem; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.bloc-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bloc-aide { color: var(--discret); font-size: .86rem; margin: 0; flex-basis: 100%; }
.bloc-centre { max-width: 560px; margin: 40px auto; text-align: center; }
.compte { font-size: .78rem; font-weight: 600; color: var(--encre-2); background: var(--surface-2); border-radius: 20px; padding: 1px 9px; }
.source { color: var(--discret); font-size: .78rem; }

.titre-onglet { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.titre-onglet h1 { font-size: 1.75rem; font-weight: 700; }
.sous-titre { color: var(--discret); margin: 4px 0 0; }

.referent {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 6px; border-radius: 30px;
  background: var(--surface); border: 1px solid var(--bord); color: var(--encre-2); font-size: .88rem;
}
.referent:hover { text-decoration: none; border-color: var(--bord-fort); }

/* Section sans données : une phrase utile */
.vide { padding: 16px 18px; border-radius: 12px; background: var(--surface-2); color: var(--encre-2); }
.vide p { margin: 0; }
.vide-aide { color: var(--discret); font-size: .88rem; margin-top: 4px !important; }
.vide-inline { color: var(--discret); font-style: italic; }
.tout-va-bien { color: var(--ok); margin: 0; padding: 12px 16px; background: var(--ok-doux); border-radius: 12px; }
.alerte-douce { color: var(--attention); background: var(--attention-doux); padding: 9px 14px; border-radius: 10px; font-size: .9rem; }

/* --- Accueil ---------------------------------------------------------------- */
.salutation { margin: 6px 0 24px; }
.date-du-jour { color: var(--discret); margin: 0 0 2px; font-size: .95rem; }
.salutation h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 700; letter-spacing: -.02em; }
.resume { font-size: 1.12rem; color: var(--encre-2); margin: 8px 0 0; max-width: 60ch; }

/* --- Cartes chiffrées --------------------------------------------------------- */
.cartes-chiffres { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
/* Quatre chiffres au lieu de sept : les cartes de la section Système (onglet Serveur). */
.cartes-chiffres.quatre { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.carte-chiffre, .chiffre-cle, .mesure {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--bord); border-radius: 16px;
  padding: 14px 16px; color: var(--encre); box-shadow: var(--ombre); min-width: 0;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.carte-chiffre:hover, a.chiffre-cle:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--ombre-haute); border-color: var(--bord-fort); }
.cc-titre { font-size: .8rem; color: var(--encre-2); font-weight: 550; line-height: 1.3; }
.cartes-chiffres .cc-titre { min-height: 2.6em; }
.cc-valeur { font-size: 1.95rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 4px; white-space: nowrap; }
.cc-valeur small { font-size: .55em; font-weight: 600; color: var(--discret); letter-spacing: 0; }
.cc-detail { font-size: .78rem; color: var(--discret); line-height: 1.35; }
.sans-donnee .cc-valeur { color: var(--discret); font-weight: 500; }
.ton-attention { border-color: color-mix(in srgb, var(--attention) 35%, var(--bord)); }
.ton-attention .cc-detail { color: var(--attention); }
.ton-alerte { border-color: color-mix(in srgb, var(--alerte) 40%, var(--bord)); background: linear-gradient(var(--alerte-doux), var(--surface) 70%); }
.ton-alerte .cc-valeur, .ton-alerte .cc-detail { color: var(--alerte); }

.societes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
a.societe { color: var(--encre); transition: transform .15s ease, box-shadow .15s ease; }
a.societe:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--ombre-haute); }
.societe-chiffres { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; align-items: end; }
.societe-chiffres > div { display: flex; flex-direction: column; gap: 4px; }
.societe-chiffres .cc-valeur { font-size: 2rem; }
.societe-chiffres .cc-valeur.petit { font-size: 1.25rem; }
.chiffres-cles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.chiffre-cle { padding: 16px 18px; }
.chiffre-cle .cc-valeur { font-size: 2.1rem; }
.choix-discret { margin-top: 8px; font-size: .78rem; color: var(--discret); display: flex; align-items: center; gap: 6px; }
.choix-discret select, .select-discret {
  border: 1px solid var(--bord); background: var(--surface-2); border-radius: 8px; padding: 2px 6px; font-size: .8rem; color: var(--encre-2);
}

/* --- Listes --------------------------------------------------------------------- */
.liste { list-style: none; margin: 0; padding: 0; }
.ligne {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; border-top: 1px solid var(--bord); min-width: 0;
}
.ligne:first-child { border-top: 0; padding-top: 2px; }
.ligne.colonne { flex-direction: column; align-items: stretch; gap: 6px; }
.ligne-haut { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ligne-lien { display: flex; flex-direction: column; flex: 1; min-width: 0; color: var(--encre); text-align: left; }
.ligne-lien:hover { text-decoration: none; }
.ligne-lien:hover .ligne-principal { color: var(--accent); }
.ligne-texte { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ligne-principal { font-weight: 550; overflow-wrap: anywhere; display: block; }
.ligne-secondaire { color: var(--discret); font-size: .84rem; display: block; overflow-wrap: anywhere; }
.ligne-droite { margin-left: auto; text-align: right; flex: none; }
.ligne-droite.empile { display: flex; flex-direction: column; align-items: flex-end; }
.ligne.retard .ligne-principal { color: var(--alerte); }
.ligne.mise-en-avant { background: var(--accent-doux); border-radius: 10px; padding-left: 10px; padding-right: 10px; border-top-color: transparent; }
.bouton-texte { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }

.date-bloc {
  flex: none; width: 50px; text-align: center; border-radius: 11px; background: var(--surface-2);
  padding: 4px 0; line-height: 1.1; display: flex; flex-direction: column;
}
.date-bloc b { font-size: 1.15rem; }
.date-bloc small { font-size: .68rem; color: var(--discret); }
.date-bloc.aujourdhui { background: var(--accent); color: #fff; }
.date-bloc.aujourdhui small { color: rgba(255, 255, 255, .85); }
[data-theme="sombre"] .date-bloc.aujourdhui { color: #10141a; }
[data-theme="sombre"] .date-bloc.aujourdhui small { color: rgba(16, 20, 26, .75); }

/* Pastilles de statut */
.pastille {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .76rem; font-weight: 600;
  white-space: nowrap; line-height: 1.5;
}
.p-gris { background: var(--surface-2); color: var(--encre-2); }
.p-vert { background: var(--ok-doux); color: var(--ok); }
.p-bleu { background: var(--accent-doux); color: var(--accent); }
.p-orange { background: var(--attention-doux); color: var(--attention); }
.p-rouge { background: var(--alerte-doux); color: var(--alerte); }

/* Barres de progression fixes (aucune animation) */
.barre { height: 7px; border-radius: 7px; background: var(--surface-3); overflow: hidden; }
.barre > span { display: block; height: 100%; background: var(--accent); border-radius: 7px; }
.barre.fine { height: 5px; }
.barre.alerte > span { background: var(--alerte); }

/* Tableaux */
.tableau-defilant { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.tableau { width: 100%; border-collapse: collapse; }
.tableau th { text-align: left; font-size: .76rem; font-weight: 600; color: var(--discret); padding: 0 10px 8px; white-space: nowrap; }
.tableau td { padding: 10px; border-top: 1px solid var(--bord); vertical-align: middle; }
.tableau th:first-child, .tableau td:first-child { padding-left: 2px; }
.tableau.compact td { padding: 6px 10px; }
.tableau tr.faible td { background: var(--attention-doux); }
.tableau tr.faible td:first-child { border-radius: 8px 0 0 8px; }
.tableau tr.faible td:last-child { border-radius: 0 8px 8px 0; }
.action-cellule { text-align: right; white-space: nowrap; }

/* --- Boutons ------------------------------------------------------------------ */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--bord);
  background: var(--surface); color: var(--encre); cursor: pointer; font-weight: 550; font-size: .9rem;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.bouton:hover { border-color: var(--bord-fort); background: var(--surface-2); text-decoration: none; }
.bouton.principal { background: var(--accent); border-color: var(--accent); color: #fff; }
.bouton.principal:hover { background: var(--accent-fort); border-color: var(--accent-fort); }
[data-theme="sombre"] .bouton.principal { color: #0f1318; }
.bouton.principal kbd { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .25); color: inherit; box-shadow: none; }
.bouton.discret { background: transparent; }
.bouton.petit { padding: 4px 10px; font-size: .82rem; border-radius: 8px; }
.bouton:disabled { opacity: .55; cursor: default; }

/* --- Agents ----------------------------------------------------------------------- */
.avatar {
  --agent: #8a8f98;
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  background: color-mix(in srgb, var(--agent) 22%, var(--surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--agent) 55%, transparent);
  font-size: 1.1rem;
}
.avatar.petit { width: 28px; height: 28px; font-size: .85rem; }
.agents { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.agent {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px;
  padding: 12px 14px; border: 1px solid var(--bord); border-radius: 14px;
  border-left: 4px solid var(--agent);
}
.agents.compact { grid-template-columns: 1fr; gap: 0; }
.agents.compact .agent { border: 0; border-top: 1px solid var(--bord); border-radius: 0; padding: 8px 2px; }
.agents.compact .agent:first-child { border-top: 0; padding-top: 0; }
.agents.compact .avatar { width: 32px; height: 32px; font-size: .95rem; }
.agent-texte { display: flex; flex-direction: column; min-width: 0; }
.agent-nom { font-weight: 650; }
.agent-role { color: var(--discret); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-actions { grid-column: 2 / 4; display: flex; gap: 14px; }
.etat-agent {
  font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap;
  background: var(--surface-2); color: var(--discret);
}
.etat-agent::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; opacity: .8; }
.etat-agent.ton-actif { background: var(--ok-doux); color: var(--ok); }
.etat-agent.ton-attention { background: var(--attention-doux); color: var(--attention); }
.etat-agent.ton-dispo { background: var(--accent-doux); color: var(--accent); }
.legende-etats { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: var(--encre-2); }
.legende-etats .etat-agent { margin-right: 8px; }
.note-discrete + .agents { margin-top: 8px; }

/* --- Salon ------------------------------------------------------------------------- */
.salon { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.bloc-fil { display: flex; flex-direction: column; padding: 0; overflow: hidden; margin-bottom: 0; }
.fil { display: flex; flex-direction: column; gap: 10px; }
#fil { height: calc(100vh - 330px); min-height: 360px; overflow-y: auto; padding: 20px 22px; scroll-behavior: auto; }
.fil-jour { text-align: center; margin: 8px 0; }
.fil-jour span { font-size: .76rem; color: var(--discret); background: var(--surface-2); padding: 3px 12px; border-radius: 20px; }
.message {
  --agent: var(--discret);
  max-width: min(680px, 88%); align-self: flex-start;
  background: var(--surface-2); border-radius: 4px 16px 16px 16px;
  padding: 8px 13px 9px; border-left: 3px solid var(--agent);
}
.message.de-moi { align-self: flex-end; background: var(--accent-doux); border-left: 0; border-right: 3px solid var(--accent); border-radius: 16px 4px 16px 16px; }
.message-entete { display: flex; align-items: baseline; gap: 6px; font-size: .78rem; margin-bottom: 1px; }
.message-auteur { font-weight: 700; color: var(--encre); }
.message-vers { color: var(--discret); }
.message-heure { color: var(--discret); margin-left: auto; padding-left: 10px; font-variant-numeric: tabular-nums; }
.message-texte { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .93rem; }
.fil.compact .message { max-width: 100%; align-self: stretch; }
.fil.compact .message-texte { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.message.nouveau { animation: apparition .3s ease-out; }
.saisie-salon { display: flex; gap: 8px; align-items: flex-end; padding: 14px 16px; border-top: 1px solid var(--bord); background: var(--surface); }
.saisie-salon select { border: 1px solid var(--bord); background: var(--surface-2); border-radius: 10px; padding: 8px; height: 40px; }
.saisie-salon textarea {
  flex: 1; resize: none; min-height: 40px; max-height: 180px; padding: 8px 12px;
  border: 1px solid var(--bord); border-radius: 10px; background: var(--surface-2); line-height: 1.45;
}
.saisie-salon textarea:focus, .saisie-salon select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }
.saisie-salon .bouton { height: 40px; }
.bloc-fil > .note-discrete { padding: 0 16px 12px; margin: 0; }

/* --- To-do --------------------------------------------------------------------------- */
.filtres { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filtres-groupe { display: flex; gap: 6px; flex-wrap: wrap; }
.puce {
  border: 1px solid var(--bord); background: var(--surface); color: var(--encre-2);
  padding: 5px 12px; border-radius: 20px; cursor: pointer; font-size: .86rem;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.puce:hover { border-color: var(--bord-fort); }
.puce.actif { background: var(--encre); color: var(--surface); border-color: var(--encre); }

.todo-projet { padding: 4px 0 14px; }
/* Page To-do : un projet par carte, sur deux colonnes */
.todo-general .todo { columns: 2 460px; column-gap: 18px; }
.todo-general .todo-projet {
  break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 18px;
  background: var(--surface); border: 1px solid var(--bord); border-radius: 18px; padding: 18px 20px; box-shadow: var(--ombre);
}
.todo-general .todo-projet + .todo-projet { border-top: 1px solid var(--bord); padding-top: 18px; }
.todo-projet + .todo-projet { border-top: 1px solid var(--bord); padding-top: 18px; }
.todo-projet-entete { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.todo-projet-entete h3 { font-size: 1.02rem; font-weight: 650; }
.compteur { color: var(--discret); font-size: .82rem; }
.todo-souscat h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--discret); font-weight: 650; margin: 12px 0 2px; }
.todo-vide { color: var(--discret); font-size: .9rem; margin: 6px 0; }
.taches { list-style: none; margin: 0; padding: 0; }
.tache {
  --retrait: 0;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 6px 6px 6px calc(6px + var(--retrait) * 24px); margin: 0 -6px;
  border-radius: 10px; transition: background-color .15s ease, opacity .25s ease;
}
.tache:hover, .tache:focus-within { background: var(--surface-2); }
.tache-texte { flex: 1; min-width: 0; padding: 1px 3px; border-radius: 5px; outline: none; overflow-wrap: anywhere; cursor: text; }
.tache-texte:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--accent-doux), 0 0 0 1px var(--accent); }
.tache.faite .tache-texte { color: var(--discret); text-decoration: line-through; text-decoration-color: var(--bord-fort); }
.tache.retard .tache-texte { color: var(--alerte); font-weight: 550; }
.tache.retard { background: color-mix(in srgb, var(--alerte-doux) 60%, transparent); }
.tache.prio-haute:not(.faite) { box-shadow: inset 3px 0 0 var(--attention); }
.case {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 19px; height: 19px; margin: 2px 0 0; border-radius: 6px;
  border: 1.6px solid var(--bord-fort); background: var(--surface); cursor: pointer; display: grid; place-items: center;
  transition: background-color .15s ease, border-color .15s ease;
}
.case:hover { border-color: var(--accent); }
.case:checked { background: var(--ok); border-color: var(--ok); }
.case:checked::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
[data-theme="sombre"] .case:checked::after { border-color: #10141a; }

/* Badges visibles en permanence (priorité, échéance) */
.tache { position: relative; }
.tache-badges { display: flex; gap: 4px; flex: none; margin-top: 1px; }
.badge { font-size: .74rem; padding: 1px 8px; border-radius: 20px; white-space: nowrap; line-height: 1.6; background: var(--surface-2); color: var(--encre-2); }
.prio-badge-haute { background: var(--attention-doux); color: var(--attention); font-weight: 600; }
.prio-badge-basse { color: var(--discret); }
.tache.retard .date-badge { background: var(--alerte-doux); color: var(--alerte); font-weight: 600; }
.tache.bientot .date-badge { background: var(--attention-doux); color: var(--attention); }

/* Boutons d'édition : posés par-dessus la ligne, visibles au survol */
.tache-meta {
  position: absolute; right: 4px; top: 3px;
  display: flex; align-items: center; gap: 2px; padding: 2px 2px 2px 14px;
  background: linear-gradient(90deg, transparent, var(--surface-2) 14px);
  border-radius: 0 10px 10px 0;
  opacity: 0; pointer-events: none; transition: opacity .15s ease;
}
.tache:hover .tache-meta, .tache:focus-within .tache-meta { opacity: 1; pointer-events: auto; }
.tache:has(.tache-texte:focus) .tache-meta { opacity: 0; pointer-events: none; }
.prio, .date-tache, .suppr {
  border: 0; background: var(--surface); color: var(--encre-2); cursor: pointer; font-size: .76rem;
  padding: 2px 8px; border-radius: 20px; white-space: nowrap; line-height: 1.5;
  box-shadow: inset 0 0 0 1px var(--bord);
}
.prio:hover, .date-tache:hover { color: var(--encre); box-shadow: inset 0 0 0 1px var(--bord-fort); }
.prio[data-prio="haute"] { background: var(--attention-doux); color: var(--attention); font-weight: 600; }
.date-tache { position: relative; display: inline-flex; }
.date-tache input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.date-tache input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }
.suppr { display: inline-grid; place-items: center; padding: 3px; }
.suppr .icone { width: 15px; height: 15px; }
.suppr:hover { color: var(--alerte); }
.ligne .suppr, tr .suppr { background: none; box-shadow: none; color: var(--discret); opacity: 0; transition: opacity .15s ease; }
.ligne:hover .suppr, tr:hover .suppr, .suppr:focus-visible { opacity: 1; }
@media (hover: none) {
  .tache { flex-wrap: wrap; }
  .tache-meta { position: static; opacity: 1; pointer-events: auto; background: none; padding: 2px 0 0 29px; width: 100%; }
  .tache:has(.tache-texte:focus) .tache-meta { opacity: 1; pointer-events: auto; }
  .tache-badges { display: none; }
  .ligne .suppr, tr .suppr { opacity: 1; }
}

.ajout-ligne {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
  padding: 4px 8px; border-radius: 10px; border: 1px dashed var(--bord-fort);
  transition: border-color .15s ease, background-color .15s ease;
}
.ajout-ligne:focus-within { border-style: solid; border-color: var(--accent); background: var(--surface); }
.ajout-plus { color: var(--discret); font-size: 1.1rem; width: 16px; text-align: center; }
.ajout-ligne input[type="text"], .ajout-ligne input:not([type]) { flex: 1; min-width: 0; border: 0; background: none; padding: 6px 0; outline: none; }
.ajout-ligne input.court { flex: 0 0 80px; }
.ajout-ligne select { border: 0; background: var(--surface-2); border-radius: 8px; padding: 4px 6px; font-size: .82rem; color: var(--encre-2); max-width: 40%; }
.ajout-ligne input[type="date"], .date-discrete { border: 0; background: var(--surface-2); border-radius: 8px; padding: 3px 6px; font-size: .82rem; color: var(--encre-2); }
.ajout-seo input { border-left: 1px solid var(--bord) !important; padding-left: 8px !important; }
.ajout-seo input:first-of-type { border-left: 0 !important; padding-left: 0 !important; }

.tache.surbrillance, .ligne.surbrillance { background: var(--accent-doux); }

/* Accueil : les prochaines choses à faire */
.prochaines { list-style: none; margin: 0; padding: 0; }
.prochaine { display: flex; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--bord); align-items: flex-start; transition: opacity .3s ease; }
.prochaine:first-child { border-top: 0; padding-top: 2px; }
.prochaine-texte { display: flex; flex-direction: column; min-width: 0; }
.prochaine-titre { font-weight: 550; font-size: 1.02rem; }
.prochaine.retard .prochaine-titre { color: var(--alerte); }
.prochaine-meta { font-size: .84rem; color: var(--discret); }
.prochaine-meta a { color: var(--discret); }
.prochaine.faite { opacity: .45; }
.prochaine.faite .prochaine-titre { text-decoration: line-through; }
.case-conteneur { display: flex; }

/* --- Documents ------------------------------------------------------------------------- */
.doc-onglets { display: flex; gap: 4px; flex-wrap: wrap; margin: -4px 0 12px; }
.doc-onglets button {
  border: 0; background: none; padding: 5px 11px; border-radius: 20px; cursor: pointer;
  color: var(--encre-2); font-size: .86rem; transition: background-color .15s ease, color .15s ease;
}
.doc-onglets button:hover { background: var(--surface-2); }
.doc-onglets button.actif { background: var(--accent-doux); color: var(--accent); font-weight: 600; }
.doc-onglets button.est-vide:not(.actif) { color: var(--discret); }
.doc-onglets button.est-vide::after { content: " ·"; opacity: .6; }
.doc-barre { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; min-height: 30px; }
.doc-etat { color: var(--discret); font-size: .8rem; margin-right: auto; }
.doc-etat.enregistre { color: var(--ok); }
.doc-etat.erreur { color: var(--alerte); }
.doc-rendu { position: relative; }
.doc-rendu.replie { max-height: 380px; overflow: hidden; }
.doc-rendu.replie::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 80px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.deplier { margin-top: 6px; }
.doc-editeur {
  width: 100%; min-height: 260px; resize: vertical; padding: 12px 14px;
  border: 1px solid var(--accent); border-radius: 12px; background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-doux); line-height: 1.55; font-size: .92rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.doc-editeur:focus { outline: none; }
.note-ouverte { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--bord); }
.note-titre { margin-right: auto; }

.prose { overflow-wrap: anywhere; color: var(--encre); }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 1.25rem; margin: 1.1em 0 .45em; }
.prose h2 { font-size: 1.08rem; margin: 1.1em 0 .4em; }
.prose h3, .prose h4 { font-size: .98rem; margin: 1em 0 .35em; }
.prose p, .prose ul, .prose ol { margin: 0 0 .7em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .15em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .9rem; margin: .6em 0 1em; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--bord); padding: 5px 9px; text-align: left; }
.prose th { background: var(--surface-2); }
.prose pre { background: var(--surface-2); padding: 10px 12px; border-radius: 10px; overflow-x: auto; font-size: .84rem; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose blockquote { margin: 0 0 .7em; padding-left: 12px; border-left: 3px solid var(--bord-fort); color: var(--encre-2); }
.prose hr { border: 0; border-top: 1px solid var(--bord); margin: 1.2em 0; }

/* --- Widgets des onglets --------------------------------------------------------------- */
.commandes { list-style: none; margin: 0; padding: 0; }
.commande { padding: 12px 0; border-top: 1px solid var(--bord); }
.commande:first-child { border-top: 0; padding-top: 0; }
.commande-haut { display: flex; justify-content: space-between; gap: 12px; }
.commande-droite { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.etapes { list-style: none; display: flex; margin: 10px 0 0; padding: 0; gap: 4px; }
.etapes li { flex: 1; font-size: .72rem; color: var(--discret); min-width: 0; }
.etapes li::before { content: ""; display: block; height: 5px; border-radius: 5px; background: var(--surface-3); margin-bottom: 4px; }
.etapes li span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etapes li.passee::before { background: color-mix(in srgb, var(--accent) 45%, var(--surface-3)); }
.etapes li.courante::before { background: var(--accent); }
.etapes li.courante { color: var(--encre); font-weight: 650; }

.grand-chiffre-editable { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 8px; }
.grand-chiffre { font-size: 3rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; min-width: 1ch; border-radius: 10px; padding: 0 6px; margin-left: -6px; align-self: flex-start; }
.grand-chiffre:empty::before { content: attr(data-vide); color: var(--discret); font-weight: 500; }
.grand-chiffre-legende { color: var(--discret); font-size: .84rem; }
.editable { border-radius: 6px; outline: none; transition: background-color .15s ease, box-shadow .15s ease; cursor: text; }
.editable:hover { background: var(--surface-2); }
.editable:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--accent-doux), 0 0 0 1px var(--accent); }
.editable[data-placeholder]:empty::before { content: attr(data-placeholder); color: var(--discret); opacity: .7; }
td.editable:empty::before { content: "—"; color: var(--discret); }

.machines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.machine { border: 1px solid var(--bord); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.machine.etat-printing { border-color: color-mix(in srgb, var(--ok) 35%, var(--bord)); }
.machine.etat-off, .machine.etat-inconnu { background: var(--surface-2); }
.machine-haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.machine-nom { font-weight: 700; }
.machine-modele { color: var(--discret); font-size: .78rem; margin-top: -3px; }
.machine-job { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.machine-restant { font-size: .8rem; color: var(--encre-2); font-variant-numeric: tabular-nums; }

.sites { list-style: none; margin: 0; padding: 0; }
.site { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-top: 1px solid var(--bord); }
.site:first-child { border-top: 0; padding-top: 2px; }
.site-texte { flex: 1; min-width: 0; }
.site-droite { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.site.en-panne { background: var(--alerte-doux); border-radius: 12px; padding-left: 10px; padding-right: 10px; }
.voyant { width: 10px; height: 10px; border-radius: 50%; background: var(--discret); flex: none; display: inline-block; }
.voyant.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-doux); }
.voyant.ko { background: var(--alerte); box-shadow: 0 0 0 4px var(--alerte-doux); }
.jauges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mesure { box-shadow: none; gap: 5px; }
.mesure .cc-valeur { font-size: 1.6rem; }
.services { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.services li { display: flex; align-items: center; gap: 8px; font-weight: 550; }

.legende { display: flex; gap: 16px; flex-wrap: wrap; margin: -6px 0 12px; font-size: .86rem; }
.legende-item { display: inline-flex; align-items: center; gap: 6px; }
.pastille-couleur { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.serie-1 { --serie: var(--serie-1); }
.serie-2 { --serie: var(--serie-2); }
.pastille-couleur { background: var(--serie); }
.titre-mois { text-transform: none; }
.navigation-mois { gap: 4px; }
.calendrier { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; margin: 0 -4px; width: calc(100% + 8px); }
.calendrier th { font-size: .74rem; font-weight: 600; color: var(--discret); padding-bottom: 2px; }
.calendrier td { height: 84px; vertical-align: top; background: var(--surface-2); border-radius: 10px; padding: 5px 6px; }
.calendrier td.passe { opacity: .6; }
.calendrier td.hors-mois { background: none; }
.calendrier td.aujourdhui { box-shadow: inset 0 0 0 2px var(--accent); opacity: 1; }
.cal-jour { display: block; font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.cal-occupe { display: block; height: 7px; border-radius: 4px; margin-top: 3px; background: var(--surface-3); }
.cal-occupe.oui { background: var(--serie); }
.cal-occupe.oui.arrivee { margin-left: 45%; }
.draps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.draps li { display: flex; justify-content: space-between; gap: 10px; }

.graphique { margin: 0; }
.graphique svg { width: 100%; height: auto; max-height: 280px; display: block; overflow: visible; }
.graphique .axe { stroke: var(--bord-fort); stroke-width: 1; }
.graphique .zone { fill: transparent; }
.graphique .barre-graph { fill: var(--serie-1); opacity: .78; transition: opacity .15s ease; }
.graphique .courant .barre-graph { opacity: 1; }
.graphique .barre-groupe:hover .barre-graph, .graphique .barre-groupe:focus .barre-graph { opacity: 1; }
.graphique .barre-groupe:hover .zone { fill: var(--surface-2); }
.graphique .barre-groupe { outline: none; cursor: default; }
.graphique .valeur-graph { fill: var(--encre); font-size: 13px; font-weight: 650; }
.graphique .libelle-graph { fill: var(--discret); font-size: 12px; }
.tableau-donnees { margin-top: 8px; font-size: .84rem; }
.tableau-donnees summary { color: var(--discret); cursor: pointer; }
.tableau-donnees table { margin-top: 6px; border-collapse: collapse; }
.tableau-donnees td { padding: 2px 16px 2px 0; }
.infobulle {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--encre); color: var(--surface); font-size: .82rem; font-weight: 600;
  padding: 5px 10px; border-radius: 8px; box-shadow: var(--ombre-haute);
  transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap;
}

.points { columns: 2 380px; column-gap: 18px; }
.point { break-inside: avoid; display: inline-block; width: 100%; }
.point h2 a { color: var(--encre); }
.point-vide { background: transparent; box-shadow: none; }
.resume-etat { font-size: .92rem; }

/* --- Dialogue d'ajout rapide ---------------------------------------------------------- */
.dialogue {
  border: 1px solid var(--bord); border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px));
  background: var(--surface); color: var(--encre); box-shadow: var(--ombre-haute);
  margin-top: 12vh;
}
.dialogue[open] { animation: apparition .16s ease-out; }
.dialogue::backdrop { background: rgba(15, 18, 22, .35); backdrop-filter: blur(2px); }
.form-ajout { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.form-ajout h2 { font-size: 1.05rem; }
.form-ajout > input { font-size: 1.05rem; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 11px; background: var(--surface-2); }
.form-ajout > input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); background: var(--surface); }
.form-ajout .aide { font-size: .8rem; color: var(--discret); margin: -2px 0 0; }
.form-ligne { display: flex; gap: 10px; }
.form-ligne label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--encre-2); }
.form-ligne select, .form-ligne input { padding: 7px 9px; border: 1px solid var(--bord); border-radius: 9px; background: var(--surface-2); font-size: .92rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* --- Notifications ------------------------------------------------------------------------ */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  background: var(--encre); color: var(--surface); padding: 10px 16px; border-radius: 12px;
  box-shadow: var(--ombre-haute); font-size: .92rem; animation: apparition .2s ease-out;
  transition: opacity .3s ease, transform .3s ease; max-width: calc(100vw - 24px);
}
.toast.erreur { background: var(--alerte); color: #fff; }
.toast button { border: 0; background: none; color: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 0; }
.toast.sortie { opacity: 0; transform: translateY(6px); }

/* --- Connexion ---------------------------------------------------------------------------- */
.page-connexion { display: grid; place-items: center; padding: 20px; }
.connexion { width: min(360px, 100%); text-align: center; animation: apparition .3s ease-out; }
.connexion h1 { margin: 16px 0 2px; font-size: 1.5rem; }
.connexion-form { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.connexion-form input { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--bord); background: var(--surface); font-size: 1rem; text-align: center; }
.connexion-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }
.connexion-form .bouton { padding: 11px; font-size: 1rem; }
.message-erreur { color: var(--alerte); margin: 4px 0 0; }

/* --- Pied de page ------------------------------------------------------------------------- */
.pied {
  max-width: 1320px; width: 100%; margin: 0 auto; padding: 8px 24px 26px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--discret); font-size: .8rem;
}
.pied a { color: var(--discret); }

/* --- Écrans moyens ---------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .cartes-chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .raccourci span { display: none; }
  .raccourci { padding: 9px; }
}
@media (max-width: 980px) {
  .grille-2, .grille-2.large-gauche, .grille-bas, .grille-accueil { grid-template-columns: minmax(0, 1fr); }
  .chiffres-cles, .jauges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .societes { grid-template-columns: minmax(0, 1fr); }
  .salon { grid-template-columns: minmax(0, 1fr); }
  .bloc-agents-salon { display: none; }
}

/* --- Téléphone ------------------------------------------------------------------------------ */
@media (max-width: 640px) {
  body { font-size: 15px; }
  html { scroll-padding-top: 150px; }
  .entete-ligne { flex-wrap: wrap; padding: 8px 14px 4px; gap: 8px; }
  .marque-nom { display: none; }
  .mini-ca { font-size: .72rem; gap: 7px; }
  /* Tout tient sur une ligne : logo, repère, raccourcis, thème */
  .raccourcis { gap: 0; }
  .raccourci { padding: 7px 6px; }
  .bouton-theme { width: 34px; height: 34px; }
  .recherche { order: 3; flex-basis: 100%; max-width: none; }
  .raccourci-indice { display: none; }
  .raccourcis { margin-left: auto; }
  .navigation { padding: 0 8px; }
  .navigation a { padding: 8px 10px 10px; }
  .contenu { padding: 18px 12px 30px; }
  .bloc { padding: 16px 14px; border-radius: 16px; }
  .cartes-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .carte-chiffre { padding: 12px 13px; }
  .carte-chiffre:last-child:nth-child(odd) { grid-column: span 2; }
  .cc-valeur { font-size: 1.6rem; }
  .chiffre-cle .cc-valeur { font-size: 1.7rem; }
  .titre-onglet h1 { font-size: 1.45rem; }
  .jauges { grid-template-columns: minmax(0, 1fr); }
  .calendrier td { height: 48px; padding: 3px 4px; border-radius: 7px; }
  .calendrier { border-spacing: 2px; }
  .cal-occupe { height: 5px; }
  .message { max-width: 94%; }
  #fil { height: calc(100vh - 360px); padding: 14px; }
  .saisie-salon { flex-wrap: wrap; }
  .saisie-salon select { width: 100%; }
  .agent-role { white-space: normal; }
  .pied span { display: none; }
  .ajout-seo { flex-wrap: wrap; }
  .dialogue { margin-top: 8vh; }
  .form-ligne { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Thème « Bureau », version panneau d'organisation
   Cette couche est la palette qui gagne : fonds encre et papier, accents
   ambre et cyan, lueurs discrètes. Les jetons de géométrie suivent plus bas.
   ========================================================================== */
:root, [data-theme="clair"] {
  --fond: #eef1f3;
  --surface: #ffffff;
  --surface-2: #e9edf0;
  --surface-3: #dfe4e8;
  --bord: #dbe1e6;
  --bord-fort: #c3ccd3;
  --encre: #0e1216;
  --encre-2: #3d454e;
  --discret: #6b747d;
  --accent: #9a6a14;
  --accent-fort: #7d5510;
  --accent-doux: #faf1de;
  --verre: rgba(255, 255, 255, .86);
  --verre-fort: rgba(255, 255, 255, .95);
  --verre-bord: rgba(14, 18, 22, .07);
  --lueur-1: rgba(224, 161, 60, .10);
  --lueur-2: rgba(95, 182, 196, .09);
  --lueur-3: rgba(224, 161, 60, .05);
  --degrade: linear-gradient(120deg, #9a6a14 0%, #2f7f8c 100%);
  --ok: #2f7a4e;
  --ok-doux: #e4f2e9;
  --attention: #8a5a12;
  --attention-doux: #fbf0dc;
  --alerte: #b8432f;
  --alerte-doux: #fbe8e4;
  --serie-1: #2f7f8c;
  --serie-2: #a86a15;
  --ombre: 0 1px 2px rgba(14, 18, 22, .05), 0 4px 16px rgba(14, 18, 22, .06);
  --ombre-haute: 0 18px 40px -24px rgba(14, 18, 22, .35);
  color-scheme: light;
}
[data-theme="sombre"] {
  --fond: #0e1216;
  --surface: #141a20;
  --surface-2: #1b232b;
  --surface-3: #222c36;
  --bord: #252f39;
  --bord-fort: #33414d;
  --encre: #e9edf0;
  --encre-2: #9aa7b2;
  --discret: #5d6a75;
  --accent: #e0a13c;
  --accent-fort: #f0b455;
  --accent-doux: #3a2d17;
  --verre: rgba(20, 26, 32, .72);
  --verre-fort: rgba(20, 26, 32, .92);
  --verre-bord: rgba(255, 255, 255, .07);
  --lueur-1: rgba(224, 161, 60, .16);
  --lueur-2: rgba(95, 182, 196, .12);
  --lueur-3: rgba(224, 161, 60, .08);
  --degrade: linear-gradient(120deg, #e0a13c 0%, #5fb6c4 100%);
  --ok: #6fbf8b;
  --ok-doux: #16291f;
  --attention: #e0a13c;
  --attention-doux: #30261a;
  --alerte: #d9705f;
  --alerte-doux: #331d19;
  --serie-1: #5fb6c4;
  --serie-2: #e0a13c;
  --ombre: 0 1px 0 rgba(255, 255, 255, .03), 0 18px 40px -24px rgba(0, 0, 0, .9);
  --ombre-haute: 0 24px 60px -24px rgba(0, 0, 0, .95);
  color-scheme: dark;
}
body { word-spacing: .06em; font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fond); }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* Fond : trois lueurs qui dérivent lentement */
.aurore { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurore span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: .9; }
.aurore span:nth-child(1) { background: radial-gradient(circle, var(--lueur-1), transparent 65%); top: -25vmax; left: -10vmax; animation: derive-1 26s ease-in-out infinite alternate; }
.aurore span:nth-child(2) { background: radial-gradient(circle, var(--lueur-2), transparent 65%); bottom: -30vmax; right: -15vmax; animation: derive-2 32s ease-in-out infinite alternate; }
.aurore span:nth-child(3) { background: radial-gradient(circle, var(--lueur-3), transparent 65%); top: 30%; left: 40%; width: 40vmax; height: 40vmax; animation: derive-3 22s ease-in-out infinite alternate; }
.aurore::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
[data-theme="clair"] .aurore::after { background-image: radial-gradient(rgba(40,40,90,.06) 1px, transparent 1px); }
@keyframes derive-1 { to { transform: translate(18vw, 14vh) scale(1.15); } }
@keyframes derive-2 { to { transform: translate(-16vw, -12vh) scale(1.1); } }
@keyframes derive-3 { to { transform: translate(-22vw, 10vh) scale(.85); } }

/* En-tête en verre */
.entete { background: var(--verre); border-bottom: 1px solid var(--verre-bord); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); }
.marque-logo { background: var(--degrade); color: #fff !important; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent); }
.marque-nom { letter-spacing: -.02em; }
.bouton-theme { background: var(--verre); border-color: var(--verre-bord); transition: transform .3s ease, color .15s ease; }
.bouton-theme:hover { transform: rotate(25deg); }
.navigation a { position: relative; border-bottom: 0; }
.navigation a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 3px; border-radius: 3px;
  background: var(--degrade); transform: scaleX(0); transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.navigation a:hover::after { transform: scaleX(.4); }
.navigation a.actif::after { transform: scaleX(1); }
.bouton.principal { background: var(--degrade); border: 0; color: #fff; }
[data-theme="sombre"] .bouton.principal { color: #120f2a; }
.toast { background: var(--verre-fort); color: var(--encre); border: 1px solid var(--verre-bord); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.dialogue { border-radius: 20px; }

/* --- Dock latéral --------------------------------------------------------- */
body { padding-left: 104px; }
.dock {
  position: fixed; left: 16px; top: 50%; transform: translateY(-50%); z-index: 30;
  display: flex; flex-direction: column; gap: 12px; padding: 14px 12px;
  background: var(--verre); border: 1px solid var(--verre-bord); border-radius: 28px;
  backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
  box-shadow: var(--ombre-haute);
  animation: dock-entree .6s cubic-bezier(.2,.9,.2,1.2) both;
}
@keyframes dock-entree { from { opacity: 0; transform: translate(-40px, -50%); } }
.dock-appli {
  --zoom: 1; position: relative; display: block; width: 52px; height: 52px;
  transform: scale(var(--zoom)); transform-origin: left center;
  margin: calc((var(--zoom) - 1) * 16px) 0;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), margin .18s cubic-bezier(.2,.8,.2,1);
}
.dock-appli:hover { text-decoration: none; }
.dock-icone {
  display: grid; place-items: center; width: 100%; height: 100%; overflow: hidden;
  border-radius: 15px; background: var(--fond-logo, #fff);
  box-shadow: 0 4px 12px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.12);
}
.dock-icone img { width: 76%; height: 76%; object-fit: contain; }
.dock-icone.plein img { width: 100%; height: 100%; object-fit: cover; }
.dock-icone.recadre img { width: 100%; height: 100%; object-fit: cover; object-position: 0 50%; }
.dock-icone.zoom img { width: 125%; height: 125%; }
.dock-appli::after {
  content: ""; position: absolute; left: -7px; top: 50%; width: 4px; height: 4px; border-radius: 50%;
  background: var(--encre-2); opacity: 0; transform: translateY(-50%); transition: opacity .2s ease;
}
.dock-appli:hover::after, .dock-appli:focus-visible::after { opacity: .7; }
.dock-bulle {
  position: absolute; left: calc(100% + 16px); top: 50%; white-space: nowrap; pointer-events: none;
  display: flex; flex-direction: column; line-height: 1.2;
  padding: 7px 12px; border-radius: 11px; font-weight: 650; font-size: .88rem; color: var(--encre);
  background: var(--verre-fort); border: 1px solid var(--verre-bord); box-shadow: var(--ombre-haute);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; transform: translate(-8px, -50%) scale(calc(1 / var(--zoom))); transform-origin: left center;
  transition: opacity .15s ease, transform .2s cubic-bezier(.2,.8,.2,1);
}
.dock-bulle small { font-weight: 500; font-size: .74rem; color: var(--discret); }
.dock-appli:hover .dock-bulle, .dock-appli:focus-visible .dock-bulle { opacity: 1; transform: translate(0, -50%) scale(calc(1 / var(--zoom))); }
.dock-appli.rebond .dock-icone { animation: rebond .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes rebond { 30% { transform: translateX(10px); } 60% { transform: translateX(-2px); } }

/* --- To-do de l'accueil --------------------------------------------------- */
body[data-page="accueil"] .contenu { max-width: 1060px; padding-top: 34px; }
.tt-hero { margin-bottom: 22px; }
.tt-date { color: var(--discret); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.tt-hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.degrade {
  background: var(--degrade); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: brillance 8s linear infinite;
}
@keyframes brillance { to { background-position: 200% center; } }
.tt-phrase { color: var(--encre-2); margin: 8px 0 0; font-size: 1.02rem; }

.tt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tt-stat {
  --teinte: var(--serie-1);
  position: relative; overflow: hidden; text-align: left; cursor: pointer; font: inherit; color: var(--encre);
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 14px 16px; border-radius: 20px;
  background: var(--verre); border: 1px solid var(--verre-bord); box-shadow: var(--ombre);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, border-color .2s ease;
}
.tt-stat.alerte { --teinte: #fb7185; }
.tt-stat.chaud { --teinte: #fbbf24; }
.tt-stat.feu { --teinte: #f472b6; }
.tt-stat::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--teinte) 22%, transparent), transparent 60%);
}
.tt-stat:hover { transform: translateY(-3px); box-shadow: var(--ombre-haute); }
.tt-stat:hover::before, .tt-stat.actif::before { opacity: 1; }
.tt-stat.actif { border-color: color-mix(in srgb, var(--teinte) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--teinte) 50%, transparent), 0 10px 30px color-mix(in srgb, var(--teinte) 25%, transparent); }
.tt-stat-icone {
  grid-row: span 2; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; position: relative;
  background: color-mix(in srgb, var(--teinte) 18%, transparent); color: var(--teinte);
}
.tt-stat-icone svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tt-stat-nombre { position: relative; font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tt-stat-nom { position: relative; color: var(--encre-2); font-size: .82rem; font-weight: 550; }
.tt-stat.alerte:not(.zero) .tt-stat-icone { animation: pouls 2.4s ease-in-out infinite; }
.tt-stat.zero .tt-stat-nombre { color: var(--discret); }
@keyframes pouls { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--teinte) 0%, transparent), 0 0 0 0 transparent; background: color-mix(in srgb, var(--teinte) 30%, transparent); } }

.tt-panneau {
  background: var(--verre); border: 1px solid var(--verre-bord); border-radius: 26px; box-shadow: var(--ombre-haute);
  backdrop-filter: saturate(1.4) blur(22px); -webkit-backdrop-filter: saturate(1.4) blur(22px);
  padding: 18px;
}

.tt-ajout {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--bord); transition: border-color .2s ease, box-shadow .2s ease;
}
.tt-ajout:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.tt-ajout-plus { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--degrade); color: #fff; transition: transform .3s cubic-bezier(.2,.8,.2,1.4); }
.tt-ajout:focus-within .tt-ajout-plus { transform: rotate(90deg); }
.tt-ajout-plus svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.tt-ajout input { flex: 1; min-width: 0; height: 40px; border: 0; background: none; outline: none; font-size: 1rem; }
.tt-ajout input::placeholder { color: var(--discret); }
.tt-ajout select, .tt-choix select {
  height: 36px; border-radius: 11px; border: 1px solid var(--bord); background: var(--surface-2); padding: 0 10px; cursor: pointer; max-width: 170px;
}
.tt-bouton {
  height: 40px; padding: 0 18px; border: 0; border-radius: 13px; cursor: pointer; font-weight: 700; color: #fff;
  background: var(--degrade); background-size: 150% auto; transition: background-position .4s ease, transform .15s ease, box-shadow .2s ease;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
[data-theme="sombre"] .tt-bouton { color: #120f2a; }
.tt-bouton:hover { background-position: 100% center; transform: translateY(-1px); }
.tt-bouton:active { transform: scale(.97); }

.tt-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 12px; }
.tt-cherche { position: relative; flex: 1 1 220px; display: flex; align-items: center; }
.tt-cherche svg { position: absolute; left: 12px; width: 17px; height: 17px; fill: none; stroke: var(--discret); stroke-width: 2; stroke-linecap: round; }
.tt-cherche input { width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: 12px; border: 1px solid var(--bord); background: var(--surface); outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
.tt-cherche input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.tt-segment { display: inline-flex; padding: 3px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--bord); }
.tt-segment button { border: 0; background: none; padding: 6px 13px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--encre-2); transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.tt-segment button.actif { background: var(--surface); color: var(--encre); box-shadow: var(--ombre); }
.tt-choix { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600; color: var(--discret); }
.tt-effacer { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--accent); font-weight: 650; font-size: .85rem; cursor: pointer; padding: 6px 8px; border-radius: 9px; }
.tt-effacer:hover { background: var(--accent-doux); }
.tt-effacer svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.tt-filtres { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--bord); }
.tt-ligne { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.tt-etiquette { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--discret); width: 76px; flex: none; }
.tt-puces { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.tt-puce {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--bord); background: var(--surface); color: var(--encre-2); font-size: .82rem; font-weight: 600;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .15s ease;
}
.tt-puce:hover { border-color: var(--bord-fort); color: var(--encre); }
.tt-puce:active { transform: scale(.95); }
.tt-puce b { font-weight: 700; font-size: .72rem; min-width: 18px; padding: 1px 5px; border-radius: 999px; background: var(--surface-3); color: var(--encre-2); text-align: center; }
.tt-puce.actif { background: var(--encre); color: var(--fond); border-color: var(--encre); }
.tt-puce.actif b { background: color-mix(in srgb, var(--fond) 20%, transparent); color: inherit; }
.tt-point { --c: var(--accent); display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.tt-point.haute { --c: var(--alerte); } .tt-point.normale { --c: var(--serie-1); } .tt-point.basse { --c: var(--discret); }

.tt-ouvrir-filtres { display: none; }
.tt-resume { margin: 10px 2px 0; font-size: .8rem; color: var(--discret); min-height: 1em; }
.tt-liste { margin-top: 6px; }
.tt-groupe { margin-top: 14px; }
.tt-groupe-titre { display: flex; align-items: center; gap: 9px; font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-2); margin: 0 4px 8px; }
.tt-groupe { --c: var(--accent); }
.tt-groupe-titre .tt-point { background: var(--c); }
.tt-groupe-titre span { font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); letter-spacing: 0; }
.tt-taches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.tt-tache {
  --c: var(--accent);
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 11px 12px 11px 16px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--bord); overflow: hidden;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, border-color .2s ease, opacity .35s ease, max-height .35s ease, background .3s ease;
}
.tt-tache::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); transition: top .2s ease, bottom .2s ease; }
.tt-tache:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--c) 45%, var(--bord)); box-shadow: 0 8px 24px color-mix(in srgb, var(--c) 14%, transparent); }
.tt-tache:hover::before { top: 0; bottom: 0; }
.tt-tache.retard { background: linear-gradient(90deg, color-mix(in srgb, #fb7185 9%, var(--surface)), var(--surface) 55%); }
.tt-tache.entree { animation: tache-entree .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes tache-entree { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.tt-tache.nouvelle { animation: tache-nouvelle 1.4s ease; }
@keyframes tache-nouvelle { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); transform: scale(.97); } 30% { transform: scale(1.01); } 100% { box-shadow: 0 0 0 14px transparent; } }
.tt-tache.enregistre { border-color: #34d399; }
.tt-tache.sortie { opacity: 0; transform: translateX(40px); }

.tt-case {
  flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 8px; cursor: pointer; padding: 0; display: grid; place-items: center;
  border: 2px solid color-mix(in srgb, var(--c) 60%, var(--bord-fort)); background: transparent; color: #fff;
  transition: background .25s ease, border-color .25s ease, transform .2s cubic-bezier(.3,1.6,.5,1);
}
.tt-case:hover { transform: scale(1.12); background: color-mix(in srgb, var(--c) 14%, transparent); }
.tt-case svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .35s ease .05s; }
.tt-tache.faite .tt-case { background: var(--c); border-color: var(--c); animation: case-pop .4s cubic-bezier(.3,1.6,.5,1); }
.tt-tache.faite .tt-case svg { stroke-dashoffset: 0; }
@keyframes case-pop { 40% { transform: scale(1.25); } }
.tt-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tt-texte { outline: none; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; font-weight: 550; overflow-wrap: anywhere; position: relative; background-image: linear-gradient(var(--discret), var(--discret)); background-size: 0 1.5px; background-position: 0 55%; background-repeat: no-repeat; transition: background-size .35s ease, color .3s ease; }
.tt-texte:focus { background-color: var(--surface-2); box-shadow: 0 0 0 2px var(--accent); }
.tt-tache.faite .tt-texte { color: var(--discret); background-size: 100% 1.5px; }
.tt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .76rem; color: var(--discret); }
.tt-meta:empty { display: none; }
.tt-projet, .tt-souscat, .tt-date-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-weight: 600; }
.tt-projet .tt-point { width: 7px; height: 7px; box-shadow: none; }
.tt-date-badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.tt-date-badge.jour { background: color-mix(in srgb, #fbbf24 20%, transparent); color: #d4930a; }
.tt-date-badge.retard { background: color-mix(in srgb, #fb7185 18%, transparent); color: #f43f5e; }
[data-theme="sombre"] .tt-date-badge.jour { color: #fcd34d; }
[data-theme="sombre"] .tt-date-badge.retard { color: #fda4af; }

.tt-actions { display: flex; align-items: center; gap: 2px; flex: none; opacity: .35; transition: opacity .2s ease; }
.tt-tache:hover .tt-actions, .tt-tache:focus-within .tt-actions { opacity: 1; }
.tt-actions button, .tt-choisir-date {
  position: relative; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--discret);
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.tt-actions button:hover, .tt-choisir-date:hover { background: var(--surface-2); color: var(--encre); }
.tt-actions button:active { transform: scale(.9); }
.tt-actions svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tt-prio[data-prio="haute"] { color: #fb7185; }
.tt-prio[data-prio="haute"] svg { fill: color-mix(in srgb, #fb7185 35%, transparent); }
.tt-prio[data-prio="basse"] { color: var(--bord-fort); }
.tt-tache.prio-haute .tt-actions { opacity: 1; }
.tt-tache.prio-haute .tt-actions > :not(.tt-prio) { opacity: .35; }
.tt-tache.prio-haute:hover .tt-actions > * { opacity: 1; }
.tt-suppr:hover { color: #f43f5e !important; background: color-mix(in srgb, #fb7185 14%, transparent) !important; }
.tt-choisir-date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.tt-choisir-date input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }

.tt-eclat {
  position: fixed; z-index: 90; width: 7px; height: 7px; border-radius: 2px; pointer-events: none; margin: -3px 0 0 -3px;
  animation: eclat .65s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes eclat { to { transform: translate(var(--dx), var(--dy)) rotate(200deg) scale(.2); opacity: 0; } }

.tt-vide { text-align: center; padding: 40px 10px; color: var(--encre-2); }
.tt-vide-icone { font-size: 2.6rem; margin-bottom: 6px; animation: flotte 3s ease-in-out infinite; }
@keyframes flotte { 50% { transform: translateY(-6px); } }
.tt-fantome { height: 50px; border-radius: 16px; margin-top: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: fantome 1.2s linear infinite; }
@keyframes fantome { to { background-position: -200% 0; } }

/* --- Téléphone : le dock passe en bas ------------------------------------- */
@media (max-width: 760px) {
  body { padding-left: 0; padding-bottom: 92px; }
  .dock {
    top: auto; bottom: 12px; left: 12px; right: 12px; transform: none; flex-direction: row; justify-content: space-between;
    padding: 9px 12px; border-radius: 24px; gap: 6px; animation-name: dock-entree-bas;
  }
  @keyframes dock-entree-bas { from { opacity: 0; transform: translateY(30px); } }
  .dock-appli { width: 46px; height: 46px; transform: none; margin: 0; }
  .dock-icone { border-radius: 13px; }
  .dock-bulle, .dock-appli::after { display: none; }
  .toasts { bottom: 104px; }
  body[data-page="accueil"] .contenu { padding-top: 20px; }
  .tt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tt-stat { padding: 11px 12px; border-radius: 16px; column-gap: 10px; }
  .tt-stat-icone { width: 36px; height: 36px; border-radius: 11px; }
  .tt-stat-nombre { font-size: 1.35rem; }
  .tt-stat-nom { font-size: .74rem; }
  .tt-panneau { padding: 12px; border-radius: 22px; margin: 0 -4px; }
  .tt-ajout { flex-wrap: wrap; }
  .tt-ajout input { flex-basis: calc(100% - 50px); }
  .tt-ajout select { flex: 1; max-width: none; }
  .tt-barre { gap: 8px; }
  .tt-cherche { flex: 1 1 100%; }
  .tt-segment button { white-space: nowrap; }
  .tt-ouvrir-filtres { order: 1; }
  .tt-ouvrir-filtres {
    display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 12px; cursor: pointer;
    border: 1px solid var(--bord); background: var(--surface); font-weight: 650; font-size: .85rem; color: var(--encre);
  }
  .tt-ouvrir-filtres svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .tt-ouvrir-filtres b { background: var(--accent); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 6px; }
  .tt-ouvrir-filtres b:empty { display: none; }
  .tt-panneau:not(.filtres-ouverts) .tt-filtres, .tt-panneau:not(.filtres-ouverts) .tt-choix { display: none; }
  .tt-panneau.filtres-ouverts .tt-filtres { animation: apparition .25s ease-out; }
  .tt-segment { order: 2; }
  .tt-choix { order: 3; flex: 1; } .tt-choix select { flex: 1; max-width: none; }
  .tt-effacer { order: 4; }
  .tt-segment { flex: 1; } .tt-segment button { flex: 1; padding: 6px 4px; }
  .tt-ligne { flex-wrap: nowrap; align-items: flex-start; flex-direction: column; gap: 5px; }
  .tt-etiquette { width: auto; }
  .tt-puces { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; padding-bottom: 2px; }
  .tt-puces::-webkit-scrollbar { display: none; }
  .tt-puce { flex: none; }
  .tt-actions { opacity: 1; }
  .tt-actions button, .tt-choisir-date { width: 30px; }
  .tt-tache { padding: 10px 8px 10px 13px; gap: 9px; }
  .tt-tache:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .aurore span, .degrade { animation: none !important; }
}

/* ==========================================================================
   V2 — rail à gauche, barre du haut, grille bento
   Direction : sobre et net. Des surfaces pleines, des traits fins, de l'air.
   Le rail remplace le menu du haut et le dock flottant ; il devient une
   barre en bas sur téléphone.
   ========================================================================== */

:root {
  --r-case: 18px;
  --r-dedans: 12px;
  --ombre-douce: 0 1px 2px rgba(25, 24, 18, .035), 0 6px 20px rgba(25, 24, 18, .045);
}
[data-theme="sombre"] {
  --ombre-douce: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .28);
}

body > .app { flex: 1 1 auto; }
/* Le dock flottant d'avant réservait 104 px à gauche : le rail le remplace. */
body { padding-left: 0; }
body[data-page="accueil"] .contenu { max-width: 1320px; padding-top: 22px; }
.app { display: flex; align-items: stretch; min-height: 100vh; }
.corps { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* --- Le rail -------------------------------------------------------------- */
.rail {
  flex: none; width: 250px; height: 100vh; position: sticky; top: 0; z-index: 40;
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-right: 1px solid var(--bord);
  transition: width .2s ease, transform .22s ease;
}
.rail-haut { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.rail-haut .marque { flex: 1 1 auto; min-width: 0; }
.marque-nom { font-size: 1.02rem; }
.rail-replier, .rail-fermer {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; cursor: pointer;
  border: 0; background: none; color: var(--discret); border-radius: 9px;
}
.rail-replier:hover, .rail-fermer:hover { background: var(--surface-2); color: var(--encre); }
.rail-fermer { display: none; }

.rail-groupe {
  margin: 14px 10px 4px; font-size: .67rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--discret);
}
.rail-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.rail-lien {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--r-dedans);
  color: var(--encre-2); font-size: .92rem; font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
}
.rail-lien:hover { background: var(--surface-2); color: var(--encre); text-decoration: none; }
.rail-lien.actif { background: var(--accent-doux); color: var(--accent-fort); font-weight: 650; }
.rail-lien.actif .rail-icone { color: var(--accent); }
.rail-lien.actif::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.rail-icone { width: 18px; height: 18px; color: var(--discret); }
.rail-lien:hover .rail-icone { color: var(--encre-2); }
.rail-texte { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-badge {
  flex: none; padding: 1px 7px; border-radius: 999px; font-size: .7rem; font-weight: 700;
  background: var(--alerte-doux); color: var(--alerte); font-variant-numeric: tabular-nums;
}

.rail-bas { margin-top: auto; padding-top: 16px; }
.rail-applis { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 10px 0; }
.rail-logo {
  width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden;
  border: 1px solid var(--bord); border-radius: 10px; background: var(--fond-logo, #fff);
  transition: transform .15s ease, border-color .15s ease;
}
.rail-appli:hover .rail-logo { transform: translateY(-2px); border-color: var(--bord-fort); }
.rail-logo img { width: 76%; height: 76%; object-fit: contain; }
.rail-logo.plein img { width: 100%; height: 100%; object-fit: cover; }
.rail-logo.recadre img { width: 100%; height: 100%; object-fit: cover; object-position: 0 50%; }
.rail-logo.zoom img { width: 125%; height: 125%; }
.rail-pied {
  margin-top: 14px; padding: 10px 10px 0; border-top: 1px solid var(--bord);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.rail-pied .mini-ca { font-size: .78rem; }
.rail-deco { color: var(--discret); font-size: .78rem; }

/* Rail replié : les icônes seules */
html[data-rail="replie"] .rail { width: 76px; padding-left: 10px; padding-right: 10px; }
html[data-rail="replie"] .rail-texte,
html[data-rail="replie"] .rail-groupe,
html[data-rail="replie"] .marque-nom,
html[data-rail="replie"] .rail-pied { display: none; }
html[data-rail="replie"] .rail-haut { justify-content: center; }
html[data-rail="replie"] .rail-haut .marque { flex: none; }
html[data-rail="replie"] .rail-lien { justify-content: center; padding: 11px 0; }
html[data-rail="replie"] .rail-badge { position: absolute; top: 2px; right: 2px; padding: 1px 5px; }
html[data-rail="replie"] .rail-applis { justify-content: center; padding: 0; }

/* --- Le voile (téléphone) -------------------------------------------------- */
.voile { position: fixed; inset: 0; z-index: 30; background: rgba(12, 14, 18, .45); animation: apparition .18s ease-out; }

/* --- La barre du haut ------------------------------------------------------ */
.barre-haut {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 22px; border-bottom: 1px solid var(--bord);
  background: color-mix(in srgb, var(--fond) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px);
}
.barre-haut .recherche { flex: 1 1 auto; max-width: 470px; }
.barre-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.barre-burger {
  display: none; width: 38px; height: 38px; flex: none; place-items: center; cursor: pointer;
  border: 1px solid var(--bord); background: var(--surface); color: var(--encre-2); border-radius: 11px;
}
.action {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px;
  border: 1px solid transparent; border-radius: 11px; background: none; cursor: pointer;
  color: var(--encre-2); font-size: .88rem; font-weight: 500; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.action:hover { background: var(--surface); color: var(--encre); border-color: var(--bord); text-decoration: none; }
.action.actif { background: var(--accent-doux); color: var(--accent-fort); }
.action .icone { width: 17px; height: 17px; }

/* --- Le fil d'Ariane et le contenu ---------------------------------------- */
.contenu { padding-top: 22px; }

/* --- Le mot du matin ------------------------------------------------------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 6px 2px 0; }
.hero-date { margin: 0 0 6px; color: var(--discret); font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.hero h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.35rem); font-weight: 700; letter-spacing: -.025em; }
.hero-phrase { margin: 8px 0 0; color: var(--encre-2); max-width: 62ch; }
.hero-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; }
.hero-actions .bouton { display: inline-flex; align-items: center; gap: 7px; }
.hero-actions .icone { width: 17px; height: 17px; }

/* --- Les sept chiffres, en bandeau ---------------------------------------- */
.cartes-chiffres { margin: 18px 0 0; gap: 10px; }
.cartes-chiffres .carte-chiffre { padding: 12px 14px; border-radius: 14px; box-shadow: none; }
.cartes-chiffres .cc-titre { min-height: 2.5em; font-size: .76rem; }
.cartes-chiffres .cc-valeur { font-size: 1.55rem; margin-top: 2px; }
.cartes-chiffres .cc-detail { font-size: .74rem; }

/* --- La grille bento ------------------------------------------------------- */
.bento { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; margin-top: 20px; align-items: start; }
.colonne { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cadre {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-case);
  padding: 18px; box-shadow: var(--ombre-douce); min-width: 0;
}
.cadre-entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cadre-entete h2 { display: flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 650; }
.cadre-entete h2 .icone { width: 17px; height: 17px; color: var(--discret); }
.cadre-entete-droite { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cadre-sous-titre { margin: 16px 0 4px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--discret); }
.cadre-sous-titre:first-of-type { margin-top: 0; }
.cadre-sous-titre.alerte { color: var(--alerte); }
.pied-cadre { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--bord); color: var(--discret); font-size: .8rem; }

/* --- Listes compactes ------------------------------------------------------ */
.liste-compacte { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.liste-compacte a, .ligne-simple {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: var(--r-dedans);
  color: var(--encre); font-size: .89rem; line-height: 1.35;
}
.liste-compacte a:hover { background: var(--surface-2); text-decoration: none; }
.liste-compacte small { margin-left: auto; padding-left: 10px; color: var(--discret); font-size: .75rem; white-space: nowrap; }
.liste-compacte .icone { width: 16px; height: 16px; color: var(--discret); flex: none; }
.liste-compacte a.en-retard { color: var(--alerte); }
.liste-compacte a.en-retard small { color: color-mix(in srgb, var(--alerte) 70%, var(--discret)); }

.liste-docs { list-style: none; margin: 0; padding: 0; }
.liste-docs a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 10px; padding: 8px 9px; border-radius: var(--r-dedans); color: var(--encre); }
.liste-docs a:hover { background: var(--surface-2); text-decoration: none; }
.doc-nom { font-size: .89rem; font-weight: 550; }
.doc-projet { font-size: .76rem; color: var(--discret); }
.liste-docs time { grid-row: 1 / span 2; grid-column: 2; color: var(--discret); font-size: .75rem; white-space: nowrap; }

/* --- Le salon et les agents dans une case --------------------------------- */
.fil-accueil { max-height: 340px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.fil-accueil .message { margin-bottom: 6px; }
.c-salon .saisie-salon { margin-top: 12px; }
.c-agents .agents { margin-top: 0; }

/* --- La to-do, à l'intérieur d'une case ------------------------------------ */
.cadre-entete .tt-phrase { margin: 0; color: var(--discret); font-size: .82rem; }
.c-taches .tt-stats { gap: 10px; margin-bottom: 14px; }
.c-taches .tt-stat {
  padding: 11px 13px; border-radius: 14px; column-gap: 10px;
  background: var(--surface-2); border: 1px solid var(--bord); box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.c-taches .tt-stat:hover { transform: none; border-color: var(--bord-fort); }
.c-taches .tt-stat.actif { border-color: color-mix(in srgb, var(--teinte) 60%, transparent); background: color-mix(in srgb, var(--teinte) 10%, var(--surface-2)); }
.c-taches .tt-stat-icone { width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--teinte) 16%, transparent); }
.c-taches .tt-stat-icone svg { width: 18px; height: 18px; }
.c-taches .tt-stat-nombre { font-size: 1.4rem; }
.c-taches .tt-stat-nom { font-size: .78rem; }
.c-taches .tt-stat.alerte:not(.zero) .tt-stat-icone { animation: none; }
.c-taches .tt-panneau {
  padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}

/* --- La barre du bas (téléphone) ------------------------------------------- */
.barre-basse {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-top: 1px solid var(--bord);
}
.barre-basse a, .barre-basse button {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border: 0; background: none; border-radius: var(--r-dedans); cursor: pointer;
  color: var(--discret); font-size: .67rem; font-weight: 600;
}
.barre-basse a:hover, .barre-basse button:hover { color: var(--encre); text-decoration: none; }
.barre-basse a.actif { color: var(--accent); }
.barre-basse .icone { width: 21px; height: 21px; }

/* --- Téléphone et tablettes ------------------------------------------------ */
@media (max-width: 1100px) {
  /* Une seule colonne : les cadres reprennent l'ordre de lecture du téléphone */
  .bento { grid-template-columns: minmax(0, 1fr); }
  .colonne { display: contents; }
  .c-taches { order: 1; } .c-jour { order: 2; } .c-agents { order: 3; } .c-salon { order: 4; } .c-docs { order: 5; }
}
@media (max-width: 1023px) {
  .rail {
    position: fixed; top: 0; bottom: 0; left: 0; height: 100%; width: 272px;
    transform: translateX(-102%); box-shadow: var(--ombre-haute);
  }
  body.rail-ouvert .rail { transform: none; }
  .rail-fermer { display: grid; }
  .rail-replier { display: none; }
  .barre-burger { display: grid; }
  .barre-haut { padding: 10px 14px; }
  /* Le champ de recherche reste sur la même ligne que le menu (règle de l'ancienne barre). */
  .barre-haut .recherche { order: 0; flex-basis: auto; }
  .rail-haut .marque-nom { display: inline; }
  .barre-actions .action span { display: none; }
  .barre-actions .action { padding: 9px; }
  .barre-basse { display: flex; }
  .contenu { padding: 18px 14px 96px; }
  .pied { display: none; }
  .hero { gap: 14px; }
  .hero-actions { width: 100%; }
  .cadre { padding: 14px; }
}
@media (max-width: 760px) {
  /* Sur un petit écran, on garde les mails, le thème et la nouvelle tâche. */
  .barre-actions .action-devis, .barre-actions .action-point { display: none; }
  .barre-haut .recherche { min-width: 140px; }
  .cartes-chiffres {
    display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px;
    margin: 16px -14px 0; padding-left: 14px; padding-right: 14px;
    scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .cartes-chiffres::-webkit-scrollbar { display: none; }
  .cartes-chiffres .carte-chiffre { flex: 0 0 58%; scroll-snap-align: start; }
  .cartes-chiffres .cc-titre { min-height: auto; }
  .c-taches .tt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   Direction artistique : le panneau d'organisation
   Portage fidele du panneau recu par mail (KNG) : trois polices, fonds encre et
   papier, accents ambre et cyan, grain, coquille a gauche, bandeau de chiffres,
   cartes a pastille, arborescence depliante, horloge et fil d'Ariane.
   Les jetons de palette sont dans la section « Theme Bureau », plus haut.
   ========================================================================== */

/* --- Les trois polices, servies par le serveur ---------------------------- */
body, button, input, select, textarea { font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3, .marque-nom, .cc-valeur, .vide-aide { font-family: "Fraunces", Georgia, "Times New Roman", serif; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; }
code, kbd, samp, .mono, .fort, th, .rail-groupe, .rail-groupe-titre, .cc-titre, .pastille,
.rail-badge, .rail-pied, .date-du-jour, .cc-unite, .pg-pin-k, .pg-pin-v, .pg-crumb,
.pg-horloge, .pg-sous, .pg-qui, .source, .bloc-entete .indice {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --- Le rail : la colonne du panneau -------------------------------------- */
.rail { width: 280px; }
[data-theme="sombre"] .rail { background: linear-gradient(180deg, var(--surface), #10151a 70%); }

.marque-nom { font-family: "Fraunces", Georgia, serif; font-weight: 900; font-size: 22px; letter-spacing: -.02em; }
.marque-nom em { font-style: italic; color: var(--accent); }

.pg-pin {
  display: block; padding: 12px 20px; border-bottom: 1px solid var(--bord);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent);
  text-decoration: none;
}
.pg-pin-k { display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.pg-pin-v { display: block; font-size: 12px; color: var(--encre-2); margin-top: 2px; }

.rail-groupe-titre, .rail-groupe {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--discret); padding: 14px 10px 6px; font-weight: 500;
}
.rail-lien { border-radius: 8px; font-size: 14px; padding: 8px 10px; }
.rail-lien:hover { background: var(--surface-3); }
[data-theme="sombre"] .rail-lien.actif { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rail-lien.actif::before { background: var(--accent); border-radius: 2px; width: 2px; }
.rail-badge {
  font-size: 10px; color: var(--discret); border: 1px solid var(--bord);
  border-radius: 20px; padding: 1px 7px; background: none;
}
.rail-badge.hot { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* --- L'arborescence des projets, comme dans le panneau -------------------- */
.pg-arbre { padding: 0 0 6px; }
.pg-proj { border-radius: 8px; }
.pg-proj-tete {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; cursor: pointer;
  color: var(--encre-2); font-size: 14px; border-radius: 8px; list-style: none;
}
.pg-proj-tete::-webkit-details-marker { display: none; }
.pg-proj-tete:hover { background: var(--surface-3); color: var(--encre); }
.pg-chev { width: 12px; display: flex; align-items: center; color: var(--discret); transition: transform .2s ease; }
.pg-chev-icone { width: 12px; height: 12px; }
.pg-proj[open] .pg-chev { transform: rotate(90deg); }
.pg-proj[open] .pg-proj-nom { color: var(--encre); }
.pg-proj-nom { color: inherit; text-decoration: none; }
.pg-proj-corps { padding: 2px 0 8px 30px; display: flex; flex-direction: column; }
.pg-sous {
  font-size: 12px; color: var(--discret); padding: 4px 8px; border-radius: 6px; text-decoration: none;
}
.pg-sous::before { content: "└ "; color: var(--bord-fort); }
.pg-sous:hover { background: var(--surface-3); color: var(--encre-2); }
.pg-sous.actif { color: var(--accent); }

/* --- Le pied du rail : l'etat de la machine ------------------------------- */
.pg-pied-etat {
  padding: 12px 16px; border-top: 1px solid var(--bord);
  display: flex; align-items: center; gap: 8px;
}
.pg-qui { font-size: 12px; color: var(--encre-2); line-height: 1.35; }
.pg-qui b { display: block; color: var(--encre); font-weight: 600; font-family: "Instrument Sans", sans-serif; }
.pg-pouls { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; animation: pg-pouls 2.4s infinite; }
@keyframes pg-pouls {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- La barre du haut : fil d'Ariane et horloge --------------------------- */
.barre-haut {
  position: sticky; top: 0; z-index: 20; gap: 16px; padding: 14px 30px;
  border-bottom: 1px solid var(--bord);
  background: color-mix(in srgb, var(--fond) 82%, transparent);
  backdrop-filter: blur(10px);
}
.pg-crumb { font-size: 12px; color: var(--discret); display: flex; align-items: center; gap: 6px; }
.pg-crumb a { color: inherit; text-decoration: none; }
.pg-crumb a:hover { color: var(--encre-2); }
.pg-crumb b { color: var(--encre); font-weight: 500; }
.pg-sep { color: var(--bord-fort); }
.pg-horloge { font-size: 12px; color: var(--encre-2); white-space: nowrap; }

/* --- Le contenu : la page du panneau -------------------------------------- */
.contenu { padding: 34px 30px 70px; max-width: 1180px; width: 100%; }
.date-du-jour { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.05; margin: 8px 0 6px; }
h1 em { font-style: italic; color: var(--accent); }
.resume, .sous-titre { color: var(--encre-2); max-width: 70ch; }

/* --- Le bandeau de chiffres : les « kpi » du panneau ---------------------- */
.cartes-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0 0 34px; }
.cartes-chiffres.quatre { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.carte-chiffre {
  border: 1px solid var(--bord); border-radius: 12px; padding: 16px 18px;
  background: linear-gradient(180deg, var(--surface), transparent);
  position: relative; overflow: hidden; text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.carte-chiffre::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
}
.carte-chiffre:hover { border-color: var(--bord-fort); transform: translateY(-2px); }
.cc-titre { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--discret); font-weight: 500; }
.cc-valeur { font-family: "Fraunces", Georgia, serif; font-size: 34px; font-weight: 600; line-height: 1.1; margin: 6px 0 2px; letter-spacing: -.02em; display: block; }
.cc-detail { font-size: 12.5px; color: var(--encre-2); }
.carte-chiffre.ton-alerte .cc-valeur { color: var(--alerte); }
.carte-chiffre.ton-attention .cc-valeur { color: var(--attention); }

/* --- Les blocs : les « card » et les entetes de section ------------------ */
.bloc {
  border: 1px solid var(--bord); border-radius: 12px; padding: 18px;
  background: var(--surface); transition: border-color .2s, background .2s;
}
.bloc:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.bloc-entete {
  display: flex; align-items: flex-end; gap: 14px;
  border-bottom: 1px solid var(--bord); padding-bottom: 10px; margin-bottom: 14px;
}
.bloc-entete h2 { font-family: "Fraunces", Georgia, serif; font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.bloc-entete .indice, .bloc-entete .source { margin-left: auto; font-size: 11px; color: var(--discret); }

/* --- Les listes et les tableaux ------------------------------------------- */
th { text-align: left; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--discret); padding: 8px 12px; border-bottom: 1px solid var(--bord); }
td { padding: 11px 12px; border-bottom: 1px solid var(--bord); vertical-align: top; color: var(--encre-2); }
.ligne { border-bottom: 1px solid var(--bord); }
.pastille { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; border-radius: 20px; font-weight: 500; }

/* --- Les encadres vides : la « note » du panneau -------------------------- */
.vide {
  border-radius: 0 8px 8px 0; border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent);
  padding: 12px 16px;
}
.vide p { margin: 0; }

/* --- Les boutons et le fond ----------------------------------------------- */
.bouton, .bouton.petit, .alerte-douce { border-radius: 8px; }
.bouton.principal { background: var(--accent); background-image: none; border-color: var(--accent); color: #fff; }
.bouton.principal:hover { background: var(--accent-fort); border-color: var(--accent-fort); }
[data-theme="sombre"] .bouton.principal { background-image: none; color: #0e1216; }
.aurore span { opacity: .45; }
.aurore::after { background-image: none; }

/* --- Le bloc arborescence, pour montrer un chemin ------------------------- */
.pg-arbre-bloc { border: 1px solid var(--bord); border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--fond) 60%, #000 8%); }
.pg-arbre-bloc header {
  padding: 10px 16px; border-bottom: 1px solid var(--bord); font-family: "IBM Plex Mono", monospace;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--discret); background: var(--surface);
}
.pg-arbre-bloc pre {
  margin: 0; padding: 18px 20px; font-family: "IBM Plex Mono", monospace; font-size: 12.5px;
  line-height: 1.75; color: var(--encre-2); overflow-x: auto;
}
