/* Sugaitu AI Full Custom Theme for Sub2API (Upgrade-safe via Nginx sub_filter) */
/* Palette derived from Sugaitu AI logo: #172352 navy · #0088ff blue · #4f46e5 indigo · #7c3aed violet · #ff8a00 orange */

/* Text selection */
::selection,
::-moz-selection {
  background-color: rgba(79, 70, 229, 0.2) !important;
  color: #172352 !important;
}

html.dark ::selection,
html.dark ::-moz-selection {
  background-color: rgba(124, 58, 237, 0.36) !important;
  color: #eef2ff !important;
}

/* Top navigation progress bar */
.navigation-progress-bar {
  background: linear-gradient(90deg, #0088ff 0%, #5b4df7 55%, #ff8a00 100%) !important;
}

/* Light mode brand backdrop */
html:not(.dark) body {
  background-color: #f6f8ff !important;
  background-image:
    radial-gradient(820px 340px at 14% 0%, rgba(0, 136, 255, 0.08), transparent 60%),
    radial-gradient(700px 320px at 88% 0%, rgba(124, 58, 237, 0.07), transparent 58%) !important;
  background-attachment: fixed;
}

html:not(.dark) .sidebar {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-right-color: #e1e7f8 !important;
}

/* Dark mode deep navy backdrop */
html.dark body {
  background-color: #0b1022 !important;
  background-image:
    radial-gradient(760px 320px at 16% 0%, rgba(0, 136, 255, 0.12), transparent 60%),
    radial-gradient(660px 300px at 88% 0%, rgba(124, 58, 237, 0.13), transparent 58%) !important;
  background-attachment: fixed;
}

html.dark .sidebar {
  background-color: #0f162e !important;
  border-right-color: #1d294a !important;
}

/* Sidebar Active & Hover States */
.sidebar-link-active,
.sidebar-link-active:hover {
  background: linear-gradient(90deg, rgba(0, 136, 255, 0.12) 0%, rgba(124, 58, 237, 0.11) 100%) !important;
  color: #4338ca !important;
  font-weight: 600 !important;
  box-shadow: inset 3px 0 0 #4f46e5 !important;
}

.sidebar-link-active svg { color: #4f46e5 !important; }

html.dark .sidebar-link-active,
html.dark .sidebar-link-active:hover {
  background: linear-gradient(90deg, rgba(0, 136, 255, 0.22) 0%, rgba(124, 58, 237, 0.22) 100%) !important;
  color: #a5b4fc !important;
  box-shadow: inset 3px 0 0 #818cf8 !important;
}

html.dark .sidebar-link-active svg { color: #818cf8 !important; }

html:not(.dark) .sidebar-link:not(.sidebar-link-active):hover {
  background-color: #f1f5ff !important;
  color: #172352 !important;
}

/* Active Tabs */
.tab-active {
  color: #4338ca !important;
  border-color: #c4d7ff !important;
}

html.dark .tab-active { color: #a5b4fc !important; }

/* Buttons & Badges & Stat Icons */
.btn-primary,
.btn-success {
  background-image: linear-gradient(120deg, #0088ff 0%, #5b4df7 58%, #7c3aed 100%) !important;
  background-color: #4f46e5 !important;
  border-color: transparent !important;
  box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.48) !important;
}

.btn-primary:hover,
.btn-success:hover {
  filter: brightness(1.06);
  background-image: linear-gradient(120deg, #007ae6 0%, #4f46e5 58%, #6d28d9 100%) !important;
}

.btn:focus,
.input:focus,
.\!input:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18) !important;
}

.badge-primary,
.badge-success {
  background-color: #eef4ff !important;
  color: #4338ca !important;
  border-color: #c4d7ff !important;
}

html.dark .badge-primary,
html.dark .badge-success {
  background-color: rgba(79, 70, 229, 0.22) !important;
  color: #a5b4fc !important;
  border-color: rgba(129, 140, 248, 0.32) !important;
}

.stat-icon-primary,
.stat-icon-success {
  background-color: #eef4ff !important;
  color: #4f46e5 !important;
}

html.dark .stat-icon-primary,
html.dark .stat-icon-success {
  background-color: rgba(79, 70, 229, 0.22) !important;
  color: #818cf8 !important;
}

.stat-trend-up { color: #4f46e5 !important; }
html.dark .stat-trend-up { color: #818cf8 !important; }

.text-gradient {
  background-image: linear-gradient(110deg, #0088ff 0%, #6d28d9 58%, #ff8a00 100%) !important;
}

.code,
.\!code {
  color: #4338ca !important;
  background-color: #eef4ff !important;
}

html.dark .code,
html.dark .\!code {
  color: #a5b4fc !important;
  background-color: rgba(79, 70, 229, 0.2) !important;
}

/* Toggle Switches (peer-checked) */
.peer:checked ~ .peer-checked\:bg-primary-500,
.peer:checked ~ .peer-checked\:bg-primary-600 {
  background-color: #4f46e5 !important;
}

.peer:checked ~ .peer-checked\:border-primary-500,
.peer:checked ~ .peer-checked\:dark\:border-primary-500 {
  border-color: #4f46e5 !important;
}

.peer:checked ~ .peer-checked\:ring-primary-500 {
  --tw-ring-color: rgba(79, 70, 229, 0.45) !important;
}

.peer:checked ~ .dark\:peer-checked\:bg-primary-500\/10 {
  background-color: rgba(79, 70, 229, 0.2) !important;
}

/* Backgrounds: primary + teal + emerald + green -> indigo/blue palette */
.bg-primary-50, .bg-teal-50, .bg-emerald-50, .bg-green-50 { background-color: #eef4ff !important; }
.bg-primary-50\/40 { background-color: rgba(238, 244, 255, 0.45) !important; }
.bg-primary-50\/50 { background-color: rgba(238, 244, 255, 0.55) !important; }
.bg-primary-50\/60 { background-color: rgba(238, 244, 255, 0.65) !important; }
.bg-primary-50\/80 { background-color: rgba(238, 244, 255, 0.85) !important; }
.bg-primary-100, .bg-teal-100, .bg-emerald-100, .bg-green-100 { background-color: #e0eaff !important; }
.bg-primary-200, .bg-teal-200, .bg-emerald-200 { background-color: #c4d7ff !important; }
.bg-primary-400 { background-color: #6389ff !important; }
.bg-primary-400\/10 { background-color: rgba(99, 137, 255, 0.12) !important; }
.bg-primary-400\/20 { background-color: rgba(99, 137, 255, 0.22) !important; }
.bg-primary-500, .bg-teal-500, .bg-emerald-500, .bg-green-500 { background-color: #4f46e5 !important; }
.bg-primary-500\/10, .bg-teal-500\/10, .bg-emerald-500\/10, .bg-green-500\/10 { background-color: rgba(79, 70, 229, 0.12) !important; }
.bg-primary-500\/15 { background-color: rgba(79, 70, 229, 0.16) !important; }
.bg-primary-500\/20, .bg-green-500\/20 { background-color: rgba(79, 70, 229, 0.22) !important; }
.bg-primary-600, .bg-emerald-600, .bg-green-600 { background-color: #4338ca !important; }
.bg-primary-700 { background-color: #3730a3 !important; }

.hover\:bg-primary-50:hover, .hover\:bg-emerald-50:hover, .hover\:bg-green-50:hover,
.group:hover .group-hover\:bg-primary-50 { background-color: #eef4ff !important; }
.hover\:bg-primary-100:hover, .hover\:bg-emerald-100:hover { background-color: #e0eaff !important; }
.hover\:bg-primary-600:hover, .hover\:bg-teal-600:hover, .hover\:bg-green-600:hover { background-color: #4338ca !important; }
.hover\:bg-primary-700:hover, .hover\:bg-green-700:hover, .active\:bg-teal-700:active { background-color: #3730a3 !important; }

/* Dark mode backgrounds */
html.dark .dark\:bg-primary-400\/10,
html.dark .dark\:bg-primary-500\/10,
html.dark .dark\:bg-teal-500\/10,
html.dark .dark\:bg-emerald-500\/10,
html.dark .dark\:bg-green-500\/10,
html.dark .group:hover .dark\:group-hover\:bg-primary-500\/10 { background-color: rgba(79, 70, 229, 0.18) !important; }
html.dark .dark\:bg-primary-500\/15,
html.dark .dark\:bg-teal-500\/15,
html.dark .dark\:bg-emerald-500\/15 { background-color: rgba(79, 70, 229, 0.22) !important; }
html.dark .dark\:bg-emerald-500\/20,
html.dark .dark\:bg-green-500\/20,
html.dark .dark\:bg-primary-900\/20,
html.dark .dark\:bg-primary-900\/30,
html.dark .dark\:bg-primary-950\/30 { background-color: rgba(79, 70, 229, 0.26) !important; }
html.dark .dark\:bg-primary-600,
html.dark .dark\:bg-green-600,
html.dark .dark\:bg-green-600\/80,
html.dark .dark\:bg-teal-500\/80 { background-color: #4f46e5 !important; }
html.dark .dark\:hover\:bg-primary-500:hover,
html.dark .dark\:hover\:bg-teal-500:hover,
html.dark .dark\:hover\:bg-green-600:hover { background-color: #4338ca !important; }

/* Text colors */
.text-primary-100, .text-teal-100, .text-emerald-100 { color: #e0eaff !important; }
.text-primary-400, .text-emerald-400 { color: #6389ff !important; }
.text-primary-500, .text-teal-500, .text-emerald-500, .text-green-500 { color: #4f46e5 !important; }
.text-primary-600, .text-primary-600\/90, .text-teal-600, .text-emerald-600, .text-emerald-600\/70, .text-green-600, .text-green-600\/70 { color: #4338ca !important; }
.text-primary-700, .text-teal-700, .text-emerald-700, .text-green-700 { color: #3730a3 !important; }
.text-teal-800, .text-emerald-800 { color: #312e81 !important; }

.hover\:text-primary-500:hover, .hover\:text-green-500:hover,
.group:hover .group-hover\:text-primary-500, .group:hover .group-hover\:text-emerald-500 { color: #4f46e5 !important; }
.hover\:text-primary-600:hover, .hover\:text-emerald-600:hover, .hover\:text-green-600:hover, .focus\:text-primary-600:focus,
.group:hover .group-hover\:text-primary-600 { color: #4338ca !important; }
.hover\:text-primary-700:hover, .hover\:text-teal-700:hover,
.group:hover .group-hover\:text-primary-700 { color: #3730a3 !important; }

html.dark .dark\:text-primary-100,
html.dark .dark\:text-emerald-100 { color: #e0eaff !important; }
html.dark .dark\:text-primary-300,
html.dark .dark\:text-emerald-300 { color: #a5b4fc !important; }
html.dark .dark\:text-primary-400,
html.dark .dark\:text-primary-400\/90,
html.dark .dark\:text-emerald-400,
html.dark .dark\:text-emerald-400\/70,
html.dark .dark\:text-green-400\/70,
html.dark .dark\:text-green-500 { color: #818cf8 !important; }

/* Borders & Rings */
.border-primary-100 { border-color: #e0eaff !important; }
.border-primary-200, .border-emerald-200 { border-color: #c4d7ff !important; }
.border-primary-300, .border-emerald-300 { border-color: #96b8ff !important; }
.border-primary-400 { border-color: #6389ff !important; }
.border-primary-500, .border-teal-500, .border-emerald-500, .border-green-500 { border-color: #4f46e5 !important; }
.border-teal-500\/20, .border-green-500\/20 { border-color: rgba(79, 70, 229, 0.24) !important; }
.border-teal-500\/30, .border-teal-500\/35, .border-green-500\/30, .border-green-500\/35 { border-color: rgba(79, 70, 229, 0.35) !important; }
.border-primary-600, .border-primary-600\/25 { border-color: #4338ca !important; }
.border-t-primary-500, .border-t-primary-600 { border-top-color: #4f46e5 !important; }

.hover\:border-primary-500:hover,
.hover\:border-l-primary-500:hover,
.focus\:border-primary-500:focus,
.focus\:border-green-500:focus,
.focus-within\:border-primary-500:focus-within { border-color: #4f46e5 !important; }

html.dark .dark\:border-primary-500,
html.dark .dark\:border-primary-600,
html.dark .dark\:border-primary-700,
html.dark .dark\:border-green-600,
html.dark .dark\:border-green-700,
html.dark .dark\:border-emerald-800 { border-color: rgba(129, 140, 248, 0.45) !important; }
html.dark .dark\:border-primary-400\/25,
html.dark .dark\:border-primary-400\/30,
html.dark .dark\:border-primary-500\/20,
html.dark .dark\:border-teal-500\/20,
html.dark .dark\:border-teal-500\/30,
html.dark .dark\:border-emerald-500\/30,
html.dark .dark\:border-green-500\/20,
html.dark .dark\:border-green-500\/30 { border-color: rgba(129, 140, 248, 0.3) !important; }

.ring-primary-100, .ring-emerald-100, .ring-emerald-200,
.group:hover .group-hover\:ring-primary-100 { --tw-ring-color: rgba(99, 137, 255, 0.25) !important; }
.ring-primary-500, .ring-primary-500\/20, .ring-primary-500\/40, .ring-green-500, .ring-green-600\/20,
.focus\:ring-primary-100:focus, .focus\:ring-primary-500:focus, .focus\:ring-primary-500\/20:focus,
.focus\:ring-primary-500\/30:focus, .focus\:ring-primary-500\/40:focus, .focus\:ring-green-500:focus,
.focus-visible\:ring-primary-500:focus-visible, .focus-visible\:ring-primary-500\/30:focus-visible,
.focus-within\:ring-primary-500:focus-within { --tw-ring-color: rgba(79, 70, 229, 0.38) !important; }

/* Gradients */
.from-primary-50, .from-teal-50, .from-emerald-50 { --tw-gradient-from: #eef4ff var(--tw-gradient-from-position) !important; }
.via-primary-50\/30 { --tw-gradient-stops: var(--tw-gradient-from), rgba(238, 244, 255, 0.35) var(--tw-gradient-via-position), var(--tw-gradient-to) !important; }
.from-primary-400, .from-teal-400, .from-emerald-400,
.from-primary-500, .from-teal-500, .from-emerald-500, .from-green-500 { --tw-gradient-from: #0088ff var(--tw-gradient-from-position) !important; }
.from-primary-600, .hover\:from-primary-600:hover { --tw-gradient-from: #4f46e5 var(--tw-gradient-from-position) !important; }
.to-teal-100, .to-emerald-100 { --tw-gradient-to: #e0eaff var(--tw-gradient-to-position) !important; }
.to-primary-500, .to-teal-500, .to-emerald-500 { --tw-gradient-to: #5b4df7 var(--tw-gradient-to-position) !important; }
.to-primary-600, .to-teal-600, .to-emerald-600, .to-green-600 { --tw-gradient-to: #7c3aed var(--tw-gradient-to-position) !important; }
.to-primary-700 { --tw-gradient-to: #6d28d9 var(--tw-gradient-to-position) !important; }

/* Shadows & native controls */
.shadow-primary-500\/20, .shadow-primary-500\/25, .shadow-primary-500\/30, .shadow-primary-600\/20,
.hover\:shadow-primary-500\/10:hover, .hover\:shadow-primary-500\/30:hover {
  --tw-shadow-color: rgba(79, 70, 229, 0.28) !important;
}

input[type="checkbox"],
input[type="radio"],
.accent-primary-500,
.accent-primary-600 {
  accent-color: #4f46e5 !important;
}
