/* =============================================================================
   Nosho — tableau de bord de l'agent vocal
   =============================================================================

   Organisation du fichier, dans l'ordre de la cascade :

     1. Jetons          couleurs, rayons, espacements — la seule source
     2. Base            reset minimal et typographie
     3. Mise en page    barre latérale + zone principale
     4. Navigation      onglets de la barre latérale
     5. Composants      boutons, formulaires, tableaux, cartes, badges
     6. Vues            appels, patients, créneaux, praticiens, configuration
     7. Connexion       page de login, isolée du reste
     8. Adaptatif       points de rupture, regroupés en fin de fichier

   Deux règles de tenue, apprises de la version précédente :

   - UN SEUL bloc par sélecteur. La feuille avait grossi par couches — huit
     redéfinitions de `.slot-tile`, trois de `.slot-calendar` — au point qu'on
     ne pouvait plus prévoir ce qui l'emportait sans dérouler tout le fichier.
   - Rien qui ne serve. Le style de trois vues supprimées (test live,
     benchmark, corrections) traînait encore ici : retiré.
   ========================================================================== */

/* -----------------------------------------------------------------------------
   1. Jetons
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Fond ivoire et accent orange : identité Nosho, reprise de
     `nosho-receptionist` — voir le README, section UI/UX. */
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-2: #efede8;
  --border: rgba(20, 20, 20, 0.09);
  --border-strong: rgba(20, 20, 20, 0.18);

  --text: #1a1a1a;
  --text-muted: #6f6f6f;
  --accent: #ff6b1a;
  --accent-hover: #e95d11;
  --accent-soft: rgba(255, 107, 26, 0.1);

  /* Couleurs de sens, distinctes de l'accent : elles disent un état, jamais
     une préférence esthétique. */
  --success: #16a34a;
  --success-soft: #ecfdf3;
  --success-text: #116232;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-text: #a91d1d;
  --warning-soft: #fff8df;
  --warning-text: #8a650b;
  --info-soft: #eef6ff;
  --info-text: #235f9c;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --sidebar-width: 232px;
}

/* -----------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h2,
h3,
h4 {
  margin: 0;
  font-family: "Avenir Next", Inter, "Segoe UI", ui-sans-serif, sans-serif;
}

/* -----------------------------------------------------------------------------
   3. Mise en page
   -------------------------------------------------------------------------- */

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 14px 16px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.app-main {
  width: auto;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 18px 24px 32px;
}

.view {
  display: none;
  width: 100%;
  max-width: none;
}

.view.active {
  display: block;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 18px;
}

.brand-lockup img {
  display: block;
  width: 104px;
  height: auto;
}

.environment {
  padding: 3px 7px;
  border: 1px solid rgba(255, 107, 26, 0.24);
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.sidebar-footer {
  display: grid;
  gap: 12px;
}

.live {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 12px;
}

.live > span {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}

.live strong,
.live small {
  display: block;
}

.live small {
  color: var(--text-muted);
  font-size: 10px;
}

.logout {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-muted);
  background: var(--surface);
  font-size: 12px;
}

.logout:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* -----------------------------------------------------------------------------
   4. Navigation
   -------------------------------------------------------------------------- */

.sidebar-nav {
  display: grid;
  gap: 2px;
}

.tab {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  color: var(--text-muted);
  background: transparent;
  text-align: left;
}

.tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.tab.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 650;
  box-shadow: inset 2px 0 0 var(--accent);
}

/* Une icône dessinée plutôt qu'une lettre : « A », « R », « C » ne voulaient
   rien dire pour quelqu'un qui découvre l'outil. */
.nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  color: currentColor;
}

.nav-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* -----------------------------------------------------------------------------
   5. Composants
   -------------------------------------------------------------------------- */

/* En-tête de vue ---------------------------------------------------------- */

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 6px;
}

.section-heading h2 {
  font-size: 25px;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* La phrase qui explique à quoi sert l'écran. Elle n'est pas décorative :
   c'est elle qui rend l'outil lisible sans formation préalable. */
.view-intro {
  max-width: 78ch;
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Boutons ----------------------------------------------------------------- */

.primary,
.secondary,
.danger-button {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 700;
  transition: 0.15s ease;
  white-space: nowrap;
}

.primary {
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: var(--shadow);
}

.primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
}

.secondary:hover {
  background: var(--surface-2);
}

.danger-button {
  border: 1px solid rgba(220, 38, 38, 0.18);
  color: var(--danger);
  background: rgba(220, 38, 38, 0.07);
}

.compact {
  padding: 6px 10px;
  font-size: 12px;
}

.primary:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.icon-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #575757;
  background: var(--surface);
  font-size: 15px;
  font-weight: 800;
}

.icon-button:hover {
  border-color: rgba(255, 107, 26, 0.35);
  color: var(--accent);
  background: var(--accent-soft);
}

.danger-icon:hover {
  border-color: rgba(220, 38, 38, 0.25);
  color: var(--danger);
  background: rgba(220, 38, 38, 0.07);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

/* Formulaires ------------------------------------------------------------- */

.hidden {
  display: none;
}

.panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: 1fr 1fr;
}

.form-grid label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.form-grid input,
.form-grid select {
  width: 100%;
  margin-top: 5px;
  padding: 10px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
}

.form-grid input:focus,
.form-grid select:focus {
  border-color: var(--accent);
  outline: 3px solid var(--accent-soft);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

/* Tableaux ---------------------------------------------------------------- */

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text-muted);
  background: rgba(241, 239, 234, 0.45);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td small {
  display: block;
  color: var(--text-muted);
}

/* Cartes et badges -------------------------------------------------------- */

.cards {
  display: grid;
  gap: 8px;
}

.card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}

.card:hover {
  border-color: rgba(255, 107, 26, 0.28);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.meta {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 800;
}

.badge.ai,
.badge.active {
  color: #9b430e;
  background: var(--accent-soft);
}

.badge.manual {
  background: var(--info-soft);
  color: var(--info-text);
}

.badge.emergency {
  color: #a11a1a;
  background: #fdeaea;
}

.badge.children {
  color: var(--success-text);
  background: var(--success-soft);
}

.badge.adults {
  color: #655c52;
  background: var(--surface-2);
}

.new-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #a94a10;
  background: #fff0e5;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Issue d'un appel : une seule échelle de couleur, réutilisée partout. */
.outcome-booked,
.outcome-success {
  color: var(--success-text);
  background: var(--success-soft);
}

.outcome-cancelled,
.outcome-failed {
  color: var(--danger-text);
  background: var(--danger-soft);
}

.outcome-active {
  color: var(--info-text);
  background: var(--info-soft);
}

.outcome-none {
  color: var(--text-muted);
  background: var(--surface-2);
}

.empty {
  padding: 28px;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* -----------------------------------------------------------------------------
   6. Vues
   -------------------------------------------------------------------------- */

/* 6.1 Appels -------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.calls-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.calls-topbar h2 {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.calls-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-search {
  display: grid;
  width: min(28vw, 360px);
  min-height: 36px;
  align-items: center;
  grid-template-columns: 32px 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.message-search:focus-within {
  border-color: rgba(255, 107, 26, 0.5);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.message-search > span {
  justify-self: center;
  color: var(--text-muted);
  font-size: 16px;
}

.message-search input {
  width: 100%;
  min-height: 34px;
  padding-right: 10px;
  border: 0;
  outline: 0;
  background: transparent;
}

.message-filter-label {
  display: block;
}

.message-filter-label select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  font: 600 12px/1 Inter, ui-sans-serif, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

.call-workspace {
  display: grid;
  min-height: 620px;
  height: calc(100vh - 84px);
  max-height: 960px;
  grid-template-columns: minmax(290px, 0.78fr) minmax(430px, 1.25fr) minmax(340px, 0.97fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.call-list-pane,
.call-analysis-pane,
.call-transcript-pane {
  min-width: 0;
  overflow: hidden;
}

.call-list-pane,
.call-analysis-pane {
  border-right: 1px solid var(--border);
}

.call-list-pane,
.call-transcript-pane {
  display: flex;
  flex-direction: column;
}

.call-pane-heading {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: #fcfbf9;
  font-size: 12px;
}

.call-list {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.call-list-empty {
  padding: 32px 18px;
  color: var(--text-muted);
  text-align: center;
}

.call-list-item {
  display: grid;
  width: 100%;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.call-list-item:hover {
  background: #fcfaf7;
}

.call-list-item.selected {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.call-kind-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  font-size: 14px;
}

.call-list-copy {
  min-width: 0;
}

.call-list-primary,
.call-list-secondary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.call-list-primary strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-list-time,
.call-list-secondary {
  color: var(--text-muted);
  font-size: 10px;
}

.call-list-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 0;
  color: #474747;
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.message-kind-pill {
  display: inline-flex;
  max-width: 150px;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.kind-booked {
  color: var(--success-text);
  background: #dff3e6;
}

.kind-cancelled {
  color: var(--danger-text);
  background: #f9dede;
}

.kind-rescheduled {
  color: #7a5b00;
  background: #f8ebbd;
}

.kind-urgent {
  color: #5c35a7;
  background: #e6dcfa;
}

.kind-callback {
  color: #17685d;
  background: #d8efeb;
}

.kind-information {
  color: #285f86;
  background: #dcebf6;
}

.kind-active {
  color: var(--info-text);
  background: #d8eef6;
}

.kind-other {
  color: var(--text-muted);
  background: var(--surface-2);
}

.call-analysis-pane {
  overflow-y: auto;
  padding: 16px;
  background: #f8f7f4;
  overscroll-behavior: contain;
}

.call-metadata {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.call-metadata > div {
  min-width: 0;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.call-metadata dt {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.call-metadata dd {
  overflow-wrap: anywhere;
  margin: 3px 0 0;
  font-size: 11px;
  font-weight: 650;
}

.call-outcome {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.call-actions {
  display: grid;
  gap: 6px;
}

.call-actions h4 {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.call-action {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 650;
}

.call-action.success {
  color: #166534;
  background: var(--success-soft);
}

.call-action.cancelled {
  color: #991b1b;
  background: var(--danger-soft);
}

.call-transcript-scroll {
  display: grid;
  align-content: start;
  flex: 1;
  gap: 6px;
  overflow-y: auto;
  padding: 12px;
  overscroll-behavior: contain;
}

.message-turn {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
}

.message-turn.agent {
  justify-self: end;
  background: var(--accent-soft);
}

.message-turn.caller {
  border: 1px solid var(--border);
}

.message-turn small {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
}

.message-turn p {
  margin: 3px 0 0;
  white-space: pre-wrap;
}

.call-analysis-section,
.call-feedback-form,
.linear-draft-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.call-analysis-section h3,
.call-feedback-form h3,
.linear-draft-form h3 {
  font-size: 13px;
}

.call-analysis-section h4 {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.analysis-status {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 750;
}

.analysis-status.ready {
  color: var(--success-text);
  background: var(--success-soft);
}

.analysis-status.error {
  color: var(--danger-text);
  background: var(--danger-soft);
}

.analysis-points {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analysis-points li {
  padding-left: 13px;
  color: #454545;
  font-size: 11px;
}

.analysis-points li::before {
  margin-left: -13px;
  margin-right: 6px;
  color: var(--accent);
  content: "•";
}

.call-feedback-form label,
.linear-draft-form label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.call-feedback-form textarea,
.linear-draft-form textarea,
.linear-draft-form input {
  width: 100%;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.feedback-rating {
  display: flex;
  gap: 7px;
}

.feedback-rating button {
  min-width: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  background: var(--surface);
}

.feedback-rating button.selected {
  border-color: rgba(255, 107, 26, 0.35);
  background: var(--accent-soft);
}

.linear-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.call-empty-state {
  display: grid;
  min-height: 100%;
  place-content: center;
  justify-items: center;
  padding: 28px;
  color: var(--text-muted);
  text-align: center;
}

.call-empty-state > span {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
}

.call-empty-state h3 {
  color: var(--text);
  font-size: 14px;
}

.call-empty-state p {
  max-width: 34ch;
  margin: 6px 0 0;
  font-size: 11px;
}

.call-empty-state.compact {
  min-height: 180px;
}

.tester-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid rgba(255, 107, 26, 0.18);
  border-radius: 999px;
  padding: 2px 6px;
  color: #a94a10;
  background: #fff6ef;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.tester-card {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr auto;
  gap: 1px 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  text-align: left;
}

.tester-card > span {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tester-card strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
}

.tester-card small {
  align-self: center;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
}

.tester-card:hover {
  border-color: rgba(255, 107, 26, 0.28);
  background: var(--accent-soft);
}

.tester-dialog {
  width: min(92vw, 430px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 26px 70px rgba(20, 20, 20, 0.2);
}

.tester-dialog::backdrop {
  background: rgba(26, 26, 26, 0.38);
  backdrop-filter: blur(3px);
}

.tester-dialog form {
  display: grid;
  gap: 14px;
  padding: 26px;
}

.tester-dialog h2 {
  font-size: 23px;
  letter-spacing: -0.025em;
}

.tester-dialog p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.tester-dialog label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.tester-dialog input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  color: var(--text);
  background: var(--surface);
}

/* 6.2 Créneaux ------------------------------------------------------------ */

.slot-section-heading {
  align-items: center;
}

.slot-navigation {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.slot-navigation > span {
  min-width: 150px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.slot-nav-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  font-size: 17px;
}

.slot-nav-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.slot-global-feedback {
  min-height: 20px;
  margin: 0 0 8px;
  color: #9b430e;
  font-size: 12px;
  font-weight: 650;
}

.slot-practitioner-filter {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.slot-practitioner-filter > span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.slot-practitioner-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slot-practitioner-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
}

.slot-practitioner-option:has(input:checked) {
  border-color: rgba(255, 107, 26, 0.35);
  background: var(--accent-soft);
}

.slot-practitioner-option input {
  accent-color: var(--accent);
}

.slot-practitioner-option strong,
.slot-practitioner-option small {
  display: block;
}

.slot-practitioner-option strong {
  font-size: 11px;
}

.slot-practitioner-option small {
  color: var(--text-muted);
  font-size: 9px;
}

.slot-practitioner-empty {
  color: var(--text-muted);
  font-size: 11px;
}

.slot-calendar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.slot-day {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.slot-day-header {
  min-height: 76px;
  padding: 15px 15px 12px;
  border-bottom: 1px solid var(--border);
  background: #fbfaf8;
  text-align: center;
}

.slot-day-header h3 {
  margin-top: 4px;
  font-size: 17px;
  text-transform: capitalize;
}

.slot-day-index {
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slot-practitioner-headings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: #f3f1ed;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.slot-practitioner-headings span {
  padding: 9px 5px;
}

.slot-practitioner-headings span + span {
  border-left: 1px solid var(--border);
}

.slot-period {
  padding: 12px 8px 14px;
}

.slot-period + .slot-period {
  border-top: 2px solid rgba(20, 20, 20, 0.11);
}

.slot-period h4 {
  margin-bottom: 9px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-align: center;
  text-transform: uppercase;
}

.slot-period-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slot-practitioner-column {
  display: grid;
  gap: 7px;
  padding: 0 4px;
}

.slot-practitioner-column + .slot-practitioner-column {
  border-left: 1px solid var(--border);
}

.slot-period-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 7px 6px 2px;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

.slot-period-toggle:hover {
  color: var(--accent);
}

/* Une tuile par créneau. Quatre états, quatre couleurs de sens — libre à
   ouvrir, ouvert, réservé, bloqué le temps d'un appel. */
.slot-tile {
  position: relative;
  display: grid;
  min-height: 72px;
  align-content: start;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfaf8;
  transition: 0.15s ease;
}

.slot-tile strong {
  font-size: 13px;
  letter-spacing: -0.02em;
}

.slot-tile.available {
  border: 1px dashed var(--border-strong);
  background: #efeeeb;
  cursor: pointer;
}

.slot-tile.available:hover,
.slot-tile.available:focus {
  border-color: var(--accent);
  outline: 0;
  background: #fff5ee;
  transform: translateY(-1px);
}

.slot-tile.saved {
  border-color: rgba(22, 163, 74, 0.22);
  background: #f0faf3;
  cursor: pointer;
}

.slot-tile.booked {
  border-color: rgba(59, 130, 246, 0.25);
  background: var(--info-soft);
}

.slot-tile.held {
  border-color: rgba(217, 158, 24, 0.3);
  background: var(--warning-soft);
}

.slot-tile-status {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
}

.slot-tile-status.urgent {
  color: #a54211;
}

.slot-tile-status.booked {
  color: var(--info-text);
}

.slot-tile-status.held {
  color: var(--warning-text);
}

.slot-tile-action {
  align-self: end;
  margin-top: 2px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.slot-tile-reasons {
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.25;
}

.slot-tile.saved .slot-tile-reasons {
  padding-right: 30px;
}

.slot-tile-actions {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 3px;
}

.slot-tile-actions .icon-button {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 12px;
}

.quick-slot-popover {
  position: fixed;
  z-index: 100;
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(20, 20, 20, 0.12);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 55px rgba(20, 20, 20, 0.2);
}

.quick-slot-popover::before {
  position: absolute;
  top: -6px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border-top: 1px solid rgba(20, 20, 20, 0.12);
  border-left: 1px solid rgba(20, 20, 20, 0.12);
  background: var(--surface);
  content: "";
}

.quick-slot-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.quick-slot-heading strong,
.quick-slot-heading small {
  display: block;
}

.quick-slot-heading small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.quick-slot-close {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 18px;
}

.quick-slot-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 9px;
  background: #f5f3ef;
  font-size: 12px;
  font-weight: 700;
}

.quick-slot-toggle input,
.quick-slot-reasons input {
  accent-color: var(--accent);
}

.quick-slot-reasons {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.quick-slot-reasons legend {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quick-slot-reasons label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.quick-slot-feedback {
  min-height: 16px;
  color: var(--danger);
  font-size: 11px;
}

.quick-slot-submit {
  width: 100%;
  padding: 9px 12px;
}

/* 6.3 Praticiens ---------------------------------------------------------- */

.practitioner-list {
  display: grid;
  gap: 9px;
}

.practitioner-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: 0.15s ease;
}

.practitioner-card:hover,
.practitioner-card:focus,
.practitioner-card.expanded {
  border-color: rgba(255, 107, 26, 0.3);
  outline: 0;
}

.practitioner-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.practitioner-card-heading strong,
.practitioner-card-heading small {
  display: block;
}

.practitioner-card-heading strong {
  font-size: 16px;
}

.practitioner-card-heading small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.practitioner-expand-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
}

.practitioner-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.practitioner-details {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.practitioner-details h4 {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.practitioner-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.reason-chip {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  color: #87400f;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
}

.practitioner-context {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.practitioner-rule-fieldset {
  margin-top: 16px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.practitioner-rule-fieldset legend {
  padding: 0 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.practitioner-rule-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.practitioner-rule-options.radio {
  grid-template-columns: repeat(2, minmax(0, 190px));
}

.practitioner-rule-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: #f5f3ef;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.practitioner-rule-options input {
  accent-color: var(--accent);
}

/* 6.4 Configuration ------------------------------------------------------- */

/* Écran de lecture : il montre ce que l'agent utilise RÉELLEMENT pendant un
   appel. Sa valeur tient à ce qu'il ne se contente pas d'afficher un
   formulaire — il affiche la version publiée, celle que chaque rapport de
   session enregistre. */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.config-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.config-card h3 {
  font-size: 15px;
}

.config-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.config-value {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.config-quote {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  font-size: 13px;
}

.config-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.config-list li {
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 650;
}

.config-locked {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 12px;
}

.config-locked li::before {
  margin-right: 7px;
  color: var(--success);
  content: "✓";
  font-weight: 800;
}

/* -----------------------------------------------------------------------------
   7. Connexion
   -------------------------------------------------------------------------- */

.login-body {
  background: #fff;
}

.login-page {
  display: grid;
  width: 100%;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 0.78fr) minmax(500px, 1.22fr);
}

.login-story {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 4vw, 62px);
  color: #fafafa;
  background: radial-gradient(circle at 12% 0, rgba(252, 141, 66, 0.1), transparent 260px),
    linear-gradient(135deg, #1d1d1b 0%, #2a2a28 100%);
}

.login-story::before,
.login-story::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  content: "";
}

.login-story::before {
  right: -30%;
  bottom: -20%;
  width: 70vw;
  height: 70vw;
}

.login-story::after {
  right: -7%;
  bottom: 3%;
  width: 35vw;
  height: 35vw;
}

.login-brand,
.login-story-copy,
.login-story-footer {
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand img {
  width: 146px;
  height: auto;
}

.login-brand span {
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #fc8d42;
  font-size: 12px;
  font-weight: 700;
}

.login-story-copy {
  max-width: 510px;
}

.login-eyebrow {
  margin: 0 0 12px;
  color: #a3a3a3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-story-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.login-story-copy > p:last-child {
  max-width: 470px;
  margin: 24px 0 0;
  color: #a3a3a3;
  font-size: 15px;
}

.login-story-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #a3a3a3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-story-footer span {
  color: #5cae92;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 48px 32px;
  background: #fafafa;
}

.login-form-wrap {
  width: min(100%, 420px);
}

.login-form-wrap h2 {
  margin: 24px 0 0;
  font-size: clamp(26px, 2.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-form-wrap form {
  display: grid;
  gap: 7px;
}

.login-form-wrap label,
.label-row span {
  color: #525252;
  font-size: 12px;
  font-weight: 600;
}

.demo-login-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #f5c9a6;
  border-radius: 999px;
  color: #9a4a12;
  background: #fff0e5;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.demo-login-pill > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d0691f;
  box-shadow: 0 0 0 4px #f5c9a6;
}

.login-intro {
  margin: 12px 0 24px;
  color: #525252;
  font-size: 13px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.label-row span {
  color: var(--text-muted);
  font-weight: 500;
}

.input-wrap {
  display: grid;
  min-height: 44px;
  align-items: center;
  grid-template-columns: 40px 1fr;
  border: 1px solid var(--text-muted);
  border-radius: 10px;
  background: #fff;
}

.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tester-login-field {
  margin-bottom: 10px;
  border-color: rgba(255, 107, 26, 0.48);
  background: #fff8f3;
}

.tester-login-field > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 10px;
  font-weight: 850;
}

.input-wrap > span {
  justify-self: center;
  color: var(--text-muted);
  font-size: 13px;
}

.input-wrap input {
  width: 100%;
  height: 42px;
  padding-right: 12px;
  border: 0;
  outline: 0;
  background: transparent;
}

.login-submit {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  color: #1d1d1b;
  background: #fc8d42;
  font-weight: 700;
}

.login-submit:hover {
  background: #f07620;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.login-disclaimer {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.login-error {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #f2c4bb;
  border-radius: var(--radius-sm);
  color: #a63122;
  background: #fdece9;
  font-size: 12px;
}

/* -----------------------------------------------------------------------------
   8. Adaptatif
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media (max-width: 1100px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .slot-calendar {
    grid-template-columns: repeat(4, minmax(225px, 1fr));
    overflow-x: auto;
  }

  .call-workspace {
    height: auto;
    max-height: none;
    grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr);
  }

  .call-transcript-pane {
    min-height: 520px;
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 800px) {
  .login-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-story {
    min-height: 320px;
  }

  .login-story-copy {
    margin: 64px 0;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand-lockup {
    padding: 0 4px 14px;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .tab {
    width: auto;
    flex: 0 0 auto;
  }

  .sidebar-footer {
    display: flex;
    margin-top: 12px;
  }

  .sidebar-footer .live {
    flex: 1;
  }

  .logout {
    width: auto;
  }

  .app-main {
    margin-left: 0;
    padding: 28px 20px 60px;
  }

  .form-grid,
  .form-grid.two,
  .call-metadata,
  .practitioner-identity-fields {
    grid-template-columns: 1fr;
  }

  .practitioner-rule-options {
    grid-template-columns: 1fr 1fr;
  }

  .section-heading,
  .slot-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .calls-topbar,
  .calls-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .message-search,
  .message-filter-label,
  .message-filter-label select {
    width: 100%;
  }

  .call-workspace {
    display: block;
  }

  .call-list-pane,
  .call-analysis-pane {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .call-list {
    max-height: 420px;
  }

  .call-analysis-pane,
  .call-transcript-pane {
    min-height: 420px;
  }

  .slot-navigation {
    align-self: stretch;
    justify-content: space-between;
  }

  .slot-practitioner-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .slot-calendar {
    grid-template-columns: repeat(4, 230px);
  }

  .call-outcome {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .login-story {
    min-height: 280px;
    padding: 28px;
  }

  .login-story-copy {
    margin: 42px 0;
  }

  .login-story-footer {
    display: none;
  }

  .login-panel {
    padding: 40px 20px;
  }
}

@media (max-width: 480px) {
  .app-main {
    padding: 24px 14px 50px;
  }

  .nav-icon {
    display: none;
  }

  .tab {
    padding: 8px 10px;
  }

  .live {
    display: none;
  }

  .sidebar-footer {
    justify-content: flex-end;
  }
}
