/* ==================================================================
   WFACTURA - MODE SOMBRE GLOBAL
   Chargee en dernier. Toutes les regles conditionnelles sont prefixees
   par html[data-theme="dark"] ; la bascule se fait via l'attribut
   data-theme pose sur <html> (localStorage, voir header.php/footer.php).
   Couleur dominante : vert. Palette Slate, jamais de noir pur.
   ================================================================== */

/* ------------------------------------------------------------------
   0. JETONS SOMBRES
------------------------------------------------------------------ */
html[data-theme="dark"] {
    color-scheme: dark;

    /* Jetons generiques reutilises par main.css */
    --wf-bg: #0b1025;
    --wf-surface: rgba(30, 41, 59, 0.72);
    --wf-card: #1e293b;
    --wf-card-border: rgba(255, 255, 255, 0.08);
    --wf-text: #e2e8f0;
    --wf-muted: #94a3b8;
    --wf-line: rgba(255, 255, 255, 0.10);
    --wf-primary: #22c55e;
    --wf-primary-dark: #16a34a;
    --wf-primary-soft: rgba(34, 197, 94, 0.14);
    --wf-dark: #0f172a;
    --wf-white: #1e293b;
    --wf-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    --wf-field-pale: #0f172a;

    /* Palette propre au mode sombre */
    --d-bg: #0b1025;
    --d-surface: #1e293b;
    --d-surface-2: rgba(255, 255, 255, 0.04);
    --d-hover: rgba(255, 255, 255, 0.06);
    --d-line: rgba(255, 255, 255, 0.10);
    --d-text: #e2e8f0;
    --d-muted: #94a3b8;
    --d-green: #22c55e;
    --d-green-text: #4ade80;
    --d-green-soft: rgba(34, 197, 94, 0.14);
    --d-blue-soft: rgba(56, 189, 248, 0.14);
    --d-blue-text: #7dd3fc;
    --d-orange-soft: rgba(245, 158, 11, 0.15);
    --d-orange-text: #fbbf24;
    --d-red-soft: rgba(239, 68, 68, 0.15);
    --d-red-text: #f87171;
    --d-violet-soft: rgba(167, 139, 250, 0.15);
    --d-violet-text: #c4b5fd;
    --d-input: #0f172a;
}

/* ------------------------------------------------------------------
   1. BASE / CHROME GLOBAL
------------------------------------------------------------------ */
html[data-theme="dark"] body {
    background-color: #0b1025;
    color: #e2e8f0;
}

html[data-theme="dark"] a,
html[data-theme="dark"] a:hover,
html[data-theme="dark"] a:focus {
    color: #4ade80;
}

html[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

html[data-theme="dark"] hr {
    border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] ::selection {
    background: rgba(34, 197, 94, 0.30);
    color: #f8fafc;
}

html[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: transparent;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

/* ------------------------------------------------------------------
   2. COQUE D'ADMINISTRATION (shell)
------------------------------------------------------------------ */
html[data-theme="dark"] body.wf-admin-shell {
    background: #0b1025;
}

html[data-theme="dark"] .content-wrapper {
    background-color: transparent;
}

html[data-theme="dark"] .page-wrapper {
    background-color: #0b1025;
}

html[data-theme="dark"] .header.wf-shell-header {
    background: rgba(15, 23, 42, 0.86);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .wf-shell-topbar .nav-link,
html[data-theme="dark"] .wf-shell-topbar .js-sidebar-toggler {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .wf-shell-topbar .nav-link:hover,
html[data-theme="dark"] .wf-shell-topbar .js-sidebar-toggler:hover {
    background: var(--wf-primary-soft);
    color: #4ade80;
}

html[data-theme="dark"] .wf-shell-kicker {
    color: #94a3b8;
}
html[data-theme="dark"] .wf-shell-header-copy strong {
    color: #e2e8f0;
}

html[data-theme="dark"] .wf-shell-user > .nav-link {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .wf-shell-user > .nav-link:hover {
    background: var(--wf-primary-soft);
    border-color: rgba(34, 197, 94, 0.30);
}
html[data-theme="dark"] .wf-shell-user-name { color: #e2e8f0; }
html[data-theme="dark"] .wf-shell-user-role { color: #94a3b8; }

html[data-theme="dark"] .page-footer {
    background-color: #0f172a;
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ------------------------------------------------------------------
   3. COMPOSANTS GENERIQUES (main.css / bootstrap)
------------------------------------------------------------------ */
/* Cartes / ibox */
html[data-theme="dark"] .ibox {
    background-color: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color: #e2e8f0;
}
html[data-theme="dark"] .ibox .ibox-head {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .ibox .ibox-head .ibox-title small {
    color: #94a3b8;
}
html[data-theme="dark"] .ibox .ibox-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .card {
    background-color: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Tableaux */
html[data-theme="dark"] .table {
    color: #e2e8f0;
}
html[data-theme="dark"] .table > tbody > tr > th,
html[data-theme="dark"] .table > tbody > tr > td,
html[data-theme="dark"] .table > tfoot > tr > th,
html[data-theme="dark"] .table > tfoot > tr > td {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .table thead th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1;
}
html[data-theme="dark"] .table-bordered {
    border: 1px solid rgba(255, 255, 255, 0.10);
}
html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.03);
}
html[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
html[data-theme="dark"] .table tr.success > td { background-color: rgba(34, 197, 94, 0.12) !important; }
html[data-theme="dark"] .table tr.info > td    { background-color: rgba(56, 189, 248, 0.12) !important; }
html[data-theme="dark"] .table tr.warning > td { background-color: rgba(245, 158, 11, 0.14) !important; }
html[data-theme="dark"] .table tr.danger > td  { background-color: rgba(239, 68, 68, 0.14) !important; }

/* Modales */
html[data-theme="dark"] .modal-content {
    background-color: #1e293b;
    color: #e2e8f0;
}
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .modal-header .close {
    color: #cbd5e1;
    text-shadow: none;
}
html[data-theme="dark"] .modal-backdrop.in,
html[data-theme="dark"] .modal-backdrop.show {
    opacity: 0.6;
}

/* Menus deroulants */
html[data-theme="dark"] .dropdown-menu {
    background-color: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .dropdown-menu .dropdown-item,
html[data-theme="dark"] .dropdown-menu > li > a {
    color: #e2e8f0;
}
html[data-theme="dark"] .dropdown-menu .dropdown-item:hover,
html[data-theme="dark"] .dropdown-menu .dropdown-item:focus,
html[data-theme="dark"] .dropdown-menu > li > a:hover,
html[data-theme="dark"] .dropdown-menu > li > a:focus {
    background-color: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
}
html[data-theme="dark"] .dropdown-menu .active > a,
html[data-theme="dark"] .dropdown-menu .active > a:hover,
html[data-theme="dark"] .dropdown-menu .active > a:focus,
html[data-theme="dark"] .dropdown-menu .dropdown-item.active,
html[data-theme="dark"] .dropdown-menu .dropdown-item.active:hover,
html[data-theme="dark"] .dropdown-menu .dropdown-item.active:focus {
    background-color: rgba(34, 197, 94, 0.14);
    color: #e2e8f0;
}
html[data-theme="dark"] .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.10);
}
html[data-theme="dark"] .wf-shell-user .dropdown-item.wf-shell-logout {
    color: #f87171;
}
html[data-theme="dark"] .wf-shell-user .dropdown-item.wf-shell-logout:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

/* Formulaires : annule le fond pale force en !important de main.css */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] select,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] input:not([type]),
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] input[type="month"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="week"],
html[data-theme="dark"] input[type="file"] {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}
html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #64748b;
}
html[data-theme="dark"] .form-control[readonly],
html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] input[readonly],
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] textarea[readonly],
html[data-theme="dark"] textarea:disabled,
html[data-theme="dark"] select:disabled {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: #94a3b8 !important;
    opacity: 1;
}
html[data-theme="dark"] .custom-control-indicator {
    background-color: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.20);
}
html[data-theme="dark"] .custom-control-description {
    color: #cbd5e1;
}
html[data-theme="dark"] .input-group-text {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
}

/* Alertes */
html[data-theme="dark"] .alert-success { background-color: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.30); color: #bbf7d0; }
html[data-theme="dark"] .alert-info    { background-color: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.30); color: #bae6fd; }
html[data-theme="dark"] .alert-warning { background-color: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.30); color: #fde68a; }
html[data-theme="dark"] .alert-danger  { background-color: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.30); color: #fecaca; }
html[data-theme="dark"] .alert a {
    color: inherit;
    text-decoration: underline;
}

/* Badges bootstrap */
html[data-theme="dark"] .badge-primary   { background-color: rgba(99, 102, 241, 0.20); color: #c7d2fe; }
html[data-theme="dark"] .badge-success   { background-color: rgba(34, 197, 94, 0.20); color: #bbf7d0; }
html[data-theme="dark"] .badge-info      { background-color: rgba(56, 189, 248, 0.20); color: #bae6fd; }
html[data-theme="dark"] .badge-warning   { background-color: rgba(245, 158, 11, 0.20); color: #fde68a; }
html[data-theme="dark"] .badge-danger    { background-color: rgba(239, 68, 68, 0.20); color: #fecaca; }
html[data-theme="dark"] .badge-secondary,
html[data-theme="dark"] .badge-default   { background-color: rgba(255, 255, 255, 0.10); color: #cbd5e1; }
html[data-theme="dark"] .badge-light     { background-color: rgba(255, 255, 255, 0.10); color: #cbd5e1; }

/* Onglets */
html[data-theme="dark"] .nav-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.10);
}
html[data-theme="dark"] .nav-tabs .nav-link {
    color: #94a3b8;
}
html[data-theme="dark"] .nav-tabs .nav-link.active,
html[data-theme="dark"] .nav-tabs .nav-item.show .nav-link {
    color: #4ade80;
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.10) rgba(255, 255, 255, 0.10) transparent;
}
html[data-theme="dark"] .nav-pills .nav-link.active {
    background-color: rgba(34, 197, 94, 0.18);
    color: #e2e8f0;
}

/* Pagination */
html[data-theme="dark"] .page-link {
    background-color: #1e293b;
    border-color: rgba(255, 255, 255, 0.10);
    color: #cbd5e1;
}
html[data-theme="dark"] .page-link:hover,
html[data-theme="dark"] .page-link:focus {
    background-color: rgba(255, 255, 255, 0.06);
    color: #4ade80;
}
html[data-theme="dark"] .page-item.disabled .page-link {
    background-color: #1e293b;
    border-color: rgba(255, 255, 255, 0.06);
    color: #64748b;
}

/* Fil d'Ariane, titres de page */
html[data-theme="dark"] .breadcrumb {
    background-color: transparent;
}
html[data-theme="dark"] .page-heading .page-title {
    color: #e2e8f0;
}

/* Boutons clairs bootstrap */
html[data-theme="dark"] .btn-default,
html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .btn-secondary {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}
html[data-theme="dark"] .btn-default:hover,
html[data-theme="dark"] .btn-light:hover,
html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

/* ------------------------------------------------------------------
   4. DATATABLES
------------------------------------------------------------------ */
html[data-theme="dark"] .dataTables_wrapper {
    color: #e2e8f0;
}
html[data-theme="dark"] .dataTables_filter input,
html[data-theme="dark"] .dataTables_length select {
    background-color: #0f172a;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
}
html[data-theme="dark"] .dataTables_info,
html[data-theme="dark"] .dataTables_filter label,
html[data-theme="dark"] .dataTables_length label {
    color: #94a3b8;
}
html[data-theme="dark"] .dataTables_paginate .paginate_button {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    color: #cbd5e1 !important;
}
html[data-theme="dark"] .dataTables_paginate .paginate_button.current,
html[data-theme="dark"] .dataTables_paginate .paginate_button.current:hover {
    background: rgba(34, 197, 94, 0.22) !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .dataTables_paginate .paginate_button.disabled {
    color: #64748b !important;
}

/* ------------------------------------------------------------------
   5. SYSTEME .wfg- (config-pages)
------------------------------------------------------------------ */
html[data-theme="dark"] .wfg-page {
    --wfg-green-50: #0f2a1c;
    --wfg-green-100: #14351f;
    --wfg-ink: #e2e8f0;
    --wfg-muted: #94a3b8;
    --wfg-line: rgba(255, 255, 255, 0.10);
    background:
        radial-gradient(circle at 10% -10%, rgba(34, 197, 94, 0.10), transparent 42%),
        radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.06), transparent 38%),
        #0b1025;
    color: #e2e8f0;
}
html[data-theme="dark"] .wfg-card,
html[data-theme="dark"] .wfg-completion--panel,
html[data-theme="dark"] .wfg-info-card,
html[data-theme="dark"] .wfg-feature,
html[data-theme="dark"] .wfg-feature-check,
html[data-theme="dark"] .wfg-modal-footer {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}
html[data-theme="dark"] .wfg-card-head {
    background: linear-gradient(180deg, #243247, #1e293b);
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .wfg-info-card--accent { background: rgba(34, 197, 94, 0.08); }
html[data-theme="dark"] .wfg-feature:hover { background: var(--d-hover); }
html[data-theme="dark"] .wfg-modal-body { background: #172033; }
html[data-theme="dark"] .wfg-input,
html[data-theme="dark"] .wfg-textarea,
html[data-theme="dark"] .wfg-select {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .wfg-table thead th { background: rgba(255, 255, 255, 0.04); color: #cbd5e1; }
html[data-theme="dark"] .wfg-table tbody tr:hover td { background: rgba(255, 255, 255, 0.04); }
html[data-theme="dark"] .wfg-code,
html[data-theme="dark"] .wfg-index,
html[data-theme="dark"] .wfg-alpha2 { background: rgba(255, 255, 255, 0.05); color: #cbd5e1; }
html[data-theme="dark"] .wfg-currency,
html[data-theme="dark"] .wfg-rc { background: rgba(255, 255, 255, 0.05); }

/* Numero de registre de commerce : c'est un identifiant legal que l'on
   recopie a la main, il doit rester lisible en un coup d'oeil. Le gris
   #475467 de la palette claire disparait sur la surface sombre. */
html[data-theme="dark"] .wfg-rc {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

/* Echeance de plan et periodicite de facturation : ecrites en #2b3a33
   dans la palette claire, elles s'effacaient completement sur la
   surface sombre alors que ce sont les deux informations que l'on
   vient lire dans la liste des abonnes. */
html[data-theme="dark"] .wfg-date,
html[data-theme="dark"] .wfg-session {
    color: #ffffff;
}
html[data-theme="dark"] .wfg-progress { background: rgba(255, 255, 255, 0.08); }

/* Chips et boutons de statut .wfg- */
html[data-theme="dark"] .wfg-alert,
html[data-theme="dark"] .wfg-status--active,
html[data-theme="dark"] .wfg-status--success,
html[data-theme="dark"] .wfg-btn--show,
html[data-theme="dark"] .wfg-btn--soft,
html[data-theme="dark"] .wfg-count--green {
    background: var(--d-green-soft);
    color: var(--d-green-text);
}
html[data-theme="dark"] .wfg-btn--show:hover,
html[data-theme="dark"] .wfg-btn--soft:hover,
html[data-theme="dark"] .wfg-btn--soft:hover {
    background: rgba(34, 197, 94, 0.22);
}
html[data-theme="dark"] .wfg-alert--info,
html[data-theme="dark"] .wfg-plan,
html[data-theme="dark"] .wfg-btn--edit,
html[data-theme="dark"] .wfg-count--blue {
    background: var(--d-blue-soft);
    color: var(--d-blue-text);
}
html[data-theme="dark"] .wfg-btn--edit:hover { background: rgba(56, 189, 248, 0.22); }
html[data-theme="dark"] .wfg-alert--danger { background: var(--d-red-soft); border-color: rgba(239, 68, 68, 0.35); }
html[data-theme="dark"] .wfg-alert--warn { background: var(--d-orange-soft); border-color: rgba(245, 158, 11, 0.35); }
html[data-theme="dark"] .wfg-status--wait,
html[data-theme="dark"] .wfg-btn--hide { background: var(--d-orange-soft); color: var(--d-orange-text); }
html[data-theme="dark"] .wfg-btn--hide:hover { background: rgba(245, 158, 11, 0.24); }
html[data-theme="dark"] .wfg-btn--danger,
html[data-theme="dark"] .wfg-status--danger { background: var(--d-red-soft); color: var(--d-red-text); }
html[data-theme="dark"] .wfg-btn--danger:hover { background: rgba(239, 68, 68, 0.24); }
html[data-theme="dark"] .wfg-status--neutral,
html[data-theme="dark"] .wfg-status--hidden,
html[data-theme="dark"] .wfg-status--done,
html[data-theme="dark"] .wfg-btn--neutral,
html[data-theme="dark"] .wfg-count--grey { background: rgba(255, 255, 255, 0.06); color: #cbd5e1; }
html[data-theme="dark"] .wfg-btn--neutral:hover { background: rgba(255, 255, 255, 0.10); }

/* ------------------------------------------------------------------
   6. SYSTEME .wfm- (modules-pages)
------------------------------------------------------------------ */
html[data-theme="dark"] .wfm-page {
    --wfm-green-50: #0f2a1c;
    --wfm-green-100: #14351f;
    --wfm-ink: #e2e8f0;
    --wfm-muted: #94a3b8;
    --wfm-line: rgba(255, 255, 255, 0.10);
    background:
        radial-gradient(circle at 10% -10%, rgba(34, 197, 94, 0.10), transparent 42%),
        radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.06), transparent 38%),
        #0b1025;
    color: #e2e8f0;
}
html[data-theme="dark"] .wfm-card,
html[data-theme="dark"] .wfm-kpi,
html[data-theme="dark"] .wfm-tpl-card,
html[data-theme="dark"] .wfm-modal .modal-footer {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}
html[data-theme="dark"] .wfm-card-head {
    background: linear-gradient(180deg, #243247, #1e293b);
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .wfm-modal .modal-body { background: #172033; }
html[data-theme="dark"] .wfm-input,
html[data-theme="dark"] .wfm-textarea,
html[data-theme="dark"] .wfm-select,
html[data-theme="dark"] textarea.wfm-editor {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .wfm-page .trumbowyg-box .trumbowyg-editor { background: #0f172a; color: #e2e8f0; }
html[data-theme="dark"] .wfm-page .trumbowyg-box .trumbowyg-toolbar { background: rgba(255, 255, 255, 0.05) !important; }
html[data-theme="dark"] .wfm-table thead th { background: rgba(255, 255, 255, 0.04); color: #cbd5e1; }
html[data-theme="dark"] .wfm-table tbody tr:hover td { background: rgba(255, 255, 255, 0.04); }
html[data-theme="dark"] .wfm-code,
html[data-theme="dark"] .wfm-index { background: rgba(255, 255, 255, 0.05); color: #cbd5e1; }
html[data-theme="dark"] .wfm-currency { background: rgba(255, 255, 255, 0.05); }

/* Bornes de validite d'un coupon : #2b3a33 dans la palette claire,
   illisible sur la surface sombre alors que ce sont les deux dates que
   l'on vient comparer dans la liste. */
html[data-theme="dark"] .wfm-date { color: #ffffff; }

/* Liste des affilies : prenoms et localisation en blanc ; les trois
   montants reprennent le code couleur des indicateurs (montant
   d'abonnement, deja percu, restant a percevoir). */
html[data-theme="dark"] .wfm-firstname,
html[data-theme="dark"] .wfm-location,
html[data-theme="dark"] .wfm-location .wfm-muted { color: #ffffff; }

html[data-theme="dark"] .wfm-amount--mt { color: var(--d-orange-text); }
html[data-theme="dark"] .wfm-amount--percu { color: var(--d-green-text); }
html[data-theme="dark"] .wfm-amount--apercevoir { color: var(--d-blue-text); }

/* Indicateur de structure du mot de passe (page profil et
   reinitialisation) : la carte de force est peinte en #fbfdfb avec des
   criteres gris clair, ce qui donnait un paté blanc sur la surface
   sombre. On la traite comme un champ : surface enfoncee, texte lisible. */
html[data-theme="dark"] .wf-pwd-strength {
    --wfp-track: rgba(255, 255, 255, 0.12);
    --wfp-excellent: #22c55e;
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .wf-pwd-label { color: #94a3b8; }

html[data-theme="dark"] .wf-pwd-rule { color: #94a3b8; }

html[data-theme="dark"] .wf-pwd-rule i {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

html[data-theme="dark"] .wf-pwd-rule.is-valid { color: #4ade80; }
html[data-theme="dark"] .wfm-map { background: #0f172a; }
html[data-theme="dark"] .wfm-tpl-thumb { background: #0f172a; }

/* Chips et statuts .wfm- */
html[data-theme="dark"] .wfm-alert,
html[data-theme="dark"] .wfm-badge--green,
html[data-theme="dark"] .wfm-btn--soft,
html[data-theme="dark"] .wfm-back,
html[data-theme="dark"] .wfm-status--success,
html[data-theme="dark"] .wfm-status--valide,
html[data-theme="dark"] .wfm-tpl-num {
    background: var(--d-green-soft);
    color: var(--d-green-text);
}
html[data-theme="dark"] .wfm-btn--soft:hover,
html[data-theme="dark"] .wfm-back:hover { background: rgba(34, 197, 94, 0.22); }
html[data-theme="dark"] .wfm-alert--info,
html[data-theme="dark"] .wfm-badge--blue,
html[data-theme="dark"] .wfm-btn--edit {
    background: var(--d-blue-soft);
    color: var(--d-blue-text);
}
html[data-theme="dark"] .wfm-btn--edit:hover { background: rgba(56, 189, 248, 0.22); }
html[data-theme="dark"] .wfm-alert--warn,
html[data-theme="dark"] .wfm-badge--orange,
html[data-theme="dark"] .wfm-status--neutral,
html[data-theme="dark"] .wfm-status--attente,
html[data-theme="dark"] .wfm-kpi--orange .wfm-kpi-icone { background: var(--d-orange-soft); color: var(--d-orange-text); }
html[data-theme="dark"] .wfm-alert--danger,
html[data-theme="dark"] .wfm-badge,
html[data-theme="dark"] .wfm-btn--danger,
html[data-theme="dark"] .wfm-status--danger,
html[data-theme="dark"] .wfm-status--banni,
html[data-theme="dark"] .wfm-kpi--red .wfm-kpi-icone { background: var(--d-red-soft); color: var(--d-red-text); }
html[data-theme="dark"] .wfm-badge--violet,
html[data-theme="dark"] .wfm-kpi--violet .wfm-kpi-icone { background: var(--d-violet-soft); color: var(--d-violet-text); }
html[data-theme="dark"] .wfm-btn--danger:hover { background: rgba(239, 68, 68, 0.24); }
html[data-theme="dark"] .wfm-btn--neutral { background: rgba(255, 255, 255, 0.06); color: #cbd5e1; }
html[data-theme="dark"] .wfm-btn--neutral:hover { background: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .wfm-badge:not([class*="badge--"]) { background: rgba(255, 255, 255, 0.08); color: #cbd5e1; }

/* ------------------------------------------------------------------
   7. SYSTEME PROFIL .pf-
------------------------------------------------------------------ */
html[data-theme="dark"] .pf-page {
    --pf-green-50: #0f2a1c;
    --pf-green-100: #14351f;
    --pf-ink: #e2e8f0;
    --pf-muted: #94a3b8;
    --pf-line: rgba(255, 255, 255, 0.10);
    background:
        radial-gradient(circle at 10% -10%, rgba(34, 197, 94, 0.10), transparent 42%),
        radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.06), transparent 38%),
        #0b1025;
    color: #e2e8f0;
}
html[data-theme="dark"] .pf-main,
html[data-theme="dark"] .pf-nav,
html[data-theme="dark"] .pf-qr-card,
html[data-theme="dark"] .pf-qr-image,
html[data-theme="dark"] .pf-step {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}
html[data-theme="dark"] .pf-action-card,
html[data-theme="dark"] .pf-qr-setup,
html[data-theme="dark"] .pf-recovery-item { background: #172033; border-color: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .pf-action-card-danger,
html[data-theme="dark"] .pf-btn-danger,
html[data-theme="dark"] .pf-recovery-item-used { background: var(--d-red-soft); color: var(--d-red-text); }
html[data-theme="dark"] .pf-btn-danger:hover { background: rgba(239, 68, 68, 0.24); }
html[data-theme="dark"] .pf-btn-outline,
html[data-theme="dark"] .pf-chip-on { background: rgba(255, 255, 255, 0.06); color: #e2e8f0; border-color: rgba(255, 255, 255, 0.12); }
html[data-theme="dark"] .pf-input {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .pf-input:disabled,
html[data-theme="dark"] .pf-input-disabled { background: rgba(255, 255, 255, 0.04) !important; color: #94a3b8 !important; }
html[data-theme="dark"] .pf-alert,
html[data-theme="dark"] .pf-status-enabled { background: var(--d-green-soft); color: var(--d-green-text); }
html[data-theme="dark"] .pf-alert-warning,
html[data-theme="dark"] .pf-note-warn { background: var(--d-orange-soft); color: var(--d-orange-text); }
html[data-theme="dark"] .pf-nav-list .nav-link i { background: rgba(255, 255, 255, 0.06); }

/* ------------------------------------------------------------------
   8. SYSTEME SUPPORT / TICKETS .wfs- / .wft-
------------------------------------------------------------------ */
html[data-theme="dark"] .wfs-page,
html[data-theme="dark"] .wft-page {
    --wfs-green-50: #0f2a1c;
    --wfs-green-100: #14351f;
    --wfs-ink: #e2e8f0;
    --wfs-muted: #94a3b8;
    --wfs-line: rgba(255, 255, 255, 0.10);
    background:
        radial-gradient(circle at 10% -10%, rgba(34, 197, 94, 0.10), transparent 42%),
        radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.06), transparent 38%),
        #0b1025;
    color: #e2e8f0;
}
html[data-theme="dark"] .wfs-card,
html[data-theme="dark"] .wft-conv,
html[data-theme="dark"] .wft-side,
html[data-theme="dark"] .wft-reply,
html[data-theme="dark"] .wft-msg--user .wft-bubble,
html[data-theme="dark"] .wft-textarea:focus {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}
html[data-theme="dark"] .wft-thread,
html[data-theme="dark"] .wft-closed,
html[data-theme="dark"] .wft-textarea { background: #172033; border-color: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .wfs-dept,
html[data-theme="dark"] .wft-avatar { background: rgba(255, 255, 255, 0.06); color: #cbd5e1; }
html[data-theme="dark"] .wfs-table thead th { background: rgba(255, 255, 255, 0.04); color: #cbd5e1; }
html[data-theme="dark"] .wfs-table tbody tr:hover td { background: rgba(255, 255, 255, 0.04); }
html[data-theme="dark"] .wfs-alert,
html[data-theme="dark"] .wft-reply-alert,
html[data-theme="dark"] .wfs-status-answered { background: var(--d-green-soft); color: var(--d-green-text); }
html[data-theme="dark"] .wfs-alert--info { background: var(--d-blue-soft); color: var(--d-blue-text); }
html[data-theme="dark"] .wfs-status-open { background: var(--d-orange-soft); color: var(--d-orange-text); }
html[data-theme="dark"] .wfs-status-closed { background: var(--d-red-soft); color: var(--d-red-text); }
html[data-theme="dark"] .wfs-status-neutral,
html[data-theme="dark"] .wfs-status-waiting { background: rgba(255, 255, 255, 0.06); color: #cbd5e1; }
html[data-theme="dark"] .wfs-btn-soft:hover { background: rgba(34, 197, 94, 0.22); }

/* Cellules dont le texte etait fige en clair sur la liste des tickets :
   le code ticket repose sur une pastille verte (--wfs-green-50, redecliné
   en sombre) que l'on conserve ; seul le texte passe en blanc. La date de
   creation, ecrite en gris-vert, devient egalement blanche. */
html[data-theme="dark"] .wfs-code { color: #ffffff; }
html[data-theme="dark"] .wfs-date { color: #ffffff; }

/* Detail d'un ticket : les valeurs du panneau lateral (code, objet, date,
   nombre de messages) etaient en bleu nuit sur la surface sombre. */
html[data-theme="dark"] .wft-info-label { color: #94a3b8; }
html[data-theme="dark"] .wft-info-value { color: #ffffff; }
html[data-theme="dark"] .wft-info-row { border-bottom-color: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .wft-empty h3,
html[data-theme="dark"] .wft-closed strong { color: #e2e8f0; }
html[data-theme="dark"] .wft-closed { color: #94a3b8; }

/* ------------------------------------------------------------------
   9. AUTHENTIFICATION (login)
------------------------------------------------------------------ */
html[data-theme="dark"] body.wf-login-page,
html[data-theme="dark"] .wf-login-page {
    --wf-ink: #e2e8f0;
    --wf-ink-muted: #94a3b8;
    --wf-line: rgba(255, 255, 255, 0.12);
    --wf-green-50: #0f2a1c;
    --wf-green-100: #14351f;
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.10), transparent 30%),
        radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.4), transparent 28%),
        linear-gradient(135deg, #0b1025 0%, #0f172a 100%);
    color: #e2e8f0;
}
html[data-theme="dark"] .wf-login-page .wf-auth-panel-form {
    background: radial-gradient(circle at 85% 10%, rgba(34, 197, 94, 0.06), transparent 42%), #0f172a;
}
html[data-theme="dark"] .wf-login-page .wf-login-card { background: #1e293b; border-color: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .wf-login-page .wf-input { background: #0f172a; color: #e2e8f0; border-color: rgba(255, 255, 255, 0.12); }
html[data-theme="dark"] .wf-login-page .wf-input:focus { background: #131c33; }
html[data-theme="dark"] .wf-login-page .wf-alert-box { background: var(--d-red-soft); color: var(--d-red-text); }

/* ------------------------------------------------------------------
   10. BOUTON DE BASCULE (ajustements sombres)
------------------------------------------------------------------ */
html[data-theme="dark"] .wf-shell-theme-slot {
    border-left-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .wf-theme-toggle {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme="dark"] .wf-theme-toggle-thumb {
    background: #22c55e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transform: translateX(30px);
}
html[data-theme="dark"] .wf-theme-toggle-ic--sun {
    color: #64748b;
}
html[data-theme="dark"] .wf-theme-toggle-ic--moon {
    color: #22c55e;
}

/* ------------------------------------------------------------------
   11. TRANSITIONS DOUCES AU CHANGEMENT DE THEME
------------------------------------------------------------------ */
html.wf-theme-anim,
html.wf-theme-anim * {
    transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

/* ------------------------------------------------------------------
   12. SYSTEME .wfd- (tableau de bord / dashboard-pages)
   Le tableau de bord porte ses propres jetons sous .wfd-page : on les
   redefinit ici plutot que de repeter chaque regle, ce qui couvre d'un
   coup les bordures, les libelles et les fonds d'icones pale
   (--wfd-green-50). Restent les surfaces figees en blanc dans
   dashboard-pages.css, reprises ci-dessous.
------------------------------------------------------------------ */
html[data-theme="dark"] .wfd-page {
    --wfd-green-50: rgba(34, 197, 94, 0.14);
    --wfd-ink: #e2e8f0;
    --wfd-muted: #94a3b8;
    --wfd-line: rgba(255, 255, 255, 0.10);
    background:
        radial-gradient(circle at 10% -10%, rgba(34, 197, 94, 0.10), transparent 42%),
        radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.06), transparent 38%),
        #0b1025;
    color: #e2e8f0;
}

/* Accents des cartes d'indicateurs : les teintes claires de la palette
   claire manquent de contraste sur une surface sombre. */
html[data-theme="dark"] .wfd-kpi--primary { --wfd-accent: #22c55e; }
html[data-theme="dark"] .wfd-kpi--blue { --wfd-accent: #60a5fa; }
html[data-theme="dark"] .wfd-kpi--green { --wfd-accent: #4ade80; }
html[data-theme="dark"] .wfd-kpi--orange { --wfd-accent: #fbbf24; }
html[data-theme="dark"] .wfd-kpi--violet { --wfd-accent: #a78bfa; }

/* Surfaces : cartes d'indicateurs, cartes de graphes, mini-stats,
   actions rapides et panneaux de listes. */
html[data-theme="dark"] .wfd-kpi,
html[data-theme="dark"] .wfd-card,
html[data-theme="dark"] .wfd-mini,
html[data-theme="dark"] .wfd-quick-item,
html[data-theme="dark"] .wfd-panel {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    color: #e2e8f0;
}

html[data-theme="dark"] .wfd-kpi:hover {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .wfd-quick-item:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .wfd-card-head,
html[data-theme="dark"] .wfd-panel-head {
    background: linear-gradient(180deg, #243247, #1e293b);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Libelles figes en gris-vert dans dashboard-pages.css. */
html[data-theme="dark"] .wfd-kpi-label {
    color: #94a3b8;
}

html[data-theme="dark"] .wfd-panel-link {
    color: #4ade80;
}

html[data-theme="dark"] .wfd-panel-link:hover {
    color: #86efac;
}

html[data-theme="dark"] .wfd-badge {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.35);
    color: #4ade80;
}

html[data-theme="dark"] .wfd-mini--wait .wfd-mini-ico {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* Tableaux des panneaux. */
html[data-theme="dark"] .wfd-table thead th {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

html[data-theme="dark"] .wfd-table tbody td {
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .wfd-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .wfd-doughnut-legend .wfd-legend-row {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .wfd-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Etiquettes de statut. */
html[data-theme="dark"] .wfd-tag--valide {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.35);
    color: #4ade80;
}

html[data-theme="dark"] .wfd-tag--attente {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

html[data-theme="dark"] .wfd-tag--neutre {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.10);
    color: #cbd5e1;
}

html[data-theme="dark"] .wfd-empty i {
    color: #475569;
}

/* ------------------------------------------------------------------
   13. NOTIFICATIONS : texte blanc sur fond sombre
   Les bandeaux de notification (flashs de session, alertes de page)
   utilisaient des teintes claires heritees du mode clair : texte
   quasi illisible. On force le texte en blanc sur tous les composants
   de notification. Les fonds restent teintes pour conserver le sens
   (succes, info, avertissement, erreur).
------------------------------------------------------------------ */
html[data-theme="dark"] .alert,
html[data-theme="dark"] .alert-success,
html[data-theme="dark"] .alert-info,
html[data-theme="dark"] .alert-warning,
html[data-theme="dark"] .alert-danger,
html[data-theme="dark"] .wf-alert-box,
html[data-theme="dark"] .wf-login-page .wf-alert-box,
html[data-theme="dark"] .wfg-alert,
html[data-theme="dark"] .wfg-alert--info,
html[data-theme="dark"] .wfg-alert--danger,
html[data-theme="dark"] .wfg-alert--warn,
html[data-theme="dark"] .wfm-alert,
html[data-theme="dark"] .wfm-alert--info,
html[data-theme="dark"] .wfm-alert--warn,
html[data-theme="dark"] .wfm-alert--danger,
html[data-theme="dark"] .wfs-alert,
html[data-theme="dark"] .wfs-alert--info,
html[data-theme="dark"] .wft-reply-alert,
html[data-theme="dark"] .pf-alert,
html[data-theme="dark"] .pf-alert-warning,
html[data-theme="dark"] .wf7-alert,
html[data-theme="dark"] .api-alert {
    color: #ffffff;
}

/* Le seul bandeau encore dote d'un fond clair en mode sombre. */
html[data-theme="dark"] .wf7-alert {
    background: var(--d-green-soft);
    border-color: rgba(34, 197, 94, 0.30);
}

/* ------------------------------------------------------------------
   14. DETAIL CLIENT .wf7- (main.css)
   La fiche client etait la seule page restee entierement en clair en
   mode sombre : chaque surface figee en blanc est ici reprise. Les
   jetons n'existant pas sous .wf7-page, on cible directement les
   composants.
------------------------------------------------------------------ */
html[data-theme="dark"] .wf7-page {
    background: linear-gradient(180deg, #0b1025 0%, #0f172a 100%);
}

/* Titres et valeurs : texte clair. */
html[data-theme="dark"] .wf7-title,
html[data-theme="dark"] .wf7-box-title,
html[data-theme="dark"] .wf7-related-title,
html[data-theme="dark"] .wf7-action-card-title,
html[data-theme="dark"] .wf7-profile-name,
html[data-theme="dark"] .wf7-meta-value,
html[data-theme="dark"] .wf7-side-card-title,
html[data-theme="dark"] .wf7-side-value,
html[data-theme="dark"] .wf7-company,
html[data-theme="dark"] .wf7-count {
    color: #e2e8f0;
}

/* Libelles et textes secondaires : gris ardoise. */
html[data-theme="dark"] .wf7-heading-text,
html[data-theme="dark"] .wf7-box-note,
html[data-theme="dark"] .wf7-breadcrumb .breadcrumb-item,
html[data-theme="dark"] .wf7-breadcrumb .breadcrumb-item a,
html[data-theme="dark"] .wf7-related-note,
html[data-theme="dark"] .wf7-action-card-text,
html[data-theme="dark"] .wf7-profile-email,
html[data-theme="dark"] .wf7-meta-label,
html[data-theme="dark"] .wf7-side-label,
html[data-theme="dark"] .wf7-label {
    color: #94a3b8;
}

html[data-theme="dark"] .wf7-kicker { color: #4ade80; }
html[data-theme="dark"] .wf7-breadcrumb .breadcrumb-item a:hover { color: #4ade80; }

/* Surfaces. */
html[data-theme="dark"] .wf7-box,
html[data-theme="dark"] .wf7-summary-box,
html[data-theme="dark"] .wf7-action-card,
html[data-theme="dark"] .wf7-side-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .wf7-box-head {
    background: #1e293b;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .wf7-profile-card {
    background: linear-gradient(180deg, #243247 0%, #1e293b 100%);
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .wf7-meta-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .wf7-side-row {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .wf7-empty {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}

html[data-theme="dark"] .wf7-empty i {
    color: #475569;
}

/* Onglets. */
html[data-theme="dark"] .wf7-tabs { border-bottom-color: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .wf7-tabs .nav-link { color: #94a3b8; }

html[data-theme="dark"] .wf7-tabs .nav-link.active {
    color: #4ade80 !important;
    border-bottom-color: #4ade80 !important;
}

/* Champs. */
html[data-theme="dark"] .wf7-input {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

html[data-theme="dark"] .wf7-input:focus {
    border-color: #22c55e;
    background: #131c33;
}

html[data-theme="dark"] .wf7-input-disabled {
    background: rgba(255, 255, 255, 0.04) !important;
    color: #94a3b8 !important;
}

/* Boutons secondaires. */
html[data-theme="dark"] .wf7-btn-soft {
    background: rgba(59, 111, 216, 0.14);
    border-color: rgba(59, 111, 216, 0.35);
    color: #93c5fd;
}

html[data-theme="dark"] .wf7-btn-soft:hover {
    background: rgba(59, 111, 216, 0.22);
    border-color: rgba(59, 111, 216, 0.45);
    color: #bfdbfe;
}

html[data-theme="dark"] .wf7-btn-stop {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

html[data-theme="dark"] .wf7-btn-stop:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

/* Tableaux (entreprises liees, abonnements). */
html[data-theme="dark"] .wf7-table thead th {
    background: rgba(255, 255, 255, 0.04);
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8;
}

html[data-theme="dark"] .wf7-table tbody td {
    background: #1e293b;
    border-top-color: rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] .wf7-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .wf7-code {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.35);
    color: #4ade80;
}

/* Pastilles d'etat des abonnements. */
html[data-theme="dark"] .wf7-status--active {
    background: var(--d-green-soft);
    border-color: rgba(34, 197, 94, 0.35);
    color: #4ade80;
}

html[data-theme="dark"] .wf7-status--wait {
    background: var(--d-orange-soft);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

html[data-theme="dark"] .wf7-status--closed,
html[data-theme="dark"] .wf7-status--neutral {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.10);
    color: #cbd5e1;
}

/* Fiches entreprises liees (une carte par entreprise). */
html[data-theme="dark"] .wf7-company-block {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .wf7-company-head {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .wf7-company-name {
    color: #e2e8f0;
}

html[data-theme="dark"] .wf7-company-badge {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.30);
    color: #4ade80;
}

html[data-theme="dark"] .wf7-info-label {
    color: #94a3b8;
}

html[data-theme="dark"] .wf7-info-value {
    color: #e2e8f0;
}

/* ------------------------------------------------------------------
   15. DONNEES DE TABLEAU ET DE MODALE EN BLANC
   Liste des inscrits (.wfm-) et historique de connexion (.wfg-).
   Les cellules de tableau et les libelles de modale sont ecrits en gris
   fonce (#2b3a33 / #344054) dans les palettes claires : sur les
   surfaces sombres ils disparaissent. On les repasse en clair.
------------------------------------------------------------------ */
html[data-theme="dark"] .wfm-table tbody td,
html[data-theme="dark"] .wfg-table tbody td {
    color: #ffffff;
}

/* Adresse IP (historique de connexion) : identifiant monospace ecrit en
   #344054 dans la palette claire, invisible sur la surface sombre. */
html[data-theme="dark"] .wfg-ip {
    color: #ffffff;
}

/* Libelles de formulaire (.wfm-label) : lisibles sur les surfaces sombres
   (modale des gains, formulaires des ecrans d'affiliation). */
html[data-theme="dark"] .wfm-label {
    color: #cbd5e1;
}

/* Donnees de la modale des gains : la carte (.wfm-card) fige la couleur
   de son texte, on cible donc directement les valeurs de chaque ligne. */
html[data-theme="dark"] .wfm-modal .wfm-form-group > div {
    color: #ffffff;
}
