:root {
  --sc-ink: var(--bs-body-color);
  --sc-muted: var(--bs-secondary-color);
  --sc-line: var(--bs-border-color-translucent);
  --sc-panel: color-mix(in srgb, var(--bs-body-bg) 88%, white 12%);
  --sc-soft: color-mix(in srgb, var(--bs-body-bg) 88%, var(--bs-primary) 12%);
  --sc-primary: var(--bs-primary);
  --sc-primary-strong: color-mix(in srgb, var(--bs-primary) 78%, black 22%);
  --sc-accent: var(--bs-info);
  --sc-rgb-primary: var(--bs-primary-rgb);
  --sc-rgb-info: var(--bs-info-rgb);
  --sc-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  --sc-shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
}

html {
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 15.5px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--bs-body-bg), 0 0 0 0.25rem rgba(var(--sc-rgb-primary), 0.28);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  color: var(--sc-ink);
  font-family: "Segoe UI", "Noto Sans Thai", Tahoma, Arial, sans-serif;
  font-size: 0.98rem;
  line-height: 1.55;
  background:
    radial-gradient(circle at 12% 0%, rgba(var(--sc-rgb-primary), 0.13), transparent 26%),
    radial-gradient(circle at 92% 10%, rgba(var(--sc-rgb-info), 0.1), transparent 25%),
    linear-gradient(180deg, color-mix(in srgb, var(--bs-body-bg) 94%, white 6%) 0%, color-mix(in srgb, var(--bs-body-bg) 88%, var(--bs-primary) 12%) 100%);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--sc-ink);
  letter-spacing: 0;
}

a {
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.smartclinic-navbar {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  backdrop-filter: blur(18px);
  background: linear-gradient(90deg, color-mix(in srgb, var(--bs-dark) 86%, var(--bs-primary) 14%) 0%, color-mix(in srgb, var(--bs-primary) 72%, var(--bs-dark) 28%) 100%);
}

.smartclinic-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 0.82rem;
}

.smartclinic-navbar .nav-link {
  border-radius: 999px;
  padding: 0.48rem 0.72rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  font-weight: 600;
}

.smartclinic-navbar .nav-link:hover,
.smartclinic-navbar .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.nav-tool,
.nav-account {
  padding-left: 0.4rem;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--bs-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.theme-select {
  min-width: 140px;
}

.profile-report-sheet {
  background: #fff;
  color: #111827;
  width: min(210mm, 100%);
  min-height: 297mm;
  margin: 0 auto;
  padding: 13mm 16mm 8mm;
  border: 1px solid #d8dee6;
  box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, .12);
  font-family: "TH Sarabun New", "Sarabun", "Leelawadee UI", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.48;
  position: relative;
}

.profile-form-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 15px;
  margin-bottom: 18px;
}

.profile-form-top > div:last-child {
  text-align: right;
}

.profile-form-small-box {
  min-width: 26px;
  min-height: 13px;
  display: inline-block;
  margin-top: 6px;
  border: 1px solid #111827;
  padding: 0 6px;
  font-size: 14px;
  line-height: 17px;
}

.profile-form-date {
  margin-top: 4px;
}

.profile-form-patient-photo {
  position: absolute;
  top: 30mm;
  right: 5mm;
  width: 24mm;
  height: 30mm;
  border: 1px solid #111827;
  background: #fff;
  padding: 1mm;
}

.profile-form-patient-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-form-title {
  text-align: center;
  margin-bottom: 15px;
}

.profile-form-logo {
  display: block;
  width: 24mm;
  height: 24mm;
  object-fit: contain;
  margin: -4mm auto 2mm;
}

.profile-form-title h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 2px;
}

.profile-form-title .clinic-name {
  font-size: 17px;
  font-weight: 700;
}

.profile-form-section {
  border-top: 1px solid #d7dde6;
  padding-top: 8px;
  margin-top: 8px;
}

.profile-form-section h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 6px;
}

.profile-form-section p {
  margin: 0 0 6px;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 42px;
}

.profile-form-grid span {
  color: #4b5563;
}

.profile-form-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 52px;
  text-align: center;
  font-size: 16px;
}

.signature-line {
  min-height: 74px;
  position: relative;
}

.profile-form-signature-img {
  display: block;
  width: 58mm;
  height: 17mm;
  object-fit: contain;
  margin: -21mm auto 1mm;
}

.signature-line .line {
  border-bottom: 1px dotted #111827;
  height: 1px;
  margin-bottom: 7px;
}

.profile-form-provider-title {
  font-size: 15px;
}

.profile-form-barcode {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3mm;
  text-align: center;
  font-family: "Courier New", monospace;
  letter-spacing: 0;
  font-size: 15px;
}

.profile-form-barcode svg {
  display: block;
  height: 42px;
  max-width: 82mm;
  margin: 0 auto 1mm;
}

@media print {
  .profile-report-sheet {
    width: 210mm;
    min-height: 297mm;
    padding: 13mm 16mm 8mm;
    border: 0;
    box-shadow: none;
  }
}

.app-shell {
  max-width: 1900px;
}

.hero-panel {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(135deg, color-mix(in srgb, var(--bs-dark) 88%, var(--bs-primary) 12%), color-mix(in srgb, var(--bs-primary) 86%, var(--bs-dark) 14%));
  box-shadow: var(--sc-shadow);
}

.hero-panel .display-5,
.hero-panel .display-6,
.hero-panel h1,
.hero-panel h2,
.hero-panel h3 {
  color: #fff;
}

.glass-card {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
}

.card {
  border: 1px solid var(--sc-line) !important;
  border-radius: 0.9rem;
  background: var(--sc-panel);
  box-shadow: var(--sc-shadow-sm) !important;
  overflow: hidden;
}

.card-body {
  color: var(--sc-ink);
}

.form-label {
  margin-bottom: 0.38rem;
  color: var(--sc-ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.form-control,
.form-select {
  min-height: 2.5rem;
  border-color: var(--sc-line);
  border-radius: 0.55rem;
  font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(var(--sc-rgb-primary), 0.65);
  box-shadow: 0 0 0 0.22rem rgba(var(--sc-rgb-primary), 0.14);
}

textarea.form-control {
  line-height: 1.45;
}

.btn {
  border-radius: 0.55rem;
  font-weight: 700;
}

.btn-primary {
  border-color: var(--sc-primary);
  background: var(--sc-primary);
}

.btn-primary:hover {
  border-color: var(--sc-primary-strong);
  background: var(--sc-primary-strong);
}

.btn-info {
  border-color: var(--sc-accent);
  background: var(--sc-accent);
}

.badge {
  border-radius: 999px;
  font-weight: 700;
}

.table {
  --bs-table-bg: transparent;
  font-size: 0.92rem;
}

.table thead th {
  color: var(--sc-muted);
  border-bottom-color: var(--sc-line);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.table tbody td {
  border-color: var(--sc-line);
  vertical-align: middle;
}

.list-group-item {
  border-color: var(--sc-line);
}

.modal-content {
  border-radius: 0.9rem;
}

.footer {
  background: color-mix(in srgb, var(--bs-body-bg) 72%, transparent);
  backdrop-filter: blur(10px);
}

.status-kpi {
  background: color-mix(in srgb, var(--bs-body-bg) 90%, var(--bs-primary) 10%);
  border: 1px solid var(--sc-line);
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 2.25rem;
  overflow: hidden;
  position: relative;
  border-radius: 1.15rem;
  color: #fff;
  background:
    radial-gradient(circle at 82% 0%, rgba(111, 211, 255, 0.28), transparent 30%),
    linear-gradient(125deg, #203c5a 0%, #265f9c 58%, #287bd3 100%);
  box-shadow: 0 16px 38px rgba(23, 67, 112, 0.2);
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -4rem;
  bottom: -7rem;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  border: 3rem solid rgba(255, 255, 255, 0.05);
}

.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.dashboard-eyebrow,
.dashboard-panel-kicker {
  display: block;
  margin-bottom: 0.35rem;
  color: #79bdf8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.dashboard-hero h1 {
  margin: 0 0 0.4rem;
  color: #fff;
  font-size: clamp(1.75rem, 3vw, 2.8rem);
  font-weight: 800;
}

.dashboard-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.dashboard-hero-status {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 310px;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.dashboard-hero-status strong,
.dashboard-hero-status small {
  display: block;
}

.dashboard-hero-status small {
  margin-top: 0.15rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.76rem;
}

.dashboard-live-dot {
  width: 0.8rem;
  height: 0.8rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0.35rem rgba(74, 222, 128, 0.16);
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-kpi {
  --kpi-color: 54, 132, 230;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.85rem;
  padding: 1.25rem;
  border: 1px solid rgba(var(--kpi-color), 0.22);
  border-radius: 1rem;
  color: var(--sc-ink);
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--kpi-color), 0.14), transparent 38%),
    var(--sc-panel);
  box-shadow: var(--sc-shadow-sm);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-kpi:hover {
  color: var(--sc-ink);
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(var(--kpi-color), 0.16);
}

.dashboard-kpi-green { --kpi-color: 36, 174, 112; }
.dashboard-kpi-violet { --kpi-color: 133, 92, 216; }
.dashboard-kpi-orange { --kpi-color: 235, 142, 49; }

.dashboard-kpi-icon {
  grid-row: 1 / span 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.85rem;
  background: rgba(var(--kpi-color), 0.13);
  font-size: 1.3rem;
}

.dashboard-kpi-icon svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: rgb(var(--kpi-color));
}

.dashboard-kpi-label {
  color: var(--bs-secondary-color);
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-kpi strong {
  color: rgb(var(--kpi-color));
  font-size: 1.85rem;
  line-height: 1.1;
}

.dashboard-kpi small {
  color: var(--bs-secondary-color);
  font-size: 0.73rem;
}

.dashboard-panel {
  overflow: hidden;
}

.dashboard-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dashboard-panel-heading h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.dashboard-total-pill {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  color: #2d639b;
  background: #eaf4ff;
  font-size: 0.75rem;
  font-weight: 800;
}

.dashboard-bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  gap: clamp(0.55rem, 2vw, 1.25rem);
  min-height: 245px;
  padding: 0.75rem 0.5rem 0;
}

.dashboard-bar-item {
  display: grid;
  grid-template-rows: 1.25rem 1fr auto auto;
  gap: 0.3rem;
  min-width: 0;
  text-align: center;
}

.dashboard-bar-value {
  color: #2c6eae;
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-bar-track {
  display: flex;
  align-items: flex-end;
  min-height: 150px;
  overflow: hidden;
  border-radius: 0.6rem 0.6rem 0.25rem 0.25rem;
  background: linear-gradient(180deg, rgba(48, 126, 207, 0.04), rgba(48, 126, 207, 0.1));
}

.dashboard-bar-fill {
  width: 100%;
  min-height: 0.45rem;
  border-radius: 0.6rem 0.6rem 0.2rem 0.2rem;
  background: linear-gradient(180deg, #69b9f2 0%, #2677c8 100%);
  box-shadow: 0 -5px 16px rgba(38, 119, 200, 0.18);
}

.dashboard-bar-item strong {
  font-size: 0.75rem;
}

.dashboard-bar-item small {
  color: var(--bs-secondary-color);
  font-size: 0.68rem;
}

.dashboard-gender-layout {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 1.5rem;
}

.dashboard-donut {
  --male: 0%;
  --female: 0%;
  display: grid;
  width: 145px;
  height: 145px;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background: conic-gradient(#3b91e3 0 var(--male), #e76da5 var(--male) calc(var(--male) + var(--female)), #b9c5d3 0);
}

.dashboard-donut::after {
  content: "";
  position: absolute;
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background: var(--sc-panel);
}

.dashboard-donut div {
  z-index: 1;
  text-align: center;
}

.dashboard-donut strong,
.dashboard-donut small {
  display: block;
}

.dashboard-donut strong {
  font-size: 1.6rem;
}

.dashboard-donut small {
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
}

.dashboard-legend {
  display: grid;
  gap: 0.7rem;
}

.dashboard-legend > div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
}

.legend-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
}

.legend-dot.male { background: #3b91e3; }
.legend-dot.female { background: #e76da5; }
.legend-dot.other { background: #b9c5d3; }

.dashboard-coverage {
  display: grid;
  gap: 0.95rem;
  margin-top: 1.5rem;
}

.dashboard-coverage > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.8rem;
  align-items: center;
  font-size: 0.78rem;
}

.dashboard-coverage .progress {
  grid-column: 1 / -1;
  height: 0.45rem;
  border-radius: 999px;
}

.dashboard-activity-list {
  display: grid;
}

.dashboard-activity-item {
  display: grid;
  grid-template-columns: auto minmax(160px, 1.1fr) minmax(180px, 2fr) auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--sc-line);
  color: var(--sc-ink);
  text-decoration: none;
  transition: background-color 0.18s ease, padding 0.18s ease;
}

.dashboard-activity-item:hover {
  padding-left: 0.8rem;
  color: var(--sc-ink);
  background: color-mix(in srgb, var(--bs-body-bg) 90%, #eaf4ff 10%);
}

.dashboard-activity-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: #2263a0;
  background: #e7f2ff;
  font-size: 0.76rem;
  font-weight: 800;
}

.dashboard-activity-patient strong,
.dashboard-activity-patient small {
  display: block;
}

.dashboard-activity-patient small,
.dashboard-activity-item time {
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
}

.dashboard-activity-diagnosis {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-activity-arrow {
  color: #3584cf;
  font-size: 1.5rem;
}

.dashboard-empty {
  padding: 2.5rem;
  color: var(--bs-secondary-color);
  text-align: center;
}

.smartclinic-status-header {
  border-bottom: 0;
}

.opd-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.opd-status-panel {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 220px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--sc-line);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--sc-shadow-sm);
}

.opd-status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--bs-success);
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-success-rgb), 0.14);
}

.opd-step-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.opd-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--sc-line);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.78);
  color: var(--bs-secondary-color);
}

.opd-step span,
.opd-section-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bs-body-color) 10%, transparent);
  color: var(--sc-ink);
  font-weight: 700;
}

.opd-step.active {
  border-color: rgba(var(--sc-rgb-primary), 0.35);
  background: rgba(var(--sc-rgb-primary), 0.08);
  color: var(--sc-ink);
}

.opd-step.active span,
.opd-section-index {
  background: var(--sc-primary);
  color: #fff;
}

.opd-form-card {
  overflow: visible;
}

.opd-form-section {
  padding: 1rem;
  border: 1px solid var(--sc-line);
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--bs-body-bg) 82%, var(--bs-primary) 6%);
}

.opd-form-section + .opd-form-section {
  margin-top: 1rem;
}

.opd-form-section-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.opd-form-section-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.opd-form-section-header p {
  margin: 0.15rem 0 0;
  color: var(--bs-secondary-color);
  font-size: 0.88rem;
}

.opd-action-bar {
  position: sticky;
  bottom: 0.75rem;
  z-index: 3;
  padding: 0.85rem;
  border: 1px solid var(--sc-line);
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--bs-body-bg) 92%, transparent);
  box-shadow: var(--sc-shadow);
  backdrop-filter: blur(10px);
}

.opd-form-section textarea.form-control {
  min-height: 6rem;
}

.opd-recent-list .opd-recent-item {
  border-bottom: 1px solid color-mix(in srgb, var(--sc-line) 85%, #dbe7f7 15%);
  transition: background-color 0.18s ease;
}

.opd-recent-list .opd-recent-item:hover {
  background: color-mix(in srgb, var(--bs-body-bg) 92%, #eef5ff 8%);
}

.opd-recent-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  color: #134a84;
  background: linear-gradient(145deg, #ecf4ff 0%, #dcecff 100%);
  border: 1px solid #bfd9fb;
  box-shadow: 0 2px 8px rgba(57, 110, 169, 0.14);
}

.opd-records-table tbody tr {
  transition: background-color 0.18s ease;
}

.opd-records-table tbody td {
  font-size: 0.78rem;
  line-height: 1.35;
}

.opd-records-table tbody td .small {
  font-size: 0.72rem;
}

.opd-records-table tbody td:nth-child(3),
.opd-records-table tbody td:nth-child(4) {
  white-space: nowrap;
}

.opd-records-table thead th:first-child,
.opd-records-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bs-body-bg);
}

.opd-records-table thead th:first-child {
  z-index: 2;
}

.opd-records-table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--bs-body-bg) 96%, #eef6ff 4%);
}

.opd-records-table tbody tr:hover {
  background: color-mix(in srgb, var(--bs-body-bg) 88%, #e4f0ff 12%);
}

.opd-record-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.83rem;
  color: #1f4f86;
  background: linear-gradient(145deg, #edf5ff 0%, #daebff 100%);
  border: 1px solid #bfd8f9;
}

.opd-records-table tbody tr:nth-child(1) .opd-record-rank {
  color: #6f4a00;
  background: linear-gradient(145deg, #fff5dc 0%, #ffe8b5 100%);
  border-color: #f1cf84;
}

.opd-records-table tbody tr:nth-child(2) .opd-record-rank {
  color: #3c4f63;
  background: linear-gradient(145deg, #f5f8fc 0%, #e5edf7 100%);
  border-color: #cad7e8;
}

.opd-records-table tbody tr:nth-child(3) .opd-record-rank {
  color: #5f4b24;
  background: linear-gradient(145deg, #fff3e7 0%, #ffe0c2 100%);
  border-color: #efc99e;
}

.signature-thumb {
  max-height: 54px;
  max-width: 160px;
  object-fit: contain;
  border-radius: 0.5rem;
  border: 1px solid var(--sc-line);
  padding: 0.25rem;
  background: #fff;
}

.signatures-table tbody tr {
  transition: background-color 0.18s ease;
}

.signatures-table {
  --sig-col-rank-width: 70px;
  --sig-col-cid-width: 220px;
  --sig-sticky-separator: color-mix(in srgb, var(--sc-line) 82%, #d8e6f8 18%);
}

.signatures-table thead th:first-child,
.signatures-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bs-body-bg);
}

.signatures-table thead th:first-child {
  z-index: 2;
}

.signatures-table thead th:nth-child(2),
.signatures-table tbody td:nth-child(2) {
  position: sticky;
  left: var(--sig-col-rank-width);
  z-index: 1;
  background: var(--bs-body-bg);
}

.signatures-table thead th:nth-child(2) {
  z-index: 2;
}

.signatures-table thead th:nth-child(3),
.signatures-table tbody td:nth-child(3) {
  position: sticky;
  left: calc(var(--sig-col-rank-width) + var(--sig-col-cid-width));
  z-index: 1;
  background: var(--bs-body-bg);
  border-right: 1px solid var(--sig-sticky-separator);
}

.signatures-table thead th:nth-child(3) {
  z-index: 2;
}

.signatures-table thead th:nth-child(1),
.signatures-table thead th:nth-child(2),
.signatures-table thead th:nth-child(3),
.signatures-table tbody td:nth-child(1),
.signatures-table tbody td:nth-child(2),
.signatures-table tbody td:nth-child(3) {
  box-shadow: 1px 0 0 var(--sig-sticky-separator);
}

.signatures-table thead th:nth-child(3),
.signatures-table tbody td:nth-child(3) {
  box-shadow: 2px 0 8px rgba(31, 79, 134, 0.06);
}

@media (max-width: 992px) {
  .signatures-table thead th:nth-child(3),
  .signatures-table tbody td:nth-child(3) {
    position: static;
    left: auto;
    border-right: 0;
    box-shadow: none;
  }
}

.signatures-table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--bs-body-bg) 96%, #eef6ff 4%);
}

.signatures-table tbody tr:hover {
  background: color-mix(in srgb, var(--bs-body-bg) 88%, #e4f0ff 12%);
}

.signature-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.83rem;
  color: #1f4f86;
  background: linear-gradient(145deg, #edf5ff 0%, #daebff 100%);
  border: 1px solid #bfd8f9;
}

.signatures-table tbody tr:nth-child(1) .signature-rank {
  color: #6f4a00;
  background: linear-gradient(145deg, #fff5dc 0%, #ffe8b5 100%);
  border-color: #f1cf84;
}

.signatures-table tbody tr:nth-child(2) .signature-rank {
  color: #3c4f63;
  background: linear-gradient(145deg, #f5f8fc 0%, #e5edf7 100%);
  border-color: #cad7e8;
}

.signatures-table tbody tr:nth-child(3) .signature-rank {
  color: #5f4b24;
  background: linear-gradient(145deg, #fff3e7 0%, #ffe0c2 100%);
  border-color: #efc99e;
}

.signature-patient-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--sc-line);
  background: #fff;
  flex-shrink: 0;
}

.report-paper {
  max-width: 1100px;
  margin: 0 auto;
}

.report-results-table tbody tr {
  transition: background-color 0.18s ease;
}

.report-results-table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--bs-body-bg) 96%, #eef6ff 4%);
}

.report-results-table tbody tr:hover {
  background: color-mix(in srgb, var(--bs-body-bg) 88%, #e4f0ff 12%);
}

.report-results-table th:first-child,
.report-results-table td:first-child {
  width: 64px;
}

.report-row-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid #bfd8f9;
  background: linear-gradient(145deg, #edf5ff 0%, #daebff 100%);
  color: #1f4f86;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(57, 110, 169, 0.12);
}

.report-results-table tbody tr:nth-child(3n + 1) .report-row-rank {
  border-color: #f1cf84;
  background: linear-gradient(145deg, #fff5dc 0%, #ffe8b5 100%);
  color: #6f4a00;
}

.report-results-table tbody tr:nth-child(3n + 2) .report-row-rank {
  border-color: #b9dfcb;
  background: linear-gradient(145deg, #eefbf4 0%, #d9f2e5 100%);
  color: #24613f;
}

.report-signature-image {
  max-height: 90px;
  max-width: 340px;
  object-fit: contain;
}

.report-signature-placeholder {
  min-height: 72px;
  border: 1px dashed var(--sc-line);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bs-secondary-color);
}

.amed-report-sheet {
  position: relative;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 7mm 8mm 26mm;
  color: #111;
  font-size: 14px;
  line-height: 1.25;
}

.amed-report-header {
  position: relative;
  text-align: center;
  min-height: 36mm;
}

.amed-report-logo {
  width: 25mm;
  height: 21mm;
  object-fit: contain;
  display: block;
  margin: 0 auto 1mm;
}

.amed-service-box {
  position: absolute;
  right: 0;
  top: 0;
  border: 1px solid #444;
  padding: 2mm 4mm;
  font-weight: 700;
  background: var(--bs-body-bg);
}

.amed-patient-photo {
  position: absolute;
  right: -5mm;
  top: 15mm;
  width: 28mm;
  height: 35mm;
  object-fit: cover;
  border: 1px solid #444;
  background: #fff;
}

.amed-report-title {
  font-size: 18px;
  text-align: center;
  font-weight: 700;
  margin: 0 0 1mm;
}

.amed-clinic-line {
  line-height: 1.3;
}

.amed-visit-line,
.amed-patient-line {
  display: flex;
  justify-content: center;
  gap: 10mm;
  flex-wrap: wrap;
  margin-bottom: 1mm;
}

.amed-patient-line {
  justify-content: flex-start;
  gap: 6mm;
}

.amed-section {
  display: flex;
  gap: 6px;
  margin-bottom: 3px;
}

.amed-label {
  font-weight: 700;
  white-space: nowrap;
}

.amed-value {
  flex: 1;
}

.amed-heading {
  font-size: 14px;
  font-weight: 700;
  margin: 5px 0 2px;
}

.amed-block {
  min-height: 22px;
}

.amed-preline {
  white-space: pre-line;
}

.amed-child-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.amed-medicine-list {
  display: grid;
  gap: 2px;
  margin-bottom: 3px;
}

.amed-medicine-item {
  padding-left: 4mm;
  text-indent: -4mm;
}

.amed-medicine-name {
  font-weight: 700;
}

.amed-signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 8px;
  text-align: center;
}

.amed-signature-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.amed-signature-img,
.amed-signature-empty {
  width: 210px;
  height: 54px;
  object-fit: contain;
  margin: 0 auto 2px;
}

.amed-signature-empty {
  border-bottom: 1px dotted #555;
}

.amed-report-bottom {
  position: absolute;
  left: 8mm;
  right: 3mm;
  bottom: 7mm;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 18px;
}

.amed-revision-text {
  align-self: end;
  font-size: 12px;
}

.amed-auth-time {
  text-align: right;
  font-size: 13px;
}

.amed-barcode {
  grid-column: 2;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0;
}

.amed-barcode svg {
  display: block;
  max-width: 260px;
  height: 54px;
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body {
    background: #fff;
    margin: 0;
  }

  header,
  footer,
  .smartclinic-navbar {
    display: none !important;
  }

  .report-paper {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }

  .report-toolbar {
    display: none !important;
  }

  .report-print-area {
    box-shadow: none !important;
    border: 0 !important;
  }

  .amed-report-sheet {
    position: relative;
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    box-shadow: none !important;
    padding: 7mm 8mm 26mm;
    font-size: 13px;
  }
}

@media (max-width: 991.98px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-hero-status {
    width: 100%;
    min-width: 0;
  }

  .dashboard-activity-item {
    grid-template-columns: auto 1fr auto;
  }

  .dashboard-activity-diagnosis {
    grid-column: 2 / -1;
  }

  .smartclinic-navbar .navbar-collapse {
    margin-top: 0.8rem;
    padding: 0.8rem;
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--bs-dark) 24%, transparent);
  }

  .smartclinic-navbar .nav-link {
    border-radius: 0.65rem;
  }

  .nav-tool,
  .nav-account {
    align-items: stretch !important;
    flex-wrap: wrap;
    padding-left: 0;
  }

  .opd-page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .opd-status-panel {
    width: 100%;
  }

  .opd-step-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .dashboard-hero {
    padding: 1.5rem;
  }

  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-gender-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: left;
  }

  .dashboard-legend {
    width: 100%;
  }

  .dashboard-bar-chart {
    gap: 0.35rem;
    overflow-x: auto;
  }

  .dashboard-activity-item {
    gap: 0.65rem;
  }

  .dashboard-activity-item time {
    display: none;
  }

  .opd-step-strip {
    grid-template-columns: 1fr;
  }

  .opd-action-bar .btn {
    flex: 1 1 100%;
  }
}

/* SmartClinic unified experience layer */
:root {
  --sc-canvas: color-mix(in srgb, var(--bs-body-bg) 92%, #eaf3fb 8%);
  --sc-radius: 1rem;
  --sc-radius-sm: 0.7rem;
  --sc-shadow: 0 16px 38px rgba(15, 43, 70, 0.09);
  --sc-shadow-sm: 0 7px 20px rgba(15, 43, 70, 0.065);
}

body.app-body {
  display: flex;
  min-height: 100vh;
  margin-bottom: 0;
  flex-direction: column;
  background:
    radial-gradient(circle at 10% 0%, rgba(var(--sc-rgb-primary), 0.1), transparent 25rem),
    radial-gradient(circle at 90% 8%, rgba(var(--sc-rgb-info), 0.08), transparent 22rem),
    var(--sc-canvas);
}

.app-body > header,
.app-body > .app-shell,
.app-body > .app-footer {
  width: 100%;
}

.app-shell {
  flex: 1 0 auto;
}

.app-main {
  animation: app-content-in 0.28s ease-out both;
}

@keyframes app-content-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1100;
  padding: 0.55rem 0.8rem;
  border-radius: 0.5rem;
  color: #fff;
  background: #153b62;
  transform: translateY(-150%);
}

.skip-link:focus {
  color: #fff;
  transform: translateY(0);
}

.smartclinic-navbar {
  min-height: 4.25rem;
  margin-bottom: 1.5rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  background:
    radial-gradient(circle at 82% -80%, rgba(110, 196, 255, 0.32), transparent 34%),
    linear-gradient(105deg, #243d58 0%, #285f98 56%, #2879c5 100%);
  box-shadow: 0 8px 24px rgba(18, 48, 78, 0.14);
}

.smartclinic-brand {
  min-width: max-content;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.7rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.1));
}

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 1rem;
}

.brand-copy small {
  margin-top: 0.25rem;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.smartclinic-navbar .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.5rem 0.62rem;
  font-size: 0.82rem;
}

.smartclinic-navbar .nav-link::before {
  content: attr(data-nav-icon);
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.45rem;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.52rem;
  font-weight: 800;
}

.smartclinic-navbar .nav-link.active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.theme-label {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.68rem;
  font-weight: 700;
}

.theme-select {
  min-width: 112px;
  color: #163d63;
  background-color: rgba(255, 255, 255, 0.94);
}

.user-chip {
  gap: 0.4rem;
  padding: 0.25rem 0.65rem 0.25rem 0.28rem;
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #3d8bd7, #235f9c);
  font-size: 0.68rem;
}

.card {
  border-radius: var(--sc-radius);
  box-shadow: var(--sc-shadow-sm) !important;
}

.card > .card-header {
  padding: 0.9rem 1.15rem;
  border-bottom-color: var(--sc-line);
  background: color-mix(in srgb, var(--bs-body-bg) 92%, var(--bs-primary) 8%);
  font-weight: 800;
}

.form-control,
.form-select {
  min-height: 2.65rem;
  border-radius: var(--sc-radius-sm);
  background-color: color-mix(in srgb, var(--bs-body-bg) 96%, white 4%);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.form-control:focus,
.form-select:focus {
  background-color: var(--bs-body-bg);
}

.form-control::placeholder {
  color: color-mix(in srgb, var(--bs-secondary-color) 72%, transparent);
}

.input-group > .form-control:first-child,
.input-group > .form-select:first-child {
  border-radius: var(--sc-radius-sm) 0 0 var(--sc-radius-sm);
}

.btn {
  min-height: 2.35rem;
  border-radius: 0.65rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  box-shadow: 0 5px 13px rgba(var(--sc-rgb-primary), 0.16);
}

.table {
  margin-bottom: 0;
}

.table thead th {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--sc-line) 80%, var(--bs-primary) 20%);
}

.table tbody td {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.table tbody tr {
  transition: background-color 0.16s ease;
}

.table tbody tr:hover {
  background: color-mix(in srgb, var(--bs-body-bg) 91%, var(--bs-primary) 9%);
}

.table-responsive {
  scrollbar-color: color-mix(in srgb, var(--bs-secondary-color) 45%, transparent) transparent;
  scrollbar-width: thin;
}

.pagination {
  gap: 0.2rem;
}

.pagination .page-link {
  min-width: 2rem;
  border-radius: 0.5rem !important;
  text-align: center;
}

.alert {
  border: 0;
  border-left: 4px solid currentColor;
  border-radius: 0.75rem;
  box-shadow: var(--sc-shadow-sm);
}

.validation-summary-errors {
  padding: 0.8rem 0.9rem;
  border-left: 4px solid var(--bs-danger);
  border-radius: 0.65rem;
  color: var(--bs-danger-text-emphasis);
  background: var(--bs-danger-bg-subtle);
  font-size: 0.82rem;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

.field-validation-error {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.75rem;
}

.modal-content {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 24px 70px rgba(14, 35, 57, 0.24);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: 1.1rem !important;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -5rem;
  bottom: -8rem;
  width: 24rem;
  height: 24rem;
  border: 3.5rem solid rgba(255, 255, 255, 0.045);
  border-radius: 50%;
  pointer-events: none;
}

.hero-panel .row {
  position: relative;
  z-index: 1;
}

.hero-panel .display-5 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 800 !important;
}

.hero-symbol,
.download-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
}

.hero-symbol svg,
.download-hero-icon svg {
  width: 1.55rem;
  height: 1.55rem;
  fill: currentColor;
}

.download-hero-icon {
  color: var(--bs-primary);
  border-color: rgba(var(--sc-rgb-primary), 0.18);
  background: rgba(var(--sc-rgb-primary), 0.09);
}

.hero-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.hero-mini-stats span {
  min-width: 0;
  padding: 0.7rem 0.45rem;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  text-align: center;
}

.hero-mini-stats strong,
.hero-mini-stats small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-mini-stats strong {
  color: #fff;
  font-size: 1.05rem;
}

.hero-mini-stats small {
  margin-top: 0.15rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.64rem;
}

.opd-page-header {
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius);
  background: color-mix(in srgb, var(--bs-body-bg) 92%, var(--bs-primary) 8%);
  box-shadow: var(--sc-shadow-sm);
}

.list-group-item {
  background: transparent;
}

.app-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--sc-line);
  background: color-mix(in srgb, var(--bs-body-bg) 86%, transparent);
  backdrop-filter: blur(12px);
}

.footer-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.5rem;
  color: #fff;
  background: linear-gradient(145deg, #356fa8, #244e76);
  font-size: 0.62rem;
  font-weight: 800;
}

.footer-status-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: #35b979;
  box-shadow: 0 0 0 0.2rem rgba(53, 185, 121, 0.11);
}

.auth-shell {
  min-height: calc(100vh - 12rem);
  align-items: center;
  padding-bottom: 2rem;
}

.auth-card {
  position: relative;
  overflow: visible;
  border-top: 4px solid var(--sc-primary) !important;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: -6rem;
  right: -5rem;
  z-index: -1;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  background: rgba(var(--sc-rgb-primary), 0.08);
  filter: blur(2px);
}

.auth-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  border-radius: 0.9rem;
  color: #fff;
  background: linear-gradient(145deg, #337fc8, #214f7d);
  box-shadow: 0 8px 20px rgba(33, 79, 125, 0.2);
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-security-note {
  margin-top: 1.25rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.7rem;
  color: var(--bs-secondary-color);
  background: color-mix(in srgb, var(--bs-body-bg) 90%, var(--bs-info) 10%);
  font-size: 0.75rem;
  text-align: center;
}

.content-intro-card {
  border-left: 5px solid var(--sc-primary) !important;
  background:
    radial-gradient(circle at 95% 0%, rgba(var(--sc-rgb-info), 0.13), transparent 30%),
    var(--sc-panel);
}

.content-page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius);
  background: var(--sc-panel);
  box-shadow: var(--sc-shadow-sm);
}

.content-page-header h1 {
  margin: 0.1rem 0;
  font-size: 1.55rem;
  font-weight: 800;
}

.content-page-header p {
  margin: 0;
  color: var(--bs-secondary-color);
}

.content-page-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  flex-shrink: 0;
  border-radius: 1rem;
  color: #fff;
  background: linear-gradient(145deg, #3e91dc, #2668a7);
  font-size: 0.72rem;
  font-weight: 800;
}

.content-page-kicker {
  color: var(--bs-primary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.privacy-status-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(53, 185, 121, 0.14), transparent 42%),
    var(--sc-panel);
}

.privacy-shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  border-radius: 50% 50% 45% 45%;
  color: #fff;
  background: #35a96f;
  box-shadow: 0 8px 18px rgba(53, 169, 111, 0.2);
  font-weight: 800;
}

.privacy-checklist {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.privacy-checklist li {
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--bs-body-bg) 90%, #dff6e9 10%);
  font-size: 0.83rem;
}

.system-state-page {
  max-width: 620px;
  margin: 8vh auto;
  padding: 2.5rem;
  border: 1px solid var(--sc-line);
  border-radius: 1.2rem;
  background: var(--sc-panel);
  box-shadow: var(--sc-shadow);
  text-align: center;
}

.system-state-icon {
  display: grid;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  place-items: center;
  border-radius: 50%;
  color: #b94747;
  background: #ffe8e8;
  font-size: 1.8rem;
  font-weight: 800;
}

.system-state-page h1 {
  margin: 0.3rem 0 0.6rem;
  font-size: 1.7rem;
  font-weight: 800;
}

.system-state-page p {
  color: var(--bs-secondary-color);
}

.system-request-id {
  margin: 1rem 0;
  padding: 0.7rem;
  border-radius: 0.6rem;
  background: var(--bs-tertiary-bg);
  font-size: 0.75rem;
}

.controller-clinics .card,
.controller-nhssomasters .card,
.controller-clinicusers .card,
.controller-downloads .card {
  border-color: color-mix(in srgb, var(--sc-line) 78%, var(--bs-primary) 22%) !important;
}

.controller-patients .recent-patient-avatar,
.controller-patientmedicalprofiles .opd-recent-rank,
.controller-medicalrecords .opd-record-rank,
.controller-signatures .signature-rank {
  box-shadow: 0 3px 10px rgba(34, 83, 130, 0.12);
}

@media (min-width: 1200px) and (max-width: 1540px) {
  .smartclinic-navbar .nav-link {
    padding-right: 0.48rem;
    padding-left: 0.48rem;
    font-size: 0.76rem;
  }

  .theme-label {
    display: none;
  }
}

@media (max-width: 1199.98px) {
  .smartclinic-navbar .nav-link {
    display: flex;
    width: 100%;
    border-radius: 0.65rem;
  }

  .smartclinic-navbar .nav-link::before {
    display: inline-flex;
  }
}

@media (max-width: 575.98px) {
  .app-shell {
    padding-right: 0.75rem !important;
    padding-left: 0.75rem !important;
  }

  .card-body.p-4,
  .card-body.p-lg-4 {
    padding: 1rem !important;
  }

  .hero-panel {
    padding: 1.35rem !important;
  }

  .opd-page-header {
    padding: 1rem;
  }
}

/* Balanced page-title scale */
.dashboard-hero {
  min-height: auto;
  padding: 1.45rem 1.8rem;
}

.dashboard-hero h1 {
  max-width: 980px;
  margin-bottom: 0.25rem;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.dashboard-hero p {
  font-size: 0.84rem;
}

.dashboard-eyebrow {
  margin-bottom: 0.45rem;
  font-size: 0.65rem;
}

.dashboard-hero-status {
  min-width: 270px;
  padding: 0.75rem 0.9rem;
}

.hero-panel {
  padding: 1.5rem 1.75rem !important;
}

.hero-panel .display-5 {
  margin-bottom: 0.45rem !important;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.012em;
}

.hero-panel .lead {
  max-width: 780px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.hero-symbol {
  width: 2.55rem;
  height: 2.55rem;
  margin-bottom: 0.65rem !important;
}

.hero-symbol svg {
  width: 1.3rem;
  height: 1.3rem;
}

.opd-page-header h1 {
  margin-bottom: 0.2rem !important;
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  line-height: 1.25;
  font-weight: 800 !important;
}

.opd-page-header > div:first-child > .text-body-secondary:last-child {
  font-size: 0.82rem;
}

.content-page-header h1,
.system-state-page h1,
.auth-card h1,
.controller-patients .app-main > .d-flex h1,
.controller-clinics .card h1,
.controller-nhssomasters .card h1,
.controller-downloads .content-intro-card h1 {
  font-size: clamp(1.35rem, 1.8vw, 1.65rem) !important;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.controller-patients .app-main > .d-flex:first-of-type {
  padding: 1rem 1.15rem;
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius);
  background: var(--sc-panel);
  box-shadow: var(--sc-shadow-sm);
}

@media (max-width: 575.98px) {
  .dashboard-hero,
  .hero-panel {
    padding: 1.15rem !important;
  }

  .dashboard-hero h1,
  .hero-panel .display-5 {
    font-size: 1.4rem;
  }

  .dashboard-hero-status {
    padding: 0.7rem 0.8rem;
  }
}
