/* Page Appels restructurée (22/11) : chiffres façon Rapport, filtres + recherche sur une ligne */
.ap-chiffres {
  --rp-bleu: #3B82F6; --rp-violet: #8B5CF6; --rp-orange: #F59E0B; --rp-vert: #10B981; --rp-rose: #EC4899;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  margin-bottom: 20px;
  background: var(--ds-surface, #fff);
}
html:root .ap-chiffres .rp-chiffre { border-bottom: 0 !important; border-right: 1px solid var(--ds-border, #ebebed) !important; }
html:root .ap-chiffres .rp-chiffre:last-child { border-right: 0 !important; }
.ap-taux { font-weight: 600; }
.ap-taux.ap-bas { color: #EF4444; }
.ap-taux.ap-moyen { color: #F59E0B; }
.ap-taux.ap-bon { color: #10B981; }

.ap-barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ap-filtres { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
html:root #page-root .ap-filtre {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  font: inherit; font-size: 13px; color: var(--ds-text-2, #52525b);
  background: transparent; border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
html:root #page-root .ap-filtre:hover { background: var(--ds-hover, #f4f4f5); }
html:root #page-root .ap-filtre.on { color: var(--ds-text, #18181b); background: var(--ds-surface, #fff); border-color: var(--ds-border, #e4e4e7); font-weight: 500; }
.ap-nb { font-size: 11.5px; color: var(--ds-text-3, #a1a1aa); font-variant-numeric: tabular-nums; }
.ap-filtre.on .ap-nb { color: var(--ds-text-2, #52525b); }
html:root #page-root .ap-filtre.appels-jour[hidden] { display: none; }
.ap-cherche { width: 280px; max-width: 100%; }
.ap-cherche input { border: none; background: transparent; outline: none; font: inherit; color: inherit; flex: 1; min-width: 0; }
html:root #page-root .ap-tableau { padding: 6px !important; }

@media (max-width: 767px) {
  .ap-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html:root .ap-chiffres .rp-chiffre:nth-child(2n) { border-right: 0 !important; }
  html:root .ap-chiffres .rp-chiffre:nth-child(-n + 2) { border-bottom: 1px solid var(--ds-border, #ebebed) !important; }
  .ap-chiffres .rp-chiffre { padding: 14px; }
  .ap-chiffres .rp-chiffre > b { font-size: 24px; }
  .ap-barre { flex-direction: column; align-items: stretch; }
  .ap-filtres { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  html:root #page-root .ap-filtre { flex: none; padding: 0 10px; }
  .ap-cherche { width: 100%; }
}

/* Jours bien séparés + vrais boutons (22/11, 2e passe) */
html:root #page-root .tbl:has(#appelsCorps) tr.ap-jour td {
  padding: 10px 14px !important; height: auto; border: 0 !important;
  background: var(--ds-hover, #f4f4f5) !important; border-radius: 10px !important;
}
html:root #page-root .tbl:has(#appelsCorps) tr.ap-jour:not(:first-child) td { box-shadow: 0 0 0 0 transparent, inset 0 0 0 0 transparent; }
@media (min-width: 768px) { html:root #page-root .tbl:has(#appelsCorps) tr.ap-jour + tr td { padding-top: 10px !important; } }
html:root #page-root .tbl:has(#appelsCorps) tr.ap-repli td { height: auto; padding: 8px 14px !important; background: transparent !important; }
html:root #page-root .ap-bouton {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--ds-text, #18181b);
  background: var(--ds-surface, #fff); border: 1px solid var(--ds-border, #e4e4e7); border-radius: 10px; cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .15s;
}
html:root #page-root .ap-bouton:hover { background: var(--ds-hover, #f4f4f5); border-color: var(--ds-border-strong, #d4d4d8); }
html:root #page-root .ap-bouton:active { transform: scale(.97); }
html:root #page-root .ap-bouton svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html:root #page-root .ap-bouton span { font-weight: 400; color: var(--ds-text-3, #a1a1aa); font-variant-numeric: tabular-nums; }
html:root #page-root .ap-bouton-plus { width: 100%; justify-content: center; }
@media (max-width: 767px) {
  html:root #page-root .tbl:has(#appelsCorps) tbody tr.ap-jour { padding: 10px 14px; margin: 12px 0 4px; border-radius: 10px; background: var(--ds-hover, #f4f4f5) !important; border: 0; }
  html:root #page-root .tbl:has(#appelsCorps) tbody tr.ap-jour:first-child { margin-top: 0; }
  html:root #page-root .tbl:has(#appelsCorps) tbody tr.ap-jour td { background: transparent !important; padding: 0 !important; border-radius: 0 !important; }
  html:root #page-root .tbl:has(#appelsCorps) tbody tr.ap-repli { padding: 8px 0; border-bottom: 0; }
  html:root #page-root .tbl:has(#appelsCorps) tbody tr.ap-repli td { padding: 0 !important; overflow: visible; }
  html:root #page-root .ap-bouton { width: 100%; justify-content: center; }
}

/* 23/11 : file d'attente en direct (texte + point, sans fond) */
.file-direct { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--text-2, #52525B); }
.file-direct b { color: var(--text, #18181B); font-weight: 600; font-variant-numeric: tabular-nums; }
.file-direct .point { width: 7px; height: 7px; border-radius: 50%; background: var(--muted, #A1A1AA); }
.file-direct[data-etat="en-ligne"] .point { background: #3F7A59; }
.file-direct[data-etat="attente"] .point { background: #946C2C; }
.file-direct .sep { width: 1px; height: 12px; background: var(--border, #E4E4E7); }
