/*
 * Titanfire ERP - Theme overrides
 * Goal: better readability on the ERP's dark surfaces without touching vendor bundles.
 */

/*
 * Metronic defines many text colors (text-gray-*) primarily for light backgrounds.
 * We remap them to brighter values on our ERP dark surfaces (sidebar layout + auth screens).
 *
 * Note: we intentionally scope to body to also fix the "dark layout + light bs-theme" mismatch.
 */
body[data-kt-app-layout="dark-sidebar"],
body.app-blank {
  --bs-body-color: #f9fafb;
  --bs-body-color-rgb: 249, 250, 251;
  --bs-heading-color: #f9fafb;

  --bs-text-muted: #cbd5e1;

  /* Metronic's dark theme inverts the gray scale (100 becomes near-black). We need these for text. */
  --bs-text-gray-100: #d1d5db;
  --bs-text-gray-200: #f3f4f6;
  --bs-text-gray-300: #e5e7eb;
  --bs-text-gray-900: #f9fafb;
  --bs-text-gray-800: #f3f4f6;
  --bs-text-gray-700: #e5e7eb;
  --bs-text-gray-600: #d1d5db;
  --bs-text-gray-500: #cbd5e1;
  --bs-text-gray-400: #b6c2d0;
}

/*
 * Base form controls in the bundle use light-theme grays (e.g. --bs-gray-700) which are too dark on
 * dark backgrounds. Our app mostly uses *-solid variants, but these overrides keep non-solid controls
 * readable in dark mode as well.
 */
body[data-kt-app-layout="dark-sidebar"] .form-control:not(.form-control-solid),
body[data-kt-app-layout="dark-sidebar"] .form-select:not(.form-select-solid),
body.app-blank .form-control:not(.form-control-solid),
body.app-blank .form-select:not(.form-select-solid) {
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

body[data-kt-app-layout="dark-sidebar"] .form-control:not(.form-control-solid)::placeholder,
body.app-blank .form-control:not(.form-control-solid)::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

body[data-kt-app-layout="dark-sidebar"] .form-select:not(.form-select-solid),
body.app-blank .form-select:not(.form-select-solid) {
  /* Light chevron for dark select backgrounds */
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23E1E3EA' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
