:root {
  --font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --primary-soft: #f1f5f9;
  --accent: #0f766e;
  --lime: #c2f13c;
  --sidebar-width: 17.5rem;
  --radius: 1rem;
  --radius-sm: 0.65rem;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 40px -8px rgba(15, 23, 42, 0.1);
}

* {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html {
  color-scheme: light;
}

/* Readable fields (never inherit light text) */
input:not([type='checkbox']):not([type='radio']):not([type='range']),
select,
textarea,
.field {
  color: #0f172a !important;
  background-color: #ffffff !important;
  -webkit-text-fill-color: #0f172a;
}

select option {
  color: #0f172a;
  background: #ffffff;
}

/* Hint / helping / placeholder text inside all fields (always grey, never full black) */
input::placeholder,
textarea::placeholder,
.field::placeholder,
select::placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  opacity: 1 !important;
  font-weight: 400 !important;
  font-style: normal !important;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
.field::-webkit-input-placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  opacity: 1 !important;
  font-weight: 400 !important;
  font-style: normal !important;
}

input::-moz-placeholder,
textarea::-moz-placeholder,
.field::-moz-placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
  font-weight: 400 !important;
  font-style: normal !important;
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder,
.field:-ms-input-placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
  font-weight: 400 !important;
  font-style: normal !important;
}

/* Soft grey when focused */
input:focus::placeholder,
textarea:focus::placeholder,
.field:focus::placeholder {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  opacity: 0.8 !important;
}

input:focus::-webkit-input-placeholder,
textarea:focus::-webkit-input-placeholder,
.field:focus::-webkit-input-placeholder {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  opacity: 0.8 !important;
}

.app-body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 100% -20%, rgba(13, 148, 136, 0.07), transparent 50%),
    radial-gradient(ellipse 80% 60% at 0% 100%, rgba(2, 132, 199, 0.05), transparent 45%);
}

/* ——— Login ——— */
.login-page {
  min-height: 100vh;
  display: grid;
}

@media (min-width: 1024px) {
  .login-page {
    grid-template-columns: 1.05fr 1fr;
  }
}

.login-brand {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 3rem;
  background: linear-gradient(155deg, #0c1322 0%, #0f172a 45%, #1e293b 100%);
  color: #ffffff;
}

@media (min-width: 1024px) {
  .login-brand {
    display: flex;
  }
}

.login-brand__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.login-brand__mark {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-sm);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.login-brand h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-brand__tagline {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  opacity: 0.9;
  max-width: 22rem;
  line-height: 1.55;
}

.login-brand__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.login-brand__features li {
  display: flex;
  gap: 0.65rem;
  font-size: 0.875rem;
  line-height: 1.45;
  opacity: 0.95;
}

.login-brand__features li::before {
  display: none;
}

.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.login-card__head {
  padding: 1.75rem 1.75rem 0;
}

.login-card__head h2 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.login-card__head p {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.login-card form {
  padding: 1.5rem 1.75rem 1.75rem;
}

.login-mobile-title {
  display: block;
  text-align: center;
  margin-bottom: 1.25rem;
}

@media (min-width: 1024px) {
  .login-mobile-title {
    display: none;
  }
}

.alert-error {
  margin: 0 1.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.875rem;
}

.alert-success {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 0.875rem;
}

/* ——— Custom Modern Scrollbars ——— */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

/* Dark Sidebar Ultra-Sleek Scrollbar */
.app-sidebar,
.app-sidebar nav,
.app-sidebar * {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.app-sidebar::-webkit-scrollbar,
.app-sidebar nav::-webkit-scrollbar,
.app-sidebar *::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.app-sidebar::-webkit-scrollbar-track,
.app-sidebar nav::-webkit-scrollbar-track,
.app-sidebar *::-webkit-scrollbar-track {
  background: transparent;
}

.app-sidebar::-webkit-scrollbar-thumb,
.app-sidebar nav::-webkit-scrollbar-thumb,
.app-sidebar *::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
}

.app-sidebar::-webkit-scrollbar-thumb:hover,
.app-sidebar nav::-webkit-scrollbar-thumb:hover,
.app-sidebar *::-webkit-scrollbar-thumb:hover {
  background: #c2f13c;
  box-shadow: 0 0 10px rgba(194, 241, 60, 0.6);
}

.app-sidebar::-webkit-scrollbar-button,
.app-sidebar nav::-webkit-scrollbar-button,
.app-sidebar *::-webkit-scrollbar-button {
  display: none !important;
  width: 0;
  height: 0;
}

/* ——— App shell ——— */
.app-sidebar {
  background: #0c1322;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.app-brand {
  padding: 0.85rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-brand__row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn i {
  font-size: 0.85em;
}

.link-action i {
  margin-right: 0.15rem;
}

.app-brand__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  background: #1e293b;
  color: #fff;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-logo--sidebar,
.brand-logo--nav,
.brand-logo--login {
  border-radius: inherit;
}

.app-brand__title {
  margin: 0;
  font-size: 0.925rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.app-brand__portal {
  margin: 0.1rem 0 0;
  font-size: 0.65rem;
  font-weight: 700;
  color: #c2f13c;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.app-sidebar .nav-section {
  margin: 0.65rem 0 0.2rem;
  padding: 0 0.85rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.1rem 0.5rem;
  padding: 0.38rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 0.55rem;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-sidebar .nav-link__icon {
  width: 1rem;
  text-align: center;
  opacity: 0.85;
  font-size: 0.8rem;
  transition: transform 0.15s ease;
}

.app-sidebar .nav-link__text {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.app-sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.app-sidebar .nav-link:hover .nav-link__icon {
  transform: scale(1.08);
}

.app-sidebar .nav-link.is-active {
  background: #c2f13c !important;
  color: #0c1322 !important;
  font-weight: 800;
  box-shadow: 0 4px 18px rgba(194, 241, 60, 0.3);
}

.app-sidebar .nav-link.is-active .nav-link__icon {
  color: #0c1322 !important;
}

.app-sidebar__user {
  margin-top: auto;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.app-sidebar__user-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-sidebar__avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #c2f13c, #84cc16);
  color: #0c1322;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(194, 241, 60, 0.25);
  flex-shrink: 0;
}

.app-sidebar__name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #ffffff;
}

.app-sidebar__role {
  font-size: 0.75rem;
  color: #94a3b8;
}

.app-sidebar__logout {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.775rem;
  font-weight: 600;
  color: #f87171;
  text-decoration: none;
  transition: color 0.15s;
}

.app-sidebar__logout:hover {
  color: #fca5a5;
  text-decoration: none;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0 1.25rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.app-topbar__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-topbar__meta {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .app-topbar__meta {
    display: flex;
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: #475569;
}

.chip--live {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.app-main {
  padding: 1.25rem 1.25rem 2rem;
}

@media (min-width: 1024px) {
  .app-main {
    padding: 1.5rem 1.75rem 2.5rem;
  }
}

/* Vendor credit — Shakeel / WhatsApp (app + print) */
.software-credit-bar {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.software-credit-bar--app {
  margin-top: 2.5rem;
}

.software-credit {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  color: #64748b;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: visible !important;
  width: 100% !important;
  display: block !important;
}

.software-credit strong {
  color: #334155;
  font-weight: 600;
}

.software-credit a {
  color: #059669;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap !important;
}

.software-credit a:hover {
  text-decoration: underline;
}

.software-credit--print {
  margin-top: 0.25rem;
  padding-top: 0;
  border-top: none;
  font-size: 0.65rem;
  color: #475569;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: visible !important;
  width: 100% !important;
  display: block !important;
}

.software-credit--print a {
  color: #0f172a;
  text-decoration: underline;
  white-space: nowrap !important;
}

.login-software-credit {
  margin-top: 1.25rem;
  text-align: center;
}


/* ——— Components ——— */
.field {
  display: block;
  width: 100%;
  border: 1.5px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0.65rem 0.95rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  color: #0f172a !important;
  background-color: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.field:hover {
  border-color: #94a3b8;
  background-color: #fafbfc !important;
}

.field:focus {
  outline: none !important;
  border-color: #0f172a !important;
  box-shadow: 0 0 0 3.5px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  background-color: #ffffff !important;
}

select.field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
  background-position: right 0.85rem center !important;
  background-repeat: no-repeat !important;
  background-size: 1rem 1rem !important;
  padding-right: 2.5rem !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  cursor: pointer;
}

textarea.field {
  min-height: 5.5rem;
  line-height: 1.5;
  resize: vertical;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.field-label i {
  margin-right: 0.35rem;
  color: #64748b;
  font-size: 0.85em;
}

.field-optional,
.field-hint,
.field-help,
.form-hint,
.form-help,
.field-label .field-optional,
.field-label span.text-slate-400,
.field-label span.text-slate-500,
.field-label small {
  font-weight: 400 !important;
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
}

.page-title {
  margin: 0;
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.page-subtitle {
  margin: 0.375rem 0 0;
  font-size: 0.9375rem;
  color: #64748b;
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: #0f172a;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2), 0 1px 2px rgba(15, 23, 42, 0.1);
}

.btn-primary:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -2px rgba(15, 23, 42, 0.26);
}

.btn-secondary {
  background: #ffffff;
  color: #1e293b !important;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-whatsapp {
  background: #059669;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-whatsapp:hover {
  background: #047857;
  transform: translateY(-1px);
}

.app-panel {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 1.5rem;
  box-shadow: 0 4px 25px -4px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.app-panel-head {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.app-panel-head .muted {
  font-weight: 500;
  color: #64748b;
}

.stat-grid {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stat-grid--5 {
    grid-template-columns: repeat(5, 1fr);
  }

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

.stat-card {
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
  padding: 1.35rem 1.5rem;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 1.5rem;
  box-shadow: 0 4px 20px -3px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -5px rgba(15, 23, 42, 0.08);
}

.stat-card__icon {
  flex-shrink: 0;
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-card--teal .stat-card__icon { background: #ecfdf5; color: #059669; }
.stat-card--blue .stat-card__icon { background: #eff6ff; color: #2563eb; }
.stat-card--amber .stat-card__icon { background: #fffbeb; color: #d97706; }
.stat-card--violet .stat-card__icon { background: #f5f3ff; color: #7c3aed; }
.stat-card--rose .stat-card__icon { background: #fff1f2; color: #e11d48; }

.stat-card__label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card__value {
  margin-top: 0.25rem;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.stat-card__hint {
  margin-top: 0.35rem;
  font-size: 0.775rem;
  color: #94a3b8;
  font-weight: 500;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead th {
  text-align: left;
  padding: 0.875rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.725rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.data-table tbody td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  font-size: 0.725rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 9999px;
  border: 1px solid transparent;
}

.badge-pending { background: #fff7ed; color: #c2410c; border-color: #ffedd5; }
.badge-collected, .badge-received { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.badge-processing { background: #f5f3ff; color: #6d28d9; border-color: #ede9fe; }
.badge-completed, .badge-verified, .badge-paid, .badge-active { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-critical { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-partial { background: #fefce8; color: #a16207; border-color: #fef08a; }
.badge-default { background: #f8fafc; color: #475569; border-color: #e2e8f0; }

.link-action {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  color: #2563eb;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}

.link-action:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-bar {
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 1.25rem 1.5rem;
}

.field-optional {
  font-weight: 500;
  color: #94a3b8;
  font-size: 0.75rem;
}

.filter-bar__grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .filter-bar__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .filter-bar__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.filter-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.catalog-workspace {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .catalog-workspace {
    grid-template-columns: 200px minmax(0, 1fr);
    align-items: start;
    min-height: 22rem;
  }
}

.catalog-pane-label {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.catalog-types {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.catalog-type-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 26rem;
  overflow-y: auto;
}

.catalog-type-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  background: transparent;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.catalog-type-btn:hover {
  background: #fff;
  border-color: #cbd5e1;
}

.catalog-type-btn.is-active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.catalog-type-btn__count {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}

.catalog-type-btn.is-active .catalog-type-btn__count {
  background: #dbeafe;
  color: #1d4ed8;
}

.catalog-pick {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background: #fff;
  min-width: 0;
}

.catalog-pick__tools {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.catalog-search-wrap {
  margin-bottom: 0.5rem;
}

.catalog-search-input {
  font-size: 0.95rem !important;
  padding: 0.7rem 0.85rem !important;
}

.catalog-hits {
  display: grid;
  gap: 0.35rem;
  max-height: 16rem;
  overflow-y: auto;
  padding-right: 0.15rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  padding: 0.4rem;
}

.catalog-hits.is-empty {
  padding: 0.75rem;
}

.catalog-hit {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  background: #fff;
  cursor: pointer;
}

.catalog-hit:hover {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.catalog-hit.hidden,
.catalog-hit[hidden] {
  display: none !important;
}

.catalog-hit__body {
  min-width: 0;
  flex: 1;
}

.catalog-hit__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.catalog-hit__meta {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.catalog-hit__price {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  padding-top: 0.1rem;
}

.catalog-hits-hint {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  color: #64748b;
}

.catalog-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.catalog-pick__hint {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.catalog-empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #64748b;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.catalog-list--selected {
  max-height: 18rem;
}

.catalog-item--selected {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 0.65rem;
  padding-right: 0.85rem;
}

.catalog-item--selected .catalog-check {
  display: none;
}

.catalog-item--selected .catalog-item__price {
  padding-top: 0.15rem;
}

.catalog-remove {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.catalog-remove:hover {
  background: #fecaca;
}

.catalog-section__title {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.catalog-list {
  display: grid;
  gap: 0.5rem;
  max-height: 22rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.catalog-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.catalog-item.hidden {
  display: none !important;
}

.catalog-item:hover {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.catalog-item:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.catalog-check {
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.catalog-item__body {
  flex: 1;
  min-width: 0;
}

.catalog-item__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.catalog-code {
  font-weight: 500;
  color: #64748b;
}

.catalog-item__meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.catalog-item__price {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.book-layout {
  display: grid;
  gap: 1rem;
}

@media (min-width: 1100px) {
  .book-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }

  .book-layout__side {
    position: sticky;
    top: 1rem;
  }
}

.billing-panel {
  display: grid;
  gap: 0.75rem;
}

.billing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #475569;
}

.billing-row--total {
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  font-size: 1rem;
  color: var(--text);
}

.billing-fields {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr 1fr;
}

.billing-hint {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.photo-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 8.5rem;
  padding: 1rem;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.photo-upload__preview {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 9999px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #64748b;
}

.form-section-note {
  margin: 0;
  padding: 0.65rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: #f0f9ff;
  border-bottom: 1px solid #bae6fd;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
}

.req::after {
  content: ' *';
  color: #dc2626;
}

.topbar-menu-btn {
  display: inline-flex;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: #475569;
}

@media (min-width: 1024px) {
  .topbar-menu-btn {
    display: none;
  }
}

/* Floating WhatsApp */
.wa-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
}

.wa-float__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem 0.65rem 0.7rem;
  border-radius: 9999px;
  background: #25d366;
  color: #fff !important;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}

.wa-float__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(37, 211, 102, 0.55);
  color: #fff !important;
}

.wa-float__btn > i {
  font-size: 1.75rem;
  line-height: 1;
}

.wa-float__label {
  display: none;
  flex-direction: column;
  line-height: 1.2;
  padding-right: 0.25rem;
}

.wa-float__title {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wa-float__number {
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .wa-float__label {
    display: flex;
  }
}

/* ——— Clinical lab report (Infinity-style layout) ——— */
.lab-report {
  --lr-ink: #000000;
  --lr-muted: #000000;
  --lr-line: #000000;
  --lr-accent: #000000;
  position: relative;
  max-width: 52rem;
  margin: 0 auto;
  background: #fff;
  color: #000000 !important;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  padding: 0.4rem 1.25rem 0.35rem 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  min-height: 275mm;
  box-sizing: border-box;
}

.lab-report__header {
  border-bottom: none;
  padding-bottom: 0.35rem;
}

.lab-letterhead-image {
  width: 100%;
  margin: 0 0 0.4rem;
  overflow: hidden;
  background: #fff;
}

.lab-letterhead-image__img {
  display: block;
  width: 100%;
  max-height: 7.5rem;
  height: auto;
  object-fit: contain;
  object-position: center top;
}

/* Inside report header mark: larger letterhead, stay in one row */
.lab-report__mark .lab-letterhead-image {
  width: auto !important;
  max-width: 14rem;
  margin: 0 !important;
}

.lab-report__mark .lab-letterhead-image__img {
  width: auto !important;
  max-width: 100%;
  height: 4.75rem !important;
  max-height: 4.75rem !important;
}

.branding-header-preview {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.branding-header-preview__img {
  display: block;
  width: 100%;
  max-height: 6rem;
  object-fit: contain;
  object-position: center top;
  background: #f8fafc;
}

.lab-doc-brand--image {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.lab-doc-brand__text--under-image .lab-doc-brand__contact {
  text-align: center;
}

.lab-report__brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.lab-report__top {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  min-height: 150px !important;
}

/* Full-width letterhead banner — image + QR side by side (never overlap) */
.lab-report__top--banner {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  min-height: 150px !important;
}

.lab-report__banner {
  flex: 1;
  min-width: 0;
  width: auto;
}

.lab-report__banner .lab-letterhead-image {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  overflow: hidden;
  background: #fff;
}

.lab-report__banner .lab-letterhead-image__img,
.lab-report__banner img {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: 1.85in !important;
  object-fit: contain;
  object-position: left center;
}

.lab-report__top--banner .lab-report__qr {
  position: static;
  flex-shrink: 0;
  align-self: center;
  margin: 0;
  background: #fff;
}

.lab-report__top--banner.lab-report__top--img-left .lab-report__banner .lab-letterhead-image__img,
.lab-report__top--banner.lab-report__top--img-left .lab-report__banner img {
  object-position: left center;
}

.lab-report__top--banner.lab-report__top--img-center .lab-report__banner .lab-letterhead-image__img,
.lab-report__top--banner.lab-report__top--img-center .lab-report__banner img {
  object-position: center center;
}

.lab-report__top--banner.lab-report__top--img-right .lab-report__banner .lab-letterhead-image__img,
.lab-report__top--banner.lab-report__top--img-right .lab-report__banner img {
  object-position: right center;
}

.lab-report__top--banner.lab-report__top--img-right {
  flex-direction: row-reverse;
}

.lab-report__top--banner.lab-report__top--img-left .lab-report__qr,
.lab-report__top--banner.lab-report__top--img-center .lab-report__qr,
.lab-report__top--banner.lab-report__top--img-right .lab-report__qr {
  left: auto;
  right: auto;
}

.lab-report__letterhead {
  flex: 1;
  min-width: 0;
}

.lab-report__mark {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lab-report__mark--logo {
  width: 4.25rem;
  height: 4.25rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.lab-report__mark--logo .brand-logo,
.lab-report__mark--logo .brand-logo--report,
.lab-report__mark--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.lab-report__mark--letterhead {
  width: auto;
  max-width: 14rem;
  height: 4.75rem;
}

.lab-report__mark--letterhead .lab-letterhead-image,
.lab-report__mark--letterhead .lab-letterhead-image__img,
.lab-report__mark--letterhead img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 4.75rem;
  max-height: 4.75rem;
  object-fit: contain;
  margin: 0;
}

.lab-report__top .lab-letterhead-image {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.lab-report__qr {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border: 1px solid #0f172a;
  padding: 2px;
  background: #fff;
}

.lab-report__qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lab-report__logo {
  width: 4.25rem;
  height: 4.25rem;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.lab-report__logo .brand-logo--report {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lab-report__lab-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1e3a5f;
  text-transform: uppercase;
  line-height: 1.15;
}

.lab-report__tagline {
  margin: 0.05rem 0 0;
  font-size: 0.68rem;
  font-style: italic;
  color: #64748b;
  line-height: 1.2;
}

.lab-report__lab-contact {
  margin: 0.05rem 0 0;
  font-size: 0.62rem;
  color: #334155;
  line-height: 1.25;
}

.lab-report__brand-text {
  min-width: 0;
  flex: 1;
}

/* Header image horizontal placement */
.lab-report__brand--img-left {
  flex-direction: row;
}

.lab-report__brand--img-right {
  flex-direction: row-reverse;
}

.lab-report__brand--img-center {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.45rem;
}

.lab-report__brand--img-center .lab-report__brand-text {
  grid-column: 1;
  justify-self: start;
}

.lab-report__brand--img-center .lab-report__mark {
  grid-column: 2;
  justify-self: center;
}

.lab-report__brand--logo-only {
  width: 100%;
}

.lab-report__brand--logo-only.lab-report__brand--img-left {
  justify-content: flex-start;
}

.lab-report__brand--logo-only.lab-report__brand--img-center {
  display: flex;
  justify-content: center;
}

.lab-report__brand--logo-only.lab-report__brand--img-right {
  display: flex;
  justify-content: flex-end;
  flex-direction: row;
}

/* Branding settings: drag-to-snap align control */
.header-align__track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  user-select: none;
}

.header-align__zone {
  appearance: none;
  border: 1px dashed #94a3b8;
  background: #f8fafc;
  border-radius: 0.35rem;
  padding: 1.35rem 0.35rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  cursor: pointer;
}

.header-align__zone.is-active {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #115e59;
}

.header-align__thumb {
  position: absolute;
  top: 0.45rem;
  width: 2.1rem;
  height: 1.55rem;
  margin-left: -1.05rem;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.55rem;
  text-align: center;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  z-index: 2;
  touch-action: none;
}

.header-align__thumb[data-align="left"] { left: 16.666%; }
.header-align__thumb[data-align="center"] { left: 50%; }
.header-align__thumb[data-align="right"] { left: 83.333%; }
.header-align__thumb:active { cursor: grabbing; }

.lab-report__letterhead-stack {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
}

.lab-report__meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.2rem 0.75rem;
  padding: 0.35rem 0;
  border-top: 1px solid #0f172a;
  border-bottom: 1px solid #0f172a;
}

.lab-report__cell {
  min-width: 0;
  padding: 0.08rem 0;
}

.lab-report__lbl {
  display: block;
  font-weight: 700 !important;
  color: #000000 !important;
  font-size: 0.68rem;
  line-height: 1.2;
  margin-bottom: 0.05rem;
}

.lab-report__lbl::after {
  content: ":";
}

.lab-report__val {
  display: block;
  color: #000000 !important;
  font-size: 0.82rem;
  font-weight: 800 !important;
  line-height: 1.25;
  word-break: break-word;
}

.lab-report__val--strong {
  color: #000000 !important;
  font-weight: 900 !important;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.lab-report__val--patient {
  color: #000000 !important;
  font-weight: 900 !important;
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.lab-report__title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin: 0.35rem 0 0.25rem;
  border-bottom: 2.5px solid #000000;
  padding-bottom: 0.2rem;
}

.lab-report__header--continued {
  margin-bottom: 0.35rem;
}

.lab-report__continued-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  font-size: 0.72rem;
  font-weight: 700 !important;
  color: #000000 !important;
  border-bottom: 1.5px solid #000000;
  padding: 0.2rem 0 0.35rem;
}

.lab-report__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 900 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000000 !important;
  border: none;
  background: transparent;
  padding: 0;
}

.lab-report__specimen {
  font-size: 0.8rem;
  font-weight: 800 !important;
  color: #000000 !important;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .lab-report__meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.lab-report__body {
  padding: 0;
  flex: 1;
}

.lab-report__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.84rem;
  border-bottom: 1.5px solid #000000;
}

/* Header row: top/bottom + vertical dividers between columns only (no outer L/R) */
.lab-report__table thead th {
  background: #fff !important;
  color: #000000 !important;
  text-align: left;
  font-size: 0.68rem;
  font-family: var(--report-body-font, "Times New Roman", Times, Georgia, serif) !important;
  font-weight: 900 !important;
  font-style: italic !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.22rem 0.35rem;
  border-top: 1.5px solid #000000;
  border-bottom: 1.5px solid #000000;
  border-right: 1px solid #000000;
  border-left: none;
  vertical-align: bottom;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.lab-report__table thead th:first-child {
  border-left: none;
}

.lab-report__table thead th:last-child {
  border-right: none;
}

.lab-report__th-test {
  width: 50%;
  text-align: left !important;
}

.lab-report__th-range {
  width: 20%;
  text-align: right !important;
  padding-right: 0.6rem !important;
  padding-left: 0.2rem !important;
}

.lab-report__th-unit {
  width: 15%;
  text-align: right !important;
  padding-right: 0.6rem !important;
  padding-left: 0.2rem !important;
}

.lab-report__th-result {
  width: 15%;
  text-align: right !important;
  padding-right: 0.6rem !important;
  padding-left: 0.2rem !important;
  line-height: 1.15;
}

.lab-report__result-date {
  display: block;
  font-size: 0.6rem;
  font-weight: 800 !important;
  font-style: italic !important;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 0.05rem;
  text-align: right !important;
}

/* Body matches Infinity sample: compact rows */
.lab-report__table tbody td {
  padding: 0.16rem 0.35rem;
  line-height: 1.25;
  border: none !important;
  vertical-align: middle;
  color: #000000 !important;
  font-family: var(--report-body-font, "Times New Roman", Times, Georgia, serif) !important;
  font-weight: var(--report-body-weight, 700) !important;
  font-style: var(--report-body-style, italic) !important;
}

.lab-report__param-cell {
  font-family: var(--report-body-font, "Times New Roman", Times, Georgia, serif) !important;
  font-weight: var(--report-body-weight, 700) !important;
  font-style: var(--report-body-style, italic) !important;
  color: #000000 !important;
  text-align: left !important;
}

.lab-report__range-cell,
.lab-report__unit-cell {
  text-align: right !important;
  padding-right: 0.6rem !important;
  padding-left: 0.2rem !important;
  font-variant-numeric: tabular-nums;
  font-family: var(--report-body-font, "Times New Roman", Times, Georgia, serif) !important;
  font-weight: var(--report-body-weight, 700) !important;
  font-style: var(--report-body-style, italic) !important;
  color: #000000 !important;
}

.lab-report__test-head td {
  background: #ffffff !important;
  padding: 0.3rem 0.45rem 0.12rem !important;
  font-size: 0.88rem;
  font-weight: 900 !important;
  color: #000000 !important;
  border: none !important;
}

.lab-report__panel-banner {
  display: inline-block;
  width: auto;
  max-width: fit-content;
  border-top: 2px solid #000000;
  border-bottom: 1.5px solid #000000;
  background: #f1f5f9;
  padding: 0.18rem 0.6rem;
  margin: 0.1rem 0 0.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #000000 !important;
  font-weight: 900 !important;
}

.lab-report__section-head td {
  background: #fff !important;
  color: #000000 !important;
  font-size: 0.74rem;
  font-weight: 900 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.45rem 0.1rem !important;
  border: none !important;
  border-bottom: 1.5px solid #000000 !important;
}

.lab-report__methodology-row td {
  border: none !important;
  padding: 0.15rem 0.45rem !important;
}

.lab-report__methodology-box {
  margin: 0.25rem 0;
  padding: 0.4rem 0.6rem;
  background: #f8fafc;
  border-left: 3px solid #000000;
  border-top: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #000000 !important;
  font-weight: 700 !important;
}

.lab-report__methodology-heading {
  font-weight: 900 !important;
  text-transform: uppercase;
  color: #000000 !important;
  font-size: 0.72rem;
  margin-top: 0.3rem;
  margin-bottom: 0.12rem;
  letter-spacing: 0.02em;
}

.lab-report__methodology-heading:first-child {
  margin-top: 0;
}

.lab-report__methodology-p {
  margin: 0 0 0.25rem;
  color: #000000 !important;
  font-weight: 700 !important;
  text-align: justify;
}

.lab-report__methodology-p:last-child {
  margin-bottom: 0;
}

.lab-report__sir-legend {
  margin-top: 0.35rem;
  padding: 0.28rem 0.5rem;
  background: #e2e8f0;
  border: 1.5px solid #000000;
  font-size: 0.72rem;
  font-weight: 900 !important;
  color: #000000 !important;
  text-align: center;
}

.lab-report__clinical-note {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: #000000 !important;
  font-weight: 700 !important;
  font-style: italic;
  line-height: 1.25;
  border-top: 1px solid #000000;
  padding-top: 0.15rem;
}

.lab-report__subtable-row td {
  border: none !important;
}

.lab-report__result {
  font-family: var(--report-body-font, "Times New Roman", Times, Georgia, serif) !important;
  font-weight: 900 !important;
  font-style: italic !important;
  font-size: 0.92rem;
  text-align: right !important;
  padding-right: 0.6rem !important;
  padding-left: 0.2rem !important;
  color: #000000 !important;
}

.lab-report__result-note {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1e293b;
  margin-top: 0.15rem;
  line-height: 1.25;
  letter-spacing: normal;
}

.lab-report__result--low {
  color: #000000 !important;
  font-weight: 900 !important;
}

.lab-report__result--high {
  color: #000000 !important;
  font-weight: 900 !important;
}

.lab-report__result--critical {
  color: #000000 !important;
  font-weight: 900 !important;
  text-decoration: underline;
}

.lab-report__arrow {
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 900;
  margin-left: 3px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Rank colors: Low = blue, Normal = green, High = red */
.lab-report__arrow--low {
  color: #2563eb !important;
}

.lab-report__arrow--normal {
  color: #16a34a !important;
}

.lab-report__arrow--high,
.lab-report__arrow--critical {
  color: #dc2626 !important;
}

.lab-report__subtable-wrap {
  margin: 0.15rem 0 0.35rem 0.5rem;
}

.lab-report__subtable-title {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 2px;
}

.lab-report__subtable {
  border-collapse: collapse;
  font-size: 0.7rem;
  width: 210px;
  background: #fff;
  border: 1px solid #0f172a;
}

.lab-report__subtable th,
.lab-report__subtable td {
  padding: 0.12rem 0.5rem !important;
  border: 1px solid #94a3b8;
}

.lab-report__subtable th {
  background: #fff;
  color: #0f172a;
  font-weight: 700;
  text-align: left;
}

.lab-report--page-break {
  page-break-after: always;
  break-after: page;
}

.print-stack {
  display: block;
}

/* Print stationery toggles — hide visually but keep blank space (no upward shift) */
.print-stack.lab-print--hide-header .lab-report__letterhead,
.print-stack.lab-print--hide-header .lab-report__letterhead *,
.print-stack.lab-print--hide-header .lab-letterhead-image,
.print-stack.lab-print--hide-header .lab-letterhead-image *,
.print-stack.lab-print--hide-header .lab-report__brand,
.print-stack.lab-print--hide-header .lab-report__brand *,
.print-stack.lab-print--hide-header .lab-report__brand-text,
.print-stack.lab-print--hide-header .lab-report__brand-text *,
.print-stack.lab-print--hide-header .lab-report__letterhead-stack,
.print-stack.lab-print--hide-header .lab-report__letterhead-stack *,
.print-stack.lab-print--hide-header .lab-report__banner,
.print-stack.lab-print--hide-header .lab-report__banner * {
  visibility: hidden !important;
  opacity: 0 !important;
}

.print-stack.lab-print--hide-qr .lab-report__qr,
.print-stack.lab-print--hide-qr .lab-report__qr * {
  visibility: hidden !important;
  opacity: 0 !important;
}

.print-stack.lab-print--hide-footer .lab-report__footer-branding,
.print-stack.lab-print--hide-footer .lab-report__footer-branding * {
  visibility: hidden !important;
  opacity: 0 !important;
}

.print-stack.lab-print--hide-all .lab-report__letterhead,
.print-stack.lab-print--hide-all .lab-report__letterhead *,
.print-stack.lab-print--hide-all .lab-letterhead-image,
.print-stack.lab-print--hide-all .lab-letterhead-image *,
.print-stack.lab-print--hide-all .lab-report__brand,
.print-stack.lab-print--hide-all .lab-report__brand *,
.print-stack.lab-print--hide-all .lab-report__brand-text,
.print-stack.lab-print--hide-all .lab-report__brand-text *,
.print-stack.lab-print--hide-all .lab-report__letterhead-stack,
.print-stack.lab-print--hide-all .lab-report__letterhead-stack *,
.print-stack.lab-print--hide-all .lab-report__banner,
.print-stack.lab-print--hide-all .lab-report__banner *,
.print-stack.lab-print--hide-all .lab-report__qr,
.print-stack.lab-print--hide-all .lab-report__qr *,
.print-stack.lab-print--hide-all .lab-report__footer-branding,
.print-stack.lab-print--hide-all .lab-report__footer-branding * {
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Software credit created by Shakeel Khalid MUST NEVER be hidden and MUST BE ON A SINGLE LINE */
.software-credit--print,
.lab-report__footer .software-credit--print {
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
  white-space: nowrap !important;
  text-align: center !important;
  width: 100% !important;
  margin: 0.2rem auto 0 auto !important;
}

.software-credit--print *,
.software-credit *,
.lab-report__footer .software-credit--print * {
  visibility: visible !important;
  opacity: 1 !important;
  display: inline !important;
  white-space: nowrap !important;
  float: none !important;
  width: auto !important;
}

.lab-report__empty {
  text-align: center;
  color: var(--lr-muted);
  padding: 1.25rem 0 !important;
}

.lab-report__side-note {
  display: none;
}

.lab-report__footer {
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: none;
}

.lab-report__disclaimer {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  color: #000;
  line-height: 1.4;
}

.lab-report__lab-note {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  color: #000;
}

.lab-report__contact-bar {
  margin-top: 0;
  padding: 0.4rem 0.55rem;
  background: #e2e8f0;
  color: #0f172a !important;
  font-size: 0.7rem;
  text-align: center;
  letter-spacing: 0.01em;
  border-top: 1px solid #0f172a;
  border-bottom: 1px solid #0f172a;
}

.lab-report__bottom-line {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: #000;
}

.lab-report .software-credit--print {
  border-top: none;
  margin-top: 0.35rem;
  padding-top: 0;
}

/* Patient bill — same base type scale as .lab-report so shared meta header matches */
.lab-bill {
  --lr-ink: #0f172a;
  --lr-muted: #475569;
  --lr-line: #94a3b8;
  --lr-accent: #1e3a5f;
  max-width: 52rem;
  margin: 0 auto;
  background: #fff;
  color: var(--lr-ink);
  font-family: "Source Sans 3", "Segoe UI", Calibri, Arial, sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
  border: 1px solid #cbd5e1;
  padding: 0.5rem 1.25rem 0.85rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.lab-bill__table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-family: var(--bill-body-font, "Times New Roman", Times, Georgia, serif) !important;
  font-weight: var(--bill-body-weight, bold) !important;
  font-style: var(--bill-body-style, italic) !important;
}

.lab-bill__table,
.lab-bill__table th,
.lab-bill__table td,
.lab-bill__footer-row,
.lab-bill__totals-wrap,
.lab-bill__totals,
.lab-bill__totals td,
.lab-bill__brand-footer,
.lab-bill__brand-footer * {
  font-family: var(--bill-body-font, "Times New Roman", Times, Georgia, serif) !important;
  font-weight: var(--bill-body-weight, bold) !important;
  font-style: var(--bill-body-style, italic) !important;
}

/* Result Entry Form Table: dynamically driven by selected report font */
.results-entry-table,
.results-entry-table th,
.results-entry-table td,
.results-entry-table .results-entry-param,
.results-entry-table input,
.results-entry-table select,
.results-entry-table textarea,
.results-entry-table [data-flag-display],
.results-entry-table [data-flag-display] * {
  font-family: var(--report-body-font, "Times New Roman", Times, Georgia, serif) !important;
  font-weight: var(--report-body-weight, bold) !important;
  font-style: var(--report-body-style, italic) !important;
}

.results-entry-table th {
  font-family: var(--report-body-font, "Times New Roman", Times, Georgia, serif) !important;
  font-weight: 900 !important;
  font-style: var(--report-body-style, italic) !important;
  letter-spacing: 0.03em;
}

.results-entry-table input.result-value-input {
  font-family: var(--report-body-font, "Times New Roman", Times, Georgia, serif) !important;
  font-weight: 900 !important;
  font-style: var(--report-body-style, italic) !important;
  font-size: 0.95rem !important;
}

.results-entry-table input[data-ref-range-input] {
  font-family: var(--report-body-font, "Times New Roman", Times, Georgia, serif) !important;
  font-weight: var(--report-body-weight, bold) !important;
  font-style: var(--report-body-style, italic) !important;
}

.lab-bill__table th {
  text-align: left;
  background: #1e3a5f;
  color: #fff;
  padding: 0.45rem 0.55rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.lab-bill__table td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.lab-bill__c-vial { width: 5.5rem; }
.lab-bill__c-exp { width: 8rem; }
.lab-bill__c-price { width: 6rem; text-align: right !important; font-variant-numeric: tabular-nums; }
.lab-bill__empty { text-align: center; color: #64748b; padding: 1rem !important; }

.lab-bill__footer-row {
  display: flex;
  justify-content: flex-end;
}

.lab-bill__totals-wrap {
  position: relative;
  min-width: 14rem;
}

.lab-bill__totals {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.lab-bill__totals td {
  padding: 0.25rem 0.15rem;
}

.lab-bill__totals td:last-child {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lab-bill__due td {
  border-top: 1px solid #94a3b8;
  padding-top: 0.4rem;
  font-weight: 700;
}

.lab-bill__stamp {
  position: absolute;
  left: -0.5rem;
  top: 50%;
  transform: translateY(-50%) rotate(-18deg);
  width: 4.5rem;
  height: 4.5rem;
  border: 3px solid #2563eb;
  border-radius: 999px;
  color: #2563eb;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  pointer-events: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.lab-bill__brand-footer {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

@media print {
  body {
    position: relative !important;
  }
  .lab-bill-container {
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
  }
  .lab-bill {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  .lab-bill .lab-doc-brand {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  .lab-bill .lab-letterhead-image {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
}

/* Legacy compact receipt (kept for older styles) */
.lab-receipt {
  max-width: 24rem;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 1.25rem;
  font-family: "Source Sans 3", "Segoe UI", Calibri, Arial, sans-serif;
  color: #0f172a;
}

.lab-doc-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  border-bottom: 1px solid #94a3b8;
  padding-bottom: 0.75rem;
}

.lab-doc-brand__logo {
  width: 3rem;
  height: 3rem;
  overflow: hidden;
}

.lab-doc-brand__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lab-doc-brand__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1e3a5f;
}

.lab-doc-brand__tag,
.lab-doc-brand__contact {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.lab-receipt__heading {
  margin: 0.85rem 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lab-receipt__body p,
.lab-receipt__totals p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.35rem 0;
  font-size: 0.875rem;
}

.lab-receipt__body span,
.lab-receipt__totals span {
  color: #64748b;
}

.lab-receipt__totals {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #94a3b8;
}

.lab-receipt__footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.lab-report__signatories {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  margin-top: 0.06rem;
  padding: 0.2rem 0 0.45rem;
  border-top: 1px solid #000;
  box-sizing: border-box;
  max-height: none;
  overflow: visible;
}

.lab-report__signatory {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 0.1rem 0.2rem 0.35rem;
  border-right: 1px solid #000;
  box-sizing: border-box;
  max-height: 2.55rem;
  overflow: hidden;
}

.lab-report__signatory:first-child {
  padding-left: 0;
}

.lab-report__signatory:last-child {
  border-right: none;
  padding-right: 0;
}

.lab-report__signatory-name {
  font-weight: 700;
  font-size: 0.7rem;
  color: #000 !important;
  line-height: 1.1;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-report__signatory-line {
  font-size: 0.58rem;
  color: #000 !important;
  line-height: 1.1;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html, body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 210mm !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Reset outer shell, sidebar offsets, and main margins so print starts cleanly at 0,0 */
  #app-shell,
  #app-shell > div,
  .lg\:pl-\[var\(--sidebar-width\)\],
  main,
  .app-main {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
    max-width: none !important;
    display: block !important;
  }

  .no-print,
  .no-print *,
  #sidebar,
  #sidebar-backdrop,
  .app-sidebar,
  .app-topbar,
  .wa-float,
  .software-credit-bar {
    display: none !important;
  }

  body * {
    visibility: hidden;
  }

  /* Include print-stack so multi-page + hide toggles work; show report sheets */
  .print-stack,
  .print-stack *,
  .print-area,
  .print-area * {
    visibility: visible;
  }

  /* Re-apply hide toggles inside print (visibility, not display) - MUST TARGET ALL DESCENDANTS (*) */
  .print-stack.lab-print--hide-header .lab-report__letterhead,
  .print-stack.lab-print--hide-header .lab-report__letterhead *,
  .print-stack.lab-print--hide-header .lab-letterhead-image,
  .print-stack.lab-print--hide-header .lab-letterhead-image *,
  .print-stack.lab-print--hide-header .lab-report__brand,
  .print-stack.lab-print--hide-header .lab-report__brand *,
  .print-stack.lab-print--hide-header .lab-report__brand-text,
  .print-stack.lab-print--hide-header .lab-report__brand-text *,
  .print-stack.lab-print--hide-header .lab-report__letterhead-stack,
  .print-stack.lab-print--hide-header .lab-report__letterhead-stack *,
  .print-stack.lab-print--hide-header .lab-report__banner,
  .print-stack.lab-print--hide-header .lab-report__banner *,
  .print-stack.lab-print--hide-header img.lab-letterhead-image__img,
  .print-stack.lab-print--hide-header .lab-report__banner img,
  .print-stack.lab-print--hide-qr .lab-report__qr,
  .print-stack.lab-print--hide-qr .lab-report__qr *,
  .print-stack.lab-print--hide-qr .lab-report__qr img,
  .print-stack.lab-print--hide-footer .lab-report__footer-branding,
  .print-stack.lab-print--hide-footer .lab-report__footer-branding *,
  .print-stack.lab-print--hide-all .lab-report__letterhead,
  .print-stack.lab-print--hide-all .lab-report__letterhead *,
  .print-stack.lab-print--hide-all .lab-letterhead-image,
  .print-stack.lab-print--hide-all .lab-letterhead-image *,
  .print-stack.lab-print--hide-all .lab-report__brand,
  .print-stack.lab-print--hide-all .lab-report__brand *,
  .print-stack.lab-print--hide-all .lab-report__brand-text,
  .print-stack.lab-print--hide-all .lab-report__brand-text *,
  .print-stack.lab-print--hide-all .lab-report__letterhead-stack,
  .print-stack.lab-print--hide-all .lab-report__letterhead-stack *,
  .print-stack.lab-print--hide-all .lab-report__banner,
  .print-stack.lab-print--hide-all .lab-report__banner *,
  .print-stack.lab-print--hide-all img.lab-letterhead-image__img,
  .print-stack.lab-print--hide-all .lab-report__banner img,
  .print-stack.lab-print--hide-all .lab-report__qr,
  .print-stack.lab-print--hide-all .lab-report__qr *,
  .print-stack.lab-print--hide-all .lab-report__qr img,
  .print-stack.lab-print--hide-all .lab-report__footer-branding,
  .print-stack.lab-print--hide-all .lab-report__footer-branding * {
    visibility: hidden !important;
    opacity: 0 !important;
  }

  /* Software credit created by Shakeel Khalid MUST NEVER be hidden in print and MUST BE ON A SINGLE LINE */
  .software-credit--print,
  .lab-report__footer .software-credit--print {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    white-space: nowrap !important;
    text-align: center !important;
    width: 100% !important;
    margin: 0.15rem auto 0 auto !important;
    font-size: 0.62rem !important;
    line-height: 1.1 !important;
  }

  .software-credit--print *,
  .software-credit *,
  .lab-report__footer .software-credit--print * {
    visibility: visible !important;
    opacity: 1 !important;
    display: inline !important;
    white-space: nowrap !important;
    float: none !important;
    width: auto !important;
  }

  .print-stack {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .print-area {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }

  .print-area.lab-bill {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .lab-report {
    width: 210mm !important;
    max-width: 210mm !important;
    min-height: 297mm !important;
    height: 297mm !important;
    box-sizing: border-box !important;
    padding: 2mm 6mm 2mm 6mm !important;
    margin: 0 auto !important;
    border: none !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    page-break-after: always !important;
    break-after: page !important;
    overflow: hidden !important;
    background: #fff !important;
  }

  .lab-report:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .lab-report--page-break {
    page-break-after: always !important;
    break-after: page !important;
  }

  .lab-report__header {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 0 0.15rem 0 !important;
  }

  .lab-report__top,
  .lab-report__top--banner,
  .lab-letterhead-image {
    margin: 0 0 0.15rem 0 !important;
    padding: 0 !important;
  }

  .lab-report__body {
    flex: 1 1 auto !important;
  }

  .lab-report__footer {
    flex: 0 0 auto !important;
    margin-top: auto !important;
    width: 100% !important;
  }

  .lab-report__side-note {
    display: none !important;
  }

  .no-print {
    display: none !important;
  }

  img {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    max-width: 100% !important;
  }

  .lab-letterhead-image__img {
    max-height: 1.85in !important;
    height: auto !important;
    width: 100% !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .lab-report__banner .lab-letterhead-image__img,
  .lab-report__banner img {
    max-height: 1.85in !important;
    width: 100% !important;
    height: auto !important;
  }

  .lab-report__qr img {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .lab-report__top,
  .lab-report__top--banner,
  .lab-report__top--custom {
    min-height: 150px !important;
  }

  .lab-report {
    color: #000000 !important;
  }
  .lab-report .lab-report__body,
  .lab-report .lab-report__body *,
  .lab-report .lab-report__table,
  .lab-report .lab-report__table *,
  .lab-report .lab-report__table thead th,
  .lab-report .lab-report__table tbody td,
  .lab-report .lab-report__param-cell,
  .lab-report .lab-report__range-cell,
  .lab-report .lab-report__unit-cell,
  .lab-report .lab-report__result,
  .lab-report .lab-report__result *,
  .lab-report .lab-report__test-head td,
  .lab-report .lab-report__sir-legend,
  .lab-report .lab-report__sir-legend *,
  .lab-report .lab-report__methodology-p,
  .lab-report .lab-report__comments {
    font-family: var(--report-body-font, "Times New Roman", Times, Georgia, serif) !important;
  }

  .lab-report__lab-name {
    color: #000000 !important;
    font-weight: 900 !important;
  }

  .lab-report__contact-bar {
    background: #e2e8f0 !important;
    color: #000000 !important;
    font-weight: 700 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .lab-report__title {
    color: #000000 !important;
    font-weight: 900 !important;
    background: transparent !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .lab-report__table thead th {
    border-color: #000000 !important;
    color: #000000 !important;
    font-weight: 900 !important;
  }

  .lab-report__table tbody td,
  .lab-report__test-head td,
  .lab-report__section-head td,
  .lab-report__subtable-row td,
  .lab-report__param-cell,
  .lab-report__range-cell,
  .lab-report__unit-cell {
    border: none !important;
    color: #000000 !important;
    font-weight: 700 !important;
  }

  .lab-report__test-head td,
  .lab-report__panel-banner,
  .lab-report__section-head td {
    color: #000000 !important;
    font-weight: 900 !important;
  }

  .lab-report__result,
  .lab-report__result--low,
  .lab-report__result--high,
  .lab-report__result--critical {
    color: #000000 !important;
    font-weight: 900 !important;
  }

  .lab-report__val--patient,
  .lab-report__val--strong,
  .lab-report__signatory-name {
    color: #000000 !important;
    font-weight: 900 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .lab-report__signatory-line,
  .lab-report__lbl,
  .lab-report__val,
  .lab-report__disclaimer,
  .lab-report__clinical-note,
  .lab-report__lab-note {
    color: #000000 !important;
    font-weight: 700 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .lab-report__signatories,
  .lab-report__signatory {
    border-color: #000000 !important;
  }

  .lab-report__arrow--low {
    color: #2563eb !important;
  }

  .lab-report__arrow--normal {
    color: #16a34a !important;
  }

  .lab-report__arrow--high,
  .lab-report__arrow--critical {
    color: #dc2626 !important;
  }

  .lab-report__arrow {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-stack > .lab-report + .lab-report {
    margin-top: 0;
  }
}

/* ——— Header Layout Drag & Drop Builder ——— */
.header-builder-wrap {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 0.75rem;
}

.header-builder-canvas {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 0.5rem auto 0;
  background: #ffffff;
  border: 2px dashed #94a3b8;
  border-radius: 0.375rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 16px 16px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.builder-item {
  position: absolute;
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 2px;
  z-index: 5;
}

.builder-item:active {
  cursor: grabbing;
}

.builder-item--logo {
  border: 1.5px dashed #0d9488;
  background: rgba(13, 148, 136, 0.06);
  border-radius: 4px;
}

.builder-item--logo:hover,
.builder-item--logo.is-active {
  border-color: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.25);
  z-index: 10;
}

.builder-item--qr {
  border: 1.5px dashed #0284c7;
  background: rgba(2, 132, 199, 0.06);
  border-radius: 4px;
}

.builder-item--qr:hover,
.builder-item--qr.is-active {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
  z-index: 10;
}

.builder-item img {
  pointer-events: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.builder-badge {
  position: absolute;
  top: -19px;
  left: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fff;
  background: #0d9488;
  white-space: nowrap;
  pointer-events: none;
  line-height: 1.3;
}

.builder-badge--qr {
  background: #0284c7;
}

.builder-resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 15px;
  height: 15px;
  background: #0f172a;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: se-resize;
  touch-action: none;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.builder-resize-handle:hover {
  transform: scale(1.25);
  background: #0d9488;
}

/* Custom Report Header Styles */
.lab-report__top--custom {
  position: relative !important;
  display: block !important;
  overflow: hidden;
  min-height: 150px !important;
}

.lab-report__banner--custom {
  position: absolute !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.lab-report__banner--custom .lab-letterhead-image,
.lab-report__banner--custom .lab-letterhead-image__img,
.lab-report__banner--custom img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
}

.lab-report__qr--custom {
  position: absolute !important;
  display: block !important;
  margin: 0 !important;
  padding: 2px !important;
  background: #fff !important;
}

.lab-report__qr--custom img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

@media print {
  .lab-report__top--custom {
    position: relative !important;
    display: block !important;
    overflow: hidden !important;
    min-height: 150px !important;
  }

  .lab-report__banner--custom {
    position: absolute !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .lab-report__banner--custom .lab-letterhead-image,
  .lab-report__banner--custom .lab-letterhead-image__img,
  .lab-report__banner--custom img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
  }

  .lab-report__qr--custom {
    position: absolute !important;
    display: block !important;
    margin: 0 !important;
    padding: 2px !important;
    background: #fff !important;
  }

  .lab-report__qr--custom img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
}

/* ——— Footer Layout Drag & Drop Builder ——— */
.footer-builder-wrap {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 0.75rem;
}

.footer-builder-canvas {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 0.5rem auto 0;
  background: #ffffff;
  border: 2px dashed #94a3b8;
  border-radius: 0.375rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 16px 16px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.builder-item--footer-img {
  border: 1.5px dashed #0284c7;
  background: rgba(2, 132, 199, 0.06);
  border-radius: 4px;
}

.builder-item--footer-img:hover,
.builder-item--footer-img.is-active {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
  z-index: 10;
}

.builder-badge--footer {
  background: #0284c7;
}

/* Custom Report Footer Styles */
.lab-report__footer-custom {
  position: relative !important;
  display: block !important;
  overflow: hidden;
  width: 100% !important;
}

.lab-report__footer-custom img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* ——— Criteria Table Editor Styles ——— */
.criteria-table-editor {
  border-collapse: collapse;
}

.criteria-table-editor th {
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.criteria-table-editor td {
  border-bottom: 1px solid #f1f5f9;
}

.criteria-table-editor tr:hover td {
  background: #f8fafc;
}

