/* Poste d'appel Eden Flavors — page /telephone.
   Memes variables que admin.css (charge avant celle-ci), mais c'est un poste
   de travail : contraste franc, grandes cibles, rien de decoratif.
   L'agent doit lire le souffleur a 60 cm sans se pencher. */

:root {
  --tel-shell: #0e2017;
  --tel-shell-2: #16301f;
  --tel-edge: rgba(255, 255, 255, 0.12);
  --tel-live: #2e9e6b;
}

html, body { height: 100%; }

body.tel {
  background: var(--tel-shell);
  color: var(--ink);
  overflow: hidden;
}

/* ------------------------------------------------ ecran de garde */

.tel-garde {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(160deg, #0c2017, #14291d);
  color: #e9e4d4;
  font-size: 16px;
  text-align: center;
  padding: 24px;
}

.tel-garde img { height: 40px; width: auto; }

/* ------------------------------------------------ coquille */

.tel-app {
  display: none;
  height: 100vh;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.tel-app.on { display: grid; }

/* barre du haut */

.tel-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: var(--ink);
  color: #e9e4d4;
  border-bottom: 1px solid var(--tel-edge);
}

.tel-bar img { height: 26px; width: auto; display: block; }

.tel-bar h1 {
  font-size: 17px;
  letter-spacing: 0.01em;
  margin-right: auto;
}

.tel-bar h1 small {
  display: block;
  font-family: 'Figtree', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #9bb0a2;
  letter-spacing: 0;
}

.tel-bar a.retour {
  color: #e9e4d4;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--tel-edge);
  border-radius: 999px;
  padding: 7px 16px;
}

.tel-bar a.retour:hover { border-color: var(--gold); color: #f6e8c9; }

.tel-etat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 13px;
  background: rgba(255, 255, 255, 0.08);
  color: #cfe0d3;
  white-space: nowrap;
}

.tel-etat i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8c9a90;
  flex: none;
}

.tel-etat.ok i { background: var(--tel-live); }
.tel-etat.warn i { background: var(--gold); }
.tel-etat.bad i { background: #d9755f; }

/* bandeau permanent : l'appel est transcrit */

.tel-bandeau {
  background: var(--gold-soft);
  color: #6f4f10;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 18px;
  border-bottom: 1px solid #e0cb9a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tel-bandeau span.libre { font-weight: 500; color: #7c5c1c; }

/* ------------------------------------------------ les trois colonnes */

.tel-grid {
  display: grid;
  grid-template-columns: 320px 416px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  min-height: 0;
}

.tel-col {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.tel-col > h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding: 14px 16px 10px;
  flex: none;
}

.tel-scroll { overflow-y: auto; min-height: 0; flex: 1; }

/* ------------------------------------------------ colonne gauche : contacts */

.tel-recherche { padding: 0 14px 10px; flex: none; }

.tel-recherche input[type="search"] {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.tel-recherche input[type="search"]:focus { outline: none; border-color: var(--gold); }

.tel-filtres {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 14px 12px;
  flex: none;
}

.tel-filtres select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 9px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.tel-filtres select:focus { outline: none; border-color: var(--gold); }

.tel-filtres .large { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }

.tel-compte { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; margin-left: auto; }

.tel-contact {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 11px 16px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s var(--ease);
}

.tel-contact:hover { background: var(--green-soft); }
.tel-contact.actif { background: var(--gold-soft); box-shadow: inset 4px 0 0 var(--gold); }

.tel-contact .nom { font-weight: 700; font-size: 15px; }
.tel-contact .num { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--ink-soft); }

.tel-contact .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
  align-items: center;
}

.tel-contact .meta .mini {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-family: 'IBM Plex Mono', monospace;
}

/* ------------------------------------------------ colonne centre : clavier */

/* la colonne du milieu defile si l'ecran est court : le softphone garde sa
   taille minimale plutot que d'etre ecrase. */
.tel-centre { padding-bottom: 14px; overflow-y: auto; }

.tel-numero {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  flex: none;
}

.tel-numero input {
  flex: 1;
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: #fff;
  color: var(--ink);
}

.tel-numero input:focus { outline: none; border-color: var(--gold); }

.tel-numero button.effacer {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 12px;
  width: 50px;
  font-size: 19px;
  cursor: pointer;
  color: var(--ink-soft);
}

.tel-numero button.effacer:hover { border-color: var(--gold); color: var(--ink); }

.tel-pave {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 16px 12px;
  flex: none;
}

.tel-pave button {
  border: 1.5px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 13px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s var(--ease);
}

.tel-pave button:hover { background: var(--green-soft); border-color: var(--green); }
.tel-pave button:active { background: var(--gold-soft); }

.tel-actions { display: flex; gap: 8px; padding: 0 16px 12px; flex: none; }

.tel-actions .btn { flex: 1; font-size: 16px; padding: 15px 18px; }

.btn.appeler { background: var(--tel-live); color: #04220f; font-weight: 700; }
.btn.raccrocher { background: var(--red); color: #fff6f2; font-weight: 700; }

/* fiche + chrono pendant l'appel */

.tel-encours {
  margin: 0 16px 12px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--paper);
  flex: none;
}

.tel-encours.live { border-color: var(--tel-live); background: var(--green-soft); }

.tel-encours .haut { display: flex; align-items: baseline; gap: 10px; }
.tel-encours .qui { font-weight: 700; font-size: 16px; }

.tel-chrono {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.tel-encours .detail { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

/* softphone Aircall */

.tel-softphone {
  margin: 0 16px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  flex: 1 0 300px;
  overflow: hidden;
}

.tel-softphone .cadre { flex: 1; min-height: 0; overflow: auto; }
.tel-softphone iframe { width: 100%; height: 100%; border: 0; display: block; }

.tel-softphone .mot {
  padding: 16px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.tel-softphone .mot b { color: var(--ink); }

/* ------------------------------------------------ colonne droite : souffleur */

.tel-souffleur { background: var(--paper-2); }

.tel-etapes {
  display: flex;
  gap: 6px;
  padding: 0 18px 12px;
  flex: none;
  flex-wrap: wrap;
}

.tel-etapes button {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 17px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
}

.tel-etapes button.active { background: var(--green); border-color: var(--green); color: #fdfaf2; }
.tel-etapes button:hover { border-color: var(--green); }

.tel-objections {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 0 18px 14px;
  flex: none;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.tel-objections button {
  border: 2px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  transition: background 0.12s var(--ease), border-color 0.12s var(--ease);
}

.tel-objections button:hover { background: var(--gold-soft); border-color: var(--gold); }
.tel-objections button.actif { background: var(--gold); border-color: var(--gold); color: #241a04; }
.tel-objections button:disabled { opacity: 0.55; cursor: wait; }

/* la reponse, en tres gros */

.tel-reponse { padding: 0 18px 18px; }

.tel-reponse .dit {
  font-family: 'Bricolage Grotesque', 'Figtree', sans-serif;
  font-size: 34px;
  line-height: 1.28;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.tel-reponse .dit.attente {
  font-family: 'Figtree', sans-serif;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.5;
}

.tel-reponse ul {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tel-reponse li {
  font-size: 20px;
  line-height: 1.4;
  font-weight: 500;
  padding: 11px 16px;
  background: var(--green-soft);
  border-left: 5px solid var(--green);
  border-radius: 0 10px 10px 0;
}

.tel-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 11.5px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ink-soft);
  background: #eee9df;
  border-radius: 999px;
  padding: 4px 11px;
}

/* couche transcription (Chrome seulement, masquee ailleurs) */

.tel-couche {
  flex: none;
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  background: var(--paper);
}

.tel-couche .rang { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.tel-couche .rang b { font-size: 14px; }

.tel-couche .mot {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 8px;
  line-height: 1.5;
}

.tel-couche .mot.alerte { color: var(--red); font-weight: 600; }

.tel-ecoute {
  max-height: 110px;
  overflow-y: auto;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.tel-ecoute p { margin-bottom: 6px; }
.tel-ecoute p:last-child { margin-bottom: 0; }
.tel-ecoute .part { color: var(--ink-soft); font-style: italic; }

/* ------------------------------------------------ messages de service */

.tel-avis {
  margin: 0 16px 12px;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  background: var(--blush-soft);
  color: #8b3524;
  border: 1px solid #edc9bf;
}

.tel-avis.calme { background: #eee9df; color: var(--ink-soft); border-color: var(--line); }

.tel-vide { padding: 30px 18px; text-align: center; color: var(--ink-soft); font-size: 14px; }

/* ------------------------------------------------ ecrans plus etroits
   Pensee pour un grand ecran, mais elle ne doit pas se casser sur un
   portable 13 pouces (1280 x 800 logiques, souvent moins en hauteur). */

@media (max-width: 1400px) {
  .tel-grid { grid-template-columns: 268px 396px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .tel-softphone { margin: 0 12px; flex: 1 0 260px; }
  .tel-reponse .dit { font-size: 30px; }
  .tel-reponse li { font-size: 18px; }
  .tel-numero input { font-size: 20px; }
  .tel-pave button { padding: 11px 0; font-size: 20px; }
  .tel-objections button { font-size: 15px; padding: 12px 15px; }
}

@media (max-width: 1150px) {
  body.tel { overflow: auto; }
  .tel-app.on { height: auto; min-height: 100vh; }
  .tel-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; }
  .tel-col { max-height: 560px; }
  .tel-souffleur { grid-column: 1 / -1; max-height: none; }
}

@media (max-width: 760px) {
  .tel-grid { grid-template-columns: minmax(0, 1fr); }
  .tel-souffleur { grid-column: auto; }
  .tel-reponse .dit { font-size: 25px; }
}

/* hauteur reduite : on rend de la place au souffleur */
@media (max-height: 800px) {
  .tel-pave button { padding: 9px 0; font-size: 18px; }
  .tel-reponse .dit { font-size: 28px; }
  .tel-objections { gap: 7px; padding-bottom: 10px; margin-bottom: 10px; }
  .tel-objections button { padding: 10px 14px; font-size: 14.5px; }
  .tel-etapes button { padding: 7px 14px; font-size: 13px; }
}

@media (max-height: 720px) {
  .tel-couche { padding: 8px 18px 10px; }
  .tel-couche .mot { font-size: 12px; margin-top: 5px; }
  .tel-ecoute { max-height: 72px; font-size: 14px; }
  .tel-reponse .dit { font-size: 25px; }
}
