/* Onglet « Agences » (Grok et Kenji, 11/11/2026) : suivi commercial interne, téléphone d'abord, palette du Bureau. */
#agences-bureau { --agb-vert: #1f7a3c; --agb-vert-bg: #e7f4ea; --agb-orange: #9a4f00; --agb-orange-bg: #fff2df; --agb-gris-bg: rgb(0 0 0 / .05); color: var(--ink); font-variant-numeric: tabular-nums; }
:root[data-theme=dark] #agences-bureau { --agb-vert: #8fe0a8; --agb-vert-bg: #1f3326; --agb-orange: #ffc27a; --agb-orange-bg: #3a2b14; --agb-gris-bg: rgb(255 255 255 / .06); }
body.avec-agences main > section:not(#agences-bureau) { display: none !important; }
body.avec-agences main { display: block; }
#agences-bureau h1, #agences-bureau h2, #agences-bureau h3, #agences-bureau p { margin: 0; }
#agences-bureau button { font: inherit; }
.agb-racine { width: min(860px, 100%); margin: 0 auto; padding: 8px 0 48px; display: grid; gap: 14px; }
.agb-tete { padding-top: 12px; }
.agb-titres { display: grid; gap: 6px; }
.agb-titre { font-size: clamp(28px, 4vw, 40px); line-height: 1.05; letter-spacing: -.04em; font-weight: 750; outline: none; }
.agb-sous-titre, .agb-statut { color: var(--muted); font-size: 15px; }
.agb-vues { display: flex; flex-wrap: wrap; gap: 6px; }
.agb-vue { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--agb-gris-bg); color: var(--ink); font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background-color .18s var(--courbe, ease), transform .18s var(--courbe, ease); }
.agb-vue[aria-pressed=true] { background: var(--accent); color: #fff; }
.agb-vue:active { transform: scale(.97); }
.agb-liste, .agb-dossiers, .agb-logements, .agb-motifs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.agb-ligne { animation: agb-entree .32s var(--courbe, ease) both; animation-delay: calc(var(--i, 0) * 22ms); }
@keyframes agb-entree { from { opacity: 0; transform: translate3d(0, 6px, 0); } }
.agb-carte { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-radius: 18px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-align: left; cursor: pointer;
  transition: transform .18s var(--courbe, ease), box-shadow .18s; }
.agb-carte:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.agb-carte:active { transform: scale(.985); }
.agb-carte:focus-visible, .agb-dossier:focus-visible, .agb-retour:focus-visible, .agb-vue:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.agb-rang { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--agb-gris-bg); font-size: 13px; font-weight: 700; color: var(--muted); }
.agb-corps { display: grid; gap: 2px; min-width: 0; }
.agb-nom { font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.agb-autres { color: var(--muted); font-size: 12.5px; font-style: italic; overflow-wrap: anywhere; }
.agb-chiffres { color: var(--muted); font-size: 13px; }
.agb-ca { color: var(--ink); font-weight: 650; white-space: nowrap; }
.agb-tendance { padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; background: var(--agb-gris-bg); color: var(--muted); }
.agb-tendance.est-hausse { background: var(--agb-vert-bg); color: var(--agb-vert); }
.agb-tendance.est-baisse { background: var(--agb-orange-bg); color: var(--agb-orange); }
.agb-vide { color: var(--muted); padding: 12px 2px; }
.agb-fiche { display: grid; gap: 16px; animation: agb-entree .3s var(--courbe, ease) both; }
.agb-retour { justify-self: start; min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--accent); font-weight: 600; }
.agb-fiche-titre { font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -.03em; font-weight: 750; outline: none; }
.agb-tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.agb-tuile { display: grid; gap: 4px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.agb-tuile-nom, .agb-tuile-note { color: var(--muted); font-size: 13px; }
.agb-tuile-valeur { font-size: 26px; letter-spacing: -.03em; }
.agb-bloc { display: grid; gap: 8px; }
.agb-bloc h3 { font-size: 15px; color: var(--muted); font-weight: 650; }
.agb-dossier { width: 100%; display: grid; gap: 2px; padding: 10px 12px; border: 0; border-radius: 14px; background: var(--agb-gris-bg); color: var(--ink); text-align: left; cursor: pointer; }
.agb-dossier.est-en-cours { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.agb-dossier-nom { font-weight: 650; overflow-wrap: anywhere; }
.agb-dossier-meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.agb-factures { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.agb-logements li, .agb-motifs li, .agb-factures li { padding: 10px 12px; border-radius: 14px; background: var(--agb-gris-bg); font-size: 14px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .agb-ligne, .agb-fiche { animation: none; } .agb-carte, .agb-vue { transition: none; } }
.agb-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.agb-comptes { flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer; }
.agb-comptes:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.agb-comptes:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Vue « Demandes » (demande de Kenji du 30/11/2026) : les agences en bannières, ce qui attend chez chacune */
.agb-racine:has(.agb-demandes:not([hidden])) { width: min(1040px, 100%); }
.agb-onglets { display: inline-flex; justify-self: start; padding: 3px; border-radius: 999px; background: var(--agb-gris-bg); }
.agb-onglet { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-weight: 600; font-size: 14px; }
.agb-onglet[aria-pressed=true] { background: var(--surface); box-shadow: 0 1px 4px rgb(0 0 0 / .14); }
.agb-demandes { display: grid; gap: 14px; }
.agb-resume { padding: 13px 18px; border-radius: 16px; background: var(--agb-vert-bg); color: var(--agb-vert); font-size: 15px; }
.agb-resume.a-traiter { background: var(--agb-orange-bg); color: var(--agb-orange); }
.agb-resume span { font-weight: 400; }
.agb-bannieres { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.agb-ban-ligne { animation: agb-entree .32s var(--courbe, ease) both; animation-delay: calc(var(--i, 0) * 22ms); }
.agb-banniere { position: relative; width: 100%; display: grid; grid-template-columns: minmax(0, 1.35fr) auto auto; align-items: center; gap: 22px; padding: 20px 22px 20px 28px; border: 0; border-radius: 22px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 14px 34px -26px rgb(0 0 0 / .45); color: var(--ink); text-align: left; cursor: pointer; overflow: hidden;
  transition: transform .2s var(--courbe, ease), box-shadow .2s; }
.agb-banniere::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--accent); }
.agb-banniere.neuf::before { background: #e8590c; }
.agb-banniere.attente::before { background: #f59f00; }
.agb-banniere.calme::before { background: color-mix(in srgb, var(--muted) 45%, transparent); }
.agb-banniere:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), 0 16px 36px -24px rgb(0 0 0 / .5); }
.agb-banniere:active { transform: scale(.99); }
.agb-banniere:focus-visible, .agb-onglet:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.agb-ban-texte { display: grid; gap: 4px; min-width: 0; }
.agb-ban-nom { font-size: 20px; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.agb-ban-qui { color: var(--muted); font-size: 13.5px; }
.agb-ban-puces { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.agb-puce { padding: 4px 11px; border-radius: 999px; background: var(--agb-gris-bg); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.agb-puce.rouge { background: #e8590c22; color: #c2410c; }
.agb-puce.ambre { background: var(--agb-orange-bg); color: var(--agb-orange); }
.agb-puce.vert { background: var(--agb-vert-bg); color: var(--agb-vert); }
:root[data-theme=dark] .agb-puce.rouge { color: #ffa987; }
.agb-ban-chiffres { display: flex; align-items: flex-end; gap: 24px; }
.agb-ban-chiffre { display: grid; gap: 2px; }
.agb-ban-chiffre strong { font-size: 28px; line-height: 1; letter-spacing: -.03em; }
.agb-ban-chiffre.gros strong { font-size: 42px; color: var(--accent); }
.agb-banniere.calme .agb-ban-chiffre.gros strong { color: var(--muted); }
.agb-ban-chiffre span { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.agb-ban-fleche { color: var(--muted); font-size: 24px; }
.agb-ban-neuf { position: absolute; top: 12px; right: 16px; padding: 3px 10px; border-radius: 999px; background: #e8590c; color: #fff; font-size: 12px; font-weight: 700; }
.agb-agence-tete { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.agb-agence-tete > div { display: grid; gap: 6px; }
.agb-agence-demandes .cellule-root { padding: 0; }
.agb-agence-mails, .agb-agence-autres { display: grid; gap: 10px; margin: 18px 0; }
.agb-section-titre { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.agb-mails, .agb-autres-dossiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.agb-mail { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 14px 16px 14px 20px; border-radius: 18px;
  background: var(--surface); color: var(--ink); border: 1px solid #e8590c55; box-shadow: inset 4px 0 0 #e8590c; }
.agb-mail-texte { display: grid; gap: 3px; min-width: 0; }
.agb-mail-objet { font-size: 15.5px; overflow-wrap: anywhere; }
.agb-mail-qui { color: var(--muted); font-size: 13px; }
.agb-mail-propose { color: var(--accent); font-size: 13.5px; font-weight: 600; }
.agb-mail-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.agb-mail-rattacher, .agb-mail-ouvrir { min-height: 40px; padding: 0 14px; border-radius: 12px; font-weight: 650; font-size: 14px; cursor: pointer; }
.agb-mail-rattacher { border: 0; background: var(--accent); color: var(--surface); }
.agb-mail-ouvrir { border: 0; box-shadow: inset 0 0 0 1px var(--line); background: transparent; color: var(--ink); }
.agb-mail-rattacher:disabled { opacity: .6; }
.agb-mail-erreur { grid-column: 1 / -1; margin: 0; }
.agb-mail-fait { margin: 0; color: var(--agb-vert); font-weight: 650; }
.agb-dossier { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px;
  border: 0; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.agb-dossier-texte { display: grid; gap: 2px; min-width: 0; }
.agb-dossier-texte strong { overflow-wrap: anywhere; }
.agb-dossier-sous { color: var(--muted); font-size: 13px; }
@media (max-width: 720px) { .agb-mail { grid-template-columns: 1fr; } .agb-mail-actions { justify-content: flex-start; } }
@media (max-width: 720px) {
  .agb-banniere { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 18px 16px 18px 22px; }
  .agb-ban-chiffres { grid-column: 1 / -1; grid-row: 2; gap: 20px; }
  .agb-ban-fleche { grid-row: 1; grid-column: 2; }
  .agb-ban-chiffre.gros strong { font-size: 34px; }
  .agb-ban-neuf { position: static; justify-self: start; grid-column: 1 / -1; grid-row: 3; }
}
