/* Bilan d’équipe : les mêmes repères que le Bilan exploitation, dans la coque
   d’administration. Les valeurs SVG sont des attributs, sans styles incorporés. */
#vue-bilan {
  container: bilan-equipe / inline-size;
  min-width: 0;
  color: var(--oaa-encre);
  --be-alterne: color-mix(in srgb, var(--oaa-surface-alt) 60%, var(--oaa-surface));
  --be-barre: color-mix(in srgb, var(--oaa-secondaire) 65%, var(--oaa-surface));
}
#vue-bilan #bilan-resultats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
#vue-bilan #bilan-resultats > *, #vue-bilan :is(#be-profils, #be-jours) { min-width: 0; }
#vue-bilan .be-intro { margin: 0 0 18px; max-width: 850px; color: var(--oaa-secondaire); font-size: 13px; line-height: 1.6; }
#vue-bilan .be-intro p { margin: 0; }
#vue-bilan .be-toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  min-width: 0; margin: 0 0 20px;
}
#vue-bilan .be-toolbar label { display: flex; flex: 1 1 150px; flex-direction: column; gap: 6px; min-width: 0; max-width: 260px; margin: 0; }
#vue-bilan .be-toolbar :is(input, select) { min-width: 0; max-width: 100%; width: 100%; margin: 0; background-color: var(--oaa-surface); }
#vue-bilan .be-dates { display: flex; flex: 2 1 360px; flex-wrap: wrap; align-items: flex-end; gap: 12px; min-width: 0; }
#vue-bilan .be-dates > label { flex-basis: 130px; max-width: none; }
#vue-bilan .be-dates > button { flex: none; }
#vue-bilan .be-export { margin-left: auto; }
#vue-bilan :is(button, input, select) { min-height: 44px; }
#vue-bilan :is(input, select) { height: 44px; border-color: transparent; box-shadow: none; }
#vue-bilan button {
  min-width: 44px; height: auto; padding: 10px 16px; border: 1px solid transparent;
  border-radius: var(--oaa-rayon-pilule); background: var(--oaa-surface-alt); color: var(--oaa-encre);
  font: 600 13px/1.35 var(--oaa-police); white-space: normal; box-shadow: none; transform: none;
  transition: background-color 150ms ease, color 150ms ease;
}
#vue-bilan button:hover:not(:disabled) { background: color-mix(in srgb, var(--oaa-encre) 6%, var(--oaa-surface-alt)); }
#vue-bilan button.principal { background: var(--oaa-accent); color: var(--oaa-sur-accent); }
#vue-bilan button.principal:hover:not(:disabled) { background: var(--oaa-accent-fonce); }
#vue-bilan button.discret { background: transparent; }
#vue-bilan button.discret:hover:not(:disabled) { background: var(--oaa-surface-alt); }
#vue-bilan :is(button, input, select, a, summary, [tabindex]):focus-visible { outline: 2px solid var(--oaa-info); outline-offset: 3px; }
#vue-bilan input::placeholder { color: var(--oaa-discret); opacity: 1; }

/* Le taux de réponse ouvre les chiffres clés ; la couleur porte sa priorité. */
#vue-bilan .be-kpis { display: grid; grid-template-columns: minmax(0, 1.55fr) repeat(5, minmax(0, 1fr)); gap: 16px; min-width: 0; }
#vue-bilan .be-kpi {
  display: flex; flex-direction: column; min-width: 0; min-height: 148px; padding: 18px;
  border: 1px solid transparent; border-radius: 22px; background: var(--oaa-surface); box-shadow: none;
}
#vue-bilan .be-label { display: block; margin: 0; color: var(--oaa-secondaire); font: 650 11px/1.4 var(--oaa-police); letter-spacing: .06em; text-transform: uppercase; }
#vue-bilan .be-kpi > strong { display: block; margin-top: 8px; font: 650 clamp(24px, 3cqi, 32px)/1.15 var(--oaa-police-titre); letter-spacing: -.025em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#vue-bilan .be-kpi > small { display: block; margin-top: 6px; color: var(--oaa-secondaire); font-size: 12px; line-height: 1.45; }
#vue-bilan .be-kpi.be-hero { background: color-mix(in srgb, var(--oaa-info) 7%, var(--oaa-surface)); }
#vue-bilan .be-hero > strong { color: var(--oaa-info); font-size: 40px; line-height: 1.1; }
#vue-bilan .be-hero > small { margin-bottom: 14px; }
#vue-bilan .be-gauge { display: block; width: 100%; height: 6px; margin-top: auto; overflow: hidden; border-radius: var(--oaa-rayon-pilule); background: var(--oaa-surface); fill: var(--oaa-info); }
#vue-bilan .be-gauge .be-muted { fill: var(--oaa-surface); }
#vue-bilan .be-gauge .be-success { fill: var(--oaa-info); }

/* Deux graphiques puis les profils et l’historique. Aucune entrée animée au
   rafraîchissement : les commandes et les chiffres gardent leur position. */
#vue-bilan .be-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }
#vue-bilan :is(.be-card, .be-card-wide, .be-profiles) {
  min-width: 0; margin: 0; padding: 22px 24px; border: 1px solid transparent;
  border-radius: 24px; background: var(--oaa-surface); box-shadow: none;
}
#vue-bilan .be-grid2 > .be-card { display: flex; flex-direction: column; }
#vue-bilan .be-card-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; min-width: 0; }
#vue-bilan .be-card-head > div { flex: 1 1 200px; min-width: 0; }
#vue-bilan .be-card-head h2 { margin: 0; color: var(--oaa-encre); font: 600 16px/1.45 var(--oaa-police-titre); letter-spacing: -.015em; }
#vue-bilan .be-card-head p { max-width: 820px; margin: 4px 0 0; color: var(--oaa-secondaire); font-size: 12.5px; line-height: 1.5; }
#vue-bilan .be-card-head > button { flex: 0 1 auto; }
#vue-bilan .be-chart-wrap { min-width: 0; max-width: 100%; margin-block: auto; padding-block: 4px 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--oaa-bord-fort) transparent; }
#vue-bilan .be-chart {
  display: block; width: 100%; max-width: 100%; height: auto; min-width: 0; margin-block: auto;
  color: var(--oaa-encre); fill: var(--oaa-encre); font-family: var(--oaa-police); font-variant-numeric: tabular-nums;
}
#vue-bilan .be-chart text { fill: var(--oaa-encre); font-size: 15px; }
#vue-bilan .be-chart-hours text { font-size: 12.5px; }
#vue-bilan .be-chart .be-bar { fill: var(--be-barre); }
#vue-bilan .be-chart .be-success { fill: var(--oaa-info); }
#vue-bilan .be-chart .be-warning { fill: var(--oaa-attention); }
#vue-bilan .be-chart .be-muted { fill: var(--be-barre); }
#vue-bilan .be-chart text.be-muted { fill: var(--oaa-secondaire); }
#vue-bilan .be-chart text:is(.be-success, .be-warning) { font-weight: 650; }
#vue-bilan .be-gridline { stroke: var(--oaa-surface-alt); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* Les meilleurs profils se lisent avant les distributions détaillées. */
#vue-bilan .be-best-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 232px), 1fr)); gap: 12px; margin: 0 0 18px; min-width: 0; }
#vue-bilan .be-best-grid:empty { display: none; }
#vue-bilan .be-best {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; margin: 0; padding: 16px 18px;
  border: 1px solid transparent; border-radius: 20px; background: var(--oaa-accent-doux);
}
#vue-bilan .be-best > :is(label, .be-label) { margin: 0; color: var(--oaa-secondaire); font: 650 11px/1.4 var(--oaa-police); letter-spacing: .06em; text-transform: uppercase; }
#vue-bilan .be-best > strong { color: var(--oaa-encre); font: 650 17px/1.35 var(--oaa-police-titre); letter-spacing: -.015em; overflow-wrap: anywhere; }
#vue-bilan .be-best-rate { color: var(--oaa-accent); font: 650 29px/1.15 var(--oaa-police-titre); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
#vue-bilan .be-best > small { color: var(--oaa-secondaire); font-size: 12px; line-height: 1.5; }
#vue-bilan .bilan-profils { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; gap: 16px; min-width: 0; }
#vue-bilan .bilan-profil {
  min-width: 0; margin: 0; padding: 16px 18px 12px; border: 1px solid transparent; border-radius: 18px;
  background: var(--oaa-surface-alt); box-shadow: none;
}
#vue-bilan .bilan-profil .bloc-entete { margin: 0 0 10px; padding: 0; border: 0; background: transparent; }
#vue-bilan .bilan-profil h3 { margin: 0 0 8px; color: var(--oaa-secondaire); font: 650 11px/1.5 var(--oaa-police); letter-spacing: .06em; text-transform: uppercase; }
#vue-bilan .bilan-profil :is(.table-conteneur, .be-table-wrap) { min-width: 0; padding: 0; overflow-x: auto; }
#vue-bilan .bilan-profil table { min-width: 0; width: 100%; table-layout: fixed; }
#vue-bilan .bilan-profil :is(th, td) { padding: 10px 6px; white-space: normal; overflow-wrap: anywhere; border: 0; background: transparent; }
#vue-bilan .bilan-profil th { font-size: 10px; letter-spacing: .03em; }
#vue-bilan .bilan-profil :is(th, td):first-child { width: 43%; min-width: 0; }
#vue-bilan .bilan-profil :is(th, td):not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
#vue-bilan .bilan-profil tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--oaa-surface) 65%, var(--oaa-surface-alt)); }
#vue-bilan .bilan-profil tbody tr:hover td { background: var(--oaa-surface); }
#vue-bilan .bilan-profil .bilan-taux { color: var(--oaa-info); font-weight: 650; }
#vue-bilan .be-profiles > .be-note { margin-block: 16px; }
#vue-bilan .be-profiles > .be-note:last-child { margin-bottom: 0; }
#vue-bilan details.be-note summary { min-height: 44px; padding-block: 12px; cursor: pointer; color: var(--oaa-encre); font-weight: 600; }
#vue-bilan details.be-note p { margin: 8px 0 0; }

/* La table conserve ses colonnes ; son conteneur défile, jamais la page. */
#vue-bilan .be-call-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; margin-bottom: 16px; }
#vue-bilan .be-call-tools > input { flex: 2 1 240px; min-width: 0; width: auto; }
#vue-bilan .be-call-tools > select { flex: 1 1 160px; min-width: 0; width: auto; max-width: 280px; }
#vue-bilan .be-call-tools input[type="search"] { padding-left: 16px; }
#vue-bilan .be-table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--oaa-bord-fort) transparent; }
#vue-bilan :where(.be-table) { width: 100%; min-width: 700px; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 13px; }
#vue-bilan :where(.be-table) :is(th, td) { padding: 12px 14px; border: 0; text-align: left; vertical-align: middle; }
#vue-bilan :where(.be-table) th { color: var(--oaa-secondaire); background: var(--oaa-surface); font: 650 10.5px/1.4 var(--oaa-police); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
#vue-bilan :where(.be-table) td { color: var(--oaa-encre); background: transparent; font-variant-numeric: tabular-nums; }
#vue-bilan :where(.be-table) tbody tr:nth-child(even) td { background: var(--be-alterne); }
#vue-bilan :where(.be-table) tbody tr:hover td { background: var(--oaa-surface-alt); }
#vue-bilan :where(.be-table) tbody td:first-child { border-radius: 12px 0 0 12px; }
#vue-bilan :where(.be-table) tbody td:last-child { border-radius: 0 12px 12px 0; }
#vue-bilan :where(.be-table) .numerique { text-align: right; white-space: nowrap; }
#vue-bilan .be-call-person { min-width: 160px; max-width: 280px; }
#vue-bilan .be-call-person strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
#vue-bilan .be-call-person small { display: block; margin-top: 3px; color: var(--oaa-secondaire); font-size: 12px; }
#vue-bilan .be-result {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 4px 9px;
  border: 1px solid transparent; border-radius: var(--oaa-rayon-pilule);
  background: var(--oaa-surface-alt); color: var(--oaa-secondaire); font-size: 11.5px; line-height: 1.35; font-weight: 600; white-space: nowrap;
}
#vue-bilan .be-result::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
#vue-bilan .be-result--repondu { color: var(--oaa-info); background: var(--oaa-info-doux); }
#vue-bilan .be-result--messagerie { color: var(--oaa-attention); background: var(--oaa-attention-doux); }
#vue-bilan .be-result--sans-reponse { color: var(--oaa-secondaire); background: var(--oaa-surface-alt); }
#vue-bilan .be-result--echec { color: var(--oaa-danger); background: var(--oaa-danger-doux); }
#vue-bilan .be-pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px 16px; margin-top: 18px; }
#vue-bilan .be-pager > span { margin-right: auto; color: var(--oaa-secondaire); font-size: 12px; }
#vue-bilan :is(.be-empty, .be-error) { margin: 0; padding: 18px 20px; border: 1px solid transparent; border-radius: 18px; line-height: 1.6; }
#vue-bilan .be-empty { color: var(--oaa-secondaire); background: var(--oaa-surface-alt); }
#vue-bilan .be-note { margin: 0; max-width: 960px; color: var(--oaa-secondaire); font-size: 12px; line-height: 1.6; }
#vue-bilan .be-error { color: var(--oaa-danger); background: var(--oaa-danger-doux); }

/* La largeur utile dépend de la coque admin, autonome ou intégrée au panel. */
@container bilan-equipe (max-width: 899px) {
  #vue-bilan .be-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #vue-bilan .be-kpi { min-height: 132px; }
}
@container bilan-equipe (max-width: 900px) {
  #vue-bilan .be-grid2 { grid-template-columns: minmax(0, 1fr); }
}
@container bilan-equipe (max-width: 720px) {
  #vue-bilan .be-chart-hours { min-width: 540px; }
}
@container bilan-equipe (max-width: 560px) {
  #vue-bilan .be-toolbar { gap: 10px; }
  #vue-bilan .be-toolbar label { flex: 1 1 140px; max-width: none; }
  #vue-bilan .be-toolbar > button { flex: 1 1 140px; }
  #vue-bilan .be-dates { flex-basis: 100%; }
  #vue-bilan .be-dates > button { flex: 1 1 140px; }
  #vue-bilan .be-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #vue-bilan .be-kpi { min-height: 126px; padding: 16px; }
  #vue-bilan .be-kpi > strong { font-size: 25px; }
  #vue-bilan .be-hero > strong { font-size: 38px; }
  #vue-bilan :is(.be-card, .be-card-wide, .be-profiles) { padding: 16px; border-radius: 22px; }
  #vue-bilan .be-card-head { gap: 10px; }
  #vue-bilan .be-card-head > div { flex-basis: 100%; }
  #vue-bilan .be-chart:not(.be-chart-hours) { min-width: 420px; }
  #vue-bilan .be-best-grid, #vue-bilan .bilan-profils { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #vue-bilan .bilan-profil { padding: 14px 10px 10px; }
  #vue-bilan .be-call-tools > :is(input, select) { flex-basis: 100%; max-width: none; }
  #vue-bilan :where(.be-table) :is(th, td) { padding: 12px 10px; }
  #vue-bilan .be-pager > span { order: -1; flex-basis: 100%; }
  #vue-bilan .be-pager > button { flex: 1 1 100px; }
}
@media (pointer: coarse), (max-width: 720px) {
  #vue-bilan :is(input, select) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  #vue-bilan *, #vue-bilan *::before, #vue-bilan *::after { animation: none; transition: none; scroll-behavior: auto; }
}
@media (forced-colors: active) {
  #vue-bilan :is(.be-kpi, .be-card, .be-card-wide, .be-profiles, .be-best, .bilan-profil, .be-result, .be-empty, .be-error, button, input, select) { border-color: CanvasText; }
  #vue-bilan .be-chart :is(.be-bar, .be-success, .be-warning, .be-muted), #vue-bilan .be-gauge { fill: CanvasText; }
  #vue-bilan .be-chart text, #vue-bilan .be-chart text.be-muted { fill: CanvasText; }
  #vue-bilan .be-gauge .be-muted { fill: Canvas; }
  #vue-bilan .be-gauge .be-success { fill: Highlight; }
}

/* Sept jours visibles ; le défilement reste local sur téléphone. */
#vue-bilan .be-weekdays { max-height: 270px; min-width: 490px; }
#vue-bilan .be-weekdays text { font-size: 14px; }
