/* The original CMS uses dark Tailwind utilities throughout its static and generated markup.
   These scoped overrides keep the existing night palette intact. */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="light"] body { background: #f3f7fb !important; color: #17243a !important; }
html[data-theme="light"] header { background: rgba(255,255,255,.96) !important; border-color: #d9e3ed !important; }

html[data-theme="light"] [class~="bg-slate-950"],
html[data-theme="light"] [class*="bg-slate-950/"],
html[data-theme="light"] [class~="bg-black"] { background-color: #f8fafc !important; }
html[data-theme="light"] [class~="bg-slate-900"],
html[data-theme="light"] [class*="bg-slate-900/"],
html[data-theme="light"] [class~="bg-slate-850"] { background-color: #fff !important; }
html[data-theme="light"] [class~="bg-slate-800"],
html[data-theme="light"] [class*="bg-slate-800/"],
html[data-theme="light"] [class~="bg-slate-700"] { background-color: #eaf0f6 !important; }
html[data-theme="light"] [class*="hover:bg-slate-"]:hover { background-color: #dde7f0 !important; }
html[data-theme="light"] [class*="bg-emerald-950"],
html[data-theme="light"] [class*="bg-emerald-900"] { background-color: #e7f6ef !important; }
html[data-theme="light"] [class*="bg-rose-950"],
html[data-theme="light"] [class*="bg-rose-900"] { background-color: #fff0f1 !important; }
html[data-theme="light"] [class*="bg-amber-950"] { background-color: #fff5db !important; }
html[data-theme="light"] [class*="from-slate-900"] {
  background-image: linear-gradient(90deg, #fff, #f5faf8, #fff) !important;
}

html[data-theme="light"] [class*="border-slate-"],
html[data-theme="light"] [class*="divide-slate-"] > * { border-color: #d8e2eb !important; }
html[data-theme="light"] [class~="text-white"],
html[data-theme="light"] [class~="text-slate-100"] { color: #17243a !important; }
html[data-theme="light"] [class~="text-slate-200"],
html[data-theme="light"] [class~="text-slate-300"],
html[data-theme="light"] [class~="text-neutral-300"] { color: #334155 !important; }
html[data-theme="light"] [class~="text-slate-400"],
html[data-theme="light"] [class~="text-neutral-400"] { color: #475569 !important; }
html[data-theme="light"] [class~="text-slate-500"],
html[data-theme="light"] [class~="text-neutral-500"] { color: #64748b !important; }
html[data-theme="light"] [class*="text-emerald-200"],
html[data-theme="light"] [class*="text-emerald-300"],
html[data-theme="light"] [class*="text-emerald-400"] { color: #047857 !important; }
html[data-theme="light"] [class*="text-sky-200"],
html[data-theme="light"] [class*="text-sky-300"],
html[data-theme="light"] [class*="text-sky-400"] { color: #0369a1 !important; }
html[data-theme="light"] [class*="text-blue-400"] { color: #1d4ed8 !important; }
html[data-theme="light"] [class*="text-amber-300"],
html[data-theme="light"] [class*="text-amber-400"] { color: #92400e !important; }
html[data-theme="light"] [class*="text-rose-300"],
html[data-theme="light"] [class*="text-rose-400"] { color: #be123c !important; }
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #64748b !important; }
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea { color: #17243a; }

/* Solid action buttons and their icons keep white text on saturated fills. */
html[data-theme="light"] [class~="bg-emerald-600"],
html[data-theme="light"] [class~="bg-sky-600"],
html[data-theme="light"] [class~="bg-sky-700"],
html[data-theme="light"] [class~="bg-sky-500"] { color: #fff !important; }
html[data-theme="light"] [class~="bg-emerald-600"] [class~="text-white"],
html[data-theme="light"] [class~="bg-sky-600"] [class~="text-white"],
html[data-theme="light"] [class~="bg-sky-700"] [class~="text-white"] { color: #fff !important; }

html[data-theme="light"] .dash-card {
  background: linear-gradient(180deg, #fff, #f7fafc) !important;
  border-color: #d8e2eb !important;
  box-shadow: 0 10px 28px rgba(51, 65, 85, .08) !important;
}
html[data-theme="light"] .dash-legend-btn:hover,
html[data-theme="light"] .dash-legend-btn.is-hot { background: #eaf6f0 !important; }
html[data-theme="light"] main.is-search-focus #home-dashboard::after { background: rgba(241, 245, 249, .68); }
html[data-theme="light"] .score-gauge-value,
html[data-theme="light"] .dash-center-value { fill: #17243a; }

/* Backdrops stay translucent while dialog contents use the light surfaces above. */
html[data-theme="light"] #library-modal,
html[data-theme="light"] #progress-modal,
html[data-theme="light"] #manual-modal,
html[data-theme="light"] #map-modal,
html[data-theme="light"] #lead-number-modal,
html[data-theme="light"] #sales-form-modal,
html[data-theme="light"] #sales-history-modal { background: rgba(30, 41, 59, .42) !important; }
html[data-theme="light"] #toast-notification { background: #fff !important; color: #17243a !important; }
html[data-theme="light"] #canada-map,
html[data-theme="light"] #cod-map-shell,
html[data-theme="light"] .leaflet-container { background: #eaf0ef !important; }
html[data-theme="light"] .cod-prov-label { color: #475569; text-shadow: 0 1px 2px #fff; }
html[data-theme="light"] .cod-city-label,
html[data-theme="light"] .cod-city-label.rank-2,
html[data-theme="light"] .cod-city-label.rank-3 { color: #1e293b; text-shadow: 0 1px 2px #fff; }
html[data-theme="light"] .map-glass-btn {
  background: linear-gradient(180deg, #eff9ff, #e0f2fe);
  border-color: #7dd3fc;
  color: #075985;
  box-shadow: 0 4px 14px rgba(14, 165, 233, .12);
}
html[data-theme="light"] .map-glass-btn:hover { background: #d9f0ff; }
html[data-theme="light"] .map-dossier-glass,
html[data-theme="light"] .map-dossier-glass [class~="text-white"] {
  color: #f8fafc !important;
}

@media (max-width: 639px) {
  #header-actions { flex: 0 0 auto; max-width: none; gap: 4px; }
  #header-actions > button { width: 36px; min-width: 36px; justify-content: center; padding-left: 0; padding-right: 0; }
  #header-actions > button span:not(#theme-icon) { display: none !important; }
  .app-header-inner { gap: 6px; }
}
@media (max-width: 359px) {
  .app-header-inner > div:first-child > div:last-child { display: none; }
}
