/*
 * MAS brand theme overrides.
 * Keep this file as the single source of brand-level color overrides.
 */

[data-bs-theme="light"][data-color-theme="MAS_Theme"]:root {
  --bs-primary: #0c7a43;
  --bs-primary-dark: #06542d;
  --bs-primary-rgb: 12, 122, 67;
  --bs-primary-text-emphasis: #05532b;
  --bs-primary-bg-subtle: #eaf6ef;
  --bs-primary-border-subtle: #c7e4d3;

  --bs-secondary: #2f8c73;
  --bs-secondary-rgb: 47, 140, 115;
  --bs-secondary-text-emphasis: #1d5a4a;
  --bs-secondary-bg-subtle: #e7f4ef;
  --bs-secondary-border-subtle: #c2e2d8;

  --bs-info: #0f766e;
  --bs-info-rgb: 15, 118, 110;
  --bs-info-text-emphasis: #0a4d48;
  --bs-info-bg-subtle: #e4f4f3;
  --bs-info-border-subtle: #bde1dd;

  --bs-link-color: #0c7a43;
  --bs-link-color-rgb: 12, 122, 67;
  --bs-link-hover-color: #06542d;
  --bs-link-hover-color-rgb: 6, 84, 45;
}

[data-bs-theme="dark"][data-color-theme="MAS_Theme"]:root {
  --bs-primary: #3bb273;
  --bs-primary-dark: #2a8a59;
  --bs-primary-rgb: 59, 178, 115;
  --bs-primary-text-emphasis: #98dfbb;
  --bs-primary-bg-subtle: #1a3a2a;
  --bs-primary-border-subtle: #2a6745;

  --bs-secondary: #4eb29a;
  --bs-secondary-rgb: 78, 178, 154;
  --bs-secondary-text-emphasis: #a7dfd0;
  --bs-secondary-bg-subtle: #1b3e36;
  --bs-secondary-border-subtle: #2e695b;

  --bs-info: #44b6ae;
  --bs-info-rgb: 68, 182, 174;
  --bs-info-text-emphasis: #9dded9;
  --bs-info-bg-subtle: #1a3f3c;
  --bs-info-border-subtle: #2f6f6a;

  --bs-link-color: #6fd09b;
  --bs-link-color-rgb: 111, 208, 155;
  --bs-link-hover-color: #95ddb7;
  --bs-link-hover-color-rgb: 149, 221, 183;
}

[data-color-theme="MAS_Theme"] .btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: #086737;
  --bs-btn-hover-border-color: #086737;
  --bs-btn-active-bg: #06542d;
  --bs-btn-active-border-color: #06542d;
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
}

[data-color-theme="MAS_Theme"] .btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-active-bg: #086737;
  --bs-btn-active-border-color: #086737;
}

[data-color-theme="MAS_Theme"] .btn-secondary {
  --bs-btn-bg: var(--bs-secondary);
  --bs-btn-border-color: var(--bs-secondary);
  --bs-btn-hover-bg: #256f5b;
  --bs-btn-hover-border-color: #256f5b;
  --bs-btn-active-bg: #1d5a4a;
  --bs-btn-active-border-color: #1d5a4a;
}

[data-color-theme="MAS_Theme"] .btn-info {
  --bs-btn-bg: var(--bs-secondary);
  --bs-btn-border-color: var(--bs-secondary);
  --bs-btn-hover-bg: #256f5b;
  --bs-btn-hover-border-color: #256f5b;
  --bs-btn-active-bg: #1d5a4a;
  --bs-btn-active-border-color: #1d5a4a;
  --bs-btn-disabled-bg: var(--bs-secondary);
  --bs-btn-disabled-border-color: var(--bs-secondary);
  --bs-btn-color: #fff;
}

[data-color-theme="MAS_Theme"] .btn-outline-info {
  --bs-btn-color: var(--bs-secondary);
  --bs-btn-border-color: var(--bs-secondary);
  --bs-btn-hover-bg: var(--bs-secondary);
  --bs-btn-hover-border-color: var(--bs-secondary);
  --bs-btn-active-bg: #256f5b;
  --bs-btn-active-border-color: #256f5b;
  --bs-btn-hover-color: #fff;
}

[data-color-theme="MAS_Theme"] .table-info,
[data-color-theme="MAS_Theme"] .table > :not(caption) > *.table-info {
  background-color: var(--bs-primary-bg-subtle) !important;
  border-color: var(--bs-primary-border-subtle) !important;
  color: var(--bs-primary-text-emphasis) !important;
}

[data-color-theme="MAS_Theme"] .text-info {
  color: var(--bs-secondary) !important;
}

[data-color-theme="MAS_Theme"] .bg-info-subtle {
  background-color: var(--bs-secondary-bg-subtle) !important;
}

[data-color-theme="MAS_Theme"] .text-info-emphasis {
  color: var(--bs-secondary-text-emphasis) !important;
}

[data-color-theme="MAS_Theme"] .card-info {
  border-top: 2px solid var(--bs-primary);
}

[data-color-theme="MAS_Theme"] .alert-info {
  --bs-alert-color: var(--bs-info-text-emphasis);
  --bs-alert-bg: var(--bs-info-bg-subtle);
  --bs-alert-border-color: var(--bs-info-border-subtle);
}

/* Decorative page headers were historically using bg-info/bg-primary. */
[data-color-theme="MAS_Theme"] .card-header.bg-info,
[data-color-theme="MAS_Theme"] .card-header.bg-primary,
[data-color-theme="MAS_Theme"] .card-header.bg-secondary {
  background: linear-gradient(135deg, #0c7a43, #086737) !important;
  color: #fff !important;
}

[data-color-theme="MAS_Theme"] .card-header.bg-info .card-title,
[data-color-theme="MAS_Theme"] .card-header.bg-primary .card-title,
[data-color-theme="MAS_Theme"] .card-header.bg-secondary .card-title {
  color: #fff !important;
}

[data-color-theme="MAS_Theme"] .page-link {
  color: var(--bs-primary);
}

[data-color-theme="MAS_Theme"] .pagination .active > .page-link {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

[data-color-theme="MAS_Theme"] .nav-tabs .nav-link.active,
[data-color-theme="MAS_Theme"] .nav-pills .nav-link.active {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
  border-color: var(--bs-primary) !important;
}

[data-color-theme="MAS_Theme"] .nav-tabs .nav-link.active i,
[data-color-theme="MAS_Theme"] .nav-pills .nav-link.active i {
  color: #fff !important;
}

[data-color-theme="MAS_Theme"] .form-control:focus,
[data-color-theme="MAS_Theme"] .form-select:focus {
  border-color: color-mix(in srgb, var(--bs-primary) 45%, #ffffff);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--bs-primary) 22%, transparent);
}

[data-color-theme="MAS_Theme"] .logo-img img,
[data-color-theme="MAS_Theme"] .brand-logo img {
  width: auto;
  max-height: 52px;
}

[data-color-theme="MAS_Theme"] .mas-brand-logo {
  width: auto;
  height: auto;
  max-width: 220px;
  max-height: 56px;
  object-fit: contain;
}

[data-color-theme="MAS_Theme"] .left-sidebar .brand-logo .logo-img {
  display: block;
  width: 100%;
}

[data-color-theme="MAS_Theme"] .left-sidebar .brand-logo .mas-brand-logo-full {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: none;
}

[data-color-theme="MAS_Theme"] .left-sidebar .brand-logo .mas-brand-logo-compact {
  display: none;
  width: 40px;
  max-width: 40px;
  max-height: 40px;
}

@media (min-width: 1300px) {
  [data-layout="vertical"] body[data-sidebartype="mini-sidebar"] .left-sidebar .brand-logo .logo-img {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  [data-layout="vertical"] body[data-sidebartype="mini-sidebar"] .left-sidebar .brand-logo .mas-brand-logo-full {
    display: none;
  }

  [data-layout="vertical"] body[data-sidebartype="mini-sidebar"] .left-sidebar .brand-logo .mas-brand-logo-compact {
    display: block;
  }

  [data-layout="vertical"] body[data-sidebartype="mini-sidebar"] .left-sidebar:hover .brand-logo .mas-brand-logo-full {
    display: block;
  }

  [data-layout="vertical"] body[data-sidebartype="mini-sidebar"] .left-sidebar:hover .brand-logo .mas-brand-logo-compact {
    display: none;
  }
}

@media (max-width: 1199.98px) {
  [data-color-theme="MAS_Theme"] .mas-brand-logo {
    max-width: 190px;
    max-height: 50px;
  }
}

[data-color-theme="MAS_Theme"] .sidebar-link:hover,
[data-color-theme="MAS_Theme"] .sidebar-link.active {
  color: var(--bs-primary);
}

[data-color-theme="MAS_Theme"] .sidebar-link:hover i {
  color: var(--bs-primary);
}

[data-color-theme="MAS_Theme"] .sidebar-link.active i {
  color: #fff;
}

/* Optional utility set for module migrations. */
.mas-page-header {
  background: linear-gradient(135deg, #0c7a43, #086737) !important;
  color: #fff !important;
}

.mas-page-header .card-title,
.mas-page-header h1,
.mas-page-header h2,
.mas-page-header h3,
.mas-page-header h4,
.mas-page-header h5,
.mas-page-header h6 {
  color: #fff !important;
}

.mas-action-primary {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: #fff !important;
}

.mas-action-secondary {
  background-color: var(--bs-secondary) !important;
  border-color: var(--bs-secondary) !important;
  color: #fff !important;
}

.mas-stat-icon {
  background: linear-gradient(145deg, #0c7a43, #086737) !important;
  color: #fff !important;
}

.mas-section-chip {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  border: 1px solid var(--bs-primary-border-subtle);
  border-radius: 999px;
}
