/* ══════════════════════════════════════════════════════════════════════
   theme-dark.css — Mode sombre global de lesoffres.ma
   ----------------------------------------------------------------------
   Ce fichier est chargé par header4.php : il s'applique donc à TOUTES les
   pages du site sans avoir à modifier leur code.
   Rien ne change tant que <html> ne porte pas l'attribut data-theme="dark"
   (posé par header4.php d'après le cookie, puis par theme-dark.js).

   Astuce : pour qu'un bloc garde ses couleurs d'origine, ajoutez-lui la
   classe « lo-no-dark » (ou l'attribut data-lo-keep).
   ══════════════════════════════════════════════════════════════════════ */

/* ───────────────── 1. Palette ───────────────── */
html[data-theme="dark"] {
    color-scheme: dark;              /* ascenseurs, menus natifs, date pickers */

    --lo-bg:          #0f151d;       /* fond de page            */
    --lo-bg-alt:      #131d28;       /* bandes alternées        */
    --lo-surface:     #172231;       /* cartes, panneaux        */
    --lo-surface-2:   #1e2a3a;       /* en-têtes de cartes      */
    --lo-surface-3:   #26354a;       /* survol                  */
    --lo-line:        #2b3a4d;       /* bordures                */
    --lo-line-soft:   #223042;
    --lo-text:        #dde6f0;
    --lo-text-soft:   #bccadb;
    --lo-muted:       #8fa1b5;
    --lo-brand:       #35aed2;       /* #1890b5 éclairci        */
    --lo-brand-2:     #7fd4ea;
    --lo-brand-soft:  #11313d;
    --lo-ok:          #41c48a;
    --lo-ok-soft:     #11311f;
    --lo-warn:        #e3ab55;
    --lo-warn-soft:   #342710;
    --lo-danger:      #f0706e;
    --lo-danger-soft: #3a1618;

    /* ---- variables déjà utilisées par header4.php ---- */
    --theme-primary:        #35aed2;
    --theme-primary-dark:   #8fd6ea;
    --theme-secondary:      #24405a;
    --theme-secondary-hover:#1890b5;
    --theme-success:        #1f9b57;
    --theme-success-hover:  #17824a;
    --text-primary:         #dde6f0;
    --text-secondary:       #9fb0c3;
    --bg-primary:           #172231;
    --bg-secondary:         #0f151d;
    --bg-topbar:            #0c1620;
    --text-topbar:          #dbe5ef;
    --alert-success-bg:     #11311f;  --alert-success-text: #74e0a7;  --alert-success-border: #1d5436;
    --alert-error-bg:       #3a1618;  --alert-error-text:   #ff9a98;  --alert-error-border:   #5d2427;
    --alert-warning-bg:     #342710;  --alert-warning-text: #f0c47a;  --alert-warning-border: #5a431a;
    --shadow-sm: 0 2px 4px rgba(0,0,0,.45);
    --shadow-md: 0 4px 10px rgba(0,0,0,.5);
    --shadow-lg: 0 10px 24px rgba(0,0,0,.55);

    /* ---- variables utilisées par index.php / autres pages ---- */
    --border-color:  #2b3a4d;
    --accent-color:  #1f93b8;
    --primary-color: #1f93b8;
}

/* ───────────────── 2. Base ───────────────── */
html[data-theme="dark"],
html[data-theme="dark"] body {
    background-color: var(--lo-bg) !important;
    color: var(--lo-text) !important;
}
html[data-theme="dark"] a { color: var(--lo-brand); }
html[data-theme="dark"] a:hover { color: var(--lo-brand-2); }
html[data-theme="dark"] hr { border-color: var(--lo-line) !important; }
html[data-theme="dark"] ::selection { background: #1f93b8; color: #fff; }
html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0c131b; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2f4056; border-radius: 6px; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #3c5270; }
html[data-theme="dark"] ::placeholder { color: #7b8ca1 !important; opacity: 1; }

/* Images : on adoucit un peu la luminosité (hors logos ré-éclaircis plus bas) */
html[data-theme="dark"] img:not(.lo-no-dark):not(.brand-logo) { filter: brightness(.92) contrast(1.02); }

/* Logo du site : inversion de la luminosité, les teintes sont conservées.
   Si votre logo est déjà clair, supprimez simplement ces 3 lignes. */
html[data-theme="dark"] .brand-logo { filter: invert(1) hue-rotate(180deg) brightness(1.08); }

/* Logos des annonceurs : on garde une pastille claire pour rester lisibles */
html[data-theme="dark"] .logo-item { background: #e9eef3 !important; border-color: #30425a !important; }

/* Échappatoire */
html[data-theme="dark"] .lo-no-dark,
html[data-theme="dark"] [data-lo-keep] { filter: none !important; }

/* ───────────────── 3. header4.php (barre, menu, modale de connexion) ───────────────── */
html[data-theme="dark"] .topbar          { background: var(--lo-bg-alt) !important; border-bottom: 1px solid var(--lo-line-soft); }
html[data-theme="dark"] .main-header     { background: var(--lo-surface) !important; border-bottom: 1px solid var(--lo-line); }
html[data-theme="dark"] .main-nav        { background: var(--lo-surface) !important; border-top-color: var(--lo-line) !important; }
html[data-theme="dark"] .main-nav__item  { border-bottom-color: var(--lo-line-soft) !important; }
html[data-theme="dark"] .main-nav__link  { color: var(--lo-text) !important; }
html[data-theme="dark"] .main-nav__link:not(.btn):hover,
html[data-theme="dark"] .main-nav__item.active .main-nav__link:not(.btn) {
    color: var(--lo-brand-2) !important; background: rgba(53,174,210,.14) !important;
}
html[data-theme="dark"] .main-nav__item.active .main-nav__link:not(.btn) { box-shadow: inset 0 -2px 0 var(--lo-brand); }
html[data-theme="dark"] .mobile-toggle   { color: var(--lo-text) !important; }
html[data-theme="dark"] .mobile-toggle:hover { background: rgba(255,255,255,.08) !important; }
html[data-theme="dark"] .dropdown-menu    { background: var(--lo-surface-2) !important; border: 1px solid var(--lo-line); }
html[data-theme="dark"] .dropdown-menu a.dropdown-item { color: var(--lo-text) !important; border-bottom-color: var(--lo-line-soft) !important; }
html[data-theme="dark"] .dropdown-menu a.dropdown-item i { color: var(--lo-muted) !important; }
html[data-theme="dark"] .dropdown-menu a.dropdown-item:hover { background: var(--lo-brand-soft) !important; color: #fff !important; }
html[data-theme="dark"] .dropdown-menu a.dropdown-item:hover i { color: #fff !important; }
html[data-theme="dark"] .btn--login  { background: #24405a !important; color: #eaf3f8 !important; }
html[data-theme="dark"] .btn--login:hover { background: #1890b5 !important; }
html[data-theme="dark"] .btn--register { background: #1f9b57 !important; color: #fff !important; }
html[data-theme="dark"] .notification-count { box-shadow: 0 0 0 2px var(--lo-surface) !important; }

html[data-theme="dark"] .auth-modal      { background: rgba(0,0,0,.72) !important; }
html[data-theme="dark"] .modal-container { background-color: var(--lo-surface) !important; background-blend-mode: luminosity; box-shadow: 0 18px 50px rgba(0,0,0,.6) !important; }
html[data-theme="dark"] .modal-container::before {       /* voile sur l'image de fond */
    content: ""; position: absolute; inset: 0; border-radius: 12px;
    background: rgba(15,21,29,.72); pointer-events: none;
}
html[data-theme="dark"] .modal-container > * { position: relative; z-index: 1; }
html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .modal-close { color: var(--lo-text) !important; }
html[data-theme="dark"] .register-prompt { border-top-color: var(--lo-line) !important; color: var(--lo-muted) !important; }

html[data-theme="dark"] .subscription-warning { background: var(--alert-warning-bg) !important; color: var(--alert-warning-text) !important; border-color: var(--alert-warning-border) !important; }
html[data-theme="dark"] .subscription-warning .renew-link { color: #ffd591 !important; }
html[data-theme="dark"] .pwa-install__btn { background: #e8f4fa !important; color: #0c1620 !important; }

/* ───────────────── 4. Bouton de bascule (dans la barre du haut) ───────────────── */
.lo-theme-toggle {
    display: inline-flex; align-items: center; gap: .4rem;
    border: 0; background: transparent; cursor: pointer;
    color: var(--text-topbar, #f8f9fa);
    font: inherit; font-size: .875rem; line-height: 1.4;
    padding: .25rem .75rem; margin-left: .25rem; border-radius: 4px;
    transition: background .2s ease, color .2s ease;
}
.lo-theme-toggle:hover { background: rgba(255,255,255,.12); color: #fff; }
.lo-theme-toggle:focus-visible { outline: 2px solid #8fd6ea; outline-offset: 2px; }
.lo-theme-toggle i { font-size: .95em; }
.lo-theme-toggle .lo-theme-toggle__off { display: inline-flex; align-items: center; gap: .4rem; }
.lo-theme-toggle .lo-theme-toggle__on  { display: none; align-items: center; gap: .4rem; }
html[data-theme="dark"] .lo-theme-toggle .lo-theme-toggle__off { display: none; }
html[data-theme="dark"] .lo-theme-toggle .lo-theme-toggle__on  { display: inline-flex; }
html[data-theme="dark"] .lo-theme-toggle { color: #ffd98a; }
html[data-theme="dark"] .lo-theme-toggle:hover { background: rgba(255,255,255,.1); color: #ffe3a6; }
@media (max-width: 480px) { .lo-theme-toggle .lo-theme-label { display: none; } .lo-theme-toggle { padding: .25rem .5rem; } }

/* ───────────────── 5. Bootstrap & classes communes ───────────────── */
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .accordion .card,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .toast {
    background-color: var(--lo-surface) !important;
    color: var(--lo-text) !important;
    border-color: var(--lo-line) !important;
}
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    background-color: var(--lo-surface-2) !important;
    border-color: var(--lo-line) !important;
    color: var(--lo-text) !important;
}
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light { background-color: var(--lo-surface) !important; }
html[data-theme="dark"] .text-dark  { color: var(--lo-text) !important; }
html[data-theme="dark"] .text-muted { color: var(--lo-muted) !important; }
html[data-theme="dark"] .text-black-50 { color: var(--lo-muted) !important; }
html[data-theme="dark"] .border, html[data-theme="dark"] [class*="border-"] { border-color: var(--lo-line) !important; }
html[data-theme="dark"] .close, html[data-theme="dark"] .modal .close { color: var(--lo-text-soft) !important; text-shadow: none !important; opacity: .9; }
html[data-theme="dark"] .close:hover { color: #fff !important; }
html[data-theme="dark"] .btn-link { color: var(--lo-brand) !important; }
html[data-theme="dark"] .btn-light, html[data-theme="dark"] .btn-outline-secondary { background: var(--lo-surface-2) !important; color: var(--lo-text) !important; border-color: var(--lo-line) !important; }
html[data-theme="dark"] .btn-outline-primary { color: var(--lo-brand) !important; border-color: var(--lo-brand) !important; background: transparent !important; }
html[data-theme="dark"] .btn-outline-primary:hover { background: var(--lo-brand) !important; color: #06131a !important; }
html[data-theme="dark"] .alert-success { background: var(--lo-ok-soft) !important;    color: #7fe3ad !important; border-color: #1d5436 !important; }
html[data-theme="dark"] .alert-danger  { background: var(--lo-danger-soft) !important; color: #ff9a98 !important; border-color: #5d2427 !important; }
html[data-theme="dark"] .alert-warning { background: var(--lo-warn-soft) !important;  color: #f0c47a !important; border-color: #5a431a !important; }
html[data-theme="dark"] .alert-info    { background: var(--lo-brand-soft) !important; color: #9bdcf0 !important; border-color: #1d4a5c !important; }
html[data-theme="dark"] .badge-light   { background: var(--lo-surface-3) !important; color: var(--lo-text) !important; }

/* ───────────────── 6. Formulaires ───────────────── */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .custom-select {
    background-color: #111b26 !important;
    color: var(--lo-text) !important;
    border-color: var(--lo-line) !important;
}
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .form-control:focus, html[data-theme="dark"] .form-input:focus {
    background-color: #0e1721 !important;
    border-color: var(--lo-brand) !important;
    box-shadow: 0 0 0 3px rgba(53,174,210,.18) !important;
    color: #fff !important;
}
html[data-theme="dark"] option, html[data-theme="dark"] optgroup { background: #111b26; color: var(--lo-text); }
html[data-theme="dark"] label, html[data-theme="dark"] .form-label { color: var(--lo-text-soft) !important; }
html[data-theme="dark"] input[type="checkbox"], html[data-theme="dark"] input[type="radio"] { accent-color: var(--lo-brand); }
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1) brightness(1.4); }
html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--lo-text) !important;
    -webkit-box-shadow: 0 0 0 1000px #111b26 inset !important;
    caret-color: var(--lo-text);
}

/* ───────────────── 7. Tableaux ───────────────── */
html[data-theme="dark"] table,
html[data-theme="dark"] .table,
html[data-theme="dark"] .details-table,
html[data-theme="dark"] .lots-table,
html[data-theme="dark"] .competitors-table,
html[data-theme="dark"] .tender-table,
html[data-theme="dark"] .archive-summary-table,
html[data-theme="dark"] .lot-competitors-table {
    color: var(--lo-text) !important;
    border-color: var(--lo-line) !important;
    background-color: transparent !important;
}
html[data-theme="dark"] table th, html[data-theme="dark"] .table th,
html[data-theme="dark"] .details-table th, html[data-theme="dark"] .lots-table th,
html[data-theme="dark"] .competitors-table th, html[data-theme="dark"] .tender-table th,
html[data-theme="dark"] .lot-info-table th {
    background-color: var(--lo-surface-2) !important;
    color: var(--lo-text-soft) !important;
    border-color: var(--lo-line) !important;
}
html[data-theme="dark"] table td, html[data-theme="dark"] .table td {
    color: var(--lo-text) !important;
    border-color: var(--lo-line-soft) !important;
}
html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd),
html[data-theme="dark"] .lots-table tr:nth-child(even) { background-color: rgba(255,255,255,.028) !important; }
html[data-theme="dark"] .table-hover tbody tr:hover,
html[data-theme="dark"] .lots-table tr:hover,
html[data-theme="dark"] .competitors-table tbody tr:hover,
html[data-theme="dark"] .tender-table tbody tr:hover { background-color: var(--lo-surface-3) !important; }

/* ───────────────── 8. Page d'accueil (index.php) ───────────────── */
/* Bandeau héros : voile sombre posé sur l'image/le dégradé existant */
html[data-theme="dark"] .hero { box-shadow: inset 0 0 0 100vmax rgba(10,16,24,.78) !important; color: var(--lo-text) !important; }
html[data-theme="dark"] .hero-title, html[data-theme="dark"] .hero-subtitle { color: var(--lo-text) !important; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
html[data-theme="dark"] .search-container { background-color: rgba(23,34,49,.82) !important; border-color: rgba(255,255,255,.08) !important; }
html[data-theme="dark"] .search-bar select { background: #111b26 !important; border-color: var(--lo-line) !important; color: var(--lo-text) !important; }

html[data-theme="dark"] .features,
html[data-theme="dark"] .statistics,
html[data-theme="dark"] .category-statistics,
html[data-theme="dark"] .pricing,
html[data-theme="dark"] .faq,
html[data-theme="dark"] .contact,
html[data-theme="dark"] .image-showcase { background-color: var(--lo-bg-alt) !important; }
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .chart-title,
html[data-theme="dark"] .category-name,
html[data-theme="dark"] .summary-info h4 { color: var(--lo-text) !important; }
html[data-theme="dark"] .section-subtitle,
html[data-theme="dark"] .category-percentage,
html[data-theme="dark"] .category-value,
html[data-theme="dark"] .subcategory-item,
html[data-theme="dark"] .top-percentage,
html[data-theme="dark"] .last-update { color: var(--lo-muted) !important; }
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .category-card,
html[data-theme="dark"] .stat-item,
html[data-theme="dark"] .chart-container,
html[data-theme="dark"] .contact-card,
html[data-theme="dark"] .pricing-card,
html[data-theme="dark"] .announcers-section {
    background: var(--lo-surface) !important;
    color: var(--lo-text) !important;
    border-color: var(--lo-line) !important;
}
html[data-theme="dark"] .pricing-card.popular { background: #13455a !important; color: #eaf6fa !important; }
html[data-theme="dark"] .pricing-features li { color: var(--lo-text-soft) !important; }
html[data-theme="dark"] .pricing-card .price-period { color: var(--lo-muted) !important; }
html[data-theme="dark"] .progress-bar-custom { background-color: #233245 !important; }
html[data-theme="dark"] .progress-label, html[data-theme="dark"] .progress-value { color: var(--lo-text) !important; }
html[data-theme="dark"] .logo-scroll-container::before { background: linear-gradient(to right, var(--lo-surface), transparent) !important; }
html[data-theme="dark"] .logo-scroll-container::after  { background: linear-gradient(to left,  var(--lo-surface), transparent) !important; }
html[data-theme="dark"] .faq .card,
html[data-theme="dark"] .faq .card-header { background: var(--lo-surface) !important; border-color: var(--lo-line) !important; }
html[data-theme="dark"] .faq .btn-link { color: var(--lo-text) !important; }
html[data-theme="dark"] .faq .card-body { color: var(--lo-text-soft) !important; }
html[data-theme="dark"] .premium-stats-btn.locked { background: #2b3a4d !important; color: #c3d1e0 !important; }
html[data-theme="dark"] .premium-toast { background: #0b121a !important; border: 1px solid var(--lo-line); }
html[data-theme="dark"] .showcase-img { background: #e9eef3 !important; }

/* ───────────────── 9. Espace membre (index.php : .member-dash) ───────────────── */
html[data-theme="dark"] .member-dash {
    --md-surface:   #172231;
    --md-bg:        #0f151d;
    --md-ink:       #dde6f0;
    --md-muted:     #93a5ba;
    --md-line:      #2b3a4d;
    --md-brand:     #35aed2;
    --md-brand-soft:#11313d;
    --md-ao-soft:   #3a1618;
    --md-bdc-soft:  #342710;
    --md-visit-soft:#10332e;
    --md-ao:        #f0706e;
    --md-bdc:       #e3ab55;
    --md-visit:     #3fc3ab;
}
html[data-theme="dark"] .md-scope { background: #1b2735 !important; }
html[data-theme="dark"] .md-scope-btn.is-active { background: var(--lo-surface) !important; box-shadow: 0 1px 3px rgba(0,0,0,.45) !important; }
html[data-theme="dark"] .md-day { background: #131d28 !important; }
html[data-theme="dark"] .md-day:hover { background: #1d2a39 !important; }
html[data-theme="dark"] .md-day.is-out { background: transparent !important; color: #5e6e82 !important; }
html[data-theme="dark"] .md-day.is-past .md-day-num { color: #5e6e82 !important; }
html[data-theme="dark"] .md-icon-btn { background: var(--lo-surface-2) !important; color: var(--lo-text) !important; border-color: var(--lo-line) !important; }
html[data-theme="dark"] .md-icon-btn:hover { background: var(--lo-surface-3) !important; }
html[data-theme="dark"] .md-chip { background: var(--lo-surface-2) !important; color: var(--lo-text) !important; border-color: var(--lo-line) !important; }
html[data-theme="dark"] .md-item:hover { background: #1b2735 !important; }
html[data-theme="dark"] .md-item { border-bottom-color: var(--lo-line-soft) !important; }
html[data-theme="dark"] .md-date { background: #1b2735 !important; }
html[data-theme="dark"] .md-countdown { background: #243041 !important; color: var(--lo-text) !important; }
html[data-theme="dark"] .md-tab-count { background: #243041 !important; color: var(--lo-text) !important; }
html[data-theme="dark"] .md-actions button, html[data-theme="dark"] .md-actions a { background: var(--lo-surface-2) !important; border-color: var(--lo-line) !important; color: var(--lo-muted) !important; }
html[data-theme="dark"] .md-cal-loading { background: rgba(15,21,29,.72) !important; }
html[data-theme="dark"] .md-cal-note { background: #342710 !important; color: #f0c47a !important; }
html[data-theme="dark"] .md-skel { background: linear-gradient(90deg,#1a2633 25%,#22303f 37%,#1a2633 63%) !important; background-size: 400% 100% !important; }
html[data-theme="dark"] .md-empty i { color: #4a5b70 !important; }
html[data-theme="dark"] .md-empty button { background: transparent !important; }

/* ───────────────── 10. Fenêtre de résultats de recherche (index.php : .sr-*) ───────────────── */
html[data-theme="dark"] .sr-modal {
    --sr-ink:  #dde6f0;
    --sr-muted:#93a5ba;
    --sr-line: #2b3a4d;
    --sr-bg:   #0f151d;
    --sr-brand:#35aed2;
    --sr-brand-dark:#146d8a;
}
html[data-theme="dark"] .sr-modal .sr-content,
html[data-theme="dark"] .sr-card,
html[data-theme="dark"] .sr-toolbar,
html[data-theme="dark"] .sr-foot,
html[data-theme="dark"] .sr-guest { background: var(--lo-surface) !important; color: var(--lo-text) !important; }
html[data-theme="dark"] .sr-body { background: var(--lo-bg) !important; }
html[data-theme="dark"] .sr-field input, html[data-theme="dark"] .sr-field select { background: #111b26 !important; }
html[data-theme="dark"] .sr-ref, html[data-theme="dark"] .sr-fig { background: #1b2735 !important; color: var(--lo-text-soft) !important; }
html[data-theme="dark"] .sr-fig strong { color: var(--lo-text) !important; }
html[data-theme="dark"] .sr-deadline { background: var(--lo-brand-soft) !important; color: #9bdcf0 !important; }
html[data-theme="dark"] .sr-deadline.is-closed { background: #243041 !important; color: var(--lo-muted) !important; }
html[data-theme="dark"] .sr-deadline.is-soon { background: #342710 !important; color: #f0c47a !important; }
html[data-theme="dark"] .sr-btn--ghost { background: transparent !important; color: var(--lo-brand-2) !important; border-color: #1d4a5c !important; }
html[data-theme="dark"] .sr-btn--ghost:hover { background: var(--lo-brand-soft) !important; }
html[data-theme="dark"] .sr-skel { background: linear-gradient(90deg,#1a2633 25%,#22303f 37%,#1a2633 63%) !important; background-size: 400% 100% !important; }
html[data-theme="dark"] .sr-guest { border-color: #1d4a5c !important; }

/* ───────────────── 11. Page des appels d'offres (offres.php / AO_styles.css) ───────────────── */
html[data-theme="dark"] .content-wrapper,
html[data-theme="dark"] .filter-section,
html[data-theme="dark"] .filter-content,
html[data-theme="dark"] .search-results,
html[data-theme="dark"] .results-header,
html[data-theme="dark"] .tender-card,
html[data-theme="dark"] .tender-info,
html[data-theme="dark"] .pagination-container,
html[data-theme="dark"] .modification-card,
html[data-theme="dark"] .lot-group,
html[data-theme="dark"] .lot-competitors-block,
html[data-theme="dark"] #tenderShareMenu {
    background: var(--lo-surface) !important;
    color: var(--lo-text) !important;
    border-color: var(--lo-line) !important;
}
html[data-theme="dark"] .tender-card:hover { background: var(--lo-surface-2) !important; }
html[data-theme="dark"] .tender-title, html[data-theme="dark"] .list-view .tender-title { color: var(--lo-brand-2) !important; }
html[data-theme="dark"] .tender-location, html[data-theme="dark"] .list-competitors,
html[data-theme="dark"] .lot-count, html[data-theme="dark"] .mod-no-attachment,
html[data-theme="dark"] .export-excel-hint { color: var(--lo-muted) !important; }
html[data-theme="dark"] .filter-item label, html[data-theme="dark"] .filter-item span { color: var(--lo-text-soft) !important; }
html[data-theme="dark"] .activity-dropdown,
html[data-theme="dark"] #regionDropdown, html[data-theme="dark"] #organizationDropdown {
    background-color: var(--lo-surface-2) !important; border-color: var(--lo-line) !important; color: var(--lo-text) !important;
}
html[data-theme="dark"] .activity-item:hover { background-color: var(--lo-surface-3) !important; }
html[data-theme="dark"] .activity-tag { background-color: #243041 !important; border-color: #33465e !important; color: var(--lo-text) !important; }
html[data-theme="dark"] .remove-activity { color: var(--lo-muted) !important; }
html[data-theme="dark"] .view-btn, html[data-theme="dark"] .status-btn, html[data-theme="dark"] .btn-share-tender {
    background: var(--lo-surface-2) !important; color: var(--lo-text-soft) !important; border-color: var(--lo-line) !important;
}
html[data-theme="dark"] .view-btn.active, html[data-theme="dark"] .status-btn.active { background: var(--lo-brand-soft) !important; color: #9bdcf0 !important; border-color: #1d4a5c !important; }
html[data-theme="dark"] .grid-view .favorite-icon { background-color: rgba(15,21,29,.7) !important; color: #7e8fa3 !important; }
html[data-theme="dark"] .favorite-icon.active { color: #ffc107 !important; }
html[data-theme="dark"] .list-view .status-badge.active { background-color: var(--lo-ok-soft) !important;    color: #74e0a7 !important; }
html[data-theme="dark"] .list-view .status-badge.soon   { background-color: var(--lo-warn-soft) !important;  color: #f0c47a !important; }
html[data-theme="dark"] .list-view .status-badge.urgent { background-color: var(--lo-danger-soft) !important; color: #ff9a98 !important; }
html[data-theme="dark"] .canceled-indicator { background-color: var(--lo-danger-soft) !important; color: #ff9a98 !important; border-color: #5d2427 !important; }
html[data-theme="dark"] .modification-indicator { background-color: var(--lo-warn-soft) !important; color: #f0c47a !important; border-color: #5a431a !important; }
html[data-theme="dark"] .modification-indicator:hover { background-color: #4a3717 !important; }
html[data-theme="dark"] .modification-card-header { background: linear-gradient(90deg,#342710 0%,#2a2113 100%) !important; color: #f0c47a !important; border-bottom-color: #5a431a !important; }
html[data-theme="dark"] .modification-card-header .mod-date { color: #d9b878 !important; }
html[data-theme="dark"] .modification-card-body table td { border-bottom-color: var(--lo-line-soft) !important; color: var(--lo-text) !important; }
html[data-theme="dark"] .modification-card-body table td:first-child { background: var(--lo-surface-2) !important; color: var(--lo-text-soft) !important; }
html[data-theme="dark"] #modificationsModal h2 { color: #f0c47a !important; border-bottom-color: #5a431a !important; }
html[data-theme="dark"] .lot-competitors-table tr.winner-row { background-color: var(--lo-ok-soft) !important; }
html[data-theme="dark"] .lot-competitors-table tr.winner-row td { color: #74e0a7 !important; }
html[data-theme="dark"] .lot-group { border-left-color: var(--lo-brand) !important; }
html[data-theme="dark"] .lot-group-title { color: var(--lo-brand-2) !important; border-bottom-color: var(--lo-line) !important; }
html[data-theme="dark"] .lot-group-title i, html[data-theme="dark"] .lot-block-title i,
html[data-theme="dark"] .lots-container h4, html[data-theme="dark"] .competitors-container h4,
html[data-theme="dark"] .archive-analysis-container h4, html[data-theme="dark"] .archive-summary-table td strong { color: var(--lo-brand-2) !important; }
html[data-theme="dark"] .lot-block-title, html[data-theme="dark"] .lot-result-title { color: var(--lo-text-soft) !important; }
html[data-theme="dark"] .lot-info-table th { background-color: #1b2735 !important; }
html[data-theme="dark"] .lot-result-locked, html[data-theme="dark"] .lot-competitors-block.premium-locked { background-color: var(--lo-surface-2) !important; border-color: var(--lo-line) !important; }
html[data-theme="dark"] .btn-toggle-more-lots { background-color: transparent !important; color: var(--lo-brand-2) !important; border-color: #1d4a5c !important; }
html[data-theme="dark"] .btn-toggle-more-lots:hover { background-color: var(--lo-brand-soft) !important; }
html[data-theme="dark"] .premium-link { color: #7ab9ff !important; }
html[data-theme="dark"] .premium-filter.disabled input, html[data-theme="dark"] .premium-filter.disabled select { background-color: #1b2735 !important; }
html[data-theme="dark"] .competitors-info { border-top-color: var(--lo-line) !important; }
html[data-theme="dark"] .competitors-info h4 { color: var(--lo-text) !important; }
html[data-theme="dark"] .competitor-item .fas { color: var(--lo-muted) !important; }
html[data-theme="dark"] .lot-number { color: #93a5ba !important; }
html[data-theme="dark"] .amount { color: #74e0a7 !important; }
html[data-theme="dark"] .active-filters-badge { background: var(--lo-surface-2) !important; color: var(--lo-text) !important; border-color: var(--lo-line) !important; }
html[data-theme="dark"] .archive-fallback-notice { background: var(--lo-surface-2) !important; color: var(--lo-text-soft) !important; border-color: var(--lo-line) !important; }
html[data-theme="dark"] .archive-fallback-notice button { background: transparent !important; color: var(--lo-brand-2) !important; border-color: #1d4a5c !important; }
html[data-theme="dark"] .login-prompt-banner { background: var(--lo-surface-2) !important; color: var(--lo-text) !important; border-color: var(--lo-line) !important; }
html[data-theme="dark"] #tenderShareMenu a { color: var(--lo-text) !important; }
html[data-theme="dark"] #tenderShareMenu a:hover { background: var(--lo-surface-3) !important; }
html[data-theme="dark"] .tooltip { background-color: #243041 !important; color: var(--lo-text) !important; }
html[data-theme="dark"] .export-progress-bar-outer { background: #243041 !important; }
html[data-theme="dark"] .btn-share-tender:hover { background: #10342a !important; border-color: #1f8f5f !important; color: #7fe3ad !important; }
html[data-theme="dark"] #exportExcelStatus, html[data-theme="dark"] #downloadStatus { color: var(--lo-text-soft) !important; }

/* ───────────────── 12. Pied de page ───────────────── */
html[data-theme="dark"] footer,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .main-footer {
    background-color: #0b121a !important;
    color: var(--lo-text-soft) !important;
    border-top: 1px solid var(--lo-line);
}
html[data-theme="dark"] footer a, html[data-theme="dark"] .footer a { color: var(--lo-brand-2) !important; }

/* ───────────────── 13. Filet de sécurité (styles en ligne clairs) ───────────────── */
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background-color:white"],
html[data-theme="dark"] [style*="background-color: white"],
html[data-theme="dark"] [bgcolor="#ffffff"],
html[data-theme="dark"] [bgcolor="#FFFFFF"] {
    background-color: var(--lo-surface) !important;
}

/* Transition douce au moment de la bascule (classe posée par theme-dark.js) */
html.lo-theme-anim body { transition: background-color .2s ease, color .2s ease !important; }
