/* Rapport AB-PHONE partagé : console exploitant et espace commerçant. */
.phone-report { display: grid; gap: 18px; }
.phone-report .phone-report-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0; }
.phone-report .phone-report-kpis article { padding: 16px; border: 1px solid var(--studio-line, #e4e7ec); border-radius: 14px; background: var(--studio-surface, #fff); }
.phone-report .phone-report-kpis strong { display: block; color: var(--studio-ink, #101828); font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.phone-report .phone-report-kpis span { color: var(--studio-muted, #667085); font-size: .78rem; }
.phone-report h3 { margin: 0 0 10px; font-size: .95rem; }
.phone-report-chart, .phone-report-breakdown, .phone-report-calls { padding: 16px; border: 1px solid var(--studio-line, #e4e7ec); border-radius: 14px; background: var(--studio-surface, #fff); }
.phone-report-bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-bottom: 20px; }
.phone-report-bar { position: relative; flex: 1 1 0; min-width: 4px; height: 100%; display: flex; align-items: flex-end; }
.phone-report-bar small { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); color: var(--studio-muted, #667085); font-size: .65rem; white-space: nowrap; }
.phone-report-bar-total { position: relative; width: 100%; min-height: 0; display: flex; align-items: flex-end; border-radius: 4px 4px 0 0; background: #147fd9; overflow: hidden; }
.phone-report-bar-after { width: 100%; background: #6549dd; }
.phone-report-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 12px 0 0; color: var(--studio-muted, #667085); font-size: .76rem; }
.phone-report-dot { width: 10px; height: 10px; border-radius: 3px; background: #147fd9; }
.phone-report-dot.after { background: #6549dd; }
.phone-report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.phone-report-breakdown ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.phone-report-breakdown li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) 2.5em; align-items: center; gap: 10px; font-size: .84rem; }
.phone-report-breakdown li strong { text-align: right; font-variant-numeric: tabular-nums; }
.phone-report-meter { height: 8px; border-radius: 999px; background: var(--studio-accent-pale, #eaf4fe); overflow: hidden; }
.phone-report-meter span { display: block; height: 100%; border-radius: 999px; background: #147fd9; }
.phone-report-calls-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.phone-report-calls-head h3 { margin: 0; }
.phone-report-calls table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.phone-report-calls th, .phone-report-calls td { padding: 9px 10px; border-bottom: 1px solid var(--studio-line, #e4e7ec); text-align: left; vertical-align: top; }
.phone-report-calls th { color: var(--studio-muted, #667085); font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.phone-report-calls .mail-table-wrap { overflow-x: auto; }
.phone-report-note { margin: 12px 0 0; color: var(--studio-muted, #667085); font-size: .76rem; }
.phone-report-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.phone-report-controls label { display: grid; gap: 4px; color: var(--studio-muted, #667085); font-size: .76rem; font-weight: 650; }
.phone-report-controls select { min-height: 40px; padding: 0 10px; border: 1px solid var(--studio-field-line, #d0d5dd); border-radius: 10px; background: var(--studio-surface, #fff); font: inherit; color: var(--studio-ink, #101828); }
.phone-emergency-banner { display: grid; gap: 4px; margin: 0 0 18px; padding: 16px 18px; border: 1px solid var(--studio-danger-line, #fecdd3); border-radius: 14px; color: var(--studio-danger-ink, #9f1239); background: var(--studio-danger-bg, #fff1f3); }
@media (max-width: 600px) {
  .phone-report-bars { gap: 1px; }
  .phone-report-breakdown li { grid-template-columns: minmax(0, 1fr) 2.5em; }
  .phone-report-meter { display: none; }
}

/* Appel reçu sur le numéro d'essai partagé. */
.phone-report .trial-chip { display: inline-flex; margin-left: 6px; padding: 2px 7px; border-radius: 999px; color: var(--studio-ok-ink, #087443); background: var(--studio-ok-bg, #effcf6); font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; vertical-align: middle; }

/* Fiches d'appel : même tableau dans la console et dans l'espace commerçant. */
.phone-report-calls { padding: 0; overflow: hidden; }
.phone-report-calls > .phone-report-calls-head { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--studio-line, #e4e7ec); }
.phone-report-calls > .phone-report-note { margin: 0; padding: 12px 16px; }
.phone-report-calls .mail-table-wrap { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.phone-report-calls table { min-width: 720px; }
.phone-report-calls th { padding: 10px 14px; background: var(--studio-sunken, #f9fafb); }
.phone-report-calls td { padding: 12px 14px; border-bottom: 1px solid var(--studio-line, #eef0f3); vertical-align: middle; }
.phone-report-calls tbody tr:last-child td { border-bottom: 0; }
.phone-report-calls tbody tr:hover td { background: var(--studio-sunken, #fafbfc); }
.phone-report-calls td:first-child { font-weight: 650; white-space: nowrap; }
.phone-report-calls td.phone-message-copy { min-width: 240px; color: var(--studio-ink-soft, #475467); line-height: 1.45; }
.phone-report-count { color: var(--studio-muted, #667085); font-size: .8rem; font-weight: 500; }
.phone-report-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.phone-report-filters { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--studio-chip, #f2f4f7); }
.phone-report-filters button { min-height: 30px; padding: 4px 11px; border: 0; border-radius: 8px; color: var(--studio-muted, #475467); background: transparent; box-shadow: none; font-size: .74rem; font-weight: 650; }
.phone-report-filters button:hover:not(:disabled) { color: var(--studio-ink, #101828); background: transparent; box-shadow: none; transform: none; }
.phone-report-filters button[aria-pressed="true"] { color: var(--studio-ink, #101828); background: var(--studio-surface, #fff); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.phone-report-search { width: 210px; min-height: 34px; padding: 0 10px; border: 1px solid var(--studio-field-line, #d0d5dd); border-radius: 9px; color: var(--studio-ink, #101828); background: var(--studio-surface, #fff); font: inherit; font-size: .8rem; }
.status-badge.phone-category, .phone-outcome {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: .68rem; font-weight: 750; letter-spacing: .02em; text-transform: none; white-space: nowrap;
  color: #3538cd; background: #eef4ff;
}
.status-badge.phone-category[data-category="reservation"] { color: #a13c50; background: #fff1f3; }
.status-badge.phone-category[data-category="commercial"] { color: #8a4b16; background: #fff5e8; }
.status-badge.phone-category[data-category="urgent"] { color: #b42318; background: #fef3f2; }
.status-badge.phone-category:is([data-category="spam"], [data-category="other"], [data-category="none"]) { color: #475467; background: #f2f4f7; }
.phone-outcome { color: #475467; background: #f2f4f7; }
.phone-outcome:is([data-outcome="booked"], [data-outcome="booking_requested"]) { color: #067647; background: #ecfdf3; }
.phone-outcome[data-outcome="message"] { color: #9a4d00; background: #fff4e5; }
.phone-outcome[data-outcome="transferred"] { color: #0b4f8a; background: #eaf4fe; }
:root[data-theme="dark"] .status-badge.phone-category, :root[data-theme="dark"] .phone-outcome { color: #c4c9ff; background: #232a5c; }
:root[data-theme="dark"] .status-badge.phone-category[data-category="reservation"] { color: #ffb4c2; background: #3b1d27; }
:root[data-theme="dark"] .status-badge.phone-category[data-category="commercial"] { color: #ffc98a; background: #3a2608; }
:root[data-theme="dark"] .status-badge.phone-category[data-category="urgent"] { color: #ffb4ab; background: #3d1714; }
:root[data-theme="dark"] .status-badge.phone-category:is([data-category="spam"], [data-category="other"], [data-category="none"]),
:root[data-theme="dark"] .phone-outcome { color: #c3cbdb; background: #1c263b; }
:root[data-theme="dark"] .phone-outcome:is([data-outcome="booked"], [data-outcome="booking_requested"]) { color: #7ee2a8; background: #0f2e20; }
:root[data-theme="dark"] .phone-outcome[data-outcome="message"] { color: #ffc574; background: #3a2608; }
:root[data-theme="dark"] .phone-outcome[data-outcome="transferred"] { color: #9fcbff; background: #1a2c4d; }
@media (max-width: 600px) { .phone-report-search { width: 100%; } }
.phone-booking-link { display: block; margin-top: 4px; color: var(--studio-ok-ink, #067647); font-size: .74rem; font-weight: 650; white-space: nowrap; }

/* Filtres : sur une ligne, défilables sur petit écran. */
.phone-report-filters { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.phone-report-filters button { white-space: nowrap; flex: none; }

/* Sur téléphone, chaque fiche devient une carte : l'heure et la durée, le
   motif et l'issue, puis le résumé. Plus de tableau à faire défiler. */
/* Fiches en cartes dès que le tableau manque de place (mobile, colonne étroite). */
.phone-report-calls { container-type: inline-size; }
@container (max-width: 820px) {
  .phone-report-calls .mail-table-wrap { overflow: visible; }
  .phone-report-calls table, .phone-report-calls tbody { display: block; min-width: 0 !important; width: 100%; }
  .phone-report-calls thead { display: none; }
  .phone-report-calls tbody tr:not([hidden]) { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; padding: 12px 14px; border-bottom: 1px solid var(--studio-line, #eef0f3); }
  .phone-report-calls tbody tr:last-child { border-bottom: 0; }
  .phone-report-calls tbody td { display: block; padding: 0 !important; border: 0 !important; background: none !important; min-width: 0 !important; }
  .phone-report-calls td.col-business { grid-column: 1 / -1; font-weight: 700; }
  .phone-report-calls td.col-when { grid-column: 1; }
  .phone-report-calls td.col-duration { grid-column: 2; color: var(--studio-muted, #667085); font-size: .8rem; text-align: right; }
  .phone-report-calls td.col-category { grid-column: 1; }
  .phone-report-calls td.col-outcome { grid-column: 2; min-width: 0; display: flex !important; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 6px; text-align: right; }
  .phone-report-calls td.col-outcome .phone-question-badge { margin: 0; flex-basis: 100%; }
  .phone-report-calls td.col-moment { display: none !important; }
  .phone-report-calls td.col-summary { grid-column: 1 / -1; font-size: .84rem; }
  .phone-report-calls td.mail-empty { grid-column: 1 / -1; }
  .phone-report-calls .phone-booking-link { text-align: right; }
}
@media (max-width: 640px) {
  .phone-report-tools { width: 100%; }
  .phone-report-tools > button { width: auto; }
}

.phone-report-legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.phone-report-breakdown, .phone-report-breakdown ul { align-content: start; }

/* Statut d'un appel : ce que le commerçant doit en faire. Vert, rien à faire
   (rendez-vous pris) ; ambre, à faire ; gris, rien à faire ; pâle, le bruit. */
.phone-action { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; color: #475467; background: #f2f4f7; font-size: .72rem; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.phone-action::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; opacity: .85; }
.phone-action[data-action="booked"] { color: #067647; background: #ecfdf3; }
.phone-action:is([data-action="callback"], [data-action="opportunity"], [data-action="missed"]) { color: #9a4d00; background: #fff4e5; }
.phone-action[data-action="confirm"] { color: #7a2e0e; background: #fef0c7; }
.phone-action[data-action="question"] { color: #3538cd; background: #eef4ff; }
.phone-action[data-action="handled"] { color: #067647; background: transparent; box-shadow: inset 0 0 0 1px #abefc6; }
.phone-action[data-action="transferred"] { color: #0b4f8a; background: #eaf4fe; }
.phone-action:is([data-action="short"], [data-action="spam"]) { color: #98a2b3; background: #f9fafb; }
:root[data-theme="dark"] .phone-action { color: #c3cbdb; background: #1c263b; }
:root[data-theme="dark"] .phone-action[data-action="booked"] { color: #7ee2a8; background: #0f2e20; }
:root[data-theme="dark"] .phone-action:is([data-action="callback"], [data-action="opportunity"], [data-action="missed"]) { color: #ffc574; background: #3a2608; }
:root[data-theme="dark"] .phone-action[data-action="confirm"] { color: #fec84b; background: #3d2a05; }
:root[data-theme="dark"] .phone-action[data-action="question"] { color: #c4c9ff; background: #232a5c; }
:root[data-theme="dark"] .phone-action[data-action="handled"] { color: #7ee2a8; background: transparent; box-shadow: inset 0 0 0 1px #1f5c3d; }
:root[data-theme="dark"] .phone-action[data-action="transferred"] { color: #9fcbff; background: #1a2c4d; }
:root[data-theme="dark"] .phone-action:is([data-action="short"], [data-action="spam"]) { color: #7d8aa3; background: #161f33; }
}
.phone-question-badge { display: block; margin-top: 4px; color: var(--studio-phone-ink, #3538cd); font-size: .72rem; font-weight: 650; }
.phone-report-calls tr.is-clickable { cursor: pointer; }
.phone-report-calls tr.is-clickable:hover td { background: var(--studio-sunken, #fafbfc); }
.phone-report-calls tr.is-clickable:focus-visible { outline: 2px solid var(--studio-accent, #147fd9); outline-offset: -2px; }
.phone-noise-toggle { margin: 10px 16px 0; color: var(--studio-muted, #667085) !important; font-weight: 600; }
.phone-report-calls > * { min-width: 0; }
/* Qui a appelé (espace commerçant) : nom laissé et numéro relu chez Twilio. */
.phone-report .phone-caller-line { display: block; margin-top: 4px; color: var(--muted, #667085); font-size: .84rem; font-weight: 500; }
.phone-report .phone-caller-line[hidden] { display: none; }
.phone-report .phone-caller-line b { color: var(--ink, #101828); font-weight: 650; }
