/* ═══════════════════════════════════════════════════════════════════════
   CRM Support Opérationnel 7G — v4 (17/09/2026)
   Même langage que Suivi des Affaires et Portail Collaborateurs :
   bandeau bleu 7G #0C3D63, barre latérale noire, bordures noires épaisses,
   ombres franches sans flou, aplats pastel, titres en capitales.
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  --bleu7g: #0C3D63;
  --bleu7g-clair: #a9cde6;
  --noir: #111111;
  --fond: #ffffff;
  --fond-2: #f4f6f8;
  --carte: #ffffff;
  --encre: #111111;
  --encre-2: #475569;
  --encre-3: #6b7280;
  --trait: #111111;
  --trait-doux: #e2e8f0;
  --ombre: #111111;
  --ciel: #c9e6f7;
  --ligne-bleue: #3b9ad2;
  --ambre: #ffb43c;
  --menthe: #4fdcb0;
  --p-bleu: #7cc9f0;
  --p-vert: #7ee2a8;
  --p-violet: #d4b0f5;
  --p-lavande: #8b93f0;
  --p-orange: #f5a66c;
  --p-rose: #f5a3a3;
  --p-jaune: #f7dd72;
  --p-gris: #dbe4f0;
  --rouge: #b42318;
  --rouge-fond: #fde2e1;
  --vert: #1f7a45;
  --b: 2.5px solid var(--trait);
  --sh: 4px 4px 0 var(--ombre);
  --sh-sm: 3px 3px 0 var(--ombre);
  --sh-xs: 2px 2px 0 var(--ombre);
  --barre: 248px;
  color-scheme: light;
}
.dark {
  --fond: #161a27;
  --fond-2: #1b2030;
  --carte: #252b3c;
  --encre: #eef0fb;
  --encre-2: #c3c9dc;
  --encre-3: #9aa3b8;
  --trait: #cfd3f5;
  --trait-doux: #3a4156;
  --ombre: #000000;
  --rouge-fond: #4a1d1d;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--fond); color: var(--encre);
  font-size: 15px; line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
svg.ic { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.maj { text-transform: uppercase; letter-spacing: .4px; }
.muet { color: var(--encre-3); }
:focus-visible { outline: 3px solid var(--ligne-bleue); outline-offset: 2px; }

/* ── Boutons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: var(--b); background: var(--carte); color: var(--encre);
  font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .4px;
  padding: 9px 14px; box-shadow: var(--sh-sm); white-space: nowrap;
  transition: transform .06s, box-shadow .06s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ombre); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ombre); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-noir { background: var(--noir); color: var(--ciel); border-color: var(--noir); }
.dark .btn-noir { border-color: var(--trait); }
.btn-bleu { background: var(--bleu7g); color: #fff; }
.btn-ambre { background: var(--ambre); color: #111; }
.btn-menthe { background: var(--menthe); color: #111; }
.btn-ciel { background: var(--p-bleu); color: #111; }
.btn-vert { background: var(--p-vert); color: #111; }
.btn-rouge { background: var(--p-rose); color: #111; }
.btn-sm { padding: 5px 9px; font-size: 11px; box-shadow: var(--sh-xs); gap: 5px; }
.btn-sm svg.ic { width: 14px; height: 14px; }
.btn-bloc { width: 100%; }
.btn-lien { font-weight: 700; font-size: 13px; text-decoration: underline; color: var(--encre-2); padding: 4px; }

/* ── Écran de connexion (style Portail, bleu 7G) ─────────────────────── */
#ecran-connexion {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: var(--bleu7g);
  background-image: radial-gradient(rgba(255,255,255,.22) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}
.connexion-boite {
  width: 100%; max-width: 410px; background: #fff; color: #111;
  border: 4px solid #111; box-shadow: 10px 10px 0 #111; padding: 30px 28px;
}
.connexion-marque { display: flex; align-items: center; gap: 14px; }
.logo-7g {
  width: 60px; height: 60px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--ciel); color: #111; border: 3px solid #111; box-shadow: 4px 4px 0 var(--bleu7g);
}
.logo-7g svg.ic { width: 30px; height: 30px; stroke-width: 2.4; }
.connexion-marque h1 { font-size: 22px; line-height: 1.05; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; }
.connexion-sous { margin: 14px 0 20px; font-size: 12.5px; font-weight: 800; color: #555; text-transform: uppercase; letter-spacing: .3px; }
.champ { display: block; margin-bottom: 14px; }
.champ > span { display: block; font-size: 11.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 5px; }
.saisie {
  width: 100%; border: var(--b); background: var(--carte); color: var(--encre);
  padding: 10px 12px; font-size: 16px; font-weight: 600; outline: none; border-radius: 0;
}
.connexion-boite .saisie { background: #fff; color: #111; border-color: #111; }
.saisie:focus { box-shadow: var(--sh-sm); background: #fbfdff; }
.dark .saisie:focus { background: #2b3246; }
textarea.saisie { resize: vertical; min-height: 90px; line-height: 1.45; font-weight: 500; }
select.saisie { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.erreur-boite { background: var(--p-rose); color: #111; border: var(--b); padding: 9px 12px; font-weight: 800; font-size: 14px; margin-bottom: 14px; }
.faceid-btn { margin-top: 12px; }
.separateur { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; font-size: 11px; font-weight: 900; color: #777; text-transform: uppercase; }
.separateur::before, .separateur::after { content: ''; flex: 1; height: 2px; background: #ddd; }

/* ── Structure : barre latérale + bandeau + contenu ──────────────────── */
#appli { min-height: 100vh; }
.barre {
  position: fixed; inset: 0 auto 0 0; width: var(--barre); z-index: 30;
  background: #111; color: #dcdcdc; display: flex; flex-direction: column;
  border-right: 4px solid #111;
}
.barre-tete { display: flex; align-items: center; gap: 12px; padding: 18px 16px; border-bottom: 4px solid var(--ligne-bleue); }
.barre-tete .logo-7g { width: 44px; height: 44px; box-shadow: 3px 3px 0 var(--bleu7g); border-width: 2.5px; }
.barre-tete .logo-7g svg.ic { width: 22px; height: 22px; }
.barre-tete b { display: block; color: #fff; font-size: 14.5px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; line-height: 1.1; }
.barre-tete small { display: block; color: #8fa3b8; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; margin-top: 3px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px 14px; }
.nav-titre { font-size: 10px; font-weight: 900; letter-spacing: 1px; color: #7a7a7a; text-transform: uppercase; padding: 14px 8px 6px; display: flex; justify-content: space-between; align-items: center; }
.nav-titre button { color: #9fb3c8; font-size: 10px; font-weight: 900; letter-spacing: .6px; padding: 2px 4px; }
.nav-titre button:hover { color: #fff; }
.nav-lien {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 10px; margin: 2px 0;
  color: #d6d6d6; font-weight: 700; font-size: 14px; text-align: left; border: 2.5px solid transparent;
}
.nav-lien:hover { background: #1f1f1f; color: #fff; }
.nav-lien.actif { background: var(--ciel); color: #111; border-color: #111; box-shadow: 3px 3px 0 rgba(59,154,210,.45); font-weight: 900; }
.nav-lien .pastille-n { margin-left: auto; min-width: 22px; padding: 0 5px; height: 19px; display: inline-flex; align-items: center; justify-content: center;
  background: #2a2a2a; color: #fff; font-size: 11px; font-weight: 900; border: 1.5px solid #000; }
.nav-lien.actif .pastille-n { background: #111; color: var(--ciel); }
.pastille-n.alerte { background: var(--p-rose) !important; color: #111 !important; }
.nav-lien .point { width: 10px; height: 10px; border: 2px solid #000; flex-shrink: 0; }
.nav-lien.sous { font-size: 13.5px; padding: 7px 10px; font-weight: 600; }
.barre-bas { padding: 12px; border-top: 2px solid #262626; display: grid; gap: 10px; }
.barre-bas .btn { box-shadow: 3px 3px 0 #000; border-color: #000; }
.moi { display: flex; align-items: center; gap: 10px; padding: 4px 2px; }
.avatar { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: var(--ciel); color: #111; font-weight: 900; border: 2px solid var(--ligne-bleue); flex-shrink: 0; }
.moi b { display: block; color: #fff; font-size: 13px; }
.moi small { display: block; color: #8a8a8a; font-size: 11px; }
.moi .icone-btn { color: #aaa; padding: 6px; margin-left: auto; }
.moi .icone-btn + .icone-btn { margin-left: 0; }
.moi .icone-btn:hover { color: #fff; }

.principal { margin-left: var(--barre); min-height: 100vh; display: flex; flex-direction: column; }
.haut {
  position: sticky; top: 0; z-index: 20; background: var(--bleu7g); color: #fff;
  border-bottom: 4px solid #111; min-height: 66px; padding: 12px 24px;
  display: flex; align-items: center; gap: 14px;
}
.haut h1 { font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.haut .espace { flex: 1; }
.recherche { display: flex; align-items: center; gap: 8px; background: #fff; color: #1f2430; border: 2.5px solid #111; box-shadow: 3px 3px 0 #111; padding: 0 10px; width: min(340px, 36vw); }
.recherche input { border: 0; outline: 0; background: transparent; padding: 8px 0; width: 100%; font-size: 14.5px; color: #1f2430; }
.recherche input::placeholder { color: #6b7280; }
.haut .btn { box-shadow: 3px 3px 0 #111; border-color: #111; }
.haut .btn-blanc { background: #fff; color: var(--bleu7g); }
.btn-carre { width: 40px; height: 40px; padding: 0; background: #fff; color: #111; }
.haut .menu-mobile { display: none; }
main#contenu { flex: 1; padding: 22px 24px 60px; max-width: 1500px; width: 100%; }
.nav-bas { display: none; }

/* ── Bandeau d'accueil (style Portail) ──────────────────────────────── */
.hero {
  background: var(--bleu7g); color: #fff; border: 3px solid #111; box-shadow: 6px 6px 0 #111;
  display: flex; align-items: center; gap: 18px; padding: 18px 22px; margin-bottom: 20px;
}
.hero-soleil { width: 54px; height: 54px; flex-shrink: 0; color: #ffd24a; }
.hero-soleil svg.ic { width: 54px; height: 54px; stroke-width: 2; }
.hero h2 { font-size: 22px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; }
.hero p { font-size: 13.5px; font-weight: 700; color: rgba(255,255,255,.88); margin-top: 3px; }
.hero .date-pastille { margin-left: auto; background: #fff; color: var(--bleu7g); border: 2.5px solid #fff; padding: 9px 14px; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }

/* ── Compteurs (style Suivi) ─────────────────────────────────────────── */
.compteurs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.compteur {
  text-align: left; border: var(--b); box-shadow: var(--sh); padding: 11px 14px 12px; background: var(--carte); color: #111;
  transition: transform .08s, box-shadow .08s; min-width: 0;
}
.compteur:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ombre); }
.compteur small { display: block; font-size: 10.5px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; color: #1f2430; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compteur b { display: block; font-size: 30px; font-weight: 900; line-height: 1.1; margin-top: 2px; }
.compteur.c-bleu7g { background: var(--bleu7g); color: #fff; }
.compteur.c-bleu7g small { color: var(--bleu7g-clair); }
.c-rose { background: var(--p-rose) !important; }
.c-violet { background: var(--p-violet) !important; }
.c-bleu { background: var(--p-bleu) !important; }
.c-vert { background: var(--p-vert) !important; }
.c-orange { background: var(--p-orange) !important; }
.c-jaune { background: var(--p-jaune) !important; }
.c-gris { background: var(--p-gris) !important; }
.c-lavande { background: var(--p-lavande) !important; }
.compteur.vide { opacity: .8; }
.evt .outil-cell { min-width: 0; overflow: hidden; }
.evt .outil-pastille { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ── Saisie rapide ───────────────────────────────────────────────────── */
.saisie-rapide { border: 3px solid var(--trait); box-shadow: var(--sh); background: var(--carte); margin-bottom: 22px; }
.saisie-rapide form { display: flex; align-items: stretch; }
.saisie-rapide .plus { display: flex; align-items: center; padding: 0 12px 0 16px; color: var(--encre-3); }
.saisie-rapide input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 17px; font-weight: 600; padding: 15px 8px; min-width: 0; }
.saisie-rapide .btn { border-width: 0 0 0 3px; box-shadow: none; padding: 0 20px; font-size: 13px; }
.saisie-rapide .btn:hover { transform: none; filter: brightness(1.05); }
.apercu { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px 46px; min-height: 0; }
.apercu:empty { display: none; }
.aide-saisie { padding: 0 14px 10px 46px; font-size: 12.5px; color: var(--encre-3); }

/* ── Cartes-colonnes (style colonnes Kanban du Suivi) ───────────────── */
.grille-journee { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.colonne { display: grid; gap: 22px; min-width: 0; }
.bloc { border: 3px solid var(--trait); box-shadow: 5px 5px 0 var(--ombre); background: var(--carte); min-width: 0; }
.bloc-tete {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 3px solid var(--trait);
  font-weight: 900; font-size: 13.5px; text-transform: uppercase; letter-spacing: .5px; color: #111;
}
.bloc-tete .rond { width: 13px; height: 13px; border: 2.5px solid #111; border-radius: 50%; background: #fff; flex-shrink: 0; }
.bloc-tete .n { margin-left: auto; background: #fff; color: #111; border: 2px solid #111; padding: 0 7px; min-width: 26px; text-align: center; font-size: 12.5px; }
.bloc-tete .actions-tete { margin-left: auto; display: flex; gap: 6px; }
.bloc-tete .n + .actions-tete { margin-left: 8px; }
.bloc-tete.t-bleu7g { background: var(--bleu7g); color: #fff; }
.bloc-tete.t-bleu7g .rond { border-color: #fff; background: transparent; }
.bloc-corps { padding: 10px 12px 12px; }
.bloc-corps.serre { padding: 6px 8px 8px; }
.bloc-vide { padding: 16px 14px; color: var(--encre-3); font-size: 14px; font-weight: 600; }
.sous-titre { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; color: var(--encre-2); padding: 10px 4px 6px; display: flex; align-items: center; gap: 8px; }
.sous-titre.rouge { color: var(--rouge); }
.dark .sous-titre.rouge { color: #ff9b94; }

/* ── Ligne de tâche ──────────────────────────────────────────────────── */
.tache {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 8px; border: 2px solid transparent;
  border-bottom: 2px solid var(--trait-doux); background: var(--carte); position: relative;
}
.tache:last-child { border-bottom-color: transparent; }
.tache:hover { border-color: var(--trait); box-shadow: var(--sh-xs); z-index: 1; }
.tache.glisse { opacity: .4; }
.tache.cible { box-shadow: 0 -4px 0 var(--ligne-bleue); }
.coche {
  width: 24px; height: 24px; margin-top: 1px; border: 2.5px solid var(--trait); background: var(--carte); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: transparent;
}
.coche svg.ic { width: 16px; height: 16px; stroke-width: 3.2; }
.coche:hover { background: var(--p-vert); color: #111; }
.tache.faite .coche { background: var(--p-vert); color: #111; }
.tache.faite .tache-titre { text-decoration: line-through; color: var(--encre-3); }
.tache.prio-urgente { box-shadow: inset 5px 0 0 #e5484d; }
.tache.prio-haute { box-shadow: inset 5px 0 0 #f5a66c; }
.tache-corps { flex: 1; min-width: 0; cursor: pointer; text-align: left; }
.tache-titre { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.tache-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tache-meta:empty { display: none; }
.tache-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .1s; }
.tache:hover .tache-actions, .tache:focus-within .tache-actions { opacity: 1; }
.icone-btn { display: inline-flex; align-items: center; justify-content: center; padding: 5px; color: var(--encre-2); border: 2px solid transparent; }
.icone-btn:hover { border-color: var(--trait); background: var(--fond-2); color: var(--encre); }
.icone-btn svg.ic { width: 17px; height: 17px; }
.poignee { cursor: grab; color: var(--encre-3); padding: 3px 0; margin-top: 2px; }
.poignee svg.ic { width: 16px; height: 16px; }

/* Étiquettes */
.puce {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 2px solid var(--trait);
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; background: var(--carte); color: var(--encre); white-space: nowrap;
}
.puce svg.ic { width: 12px; height: 12px; stroke-width: 2.6; }
.puce.p-retard { background: var(--p-rose); color: #111; }
.puce.p-jour { background: var(--p-jaune); color: #111; }
.puce.p-date { background: var(--p-gris); color: #111; }
.puce.p-urgente { background: #e5484d; color: #fff; border-color: #111; }
.puce.p-haute { background: var(--p-orange); color: #111; }
.puce.p-demande { background: var(--p-bleu); color: #111; }
.puce.p-telegram { background: #9fd3f5; color: #111; }
.puce.p-claude { background: var(--p-violet); color: #111; }
.puce.p-liste { background: var(--carte); }
.puce.p-statut { background: var(--p-gris); color: #111; }
.puce.p-valider { background: var(--p-vert); color: #111; }
.puce.nue { border-color: transparent; background: transparent; padding-left: 0; color: var(--encre-3); }
.carre-couleur { width: 9px; height: 9px; border: 1.5px solid #111; display: inline-block; }
.coul-bleu { background: var(--p-bleu); } .coul-vert { background: var(--p-vert); } .coul-violet { background: var(--p-violet); }
.coul-orange { background: var(--p-orange); } .coul-rose { background: var(--p-rose); } .coul-jaune { background: var(--p-jaune); } .coul-gris { background: var(--p-gris); }

/* ── Récap et activité ───────────────────────────────────────────────── */
.note-claude { border: 2px solid var(--trait); background: var(--fond-2); padding: 10px 12px; margin-bottom: 12px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-claude .qui { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: var(--encre-2); margin-bottom: 5px; white-space: normal; }
.outil-ligne { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 8px 2px; border-bottom: 2px solid var(--trait-doux); }
.outil-ligne:last-child { border-bottom: 0; }
.outil-pastille { display: inline-flex; align-items: center; padding: 2px 8px; border: 2px solid #111; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .3px; color: #111; white-space: nowrap; height: fit-content; }
.outil-ligne ul { list-style: none; display: grid; gap: 3px; }
.outil-ligne li { font-size: 13.5px; overflow-wrap: anywhere; }
.outil-ligne li b { font-weight: 900; }
.outil-ligne li .ex { color: var(--encre-3); }
.etat-serveur { display: flex; align-items: center; gap: 10px; border: 2.5px solid #111; padding: 9px 12px; font-weight: 800; font-size: 14px; color: #111; cursor: pointer; width: 100%; text-align: left; }
.etat-serveur.ok { background: var(--p-vert); }
.etat-serveur.ko { background: var(--p-rose); }
.etat-serveur ul { margin: 4px 0 0 18px; font-weight: 600; font-size: 13px; }

.chronologie { display: grid; }
.evt { display: grid; grid-template-columns: 52px 132px minmax(0, 1fr); gap: 10px; padding: 8px 6px; border-bottom: 2px solid var(--trait-doux); align-items: baseline; }
.evt:last-child { border-bottom: 0; }
.evt .h { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--encre-2); font-size: 13px; }
.evt .txt { font-size: 14px; overflow-wrap: anywhere; }
.evt .txt b { font-weight: 800; }
.evt.attention { background: #fff4e0; } .dark .evt.attention { background: #3a2f1a; }
.evt.erreur { background: var(--rouge-fond); }
.evt details summary { cursor: pointer; font-size: 12px; font-weight: 800; color: var(--encre-2); margin-top: 3px; }
.evt details code { display: block; font-size: 12px; margin-top: 4px; color: var(--encre-2); white-space: pre-wrap; }
.jour-titre { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; padding: 12px 6px 6px; color: var(--encre-2); border-bottom: 3px solid var(--trait); }

/* ── Barres d'outils, filtres, onglets ───────────────────────────────── */
.outils-page { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.onglets { display: inline-flex; border: var(--b); box-shadow: var(--sh-sm); background: var(--carte); }
.onglets button { padding: 8px 13px; font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; border-right: 2px solid var(--trait); }
.onglets button:last-child { border-right: 0; }
.onglets button.actif { background: var(--noir); color: var(--ciel); }
.dark .onglets button.actif { background: var(--ciel); color: #111; }
.filtre { padding: 5px 10px; border: 2px solid var(--trait); font-weight: 800; font-size: 12px; text-transform: uppercase; background: var(--carte); display: inline-flex; align-items: center; gap: 6px; }
.filtre.actif { background: var(--noir); color: var(--ciel); }
.dark .filtre.actif { background: var(--ciel); color: #111; }

/* ── Demandes (colonnes) ─────────────────────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.carte-demande { border: 2.5px solid var(--trait); box-shadow: var(--sh-sm); background: var(--carte); margin-bottom: 12px; }
.carte-demande .cd-tete { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 2.5px solid var(--trait); background: var(--fond-2); font-size: 12px; font-weight: 800; }
.carte-demande .cd-tete .quand { margin-left: auto; color: var(--encre-3); font-weight: 700; }
.carte-demande .cd-corps { padding: 10px; cursor: pointer; }
.carte-demande h3 { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.carte-demande p { font-size: 13.5px; color: var(--encre-2); margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.carte-demande .cd-pied { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px; }

/* ── Serveur ─────────────────────────────────────────────────────────── */
.table-simple { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-simple th { text-align: left; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: var(--encre-2); padding: 6px 8px; border-bottom: 2.5px solid var(--trait); }
.table-simple td { padding: 7px 8px; border-bottom: 2px solid var(--trait-doux); vertical-align: top; }
.table-simple tr:last-child td { border-bottom: 0; }
.statut { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 12px; text-transform: uppercase; padding: 1px 8px; border: 2px solid #111; color: #111; white-space: nowrap; }
.statut.ok { background: var(--p-vert); } .statut.ko { background: var(--p-rose); } .statut.neutre { background: var(--p-gris); } .statut.moyen { background: var(--p-jaune); }
.jauge { height: 12px; border: 2px solid var(--trait); background: var(--fond-2); margin-top: 6px; }
.jauge i { display: block; height: 100%; background: var(--p-bleu); }
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }

/* ── Panneau de détail (tiroir à droite / feuille en bas sur mobile) ─── */
#voile { position: fixed; inset: 0; background: rgba(12, 20, 33, .45); z-index: 60; }
#panneau {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 70; background: var(--carte);
  border-left: 4px solid #111; box-shadow: -8px 0 0 rgba(0,0,0,.18); display: flex; flex-direction: column;
  animation: entreeDroite .16s ease-out;
}
@keyframes entreeDroite { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.panneau-tete { background: var(--bleu7g); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 4px solid #111; }
.panneau-tete b { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; font-weight: 900; }
.panneau-tete .icone-btn { color: #fff; margin-left: auto; }
.panneau-tete .icone-btn:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }
.panneau-corps { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
.titre-edit { width: 100%; font-size: 20px; font-weight: 800; border: 2.5px solid transparent; background: transparent; padding: 6px 8px; outline: none; resize: none; line-height: 1.25; overflow: hidden; }
.titre-edit:hover { border-color: var(--trait-doux); }
.titre-edit:focus { border-color: var(--trait); box-shadow: var(--sh-xs); }
.ligne-champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.segment { display: flex; border: var(--b); }
.segment button { flex: 1; padding: 8px 4px; font-size: 12px; font-weight: 800; text-transform: uppercase; border-right: 2px solid var(--trait); }
.segment button:last-child { border-right: 0; }
.segment button.actif { background: var(--noir); color: var(--ciel); }
.dark .segment button.actif { background: var(--ciel); color: #111; }
.segment button.actif.urgente { background: #e5484d; color: #fff; }
.segment button.actif.haute { background: var(--p-orange); color: #111; }
.bascule { display: flex; align-items: center; gap: 10px; border: var(--b); padding: 9px 12px; font-weight: 800; width: 100%; text-align: left; }
.bascule.actif { background: var(--p-jaune); color: #111; }
.bascule svg.ic { color: #c98a00; }
.origine { font-size: 13px; color: var(--encre-2); border-left: 4px solid var(--p-violet); padding: 6px 10px; background: var(--fond-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.commentaire { border: 2px solid var(--trait-doux); padding: 8px 10px; }
.commentaire .qui { font-size: 11.5px; font-weight: 900; text-transform: uppercase; color: var(--encre-2); display: flex; gap: 8px; }
.commentaire .qui span { font-weight: 600; text-transform: none; color: var(--encre-3); }
.commentaire p { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.historique { font-size: 12.5px; color: var(--encre-3); display: grid; gap: 3px; }
.panneau-pied { border-top: 3px solid var(--trait); padding: 12px 14px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Modale ──────────────────────────────────────────────────────────── */
#modale { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(12, 20, 33, .5); }
.modale-boite { width: min(520px, 100%); background: var(--carte); border: 4px solid #111; box-shadow: 10px 10px 0 #111; max-height: calc(100vh - 32px); overflow-y: auto; }
.modale-boite .panneau-corps { padding: 18px; }

/* ── Notifications ───────────────────────────────────────────────────── */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 8px; }
.toast { background: var(--noir); color: #fff; border: 2.5px solid #111; box-shadow: 4px 4px 0 var(--ligne-bleue); padding: 10px 14px; font-weight: 700; font-size: 14px; max-width: 360px; display: flex; gap: 12px; align-items: center; }
.toast.erreur { background: var(--p-rose); color: #111; box-shadow: 4px 4px 0 #111; }
.toast button { color: var(--ciel); font-weight: 900; text-transform: uppercase; font-size: 12px; text-decoration: underline; }

.chargement { padding: 40px; text-align: center; font-weight: 800; color: var(--encre-3); text-transform: uppercase; letter-spacing: .5px; }
.vide-grand { border: 3px dashed var(--trait-doux); padding: 30px; text-align: center; color: var(--encre-3); font-weight: 700; }

/* ── Tablette ────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .grille-journee { grid-template-columns: minmax(0, 1fr); }
  .compteurs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kanban { grid-template-columns: minmax(0, 1fr); }
  .grille-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ── Téléphone ───────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  body { font-size: 15.5px; }
  .barre { transform: translateX(-105%); transition: transform .18s; width: min(300px, 86vw); box-shadow: 8px 0 0 rgba(0,0,0,.25); }
  body.menu-ouvert .barre { transform: none; }
  .principal { margin-left: 0; }
  .haut { padding: 10px 12px; min-height: 58px; gap: 8px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .haut h1 { font-size: 16px; }
  .haut .menu-mobile { display: inline-flex; }
  .recherche { display: none; }
  .haut .masque-mobile { display: none; }
  main#contenu { padding: 14px 12px calc(96px + env(safe-area-inset-bottom)); }
  .hero { padding: 14px; gap: 12px; flex-wrap: wrap; box-shadow: 4px 4px 0 #111; }
  .hero-soleil, .hero-soleil svg.ic { width: 40px; height: 40px; }
  .hero h2 { font-size: 18px; }
  .hero .date-pastille { margin-left: 0; font-size: 12px; padding: 6px 10px; }
  .compteurs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .compteur { padding: 9px 11px; box-shadow: var(--sh-sm); }
  .compteur b { font-size: 25px; }
  .compteur:last-child:nth-child(odd) { grid-column: span 2; }
  .saisie-rapide input { font-size: 16px; padding: 13px 6px; }
  .saisie-rapide .btn { padding: 0 14px; }
  .saisie-rapide .btn span { display: none; }
  .apercu, .aide-saisie { padding-left: 14px; }
  .bloc { box-shadow: 4px 4px 0 var(--ombre); }
  .tache-actions { opacity: 1; }
  .tache { padding: 10px 6px; }
  .coche { width: 28px; height: 28px; }
  .evt { grid-template-columns: 44px minmax(0, 1fr); }
  .evt .outil-cell { grid-column: 2; }
  .evt .txt { grid-column: 2; }
  .ligne-champs { grid-template-columns: minmax(0, 1fr); }
  #panneau { width: 100vw; border-left: 0; top: auto; height: 94vh; border-top: 4px solid #111; animation: entreeBas .18s ease-out; }
  @keyframes entreeBas { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
  .panneau-corps { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  #toasts { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .table-simple .masque-mobile { display: none; }
  .nav-bas {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: #111; border-top: 4px solid var(--ligne-bleue); padding-bottom: env(safe-area-inset-bottom);
  }
  .nav-bas button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; color: #9a9a9a; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .3px; position: relative; }
  .nav-bas button svg.ic { width: 22px; height: 22px; }
  .nav-bas button.actif { color: #fff; }
  .nav-bas button.actif svg.ic { color: var(--ciel); }
  .nav-bas .pastille-n { position: absolute; top: 4px; left: 50%; margin-left: 6px; min-width: 18px; height: 17px; padding: 0 4px; background: var(--ambre); color: #111; font-size: 10.5px; font-weight: 900; border: 1.5px solid #000; display: flex; align-items: center; justify-content: center; }
}
@media (max-width: 400px) {
  .onglets button { padding: 7px 9px; font-size: 11.5px; }
}
