/* =========================================================================
   STREXO — styles.css
   Thème : registre discret / encre lumineuse bleue dans le noir.
   Fraunces = voix (titres, montants, wordmark) — IBM Plex Sans = corps
   IBM Plex Mono = chiffres, identifiants, tout ce qui ressemble à un registre.
   ========================================================================= */

/* -------------------------------------------------------------------------
   0. RESET & TOKENS
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
img { max-width: 100%; display: block; }

:root {
  /* --- surfaces --- */
  --ink-950: #05080f;
  --ink-900: #0a0f1c;
  --ink-850: #0d1424;
  --ink-800: #121b30;
  --ink-750: #17223c;
  --ink-700: #1c2947;
  --line: rgba(148, 178, 235, 0.14);
  --line-soft: rgba(148, 178, 235, 0.08);

  /* --- electric blue ink --- */
  --blue-300: #8fc7ff;
  --blue-400: #5eb0ff;
  --blue-500: #2f8bff;
  --blue-600: #1868e0;
  --cyan-400: #5df1ff;
  --glow-soft: rgba(47, 139, 255, 0.28);
  --glow-strong: rgba(94, 176, 255, 0.55);
  --glow-cyan: rgba(93, 241, 255, 0.35);

  /* --- signal colors --- */
  --positive: #46e0a4;
  --positive-glow: rgba(70, 224, 164, 0.35);
  --negative: #ff6b7d;
  --negative-glow: rgba(255, 107, 125, 0.35);
  --warn: #ffb648;
  --warn-glow: rgba(255, 182, 72, 0.32);

  /* --- text --- */
  --text-hi: #eef4ff;
  --text-mid: #b7c4e0;
  --text-low: #7d8bab;
  --text-faint: #5a6684;

  /* --- type --- */
  --font-display: "Fraunces", "IBM Plex Sans", serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  /* --- shape / motion --- */
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 0.22s;

  --nav-w: 240px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

/* -------------------------------------------------------------------------
   1. BASE
   ------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(47, 139, 255, 0.16), transparent 60%),
    radial-gradient(900px 700px at 100% 0%, rgba(93, 241, 255, 0.08), transparent 55%),
    var(--ink-950);
  color: var(--text-hi);
  min-height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

::selection { background: var(--glow-soft); color: var(--text-hi); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--blue-600), var(--blue-400));
  border-radius: 10px;
  border: 2px solid var(--ink-950);
}

:focus-visible {
  outline: 2px solid var(--blue-400);
  outline-offset: 2px;
  border-radius: 6px;
}

.hidden { display: none !important; }

/* -------------------------------------------------------------------------
   2. APP SHELL / LAYOUT
   ------------------------------------------------------------------------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(78px + var(--safe-b));
}

.content {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 18px 40px;
  animation: viewIn 0.38s var(--ease);
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------
   3. LEDGER BAR (top status strip)
   ------------------------------------------------------------------------- */
.ledger-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  background: rgba(10, 15, 28, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(94, 176, 255, 0.06);
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 96px;
  padding: 12px 18px;
  border-radius: var(--radius-m);
  background: linear-gradient(160deg, var(--ink-800), var(--ink-850));
  border: 1px solid var(--line);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset, 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(148, 178, 235, 0.28); }

.stat-card-value {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--text-hi);
  line-height: 1;
}
.stat-card-value.is-accent {
  color: var(--cyan-400);
  text-shadow: 0 0 16px var(--glow-cyan);
}

.stat-card-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-low);
}

.ledger-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ledger-label {
  font-size: 11px;
  color: var(--text-low);
  letter-spacing: 0.02em;
}

.ledger-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-hi);
  overflow-wrap: anywhere;
}

.ledger-value-accent {
  color: var(--cyan-400);
  text-shadow: 0 0 16px var(--glow-cyan);
}

/* -------------------------------------------------------------------------
   4. BLOCK BANNER
   ------------------------------------------------------------------------- */
.block-banner {
  margin: 0;
  padding: 12px 20px;
  background: linear-gradient(90deg, rgba(255, 107, 125, 0.14), transparent);
  border-bottom: 1px solid rgba(255, 107, 125, 0.28);
  border-left: 3px solid var(--negative);
  color: #ffd6dc;
  font-size: 14px;
  animation: bannerDrop 0.35s var(--ease);
}
.block-banner strong { color: var(--negative); font-weight: 600; margin-right: 6px; }

@keyframes bannerDrop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------
   5. NAV — leaderboard-rail on desktop, dock on mobile
   ------------------------------------------------------------------------- */
.nav {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: rgba(9, 13, 24, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}

#main-nav-inner {
  justify-content: space-around;
  align-items: stretch;
}

.nav-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-low);
  transition: color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 16px;
  border-radius: 50%;
  transition: transform var(--speed) var(--ease), background var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease), color var(--speed) var(--ease);
}

.nav-item:hover { color: var(--text-mid); }
.nav-item:hover .nav-icon { transform: translateY(-2px); }
.nav-item:active .nav-icon { transform: scale(0.88); }

.nav-item.is-active { color: var(--blue-300); }
.nav-item.is-active .nav-icon {
  background: radial-gradient(circle, rgba(47, 139, 255, 0.28), transparent 70%);
  color: var(--cyan-400);
  box-shadow: 0 0 18px var(--glow-strong);
  transform: translateY(-2px);
}

.nav-item.is-active::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan-400);
  box-shadow: 0 0 10px var(--glow-cyan);
  animation: dotPop 0.3s var(--ease);
}

@keyframes dotPop {
  from { opacity: 0; transform: scale(0.3); }
  to { opacity: 1; transform: scale(1); }
}

/* -------------------------------------------------------------------------
   5b. ADMIN MENU (boutons de section, style identique au bouton Admin,
   empilés les uns en dessous des autres)
   ------------------------------------------------------------------------- */
.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.admin-menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(18, 27, 44, .55);
  color: var(--text-low);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color var(--speed) var(--ease), background var(--speed) var(--ease),
    border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.admin-menu-item .nav-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
}

.admin-menu-item:hover {
  color: var(--text-hi);
  background: rgba(125, 179, 255, .08);
  border-color: rgba(125, 179, 255, .2);
}

.admin-menu-item:active { transform: scale(0.98); }

.admin-menu-item.is-active {
  color: var(--cyan-400);
  background: rgba(76, 141, 245, .14);
  border-color: rgba(125, 179, 255, .3);
}

.admin-menu-item.is-active .nav-icon {
  background: radial-gradient(circle, rgba(47, 139, 255, 0.28), transparent 70%);
  color: var(--cyan-400);
  box-shadow: 0 0 18px var(--glow-strong);
}

.admin-menu-item .nav-badge {
  position: static;
  margin-left: auto;
  transform: none;
}

/* -------------------------------------------------------------------------
   6. ADMIN TABS (segmented control)
   ------------------------------------------------------------------------- */
.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.admin-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-tab {
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-low);
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s ease;
}

.admin-tab:hover {
  background: rgba(125, 179, 255, .08);
  color: var(--text-hi);
}

.admin-tab.is-active {
  background: rgba(76, 141, 245, .14);
  color: var(--text-hi);
  box-shadow: inset 2px 0 var(--blue-400);
}

.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  width: fit-content;
}

.admin-tab {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text-low);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--speed) var(--ease);
}

.admin-tab:hover { color: var(--text-mid); }

.admin-tab.is-active {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  color: #fff;
  box-shadow: 0 4px 18px var(--glow-soft);
}

/* -------------------------------------------------------------------------
   7. VIEW HEADS
   ------------------------------------------------------------------------- */
.view-head { margin-bottom: 14px; }
.view-head h2 { font-size: 20px; color: var(--text-hi); }
.view-head-spaced { margin-top: 34px; }
.view-sub { font-size: 13px; color: var(--text-low); margin-top: 4px; }

/* -------------------------------------------------------------------------
   8. LEDGER LIST / ROWS
   ------------------------------------------------------------------------- */
.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ledger-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 14px 16px;
  background: var(--ink-850);
  border: 1px solid var(--line-soft);
  border-left: 3px solid transparent;
  border-radius: var(--radius-m);
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease),
    background var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.ledger-row:hover {
  transform: translateX(4px);
  border-left-color: var(--blue-500);
  background: var(--ink-800);
  box-shadow: -6px 0 18px -8px var(--glow-soft);
}

.ledger-row-main { display: flex; flex-direction: column; gap: 3px; flex: 1 1 200px; min-width: 200px; }
.ledger-row-title { font-size: 14.5px; font-weight: 500; color: var(--text-hi); overflow-wrap: anywhere; }
.ledger-row-desc { font-size: 13px; color: var(--text-mid); overflow-wrap: anywhere; }
.ledger-row-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); overflow-wrap: anywhere; }

.ledger-row-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 10px;
  flex: 0 1 auto;
  margin-left: auto;
}

.ledger-price {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-hi);
}
.ledger-price.is-positive { color: var(--positive); text-shadow: 0 0 12px var(--positive-glow); }
.ledger-price.is-negative { color: var(--negative); text-shadow: 0 0 12px var(--negative-glow); }

.empty-state {
  padding: 26px 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13.5px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-m);
  background: rgba(255, 255, 255, 0.015);
}

/* -------------------------------------------------------------------------
   9. PILLS (status)
   ------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.pill-pending {
  color: var(--warn);
  background: rgba(255, 182, 72, 0.1);
  border-color: rgba(255, 182, 72, 0.28);
  box-shadow: 0 0 12px var(--warn-glow);
}
.pill-available {
  color: var(--positive);
  background: rgba(70, 224, 164, 0.1);
  border-color: rgba(70, 224, 164, 0.28);
  box-shadow: 0 0 12px var(--positive-glow);
}
.pill-taken {
  color: var(--blue-300);
  background: rgba(47, 139, 255, 0.12);
  border-color: rgba(47, 139, 255, 0.3);
  box-shadow: 0 0 12px var(--glow-soft);
}
.pill-blocked {
  color: var(--negative);
  background: rgba(255, 107, 125, 0.1);
  border-color: rgba(255, 107, 125, 0.28);
  box-shadow: 0 0 12px var(--negative-glow);
}

/* -------------------------------------------------------------------------
   10. BUTTONS
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
    background var(--speed) var(--ease), border-color var(--speed) var(--ease), opacity var(--speed) var(--ease);
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  color: #fff;
  box-shadow: 0 4px 20px var(--glow-soft);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 28px var(--glow-strong);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: rgba(94, 176, 255, 0.35);
  color: var(--blue-300);
}
.btn-outline:hover:not(:disabled) {
  background: rgba(47, 139, 255, 0.1);
  border-color: var(--blue-400);
  box-shadow: 0 0 16px var(--glow-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-hi);
}

.btn-danger {
  background: rgba(255, 107, 125, 0.12);
  border-color: rgba(255, 107, 125, 0.35);
  color: #ffb3bd;
}
.btn-danger:hover:not(:disabled) {
  background: rgba(255, 107, 125, 0.2);
  box-shadow: 0 0 16px var(--negative-glow);
}

.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------------------
   11. FORMS
   ------------------------------------------------------------------------- */
.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--ink-850);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-m);
}
.stacked-form label { font-size: 12.5px; color: var(--text-low); margin-top: 6px; }
.stacked-form label:first-child { margin-top: 0; }
.stacked-form button { margin-top: 10px; align-self: flex-start; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
.search-input {
  width: 100%;
  padding: 11px 13px;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--text-hi);
  font-size: 14px;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

input:focus, textarea:focus, .search-input:focus {
  outline: none;
  border-color: var(--blue-400);
  background: var(--ink-850);
  box-shadow: 0 0 0 3px var(--glow-soft);
}

textarea { resize: vertical; min-height: 72px; }

.search-input { margin-bottom: 14px; }

.input-with-btn { display: flex; gap: 8px; align-items: center; }
.input-with-btn input { flex: 1; }

/* -------------------------------------------------------------------------
   12. PRESET GRID (admin quick tasks)
   ------------------------------------------------------------------------- */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.preset-btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  padding: 14px;
  background: var(--ink-850);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-m);
  cursor: pointer;
  text-align: left;
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease);
}
.preset-btn:hover {
  transform: translateY(-3px);
  border-color: var(--blue-500);
  box-shadow: 0 10px 28px -12px var(--glow-strong);
}
.preset-btn:active { transform: translateY(-1px) scale(0.98); }

.preset-btn-title { font-size: 14px; font-weight: 500; color: var(--text-hi); }
.preset-btn-price { font-family: var(--font-mono); font-size: 12.5px; color: var(--cyan-400); }

/* -------------------------------------------------------------------------
   13. WALLET
   ------------------------------------------------------------------------- */
.wallet-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 34px 20px;
  margin-bottom: 16px;
  border-radius: var(--radius-l);
  background:
    radial-gradient(circle at 50% 0%, rgba(47, 139, 255, 0.18), transparent 60%),
    var(--ink-850);
  border: 1px solid var(--line);
  text-align: center;
}

.wallet-hero-label { font-size: 12.5px; color: var(--text-low); }

.wallet-hero-value {
  font-family: var(--font-display);
  font-size: clamp(34px, 9vw, 52px);
  font-weight: 600;
  color: var(--text-hi);
  text-shadow: 0 0 28px var(--glow-strong);
  animation: valuePulse 3.6s ease-in-out infinite;
  overflow-wrap: anywhere;
  max-width: 100%;
}

@keyframes valuePulse {
  0%, 100% { text-shadow: 0 0 22px var(--glow-strong); }
  50% { text-shadow: 0 0 40px var(--glow-cyan); }
}

.wallet-hero-unit { font-size: 12px; color: var(--text-faint); }

.wallet-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
}
.wallet-actions .btn { flex: 1; }

/* -------------------------------------------------------------------------
   14. PROFILE
   ------------------------------------------------------------------------- */
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(18, 27, 44, .72);
  margin-bottom: 20px;
  position: relative;
}

.profile-card-info {
  flex: 1;
}

.profile-avatar {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(76, 141, 245, 0.2);
  font-weight: 700;
  font-size: 18px;
  color: var(--blue-400);
}

.profile-avatar-lg {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(76, 141, 245, 0.2);
  font-weight: 700;
  font-size: 32px;
  color: var(--blue-400);
  margin: 20px auto;
}

.profile-settings-btn {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(23, 36, 58, .64);
  color: var(--text-mid);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s ease;
}

.profile-settings-btn:hover {
  border-color: rgba(125, 179, 255, .38);
  color: var(--text-hi);
  background: rgba(125, 179, 255, .1);
}

.profile-name { font-size: 16px; font-weight: 600; color: var(--text-hi); }
.profile-id { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

.setting-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(18, 27, 44, .72);
  gap: 10px;
  margin-bottom: 20px;
}

.setting-hint {
  font-size: 13px;
  color: var(--text-low);
}

.setting-block-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.profile-avatar-image,
.profile-avatar.profile-avatar-image,
.profile-avatar-lg.profile-avatar-image {
  object-fit: cover;
  background: rgba(18, 27, 44, .72);
}

/* -------------------------------------------------------------------------
   15. MODALS
   ------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(4, 7, 14, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: overlayIn 0.22s var(--ease);
}

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-top: 2px solid var(--blue-500);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: 0 -20px 60px -20px var(--glow-soft);
  animation: modalUp 0.32s var(--ease);
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal h3 { font-size: 18px; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--text-low); margin-bottom: 4px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.member-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.member-detail-row span:first-child { color: var(--text-low); }
.member-detail-row span:last-child { font-family: var(--font-mono); color: var(--text-hi); }

.member-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.transfer-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}

.transfer-result-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--ink-900);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-s);
  cursor: pointer;
  font-size: 13.5px;
  transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.transfer-result-item:hover {
  background: rgba(47, 139, 255, 0.1);
  border-color: var(--blue-500);
  transform: translateX(3px);
}

.transfer-selected {
  padding: 9px 12px;
  background: rgba(70, 224, 164, 0.1);
  border: 1px solid rgba(70, 224, 164, 0.3);
  border-radius: var(--radius-s);
  color: var(--positive);
  font-size: 13px;
  animation: dotPop 0.25s var(--ease);
}

/* -------------------------------------------------------------------------
   16. TOASTS
   ------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, 90vw);
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue-400);
  border-radius: var(--radius-s);
  font-size: 13.5px;
  color: var(--text-hi);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.3s var(--ease);
}
.toast.is-error {
  border-left-color: var(--negative);
  color: #ffd6dc;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* -------------------------------------------------------------------------
   16a-bis. ICÔNE CLINS — pastille affichée à côté des montants
   ------------------------------------------------------------------------- */
.coin-icon {
  width: 1em;
  height: 1em;
  min-width: 14px;
  min-height: 14px;
  object-fit: contain;
  vertical-align: -0.15em;
  margin-right: 0.28em;
  flex: 0 0 auto;
  display: inline-block;
}

/* -------------------------------------------------------------------------
   16b. LOGO "STREXO" — police graffiti/encre, PC uniquement pour le nav
   ------------------------------------------------------------------------- */
.logo-strexo {
  font-family: "Rubik Wet Paint", "Fraunces", serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-hi);
  text-shadow: 0 0 18px var(--glow-strong), 0 0 2px rgba(0,0,0,0.6);
  text-transform: uppercase;
  line-height: 1;
}

/* -------------------------------------------------------------------------
   16c. MESSAGERIE
   ------------------------------------------------------------------------- */
.nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--negative);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 8px var(--negative-glow);
}

.msg-form { display: flex; gap: 10px; align-items: flex-end; }
.msg-form textarea {
  flex: 1;
  resize: vertical;
  padding: 10px 12px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--ink-900);
  color: var(--text-hi);
}

.code-pill {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 6px 12px;
  border-radius: var(--radius-s);
  background: rgba(93, 241, 255, 0.12);
  border: 1px solid rgba(93, 241, 255, 0.3);
  color: var(--cyan-400);
}

.login-step-hint {
  font-size: 12.5px;
  color: var(--text-mid);
  line-height: 1.5;
  margin: 0 0 4px;
}

/* -------------------------------------------------------------------------
   17. LOGIN SCREEN
   ------------------------------------------------------------------------- */
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: var(--ink-950);
}

.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: 0;
}
.login-screen::before {
  background: var(--blue-600);
  top: -180px;
  left: -160px;
  animation: blobFloat 14s ease-in-out infinite;
}
.login-screen::after {
  background: var(--cyan-400);
  bottom: -200px;
  right: -160px;
  animation: blobFloat 16s ease-in-out infinite reverse;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.1); }
}

.login-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: 1fr;
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(10, 15, 28, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.7);
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  padding: 40px 34px;
  background: linear-gradient(160deg, rgba(47, 139, 255, 0.16), transparent 60%);
  border-bottom: 1px solid var(--line);
}

.login-brand-inner { display: flex; flex-direction: column; gap: 14px; }

.login-brand-glyph {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--blue-400);
  box-shadow: 0 0 22px var(--glow-strong), inset 0 0 12px var(--glow-cyan);
  position: relative;
}
.login-brand-glyph::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--cyan-400);
  box-shadow: 0 0 16px var(--glow-cyan);
}

.login-wordmark { font-size: 30px; color: var(--text-hi); }
.login-tagline { font-size: 14px; color: var(--text-mid); max-width: 34ch; line-height: 1.6; }
.login-brand-foot { font-size: 12px; color: var(--text-faint); max-width: 32ch; }

.login-panel { padding: 40px 34px; }
.login-panel-inner { display: flex; flex-direction: column; gap: 16px; }

.login-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}

.login-toggle-btn {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text-low);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--speed) var(--ease);
}
.login-toggle-btn.is-active {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  color: #fff;
  box-shadow: 0 4px 16px var(--glow-soft);
}

.login-error {
  padding: 10px 12px;
  font-size: 13px;
  color: #ffd6dc;
  background: rgba(255, 107, 125, 0.1);
  border: 1px solid rgba(255, 107, 125, 0.3);
  border-radius: var(--radius-s);
}

.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-form label { font-size: 12.5px; color: var(--text-low); }
.login-form button { margin-top: 8px; }

.login-panel-foot { font-size: 11.5px; color: var(--text-faint); text-align: center; margin-top: 4px; }

/* -------------------------------------------------------------------------
   18. RESPONSIVE — DESKTOP: sidebar leaderboard rail
   ------------------------------------------------------------------------- */
@media (min-width: 861px) {
  .app {
    padding-bottom: 0;
    padding-left: var(--nav-w);
  }

  .content { max-width: 860px; padding: 32px 40px 56px; }

  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    bottom: 0;
    width: var(--nav-w);
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    border-top: none;
    border-right: 1px solid var(--line);
    padding: 26px 14px;
  }

  #main-nav-inner {
    flex-direction: column;
    gap: 4px;
    justify-content: flex-start;
    width: 100%;
  }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-m);
    font-size: 14px;
    border-left: 3px solid transparent;
  }

  .nav-item:hover {
    background: rgba(47, 139, 255, 0.08);
    transform: translateX(6px);
  }
  .nav-item:hover .nav-icon { transform: none; }
  .nav-item:active { transform: translateX(3px) scale(0.98); }

  .nav-item.is-active {
    background: linear-gradient(90deg, rgba(47, 139, 255, 0.18), transparent);
    border-left-color: var(--cyan-400);
  }
  .nav-item.is-active .nav-icon { transform: none; }
  .nav-item.is-active::after {
    top: 50%;
    left: auto;
    right: 12px;
    transform: translateY(-50%);
  }

  .modal-overlay { align-items: center; }
  .modal {
    border-radius: var(--radius-l);
    border-top: 1px solid var(--line);
    border-left: 2px solid var(--blue-500);
    animation: modalPop 0.28s var(--ease);
  }
  @keyframes modalPop {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .login-frame { grid-template-columns: 1fr 1fr; }
  .login-brand { border-bottom: none; border-right: 1px solid var(--line); }
}

/* -------------------------------------------------------------------------
   19. SMALL PHONES
   ------------------------------------------------------------------------- */
@media (max-width: 380px) {
  .nav-item { font-size: 10px; }
  .wallet-hero-value { font-size: 42px; }
  .ledger-bar { gap: 14px; padding: 12px 14px; }
}

/* -------------------------------------------------------------------------
   20. ÉCRAN DE CHARGEMENT INITIAL (anti-flash)
   ------------------------------------------------------------------------- */
.app-loading {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-950);
}
.app-loading .loader-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--cyan-400);
  animation: loaderSpin 0.8s linear infinite;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------------------
   21. REFRESH — calm glass dashboard / mobile-first navigation
   ------------------------------------------------------------------------- */
:root {
  --ink-950: #070b14;
  --ink-900: #0d1422;
  --ink-850: #111a2b;
  --ink-800: #172338;
  --ink-750: #1d2d47;
  --line: rgba(164, 190, 228, 0.16);
  --line-soft: rgba(164, 190, 228, 0.1);
  --blue-300: #b8d8ff;
  --blue-400: #7eb9ff;
  --blue-500: #4f96f7;
  --blue-600: #3475d5;
  --cyan-400: #8bdcff;
  --glow-soft: rgba(79, 150, 247, 0.24);
  --glow-strong: rgba(126, 185, 255, 0.4);
  --glow-cyan: rgba(139, 220, 255, 0.24);
  --text-hi: #f4f8ff;
  --text-mid: #b5c3d9;
  --text-low: #8292aa;
  --text-faint: #5f6e86;
  --radius-s: 12px;
  --radius-m: 18px;
  --radius-l: 26px;
}

html { background: var(--ink-950); }
body {
  background: radial-gradient(900px 480px at 50% -12%, rgba(79,150,247,.16), transparent 70%), var(--ink-950);
}
.app { padding-bottom: calc(86px + var(--safe-b)); }
.content { padding: 24px 16px 42px; }
.ledger-bar {
  justify-content: flex-start;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding: 12px 16px;
  scrollbar-width: none;
  background: rgba(7, 11, 20, .78);
}
.ledger-bar::-webkit-scrollbar { display: none; }
.stat-card { min-width: 92px; padding: 10px 14px; }
.nav { background: rgba(13,20,34,.9); box-shadow: 0 -12px 30px rgba(0,0,0,.22); }
.nav-item { min-height: 64px; }
.nav-icon { width: 30px; height: 30px; }
.nav-item.is-active { font-weight: 600; }
.nav-item.is-active .nav-icon { background: rgba(79,150,247,.16); }
.ledger-row { padding: 15px; border-radius: var(--radius-m); }
.ledger-row:hover { transform: translateY(-2px); }
.btn { min-height: 44px; }
.modal { width: min(100% - 24px, 560px); max-height: min(86vh, 760px); overflow-y: auto; }
.login-screen { padding: 14px; overflow-y: auto; }
.login-frame { border-radius: var(--radius-l); }
.login-brand {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 20px;
  min-height: 0;
  gap: 10px;
}
.login-brand-inner { flex-direction: row; align-items: center; gap: 8px; }
.login-wordmark { font-size: 18px; }
.login-tagline { display: none; }
.login-panel { padding: 16px 20px; }
.login-panel-inner { gap: 10px; }
.login-panel-heading { margin-bottom: 12px; }
.login-panel-heading h2 { font-size: 22px; }
.login-panel-foot { display: none; }
.login-step-hint { font-size: 11.5px; line-height: 1.35; margin-bottom: 2px; }
.login-toggle-btn { min-height: 38px; }
.login-form { gap: 6px; }
.login-form input { min-height: 42px; }
.login-form button { margin-top: 4px; }

@media (min-width: 861px) {
  .app { padding-bottom: 0; }
  .content { max-width: 980px; padding: 40px 52px 64px; }
  .ledger-bar { padding: 14px 32px; }
  .nav { padding: 28px 16px; }
  .nav-item { min-height: 48px; }

  .login-brand { flex-direction: column; justify-content: space-between; padding: 40px 34px; min-height: initial; gap: 30px; }
  .login-brand-inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .login-wordmark { font-size: 30px; }
  .login-tagline { display: block; }
  .login-panel { padding: 40px 34px; }
  .login-panel-inner { gap: 16px; }
  .login-panel-heading { margin-bottom: 26px; }
  .login-panel-heading h2 { font-size: clamp(25px, 3vw, 32px); }
  .login-panel-foot { display: block; }
  .login-step-hint { font-size: 12.5px; line-height: 1.5; margin-bottom: 4px; }
  .login-toggle-btn { min-height: 42px; }
  .login-form { gap: 8px; }
  .login-form input { min-height: 46px; }
  .login-form button { margin-top: 8px; }
}

@media (max-width: 520px) {
  .content { padding-inline: 12px; }
  .view-head h2 { font-size: 22px; }
  .ledger-row-main { min-width: 0; flex-basis: 100%; }
  .ledger-row-side { width: 100%; justify-content: space-between; margin-left: 0; }
  .btn { flex: 1; }
  .btn-block { width: 100%; }
  .admin-tabs { width: 100%; overflow-x: auto; }
  .admin-tab { flex: 1 0 auto; }
  .msg-form { flex-direction: column; align-items: stretch; }
  .msg-form .btn { width: 100%; }
}

@media (max-width: 380px) {
  .nav-item { padding-inline: 2px; }
  .nav-icon { width: 27px; height: 27px; }
  .content { padding-inline: 10px; }
}

@media (max-width: 768px) {
  .btn { flex: 1; }
  .btn-block { width: 100%; }
  .admin-tabs { width: 100%; overflow-x: auto; display: flex; flex-direction: row; }
  .admin-sidebar { display: none; }
  .msg-form { flex-direction: row; align-items: flex-end; gap: 8px; }
  .msg-form textarea { flex: 1; }
  .msg-form .btn { flex: 0 0 auto; width: auto; min-width: 72px; padding-inline: 12px; }
}

/* -------------------------------------------------------------------------
   23. 2026 PRODUCT SYSTEM — clean, layered, official-grade UI
   ------------------------------------------------------------------------- */
:root {
  --ink-950: #080d18;
  --ink-900: #0d1422;
  --ink-850: #121b2c;
  --ink-800: #17243a;
  --line: rgba(185, 204, 234, .14);
  --line-soft: rgba(185, 204, 234, .08);
  --blue-400: #7db3ff;
  --blue-500: #4c8df5;
  --blue-600: #316fd3;
  --cyan-400: #8bdcff;
  --text-hi: #f6f9ff;
  --text-mid: #afbdd1;
  --text-low: #77869f;
  --text-faint: #56647c;
  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;
}

* { box-sizing: border-box; }
body { background: #080d18; color: var(--text-hi); letter-spacing: -.008em; }
button, input, textarea, select { font: inherit; }
button { transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue-400); outline-offset: 2px; }

.login-screen { background: radial-gradient(700px 480px at 50% 0%, rgba(76,141,245,.17), transparent 70%), #080d18; }
.login-frame { border: 1px solid var(--line); border-radius: 20px; background: rgba(13,20,34,.84); box-shadow: 0 30px 80px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.05); overflow: hidden; }
.login-brand { background: linear-gradient(145deg, rgba(23,36,58,.95), rgba(13,20,34,.92)); }
.login-panel { background: rgba(13,20,34,.96); }
.login-wordmark { letter-spacing: -.06em; }
.login-subtitle, .login-help, .form-label { color: var(--text-mid); }
.login-form input, .login-form select { border: 1px solid var(--line); border-radius: 10px; background: rgba(8,13,24,.72); color: var(--text-hi); }
.login-form input:hover { border-color: rgba(126,185,255,.35); }
.login-form input:focus { border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(76,141,245,.14); }

.app { background: #080d18; }
.topbar { min-height: 62px; border-bottom: 1px solid var(--line-soft); background: rgba(8,13,24,.86); backdrop-filter: blur(18px); }
.nav { border-right: 1px solid var(--line-soft); background: #0b1220; }
.nav-item { color: var(--text-low); border-radius: 10px; }
.nav-item:hover { color: var(--text-hi); background: rgba(125,179,255,.08); }
.nav-item.is-active { color: var(--text-hi); background: rgba(76,141,245,.14); box-shadow: inset 2px 0 var(--blue-400); }
.content { background: radial-gradient(650px 360px at 50% -10%, rgba(76,141,245,.09), transparent 70%); }
.view-head h2 { letter-spacing: -.045em; }
.view-head p, .muted, .stat-card-label { color: var(--text-low); }

.ledger-bar { border-bottom: 1px solid var(--line-soft); background: rgba(11,18,32,.82); backdrop-filter: blur(16px); }
.stat-card { border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(23,36,58,.58); box-shadow: inset 0 1px rgba(255,255,255,.04); }
.stat-card-value { color: var(--text-hi); font-variant-numeric: tabular-nums; }
.ledger-row { border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(18,27,44,.72); box-shadow: 0 12px 26px rgba(0,0,0,.12); }
.ledger-row:hover { border-color: rgba(125,179,255,.3); background: rgba(23,36,58,.8); }
.btn { border-radius: 9px; font-weight: 650; }
.btn-primary { background: var(--blue-500); color: #fff; box-shadow: 0 7px 18px rgba(76,141,245,.22); }
.btn-primary:hover { background: #5d9afb; transform: translateY(-1px); box-shadow: 0 9px 22px rgba(76,141,245,.32); }
.btn-secondary, .btn-ghost { border: 1px solid var(--line); background: rgba(23,36,58,.64); color: var(--text-mid); }
.btn-secondary:hover, .btn-ghost:hover { border-color: rgba(125,179,255,.38); color: var(--text-hi); background: rgba(125,179,255,.1); }

.msg-thread { border: 1px solid var(--line-soft); border-radius: 16px; background: rgba(13,20,34,.58); box-shadow: inset 0 1px rgba(255,255,255,.035); }
.msg-bubble { border: 1px solid var(--line-soft); border-radius: 14px; }
.msg-bubble.is-own { background: rgba(49,111,211,.82); border-color: rgba(125,179,255,.24); }
.msg-form { border-top: 1px solid var(--line-soft); }
.msg-form textarea { border: 1px solid var(--line); border-radius: 10px; background: rgba(8,13,24,.72); color: var(--text-hi); }

/* -------------------------------------------------------------------------
   24. STRUCTURE — signature Strexo, moins template, plus produit
   ------------------------------------------------------------------------- */
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; transform: translateY(-150%); padding: 9px 13px; border-radius: 8px; background: var(--blue-500); color: #fff; font-size: 13px; font-weight: 600; }
.skip-link:focus { transform: translateY(0); }
.login-eyebrow { margin: 0; color: var(--blue-400); font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.login-brand-inner { position: relative; }
.login-highlights { display: grid; gap: 9px; margin-top: 28px; color: var(--text-mid); font-size: 13px; }
.login-highlights span { display: flex; align-items: center; gap: 9px; }
.login-highlights i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #65d29b; box-shadow: 0 0 0 4px rgba(101,210,155,.1); }
.login-brand-foot { display: flex; align-items: center; gap: 10px; }
.login-brand-foot span { color: var(--blue-400); font-family: var(--font-mono); font-size: 10px; }
.login-panel-heading h2 { margin: 8px 0 5px; color: var(--text-hi); letter-spacing: -.055em; }
.login-panel-heading p:last-child { margin: 0; color: var(--text-low); font-size: 13px; }
/* En-tête unique : logo + "Strexo", identique en haut sur PC et mobile. */
.app-header { display: flex; align-items: center; justify-content: center; min-height: 58px; padding: 0 28px; border-bottom: 1px solid var(--line-soft); background: rgba(8,13,24,.88); }
.app-header-brand { display: flex; align-items: center; gap: 10px; }
.app-header-logo { width: 28px; height: 28px; flex: 0 0 28px; object-fit: cover; object-position: 50% 82%; border-radius: 9px; border: 1px solid rgba(184,216,255,.3); box-shadow: 0 0 16px rgba(126,185,255,.2); }
.app-header-name { color: var(--text-hi); font-size: 17px; }

@media (max-width: 860px) {
  .app-header { min-height: 54px; padding: 0 14px; }
}

/* Final responsive fixes */
.login-logo-art {
  display: none;
  width: 86px;
  height: 86px;
  object-fit: cover;
  object-position: 50% 82%;
  border: 1px solid rgba(184, 216, 255, .28);
  border-radius: 22px;
  box-shadow: 0 16px 34px rgba(0,0,0,.34), 0 0 24px rgba(126,185,255,.2);
}

@media (min-width: 861px) {
  .login-logo-art { display: block; }
}

@media (max-width: 860px) {
  .login-logo-art { display: none; }
  .content:has(.msg-thread) { padding-bottom: 16px; }
  .content:has(.msg-thread) .msg-form {
    position: relative;
    z-index: 5;
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-direction: row;
    margin-bottom: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(13,20,34,.96);
    box-shadow: 0 8px 22px rgba(0,0,0,.28);
  }
  .content:has(.msg-thread) .msg-form textarea {
    flex: 1;
    min-height: 44px;
    max-height: 74px;
    resize: none;
    padding: 10px 11px;
  }
  .content:has(.msg-thread) .msg-form .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    min-width: 72px;
    height: 44px;
    padding: 8px 12px;
  }
}

/* -------------------------------------------------------------------------
   22. SIGNATURE — interface compacte, éditoriale et verrouillée sur mobile
   ------------------------------------------------------------------------- */
.logo-strexo,
.login-wordmark {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.045em;
  text-transform: none;
}

.ledger-bar {
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 11, 20, .9);
}
.stat-card {
  min-width: 108px;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(23,35,56,.72), rgba(13,20,34,.7));
  box-shadow: inset 0 1px rgba(255,255,255,.045);
}
.stat-card-value { font-size: 18px; line-height: 1.15; }
.stat-card-label { margin-top: 3px; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.ledger-row {
  border: 1px solid var(--line-soft);
  border-left: 1px solid rgba(126,185,255,.28);
  background: linear-gradient(135deg, rgba(23,35,56,.72), rgba(13,20,34,.72));
  box-shadow: 0 14px 30px rgba(0,0,0,.12);
}
.ledger-row-side { gap: 12px; }
.ledger-price { color: var(--cyan-400); font-size: 15px; }
.btn-sm[data-take] { width: auto; min-width: 70px; padding: 7px 12px; }
.btn-primary { box-shadow: 0 8px 20px rgba(52,117,213,.18); }

.msg-thread {
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: rgba(13,20,34,.58);
  box-shadow: inset 0 1px rgba(255,255,255,.035);
}
.msg-bubble { max-width: min(78%, 520px); border-radius: 17px; }
.msg-text { font-size: clamp(13px, 3.5vw, 14px); line-height: 1.5; }
.msg-form textarea { min-height: 46px; max-height: 112px; font-size: 14px; }

@media (max-width: 860px) {
  html, body {
    height: 100%;
    overflow-x: hidden;
  }
  .app {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding-bottom: calc(86px + var(--safe-b));
  }
  .app-header, .ledger-bar, #block-banner-slot { flex: 0 0 auto; }
  .content {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 16px;
  }

  /* Conversation mobile : le conteneur reste fixe entre le haut et la nav.
     Seule la liste des messages défile. */
  .content:has(.msg-thread) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    height: 100%;
    padding: 0 12px 10px;
  }
  .content:has(.msg-thread) > #content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }
  .content:has(.msg-thread) .conversation-page {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }
  .content:has(.msg-thread) .conversation-toolbar,
  .content:has(.msg-thread) .conversation-banner,
  .content:has(.msg-thread) .conversation-request-actions,
  .content:has(.msg-thread) .msg-form {
    flex: 0 0 auto;
  }
  .content:has(.msg-thread) .msg-thread {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }
  .content:has(.msg-thread) .msg-form {
    flex: 0 0 auto;
    padding-top: 10px;
    padding-bottom: max(4px, var(--safe-b));
  }
  .nav {
    position: fixed;
    z-index: 30;
    right: 10px;
    bottom: calc(10px + var(--safe-b));
    left: 10px;
    width: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(13,20,34,.94);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 34px rgba(0,0,0,.35);
  }
  .nav-item { min-height: 56px; border-radius: 13px; }
  .nav-item.is-active { background: rgba(79,150,247,.13); }
  .nav-item.is-active::after { display: none; }
  
  .admin-sidebar { display: none !important; }
}

@media (min-width: 861px) {
  .content:has(.msg-thread) {
    max-height: none;
    overflow-y: visible;
  }
  .content:has(.msg-thread) .msg-thread {
    max-height: 52vh;
    overflow-y: auto;
  }
  
  .admin-sidebar {
    display: flex;
    flex-direction: column;
    width: 200px;
    padding: 20px;
    border-right: 1px solid var(--line-soft);
    background: rgba(7, 11, 20, .9);
    position: sticky;
    top: 0;
    height: calc(100dvh - 155px);
    overflow-y: auto;
  }
  
  .admin-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }
  
  .admin-tab {
    text-align: left;
    padding: 12px 14px;
    border-radius: 10px;
    background: transparent;
    color: var(--text-low);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all .18s ease;
  }
  
  .admin-tab:hover {
    background: rgba(125, 179, 255, .08);
    color: var(--text-hi);
  }
  
  .admin-tab.is-active {
    background: rgba(76, 141, 245, .14);
    color: var(--text-hi);
    box-shadow: inset 2px 0 var(--blue-400);
  }
  
  #content-shell {
    display: flex;
  }
  
  #admin-tabs-slot {
    flex: 0 0 auto;
  }
  
  #content {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .ledger-bar { gap: 7px; padding: 9px 10px; }
  .stat-card { min-width: 0; flex: 1; padding: 9px 5px; }
  .stat-card-value { font-size: 16px; }
  .stat-card-label { font-size: 8px; letter-spacing: .08em; }
  .content { padding: 17px 12px 18px; }
  .view-head { margin-bottom: 12px; }
  .view-head h2 { font-size: 23px; }
  .ledger-row { padding: 14px; }
  .ledger-row-side { margin-top: 10px; }
  .btn-sm[data-take] { min-width: 62px; padding: 6px 10px; }
  .msg-thread { border-radius: 16px; padding: 12px; }
  .msg-bubble { max-width: 88%; padding: 9px 11px; }
  .msg-form { gap: 7px; flex-direction: row; }
  .msg-form textarea { flex: 1; }
  .msg-form .btn { flex: 0 0 auto; width: auto; min-width: 64px; padding-inline: 10px; }
  .profile-card { flex-direction: column; text-align: center; gap: 12px; }
  .profile-settings-btn { position: absolute; top: 10px; right: 10px; }
  .profile-card-info { order: -1; }
}

.view-head-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(23, 36, 58, .64);
  color: var(--text-mid);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition:
    border-color var(--speed) var(--ease),
    background var(--speed) var(--ease),
    color var(--speed) var(--ease),
    transform var(--speed) var(--ease);
}

.history-clear-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-clear-btn:hover {
  border-color: rgba(255, 107, 125, .38);
  background: rgba(255, 107, 125, .08);
  color: #ffb2bd;
  transform: translateY(-1px);
}

@media (max-width: 520px) {
  .view-head-action {
    flex-wrap: nowrap;
  }

  .view-head-action h2 {
    min-width: 0;
    flex: 1 1 auto;
  }

  .history-clear-btn {
    margin-left: auto;
    white-space: nowrap;
    padding: 7px 9px;
  }

  .history-clear-btn span {
    display: inline;
  }
}

@media (min-width: 861px) {
  .admin-nav-sections {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .admin-nav-bottom {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
  }

  #main-nav-inner {
    height: 100%;
    display: flex !important;
    flex-direction: column;
  }

  .admin-nav-bottom .nav-item {
    flex: 0 0 auto;
  }
}

/* Écran de maintenance */
.maintenance-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
  background: var(--bg, #f5f2ec);
}
.maintenance-card {
  width: min(560px, 100%);
  text-align: center;
  padding: 48px 28px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  background: var(--surface, #fff);
  box-shadow: 0 18px 60px rgba(0,0,0,.08);
}
.maintenance-mark {
  font-size: 42px;
  margin-bottom: 18px;
}
.maintenance-card h1 {
  margin: 0 0 14px;
  letter-spacing: .08em;
}
.maintenance-card p {
  margin: 0;
  font-size: 18px;
}
.maintenance-card .maintenance-subtitle {
  margin-top: 8px;
  font-size: 15px;
  opacity: .65;
}


/* -------------------------------------------------------------------------
   26. MESSAGERIE — style type Google Messages, sans séparateurs
   ------------------------------------------------------------------------- */
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 18px;
}

.chat-section-label {
  margin: 20px 2px 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.chat-list-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 11px 2px 11px 4px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.chat-list-row:hover,
.chat-list-row:focus-visible {
  background: rgba(93, 145, 220, .08);
  transform: none;
}

.chat-list-row.is-request { padding-top: 9px; padding-bottom: 9px; }

.chat-avatar {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(47, 139, 255, .24), rgba(93, 241, 255, .12));
  border: 1px solid rgba(125, 179, 255, .18);
  color: var(--blue-300);
  font-size: 16px;
  font-weight: 700;
  user-select: none;
}

img.chat-avatar { object-fit: cover; }

.chat-list-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-list-name-line {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 7px;
  padding-right: 30px;
}

.chat-list-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 650;
  color: var(--text-hi);
}

.chat-list-username {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-faint);
}

.chat-list-preview {
  min-width: 0;
  padding-right: 30px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-low);
}

.chat-list-preview.is-unread {
  color: var(--text-mid);
  font-weight: 600;
}

.chat-list-side {
  flex: 0 0 auto;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-top: 1px;
  padding-right: 34px;
}

.chat-list-time {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.chat-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-400);
  box-shadow: 0 0 10px var(--glow-soft);
}

.chat-more-btn {
  position: absolute;
  top: 8px;
  right: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-faint);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: .72;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease), opacity var(--speed) var(--ease);
}

.chat-list-row:hover .chat-more-btn,
.chat-more-btn:focus-visible,
.conversation-more { opacity: 1; }
.chat-more-btn:hover {
  color: var(--text-hi);
  background: rgba(125, 179, 255, .1);
}

.chat-request-label {
  font-size: 10px;
  color: var(--blue-300);
  white-space: nowrap;
}

.chat-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-search-result .chat-avatar { width: 34px; height: 34px; flex-basis: 34px; font-size: 12px; }
.chat-search-name { flex: 1; min-width: 0; font-weight: 600; color: var(--text-hi); }

.conversation-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}
.conversation-avatar { width: 42px; height: 42px; flex-basis: 42px; }
.conversation-head-copy { min-width: 0; flex: 1; }
.conversation-more { position: static; flex: 0 0 34px; width: 34px; height: 34px; }

.msg-row {
  align-items: flex-end;
  gap: 7px;
}
.msg-row .chat-avatar {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  font-size: 11px;
  margin-bottom: 3px;
}
.msg-row.is-other .msg-bubble { max-width: calc(78% - 37px); }

@media (max-width: 520px) {
  .chat-list-row { gap: 10px; padding-inline: 1px; }
  .chat-avatar { width: 42px; height: 42px; flex-basis: 42px; }
  .chat-list-side { padding-right: 30px; }
  .chat-list-name-line { padding-right: 20px; }
  .chat-list-preview { padding-right: 20px; }
  .chat-more-btn { right: -2px; }
  .msg-row.is-other .msg-bubble { max-width: calc(88% - 37px); }
}

/* Maintenance cohérente avec le thème du site */
.maintenance-screen {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(850px 620px at 50% 22%, rgba(47, 139, 255, .20), transparent 62%),
    radial-gradient(600px 500px at 10% 100%, rgba(93, 241, 255, .08), transparent 60%),
    var(--ink-950);
}

.maintenance-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148,178,235,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(148,178,235,.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 76%);
  pointer-events: none;
}

.maintenance-card {
  position: relative;
  z-index: 1;
  width: min(590px, 100%);
  padding: 52px 34px 42px;
  text-align: center;
  border: 1px solid rgba(125, 179, 255, .18);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(18, 27, 48, .88), rgba(10, 15, 28, .90));
  box-shadow: 0 30px 90px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.045), 0 0 0 1px rgba(47,139,255,.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.maintenance-eyebrow {
  margin-bottom: 20px;
  color: var(--cyan-400);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.maintenance-mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: var(--blue-300);
  background: linear-gradient(145deg, rgba(47,139,255,.18), rgba(93,241,255,.08));
  border: 1px solid rgba(125,179,255,.22);
  box-shadow: 0 0 36px rgba(47,139,255,.18);
  font-size: 35px;
}

.maintenance-card h1 {
  margin-bottom: 12px;
  color: var(--text-hi);
  font-size: clamp(28px, 6vw, 42px);
  letter-spacing: .12em;
}

.maintenance-card p:not(.maintenance-eyebrow) {
  color: var(--text-mid);
  font-size: 17px;
  line-height: 1.65;
}

.maintenance-card .maintenance-subtitle {
  max-width: 430px;
  margin: 8px auto 0;
  color: var(--text-low);
  font-size: 14px;
}

.maintenance-orbit {
  position: absolute;
  z-index: 0;
  width: min(760px, 92vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(94,176,255,.08);
  box-shadow: inset 0 0 70px rgba(47,139,255,.05), 0 0 80px rgba(47,139,255,.06);
  pointer-events: none;
}
.maintenance-orbit::before,
.maintenance-orbit::after,
.maintenance-orbit span,
.maintenance-orbit i {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.maintenance-orbit::before { width: 70%; height: 70%; border: 1px solid rgba(94,176,255,.06); }
.maintenance-orbit::after { width: 40%; height: 40%; border: 1px solid rgba(93,241,255,.06); }
.maintenance-orbit span { width: 8px; height: 8px; background: var(--blue-400); box-shadow: 0 0 18px var(--glow-strong); transform: translate(-50%, -50%) translateX(315px); }
.maintenance-orbit i { width: 5px; height: 5px; background: var(--cyan-400); box-shadow: 0 0 16px var(--glow-cyan); transform: translate(-50%, -50%) translateX(-245px); }

@media (max-width: 620px) {
  .maintenance-card { padding: 38px 22px 32px; }
  .maintenance-orbit { width: 620px; opacity: .75; }
  .maintenance-orbit span { transform: translate(-50%, -50%) translateX(250px); }
  .maintenance-orbit i { transform: translate(-50%, -50%) translateX(-205px); }
}


/* -------------------------------------------------------------------------
   27. MESSAGERIE — refonte façon Messenger, adaptée au thème Strexo
   ------------------------------------------------------------------------- */
.messages-page-head {
  align-items: center;
  gap: 16px;
}
.messages-page-subtitle {
  margin-top: 3px;
}
.messages-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.messages-new-btn {
  white-space: nowrap;
}

.chat-requests-btn {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(11, 18, 32, .70);
  color: var(--text-mid);
  cursor: pointer;
  transition: transform .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.chat-requests-btn svg { width: 19px; height: 19px; }
.chat-requests-btn:hover,
.chat-requests-btn:focus-visible {
  color: var(--text-hi);
  border-color: rgba(125, 179, 255, .28);
  background: rgba(47, 139, 255, .10);
  transform: translateY(-1px);
}
.chat-request-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--negative);
  color: #fff;
  border: 2px solid var(--ink-950);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(0,0,0,.25);
}

.nav-icon { position: relative; }
.nav-badge-friends {
  top: auto;
  right: -10px;
  bottom: -5px;
  background: var(--negative);
  transform: scale(.88);
}

.friend-requests-modal {
  width: min(620px, 100%);
  max-height: min(78vh, 690px);
}
.friend-requests-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
}
.friend-requests-head .chat-more-btn {
  position: static;
  flex: 0 0 34px;
  opacity: 1;
}
.friend-requests-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 18px;
  max-height: 56vh;
  overflow-y: auto;
}
.friend-request-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border-radius: 15px;
  border: 1px solid var(--line-soft);
  background: rgba(10, 16, 29, .72);
}
.friend-request-avatar {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}
.friend-request-main { min-width: 0; }
.friend-request-name {
  color: var(--text-hi);
  font-size: 14px;
  font-weight: 700;
}
.friend-request-id {
  margin-top: 1px;
  color: var(--text-faint);
  font-size: 11px;
}
.friend-request-preview {
  margin-top: 7px;
  color: var(--text-low);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friend-request-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.friend-requests-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-low);
}
.friend-requests-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(70, 224, 164, .10);
  border: 1px solid rgba(70, 224, 164, .18);
  color: var(--positive);
  font-size: 18px;
}
.friend-requests-empty strong,
.friend-requests-empty span { display: block; }
.friend-requests-empty strong { color: var(--text-hi); }
.friend-requests-empty span { margin-top: 4px; font-size: 12px; }

/* conversations */
.conversation-page {
  display: flex;
  flex-direction: column;
  min-height: min(72vh, 720px);
}
.conversation-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.conversation-back-btn {
  flex: 0 0 auto;
}
.conversation-head {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 9px 4px;
  border-radius: 14px;
  background: rgba(11,18,32,.44);
}
.conversation-name {
  color: var(--text-hi);
  font-size: 15px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-id {
  margin-top: 2px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-banner {
  margin: 4px 0 9px;
}
.conversation-request-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.msg-thread {
  flex: 1 1 auto;
  min-height: 330px;
  max-height: none;
  padding: 18px 12px 20px;
  border: 1px solid rgba(125,179,255,.10);
  border-radius: 20px;
  background:
    radial-gradient(560px 260px at 50% 0%, rgba(47,139,255,.055), transparent 65%),
    rgba(7, 12, 22, .62);
  box-shadow: inset 0 1px rgba(255,255,255,.025);
  overflow-y: auto;
}
.msg-thread.is-loading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-direction: column;
}
.message-loading {
  width: min(100%, 520px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.message-loading span {
  height: 38px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(125,179,255,.05), rgba(125,179,255,.13), rgba(125,179,255,.05));
  background-size: 200% 100%;
  animation: messageShimmer 1.25s linear infinite;
}
.message-loading span:nth-child(1) { width: 44%; align-self: flex-start; }
.message-loading span:nth-child(2) { width: 62%; align-self: flex-end; }
.message-loading span:nth-child(3) { width: 34%; align-self: flex-start; }

@keyframes messageShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.msg-row {
  display: flex;
  width: 100%;
  margin: 2px 0 3px;
}

/* Animation d'apparition façon Telegram : la bulle arrive avec un léger
   glissement + zoom depuis son coin d'origine (bas-droite pour nos messages,
   bas-gauche pour ceux reçus), puis se stabilise. */
.msg-row.msg-anim-in {
  animation: msgPopIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.msg-row.msg-anim-in.is-me .msg-bubble {
  transform-origin: bottom right;
}
.msg-row.msg-anim-in.is-other .msg-bubble {
  transform-origin: bottom left;
}
.msg-row.msg-anim-in .msg-bubble {
  animation: msgBubbleIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes msgPopIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes msgBubbleIn {
  0% { transform: scale(0.72) translateY(10px); opacity: 0; }
  60% { transform: scale(1.02) translateY(-1px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Messages consécutifs du même expéditeur : bulles visuellement collées,
   avec un léger changement de rayon pour garder chaque message identifiable. */
.msg-row.is-group-middle,
.msg-row.is-group-last:not(.is-group-first) {
  margin-top: 1px;
}
.msg-row.is-other.is-group-middle .msg-bubble {
  border-top-left-radius: 7px;
}
.msg-row.is-other.is-group-last:not(.is-group-first) .msg-bubble {
  border-top-left-radius: 7px;
}
.msg-row.is-other.is-group-first:not(.is-group-last) .msg-bubble {
  border-bottom-left-radius: 7px;
}
.msg-row.is-me.is-group-middle .msg-bubble {
  border-top-right-radius: 7px;
}
.msg-row.is-me.is-group-last:not(.is-group-first) .msg-bubble {
  border-top-right-radius: 7px;
}
.msg-row.is-me.is-group-first:not(.is-group-last) .msg-bubble {
  border-bottom-right-radius: 7px;
}
.msg-row.is-other { justify-content: flex-start; }
.msg-row.is-me { justify-content: flex-end; }
.msg-row .chat-avatar {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  margin: 0 6px 0 0;
  font-size: 10px;
  align-self: flex-start;
}
.msg-avatar-spacer {
  flex: 0 0 36px;
}
.msg-bubble {
  position: relative;
  max-width: min(76%, 530px);
  padding: 8px 11px 7px;
  border: 1px solid transparent;
  border-radius: 18px;
  box-shadow: 0 4px 13px rgba(0,0,0,.10);
  transition: transform .14s var(--ease);
}
.msg-row.is-other .msg-bubble {
  background: rgba(18, 29, 48, .94);
  border-color: rgba(125,179,255,.11);
  border-bottom-left-radius: 6px;
}
.msg-row.is-me .msg-bubble {
  background: linear-gradient(145deg, rgba(49,111,211,.96), rgba(32,89,173,.96));
  border-color: rgba(125,179,255,.20);
  border-bottom-right-radius: 6px;
  box-shadow: 0 7px 17px rgba(22,78,150,.20);
}
.msg-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
}
.msg-row.is-me .msg-text { color: #fff; }
.msg-meta {
  margin: 4px 0 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.15;
  color: var(--text-faint);
}
.msg-row.is-me .msg-meta { color: rgba(255,255,255,.66); }
.msg-sender-name {
  display: block;
  margin: 0 0 2px;
  color: var(--cyan-400);
  font-size: 10px;
  font-weight: 700;
}
.msg-row.is-me .msg-sender-name { display: none; }

.modern-msg-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 2px 0;
  border-top: 0;
}
.msg-input-shell {
  flex: 1 1 auto;
  min-width: 0;
}
.msg-input-shell textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 132px;
  resize: none;
  padding: 11px 14px;
  border-radius: 18px;
  border: 1px solid rgba(125,179,255,.13);
  background: rgba(12,19,34,.88);
  color: var(--text-hi);
  line-height: 1.45;
  outline: none;
}
.msg-input-shell textarea:focus {
  border-color: rgba(79,150,247,.42);
  box-shadow: 0 0 0 3px rgba(79,150,247,.07);
}
.msg-send-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blue-400), var(--blue-600));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(47,139,255,.20);
  transition: transform .15s var(--ease), filter .15s var(--ease);
}
.msg-send-btn svg { width: 19px; height: 19px; }
.msg-send-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.msg-send-btn:disabled { opacity: .55; cursor: wait; transform: none; }

@media (max-width: 640px) {
  .messages-page-head {
    align-items: flex-start;
  }
  .messages-page-head .messages-page-subtitle { display: none; }
  .friend-request-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .friend-request-actions {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 2px;
  }
  .conversation-page {
    min-height: 0;
    height: 100%;
  }
  .conversation-toolbar {
    gap: 6px;
  }
  .conversation-back-btn span:last-child { display: none; }
  .msg-thread {
    min-height: 280px;
    padding-inline: 7px;
    border-radius: 17px;
  }
  .msg-bubble { max-width: 84%; }
  .msg-row.is-other .msg-bubble { max-width: calc(84% - 36px); }
}
