:root {
  --bleu: #1f4e79;
  --bleu-clair: #e8f0f8;
  --texte: #1b2430;
  --texte-2: #55626f;
  --fond: #f4f6f8;
  --carte: #ffffff;
  --bord: #dde3ea;
  --vert: #1e7d4f;
  --vert-clair: #e5f4ec;
  --orange: #b25d00;
  --orange-clair: #fdf0e1;
  --rouge: #b3261e;
  --rouge-clair: #fbe9e7;
  --gris-clair: #eef1f4;
  --rayon: 14px;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bleu: #7fb0e0; --bleu-clair: #1d2c3b; --texte: #e8edf2; --texte-2: #a3afbb; --fond: #12171d; --carte: #1b2229;
    --bord: #2c3641; --vert: #5cc792; --vert-clair: #17302a; --orange: #f0a65a; --orange-clair: #33261a;
    --rouge: #f08a80; --rouge-clair: #3a1f1d; --gris-clair: #232c35;
  }
}
:root[data-theme="dark"] {
  --bleu: #7fb0e0; --bleu-clair: #1d2c3b; --texte: #e8edf2; --texte-2: #a3afbb; --fond: #12171d; --carte: #1b2229;
  --bord: #2c3641; --vert: #5cc792; --vert-clair: #17302a; --orange: #f0a65a; --orange-clair: #33261a;
  --rouge: #f08a80; --rouge-clair: #3a1f1d; --gris-clair: #232c35;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--bleu); }
img { max-width: 100%; }
h1 { font-size: 1.45rem; margin: .2rem 0 1rem; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .3rem; }
p { margin: .4rem 0; }
.discret { color: var(--texte-2); font-size: .9rem; }
.chargement { color: var(--texte-2); text-align: center; padding: 3rem 0; }

.barre {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--carte); border-bottom: 1px solid var(--bord);
}
.marque { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--texte); text-decoration: none; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a, .nav button {
  position: relative; text-decoration: none; color: var(--texte-2); font-size: .9rem; padding: 8px 10px; border-radius: 10px;
  background: none; border: 0; cursor: pointer; font: inherit;
}
.nav a.actif { color: var(--bleu); background: var(--bleu-clair); font-weight: 600; }
.pastille {
  position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--rouge); color: #fff;
  font-size: 11px; display: grid; place-items: center; padding: 0 4px; font-weight: 700;
}

.contenu { max-width: 640px; margin: 0 auto; padding: 16px; outline: none; }
.contenu.large { max-width: 1100px; }

.carte {
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; margin: 0 0 12px; box-shadow: var(--ombre);
}
.carte.cliquable { cursor: pointer; display: block; color: inherit; text-decoration: none; }
.carte.cliquable:hover { border-color: var(--bleu); }
.ticket { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start; }
.ticket .vignette { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--gris-clair); display: grid; place-items: center; font-size: 28px; }
.ticket .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--gris-clair); color: var(--texte-2); white-space: nowrap; }
.badge.ouvert { background: var(--bleu-clair); color: var(--bleu); }
.badge.missionne { background: var(--orange-clair); color: var(--orange); }
.badge.resolu { background: var(--vert-clair); color: var(--vert); }
.badge.a_valider { background: var(--orange-clair); color: var(--orange); }
.badge.refuse, .badge.refuse_ia { background: var(--rouge-clair); color: var(--rouge); }
.badge.critique { background: var(--rouge); color: #fff; }
.badge.haute { background: var(--rouge-clair); color: var(--rouge); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 18px; border-radius: 12px;
  border: 1px solid var(--bord); background: var(--carte); color: var(--texte); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.primaire { background: var(--bleu); border-color: var(--bleu); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primaire, :root:not([data-theme="light"]) .onglets button.actif, :root:not([data-theme="light"]) .btn.vert { color: #0d1620; } }
:root[data-theme="dark"] .btn.primaire, :root[data-theme="dark"] .onglets button.actif, :root[data-theme="dark"] .btn.vert { color: #0d1620; }
.btn.vert { background: var(--vert); border-color: var(--vert); color: #fff; }
.btn.danger { color: var(--rouge); border-color: var(--rouge); }
.btn.bloc { width: 100%; }
.btn.petit { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn.geant { min-height: 64px; font-size: 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions .btn { flex: 1 1 160px; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=tel], input[type=datetime-local], input:not([type]), textarea, select {
  width: 100%; padding: 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); color: var(--texte); font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus, .btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--bleu) 35%, transparent); outline-offset: 1px; }
.code-saisie { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.case { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.case input { width: 22px; height: 22px; }

.photo-zone {
  display: grid; place-items: center; text-align: center; gap: 6px; min-height: 180px; border: 2px dashed var(--bord); border-radius: var(--rayon);
  background: var(--carte); cursor: pointer; color: var(--texte-2); padding: 16px; position: relative; overflow: hidden;
}
.photo-zone img { max-height: 320px; border-radius: 10px; }
.photo-zone .icone { font-size: 42px; }
.photo-grande { width: 100%; max-height: 420px; object-fit: contain; background: var(--gris-clair); border-radius: var(--rayon); }

.encart { border-radius: var(--rayon); padding: 14px 16px; margin: 0 0 14px; }
.encart.info { background: var(--bleu-clair); }
.encart.succes { background: var(--vert-clair); }
.encart.alerte { background: var(--orange-clair); }
.encart.erreur { background: var(--rouge-clair); color: var(--rouge); }

.frise { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--bord); }
.frise li { position: relative; padding: 0 0 14px 16px; }
.frise li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bleu); }
.frise .quand { font-size: .8rem; color: var(--texte-2); }

.onglets { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 4px; }
.onglets button { white-space: nowrap; border: 1px solid var(--bord); background: var(--carte); color: var(--texte); border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer; }
.onglets button.actif { background: var(--bleu); border-color: var(--bleu); color: #fff; }

.grille { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tableau { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau th, .tableau td { text-align: left; padding: 8px; border-bottom: 1px solid var(--bord); vertical-align: top; }
.defile { overflow-x: auto; }
.kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi div { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 12px; }
.kpi b { display: block; font-size: 1.6rem; }
.kpi span { color: var(--texte-2); font-size: .85rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(120px); transition: transform .25s;
  background: #1b2430; color: #fff; padding: 12px 18px; border-radius: 12px; max-width: calc(100% - 32px); z-index: 50; box-shadow: var(--ombre);
}
.toast.visible { transform: translateX(-50%) translateY(0); }
.spinner { width: 42px; height: 42px; border: 4px solid var(--bord); border-top-color: var(--bleu); border-radius: 50%; animation: tourne 1s linear infinite; margin: 24px auto; }
@keyframes tourne { to { transform: rotate(360deg); } }
.centre { text-align: center; }
.separateur { height: 1px; background: var(--bord); margin: 18px 0; }
pre.email { white-space: pre-wrap; font: inherit; font-size: .9rem; background: var(--gris-clair); padding: 12px; border-radius: 10px; margin: 6px 0 0; }

@media (max-width: 520px) {
  .nav .libelle { display: none; }
  h1 { font-size: 1.3rem; }
}

/* Annonces du gestionnaire */
.encart.annonce { background: var(--orange-clair); border-left: 4px solid var(--orange); }
.encart.annonce p { margin: 6px 0; white-space: pre-line; }
.annonce-titre { font-weight: 700; font-size: 1.05rem; }
.annonce-quand { font-weight: 600; color: var(--orange); margin-top: 2px; }
.encart.annonce .btn.petit { margin-top: 8px; }
.entete-gestion { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.entete-gestion h1 { margin-bottom: 0; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.puce { border: 1px solid var(--bord); background: var(--carte); color: var(--texte); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; }
.puce:hover { border-color: var(--bleu); }
.deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.deux-col input { width: 100%; min-width: 0; }
@media (max-width: 420px) { .deux-col { grid-template-columns: 1fr; } }

/* Administration : vue d'ensemble */
.grille.agences { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
@media (max-width: 520px) { .grille.agences { grid-template-columns: 1fr; } }
.agence-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.agence-tete h3 { margin: 0; }
.kpi.compact { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
@media (max-width: 520px) { .kpi.compact { grid-template-columns: repeat(2, 1fr); } }
.kpi.compact div { padding: 8px; }
.kpi.compact b { font-size: 1.2rem; }
.kpi.compact span { font-size: .75rem; }
.kpi div.alerte { border-color: var(--rouge); background: var(--rouge-clair); }
.kpi div.alerte b { color: var(--rouge); }
.badge.logiciel.powimo { background: var(--bleu-clair); color: var(--bleu); }
.badge.logiciel.gercop { background: var(--vert-clair); color: var(--vert); }
.barres { display: flex; align-items: flex-end; gap: 4px; height: 48px; margin: 4px 0 10px; }
.barres span { flex: 1; background: color-mix(in srgb, var(--bleu) 55%, transparent); border-radius: 3px 3px 0 0; position: relative; min-height: 4px; }
.barres i { position: absolute; top: -15px; left: 0; right: 0; text-align: center; font-size: .65rem; font-style: normal; color: var(--texte-2); }
.tableau td.rouge { color: var(--rouge); font-weight: 700; }
.carte.agence .btn.petit { margin-top: 2px; }
.carte.agence.ouverte { grid-column: 1 / -1; }
.carte.agence .tableau { font-size: .85rem; }

/* ───────── Espace professionnel : menu latéral (inspiré des logiciels métier) ───────── */
:root { --cote: 252px; --cote-fond: #e3edf8; --bleu-vif: #2f6fb0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cote-fond: #16212c; --bleu-vif: #5b9bd8; } }
:root[data-theme="dark"] { --cote-fond: #16212c; --bleu-vif: #5b9bd8; }

.menu-btn, .cote, .voile { display: none; }
body.pro .cote {
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--cote); z-index: 30;
  background: var(--cote-fond); border-right: 1px solid var(--bord); padding: 14px 12px; overflow-y: auto;
}
body.pro .barre, body.pro .contenu { margin-left: var(--cote); }
body.pro .barre { justify-content: flex-end; padding: 10px 24px; }
body.pro .barre .marque { display: none; }
body.pro .contenu.large { max-width: 1240px; padding: 24px; }
.cote-marque { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--texte); text-decoration: none; padding: 4px 8px 14px; border-bottom: 1px solid var(--bord); margin-bottom: 6px; }
.cote-titre { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-2); margin: 16px 10px 6px; }
.cote-lien { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--texte); text-decoration: none; font-weight: 500; position: relative; }
.cote-lien:hover { background: color-mix(in srgb, var(--bleu-vif) 10%, transparent); }
.cote-lien.actif { background: var(--bleu-vif); color: #fff; font-weight: 600; box-shadow: 0 2px 6px color-mix(in srgb, var(--bleu-vif) 35%, transparent); }
.cote-ico { width: 22px; text-align: center; font-size: 1.05rem; }
.cote-compteur { margin-left: auto; background: var(--rouge); color: #fff; border-radius: 9px; font-size: .72rem; font-weight: 700; padding: 1px 7px; }
.cote-pied { margin-top: auto; padding: 16px 10px 4px; font-size: .78rem; color: var(--texte-2); }
.cote-pied a { color: var(--texte-2); }

.choix-agence { width: auto; margin-right: auto; font-weight: 700; font-size: 1.05rem; border: 0; background: transparent; padding: 6px 8px; color: var(--texte); cursor: pointer; }
.choix-agence.fixe { cursor: default; }
body.pro .nav { flex: 1; gap: 14px; }
.cloche { position: relative; font-size: 1.2rem; text-decoration: none; padding: 6px 10px; border-radius: 10px; }
.profil { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texte); padding: 4px 6px; border-radius: 12px; }
.profil:hover { background: var(--gris-clair); }
.profil-txt { display: flex; flex-direction: column; line-height: 1.2; }
.profil-txt small { color: var(--texte-2); }
.role { font-size: .65rem; font-weight: 700; letter-spacing: .06em; color: var(--bleu-vif); background: var(--bleu-clair); border-radius: 6px; padding: 2px 6px; vertical-align: middle; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bleu-vif); color: #fff; font-weight: 700; font-size: .85rem; flex: none; }
.avatar.grand { width: 56px; height: 56px; font-size: 1.15rem; }

@media (max-width: 899px) {
  body.pro .cote { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 30px rgba(0,0,0,.2); }
  body.pro.menu-ouvert .cote { transform: none; }
  body.pro .barre, body.pro .contenu { margin-left: 0; }
  body.pro .barre { padding: 8px 12px; }
  body.pro .menu-btn { display: block; font-size: 1.4rem; background: none; border: 0; padding: 4px 8px; cursor: pointer; color: var(--texte); }
  body.pro .voile:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
  .profil-txt { display: none; }
  .choix-agence { font-size: .95rem; max-width: 50vw; }
  body.pro .contenu.large { padding: 16px; }
}
@media (min-width: 900px) { body.pro .onglets-admin { display: none; } }

/* Accueil du tableau de bord */
.carte.bonjour { display: flex; align-items: center; gap: 16px; background: linear-gradient(100deg, var(--bleu-clair), var(--carte) 70%); border-color: color-mix(in srgb, var(--bleu-vif) 30%, var(--bord)); }
.carte.bonjour > div:nth-child(2) { flex: 1; }
.bonjour-droite { text-align: right; }
@media (max-width: 600px) { .bonjour-droite { display: none; } }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 44%), 1fr)); gap: 14px; margin-bottom: 14px; }
.carte.chiffre { margin: 0; padding: 18px; }
.chiffre-tete { display: flex; align-items: center; gap: 10px; font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--texte-2); }
.chiffre-ico { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--bleu-clair); font-size: 1rem; flex: none; }
.chiffre-val { display: flex; align-items: center; gap: 10px; margin: 8px 0 6px; }
.chiffre-val b { font-size: 2.2rem; line-height: 1; }
.variation { font-size: .8rem; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--gris-clair); color: var(--texte-2); }
.variation.bon { background: var(--vert-clair); color: var(--vert); }
.variation.mauvais { background: var(--rouge-clair); color: var(--rouge); }
.deux-blocs { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; }
.deux-blocs.larges { grid-template-columns: 3fr 2fr; margin-bottom: 4px; }
@media (max-width: 900px) { .deux-blocs, .deux-blocs.larges { grid-template-columns: 1fr; } }
.carte.bloc h2 { margin: 0; font-size: 1.1rem; }
.bloc-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.bloc-tete a { text-decoration: none; }
.compteurs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.compteur { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; border-radius: 12px; text-decoration: none; color: var(--texte-2); font-size: .85rem; border: 1px solid transparent; text-align: center; }
.compteur b { font-size: 1.5rem; color: var(--texte); }
.compteur.orange { background: var(--orange-clair); border-color: color-mix(in srgb, var(--orange) 30%, transparent); }
.compteur.orange b { color: var(--orange); }
.compteur.vert { background: var(--vert-clair); border-color: color-mix(in srgb, var(--vert) 30%, transparent); }
.compteur.bleu { background: var(--bleu-clair); border-color: color-mix(in srgb, var(--bleu-vif) 30%, transparent); }
.liste .ligne { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--bord); text-decoration: none; color: inherit; }
.liste .ligne:hover { background: var(--gris-clair); }
.ligne-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gris-clair); flex: none; }
.ligne-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ligne-txt small { color: var(--texte-2); }
.pilule { display: inline-block; white-space: nowrap; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 8px; border: 1px solid; }
.pilule.ouvert { background: var(--vert-clair); color: var(--vert); border-color: color-mix(in srgb, var(--vert) 35%, transparent); }
.pilule.a_valider { background: var(--orange-clair); color: var(--orange); border-color: color-mix(in srgb, var(--orange) 35%, transparent); }
.pilule.missionne { background: var(--bleu-clair); color: var(--bleu-vif); border-color: color-mix(in srgb, var(--bleu-vif) 35%, transparent); }
.pilule.resolu { background: var(--gris-clair); color: var(--texte-2); border-color: var(--bord); }
.pilule.refuse, .pilule.refuse_ia, .pilule.brouillon { background: var(--gris-clair); color: var(--texte-2); border-color: var(--bord); }
.classement { list-style: none; counter-reset: rang; padding: 0; margin: 0; }
.classement li { counter-increment: rang; display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--bord); }
.classement li::before { content: counter(rang); width: 22px; color: var(--texte-2); font-weight: 700; text-align: center; }

/* Liste des signalements */
.filtres-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.filtre-carte { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 12px; cursor: pointer; font: inherit; color: var(--texte); box-shadow: var(--ombre); }
.filtre-carte small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); }
.filtre-carte b { font-size: 1.35rem; }
.filtre-carte.actif { border: 2px solid var(--bleu-vif); padding: 11px; }
.barre-outils { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.barre-outils .recherche { flex: 1 1 320px; width: auto; }
.barre-outils select { width: auto; }
input[type=search] { width: 100%; padding: 12px 14px; border: 1px solid var(--bord); border-radius: 12px; background: var(--carte); color: var(--texte); font: inherit; }
.carte.sans-marge { padding: 0; overflow: hidden; }
.tableau.tickets th { font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; color: var(--texte-2); padding: 14px 12px; background: var(--gris-clair); }
.tableau.tickets td { padding: 12px; vertical-align: middle; }
.tableau.tickets tr.cliquable { cursor: pointer; }
.tableau.tickets tr.cliquable:hover td { background: color-mix(in srgb, var(--bleu-vif) 5%, transparent); }
.titre-ticket { display: flex; align-items: center; gap: 12px; }
.titre-ticket a { color: var(--texte); text-decoration: none; font-weight: 600; }
.titre-ticket small { display: block; color: var(--bleu-vif); font-size: .85rem; }
.jauge { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 600; font-size: .88rem; }
.jauge .traits { display: inline-flex; gap: 3px; }
.jauge i { width: 14px; height: 6px; border-radius: 3px; background: var(--bord); }
.jauge.faible { color: var(--texte-2); } .jauge.faible i.plein { background: var(--texte-2); }
.jauge.normale { color: var(--orange); } .jauge.normale i.plein { background: var(--orange); }
.jauge.haute, .jauge.critique { color: var(--rouge); } .jauge.haute i.plein, .jauge.critique i.plein { background: var(--rouge); }

/* Graphiques */
.graphe { width: 100%; height: auto; display: block; margin-top: 8px; }
.graphe .grille-ligne { stroke: var(--bord); stroke-dasharray: 3 4; }
.graphe .axe { fill: var(--texte-2); font-size: 11px; }
.graphe .point { fill: transparent; }
.graphe .point:hover { fill: color-mix(in srgb, var(--bleu) 25%, transparent); }
.donut { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.donut svg { width: 190px; height: 190px; }
.donut-total { font-size: 30px; font-weight: 800; fill: var(--texte); }
.legende { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: .85rem; color: var(--texte-2); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
@media (max-width: 600px) {
  .carte.chiffre { padding: 12px; }
  .chiffre-val b { font-size: 1.7rem; }
  .chiffre-tete { font-size: .7rem; gap: 6px; }
  .chiffre-ico { width: 26px; height: 26px; }
  .variation { font-size: .72rem; padding: 2px 6px; }
}

/* Console plateforme */
.bandeau-tech { display: inline-flex; align-items: center; gap: 4px; background: #fff3cd; color: #7a5a00; border: 1px solid #f0d78a; border-radius: 10px; padding: 6px 10px; font-size: .88rem; white-space: nowrap; }
.bandeau-tech.neutre { background: var(--gris-clair); color: var(--texte-2); border-color: var(--bord); }
.bandeau-tech button { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; font-weight: 700; padding: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bandeau-tech:not(.neutre) { background: #3a3014; color: #f3d77d; border-color: #6b5a22; } }
.pilule.client-actif { background: var(--vert-clair); color: var(--vert); border-color: color-mix(in srgb, var(--vert) 35%, transparent); }
.pilule.client-essai { background: var(--bleu-clair); color: var(--bleu-vif); border-color: color-mix(in srgb, var(--bleu-vif) 35%, transparent); }
.pilule.client-suspendu { background: var(--orange-clair); color: var(--orange); border-color: color-mix(in srgb, var(--orange) 35%, transparent); }
.pilule.client-resilie { background: var(--rouge-clair); color: var(--rouge); border-color: color-mix(in srgb, var(--rouge) 35%, transparent); }
.progression { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; }
.progression .piste { flex: 1; height: 8px; background: var(--gris-clair); border-radius: 4px; overflow: hidden; min-width: 80px; }
.progression .piste span { display: block; height: 100%; background: var(--bleu-vif); border-radius: 4px; }
.etapes { list-style: none; padding: 0; margin: 0; }
.etapes li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 4px; border-top: 1px solid var(--bord); }
.etapes li label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.etapes li.fait label { color: var(--texte-2); }
.etapes input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--bleu-vif); }
.point-etat { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--texte-2); vertical-align: middle; }
.point-etat.vert { background: var(--vert); } .point-etat.orange { background: var(--orange); }
.journal { list-style: none; padding: 0; margin: 0; max-height: 320px; overflow-y: auto; }
.journal li { padding: 8px 2px; border-top: 1px solid var(--bord); }
.formulaire h3 { margin: 18px 0 8px; font-size: .8rem; letter-spacing: .07em; text-transform: uppercase; color: var(--texte-2); }
.formulaire h3:first-child { margin-top: 0; }
.grille-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; align-items: end; }
.champ { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.champ input, .champ select, .champ textarea { font-weight: 400; }
input[type=number], input[type=date] { width: 100%; padding: 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); color: var(--texte); font: inherit; }
.btn.petit { white-space: nowrap; }
input[type=color] { width: 100%; height: 46px; padding: 4px; border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); cursor: pointer; }

/* ═════════════ Charte Signal Copro : bleu marine & orange ═════════════ */
:root {
  --marine: #0e2542; --marine-2: #1b3a63; --marine-clair: #eaf0f7;
  --accent: #f26a1b; --accent-fonce: #d65a10; --accent-clair: #fff1e7;
  --bleu: #1b3a63; --bleu-clair: #eef2f8; --bleu-vif: #1b3a63;
  --texte: #0f1b2d; --texte-2: #5a6577; --fond: #f4f6f9; --bord: #e3e7ee; --gris-clair: #f0f2f6;
  --rayon: 12px; --ombre: 0 1px 2px rgba(15, 27, 45, .04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bleu: #a9c1e6; --bleu-clair: #1a2737; --bleu-vif: #7fa3d6; --marine-clair: #1a2737; --accent-clair: #3a2416; --texte: #e8edf3; --texte-2: #a0abba; --fond: #0f141b; --carte: #171e27; --bord: #283240; --gris-clair: #1e2631; }
}
:root[data-theme="dark"] { --bleu: #a9c1e6; --bleu-clair: #1a2737; --bleu-vif: #7fa3d6; --marine-clair: #1a2737; --accent-clair: #3a2416; --texte: #e8edf3; --texte-2: #a0abba; --fond: #0f141b; --carte: #171e27; --bord: #283240; --gris-clair: #1e2631; }

body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif; letter-spacing: -.005em; }
h1, h2, h3 { color: var(--texte); letter-spacing: -.015em; }
h1 { font-weight: 700; }
b, .chiffre-val b, .kpi b, .filtre-carte b, .compteur b { font-variant-numeric: tabular-nums; }
.ico { flex: none; vertical-align: -3px; }
.avec-ico { display: inline-flex; align-items: center; gap: 6px; }
.encart.avec-ico { display: flex; }
.compte-ico { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.compte-ico .ico + .ico { margin-left: 10px; }

/* Boutons : l'orange est réservé à l'action principale */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; font-weight: 600; }
.btn.primaire { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primaire:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); }
.btn.geant { font-size: 1.1rem; }
a { color: var(--bleu); }

/* Cartes plus sobres */
.carte { border-radius: var(--rayon); box-shadow: var(--ombre); border-color: var(--bord); }
.encart { border-radius: 10px; }
.encart.succes { color: var(--vert); }
.badge { border-radius: 6px; }
.pilule { border: 0; border-radius: 6px; font-size: .78rem; padding: 3px 8px; }
.pilule.missionne { background: var(--marine-clair); color: var(--bleu); }
.avatar { background: var(--marine); }
:root:not([data-theme="light"]) .avatar { background: var(--marine-2); }

/* Menu latéral bleu marine */
body.pro .cote { background: var(--marine); border-right: 0; color: #c3cddc; }
.cote-marque { color: #fff; border-bottom-color: rgba(255, 255, 255, .08); font-size: 1.12rem; letter-spacing: -.02em; }
.cote-marque .orange, .marque .orange { color: var(--accent); }
.cote-titre { color: #7183a0; font-size: .68rem; letter-spacing: .1em; }
.cote-lien { color: #c3cddc; font-weight: 500; border-radius: 8px; padding: 9px 12px; }
.cote-lien:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.cote-lien.actif { background: rgba(242, 106, 27, .14); color: #fff; box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.cote-lien.actif .cote-ico { color: var(--accent); }
.cote-ico { display: inline-grid; place-items: center; width: 20px; color: #8fa0b8; }
.cote-pied, .cote-pied a { color: #7183a0; }
.cote-compteur { background: var(--accent); }
.pastille { background: var(--accent); }
body.pro .barre { background: var(--carte); }
.cloche { color: var(--texte-2); display: inline-grid; place-items: center; }
.role { color: var(--accent-fonce); background: var(--accent-clair); }
.choix-agence { color: var(--texte); }

/* En-tête côté copropriétaire */
.barre .marque span { letter-spacing: -.02em; }

/* Accueil du tableau de bord */
.carte.bonjour { background: var(--carte); border-color: var(--bord); }
.carte.bonjour b { font-size: 1.15rem; }
.chiffre-tete { font-size: .72rem; letter-spacing: .08em; color: var(--texte-2); }
.chiffre-ico { background: transparent; width: auto; height: auto; color: var(--texte-2); }
.chiffre-val b { font-size: 2rem; font-weight: 700; color: var(--marine); }
:root:not([data-theme="light"]) .chiffre-val b { color: var(--texte); }
@media (prefers-color-scheme: light) { .chiffre-val b { color: var(--marine); } }
.variation { display: inline-flex; align-items: center; gap: 3px; border-radius: 6px; font-size: .75rem; }
.barres span { background: color-mix(in srgb, var(--bleu-vif) 22%, transparent); }
.barres span:last-child { background: var(--accent); }
.compteur { background: var(--gris-clair) !important; border: 1px solid var(--bord) !important; color: var(--texte-2); }
.compteur b { color: var(--texte) !important; }
.compteur.orange { box-shadow: inset 0 3px 0 #e0a100; }
.compteur.vert { box-shadow: inset 0 3px 0 var(--vert); }
.compteur.bleu { box-shadow: inset 0 3px 0 var(--marine-2); }
.ligne-ico { background: var(--gris-clair); color: var(--texte-2); }
.titre-ticket small { color: var(--texte-2); }

/* Liste des signalements */
.filtre-carte { box-shadow: none; border-radius: 10px; }
.filtre-carte .chiffre-ico { color: var(--texte-2); }
.filtre-carte.actif { border: 2px solid var(--accent); }
.filtre-carte.actif .chiffre-ico { color: var(--accent); }
.tableau.tickets th { background: var(--carte); border-bottom: 1px solid var(--bord); font-size: .7rem; }
.progression .piste span { background: var(--accent); }
.onglets button.actif { background: var(--marine); border-color: var(--marine); }
.puce .ico { margin-right: 6px; vertical-align: -3px; }
.encart.annonce { border-left-color: var(--accent); background: var(--accent-clair); }
.annonce-quand { color: var(--accent-fonce); }

/* Logo du syndic */
.logo-client { max-height: 34px; max-width: 150px; object-fit: contain; }
.syndic { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.syndic:empty { display: none; }
.syndic img { max-height: 44px; max-width: 160px; object-fit: contain; }
.syndic .discret { display: flex; flex-direction: column; line-height: 1.25; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.syndic .discret b { text-transform: none; letter-spacing: 0; font-size: .98rem; color: var(--texte); }
.logo-bloc { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; align-items: center; }
@media (max-width: 520px) { .logo-bloc { grid-template-columns: 1fr; } }
.logo-apercu { display: grid; place-items: center; height: 90px; border: 1px dashed var(--bord); border-radius: 10px; background: #fff; padding: 8px; }
.logo-apercu img { max-height: 72px; max-width: 140px; object-fit: contain; }

/* Menu du profil */
.profil-zone { position: relative; }
button.profil { background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.chevron { color: var(--texte-2); font-size: 1rem; margin-left: 2px; line-height: 1; }
.menu-profil { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 27, 45, .14); padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.menu-profil[hidden] { display: none; }
.menu-profil-tete { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--bord); margin-bottom: 4px; }
.menu-profil-tete small { color: var(--texte-2); }
.menu-profil a, .menu-profil button { display: block; text-align: left; padding: 9px 10px; border-radius: 8px; color: var(--texte); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.menu-profil a:hover, .menu-profil button:hover { background: var(--gris-clair); }
.menu-profil .deconnexion { color: var(--rouge); border-top: 1px solid var(--bord); border-radius: 0 0 8px 8px; margin-top: 4px; }

/* Mon équipe */
.entete-gestion p { margin: 2px 0 0; }
.btn-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: none; color: var(--texte-2); cursor: pointer; }
.btn-ico:hover { background: var(--gris-clair); color: var(--texte); }
.actions-ligne { text-align: right; white-space: nowrap; }
.pilule.role-admin { background: var(--marine-clair); color: var(--bleu); }
.pilule.role-gestionnaire { background: var(--gris-clair); color: var(--texte-2); }
tr.inactif td { opacity: .55; }
.tableau.tickets td input, .tableau.tickets td select { padding: 8px; margin: 2px 0; }
.titre-ticket small { display: block; }
.grille-form { align-items: start; }
.formulaire .actions .btn { flex: 0 0 auto; min-width: 140px; }
/* Logo du syndic : toujours sur fond blanc, lisible en mode sombre */
.logo-client, .syndic img { background: #fff; border-radius: 8px; padding: 4px 8px; }
