:root {
  --bg-deep: #050811;
  --emerald: #10b981;
  --emerald-bright: #00ff88;
  --gold: #f59e0b;
  --gold-bright: #fbbf24;
  --cyan-ice: #38bdf8;
  --silver: #e2e8f0;
  --role-accent: #10b981;
  --role-accent-2: #f59e0b;
  --glass-bg: linear-gradient(155deg, rgba(16, 22, 34, 0.82), rgba(9, 13, 22, 0.90));
  --glass-clear: rgba(16, 22, 34, 0.65);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-top-edge: rgba(255, 255, 255, 0.22);
  --glass-shadow: 0 14px 34px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
}

[data-role="free"] { --role-accent: #10b981; --role-accent-2: #34d399; }
[data-role="vip"] { --role-accent: #e6c875; --role-accent-2: #f3e5ab; }
[data-role="reseller"] { --role-accent: #3b82f6; --role-accent-2: #60a5fa; }
[data-role="admin"] { --role-accent: #722f37; --role-accent-2: #ffffff; }

body.ls-emerald {
  background-color: #050811;
  background-image: none;
  color: var(--text-main);
  min-height: 100vh;
}

.ls-glass-card,
.vitrine-card {
  background: linear-gradient(155deg, rgba(16, 22, 34, 0.82), rgba(9, 13, 22, 0.90));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.ls-topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(9, 13, 22, 0.84);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 -1px 0 rgba(16, 185, 129, 0.22), 0 10px 28px rgba(0, 0, 0, 0.55);
}

.ls-avatar-ring {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--role-accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--role-accent) 45%, transparent);
}

.ls-lang-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(155deg, rgba(16, 22, 34, 0.84), rgba(9, 13, 22, 0.92));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: var(--text-main);
  font-size: 12.5px; font-weight: 800; text-decoration: none; cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.ls-lang-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(16, 185, 129, 0.65);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65), 0 0 16px rgba(16, 185, 129, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ls-butterfly {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 9999; width: min(94vw, 520px);
  background: rgba(10, 18, 32, 0.92);
  backdrop-filter: blur(20px);
  border: 1.5px solid #F59E0B;
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 0 24px rgba(245, 158, 11, 0.25);
  animation: lsButterflyIn 0.35s cubic-bezier(.22, 1, .36, 1);
}
@keyframes lsButterflyIn { from { opacity: 0; transform: translate(-50%, -18px); } to { opacity: 1; transform: translate(-50%, 0); } }

.ls-mini-assistant {
  position: fixed; bottom: 16px; right: 16px; z-index: 950;
  max-width: 320px; padding: 12px 14px;
  background: rgba(10, 22, 34, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid var(--emerald);
  border-radius: 16px;
  font-size: 12.5px; line-height: 1.4;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.ls-invoice-card {
  background: linear-gradient(145deg, rgba(10, 24, 34, 0.95), rgba(6, 9, 19, 0.98));
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 18px;
  padding: 20px;
  position: relative;
}
.ls-invoice-stamp {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--emerald-bright); color: var(--emerald-bright);
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}

/* ============================================================================
   Bascule thème clair « Clair Givré » (data-ls-theme="light") — partagée avec
   les espaces refondus. Le sombre reste le défaut.
   ============================================================================ */
html[data-ls-theme="light"] body.ls-emerald {
  background: #eef4f7;
  background-image:
    radial-gradient(680px circle at 12% 8%, rgba(16, 185, 129, 0.10), transparent 60%),
    radial-gradient(560px circle at 88% 18%, color-mix(in srgb, var(--role-accent) 10%, transparent), transparent 62%);
  color: #0f172a;
}
html[data-ls-theme="light"] .ls-topbar {
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: rgba(16, 185, 129, 0.22);
  color: #0f172a;
}
html[data-ls-theme="light"] .ls-glass-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(16, 185, 129, 0.28);
  box-shadow: 0 10px 26px rgba(71, 85, 105, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #0f172a;
}
html[data-ls-theme="light"] .ls-lang-pill {
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.18);
}
html[data-ls-theme="light"] body.ls-emerald input,
html[data-ls-theme="light"] body.ls-emerald select,
html[data-ls-theme="light"] body.ls-emerald textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}
html[data-ls-theme="light"] body.ls-emerald .ls-butterfly,
html[data-ls-theme="light"] body.ls-emerald .ls-mini-assistant {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
}

/* Bouton flottant de bascule (injecté par static/js/i18n-panel.js) */
.ls-theme-toggle {
  position: fixed; left: 14px; bottom: 14px; z-index: 900;
  width: 42px; height: 42px; padding: 0; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--glass-bg); color: var(--text-main);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  cursor: pointer; font-size: 18px; line-height: 1;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.ls-theme-toggle:hover { border-color: var(--emerald); transform: translateY(-1px); }
.ls-theme-toggle:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }
html[data-ls-theme="light"] .ls-theme-toggle { background: rgba(255, 255, 255, 0.9); color: #0f172a; }
@media (prefers-reduced-motion: reduce) { .ls-theme-toggle { transition: none; } }

/* ============================================================================
   Ergonomie Hybride Android (360-412px) & Poste PC (>= 1024px) — Cristal Taillé
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body.ls-emerald { max-width: 100%; overflow-x: hidden; }
.ls-hybrid-wrap {
  position: relative;
  z-index: 1;
  background: transparent;
  width: min(1240px, 100%);
  margin: 18px auto 84px;
  padding: 0 12px;
  display: grid;
  gap: 16px;
}
@media (min-width: 1024px) {
  .ls-hybrid-wrap { padding: 0 20px; gap: 20px; }
}
.ls-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 768px) {
  .ls-quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
}
.ls-qaction {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 14px; border-radius: 999px;
  background: linear-gradient(155deg, rgba(16, 22, 34, 0.84), rgba(9, 13, 22, 0.92));
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: var(--text-main); font-size: 13px; font-weight: 800; text-decoration: none;
  text-align: center; min-width: 0; white-space: nowrap;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.ls-qaction:hover {
  transform: translateY(-1px);
  border-color: rgba(226, 232, 240, 0.45);
}
.ls-qaction.primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #021a0e;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 10px 26px rgba(16, 185, 129, 0.34);
}
.ls-qaction.cyan {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #030914;
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 10px 26px rgba(56, 189, 248, 0.30);
}
.ls-qaction.gold {
  background: linear-gradient(155deg, rgba(245, 158, 11, 0.18), rgba(9, 13, 22, 0.90));
  border: 1px solid rgba(245, 158, 11, 0.52);
  border-top: 1px solid rgba(251, 191, 36, 0.72);
  color: #fbbf24;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.58), 0 0 20px rgba(245, 158, 11, 0.16), inset 0 1px 0 rgba(251, 191, 36, 0.24);
}
.ls-cols-2 {
  display: grid; grid-template-columns: 1fr; gap: 16px;
}
@media (min-width: 1024px) {
  .ls-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
}
.ls-kpis-compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 768px) {
  .ls-kpis-compact {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}
.ls-stat-crystal {
  padding: 14px 10px;
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(16, 22, 34, 0.82), rgba(9, 13, 22, 0.90));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
@media (min-width: 768px) {
  .ls-stat-crystal {
    padding: 18px 16px;
  }
}
.ls-touch-btn {
  min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
body.ls-emerald input, body.ls-emerald select, body.ls-emerald button[type="submit"] {
  min-height: 46px;
}

/* ============================================================================
   LOGO HORIZONTAL (MODE SOMBRE) ANIMÉ (.labosurf-horizontal-logo)
   - Bloc Gauche : Emblème hexagonal métallique + Globe 3D rotatif + Clé cyber-tech + Anneaux orbitaux émeraude
   - Bloc Droit : Signature typographique horizontale LABOSURF + Arc émeraude + Filets + LaboSurf Panel
   ============================================================================ */
.vitrine-hero-split {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 20px;
  max-width: 1260px;
  width: 100%;
  margin: 0 auto 24px;
  padding: 8px 4px;
  position: relative;
  z-index: 1;
  background: transparent;
}
@media (min-width: 960px) {
  .vitrine-hero-split {
    grid-template-columns: 1.25fr 0.95fr;
    gap: 32px;
    padding: 12px 16px;
  }
}
.labosurf-horizontal-logo {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 4px 0;
  position: relative;
  z-index: 2;
}
@media (min-width: 400px) {
  .labosurf-horizontal-logo {
    gap: 12px;
  }
}
@media (min-width: 960px) {
  .labosurf-horizontal-logo {
    gap: 18px;
  }
}
.lh-emblem {
  position: relative;
  width: 152px;
  height: 152px;
  flex: 0 0 152px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  filter: drop-shadow(0 0 18px rgba(0, 255, 127, 0.32));
}
@media (min-width: 960px) {
  .lh-emblem {
    width: 290px;
    height: 290px;
    flex: 0 0 290px;
    filter: drop-shadow(0 0 26px rgba(0, 255, 127, 0.36));
  }
}
.lh-emblem-back {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
  pointer-events: none;
  display: block;
}
.lh-globe-stage {
  position: relative;
  z-index: 2;
  width: 102px;
  height: 102px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 36% 32%, rgba(0, 195, 255, 0.35), rgba(3, 10, 24, 0.96) 75%);
  box-shadow:
    0 0 18px rgba(0, 212, 255, 0.72),
    0 0 32px rgba(0, 255, 127, 0.36),
    inset 0 0 12px rgba(0, 212, 255, 0.52);
}
#heroGlobeCanvas {
  position: relative;
  z-index: 2;
  width: 102px !important;
  height: 102px !important;
  border-radius: 50%;
  display: block;
}
@media (min-width: 960px) {
  .lh-globe-stage {
    width: 194px;
    height: 194px;
  }
  #heroGlobeCanvas {
    width: 194px !important;
    height: 194px !important;
  }
}
.lh-emblem-front {
  position: absolute;
  inset: -6%;
  width: 112% !important;
  height: 112% !important;
  z-index: 3;
  pointer-events: none;
  display: block;
}
.lh-wordmark-box {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding-top: 14px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.88));
}
@media (min-width: 960px) {
  .lh-wordmark-box {
    padding-top: 26px;
  }
}
.lh-arc-svg {
  position: absolute;
  top: 0;
  left: 30%;
  width: 68%;
  height: auto;
  pointer-events: none;
  overflow: visible;
}
.lh-title {
  margin: 0;
  font-family: 'Orbitron', 'Montserrat', 'Arial Black', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(2.05rem, 8.8vw, 2.7rem);
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  user-select: none;
}
@media (min-width: 960px) {
  .lh-title {
    font-size: clamp(3.4rem, 5.2vw, 4.8rem);
    letter-spacing: 0.01em;
  }
}
.lh-title-lab {
  background: linear-gradient(180deg, #eafff5 0%, #34d399 24%, #00e676 52%, #047857 62%, #10b981 86%, #a7f3d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(0, 255, 127, 0.35));
}
.lh-title-osurf {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 26%, #cbd5e1 52%, #475569 62%, #e2e8f0 86%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.22));
}
.vitrine-eco-card {
  position: relative;
  z-index: 2;
  background: linear-gradient(155deg, rgba(16, 22, 34, 0.86), rgba(9, 13, 22, 0.94));
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1.5px solid rgba(16, 185, 129, 0.58);
  border-radius: 22px;
  padding: 26px 24px;
  text-align: left;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 28px rgba(16, 185, 129, 0.12);
}
.vitrine-eco-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.20), rgba(245, 158, 11, 0.14));
  border: 1px solid rgba(16, 185, 129, 0.48);
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* --- Verrouillage strict Android-First (< 960px) : zéro carte/bouton coupé --- */
*, *::before, *::after { box-sizing: border-box; }
@media (max-width: 959px) {
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .ls-topbar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex-wrap: wrap !important;
    padding: 10px 12px !important;
  }
  .ls-hybrid-wrap, .ps-shell, .ps-main, .adm-shell, .adm-main, .adm-section, .vitrine-main, .vitrine-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 12px !important;
    padding-bottom: 84px !important;
  }
  .ps-card, .adm-card, .vitrine-card, .vitrine-stat-card, .vitrine-eco-card, .ls-glass-card, .vitrine-section-glass {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 14px !important;
    overflow: hidden !important;
  }
  .adm-kpis, .ps-kpis {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .adm-kpi, .ps-kpi {
    min-width: 0 !important;
    width: 100% !important;
    padding: 12px !important;
    overflow: hidden !important;
  }
  .adm-kpi *, .ps-kpi *, .vitrine-card *, .ps-card *, .adm-card *, .ls-glass-card * {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }
  nav img[src*="logo-horizontal"], .ls-topbar img[src*="logo-horizontal"], .ps-topbar img[src*="logo-horizontal"], header img[src*="logo-horizontal"] {
    height: 32px !important;
    width: auto !important;
    max-width: 155px !important;
    object-fit: contain !important;
  }
  .lh-emblem {
    width: 132px !important;
    height: 132px !important;
    flex: 0 0 132px !important;
  }
  .lh-globe-stage {
    width: 88px !important;
    height: 88px !important;
  }
  #heroGlobeCanvas {
    width: 88px !important;
    height: 88px !important;
  }
  .lh-title {
    font-size: clamp(1.75rem, 8vw, 2.4rem) !important;
  }
  input, select, textarea, button {
    max-width: 100% !important;
    min-width: 0 !important;
  }
}
