/**
 * Cash Scanner - Theme White B&W (wbw-mode) - V4.5.253
 * .wbw-mode : fond blanc pur, texte noir pur — monochromatique, impression, WCAG AAA
 * Extrait de bw-theme.css (V4.5.119)
 */

/* ============================================================================
   THÈME WHITE B&W (wbw-mode) — V4.5.41
   Fond blanc pur, texte noir pur, zéro accent coloré
   Usage : impression, présentations, accessibilité WCAG AAA
   ============================================================================ */

/* Variables WBW */
html.wbw-mode,
body.wbw-mode {
    --bg-color: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-gradient: var(--bg-color);
    --hover-bg: #f0f0f0;
    --text-color: #111111;
    --text-primary: #111111;
    --text-secondary: #555555;
    --card-bg: #ffffff;
    --border-color: #d4d4d4;
    --chart-grid-color: rgba(180,180,180,0.4);
    --shadow-color: rgba(0, 0, 0, 0.08);
    --input-bg: #ffffff;
    --input-border: #aaaaaa;
    --accent-primary: #222222;
    --accent-secondary: #525252;
    --accent-success: #16a34a;
    --accent-danger: #dc2626;
    --accent-warning: #d97706;
    --opp-score-bg: #f0f0f0;
    --opp-score-text: #111111;
    --brief-bg: #f8f8f8;
    --secondary-text: #555555;
    --header-bg: #ffffff;
    --card-bg-solid: #ffffff;
    --success-bg: #f0f0f0;
    --success-text: #111111;
    --badge-bg: #eeeeee;
    --badge-text: #333333;
    --msg-error-bg: #f5f5f5;
    --msg-error-text: #222222;
    --msg-success-bg: #f5f5f5;
    --msg-success-text: #222222;
    --msg-info-bg: #f0f0f0;
    --msg-info-text: #111111;
    --warning-bg: #fefce8;
    --warning-text: #713f12;
    --msg-warning-bg: #fefce8;
    --msg-warning-text: #713f12;
    /* Variables guide indicateurs */
    --guide-heading: #111111;
    --guide-section: #333333;
    --guide-table-row: #f5f5f5;
    --guide-penalty: #111111;
    --overlay-bg: rgba(0, 0, 0, 0.4);
    /* Nouvelles vars DA-D (V4.7.87) */
    --text-hover: #000000;
    --text-dimmed: #444444;
    --text-muted: #888888;
    --border-subtle: #cccccc;
    --skeleton-from: #e8e8e8;
    --score-low-text: #737373;
    --score-high-bg: #e5e5e5;
    --score-high-text: #171717;
    --score-excellent-bg: #262626;
    --score-excellent-text: #fafafa;
    --delete-hover-bg: #e0e0e0;
    --card-border-radius: 4px; /* Intentionnel : coins nets pour impression/WCAG (vs 12px autres thèmes) */
    /* Vars UI buttons et badges spécifiques wbw-mode */
    --wbw-btn-secondary: #e5e5e5;   /* fond boutons secondaires et badges */
    --wbw-btn-dark: #262626;         /* hover foncé bouton settings */
    --wbw-btn-medium: #525252;       /* fond bouton logout */
    --wbw-btn-hover: #404040;        /* hover bouton logout */
    --wbw-white: #ffffff;            /* texte blanc sur fonds foncés */
    --wbw-sig-risk-bg: #f5e5e5;      /* fond signal risk (rose pâle) */
    --wbw-sig-risk-text: #5c1a1a;    /* texte signal risk (rouge sombre) */
    --wbw-sig-risk-border: #d4c0c0;  /* bordure signal risk */
    /* V4.8.20 — vars score couleurs accessibles WCAG AA (wbw) */
    --wbw-score-good: #16a34a;       /* score-good texte vert foncé */
    --wbw-score-warning: #d97706;    /* score-warning texte ambre foncé */
    --wbw-score-danger: #dc2626;     /* score-danger texte rouge */
    /* Aliases ticker.html (score panel) — cohérence avec dark-mode.css */
    --success: var(--accent-success);
    --warning: var(--accent-warning);
    --danger: var(--accent-danger);
    --accent: var(--accent-primary);
}

/* NOTE : body, cards, grid, inputs, labels, tables, .modal-content communs
   à bw-mode et wbw-mode sont désormais définis dans bw-theme.css
   (section "MONOCHROME COMMUN") — ne pas redéfinir ici. */

body.wbw-mode input[type="checkbox"],
body.wbw-mode input[type="radio"],
body.wbw-mode select {
    accent-color: var(--badge-text) !important;
}

body.wbw-mode input::placeholder,
body.wbw-mode textarea::placeholder {
    color: var(--text-secondary);
}

body.wbw-mode input:focus,
body.wbw-mode select:focus,
body.wbw-mode textarea:focus,
body.wbw-mode .settings-input:focus {
    border-color: var(--text-color) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-color) 15%, transparent) !important;
    outline: none;
}

/* Boutons — gris anthracite sur blanc
   EXCLUSIONS directes dans :not() — PAS d'ID dans :not() (ajoute (1,0,0) à la spécificité,
   rendant impossible tout override button#id à (1,1,2)).
   Icônes/close/modales sont exclus par classe ou attribut uniquement. */
body.wbw-mode .btn:not(.icon-only),
body.wbw-mode button:not(.modal-close):not(.settings-modal-close):not(.collapse-btn):not(.expand-btn):not(.opp-action-btn):not(.watchlist-star):not(.portfolio-btn):not(.icon-only):not(.score-explain-tab-btn):not([data-action="open-alert"]):not([data-action="close-modal"]):not([style*="background: none"]):not([style*="background:none"]) {
    background: var(--accent-primary) !important;
    color: var(--bg-color) !important;
    border-color: var(--accent-primary) !important;
}
body.wbw-mode .btn:not(.icon-only):hover,
body.wbw-mode button:not(.modal-close):not(.settings-modal-close):not(.collapse-btn):not(.expand-btn):not(.opp-action-btn):not(.watchlist-star):not(.portfolio-btn):not(.icon-only):not(.score-explain-tab-btn):not([data-action="open-alert"]):not([data-action="close-modal"]):not([style*="background: none"]):not([style*="background:none"]):hover {
    background: var(--text-color) !important;
    border-color: var(--text-color) !important;
}
body.wbw-mode .btn-secondary,
body.wbw-mode button.secondary {
    background: var(--card-bg) !important;
    color: var(--accent-primary) !important;
    border-color: var(--input-border) !important;
}

/* ============================================================================
   WBW — Score explain tabs (Momentum / Phoenix)
   Empêche les règles globales button:not(...) de dégrader le style.
   ============================================================================ */
body.wbw-mode .score-explain-tabs {
    background: var(--bg-secondary) !important;
    border-color: var(--input-border) !important;
    box-shadow: none !important;
}
body.wbw-mode .score-explain-tab-btn {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--text-secondary) !important;
    box-shadow: none !important;
}
body.wbw-mode .score-explain-tab-btn:hover {
    color: var(--text-color) !important;
}
body.wbw-mode .score-explain-tab-btn.active {
    background: var(--text-color) !important;
    border-color: var(--text-color) !important;
    color: var(--bg-color) !important;
    box-shadow: none !important;
}

/* Modales */
body.wbw-mode .modal,
body.wbw-mode .modal-content,
body.wbw-mode .dialog,
body.wbw-mode .settings-modal-content {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}
body.wbw-mode .modal-close,
body.wbw-mode .settings-modal-close {
    color: var(--text-secondary) !important;
    background: transparent !important;
}

/* Score badges */
body.wbw-mode .opp-score {
    background: var(--opp-score-bg) !important;
    color: var(--opp-score-text) !important;
}
/* V4.7.19 — Score gradient wbw-mode (monochromatique clair : intensité croissante) */
body.wbw-mode .opp-score[data-score-range="low"]      { background: var(--bg-secondary) !important; color: var(--score-low-text) !important; font-weight: 400; }
body.wbw-mode .opp-score[data-score-range="mid"]      { background: var(--opp-score-bg) !important; color: var(--opp-score-text) !important; }
body.wbw-mode .opp-score[data-score-range="high"]     { background: var(--score-high-bg) !important; color: var(--score-high-text) !important; }
body.wbw-mode .opp-score[data-score-range="excellent"]{ background: var(--score-excellent-bg) !important; color: var(--score-excellent-text) !important; font-weight: 700; }
body.wbw-mode .rank-badge,
body.wbw-mode .rank-top5 {
    background: var(--badge-bg) !important;
    color: var(--text-color) !important;
    border-color: var(--input-border) !important;
}

/* Setup badges (gold/green/blue → gris en WBW) */
body.wbw-mode .badge-gold,
body.wbw-mode .badge-green,
body.wbw-mode .badge-blue {
    background: var(--badge-bg) !important;
    color: var(--accent-primary) !important;
}

/* Signal badges */
body.wbw-mode .sig-badge { background: var(--badge-bg) !important; color: var(--badge-text) !important; }
body.wbw-mode .sig-support { background: var(--bg-secondary) !important; color: var(--accent-primary) !important; }

/* Toasts (zéro couleur) */
body.wbw-mode .toast.success,
body.wbw-mode .toast.error,
body.wbw-mode .toast.info,
body.wbw-mode .alert-toast--info,
body.wbw-mode .alert-toast--success,
body.wbw-mode .alert-toast--warning,
body.wbw-mode .alert-toast--error {
    background: var(--accent-primary) !important;
    color: var(--bg-color) !important;
    border-left: 3px solid var(--input-border) !important;
}

/* Skeleton shimmer en WBW */
body.wbw-mode .skeleton {
    background: linear-gradient(90deg, var(--skeleton-from) 25%, var(--hover-bg) 50%, var(--skeleton-from) 75%);
    background-size: 800px 100%;
    animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

/* Links */
body.wbw-mode a { color: var(--text-color); text-decoration: underline; }
body.wbw-mode a:hover { color: var(--text-hover); }

/* Header */
body.wbw-mode .header {
    background: var(--bg-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
}
body.wbw-mode .username-pill {
    background: var(--hover-bg) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}
body.wbw-mode .role-badge.role-admin {
    color: var(--text-color) !important;
    border-color: rgba(0,0,0,0.3) !important;
}
body.wbw-mode .role-badge.role-user {
    color: var(--text-dimmed) !important;
    border-color: rgba(0,0,0,0.2) !important;
}
body.wbw-mode .portfolio-link {
    color: var(--accent-primary) !important;
    border-color: rgba(0,0,0,0.25) !important;
}

/* Icônes d'action (favoris, portfolio, alerte) */
body.wbw-mode .watchlist-star,
body.wbw-mode #toggle-favorite-btn,
body.wbw-mode #toggle-portfolio-btn,
body.wbw-mode #alert-btn {
    filter: grayscale(1) !important;
    background: transparent !important;
    border: none !important;
}

/* Charts */
body.wbw-mode .chart-panel,
body.wbw-mode .chart-header {
    background: var(--bg-color) !important;
    border-color: var(--border-color) !important;
}
body.wbw-mode .chart-title { color: var(--text-color) !important; }
body.wbw-mode .score-section { border-left-color: var(--input-border) !important; }
body.wbw-mode .chart-modal {
    background: rgba(0, 0, 0, 0.6) !important;
}

/* Score panel (ticker) */
body.wbw-mode #score-panel {
    background: var(--brief-bg) !important;
    border-color: var(--border-color) !important;
}

/* Pas d'ombres */
body.wbw-mode .card,
body.wbw-mode .opportunities,
body.wbw-mode .opp-item,
body.wbw-mode .modal,
body.wbw-mode .modal-content,
body.wbw-mode .btn,
body.wbw-mode button,
body.wbw-mode input,
body.wbw-mode select,
body.wbw-mode textarea,
body.wbw-mode .portfolio-item {
    box-shadow: none !important;
}

/* Emojis : désaturation (B&W fonctionnel, conserve les formes) */
body.wbw-mode img.emoji { filter: grayscale(1) opacity(0.7); }

/* Override styles inline (éléments créés dynamiquement en JS) */
body.wbw-mode div[style*="background: #f8fafc"],
body.wbw-mode div[style*="background:#f8fafc"],
body.wbw-mode div[style*="background: white"],
body.wbw-mode div[style*="background:white"],
body.wbw-mode div[style*="background: #fff"],
body.wbw-mode div[style*="background:#fff"],
body.wbw-mode div[style*="background: #ffffff"],
body.wbw-mode div[style*="background:#ffffff"] {
    background: var(--bg-color) !important;
    color: var(--text-color) !important;
}
body.wbw-mode div[style*="color: #1e293b"],
body.wbw-mode div[style*="color:#1e293b"],
body.wbw-mode div[style*="color: #64748b"],
body.wbw-mode div[style*="color:#64748b"] {
    color: var(--badge-text) !important;
}

/* Mobile header */
@media (max-width: 768px) {
    body.wbw-mode #header-user-info {
        border-top-color: var(--border-color) !important;
    }
}

/* ============================================================================
   WBW — Audit complet V4.5.48
   Tous les éléments manquants : boutons, badges, charts, pages, portfolio…
   ============================================================================ */

/* --- Bouton theme toggle --- */
body.wbw-mode #theme-toggle,
body.wbw-mode #theme-toggle-mobile {
    background: var(--text-color) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    color: var(--bg-color) !important;
}
body.wbw-mode #theme-toggle:hover,
body.wbw-mode #theme-toggle-mobile:hover {
    background: var(--badge-text) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    transform: none !important;
}

/* --- Bordures colorées des cartes → gris neutre --- */
body.wbw-mode .card {
    border-left: 1px solid var(--border-color) !important;
    border-right: 1px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
body.wbw-mode .card.blue,
body.wbw-mode .card.green,
body.wbw-mode .card.purple,
body.wbw-mode .card.orange,
body.wbw-mode .card.red,
body.wbw-mode .card.teal,
body.wbw-mode .card.indigo { border-top-color: var(--text-muted) !important; }
body.wbw-mode .card:hover {
    border-color: var(--input-border) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
}

/* Carte contenant la portfolio-list */
body.wbw-mode .card:has(.portfolio-list) { background: var(--brief-bg) !important; }

/* --- Boutons variantes colorées --- */
body.wbw-mode .btn.success,
body.wbw-mode .btn.success:not(:disabled) { background: var(--badge-text) !important; color: var(--bg-color) !important; }
body.wbw-mode .btn.success:hover { background: var(--text-color) !important; }
body.wbw-mode .btn.warning,
body.wbw-mode .btn.warning:not(:disabled) { background: var(--text-secondary) !important; color: var(--bg-color) !important; }
body.wbw-mode .btn.warning:hover { background: var(--badge-text) !important; }
body.wbw-mode .btn.secondary,
body.wbw-mode button.secondary { background: var(--text-secondary) !important; color: var(--bg-color) !important; border-color: var(--text-secondary) !important; }
body.wbw-mode .btn.secondary:hover { background: var(--text-secondary) !important; }
body.wbw-mode .btn.primary { background: var(--text-color) !important; color: var(--bg-color) !important; }
body.wbw-mode .btn.primary:hover { background: var(--accent-primary) !important; }

/* --- Bouton retour --- */
body.wbw-mode .btn-back {
    background: transparent !important;
    border: none !important;
    color: var(--text-color) !important;
    box-shadow: none !important;
}
body.wbw-mode .btn-back:hover { background: transparent !important; text-decoration: underline !important; }

/* --- Modal buttons --- */
body.wbw-mode .modal-button-primary {
    background: var(--accent-primary) !important;
    color: var(--bg-color) !important;
}
body.wbw-mode .modal-button-primary:hover { background: var(--text-color) !important; }
body.wbw-mode .modal-button-secondary {
    background: var(--bg-secondary) !important;
    color: var(--accent-primary) !important;
}
body.wbw-mode .modal-button-secondary:hover { background: var(--border-color) !important; }

/* --- Messages (erreur / succès / info) --- */
body.wbw-mode .alert,
body.wbw-mode .message {
    background: var(--bg-secondary) !important;
    border-color: var(--input-border) !important;
    color: var(--text-color) !important;
}
body.wbw-mode .message.error { background: var(--hover-bg) !important; color: var(--accent-primary) !important; }
body.wbw-mode .message.success { background: var(--hover-bg) !important; color: var(--accent-primary) !important; }
body.wbw-mode .message.info { background: var(--bg-secondary) !important; color: var(--accent-primary) !important; }
body.wbw-mode .message.loading { background: var(--bg-secondary) !important; color: var(--accent-primary) !important; }

/* --- Spinner --- */
body.wbw-mode .spinner {
    border-color: rgba(0, 0, 0, 0.1) !important;
    border-top-color: var(--badge-text) !important;
}

/* --- Score ajusté intra-secteur --- */
body.wbw-mode .score-adj { color: var(--text-secondary) !important; background: var(--hover-bg) !important; }

/* --- Badges status / version / env --- */
body.wbw-mode .status-badge {
    background: var(--bg-secondary) !important;
    color: var(--badge-text) !important;
    border: 1px solid var(--input-border) !important;
}
body.wbw-mode .version-badge {
    background: var(--hover-bg) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
}
body.wbw-mode .env-badge.env-prod,
body.wbw-mode .env-badge.env-rec {
    background: var(--bg-secondary) !important;
    color: var(--badge-text) !important;
    border-color: var(--input-border) !important;
}

/* --- Bouton collapse/expand --- */
body.wbw-mode .collapse-btn {
    background: var(--bg-secondary) !important;
    color: var(--accent-primary) !important;
    border-color: transparent !important;
}
body.wbw-mode .collapse-btn:hover { background: var(--border-color) !important; transform: none !important; }

/* --- Brief display --- */
body.wbw-mode .brief-display {
    background: var(--brief-bg) !important;
    color: var(--text-color) !important;
    border-left: 3px solid var(--input-border) !important;
}
body.wbw-mode .brief-display a { color: var(--badge-text) !important; }

/* --- Autocomplete / suggestions --- */
body.wbw-mode #search-suggestions,
body.wbw-mode div[id$="-suggestions"] {
    background: var(--bg-color) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}
body.wbw-mode .search-suggestion-item {
    color: var(--text-color) !important;
    border-bottom-color: var(--badge-bg) !important;
    background: var(--bg-color) !important;
}
body.wbw-mode .search-suggestion-item:hover,
body.wbw-mode .search-suggestion-item.active {
    background: var(--hover-bg) !important;
    color: var(--text-color) !important;
}

/* --- Scheduler / Config --- */
body.wbw-mode #scheduler-status-box {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}
body.wbw-mode #scheduler-status-box span,
body.wbw-mode #scheduler-status span { color: var(--text-color) !important; }
body.wbw-mode #scheduler-toggle-btn {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}
body.wbw-mode #scheduler-toggle-btn:hover { background: var(--score-high-bg) !important; }
body.wbw-mode #recette-daily-job-hour,
body.wbw-mode #recette-daily-job-minute,
body.wbw-mode #card-config input,
body.wbw-mode #card-config select,
body.wbw-mode .config-section input,
body.wbw-mode .config-section select {
    background: var(--bg-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}

/* --- Scrollbars --- */
body.wbw-mode {
    scrollbar-color: var(--input-border) var(--bg-secondary);
    scrollbar-width: thin;
}
body.wbw-mode ::-webkit-scrollbar { width: 6px; height: 6px; }
body.wbw-mode ::-webkit-scrollbar-track { background: var(--bg-secondary); }
body.wbw-mode ::-webkit-scrollbar-thumb { background: var(--input-border); border-radius: 3px; }
body.wbw-mode ::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* --- Badges mobile / ligne prix --- */
body.wbw-mode .filters-badge { background: var(--badge-text) !important; color: var(--bg-color) !important; }
body.wbw-mode .opp-price-line { color: var(--text-secondary) !important; }

/* --- Bloc "Modèle actuel" (inline style violet/purple) --- */
body.wbw-mode #model-display {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}
body.wbw-mode div[style*="rgba(139, 92, 246"],
body.wbw-mode div[style*="rgba(59, 130, 246"],
body.wbw-mode div[style*="rgba(16, 185, 129"],
body.wbw-mode div[style*="rgba(239, 68, 68"],
body.wbw-mode div[style*="rgba(245, 158, 11"] {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

/* --- Icônes étoiles / portefeuille / cloche : grayscale strict --- */
body.wbw-mode .watchlist-star { color: var(--badge-text) !important; filter: none !important; }
body.wbw-mode .watchlist-star.filled { color: var(--text-color) !important; }
body.wbw-mode .watchlist-star:hover { color: var(--text-hover) !important; }
body.wbw-mode .portfolio-btn:not(.filled) { color: var(--text-secondary) !important; filter: grayscale(1) !important; }
body.wbw-mode .portfolio-btn.filled { color: var(--text-color) !important; filter: none !important; }
body.wbw-mode #alert-btn,
body.wbw-mode .alert-btn { filter: grayscale(1) !important; }

/* --- Plotly charts WBW (fond blanc, texte sombre, grilles légères) --- */
body.wbw-mode .plotly,
body.wbw-mode .js-plotly-plot,
body.wbw-mode .plot-container,
body.wbw-mode div[id^="chart-"],
body.wbw-mode div[id$="-chart"] { background: var(--bg-color) !important; }
body.wbw-mode .plotly .bg,
body.wbw-mode .plotly rect.bg,
body.wbw-mode .js-plotly-plot .bg,
body.wbw-mode .main-svg .bg { fill: var(--bg-color) !important; }
body.wbw-mode .plotly text,
body.wbw-mode .js-plotly-plot text,
body.wbw-mode .plotly .xtick text,
body.wbw-mode .plotly .ytick text,
body.wbw-mode .plotly .legendtext,
body.wbw-mode .plotly .g-xtitle text,
body.wbw-mode .plotly .g-ytitle text { fill: var(--badge-text) !important; }
body.wbw-mode .plotly .gridlayer path,
body.wbw-mode .plotly .crisp { stroke: var(--border-color) !important; stroke-opacity: 0.8 !important; }
body.wbw-mode .plotly .zerolinelayer path { stroke: var(--input-border) !important; }
body.wbw-mode .chart-modal { background: rgba(0, 0, 0, 0.6) !important; }
/* Conteneur Chart.js performance */
body.wbw-mode div:has(> #performance-chart) {
    background: var(--bg-color) !important;
    border-radius: 8px;
}

/* --- Portfolio items WBW --- */
body.wbw-mode .portfolio-item,
body.wbw-mode div.portfolio-item {
    background: var(--bg-color) !important;
    border: none !important;
    border-bottom: 1px solid var(--badge-bg) !important;
}
body.wbw-mode .portfolio-item:hover,
body.wbw-mode div.portfolio-item:hover { background: var(--brief-bg) !important; }
body.wbw-mode .portfolio-item-info h3 { color: var(--text-color) !important; }
body.wbw-mode .portfolio-item-info h3 a {
    color: var(--badge-text) !important;
    text-decoration: underline !important;
    background: transparent !important;
}
body.wbw-mode .portfolio-item-info h3 a:hover { color: var(--text-hover) !important; }
body.wbw-mode .portfolio-item-info p { color: var(--text-secondary) !important; }
body.wbw-mode .portfolio-item-actions .btn,
body.wbw-mode .portfolio-item-actions a.btn,
body.wbw-mode .portfolio-item-actions button.btn {
    background: transparent !important;
    border: 1px solid var(--input-border) !important;
    color: var(--badge-text) !important;
}
body.wbw-mode .portfolio-item-actions .btn:hover,
body.wbw-mode .portfolio-item-actions a.btn:hover { background: var(--hover-bg) !important; }
body.wbw-mode .portfolio-item-actions button[data-action="open-alert"] {
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary) !important;
}

/* Performance summary cards */
body.wbw-mode #performance-summary > div {
    background: var(--brief-bg) !important;
    border: 1px solid var(--border-color) !important;
}
body.wbw-mode #performance-summary > div > div:first-child,
body.wbw-mode #performance-summary > div[style*="background"] > div:first-child { color: var(--text-secondary) !important; }
body.wbw-mode #performance-summary > div > div:last-child,
body.wbw-mode #performance-summary > div[style*="background"] > div:last-child { color: var(--text-color) !important; }

/* --- Ticker page: score sections, isin, status --- */
body.wbw-mode .score-section {
    background: var(--brief-bg) !important;
    border-left-color: var(--text-muted) !important;
}
body.wbw-mode .score-section:hover { background: var(--hover-bg) !important; }
body.wbw-mode .ticker-isin { background: transparent !important; color: var(--badge-text) !important; }
body.wbw-mode #status {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}
body.wbw-mode .expand-btn { color: var(--text-secondary) !important; }
body.wbw-mode .expand-btn:hover { color: var(--text-color) !important; background: transparent !important; }

/* --- Surcharges inline background: #f8fafc (portfolio summary, divers) --- */
body.wbw-mode [style*="background: #f8fafc"],
body.wbw-mode [style*="background:#f8fafc"],
body.wbw-mode [style*="background: #f8fafc;"],
body.wbw-mode [style*="background:#f8fafc;"] {
    background: var(--brief-bg) !important;
}
body.wbw-mode [style*="color: #1e293b"],
body.wbw-mode [style*="color:#1e293b"] { color: var(--text-color) !important; }
body.wbw-mode [style*="color: #64748b"],
body.wbw-mode [style*="color:#64748b"] { color: var(--text-secondary) !important; }

/* --- Login page WBW --- */
body.wbw-mode .login-container {
    background: var(--bg-color) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06) !important;
}
body.wbw-mode .logo h1 { color: var(--text-color) !important; }
body.wbw-mode .divider,
body.wbw-mode .register-link { color: var(--text-secondary) !important; }
body.wbw-mode .form-group input:focus,
body.wbw-mode .login-container input:focus {
    border-color: var(--badge-text) !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08) !important;
}
body.wbw-mode .auth-tab.active { color: var(--text-color) !important; border-bottom-color: var(--badge-text) !important; }
body.wbw-mode .btn-login {
    background: var(--accent-primary) !important;
    color: var(--bg-color) !important;
    border: 1px solid var(--accent-primary) !important;
}
body.wbw-mode .btn-login:hover { background: var(--text-hover) !important; }
body.wbw-mode .btn-social,
body.wbw-mode .btn-google {
    background: var(--bg-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}
body.wbw-mode .success-message {
    background: var(--hover-bg) !important;
    border-left-color: var(--text-secondary) !important;
    color: var(--text-color) !important;
}
body.wbw-mode .error-message {
    background: var(--hover-bg) !important;
    border-left-color: var(--text-muted) !important;
    color: var(--accent-primary) !important;
}
body.wbw-mode .biometric-options {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--badge-text) !important;
}
body.wbw-mode .biometric-options .biometric-login-link { color: var(--text-color) !important; }
body.wbw-mode .biometric-options .biometric-icon-btn {
    background: var(--bg-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}
body.wbw-mode #cold-start-overlay { background: var(--bg-color) !important; color: var(--text-color) !important; }

/* --- Opportunités / Favoris --- */
body.wbw-mode .opportunities {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
body.wbw-mode .opp-item { border-bottom-color: var(--badge-bg) !important; }
body.wbw-mode .opp-item:hover { background-color: var(--bg-secondary) !important; }

/* --- Header ombre légère --- */
body.wbw-mode .header { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important; }

/* ============================================================================
   WBW — V4.5.50 : Spécificité boutons icônes + gradients ticker
   Ces règles doivent être APRÈS la règle générale body.wbw-mode button:not(...)
   body.wbw-mode button.classe = (0,2,2) = même spécificité, mais position TARDIVE → gagne
   ============================================================================ */

/* Boutons icônes WBW — transparents.
   NOTE : le sélecteur général a été modifié pour les EXCLURE directement (voir au-dessus).
   Ces règles sont conservées comme filet de sécurité. */
body.wbw-mode button.opp-action-btn,
body.wbw-mode button.watchlist-star,
body.wbw-mode .opp-item button.watchlist-star,
body.wbw-mode .card button.watchlist-star,
body.wbw-mode button.portfolio-btn,
body.wbw-mode .opp-item button.portfolio-btn,
body.wbw-mode .card button.portfolio-btn,
body.wbw-mode button.expand-btn,
body.wbw-mode button#toggle-favorite-btn,
body.wbw-mode button#toggle-portfolio-btn,
body.wbw-mode button#alert-btn,
body.wbw-mode button[data-action="open-alert"],
body.wbw-mode button.has-alert {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--badge-text) !important;
}
body.wbw-mode button.opp-action-btn:hover,
body.wbw-mode button.watchlist-star:hover,
body.wbw-mode button.portfolio-btn:hover,
body.wbw-mode button.expand-btn:hover,
body.wbw-mode button#toggle-favorite-btn:hover,
body.wbw-mode button#toggle-portfolio-btn:hover,
body.wbw-mode button#alert-btn:hover,
body.wbw-mode button[data-action="open-alert"]:hover {
    background: transparent !important;
    color: var(--text-hover) !important;
}

/* Collapse btn WBW — gris clair (override #222222 général) */
body.wbw-mode button.collapse-btn {
    background: var(--skeleton-from) !important;
    color: var(--badge-text) !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: none !important;
}
body.wbw-mode button.collapse-btn:hover {
    background: var(--border-color) !important;
    color: var(--text-color) !important;
}

/* Bouton Retour WBW — sans rectangle (texte seul, transparence) */
body.wbw-mode button.btn-back,
body.wbw-mode a.btn-back {
    background: transparent !important;
    border: none !important;
    color: var(--text-color) !important;
    box-shadow: none !important;
}
body.wbw-mode button.btn-back:hover,
body.wbw-mode a.btn-back:hover {
    background: transparent !important;
    text-decoration: underline !important;
}


/* ============================================================================
   WBW — Ticker page : gradients violets à neutraliser
   ============================================================================ */

/* h1 "Graphique" : gradient clip text → texte noir pur */
body.wbw-mode h1 {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: var(--text-color) !important;
    color: var(--text-color) !important;
}

/* Barre violette 3px en haut des chart-panel */
body.wbw-mode .chart-panel::before {
    background: var(--border-subtle);
}

/* .chart-panel hover : pas de translate en WBW */
body.wbw-mode .chart-panel:hover {
    transform: none !important;
}

/* En-tête score panel (fond violet dégradé → gris foncé) */
body.wbw-mode .score-header {
    background: var(--badge-text) !important;
    color: var(--bg-color) !important;
}
body.wbw-mode .score-header h3,
body.wbw-mode .score-header span,
body.wbw-mode .score-header p {
    color: var(--bg-color) !important;
    -webkit-text-fill-color: var(--bg-color) !important;
}
body.wbw-mode .global-score {
    color: var(--bg-color) !important;
    -webkit-text-fill-color: var(--bg-color) !important;
    text-shadow: none !important;
}

/* Bouton Analyse IA dans la toolbar ticker — fond clair pour lisibilité WBW */
body.wbw-mode button#ai-analysis-btn,
body.wbw-mode #ai-analysis-btn {
    background: var(--bg-secondary) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--text-secondary) !important;
    box-shadow: none !important;
}

/* ============================================================================
   WBW — indicators.html : cartes et nav-items avec gradient inline violet/rose
   ============================================================================ */
body.wbw-mode .indicator-card {
    background: var(--badge-text) !important;
    color: var(--bg-color) !important;
    box-shadow: none !important;
}
body.wbw-mode .indicator-card h4,
body.wbw-mode .indicator-card p,
body.wbw-mode .indicator-card span {
    color: var(--bg-color) !important;
    -webkit-text-fill-color: var(--bg-color) !important;
}
body.wbw-mode .nav-item {
    background: var(--text-dimmed) !important;
    color: var(--bg-color) !important;
    box-shadow: none !important;
}
body.wbw-mode .nav-item h3,
body.wbw-mode .nav-item p { color: var(--bg-color) !important; }
body.wbw-mode .nav-item:hover {
    background: var(--accent-primary) !important;
    transform: none !important;
    box-shadow: none !important;
}
body.wbw-mode .formula { background: rgba(0,0,0,0.1) !important; }

/* index.html progress bar inline style (cold-start overlay) */
body.wbw-mode #progress-bar { background: var(--badge-text) !important; }

/* ============================================================================
   WBW + BW — Boutons de modales JS (inline styles colorés)
   Ces boutons ont background: rgba(...) ou #dc2626 etc. en inline → overridés
   ============================================================================ */

/* Boutons fermeture × (background: none inline — normalement exclus du sélecteur,
   filet de sécurité au cas où la détection [style*=...] rate une variante) */
body.wbw-mode button[data-action="close-modal"],
body.wbw-mode button[id^="close-"],
body.wbw-mode button#close-alerts-list,
body.wbw-mode button#close-alerts-triggered,
body.wbw-mode button#app-update-banner-close {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-secondary) !important;
}

/* Boutons "Supprimer" alerte (delete-alert) — gris clair avec bordure en WBW */
body.wbw-mode button[data-action="delete-alert"] {
    background: var(--hover-bg) !important;
    color: var(--badge-text) !important;
    border: 1px solid var(--input-border) !important;
}
body.wbw-mode button[data-action="delete-alert"]:hover {
    background: var(--delete-hover-bg) !important;
}

/* Boutons confirm/cancel de modale de suppression */
body.wbw-mode #alert-delete-confirm-btn {
    background: var(--badge-text) !important;
    color: var(--bg-color) !important;
    border: none !important;
}
body.wbw-mode #alert-delete-cancel-btn,
body.wbw-mode #btn-cancel-alert,
body.wbw-mode #portfolio-modal-cancel-btn {
    background: var(--bg-secondary) !important;
    color: var(--badge-text) !important;
    border: 1px solid var(--border-subtle) !important;
}
body.wbw-mode #btn-save-alert {
    background: var(--accent-primary) !important;
    color: var(--bg-color) !important;
    border: none !important;
}

/* Portfolio modal "Ajouter" (type=submit exclu du sélecteur général) */
body.wbw-mode .portfolio-add-modal button[type="submit"],
body.wbw-mode #portfolio-modal button[type="submit"] {
    background: var(--accent-primary) !important;
    color: var(--bg-color) !important;
}

/* Tout button[style*=background: none] — filet de sécurité général */
body.wbw-mode button[style*="background: none"],
body.wbw-mode button[style*="background:none"] {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
/* ============================================================================
   GUIDE INDICATEURS — pénalités distinguées sans rouge (WBW / WCAG AAA)
   ============================================================================ */
body.wbw-mode .guide-penalty-row {
    font-weight: 700;
    text-decoration: underline dotted #555555;
}

/* ============================================================================
   DIALOGS NATIFS — backdrops thème B&W / WBW (V4.5.75)
   ============================================================================ */
body.wbw-mode dialog#config-loading-dialog::backdrop,
html.wbw-mode dialog#config-loading-dialog::backdrop {
    background: rgba(255, 255, 255, 0.65);
}
