/* Custom Theme Override - Force Green Color #013C28 */

/* Root variables override */
:root {
  --bs-primary: #013C28 !important;
  --bs-primary-rgb: 1, 60, 40 !important;
  --bs-blue: #013C28 !important;
  --bs-green: #013C28 !important;
  --primary-color: #013C28 !important;
  --primary-dark: #012218 !important;
  --primary-light: #E8F5F0 !important;
}

/* Force primary button colors */
.btn-primary,
.btn.btn-primary {
  background-color: #013C28 !important;
  border-color: #013C28 !important;
  color: white !important;
  font-weight: 500 !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn.btn-primary:hover,
.btn.btn-primary:focus,
.btn.btn-primary:active,
.btn.btn-primary.active {
  background-color: #012218 !important;
  border-color: #012218 !important;
  color: white !important;
  font-weight: 500 !important;
}

/* Force light primary button colors */
.btn-light-primary {
  background-color: #E8F5F0 !important;
  border-color: #E8F5F0 !important;
  color: #013C28 !important;
  font-weight: 500 !important;
}

.btn-light-primary:hover,
.btn-light-primary:focus,
.btn-light-primary:active {
  background-color: #D4EDE4 !important;
  border-color: #D4EDE4 !important;
  color: #012218 !important;
  font-weight: 500 !important;
}

/* Force primary text colors */
.text-primary,
.text-blue {
  color: #013C28 !important;
  font-weight: 500 !important;
}

/* Ensure white text on dark green backgrounds */
.bg-primary *,
.btn-primary *,
.badge-primary *,
[style*="background-color: #013C28"] *,
[style*="background: #013C28"] * {
  color: white !important;
}

/* Ensure dark green text on light backgrounds */
.bg-light-primary *,
.btn-light-primary *,
.badge-light-primary *,
[style*="background-color: #E8F5F0"] *,
[style*="background: #E8F5F0"] * {
  color: #013C28 !important;
  font-weight: 500 !important;
}

/* Force primary background colors */
.bg-primary,
.bg-blue {
  background-color: #013C28 !important;
}

/* Force primary border colors */
.border-primary,
.border-blue {
  border-color: #013C28 !important;
}

/* Force badge colors */
.badge-primary,
.badge.badge-primary {
  background-color: #013C28 !important;
  color: white !important;
}

.badge-light-primary {
  background-color: #E8F5F0 !important;
  color: #013C28 !important;
}

/* Force link colors */
a:not(.btn) {
  color: #013C28 !important;
}

a:not(.btn):hover,
a:not(.btn):focus {
  color: #012218 !important;
}

/* Force form control focus */
.form-control:focus,
.form-select:focus {
  border-color: #013C28 !important;
  box-shadow: 0 0 0 0.2rem rgba(1, 60, 40, 0.25) !important;
  color: #374151 !important;
}

/* Form labels */
.form-label,
label {
  color: #374151 !important;
  font-weight: 500 !important;
}

/* Form text and placeholders */
.form-control,
.form-select {
  color: #374151 !important;
}

.form-control::placeholder {
  color: #9CA3AF !important;
  opacity: 1 !important;
}

/* Force checkbox and radio */
.form-check-input:checked {
  background-color: #013C28 !important;
  border-color: #013C28 !important;
}

/* Force progress bars */
.progress-bar {
  background-color: #013C28 !important;
}

/* Force navigation active states */
.nav-pills .nav-link.active {
  background-color: #013C28 !important;
}

.nav-tabs .nav-link.active {
  color: #013C28 !important;
  border-bottom-color: #013C28 !important;
}

/* Force sidebar active states */
.menu-item.here > .menu-link,
.menu-item.show > .menu-link {
  background-color: #E8F5F0 !important;
  color: #013C28 !important;
}

/* Force pagination */
.page-link {
  color: #013C28 !important;
}

.page-link:hover {
  color: #012218 !important;
  background-color: #E8F5F0 !important;
  border-color: #013C28 !important;
}

.page-item.active .page-link {
  background-color: #013C28 !important;
  border-color: #013C28 !important;
}

/* Force switch/toggle */
.form-switch .form-check-input:checked {
  background-color: #013C28 !important;
  border-color: #013C28 !important;
}

/* Switch labels and text */
.form-switch .form-check-label,
.form-check-label {
  color: #374151 !important;
  font-weight: 500 !important;
}

/* Active switch text */
.form-switch .form-check-input:checked + .form-check-label {
  color: #013C28 !important;
  font-weight: 600 !important;
}

/* Force dropdown active */
.dropdown-item:active,
.dropdown-item.active {
  background-color: #013C28 !important;
  color: white !important;
}

.dropdown-item:hover {
  background-color: #E8F5F0 !important;
  color: #013C28 !important;
}

/* Dropdown toggle buttons */
.dropdown-toggle {
  color: #013C28 !important;
  font-weight: 500 !important;
}

.btn-light-primary.dropdown-toggle {
  background-color: #E8F5F0 !important;
  border-color: #E8F5F0 !important;
  color: #013C28 !important;
  font-weight: 500 !important;
}

.btn-light-primary.dropdown-toggle:hover,
.btn-light-primary.dropdown-toggle:focus {
  background-color: #D4EDE4 !important;
  border-color: #D4EDE4 !important;
  color: #012218 !important;
}

/* Force alert primary */
.alert-primary {
  background-color: #E8F5F0 !important;
  border-color: #013C28 !important;
  color: #013C28 !important;
}

/* Force table primary */
.table-primary {
  background-color: #E8F5F0 !important;
  color: #013C28 !important;
  font-weight: 500 !important;
}

/* Table headers */
.table th,
.table thead th {
  color: #374151 !important;
  font-weight: 600 !important;
}

/* Table cells */
.table td {
  color: #374151 !important;
}

/* Card headers */
.card-header {
  color: #374151 !important;
  font-weight: 600 !important;
}

.card-title {
  color: #374151 !important;
  font-weight: 600 !important;
}

.card-body {
  color: #374151 !important;
}

/* Force spinner */
.spinner-border-primary {
  color: #013C28 !important;
}

/* Force any remaining blue elements */
[class*="blue"],
[class*="primary"] {
  color: #013C28 !important;
}

[class*="bg-blue"],
[class*="bg-primary"] {
  background-color: #013C28 !important;
}

/* Force SVG icons */
.svg-icon-primary,
.svg-icon-blue {
  color: #013C28 !important;
}

/* Force menu icons */
.menu-icon,
.menu-bullet {
  color: #013C28 !important;
}

/* Force any hardcoded blue colors */
*[style*="color: #009ef"],
*[style*="color: #3699FF"],
*[style*="color: #187DE4"],
*[style*="color: #1B84FF"],
*[style*="color: #056EE9"],
*[style*="color: #0095E8"] {
  color: #013C28 !important;
}

*[style*="background-color: #009ef"],
*[style*="background-color: #3699FF"],
*[style*="background-color: #187DE4"],
*[style*="background-color: #1B84FF"],
*[style*="background-color: #056EE9"],
*[style*="background-color: #0095E8"] {
  background-color: #013C28 !important;
}

*[style*="border-color: #009ef"],
*[style*="border-color: #3699FF"],
*[style*="border-color: #187DE4"],
*[style*="border-color: #1B84FF"],
*[style*="border-color: #056EE9"],
*[style*="border-color: #0095E8"] {
  border-color: #013C28 !important;
}

/* Force Element Plus primary colors */
.el-button--primary {
  background-color: #013C28 !important;
  border-color: #013C28 !important;
}

.el-button--primary:hover,
.el-button--primary:focus {
  background-color: #012218 !important;
  border-color: #012218 !important;
}

/* Force any CSS variables that might override */
* {
  --el-color-primary: #013C28 !important;
  --el-color-primary-light-3: #E8F5F0 !important;
  --el-color-primary-light-5: #F4FAF7 !important;
  --el-color-primary-light-7: #F9FCF9 !important;
  --el-color-primary-light-8: #FBFDFB !important;
  --el-color-primary-light-9: #FDFEFE !important;
  --el-color-primary-dark-2: #012218 !important;
}

/* Force any remaining primary colors */
.primary,
.text-primary,
.bg-primary,
.border-primary,
.btn-primary,
.badge-primary {
  color: #013C28 !important;
}

.bg-primary,
.btn-primary,
.badge-primary {
  background-color: #013C28 !important;
}

.border-primary {
  border-color: #013C28 !important;
}

/* Force all blue color variations to green */
.text-blue,
.text-primary,
[class*="text-blue"],
[class*="color-blue"] {
  color: #013C28 !important;
}

.bg-blue,
.bg-primary,
[class*="bg-blue"],
[class*="background-blue"] {
  background-color: #013C28 !important;
}

.border-blue,
.border-primary,
[class*="border-blue"] {
  border-color: #013C28 !important;
}

/* Force SweetAlert2 buttons */
.swal2-confirm {
  background-color: #013C28 !important;
}

/* Force any CSS variables with blue colors */
* {
  --blue: #013C28 !important;
  --primary: #013C28 !important;
  --primary-rgb: 1, 60, 40 !important;
  --bs-blue: #013C28 !important;
  --bs-primary: #013C28 !important;
  --bs-primary-rgb: 1, 60, 40 !important;
  --primary-color: #013C28 !important;
  --primary-active: #012218 !important;
  --primary-hover: #012218 !important;
  --link-color: #013C28 !important;
  --link-hover-color: #012218 !important;
}

/* Force Element Plus and other UI library colors */
.el-button--primary,
.el-link--primary,
.el-tag--primary {
  background-color: #013C28 !important;
  border-color: #013C28 !important;
  color: white !important;
}

/* Force any remaining blue hex codes */
*[style*="#009ef7"],
*[style*="#3699FF"],
*[style*="#187DE4"],
*[style*="#1B84FF"],
*[style*="#056EE9"],
*[style*="#0095E8"] {
  color: #013C28 !important;
  background-color: #013C28 !important;
  border-color: #013C28 !important;
}

/* General text contrast improvements */
body {
  color: #374151 !important;
}

h1, h2, h3, h4, h5, h6 {
  color: #1F2937 !important;
  font-weight: 600 !important;
}

p, span, div {
  color: #374151 !important;
}

/* Ensure high contrast for small text */
.fs-7, .fs-8, .fs-9,
.small, small {
  color: #1F2937 !important;
  font-weight: 500 !important;
}

/* Status text colors */
.text-success {
  color: #059669 !important;
  font-weight: 500 !important;
}

.text-danger {
  color: #DC2626 !important;
  font-weight: 500 !important;
}

.text-warning {
  color: #D97706 !important;
  font-weight: 500 !important;
}

.text-info {
  color: #0284C7 !important;
  font-weight: 500 !important;
}

.text-muted {
  color: #6B7280 !important;
}

.text-gray-600 {
  color: #4B5563 !important;
}

.text-gray-500 {
  color: #6B7280 !important;
}

/* Ensure the theme is applied to dynamically loaded content */
body * {
  --primary: #013C28 !important;
  --primary-rgb: 1, 60, 40 !important;
}
