/* Retro Hub — « Mon compte » et panel admin. Reprend les jetons de styles.css (thèmes clair / sombre). */

[hidden] { display: none !important; }

.es-conteneur { max-width: 640px; }
.es-titre { font-size: clamp(30px, 5vw, 46px); }
.es-h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; color: var(--texte-vif); }
.es-sous { margin-top: 4px; color: var(--texte-attenue); font-size: 14px; }
.es-mono { font-family: var(--police-mono); font-size: 12.5px; word-break: break-all; }
.es-centre { max-width: 460px; margin: 56px auto; }

/* ── Cartes ─────────────────────────────────────────────────────────────── */
.es-carte {
  margin-top: 32px; padding: 28px; border: 1px solid var(--bordure); border-radius: var(--rayon-carte);
  background: var(--panneau); box-shadow: var(--ombre-apercu);
}
.es-carte__icone {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-lueur); color: var(--accent-texte); border: 1px solid var(--accent-ligne); font-size: 20px;
}
.es-indispo, .es-auth__tete { display: flex; gap: 16px; align-items: flex-start; }
.es-indispo h2 { font-size: 18px; font-weight: 600; color: var(--texte-vif); }
.es-indispo p { margin-top: 6px; color: var(--texte-attenue); }
.es-auth__tete { margin-bottom: 22px; align-items: center; }

/* ── Onglets connexion / inscription ───────────────────────────────────── */
.es-onglets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 22px;
  border-radius: 12px; background: var(--fond); border: 1px solid var(--bordure); }
.es-onglet { height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--texte-attenue);
  font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.es-onglet[aria-selected="true"] { background: var(--panneau); color: var(--texte-vif); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.es-onglet:focus-visible { outline: 2px solid var(--accent-texte); outline-offset: 2px; }

/* ── Formulaires ───────────────────────────────────────────────────────── */
.es-formulaire { display: grid; gap: 16px; }
.es-champ { display: grid; gap: 6px; min-width: 0; }
.es-champ > span:first-child { font-size: 13.5px; font-weight: 600; color: var(--texte); }
.es-champ input, .es-champ textarea, .es-champ select, .es-outils select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--bordure-forte); border-radius: var(--rayon);
  background: var(--app); color: var(--texte-vif); font: inherit; font-size: 15px;
}
.es-champ textarea { resize: vertical; min-height: 64px; }
.es-champ input:focus, .es-champ textarea:focus, .es-champ select:focus, .es-outils select:focus, .es-recherche input:focus {
  outline: none; border-color: var(--accent-texte); box-shadow: 0 0 0 3px var(--accent-lueur);
}
.es-champ input:disabled { opacity: .5; }
.es-aide { font-size: 13px; color: var(--texte-faible); }
.es-mdp { position: relative; display: block; }
.es-mdp input { padding-right: 48px; }
.es-mdp__voir { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 36px;
  border: 0; border-radius: 8px; background: transparent; color: var(--texte-attenue); cursor: pointer; font-size: 17px; }
.es-mdp__voir:hover { background: var(--survol); color: var(--texte-vif); }
.es-case { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--texte); cursor: pointer; }
.es-case input { width: 18px; height: 18px; accent-color: var(--accent-texte); }
.es-ligne-champs { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.es-ligne-champs .es-champ { flex: 1 1 200px; }
.es-plein { width: 100%; justify-content: center; }
.es-note { font-size: 13.5px; color: var(--texte-attenue); text-align: center; }

.es-message { padding: 10px 14px; border-radius: var(--rayon); font-size: 14px; border: 1px solid transparent; }
.es-message--erreur { color: var(--rouge); background: color-mix(in srgb, var(--rouge) 9%, transparent); border-color: color-mix(in srgb, var(--rouge) 30%, transparent); }
.es-message--succes { color: var(--accent-texte); background: var(--accent-lueur); border-color: var(--accent-ligne); }

.es-occupe { opacity: .7; cursor: progress; }
.bouton:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.bouton--danger { background: color-mix(in srgb, var(--rouge) 12%, transparent); color: var(--rouge);
  border-color: color-mix(in srgb, var(--rouge) 40%, transparent); }
.bouton--danger:hover { background: color-mix(in srgb, var(--rouge) 20%, transparent); }

/* ── Statuts ───────────────────────────────────────────────────────────── */
.es-statut { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.es-statut::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.es-statut--actif { color: var(--accent-texte); background: var(--accent-lueur); border-color: var(--accent-ligne); }
.es-statut--attente { color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, transparent); border-color: color-mix(in srgb, var(--orange) 32%, transparent); }
.es-statut--inactif { color: var(--rouge); background: color-mix(in srgb, var(--rouge) 9%, transparent); border-color: color-mix(in srgb, var(--rouge) 30%, transparent); }

/* ── État du compte ────────────────────────────────────────────────────── */
.es-etat__tete { display: flex; gap: 14px; align-items: center; }
.es-avatar { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent-lueur); color: var(--accent-texte); border: 1px solid var(--accent-ligne); font-size: 22px; }
.es-etat__qui { min-width: 0; display: grid; gap: 6px; justify-items: start; }
.es-etat__email { font-weight: 600; color: var(--texte-vif); overflow-wrap: anywhere; }
.es-etat__message { margin-top: 18px; color: var(--texte); }
.es-infos { display: grid; gap: 0; margin-top: 18px; border-top: 1px solid var(--bordure); }
.es-infos > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--bordure); }
.es-infos dt { color: var(--texte-attenue); font-size: 14px; flex: none; }
.es-infos dd { margin: 0; color: var(--texte-vif); font-size: 14px; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.es-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ── Panel admin ───────────────────────────────────────────────────────── */
.es-admin__main { padding-block: 40px 64px; min-height: calc(100vh - var(--hauteur-entete) - 80px); }
.es-admin__tete { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; }
.es-admin__tete .surtitre { margin-bottom: 6px; }
.es-admin__boutons { display: flex; flex-wrap: wrap; gap: 10px; }

.es-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.es-stat { display: grid; gap: 2px; padding: 16px 18px; text-align: left; border: 1px solid var(--bordure); border-radius: 14px;
  background: var(--panneau); color: inherit; font: inherit; cursor: pointer; }
.es-stat:hover { border-color: var(--bordure-forte); background: var(--survol); }
.es-stat__val { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; color: var(--texte-vif); font-variant-numeric: tabular-nums; }
.es-stat__lib { font-size: 13px; color: var(--texte-attenue); }
.es-stat--attente .es-stat__val { color: var(--orange); }
.es-stat--actif .es-stat__val { color: var(--accent-texte); }
.es-stat--inactif .es-stat__val { color: var(--rouge); }

.es-outils { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.es-recherche { position: relative; flex: 1 1 260px; }
.es-recherche .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--texte-faible); }
.es-recherche input { width: 100%; height: 44px; padding: 0 12px 0 38px; border: 1px solid var(--bordure-forte);
  border-radius: var(--rayon); background: var(--app); color: var(--texte-vif); font: inherit; font-size: 15px; }
.es-outils select { width: auto; flex: 0 0 auto; }

.es-tableau-cadre { margin-top: 16px; border: 1px solid var(--bordure); border-radius: var(--rayon-carte);
  background: var(--panneau); overflow: hidden; }
.es-tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.es-tableau th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--texte-faible); background: var(--fond); border-bottom: 1px solid var(--bordure); }
.es-tableau td { padding: 12px 16px; border-bottom: 1px solid var(--bordure); color: var(--texte); vertical-align: middle; }
.es-tableau tbody tr:last-child td { border-bottom: 0; }
.es-tableau tbody tr:hover td { background: var(--survol); }
.es-col-actions { text-align: right; width: 1%; white-space: nowrap; }
.es-tableau td[data-label="PC lié"], .es-tableau td[data-label="Expiration"] { white-space: nowrap; }
.es-qui { display: grid; gap: 3px; min-width: 0; }
.es-qui__email { font-weight: 600; color: var(--texte-vif); overflow-wrap: anywhere; }
.es-qui__note { font-size: 12.5px; color: var(--texte-faible); overflow-wrap: anywhere; }
.es-badge { justify-self: start; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, transparent); }
.es-actions-ligne { display: inline-flex; gap: 8px; align-items: center; justify-content: flex-end; }
.es-voir { width: 36px; height: 36px; }
.es-vide { padding: 32px; text-align: center; color: var(--texte-attenue); }

/* ── Fenêtres (détail, création) ───────────────────────────────────────── */
.es-dialogue { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 48px); margin: auto; padding: 28px;
  border: 1px solid var(--bordure); border-radius: var(--rayon-grand); background: var(--panneau); color: var(--texte);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); overflow-y: auto; }
.es-dialogue::backdrop { background: rgba(9, 9, 11, .6); backdrop-filter: blur(4px); }
.es-dialogue__fermer { position: absolute; top: 14px; right: 14px; }
.es-dialogue__titre { padding-right: 44px; margin-bottom: 8px; font-size: 20px; font-weight: 700; color: var(--texte-vif); overflow-wrap: anywhere; }
.es-infos--dialogue { margin-top: 16px; }
.es-bloc { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--bordure); display: grid; gap: 12px; }
.es-bloc h3 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-faible); }
.es-bloc .es-actions { margin-top: 0; }
.es-bloc .bouton { justify-self: start; }
.es-bloc--danger p { font-size: 14px; color: var(--texte-attenue); }

/* ── Notification ──────────────────────────────────────────────────────── */
.es-toast { position: fixed; z-index: 100; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; border: 1px solid var(--bordure-forte);
  background: var(--panneau); color: var(--texte-vif); font-size: 14px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .45);
  overflow-wrap: anywhere; }
.es-toast--succes { border-color: var(--accent-ligne); }
.es-toast--erreur { border-color: color-mix(in srgb, var(--rouge) 45%, transparent); color: var(--rouge); }

.es-pied-admin { padding-block: 20px; }

/* ── Petits écrans ─────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .es-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  /* Le tableau devient une pile de cartes : une par compte. */
  .es-tableau thead { display: none; }
  .es-tableau, .es-tableau tbody, .es-tableau tr, .es-tableau td { display: block; width: 100%; }
  .es-tableau tr { padding: 14px 16px; border-bottom: 1px solid var(--bordure); }
  .es-tableau tbody tr:last-child { border-bottom: 0; }
  .es-tableau td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
  .es-tableau td::before { content: attr(data-label); flex: none; color: var(--texte-faible); font-size: 13px; text-align: left; }
  .es-tableau td:first-child { display: block; text-align: left; padding-bottom: 8px; }
  .es-tableau td:first-child::before { content: none; }
  .es-tableau tbody tr:hover td { background: none; }
  .es-col-actions { width: auto; }
  .es-tableau td.es-col-actions::before { content: none; }
  .es-tableau td.es-col-actions { justify-content: flex-start; padding-top: 10px; }
}
@media (max-width: 520px) {
  .es-carte, .es-dialogue { padding: 20px; }
  .es-infos > div { flex-direction: column; gap: 2px; }
  .es-infos dd { text-align: left; }
  .es-admin__boutons, .es-admin__boutons .bouton { width: 100%; }
  .es-admin__boutons .bouton { justify-content: center; }
  .es-outils select { flex: 1 1 100%; width: 100%; }
}
