/* T4S Hub CRM - Light Theme v4 (Clean Rewrite) */
/* Soft blue + lavender sidebar | All text legible | No fluorescents */

/* 1. BASE */
html, body { background: #eaf1f7 !important; color: #1f2733 !important; }

/* 2. DARK-MODE KILL - override any .dark, bg-gray-8/9, bg-slate-8/9 */
html.dark, body.dark, .dark .bg-gray-900, .dark .bg-gray-800,
[class*="bg-gray-9"], [class*="bg-gray-8"], [class*="bg-slate-9"], [class*="bg-slate-8"],
[class*="bg-dark"], .bg-gray-100, .bg-gray-50 {
  background: #eaf1f7 !important; color: #1f2733 !important;
}
#darkModeToggle, #darkIcon, #lightIcon, #theme-icon,
button[class*="fixed"][class*="bottom"] { display: none !important; }
/* 3. SIDEBAR */
aside, .sidebar, [class*="w-64"][class*="bg-gray"] {
  background: #ede8f5 !important; color: #1f2733 !important;
  border-right: 1px solid #cdc5e0 !important;
}
aside a, .sidebar a {
  color: #4a5463 !important; background: transparent !important; border-radius: 6px;
}
aside a *, .sidebar a * { color: inherit !important; }
aside a:hover, .sidebar a:hover, aside a:hover *, .sidebar a:hover * {
  background: #e2dcef !important; color: #1f2733 !important;
}
aside a.active, .sidebar a.active,
aside a[class*="bg-white"], aside a[class*="border-blue"], aside a[class*="border-l-4"] {
  background: #d6cee8 !important; color: #1f2733 !important;
  border-left: 3px solid #6b5aad !important;
}
aside a.active i, aside a.active svg, .sidebar a.active i, .sidebar a.active svg {
  color: #6b5aad !important;
}
aside .uppercase, .sidebar .uppercase, aside .text-xs, .sidebar .text-xs {
  color: #6b7380 !important;
}
aside .border-b, .sidebar .border-b { border-color: #cdc5e0 !important; }
aside a i, aside a svg, .sidebar a i, .sidebar a svg { color: #6b7380 !important; }
aside a:hover i, aside a:hover svg, .sidebar a:hover i, .sidebar a:hover svg {
  color: #1f2733 !important;
}
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(107,90,173,0.25) !important; }
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(107,90,173,0.45) !important; }
.sidebar-scroll { scrollbar-color: rgba(107,90,173,0.25) transparent !important; }
/* 4. CONTENT AREA */
.ml-64, [class*="ml-64"] { padding: 2rem 2.5rem !important; }
.ml-64 > *, [class*="ml-64"] > * {
  max-width: 1200px; margin-left: auto !important; margin-right: auto !important;
}

/* 5. TEXT */
h1,h2,h3,h4,h5,h6 { color: #1f2733 !important; }
p, span, div, td, th, li, label, dt, dd, figcaption, blockquote, pre, code {
  color: #1f2733 !important;
}
.text-gray-400, .text-gray-500, .text-gray-600, .text-muted,
[class*="text-gray-5"], [class*="text-gray-6"] { color: #4a5463 !important; }
.text-gray-700, .text-gray-800, .text-gray-900 { color: #1f2733 !important; }
a { color: #3a7c7c !important; }
a:hover { color: #2e6868 !important; }
/* 6. CARDS & SURFACES */
.bg-white, .card, .panel, [class*="bg-gray-7"], .bg-gray-700, .bg-slate-700, [class*="bg-slate-7"] {
  background: #f4f8fc !important; color: #1f2733 !important;
  border: 1px solid #c3d2e0 !important;
}
[class*="rounded-lg"], [class*="rounded-xl"], [class*="rounded-2xl"], [class*="shadow"] {
  color: #1f2733 !important;
}
.card-body { padding: 1rem; }
.card-title { font-weight: 600; color: #1f2733 !important; }
.card-footer { border-top: 1px solid #c3d2e0; }

/* 7. TABLES */
table, .table { background: #f4f8fc !important; color: #1f2733 !important; border-color: #c3d2e0 !important; }
thead, thead tr, thead th {
  background: #dde7f0 !important; color: #1f2733 !important;
  border-bottom: 2px solid #c3d2e0 !important;
}
tbody tr { background: #f4f8fc !important; border-bottom: 1px solid #c3d2e0 !important; }
tbody tr:hover { background: #e6eef6 !important; }
td, th { color: #1f2733 !important; border-color: #c3d2e0 !important; }

/* 8. INPUTS */
input, select, textarea, .form-control, .form-select {
  background: #f4f8fc !important; color: #1f2733 !important;
  border: 1px solid #c3d2e0 !important;
}
input::placeholder, textarea::placeholder { color: #6b7380 !important; }
input:focus, select:focus, textarea:focus {
  border-color: #3a7c7c !important; outline: 2px solid rgba(58,124,124,0.2) !important;
}
/* 9. BUTTONS - colored buttons get white text, everything else gets dark text */
.btn-primary, [class*="bg-blue"], [class*="bg-cyan"], [class*="bg-sky"],
button[class*="bg-teal"], a[class*="bg-teal"], a[href*="/create"] {
  background: #3a7c7c !important; color: #fff !important;
  border: 1px solid #3a7c7c !important;
}
.btn-primary:hover { background: #2e6868 !important; border-color: #2e6868 !important; }
.btn-success {
  background: #ede8f5 !important; color: #4a3d80 !important;
  border: 1px solid #cfc3e8 !important;
}
.btn-danger, [class*="bg-red"], [class*="bg-rose"] {
  background: #b5484a !important; color: #fff !important;
  border: 1px solid #b5484a !important;
}
.btn-warning, [class*="bg-yellow"], [class*="bg-amber"] {
  background: #b8872e !important; color: #fff !important;
  border: 1px solid #b8872e !important;
}
.btn-info, [class*="bg-indigo"], [class*="bg-purple"], [class*="bg-violet"],
[class*="bg-fuchsia"], [class*="bg-pink"] {
  background: #4d7199 !important; color: #fff !important;
  border: 1px solid #4d7199 !important;
}
.btn-secondary, .btn-light, .btn-white, .btn-outline-secondary, .btn-outline-primary,
button[class*="border-"], a[class*="border-"] {
  background: #e8edf3 !important; color: #1f2733 !important;
  border: 1px solid #bfc9d6 !important;
}
.btn-outline-primary:hover { background: #3a7c7c !important; color: #fff !important; }
[class*="bg-orange"] { background: #b58a3a !important; color: #fff !important; }
.btn {
  display: inline-block; padding: .5rem 1rem; border-radius: .375rem;
  font-size: .875rem; font-weight: 500; cursor: pointer; text-decoration: none !important;
}
.btn-sm { padding: .25rem .75rem; font-size: .8125rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
button i, button svg, a i, a svg { color: inherit !important; }
/* 10. BADGES */
[class*="bg-green"], [class*="bg-emerald"], [class*="bg-lime"], .badge-success, .bg-success {
  background: #ede8f5 !important; color: #4a3d80 !important;
  border: 1px solid #cfc3e8 !important;
}
.badge {
  display: inline-block; padding: .25rem .5rem; font-size: .75rem;
  font-weight: 600; border-radius: .25rem;
}
[class*="bg-green-"], [class*="bg-emerald-"], [class*="bg-teal-"]:not(button):not(.btn-primary),
[class*="bg-blue-1"], [class*="bg-indigo-1"], [class*="bg-cyan-1"],
span[class*="bg-blue"], span[class*="bg-green"], span[class*="bg-teal"],
span[class*="bg-emerald"], span[class*="bg-indigo"],
div[class*="bg-indigo-1"], div[class*="bg-teal-"], div[class*="bg-green-"] {
  background: #ede8f5 !important; color: #4a3d80 !important;
  border: 1px solid #cfc3e8 !important;
}
[class*="text-indigo-6"], [class*="text-blue-7"], [class*="text-teal-"],
[class*="text-green-7"], [class*="text-emerald-"] { color: #4a3d80 !important; }
/* 11. ALERTS */
.alert { padding: .75rem 1rem; border-radius: .375rem; margin-bottom: 1rem; }
.alert-info { background: #dfe8f1 !important; color: #1f2733 !important; border: 1px solid #c3d2e0 !important; }
.alert-success { background: #dff0e5 !important; color: #1f2733 !important; border: 1px solid #b8d8c5 !important; }
.alert-warning { background: #f5ecd8 !important; color: #1f2733 !important; border: 1px solid #e0d0a8 !important; }
.alert-danger { background: #f5dfe0 !important; color: #1f2733 !important; border: 1px solid #ddb8b9 !important; }

/* 12. BOOTSTRAP GRID */
.container-fluid { width: 100%; padding: 0 1rem; }
.row { display: flex; flex-wrap: wrap; margin: 0 -.5rem; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 .5rem; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 .5rem; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding: 0 .5rem; }
.col-md-8 { flex: 0 0 66.667%; max-width: 66.667%; padding: 0 .5rem; }
.col-md-12, .col-lg-12 { flex: 0 0 100%; max-width: 100%; padding: 0 .5rem; }
@media (max-width: 767px) {
  .col-md-4, .col-md-6, .col-md-8 { flex: 0 0 100%; max-width: 100%; }
}
.d-flex { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.mb-3 { margin-bottom: .75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.w-100 { width: 100% !important; }
.text-muted { color: #6b7380 !important; }
.small { font-size: .875rem; }
/* 13. APPOINTMENT FILTER LINKS */
a[href*="status=pending"], a[href*="status=confirmed"], a[href="/calendar/appointments"] {
  color: #1f2733 !important; background: #e8edf3 !important;
  border: 1px solid #bfc9d6 !important; padding: .375rem .75rem !important;
  border-radius: .375rem !important; text-decoration: none !important;
  display: inline-block !important;
}
a[href*="status="]:hover, a[href="/calendar/appointments"]:hover {
  background: #e2dcef !important;
}
aside a[href*="/calendar"], .sidebar a[href*="/calendar"] {
  background: transparent !important; border: none !important;
  padding: .5rem .75rem !important; display: block !important; color: #4a5463 !important;
}
aside a[href*="/calendar"]:hover, .sidebar a[href*="/calendar"]:hover {
  background: #e2dcef !important;
}

/* 14. FORCE WHITE TEXT ON COLORED BACKGROUNDS */
button[class*="bg-"], a[class*="bg-"],
button[class*="bg-"] *, a[class*="bg-"] * { color: #fff !important; }
button[class*="bg-white"], a[class*="bg-white"],
button[class*="bg-gray-1"], a[class*="bg-gray-1"],
button[class*="bg-gray-50"], a[class*="bg-gray-50"],
button[class*="bg-gray-100"], a[class*="bg-gray-100"] { color: #1f2733 !important; }
button[class*="bg-white"] *, a[class*="bg-white"] *,
button[class*="bg-gray-1"] *, a[class*="bg-gray-1"] *,
button[class*="bg-gray-50"] *, a[class*="bg-gray-50"] *,
button[class*="bg-gray-100"] *, a[class*="bg-gray-100"] * { color: #1f2733 !important; }
/* 15. RE-ENFORCE SIDEBAR */
aside a, aside a *, .sidebar a, .sidebar a * { color: #4a5463 !important; }
aside a:hover, aside a:hover *, .sidebar a:hover, .sidebar a:hover * { color: #1f2733 !important; }
aside a.active i, aside a.active svg { color: #6b5aad !important; }

/* 16. FIX: Buttons with bg-gray classes */
button[class*="bg-gray"], a[class*="bg-gray"],
button[class*="bg-gray"] *, a[class*="bg-gray"] *,
button[class*="bg-slate"], a[class*="bg-slate"],
button[class*="bg-slate"] *, a[class*="bg-slate"] * {
  color: #1f2733 !important; background: #e8edf3 !important;
  border: 1px solid #bfc9d6 !important;
}
button[class*="bg-gray"]:hover, a[class*="bg-gray"]:hover,
button[class*="bg-slate"]:hover, a[class*="bg-slate"]:hover {
  background: #e2dcef !important;
}

/* 17. FIX: Generic small action buttons */
[class*="inline-flex"][class*="bg-gray"], [class*="inline-flex"][class*="bg-slate"],
button[class*="text-sm"][class*="bg-gray"], a[class*="text-sm"][class*="bg-gray"],
button[class*="rounded"][class*="bg-gray"], a[class*="rounded"][class*="bg-gray"] {
  color: #1f2733 !important; background: #e8edf3 !important;
  border: 1px solid #bfc9d6 !important; padding: .375rem .75rem;
  border-radius: .375rem; text-decoration: none !important;
}
/* 18. FIX: Observability nav buttons */
a[href*="/traces"], a[href*="/spans"], a[href*="/alerts"] {
  color: #1f2733 !important; background: #e8edf3 !important;
  border: 1px solid #bfc9d6 !important; padding: .375rem .75rem !important;
  border-radius: .375rem !important; text-decoration: none !important;
}
a[href*="/traces"]:hover, a[href*="/spans"]:hover, a[href*="/alerts"]:hover {
  background: #e2dcef !important;
}
aside a[href*="/traces"], aside a[href*="/spans"], aside a[href*="/alerts"],
.sidebar a[href*="/traces"], .sidebar a[href*="/spans"], .sidebar a[href*="/alerts"] {
  background: transparent !important; border: none !important;
  padding: .5rem .75rem !important; display: block !important; color: #4a5463 !important;
}

/* 19. FIX: AI Agents page - View/Edit buttons on agent cards */
a[href*="/ai/agents/"][class*="text-cyan"] {
  color: #0e7490 !important; border-color: #0e7490 !important; background: #ecfeff !important;
}
a[href*="/ai/agents/"][class*="text-yellow"] {
  color: #a16207 !important; border-color: #a16207 !important; background: #fefce8 !important;
}
a[href*="/ai/agents/"][class*="text-cyan"]:hover {
  background: #0e7490 !important; color: #ffffff !important;
}
a[href*="/ai/agents/"][class*="text-yellow"]:hover {
  background: #a16207 !important; color: #ffffff !important;
}

/* 20. FIX: Disaster Recovery buttons */
a[href*="/deployments"][class*="bg-gray"],
a[href*="/deployment"][class*="bg-"] {
  color: #1f2733 !important; background: #e8edf3 !important;
  border: 1px solid #bfc9d6 !important;
}

/* 21. FIX: Disabled buttons */
button[class*="bg-gray"][disabled],
button[disabled][class*="text-white"],
a[class*="bg-gray"][class*="opacity"] {
  color: #7c7c8a !important; background: #e8e8ee !important;
  border: 1px solid #d0d0da !important;
}

/* 22. FIX: bg-green-600 action buttons (Import CSV, Add Transport) */
/* These get turned into lavender badges by section 10, but should be solid teal buttons */
button[class*="bg-green-6"][class*="text-white"],
a[class*="bg-green-6"][class*="text-white"] {
  background: #3a7c7c !important;
  color: #fff !important;
  border: 1px solid #3a7c7c !important;
}
button[class*="bg-green-6"][class*="text-white"]:hover,
a[class*="bg-green-6"][class*="text-white"]:hover {
  background: #2e6868 !important;
}


/* 23. FIX: Calendar - Today & Pending icon bg colors to match lavender */
[class*="bg-purple-1"], [class*="bg-yellow-1"] {
  background: #ede8f5 !important;
  color: #4a3d80 !important;
}
[class*="text-purple-6"], [class*="text-yellow-6"] {
  color: #6b5aad !important;
}

/* 24. FIX: Calendar Quick Links - remove thin boxes around icons/text */
[class*="hover:bg-gray-50"][class*="flex"][class*="rounded-lg"] {
  border: none !important;
  background: transparent !important;
}
[class*="hover:bg-gray-50"][class*="flex"][class*="rounded-lg"]:hover {
  background: #ede8f5 !important;
}

/* 25. FIX: Bootstrap badges - softer colors for legibility */
/* badge bg-success (green) -> soft teal */
.badge.bg-success, span.badge.bg-success {
  background: #3a7c7c !important;
  color: #fff !important;
  border: none !important;
}
/* badge bg-secondary (grey) -> soft slate with dark text */
.badge.bg-secondary, span.badge.bg-secondary {
  background: #e0e4ea !important;
  color: #3b4252 !important;
  border: 1px solid #c3cad5 !important;
}
/* badge bg-danger (red) -> muted red */
.badge.bg-danger, span.badge.bg-danger {
  background: #b5484a !important;
  color: #fff !important;
  border: none !important;
}
/* badge bg-warning (yellow) -> soft warm amber, not neon */
.badge.bg-warning, span.badge.bg-warning {
  background: #c9882e !important;
  color: #fff !important;
  border: none !important;
}
/* badge bg-info (blue) -> soft steel blue */
.badge.bg-info, span.badge.bg-info {
  background: #4d7199 !important;
  color: #fff !important;
  border: none !important;
}
/* badge bg-primary -> muted primary */
.badge.bg-primary, span.badge.bg-primary {
  background: #3a7c7c !important;
  color: #fff !important;
  border: none !important;
}

/* 26. FIX: AI Dashboard - soften Bootstrap border-* and text-* contextual colors */
/* border-warning: neon yellow -> soft amber */
.border-warning { border-color: #d4a44a !important; }
/* border-success: bright green -> soft teal */
.border-success { border-color: #5a9e9e !important; }
/* border-info: cyan -> soft steel */
.border-info { border-color: #6a93b5 !important; }
/* border-danger: bright red -> muted red */
.border-danger { border-color: #c47070 !important; }
/* border-primary: bright blue -> muted teal */
.border-primary { border-color: #5a8f8f !important; }

/* text-warning: neon yellow -> readable warm amber */
.text-warning { color: #a07020 !important; }
/* text-success: bright green -> readable teal */
.text-success { color: #2e7a6e !important; }
/* text-info: cyan -> readable steel blue */
.text-info { color: #3d6a8a !important; }
/* text-danger: bright red -> muted red */
.text-danger { color: #b5484a !important; }
/* text-primary: bright blue -> muted teal */
.text-primary { color: #3a7c7c !important; }

/* btn-outline-warning: neon yellow border/text -> warm amber */
.btn-outline-warning {
  color: #a07020 !important;
  border-color: #c9a050 !important;
  background: transparent !important;
}
.btn-outline-warning:hover {
  background: #c9882e !important;
  color: #fff !important;
  border-color: #c9882e !important;
}
/* btn-outline-danger */
.btn-outline-danger {
  color: #b5484a !important;
  border-color: #c47070 !important;
  background: transparent !important;
}
.btn-outline-danger:hover {
  background: #b5484a !important;
  color: #fff !important;
}
/* btn-outline-info */
.btn-outline-info {
  color: #3d6a8a !important;
  border-color: #6a93b5 !important;
  background: transparent !important;
}
.btn-outline-info:hover {
  background: #4d7199 !important;
  color: #fff !important;
}
/* btn-outline-primary */
.btn-outline-primary {
  color: #3a7c7c !important;
  border-color: #5a8f8f !important;
  background: transparent !important;
}
.btn-outline-primary:hover {
  background: #3a7c7c !important;
  color: #fff !important;
}
/* btn-outline-success */
.btn-outline-success {
  color: #2e7a6e !important;
  border-color: #5a9e9e !important;
  background: transparent !important;
}
.btn-outline-success:hover {
  background: #3a7c7c !important;
  color: #fff !important;
}

/* 27. FIX: AI Dashboard inline styles - override neon .ai-badge-scheduled */
.ai-badge-scheduled {
  background: #c9882e !important;
  color: #fff !important;
}
.ai-badge-active {
  background: #e0e4ea !important;
  color: #3b4252 !important;
}
/* bg-light -> soft surface */
.bg-light {
  background: #f4f8fc !important;
}
/* card.bg-light border colors soften */
.card.bg-light {
  background: #f4f8fc !important;
}


/* 28. FIX: Calendar Quick Links - remove thin border boxes */
a[href*="/calendar/event-types"][class*="flex"],
a[href*="/calendar/booking-links"][class*="flex"],
a[href*="/calendar/coupons"][class*="flex"],
a[href*="/calendar/availability"][class*="flex"] {
  border: none !important;
  background: transparent !important;
}
a[href*="/calendar/event-types"][class*="flex"]:hover,
a[href*="/calendar/booking-links"][class*="flex"]:hover,
a[href*="/calendar/coupons"][class*="flex"]:hover,
a[href*="/calendar/availability"][class*="flex"]:hover {
  background: #ede8f5 !important;
}
a[href*="/calendar/event-types"][class*="flex"] span,
a[href*="/calendar/booking-links"][class*="flex"] span,
a[href*="/calendar/coupons"][class*="flex"] span,
a[href*="/calendar/availability"][class*="flex"] span {
  border: none !important;
}
a[href*="/calendar/event-types"][class*="flex"] i,
a[href*="/calendar/booking-links"][class*="flex"] i,
a[href*="/calendar/coupons"][class*="flex"] i,
a[href*="/calendar/availability"][class*="flex"] i {
  border: none !important;
}

