/* Relais Mail - theme sombre (maquette 2), actif quand <html> porte la classe rm-dark */
html.rm-dark{
  --rm-bg1:#070a17; --rm-bg2:#120a24;
  --rm-glass:rgba(255,255,255,.07); --rm-glass-strong:rgba(255,255,255,.12);
  --rm-stroke:rgba(255,255,255,.14); --rm-line:rgba(255,255,255,.09);
  --rm-text:#eef1ff; --rm-muted:#9aa3c7; --rm-accent:#8b9bff; --rm-accent2:#c58bff;
  --rm-ok:#3ee0a8; --rm-danger:#ff6b70;
  --rm-shadow:0 10px 50px rgba(0,0,0,.45);
  color-scheme:dark;
}
html.rm-dark{
  background:
    radial-gradient(600px 600px at -5% -10%, rgba(42,77,255,.40), transparent 60%),
    radial-gradient(520px 520px at 85% 110%, rgba(138,43,255,.38), transparent 60%),
    radial-gradient(420px 420px at 105% 35%, rgba(0,194,168,.22), transparent 60%),
    linear-gradient(135deg,var(--rm-bg1),var(--rm-bg2)) !important;
}

/* Reflets internes : plus discrets sur fond sombre */
html.rm-dark body > aside, html.rm-dark main .bg-gray-800, html.rm-dark .card, html.rm-dark .rm-card{
  box-shadow:var(--rm-shadow), inset 0 1px 0 rgba(255,255,255,.08) !important}
html.rm-dark .button{box-shadow:0 2px 8px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.08) !important}
html.rm-dark .button--text{box-shadow:none !important}
html.rm-dark .button--cta{box-shadow:0 8px 22px rgba(91,108,255,.35), inset 0 1px 0 rgba(255,255,255,.2) !important}
html.rm-dark .button::after{background:linear-gradient(105deg,transparent 30%,rgba(255,255,255,.14) 50%,transparent 70%)}
html.rm-dark aside .menu-link--active{box-shadow:inset 0 1px 0 rgba(255,255,255,.08), 0 4px 14px rgba(0,0,0,.3)}
html.rm-dark main .rm-tilt.rm-tilt{background-image:radial-gradient(420px circle at var(--mx,50%) var(--my,0%), rgba(255,255,255,.08), transparent 45%) !important}

/* Champs */
html.rm-dark input[type=text], html.rm-dark input[type=email], html.rm-dark input[type=password], html.rm-dark input[type=number],
html.rm-dark input[type=url], html.rm-dark input[type=search], html.rm-dark input[type=datetime-local], html.rm-dark input[type=date],
html.rm-dark input[type=time], html.rm-dark select, html.rm-dark textarea{background:rgba(255,255,255,.06) !important;box-shadow:none !important}
html.rm-dark tbody tr:hover td{background:rgba(255,255,255,.04)}

/* Fenetres de dialogue */
html.rm-dark .fixed.inset-0[class*="bg-black"]{background:rgba(0,0,0,.55) !important}
html.rm-dark .fixed .bg-gray-900, html.rm-dark .fixed .bg-gray-800, html.rm-dark .fixed .bg-gray-950,
html.rm-dark [class*="bg-black/"] .inline-block, html.rm-dark [role="dialog"] > div{
  background:#151a33 !important;box-shadow:0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08) !important}

/* Alertes et pastilles */
html.rm-dark main div.bg-red-500, html.rm-dark main div.bg-red-700, html.rm-dark main div.bg-red-800, html.rm-dark main p.bg-red-700,
html.rm-dark main div.bg-red-500 *, html.rm-dark main div.bg-red-700 *, html.rm-dark main div.bg-red-800 *{color:#ff9a9e !important}
html.rm-dark .rm-pill.ok, html.rm-dark .rm-chk.ok b, html.rm-dark main .rounded-full.h-14.bg-emerald-800{color:#3ee0a8 !important}
html.rm-dark .rm-pill.warn, html.rm-dark .rm-chk.warn b, html.rm-dark .rm-txt-warn, html.rm-dark main .rounded-full.h-14.bg-orange-800{color:#ffc35c !important}
html.rm-dark .rm-pill.bad{color:#ff8a8f}
html.rm-dark main .rounded-full.h-14{border-color:rgba(255,255,255,.12)}
html.rm-dark .rm-banner{background:linear-gradient(135deg,rgba(240,170,20,.16),rgba(255,255,255,.04)) !important}
html.rm-dark .rm-tip{background:#eef1ff;color:#0f1730}
html.rm-dark .rm-step.done .rm-step-n{color:#3ee0a8}
html.rm-dark table.rm-dns{background:rgba(255,255,255,.04) !important}

/* Editeur d'e-mail : on garde une "feuille" claire, l'e-mail sera lu sur fond blanc */
html.rm-dark .codex-editor{background:#fff;border-radius:16px;padding:12px 16px}

/* Graphique Keila : deja concu pour le sombre */
html.rm-dark main canvas[phx-hook="CampaignStatsChartHook"]{filter:none}

/* Fond anime */
html.rm-dark .rm-blob.a{background:#2a4dff}
html.rm-dark .rm-blob.b{background:#8a2bff}
html.rm-dark .rm-blob.c{background:#00c2a8}
html.rm-dark .rm-blob{opacity:.35}
html.rm-dark #rm-cursor-glow{mix-blend-mode:screen;background:radial-gradient(circle,rgba(123,92,255,.18),rgba(79,140,255,.08) 40%,transparent 70%)}
html.rm-dark.rm-fx{background-image:linear-gradient(135deg,var(--rm-bg1),var(--rm-bg2)) !important}
