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

/* --- Couleurs ------------------------------------------------------------ */
:root,
[data-theme="clair"] {
  --fond: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #f3f2ee;
  --surface-3: #eceae4;
  --bord: #e5e2da;
  --bord-fort: #d3cfc5;
  --encre: #1c2027;
  --encre-2: #4a515c;
  --discret: #767c86;
  --accent: #3f6fb5;
  --accent-fort: #335d9a;
  --accent-doux: #e9f0fa;
  --ok: #2c7a4b;
  --ok-doux: #e3f2e8;
  --attention: #9a5b0f;
  --attention-doux: #fbf0dc;
  --alerte: #b93a26;
  --alerte-doux: #fbe8e4;
  --serie-1: #3f6fb5;
  --serie-2: #c46a1f;
  --ombre: 0 1px 2px rgba(30, 30, 20, .04), 0 2px 8px rgba(30, 30, 20, .04);
  --ombre-haute: 0 10px 40px rgba(20, 20, 10, .14);
  color-scheme: light;
}

[data-theme="sombre"] {
  --fond: #111316;
  --surface: #191c20;
  --surface-2: #20242a;
  --surface-3: #282d34;
  --bord: #2a2f36;
  --bord-fort: #3a4049;
  --encre: #e8e6e1;
  --encre-2: #b8bcc3;
  --discret: #8c929b;
  --accent: #79a6e6;
  --accent-fort: #9bbdf0;
  --accent-doux: #1d2837;
  --ok: #6cc08c;
  --ok-doux: #19291f;
  --attention: #e2a750;
  --attention-doux: #30261a;
  --alerte: #ef8470;
  --alerte-doux: #37201c;
  --serie-1: #3987e5;
  --serie-2: #d0782a;
  --ombre: 0 1px 2px rgba(0, 0, 0, .3);
  --ombre-haute: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* --- 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; }
.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; }
}
