/* ============================================================
   PORTAIL CLIENTS — THÈME NUIT (html[data-theme="dark"])  2026-09-13
   Le portail n'a pas de préférence serveur : le mode vient du dernier
   choix de l'onglet (sessionStorage alicea_theme) sinon de la préférence
   système. Bascule Jour / Nuit dans l'en-tête (clients-theme.js).
   Première partie manuelle ; seconde partie générée par
   scripts/gen-theme-nuit.js --pages=outils/… (mandats-immo.css, padel).
   ============================================================ */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] {
  --color-marine:   #F5A574;   /* sert de couleur de TEXTE (titres) : abricot en nuit */
  --color-creme:    #0F1729;
  --text-dark:      #F3F0EB;
  --text-gray:      #B8BCC8;
  --text-light:     #8E97A9;
  --border:         #263450;
  --danger:         #F87171;
  --success:        #6FCB8A;
  --texte-desactive: #8E97A9;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.35);
}
html[data-theme="dark"] body { background: #0F1729; color: #F3F0EB; }
html[data-theme="dark"] .cl-header { background: #0A1020; border-bottom: 1px solid #1E2B45; }
html[data-theme="dark"] .cl-card, html[data-theme="dark"] .cl-tool-card { background: #16213A; border-color: #263450; }
html[data-theme="dark"] .cl-field input, html[data-theme="dark"] .cl-field select, html[data-theme="dark"] .cl-field textarea {
  background: #111A2E; color: #F3F0EB; border-color: #263450;
}
html[data-theme="dark"] .cl-btn-secondary { background: #16213A; color: #F3F0EB; border-color: #34456A; }
html[data-theme="dark"] .cl-btn-secondary:hover { background: #F5A574; color: #0F1729; }
html[data-theme="dark"] .cl-btn-ghost { color: #B8BCC8; }
html[data-theme="dark"] .cl-btn-ghost:hover { color: #F5A574; }
html[data-theme="dark"] .cl-msg-error { background: rgba(248,113,113,0.14); border-color: rgba(248,113,113,0.35); }
html[data-theme="dark"] .cl-msg-success { background: rgba(111,203,138,0.14); border-color: rgba(111,203,138,0.35); }
html[data-theme="dark"] .cl-msg-info { background: rgba(245,166,35,0.14); color: #F5A623; border-color: rgba(245,166,35,0.35); }
html[data-theme="dark"] .cl-footer { color: #8E97A9; border-color: #1E2B45; }

/* Bascule Jour / Nuit dans l'en-tête marine */
.cl-theme-toggle {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  background: rgba(255,255,255,0.12); border: none; border-radius: 99px; cursor: pointer; font-family: inherit;
}
.cl-theme-toggle .ttt-opt {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.6); transition: all 0.15s;
}
.cl-theme-toggle .ttt-opt.on { background: #FFFFFF; color: #1B3A5C; }
html[data-theme="dark"] .cl-theme-toggle .ttt-opt.on { background: #F5A574; color: #0F1729; }

/* ---- Pages outils : styles en ligne du cabinet (mandats-immo, padel) ---- */
html[data-theme="dark"] [style*="background:#fff"], html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:white"], html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background:#FFFFFF"], html[data-theme="dark"] [style*="background: #FFFFFF"] { background-color: #16213A !important; }
html[data-theme="dark"] [style*="color:#1B3A5C"], html[data-theme="dark"] [style*="color: #1B3A5C"],
html[data-theme="dark"] [style*="color:#2D3142"], html[data-theme="dark"] [style*="color: #2D3142"],
html[data-theme="dark"] [style*="color:var(--color-marine)"], html[data-theme="dark"] [style*="color: var(--color-marine)"] { color: #F3F0EB !important; }
html[data-theme="dark"] [style*="color:#4A5568"], html[data-theme="dark"] [style*="color: #4A5568"],
html[data-theme="dark"] [style*="color:#6B7280"], html[data-theme="dark"] [style*="color: #6B7280"] { color: #B8BCC8 !important; }
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]), html[data-theme="dark"] select, html[data-theme="dark"] textarea {
  background-color: #111A2E !important; color: #F3F0EB !important; border-color: #263450 !important;
}
html[data-theme="dark"] table th { background-color: #111A2E; color: #B8BCC8; border-color: #263450; }
html[data-theme="dark"] table td { border-color: #263450; color: #F3F0EB; }

/* ---- Surcharges dérivées des <style> des pages (générées par scripts/gen-theme-nuit.js) ---- */
html[data-theme="dark"] #section-gestion-mandats:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] #section-nego-accueil .nd-c { background-color: #16213A; }
html[data-theme="dark"] #section-nego-accueil .nd-tip { background: #111A2E; }
html[data-theme="dark"] .gm-header:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background: #111A2E; }
html[data-theme="dark"] .gm-header-action select { background-color: #16213A; color: #E8E6E1; }
html[data-theme="dark"] .gm-tab:hover { color: #E8E6E1; }
html[data-theme="dark"] .gm-dash-validate-pane:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-dash-validate-pane[data-empty="true"] .gm-dash-validate-count { background-color: #111A2E; }
html[data-theme="dark"] .gm-dash-validate-item:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-dash-validate-item-name { color: #E8E6E1; }
html[data-theme="dark"] .gm-dash-validate-btn-reject:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-dash-kpi:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-dash-kpi-value { color: #E8E6E1; }
html[data-theme="dark"] .gm-dash-kpi.accent .gm-dash-kpi-value { color: #E8E6E1; }
html[data-theme="dark"] .gm-dash-card:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-dash-card-title { color: #E8E6E1; }
html[data-theme="dark"] .gm-dash-list-item:hover { background-color: #111A2E; }
html[data-theme="dark"] .gm-dash-list-avatar:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-dash-list-title { color: #E8E6E1; }
html[data-theme="dark"] .gm-search-wrap input { background-color: #16213A; color: #E8E6E1; }
html[data-theme="dark"] .gm-toolbar select { background-color: #16213A; color: #E8E6E1; }
html[data-theme="dark"] .gm-btn-ghost:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-btn-ghost:hover { background-color: #111A2E; color: #E8E6E1; }
html[data-theme="dark"] .gm-btn-danger:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-table-wrap:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-table th { color: #A7ADBB; }
html[data-theme="dark"] .gm-table th.gm-sortable:hover { color: #E8E6E1; }
html[data-theme="dark"] .gm-table td { color: #E8E6E1; }
html[data-theme="dark"] .gm-cell-main { color: #E8E6E1; }
html[data-theme="dark"] .gm-cell-money-main { color: #E8E6E1; }
html[data-theme="dark"] .gm-row-collab-name { color: #E8E6E1; }
html[data-theme="dark"] .gm-row-collab-flag:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-table tfoot td { background-color: #111A2E; color: #E8E6E1; }
html[data-theme="dark"] .gm-edit-btn:hover { background-color: #111A2E; }
html[data-theme="dark"] .gm-empty-title { color: #E8E6E1; }
html[data-theme="dark"] .gm-collab-card:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-collab-photo-rank-badge { color: #E8E6E1; }
html[data-theme="dark"] .gm-collab-invite-btn.ghost:hover { background-color: #16213A; }
html[data-theme="dark"] .gm-collab-invite-btn:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-view-toggle:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-view-toggle-btn:hover { color: #E8E6E1; }
html[data-theme="dark"] .gm-view-toggle-btn.active:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-collab-list-view:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-collab-list-table th { background-color: #111A2E; }
html[data-theme="dark"] .gm-collab-list-table td { color: #E8E6E1; }
html[data-theme="dark"] .gm-collab-list-avatar:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-collab-list-row-name .name { color: #E8E6E1; }
html[data-theme="dark"] .gm-collab-photo-zone:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-collab-photo-preview:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-collab-photo-zone-info:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-grille-wrap:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-grille-table th { color: #E8E6E1; }
html[data-theme="dark"] .gm-grille-table td:first-child { color: #E8E6E1; }
html[data-theme="dark"] .gm-grille-row-cumul td { background-color: #111A2E; }
html[data-theme="dark"] .gm-rate-edit-wrap:hover { background-color: #111A2E; }
html[data-theme="dark"] .gm-rate-input:hover { background-color: #16213A; }
html[data-theme="dark"] .gm-rate-input:focus { background-color: #16213A; }
html[data-theme="dark"] .gm-tranche-add:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-recalc-status.running:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-test-item:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-kpi-card:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-kpi-value { color: #E8E6E1; }
html[data-theme="dark"] .gm-cumul-chart-wrap:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-chart-title { color: #E8E6E1; }
html[data-theme="dark"] .gm-detail-section-title { color: #E8E6E1; }
html[data-theme="dark"] .gm-detail-count:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-modal:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-modal-title { color: #E8E6E1; }
html[data-theme="dark"] .gm-modal-close:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-modal-close:hover { background-color: #111A2E; color: #E8E6E1; }
html[data-theme="dark"] .gm-tour-modal:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-tour-progress:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-tour-highlight:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background: #111A2E; color: #E8E6E1; }
html[data-theme="dark"] .gm-tour-footer:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-tour-dot:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-field input, html[data-theme="dark"] .gm-field select, html[data-theme="dark"] .gm-field textarea { background-color: #16213A; color: #E8E6E1; }
html[data-theme="dark"] .gm-field-checkbox span { color: #E8E6E1; }
html[data-theme="dark"] .gm-retro-preview:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-retro-card:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-retro-card-total:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-retro-value { color: #E8E6E1; }
html[data-theme="dark"] .gm-external-block:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #111A2E; }
html[data-theme="dark"] .gm-quick-ratio:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-split:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-list:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-search input:focus { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-grouptog button { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-li.active:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-dh:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-act-btn:hover { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-dh-title:focus { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-dh-addr:focus { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-tl-circle:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-tl-step.current .gm-v3-tl-circle { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-zone:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-section:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-notes:focus { background-color: #16213A; }
html[data-theme="dark"] .gm-v3-toast:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .cl-card:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .cl-field input, html[data-theme="dark"] .cl-field select, html[data-theme="dark"] .cl-field textarea { background-color: #16213A; }
html[data-theme="dark"] .cl-btn-secondary:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }
html[data-theme="dark"] .cl-tool-card:not(.active):not(.is-active):not(.on):not(.selected):not(.current):not(.checked):not(.sorted-asc):not(.sorted-desc) { background-color: #16213A; }

/* Tableau de bord en widgets (moteur partagé) — variables lues par journee-colonnes.css */
html[data-theme="dark"] {
  --blanc: #16213A; --bordure-hover: #34456A; --bordure-legere: #1E2B45;
  --corail-text: #F5A574; --corail-light: rgba(232,115,74,0.15); --erreur-light: rgba(248,113,113,0.14);
  --bleu-dark: #7C9DC4;
}
html[data-theme="dark"] .mj-page-btn.primary { background: #F5A574; color: #0F1729; border-color: #F5A574; }
html[data-theme="dark"] .mj-colw-menu { box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
html[data-theme="dark"] .cl-widget-plain { background: transparent; }
html[data-theme="dark"] .cl-quick { background: #111A2E; color: #F3F0EB; border-color: #263450; }
html[data-theme="dark"] .cl-membre-av { color: #0F1729; }
html[data-theme="dark"] .cl-kv b { color: #F3F0EB; }

/* Recherche du portail */
html[data-theme="dark"] .cl-search { background: #16213A; border-color: #263450; }
html[data-theme="dark"] .cl-search kbd { background: #111A2E; border-color: #263450; }
html[data-theme="dark"] .cls-box { background: #16213A; }
html[data-theme="dark"] .cls-preview { background: #111A2E; }
html[data-theme="dark"] .cls-pills span, html[data-theme="dark"] .cls-qa button, html[data-theme="dark"] .cls-qa .cls-btn { background: #16213A; border-color: #263450; color: #F3F0EB; }
html[data-theme="dark"] .cls-qa .p { background: #F5A574; color: #0F1729; border-color: #F5A574; }
html[data-theme="dark"] .cls-av { background: #F5A574; color: #0F1729; }
html[data-theme="dark"] .mj-hero-results { background: #16213A; }
