/* Panel admin de holorientation.com (admin/index.html, admin.js), après accueil.css. Même thème que la page d'accueil
   (demande d'Amine) : ses couleurs (variables de accueil.css, jamais redéfinies ici), ses polices (Barlow Condensed pour
   les titres, avec la petite barre de couleur ; Barlow pour les phrases d'introduction ; police du système pour le reste),
   fonds sombres, traits fins et discrets, accents bleu et cyan. En-tête, menu du compte et fenêtres : ceux de l'accueil.
   Mise en page : une colonne d'entrées à gauche sur toute la hauteur (Utilisateurs, Logs – conversations, Statistiques),
   la page de l'entrée choisie à droite ; sur un téléphone, la colonne devient un menu qui se déplie en haut. */

.page-panel { background: var(--fond); }
/* La lueur bleue du haut des sections de l'accueil, derrière le panel. */
.panel {
  min-height: 100vh; min-height: 100svh; padding-top: var(--entete);
  background: radial-gradient(ellipse 70% 460px at 60% 0%, rgba(47, 107, 255, .11), rgba(47, 107, 255, 0) 70%), var(--fond);
}

/* En-tête de l'accueil, un peu plus opaque (la page défile dessous) et d'un bord à l'autre. */
.page-panel .entete, .page-panel .entete.defile { background: rgba(8, 11, 18, .9); border-bottom-color: var(--bordure); }
.page-panel .entete .conteneur { width: auto; max-width: none; padding: 0 1.25rem; }

/* Icônes au trait (leurs attributs fill="none" et stroke disent déjà la même chose : jamais de formes noires, même si
   cette feuille n'est pas encore chargée). */
.icone { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
  stroke-linejoin: round; }

/* Contour du clavier (celui de l'accueil) : chaque élément garde ses coins arrondis. */
.panel-entrees a:focus-visible { border-radius: 12px; outline-offset: 2px; }
.petit-bouton:focus-visible { border-radius: 999px; }
.panel-menu-bouton:focus-visible { border-radius: 12px; outline-offset: -4px; }

/* Grands titres : Barlow Condensed et la petite barre cyan-bleu des lignes de l'accueil, à hauteur des lettres. */
.panel-titre, .page-titre {
  position: relative; padding-left: calc(4px + .34em); color: #fff; font: 600 clamp(2.4rem, 1.8rem + 1.6vw, 3.2rem)/1.04 var(--police-titres);
  letter-spacing: -.03em; font-synthesis: none; overflow-wrap: anywhere;
}
.panel-titre::before, .page-titre::before {
  content: ""; position: absolute; left: 0; top: .31em; width: 4px; height: .54em; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--bleu-vif));
}
/* Cartes sombres (listes, chiffres, graphique, messages) : fond bleu nuit dégradé, trait fin. */
.panel-message, .comptes, .qr-liste, .chiffre, .graphique {
  border: 1px solid var(--bordure); border-radius: 16px;
  background: linear-gradient(180deg, rgba(23, 32, 51, .72), rgba(18, 26, 41, .42));
}

/* ─────────────── Hors du panel : connexion, attente, service indisponible ─────────────── */
.panel-seul { width: min(100% - 2.5rem, 40rem); margin: 0 auto; padding: 4.5rem 0 5rem; }
.panel-ouvert .panel-seul { display: none; }
.panel-vue[hidden] { display: none !important; }
.panel-message { margin-top: 2.2rem; padding: 1.6rem 1.6rem 1.7rem; }
.panel-message p { color: var(--pale); line-height: 1.6; }
.panel-message strong { color: #fff; }
.panel-message .bouton-plein { margin-top: 1.3rem; }
.panel-retour { display: inline-block; margin-top: 2rem; font-weight: 600; text-decoration: none; }
.panel-retour:hover { text-decoration: underline; text-underline-offset: .25em; }
.panel-attente { margin-top: 2rem; color: var(--doux); }

/* ─────────────── Le panel : colonne de gauche + page ─────────────── */
.panel-cadre { display: grid; grid-template-rows: auto 1fr; min-height: calc(100vh - var(--entete));
  min-height: calc(100svh - var(--entete)); }
.panel-menu { background: #090c13; border-bottom: 1px solid var(--bordure); }
.panel-menu-tete { padding: 1.1rem 1.25rem .7rem; color: var(--cyan); font: 600 .72rem/1.3 var(--police-texte);
  letter-spacing: .22em; text-transform: uppercase; }
/* Téléphone : un bouton « Menu » déplie la liste des entrées ; il dit l'entrée ouverte. */
.panel-menu-bouton {
  appearance: none; display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 56px; margin: 0;
  padding: 0 1.25rem; border: 0; background: transparent; color: var(--doux); font: 500 1rem/1.2 var(--police-texte);
  text-align: left; cursor: pointer;
}
.panel-menu-bouton:hover { color: var(--pale); }
.panel-menu-bouton .menu-courant { display: inline-flex; align-items: center; gap: .7rem; color: #fff; font-weight: 600; }
.panel-menu-bouton .menu-courant:empty { display: none; }
.panel-menu-bouton .menu-courant::before { content: ""; width: 1px; height: 1.1em; background: var(--bordure-forte); }
.panel-menu-bouton .chevron { margin-left: auto; transition: transform .2s; }
.panel-menu-bouton[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.panel-entrees { display: none; padding: 0 0 .9rem; border-top: 1px solid var(--bordure); }
.panel-menu-bouton[aria-expanded="true"] + .panel-entrees { display: block; }
.panel-entrees a {
  position: relative; display: flex; align-items: center; gap: .85rem; min-height: 52px; margin: 0 .75rem;
  padding: 0 .85rem 0 .6rem; border-radius: 12px; color: var(--pale); font: 500 1rem/1.25 var(--police-texte);
  text-decoration: none; transition: background-color .2s, color .2s;
}
.panel-entrees a + a { margin-top: 4px; }
.panel-entrees a:hover { color: #fff; background: rgba(255, 255, 255, .045); }
.panel-entrees .icone { width: 22px; height: 22px; color: var(--doux); transition: color .2s; }
.panel-entrees a:hover .icone { color: var(--pale); }
/* L'entrée ouverte : teintée de bleu, icône cyan, et la petite barre de l'accueil collée au bord de la colonne. */
.panel-entrees a[aria-current="page"] {
  color: #fff; font-weight: 600; background: linear-gradient(90deg, rgba(47, 107, 255, .2), rgba(47, 107, 255, .06));
  box-shadow: inset 0 0 0 1px rgba(91, 155, 255, .2);
}
.panel-entrees a[aria-current="page"] .icone { color: var(--cyan); }
.panel-entrees a[aria-current="page"]::before {
  content: ""; position: absolute; left: -.75rem; top: 50%; width: 4px; height: 24px; transform: translateY(-50%);
  border-radius: 0 3px 3px 0; background: linear-gradient(180deg, var(--cyan), var(--bleu-vif));
}
.section-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compteur {
  margin-left: auto; min-width: 1.9rem; padding: .14rem .55rem; border-radius: 999px; background: rgba(148, 163, 184, .1);
  border: 1px solid var(--bordure); color: var(--pale); font: 600 .78rem/1.3 var(--police-texte);
  font-variant-numeric: tabular-nums; text-align: center;
}
.compteur:empty { display: none; }
.panel-entrees a[aria-current="page"] .compteur { background: rgba(91, 155, 255, .16); border-color: rgba(91, 155, 255, .34);
  color: #d6e5ff; }
.panel-menu-retour { display: none; }

.panel-page { min-width: 0; padding: 2.2rem 1.25rem 4rem; }
.panel-section { max-width: 68rem; }
.page-outils { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin: 2rem 0 1.1rem; }
.page-resume { margin-bottom: .9rem; color: var(--doux); font-size: .9rem; }
.panel-erreur { margin-bottom: 1.2rem; }
.liste-vide { padding: 1.4rem 1.25rem; color: var(--doux); }

@media (min-width: 900px) {
  .page-panel .entete .conteneur { padding: 0 2rem; }
  .panel-cadre { grid-template-columns: 330px minmax(0, 1fr); grid-template-rows: none; }
  .panel-menu { position: sticky; top: var(--entete); align-self: start; height: calc(100vh - var(--entete));
    height: calc(100svh - var(--entete)); overflow-y: auto; border-bottom: 0; border-right: 1px solid var(--bordure); }
  .panel-menu-bouton { display: none; }
  .panel-menu-tete { padding: 2rem 2rem .9rem; }
  .panel-entrees { display: block; padding: 0 0 1rem; border-top: 0; }
  .panel-entrees a { margin: 0 .9rem; padding: 0 .85rem 0 1.1rem; }
  .panel-entrees a[aria-current="page"]::before { left: -.9rem; }
  .panel-menu-retour {
    display: block; margin: .6rem .9rem 0; padding: 1.1rem 1.1rem 0; border-top: 1px solid var(--bordure); color: var(--doux);
    font-size: .92rem; font-weight: 600; text-decoration: none;
  }
  .panel-menu-retour:hover { color: #fff; }
  .panel-page { padding: 3rem 3.5rem 5rem; }
}

/* ─────────────── Champs, boutons, pastilles ─────────────── */
.recherche {
  display: flex; flex: 1 1 18rem; align-items: center; gap: .65rem; max-width: 30rem; padding: 0 1rem;
  border: 1px solid var(--bordure-forte); border-radius: 12px; background: rgba(255, 255, 255, .035); color: var(--doux);
  transition: border-color .2s, box-shadow .2s;
}
.recherche:focus-within { border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(91, 155, 255, .25); }
.recherche .icone { width: 18px; height: 18px; stroke-width: 2; }
.recherche input { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; color: var(--texte);
  font: 400 1rem var(--police-texte); }
.recherche input:focus { outline: none; }
.recherche input::placeholder { color: #7f8b9d; }
.petit-bouton {
  appearance: none; min-height: 40px; margin: 0; padding: 0 1.1rem; border-radius: 999px; border: 1px solid var(--bordure-forte);
  background: rgba(255, 255, 255, .04); color: var(--texte); font: 600 .9rem/1 var(--police-texte); cursor: pointer;
  transition: background-color .2s, border-color .2s, filter .2s;
}
.petit-bouton:hover { background: rgba(255, 255, 255, .09); border-color: rgba(148, 163, 184, .42); }
.petit-bouton.principal { border-color: transparent; background: linear-gradient(135deg, var(--bleu-vif), #19b4d6); color: #fff; }
.petit-bouton.principal:hover { filter: brightness(1.08); }
.petit-bouton.danger { border-color: rgba(194, 24, 59, .55); color: #ffb9c5; }
.petit-bouton.danger:hover { background: rgba(194, 24, 59, .16); border-color: rgba(194, 24, 59, .75); }
.petit-bouton:disabled { opacity: .5; cursor: default; }
.statut {
  display: inline-flex; align-items: center; gap: .42rem; padding: .22rem .65rem; border: 1px solid; border-radius: 999px;
  font: 600 .78rem/1.25 var(--police-texte); white-space: nowrap;
}
.statut::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.statut-proprietaire { background: rgba(34, 211, 238, .1); border-color: rgba(34, 211, 238, .3); color: #67e8f9; }
.statut-acces, .statut-actif { background: rgba(91, 155, 255, .12); border-color: rgba(91, 155, 255, .32); color: #a9c8ff; }
.statut-sans { background: rgba(148, 163, 184, .08); border-color: rgba(148, 163, 184, .22); color: #b3bdcc; }
.statut-scanne { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .3); color: #6ee7b7; }
.pastille-langue { padding: .08rem .42rem; border: 1px solid var(--bordure-forte); border-radius: 6px; color: var(--pale);
  font: 700 .7rem/1.3 var(--police-texte); letter-spacing: .08em; }

/* ─────────────── Utilisateurs ─────────────── */
.comptes { list-style: none; padding: 0; overflow: hidden; }
.comptes li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem 1rem; align-items: center;
  padding: 1rem 1.15rem; transition: background-color .2s; }
.comptes li + li { border-top: 1px solid var(--bordure); }
.comptes li:hover { background: rgba(255, 255, 255, .02); }
.compte-ligne-nom { display: flex; align-items: center; gap: .8rem; min-width: 0; color: #fff;
  font: 600 1.04rem/1.25 var(--police-texte); overflow-wrap: anywhere; }
.compte-ligne-nom .initiales { flex: none; width: 2.2rem; height: 2.2rem; font-size: 1.02rem; }
/* Sans accès : des initiales éteintes. */
.comptes li:has(.statut-sans) .initiales { background: var(--carte-2); color: var(--pale); box-shadow: inset 0 0 0 1px var(--bordure-forte); }
.compte-ligne-dates { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; padding-left: 3rem; color: var(--doux);
  font-size: .88rem; }   /* sous le nom, après les initiales */
.compte-ligne-dates b { color: var(--pale); font-weight: 500; white-space: nowrap; }
.compte-ligne-dates > span > [data-lang] { white-space: nowrap; }   /* une date ne se coupe jamais : son nom passe au-dessus */
.compte-ligne-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; }
.compte-ligne-actions:empty { display: none; }
@media (min-width: 480px) { .compte-ligne-actions { padding-left: 3rem; } }   /* boutons sous les dates */
/* Grand écran : une ligne par compte (nom, statut, les deux dates l'une sous l'autre, boutons). Les lignes partagent les
   colonnes de la liste (subgrid) : tout s'aligne d'une ligne à l'autre. Plus étroit : nom et statut, dates, boutons. */
@media (min-width: 1280px) {
  .comptes { display: grid; grid-template-columns: minmax(9rem, 1fr) auto auto auto; }
  .comptes li { grid-column: 1 / -1; grid-template-columns: subgrid; gap: .35rem 1.6rem; padding: .95rem 1.35rem; }
  .comptes .liste-vide { display: block; }
  .comptes .statut { justify-self: start; }
  .compte-ligne-dates { grid-column: auto; flex-direction: column; gap: .1rem; padding-left: 0; }
  .compte-ligne-actions, .compte-ligne-actions:empty { display: flex; grid-column: auto; flex-wrap: nowrap; justify-content: flex-end;
    padding-left: 0; }
}

/* ─────────────── Logs – conversations ─────────────── */
.qr-liste { list-style: none; padding: 0; overflow: hidden; }
.qr-liste li + li { border-top: 1px solid var(--bordure); }
/* Une ligne par conversation ; le petit triangle des liens de l'accueil à droite. */
.qr-lien {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .32rem 1.2rem; padding: 1rem 1.35rem;
  color: var(--texte); text-decoration: none; transition: background-color .2s;
}
.qr-lien > * { grid-column: 1; }
.qr-lien::after {
  content: ""; grid-column: 2; grid-row: 1 / span 3; align-self: center; border-left: .42em solid currentColor;
  border-top: .27em solid transparent; border-bottom: .27em solid transparent; color: var(--doux); transition: transform .2s, color .2s;
}
.qr-lien:hover { background: rgba(91, 155, 255, .06); color: var(--texte); }
.qr-lien:hover::after { color: var(--cyan); transform: translateX(3px); }
.qr-lien:focus-visible { outline-offset: -3px; border-radius: 0; }
.qr-nom { color: #fff; font: 600 1.3rem/1.15 var(--police-titres); letter-spacing: .01em; }
.qr-apercu { overflow: hidden; color: #aab2c0; text-overflow: ellipsis; white-space: nowrap; }
.qr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; color: var(--doux); font-size: .86rem; }
.qr-statuts { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.qr-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .8rem; margin-top: 1.4rem; }
.qr-pages[hidden] { display: none; }
.qr-page { color: var(--doux); font-size: .9rem; }
.qr-retour { display: inline-block; margin-bottom: 1.2rem; font-weight: 600; text-decoration: none; }
.qr-retour:hover { text-decoration: underline; text-underline-offset: .25em; }
.qr-entete { display: grid; gap: .7rem; margin-bottom: 1.8rem; }
.qr-infos { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .45rem; color: var(--doux); font-size: .94rem; }
.qr-actions:empty { display: none; }
/* La conversation, dans une carte : le visiteur à droite en bleu, la borne à gauche sur une bulle sombre. */
.qr-echanges {
  display: grid; gap: 1.5rem; max-width: 50rem; list-style: none; padding: 1.3rem 1rem; border: 1px solid var(--bordure);
  border-radius: 18px; background: radial-gradient(ellipse 80% 50% at 100% 0%, rgba(47, 107, 255, .09), rgba(47, 107, 255, 0) 70%),
  rgba(15, 20, 32, .72);
}
.qr-echanges:empty { display: none; }
.qr-echange { display: grid; gap: .55rem; }
.bulle { max-width: 85%; padding: .85rem 1.1rem; border-radius: 18px; line-height: 1.55; overflow-wrap: anywhere; }
.bulle p { white-space: pre-line; }
.bulle-question {
  justify-self: end; border-bottom-right-radius: 6px; background: linear-gradient(135deg, var(--bleu-vif), #2757d6); color: #fff;
  box-shadow: 0 10px 24px -18px rgba(47, 107, 255, .7);
}
.bulle-reponse { justify-self: start; border-bottom-left-radius: 6px; background: var(--carte-2); border: 1px solid var(--bordure);
  color: var(--texte); }
.bulle-heure { display: block; margin-top: .3rem; color: rgba(255, 255, 255, .74); font-size: .78rem; text-align: right; }
.bulle-liens { display: grid; gap: .3rem; margin-top: .75rem; padding: .65rem 0 0; border-top: 1px solid var(--bordure);
  list-style: none; color: var(--doux); font-size: .86rem; }
@media (min-width: 900px) { .qr-echanges { padding: 1.8rem 1.6rem; } .bulle { max-width: 78%; } }

/* ─────────────── Statistiques ─────────────── */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: 1rem; margin: 2rem 0 1.25rem; }
@media (max-width: 599px) {   /* téléphone : deux cartes par rangée, la dernière seule prend toute la largeur */
  .chiffres { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .chiffre:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* Un chiffre par carte, avec un trait cyan-bleu en haut (les couleurs de la barre des titres). */
.chiffre { position: relative; padding: 1.25rem 1.25rem 1.15rem; }
.chiffre::before {
  content: ""; position: absolute; left: 1.25rem; top: -1px; width: 2.2rem; height: 2px; border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, var(--cyan), var(--bleu-vif));
}
.chiffre-valeur { display: block; color: #fff; font: 600 2.6rem/1 var(--police-titres); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; }
.chiffre-nom { display: block; margin-top: .55rem; color: var(--pale); font-size: .9rem; line-height: 1.4; }
.chiffre-detail { display: block; margin-top: .3rem; color: var(--doux); font-size: .82rem; line-height: 1.4; }
.graphique { margin: 0; padding: 1.35rem 1.35rem 1.05rem; }
.graphique figcaption { color: #fff; font: 600 1.55rem/1.1 var(--police-titres); letter-spacing: -.02em; }
.graphique-legende { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; margin: .65rem 0 .9rem; color: var(--pale); font-size: .86rem; }
.graphique-legende > span { display: inline-flex; align-items: center; gap: .5rem; }
.graphique-legende > span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--couleur); }
/* Créés : le bleu vif de l'accueil ; scannés : un cyan un peu plus profond que celui des titres, pour que les deux barres
   se distinguent aussi pour un daltonien et restent lisibles sur le fond sombre (vérifié). */
.legende-crees { --couleur: var(--bleu-vif); }
.legende-scannes { --couleur: #0aa5c0; }
.graphique svg { display: block; width: 100%; height: auto; }
.graphique .axe { fill: var(--doux); font: 500 11px var(--police-texte); }
.graphique .grille { stroke: rgba(148, 163, 184, .14); stroke-width: 1; }
.graphique .barre-crees { fill: var(--bleu-vif); }
.graphique .barre-scannes { fill: #0aa5c0; }
.graphique .jour:hover rect.fond-jour { fill: rgba(255, 255, 255, .045); }

/* ─────────────── Fenêtres de confirmation (celles de l'accueil, sombres) ─────────────── */
.fenetre-confirmation .formulaire-compte { gap: 1.1rem; }
.fenetre-confirmation p { color: var(--pale); line-height: 1.55; }
.fenetre-confirmation strong { color: #fff; }
.confirmation-boutons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; }
.fenetre-confirmation .petit-bouton.danger { background: var(--grenat); border-color: var(--grenat); color: #fff; }   /* le geste final */
.fenetre-confirmation .petit-bouton.danger:hover { background: #d81f47; border-color: #d81f47; }
