/* NASORA CRM — mode sombre activable par l'utilisateur */
html[data-theme="dark"] {
  color-scheme: dark;
  --nasora-green: #55c58a;
  --nasora-green-hover: #3daa72;
  --nasora-green-dark: #a5e7c2;
  --nasora-green-soft: #203c30;
  --nasora-green-pale: #192b22;
  --nasora-ink: #f1f5f2;
  --nasora-text: #e0e8e2;
  --nasora-muted: #b0beb5;
  --nasora-border: #34483c;
  --nasora-border-strong: #496153;
  --nasora-white: #202a24;
  --nasora-bg: #141b17;
  --nasora-shadow: 0 2px 10px rgba(0,0,0,.2);
  --nasora-shadow-hover: 0 7px 20px rgba(0,0,0,.28);
}
html[data-theme="dark"] body,
html[data-theme="dark"] .nasora-app-shell,
html[data-theme="dark"] main.container {
  background: #141b17 !important;
  color: #e0e8e2 !important;
}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] strong,
html[data-theme="dark"] b,
html[data-theme="dark"] label,
html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] td,
html[data-theme="dark"] th,
html[data-theme="dark"] .nasora-user-copy,
html[data-theme="dark"] .nasora-user-copy strong,
html[data-theme="dark"] .nasora-user-copy small {
  color: #e0e8e2 !important;
}
html[data-theme="dark"] small,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .section-subtitle,
html[data-theme="dark"] .panel-subtitle {
  color: #b0beb5 !important;
}
html[data-theme="dark"] .nasora-topbar,
html[data-theme="dark"] .nasora-sidebar,
html[data-theme="dark"] .site-header,
html[data-theme="dark"] footer {
  background: #1b2620 !important;
  color: #e0e8e2 !important;
  border-color: #34483c !important;
}
html[data-theme="dark"] .nasora-topnav,
html[data-theme="dark"] .site-nav {
  background: #103c29 !important;
}
html[data-theme="dark"] .nasora-topnav a,
html[data-theme="dark"] .nasora-sidebar a,
html[data-theme="dark"] .nasora-sidebar button,
html[data-theme="dark"] .site-nav a {
  color: #e7f6ec !important;
}
html[data-theme="dark"] .nasora-topnav a:hover,
html[data-theme="dark"] .nasora-sidebar a:hover {
  background: #263c30 !important;
}
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .form-container,
html[data-theme="dark"] .filter-form,
html[data-theme="dark"] .responsive-table,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .data-card,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .planning-hero,
html[data-theme="dark"] .planning-info-card,
html[data-theme="dark"] .planning-admin-card,
html[data-theme="dark"] .planning-empty,
html[data-theme="dark"] .planning-empty-card,
html[data-theme="dark"] .planning-week-card,
html[data-theme="dark"] .eval-hero,
html[data-theme="dark"] .eval-commercial-card,
html[data-theme="dark"] .eval-empty,
html[data-theme="dark"] .eval-live-card,
html[data-theme="dark"] .eval-panel,
html[data-theme="dark"] .cookie-banner,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu {
  background: #202a24 !important;
  color: #e0e8e2 !important;
  border-color: #34483c !important;
  box-shadow: 0 2px 10px rgba(0,0,0,.2) !important;
}
html[data-theme="dark"] .planning-week-header,
html[data-theme="dark"] .eval-commercial-meta,
html[data-theme="dark"] .eval-level-grid > div,
html[data-theme="dark"] .eval-management-note,
html[data-theme="dark"] .planning-rules span {
  background: #192b22 !important;
  color: #d8f0e1 !important;
  border-color: #34483c !important;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-dropdown {
  background: #18211b !important;
  color: #edf4ef !important;
  border-color: #496153 !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #9eafa4 !important;
}
html[data-theme="dark"] table,
html[data-theme="dark"] .responsive-table table {
  background: #202a24 !important;
  color: #e0e8e2 !important;
}
html[data-theme="dark"] .responsive-table th,
html[data-theme="dark"] .responsive-table thead th,
html[data-theme="dark"] table thead th {
  background: #203c30 !important;
  color: #c7f2d8 !important;
  border-color: #496153 !important;
}
html[data-theme="dark"] .responsive-table td,
html[data-theme="dark"] table td,
html[data-theme="dark"] table th {
  border-color: #34483c !important;
}
html[data-theme="dark"] .responsive-table tbody tr:nth-child(even),
html[data-theme="dark"] table tbody tr:nth-child(even) {
  background: #1a241e !important;
}
html[data-theme="dark"] .responsive-table tbody tr:hover,
html[data-theme="dark"] table tbody tr:hover {
  background: #263c30 !important;
}
html[data-theme="dark"] a:not(.nasora-topnav a):not(.nasora-sidebar a):not(.btn):not(.site-nav a) {
  color: #72d6a0 !important;
}
html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .btn-danger-outline,
html[data-theme="dark"] .cookie-reject {
  background: #26372d !important;
  color: #d8f0e1 !important;
  border-color: #496153 !important;
}
html[data-theme="dark"] .planning-hero,
html[data-theme="dark"] .eval-hero {
  background: linear-gradient(135deg, #192b22, #202a24 72%) !important;
}
.nasora-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #d6e0d8;
  border-radius: 9px;
  background: #f4f8f5;
  color: #17643f;
  font: 600 .76rem/1.2 Inter, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.nasora-theme-toggle:hover { background: #eaf4ee; }
.nasora-theme-toggle:focus-visible { outline: 3px solid #55a879; outline-offset: 2px; }
.nasora-theme-icon { font-size: 1.05rem; line-height: 1; }
html[data-theme="dark"] .nasora-theme-toggle {
  background: #26372d;
  color: #e0f6e8;
  border-color: #496153;
}
html[data-theme="dark"] .nasora-theme-toggle:hover { background: #30483a; }
@media (max-width: 900px) {
  .nasora-theme-toggle { min-width: 38px; padding: 8px; }
  .nasora-theme-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme="dark"] *, html[data-theme="dark"] *::before, html[data-theme="dark"] *::after { transition: none !important; }
}


/* Renfort contraste : textes hérités des feuilles historiques du CRM. */
html[data-theme="dark"] :where(.container,.container-fluid,.row,[class*="col-"],.card-body,.card-header,.card-footer,.panel-body,.panel-heading,.modal-body,.modal-header,.dropdown-item,.list-group-item,.form-text,.form-label,.control-label,.breadcrumb,.pagination,.page-link,.alert,.badge,.kpi-label,.kpi-sub,.kpi-value,.chart-card h3,.chart-card p,.chart-card span,.chart-card label,.dashboard-card h3,.dashboard-card p,.dashboard-card span,.dashboard-card label,.ranking-rate,.ranking-target,.status-good,.status-warning) {
  color: #edf5ef !important;
}
html[data-theme="dark"] :where(.text-dark,.text-body,.text-secondary,.text-body-secondary,.text-black,.text-black-50,.text-secondary-emphasis,.link-dark) {
  color: #edf5ef !important;
}
html[data-theme="dark"] :where(.bg-white,.bg-light,.list-group-item,.page-link,.breadcrumb,.alert-light,.alert-secondary,.table-light,.table-striped>tbody>tr:nth-of-type(odd)>*) {
  background-color: #202a24 !important;
  color: #edf5ef !important;
  border-color: #405448 !important;
}
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .crm-table-card {
  background: #202a24 !important;
  color: #edf5ef !important;
  border-color: #405448 !important;
}
html[data-theme="dark"] .chart-card h3,
html[data-theme="dark"] .kpi-value,
html[data-theme="dark"] .kpi-label,
html[data-theme="dark"] .kpi-sub,
html[data-theme="dark"] .ranking-rate,
html[data-theme="dark"] .ranking-target {
  color: #f3f8f4 !important;
}
html[data-theme="dark"] .kpi-icon {
  background: #254b38 !important;
  color: #a9f0c8 !important;
  border-color: #3b7656 !important;
}
html[data-theme="dark"] .status-good,
html[data-theme="dark"] .ranking-status.good { color: #9cebb9 !important; }
html[data-theme="dark"] .status-warning,
html[data-theme="dark"] .ranking-status.warning { color: #ffd27c !important; }
html[data-theme="dark"] .ranking-status.bad { color: #ffaaa6 !important; }
html[data-theme="dark"] canvas { color: #edf5ef; }
html[data-theme="dark"] .chart-card::before {
  background: linear-gradient(90deg, #62dda0, #7ccfff) !important;
}
html[data-theme="dark"] .progress,
html[data-theme="dark"] .progress-bar,
html[data-theme="dark"] .progress-track { border-color: #405448 !important; }
html[data-theme="dark"] .btn:not(.nasora-theme-toggle),
html[data-theme="dark"] button:not(.nasora-theme-toggle) {
  text-shadow: none;
}
