/* Telsmart portal — day mode default (body.light), night via body:not(.light) */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { border-radius: 6px; }

/* ---- Base surfaces ---- */
body {
  transition: background 0.3s ease, color 0.3s ease;
}
body:not(.light) {
  background: radial-gradient(1200px 600px at 10% -10%, #1e293b 0%, #0f172a 45%, #020617 100%);
  color: #f1f5f9;
}
body:not(.light) .glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
body:not(.light) .kpi {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
}
body:not(.light) ::-webkit-scrollbar-thumb { background: #334155; }
body:not(.light) input[type="date"] { color-scheme: dark; }

/* ---- Night: readable muted text (WCAG AA on dark surfaces) ---- */
body:not(.light) .text-slate-300 { color: #cbd5e1; }
body:not(.light) .text-slate-500 { color: #94a3b8; }
body:not(.light) .text-slate-600 { color: #94a3b8; }
body:not(.light) [class*="text-cyan-300"] { color: #67e8f9 !important; }
body:not(.light) [class*="text-indigo-300"] { color: #a5b4fc !important; }
body:not(.light) [class*="text-indigo-200"] { color: #c7d2fe !important; }
body:not(.light) [class*="text-emerald-300"] { color: #6ee7b7 !important; }
body:not(.light) [class*="text-emerald-400"] { color: #34d399 !important; }
body:not(.light) [class*="text-amber-300"] { color: #fcd34d !important; }
body:not(.light) [class*="text-rose-300"] { color: #fda4af !important; }
body:not(.light) [class*="text-rose-400"] { color: #fb7185 !important; }
body:not(.light) [class*="text-fuchsia-300"] { color: #f0abfc !important; }
body:not(.light) .bg-indigo-500\/20.text-indigo-300 { color: #c7d2fe !important; }
body:not(.light) .bg-emerald-500\/20.text-emerald-300 { color: #6ee7b7 !important; }
body:not(.light) .bg-amber-500\/20.text-amber-300 { color: #fcd34d !important; }
body:not(.light) .bg-rose-500\/20.text-rose-300 { color: #fda4af !important; }
body:not(.light) .bg-slate-500\/20.text-slate-300 { color: #cbd5e1 !important; }
body:not(.light) .bg-amber-500\/15.text-amber-200,
body:not(.light) .bg-amber-500\/15.border-amber-500\/30.text-amber-200 { color: #fde68a !important; }
body:not(.light) .bg-rose-500\/15.text-rose-200,
body:not(.light) .bg-rose-500\/15.border-rose-500\/30.text-rose-200 { color: #fecdd3 !important; }
body:not(.light) ::placeholder { color: #94a3b8; opacity: 1; }

/* ---- Day mode ---- */
body.light {
  background: radial-gradient(1200px 600px at 10% -10%, #eef2ff 0%, #f1f5f9 45%, #e2e8f0 100%);
  color: #0f172a;
}
body.light .glass {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 8px 30px -14px rgba(15, 23, 42, 0.15);
}
body.light .kpi {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
body.light ::-webkit-scrollbar-thumb { background: #cbd5e1; }
body.light input[type="date"] { color-scheme: light; }

body.light .text-slate-100 { color: #0f172a; }
body.light .text-slate-300 { color: #334155; }
body.light .text-slate-400 { color: #475569; }
body.light .text-slate-500 { color: #64748b; }
body.light .text-slate-600 { color: #475569; }

body.light .bg-white\/5 { background: rgba(15, 23, 42, 0.04) !important; }
body.light .bg-white\/10 { background: rgba(15, 23, 42, 0.06) !important; }
body.light .hover\:bg-white\/5:hover { background: rgba(15, 23, 42, 0.05) !important; }
body.light .hover\:bg-white\/10:hover { background: rgba(15, 23, 42, 0.08) !important; }
body.light .border-white\/5 { border-color: rgba(15, 23, 42, 0.08) !important; }
body.light .border-white\/10 { border-color: rgba(15, 23, 42, 0.12) !important; }
body.light .bg-black\/60 { background: rgba(15, 23, 42, 0.35) !important; }
body.light .hover\:text-white:hover { color: #0f172a !important; }

body.light [class*="text-indigo-300"],
body.light summary[class*="text-indigo-300"] { color: #4338ca !important; }
body.light [class*="text-indigo-200"] { color: #3730a3 !important; }
body.light [class*="text-cyan-300"] { color: #0e7490 !important; }
body.light [class*="text-emerald-300"],
body.light [class*="text-emerald-400"] { color: #047857 !important; }
body.light [class*="text-amber-300"] { color: #b45309 !important; }
body.light [class*="text-amber-200"] { color: #92400e !important; }
body.light [class*="text-rose-300"],
body.light [class*="text-rose-400"],
body.light [class*="text-rose-200"] { color: #be123c !important; }
body.light [class*="text-fuchsia-300"] { color: #a21caf !important; }

body.light select,
body.light input,
body.light textarea { color: #0f172a; }
body.light select.glass,
body.light input.glass,
body.light textarea.glass {
  background: rgba(255, 255, 255, 0.95);
}
body.light option { background: #fff; color: #0f172a; }
body.light ::placeholder { color: #64748b; opacity: 1; }

/* Solid action buttons keep white label text in day mode */
body.light button[class*="bg-indigo-600"],
body.light button[class*="bg-indigo-500"],
body.light button[class*="bg-emerald-600"],
body.light button[class*="bg-emerald-500"],
body.light button[class*="bg-rose-700"],
body.light button[class*="bg-rose-600"],
body.light button[class*="bg-amber-600"] {
  color: #fff !important;
}

body.light [class*="text-amber-400"] { color: #b45309 !important; }
body.light .text-slate-400.hover\:text-white:hover,
body.light #modalClose:hover { color: #0f172a !important; }

body.light .bg-indigo-500\/20.text-indigo-300 {
  background: rgba(79, 70, 229, 0.12) !important;
  color: #3730a3 !important;
}
body.light .bg-emerald-500\/20.text-emerald-300 {
  background: rgba(5, 150, 105, 0.12) !important;
  color: #047857 !important;
}
body.light .bg-amber-500\/20.text-amber-300 {
  background: rgba(217, 119, 6, 0.14) !important;
  color: #b45309 !important;
}
body.light .bg-rose-500\/20.text-rose-300 {
  background: rgba(225, 29, 72, 0.1) !important;
  color: #be123c !important;
}
body.light .bg-slate-500\/20.text-slate-300 {
  background: rgba(100, 116, 139, 0.15) !important;
  color: #334155 !important;
}
body.light .bg-amber-500\/15.text-amber-200,
body.light .bg-amber-500\/15.border-amber-500\/30.text-amber-200 {
  background: rgba(217, 119, 6, 0.14) !important;
  color: #92400e !important;
}
body.light .bg-rose-500\/15.text-rose-200,
body.light .bg-rose-500\/15.border-rose-500\/30.text-rose-200 {
  background: rgba(225, 29, 72, 0.1) !important;
  color: #9f1239 !important;
}

body.light .border-emerald-500\/25 { border-color: rgba(5, 150, 105, 0.35) !important; }
body.light .bg-emerald-500\/5 { background: rgba(5, 150, 105, 0.08) !important; }

body.light .modeBtn { color: #1e293b; }
body.light .modeBtn.modeBtn-active {
  color: #fff !important;
  background-color: #4f46e5 !important;
}
body.light .modeBtn:not(.modeBtn-active):hover {
  background: rgba(15, 23, 42, 0.06) !important;
}
body.light #applyFilters {
  background: #334155;
  color: #fff;
}
body.light #applyFilters:hover { background: #475569; }

body.light .closePop { color: #64748b !important; }
body.light .closePop:hover { color: #0f172a !important; }

/* Agent chat — night */
#agent-chat-panel.agent-chat-panel {
  background: rgba(15, 23, 42, 0.95);
}

/* Agent chat — day */
body.light #agent-chat-panel.agent-chat-panel {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.18);
  color: #0f172a;
}
body.light #agent-chat-root .agent-chat-bubble-user {
  background: #4f46e5 !important;
  color: #fff !important;
}
body.light #agent-chat-root .agent-chat-bubble-assistant {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #334155 !important;
}
body.light #agent-chat-root .agent-chat-bubble-error {
  background: rgba(225, 29, 72, 0.1) !important;
  color: #be123c !important;
}
body.light #agent-chat-root .agent-chat-log-question,
body.light #agent-chat-root [class*="text-indigo-200"] {
  color: #4338ca !important;
}
body.light #agent-chat-root .text-rose-500,
body.light #agent-chat-root [class*="text-rose-400"] {
  color: #be123c !important;
}
body.light #agent-chat-warn {
  background: rgba(217, 119, 6, 0.12) !important;
  border-color: rgba(217, 119, 6, 0.22) !important;
  color: #92400e !important;
}
body.light #agent-chat-input {
  background: #fff !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
  color: #0f172a !important;
}
body.light #agent-chat-input:focus {
  border-color: rgba(79, 70, 229, 0.45) !important;
}
