/* HMS Login — fixed viewport, centered, healthcare theme */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body.login-page {
  overflow: hidden;
}

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  height: 100vh;
  padding: 1rem;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
  background: linear-gradient(145deg, #0e7490 0%, #0891b2 35%, #1d4ed8 100%);
  position: relative;
}

/* Soft background shapes */
.login-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.login-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
}

.login-bg__orb--1 {
  width: 420px;
  height: 420px;
  background: #5eead4;
  top: -120px;
  right: -80px;
}

.login-bg__orb--2 {
  width: 360px;
  height: 360px;
  background: #93c5fd;
  bottom: -100px;
  left: -60px;
}

.login-bg__cross {
  position: absolute;
  width: 280px;
  height: 280px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.06;
}

.login-bg__cross::before,
.login-bg__cross::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 8px;
}

.login-bg__cross::before {
  width: 72px;
  height: 280px;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.login-bg__cross::after {
  width: 280px;
  height: 72px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.form-signin.login-card {
  width: 100%;
  max-width: 400px;
  margin: 0;
  padding: 2rem 1.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 25px 50px -12px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(12px);
  animation: loginCardIn 0.55s ease-out;
}

@keyframes loginCardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-brand__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0e7490;
  background: #ecfeff;
  border-radius: 999px;
}

.login-brand__badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.login-brand img {
  display: block;
  margin: 0 auto 1rem;
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(14, 116, 144, 0.2));
}

.login-brand__title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
}

.login-brand__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.4;
}

.login-field {
  margin-bottom: 0.85rem;
  text-align: left;
}

.login-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

.form-signin .form-control {
  position: relative;
  width: 100%;
  height: auto;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #0f172a;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 0.65rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-signin .form-control::placeholder {
  color: #94a3b8;
}

.form-signin .form-control:focus {
  z-index: 2;
  outline: none;
  background: #fff;
  border-color: #0891b2;
  box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.15);
}

.form-signin input[type="text"],
.form-signin input[type="password"] {
  margin-bottom: 0;
  border-radius: 0.65rem;
}

.login-divider {
  height: 1px;
  margin: 1.25rem 0 1rem;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
  border: 0;
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #0d9488 0%, #0891b2 50%, #0284c7 100%);
  border: none;
  border-radius: 0.65rem;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.4);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
  color: #fff;
}

.btn-login:active {
  transform: translateY(0);
}

.login-footer {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.login-footer a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  transition: border-color 0.2s;
}

.login-footer a:hover {
  border-bottom-color: #fff;
  color: #fff;
  text-decoration: none;
}

/* Legacy: keep generic form rule from old file for any other use */
form:not(.login-card) {
  box-shadow: 2px 3px 10px 3px lightgreen;
  border-radius: 0.5rem;
  background-color: white;
}

@media (max-height: 620px) {
  .login-brand img {
    width: 72px;
    height: 72px;
    margin-bottom: 0.65rem;
  }

  .form-signin.login-card {
    padding: 1.25rem 1.25rem 1rem;
  }

  .login-brand {
    margin-bottom: 1rem;
  }

  .login-brand__title {
    font-size: 1.15rem;
  }
}

/* ─── Home dashboard (matches login theme) ─── */

body.home-page {
  min-height: auto;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
  background: linear-gradient(145deg, #0e7490 0%, #0891b2 35%, #1d4ed8 100%);
  overflow-x: hidden;
}

body.home-page .app-navbar,
body.form-page .app-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.app-navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  position: relative;
}

.app-navbar__brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}

.app-navbar__brand:hover {
  color: #fff;
  text-decoration: none;
}

.app-navbar__name {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-navbar__meta {
  font-size: 0.72rem;
  opacity: 0.88;
}

.app-navbar__check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.app-navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.45rem;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.app-navbar__hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.app-navbar__menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.app-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.app-nav-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.app-nav-btn--logout {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(252, 165, 165, 0.45);
}

.app-navbar__lang {
  display: inline-flex;
  align-items: center;
}

.app-navbar__lang-select {
  appearance: none;
  padding: 0.45rem 1.75rem 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 0.55rem center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
  max-width: 8.5rem;
}

.app-navbar__lang-select:hover,
.app-navbar__lang-select:focus {
  background-color: rgba(255, 255, 255, 0.26);
  outline: none;
}

.app-navbar__lang-select option {
  color: #111827;
  background: #fff;
}

.home-shell {
  position: relative;
  z-index: 1;
  padding: 1.25rem 0 2rem;
  max-width: 1120px;
  margin: 0 auto;
}

.home-hero {
  padding: 0 1rem 1.5rem;
  color: #fff;
}

.home-hero__banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.15rem 1.35rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
}

.home-hero__logo {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 0.85rem;
  padding: 0.45rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.home-hero__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-hero__body {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.home-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  margin-bottom: 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #ecfeff;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.home-hero h1 {
  margin: 0 0 0.45rem;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.home-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.88rem;
}

.home-hero__chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0e7490;
  background: #ecfeff;
  border-radius: 999px;
}

.home-hero__shift {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

.home-section {
  padding: 0 1rem;
}

.home-section__head {
  margin-bottom: 1rem;
  text-align: center;
  color: #fff;
}

.home-section__head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.home-section__head p {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.88;
}

.home-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.dash-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  padding: 1.35rem 1.25rem 1.25rem;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px -6px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  flex: 1 1 250px;
  max-width: 320px;
  animation: loginCardIn 0.45s ease-out backwards;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 4px 8px rgba(15, 23, 42, 0.06),
    0 16px 36px -8px rgba(15, 23, 42, 0.22);
}

.dash-card:nth-child(1) { animation-delay: 0.05s; }
.dash-card:nth-child(2) { animation-delay: 0.1s; }
.dash-card:nth-child(3) { animation-delay: 0.15s; }
.dash-card:nth-child(4) { animation-delay: 0.2s; }
.dash-card:nth-child(5) { animation-delay: 0.25s; }

.dash-card--wide {
  flex: 1 1 100%;
  max-width: 660px;
}

@media (min-width: 768px) {
  .dash-card--wide {
    flex: 1 1 calc(50% - 0.5rem);
    max-width: 660px;
  }
}

.dash-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  font-size: 1.35rem;
  line-height: 1;
  background: linear-gradient(145deg, #ecfeff 0%, #cffafe 100%);
  border-radius: 0.7rem;
  color: #0e7490;
  border: 1px solid rgba(8, 145, 178, 0.12);
}

.dash-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.dash-card__desc {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
  flex-grow: 1;
}

.dash-card .form-control {
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 0.55rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dash-card .form-control:focus {
  outline: none;
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
  background: #fff;
}

.dash-card label.dash-field-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}

.dash-card .btn-action,
.dash-card .btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #0d9488 0%, #0891b2 50%, #0284c7 100%);
  border: none;
  border-radius: 0.55rem;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.dash-card .btn-action:hover,
.dash-card .btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.42);
  color: #fff;
  text-decoration: none;
}

.dash-card form {
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  margin: 0;
}

.dash-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 575px) {
  .dash-form-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Form pages (patient registration, etc.) ─── */

body.form-page {
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  display: block;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
  background: linear-gradient(145deg, #0e7490 0%, #0891b2 35%, #1d4ed8 100%);
  position: relative;
}

body.form-page .navbar.navbar-cls-top {
  margin-bottom: 0;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.report-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.report-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.report-row--head {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.55rem;
}

.report-row--total {
  border-bottom: none;
  padding-top: 0.65rem;
  font-weight: 700;
}

.report-row__label {
  font-size: 0.88rem;
  color: #334155;
}

.report-row__values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.report-row--head .report-row__values {
  text-align: center;
}

.form-page-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1.75rem 1.5rem 0;
  box-sizing: border-box;
}

/* Guaranteed breathing room below the card (always in document flow) */
.form-page-shell::after {
  content: "";
  display: block;
  width: 100%;
  height: 4.5rem;
}

/* Unified panel: header + form in one card */
.patient-panel {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 24px 48px -12px rgba(15, 23, 42, 0.28);
  animation: loginCardIn 0.45s ease-out;
}

.patient-panel__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.5rem;
  background: linear-gradient(135deg, #0d9488 0%, #0891b2 45%, #2563eb 100%);
  color: #fff;
}

.patient-panel__header img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 0.65rem;
  padding: 0.35rem;
}

.patient-panel__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  margin-bottom: 0.3rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #ecfeff;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.patient-panel__header h1 {
  margin: 0 0 0.2rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
}

.patient-panel__header p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.92;
  line-height: 1.35;
}

.patient-panel__body {
  padding: 1.35rem 1.5rem 1.6rem;
}

.patient-panel__body form {
  margin: 0;
  box-shadow: none;
  background: transparent;
}

.patient-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem 1.15rem;
}

.patient-form-grid--search {
  grid-template-columns: 1fr 1fr;
  max-width: 560px;
  margin: 0 auto;
}

.patient-form-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.patient-panel--search {
  max-width: 680px;
}

.patient-panel--search .patient-panel__body {
  padding: 1.5rem 1.75rem 1.5rem;
}

.patient-panel--lab {
  max-width: 1060px;
}

.lab-test-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem 1.25rem;
}

.lab-test-item {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 0.45rem 0.65rem;
  align-items: end;
}

.lab-test-item__label {
  grid-column: 1 / -1;
  margin: 0 0 0.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.lab-test-fees {
  text-align: right;
}

.lab-totals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 640px;
  margin: 0 auto;
}

.diagnose-test-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem 1.25rem;
}

.diagnose-test-item {
  display: grid;
  grid-template-columns: 1fr 1.35fr 88px;
  gap: 0.45rem 0.65rem;
  align-items: end;
}

.diagnose-test-item__label {
  grid-column: 1 / -1;
  margin: 0 0 0.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.other-service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem 1.25rem;
}

.other-service-item {
  display: grid;
  grid-template-columns: 1fr 88px 88px;
  gap: 0.45rem 0.65rem;
  align-items: end;
}

.other-service-item__label {
  grid-column: 1 / -1;
  margin: 0 0 0.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.other-service-qty,
.lab-test-fees {
  text-align: right;
}

.lab-totals-grid--4 {
  grid-template-columns: repeat(4, 1fr);
  max-width: 900px;
}

.patient-form-grid--report {
  grid-template-columns: repeat(2, 1fr);
  max-width: 640px;
  margin: 0 auto;
}

@media (max-width: 991px) {
  .diagnose-test-grid,
  .other-service-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .lab-test-grid {
    grid-template-columns: 1fr;
  }

  .lab-totals-grid,
  .lab-totals-grid--4 {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

.form-field {
  text-align: left;
}

.form-page .form-field label {
  display: block;
  margin: 0 0 0.4rem !important;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.3;
}

.form-field .text-muted {
  font-weight: 400;
  color: #94a3b8 !important;
  font-size: 0.75rem;
}

.patient-panel .form-control {
  display: block;
  width: 100%;
  height: 2.8rem;
  padding: 0 0.9rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #0f172a;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.patient-panel select.form-control {
  padding-right: 2rem;
  -webkit-appearance: menulist;
  appearance: auto;
  cursor: pointer;
}

.patient-panel .form-control:focus {
  outline: none;
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
  background: #fff;
}

.patient-panel .form-control[readonly] {
  background: #f1f5f9;
  color: #475569;
  cursor: default;
}

.patient-panel .form-control[readonly]:focus {
  border-color: #e2e8f0;
  box-shadow: none;
  background: #f1f5f9;
}

.patient-form-section {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0;
  padding-bottom: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0e7490;
  border-bottom: 1px solid #e2e8f0;
}

.patient-form-section--spaced {
  margin-top: 0.35rem;
}

.patient-form-footer {
  margin-top: 1.15rem;
  padding-top: 1.1rem;
  padding-bottom: 0.15rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.patient-panel .btn-action,
a.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 0.7rem 2.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #0d9488 0%, #0891b2 50%, #0284c7 100%);
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
}

.patient-panel .btn-action:hover,
a.btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.42);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 767px) {
  .form-page-shell {
    padding: 1.25rem 1rem 0;
  }

  .form-page-shell::after {
    height: 3.5rem;
  }

  .patient-form-grid,
  .patient-form-grid--search,
  .patient-form-grid--4 {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .patient-form-grid {
    grid-template-columns: 1fr;
  }

  .patient-panel__header {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }

  .patient-panel__header h1 {
    font-size: 1.05rem;
  }

  .patient-panel .btn-action {
    width: 100%;
    min-width: 0;
  }

  .home-hero h1 {
    font-size: 1.15rem;
  }

  .home-section__head h2 {
    font-size: 0.95rem;
  }

  .dash-card {
    flex: 1 1 100%;
    max-width: none;
  }
}

/* ─── Responsive navigation ─── */

@media (max-width: 767px) {
  .app-navbar__hamburger {
    display: flex;
    flex-shrink: 0;
  }

  .app-navbar__menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 1rem;
    left: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding: 0.65rem;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  }

  .app-navbar__check:checked ~ .app-navbar__menu {
    display: flex;
  }

  .app-navbar__check:checked + .app-navbar__hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .app-navbar__check:checked + .app-navbar__hamburger span:nth-child(2) {
    opacity: 0;
  }

  .app-navbar__check:checked + .app-navbar__hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .app-nav-btn {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1rem;
  }
}

/* ─── Responsive home dashboard ─── */

@media (max-width: 767px) {
  .home-shell {
    padding-bottom: 1.5rem;
  }

  .home-hero {
    padding: 0 0.75rem 1.15rem;
  }

  .home-hero__banner {
    flex-direction: column;
    text-align: center;
    padding: 1.1rem 1rem;
  }

  .home-hero__body {
    text-align: center;
  }

  .home-hero__meta {
    justify-content: center;
  }

  .home-hero h1 {
    font-size: 1.3rem;
  }

  .home-hero__logo {
    width: 64px;
    height: 64px;
  }

  .home-section {
    padding: 0 0.75rem;
  }

  .home-grid {
    gap: 0.85rem;
  }

  .dash-card {
    flex: 1 1 100%;
    max-width: none;
  }
}

/* ─── Responsive form / lab grids ─── */

@media (max-width: 991px) {
  .patient-form-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .lab-totals-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .lab-test-item,
  .diagnose-test-item,
  .other-service-item {
    grid-template-columns: 1fr;
  }

  .form-split {
    grid-template-columns: 1fr;
  }

  .report-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .report-row__values {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767px) {
  .patient-panel--lab,
  .patient-panel--search,
  .patient-panel {
    border-radius: 0.85rem;
  }

  .patient-panel__body {
    padding: 1.1rem 1rem 1.25rem;
  }

  .patient-panel--search .patient-panel__body {
    padding: 1.25rem 1rem;
  }
}

/* ─── Login mobile scroll ─── */

@media (max-width: 480px), (max-height: 700px) {
  body.login-page {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
    align-items: flex-start;
    padding: 1rem 0.75rem 1.5rem;
  }

  .login-wrapper {
    padding-top: 0.5rem;
  }
}

/* Global mobile overflow */
html {
  -webkit-text-size-adjust: 100%;
}

body.home-page,
body.form-page {
  overflow-x: hidden;
}

@media (max-width: 480px) {
  .patient-form-grid--4,
  .lab-totals-grid--4 {
    grid-template-columns: 1fr;
  }

  .app-navbar__inner {
    padding: 0.65rem 0.85rem;
  }
}

/* Token queue list */
.form-page-shell--wide {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.patient-panel--token-list {
  max-width: none;
  width: 100%;
}

.token-list-toolbar {
  margin-bottom: 1rem;
}

.token-list-toolbar .btn-action {
  min-width: 0;
  padding: 0.5rem 1.15rem;
  font-size: 0.875rem;
  gap: 0.4rem;
}

.token-list-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 1.15rem;
  align-items: end;
}

.token-list-filters .form-field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.token-list-filters .form-control {
  height: 2.15rem;
  font-size: 0.875rem;
  padding: 0.35rem 0.6rem;
}

.token-list-filters__submit .btn {
  width: 100%;
  height: 2.15rem;
}

.token-list-table {
  width: 100%;
  margin-bottom: 0;
  font-size: 0.875rem;
}

.token-list-table > thead > tr > th,
.token-list-table > tbody > tr > td {
  /* padding: 0.55rem 0.65rem; */
  vertical-align: middle;
}

.token-list-table > thead > tr > th {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
  border-bottom-width: 1px;
}

.token-col-collect {
  min-width: 11.5rem;
  width: 12.5rem;
}

.token-col-actions {
  width: 9.5rem;
  text-align: center;
}



select.form-control:not([size]):not([multiple]) {
  height: calc(2.25rem + 10px);
}

.token-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
}

.token-pill--paid {
  background: #ecfdf5;
  color: #047857;
}

.token-pill--unpaid {
  background: #fff7ed;
  color: #c2410c;
}

.token-pill--no_show {
  background: #fef3c7;
  color: #c2410c;
}


.token-pill--cancelled {
  background: #fee2e2;
  color: #991b1b;
}



.token-pill--converted {
  background: #ecfdf5;
  color: #047857;
}

.token-collect-form {
  display: block;
  margin: 0;
  max-width: 10.5rem;
}

.token-collect-group {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch;
  width: 100%;
}

.token-collect-group > .form-control {
  display: block;
  width: auto !important;
  flex: 1 1 auto;
  min-width: 0;
  height: 2rem !important;
  padding: 0.2rem 0.45rem !important;
  font-size: 0.8125rem !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.token-collect-group > .input-group-append {
  display: flex;
  margin-left: -1px;
}

.token-collect-group .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.token-collect-group .btn i.fa {
  font-size: 0.95rem;
}

.token-collect-done {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #047857;
}

.token-action-btns {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
}

.token-action-btns form {
  display: inline-flex;
  margin: 0;
}

.token-action-btns .btn {
  min-width: 2.15rem;
  padding: 0.25rem 0.45rem;
  line-height: 1.2;
}

.token-action-btns .btn i.fa {
  font-size: 0.95rem;
  line-height: 1;
}

.token-opd-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35em 0.55em;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: middle;
}

.token-opd-badge:hover,
.token-opd-badge:focus {
  color: #fff;
  text-decoration: none;
  opacity: 0.92;
}

.token-opd-badge .fa {
  font-size: 0.85rem;
}

@media (max-width: 991px) {
  .token-list-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .token-list-filters {
    grid-template-columns: 1fr;
  }
}

/* Staff record list (expense list, etc.) */
.staff-record-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.staff-record-filter {
  flex: 1 1 220px;
  max-width: 360px;
}

.staff-record-total {
  font-size: 0.95rem;
  color: #334155;
}

.staff-record-row-hidden {
  display: none !important;
}

.staff-record-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

.staff-record-pagination__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.staff-record-pagination__size {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-weight: normal;
}

.staff-record-pagination__pages {
  display: inline-flex;
  gap: 0.25rem;
}

.staff-record-pagination__pages .btn {
  min-width: 2rem;
}

[dir="rtl"] .app-navbar__inner,
[dir="rtl"] .home-hero__body,
[dir="rtl"] .home-section__head,
[dir="rtl"] .patient-panel__header,
[dir="rtl"] .patient-form-grid,
[dir="rtl"] .dash-card {
  text-align: right;
}

[dir="rtl"] .app-navbar__menu {
  direction: rtl;
}

[dir="rtl"] .app-navbar__lang-select {
  padding: 0.45rem 0.75rem 0.45rem 1.75rem;
  background-position: left 0.55rem center;
}

[dir="rtl"] .patient-form-footer,
[dir="rtl"] .home-hero__meta {
  direction: rtl;
}

[dir="rtl"] .form-field label {
  text-align: right;
  display: block;
}
