/* IPMAFA brand palette, derived from the institution's official website. */
:root {
  --ipmafa-primary: #1e7e4d;
  --ipmafa-primary-dark: #165c38;
  --ipmafa-primary-deep: #0d3822;
  --ipmafa-primary-soft: #e8f5e9;
  --ipmafa-primary-softest: #f1f8f3;
  --ipmafa-accent: #f1c40f;
  --ipmafa-accent-dark: #c79e00;
  --bs-primary: #1e7e4d !important;
  --bs-primary-rgb: 30, 126, 77 !important;
  --bs-link-color: #1e7e4d;
  --bs-link-hover-color: #165c38;
}

::selection { color: #fff; background: var(--ipmafa-primary); }
a { color: var(--ipmafa-primary); }
a:hover { color: var(--ipmafa-primary-dark); }

.text-primary { color: var(--ipmafa-primary) !important; }
.bg-primary { background-color: var(--ipmafa-primary) !important; }
.border-primary { border-color: var(--ipmafa-primary) !important; }
.bg-label-primary {
  color: var(--ipmafa-primary) !important;
  background-color: rgba(30, 126, 77, .12) !important;
}

.btn-primary {
  --bs-btn-bg: var(--ipmafa-primary);
  --bs-btn-border-color: var(--ipmafa-primary);
  --bs-btn-hover-bg: var(--ipmafa-primary-dark);
  --bs-btn-hover-border-color: var(--ipmafa-primary-dark);
  --bs-btn-active-bg: var(--ipmafa-primary-dark);
  --bs-btn-active-border-color: var(--ipmafa-primary-dark);
  --bs-btn-disabled-bg: var(--ipmafa-primary);
  --bs-btn-disabled-border-color: var(--ipmafa-primary);
  color: #fff !important;
  background-color: var(--ipmafa-primary) !important;
  border-color: var(--ipmafa-primary) !important;
  box-shadow: 0 .35rem .8rem rgba(30, 126, 77, .2);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--ipmafa-primary-dark) !important;
  border-color: var(--ipmafa-primary-dark) !important;
}
.btn-outline-primary {
  color: var(--ipmafa-primary) !important;
  border-color: var(--ipmafa-primary) !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  color: #fff !important;
  background-color: var(--ipmafa-primary) !important;
  border-color: var(--ipmafa-primary) !important;
}

.form-control:focus,
.form-select:focus,
.select2-container--default.select2-container--focus .select2-selection,
.select2-container--default.select2-container--open .select2-selection {
  border-color: rgba(30, 126, 77, .58) !important;
  box-shadow: 0 0 0 .2rem rgba(30, 126, 77, .12) !important;
}
.form-check-input:checked,
.form-check-input[type=checkbox]:indeterminate {
  background-color: var(--ipmafa-primary) !important;
  border-color: var(--ipmafa-primary) !important;
}
.form-range::-webkit-slider-thumb { background: var(--ipmafa-primary) !important; }
.form-range::-moz-range-thumb { background: var(--ipmafa-primary) !important; }

.page-item.active .page-link,
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link,
.dropdown-item.active,
.dropdown-item:active {
  color: #fff !important;
  background-color: var(--ipmafa-primary) !important;
  border-color: var(--ipmafa-primary) !important;
}
.page-link { color: var(--ipmafa-primary); }
.page-link:hover { color: var(--ipmafa-primary-dark); background: var(--ipmafa-primary-soft); }
.progress-bar { background-color: var(--ipmafa-primary); }
.spinner-border.text-primary { color: var(--ipmafa-primary) !important; }

.app-brand-text { color: var(--ipmafa-primary-deep) !important; }
#layout-navbar .avatar-online::after { background-color: #69b342; }
#layout-navbar .dropdown-user {
  width: auto !important;
}
#layout-navbar .navbar-user-trigger {
  display: inline-flex !important;
  width: max-content !important;
  flex-flow: row nowrap !important;
  align-items: center;
  justify-content: flex-end;
  gap: .7rem;
}
#layout-navbar .navbar-user-identity {
  display: flex !important;
  min-width: 0;
  max-width: 13rem;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  text-align: right;
}
#layout-navbar .navbar-user-trigger > .avatar {
  flex: 0 0 2.5rem;
}
#layout-navbar .navbar-user-identity strong,
#layout-navbar .navbar-user-identity small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#layout-navbar .navbar-user-identity strong {
  color: var(--bs-heading-color);
  font-size: .875rem;
  font-weight: 600;
}
#layout-navbar .navbar-user-identity small {
  margin-top: .15rem;
  color: var(--bs-secondary-color);
  font-size: .75rem;
}
@media (max-width: 575.98px) {
  #layout-navbar .navbar-user-identity { max-width: 9.5rem; }
  #layout-navbar .navbar-user-identity strong { font-size: .8rem; }
  #layout-navbar .navbar-user-identity small { font-size: .7rem; }
}
#layout-menu.menu-horizontal .menu-inner > .menu-item.active > .menu-link {
  color: #fff !important;
  background: var(--ipmafa-primary) !important;
  box-shadow: 0 .38rem .85rem rgba(30, 126, 77, .22) !important;
}
#layout-menu.menu-horizontal .menu-inner > .menu-item.active > .menu-link > .menu-icon,
#layout-menu.menu-horizontal .menu-inner > .menu-item.active > .menu-link::after {
  color: #fff !important;
}
#layout-menu .menu-sub .menu-item.active > .menu-link {
  color: var(--ipmafa-primary) !important;
  background: var(--ipmafa-primary-soft) !important;
}

/* Modern pages built in this application use page-scoped primary variables. */
.eva-dashboard { --eva-primary: var(--ipmafa-primary) !important; --eva-primary-dark: var(--ipmafa-primary-dark) !important; }
.leger-page { --leger-primary: var(--ipmafa-primary) !important; --leger-ink: var(--ipmafa-primary-deep) !important; }
.unit-page { --unit-primary: var(--ipmafa-primary) !important; --unit-ink: var(--ipmafa-primary-deep) !important; }
.download-page { --download-primary: var(--ipmafa-primary) !important; }

.course-report-hero,
.lecturer-report-hero,
.ranking-hero,
.leger-hero,
.students-hero,
.courses-hero,
.download-hero,
.unit-hero,
.eva-overview {
  border-color: rgba(30, 126, 77, .15) !important;
  background:
    radial-gradient(circle at 88% 8%, rgba(241, 196, 15, .14), transparent 24%),
    radial-gradient(circle at 76% 18%, rgba(30, 126, 77, .15), transparent 31%),
    linear-gradient(125deg, #fff 0%, var(--ipmafa-primary-softest) 100%) !important;
}
.course-report-hero::after,
.lecturer-report-hero::after,
.ranking-hero::after,
.leger-hero::after,
.students-hero::after,
.courses-hero::after,
.download-hero::after,
.unit-hero::before,
.eva-overview::after {
  border-color: rgba(30, 126, 77, .07) !important;
}

.course-report-eyebrow,
.lecturer-report-eyebrow,
.ranking-eyebrow,
.leger-eyebrow,
.students-eyebrow,
.courses-eyebrow,
.download-eyebrow,
.unit-eyebrow,
.eva-eyebrow,
.eva-panel__kicker {
  color: var(--ipmafa-primary) !important;
}

.students-program-badge,
.students-last-update,
.courses-program-badge,
.course-report-program,
.course-report-period,
.lecturer-report-program,
.lecturer-report-period,
.ranking-program,
.ranking-period,
.dosen-page-kicker {
  color: var(--ipmafa-primary) !important;
  background-color: var(--ipmafa-primary-soft) !important;
}

.dosen-stat:first-child .dosen-stat__icon {
  color: var(--ipmafa-primary) !important;
  background: rgba(30, 126, 77, .11) !important;
}

.course-report-table-card tbody td:nth-child(1),
.course-report-table-card tbody td:nth-child(3) {
  color: var(--ipmafa-primary) !important;
}

.course-report-filters .form-label > span,
.lecturer-report-filters .form-label > span,
.ranking-filters .form-label > span,
.leger-filters .form-label > span,
.leger-step,
.unit-step,
.download-step {
  color: #fff !important;
  background: var(--ipmafa-primary) !important;
}

.is-purple,
.students-stat__icon.is-purple,
.courses-stat__icon.is-purple,
.download-stat__icon.is-purple,
.leger-stat__icon.is-purple,
.ranking-stat__icon.is-purple,
.lecturer-report-stat__icon.is-purple {
  color: var(--ipmafa-primary) !important;
  background: var(--ipmafa-primary-soft) !important;
}

.unit-stat:first-child,
.leger-stat:first-child {
  --stat-color: var(--ipmafa-primary) !important;
  --stat-bg: var(--ipmafa-primary-soft) !important;
}

.score-pill,
.unit-mean,
.essay-count,
.essay-group h3 span,
.leger-faculty,
.leger-period {
  color: var(--ipmafa-primary) !important;
  background: var(--ipmafa-primary-soft) !important;
}
.unit-group td { color: var(--ipmafa-primary-dark) !important; background: var(--ipmafa-primary-soft) !important; }
.unit-group-index { background: var(--ipmafa-primary) !important; }
.unit-score-value { color: var(--ipmafa-primary) !important; }
.unit-score-bar span { background: linear-gradient(90deg, var(--ipmafa-primary), #2fb58d) !important; }

.table-primary { --bs-table-bg: rgba(30, 126, 77, .1); --bs-table-color: var(--ipmafa-primary-deep); }
.card-border-shadow-primary::after { background: var(--ipmafa-primary) !important; }

/* Gold is deliberately restrained to secondary emphasis, matching ipmafa.ac.id. */
.ipmafa-accent,
.badge.bg-warning,
.text-warning { color: var(--ipmafa-accent-dark) !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
