/* ============================================================
   Am-Connect — feuille de style
   Direction : "aurora fintech" — navy profond, halo lumineux en
   mouvement lent, verre dépoli, dégradé bleu→violet, typo display
   Space Grotesk sur Inter. Mouvements discrets et orchestrés.
   ============================================================ */

:root {
  /* Surfaces (navy profond, légèrement biaisé vers le bleu) */
  --bg: #080b14;
  --bg-soft: #0f1524;
  --card: #141b2e;
  --card-2: #1a2238;
  --border: #243149;
  --border-soft: rgba(255, 255, 255, .06);

  /* Texte */
  --text: #eaf0fb;
  --muted: #8795b4;

  /* Accent de marque + sémantique */
  --brand: #22d3ee;
  --brand-2: #3b82f6;
  --accent: #5eead4;
  --green: #2dd4a7;
  --amber: #f5b945;
  --red: #ff6b7a;

  /* Dégradés & halos */
  --grad: linear-gradient(135deg, var(--brand), var(--brand-2));
  --glow: rgba(34, 211, 238, .45);

  /* Rayons & ombres */
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 14px 44px rgba(3, 6, 14, .55);
  --shadow-glow: 0 22px 60px -18px rgba(34, 211, 238, .55);

  /* Typographie */
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'SFMono-Regular', Menlo, monospace;

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Halo d'ambiance qui dérive lentement derrière le contenu */
body::before {
  content: "";
  position: fixed;
  inset: -25% -15% auto;
  height: 85vh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(48% 48% at 78% 18%, rgba(34, 211, 238, .24), transparent 70%),
    radial-gradient(42% 42% at 14% 8%, rgba(59, 130, 246, .20), transparent 70%),
    radial-gradient(38% 38% at 52% 0%, rgba(94, 234, 212, .09), transparent 72%);
  filter: blur(18px);
  animation: aurora 20s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(4%, 3%, 0) scale(1.12); }
}

a { color: inherit; text-decoration: none; }
::selection { background: rgba(34, 211, 238, .32); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- Icônes SVG (jeu interne) ---------- */
.icn { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; }
.btn .icn { width: 1.05em; height: 1.05em; }
.btn [data-icon] { line-height: 0; }
.icon-btn .icn { width: 20px; height: 20px; }
.sb-ic { display: inline-flex; align-items: center; justify-content: center; width: 22px; }
.sb-ic .icn { width: 18px; height: 18px; }
.ic .icn { width: 19px; height: 19px; }
.search-ic .icn { width: 16px; height: 16px; color: var(--muted); }
.copy-ic .icn { width: 15px; height: 15px; }
.int-ic { display: inline-flex; color: var(--brand); }
.int-ic .icn { width: 16px; height: 16px; }
.ok-box .circle .icn { width: 30px; height: 30px; }
.step .num .icn { width: 15px; height: 15px; }
.free-note .icn { width: 15px; height: 15px; color: var(--brand-2); vertical-align: -0.2em; }
.guide summary .icn { width: 15px; height: 15px; }

/* ---------- Layout ---------- */
.container { max-width: 1160px; margin: 0 auto; padding: 0 22px; }

.nav {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(16px) saturate(140%);
  background: linear-gradient(180deg, rgba(8, 11, 20, .82), rgba(8, 11, 20, .62));
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.4px; }
.brand .dot {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad);
  display: grid; place-items: center; font-size: 16px; box-shadow: 0 6px 18px var(--glow);
}
.brand small { color: var(--muted); font-weight: 500; font-size: 12px; }
.brand-logo { width: 32px; height: 32px; display: block; border-radius: 9px; box-shadow: 0 6px 20px rgba(59, 130, 246, .45); flex-shrink: 0; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.06); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* ---------- Boutons ---------- */
.btn {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); background: var(--card-2); color: var(--text);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .2s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 10px 26px -8px var(--glow); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 16px 34px -10px var(--glow); }
/* Reflet qui balaie le bouton principal au survol */
.btn-primary::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-130%);
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35), transparent 70%);
}
.btn-primary:hover::after { animation: sheen .7s ease; }
@keyframes sheen { to { transform: translateX(130%); } }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; padding: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }

/* ---------- Hero ---------- */
.hero { padding: 70px 0 30px; text-align: center; }
.hero h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 54px); font-weight: 700; letter-spacing: -1.5px; line-height: 1.05; text-wrap: balance; }
.hero h1 span { background: linear-gradient(120deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); max-width: 560px; margin: 16px auto 0; font-size: 17px; }

.pill { display: inline-flex; gap: 9px; align-items: center; font-size: 13px; font-weight: 500; color: var(--muted); border: 1px solid var(--border); background: rgba(20, 27, 46, .7); padding: 7px 15px; border-radius: 999px; margin-bottom: 20px; }
.pill .live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pill .live::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--accent); opacity: .6; animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 80%, 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Boutique (layout 2 colonnes) ---------- */
.shop-layout { display: grid; grid-template-columns: 340px 1fr; gap: 34px; padding: 48px 0 10px; align-items: start; }
.shop-aside { position: sticky; top: 92px; }
.shop-aside h1 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 42px); font-weight: 700; letter-spacing: -1.4px; line-height: 1.06; margin-top: 16px; text-wrap: balance; }
.shop-aside h1 span { background: linear-gradient(120deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.shop-aside > p { color: var(--muted); margin: 14px 0 22px; font-size: 15px; }
.steps-list { display: flex; flex-direction: column; gap: 10px; }
.step-chip { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border-soft); border-radius: 13px; padding: 12px 14px; font-size: 14px; font-weight: 500; transition: transform .16s ease, border-color .16s ease; }
.step-chip:hover { transform: translateX(3px); border-color: var(--border); }
.sc-num { width: 27px; height: 27px; border-radius: 9px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; box-shadow: 0 4px 12px -2px var(--glow); }
.guide { margin-top: 18px; background: var(--card); border: 1px solid var(--border-soft); border-radius: 13px; padding: 4px 16px; }
.guide summary { cursor: pointer; padding: 13px 0; font-size: 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: "⌄"; color: var(--muted); transition: transform .2s ease; }
.guide[open] summary::after { transform: rotate(180deg); }
.guide p { color: var(--muted); font-size: 13.5px; padding: 0 0 14px; }

.shop-head { display: flex; align-items: center; gap: 12px; }
.shop-head h2 { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: -.5px; }
.source-badge { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; }
.source-badge.demo { background: rgba(245, 185, 69, .14); color: var(--amber); }
.shop-sub { color: var(--muted); margin: 6px 0 22px; font-size: 14px; }

/* ---------- Cartes forfait ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 15px; }
.fcard {
  text-align: left; background: linear-gradient(180deg, var(--card), rgba(15, 21, 36, .9));
  border: 1px solid var(--border-soft); border-radius: 17px;
  padding: 17px 17px 15px; cursor: pointer; position: relative; color: var(--text); font: inherit;
  display: flex; flex-direction: column; gap: 2px; overflow: hidden;
  transition: transform .18s cubic-bezier(.34, 1.4, .64, 1), border-color .18s ease, box-shadow .22s ease;
  animation: cardIn .5s cubic-bezier(.22, 1, .36, 1) both;
}
/* Entrée échelonnée des cartes */
.fcard:nth-child(1) { animation-delay: .02s; } .fcard:nth-child(2) { animation-delay: .06s; }
.fcard:nth-child(3) { animation-delay: .10s; } .fcard:nth-child(4) { animation-delay: .14s; }
.fcard:nth-child(5) { animation-delay: .18s; } .fcard:nth-child(6) { animation-delay: .22s; }
.fcard:nth-child(7) { animation-delay: .26s; } .fcard:nth-child(8) { animation-delay: .30s; }
.fcard:nth-child(9) { animation-delay: .34s; } .fcard:nth-child(n+10) { animation-delay: .38s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
/* Liseré dégradé révélé au survol */
.fcard::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .22s ease; pointer-events: none;
}
.fcard:hover { transform: translateY(-5px); box-shadow: var(--shadow-glow); border-color: transparent; }
.fcard:hover::before { opacity: 1; }
.fcard.pop::before { opacity: .6; }
.fcard-pop { position: absolute; top: 12px; right: 12px; background: var(--grad); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .3px; padding: 3px 9px; border-radius: 999px; box-shadow: 0 4px 12px -3px var(--glow); }
.fcard-vol { font-family: var(--font-display); font-size: 13px; color: var(--accent); font-weight: 600; letter-spacing: .2px; }
.fcard-name { font-size: 17px; font-weight: 700; letter-spacing: -.2px; margin-top: 3px; }
.fcard-dur { font-size: 13px; color: var(--muted); margin: 2px 0 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fcard-dur .night { background: rgba(59, 130, 246, .16); color: var(--brand-2); font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.fcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.fcard-price { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.fcard-price small { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.fcard-free { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--accent); }
.fcard-cta { font-size: 12.5px; font-weight: 700; color: var(--brand); background: rgba(34, 211, 238, .12); padding: 7px 12px; border-radius: 10px; white-space: nowrap; transition: .18s; }
.fcard:hover .fcard-cta { background: var(--grad); color: #fff; box-shadow: 0 6px 16px -4px var(--glow); }

/* Squelette de chargement des forfaits */
.plan-skel { height: 150px; border-radius: 17px; border: 1px solid var(--border-soft); background:
  linear-gradient(100deg, var(--card) 30%, var(--card-2) 50%, var(--card) 70%); background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 820px) {
  .shop-layout { grid-template-columns: 1fr; gap: 24px; padding-top: 28px; }
  .shop-aside { position: static; }
}

/* ---------- Cartes génériques (conservé) ---------- */
.section-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 36px 0 6px; letter-spacing: -.3px; }
.section-sub { color: var(--muted); margin-bottom: 22px; font-size: 14px; }
.grid { display: grid; gap: 18px; }
.plans { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.plan-card { background: linear-gradient(180deg, var(--card), var(--bg-soft)); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; position: relative; transition: .18s; }
.plan-card:hover { border-color: var(--brand); transform: translateY(-4px); box-shadow: var(--shadow); }
.plan-card.popular { border-color: var(--brand); }
.tag-pop { position: absolute; top: -11px; right: 16px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.op { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.plan-card h3 { font-size: 19px; margin: 4px 0 2px; }
.data-big { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -1px; margin: 10px 0 2px; }
.data-big small { font-size: 14px; color: var(--muted); font-weight: 500; }
.valid { color: var(--muted); font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }
.price-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.price { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.price small { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 8, 15, .66); backdrop-filter: blur(6px); display: none; place-items: center; z-index: 50; padding: 20px; }
.modal-bg.open { display: grid; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 430px;
  padding: 30px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  animation: modalIn .34s cubic-bezier(.34, 1.56, .64, 1);
}
.modal::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad); }
@keyframes modalIn { from { transform: translateY(16px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: -.4px; }
.modal .muted { color: var(--muted); font-size: 14px; margin: 4px 0 20px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
.field input, .field select {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 12px; font-size: 15px; font-family: inherit; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: #566182; }
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(34, 211, 238, .14); }
.switch-line { text-align: center; color: var(--muted); font-size: 14px; margin-top: 16px; }
.switch-line a { color: var(--brand); font-weight: 600; cursor: pointer; }

.err { background: rgba(255, 107, 122, .12); border: 1px solid rgba(255, 107, 122, .4); color: var(--red); padding: 11px 13px; border-radius: 11px; font-size: 13px; margin-bottom: 14px; display: none; }
.err.show { display: block; animation: shake .3s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* État de succès / résultat d'achat */
.ok-box { text-align: center; padding: 10px 0; }
.ok-box .circle { width: 68px; height: 68px; border-radius: 50%; background: rgba(45, 212, 167, .14); color: var(--green); display: grid; place-items: center; font-size: 32px; margin: 0 auto 14px; animation: popIn .4s cubic-bezier(.34, 1.56, .64, 1) both; }
.ok-box .circle::after { content: ""; position: absolute; width: 68px; height: 68px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: ringOut .7s ease .1s; }
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ringOut { from { transform: scale(.8); opacity: .6; } to { transform: scale(1.5); opacity: 0; } }

/* ---------- Avatar / menu ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 700; cursor: pointer; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .uname { font-size: 14px; font-weight: 600; }
.user-chip .uname small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }

/* ---------- Table commandes ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 14px 18px; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
td { padding: 14px 18px; border-bottom: 1px solid rgba(36, 48, 72, .5); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(34, 211, 238, .05); }
.badge { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.completé, .badge.complété { background: rgba(45, 212, 167, .14); color: var(--green); }
.badge.attente { background: rgba(245, 185, 69, .14); color: var(--amber); }
.badge.échoué { background: rgba(255, 107, 122, .14); color: var(--red); }

.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 56px 0 34px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--card-2); border: 1px solid var(--border); padding: 14px 22px; border-radius: 13px; box-shadow: var(--shadow); opacity: 0; transition: .28s cubic-bezier(.34, 1.56, .64, 1); z-index: 80; font-size: 14px; font-weight: 500; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hidden, [hidden] { display: none !important; }

/* ============================================================
   ADMIN
   ============================================================ */
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 22px; }
.kpi { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--card), var(--bg-soft)); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 20px 22px; transition: transform .18s ease, border-color .18s ease, box-shadow .22s ease; }
/* Fin liseré supérieur qui signale la tuile au survol */
.kpi::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.kpi:hover { transform: translateY(-3px); border-color: transparent; box-shadow: 0 16px 38px -18px rgba(34, 211, 238, .5); }
.kpi:hover::before { transform: scaleX(1); }
.kpi .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kpi .val { font-family: var(--font-display); font-size: 31px; font-weight: 700; letter-spacing: -1px; margin-top: 12px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .label + .val + .label { font-size: 12px; color: var(--accent); opacity: .85; }
.kpi .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 16px; }
.ic.blue { background: rgba(34, 211, 238, .15); color: var(--brand); }
.ic.green { background: rgba(45, 212, 167, .15); color: var(--green); }
.ic.violet { background: rgba(59, 130, 246, .15); color: var(--brand-2); }
.ic.amber { background: rgba(245, 185, 69, .15); color: var(--amber); }

.panel { background: linear-gradient(180deg, var(--card), rgba(15, 21, 36, .7)); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 22px; }
.panel h3 { font-family: var(--font-display); font-size: 16px; margin-bottom: 4px; }
.panel .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.charts { grid-template-columns: 1.6fr 1fr; align-items: start; }
.two-col { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .charts, .two-col { grid-template-columns: 1fr; } }

.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 14px; }
.bar-row .n { width: 120px; color: var(--text); }
.bar-track { flex: 1; height: 10px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; }
.bar-row .v { width: 90px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab { padding: 8px 16px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--muted); border: 1px solid transparent; }
.tab.active { background: var(--card); border-color: var(--border); color: var(--text); }

/* ----- Console admin (sidebar) ----- */
.admin-body { display: flex; min-height: 100vh; }
.login-screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; z-index: 60;
  background: radial-gradient(1000px 500px at 70% -10%, rgba(34, 211, 238, .18), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: linear-gradient(180deg, var(--card), var(--bg-soft)); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); animation: modalIn .34s cubic-bezier(.34, 1.56, .64, 1); }
.login-card h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: -.4px; }
.login-screen[hidden], .sidebar[hidden], .admin-main[hidden] { display: none !important; }

.sidebar { width: 250px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, var(--bg-soft), var(--bg)); border-right: 1px solid var(--border-soft); display: flex; flex-direction: column; padding: 18px 14px; z-index: 40; }
.sb-brand { margin: 6px 8px 24px; font-size: 18px; font-family: var(--font-display); }
.sb-nav { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sb-group { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin: 18px 10px 6px; opacity: .7; }
.sb-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 11px; color: var(--muted); font-size: 14.5px; font-weight: 500; cursor: pointer; transition: background .15s ease, color .15s ease, transform .15s ease; }
.sb-link:hover { background: var(--card); color: var(--text); transform: translateX(2px); }
.sb-link.active { background: linear-gradient(135deg, rgba(34, 211, 238, .18), rgba(59, 130, 246, .14)); color: var(--text); font-weight: 600; }
/* Barre d'accent à gauche du lien actif */
.sb-link.active::before { content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--grad); box-shadow: 0 0 10px var(--glow); }
.sb-ic { width: 22px; text-align: center; font-size: 15px; }
.sb-foot { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 10px; }
.sb-foot .user-chip { padding: 0 6px; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 18px 30px; background: rgba(8, 11, 20, .82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-soft); }
.page-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.page-sub { color: var(--muted); font-size: 13px; }
.admin-content { padding: 26px 30px 60px; }
.view { display: grid; gap: 18px; animation: viewIn .3s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view[hidden] { display: none; }

.icon-btn { display: none; background: var(--card-2); border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 18px; }
.sb-backdrop { display: none; position: fixed; inset: 0; background: rgba(5, 8, 15, .6); z-index: 35; }

.role-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.role-row .rn { width: 130px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.role-dot { width: 11px; height: 11px; border-radius: 3px; }

.int-item { border: 1px solid var(--border-soft); border-radius: 13px; padding: 16px; margin-bottom: 12px; background: var(--bg-soft); transition: border-color .16s ease, transform .16s ease; }
.int-item:hover { border-color: var(--border); transform: translateX(2px); }
.int-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.int-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.int-key { font-family: var(--font-mono); background: var(--bg); border: 1px solid var(--border); padding: 7px 10px; border-radius: 9px; font-size: 13px; color: var(--muted); margin-top: 10px; display: inline-block; }
.int-meta { color: var(--muted); font-size: 12px; margin-top: 8px; }
.chip-env { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(34, 211, 238, .15); color: var(--brand); }
.chip-on { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(45, 212, 167, .15); color: var(--green); }
.chip-off { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(140, 153, 181, .15); color: var(--muted); }
.int-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.btn-danger { color: var(--red); border-color: rgba(255, 107, 122, .4); }
.btn-danger:hover { border-color: var(--red); background: rgba(255, 107, 122, .1); }

.period-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.period-btn { padding: 9px 15px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: .15s; }
.period-btn:hover { color: var(--text); border-color: var(--brand); }
.period-btn.active { background: var(--grad); color: #fff; border-color: transparent; }

/* Panneau commandes / comptes : en-tête + recherche + pagination */
.orders-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.orders-head h3 { font-family: var(--font-display); font-size: 17px; }
.search-box { position: relative; flex: 1; min-width: 180px; max-width: 360px; }
.search-box .search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .7; pointer-events: none; }
.search-box input { width: 100%; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); padding: 10px 14px 10px 34px; border-radius: 11px; font-size: 14px; font-family: inherit; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.search-box input::placeholder { color: #566182; }
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(34, 211, 238, .14); }

.orders-table th, .orders-table td { font-size: 13.5px; }
.ord-code-cell { white-space: nowrap; }
.ord-code { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); }
.copy-ic { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 14px; margin-left: 6px; padding: 2px 5px; border-radius: 6px; transition: .15s; }
.copy-ic:hover { color: var(--brand); background: rgba(34, 211, 238, .12); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.pager-info { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pager-btns { display: flex; align-items: center; gap: 10px; }
.pager-page { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

tfoot td { font-weight: 700; border-top: 2px solid var(--border); background: var(--bg-soft); }
.marge-pos { color: var(--green); font-weight: 600; }

/* Code d'activation */
.code-box { background: var(--bg-soft); border: 1px dashed var(--brand); border-radius: 13px; padding: 15px 16px; margin: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.code-box .code { font-family: var(--font-mono); font-size: 20px; font-weight: 700; letter-spacing: 1px; color: var(--text); }
.code-box .copy { background: var(--card-2); border: 1px solid var(--border); color: var(--text); padding: 8px 13px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; transition: .15s; }
.code-box .copy:hover { border-color: var(--brand); background: rgba(34, 211, 238, .1); }

/* Stepper (3 étapes) */
.stepper { display: flex; align-items: center; gap: 0; margin: 4px 0 22px; }
.step { display: flex; align-items: center; gap: 8px; flex: 1; }
.step .num { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted); flex-shrink: 0; transition: .25s ease; }
.step .lbl { font-size: 12.5px; color: var(--muted); transition: color .25s ease; }
.step.active .num { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 0 0 5px rgba(34, 211, 238, .16); }
.step.active .lbl { color: var(--text); font-weight: 600; }
.step.done .num { background: rgba(45, 212, 167, .16); color: var(--green); border-color: transparent; }
.step .line { flex: 1; height: 2px; background: var(--border); margin: 0 6px; border-radius: 2px; position: relative; overflow: hidden; }
.step.done .line::after, .step.active .line::after { content: ""; position: absolute; inset: 0; background: var(--grad); animation: lineFill .4s ease both; }
@keyframes lineFill { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); } }

.op-row { display: flex; gap: 10px; margin-bottom: 14px; }
.op-pick { flex: 1; position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 11px; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: .16s; }
.op-pick:hover { border-color: var(--brand); color: var(--text); }
.op-pick.on { border-color: var(--brand); color: var(--text); background: rgba(34, 211, 238, .1); box-shadow: 0 0 0 3px rgba(34, 211, 238, .12); }
.op-pick.on::after { content: "✓"; position: absolute; top: 6px; right: 8px; font-size: 11px; color: var(--brand); font-weight: 800; }
.op-pick small { display: block; font-weight: 400; font-size: 11px; margin-top: 2px; }

.processing { text-align: center; padding: 22px 0; }
.spinner { width: 54px; height: 54px; border: 4px solid var(--border); border-top-color: var(--brand); border-right-color: var(--brand-2); border-radius: 50%; margin: 0 auto 16px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 880px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: .22s; }
  .admin-body.sb-open .sidebar { transform: translateX(0); }
  .admin-body.sb-open .sb-backdrop { display: block; }
  .icon-btn { display: grid; place-items: center; }
  .topbar, .admin-content { padding-left: 18px; padding-right: 18px; }
}

/* Diagnostic connexion Geny */
.geny-ok, .geny-err { border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.6; margin-bottom: 14px; }
.geny-ok { background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .35); color: #bbf7d0; }
.geny-err { background: rgba(239, 68, 68, .10); border: 1px solid rgba(239, 68, 68, .35); color: #fecaca; }

/* Note forfait gratuit / infobulle */
.free-note { background: rgba(59, 130, 246, .10); border: 1px solid rgba(59, 130, 246, .30); color: #c9ecfb; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; margin: 6px 0 18px; }

/* Connexion client */
.auth-wrap { display: grid; place-items: center; min-height: 70vh; padding-top: 24px; padding-bottom: 24px; }

/* Accessibilité : respecter la préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Bande de téléchargement de l'application (au-dessus des forfaits) */
.app-promo { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 14px; padding: 13px 18px; margin: 22px 0 20px; }
.app-promo-txt { display: flex; flex-direction: column; gap: 2px; }
.app-promo-txt b { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.app-promo-txt span { color: var(--muted); font-size: 12.5px; }
.app-promo-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.btn-dl-lg { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; padding: 10px 18px; border-radius: 11px;
  box-shadow: 0 6px 16px rgba(0,0,0,.30); }
.btn-dl-lg small { font-weight: 600; opacity: .8; font-size: 11.5px; margin-left: 2px; }
.dl-svg { width: 17px; height: 17px; flex-shrink: 0; }
.dl-ti { width: 16px; height: 16px; color: var(--brand); flex-shrink: 0; }
@media (max-width: 640px) {
  .app-promo { flex-direction: column; align-items: stretch; text-align: center; }
  .app-promo-txt b { justify-content: center; }
  .app-promo-btns { margin-left: 0; }
  .btn-dl-lg { flex: 1 1 140px; justify-content: center; }
}
