/* HAI Medical UI - global visual design system (UI only) */
:root {
  --hai-primary: #0f4c81;
  --hai-primary-strong: #0b3a63;
  --hai-secondary: #00a6c8;
  --hai-accent: #20c997;
  --hai-warning: #f59f00;
  --hai-danger: #dc3545;
  --hai-surface: #ffffff;
  --hai-surface-soft: #f4f9ff;
  --hai-border: #dce8f4;
  --hai-text: #1e2a3a;
  --hai-muted: #5f6e81;
  --hai-shadow-sm: 0 8px 18px rgba(15, 76, 129, 0.08);
  --hai-shadow-md: 0 16px 36px rgba(15, 76, 129, 0.12);
  --hai-radius-md: 12px;
  --hai-radius-lg: 16px;
}

html,
body {
  font-family: "Kanit", sans-serif;
  color: var(--hai-text);
}

body {
  background: linear-gradient(180deg, #f3f8ff 0%, #ffffff 240px);
}

.content-wrapper {
  background: transparent;
}

.content-header h1,
.content-header .h1 {
  font-weight: 600;
  color: var(--hai-primary-strong);
}

.card,
.small-box,
.info-box,
.modal-content {
  border-radius: var(--hai-radius-md);
  border: 1px solid var(--hai-border);
  box-shadow: var(--hai-shadow-sm);
}

.card {
  background: var(--hai-surface);
}

.card .card-header {
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
  border-bottom: 1px solid var(--hai-border);
  border-radius: var(--hai-radius-md) var(--hai-radius-md) 0 0;
}

.card-title {
  color: var(--hai-primary-strong);
  font-weight: 600;
}

.small-box {
  overflow: hidden;
  border: 0;
}

.small-box .inner h3 {
  font-weight: 700;
}

.small-box .icon > i {
  opacity: 0.22;
}

.small-box.bg-info {
  background: linear-gradient(135deg, #0f4c81, #2b7dbf) !important;
}

.small-box.bg-success {
  background: linear-gradient(135deg, #14866f, #20c997) !important;
}

.small-box.bg-warning {
  background: linear-gradient(135deg, #b67800, #f59f00) !important;
  color: #fff !important;
}

.small-box.bg-danger {
  background: linear-gradient(135deg, #a9323d, #dc3545) !important;
}

.btn {
  border-radius: 10px;
  font-weight: 500;
}

.btn-primary {
  background: linear-gradient(135deg, var(--hai-primary), #2b7dbf);
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(15, 76, 129, 0.24);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--hai-primary-strong), #1f6aa7);
  border-color: transparent;
}

.btn-outline-primary {
  border-color: #6ca3d6;
  color: var(--hai-primary);
}

.form-control,
.custom-select,
.select2-container--default .select2-selection--single {
  border-radius: 10px;
  border-color: #c8d9ea;
  min-height: 42px;
  box-shadow: none;
}

.form-control:focus,
.custom-select:focus,
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #5ea3e7;
  box-shadow: 0 0 0 0.2rem rgba(15, 76, 129, 0.14);
}

table.table thead th {
  background: #f0f7ff;
  border-bottom: 1px solid #d5e6f7;
  color: var(--hai-primary-strong);
  font-weight: 600;
}

table.table tbody tr:nth-child(even) {
  background: #fbfdff;
}

table.table-hover tbody tr:hover {
  background: #eef6ff;
}

.badge {
  border-radius: 999px;
  padding: 0.38rem 0.62rem;
  font-weight: 500;
}

.modal-header {
  border-bottom: 1px solid var(--hai-border);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.modal-footer {
  border-top: 1px solid var(--hai-border);
}

.main-header.navbar {
  border-bottom: 1px solid #d9e7f4;
  box-shadow: 0 4px 12px rgba(15, 76, 129, 0.08);
  background: #ffffff !important;
}

.main-header .nav-link {
  color: #2f4b67 !important;
}

.main-sidebar {
  background: linear-gradient(180deg, #0f3f6a 0%, #0d2f50 100%) !important;
}

.main-sidebar .brand-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.main-sidebar .brand-text {
  color: #eff7ff !important;
  font-weight: 500 !important;
}

.main-sidebar .nav-header {
  color: rgba(217, 235, 252, 0.76) !important;
  letter-spacing: 0.3px;
}

.main-sidebar .nav-link {
  border-radius: 10px;
  margin: 2px 8px;
  color: rgba(236, 246, 255, 0.95) !important;
}

.main-sidebar .nav-link .nav-icon {
  color: #7fc8ff !important;
}

.main-sidebar .nav-link:hover {
  background: rgba(59, 155, 233, 0.2) !important;
}

.main-sidebar .nav-link.active {
  background: linear-gradient(135deg, rgba(46, 144, 227, 0.38), rgba(12, 104, 183, 0.42)) !important;
  box-shadow: inset 0 0 0 1px rgba(176, 220, 255, 0.35);
}

.main-sidebar .nav-treeview .nav-link {
  margin-left: 18px;
}

.main-footer {
  border-top: 1px solid #dce8f4;
  color: var(--hai-muted);
}

/* Assessment/checklist-friendly sections */
.form-section {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: linear-gradient(180deg, #f8fbff 0%, #f4f9ff 100%);
  border: 1px solid #d8e8f8;
  border-radius: 12px;
}

.form-section-title {
  font-size: 1.08rem;
  font-weight: 600;
  color: #0f4c81;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #cfe2f4;
}

.sub-section {
  margin-top: 0.75rem;
  padding: 0.85rem 0.95rem;
  background: #ffffff;
  border: 1px solid #dfeaf6;
  border-left: 4px solid #78b2e7;
  border-radius: 10px;
}

.sub-section-title {
  font-weight: 600;
  color: #2c4f71;
}

.note-box {
  background-color: #fff9e8;
  border-left: 4px solid #f5c259;
  border-radius: 8px;
}

/* List/report utility */
.card-tools .input-group-text {
  background: #f0f7ff;
  border-color: #cfe0f2;
  color: #36597a;
}

.pagination .page-link {
  border-radius: 8px;
  margin: 0 2px;
  border-color: #d2e2f3;
  color: #174c7f;
}

.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #0f4c81, #2b7dbf);
  border-color: transparent;
}

body.login-page {
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 166, 200, 0.2), transparent 38%),
    radial-gradient(circle at 78% 14%, rgba(15, 76, 129, 0.23), transparent 42%),
    linear-gradient(160deg, #edf6ff 0%, #f8fcff 45%, #ffffff 100%);
}

.login-box .card {
  border-radius: var(--hai-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(7px);
  box-shadow: var(--hai-shadow-md);
}

.login-box .card-header {
  border-radius: var(--hai-radius-lg) var(--hai-radius-lg) 0 0;
}

.login-box .form-control {
  min-height: 48px;
}

.login-box .btn-primary {
  min-height: 46px;
}

.login-box .input-group-text {
  border-radius: 10px 0 0 10px;
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

@media (max-width: 991.98px) {
  .content-header {
    padding-bottom: 0.25rem;
  }

  .content-header .breadcrumb {
    float: none !important;
    margin-top: 0.5rem;
  }
}

@media (max-width: 767.98px) {
  .main-header .navbar-nav .nav-item.d-none.d-md-flex {
    display: none !important;
  }

  .card,
  .small-box,
  .info-box {
    border-radius: 10px;
  }

  .btn {
    min-height: 40px;
  }

  .form-section {
    padding: 0.85rem;
  }
}
