/* ==========================================================================
   RMTG — THÈME SOMBRE SOUVERAIN UNIFIÉ (Public, Espace Client & Cockpit Admin)
   Actif sur : html.rmtg-dark-mode, body.rmtg-dark-mode, body.admin-dark-mode
   ========================================================================== */

html.rmtg-dark-mode {
  color-scheme: dark;
  background-color: #070b14;
}

html.rmtg-dark-mode,
body.rmtg-dark-mode,
body.admin-dark-mode {
  --bg: #070b14;
  --bg-0: #101829;
  --bg-1: #162033;
  --bg-2: #1e2b45;
  --bg-soft: #101829;
  --white: #0f1626;
  --surface: #0f1626;
  --card: #0f1626;
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --text-3: #94a3b8;
  --ink-900: #f8fafc;
  --ink-700: #cbd5e1;
  --ink-500: #94a3b8;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.24);
  --stroke: rgba(148, 163, 184, 0.14);
  --shadow: rgba(0, 0, 0, 0.6);
  --muted: #94a3b8;
  background-color: #070b14 !important;
  color: #f1f5f9 !important;
}

/* Toile de fond atmosphérique sur le viewport */
html.rmtg-dark-mode body {
  background-color: #070b14 !important;
  background-image:
    radial-gradient(900px 480px at 85% -6%, rgba(37, 99, 235, 0.12), transparent 65%),
    radial-gradient(760px 440px at 8% 12%, rgba(124, 58, 237, 0.1), transparent 65%) !important;
  color: #f1f5f9 !important;
}

/* ---------- 1. Header, Navigation, Mega-Menus, Footer & Dock Mobile ---------- */
html.rmtg-dark-mode .site-header,
body.rmtg-dark-mode .site-header,
body.admin-dark-mode .site-header {
  background: rgba(7, 11, 20, 0.88) !important;
  backdrop-filter: blur(18px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(160%) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

html.rmtg-dark-mode .rmtg-mobile-dock,
body.rmtg-dark-mode .rmtg-mobile-dock {
  background: rgba(11, 17, 30, 0.94) !important;
  backdrop-filter: blur(18px) !important;
  border-top: 1px solid rgba(148, 163, 184, 0.16) !important;
}

html.rmtg-dark-mode .brand__name span,
html.rmtg-dark-mode .nav__link,
html.rmtg-dark-mode .nav__trigger,
html.rmtg-dark-mode .user-btn__name,
body.rmtg-dark-mode .brand__name span,
body.rmtg-dark-mode .nav__link,
body.rmtg-dark-mode .nav__trigger,
body.admin-dark-mode .brand__name span,
body.admin-dark-mode .nav__link,
body.admin-dark-mode .nav__trigger {
  color: #e2e8f0 !important;
}

html.rmtg-dark-mode .brand__tagline,
body.rmtg-dark-mode .brand__tagline,
body.admin-dark-mode .brand__tagline {
  color: #94a3b8 !important;
}

html.rmtg-dark-mode .mega,
html.rmtg-dark-mode .dropdown__panel,
body.rmtg-dark-mode .mega,
body.rmtg-dark-mode .dropdown__panel,
body.admin-dark-mode .mega,
body.admin-dark-mode .dropdown__panel {
  background: rgba(15, 22, 38, 0.97) !important;
  backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.65) !important;
  color: #f1f5f9 !important;
}

html.rmtg-dark-mode .mega__title,
html.rmtg-dark-mode .dropdown__head strong,
html.rmtg-dark-mode .dropdown__item {
  color: #f8fafc !important;
}

html.rmtg-dark-mode .mega__desc,
html.rmtg-dark-mode .dropdown__head span {
  color: #94a3b8 !important;
}

html.rmtg-dark-mode .mega__link:hover,
html.rmtg-dark-mode .dropdown__item:hover,
html.rmtg-dark-mode .nav__link:hover,
html.rmtg-dark-mode .nav__trigger:hover,
html.rmtg-dark-mode .nav__item.is-open .nav__trigger {
  background: rgba(59, 130, 246, 0.14) !important;
  color: #ffffff !important;
}

html.rmtg-dark-mode .hero,
html.rmtg-dark-mode .page-hero,
html.rmtg-dark-mode .section,
html.rmtg-dark-mode .section--soft,
html.rmtg-dark-mode .site-footer,
html.rmtg-dark-mode footer {
  background: transparent !important;
  color: #e2e8f0 !important;
}

html.rmtg-dark-mode .site-footer,
html.rmtg-dark-mode footer {
  background: #050810 !important;
  border-top: 1px solid rgba(148, 163, 184, 0.12) !important;
}

html.rmtg-dark-mode .footer-bottom {
  border-top-color: rgba(148, 163, 184, 0.12) !important;
  color: #94a3b8 !important;
}

html.rmtg-dark-mode .site-footer a,
html.rmtg-dark-mode footer a {
  color: #cbd5e1 !important;
}

html.rmtg-dark-mode .site-footer a:hover,
html.rmtg-dark-mode footer a:hover {
  color: #93c5fd !important;
}

/* ---------- 2. Surfaces Niveau 1 (Cartes, Panels, Tables, Sidebars) ---------- */
html.rmtg-dark-mode .card,
html.rmtg-dark-mode .pricing-card,
html.rmtg-dark-mode .feature-card,
html.rmtg-dark-mode .brand-card,
html.rmtg-dark-mode .step-card,
html.rmtg-dark-mode .window,
html.rmtg-dark-mode .faq-item,
html.rmtg-dark-mode .rmtg-app-sidebar,
html.rmtg-dark-mode .rmtg-panel-card,
html.rmtg-dark-mode .rmtg-console-tile,
html.rmtg-dark-mode .rmtg-stage-top,
html.rmtg-dark-mode .rmtg-bento-card,
html.rmtg-dark-mode .glass-hero-card,
html.rmtg-dark-mode .auth-split,
html.rmtg-dark-mode .dd-overall-banner,
html.rmtg-dark-mode .dd-report-card,
html.rmtg-dark-mode .dd-service-card,
html.rmtg-dark-mode .scrolly-voxel,
html.rmtg-dark-mode .info-card,
html.rmtg-dark-mode .contact-form-card,
html.rmtg-dark-mode .erp-card,
html.rmtg-dark-mode .table-wrapper,
body.admin-dark-mode .admin-pro-header,
body.admin-dark-mode .admin-cockpit-nav,
body.admin-dark-mode .admin-sidebar-toggle,
body.admin-dark-mode .admin-kpi-card,
body.admin-dark-mode .admin-node-card,
body.admin-dark-mode .admin-box,
body.admin-dark-mode .table-wrapper {
  background: #0f1626 !important;
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
  color: #f1f5f9 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 34px -16px rgba(0, 0, 0, 0.65) !important;
}

html.rmtg-dark-mode .pricing-card--featured {
  background: linear-gradient(165deg, #131d33 0%, #171430 100%) !important;
  border: 1.5px solid rgba(124, 58, 237, 0.48) !important;
  box-shadow: 0 18px 44px -14px rgba(91, 33, 182, 0.32) !important;
}

/* ---------- 3. Admin Cockpit Spécifique (Menu déroulant + badges + lignes) ---------- */
body.admin-dark-mode .admin-nav-topbar {
  border-bottom-color: rgba(148, 163, 184, 0.14) !important;
}

body.admin-dark-mode .admin-nav-role-pill {
  background: rgba(124, 58, 237, 0.22) !important;
  color: #ddd6fe !important;
  border: 1px solid rgba(167, 139, 250, 0.25);
}

body.admin-dark-mode .admin-nav-mini-btn {
  background: #162033 !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #cbd5e1 !important;
}

body.admin-dark-mode .admin-nav-mini-btn:hover {
  background: rgba(124, 58, 237, 0.25) !important;
  color: #ffffff !important;
}

body.admin-dark-mode .admin-nav-cat__head {
  background: #162033 !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(148, 163, 184, 0.12) !important;
}

body.admin-dark-mode .admin-nav-cat__head:hover {
  background: rgba(124, 58, 237, 0.2) !important;
  color: #f8fafc !important;
}

body.admin-dark-mode .admin-nav-item {
  color: #cbd5e1 !important;
}

body.admin-dark-mode .admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
}

body.admin-dark-mode .admin-nav-item.is-active {
  background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(109, 40, 217, 0.35) !important;
}

body.admin-dark-mode .admin-pro-chip {
  background: rgba(124, 58, 237, 0.22) !important;
  color: #ddd6fe !important;
}

body.admin-dark-mode .admin-live-beacon {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #6ee7b7 !important;
}

body.admin-dark-mode .admin-row-item {
  background: #162033 !important;
  border-color: rgba(148, 163, 184, 0.14) !important;
}

body.admin-dark-mode .admin-row-item:hover {
  background: #1d2a42 !important;
  border-color: rgba(139, 92, 246, 0.5) !important;
}

/* ---------- 4. Typographie, Titres, Liens & Éléments Natifs ---------- */
html.rmtg-dark-mode h1,
html.rmtg-dark-mode h2,
html.rmtg-dark-mode h3,
html.rmtg-dark-mode h4,
html.rmtg-dark-mode h5,
html.rmtg-dark-mode strong,
body.admin-dark-mode .admin-pro-title,
body.admin-dark-mode .admin-kpi-value,
body.admin-dark-mode .admin-section-title,
body.admin-dark-mode .admin-box-title,
body.admin-dark-mode .admin-node-title {
  color: #f8fafc !important;
}

html.rmtg-dark-mode p,
html.rmtg-dark-mode li,
html.rmtg-dark-mode label,
html.rmtg-dark-mode .lead {
  color: #cbd5e1;
}

html.rmtg-dark-mode .muted,
html.rmtg-dark-mode .eyebrow,
html.rmtg-dark-mode .admin-kpi-label {
  color: #94a3b8 !important;
}

html.rmtg-dark-mode hr {
  border-color: rgba(148, 163, 184, 0.14) !important;
}

html.rmtg-dark-mode code,
html.rmtg-dark-mode pre,
html.rmtg-dark-mode kbd {
  background: #162033 !important;
  color: #93c5fd !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
}

/* ---------- 5. Formulaires, Boutons, Tableaux, Modales & Palette ---------- */
html.rmtg-dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html.rmtg-dark-mode select,
html.rmtg-dark-mode textarea,
html.rmtg-dark-mode .input,
html.rmtg-dark-mode .select,
html.rmtg-dark-mode .form-control,
html.rmtg-dark-mode .admin-search-input,
html.rmtg-dark-mode .field-input,
html.rmtg-dark-mode .field-select,
html.rmtg-dark-mode .field-textarea {
  background: #162033 !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  color: #f8fafc !important;
}

html.rmtg-dark-mode input::placeholder,
html.rmtg-dark-mode textarea::placeholder {
  color: #64748b !important;
}

html.rmtg-dark-mode input:focus,
html.rmtg-dark-mode select:focus,
html.rmtg-dark-mode textarea:focus,
html.rmtg-dark-mode .form-control:focus {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22) !important;
  outline: none !important;
}

html.rmtg-dark-mode .user-btn,
html.rmtg-dark-mode .icon-btn,
html.rmtg-dark-mode .cart-btn,
html.rmtg-dark-mode .btn-secondary,
html.rmtg-dark-mode .btn-executive-ghost,
html.rmtg-dark-mode .rmtg-mini-stat,
html.rmtg-dark-mode .rmtg-tab-btn:not(.is-active),
html.rmtg-dark-mode .rmtg-page-btn:not(.is-active) {
  background: #162033 !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #f1f5f9 !important;
}

html.rmtg-dark-mode .btn-secondary:hover,
html.rmtg-dark-mode .user-btn:hover,
html.rmtg-dark-mode .icon-btn:hover,
html.rmtg-dark-mode .cart-btn:hover,
html.rmtg-dark-mode .rmtg-tab-btn:not(.is-active):hover {
  background: #1e2b45 !important;
  border-color: rgba(96, 165, 250, 0.45) !important;
}

html.rmtg-dark-mode .btn-ghost,
html.rmtg-dark-mode .btn-outline {
  color: #e2e8f0 !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}

html.rmtg-dark-mode .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

html.rmtg-dark-mode table {
  color: #e2e8f0 !important;
}

html.rmtg-dark-mode th,
html.rmtg-dark-mode .table th,
html.rmtg-dark-mode .table-wrapper th {
  background: #162033 !important;
  color: #94a3b8 !important;
  border-bottom-color: rgba(148, 163, 184, 0.16) !important;
}

html.rmtg-dark-mode td,
html.rmtg-dark-mode .table td,
html.rmtg-dark-mode .table-wrapper td {
  color: #e2e8f0 !important;
  border-bottom-color: rgba(148, 163, 184, 0.1) !important;
}

html.rmtg-dark-mode tbody tr:hover td {
  background: rgba(59, 130, 246, 0.06) !important;
}

html.rmtg-dark-mode details {
  background: #101829 !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
  color: #e2e8f0 !important;
}

html.rmtg-dark-mode summary {
  color: #f8fafc !important;
}

html.rmtg-dark-mode #rmtgCmdPaletteModal > div,
html.rmtg-dark-mode .modal > div,
html.rmtg-dark-mode #rmtgPwaInstallBar {
  background: #111a2e !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #f8fafc !important;
}

/* Badges neutres */
html.rmtg-dark-mode .badge--neutral,
html.rmtg-dark-mode .badge-neutral {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

/* ---------- 6. Neutralisation des styles inline clairs dans les vues Blade ---------- */
html.rmtg-dark-mode [style*="background: #fff"],
html.rmtg-dark-mode [style*="background:#fff"],
html.rmtg-dark-mode [style*="background: #ffffff"],
html.rmtg-dark-mode [style*="background:#ffffff"],
html.rmtg-dark-mode [style*="background-color: #ffffff"],
html.rmtg-dark-mode [style*="background-color: #fff"],
html.rmtg-dark-mode [style*="background: linear-gradient(135deg, #ffffff"] {
  background: #0f1626 !important;
  background-image: none !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
  color: #f1f5f9 !important;
}

html.rmtg-dark-mode [style*="background: #f8fafc"],
html.rmtg-dark-mode [style*="background:#f8fafc"],
html.rmtg-dark-mode [style*="background: #f1f5f9"],
html.rmtg-dark-mode [style*="background:#f1f5f9"],
html.rmtg-dark-mode [style*="background: #f9fafb"],
html.rmtg-dark-mode [style*="background:#f9fafb"],
html.rmtg-dark-mode [style*="background: #fbfafd"],
html.rmtg-dark-mode [style*="background: var(--bg-soft"] {
  background: #162033 !important;
  background-image: none !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
}

/* Encarts pastel sémantiques -> teintes translucides sombres haute lisibilité */
html.rmtg-dark-mode [style*="background: #eff6ff"],
html.rmtg-dark-mode [style*="background: #dbeafe"],
html.rmtg-dark-mode [style*="background: #e0f2fe"],
html.rmtg-dark-mode [style*="background: linear-gradient(135deg, #eff6ff"] {
  background: rgba(37, 99, 235, 0.14) !important;
  border-color: rgba(96, 165, 250, 0.3) !important;
}

html.rmtg-dark-mode [style*="background: #f5f3ff"],
html.rmtg-dark-mode [style*="background: #faf5ff"],
html.rmtg-dark-mode [style*="background: #ede9fe"],
html.rmtg-dark-mode [style*="background: #f3e8ff"],
html.rmtg-dark-mode [style*="background: linear-gradient(135deg, #f5f3ff"] {
  background: rgba(124, 58, 237, 0.16) !important;
  border-color: rgba(167, 139, 250, 0.3) !important;
}

html.rmtg-dark-mode [style*="background: #fef2f2"],
html.rmtg-dark-mode [style*="background: #fee2e2"] {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(248, 113, 113, 0.3) !important;
}

html.rmtg-dark-mode [style*="background: #fff7ed"],
html.rmtg-dark-mode [style*="background: #fef3c7"],
html.rmtg-dark-mode [style*="background: #fefce8"],
html.rmtg-dark-mode [style*="background: #fffbeb"] {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(251, 191, 36, 0.3) !important;
}

html.rmtg-dark-mode [style*="background: #f0fdf4"],
html.rmtg-dark-mode [style*="background: #ecfdf5"],
html.rmtg-dark-mode [style*="background: #d1fae5"] {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(52, 211, 153, 0.3) !important;
}

/* Couleurs de texte sombres codées en dur -> lisibles sur fond nuit */
html.rmtg-dark-mode [style*="color: #0f172a"],
html.rmtg-dark-mode [style*="color:#0f172a"],
html.rmtg-dark-mode [style*="color: #1e293b"],
html.rmtg-dark-mode [style*="color: #111827"],
html.rmtg-dark-mode [style*="color: #1d1b29"] {
  color: #f8fafc !important;
}

html.rmtg-dark-mode [style*="color: #334155"],
html.rmtg-dark-mode [style*="color: #3f3b4f"],
html.rmtg-dark-mode [style*="color: #475569"],
html.rmtg-dark-mode [style*="color: #64748b"],
html.rmtg-dark-mode [style*="color: #716d84"] {
  color: #cbd5e1 !important;
}

html.rmtg-dark-mode [style*="color: #1e3a8a"],
html.rmtg-dark-mode [style*="color: #1d4ed8"] {
  color: #93c5fd !important;
}

html.rmtg-dark-mode [style*="color: #5b21b6"],
html.rmtg-dark-mode [style*="color: #6d28d9"],
html.rmtg-dark-mode [style*="color: #3b206b"] {
  color: #c4b5fd !important;
}

html.rmtg-dark-mode [style*="color: #c2410c"],
html.rmtg-dark-mode [style*="color: #9a3412"] {
  color: #fdba74 !important;
}

html.rmtg-dark-mode [style*="color: #065f46"],
html.rmtg-dark-mode [style*="color: #047857"] {
  color: #6ee7b7 !important;
}

/* Préservation du texte blanc sur boutons & éléments colorés */
html.rmtg-dark-mode .btn-primary,
html.rmtg-dark-mode .btn-primary *,
html.rmtg-dark-mode .btn-danger,
html.rmtg-dark-mode .btn-danger *,
html.rmtg-dark-mode .admin-nav-item.is-active,
html.rmtg-dark-mode .admin-nav-item.is-active *,
html.rmtg-dark-mode .rmtg-page-btn.is-active,
html.rmtg-dark-mode .auth-split__aside,
html.rmtg-dark-mode .auth-split__aside h1,
html.rmtg-dark-mode .auth-split__aside h2,
html.rmtg-dark-mode .auth-split__aside p,
html.rmtg-dark-mode .auth-split__aside li {
  color: #ffffff !important;
}

/* Scrollbars discrètes en mode sombre */
html.rmtg-dark-mode ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
html.rmtg-dark-mode ::-webkit-scrollbar-track {
  background: #0b111e;
}
html.rmtg-dark-mode ::-webkit-scrollbar-thumb {
  background: #27354f;
  border-radius: 999px;
}
html.rmtg-dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #3b4f75;
}
