:root {
  --hmis-color-brand: #189f9f;
  --hmis-color-on-brand: #ffffff;
  --hmis-color-action: #189f9f;
  --hmis-color-required: #c00;
  --hmis-color-nav-bullet: #5f6281;
  --hmis-font-data: "IBM Plex Sans", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hmis-dash-icon-height: 150px;
  --hmis-dash-icon-sm-height: 110px;
  --hmis-search-input-width: 45em;
}

/* Safe extraction set from legacy style.css */
form ul {
  margin: 0;
  padding: 0;
}

form ul li {
  list-style-type: none;
  margin: 2px 0;
}

.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--kt-primary, #5867dd);
  color: #fff;
  z-index: 10000;
}

.form-validation {
  position: relative;
}

.form-validation .invalid-feedback {
  display: block;
  color: var(--kt-danger, #fd3995);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-validation .is-invalid {
  border-color: var(--kt-danger, #fd3995);
}

.form-validation .is-valid {
  border-color: var(--kt-success, #34bfa3);
}

.form-validation-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
}

.form-validation .is-valid ~ .form-validation-icon {
  display: block;
  color: var(--kt-success, #34bfa3);
}

.form-validation .is-invalid ~ .form-validation-icon {
  display: block;
  color: var(--kt-danger, #fd3995);
}

.hmis-data-surface tbody td {
  font-family: var(--hmis-font-data);
}

.hmis-data-surface .hmis-data-num {
  font-variant-numeric: tabular-nums;
}

.kt-portlet--mobile table.table.table-striped.table-bordered.table-hover tbody td {
  font-family: var(--hmis-font-data);
}

.kt-portlet--mobile table.table.table-striped.table-bordered.table-hover tbody td.text-right {
  font-variant-numeric: tabular-nums;
}

.hmis-security-aside-bg {
  background-image: url("../media/bg/bg-4.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.hmis-user-card-bg {
  background-image: url("../media/misc/bg-1.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.hmis-error-shell-bg {
  background-image: url("../media/bg/bg-3.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.hmis-abha-eye-toggle {
  position: absolute;
  right: 10px;
  top: 10px;
  cursor: pointer;
}

.hmis-abha-eye-toggle-step1 {
  right: 18px;
}

.hmis-abha-card-image {
  height: 400px;
}

.hmis-abha-radio-inline {
  padding-bottom: 20px;
}

.hmis-abha-mode-error {
  position: absolute;
  padding-top: 40px;
  padding-left: 239px;
}

.hmis-abha-mode-error-step5 {
  padding-left: 229px;
}

.hmis-abha-health-id-error {
  position: absolute;
  margin-top: 40px;
  margin-left: 232px;
  color: red;
}

.hmis-abha-pdf-view {
  width: 100%;
  height: 500px;
  overflow: scroll;
}

.hmis-abha-card-shell {
  margin: 0;
  padding: 0;
}

.hmis-abha-card-responsive {
  width: 95%;
  max-width: 100%;
  height: auto;
}

.hmis-abha-account-details {
  line-height: 1.4;
}

.hmis-abha-account-image {
  max-width: 100px;
  height: auto;
}

.hmis-abha-fetch-radio {
  margin-top: 3px;
  display: inline-block;
  min-width: 18px;
  min-height: 18px;
}

.hmis-abha-fetch-radio > input {
  z-index: 1;
  width: 18px;
  height: 18px;
  left: 0;
  top: 0;
  cursor: pointer;
}

.hmis-abha-fetch-radio > span {
  pointer-events: none;
}

.hmis-abha-actions-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hmis-abha-profile-panel {
  border: 1px solid #e9edf5;
  border-radius: 0.4rem;
  background: #fbfcff;
  padding: 1rem;
}

.hmis-abha-kv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.hmis-abha-kv {
  min-width: 0;
}

.hmis-abha-kv--wide {
  grid-column: span 2;
}

.hmis-abha-kv__label {
  color: #5f6281;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.hmis-abha-kv__value {
  color: #2b2f4a;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  word-break: break-word;
}

.hmis-abha-mobile-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hmis-abha-mobile-prefix {
  color: #5f6281;
  font-weight: 700;
}

.hmis-abha-card-shell {
  border: 1px solid #e9edf5;
  border-radius: 0.4rem;
  background: #f8faff;
  padding: 1rem;
  text-align: center;
}

@media (max-width: 991.98px) {
  .hmis-abha-kv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .hmis-abha-kv-grid {
    grid-template-columns: 1fr;
  }

  .hmis-abha-kv--wide {
    grid-column: span 1;
  }

  .hmis-abha-card-image {
    width: 100%;
    max-width: 360px;
    height: auto;
  }
}

/* Top Navigation Enhancements */
.kt-header-menu .kt-menu__nav > .kt-menu__item--submenu > .kt-menu__link {
  display: flex !important;
  align-items: center;
}

.kt-header-menu .kt-menu__nav > .kt-menu__item--submenu > .kt-menu__link .kt-menu__ver-arrow {
  display: inline-flex !important;
  align-items: center;
  margin-left: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.kt-header-menu .kt-menu__nav > .kt-menu__item--submenu:hover > .kt-menu__link .kt-menu__ver-arrow {
  opacity: 1;
}

.kt-header-menu .kt-menu__nav > .kt-menu__item--submenu.kt-menu__item--open > .kt-menu__link .kt-menu__ver-arrow {
  transform: rotate(180deg);
}

/* Dashboard Tiles */
.hmis-dashboard-tile {
  padding: 1.25rem 1rem;
  border-radius: 0.65rem;
  border: 2px solid rgba(24, 159, 159, 0.2);
  box-shadow: 0 4px 16px rgba(24, 159, 159, 0.2);
  transition: all 0.3s ease;
}

.hmis-dashboard-tile:hover {
  background: linear-gradient(135deg, #189f9f 0%, #16b8b8 100%) !important;
  border-color: rgba(24, 159, 159, 0.5);
  box-shadow: 0 8px 24px rgba(24, 159, 159, 0.4);
  transform: translateY(-2px);
}

.hmis-dashboard-tile:hover .hmis-dashboard-tile__icon {
  background: rgba(255, 255, 255, 0.25) !important;
}

.hmis-dashboard-tile:hover .hmis-dashboard-tile__icon i,
.hmis-dashboard-tile:hover .hmis-dashboard-tile__text {
  color: #ffffff !important;
}

.hmis-dashboard-tile__icon {
  width: 3.5rem;
  height: 3.5rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.hmis-case-filter {
  border: 1px solid #dfe6ef;
  box-shadow: none;
  background: #f5f8fc;
}

.hmis-case-filter__label {
  color: #5f6281;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.375rem;
  text-transform: uppercase;
}

.hmis-case-table-shell {
  border: 1px solid #ebedf3;
  border-radius: 0.25rem;
  overflow: hidden;
}

.hmis-case-table__col-index {
  width: 4.5rem;
}

.hmis-case-table__col-patient {
  width: 31%;
}

.hmis-case-table__col-case {
  width: 18%;
}

.hmis-case-table__col-status {
  width: 11%;
}

.hmis-case-table__col-created {
  width: 13%;
}

.hmis-case-table__col-balance {
  width: 9%;
}

.hmis-case-table__col-abha {
  width: 10%;
}

.hmis-case-table__col-actions {
  width: 7%;
}

.hmis-case-patient__photo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 0.25rem;
}

.hmis-case-patient__name {
  color: #1f2430;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.2rem;
}

.hmis-case-patient__meta {
  color: #5f6281;
  font-size: 0.875rem;
  line-height: 1.5;
}

.hmis-case-detail-heading__meta-label {
  color: var(--hmis-color-brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
}

.hmis-case-detail-heading__title {
  color: #252b3b;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
}

.hmis-case-detail-tools__text {
  color: #4f5875;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
}

.hmis-case-detail-tools-card .card-body {
  border: 1px solid #edf2f7;
  border-radius: 0.42rem;
  padding-bottom: 0.85rem !important;
  padding-top: 0.85rem !important;
}

.hmis-case-detail-section-card {
  border: 1px solid #edf2f7;
}

.hmis-case-detail-section-card .card-header {
  min-height: 62px;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 0.7rem;
  padding-top: 0.7rem;
}

.hmis-case-detail-section-card .card-title {
  margin-bottom: 0;
}

.hmis-case-detail-card__icon {
  color: var(--hmis-color-brand);
  font-size: 1.5rem !important;
}

.hmis-patient-summary-media {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hmis-patient-summary-media__avatar.kt-media {
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
}

.hmis-patient-summary-media__image {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 50%;
}

.hmis-patient-summary-inline {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.hmis-patient-summary-inline__primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.hmis-patient-summary-inline__name {
  color: #1f2430;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.hmis-patient-summary-inline__meta,
.hmis-patient-summary-inline__secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.hmis-patient-summary-inline__item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: #55607a;
  font-size: 0.9rem;
  line-height: 1.4;
}

.hmis-patient-summary-inline__item i {
  color: var(--hmis-color-brand);
  margin-right: 0.4rem;
}

.hmis-patient-summary-inline__item span {
  min-width: 0;
}

.hmis-patient-summary-inline__item--address {
  display: flex;
  align-items: flex-start;
}

.hmis-patient-summary-inline__item--address span {
  color: #4f5875;
}

.hmis-patient-summary-inline__item--balance {
  color: #252b3b;
  font-size: 0.98rem;
  font-weight: 700;
}

@media (max-width: 767.98px) {
  .hmis-patient-summary-inline {
    margin-top: 0.75rem;
  }

  .hmis-patient-summary-inline__primary {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

.hmis-case-detail-dl dt,
.hmis-case-detail-dl dd {
  color: #1f2430;
  font-size: 0.88rem;
  line-height: 1.4;
}

.hmis-case-detail-dl dt {
  color: #5f6281;
  font-weight: 600;
}

.hmis-case-detail-dl dd {
  font-weight: 500;
  margin-bottom: 0;
}

.hmis-case-detail-keyline {
  background: #fbfcfe;
  border: 1px solid #edf2f7;
  border-radius: 0.42rem;
  padding: 0.9rem 1rem;
}

.hmis-case-detail-keyline__label {
  color: #7a8199;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
}

.hmis-case-detail-keyline__value {
  color: #252b3b;
  font-size: 0.95rem;
  font-weight: 600;
}

.hmis-case-detail-panel {
  background: #fbfcfe;
  border: 1px solid #edf2f7;
  border-radius: 0.42rem;
  padding: 0.85rem 0.95rem;
}

.hmis-case-detail-panel__title {
  color: var(--hmis-color-brand);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.hmis-case-detail-panel .hmis-case-detail-dl dt,
.hmis-case-detail-panel .hmis-case-detail-dl dd {
  padding-bottom: 0.22rem;
  padding-top: 0.22rem;
}

.hmis-case-detail-note {
  background: #fbfcfe;
  border: 1px solid #edf2f7;
  border-radius: 0.42rem;
  padding: 0.85rem 1rem;
}

.hmis-case-detail-note__label {
  color: #7a8199;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.hmis-case-history-card__toolbar {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}
.hmis-case-history-card__print {
  font-weight: 600;
}

.hmis-case-history-card .card-body {
  padding-top: 0.65rem;
}

.hmis-case-history-card .kt-timeline-v1__item {
  padding-bottom: 0.9rem;
}

.hmis-case-history-card .kt-timeline-v1__item-time {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.hmis-case-history-card .kt-timeline-v1__item-body {
  background: #fbfcfe;
  border: 1px solid #edf2f7;
  border-radius: 0.35rem;
  padding: 0.6rem 0.75rem;
}

.hmis-case-history-card .kt-timeline-v1__item-body .hmis-case-detail-dl dt,
.hmis-case-history-card .kt-timeline-v1__item-body .hmis-case-detail-dl dd {
  padding-bottom: 0.24rem;
  padding-top: 0.24rem;
}

.hmis-case-history-card .kt-timeline-v1__marker {
  top: 0.35rem;
}

/* Patient Search Empty State */
.hmis-search-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
}

.hmis-search-empty-state__icon {
  display: block;
  font-size: 4rem;
  color: #d1d5e0;
  margin-bottom: 0.75rem;
}

.hmis-search-empty-state__text {
  color: #a2a5b9;
  font-size: 0.95rem;
  margin: 0;
}
