/**
 * Raghuram Lab and Diagnostics — dashboard theme overrides
 * Loaded after styles.css on the staff dashboard only.
 */

:root {
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #f0f7f8;
  --bg-elevated: #ffffff;
  --sidebar: #1a3a3f;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(0, 169, 181, 0.32);
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --text: #1a2e32;
  --text-muted: #5a6f74;
  --line: #d8e8ea;
  --line-strong: #c5dde0;
  --primary: #00a9b5;
  --primary-hover: #008a94;
  --primary-soft: #e0f7f9;
  --primary-accent-2: #f57c00;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #f57c00;
  --danger: #e3342f;
  --danger-soft: #fdecea;
  --shadow-card: 0 8px 32px rgba(26, 58, 63, 0.08);
  --shadow-md: 0 12px 40px rgba(26, 58, 63, 0.1);
}

body {
  background: var(--bg);
}

.topbar {
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfd 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 20px rgba(26, 58, 63, 0.04);
}

.topbar-logo {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.topbar-logo--full {
  height: 44px;
  width: auto;
  max-width: min(280px, 38vw);
  object-fit: contain;
  object-position: left center;
}

.topbar-logo--custom {
  max-width: min(320px, 42vw);
}

.topbar-branch-logo--switch {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.topbar-branch-logo--switch:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(0, 169, 181, 0.28);
}

.topbar-name-img {
  height: 44px;
  width: auto;
  max-width: min(320px, 42vw);
  object-fit: contain;
}

.topbar-brand-text {
  min-width: 0;
  display: none;
}

.topbar-brand-text--visible {
  display: block;
}

.topbar-brand-text h1 {
  margin: 0;
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--surya-dark, #1a3a3f);
  line-height: 1.2;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-panel--menu {
  background: linear-gradient(180deg, #1a3a3f 0%, #0f282c 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
}

.nav-panel--menu .nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 10px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.nav-sidebar-foot {
  flex-shrink: 0;
  margin-top: auto;
  padding: 12px 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.22) 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-new-case-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #00a9b5 0%, #008a94 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 169, 181, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-new-case-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 169, 181, 0.42);
}

.nav-branch-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-branch-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.nav-branch-chip__media {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 169, 181, 0.2);
  color: #7dd3e0;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
}

.nav-branch-chip__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.nav-branch-chip__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-branch-chip__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
}

.nav-branch-chip__name {
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-branch-chip__chev {
  flex-shrink: 0;
  opacity: 0.5;
}

.nav-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 2px;
}

.nav-user-chip__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.nav-user-chip__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.nav-user-chip__label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.42);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-user-chip__name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-menu-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 10px 12px 8px;
}

.nav-group {
  margin: 0 0 2px;
  border: none;
  background: transparent;
}

.nav-group__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.82);
  transition: background 0.18s ease, color 0.18s ease;
  user-select: none;
}

.nav-group__summary::-webkit-details-marker {
  display: none;
}

.nav-group__summary:hover,
.nav-group--active > .nav-group__summary {
  background: var(--sidebar-hover);
  color: #f8fafc;
}

.nav-group__lead {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-group__lead .nav-icon {
  opacity: 0.72;
}

.nav-group--active > .nav-group__summary .nav-icon,
.nav-group__summary:hover .nav-icon {
  opacity: 1;
}

.nav-group__lead .tab-btn-label {
  font-size: 13px;
  font-weight: 600;
}

.nav-group__chev {
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.2s ease;
}

.nav-group[open] .nav-group__chev {
  transform: rotate(90deg);
}

.nav-group__items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 6px 8px;
  padding: 4px 4px 6px 32px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-panel--menu .tab-btn {
  color: #cbd5e1;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 0;
}

.nav-panel--menu .tab-btn:hover {
  background: var(--sidebar-hover);
  color: #f8fafc;
}

.nav-panel--menu .tab-btn.active {
  background: var(--sidebar-active);
  color: #f8fafc;
  box-shadow: none;
}

.nav-panel--menu .tab-btn.active .nav-icon {
  opacity: 1;
  color: inherit;
}

.nav-panel--menu .tab-btn.nav-sub {
  padding: 7px 10px;
  position: relative;
}

.nav-panel--menu .tab-btn.nav-sub::before {
  content: "—";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  font-weight: 400;
}

.nav-panel--menu .tab-btn.nav-sub .tab-btn-label {
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
}

.nav-panel--menu .tab-btn.nav-sub.active {
  background: rgba(0, 169, 181, 0.22);
}

.nav-panel--menu .tab-btn.nav-sub.active .tab-btn-label {
  font-weight: 600;
  color: #f8fafc;
}

.nav-panel--menu .tab-btn-label {
  font-weight: 600;
}

.placeholder-page-head {
  margin-bottom: 16px;
}

.placeholder-page-head h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.placeholder-card {
  padding: 20px 22px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text-muted);
  max-width: 560px;
}

.placeholder-card--support .placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.placeholder-empty {
  margin: 0;
  font-size: 14px;
}

.nav-panel {
  background: linear-gradient(180deg, #1a3a3f 0%, #0f282c 100%);
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--sidebar-active);
}

.btn.primary,
.fab-new-billing {
  background: linear-gradient(135deg, var(--primary) 0%, #00c4d4 100%);
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(0, 169, 181, 0.35);
}

.btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
}

.btn.danger {
  background: linear-gradient(135deg, var(--danger) 0%, #ff5252 100%);
}

.dash-v2-kpi,
.summary-card,
.stat-card,
.panel {
  border-color: var(--line);
}

.summary-card--inv-total .summary-card-icon {
  background: var(--primary-soft);
  color: var(--primary);
}

.dash-v2-period .period-btn.active {
  background: var(--primary);
  border-color: var(--primary);
}

.auth-pill {
  background: var(--primary-soft);
  color: var(--primary-hover);
  border: 1px solid rgba(0, 169, 181, 0.2);
}

.table thead th {
  background: #f4fafb;
  color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 169, 181, 0.15);
}

.fab-new-billing {
  background: linear-gradient(135deg, var(--danger) 0%, #ff7043 100%);
  box-shadow: 0 8px 28px rgba(227, 52, 47, 0.4);
}

.chart-card__head h3,
.dash-v2-section__title {
  color: var(--text);
}

.nav-section-label {
  color: rgba(255, 255, 255, 0.45);
}

.tab-btn {
  color: rgba(255, 255, 255, 0.82);
}

.tab-btn.active {
  color: #fff;
  background: rgba(0, 169, 181, 0.22);
}

.details-nav summary,
details.nav-accordion > summary {
  color: rgba(255, 255, 255, 0.9);
}

/* ——— Unified list / data page shell ——— */
.panel.tab-content:has(.all-cases-head) {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.all-cases-head,
.billing-page-head,
.inventory-page-head,
.lis-page-head,
.report-page-head,
.test-setup-head,
.lab-page-head,
.placeholder-page-head,
.reports-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f4fbfc 50%, #e8f5f7 100%);
  border: 1px solid #d5e8ec;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(26, 58, 63, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.all-cases-head__lead,
.billing-page-head > div:first-child,
.inventory-page-head > div:first-child,
.lis-page-head > div:first-child,
.lab-page-head,
.report-page-head,
.test-setup-head,
.placeholder-page-head,
.reports-list-head {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.all-cases-breadcrumb,
.lab-page-breadcrumb {
  order: 1;
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
  color: var(--text-muted);
}

.all-cases-breadcrumb > span:not(.all-cases-breadcrumb__sep):not(:last-of-type) {
  color: var(--text-muted);
  font-weight: 500;
}

.all-cases-breadcrumb__sep {
  margin: 0 6px;
  font-size: 11px;
  opacity: 0.45;
}

.all-cases-breadcrumb__current,
.all-cases-breadcrumb > span:last-of-type:not(.all-cases-breadcrumb__sep),
.lab-page-breadcrumb span:last-child {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a !important;
}

.all-cases-head__title,
.all-cases-head h2,
.billing-page-head h2,
.inventory-page-head h2,
.lis-page-head h2,
.report-page-head h2,
.test-setup-head h2,
.lab-page-head h2,
.placeholder-page-head h2,
.reports-list-head h2,
.all-cases-page-head__title {
  order: 2;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: #0f172a;
  line-height: 1.2;
}

/* Breadcrumb already shows the page name — hide duplicate plain titles */
.all-cases-head__lead:has(.all-cases-breadcrumb) > .all-cases-head__title:not(.all-cases-head__title--show):not(:has(*)) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.all-cases-page-head .all-cases-head__lead {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.all-cases-page-head .all-cases-breadcrumb--inline {
  order: unset;
}

.all-cases-page-head .all-cases-breadcrumb__parent {
  color: var(--text-muted);
  font-weight: 500;
}

.all-cases-head__desc,
.all-cases-head__lead > .hint,
.billing-page-sub,
.test-setup-outsource-note,
.lab-page-head .hint,
.placeholder-page-head .hint,
.reports-list-head .hint,
.inventory-page-head .hint {
  order: 3;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
  max-width: 72ch;
}

.all-cases-head__meta {
  margin: 0;
  align-self: center;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.all-cases-head__meta:empty {
  display: none;
}

.all-cases-head__actions,
.inventory-page-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  align-self: center;
  flex-shrink: 0;
}

.panel.tab-content:has(.all-cases-head).tab-content.active {
  min-height: auto;
}

/* Sample data bar */
.surya-sample-data-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0;
  padding: 8px 16px;
  background: linear-gradient(90deg, #fff8eb 0%, #fffdf5 55%, #f0fdf9 100%);
  border-bottom: 1px solid #f5d9a8;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.surya-sample-data-bar.is-active {
  background: linear-gradient(90deg, #ecfdf5 0%, #f0fdf9 55%, #ecfeff 100%);
  border-bottom-color: #a7f3d0;
}

.surya-sample-data-bar__text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  min-width: 0;
  font-size: 12px;
  color: #475569;
}

.surya-sample-data-bar__text strong {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.surya-sample-data-bar__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.surya-sample-data-bar .btn-sm {
  height: 30px;
  min-height: 30px;
  padding: 0 12px;
  font-size: 11px;
}

.all-cases-filters {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 12px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* ——— Dashboard form alignment (all pages) ——— */
.tab-content,
.all-cases-filters,
.ls-modal-overlay,
.ps-studio {
  --sd-control-h: 34px;
  --sd-grid-gap: 8px;
  --sd-label-size: 11px;
}

.tab-content label.all-cases-field,
.tab-content label.nc-field,
.tab-content .nc-payment-stat,
.all-cases-filters label,
.nc-field-grid label,
.nc-case-toolbar label,
.nc-payment-grid label,
.ls-modal-overlay .ls-form label:not(.ls-check):not(.ls-radio),
.ls-modal-overlay .ls-config-field {
  display: block;
  margin: 0;
  min-width: 0;
  font-size: var(--sd-label-size);
  font-weight: 600;
  color: #64748b;
  line-height: 1.3;
}

.tab-content .req,
.tab-content .pk-req,
.nc-view .req,
.nc-view .pk-req,
.nc-payment-grid .req,
.nc-case-toolbar .req,
.referral-field .req {
  display: inline;
  color: #e11d48;
  font-weight: 600;
  margin-left: 1px;
}

.tab-content .optional,
.nc-view .optional,
.dashboard-sample-form .optional {
  display: inline;
  color: #94a3b8;
  font-weight: 500;
  font-size: 10px;
  margin-left: 4px;
}

.nc-field > input:not([type="checkbox"]):not([type="radio"]),
.nc-field > select,
.nc-field > .inline-age,
.nc-field > .billing-referrer-controls,
.nc-field > .billing-test-add-controls,
.nc-investigation-add .billing-test-add-controls,
.nc-payment-stat > input,
.nc-payment-stat > select,
.nc-payment-stat > .discount-row,
.nc-payment-stat > .nc-gst-row,
.nc-payment-stat > .dash-gst-toggle + .nc-gst-row {
  margin-top: 3px;
}

.tab-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
.tab-content select,
.all-cases-filters input:not([type="checkbox"]):not([type="radio"]),
.all-cases-filters select,
.nc-field input:not([type="checkbox"]):not([type="radio"]),
.nc-field select,
.nc-payment-stat--edit input,
.nc-payment-stat--edit select,
.nc-patient-search {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: var(--sd-control-h);
  min-height: var(--sd-control-h) !important;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.tab-content textarea {
  min-height: 72px;
  padding: 8px 10px;
  font-size: 13px;
}

.sd-form-grid,
.nc-field-grid,
.nc-case-toolbar {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sd-grid-gap);
  row-gap: var(--sd-grid-gap);
  align-items: end;
}

.sd-form-grid > .nc-field,
.sd-form-grid > .all-cases-field,
.nc-field-grid > .nc-field,
.nc-case-toolbar > .nc-field {
  grid-column: span 3;
  min-width: 0;
}

.sd-col-2 { grid-column: span 2; }
.sd-col-3 { grid-column: span 3; }
.sd-col-4 { grid-column: span 4; }
.sd-col-6 { grid-column: span 6; }
.sd-col-8 { grid-column: span 8; }
.sd-col-12 { grid-column: span 12; }

.sd-form-span-2 { grid-column: span 2; }
.sd-form-span-3 { grid-column: span 3; }
.sd-form-span-4 { grid-column: span 4; }
.sd-form-span-6 { grid-column: span 6; }
.sd-form-span-8 { grid-column: span 8; }
.sd-form-span-12 { grid-column: span 12; }

.sd-form-grid > .active-lab-logo-block,
.sd-form-grid > .active-lab-form__foot,
.sd-form-grid > footer.active-lab-form__foot {
  grid-column: span 12;
  min-width: 0;
  align-self: start;
}

.sd-form-grid > .nc-field.sd-form-span-6 {
  grid-column: span 6;
}

.sd-form-grid > .nc-field.sd-form-span-4 {
  grid-column: span 4;
}

.sd-form-grid > .nc-field.sd-form-span-12 {
  grid-column: span 12;
}

.all-cases-filters__row--primary {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sd-grid-gap);
  row-gap: var(--sd-grid-gap);
  align-items: end;
}

.all-cases-filters__row--primary > .all-cases-field {
  grid-column: span 2;
  min-width: 0;
}

.all-cases-filters__row--primary > .all-cases-field--daterange {
  grid-column: span 3;
}

.all-cases-filters__row--actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sd-grid-gap);
  margin-top: var(--sd-grid-gap);
  padding-top: var(--sd-grid-gap);
  border-top: 1px solid #f1f5f9;
}

/* All Cases — compact 2-row filters */
.all-cases-filters--cases {
  --sd-control-h: 32px;
  --sd-grid-gap: 8px;
  --sd-label-size: 11px;
  padding: 12px 14px 10px;
}

.all-cases-filters--cases .all-cases-filters__row--primary {
  grid-template-columns:
    minmax(72px, 0.8fr)
    minmax(80px, 0.85fr)
    minmax(92px, 1fr)
    minmax(84px, 0.9fr)
    minmax(140px, 1.2fr)
    minmax(92px, 1fr)
    minmax(72px, 0.8fr);
  column-gap: 8px;
  row-gap: 8px;
}

.all-cases-filters--cases .all-cases-filters__row--primary > .all-cases-field,
.all-cases-filters--cases .all-cases-filters__row--primary > .all-cases-field--daterange {
  grid-column: auto;
}

.all-cases-filters--cases .all-cases-filters__row--actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}

.all-cases-filters--cases .all-cases-filters__row--actions .all-cases-field {
  flex: 0 1 112px;
  min-width: 0;
}

.all-cases-filters--cases .all-cases-filters__row--actions .all-cases-field--compact {
  flex-basis: 104px;
}

.all-cases-filters--cases .all-cases-filters__spacer {
  flex: 1 1 auto;
  min-width: 4px;
}

.all-cases-filters--cases .all-cases-clear-btn {
  flex: 0 0 auto;
}

.all-cases-filters--cases .table-export-group--icons {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.all-cases-filters--cases .table-export-btn--icon {
  width: var(--sd-control-h);
  min-width: var(--sd-control-h);
  height: var(--sd-control-h);
  min-height: var(--sd-control-h);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.all-cases-filters--cases .table-export-btn--icon svg {
  display: block;
  flex-shrink: 0;
}

.all-cases-filters--cases input:not([type="checkbox"]):not([type="radio"]),
.all-cases-filters--cases select {
  height: var(--sd-control-h);
  min-height: var(--sd-control-h) !important;
  padding: 0 8px;
  font-size: 12px;
}

.all-cases-filters--cases .all-cases-daterange {
  gap: 6px;
}

.all-cases-filters--cases .all-cases-daterange input {
  padding: 0 6px;
  font-size: 11px;
}

.all-cases-filters--cases .all-cases-clear-btn,
.all-cases-filters--cases .table-export-btn:not(.table-export-btn--icon) {
  height: var(--sd-control-h);
  min-height: var(--sd-control-h);
  padding: 0 10px;
  font-size: 11px;
}

.all-cases-filters--cases .table-export-group {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

@media (max-width: 1280px) {
  .all-cases-filters--cases .all-cases-filters__row--primary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .all-cases-filters--cases .all-cases-filters__row--primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .all-cases-filters--cases .all-cases-filters__row--actions {
    flex-wrap: wrap;
  }

  .all-cases-filters--cases .all-cases-filters__row--actions .all-cases-field {
    flex: 1 1 calc(50% - 4px);
  }

  .all-cases-filters--cases .all-cases-filters__spacer {
    display: none;
  }

  .all-cases-filters--cases .table-export-group--icons {
    margin-left: auto;
  }
}

.due-collections-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.due-collections-toolbar .samples-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.due-collections-toolbar .samples-search-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  font-size: 13px;
}

.lab-page-head__sub {
  font-size: 0.92em;
  font-weight: 500;
  color: #64748b;
}

.all-cases-filters__spacer {
  flex: 1;
  min-width: 8px;
}

.all-cases-field {
  display: block;
  font-size: var(--sd-label-size, 11px);
  font-weight: 600;
  color: #64748b;
  min-width: 0;
  line-height: 1.3;
  align-self: end;
}

.all-cases-field--compact {
  grid-column: span 2;
  width: auto;
  flex: initial;
}

.all-cases-field input,
.all-cases-field select {
  width: 100%;
  min-width: 0;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 500;
  padding: 0 10px;
  height: var(--sd-control-h, 34px);
  min-height: var(--sd-control-h, 34px) !important;
  line-height: 1.25;
  border-radius: 8px;
  border: 1px solid #dbe3ea;
  background: #fff;
  color: var(--text);
  box-sizing: border-box;
}

.all-cases-field select {
  padding-right: 24px;
}

.all-cases-daterange {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.all-cases-daterange input {
  padding: 0 8px;
  font-size: 12px;
  height: var(--sd-control-h, 34px);
  min-height: var(--sd-control-h, 34px) !important;
}

.all-cases-clear-btn,
.all-cases-excel-btn,
.table-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 8px;
}

.all-cases-excel-btn {
  min-width: 72px;
}

.table-export-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.table-export-btn {
  min-width: 50px;
  padding: 0 10px;
  font-size: 11px;
}

.table-export-group--compact .table-export-btn {
  height: 28px;
  min-width: 44px;
  padding: 0 8px;
  font-size: 10px;
}

.all-cases-table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Override global .table fixed layout — prevents date columns crushing & overlapping */
.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  margin-top: 0;
  border: none;
  border-radius: 0;
  border-collapse: collapse;
  overflow: visible;
}

.all-cases-table.table td {
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
}

.ac-col-expand { width: 28px; }
.ac-col-sr { width: 40px; }
.ac-col-case { width: 7%; }
.ac-col-type { width: 5%; }
.ac-col-invoice { width: 8%; }
.ac-col-dt { width: 7%; }
.ac-col-patient { width: 11%; }
.ac-col-ref { width: 8%; }
.ac-col-cc { width: 6%; }
.ac-col-money { width: 5%; }
.ac-col-status { width: 7%; }
.ac-col-actions { width: 118px; }

.all-cases-table {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  border-collapse: collapse;
}

.all-cases-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.all-cases-table tbody td {
  padding: 9px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text);
  font-size: 12px;
}

.all-cases-table tbody tr:hover td {
  background: #f8fcfd;
}

.all-cases-table tbody tr.cases-row-expanded td {
  background: #f0fafa;
}

.all-cases-th--expand {
  width: 36px;
}

.all-cases-th--sr {
  width: 48px;
}

.all-cases-th--patient {
  min-width: 0;
}

.all-cases-th--money {
  text-align: right;
}

.all-cases-th--actions {
  width: 130px;
  text-align: center;
  position: sticky;
  right: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: -4px 0 8px rgba(15, 23, 42, 0.04);
}

.all-cases-col-status {
  min-width: 0;
  max-width: none;
  padding-right: 6px !important;
}

.all-cases-th--status {
  min-width: 0;
}

.all-cases-col-datetime {
  font-size: 11px;
  line-height: 1.25;
  color: #475569;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}

.cases-dt {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.cases-dt__date {
  display: block;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.cases-dt__time {
  display: block;
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
}

.cases-dt--empty {
  color: #94a3b8;
}

.all-cases-table tbody td.all-cases-col-actions {
  position: sticky;
  right: 0;
  z-index: 1;
  background: #fff;
  box-shadow: -4px 0 8px rgba(15, 23, 42, 0.04);
  overflow: visible;
}

.all-cases-table tbody tr:hover td.all-cases-col-actions {
  background: #f8fcfd;
}

.all-cases-table tbody tr.cases-row-expanded td.all-cases-col-actions {
  background: #f0fafa;
}

.all-cases-col-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.all-cases-col-patient {
  font-weight: 600;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.all-cases-expand-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  border-radius: 6px;
}

.all-cases-expand-btn:hover {
  background: var(--primary-soft);
}

.cases-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.25;
  max-width: 100%;
}

.cases-status-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: 100%;
}

.cases-status--ok {
  color: var(--primary);
  background: var(--primary-soft);
}

.cases-status--due {
  color: var(--danger);
  background: var(--danger-soft);
}

.cases-status--pending {
  color: #b45309;
  background: #fffbeb;
}

.all-cases-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.cases-act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.cases-act-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.cases-act-btn--danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.cases-menu {
  position: relative;
}

.cases-menu[open] > summary {
  background: var(--primary-soft);
  color: var(--primary);
}

.cases-menu > summary {
  list-style: none;
  cursor: pointer;
}

.cases-menu > summary::-webkit-details-marker {
  display: none;
}

.cases-menu__panel {
  display: none;
}

.cases-menu__panel.is-floating {
  display: block;
  position: fixed;
  right: auto;
  top: auto;
  z-index: 1200;
  min-width: 200px;
  width: max-content;
  max-width: min(280px, calc(100vw - 16px));
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  isolation: isolate;
}

.cases-menu__panel.is-floating button {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.cases-menu__panel button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.cases-menu__panel button:hover {
  background: #f4fafb;
}

.cases-menu__panel button.cases-menu__danger {
  color: var(--danger);
}

.cases-menu__panel button.cases-menu__accept {
  color: #059669;
  font-weight: 600;
}

.cases-menu__panel button.cases-menu__accept svg {
  flex-shrink: 0;
}

.cases-status--due-btn {
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
}

.cases-status--due-btn:hover {
  filter: brightness(0.96);
}

.dc-due-amt {
  color: #dc2626;
  font-weight: 600;
}

.cases-detail-row td {
  padding: 0 !important;
  background: #f8fcfd !important;
}

.cases-detail-inner {
  padding: 12px 16px 14px 52px;
  font-size: 12px;
  color: var(--text-muted);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 20px;
}

.cases-detail-inner strong {
  color: var(--text);
}

.all-cases-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.all-cases-page-size {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.all-cases-page-size select {
  margin: 0;
  padding: 2px 22px 2px 8px;
  height: 28px;
  min-height: 28px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.all-cases-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.all-cases-pagination button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.all-cases-pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.all-cases-pagination button.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.all-cases-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 1200px) {
  .all-cases-filters__row--primary > .all-cases-field {
    grid-column: span 3;
  }

  .all-cases-filters__row--primary > .all-cases-field--daterange {
    grid-column: span 4;
  }

  .all-cases-filters--cases .all-cases-filters__row--primary > .all-cases-field,
  .all-cases-filters--cases .all-cases-filters__row--primary > .all-cases-field--daterange {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .all-cases-filters__row--primary > .all-cases-field,
  .all-cases-filters__row--primary > .all-cases-field--daterange {
    grid-column: span 6;
  }

  .all-cases-filters--cases .all-cases-filters__row--primary > .all-cases-field,
  .all-cases-filters--cases .all-cases-filters__row--primary > .all-cases-field--daterange {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .all-cases-filters__row--primary > .all-cases-field,
  .all-cases-filters__row--primary > .all-cases-field--daterange {
    grid-column: span 12;
  }

  .all-cases-filters--cases .all-cases-filters__row--primary > .all-cases-field,
  .all-cases-filters--cases .all-cases-filters__row--primary > .all-cases-field--daterange {
    grid-column: auto;
  }

  .all-cases-daterange {
    grid-template-columns: 1fr;
  }
}

/* ——— Patients (Cases > Patients) ——— */
.tab-patients {
  padding-top: 0;
}

.patients-head .all-cases-breadcrumb__current {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1rem;
}

.patients-filters__row {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
}

.all-cases-filters--patients .all-cases-filters__row--primary {
  gap: 10px 12px;
}

.patients-filters__row > .all-cases-field:nth-child(1) { grid-column: span 3; }
.patients-filters__row > .all-cases-field:nth-child(2) { grid-column: span 3; }
.patients-filters__row > .all-cases-field:nth-child(3) { grid-column: span 2; }
.patients-filters__row > .all-cases-field:nth-child(4) { grid-column: span 2; }
.patients-filters__row > .patients-filters__actions-inline { grid-column: span 2; }

.patients-filters__actions-inline {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 1px;
}

.patients-export-menu {
  position: relative;
}

.patients-export-more {
  list-style: none;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 169, 181, 0.28);
}

.patients-export-more::-webkit-details-marker {
  display: none;
}

.patients-export-more:hover {
  filter: brightness(1.05);
}

.patients-export-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

.patients-export-menu:not([open]) .patients-export-menu__panel {
  display: none;
}

.patients-export-menu__panel .table-export-btn--icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.patients-table-wrap {
  margin-bottom: 0;
}

/* Patients table — do not inherit All Cases 1572px min-width / sticky actions */
.all-cases-table.patients-table,
.all-cases-table.patients-table.table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.all-cases-table.patients-table .pt-col-sr { width: 56px; }
.all-cases-table.patients-table .pt-col-patient { width: 24%; }
.all-cases-table.patients-table .pt-col-address { width: 16%; }
.all-cases-table.patients-table .pt-col-phone { width: 18%; }
.all-cases-table.patients-table .pt-col-reg { width: 15%; }
.all-cases-table.patients-table .pt-col-actions { width: 168px; }

.patients-table thead th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  position: static;
  box-shadow: none;
}

.patients-table .all-cases-th--sr,
.patients-table .patients-col-sr {
  width: 56px;
  text-align: center;
}

.patients-table .all-cases-th--patient {
  min-width: 0;
  width: auto;
}

.patients-table .all-cases-th--actions,
.patients-table .patients-col-actions {
  width: 168px;
  min-width: 168px;
  max-width: 168px;
  text-align: center;
  position: static;
  right: auto;
  box-shadow: none;
}

.patients-table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
}

.patients-table tbody tr {
  border-bottom: 1px solid #eef2f6;
}

.patients-table tbody tr:hover td {
  background: #fafcfd;
}

.patients-table tbody td.patients-col-actions {
  position: static;
  right: auto;
  background: transparent;
  box-shadow: none;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}

.patients-table tbody tr:hover td.patients-col-actions {
  background: #fafcfd;
}

.patients-col-sr {
  text-align: center;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.patients-col-address {
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.patients-col-phone {
  white-space: nowrap;
}

.patients-col-datetime {
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.25;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.patients-col-actions .patients-actions {
  margin: 0 auto;
}

.patients-profile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.patients-profile__name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.patients-profile__meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1.2;
  color: #64748b;
}

.patients-profile__age {
  color: #475569;
  font-weight: 500;
}

.patients-profile__sep {
  color: #94a3b8;
}

.patients-gender {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.patients-gender--male {
  background: #e8f4fc;
  color: #1a7fc4;
}

.patients-gender--female {
  background: #fce8f3;
  color: #c43d7a;
}

.patients-gender--neutral {
  background: #eef4f5;
  color: var(--text-muted);
}

.patients-phone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
}

.patients-phone svg {
  flex-shrink: 0;
  opacity: 0.55;
}

.patients-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #f8fbfc;
  border: 1px solid #e2eef2;
  width: fit-content;
  max-width: 100%;
}

.patients-actions .cases-act-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  border: 1px solid #d7e8ee;
  background: #fff;
  color: #3b82b6;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.patients-actions .cases-act-btn:hover {
  background: #eef8fa;
  border-color: #b8dde8;
  color: #0e7490;
  transform: translateY(-1px);
}

.patients-actions .cases-act-btn:active {
  transform: translateY(0);
}

.patients-actions .cases-act-abha {
  border-color: #f5d5d5;
  background: #fffbfb;
}

.patients-actions .cases-act-abha:hover {
  background: #fff5f5;
  border-color: #f0b4b4;
}

/* ——— Patient modals ——— */
body.pt-modal-open {
  overflow: hidden;
}

.pt-modal-overlay {
  z-index: 1200;
  background: rgba(15, 40, 44, 0.55);
  backdrop-filter: blur(8px);
}

.pt-modal {
  max-width: min(960px, calc(100vw - 32px));
  max-height: min(92vh, 900px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 169, 181, 0.15);
  box-shadow: 0 24px 64px rgba(15, 40, 44, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  display: flex;
  flex-direction: column;
}

.pt-modal--history {
  max-width: min(1040px, calc(100vw - 32px));
}

.pt-modal--edit {
  max-width: min(780px, calc(100vw - 32px));
}

.pt-modal--case {
  max-width: min(920px, calc(100vw - 32px));
}

.pt-modal--abha {
  max-width: min(440px, calc(100vw - 32px));
  padding: 0 0 20px;
}

.pt-modal-hero {
  padding: 18px 22px 14px;
  background: linear-gradient(135deg, #1a3a3f 0%, #0f282c 55%, #163a42 100%);
  color: #fff;
  border-bottom: 1px solid rgba(0, 169, 181, 0.25);
}

.pt-modal-hero__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pt-modal-hero__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.pt-modal-hero__meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pt-modal-close {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pt-modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.pt-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--line);
}

.pt-modal-head--gradient {
  background: linear-gradient(180deg, #f8fcfd 0%, #fff 100%);
}

.pt-modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
}

.pt-modal-sub {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.pt-modal-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.pt-modal-body {
  padding: 14px 18px 18px;
}

.pt-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fafcfd;
}

.pt-modal-foot--split {
  justify-content: space-between;
}

.pt-modal-foot__right {
  display: flex;
  gap: 8px;
}

.pt-btn-glow {
  box-shadow: 0 4px 14px rgba(0, 169, 181, 0.35);
}

.pt-btn-glow:hover {
  box-shadow: 0 6px 20px rgba(0, 169, 181, 0.45);
}

.pt-btn-outline {
  border: 1px solid var(--primary);
  color: var(--primary);
}

.pt-info-card {
  background: linear-gradient(135deg, #f4fafb 0%, #fff 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.pt-info-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.pt-info-card__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pt-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
  font-size: 12px;
}

.pt-info-grid dt {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: capitalize;
}

.pt-info-grid dd {
  margin: 2px 0 0;
  font-weight: 600;
  color: var(--text);
}

.pt-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 8px;
}

.pt-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.pt-cases-table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.pt-cases-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 11px;
}

.pt-cases-table th {
  background: #f4fafb;
  padding: 7px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.pt-cases-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #eef4f5;
  vertical-align: middle;
}

.pt-cases-table tr:hover td {
  background: #f8fcfd;
}

.pt-cases-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 12px;
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(0, 169, 181, 0.06), rgba(26, 58, 63, 0.03));
  border-radius: 10px;
  border: 1px solid rgba(0, 169, 181, 0.12);
  font-size: 11px;
}

.pt-cases-totals span {
  color: var(--text-muted);
}

.pt-cases-totals strong {
  color: var(--text);
  margin-left: 4px;
}

.pt-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #fafcfd;
}

.pt-history-toolbar .pt-btn-excel {
  margin-left: auto;
}

.pt-modal-scroll--history {
  padding: 12px 18px 18px;
  max-height: min(62vh, 560px);
}

.pt-history-case-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin: 10px 0 6px;
  background: linear-gradient(90deg, #e8f7f9, #fff);
  border: 1px solid rgba(0, 169, 181, 0.15);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}

.pt-history-test-block {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.pt-history-test-block h4 {
  margin: 0;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #f4fafb;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.pt-history-results {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.pt-history-results th,
.pt-history-results td {
  padding: 6px 10px;
  border-bottom: 1px solid #eef4f5;
  text-align: left;
}

.pt-history-results th {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  background: #fafcfd;
}

.pt-edit-form {
  padding: 0 18px 18px;
}

.pt-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
}

.pt-edit-grid--case {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pt-field {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 0;
  line-height: 1.3;
}

.pt-field > input,
.pt-field > select,
.pt-field > textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
}

.pt-field--span2 {
  grid-column: span 2;
}

.pt-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.pt-field--inline select {
  min-width: 140px;
}

.pt-field input,
.pt-field select {
  font-size: 12px;
  font-weight: 500;
  padding: 0 10px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.pt-field--gender {
  grid-column: span 2;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.pt-field--gender legend {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 4px;
}

.pt-field--gender label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.pt-field--toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.pt-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.pt-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pt-toggle__track {
  position: absolute;
  inset: 0;
  background: #d8e8ea;
  border-radius: 999px;
  transition: background 0.2s;
  cursor: pointer;
}

.pt-toggle__track::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.pt-toggle input:checked + .pt-toggle__track {
  background: var(--primary);
}

.pt-toggle input:checked + .pt-toggle__track::after {
  transform: translateX(18px);
}

.pt-case-section {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.pt-investigation-table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pt-investigation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.pt-investigation-table th,
.pt-investigation-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #eef4f5;
}

.pt-investigation-table th {
  background: #f4fafb;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.pt-payment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.pt-payment-stat {
  padding: 10px;
  border-radius: 8px;
  background: #f4fafb;
  border: 1px solid var(--line);
  font-size: 10px;
  color: var(--text-muted);
}

.pt-payment-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--text);
}

.pt-abha-brand {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 10px;
}

.pt-abha-brand h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.pt-abha-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.pt-abha-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.pt-abha-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.pt-abha-tab__badge {
  display: block;
  font-size: 9px;
  font-weight: 500;
  opacity: 0.75;
}

.pt-abha-panel {
  padding: 16px 20px 0;
}

.pt-abha-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.pt-aadhaar-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pt-aadhaar-chunk {
  flex: 1;
  text-align: center;
  letter-spacing: 0.15em;
  font-weight: 600;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 14px;
}

.pt-aadhaar-toggle {
  border: none;
  background: var(--primary-soft);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
}

.pt-abha-legal {
  margin: 14px 20px 10px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.pt-btn-otp {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
}

.pt-case-detail-row td {
  background: #f8fcfd !important;
  padding: 10px 12px !important;
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .pt-edit-grid,
  .pt-edit-grid--case,
  .pt-info-grid,
  .pt-payment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pt-field--span2 {
    grid-column: span 2;
  }
}

.patients-footer {
  margin-top: 10px;
}

@media (max-width: 1100px) {
  .patients-filters__row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .patients-filters__actions-inline {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

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

/* ——— Lab section pages ——— */
.tab-lab-page {
  padding-top: 0;
}

.lab-page-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}

.lab-page-card--table {
  padding: 0;
  overflow: auto;
}

.lab-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.lab-stats-table thead th {
  background: #f4fafb;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.lab-stats-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #eef4f5;
  vertical-align: middle;
}

.lab-stats-table tbody tr:hover td {
  background: #f8fcfd;
}

/* ——— Search Reports (Lab > Search Reports) ——— */
.tab-search-reports {
  padding-top: 0;
  max-width: 100%;
  overflow-x: hidden;
  --sd-control-h: 28px;
}

.tab-search-reports .all-cases-head {
  margin-bottom: 6px;
  padding: 8px 12px;
  border-radius: 8px;
}

.tab-search-reports .search-reports-head__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tab-search-reports .all-cases-head__meta {
  font-size: 11px;
}

.search-reports-filters {
  margin-bottom: 6px;
  padding: 8px 10px 6px;
  border-radius: 8px;
}

/* Must beat .all-cases-filters--cases .all-cases-filters__row--primary (shared form class) */
.all-cases-filters.search-reports-filters .search-reports-filters__row,
.all-cases-filters--cases.search-reports-filters .all-cases-filters__row--primary.search-reports-filters__row {
  grid-template-columns:
    292px
    88px
    minmax(120px, 1fr)
    minmax(90px, 0.95fr)
    minmax(80px, 0.85fr)
    minmax(80px, 0.85fr);
  column-gap: 10px;
  row-gap: 6px;
  align-items: end;
}

.all-cases-filters.search-reports-filters .search-reports-filters__row > .all-cases-field,
.all-cases-filters.search-reports-filters .search-reports-filters__row > .all-cases-field--duration-date {
  grid-column: auto;
  min-width: 0;
}

.all-cases-filters.search-reports-filters .all-cases-field--duration-date {
  contain: layout;
}

.all-cases-filters.search-reports-filters .sr-filter-duration-date {
  display: flex;
  gap: 6px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
}

.all-cases-filters.search-reports-filters .sr-filter-duration-date select {
  flex: 0 0 86px;
  width: 86px;
  min-width: 86px;
}

.all-cases-filters.search-reports-filters .sr-filter-duration-date input[type="date"] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: 100%;
  padding: 0 2px;
}

.tab-search-reports .all-cases-field input,
.tab-search-reports .all-cases-field select {
  margin-top: 2px;
  height: var(--sd-control-h);
  min-height: var(--sd-control-h) !important;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 5px;
}

.sr-filter-duration-date {
  display: flex;
  gap: 6px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.sr-filter-duration-date select {
  flex: 0 0 84px;
  width: 84px;
  min-width: 84px;
}

.sr-filter-duration-date input[type="date"] {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  padding: 0 2px;
}

.all-cases-filters.search-reports-filters .search-reports-filters__actions-row,
.all-cases-filters--cases.search-reports-filters .all-cases-filters__row--actions.search-reports-filters__actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
  gap: 8px;
}

.search-reports-filters__actions-row .all-cases-filters__spacer {
  display: none;
}

.all-cases-filters.search-reports-filters .search-reports-filters__actions-row .all-cases-field--compact {
  flex: 0 0 130px;
  min-width: 0;
}

.search-reports-filters .sr-refresh-btn {
  width: auto;
  min-width: var(--sd-control-h, 28px);
  height: var(--sd-control-h, 28px);
  min-height: var(--sd-control-h, 28px);
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 5px;
}

.tab-search-reports .all-cases-table-wrap,
.tab-search-reports .search-reports-table-wrap {
  overflow-x: hidden;
  border-radius: 8px 8px 0 0;
  border-bottom: none;
}

.search-reports-table.table,
.search-reports-table.all-cases-table.table,
.search-reports-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.search-reports-table .sr-col-expand { width: 34px; }
.search-reports-table .sr-col-sr { width: 48px; }
.search-reports-table .sr-col-priority { width: 68px; }
.search-reports-table .sr-col-case { width: 76px; }
.search-reports-table .sr-col-dt { width: 92px; }
.search-reports-table .sr-col-cc { width: 72px; }
.search-reports-table .sr-col-patient { width: 130px; }
.search-reports-table .sr-col-actions { width: 140px; }

.tab-search-reports .search-reports-col-inv {
  max-width: none;
  width: auto;
  min-width: 180px;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  vertical-align: top;
}

.tab-search-reports .all-cases-col-patient {
  min-width: 0;
  max-width: none;
  white-space: nowrap;
}

.tab-search-reports .search-reports-col-inv .sr-inv-list {
  flex: 1;
  min-width: 0;
}

.tab-search-reports .search-reports-col-inv .sr-inv-body {
  width: 100%;
}

.tab-search-reports .search-reports-table thead th {
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  background: #eef3f8;
  color: #475569;
  border-bottom: 1px solid #dbe3ec;
}

.tab-search-reports .search-reports-table tbody td {
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.25;
  overflow: visible;
  text-overflow: clip;
}

.tab-search-reports .search-reports-table tbody td.all-cases-col-patient,
.tab-search-reports .search-reports-table tbody td.all-cases-col-case {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-search-reports .all-cases-col-datetime {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
  font-size: 10px;
}

.tab-search-reports .cases-dt__date,
.tab-search-reports .cases-dt__time {
  display: block;
  line-height: 1.2;
}

.tab-search-reports .all-cases-th--expand,
.tab-search-reports .all-cases-th--sr,
.tab-search-reports .all-cases-th--actions {
  width: 1%;
  white-space: nowrap;
}

.tab-search-reports .all-cases-col-priority,
.tab-search-reports .all-cases-col-case,
.tab-search-reports .all-cases-col-datetime,
.tab-search-reports .all-cases-col-cc,
.tab-search-reports .search-reports-table tbody td:first-child,
.tab-search-reports .search-reports-table tbody td:nth-child(2) {
  white-space: nowrap;
}

.tab-search-reports .all-cases-col-actions {
  width: auto;
  white-space: nowrap;
}

.tab-search-reports .sr-priority {
  font-size: 11px;
}

.search-reports-th--inv {
  min-width: 0;
}

.search-reports-col-inv {
  max-width: none;
}

.tab-search-reports .all-cases-expand-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 10px;
  color: #94a3b8;
}

.tab-search-reports .all-cases-expand-btn:hover {
  color: #64748b;
  background: #f1f5f9;
}

.tab-search-reports .cases-act-btn {
  width: 24px;
  height: 24px;
}

.tab-search-reports .search-reports-footer {
  margin-top: 0;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 1px solid #e8edf2;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sr-priority {
  display: inline;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.sr-priority--normal {
  color: #16a34a;
}

.sr-priority--urgent {
  color: #dc2626;
}

.sr-branch-cell {
  display: block;
  max-width: 68px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  letter-spacing: 0.01em;
}

.sr-patient-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.sr-patient-cell__text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.sr-patient-cell__text strong {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-patient-cell__meta {
  font-size: 10px;
  color: #64748b;
  line-height: 1.2;
}

.sr-patient-cell__gender {
  font-weight: 600;
}

.sr-patient-cell__gender--f {
  color: #db2777;
}

.sr-patient-cell__gender--m {
  color: #2563eb;
}

.sr-inv-list {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

.sr-inv-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.sr-inv-doc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 0;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 2px;
}

.sr-inv-doc svg {
  display: block;
}

.sr-inv-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 7px;
  min-width: 0;
  min-height: 20px;
}

.sr-inv-group__label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}

.sr-inv-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.sr-inv-chip {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  box-sizing: border-box;
  height: 20px;
  min-height: 20px;
  max-width: 100%;
  padding: 0 6px 0 7px;
  border-radius: 3px;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  vertical-align: middle;
}

.sr-inv-chip--green {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.sr-inv-chip--purple {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

.sr-inv-chip--green .sr-inv-chip__icons {
  width: 34px;
  min-width: 34px;
  gap: 2px;
}

.sr-inv-chip--purple .sr-inv-chip__icons {
  width: 12px;
  min-width: 12px;
  justify-content: center;
}

.sr-inv-chip--green .sr-inv-chip__tick {
  color: #059669;
}

.sr-inv-chip--purple .sr-inv-chip__tick {
  color: #4338ca;
}

.sr-inv-chip:hover {
  filter: brightness(0.97);
}

.sr-inv-chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.sr-inv-chip__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 168px;
  text-align: left;
  line-height: 1.1;
}

.sr-inv-chip__icons {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
  width: 24px;
  min-width: 24px;
  height: 11px;
}

.sr-inv-chip__tick {
  font-weight: 800;
  font-size: 10px;
  line-height: 1;
}

.sr-inv-chip__sign,
.sr-inv-chip__print {
  display: block;
  width: 11px;
  height: 11px;
  opacity: 0.85;
  flex-shrink: 0;
}

.sr-actions {
  flex-wrap: nowrap;
  gap: 1px;
}

.sr-detail-row td {
  background: #f8fcfd !important;
  padding: 0 !important;
}

.sr-detail-inner {
  padding: 6px 10px 8px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px 12px;
  font-size: 10px;
  color: var(--text-muted);
}

.sr-detail-inner strong {
  color: var(--text);
}

@media (max-width: 1100px) {
  .all-cases-filters.search-reports-filters .search-reports-filters__row,
  .all-cases-filters--cases.search-reports-filters .all-cases-filters__row--primary.search-reports-filters__row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .all-cases-filters.search-reports-filters .search-reports-filters__row > .all-cases-field--duration-date {
    grid-column: 1 / -1;
  }

  .all-cases-filters.search-reports-filters .sr-filter-duration-date input[type="date"] {
    min-width: 0;
    width: auto;
  }
}

@media (max-width: 640px) {
  .all-cases-filters.search-reports-filters .search-reports-filters__row,
  .all-cases-filters--cases.search-reports-filters .all-cases-filters__row--primary.search-reports-filters__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .all-cases-filters.search-reports-filters .search-reports-filters__row > .all-cases-field--duration-date {
    grid-column: 1 / -1;
  }
}

/* ——— Internal case modals (Case Info, Bill, Report, Share) ——— */
.ci-modal-overlay {
  z-index: 1250;
  background: rgba(15, 40, 44, 0.58);
  backdrop-filter: blur(8px);
}

.modal-card.ci-modal {
  max-width: min(1040px, calc(100vw - 28px));
  max-height: min(92vh, 880px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ci-modal {
  max-width: min(1040px, calc(100vw - 28px));
  max-height: min(92vh, 880px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 169, 181, 0.18);
  box-shadow: 0 28px 72px rgba(15, 40, 44, 0.28);
}

.ci-modal--split,
.ci-modal--report,
.ci-modal--print-pdf {
  max-width: min(1180px, calc(100vw - 24px));
  height: min(90vh, 860px);
}

.ci-modal--print-pdf {
  display: flex;
  flex-direction: column;
}

/* ——— Report Print modal (full page) ——— */
.rp-modal-overlay.is-open {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: #fff;
  backdrop-filter: none;
}

#reportsMasterPrintModal.is-open,
#reportViewerModal.is-open {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: #fff;
  backdrop-filter: none;
}

#reportsMasterPrintModal.is-open .modal-card,
#reportViewerModal.is-open .modal-card {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  overflow: hidden;
}

.rp-modal-overlay .ci-modal--print-pdf {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: #fff;
}

.rp-modal-overlay .ci-split-head {
  flex-shrink: 0;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.rp-modal-overlay .ci-split-head h2 {
  font-size: 15px;
  font-weight: 700;
  color: #374151;
}

.rp-modal-overlay .ci-modal-close {
  font-size: 22px;
  color: #6b7280;
}

.rp-modal-overlay .rp-print-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 22%);
  overflow: hidden;
}

.rp-modal-overlay .rp-config-side {
  width: 100%;
  min-width: 0;
  max-width: none;
  background: #eef2f6;
  border-left: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  overflow: hidden;
  min-height: 0;
}

.rp-modal-overlay .rm-print-sequence-side {
  width: 100%;
  min-width: 0;
  max-width: none;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  overflow: auto;
  min-height: 0;
}

.rp-modal-overlay .rm-print-sequence-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  flex-shrink: 0;
}

.rp-modal-overlay .rm-seq-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.rp-modal-overlay .rm-seq-table {
  width: 100%;
  border-collapse: collapse;
}

.rp-modal-overlay .rm-seq-table th {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.rp-modal-overlay .rm-seq-table td {
  font-size: 12px;
  padding: 10px;
  border-bottom: 1px solid #f3f4f6;
  color: #111827;
  vertical-align: middle;
}

.rp-modal-overlay .rm-seq-table .rm-th-drag,
.rp-modal-overlay .rm-seq-table .rm-seq-drag {
  width: 32px;
  text-align: center;
  color: #9ca3af;
  font-size: 15px;
  padding-left: 4px;
  padding-right: 4px;
}

.rp-modal-overlay .rm-seq-table .rm-seq-name {
  font-weight: 500;
}

/* ——— Print sidebar (reference-style) ——— */
.rp-modal-overlay .rp-config-accordion {
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 40, 44, 0.05);
}

.rp-modal-overlay .rp-config-accordion--pdf {
  flex: 0 0 auto;
}

.rp-modal-overlay .rp-config-accordion--pdf .rp-config-accordion__head {
  padding: 6px 10px;
  font-size: 11px;
}

.rp-modal-overlay .rp-config-accordion--report {
  flex: 1 1 0;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rp-modal-overlay .rp-config-accordion--report .rp-config-accordion__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 10px;
}

.rp-modal-overlay .rp-config-accordion--share {
  flex-shrink: 0;
  margin-top: 0;
  position: relative;
  z-index: 2;
}

.rp-modal-overlay .rp-config-accordion__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #5dabda 0%, #4a96c4 100%);
  border: none;
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
}

.rp-modal-overlay .rp-config-accordion__head--share {
  background: linear-gradient(135deg, #52b788 0%, #40916c 100%);
}

.rp-modal-overlay .rp-config-accordion__chev {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(255, 255, 255, 0.95);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.rp-modal-overlay .rp-config-accordion:not(.is-open) .rp-config-accordion__chev {
  transform: rotate(-90deg);
}

.rp-modal-overlay .rp-config-accordion:not(.is-open) .rp-config-accordion__body {
  display: none;
}

.rp-modal-overlay .rp-config-accordion__body {
  padding: 12px 12px 14px;
  background: #fff;
}

.rp-modal-overlay .rp-config-accordion--pdf .rp-config-accordion__body {
  padding: 5px 8px 6px;
}

.rp-modal-overlay .rp-config-accordion--pdf .rp-field {
  gap: 2px;
  margin: 0 0 4px;
  font-size: 9px;
}

.rp-modal-overlay .rp-config-accordion--pdf .rp-field select {
  height: 24px;
  padding: 0 6px;
  font-size: 11px;
  border-radius: 5px;
}

.rp-modal-overlay .rp-pdf-opts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  margin-top: 0;
}

.rp-modal-overlay .rp-pdf-opts .rp-opt-row {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 0;
  padding: 3px 2px 4px;
  border-radius: 5px;
  text-align: center;
}

.rp-modal-overlay .rp-pdf-opts .rp-opt-row__label {
  font-size: 8px;
  font-weight: 600;
  line-height: 1.15;
  color: #475569;
  word-break: break-word;
  hyphens: auto;
}

.rp-modal-overlay .rp-pdf-opts .rp-switch__track {
  width: 26px;
  height: 15px;
}

.rp-modal-overlay .rp-pdf-opts .rp-switch__track::after {
  width: 11px;
  height: 11px;
  top: 2px;
  left: 2px;
}

.rp-modal-overlay .rp-pdf-opts .rp-switch input:checked + .rp-switch__track::after {
  transform: translateX(11px);
}

.rp-modal-overlay .rp-opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 5px 9px;
  margin: 0;
  border: 1px solid #e8eef2;
  border-radius: 8px;
  background: #fafcfd;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.rp-modal-overlay .rp-opt-row:hover {
  border-color: #cbd5e1;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 40, 44, 0.06);
}

.rp-modal-overlay .rp-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.rp-modal-overlay .rp-field select,
.rp-modal-overlay .rp-field input[type="tel"] {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  background: #fff;
  box-sizing: border-box;
}

.rp-modal-overlay .rp-field select:focus,
.rp-modal-overlay .rp-field input:focus {
  outline: none;
  border-color: #5dabda;
  box-shadow: 0 0 0 2px rgba(93, 171, 218, 0.2);
}

.rp-modal-overlay .rp-opt-row__label {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  line-height: 1.25;
  min-width: 0;
}

.rp-modal-overlay .rp-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  cursor: pointer;
}

.rp-modal-overlay .rp-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.rp-modal-overlay .rp-switch__track {
  position: relative;
  display: block;
  pointer-events: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
}

.rp-modal-overlay .rp-switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 40, 44, 0.18);
  transition: transform 0.18s ease;
}

.rp-modal-overlay .rp-switch input:checked + .rp-switch__track {
  background: var(--accent, #00a9b5);
}

.rp-modal-overlay .rp-switch input:checked + .rp-switch__track::after {
  transform: translateX(18px);
}

.rp-modal-overlay .rp-switch input:focus-visible + .rp-switch__track {
  outline: 2px solid rgba(0, 169, 181, 0.35);
  outline-offset: 2px;
}

.rp-modal-overlay .rp-switch--sm .rp-switch__track {
  width: 34px;
  height: 20px;
}

.rp-modal-overlay .rp-switch--sm .rp-switch__track::after {
  width: 16px;
  height: 16px;
}

.rp-modal-overlay .rp-switch--sm input:checked + .rp-switch__track::after {
  transform: translateX(14px);
}

/* legacy opt-cell (other panels) */
.rp-modal-overlay .rp-opt-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  cursor: pointer;
  margin: 0;
}

.rp-modal-overlay .rp-opt-cell__label {
  font-size: 11px;
  font-weight: 500;
  color: #475569;
  line-height: 1.25;
}

.rp-modal-overlay .rp-opt-cell__box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 18px;
}

.rp-modal-overlay .rp-opt-cell__box input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #3b82f6;
  cursor: pointer;
}

.rp-modal-overlay .rp-seq-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.rp-modal-overlay .rp-seq-pagebreak {
  flex: 1;
  min-width: 0;
  margin-bottom: 0 !important;
}

.rp-modal-overlay .rp-seq-master {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid #e8eef2;
  border-radius: 8px;
  background: #fafcfd;
  white-space: nowrap;
}

.rp-modal-overlay .rp-seq-master__label {
  font-size: 10px;
  font-weight: 600;
  color: #334155;
  text-align: right;
  line-height: 1.25;
  max-width: none;
}

.rp-modal-overlay .rp-seq-table-wrap {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: none;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fafcfd;
}

.rp-modal-overlay .rp-apply-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 0;
  flex-shrink: 0;
}

.rp-modal-overlay .rp-seq-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.rp-modal-overlay .rp-seq-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 6px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  text-align: left;
  white-space: nowrap;
}

.rp-modal-overlay .rp-seq-table td {
  padding: 7px 6px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.rp-modal-overlay .rp-seq-table .rp-th-order,
.rp-modal-overlay .rp-seq-table td:first-child {
  width: 42px;
  text-align: center;
}

.rp-modal-overlay .rp-seq-table .rp-th-ready,
.rp-modal-overlay .rp-seq-table .rp-th-single,
.rp-modal-overlay .rp-seq-table .rp-td-ready,
.rp-modal-overlay .rp-seq-table .rp-td-single {
  width: 58px;
  text-align: center;
}

.rp-modal-overlay .rp-seq-table .rp-th-name,
.rp-modal-overlay .rp-seq-table td:nth-child(2) {
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  font-size: 11px;
}

.rp-modal-overlay .rp-seq-pkg-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0d6e5f;
  background: #e6f7f4;
  vertical-align: middle;
}

.rp-modal-overlay .rp-seq-table .rp-switch {
  margin: 0 auto;
}

.rp-modal-overlay .rp-seq-table.rp-seq-table--no-single .rp-th-single,
.rp-modal-overlay .rp-seq-table.rp-seq-table--no-single .rp-td-single {
  display: none;
}

.rp-modal-overlay .rp-apply-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.rp-modal-overlay .rp-apply-btn {
  min-width: 72px;
  height: 32px;
  padding: 0 18px;
  border: none;
  border-radius: 16px;
  background: #14b8a6;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.rp-modal-overlay .rp-apply-btn:hover {
  background: #0d9488;
}

.rp-modal-overlay .rp-phone-field {
  display: flex;
  align-items: stretch;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.rp-modal-overlay .rp-phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  white-space: nowrap;
  flex-shrink: 0;
}

.rp-modal-overlay .rp-phone-field input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: none;
  font-size: 13px;
  color: #1e293b;
  background: transparent;
}

.rp-modal-overlay .rp-phone-field input:focus {
  outline: none;
}

.rp-modal-overlay .rp-phone-field:focus-within {
  border-color: #52b788;
  box-shadow: 0 0 0 2px rgba(82, 183, 136, 0.2);
}

.rp-modal-overlay .rp-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 38px;
  margin-top: 4px;
  border: none;
  border-radius: 6px;
  background: #14b8a6;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rp-modal-overlay .rp-share-btn:hover {
  background: #0d9488;
}

.rp-modal-overlay .rp-share-btn__icon {
  flex-shrink: 0;
}

.rp-modal-overlay .ci-modal-foot {
  flex-shrink: 0;
  padding: 10px 16px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  justify-content: flex-end;
}

.rp-modal-overlay .ci-modal-foot .btn.secondary {
  min-width: 80px;
  border-radius: 4px;
}

.rp-modal-overlay .rp-print-preview .rr-a4-sheet {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.rp-modal-overlay .rp-print-preview .ci-preview-shell--clinical-stack {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.rp-print-preview .rr-a4-sheet {
  width: 210mm;
  min-height: 297mm;
  max-width: 210mm;
  margin: 0 auto;
  flex-shrink: 0;
}

.rp-print-preview .rp-a4-zoom-host {
  width: fit-content;
  margin: 0 auto;
  transform-origin: top center;
}

.rp-print-preview .rr-a4-sheet .letter-preview--report,
.rp-print-preview .rr-a4-sheet .ci-preview-shell.letter-preview--a4 {
  width: 210mm !important;
  max-width: 210mm !important;
  min-height: 297mm;
  padding: 0 !important;
  box-sizing: border-box;
}

.rp-print-preview .ci-preview-shell--clinical-stack {
  width: fit-content;
  margin: 0 auto;
  max-width: none !important;
}

.rp-modal-overlay .rp-print-preview .letter-preview--report {
  max-width: 210mm !important;
  width: 210mm !important;
}

.rp-print-preview .letter-preview {
  max-width: 210mm !important;
  padding: 0 !important;
  box-shadow: none;
  background: transparent;
}

.rp-print-body {
  flex: 1;
  min-height: 0;
}

.rp-print-viewer {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #3a3d40;
}

.rp-print-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #2b2b2b;
  color: #e8eaed;
  border-bottom: 1px solid #1f1f1f;
}

.rp-print-filename {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.rp-print-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rp-print-tools--nav {
  justify-self: center;
}

.rp-print-tools--actions {
  justify-self: end;
  gap: 2px;
}

.rp-tool-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #e8eaed;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.rp-tool-btn--icon svg {
  display: block;
}

.rp-tool-menu {
  position: relative;
}

.rp-tool-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  padding: 6px 0;
  background: #303134;
  border: 1px solid #5f6368;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

.rp-tool-menu__item {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: #e8eaed;
  text-align: left;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.rp-tool-menu__item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.rp-tool-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.rp-tool-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.rp-tool-btn.is-busy:disabled {
  opacity: 0.75;
  cursor: wait;
}

.rp-print-page,
.rp-print-zoom {
  font-size: 12px;
  min-width: 44px;
  text-align: center;
}

.rp-print-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  min-width: 0;
}

.rp-viewer__stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: #525659;
}

.rp-viewer__canvas {
  transform-origin: top center;
  transition: zoom 0.12s ease, transform 0.12s ease;
}

.rp-print-preview-host {
  width: 210mm;
  max-width: 210mm;
  flex-shrink: 0;
}

.rp-print-preview-host .rp-a4-zoom-host {
  width: 210mm;
  max-width: 210mm;
}

.rp-print-preview-host .rr-a4-sheet,
.rp-print-preview-host .rp-a4-zoom-host,
.rp-print-preview-host .letter-preview--report {
  background: #fff;
}

.rp-print-preview-host .rr-a4-sheet,
.rp-print-preview-host .ci-preview-shell--clinical-stack {
  width: 210mm !important;
  max-width: 210mm !important;
  margin: 0 auto;
}

.rp-print-preview-host .lab-report-page--clinical {
  min-height: 297mm;
  background: #fff;
}

.rp-print-preview-host .letter-preview--report,
.rp-print-preview-host .ci-preview-shell.letter-preview--a4 {
  width: 210mm !important;
  max-width: 210mm !important;
  min-height: 297mm;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  background: #fff;
  box-sizing: border-box;
  isolation: isolate;
}

.rp-print-preview-host .lab-report-page--clinical,
.rp-print-preview-host .print-target.report-preview-root {
  width: 210mm !important;
  max-width: 210mm !important;
  box-sizing: border-box;
}

.rp-print-preview-host .rr-a4-sheet--page .letter-preview--report {
  width: 210mm !important;
  max-width: 210mm !important;
}

.rp-print-thumbs {
  width: 72px;
  flex-shrink: 0;
  background: #2b2b2b;
  border-right: 1px solid #1f1f1f;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.rp-print-thumb {
  border: 2px solid transparent;
  background: #fff;
  border-radius: 2px;
  padding: 6px 4px;
  cursor: pointer;
  font-size: 10px;
  color: #333;
}

.rp-print-thumb.is-active {
  border-color: #1a73e8;
}

.rp-print-preview {
  flex: 1;
  min-width: 0;
}

.rp-share-side,
.rp-config-side {
  width: 100%;
  min-width: 0;
  border-left: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.rp-config-block {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.rp-config-block--report {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.rp-config-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.rp-pdf-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 10px;
}

.rp-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
}

.rp-check input {
  margin: 0;
  flex-shrink: 0;
}

.rp-seq-table .rp-th-order {
  width: 48px;
  text-align: center;
}

.rp-seq-table .rp-th-ready {
  width: 72px;
  text-align: center;
}

.rp-seq-table td:first-child,
.rp-seq-table td:last-child {
  text-align: center;
}

.rp-seq-table td:nth-child(2) {
  font-size: 12px;
}

.rp-seq-global {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 12px;
}

.rp-apply-btn {
  align-self: flex-end;
  min-width: 88px;
}

.rp-share-block {
  margin-top: auto;
}

.rp-wa-share-btn {
  width: 100%;
  background: #25d366;
  border-color: #25d366;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.rp-wa-share-btn:hover {
  background: #1ebe57;
  border-color: #1ebe57;
}

.rp-wa-icon {
  font-size: 16px;
  line-height: 1;
}

.rp-share-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.rp-share-tab {
  flex: 1;
  border: none;
  background: #f8fafb;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #64748b;
}

.rp-share-tab.is-active {
  background: #fff;
  color: var(--primary, #00a9b5);
  box-shadow: inset 0 -2px 0 var(--primary, #00a9b5);
}

.rp-share-panel {
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.rp-share-heading {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.rp-phone-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rp-phone-flag {
  flex-shrink: 0;
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

.rp-phone-field input {
  flex: 1;
  min-width: 0;
}

.rp-share-btn {
  align-self: flex-end;
  margin-top: auto;
  min-width: 88px;
}

@media (max-width: 900px) {
  .rp-print-thumbs {
    display: none;
  }

  .rp-modal-overlay .rp-print-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .rp-modal-overlay .rp-config-side {
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: 42vh;
    border-left: none;
    border-top: 1px solid #e2e8f0;
    overflow: hidden;
    padding: 6px;
    gap: 6px;
  }

  .rp-modal-overlay .rp-config-accordion--report {
    min-height: 200px;
  }

  .rp-modal-overlay .rp-seq-table-wrap {
    min-height: 140px;
  }

  .rp-modal-overlay .rp-print-preview {
    min-height: 50vh;
  }

  .rp-share-side,
  .rp-config-side {
    width: 100%;
    min-width: 0;
  }
}

.ci-modal--slip {
  max-width: min(720px, calc(100vw - 32px));
}

.ci-modal--share {
  max-width: min(520px, calc(100vw - 32px));
}

.ci-modal-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  background: linear-gradient(135deg, #1a3a3f 0%, #0f282c 100%);
  color: #fff;
}

.ci-modal-hero__lead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ci-modal-hero__icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(0, 169, 181, 0.2);
  font-size: 18px;
}

.ci-modal-hero h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.ci-modal-hero__sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.ci-modal-hero__sub .ci-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 169, 181, 0.25);
  color: #b8f0f4;
  font-weight: 700;
  font-size: 11px;
}

.ci-modal-close {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  width: 32px;
  height: 32px;
}

.ci-tabs {
  display: flex;
  gap: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #fafcfd;
}

.ci-tab {
  padding: 10px 14px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.ci-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.ci-modal-scroll {
  overflow: auto;
  flex: 1;
  padding: 14px 18px 18px;
  min-height: 0;
}

/* ——— Case Information · Patient Journey ——— */
.ci-journey {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.ci-journey-section {
  min-width: 0;
}

.ci-journey-title {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #64748b;
}

.ci-workflow {
  overflow-x: auto;
  padding-bottom: 4px;
}

.ci-workflow__track {
  display: flex;
  align-items: flex-start;
  min-width: max-content;
  gap: 0;
}

.ci-wf-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 148px;
  flex-shrink: 0;
  text-align: center;
}

.ci-wf-step__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: #e2e8f0;
  color: #94a3b8;
}

.ci-wf-step--done .ci-wf-step__icon {
  background: #22c55e;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

.ci-wf-step__connector {
  flex: 0 0 36px;
  height: 3px;
  margin-top: 22px;
  background: #e2e8f0;
  border-radius: 2px;
}

.ci-wf-step__connector--done {
  background: #22c55e;
}

.ci-wf-step__label {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  min-height: 28px;
}

.ci-wf-step--pending .ci-wf-step__label {
  color: #94a3b8;
}

.ci-wf-step__time {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.35;
}

.ci-wf-step__performed {
  margin-top: 8px;
  font-size: 9px;
  color: #64748b;
  line-height: 1.35;
}

.ci-wf-performed-badge {
  display: inline-block;
  padding: 1px 6px;
  margin-bottom: 3px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-weight: 700;
  font-size: 8px;
}

.ci-inv-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ci-inv-card {
  border: 1px solid #dbeafe;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.ci-inv-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: linear-gradient(180deg, #eff6ff, #f8fbff);
  border-bottom: 1px solid #dbeafe;
}

.ci-inv-card__tube {
  display: inline-flex;
  color: var(--primary);
  flex-shrink: 0;
}

.ci-inv-card__name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
  min-width: 0;
}

.ci-inv-report-btn {
  padding: 4px 12px !important;
  font-size: 11px !important;
  min-height: 28px;
}

.ci-inv-status {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.ci-inv-status--signed {
  background: #22c55e;
  color: #fff;
}

.ci-inv-status--pending {
  background: #fffbeb;
  color: #b45309;
}

.ci-inv-collector {
  margin: 0;
  padding: 8px 12px 0;
  font-size: 11px;
  color: #64748b;
}

.ci-inv-collector strong {
  color: #334155;
  font-weight: 600;
}

.ci-inv-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.ci-inv-tl-item {
  min-width: 0;
  text-align: left;
}

.ci-inv-tl-item__icon {
  color: var(--primary);
  margin-bottom: 4px;
}

.ci-inv-tl-item__label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.ci-inv-tl-item__time {
  font-size: 10px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.ci-inv-tl-item__sub {
  font-size: 9px;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.3;
}

@media (max-width: 900px) {
  .ci-inv-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ci-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fafcfd;
}

.ci-modal-foot--split {
  justify-content: space-between;
}

.ci-modal-foot__right {
  display: flex;
  gap: 8px;
}

.ci-split-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fcfd, #fff);
}

.ci-split-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.ci-split-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(320px, 32%);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ci-split-preview {
  overflow: auto;
  padding: 16px;
  background: #eef2f4;
  border-right: 1px solid var(--line);
  min-height: 0;
}

.ci-split-preview--report {
  background: #525659;
  padding: 12px;
}

.ci-preview-shell.letter-preview,
.ci-split-preview .letter-preview {
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  margin: 0 auto;
  max-width: min(100%, 720px);
  padding: 16px 18px;
  box-sizing: border-box;
}

.ci-preview-shell .print-target,
.ci-split-preview .letter-preview .print-target {
  box-shadow: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.ci-preview-shell .ps-bill-receipt,
.ci-split-preview .letter-preview .ps-bill-receipt {
  box-shadow: none;
}

.ci-bill-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 12px 0 14px;
  font-size: 13px;
  line-height: 1.45;
}

.ci-bill-meta p {
  margin: 0 0 6px;
}

.ci-bill-doc--no-letterhead {
  padding-top: 0;
}

.ci-bill-totals {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.ci-bill-totals p {
  margin: 0 0 4px;
}

.ci-preview-shell .table:not(.ps-bill-table),
.ci-split-preview .letter-preview .table:not(.ps-bill-table),
.ci-bill-table {
  table-layout: auto;
  margin-top: 10px;
  border-radius: 6px;
}

.ci-preview-shell .table:not(.ps-bill-table) th,
.ci-preview-shell .table:not(.ps-bill-table) td,
.ci-split-preview .letter-preview .table:not(.ps-bill-table) th,
.ci-split-preview .letter-preview .table:not(.ps-bill-table) td,
.ci-bill-table th,
.ci-bill-table td {
  padding: 8px 10px;
  font-size: 12px;
  overflow-wrap: normal;
  word-break: normal;
}

.ci-preview-shell .ps-bill-receipt,
.ci-split-preview .letter-preview .ps-bill-receipt,
.pb-viewer__page-shell .ps-bill-receipt {
  box-shadow: none;
  border: none;
  border-radius: 0;
  margin: 0;
  padding: 0;
  background: #fff;
}

.ci-split-side {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  background: #fff;
  min-height: 0;
}

.ci-side-block {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef4f5;
}

.ci-side-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.ci-side-block h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ci-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ci-field input,
.ci-field select {
  height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.ci-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
  cursor: pointer;
}

.ci-btn-block {
  width: 100%;
  justify-content: center;
}

.ci-btn-wa {
  background: #059669;
  border-color: #059669;
}

.ci-side-table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ci-side-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: auto;
}

.ci-side-table th,
.ci-side-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #eef4f5;
  text-align: left;
  white-space: nowrap;
}

.ci-side-table th {
  background: #f4fafb;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 9px;
}

.ci-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.ci-info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ci-info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
}

.ci-info-row__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}

.ci-info-row__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ci-info-row__val {
  font-weight: 600;
  color: var(--text);
}

.ci-fin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ci-fin-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ci-fin-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: #ecfdf5;
  color: #059669;
}

.ci-fin-badge--due {
  background: #fff7ed;
  color: #c2410c;
}

.ci-fin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ci-fin-card {
  padding: 10px 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.ci-fin-card strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--text);
}

.ci-fin-card--green { background: linear-gradient(135deg, #ecfdf5, #fff); }
.ci-fin-card--purple { background: linear-gradient(135deg, #f5f3ff, #fff); }
.ci-fin-card--orange { background: linear-gradient(135deg, #fff7ed, #fff); }
.ci-fin-card--red { background: linear-gradient(135deg, #fef2f2, #fff); }
.ci-fin-card--cyan { background: linear-gradient(135deg, #ecfeff, #fff); }
.ci-fin-card--pink { background: linear-gradient(135deg, #fdf2f8, #fff); }

.ci-report-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.ci-report-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f4fafb;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.ci-report-block__count {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

.ci-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.ci-report-table th,
.ci-report-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef4f5;
  text-align: left;
}

.ci-report-table th {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  background: #fafcfd;
}

.ci-slip-preview-wrap {
  flex: 1;
  overflow: auto;
  padding: 16px;
  background: #525659;
}

.ci-slip-preview {
  background: #fff;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  font-size: 12px;
}

.ci-slip-preview h3 {
  text-align: center;
  margin: 0 0 4px;
  font-size: 14px;
}

.ci-slip-preview .ci-slip-bar {
  text-align: center;
  background: #f4fafb;
  padding: 6px;
  margin: 10px 0 14px;
  font-weight: 700;
  font-size: 11px;
}

.ps-slip-preview {
  max-width: 560px;
  padding: 28px 32px;
}

.ps-slip {
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.45;
}

.ps-slip__clinic {
  margin: 0 0 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ps-slip__bar {
  text-align: center;
  background: #ececec;
  padding: 7px 8px;
  margin: 0 0 14px;
  font-weight: 700;
  font-size: 12px;
  text-decoration: underline;
}

.ps-slip__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 28px;
  margin-bottom: 12px;
  font-size: 11px;
}

.ps-slip__meta p {
  margin: 0 0 5px;
}

.ps-slip__rule {
  border: none;
  border-top: 1px solid #333;
  margin: 10px 0 16px;
}

.ps-slip__params {
  margin-top: 4px;
}

.ps-slip__group {
  margin-bottom: 16px;
}

.ps-slip__group-title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 12px;
}

.ps-slip__param {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
}

.ps-slip__empty {
  margin: 0;
  color: #64748b;
  font-size: 11px;
}

.bs-slip-preview {
  max-width: 560px;
  padding: 28px 32px;
}

.bs-slip {
  color: #1e293b;
  font-size: 12px;
  line-height: 1.45;
}

.bs-slip__clinic {
  text-align: center;
  margin-bottom: 4px;
}

.bs-slip__clinic-name {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}

.bs-slip__clinic-addr {
  margin: 0 0 6px;
  font-size: 11px;
  color: #334155;
  line-height: 1.45;
}

.bs-slip__clinic-phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 11px;
  color: #334155;
}

.bs-slip__phone-icon {
  font-size: 12px;
  line-height: 1;
  opacity: 0.85;
}

.bs-slip__rule {
  border: none;
  border-top: 1px solid #cbd5e1;
  margin: 10px 0;
}

.bs-slip__title {
  margin: 10px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.bs-slip__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 14px 0 16px;
  font-size: 11px;
}

.bs-slip__meta-item {
  min-width: 0;
}

.bs-slip__meta-item strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 700;
}

.bs-slip__meta-item span {
  display: block;
  word-break: break-word;
}

.bs-slip__age-sex {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bs-slip__gender {
  font-size: 13px;
  line-height: 1;
}

.bs-slip__table-head,
.bs-slip__table-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  font-size: 11px;
}

.bs-slip__table-head {
  background: #e8f4f7;
  font-weight: 700;
}

.bs-slip__table-row + .bs-slip__table-row {
  border-top: 1px solid #f1f5f9;
}

.bs-slip__lab {
  flex: 1;
  min-width: 0;
}

.bs-slip__price {
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
}

.bs-slip__dot-rule {
  border: none;
  border-top: 1px dotted #94a3b8;
  margin: 12px 0;
}

.bs-slip__totals {
  margin-left: auto;
  width: min(200px, 100%);
  font-size: 11px;
  text-align: right;
}

.bs-slip__totals p {
  margin: 5px 0;
}

.bs-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cr-modal {
  max-width: min(480px, calc(100vw - 32px));
}

.cr-modal-body {
  padding: 18px 22px 8px;
}

.cr-form-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 14px;
}

.cr-form-row--remarks {
  align-items: start;
}

.cr-form-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.cr-form-value {
  font-size: 13px;
  color: #1e293b;
}

.cr-form-select,
.cr-form-textarea {
  width: 100%;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: #1e293b;
  font-family: inherit;
}

.cr-form-textarea {
  min-height: 72px;
  resize: vertical;
}

.ci-modal-foot--cr {
  justify-content: flex-end;
  padding: 12px 18px 16px;
}

.cr-cancel-btn {
  background: #e76f6f;
  border: none;
  color: #fff;
  font-weight: 600;
  min-width: 88px;
  padding: 8px 20px;
  border-radius: 6px;
}

.cr-cancel-btn:hover {
  background: #d85f5f;
}

.dc-modal-body {
  padding-top: 14px;
}

.dc-summary {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.dc-summary__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}

.dc-summary__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 2px;
}

.dc-summary__grid strong {
  font-size: 14px;
  color: #0f172a;
}

.dc-summary__due strong {
  color: #dc2626;
}

.cases-status--cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.ci-share-body {
  padding: 16px 18px 8px;
}

.ci-share-method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.ci-share-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.ci-share-method__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.ci-share-method__channel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.ci-share-method__opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding-top: 2px;
}

.ci-share-method__opts .ci-check {
  font-size: 11px;
}

.ci-share-channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.ci-share-channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.ci-share-channel__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.ci-share-channel__icon--wa {
  background: #dcfce7;
  color: #059669;
}

.ci-share-channel__icon--email {
  background: #fee2e2;
  color: #dc2626;
}

.ci-share-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.ci-share-others-field {
  display: block;
  margin: 0 0 10px;
}

.ci-share-others-field__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}

.ci-share-others-field input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  font-size: 13px;
  box-sizing: border-box;
}

.ci-modal--share {
  max-width: min(520px, calc(100vw - 24px));
}

.ci-share-to__label {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  position: relative;
}

.ci-share-to__label::before,
.ci-share-to__label::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--line);
}

.ci-share-to__label::before { left: 0; }
.ci-share-to__label::after { right: 0; }

.ci-share-to__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ci-share-status {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: 12px 0 0;
}

.ci-placeholder-tab {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .ci-modal--split,
  .ci-modal--report {
    height: auto;
    max-height: min(94vh, 100%);
  }

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

  .ci-split-preview {
    max-height: 42vh;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .ci-info-grid {
    grid-template-columns: 1fr;
  }
}

/* ——— Patient Bill modal (post-create) ——— */
.pb-modal-overlay.is-open {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.pb-modal {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.pb-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-shrink: 0;
}

.pb-modal__head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #374151;
}

.pb-modal__close {
  font-size: 22px;
  line-height: 1;
  color: #6b7280;
}

.pb-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.95fr);
  overflow: hidden;
}

.pb-viewer {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #525659;
}

.pb-viewer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #2b2b2b;
  color: #e8eaed;
  border-bottom: 1px solid #1f1f1f;
  flex-shrink: 0;
}

.pb-viewer__filename {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-viewer__tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pb-tool-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #e8eaed;
  font-size: 14px;
  cursor: pointer;
}

.pb-tool-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.pb-tool-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pb-viewer__page,
.pb-viewer__zoom {
  font-size: 12px;
  min-width: 42px;
  text-align: center;
}

.pb-viewer__stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  display: flex;
  justify-content: center;
}

.pb-viewer__canvas {
  transform-origin: top center;
  transition: transform 0.12s ease;
}

.pb-viewer__page-shell {
  background: transparent;
  box-shadow: none;
  max-width: none;
  width: auto;
  margin: 0;
}

.pb-a4-sheet {
  box-sizing: border-box;
  width: 210mm;
  min-height: 297mm;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.pb-viewer__page-shell .pb-a4-sheet .ci-preview-shell.letter-preview--a4,
.pb-viewer__page-shell .letter-preview--a4 {
  margin: 0;
  box-shadow: none;
  max-width: none;
  width: 100%;
  min-height: 297mm;
  padding: 0;
  background: #fff;
  box-sizing: border-box;
}

.pb-viewer__page-shell .pb-a4-sheet .ps-bill-receipt {
  box-sizing: border-box;
  width: 100%;
  min-height: 297mm;
  margin: 0;
}

.pb-side {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px;
  background: #fff;
  border-left: 1px solid #e5e7eb;
}

.pb-side-block {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef2f7;
}

.pb-side-block--history {
  border-bottom: none;
  margin-bottom: 0;
}

.pb-side-block__title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

.pb-side-block__title--line {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pb-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #374151;
  margin-bottom: 8px;
  cursor: pointer;
}

.pb-field {
  display: block;
  margin-bottom: 8px;
}

.pb-field__label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: #374151;
}

.pb-wa-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  padding: 0 10px;
  height: 36px;
  background: #fff;
}

.pb-wa-phone__flag {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.pb-wa-phone input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  color: #111827;
}

.pb-side-block__action {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.pb-btn-apply,
.pb-btn-share {
  min-width: 72px;
  min-height: 30px;
  font-size: 12px;
  font-weight: 600;
}

.pb-pay-table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #eef2f7;
  border-radius: 8px;
}

.pb-pay-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.pb-pay-table th,
.pb-pay-table td {
  padding: 8px 8px;
  border-bottom: 1px solid #f3f4f6;
  text-align: left;
  vertical-align: middle;
}

.pb-pay-table th {
  background: #f9fafb;
  color: #6b7280;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.pb-pay-dt {
  line-height: 1.35;
  white-space: normal;
}

.pb-pay-dt span {
  display: block;
}

.pb-pay-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: #ecfdf5;
  color: #059669;
}

.pb-pay-badge--due {
  background: #fef2f2;
  color: #dc2626;
}

.pb-pay-amt--due {
  color: #dc2626;
  font-weight: 700;
}

.pb-pay-row--due td {
  color: inherit;
}

#updateTxnType .pb-pay-badge {
  vertical-align: middle;
}

.pb-pay-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pb-pay-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
}

.pb-pay-action:hover {
  background: #eff6ff;
}

.pb-modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-shrink: 0;
}

.pb-modal__foot-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.pb-btn-close {
  min-height: 34px;
}

.pb-btn-report {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  font-weight: 600;
}

.pb-more-menu {
  position: relative;
}

.pb-more-menu__trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  cursor: pointer;
}

.pb-more-menu__trigger::-webkit-details-marker {
  display: none;
}

.pb-more-menu__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 160px;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 5;
}

.pb-more-menu__item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
}

.pb-more-menu__item:hover {
  background: #f3f4f6;
}

@media (max-width: 960px) {
  .pb-modal__body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(280px, 1fr) auto;
  }

  .pb-side {
    border-left: none;
    border-top: 1px solid #e5e7eb;
    max-height: 42vh;
  }
}

/* ——— Packages Master (Lab > Packages Master) ——— */
.tab-packages-master {
  padding-top: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.tab-packages-master .all-cases-table-wrap {
  overflow-x: hidden;
}

.tab-packages-master .pk-master-table thead th {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  position: static;
  right: auto;
  box-shadow: none;
}

.tab-packages-master .pk-master-table tbody td {
  padding: 8px 10px;
  font-size: 12px;
  position: static;
  right: auto;
  box-shadow: none;
  background: #fff;
}

.tab-packages-master .pk-master-table tbody tr:hover td {
  background: #f8fcfd;
}

.pk-master-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.pk-master-search {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1 1 320px;
  min-width: 0;
}

.pk-master-search__field {
  flex: 1 1 220px;
  max-width: 320px;
}

.pk-create-btn {
  flex-shrink: 0;
  height: 30px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 5px;
  white-space: nowrap;
}

.pk-master-table-wrap {
  margin-bottom: 0;
  overflow-x: hidden;
}

.pk-master-table.table,
.pk-master-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.pk-master-table col.pk-col-sr { width: 52px; }
.pk-master-table col.pk-col-name { width: 20%; }
.pk-master-table col.pk-col-gender { width: 76px; }
.pk-master-table col.pk-col-included { width: auto; }
.pk-master-table col.pk-col-actions { width: 52px; }
.pk-master-table col.pk-col-available { width: 100px; }

.pk-master-table thead th,
.pk-master-table tbody td {
  overflow: hidden;
  vertical-align: middle;
}

.pk-master-table tbody td:first-child {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.pk-master-table tbody td:nth-child(2) strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pk-master-table .pk-th-included,
.pk-master-table .pk-col-included {
  min-width: 0;
  width: auto;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pk-master-table .pk-th-gender,
.pk-master-table tbody td:nth-child(3) {
  width: 76px;
  white-space: nowrap;
}

.pk-master-table .pk-th-actions,
.pk-master-table .pk-col-actions {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  padding-left: 4px !important;
  padding-right: 4px !important;
  text-align: center;
  position: static;
  right: auto;
  box-shadow: none;
}

.pk-master-table .pk-th-available,
.pk-master-table .pk-available-cell {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  padding-left: 6px !important;
  padding-right: 6px !important;
  text-align: center;
  position: static;
  right: auto;
  box-shadow: none;
}

.pk-gender-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.pk-actions {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pk-actions .pt-act-btn--edit {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--accent);
}

.pk-actions .pt-act-btn--edit:hover {
  background: rgba(0, 169, 181, 0.12);
}

.pk-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  vertical-align: middle;
}

.pk-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.pk-toggle__track {
  position: relative;
  display: block;
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
}

.pk-toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 40, 44, 0.2);
  transition: transform 0.18s ease;
}

.pk-toggle--on .pk-toggle__track,
.pk-toggle input:checked + .pk-toggle__track {
  background: #2563eb;
}

.pk-toggle--off .pk-toggle__track,
.pk-toggle input:not(:checked) + .pk-toggle__track {
  background: #cbd5e1;
}

.pk-toggle input:checked + .pk-toggle__track::after {
  transform: translateX(18px);
}

.pk-toggle input:focus-visible + .pk-toggle__track {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.pk-modal-overlay {
  z-index: 1200;
}

.pk-modal {
  width: min(1020px, calc(100vw - 32px));
  max-width: min(1020px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: visible;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 40, 44, 0.14);
}

.pk-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.pk-modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.pk-modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}

.pk-modal-close:hover {
  background: rgba(15, 40, 44, 0.06);
  color: var(--text);
}

.pk-modal-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  padding: 20px 24px 24px;
  overflow: visible;
  overflow-x: hidden;
}

.pk-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 14px 20px;
  margin-bottom: 18px;
}

.pk-modal-ms-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  min-width: 0;
}

.pk-field {
  display: block;
  margin-bottom: 10px;
  line-height: 1.3;
}

.pk-field > input,
.pk-field > select,
.pk-field > textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
}

.pk-field-label,
.pk-field > span:first-child {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pk-req {
  display: inline;
  color: #e11d48;
  font-weight: 600;
  margin-left: 1px;
}

.pk-view-all {
  margin-left: auto;
  border: none;
  background: none;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.pk-view-all:hover {
  text-decoration: underline;
}

.pk-field input,
.pk-field select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}

.pk-field--ms {
  margin-bottom: 0;
  position: relative;
  overflow: visible;
  z-index: 1;
}

.pk-field--ms > .pk-field-label {
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 6px;
}

.pk-field--ms:focus-within {
  z-index: 30;
}

.pk-ms {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 48px;
  padding: 8px 12px 10px;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.pk-ms-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.pk-ms-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 8px 4px 10px;
  border-radius: 6px;
  background: #eef7f8;
  border: 1px solid rgba(0, 169, 181, 0.22);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}

.pk-ms-tag span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(420px, 100%);
}

.pk-ms-tag button {
  border: none;
  background: none;
  padding: 0;
  width: 14px;
  height: 14px;
  font-size: 13px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.pk-ms-tag button:hover {
  color: #e11d48;
}

.pk-ms-search {
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 13px;
  padding: 4px 0;
  background: transparent;
  color: var(--text);
}

.pk-ms-drop {
  position: absolute;
  left: -1px;
  right: -1px;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 40, 44, 0.12);
}

.pk-ms-drop.is-expanded {
  max-height: min(360px, 50vh);
}

.pk-ms-opt {
  display: block;
  width: 100%;
  border: none;
  background: #fff;
  text-align: left;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid #f1f5f6;
}

.pk-ms-opt:hover,
.pk-ms-opt:focus-visible {
  background: #eef7f8;
  outline: none;
}

.pk-ms-opt:last-child {
  border-bottom: none;
}

.pk-ms-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.pk-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  margin: 8px -24px -24px;
  border-top: 1px solid var(--line);
  background: #fafcfd;
  flex-shrink: 0;
}

body.pk-modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .pk-modal-ms-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .pk-modal-grid {
    grid-template-columns: 1fr;
  }

  .pk-master-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pk-create-btn {
    width: 100%;
  }
}

/* ——— Reports Master (Lab > Reports Master) ——— */
.tab-reports-master {
  padding-top: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.tab-reports-master .all-cases-table-wrap {
  overflow-x: hidden;
}

.rm-master-filters {
  margin-bottom: 6px;
}

.rm-master-filters__row {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
}

.rm-master-filters__row > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.rm-master-filters__actions {
  display: flex;
  align-items: flex-end;
  padding-bottom: 1px;
}

.rm-master-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.rm-master-toolbar__spacer {
  flex: 1;
}

.rm-master-table-wrap {
  margin-bottom: 0;
  overflow-x: hidden;
}

.rm-master-table.table,
.rm-master-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.rm-master-table col.rm-col-sr { width: 52px; }
.rm-master-table col.rm-col-name { width: 22%; }
.rm-master-table col.rm-col-short { width: 88px; }
.rm-master-table col.rm-col-category { width: 14%; }
.rm-master-table col.rm-col-sample { width: 84px; }
.rm-master-table col.rm-col-tests { width: auto; }
.rm-master-table col.rm-col-actions { width: 128px; }

.tab-reports-master .rm-master-table thead th {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  position: static;
  right: auto;
  box-shadow: none;
}

.tab-reports-master .rm-master-table tbody td {
  padding: 8px 10px;
  font-size: 12px;
  position: static;
  right: auto;
  box-shadow: none;
  background: #fff;
  vertical-align: top;
}

.tab-reports-master .rm-master-table tbody tr:hover td {
  background: #f8fcfd;
}

.rm-master-table .rm-col-sr,
.rm-master-table .all-cases-th--sr {
  width: 52px;
  text-align: center;
  color: var(--text-muted);
  vertical-align: middle;
}

.rm-master-table .rm-col-name,
.rm-master-table .rm-th-name {
  min-width: 0;
}

.rm-master-table .rm-col-name strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

.rm-master-table .rm-col-short,
.rm-master-table .rm-th-short {
  width: 88px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-master-table .rm-col-category,
.rm-master-table .rm-th-category {
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.rm-master-table .rm-col-sample,
.rm-master-table .rm-th-sample {
  width: 84px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.rm-master-table .rm-col-tests,
.rm-master-table .rm-th-tests {
  min-width: 0;
  width: auto;
}

.rm-master-table .rm-th-actions,
.rm-master-table .rm-col-actions {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
  padding-left: 4px !important;
  padding-right: 4px !important;
  text-align: center;
  position: static;
  right: auto;
  box-shadow: none;
  vertical-align: middle;
}

.rm-tests-single {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  word-break: break-word;
}

.rm-tests-empty {
  color: var(--text-muted);
}

.rm-tests-wrap {
  min-width: 0;
}

.rm-tests-list {
  margin: 0;
  padding: 0 0 0 14px;
  list-style: disc;
}

.rm-tests-list li {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  margin: 0 0 2px;
  word-break: break-word;
}

.rm-tests-wrap--collapsed .rm-tests-list li:nth-child(n + 4) {
  display: none;
}

.rm-tests-toggle {
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.rm-tests-toggle:hover {
  text-decoration: underline;
}

.rm-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: nowrap;
}

.rm-actions .pt-act-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--accent);
}

.rm-actions .pt-act-btn:hover {
  background: rgba(0, 169, 181, 0.12);
}

.rm-actions .pt-act-btn--delete:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.rm-modal-overlay {
  z-index: 1210;
}

.rm-modal {
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 40, 44, 0.14);
}

.rm-modal--print {
  width: min(960px, calc(100vw - 24px));
}

.rm-modal--edit {
  width: min(1020px, calc(100vw - 24px));
}

.rm-modal--view {
  width: min(1120px, calc(100vw - 24px));
  max-height: min(88vh, 720px);
}

.rm-modal--view .rm-modal-head h2 {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.rm-modal--view .rm-modal-scroll {
  padding: 14px 20px;
}

.rm-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 12px;
}

.rm-edit-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rm-edit-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rm-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.rm-modal-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.rm-modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  border-radius: 6px;
}

.rm-modal-close:hover {
  background: rgba(15, 40, 44, 0.06);
}

.rm-modal-scroll,
.rm-edit-scroll {
  padding: 16px 18px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.rm-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fafcfd;
}

.rm-view-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
  margin-bottom: 0;
}

.rm-view-grid--6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.rm-view-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.rm-view-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid #e8eef2;
  border-radius: 6px;
  background: #fafcfd;
}

.rm-view-item--inline {
  max-width: none;
}

.rm-view-item span {
  display: inline;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0;
  white-space: nowrap;
}

.rm-view-item span::after {
  content: ":";
}

.rm-view-item strong {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.rm-view-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  min-width: 0;
}

.rm-view-panel--meta {
  padding: 10px 14px;
  background: #fafcfd;
}

.rm-view-panel__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.rm-view-blocks-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.rm-view-blocks-row--single {
  grid-template-columns: 1fr;
}

.rm-view-blocks-row .rm-view-block:only-child {
  grid-column: 1 / -1;
}

.rm-view-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.rm-view-freq {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 0;
}

.rm-view-freq > span {
  display: inline;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0;
  flex-shrink: 0;
}

.rm-freq-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rm-freq-day {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.rm-freq-day.is-on::before {
  content: "✓ ";
  color: #16a34a;
}

.rm-view-tests-table {
  margin-bottom: 0;
  width: 100%;
  table-layout: auto;
}

.rm-view-tests-table th,
.rm-view-tests-table td {
  font-size: 12px;
  padding: 8px 12px;
  word-break: normal;
  white-space: normal;
  vertical-align: top;
}

.rm-view-block {
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fafcfd;
  min-width: 0;
  min-height: 64px;
}

.rm-view-block--plain {
  border: none;
  background: transparent;
  padding: 0;
  min-height: 0;
}

.rm-view-block span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.rm-view-block p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

.rm-print-split {
  display: grid;
  grid-template-columns: 1fr 240px;
  min-height: 420px;
  max-height: calc(100vh - 160px);
}

.rm-print-preview {
  background: #525659;
  padding: 12px;
  overflow: auto;
}

.rm-print-shell {
  max-width: 640px;
  margin: 0 auto;
}

.rm-print-shell:has(.rm-print-sheet--live) {
  max-width: 820px;
}

.rm-print-pdfbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #323639;
  color: #e8eaed;
  font-size: 11px;
  padding: 8px 12px;
  border-radius: 4px 4px 0 0;
}

.rm-print-pdfbar__file {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-print-sheet {
  background: #fff;
  padding: 24px 28px 28px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  font-size: 12px;
  line-height: 1.45;
  color: #111;
}

.rm-print-sheet--live {
  padding: 0;
  background: transparent;
  box-shadow: none;
  max-width: none;
}

.rm-print-sheet--live .rr-a4-sheet,
.rm-print-sheet--live .ci-preview-shell {
  margin: 0 auto;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.rm-print-sheet--live .lab-report-page {
  background: #fff;
}

.rm-print-patient {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 14px;
  font-size: 11px;
}

.rm-print-category {
  margin: 0 0 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.rm-print-title {
  margin: 0 0 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}

.rm-print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.rm-print-table thead th {
  background: #dbeafe;
  color: #1e3a5f;
  font-weight: 700;
  padding: 7px 8px;
  text-align: left;
  border: 1px solid #bfdbfe;
}

.rm-print-table tbody td {
  padding: 8px;
  border: 1px solid #e5e7eb;
  vertical-align: top;
}

.rm-print-td-test strong {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5px;
}

.rm-print-method {
  margin-top: 3px;
  font-size: 10px;
  color: #6b7280;
  font-weight: 400;
}

.rm-print-td-result {
  min-width: 72px;
}

.rm-print-td-unit,
.rm-print-td-range {
  white-space: pre-line;
  font-size: 10.5px;
}

.rm-print-interpret {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.5;
}

.rm-print-end {
  text-align: center;
  margin: 18px 0 0;
  font-size: 11px;
  color: #6b7280;
}

.rm-seq-name {
  word-break: normal;
  white-space: normal;
  line-height: 1.35;
}

.rm-print-sequence {
  padding: 14px 12px;
  border-left: 1px solid var(--line);
  background: #fff;
  overflow: auto;
}

.rm-print-sequence h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.rm-seq-table th,
.rm-seq-table td {
  font-size: 11px;
  padding: 6px 8px;
}

.rm-edit-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.rm-edit-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rm-edit-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rm-field {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

.rm-field > input,
.rm-field > select,
.rm-field > textarea {
  margin-top: 4px;
}

.rm-field--span2,
.rm-field--full {
  grid-column: 1 / -1;
}

.rm-field--block {
  margin-bottom: 10px;
}

.rm-field input,
.rm-field select,
.rm-field textarea {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}

.rm-field input,
.rm-field select {
  height: 34px;
}

.rm-field textarea {
  padding: 8px 10px;
  resize: vertical;
  min-height: 80px;
}

.rm-edit-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-bottom: 12px;
}

.rm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.rm-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.rm-toggle__track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  flex-shrink: 0;
}

.rm-toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.rm-toggle input:checked + .rm-toggle__track {
  background: var(--accent);
}

.rm-toggle input:checked + .rm-toggle__track::after {
  transform: translateX(16px);
}

.rm-frequency {
  border: none;
  margin: 0 0 12px;
  padding: 0;
}

.rm-frequency legend {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.rm-frequency__days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.rm-frequency__days label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

body.rm-modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .rm-master-filters__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rm-view-grid,
  .rm-view-grid--6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rm-view-blocks-row {
    grid-template-columns: 1fr;
  }

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

  .rm-print-sequence {
    border-left: none;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .rm-edit-grid,
  .rm-edit-grid--4,
  .rm-edit-grid--2 {
    grid-template-columns: 1fr;
  }

  .rm-view-grid,
  .rm-view-grid--6 {
    grid-template-columns: 1fr;
  }

  .modal-card.rm-modal--view {
    width: min(100vw - 16px, 100%);
    max-height: calc(100vh - 24px);
  }
}

/* ——— Test Master (Lab > Test Master) ——— */
.tab-test-master {
  padding-top: 0;
}

.tm-master-filters__row {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: end;
}

.tm-master-filters__row > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.tm-master-filters__actions {
  display: flex;
  align-items: flex-end;
  padding-bottom: 1px;
}

.tm-modal-overlay {
  z-index: 1220;
}

.tm-modal--edit {
  width: min(1020px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}

.tm-edit-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.tm-edit-scroll {
  padding: 14px 18px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.tm-edit-grid {
  display: grid;
  gap: 10px 12px;
  margin-bottom: 12px;
}

.tm-edit-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tm-edit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 10px;
}

.tm-edit-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.tm-edit-link:hover {
  text-decoration: underline;
}

.tm-edit-panel {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #eef4f5;
  border-radius: 6px;
  background: #fafcfd;
}

.tm-nv-summary {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.tm-nv-modal-overlay {
  z-index: 1260;
}

.tm-nv-modal {
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}

.tm-nv-notes {
  padding: 10px 18px 0;
  font-size: 12px;
  color: #475569;
}

.tm-nv-notes ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.tm-nv-notes li {
  margin-bottom: 4px;
}

.tm-nv-scroll {
  padding: 12px 18px;
}

.tm-nv-card {
  position: relative;
  border: 1px solid #b8d4e8;
  border-radius: 4px;
  background: #f3f9fc;
  padding: 14px 14px 12px;
  margin-bottom: 12px;
}

.tm-nv-remove {
  border: none;
  background: none;
  padding: 0;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.tm-nv-remove:hover {
  text-decoration: underline;
}

.tm-nv-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 10px;
}

.tm-nv-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.tm-nv-field input,
.tm-nv-field select {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.tm-nv-field--block {
  margin-bottom: 8px;
}

.tm-nv-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tm-nv-stack__title {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.tm-nv-age {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
}

.tm-nv-age input {
  min-width: 0;
}

.tm-nv-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.tm-nv-foot {
  justify-content: space-between;
  align-items: center;
}

.tm-nv-add-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.tm-nv-add-link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .tm-nv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .tm-nv-grid {
    grid-template-columns: 1fr;
  }
}

.tm-hint {
  font-weight: 500;
  color: var(--text-muted);
}

.tm-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
  cursor: pointer;
}

.tm-edit-advanced {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
}

.tm-edit-advanced summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.tm-edit-advanced .tm-edit-grid {
  margin-top: 10px;
  margin-bottom: 0;
}

.tm-field--check {
  justify-content: flex-end;
}

.tm-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-right: 12px;
}

body.tm-modal-open {
  overflow: hidden;
}

.tm-view-params-wrap {
  margin-top: 0;
  overflow-x: hidden;
  max-width: 100%;
}

.tm-view-params-table {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  table-layout: fixed;
}

.tm-view-params-table th,
.tm-view-params-table td {
  padding: 8px 12px;
  vertical-align: top;
  word-break: normal;
  white-space: normal;
}

.tm-view-params-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.tm-view-block--params > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.tm-view-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .tm-edit-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tm-edit-grid--4 {
    grid-template-columns: 1fr;
  }

  .tm-master-filters__row {
    grid-template-columns: 1fr;
  }
}

/* ——— Test Categories (Lab > Test Category) ——— */
.tab-test-categories {
  padding-top: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.tc-cat-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tc-cat-search {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1 1 280px;
  min-width: 0;
}

.tc-cat-search__field {
  flex: 1 1 220px;
  max-width: 320px;
}

.tc-cat-table-wrap {
  margin-bottom: 0;
  overflow-x: hidden;
}

.tc-cat-table.table,
.tc-cat-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-test-categories .tc-cat-table thead th {
  position: static;
  padding: 10px 12px;
  white-space: nowrap;
}

.tab-test-categories .tc-cat-table tbody td {
  padding: 10px 12px;
}

.tc-th-order {
  width: 108px;
}

.tc-th-icon {
  width: 72px;
  text-align: center;
}

.tc-th-toggle {
  width: 118px;
  text-align: center;
}

.tc-cat-table th.tc-th-icon,
.tc-cat-table th.tc-th-toggle {
  text-align: center;
}

.tc-cat-table thead th:nth-child(2) {
  width: auto;
}

.tc-order-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.tc-order-drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: grab;
  user-select: none;
}

.tc-order-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  min-width: 14px;
}

.tc-order-move {
  display: inline-flex;
  flex-direction: column;
  gap: 0;
  margin-left: 4px;
  flex-shrink: 0;
}

.tc-order-move button {
  border: none;
  background: none;
  padding: 0;
  line-height: 1;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
}

.tc-order-move button:hover {
  color: var(--accent);
}

.tc-cat-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  max-width: 100%;
  min-width: 0;
}

.tc-cat-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px solid rgba(15, 40, 44, 0.12);
}

.tc-cat-icon-cell {
  text-align: center;
}

.tc-cat-icon-cell .pt-act-btn {
  color: var(--accent);
}

.tc-cat-toggle-cell {
  text-align: center;
}

.tc-cat-modal-overlay {
  z-index: 1230;
}

.tc-cat-modal {
  width: min(420px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
}

.tc-cat-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 16px 18px 0;
}

.tc-cat-form .rm-field {
  margin-bottom: 0;
}

.tc-cat-error {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #e11d48;
}

.tc-cat-error[hidden] {
  display: none;
}

.tc-cat-color-select {
  width: 100%;
}

.tc-cat-color-preview {
  display: inline-block;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  margin-top: 6px;
  background: #e2e8f0;
}

body.tc-cat-modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .tc-cat-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tc-cat-search__field {
    max-width: none;
  }

  .tc-cat-toolbar .pk-create-btn {
    width: 100%;
  }
}

/* ——— Interpretation (Lab > Interpretation) ——— */
.tab-interpretation {
  padding-top: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.interp-filters {
  margin-bottom: 8px;
}

.interp-filters__row {
  grid-template-columns: minmax(0, 1.4fr) auto;
  align-items: end;
}

.interp-filters__row > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.interp-filters__actions {
  display: flex;
  align-items: flex-end;
  padding-bottom: 1px;
}

.interp-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.interp-tabs__btn {
  border: none;
  background: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.interp-tabs__btn.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.interp-tabs__btn:hover:not(.is-active) {
  color: var(--text);
}

.interp-toolbar {
  margin-bottom: 8px;
}

.interp-table-wrap {
  margin-bottom: 0;
  overflow-x: hidden;
}

.interp-table.table,
.interp-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.interp-modal-overlay {
  z-index: 1240;
}

.interp-sub-modal-overlay {
  z-index: 1250;
}

.interp-modal--view {
  width: min(920px, calc(100vw - 24px));
}

.interp-sub-modal {
  width: min(960px, calc(100vw - 24px));
}

.interp-modal--edit {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}

.interp-edit-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.interp-edit-scroll {
  padding: 14px 18px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.interp-edit-meta {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text);
}

.interp-edit-meta strong {
  font-weight: 700;
}

.interp-edit-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.interp-editor {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.interp-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.interp-tool-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.interp-tool-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.interp-tool-btn:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent);
}

.interp-editor textarea {
  width: 100%;
  border: none;
  outline: none;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  min-height: 220px;
  font-family: inherit;
  color: var(--text);
}

.interp-view-text {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text);
}

.interp-view-category {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.interp-view-category strong {
  color: var(--text);
  font-weight: 600;
}

.rm-view-grid--interp {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.interp-view-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.interp-view-note span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.interp-view-note p {
  margin: 0;
  font-size: 12px;
  color: var(--text);
}

.interp-view-comment-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}

.interp-view-comment-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.interp-view-comment-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.interp-view-foot {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.interp-view-foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.interp-view-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.interp-view-link:hover {
  text-decoration: underline;
}

.interp-view-link svg {
  flex-shrink: 0;
}

.interp-values-table-wrap {
  overflow-x: hidden;
}

.interp-values-table {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  border-collapse: collapse;
}

.interp-values-table thead th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  text-align: left;
}

.interp-values-table tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
  vertical-align: middle;
}

.interp-values-table--possible {
  max-width: 420px;
}

.interp-td-center {
  text-align: center;
}

.interp-empty-msg {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

body.interp-modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .rm-view-grid--interp {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .interp-view-notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .interp-filters__row {
    grid-template-columns: 1fr;
  }

  .rm-view-grid--interp {
    grid-template-columns: 1fr;
  }

  .interp-view-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .interp-view-foot .btn {
    align-self: flex-end;
  }
}

/* ——— Test Count (Lab > Test Count) ——— */
.tab-test-counts {
  padding-top: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.tc-counts-filters {
  margin-bottom: 10px;
}

.tc-counts-filters__row {
  grid-template-columns: minmax(200px, 1.1fr) minmax(0, 1.2fr) auto;
  align-items: end;
}

.tc-counts-filters__row > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.tc-counts-filters__actions {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding-bottom: 1px;
}

.tc-counts-table-wrap {
  margin-bottom: 0;
  overflow-x: hidden;
}

.tc-counts-table.table,
.tc-counts-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-test-counts .tc-counts-table thead th {
  position: static;
  padding: 10px 10px;
  white-space: nowrap;
}

.tab-test-counts .tc-counts-table tbody td {
  padding: 10px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-test-counts .tc-counts-table .all-cases-th--sr {
  width: 52px;
}

.tab-test-counts .tc-counts-table thead th:nth-child(2) {
  width: auto;
  min-width: 0;
}

.tc-th-kind {
  width: 118px;
}

.tc-th-num {
  width: 96px;
  text-align: right;
}

.tc-counts-table th.tc-th-num:last-child {
  width: 108px;
}

.tc-counts-table th.tc-th-num {
  text-align: right;
}

.tc-counts-table td.tc-col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.tc-kind-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.tc-kind-badge--report {
  background: #dcfce7;
  color: #166534;
}

.tc-kind-badge--package {
  background: #ede9fe;
  color: #5b21b6;
}

.tc-kind-badge--test {
  background: #e0f2fe;
  color: #0369a1;
}

.tc-counts-totals {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  padding: 12px 4px 4px;
  border-top: 1px solid var(--line);
  margin-top: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.tc-counts-totals strong {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .tc-counts-filters__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tc-counts-filters__actions {
    grid-column: 1 / -1;
  }
}

/* ——— Test Result Analysis (Lab > Test Result Analysis) ——— */
.tab-test-analysis {
  padding-top: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.tra-filters {
  margin-bottom: 8px;
}

.tra-filters__row--primary {
  grid-template-columns: minmax(200px, 1.15fr) repeat(4, minmax(0, 1fr));
  align-items: end;
  column-gap: 8px;
}

.tra-filters__row--primary > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.tra-filters .tra-filters__row--actions {
  display: grid;
  grid-template-columns: minmax(88px, 0.75fr) minmax(0, 1fr) minmax(0, 1fr) auto auto minmax(12px, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
  flex-wrap: nowrap;
}

.tra-filters .tra-filters__row--actions > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.tra-filters .tra-filters__row--actions .all-cases-field--compact {
  min-width: 0;
}

.tra-filters .tra-filters__row--actions .all-cases-filters__spacer {
  min-width: 0;
}

.tra-filters .tra-filters__row--actions .table-export-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-self: end;
}

.tra-filters .tra-filters__row--actions .table-export-btn {
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 10px;
}

.tra-tabs {
  margin-bottom: 8px;
}

.tra-table-wrap {
  margin-bottom: 0;
  overflow-x: hidden;
}

.tra-table.table,
.tra-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-test-analysis .tra-table thead th {
  position: static;
  padding: 9px 8px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-test-analysis .tra-table tbody td {
  padding: 9px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.tab-test-analysis .tra-table .all-cases-th--sr {
  width: 48px;
}

.tab-test-analysis .tra-table thead th:nth-child(2) {
  width: 9%;
}

.tab-test-analysis .tra-table thead th:nth-child(3) {
  width: 8%;
}

.tab-test-analysis .tra-table .all-cases-th--patient {
  width: 14%;
  min-width: 0;
}

.tra-th-gender {
  width: 5%;
  min-width: 52px;
}

.tab-test-analysis .tra-table thead th:nth-child(6) {
  width: 12%;
}

.tab-test-analysis .tra-table thead th:nth-child(7) {
  width: 12%;
}

.tra-th-result,
.tra-th-flag {
  width: 6%;
  min-width: 52px;
  text-align: center;
}

.tra-th-unit {
  width: 6%;
  min-width: 48px;
}

.tab-test-analysis .tra-table thead th:nth-child(10) {
  width: 14%;
  min-width: 0;
}

.tra-table td.tra-col-result,
.tra-table td.tra-col-flag {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tra-table td.tra-col-result.result-high,
.tra-table td.tra-col-flag.result-high {
  color: #b91c1c;
  font-weight: 700;
}

.tra-table td.tra-col-result.result-low,
.tra-table td.tra-col-flag.result-low {
  color: #1d4ed8;
  font-weight: 700;
}

.tra-table td.tra-col-gender {
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .tra-filters__row--primary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tra-filters .tra-filters__row--actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  }

  .tra-filters .tra-filters__row--actions .all-cases-filters__spacer {
    display: none;
  }

  .tra-filters .tra-filters__row--actions .table-export-group {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 640px) {
  .tra-filters__row--primary {
    grid-template-columns: 1fr;
  }

  .tra-filters .tra-filters__row--actions {
    grid-template-columns: 1fr;
  }

  .tra-filters .tra-filters__row--actions .table-export-group {
    justify-self: stretch;
    flex-wrap: wrap;
  }
}

/* ——— TAT Dashboard (Lab > TAT Report) ——— */
.tab-tat-report {
  padding-top: 0;
  max-width: 100%;
}

.tat-filters {
  margin-bottom: 8px;
}

.tat-filters__row--primary {
  grid-template-columns: minmax(0, 1.1fr) minmax(120px, 0.75fr) minmax(120px, 0.75fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1fr);
  align-items: end;
  column-gap: 8px;
}

.tat-filters__row--primary > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.tat-filters .tat-filters__row--actions {
  display: grid;
  grid-template-columns: auto auto minmax(12px, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}

.tat-tabs {
  margin-bottom: 8px;
}

.tat-table-wrap {
  margin-bottom: 0;
  overflow-x: hidden;
}

.tat-table.table,
.tat-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-tat-report .tat-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  padding: 9px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  vertical-align: bottom;
}

.tab-tat-report .tat-table tbody td {
  padding: 9px 10px;
  font-size: 12px;
  vertical-align: middle;
  white-space: nowrap;
}

.tat-col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tat-col-action {
  text-align: center;
}

.tat-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.tat-status--ok {
  background: #dcfce7;
  color: #166534;
}

.tat-status--pending {
  background: #fef9c3;
  color: #854d0e;
}

.tat-status--bad {
  background: #fee2e2;
  color: #b91c1c;
}

.tat-empty {
  text-align: center;
  padding: 28px 12px !important;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .tat-filters__row--primary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tat-filters__row--primary,
  .tat-filters .tat-filters__row--actions {
    grid-template-columns: 1fr;
  }
}

/* ——— Sample Type Master (Lab > Sample Type Master) ——— */
.tab-sample-types {
  padding-top: 0;
}

.stm-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.stm-search {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.stm-search__field {
  flex: 1;
  max-width: 320px;
  min-width: 160px;
}

.stm-table-wrap {
  margin-bottom: 0;
}

.stm-th-color {
  width: 120px;
}

.stm-th-duration {
  width: 110px;
}

.stm-type-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stm-color-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.stm-color-label {
  font-size: 12px;
  color: var(--text-muted);
}

.stm-modal-overlay {
  z-index: 1235;
}

.stm-modal {
  width: min(780px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
}

.stm-form {
  padding: 16px 18px 18px;
}

.stm-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 12px;
}

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

.stm-form .rm-field {
  margin-bottom: 14px;
}

.stm-error {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #e11d48;
}

.stm-error[hidden] {
  display: none;
}

.stm-color-select {
  width: 100%;
}

.stm-color-preview {
  display: inline-block;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  margin-top: 6px;
  background: #e2e8f0;
}

body.stm-modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .stm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .stm-search__field {
    max-width: none;
  }

  .stm-toolbar .pk-create-btn {
    align-self: flex-end;
  }

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

/* ——— Rack Master (Manage > Rack Master) ——— */
.tab-rack-master {
  padding-top: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.rk-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.rk-filter {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.rk-filter__field {
  min-width: 200px;
  max-width: 280px;
}

.rk-table-wrap {
  margin-bottom: 0;
  overflow-x: hidden;
}

.rk-table.table,
.rk-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-rack-master .rk-table thead th {
  position: static;
  padding: 10px 12px;
  white-space: nowrap;
}

.tab-rack-master .rk-table tbody td {
  padding: 10px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-rack-master .rk-table .all-cases-th--sr {
  width: 52px;
}

.tab-rack-master .rk-table thead th:nth-child(2) {
  width: auto;
  min-width: 0;
}

.rk-th-num {
  width: 72px;
  text-align: center;
}

.tab-rack-master .rk-table .all-cases-th--actions {
  width: 96px;
  text-align: center;
  position: static;
  box-shadow: none;
}

.tab-rack-master .rk-table .all-cases-actions {
  position: static;
  box-shadow: none;
  text-align: center;
  white-space: nowrap;
}

.rk-table th.rk-th-num {
  text-align: center;
}

.rk-table td.rk-col-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.rk-modal-overlay {
  z-index: 1240;
}

.rk-modal {
  width: min(480px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
}

.rk-form {
  padding: 16px 18px 18px;
}

.rk-form .rm-field {
  margin-bottom: 14px;
}

.rk-dim-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 8px 10px;
  align-items: end;
  margin-bottom: 6px;
}

.rk-dim-row .rm-field {
  margin-bottom: 0;
}

.rk-dim-x,
.rk-dim-eq {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 8px;
  text-align: center;
}

.rk-dim-row input[readonly] {
  background: #f1f5f9;
  color: var(--text);
  cursor: default;
}

.rk-error {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #e11d48;
}

.rk-error[hidden] {
  display: none;
}

body.rk-modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .rk-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .rk-filter__field {
    max-width: none;
  }

  .rk-toolbar .pk-create-btn {
    align-self: flex-end;
  }

  .rk-dim-row {
    grid-template-columns: 1fr 1fr;
  }

  .rk-dim-x,
  .rk-dim-eq {
    display: none;
  }

  .rk-dim-row .rm-field:last-child {
    grid-column: 1 / -1;
  }
}

/* ——— Outsource Report Master (Outsource > Outsource Report) ——— */
.tab-outsource-report {
  padding-top: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.osr-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.osr-search {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.osr-search__field {
  flex: 1;
  max-width: 320px;
  min-width: 160px;
}

.osr-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.osr-more-btn {
  min-width: 36px;
  width: 36px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.osr-table-wrap {
  margin-bottom: 0;
  overflow-x: hidden;
}

.osr-table.table,
.osr-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-outsource-report .osr-table thead th {
  position: static;
  padding: 10px 12px;
  white-space: nowrap;
}

.tab-outsource-report .osr-table tbody td {
  padding: 10px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-outsource-report .osr-table .all-cases-th--sr {
  width: 52px;
}

.tab-outsource-report .osr-table thead th:nth-child(2) {
  width: auto;
  min-width: 0;
}

.osr-th-short {
  width: 14%;
}

.osr-th-gender {
  width: 88px;
}

.osr-th-available {
  width: 118px;
  text-align: center;
}

.tab-outsource-report .osr-table .all-cases-th--actions {
  width: 88px;
  text-align: center;
  position: static;
  box-shadow: none;
}

.tab-outsource-report .osr-table .all-cases-actions {
  position: static;
  box-shadow: none;
  text-align: center;
  white-space: nowrap;
}

.osr-table th.osr-th-available {
  text-align: center;
}

.osr-table td.osr-available-cell {
  text-align: center;
}

/* ——— Outsource Cases (Outsource > Outsource Cases) ——— */
.tab-all-cases {
  max-width: 100%;
  overflow-x: hidden;
}

.tab-all-cases--outsource {
  max-width: 100%;
  overflow-x: hidden;
}

.tab-all-cases--outsource .all-cases-table-wrap {
  overflow-x: hidden;
}

.tab-all-cases--outsource .all-cases-table.table,
.tab-all-cases--outsource .all-cases-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.tab-all-cases--outsource .all-cases-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
}

.tab-all-cases--outsource .all-cases-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
}

.tab-all-cases--outsource .ac-col-expand { width: 28px; }
.tab-all-cases--outsource .ac-col-sr { width: 40px; }
.tab-all-cases--outsource .ac-col-case { width: 7%; }
.tab-all-cases--outsource .ac-col-type { width: 5%; }
.tab-all-cases--outsource .ac-col-invoice { width: 8%; }
.tab-all-cases--outsource .ac-col-dt { width: 8%; }
.tab-all-cases--outsource .ac-col-patient { width: 12%; }
.tab-all-cases--outsource .ac-col-ref { width: 9%; }
.tab-all-cases--outsource .ac-col-cc { width: 7%; }
.tab-all-cases--outsource .ac-col-money { width: 6%; }
.tab-all-cases--outsource .ac-col-status { width: 8%; }
.tab-all-cases--outsource .ac-col-actions { width: 118px; }

.tab-all-cases--outsource .all-cases-th--patient,
.tab-all-cases--outsource .all-cases-col-patient {
  min-width: 0;
  max-width: none;
}

.tab-all-cases--outsource .all-cases-col-status,
.tab-all-cases--outsource .all-cases-th--status {
  min-width: 0;
  max-width: none;
}

.tab-all-cases--outsource .all-cases-th--actions,
.tab-all-cases--outsource .all-cases-col-actions {
  position: static;
  box-shadow: none;
  width: 118px;
  overflow: visible;
}

.tab-all-cases--outsource .all-cases-actions {
  white-space: nowrap;
}

.tab-all-cases--outsource .all-cases-col-datetime {
  font-size: 10px;
}

.tab-all-cases--outsource .cases-dt__date,
.tab-all-cases--outsource .cases-dt__time {
  font-size: 10px;
}

.osr-modal-overlay {
  z-index: 1245;
}

.osr-modal {
  width: min(900px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
}

.osr-form {
  padding: 16px 18px 18px;
}

.osr-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 12px;
}

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

.osr-form .rm-field {
  margin-bottom: 14px;
}

.osr-error {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #e11d48;
}

.osr-error[hidden] {
  display: none;
}

body.osr-modal-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .osr-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .osr-search__field {
    max-width: none;
  }

  .osr-toolbar__actions {
    justify-content: flex-end;
  }

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

  .osr-field--full {
    grid-column: auto;
  }
}

/* ——— Daily Business Reports (Business > Daily Business Reports) ——— */
.tab-daily-business {
  padding-top: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.dbr-filters {
  margin-bottom: 8px;
}

.dbr-filters__row {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(120px, 0.7fr) auto;
  column-gap: 8px;
  row-gap: 8px;
  align-items: end;
}

.dbr-filters__row > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.dbr-filters .all-cases-field--duration-date {
  min-width: 0;
}

.dbr-filters .sr-filter-duration-date select {
  flex: 0 0 92px;
  width: 92px;
  min-width: 92px;
}

.dbr-filters .sr-filter-duration-date input[type="date"] {
  flex: 1 1 0;
  min-width: 0;
  max-width: 132px;
}

.dbr-filters__row > .all-cases-field:nth-child(2) select {
  max-width: 160px;
}

.dbr-filters__actions {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding-bottom: 1px;
  flex-wrap: nowrap;
  justify-self: end;
  white-space: nowrap;
}

.dbr-filters__actions .table-export-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.dbr-filters__actions .table-export-btn {
  padding-left: 10px;
  padding-right: 10px;
}

.dbr-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.dbr-more-btn {
  min-width: 36px;
  width: 36px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.dbr-summary {
  position: relative;
  margin-bottom: 10px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dbr-summary__ribbon {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 0 8px 0 8px;
}

.dbr-summary__equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  padding-right: 72px;
}

.dbr-summary__equation .dbr-sum-op {
  color: var(--text-muted);
  font-weight: 500;
}

.dbr-summary__equation .dbr-sum-val {
  font-variant-numeric: tabular-nums;
}

.dbr-summary__equation .dbr-sum-net {
  color: var(--accent);
}

.dbr-summary__date {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.dbr-summary__payments {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
}

.dbr-pay-chip {
  padding: 6px 8px;
  border: 1px solid #eef4f5;
  border-radius: 6px;
  background: #fafcfd;
  min-width: 0;
}

.dbr-pay-chip__label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dbr-pay-chip__val {
  display: block;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dbr-tabs {
  margin-bottom: 8px;
}

.dbr-table-wrap {
  margin-bottom: 0;
  overflow-x: hidden;
}

.dbr-cases-table.table,
.dbr-cases-table.all-cases-table.table,
.dbr-txn-table.table,
.dbr-txn-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-daily-business .dbr-cases-table thead th,
.tab-daily-business .dbr-txn-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.tab-daily-business .dbr-cases-table tbody td,
.tab-daily-business .dbr-txn-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cases table columns */
.tab-daily-business .dbr-cases-table .all-cases-th--expand {
  width: 28px;
}

.tab-daily-business .dbr-cases-table thead th:nth-child(2) {
  width: 7%;
}

.tab-daily-business .dbr-cases-table thead th:nth-child(3) {
  width: 9%;
}

.dbr-th-emp {
  width: 56px;
}

.tab-daily-business .dbr-cases-table .all-cases-th--patient {
  width: 12%;
  min-width: 0;
}

.dbr-th-age {
  width: 6%;
}

.tab-daily-business .dbr-cases-table thead th:nth-child(7),
.tab-daily-business .dbr-cases-table thead th:nth-child(8) {
  width: 8%;
}

.tab-daily-business .dbr-cases-table thead th:nth-child(9) {
  width: 6%;
}

.tab-daily-business .dbr-cases-table .all-cases-th--money {
  width: 6%;
}

.dbr-th-status {
  width: 7%;
}

.dbr-th-view {
  width: 44px;
  text-align: center;
}

/* Transactions table columns */
.tab-daily-business .dbr-txn-table thead th:nth-child(1) {
  width: 8%;
}

.tab-daily-business .dbr-txn-table thead th:nth-child(2) {
  width: 10%;
}

.tab-daily-business .dbr-txn-table .all-cases-th--patient {
  width: 14%;
  min-width: 0;
}

.tab-daily-business .dbr-txn-table thead th:nth-child(4),
.tab-daily-business .dbr-txn-table thead th:nth-child(5) {
  width: 9%;
}

.dbr-th-info {
  width: 40px;
  text-align: center;
}

.dbr-th-type {
  width: 72px;
}

.tab-daily-business .dbr-txn-table .all-cases-th--money {
  width: 8%;
}

.tab-daily-business .dbr-txn-table thead th:nth-child(9) {
  width: 8%;
}

.tab-daily-business .dbr-txn-table .dbr-th-view {
  width: 48px;
}

.dbr-th-emp,
.dbr-th-age,
.dbr-th-status,
.dbr-th-view,
.dbr-th-info,
.dbr-th-type {
  white-space: nowrap;
}

.dbr-cases-table .all-cases-col-patient,
.dbr-txn-table .all-cases-col-patient {
  min-width: 0;
  max-width: none;
}

.dbr-patient-cell {
  min-width: 0;
  overflow: hidden;
}

.dbr-patient-cell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dbr-patient-cell small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dbr-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.dbr-status--ok {
  background: #dbeafe;
  color: #1d4ed8;
}

.dbr-status--due {
  background: #ffedd5;
  color: #c2410c;
}

.dbr-txn-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #dcfce7;
  color: #166534;
}

.dbr-txn-type--refund {
  background: #fee2e2;
  color: #b91c1c;
}

.dbr-txn-amt {
  color: #15803d;
  font-weight: 700;
}

.dbr-detail-row td {
  background: #f8fafc;
}

.dbr-detail-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  padding: 8px 4px;
  font-size: 12px;
}

.dbr-info-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

@media (max-width: 1100px) {
  .dbr-summary__payments {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dbr-filters__row {
    grid-template-columns: 1fr 1fr;
  }

  .dbr-filters__actions {
    grid-column: 1 / -1;
  }
}

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

  .dbr-filters__row {
    grid-template-columns: 1fr;
  }
}

/* ——— Transactions (Business > Transactions) ——— */
.tab-transactions {
  padding-top: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.txn-filters {
  margin-bottom: 8px;
}

.txn-filters__row {
  display: grid;
  grid-template-columns:
    minmax(96px, 0.7fr)
    minmax(96px, 0.7fr)
    minmax(88px, 0.8fr)
    minmax(76px, 0.68fr)
    minmax(76px, 0.68fr)
    minmax(72px, 0.62fr)
    minmax(72px, 0.62fr)
    auto;
  column-gap: 6px;
  row-gap: 8px;
  align-items: end;
}

.txn-filters__row > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.txn-filters__actions {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
  justify-self: end;
}

.txn-filters__actions .table-export-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.txn-filters__actions .table-export-btn {
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
}

.txn-more-btn {
  min-width: 36px;
  width: 36px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.txn-table-wrap {
  margin-bottom: 0;
  overflow-x: hidden;
}

.txn-table.table,
.txn-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-transactions .txn-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.tab-transactions .txn-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-transactions .txn-table .all-cases-th--sr {
  width: 40px;
}

.txn-th-datetime {
  width: 9%;
}

.tab-transactions .txn-table thead th:nth-child(3) {
  width: 7%;
}

.tab-transactions .txn-table .all-cases-th--patient {
  width: 12%;
  min-width: 0;
}

.tab-transactions .txn-table thead th:nth-child(5) {
  width: 9%;
}

.txn-th-cc,
.txn-th-view {
  width: 56px;
  text-align: center;
}

.txn-th-type {
  width: 72px;
}

.tab-transactions .txn-table .all-cases-th--money {
  width: 8%;
}

.tab-transactions .txn-table thead th:nth-child(9) {
  width: 7%;
}

.txn-th-detail {
  width: 10%;
  min-width: 0;
}

.tab-transactions .txn-table .txn-th-view {
  width: 44px;
}

.txn-table th.txn-th-cc,
.txn-table th.txn-th-view {
  text-align: center;
}

.tab-transactions .txn-table .all-cases-col-patient {
  min-width: 0;
  max-width: none;
}

.tab-transactions .txn-table .all-cases-col-patient strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.txn-date-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
  min-width: 0;
}

.txn-date-stack__date {
  font-size: 11px;
  font-weight: 600;
}

.txn-date-stack__time {
  font-size: 10px;
  color: var(--text-muted);
}

.tab-transactions .txn-table td.txn-th-view {
  overflow: visible;
  text-overflow: clip;
}

.tab-transactions .txn-table td.txn-th-cc {
  overflow: visible;
  text-overflow: clip;
}

.txn-cc-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.txn-cc-label {
  font-size: 12px;
}

.txn-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #dcfce7;
  color: #166534;
}

.txn-type-badge--refund {
  background: #fee2e2;
  color: #b91c1c;
}

.txn-amt-received {
  color: #15803d;
  font-weight: 700;
}

.txn-amt-refund {
  color: #b91c1c;
  font-weight: 700;
}

@media (max-width: 1280px) {
  .txn-filters__row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .txn-filters__actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: flex-end;
  }
}

@media (max-width: 900px) {
  .txn-filters__row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .txn-filters__row {
    grid-template-columns: 1fr 1fr;
  }

  .txn-filters__actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* Business Analysis */
.tab-business-analysis {
  padding-bottom: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.ba-filters__row {
  align-items: end;
}

.ba-filters__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.ba-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ba-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.ba-kpi {
  padding: 10px 12px;
  border-right: 1px solid #e2e8f0;
  min-width: 0;
}

.ba-kpi:last-child {
  border-right: none;
}

.ba-kpi__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ba-kpi__value {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ba-panel {
  margin-bottom: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.ba-panel--chart {
  padding-bottom: 8px;
}

.ba-panel__title {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.ba-table-wrap {
  margin: 0;
  overflow-x: hidden;
}

.ba-type-table.table,
.ba-type-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.ba-type-table thead th {
  position: static;
  padding: 10px 10px;
  font-size: 10px;
  line-height: 1.25;
  white-space: normal;
}

.ba-type-table tbody td {
  padding: 10px 10px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ba-type-table thead th:nth-child(1) {
  width: 18%;
}

.ba-type-table .all-cases-th--num {
  width: 14%;
  text-align: right;
}

.ba-type-table .all-cases-th--money {
  width: 17%;
  text-align: right;
}

.ba-type-table td:nth-child(2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ba-type-table tr.ba-type-row--total td {
  font-weight: 700;
  background: #f8fafc;
}

.ba-chart-wrap {
  position: relative;
  height: 320px;
  padding: 12px;
}

.ba-chart-empty {
  margin: 0;
  padding: 48px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .ba-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ba-kpi:nth-child(3) {
    border-right: none;
  }

  .ba-kpi:nth-child(4),
  .ba-kpi:nth-child(5) {
    border-top: 1px solid #e2e8f0;
  }
}

@media (max-width: 640px) {
  .ba-kpi-strip {
    grid-template-columns: 1fr 1fr;
  }

  .ba-kpi:nth-child(2n) {
    border-right: none;
  }

  .ba-kpi:nth-child(3),
  .ba-kpi:nth-child(4),
  .ba-kpi:nth-child(5) {
    border-top: 1px solid #e2e8f0;
  }

  .ba-filters__actions {
    margin-left: 0;
    width: 100%;
  }
}

/* Business Report */
.tab-business-report {
  padding-bottom: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.br-filters__row {
  align-items: end;
}

.br-filters__row--secondary {
  margin-top: 0;
}

.br-more-btn {
  min-width: 36px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 18px;
  line-height: 1;
}

.br-tabs {
  flex-wrap: wrap;
  gap: 2px;
}

.br-tabs__btn {
  font-size: 12px;
  padding: 8px 12px;
  white-space: nowrap;
}

.br-panel {
  margin-bottom: 0;
}

.br-table-wrap {
  overflow-x: hidden;
}

.br-table-wrap--wide {
  overflow-x: hidden;
}

.br-txn-table.table,
.br-txn-table.all-cases-table.table,
.br-cases-table.table,
.br-cases-table.all-cases-table.table,
.br-inv-table.table,
.br-inv-table.all-cases-table.table,
.br-history-table.table,
.br-history-table.all-cases-table.table,
.br-case-txn-table.table,
.br-case-txn-table.all-cases-table.table,
.br-b2b-table.table,
.br-b2b-table.all-cases-table.table,
.br-summary-table.table,
.br-summary-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-business-report .br-txn-table thead th,
.tab-business-report .br-cases-table thead th,
.tab-business-report .br-inv-table thead th,
.tab-business-report .br-history-table thead th,
.tab-business-report .br-case-txn-table thead th,
.tab-business-report .br-b2b-table thead th,
.tab-business-report .br-summary-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.tab-business-report .br-txn-table tbody td,
.tab-business-report .br-cases-table tbody td,
.tab-business-report .br-inv-table tbody td,
.tab-business-report .br-history-table tbody td,
.tab-business-report .br-case-txn-table tbody td,
.tab-business-report .br-b2b-table tbody td,
.tab-business-report .br-summary-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-business-report .br-txn-table .all-cases-col-patient,
.tab-business-report .br-cases-table .all-cases-col-patient,
.tab-business-report .br-inv-table .all-cases-col-patient,
.tab-business-report .br-history-table .all-cases-col-patient,
.tab-business-report .br-case-txn-table .all-cases-col-patient {
  min-width: 0;
  max-width: none;
}

.tab-business-report .all-cases-col-patient strong,
.tab-business-report .dbr-patient-cell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Transactions tab */
.tab-business-report .br-txn-table thead th:nth-child(1) { width: 8%; }
.tab-business-report .br-txn-table thead th:nth-child(2) { width: 10%; }
.tab-business-report .br-txn-table .all-cases-th--patient { width: 14%; }
.tab-business-report .br-txn-table thead th:nth-child(4),
.tab-business-report .br-txn-table thead th:nth-child(5) { width: 9%; }
.tab-business-report .br-txn-table .dbr-th-info { width: 40px; }
.tab-business-report .br-txn-table .dbr-th-type { width: 72px; }
.tab-business-report .br-txn-table .all-cases-th--money { width: 8%; }
.tab-business-report .br-txn-table thead th:nth-child(9) { width: 7%; }
.tab-business-report .br-txn-table .dbr-th-view { width: 48px; }

/* Cases tab */
.tab-business-report .br-cases-table .all-cases-th--expand { width: 28px; }
.tab-business-report .br-cases-table thead th:nth-child(2) { width: 7%; }
.tab-business-report .br-cases-table thead th:nth-child(3) { width: 9%; }
.tab-business-report .br-cases-table .dbr-th-emp { width: 56px; }
.tab-business-report .br-cases-table .all-cases-th--patient { width: 12%; }
.tab-business-report .br-cases-table .dbr-th-age { width: 6%; }
.tab-business-report .br-cases-table thead th:nth-child(7),
.tab-business-report .br-cases-table thead th:nth-child(8) { width: 8%; }
.tab-business-report .br-cases-table thead th:nth-child(9) { width: 6%; }
.tab-business-report .br-cases-table .all-cases-th--money { width: 6%; }
.tab-business-report .br-cases-table .dbr-th-status { width: 7%; }
.tab-business-report .br-cases-table .dbr-th-view { width: 44px; }

/* Investigation wise */
.tab-business-report .br-inv-table .all-cases-th--sr { width: 40px; }
.tab-business-report .br-inv-table .txn-th-datetime { width: 9%; }
.tab-business-report .br-inv-table .all-cases-th--patient { width: 12%; }
.tab-business-report .br-inv-table thead th:nth-child(4) { width: 9%; }
.tab-business-report .br-inv-table thead th:nth-child(5) { width: 18%; }
.tab-business-report .br-inv-table .all-cases-th--money { width: 8%; }
.tab-business-report .br-inv-table thead th:nth-child(9) { width: 8%; }

/* Case history */
.tab-business-report .br-history-table .all-cases-th--sr { width: 40px; }
.tab-business-report .br-history-table thead th:nth-child(2) { width: 7%; }
.tab-business-report .br-history-table thead th:nth-child(3) { width: 8%; }
.tab-business-report .br-history-table .all-cases-th--patient { width: 12%; }
.tab-business-report .br-history-table thead th:nth-child(5) { width: 9%; }
.tab-business-report .br-history-table .txn-th-cc { width: 56px; }
.tab-business-report .br-history-table thead th:nth-child(7) { width: 14%; }
.tab-business-report .br-history-table .all-cases-th--money { width: 7%; }
.tab-business-report .br-history-table thead th:nth-child(11) { width: 7%; }

/* Case wise transaction */
.tab-business-report .br-case-txn-table .all-cases-th--sr { width: 36px; }
.tab-business-report .br-case-txn-table thead th:nth-child(2) { width: 6%; }
.tab-business-report .br-case-txn-table thead th:nth-child(3) { width: 7%; }
.tab-business-report .br-case-txn-table .all-cases-th--patient { width: 10%; }
.tab-business-report .br-case-txn-table thead th:nth-child(5) { width: 5%; }
.tab-business-report .br-case-txn-table thead th:nth-child(6) { width: 7%; }
.tab-business-report .br-case-txn-table thead th:nth-child(7) { width: 12%; }
.tab-business-report .br-case-txn-table .all-cases-th--money { width: 6%; }
.tab-business-report .br-case-txn-table thead th:nth-child(12) { width: 7%; }

/* B2B revenue */
.tab-business-report .br-b2b-table .all-cases-th--sr { width: 40px; }
.tab-business-report .br-b2b-table thead th:nth-child(2) { width: 28%; }
.tab-business-report .br-b2b-table .all-cases-th--num { width: 12%; text-align: right; }
.tab-business-report .br-b2b-table .all-cases-th--money { width: 20%; }

/* Summary report */
.tab-business-report .br-summary-table .all-cases-th--sr { width: 40px; }
.tab-business-report .br-summary-table thead th:nth-child(2) { width: 35%; }
.tab-business-report .br-summary-table .all-cases-th--num { width: 15%; text-align: right; }
.tab-business-report .br-summary-table .all-cases-th--money { width: 25%; }

.tab-business-report .br-txn-table td.dbr-th-info,
.tab-business-report .br-txn-table td.dbr-th-view,
.tab-business-report .br-cases-table td.dbr-th-view {
  overflow: visible;
  text-overflow: clip;
}

.br-inv-subtitle {
  margin: 0 0 8px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.br-summary-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
  margin: 10px 4px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.br-summary-foot strong {
  color: #0f172a;
}

.br-footer {
  margin-top: 10px;
}

@media (max-width: 900px) {
  .br-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

/* Referral Doctor */
.tab-referral-doctor {
  padding-bottom: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.rd-filters__row {
  align-items: end;
}

.rd-filters__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.rd-table-wrap {
  overflow-x: hidden;
}

.rd-table.table,
.rd-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-referral-doctor .rd-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.tab-referral-doctor .rd-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-referral-doctor .rd-table .all-cases-th--sr {
  width: 44px;
}

.tab-referral-doctor .rd-table thead th:nth-child(2) {
  width: 9%;
}

.tab-referral-doctor .rd-table .all-cases-th--patient {
  width: 16%;
  min-width: 0;
}

.tab-referral-doctor .rd-table thead th:nth-child(4) {
  width: 22%;
}

.tab-referral-doctor .rd-table thead th:nth-child(5) {
  width: 11%;
}

.rd-th-report,
.rd-th-active,
.rd-th-action {
  text-align: center;
  white-space: nowrap;
}

.rd-th-report {
  width: 64px;
}

.rd-th-active {
  width: 52px;
}

.rd-th-action {
  width: 56px;
}

.tab-referral-doctor .rd-table .all-cases-col-patient {
  min-width: 0;
  max-width: none;
}

.tab-referral-doctor .rd-table .all-cases-col-patient strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-referral-doctor .rd-table td.rd-th-report,
.tab-referral-doctor .rd-table td.rd-th-active,
.tab-referral-doctor .rd-table td.rd-th-action {
  overflow: visible;
  text-overflow: clip;
}

.tab-referral-doctor .commission-table-wrap--summary {
  overflow-x: hidden;
}

.tab-referral-doctor .table--commission-summary {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.rd-more-btn {
  min-width: 36px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 18px;
  line-height: 1;
}

.rd-report-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  opacity: 0.85;
}

.rd-report-btn:hover {
  opacity: 1;
}

.rd-active-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.rd-active-badge--yes {
  background: #dcfce7;
  color: #15803d;
}

.rd-active-badge--no {
  background: #fee2e2;
  color: #b91c1c;
}

.rd-commission-details {
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 0 12px 12px;
}

.rd-commission-details__summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 4px;
  color: #0f172a;
}

/* Revenue sharing report (Referral Doctor > Business Report) */
.rsr-modal-overlay {
  z-index: 1260;
}

.modal-card--referrer-revenue {
  width: min(96vw, 1280px);
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.rsr-modal__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.rsr-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  align-items: end;
}

.rsr-filters > .all-cases-field {
  min-width: 0;
}

.rsr-filters__exports {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: flex-end;
}

.rsr-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.rsr-doctor-title {
  margin: 0;
  padding: 12px 16px 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.rsr-table-wrap {
  margin: 0 16px;
  overflow-x: hidden;
  flex: 1;
  min-height: 180px;
}

.rsr-table.table,
.rsr-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.rsr-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
  line-height: 1.25;
  white-space: normal;
}

.rsr-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rsr-table .all-cases-th--sr {
  width: 40px;
}

.rsr-table thead th:nth-child(2) {
  width: 9%;
}

.rsr-table thead th:nth-child(3) {
  width: 7%;
}

.rsr-table .all-cases-th--patient {
  width: 11%;
  min-width: 0;
}

.rsr-th-cc {
  width: 48px;
  text-align: center;
}

.rsr-table thead th:nth-child(6) {
  width: 14%;
}

.rsr-table thead th:nth-child(7),
.rsr-table thead th:nth-child(8) {
  width: 8%;
}

.rsr-table .all-cases-th--money {
  width: 7%;
}

.rsr-table .all-cases-col-patient strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rsr-totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px 20px;
  padding: 12px 16px 16px;
  font-size: 12px;
  color: #475569;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}

.rsr-totals strong {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

body.rsr-modal-open {
  overflow: hidden;
}

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

  .rsr-filters__exports {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

.modal-card--referral-doctor {
  max-width: 920px;
  width: min(96vw, 920px);
}

.referral-doctor-form__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}

.referral-field--span2 {
  grid-column: span 2;
}

.referral-field--check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-top: 22px;
  font-size: 13px;
  font-weight: 600;
}

.referral-field--check input[type="checkbox"] {
  min-height: 0;
  width: 16px;
  height: 16px;
  padding: 0;
  flex-shrink: 0;
}

.rd-phone-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rd-phone-field__prefix {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.rd-phone-field input {
  flex: 1;
  min-width: 0;
}

.referral-doctor-form__actions {
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 800px) {
  .referral-doctor-form__grid {
    grid-template-columns: 1fr 1fr;
  }

  .referral-field--span2 {
    grid-column: span 2;
  }

  .rd-filters__actions {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .referral-doctor-form__grid {
    grid-template-columns: 1fr;
  }

  .referral-field--span2 {
    grid-column: span 1;
  }
}

/* Outsourcing Lab */
.tab-outsourcing-lab {
  padding-bottom: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.ol-filters__row {
  align-items: end;
}

.ol-table-wrap {
  overflow-x: hidden;
}

.ol-table.table,
.ol-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-outsourcing-lab .ol-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.tab-outsourcing-lab .ol-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-outsourcing-lab .ol-table .all-cases-th--sr {
  width: 44px;
}

.tab-outsourcing-lab .ol-table thead th:nth-child(2) {
  width: 18%;
}

.tab-outsourcing-lab .ol-table thead th:nth-child(3) {
  width: 14%;
}

.tab-outsourcing-lab .ol-table thead th:nth-child(4) {
  width: auto;
  min-width: 0;
}

.ol-th-print,
.ol-th-active,
.ol-th-action {
  text-align: center;
  white-space: nowrap;
}

.ol-th-print {
  width: 64px;
}

.ol-th-active {
  width: 52px;
}

.ol-th-action {
  width: 56px;
}

.tab-outsourcing-lab .ol-table td.ol-th-print,
.tab-outsourcing-lab .ol-table td.ol-th-active,
.tab-outsourcing-lab .ol-table td.ol-th-action {
  overflow: visible;
  text-overflow: clip;
}

.ol-more-btn {
  min-width: 36px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 18px;
  line-height: 1;
}

.ol-print-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  opacity: 0.85;
}

.ol-print-btn:hover {
  opacity: 1;
}

/* Lab wise outsourcing report (Outsourcing Lab > Print Business) */
.olr-modal-overlay {
  z-index: 1260;
}

.modal-card--outsourcing-report {
  width: min(96vw, 1180px);
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.olr-modal__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.olr-filters {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto auto;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  align-items: end;
}

.olr-filters > .all-cases-field {
  min-width: 0;
}

.olr-filters__exports {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: flex-end;
}

.olr-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.olr-lab-meta {
  padding: 12px 16px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

.olr-lab-meta small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
}

.olr-table-wrap {
  margin: 0 16px;
  overflow-x: hidden;
  flex: 1;
  min-height: 180px;
}

.olr-table.table,
.olr-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.olr-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
  line-height: 1.25;
  white-space: normal;
}

.olr-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.olr-table thead th:nth-child(1) {
  width: 9%;
}

.olr-table thead th:nth-child(2) {
  width: 9%;
}

.olr-table .all-cases-th--patient {
  width: 14%;
  min-width: 0;
}

.olr-table thead th:nth-child(4) {
  width: 22%;
}

.olr-table .all-cases-th--money {
  width: 12%;
}

.olr-table .all-cases-col-patient strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.olr-totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px 20px;
  padding: 12px 16px 16px;
  font-size: 12px;
  color: #475569;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}

.olr-totals strong {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

body.olr-modal-open {
  overflow: hidden;
}

.ol-phone-cell {
  white-space: nowrap;
}

.ol-modal {
  max-width: 640px;
  width: min(calc(100vw - 24px), 640px);
}

.ol-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 16px 18px 18px;
}

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

.ol-field {
  display: grid;
  gap: 6px;
}

.ol-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.ol-field--check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.ol-field--check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  flex-shrink: 0;
}

.ol-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* B2B List */
.tab-b2b-list {
  padding-bottom: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.b2b-filters__row {
  align-items: end;
}

.b2b-more-btn {
  min-width: 36px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 18px;
  line-height: 1;
}

.b2b-th-report,
.b2b-th-active,
.b2b-th-action {
  width: 72px;
  text-align: center;
  white-space: nowrap;
}

.b2b-table-wrap {
  overflow-x: hidden;
}

.b2b-table.table,
.b2b-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-b2b-list .b2b-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.tab-b2b-list .b2b-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-b2b-list .b2b-table .all-cases-th--sr {
  width: 44px;
}

.tab-b2b-list .b2b-table thead th:nth-child(2) {
  width: 11%;
}

.tab-b2b-list .b2b-table thead th:nth-child(3) {
  width: 14%;
}

.tab-b2b-list .b2b-table thead th:nth-child(4) {
  width: 10%;
}

.tab-b2b-list .b2b-table thead th:nth-child(5) {
  width: 14%;
}

.tab-b2b-list .b2b-table thead th:nth-child(6) {
  width: 14%;
  min-width: 0;
}

.tab-b2b-list .b2b-table thead th.b2b-th-report,
.tab-b2b-list .b2b-table thead th.b2b-th-active,
.tab-b2b-list .b2b-table thead th.b2b-th-action {
  width: 56px;
  min-width: 56px;
}

.tab-b2b-list .b2b-table .b2b-th-report,
.tab-b2b-list .b2b-table .b2b-th-active,
.tab-b2b-list .b2b-table .b2b-th-action {
  width: 56px;
  min-width: 56px;
}

.tab-b2b-list .b2b-table td.b2b-th-report,
.tab-b2b-list .b2b-table td.b2b-th-active,
.tab-b2b-list .b2b-table td.b2b-th-action {
  text-align: center;
  position: relative;
  z-index: 2;
  overflow: visible;
}

.tab-b2b-list .b2b-table td.b2b-th-report .ol-print-btn,
.tab-b2b-list .b2b-table td.b2b-th-action .cases-act-btn {
  position: relative;
  z-index: 3;
}

.b2b-modal {
  max-width: 480px;
  width: min(96vw, 480px);
}

.b2b-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 16px 18px 18px;
}

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

.b2b-field {
  display: grid;
  gap: 6px;
}

.b2b-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.b2b-field textarea {
  min-height: 72px;
  resize: vertical;
}

.b2b-field--check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.b2b-field--check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  flex-shrink: 0;
}

.b2b-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* B2B business report (B2B List > Business Report) */
.bbr-modal-overlay {
  z-index: 1260;
}

.modal-card--b2b-report {
  width: min(96vw, 1180px);
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.bbr-modal__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.bbr-filters {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto auto;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  align-items: end;
}

.bbr-filters > .all-cases-field {
  min-width: 0;
}

.bbr-filters__exports {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: flex-end;
}

.bbr-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.bbr-client-meta {
  padding: 12px 16px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

.bbr-client-meta small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.bbr-table-wrap {
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  padding: 0 16px;
}

.bbr-table.table,
.bbr-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.bbr-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.bbr-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bbr-table .all-cases-th--sr {
  width: 40px;
}

.bbr-table thead th:nth-child(2) {
  width: 11%;
}

.bbr-table thead th:nth-child(3) {
  width: 8%;
}

.bbr-table .all-cases-th--patient {
  width: 12%;
  min-width: 0;
}

.bbr-th-cc {
  width: 7%;
}

.bbr-table thead th:nth-child(6) {
  width: 16%;
}

.bbr-table thead th:nth-child(7) {
  width: 9%;
}

.bbr-table .all-cases-th--money {
  width: 8%;
}

.bbr-table .all-cases-col-patient strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bbr-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 12px 16px 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--line);
  margin-top: 10px;
}

.bbr-totals strong {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

body.bbr-modal-open {
  overflow: hidden;
}

/* Sample Collection Agents */
.tab-agents {
  padding-bottom: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.agents-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.agents-toolbar__title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.agents-help {
  font-size: 12px;
  color: var(--text-muted);
}

.agents-help__summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.agents-help__summary::-webkit-details-marker {
  display: none;
}

.agents-help__list {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.agents-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ag-more-btn {
  min-width: 36px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 18px;
  line-height: 1;
}

.ag-th-report,
.ag-th-active,
.ag-th-action {
  width: 72px;
  text-align: center;
  white-space: nowrap;
}

.ag-table-wrap {
  overflow-x: hidden;
}

.ag-table.table,
.ag-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-agents .ag-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.tab-agents .ag-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-agents .ag-table .all-cases-th--sr {
  width: 44px;
}

.tab-agents .ag-table thead th:nth-child(2) {
  width: 14%;
}

.tab-agents .ag-table thead th:nth-child(3) {
  width: 18%;
}

.tab-agents .ag-table thead th:nth-child(4) {
  width: 14%;
}

.tab-agents .ag-table thead th.ag-th-report,
.tab-agents .ag-table thead th.ag-th-active,
.tab-agents .ag-table thead th.ag-th-action {
  width: 56px;
  min-width: 56px;
}

.tab-agents .ag-table .ag-th-report,
.tab-agents .ag-table .ag-th-active,
.tab-agents .ag-table .ag-th-action {
  width: 56px;
  min-width: 56px;
}

.tab-agents .ag-table td.ag-th-report,
.tab-agents .ag-table td.ag-th-active,
.tab-agents .ag-table td.ag-th-action {
  text-align: center;
  position: relative;
  z-index: 2;
  overflow: visible;
}

.tab-agents .ag-table td.ag-th-report .ol-print-btn,
.tab-agents .ag-table td.ag-th-action .cases-act-btn {
  position: relative;
  z-index: 3;
}

/* Agent business report (Agents > Business Report) */
.abr-modal-overlay {
  z-index: 1260;
}

.modal-card--agent-report {
  width: min(96vw, 1180px);
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.abr-modal__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.abr-filters {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto auto;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  align-items: end;
}

.abr-filters > .all-cases-field {
  min-width: 0;
}

.abr-filters__exports {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: flex-end;
}

.abr-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.abr-agent-meta {
  padding: 12px 16px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

.abr-agent-meta small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.abr-table-wrap {
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  padding: 0 16px;
}

.abr-table.table,
.abr-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.abr-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.abr-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.abr-table .all-cases-th--sr {
  width: 40px;
}

.abr-table thead th:nth-child(2) {
  width: 11%;
}

.abr-table thead th:nth-child(3) {
  width: 8%;
}

.abr-table .all-cases-th--patient {
  width: 12%;
  min-width: 0;
}

.abr-th-cc {
  width: 7%;
}

.abr-table thead th:nth-child(6) {
  width: 16%;
}

.abr-table thead th:nth-child(7) {
  width: 9%;
}

.abr-table .all-cases-th--money {
  width: 8%;
}

.abr-table .all-cases-col-patient strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.abr-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 12px 16px 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--line);
  margin-top: 10px;
}

.abr-totals strong {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

body.abr-modal-open {
  overflow: hidden;
}

.ag-modal-overlay {
  z-index: 1300;
}

.ag-modal-overlay.is-open {
  display: flex;
}

.ag-modal {
  max-width: 420px;
  width: min(96vw, 420px);
}

.ag-form {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.ag-field {
  display: grid;
  gap: 6px;
}

.ag-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.ag-field--check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.ag-field--check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  flex-shrink: 0;
}

.ag-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* Manage Users */
.tab-users {
  padding-bottom: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.mu-filters__row {
  align-items: end;
}

.mu-filters__row > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.mu-filters__actions {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-left: auto;
}

.mu-more-btn {
  min-width: 36px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 18px;
  line-height: 1;
}

.mu-tabs {
  margin: 0 0 12px;
}

.mu-th-verified {
  width: 72px;
  text-align: center;
  white-space: nowrap;
}

.mu-th-profile {
  min-width: 0;
}

.mu-th-action {
  width: 108px;
  min-width: 108px;
  text-align: center;
  white-space: nowrap;
}

.mu-profile-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.mu-profile-select {
  width: 100%;
  min-width: 0;
  max-width: 160px;
  font-size: 12px;
  padding: 4px 6px;
}

.mu-action-dash {
  margin-left: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.mu-phone-cell {
  white-space: nowrap;
}

.mu-status-link {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.mu-table-wrap {
  overflow-x: hidden;
}

.mu-table.table,
.mu-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-users .mu-table thead th {
  position: static;
  padding: 8px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.tab-users .mu-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-users .mu-table .all-cases-th--sr {
  width: 44px;
}

.tab-users .mu-table thead th:nth-child(2) {
  width: 10%;
}

.tab-users .mu-table thead th:nth-child(3) {
  width: 14%;
}

.tab-users .mu-table thead th:nth-child(4) {
  width: 18%;
}

.tab-users .mu-table thead th:nth-child(5) {
  width: 12%;
}

.tab-users .mu-table thead th:nth-child(7) {
  width: 14%;
}

.tab-users .mu-table td.mu-th-profile,
.tab-users .mu-table td.mu-th-action {
  overflow: visible;
  text-overflow: clip;
}

.tab-users .mu-table td.mu-th-action {
  position: relative;
  z-index: 2;
}

.tab-users .mu-table td.mu-th-action .cases-act-btn,
.tab-users .mu-table td.mu-th-action .mu-status-link {
  position: relative;
  z-index: 3;
}

.mu-modal {
  max-width: 720px;
  width: min(96vw, 720px);
}

.mu-form {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.mu-form__name-grid,
.mu-form__detail-grid,
.mu-form__password-grid {
  display: grid;
  gap: 10px 12px;
}

.mu-form__name-grid,
.mu-form__detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mu-form__password-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mu-field {
  display: grid;
  gap: 6px;
}

.mu-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.mu-password-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mu-password-field input {
  flex: 1;
}

.mu-password-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.mu-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

@media (max-width: 720px) {
  .mu-form__name-grid,
  .mu-form__detail-grid,
  .mu-form__password-grid {
    grid-template-columns: 1fr;
  }

  .mu-filters__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Manage Profiles */
.tab-profiles {
  padding-bottom: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.mp-filters__row {
  align-items: end;
}

.mp-filters__row > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.mp-more-btn {
  min-width: 36px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 18px;
  line-height: 1;
}

.mp-th-action {
  width: 88px;
  min-width: 88px;
  text-align: center;
  white-space: nowrap;
}

.mp-table-wrap {
  overflow-x: hidden;
}

.mp-table.table,
.mp-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-profiles .mp-table thead th {
  position: static;
  padding: 8px 10px;
  font-size: 10px;
  white-space: nowrap;
}

.tab-profiles .mp-table tbody td {
  padding: 10px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.tab-profiles .mp-table .all-cases-th--sr {
  width: 52px;
}

.tab-profiles .mp-table thead th:nth-child(2) {
  width: auto;
  min-width: 0;
}

.tab-profiles .mp-table tbody td:nth-child(2) strong {
  display: inline;
  font-weight: 600;
  color: var(--text);
}

.tab-profiles .mp-table td.mp-th-action {
  overflow: visible;
  text-overflow: clip;
  text-align: center;
}

.tab-profiles .mp-table td.mp-th-action .cases-act-btn {
  margin: 0 2px;
}

.mp-system-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.mp-modal {
  max-width: 420px;
  width: min(96vw, 420px);
}

.mp-form {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.mp-field {
  display: grid;
  gap: 6px;
}

.mp-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.mp-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.mp-perm-modal {
  max-width: 640px;
  width: min(96vw, 640px);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
}

.mp-perm-form {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
  overflow: auto;
}

.mp-perm-form__lead {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.mp-perm-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.mp-perm-toolbar__sep {
  color: var(--text-muted);
}

.mp-perm-groups {
  display: grid;
  gap: 12px;
}

.mp-perm-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface);
}

.mp-perm-group__title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mp-perm-group__items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.mp-perm-check {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.mp-perm-check input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  margin-top: 2px;
  flex-shrink: 0;
}

.cases-act-delete {
  color: var(--danger, #c62828);
}

@media (max-width: 640px) {
  .mp-perm-group__items {
    grid-template-columns: 1fr;
  }
}

/* Title Master */
.tab-title-master {
  padding-bottom: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.tm-filters__row {
  align-items: end;
}

.tm-filters__row > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.tm-more-btn {
  min-width: 36px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 18px;
  line-height: 1;
}

.tm-th-action {
  width: 88px;
  min-width: 88px;
  text-align: center;
  white-space: nowrap;
}

.tm-table-wrap {
  overflow-x: hidden;
}

.tm-table.table,
.tm-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-title-master .tm-table thead th {
  position: static;
  padding: 8px 10px;
  font-size: 10px;
  white-space: nowrap;
}

.tab-title-master .tm-table tbody td {
  padding: 10px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.tab-title-master .tm-table .all-cases-th--sr {
  width: 52px;
}

.tab-title-master .tm-table thead th:nth-child(2) {
  width: auto;
  min-width: 0;
}

.tab-title-master .tm-table thead th:nth-child(3) {
  width: 120px;
}

.tab-title-master .tm-table tbody td:nth-child(2) strong {
  font-weight: 600;
  color: var(--text);
}

.tab-title-master .tm-table td.tm-th-action {
  overflow: visible;
  text-overflow: clip;
  text-align: center;
}

.tab-title-master .tm-table td.tm-th-action .cases-act-btn {
  margin: 0 2px;
}

.tm-modal {
  max-width: 420px;
  width: min(96vw, 420px);
}

.tm-form {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.tm-field {
  display: grid;
  gap: 6px;
  border: 0;
  margin: 0;
  padding: 0;
}

.tm-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.tm-field--gender legend {
  margin-bottom: 4px;
}

.tm-gender-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
}

.tm-gender-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.tm-gender-option input {
  width: auto;
}

.tm-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* Radiology Machines */
.tab-radiology-machines {
  padding-bottom: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.rm-filters__row {
  align-items: end;
}

.rm-filters__row > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.rm-th-action {
  width: 140px;
  min-width: 140px;
  text-align: center;
  white-space: nowrap;
}

.rm-table-wrap {
  overflow-x: hidden;
}

.rm-table.table,
.rm-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-radiology-machines .rm-table thead th {
  position: static;
  padding: 8px 10px;
  font-size: 10px;
  white-space: nowrap;
}

.tab-radiology-machines .rm-table tbody td {
  padding: 10px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.tab-radiology-machines .rm-table .all-cases-th--sr {
  width: 52px;
}

.tab-radiology-machines .rm-table thead th:nth-child(2) {
  width: auto;
  min-width: 0;
}

.tab-radiology-machines .rm-table tbody td:nth-child(2) strong {
  font-weight: 600;
  color: var(--text);
}

.tab-radiology-machines .rm-table td.rm-th-action {
  overflow: visible;
  text-overflow: clip;
  text-align: center;
}

.rm-row--edit td {
  vertical-align: middle;
  overflow: visible;
}

.rm-row--edit td:nth-child(2) {
  overflow: visible;
}

.rm-inline-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.rm-th-action .btn-sm {
  margin-right: 6px;
}

.rm-th-action .btn-sm:last-child {
  margin-right: 0;
}

.tab-radiology-machines .rm-table td.rm-th-action .cases-act-btn {
  margin: 0 2px;
}

/* Price List Master */
.tab-price-list {
  padding-bottom: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.pl-filters__row {
  align-items: end;
}

.pl-filters__row > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.pl-th-active,
.pl-th-action {
  width: 72px;
  min-width: 72px;
  text-align: center;
  white-space: nowrap;
}

.pl-table-wrap {
  overflow-x: hidden;
}

.pl-table.table,
.pl-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tab-price-list .pl-table thead th {
  position: static;
  padding: 8px 10px;
  font-size: 10px;
  white-space: nowrap;
}

.tab-price-list .pl-table tbody td {
  padding: 10px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.tab-price-list .pl-table .all-cases-th--sr {
  width: 52px;
}

.tab-price-list .pl-table thead th:nth-child(2) {
  width: 22%;
}

.tab-price-list .pl-table thead th:nth-child(3) {
  width: auto;
  min-width: 0;
}

.tab-price-list .pl-table td.pl-th-action,
.tab-price-list .pl-table td.pl-th-active {
  overflow: visible;
  text-align: center;
}

.pl-modal {
  max-width: min(96vw, 960px);
  width: min(96vw, 960px);
  max-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.pl-modal > .modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.pl-modal-tabs {
  margin: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 4;
}

.pl-modal > .modal-head {
  flex-shrink: 0;
}

.pl-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.pl-tab-panel {
  display: none;
  padding: 14px 16px;
  overflow: auto;
  min-height: 0;
  flex: 1;
}

.pl-tab-panel.is-active {
  display: flex;
  flex-direction: column;
}

.pl-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
}

.pl-field {
  display: grid;
  gap: 6px;
}

.pl-field--span2 {
  grid-column: span 3;
}

.pl-field--days {
  grid-column: span 3;
  border: 0;
  margin: 0;
  padding: 0;
}

.pl-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.pl-field--check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.pl-field--check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  flex-shrink: 0;
}

.pl-days {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.pl-day-check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.pl-day-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  flex-shrink: 0;
}

.pl-money-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pl-money-field input {
  flex: 1;
}

.pl-money-field__suffix {
  font-weight: 600;
  color: var(--text-muted);
}

.pl-doctor-combo {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.pl-doctor-combo:focus-within {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 12%, transparent);
}

.pl-doctor-combo__inner {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 8px;
}

.pl-doctor-combo__input {
  flex: 1 1 120px;
  min-width: 80px;
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-size: 13px;
  outline: none;
  box-shadow: none;
  min-height: 0;
}

.pl-doctor-combo__clear,
.pl-doctor-combo__toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  border: 0;
  border-left: 1px solid var(--line);
  background: #fff;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.pl-doctor-combo__clear:hover,
.pl-doctor-combo__toggle:hover {
  background: #f8fafc;
  color: var(--text);
}

.pl-doctor-combo__drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.pl-doctor-combo__option {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.pl-doctor-combo__option:hover,
.pl-doctor-combo__option:focus {
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  color: var(--primary);
}

.pl-doctor-combo__empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.pl-doctor-tags {
  display: contents;
}

.pl-doctor-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pl-doctor-tag__remove {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.pl-tab-panel[data-pl-panel="pricing"].is-active {
  overflow: hidden;
  padding: 0;
}

.pl-tab-panel[data-pl-panel="pricing"] .pl-pricing-toolbar {
  margin-bottom: 0;
  padding: 14px 16px 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 3;
}

.pl-tab-panel[data-pl-panel="pricing"] .pl-pricing-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  border: none;
  border-radius: 0;
}

.pl-pricing-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 10px 16px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.pl-pricing-foot__size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
}

.pl-pricing-foot__size select {
  min-width: 72px;
  padding: 6px 8px;
  font-size: 13px;
}

.pl-pricing-foot__pager {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pl-pricing-foot__pager .all-cases-page-btn {
  min-width: 32px;
}

.pl-pricing-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.pl-pricing-toolbar > .all-cases-field {
  grid-column: auto;
  min-width: 0;
}

.pl-pricing-toolbar__spacer {
  flex: 1;
  min-width: 12px;
}

.pl-pricing-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.pl-more-menu {
  position: relative;
}

.pl-more-menu__btn {
  min-width: 40px;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 18px;
  line-height: 1;
}

.pl-more-menu__drop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 140px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.pl-more-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-align: left;
}

.pl-more-menu__item:hover {
  background: #f1f5f9;
}

.pl-pricing-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pl-pricing-save-btn__icon {
  font-size: 14px;
  line-height: 1;
}

.pl-pricing-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pl-pricing-table.table,
.pl-pricing-table.all-cases-table.table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  margin-top: 0;
  border: none;
}

.pl-pricing-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: 0 1px 0 var(--line);
}

.pl-pricing-table.pl-pricing-table--master .pl-th-commission,
.pl-pricing-table.pl-pricing-table--master td.pl-td-commission {
  display: none;
}

.pl-pricing-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.pl-pricing-table tbody tr:hover td {
  background: #f0fdfa;
}

.pl-pricing-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.pl-th-price,
.pl-th-commission {
  width: 130px;
}

.pl-commission-field {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pl-commission-field input {
  flex: 1;
  min-width: 0;
}

.pl-commission-field > span {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
}

.pl-sync-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 120px;
}

.pl-modal-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.pl-modal-form__actions[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .pl-modal {
    width: min(96vw, 960px);
  }

  .pl-form-grid,
  .pl-sync-grid {
    grid-template-columns: 1fr;
  }

  .pl-field--span2,
  .pl-field--days {
    grid-column: span 1;
  }

  .pl-pricing-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* —— Print Settings studio —— */
.tab-print-setting .ps-head {
  margin-bottom: 12px;
}

.ps-studio {
  display: grid;
  grid-template-columns: minmax(320px, 42%) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ps-studio__left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  padding-right: 4px;
}

.ps-top-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ps-top-tab {
  border: 1px solid var(--border, #d8dee6);
  background: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.ps-top-tab.is-active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
}

.ps-panel-title {
  margin: 0 0 10px;
  font-size: 15px;
}

.ps-accordions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ps-accordion {
  border: 1px solid var(--border, #d8dee6);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.ps-accordion__head {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  background: #f6f8fb;
  font-weight: 600;
  cursor: pointer;
}

.ps-accordion__body {
  display: none;
  padding: 12px;
}

.ps-accordion.is-open .ps-accordion__body {
  display: block;
}

.ps-grid-2,
.ps-grid-4 {
  display: grid;
  gap: 10px;
}

.ps-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.ps-studio .ps-grid-2 > label:not(.ps-check):not(.ps-radio),
.ps-studio .ps-grid-4 > label:not(.ps-check):not(.ps-radio),
.ps-studio .ps-fieldset .ps-grid-2 > label,
.ps-studio .ps-fieldset .ps-grid-4 > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.ps-studio .ps-grid-2 input:not([type="checkbox"]):not([type="radio"]),
.ps-studio .ps-grid-4 input:not([type="checkbox"]):not([type="radio"]),
.ps-studio .ps-grid-2 select,
.ps-studio .ps-grid-4 select {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
}

.ps-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 10px;
}

.ps-check,
.ps-radio {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #334155);
  cursor: pointer;
  width: auto;
  max-width: 100%;
}

.ps-studio label.ps-check,
.ps-studio label.ps-radio,
.ps-modal-card label.ps-check,
.ps-modal-card label.ps-radio,
.ps-patient-fields label.ps-check,
.ps-check-row label.ps-check {
  display: inline-flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #334155);
  line-height: 1.35;
}

.ps-studio label.ps-check input[type="checkbox"],
.ps-studio label.ps-check input[type="radio"],
.ps-studio label.ps-radio input[type="radio"],
.ps-modal-card label.ps-check input[type="checkbox"],
.ps-modal-card label.ps-check input[type="radio"],
.ps-patient-fields label.ps-check input[type="checkbox"],
.ps-check-row label.ps-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--primary, #0f766e);
}

.ps-check--block {
  display: flex;
  flex-direction: row;
}

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

.ps-fieldset {
  border: 1px dashed var(--border, #d8dee6);
  border-radius: 6px;
  padding: 10px;
  margin: 0 0 10px;
}

.ps-fieldset legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
}

.ps-actions-row,
.ps-save-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ps-patient-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.ps-studio__right {
  position: sticky;
  top: 12px;
}

.ps-preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #eef2f7;
  border: 1px solid var(--border, #d8dee6);
  border-radius: 8px 8px 0 0;
  font-size: 13px;
}

.ps-preview-stage {
  border: 1px solid var(--border, #d8dee6);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #c8cdd4;
  padding: 16px;
  min-height: 520px;
  overflow: auto;
}

.ps-preview-page {
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  margin: 0 auto;
  max-width: 210mm;
}

.ps-preview-page .print-target,
.ps-preview-page .report-preview-root {
  width: 100%;
  box-sizing: border-box;
}

.ps-preview-page .lab-report-page--clinical,
.ps-preview-page .lab-report-page--continuous-doc {
  min-height: 280mm;
}

.ps-preview-doc {
  position: relative;
  min-height: 280mm;
  box-sizing: border-box;
}

.ps-preview-watermark {
  position: absolute;
  inset: 40% 10%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: rgba(0, 0, 0, 0.06);
  transform: rotate(-24deg);
  pointer-events: none;
}

.ps-patient-border--line {
  border-top: 1px solid #333;
  padding-top: 8px;
  margin-top: 8px;
}

.ps-patient-border--box {
  border: 1px solid #333;
  padding: 8px;
  margin: 8px 0;
}

.ps-order-grid {
  display: flex;
  gap: 8px;
}

.ps-order-col {
  min-width: 0;
}

.ps-order-line {
  margin: 0 0 4px;
  font-size: inherit;
}

.ps-preview-footer {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.ps-preview-signatures {
  display: flex;
  gap: 24px;
  flex: 1;
}

.ps-preview-sig-slot {
  min-width: 120px;
}

.ps-preview-sig-line {
  border-bottom: 1px solid #333;
  height: 36px;
  margin-bottom: 4px;
}

.ps-preview-sig-tag {
  font-size: 10px;
  color: #666;
}

.ps-preview-label {
  border: 1px dashed #333;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  background: #fff;
}

.ps-label-sheet {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
  min-height: 200px;
}

.ps-label-sticker {
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  color: #111;
  line-height: 1.35;
}

.ps-label-barcode-wrap {
  margin-bottom: 4px;
}

.ps-label-barcode-wrap--center {
  margin-left: auto;
  margin-right: auto;
}

.ps-label-barcode-wrap--right {
  margin-left: auto;
}

.ps-label-barcode {
  display: block;
  width: 100%;
  max-width: 100%;
  height: var(--ps-label-barcode-h, 25px);
  object-fit: fill;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.ps-label-line {
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ps-label-line--test {
  font-weight: 600;
}

.ps-radio-row {
  display: flex;
  gap: 16px;
}

.ps-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.ps-label-order-link {
  padding: 0;
  margin-top: 8px;
  font-size: 13px;
}

/* —— Lab Settings —— */
.tab-lab-settings .ls-head {
  margin-bottom: 20px;
}

.ls-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  max-width: 1000px;
}

.ls-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 128px;
  padding: 24px 18px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  font: inherit;
  color: inherit;
}

.ls-card:hover {
  border-color: var(--primary, #0f766e);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.14);
  transform: translateY(-2px);
}

.ls-card:focus-visible {
  outline: 2px solid var(--primary, #0f766e);
  outline-offset: 2px;
}

.ls-card__icon {
  font-size: 32px;
  line-height: 1;
}

.ls-card__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #334155;
}

.ls-modal-card--wide {
  width: min(96vw, 780px);
}

.ls-modal-card--sequence {
  width: min(96vw, 520px);
}

.ls-modal-card--config {
  width: min(98vw, 1200px);
  max-height: min(94vh, 880px);
}

.ls-modal-overlay .modal-card.ls-modal-card {
  max-width: none;
  width: min(96vw, 520px);
  max-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}

.ls-modal-overlay .modal-card.ls-modal-card.ls-modal-card--wide {
  width: min(96vw, 780px);
}

.ls-modal-overlay .modal-card.ls-modal-card.ls-modal-card--config {
  width: min(98vw, 1200px);
  max-height: min(94vh, 880px);
}

.ls-modal-overlay .modal-head {
  flex-shrink: 0;
  padding: 18px 20px 14px;
  background: #fff;
}

.ls-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.ls-modal-body::-webkit-scrollbar {
  width: 8px;
}

.ls-modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.ls-modal-body--flush {
  padding: 0;
  overflow: hidden;
}

.ls-form--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.ls-form--grid-tight {
  margin-top: 4px;
}

.ls-form--stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ls-modal-overlay .ls-form label:not(.ls-check):not(.ls-radio) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin: 0;
  min-width: 0;
}

.ls-modal-overlay .ls-form label input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.ls-modal-overlay .ls-form label select,
.ls-modal-overlay .ls-config-field input,
.ls-modal-overlay .ls-config-field select {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #d1d9e6;
  width: 100%;
  box-sizing: border-box;
}

.ls-modal-overlay .ls-form label input[type="file"] {
  padding: 8px 0;
  font-size: 13px;
  border: 0;
  min-height: 0;
}

.ls-field-span2 {
  grid-column: 1 / -1;
}

.ls-callout {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.ls-form.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px 8px;
}

.ls-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: #f8fafc;
  flex-shrink: 0;
  margin: 0;
}

.ls-logo-preview {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 8px 0;
}

.ls-logo-preview__img {
  max-height: 72px;
  max-width: 220px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  padding: 4px;
  background: #fff;
}

.ls-branches-wrap {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.ls-subtitle {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ls-branches-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ls-branch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 13px;
}

.ls-config-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 480px;
  height: 100%;
  max-height: min(68vh, 600px);
}

.ls-config-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 10px;
  border-right: 1px solid #dde3ea;
  overflow-y: auto;
  background: #eceff3;
  scrollbar-width: thin;
}

.ls-config-nav__btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  color: #334155;
  transition: background 0.15s, color 0.15s;
}

.ls-config-nav__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ls-config-nav__icon svg {
  display: block;
}

.ls-config-nav__text {
  flex: 1;
  min-width: 0;
}

.ls-config-nav__btn:hover {
  background: #dfe4ea;
  color: #0f172a;
}

.ls-config-nav__btn.is-active {
  background: #2563eb;
  color: #fff;
}

.ls-config-panels {
  padding: 24px 32px 28px;
  overflow-y: auto;
  scrollbar-width: thin;
  background: #fff;
}

.ls-config-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.ls-config-panel__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.ls-config-panel__icon svg {
  display: block;
}

.ls-config-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ls-config-checks .ls-check {
  border: 0;
  background: transparent;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 400;
  color: #1e293b;
}

.ls-config-checks .ls-check:hover {
  border-color: transparent;
  background: transparent;
}

.ls-check {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
  color: #334155;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.ls-check:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.ls-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  margin-top: 2px;
  flex-shrink: 0;
}

.ls-config-panel {
  display: none;
}

.ls-config-panel.is-active {
  display: block;
}

.ls-config-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.ls-config-field input,
.ls-config-field select {
  margin-top: 0;
}

.ls-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 8px;
}

.ls-radio {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}

.ls-radio input[type="radio"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.ls-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 720px) {
  .ls-form--grid,
  .ls-form.grid-form {
    grid-template-columns: 1fr;
  }

  .ls-config-layout {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .ls-config-nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--border, #e2e8f0);
  }

  .ls-modal-overlay .modal-card.ls-modal-card,
  .ls-modal-card--wide,
  .ls-modal-card--config {
    width: min(96vw, 100%);
  }

  .ls-modal-overlay .modal-card.ls-modal-card.ls-modal-card--config {
    width: min(98vw, 100%);
  }
}

/* —— Lab Signatures —— */
.lsig-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.lsig-toolbar__spacer {
  flex: 1;
}

.lsig-tabs {
  margin-bottom: 12px;
}

.lsig-th-text {
  min-width: 220px;
}

.lsig-th-image {
  width: 140px;
}

.lsig-td-text {
  font-size: 13px;
  max-width: 320px;
  white-space: normal;
}

.lsig-td-image {
  text-align: center;
}

.lsig-thumb {
  max-height: 48px;
  max-width: 120px;
  object-fit: contain;
  display: inline-block;
}

.lsig-thumb--empty {
  color: var(--text-muted, #888);
}

.cases-act-archive {
  color: #64748b;
}

.lsig-modal-card {
  width: min(96vw, 580px);
  max-width: none;
}

.lsig-form {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lsig-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.lsig-field input,
.lsig-field textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 8px;
  box-sizing: border-box;
}

.lsig-mode-tabs {
  display: flex;
  gap: 8px;
}

.lsig-mode-tab {
  border: 1px solid var(--border, #d8dee6);
  background: #fff;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.lsig-mode-tab.is-active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
}

.lsig-canvas {
  width: 100%;
  height: 140px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.lsig-canvas-tools {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.lsig-tool-btn {
  border: 1px solid var(--border, #d8dee6);
  background: #f8fafc;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.lsig-upload-preview__img {
  max-height: 80px;
  margin-top: 8px;
}

.lsig-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #d8dee6);
}

/* —— Branch picker —— */
.auth-pill--branch {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
}

body.branch-picker-open {
  overflow: hidden;
}

.branch-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(0, 169, 181, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 55% at 85% 90%, rgba(245, 124, 0, 0.22), transparent 50%),
    linear-gradient(155deg, #0c2226 0%, #143840 42%, #0f2a30 100%);
  backdrop-filter: blur(4px);
}

.branch-picker-overlay[hidden] {
  display: none !important;
}

.branch-picker--overlay {
  position: relative;
  width: min(100%, 520px);
}

.branch-picker--page {
  min-height: 60vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 0;
}

.branch-picker__ambient {
  position: absolute;
  inset: -120px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.branch-picker__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: branch-picker-float 14s ease-in-out infinite;
}

.branch-picker__orb--1 {
  width: 220px;
  height: 220px;
  top: -40px;
  left: -60px;
  background: rgba(0, 169, 181, 0.55);
}

.branch-picker__orb--2 {
  width: 180px;
  height: 180px;
  bottom: -20px;
  right: -40px;
  background: rgba(245, 124, 0, 0.35);
  animation-delay: -5s;
}

.branch-picker__orb--3 {
  width: 140px;
  height: 140px;
  top: 45%;
  left: 55%;
  background: rgba(56, 189, 198, 0.4);
  animation-delay: -9s;
}

@keyframes branch-picker-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(18px, -14px) scale(1.06); }
  66% { transform: translate(-12px, 10px) scale(0.94); }
}

.branch-picker__card {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  padding: 26px 24px 20px;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 252, 253, 0.94) 100%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 0 0 1px rgba(0, 169, 181, 0.12),
    0 28px 70px rgba(0, 0, 0, 0.35),
    0 8px 24px rgba(0, 169, 181, 0.15);
  overflow: hidden;
}

.branch-picker__card-glow {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #00a9b5, #38d4de, #f57c00, #00a9b5);
  background-size: 200% 100%;
  animation: branch-picker-shimmer 6s linear infinite;
}

@keyframes branch-picker-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.branch-picker__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  padding-top: 4px;
}

.branch-picker__title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.branch-picker__title-block {
  min-width: 0;
}

.branch-picker__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f2428;
  line-height: 1.2;
}

.branch-picker__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #5a6f74;
  line-height: 1.35;
}

.branch-picker__title-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, #00a9b5, #008a94);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0, 169, 181, 0.35);
}

.branch-picker__logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(15, 36, 40, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: #3d5258;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
  box-shadow: 0 2px 8px rgba(15, 36, 40, 0.06);
}

.branch-picker__logout:hover {
  border-color: rgba(227, 52, 47, 0.35);
  color: #c53030;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(227, 52, 47, 0.12);
}

.branch-picker__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.branch-picker__foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(216, 232, 234, 0.9);
  display: flex;
  justify-content: center;
}

.branch-picker__settings {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: transparent;
  color: #5a6f74;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.branch-picker__settings:hover {
  color: var(--primary, #00a9b5);
  background: var(--primary-soft, #e0f7f9);
}

.branch-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px 14px 14px;
  border: 1px solid rgba(216, 232, 234, 0.95);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfd 100%);
  cursor: pointer;
  text-align: left;
  transition: transform 0.22s ease, border-color 0.22s, box-shadow 0.22s, background 0.22s;
  overflow: hidden;
}

.branch-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: transparent;
  transition: background 0.22s;
}

.branch-row:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 169, 181, 0.45);
  box-shadow: 0 12px 28px rgba(0, 169, 181, 0.14);
}

.branch-row:hover::before {
  background: linear-gradient(180deg, #00a9b5, #38d4de);
}

.branch-row:hover .branch-row__chev {
  background: var(--primary, #00a9b5);
  color: #fff;
  transform: translateX(2px);
}

.branch-row.is-active {
  border-color: rgba(0, 169, 181, 0.55);
  background: linear-gradient(135deg, rgba(224, 247, 249, 0.95) 0%, rgba(255, 255, 255, 1) 100%);
  box-shadow: 0 10px 24px rgba(0, 169, 181, 0.16);
}

.branch-row.is-active::before {
  background: linear-gradient(180deg, #00a9b5, #f57c00);
}

.branch-row.is-active .branch-row__chev {
  background: var(--primary, #00a9b5);
  color: #fff;
}

.branch-row__logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(216, 232, 234, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 12px rgba(15, 36, 40, 0.06);
  overflow: hidden;
}

.branch-row__logo-wrap--initials {
  background: linear-gradient(145deg, #e0f7f9, #d0eef2);
}

.branch-row__icon {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: #008a94;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.branch-row__logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 0;
  flex-shrink: 0;
}

.branch-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.branch-row__name {
  font-size: 15px;
  font-weight: 700;
  color: #0f2428;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-row__meta {
  font-size: 12px;
  color: #5a6f74;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-row__badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #008a94;
  background: rgba(0, 169, 181, 0.12);
  border: 1px solid rgba(0, 169, 181, 0.22);
}

.branch-row__chev {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eef6f7;
  color: #5a6f74;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.22s, background 0.22s, color 0.22s;
}

.branch-modal-card {
  width: min(96vw, 440px);
}

.branch-add-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 16px 18px 18px;
}

.branch-add-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  min-width: 0;
}

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

.branch-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}

.ps-modal-card--wide {
  width: min(96vw, 960px);
}

.ps-modal-card {
  width: min(96vw, 540px);
  max-height: min(92vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.ps-modal-card .modal-head {
  flex-shrink: 0;
}

.ps-modal-card .ps-signature-form,
.ps-modal-card .ps-print-order,
.ps-modal-card .ps-modal-hint,
.ps-modal-card .ps-label-order-list {
  padding-left: 16px;
  padding-right: 16px;
}

.ps-modal-card .ps-signature-form,
.ps-modal-card .ps-print-order {
  padding-top: 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.ps-modal-hint {
  margin: 0 16px 8px;
  font-size: 12px;
}

.ps-label-order-list {
  margin: 0 16px 12px;
  max-height: 50vh;
  overflow-y: auto;
}

.ps-print-order__controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.ps-print-order__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ps-order-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ps-order-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 12px;
}

.ps-order-item__actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.ps-signature-form {
  display: grid;
  gap: 12px;
}

.ps-sig-slot {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.ps-sig-slot legend {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #111827);
  padding: 0 4px;
}

.ps-sig-slot > label:not(.ps-check),
.ps-sig-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.ps-sig-slot select {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}

.ps-sig-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.ps-signature-typo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 0;
  border-top: 1px solid var(--border, #e5e7eb);
}

.ps-sig-typo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.ps-sig-typo-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.ps-sig-typo-field input {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}

.ps-sig-typo-check {
  margin-bottom: 6px;
  white-space: nowrap;
}

.ps-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border, #d8dee6);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1100px) {
  .ps-studio {
    grid-template-columns: 1fr;
  }

  .ps-studio__right {
    position: static;
  }

  .ps-grid-4,
  .ps-print-order__controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* —— Bill receipt preview (exact Labnex letterhead format) —— */
.ps-bill-receipt {
  position: relative;
  box-sizing: border-box;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
  line-height: 1.4;
  background: #fff;
}

.ps-bill-receipt--no-letterhead .ps-bill-lh {
  display: none;
}

.ps-bill-section--dotted {
  border-bottom: 1px dotted #000;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

/* Letterhead */
.ps-bill-lh {
  --ps-bill-lh-logo-w: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.ps-bill-lh__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.ps-bill-lh__logo {
  flex: 0 0 auto;
  line-height: 0;
}

.ps-bill-lh-logo {
  display: block;
  max-height: 88px;
  max-width: var(--ps-bill-lh-logo-w);
  object-fit: contain;
}

.ps-bill-lh-logo-fallback {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #e8f5e9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  color: #2e7d32;
}

.ps-bill-lh__text {
  min-width: 0;
  flex: 1 1 auto;
}

.ps-bill-lh__name {
  margin: 0;
  font-size: 15pt;
  font-weight: 700;
  line-height: 1.15;
}

.ps-bill-lh__addr {
  margin: 1px 0 0;
  padding: 0;
  font-size: 10.5pt;
  line-height: 1.3;
}

.ps-bill-lh__addr-line {
  display: block;
}

.ps-bill-lh__phones {
  flex: 0 0 auto;
  text-align: right;
  font-size: 9pt;
  line-height: 1.45;
  align-self: center;
  white-space: nowrap;
}

.ps-bill-lh__phone {
  margin: 0;
}

.ps-bill-lh__phone + .ps-bill-lh__phone {
  margin-top: 2px;
}

/* Grey RECEIPT title bar */
.ps-bill-title-bar {
  background: #eeeeee;
  text-align: center;
  padding: 5px 8px;
  margin: 0 0 8px;
}

.ps-bill-title-bar span {
  font-size: 11pt;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  letter-spacing: 0.02em;
}

/* Invoice / Case / Date */
.ps-bill-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  font-size: 10pt;
}

.ps-bill-meta-row__cell--left {
  text-align: left;
}

.ps-bill-meta-row__cell--center {
  text-align: center;
}

.ps-bill-meta-row__cell--right {
  text-align: right;
}

/* Patient + Referral doctor — two columns */
.ps-bill-info-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  align-items: start;
}

.ps-bill-info-block h4 {
  margin: 0 0 4px;
  font-size: 10pt;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  letter-spacing: 0;
}

.ps-bill-info-block p {
  margin: 0 0 2px;
  font-size: 10pt;
}

.ps-bill-info-block p strong {
  font-weight: 700;
}

/* Income slip — matches Labnex reference */
.ps-income-slip {
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
  line-height: 1.35;
}

.ps-income-slip__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.ps-income-slip__brand {
  min-width: 0;
  flex: 1 1 auto;
}

.ps-income-slip__name {
  margin: 0;
  font-size: 13pt;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.ps-income-slip__branch {
  margin: 2px 0 0;
  font-size: 10pt;
  font-weight: 600;
  color: #000;
}

.ps-income-slip__phone {
  margin: 0;
  flex: 0 0 auto;
  font-size: 9pt;
  line-height: 1.4;
  text-align: right;
  white-space: nowrap;
}

.ps-income-slip__title-bar {
  background: #eeeeee;
  text-align: center;
  padding: 5px 8px;
  margin: 0 0 10px;
}

.ps-income-slip__title-bar span {
  font-size: 11pt;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  letter-spacing: 0.02em;
}

.ps-income-slip__section {
  border-bottom: 1px dotted #000;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.ps-income-slip__info {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px 16px;
  font-size: 10pt;
}

.ps-income-slip__info-col p {
  margin: 0 0 4px;
  line-height: 1.4;
}

.ps-income-slip__info-col--right {
  text-align: right;
}

.ps-income-slip__info-col p strong {
  font-weight: 700;
}

.ps-income-slip__table {
  margin-top: 2px;
  font-size: 10pt;
}

.ps-income-slip__table-head,
.ps-income-slip__table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 5px 8px;
}

.ps-income-slip__table-head {
  background: #eeeeee;
  font-weight: 700;
}

.ps-income-slip__table-head span:last-child,
.ps-income-slip__income-amt {
  text-align: right;
  flex: 0 0 auto;
}

.ps-income-slip__income-desc {
  flex: 1 1 auto;
  min-width: 0;
}

.ps-income-slip__table-row {
  padding-top: 6px;
  padding-bottom: 6px;
}

.ps-income-slip__total {
  margin: 8px 0 10px;
  text-align: right;
  font-size: 10pt;
}

.ps-income-slip__total strong {
  font-weight: 700;
}

.ps-income-slip__issue {
  margin: 0;
  font-size: 10pt;
}

.ps-income-slip__issue strong {
  font-weight: 700;
}

.pb-viewer__page-shell .ps-income-slip {
  max-width: 100%;
}

.pb-modal--income .pb-viewer__page-shell .ci-preview-shell {
  padding: 14mm 16mm;
}

.pb-modal__body--single {
  grid-template-columns: 1fr;
}

.pb-modal--income .pb-modal__body {
  min-height: 70vh;
}

#incomeSlipModal.is-open,
#updateTxnModal.is-open {
  z-index: 1260;
}

#incomeSlipModal.pb-modal-overlay--stack.is-open {
  z-index: 1265;
}

/* Reports table — dotted rules, ₹ amounts */
.ps-bill-table-wrap {
  padding-bottom: 4px;
}

.ps-bill-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0;
  font-size: 10pt;
  border-top: none;
  border-bottom: none;
}

.ps-bill-col-name {
  width: 50%;
}

.ps-bill-col-money {
  width: 16.66%;
}

.ps-bill-table thead tr {
  background: #eeeeee;
}

.ps-bill-table th {
  background: #eeeeee;
  color: #000;
  font-weight: 700;
  font-size: 9pt;
  text-transform: uppercase;
  text-decoration: none;
  padding: 5px 4px;
  border: none;
  vertical-align: bottom;
}

.ps-bill-table th:nth-child(1) {
  text-align: left;
}

.ps-bill-table th:nth-child(n + 2) {
  text-align: right;
}

.ps-bill-table td {
  padding: 4px 4px;
  border: none;
  vertical-align: top;
  font-size: 10pt;
  font-weight: 400;
  background: #fff;
}

.ps-bill-table__name {
  text-align: left;
  word-break: break-word;
}

.ps-bill-num {
  text-align: right;
  white-space: nowrap;
}

.ps-bill-total-row td {
  padding-top: 5px;
  padding-bottom: 5px;
  font-weight: 700;
}

.ps-bill-table-wrap.ps-bill-section--dotted {
  border-bottom: none;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

/* Payment + signature */
.ps-bill-footer-wrap {
  display: block;
  margin-top: 4px;
  position: relative;
}

.ps-bill-payment {
  width: 100%;
  margin-bottom: 20px;
}

.ps-bill-payment h4 {
  margin: 0 0 5px;
  font-size: 10pt;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ps-bill-payment-rows {
  width: 100%;
  max-width: 100%;
}

.ps-bill-pay-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 2px;
  font-size: 10pt;
  line-height: 1.45;
}

.ps-bill-pay-row__label {
  flex: 0 1 auto;
  text-align: left;
}

.ps-bill-pay-row__value {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}

.ps-bill-cashier-sig {
  width: 160px;
  margin-left: auto;
  text-align: center;
  font-size: 9pt;
}

.ps-bill-sig-line {
  border-bottom: 1px solid #000;
  height: 32px;
  margin-bottom: 3px;
}

.ps-bill-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.ps-bill-header__brand {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.ps-bill-logo {
  object-fit: contain;
}

.ps-bill-lab-name {
  margin: 0 0 4px;
  font-size: 1.35em;
  text-transform: uppercase;
}

.ps-bill-lab-info {
  margin: 0;
  font-size: 0.9em;
}

.ps-bill-barcode {
  max-height: 48px;
}

.ps-bill-title {
  display: none;
}

.ps-bill-info-single {
  margin-bottom: 10px;
}

.ps-bill-meta-line {
  margin: 0 0 8px;
}

.ps-bill-payment-wrap {
  display: block;
}

.ps-bill-payment p {
  margin: 0 0 4px;
}

.ps-subheading {
  margin: 12px 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.print-target .ps-bill-receipt,
.pb-viewer__page-shell .ci-preview-shell .ps-bill-receipt {
  background: #fff;
}

.pb-viewer__page-shell .ci-preview-shell.letter-preview {
  padding: 0;
  box-shadow: none;
  max-width: none;
}

.pb-viewer__page-shell .ps-bill-receipt {
  padding: 12mm 10mm 14mm !important;
}

/* ——— Billing / New Case workspace ——— */
.panel.tab-content.tab-billing {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  padding-bottom: 88px;
}

body.ec-edit-mode {
  overflow: hidden;
}

body.ec-edit-mode .nav-panel,
body.ec-edit-mode .topbar,
body.ec-edit-mode .fab-new-billing {
  pointer-events: none;
}

body.ec-edit-mode #billingTab {
  position: fixed;
  inset: 0;
  z-index: 1100;
  overflow: auto;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

body.ec-edit-mode #billingTab .nc-view {
  max-width: 1180px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  padding-bottom: 0;
}

body.ec-edit-mode #billingAbhaBtn,
body.ec-edit-mode .nc-patient-unified,
body.ec-edit-mode .billing-nc-head .all-cases-head__actions {
  display: none !important;
}

body.ec-edit-mode #editCaseCloseBtn {
  display: inline-flex !important;
}

body.ec-edit-mode .pt-modal-overlay.is-open {
  z-index: 1300;
}

.nc-patient-readonly .pt-info-card {
  margin: 0;
  border: none;
  box-shadow: none;
  padding: 0;
}

.billing-new-case-btn {
  font-weight: 700;
  padding: 0 18px;
  height: 38px;
}

.billing-landing-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.billing-landing-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  min-height: 220px;
  color: var(--text-muted);
}

.billing-landing-empty h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #0f172a;
}

.billing-landing-empty p {
  margin: 0;
  max-width: 40ch;
  font-size: 14px;
}

.billing-landing-empty__icon {
  color: var(--primary);
  opacity: 0.85;
}

.nc-view {
  --nc-field-gap: 14px;
  --nc-row-gap: 12px;
  --nc-input-h: 38px;
  --nc-label-size: 12px;
  --nc-section-pad: 16px;
  --nc-border: #d1d5db;
  --nc-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

.nc-workspace {
  display: flex;
  flex-direction: column;
  gap: var(--nc-row-gap);
}

.nc-view .nc-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: var(--nc-section-pad);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.nc-view .nc-card__title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
}

.nc-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.85fr);
  gap: var(--nc-row-gap);
  align-items: start;
}

/* Patient block — single card, form + picker side by side */
.nc-patient-unified {
  padding: var(--nc-section-pad);
}

.nc-patient-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(232px, 280px);
  gap: 18px;
  align-items: start;
}

.nc-patient-split__main {
  min-width: 0;
}

.nc-patient-split__main > .nc-card__title {
  margin-bottom: 10px;
}

.nc-patient-picker {
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid #e8eef2;
  display: flex;
  flex-direction: column;
}

.nc-patient-picker__title {
  margin-bottom: 8px;
  font-size: 14px;
}

.nc-patient-picker .nc-patient-search {
  margin-bottom: 8px;
}

.nc-patient-picker .nc-patient-list {
  max-height: 156px;
  overflow-y: auto;
}

.nc-patient-picker .nc-patient-list li button {
  padding: 8px 10px;
}

.nc-patient-picker .nc-patient-empty {
  padding: 14px 8px;
}

.nc-patient-card,
.nc-available-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.nc-view .nc-patient-card {
  overflow: hidden;
}

/* ——— Patient Details ——— */
.nc-view .nc-patient-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 10px;
  align-items: end;
  width: 100%;
  min-width: 0;
}

.nc-view .nc-patient-grid .nc-field--title {
  grid-column: span 2;
}

.nc-view .nc-patient-grid .nc-field--name {
  grid-column: span 3;
}

.nc-view .nc-patient-grid .nc-field--phone {
  grid-column: span 3;
}

.nc-view .nc-patient-grid .nc-field--email {
  grid-column: span 4;
}

.nc-view .nc-patient-grid .nc-field--age-unit {
  grid-column: span 2;
}

.nc-view .nc-patient-grid .nc-field--age-val {
  grid-column: span 1;
}

.nc-view .nc-patient-grid .nc-field--gender-wrap {
  grid-column: span 3;
}

.nc-view .nc-patient-grid .nc-field--blood {
  grid-column: span 2;
}

.nc-view .nc-patient-grid .nc-field--locality {
  grid-column: span 4;
}

.nc-view .nc-patient-form {
  display: block;
}

.nc-view .nc-patient-form .nc-patient-grid {
  margin: 0;
}

.nc-view .nc-patient-grid .nc-field,
.nc-view .nc-patient-grid .nc-field--gender-wrap {
  display: block;
  min-width: 0;
  margin: 0;
  font-size: var(--nc-label-size);
  font-weight: 500;
  color: #4b5563;
  line-height: 1.3;
}

.nc-view .nc-patient-grid .nc-field__label {
  display: block;
  font-size: var(--nc-label-size);
  font-weight: 600;
  color: #64748b;
}

.nc-view .nc-patient-grid .nc-field > input:not([type="checkbox"]):not([type="radio"]),
.nc-view .nc-patient-grid .nc-field > select,
.nc-view .nc-patient-grid .nc-field > .nc-phone-field,
.nc-view .nc-patient-grid .nc-field--gender-wrap > .nc-field--gender {
  margin-top: 4px;
}

.nc-view .nc-patient-grid input:not([type="checkbox"]):not([type="radio"]),
.nc-view .nc-patient-grid select {
  box-sizing: border-box;
  width: 100%;
  height: var(--nc-input-h);
  min-height: var(--nc-input-h) !important;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius);
  background: #fff;
  color: var(--text);
}

.nc-view .nc-field--age-val input {
  text-align: center;
  padding: 0 6px;
}

.nc-view .nc-field--name input {
  font-weight: 600;
}

.nc-view .nc-field--gender-wrap {
  align-self: end;
}

.nc-view .nc-field--gender {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  padding: 0;
  min-height: var(--nc-input-h);
  height: var(--nc-input-h);
  border: none;
  background: transparent;
  box-sizing: border-box;
  min-width: 0;
}

.nc-view .nc-field--gender legend {
  display: none;
}

.nc-view .nc-gender-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.nc-view .nc-gender-opt input {
  width: 14px;
  height: 14px;
  min-height: 0 !important;
  margin: 0;
  accent-color: var(--primary);
  border: none !important;
  background: transparent;
}

.nc-view .nc-phone-field {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: var(--nc-input-h);
  min-height: var(--nc-input-h);
  padding: 0 10px;
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius);
  background: #fff;
  box-sizing: border-box;
}

.nc-view .nc-phone-field__prefix {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}

.nc-view .nc-phone-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  padding: 0;
  border: none !important;
  background: transparent;
  box-shadow: none;
}

/* ——— New Case: case details & other grids ——— */
.nc-view .nc-grid {
  display: grid;
  column-gap: var(--nc-field-gap);
  row-gap: var(--nc-row-gap);
  align-items: end;
  width: 100%;
  min-width: 0;
}

.nc-view .nc-grid .nc-field {
  display: block;
  margin: 0;
  min-width: 0;
  font-size: var(--nc-label-size);
  font-weight: 500;
  color: #4b5563;
  line-height: 1.3;
}

.nc-view .nc-field > input:not([type="checkbox"]):not([type="radio"]),
.nc-view .nc-field > select,
.nc-view .nc-field > .inline-age,
.nc-view .nc-field > .billing-referrer-controls,
.nc-view .nc-field > .billing-test-add-controls,
.nc-view .nc-field > .nc-grid--investigation {
  margin-top: 4px;
}

.nc-view .nc-field input:not([type="checkbox"]):not([type="radio"]),
.nc-view .nc-field select {
  box-sizing: border-box;
  width: 100%;
  height: var(--nc-input-h);
  min-height: var(--nc-input-h) !important;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius);
  background: #fff;
  color: var(--text);
}

.nc-view .nc-field__label {
  display: block;
  font-size: var(--nc-label-size);
  font-weight: 500;
  color: #4b5563;
  line-height: 1.3;
}

.nc-view .nc-field--collector .nc-field__label {
  margin-bottom: 4px;
}

.nc-view .nc-field--collector select {
  margin-top: 0;
}

.nc-view .nc-field--collector {
  display: block;
  min-width: 0;
}

.nc-view .nc-field__label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  min-width: 0;
}

.nc-view .nc-field__label-row .nc-field__label {
  margin-bottom: 0;
  min-width: 0;
}

.nc-view .nc-field--collector select {
  margin-top: 0;
}

.nc-view .nc-link-btn {
  display: inline-block;
  margin-top: 0;
  padding: 0;
  border: none;
  background: none;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.nc-view .nc-link-btn:hover {
  color: #4338ca;
  text-decoration: underline;
}

.nc-view .nc-field--urgent {
  display: block;
  min-width: 0;
}

.nc-view .nc-field--urgent .nc-field__label {
  margin-bottom: 6px;
}

.nc-view .nc-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-top: 2px;
}

.nc-view .nc-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.nc-view .nc-switch__track {
  display: block;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.15s ease;
  position: relative;
}

.nc-view .nc-switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}

.nc-view .nc-switch input:checked + .nc-switch__track {
  background: #6366f1;
}

.nc-view .nc-switch input:checked + .nc-switch__track::after {
  transform: translateX(16px);
}

.nc-view .nc-field--urgent .nc-switch {
  margin-top: 0;
}

.nc-view .nc-field input.input-readonly,
.nc-view .nc-field input[readonly] {
  background: #f9fafb;
  color: #6b7280;
  cursor: default;
}

.nc-view .nc-field .inline-age {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(72px, 1.2fr);
  gap: 8px;
  width: 100%;
}

.nc-view .nc-field .inline-age input,
.nc-view .nc-field .inline-age select {
  width: 100%;
  min-width: 0;
  height: var(--nc-input-h);
  min-height: var(--nc-input-h) !important;
}

.nc-view .nc-field .salutation-select {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.nc-view .nc-field .billing-referrer-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--nc-input-h);
  gap: 8px;
  width: 100%;
}

.nc-view .nc-field .billing-referrer-controls input {
  width: 100%;
  min-width: 0;
}

.nc-view .billing-referrer-plus,
.nc-view .billing-test-plus {
  width: var(--nc-input-h);
  height: var(--nc-input-h);
  min-height: var(--nc-input-h) !important;
  padding: 0;
  flex: none;
}

.nc-view .nc-field--toggle {
  display: none;
}

.nc-view .nc-grid__fill {
  min-width: 0;
  min-height: 0;
}

/* Case Details — single row */
.nc-view .nc-grid--case {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  column-gap: 10px;
}

.nc-view .nc-grid--case.nc-grid--case--b2b,
.nc-view .nc-grid--case.nc-grid--case--org {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.nc-view .nc-field--consulting .nc-field__label-row,
.nc-view .nc-field--collector .nc-field__label-row,
.nc-view .nc-field--organization .nc-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 16px;
  margin-bottom: 4px;
}

.nc-view .nc-field--consulting .nc-field__label,
.nc-view .nc-field--organization .nc-field__label {
  margin: 0;
}

/* Organization quick-add uses wide form shell sizing in surya-dashboard.css */

.org-modal-form {
  display: grid;
  gap: 10px 12px;
  padding: 16px 18px 18px;
}

.org-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.org-field--check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.org-field__label {
  font-size: 12px;
  color: #64748b;
}

.org-modal-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}

.nc-view .nc-link-btn--inline {
  display: inline;
  margin-top: 0;
  margin-left: 6px;
  font-size: 11px;
  vertical-align: baseline;
}

.nc-view .nc-field--collector .nc-field__label {
  white-space: normal;
  overflow: visible;
}

/* Tablet — case details wrap to 2 rows */
@media (min-width: 768px) and (max-width: 1199px) {
  .nc-view .nc-grid--case {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nc-view .nc-grid--case.nc-grid--case--b2b,
  .nc-view .nc-grid--case.nc-grid--case--org {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Mobile < 768px — stack fields */
@media (max-width: 767px) {
  .nc-patient-split {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .nc-patient-picker {
    padding-left: 0;
    padding-top: 14px;
    border-left: none;
    border-top: 1px solid #e8eef2;
  }

  .nc-patient-picker .nc-patient-list {
    max-height: 200px;
  }

  .nc-view .nc-patient-grid .nc-field,
  .nc-view .nc-patient-grid .nc-field--gender-wrap,
  .nc-view .nc-patient-grid .nc-field--title,
  .nc-view .nc-patient-grid .nc-field--name,
  .nc-view .nc-patient-grid .nc-field--phone,
  .nc-view .nc-patient-grid .nc-field--email,
  .nc-view .nc-patient-grid .nc-field--age-unit,
  .nc-view .nc-patient-grid .nc-field--age-val,
  .nc-view .nc-patient-grid .nc-field--blood,
  .nc-view .nc-patient-grid .nc-field--locality {
    grid-column: 1 / -1;
  }

  .nc-view .nc-field--gender {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--nc-input-h);
  }

  .nc-view .nc-grid--case,
  .nc-view .nc-grid--investigation {
    grid-template-columns: 1fr;
  }

  .nc-view .nc-grid--case .nc-field {
    grid-column: 1 / -1;
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .nc-view .nc-grid__fill {
    display: none;
  }
}

.nc-view .nc-case-card .nc-grid--case {
  margin-bottom: var(--nc-row-gap);
}

.nc-combo {
  position: relative;
  width: 100%;
}

.nc-combo-input {
  box-sizing: border-box;
  width: 100%;
  height: var(--sd-control-h, 34px);
  min-height: var(--sd-control-h, 34px) !important;
  padding: 0 28px 0 10px;
  font-size: 13px;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.nc-combo-input:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
}

.nc-combo-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -2px;
  border-right: 1.5px solid #9ca3af;
  border-bottom: 1.5px solid #9ca3af;
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.nc-combo-drop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  max-height: 180px;
  overflow: auto;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 40, 44, 0.12);
}

.nc-combo-opt {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  color: #111827;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.nc-combo-opt:hover,
.nc-combo-opt:focus-visible,
.nc-combo-opt.is-active {
  background: #2563eb;
  color: #fff;
  outline: none;
}

.nc-combo-opt:last-child {
  border-bottom: none;
}

.nc-field--referrer-type {
  position: relative;
  z-index: 6;
}

.nc-datetime-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  width: 100%;
}

.nc-datetime-display {
  box-sizing: border-box;
  width: 100%;
  height: var(--sd-control-h, 34px);
  min-height: var(--sd-control-h, 34px) !important;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid #dbe3ea;
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.nc-datetime-display:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
}

.nc-datetime-display::placeholder {
  color: #9ca3af;
}

.nc-datetime-btn-wrap {
  position: relative;
  width: 36px;
  height: var(--sd-control-h, 34px);
  border: 1px solid #dbe3ea;
  border-radius: 0 8px 8px 0;
  background: #fff;
  overflow: hidden;
}

.nc-datetime-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  margin: 0;
  padding: 0;
}

.nc-datetime-btn-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  pointer-events: none;
}

.nc-datetime-wrap:focus-within .nc-datetime-display,
.nc-datetime-wrap:focus-within .nc-datetime-btn-wrap {
  border-color: #818cf8;
}

.nc-datetime-wrap:focus-within {
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
  border-radius: 8px;
}

.nc-investigation-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--nc-input-h);
  gap: 8px;
  margin-bottom: 0;
}

.nc-investigation-add input {
  width: 100%;
  min-width: 0;
  height: var(--nc-input-h);
  min-height: var(--nc-input-h) !important;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius);
  background: #fff;
  box-sizing: border-box;
}

.nc-investigation-add .billing-test-plus {
  width: var(--nc-input-h);
  height: var(--nc-input-h);
  min-height: var(--nc-input-h) !important;
  padding: 0;
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius);
  background: #fff;
  color: #4f46e5;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}

.nc-investigation-add .billing-test-plus:hover {
  background: #f5f3ff;
}

.nc-view .nc-case-card {
  display: flex;
  flex-direction: column;
  gap: var(--nc-row-gap);
}

.nc-view .nc-patient-search {
  width: 100%;
  height: var(--nc-input-h);
  padding: 0 10px;
  margin-bottom: 8px;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  font-size: 13px;
  box-sizing: border-box;
}

.nc-field-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sd-grid-gap, 12px);
  row-gap: var(--sd-grid-gap, 12px);
  align-items: end;
}

.nc-field {
  display: block;
  margin: 0;
  min-width: 0;
  font-size: var(--sd-label-size, 11px);
  font-weight: 600;
  color: #64748b;
  align-self: end;
}

.nc-field-grid > .nc-field {
  grid-column: span 3;
}

.nc-field--span2 {
  grid-column: span 2;
}

.nc-field--span5 {
  grid-column: span 5;
}

.nc-field--span6 {
  grid-column: span 6;
}

.nc-field--span8 {
  grid-column: span 8;
}

.nc-field--span3 {
  grid-column: span 3;
}

.nc-field--full {
  grid-column: span 12;
}

.nc-field--grow {
  flex: 1;
  min-width: 0;
}

.nc-field input:not([type="checkbox"]):not([type="radio"]),
.nc-field select {
  width: 100%;
  box-sizing: border-box;
  height: var(--sd-control-h, 34px);
  min-height: var(--sd-control-h, 34px) !important;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.nc-field .inline-age {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  width: 100%;
}

.nc-field .inline-age input,
.nc-field .inline-age select {
  width: 100%;
  min-width: 0;
  height: var(--sd-control-h, 34px);
  min-height: var(--sd-control-h, 34px) !important;
}

.nc-field .salutation-select {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.nc-field .billing-referrer-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sd-control-h, 38px);
  gap: 8px;
  width: 100%;
}

.nc-field .billing-referrer-controls input {
  width: 100%;
  min-width: 0;
}

.nc-field .billing-referrer-plus,
.nc-investigation-add .billing-test-plus {
  width: var(--sd-control-h, 38px);
  height: var(--sd-control-h, 34px);
  min-height: var(--sd-control-h, 34px) !important;
  padding: 0;
  flex: none;
}

.nc-patient-search {
  width: 100%;
  height: var(--sd-control-h, 34px);
  padding: 0 10px;
  margin-bottom: 8px;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  font-size: 13px;
}

.nc-patient-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nc-patient-list li button {
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
}

.nc-patient-list li button:hover,
.nc-patient-list li button.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.nc-patient-list__name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.nc-patient-list__meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #64748b;
}

.nc-patient-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 12px;
  color: #94a3b8;
  text-align: center;
}

.nc-patient-empty[hidden],
.nc-patient-list:not(:empty) + .nc-patient-empty {
  display: none;
}

.nc-patient-list:not(:empty) {
  display: flex;
}

.nc-investigation-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.nc-investigation-table col.nc-col-sr { width: 5%; }
.nc-investigation-table col.nc-col-inv { width: 13%; }
.nc-investigation-table col.nc-col-report { width: 27%; }
.nc-investigation-table col.nc-col-time { width: 12%; }
.nc-investigation-table col.nc-col-price { width: 11%; }
.nc-investigation-table col.nc-col-disc { width: 11%; }
.nc-investigation-table col.nc-col-total { width: 11%; }
.nc-investigation-table col.nc-col-action { width: 10%; }

.nc-investigation-table thead th {
  background: #eef2f7;
  color: #374151;
  font-size: 11px;
  font-weight: 600;
  padding: 9px 10px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: bottom;
}

.nc-investigation-table thead th.nc-col-sr,
.nc-investigation-table thead th.nc-col-action {
  text-align: center;
}

.nc-investigation-table thead th.nc-col-money {
  text-align: right;
  padding-right: 10px;
}

.nc-investigation-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
  font-size: 12px;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nc-investigation-table .nc-col-sr {
  text-align: center;
  color: #6b7280;
}

.nc-investigation-table .nc-col-inv,
.nc-investigation-table .nc-col-report {
  white-space: nowrap;
}

.nc-bill-kind-select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  font-size: 12px;
  border: 1px solid var(--nc-border, #d1d5db);
  border-radius: 4px;
  background: #fff;
  color: #111827;
}

.nc-bill-rpt {
  position: relative;
  width: 100%;
  min-width: 0;
}

.nc-bill-rpt-chevron {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #9ca3af;
  border-bottom: 1.5px solid #9ca3af;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  z-index: 1;
}

.nc-bill-rpt-search {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 24px 0 22px;
  font-size: 12px;
  border: 1px solid var(--nc-border, #d1d5db);
  border-radius: 4px;
  background: #fff;
  color: #111827;
}

.nc-bill-rpt-search:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.15);
}

.nc-bill-rpt-search::placeholder {
  color: #9ca3af;
}

.nc-bill-rpt-drop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #dbe3ea;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 40, 44, 0.12);
}

.nc-bill-rpt-opt {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  color: #111827;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  line-height: 1.35;
}

.nc-bill-rpt-opt:hover,
.nc-bill-rpt-opt:focus-visible {
  background: #eff6ff;
  outline: none;
}

.nc-bill-rpt-opt:last-child {
  border-bottom: none;
}

.nc-bill-rpt-empty {
  padding: 12px 10px;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
}

.nc-bill-time {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  font-size: 12px;
  border: 1px solid var(--nc-border, #d1d5db);
  border-radius: 4px;
  background: #fff;
  color: #374151;
}

.nc-bill-row--draft .nc-bill-time,
.nc-bill-row--draft .nc-bill-input[readonly] {
  background: #fafafa;
  color: #6b7280;
}

.nc-investigation-table .nc-col-time {
  color: #9ca3af;
  white-space: nowrap;
}

.nc-investigation-table .nc-col-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-right: 10px;
  padding-left: 6px;
}

.nc-investigation-table .nc-col-action {
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

.nc-bill-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  font-size: 12px;
  text-align: right;
  border: 1px solid var(--nc-border, #d1d5db);
  border-radius: 4px;
  background: #fff;
  color: #111827;
}

.nc-bill-discount-wrap {
  position: relative;
  display: block;
}

.nc-bill-discount-wrap .nc-bill-input {
  padding-right: 22px;
}

.nc-bill-discount-suffix {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #9ca3af;
  pointer-events: none;
}

.nc-bill-line-total {
  font-weight: 600;
  white-space: nowrap;
}

.nc-table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: var(--nc-radius);
}

.nc-table-wrap.nc-table-wrap--drop-open {
  overflow: visible;
}

.nc-investigation-table tbody td.nc-col-report,
.nc-investigation-table tbody td.nc-col-inv {
  overflow: visible;
}

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

.nc-view .nc-investigation-table .billing-bill-empty {
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  padding: 20px 12px !important;
  white-space: normal;
}

.nc-table-meta {
  margin: 0;
  padding: 8px 12px;
  font-size: 11px;
  color: #64748b;
  background: #fafbfc;
  border-top: 1px solid #e2e8f0;
}

.nc-payment-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sd-grid-gap, 12px);
  row-gap: var(--sd-grid-gap, 12px);
  align-items: end;
}

.nc-payment-grid > .nc-payment-stat {
  grid-column: span 3;
  min-width: 0;
}

.nc-payment-grid > .nc-payment-stat--gst {
  grid-column: span 6;
}

.nc-payment-stat {
  display: block;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fafbfc;
  font-size: var(--sd-label-size, 11px);
  font-weight: 600;
  color: #64748b;
  min-height: 0;
}

.nc-payment-stat--edit input,
.nc-payment-stat--edit select {
  width: 100%;
  min-height: var(--sd-control-h, 34px);
  height: var(--sd-control-h, 34px);
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.nc-payment-value {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 3px;
  display: block;
}

.nc-payment-value--due {
  color: var(--danger);
}

.nc-payment-value--sm {
  font-size: 13px;
}

.nc-payment-stat--gst .nc-gst-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nc-payment-stat--gst input[type="number"] {
  width: 72px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #dbe3ea;
  border-radius: 6px;
}

.nc-footer-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}

.nc-footer-bar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nc-abha-btn,
.nc-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-weight: 700;
}

.nc-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
}

.nc-remove-btn:hover {
  background: #fef2f2;
}

.nc-remove-btn--disabled,
.nc-remove-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.nc-remove-btn--disabled:hover,
.nc-remove-btn:disabled:hover {
  background: transparent;
}

.nc-remove-btn svg {
  display: block;
}

/* ——— Payment Details (LIS horizontal row) ——— */
.nc-payment-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nc-lis-pay-row {
  display: grid;
  grid-template-columns:
    minmax(88px, 0.95fr)
    minmax(128px, 1.2fr)
    minmax(76px, 0.85fr)
    minmax(96px, 1fr)
    minmax(88px, 0.95fr)
    minmax(96px, 1fr)
    minmax(76px, 0.85fr)
    minmax(88px, 0.95fr);
  gap: 10px;
  align-items: end;
}

.nc-lis-discount-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.nc-lis-discount-entry input {
  min-width: 0;
}

.nc-lis-discount-toggle {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius);
  overflow: hidden;
}

.nc-lis-discount-toggle .toggle-pill {
  min-width: 30px;
  height: var(--nc-input-h);
  padding: 0 8px;
  border: none;
  background: #fff;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}

.nc-lis-discount-toggle .toggle-pill.active {
  background: #eef2ff;
  color: #4f46e5;
}

.nc-remark-modal-overlay.is-open {
  display: flex;
}

.nc-lis-pay-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.nc-lis-pay-label {
  display: block;
  min-height: 16px;
  font-size: var(--nc-label-size);
  font-weight: 500;
  color: #4b5563;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nc-lis-pay-slot {
  display: flex;
  align-items: center;
  min-height: var(--nc-input-h);
  width: 100%;
  min-width: 0;
}

.nc-lis-pay-slot .nc-lis-currency-wrap {
  width: 100%;
}

.nc-lis-pay-value {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--nc-input-h);
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.2;
}

.nc-lis-pay-value--due {
  color: #dc2626;
}

.nc-lis-pay-value.has-balance,
.nc-lis-pay-value--due.has-balance {
  color: #dc2626;
}

.nc-lis-pay-cell--input input,
.nc-lis-pay-cell--input select,
.nc-lis-pay-slot input,
.nc-lis-pay-slot select {
  box-sizing: border-box;
  width: 100%;
  height: var(--nc-input-h);
  min-height: var(--nc-input-h) !important;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius);
  background: #fff;
  color: var(--text);
}

.nc-lis-currency-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.nc-lis-currency-wrap input {
  width: 100%;
  padding-right: 28px !important;
}

.nc-lis-currency-suffix {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: #6b7280;
  pointer-events: none;
}

.nc-lis-pay-note {
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
}

.nc-lis-pay-note[hidden] {
  display: none !important;
}

.nc-lis-hint {
  font-size: 11px;
  color: #9ca3af;
  cursor: help;
}

.nc-lis-pay-remarks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nc-remark-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius);
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.nc-remark-btn:hover {
  background: #f9fafb;
}

.nc-remark-btn.has-remark {
  border-color: #a5b4fc;
  background: #eef2ff;
  color: #4338ca;
}

.nc-remark-btn__icon {
  font-size: 13px;
  line-height: 1;
}

.nc-remark-modal-overlay {
  z-index: 1310;
}

.nc-bill-price-modal {
  max-width: 420px;
}

.nc-bill-price-form__name {
  margin: 0 0 14px;
  font-size: 13px;
  color: #374151;
  line-height: 1.45;
}

.nc-bill-price-form__name strong {
  font-weight: 600;
  color: #6b7280;
}

.nc-bill-price-form input[type="number"] {
  box-sizing: border-box;
  width: 100%;
  height: var(--nc-input-h, 36px);
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  background: #fff;
  color: #111827;
}

.nc-bill-price-form input[type="number"]:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
}

.nc-bill-price-form input[type="number"]::placeholder {
  color: #9ca3af;
}

.nc-remark-modal {
  max-width: 480px;
  width: min(96vw, 480px);
  border-radius: 10px;
}

.nc-remark-modal__head {
  padding: 18px 20px 8px;
  border-bottom: none;
}

.nc-remark-modal__head h2 {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.nc-remark-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 20px 20px;
}

.nc-remark-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nc-remark-form__label {
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
}

.nc-remark-form__field textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.45;
  border: 1px solid var(--nc-border, #d1d5db);
  border-radius: 6px;
  resize: vertical;
  box-sizing: border-box;
}

.nc-remark-form__field textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.nc-remark-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.nc-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1200px) {
  .nc-lis-pay-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .nc-lis-pay-row {
    grid-template-columns: 1fr 1fr;
  }

  .nc-lis-pay-label {
    white-space: normal;
  }
}

/* ——— Sample Collection Agent modal (LIS) ——— */
.ag-modal--lis {
  max-width: 520px;
  width: min(96vw, 520px);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.ag-modal--lis .ag-modal__head {
  padding: 18px 20px 8px;
  border-bottom: none;
}

.ag-modal--lis .ag-modal__head h2 {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.ag-form--lis {
  padding: 8px 20px 20px;
  gap: 14px;
}

.ag-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ag-form--lis .ag-field__label {
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
}

.ag-form--lis .ag-field input:not([type="checkbox"]) {
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
}

.ag-form--lis .ag-phone-field {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
}

.ag-form--lis .ag-phone-field input {
  border: none !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 0 0 8px !important;
  box-shadow: none;
}

.ag-form--lis .ag-field--check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
}

.ag-form__actions--lis {
  padding-top: 8px;
  gap: 10px;
}

.ag-btn-cancel {
  border: none !important;
  background: transparent !important;
  color: #374151 !important;
  font-weight: 600;
  box-shadow: none !important;
}

.ag-btn-add {
  background: #6366f1 !important;
  border-color: #6366f1 !important;
  min-width: 72px;
  font-weight: 600;
}

@media (max-width: 520px) {
  .ag-form__row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .nc-patient-split {
    grid-template-columns: 1fr;
  }

  .nc-patient-picker {
    padding-left: 0;
    padding-top: 14px;
    border-left: none;
    border-top: 1px solid #e8eef2;
  }

  .nc-patient-picker .nc-patient-list {
    max-height: 220px;
  }

  .nc-top-grid {
    grid-template-columns: 1fr;
  }

  .nc-field-grid > .nc-field,
  .nc-payment-grid > .nc-payment-stat {
    grid-column: span 6;
  }

  .nc-field--span6,
  .nc-field--span8,
  .nc-field--span3,
  .nc-field--full,
  .nc-payment-grid > .nc-payment-stat--gst {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  .nc-field-grid > .nc-field,
  .nc-payment-grid > .nc-payment-stat,
  .nc-field--span6,
  .nc-field--span8 {
    grid-column: span 12;
  }

  .nc-footer-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .nc-footer-bar__right {
    margin-left: 0;
    width: 100%;
  }

  .nc-footer-bar__right .btn {
    flex: 1;
  }
}

/* ——— Active Lab tab ——— */
.tab-active-lab.panel,
.tab-active-lab {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  max-width: none;
  width: 100%;
}

.active-lab-head {
  margin-bottom: 4px;
}

.active-lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 16px;
  align-items: start;
}

.active-lab-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.active-lab-panel {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 20px 22px 22px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.active-lab-panel__head {
  margin-bottom: 18px;
}

.active-lab-panel__head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}

.active-lab-editing-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 169, 181, 0.1);
  border: 1px solid rgba(0, 169, 181, 0.22);
  color: var(--primary-hover);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  max-width: min(100%, 280px);
}

.active-lab-editing-pill:empty {
  display: none;
}

.active-lab-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.active-lab-panel__hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 56ch;
}

.active-lab-form.sd-form-grid,
.active-lab-admin-form.sd-form-grid {
  align-items: start;
}

.active-lab-form__foot {
  display: flex;
  justify-content: flex-start;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid #f1f5f9;
}

.active-lab-logo-block {
  margin-bottom: 4px;
}

.active-lab-logo-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.active-lab-logo-upload-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.active-lab-logo-upload {
  margin: 0;
}

.active-lab-logo-preview {
  min-height: 120px;
  height: 100%;
  border: 1px dashed rgba(0, 169, 181, 0.35);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fcfd 0%, #f1f8f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.active-lab-logo-preview__img {
  max-height: 88px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

.active-lab-logo-preview__empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.active-lab-logo-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.active-lab-aside {
  min-width: 0;
}

.active-lab-panel--branches {
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.active-lab-branch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  flex: 1;
}

.active-lab-branch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.active-lab-branch-row:hover {
  border-color: rgba(0, 169, 181, 0.35);
  background: #f8fcfd;
}

.active-lab-branch-row.is-active {
  border-color: rgba(0, 169, 181, 0.55);
  background: rgba(0, 169, 181, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 169, 181, 0.12);
  cursor: default;
}

.active-lab-branch-row__logo,
.active-lab-branch-row__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.active-lab-branch-row__logo {
  object-fit: cover;
}

.active-lab-branch-row__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 169, 181, 0.14);
  color: var(--primary-hover);
  font-size: 11px;
  font-weight: 700;
}

.active-lab-branch-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.active-lab-branch-row__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-lab-branch-row__meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-lab-branch-row__badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-hover);
  background: rgba(0, 169, 181, 0.12);
  padding: 4px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.active-lab-branch-row__switch {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.active-lab-add-branch-btn {
  width: 100%;
}

.print-setup-account-moved {
  margin-top: 12px;
}

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

  .active-lab-panel--branches {
    position: static;
    min-height: 0;
  }

  .active-lab-logo-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sd-form-grid > .nc-field.sd-form-span-6,
  .sd-form-grid > .nc-field.sd-form-span-4 {
    grid-column: span 12;
  }
}

/* ===== Dashboard (canonical layout) ===== */
.content:has(.tab-dashboard.active) {
  padding: 20px 24px 24px;
  background: #f4f8f9;
}

.tab-dashboard .dash-v2 {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tab-dashboard .dash-v2-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin: 0;
  padding: 18px 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a3a3f 0%, #234a50 48%, #008a94 100%);
  border: none;
  box-shadow: 0 10px 32px rgba(26, 58, 63, 0.16);
  color: #fff;
}

.tab-dashboard .dash-v2-hero__lead {
  min-width: 0;
}

.tab-dashboard .dash-v2-hero__greet {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}

.tab-dashboard .dash-v2-hero__comma {
  margin-right: 0.3em;
}

.tab-dashboard .dash-v2-hero__user {
  font-weight: 700;
  color: #fff;
}

.tab-dashboard .dash-v2-hero__sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.tab-dashboard .dash-v2-period {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 3px;
  box-shadow: none;
}

.tab-dashboard .dash-v2-period .period-option span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 600;
}

.tab-dashboard .dash-v2-period .period-option-picked span {
  background: #fff;
  color: var(--primary-hover);
}

.tab-dashboard .dash-v2-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.tab-dashboard .dash-kpi {
  padding: 16px 18px;
  border-radius: 14px;
  min-height: 88px;
}

.tab-dashboard .dash-kpi__value {
  font-size: 1.25rem;
}

.tab-dashboard .dash-v2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 4px 2px;
}

.tab-dashboard .dash-v2-actions .quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tab-dashboard .dash-v2-actions .quick-action-btn:hover {
  border-color: rgba(0, 169, 181, 0.35);
  box-shadow: 0 4px 14px rgba(0, 169, 181, 0.1);
  transform: translateY(-1px);
}

.tab-dashboard .dash-v2-actions .quick-action-btn--primary {
  background: linear-gradient(135deg, var(--primary) 0%, #008a94 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 169, 181, 0.28);
}

.tab-dashboard .dash-analytics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 14px;
  align-items: start;
}

.tab-dashboard .dash-analytics__primary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.tab-dashboard .dash-analytics__minis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tab-dashboard .dash-analytics__aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.tab-dashboard .dash-chart-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.tab-dashboard .dash-chart-card--trend {
  min-height: 260px;
}

.tab-dashboard .dash-chart-card--payment {
  min-height: 200px;
}

.tab-dashboard .dash-chart-card--mini {
  min-height: 190px;
}

.tab-dashboard .dash-chart-card--ops {
  flex: 1;
  min-height: 0;
}

.tab-dashboard .dash-chart-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tab-dashboard .dash-chart-card__head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.tab-dashboard .dash-chart-card__meta {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tab-dashboard .dash-chart-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 160px;
}

.tab-dashboard .dash-chart-canvas-wrap--tall {
  min-height: 220px;
}

.tab-dashboard .dash-chart-canvas-wrap--pie {
  min-height: 150px;
  max-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-dashboard .dash-chart-empty {
  margin: 0;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(248, 252, 253, 0.94);
  border-radius: 10px;
}

.tab-dashboard .dash-chart-empty[hidden] {
  display: none !important;
}

.tab-dashboard .dash-ops-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.tab-dashboard .dash-ops-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 12px;
}

.tab-dashboard .dash-ops-list li:last-child {
  border-bottom: none;
}

.tab-dashboard .dash-ops-list__label {
  color: var(--text-muted);
  font-weight: 500;
}

.tab-dashboard .dash-ops-list__val {
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.tab-dashboard .dash-ops-ring-wrap {
  height: 100px;
  max-width: 140px;
  margin: 0 auto;
}

.tab-dashboard .dash-tables {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 400px);
  gap: 14px;
  align-items: stretch;
}

.tab-dashboard .dash-tables__side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.tab-dashboard .dash-tables .dashboard-table-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.tab-dashboard .dash-tables__main .dashboard-table-wrap {
  max-height: 380px;
}

.tab-dashboard .dashboard-table-wrap--compact {
  max-height: 200px;
}

.tab-dashboard .dash-tables__side .activity-timeline {
  max-height: 220px;
  flex: 1;
}

.tab-dashboard .dashboard-activity-card {
  margin-top: 0;
  flex: 1;
}

.tab-dashboard .dashboard-table-head {
  padding: 14px 18px 12px;
  background: #fafcfd;
}

.tab-dashboard .dashboard-mini-table th {
  font-size: 10px;
  padding: 9px 12px;
  background: #f8fafb;
}

.tab-dashboard .dashboard-mini-table td {
  font-size: 12px;
  padding: 10px 12px;
}

.tab-dashboard .dash-chart-card,
.tab-dashboard .dash-chart-card--trend,
.tab-dashboard .dash-chart-card--payment,
.tab-dashboard .dash-chart-card--mini,
.tab-dashboard .dash-chart-card--ops {
  display: flex;
  flex-direction: column;
  grid-column: unset;
  grid-row: unset;
}

.tab-dashboard .dash-v2-actions.dashboard-quick-actions {
  margin-bottom: 0;
}

body:has(#dashboardTab.active) .fab-new-billing {
  display: none;
}

@media (min-width: 1001px) {
  body:not(.sidebar-collapsed) .layout {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }

  body:not(.sidebar-collapsed) .nav-panel {
    width: var(--sidebar-w);
    transform: none;
  }
}

@media (max-width: 1200px) {
  .tab-dashboard .dash-v2-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-dashboard .dash-analytics {
    grid-template-columns: 1fr;
  }

  .tab-dashboard .dash-analytics__aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tab-dashboard .dash-tables {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .content:has(.tab-dashboard.active) {
    padding: 14px 14px 20px;
  }

  .tab-dashboard .dash-v2-kpis {
    grid-template-columns: 1fr;
  }

  .tab-dashboard .dash-analytics__minis {
    grid-template-columns: 1fr;
  }

  .tab-dashboard .dash-analytics__aside {
    grid-template-columns: 1fr;
  }

  .tab-dashboard .dash-v2-actions .quick-action-btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }
}

/* ——— Sticker Print modal (cases label action) ——— */
.sp-modal-overlay.is-open {
  z-index: 1200;
}

.sp-modal.ci-modal--split {
  width: min(1180px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}

.sp-split-body {
  min-height: 520px;
}

.sp-preview-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #525659;
  border-radius: 0 0 0 12px;
  overflow: hidden;
}

.sp-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #323639;
  color: #e8eaed;
  font-size: 12px;
}

.sp-preview-filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.sp-preview-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sp-tool-btn {
  border: none;
  background: transparent;
  color: #e8eaed;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.sp-tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sp-preview-zoom {
  min-width: 40px;
  text-align: center;
  font-size: 11px;
}

.sp-sticker-preview-wrap {
  flex: 1;
  overflow: auto;
  padding: 32px 24px;
  background: #525659;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.sp-sticker-preview-wrap .sp-sticker-scale {
  transform-origin: top center;
}

.sp-sticker-preview-wrap .ps-label-sheet {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.sp-sticker-preview-wrap .ps-label-sticker {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.sp-config-side {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: auto;
}

.sp-config-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.sp-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 10px;
}

.sp-fields-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #334155;
  cursor: pointer;
}

.sp-fields-grid input {
  margin: 0;
  flex-shrink: 0;
}

.sp-report-block {
  flex: 1;
  min-height: 0;
}

.sp-report-table .sp-th-check,
.sp-report-table .sp-th-count {
  width: 56px;
  text-align: center;
}

.sp-report-table td.sp-td-check,
.sp-report-table td.sp-td-count {
  text-align: center;
}

.sp-report-table input[type="number"] {
  width: 48px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
}

.sp-apply-btn {
  margin-top: auto;
  align-self: flex-end;
  min-width: 88px;
}

@media (max-width: 900px) {
  .sp-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ========== Unified form modals (wide rectangular layout) ========== */
:root {
  --dash-modal-xl: min(1120px, calc(100vw - 32px));
  --dash-modal-lg: min(1020px, calc(100vw - 32px));
  --dash-modal-md: min(900px, calc(100vw - 32px));
  --dash-modal-sm: min(720px, calc(100vw - 32px));
  --dash-modal-xs: min(520px, calc(100vw - 32px));
  --dash-modal-tiny: min(440px, calc(100vw - 32px));
}

.modal-card.pk-modal,
.modal-card.rm-modal,
.modal-card.tm-modal,
.modal-card.tc-cat-modal,
.modal-card.rk-modal,
.modal-card.stm-modal,
.modal-card.osr-modal,
.modal-card.modal-card--org,
.modal-card.modal-card--referral,
.modal-card.ol-modal,
.modal-card.pl-modal,
.modal-card.mp-modal,
.modal-card.mp-perm-modal,
.modal-card.mu-modal,
.modal-card.ag-modal,
.modal-card.b2b-modal,
.modal-card.branch-modal-card,
.modal-card.lsig-modal-card,
.modal-card.ls-modal-card,
.modal-card.ps-modal-card,
.modal-card.nc-remark-modal {
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 40, 44, 0.14);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  max-width: none;
  max-height: calc(100vh - 32px);
  min-width: 0;
}

.modal-card.pk-modal > .pk-modal-head,
.modal-card.rm-modal > .rm-modal-head,
.modal-card.tm-modal > .modal-head,
.modal-card.tc-cat-modal > .rm-modal-head,
.modal-card.rk-modal > .rm-modal-head,
.modal-card.stm-modal > .rm-modal-head,
.modal-card.osr-modal > .rm-modal-head,
.modal-card.modal-card--org > .modal-head,
.modal-card.modal-card--referral > .modal-head,
.modal-card.ol-modal > .modal-head,
.modal-card.pl-modal > .modal-head,
.modal-card.mp-modal > .modal-head,
.modal-card.mp-perm-modal > .modal-head,
.modal-card.mu-modal > .modal-head,
.modal-card.ag-modal > .modal-head,
.modal-card.b2b-modal > .modal-head,
.modal-card.branch-modal-card > .modal-head,
.modal-card.lsig-modal-card > .modal-head,
.modal-card.ls-modal-card > .modal-head,
.modal-card.ps-modal-card > .modal-head,
.modal-card.nc-remark-modal > .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
  flex-shrink: 0;
}

.modal-card.pk-modal > .pk-modal-head h2,
.modal-card.rm-modal > .rm-modal-head h2,
.modal-card.tm-modal > .modal-head h2,
.modal-card.tc-cat-modal > .rm-modal-head h2,
.modal-card.rk-modal > .rm-modal-head h2,
.modal-card.stm-modal > .rm-modal-head h2,
.modal-card.osr-modal > .rm-modal-head h2,
.modal-card.modal-card--org > .modal-head h2,
.modal-card.modal-card--referral > .modal-head h2,
.modal-card.ol-modal > .modal-head h2,
.modal-card.pl-modal > .modal-head h2,
.modal-card.mp-modal > .modal-head h2,
.modal-card.mp-perm-modal > .modal-head h2,
.modal-card.mu-modal > .modal-head h2,
.modal-card.ag-modal > .modal-head h2,
.modal-card.b2b-modal > .modal-head h2,
.modal-card.branch-modal-card > .modal-head h2,
.modal-card.lsig-modal-card > .modal-head h2,
.modal-card.ls-modal-card > .modal-head h2,
.modal-card.ps-modal-card > .modal-head h2,
.modal-card.nc-remark-modal > .modal-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.35;
}

.modal-card.pk-modal .modal-close,
.modal-card.rm-modal .modal-close,
.modal-card.tm-modal .modal-close,
.modal-card.tc-cat-modal .modal-close,
.modal-card.rk-modal .modal-close,
.modal-card.stm-modal .modal-close,
.modal-card.osr-modal .modal-close,
.modal-card.modal-card--org .modal-close,
.modal-card.modal-card--referral .modal-close,
.modal-card.ol-modal .modal-close,
.modal-card.pl-modal .modal-close,
.modal-card.mp-modal .modal-close,
.modal-card.mp-perm-modal .modal-close,
.modal-card.mu-modal .modal-close,
.modal-card.ag-modal .modal-close,
.modal-card.b2b-modal .modal-close,
.modal-card.branch-modal-card .modal-close,
.modal-card.lsig-modal-card .modal-close,
.modal-card.ls-modal-card .modal-close,
.modal-card.ps-modal-card .modal-close,
.modal-card.nc-remark-modal .modal-close,
.pk-modal-close,
.rm-modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  flex-shrink: 0;
}

.modal-card.pk-modal .modal-close:hover,
.modal-card.rm-modal .modal-close:hover,
.modal-card.tm-modal .modal-close:hover,
.modal-card.tc-cat-modal .modal-close:hover,
.modal-card.rk-modal .modal-close:hover,
.modal-card.stm-modal .modal-close:hover,
.modal-card.osr-modal .modal-close:hover,
.modal-card.modal-card--org .modal-close:hover,
.modal-card.modal-card--referral .modal-close:hover,
.modal-card.ol-modal .modal-close:hover,
.modal-card.pl-modal .modal-close:hover,
.modal-card.mp-modal .modal-close:hover,
.modal-card.mp-perm-modal .modal-close:hover,
.modal-card.mu-modal .modal-close:hover,
.modal-card.ag-modal .modal-close:hover,
.modal-card.b2b-modal .modal-close:hover,
.modal-card.branch-modal-card .modal-close:hover,
.modal-card.lsig-modal-card .modal-close:hover,
.modal-card.ls-modal-card .modal-close:hover,
.modal-card.ps-modal-card .modal-close:hover,
.modal-card.nc-remark-modal .modal-close:hover,
.pk-modal-close:hover,
.rm-modal-close:hover {
  background: rgba(15, 40, 44, 0.06);
  color: var(--text);
}

/* Scrollable form bodies — vertical only */
.rm-edit-scroll,
.rm-modal-scroll,
.tm-edit-scroll,
.interp-edit-scroll,
.tc-cat-form,
.rk-form,
.stm-form,
.osr-form,
.org-modal-form,
.referral-modal-form,
.tm-form,
.b2b-form,
.ag-form,
.branch-add-form,
.lsig-form,
.pl-modal-form,
.ol-form,
.mp-form,
.mu-form,
.nc-remark-form {
  overflow-x: hidden;
  min-width: 0;
  max-width: 100%;
}

.rm-edit-form,
.tm-edit-form,
.interp-edit-form,
.tc-cat-form,
.rk-form,
.stm-form,
.osr-form,
.pl-modal-form,
.mp-form,
.mu-form,
.nc-remark-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

/* Unified footers */
.pk-modal-foot,
.rm-modal-foot,
.org-modal-form__actions,
.referral-modal-form__actions,
.referral-doctor-form__actions,
.tm-form__actions,
.b2b-form__actions,
.ag-form__actions,
.branch-modal-foot,
.lsig-modal-foot,
.ol-form__actions,
.mp-form__actions,
.mu-form__actions,
.pl-modal-form__actions,
.nc-remark-form__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fafcfd;
  flex-shrink: 0;
  margin-top: auto;
}

.org-modal-form__actions,
.referral-modal-form__actions,
.referral-doctor-form__actions,
.tm-form__actions,
.b2b-form__actions,
.ag-form__actions {
  margin: 0;
  padding-top: 12px;
}

/* Form grids — no horizontal overflow */
.pk-modal-grid,
.rm-edit-grid,
.tm-edit-grid,
.osr-form-grid,
.stm-form-grid,
.pl-form-grid,
.referral-doctor-form__grid,
.org-modal-form {
  min-width: 0;
  max-width: 100%;
}

.rm-edit-grid,
.tm-edit-grid,
.osr-form-grid,
.stm-form-grid,
.pl-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rm-edit-grid--4,
.tm-edit-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rm-edit-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.org-modal-form,
.b2b-form,
.branch-add-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tc-cat-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.org-field--full,
.b2b-field--full,
.branch-add-form > label.branch-field--full {
  grid-column: 1 / -1;
}

/* Unified field labels & inputs */
.pk-field,
.rm-field,
.org-field,
.referral-field,
.tm-field,
.pl-field,
.b2b-field,
.ag-field,
.lsig-field,
.branch-add-form > label,
.ol-field {
  min-width: 0;
  max-width: 100%;
}

.pk-field input,
.pk-field select,
.rm-field input,
.rm-field select,
.org-field input,
.org-field select,
.org-field textarea,
.referral-field input,
.referral-field select,
.referral-field textarea,
.tm-field input,
.pl-field input,
.pl-field select,
.b2b-field input,
.b2b-field select,
.b2b-field textarea,
.ag-field input,
.lsig-field input,
.lsig-field textarea,
.branch-add-form > label input,
.branch-add-form > label select,
.ol-field input,
.ol-field select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.pk-field input:focus,
.pk-field select:focus,
.rm-field input:focus,
.rm-field select:focus,
.rm-field textarea:focus,
.org-field input:focus,
.org-field select:focus,
.org-field textarea:focus,
.referral-field input:focus,
.referral-field select:focus,
.referral-field textarea:focus,
.tm-field input:focus,
.pl-field input:focus,
.pl-field select:focus,
.b2b-field input:focus,
.b2b-field select:focus,
.b2b-field textarea:focus,
.ag-field input:focus,
.lsig-field input:focus,
.lsig-field textarea:focus,
.branch-add-form > label input:focus,
.branch-add-form > label select:focus,
.pk-ms:focus-within {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 169, 181, 0.14);
}

.org-field__label,
.referral-field__label,
.pl-field__label,
.b2b-field__label,
.ag-field__label,
.tm-field__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Site-wide wide form modal sizing — width and max-width always paired */
/* XL — wide view / split layouts */
.modal-card.rm-modal--view,
.modal-card.ci-modal.ci-modal--split,
.modal-card.ci-modal.ci-modal--report,
.modal-card.sp-modal.ci-modal--split,
.modal-card.ls-modal-card.ls-modal-card--sequence {
  width: var(--dash-modal-xl);
  max-width: var(--dash-modal-xl);
}

/* LG — multi-field create / edit forms */
.modal-card.pk-modal,
.modal-card.rm-modal--edit,
.modal-card.tm-modal--edit,
.modal-card.tm-modal,
.modal-card.pl-modal,
.modal-card.ol-modal,
.modal-card.osr-modal,
.modal-card.stm-modal,
.modal-card.rk-modal,
.modal-card.tc-cat-modal,
.modal-card.b2b-modal,
.modal-card.ag-modal,
.modal-card.branch-modal-card,
.modal-card.mp-modal,
.modal-card.mu-modal,
.modal-card.mp-perm-modal,
.modal-card.nc-remark-modal,
.modal-card.modal-card--org,
.modal-card.modal-card--referral,
.modal-card.modal-card--referral-doctor,
.modal-card.lsig-modal-card,
.modal-card.interp-modal--edit,
.modal-card.pt-modal:not(.pt-modal--abha),
.modal-card.pt-modal--edit,
.modal-card.pt-modal--view,
.modal-card.pt-modal--case,
.modal-card.pt-modal--history {
  width: var(--dash-modal-lg);
  max-width: var(--dash-modal-lg);
}

/* MD — medium dialogs */
.modal-card.rm-modal:not(.rm-modal--view):not(.rm-modal--edit),
.modal-card.ci-modal:not(.ci-modal--split):not(.ci-modal--report):not(.ci-modal--print-pdf):not(.ci-modal--share),
.modal-card.ci-modal--slip,
.modal-card.ls-modal-card--wide,
.modal-card.ls-modal-card--config,
.modal-card.ps-modal-card--wide,
.modal-card.ag-modal--lis {
  width: var(--dash-modal-md);
  max-width: var(--dash-modal-md);
}

/* SM — compact share / quick prompts */
.modal-card.ci-modal.ci-modal--share,
.modal-card.ps-modal-card:not(.ps-modal-card--wide) {
  width: var(--dash-modal-xs);
  max-width: var(--dash-modal-xs);
}

/* Tiny — minimal single-field dialogs */
.modal-card.pt-modal--abha {
  width: var(--dash-modal-tiny);
  max-width: var(--dash-modal-tiny);
}

/* Fullscreen viewers */
.modal-card.pb-modal,
.modal-card.pb-modal--income {
  width: 100vw;
  max-width: 100vw;
  max-height: 100vh;
}

.modal-card.pk-modal {
  overflow: visible;
}

.modal-card.pk-modal .pk-modal-form {
  overflow: visible;
  padding: 20px 24px 24px;
}

.modal-card.pk-modal > .pk-modal-head {
  padding: 16px 24px;
}

.modal-card.pk-modal > .pk-modal-head h2 {
  font-size: 16px;
}

.modal-card.pk-modal .pk-modal-foot {
  padding: 14px 24px;
  margin: 8px -24px -24px;
}

.modal-card.rm-modal--view {
  max-height: min(88vh, 720px);
}

/* Form padding inside compact modals */
.org-modal-form {
  padding: 16px 18px 18px;
}

.referral-modal-form {
  padding: 16px 18px 18px;
}

.tm-form {
  padding: 16px 18px 18px;
}

.b2b-form,
.ag-form,
.branch-add-form,
.lsig-form,
.ol-form,
.mp-form,
.mu-form,
.nc-remark-form,
.pl-modal-form {
  padding: 16px 18px 18px;
}

.tc-cat-form,
.rk-form {
  padding: 16px 18px 0;
}

.tc-cat-form .rm-modal-foot,
.rk-form .rm-modal-foot,
.stm-form .rm-modal-foot,
.osr-form .rm-modal-foot {
  margin: 0;
}

@media (max-width: 1100px) {
  .rm-edit-grid--4,
  .tm-edit-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .osr-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stm-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tc-cat-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .tm-edit-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .pk-modal-ms-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .pk-modal-grid,
  .rm-edit-grid,
  .rm-edit-grid--4,
  .rm-edit-grid--2,
  .tm-edit-grid,
  .tm-edit-grid--4,
  .osr-form-grid,
  .stm-form-grid,
  .pl-form-grid,
  .referral-doctor-form__grid,
  .org-modal-form,
  .b2b-form,
  .branch-add-form,
  .tc-cat-form {
    grid-template-columns: 1fr;
  }

  .modal-card.pl-modal,
  .modal-card.ls-modal-card--wide,
  .modal-card.rm-modal--edit,
  .modal-card.tm-modal--edit,
  .modal-card.pk-modal,
  .modal-card.rm-modal--view,
  .modal-card.ol-modal,
  .modal-card.osr-modal,
  .modal-card.stm-modal,
  .modal-card.rk-modal,
  .modal-card.tc-cat-modal,
  .modal-card.b2b-modal,
  .modal-card.ag-modal,
  .modal-card.branch-modal-card,
  .modal-card.mp-modal,
  .modal-card.mu-modal,
  .modal-card.modal-card--org,
  .modal-card.modal-card--referral,
  .modal-card.lsig-modal-card,
  .modal-card.pt-modal:not(.pt-modal--abha) {
    width: min(100vw - 16px, 100%);
    max-width: min(100vw - 16px, 100%);
  }
}

/* Restricted operator login (case + report entry only) */
body.access-operator .nav-scroll > :not(#operatorNav) {
  display: none !important;
}
body.access-operator .operator-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 12px;
}
body.access-operator .operator-nav__btn {
  width: 100%;
  justify-content: flex-start;
}
body.access-operator .dash-v2-actions {
  justify-content: center;
  gap: 12px;
  margin: 1.5rem 0 0;
}
body.access-operator .dash-v2-actions .quick-action-btn:not(#quickNewBilling):not(#quickPrintReport) {
  display: none !important;
}
body.access-operator .dash-v2-hero {
  margin-bottom: 0;
}
body.access-operator .cases-act-delete,
body.access-operator .cases-menu__danger,
body.access-operator .pt-act-btn--delete,
body.access-operator .delete-b2b-partner-btn,
body.access-operator [data-mp-delete],
body.access-operator [data-tm-delete],
body.access-operator [data-rm-delete],
body.access-operator .cases-act-send,
body.access-operator .cases-act-label,
body.access-operator .cases-menu {
  display: none !important;
}
body.access-operator .lr-fab-btn--purple,
body.access-operator .lr-fab-btn--pink,
body.access-operator .lr-fab-btn--green {
  display: none !important;
}
body.access-operator .dbr-tabs,
body.access-operator #dbrFilterForm .table-export-group {
  display: none !important;
}
body.access-operator .all-cases-breadcrumb,
body.access-operator .lr-breadcrumb,
body.access-operator .lr-top .lr-title + .lr-breadcrumb {
  display: none !important;
}
body.access-operator .billing-nc-head .all-cases-head__actions {
  display: none !important;
}
body.access-operator .branch-picker-overlay {
  display: none !important;
}
body.access-operator.branch-picker-open {
  overflow: auto !important;
}
body.access-operator.branch-picker-open #appRoot {
  filter: none !important;
}

/* Staff login lab picker (auth/index.php) */
body.branch-picker-page {
  min-height: 100vh;
  margin: 0;
  background: #0d1f22;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
}
.branch-picker-page__back {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  z-index: 2;
}
.branch-picker-page__back:hover {
  color: #fff;
}
.branch-row--link {
  text-decoration: none;
  color: inherit;
  width: 100%;
}
.branch-row--link:hover {
  text-decoration: none;
}
body.access-operator .content > .tab-content:not(#billingTab):not(#reportTab):not(#dailyBusinessTab) {
  display: none !important;
}
body.access-operator .tab-content { display: none !important; }
body.access-operator #billingTab.active,
body.access-operator #reportTab.active,
body.access-operator #dailyBusinessTab.active {
  display: block !important;
}
body.access-operator .nav-sidebar-foot,
body.access-operator #navNewCaseBtn,
body.access-operator .nav-user-chip {
  display: none !important;
}
body.access-operator .sidebar-toggle-btn {
  display: none !important;
}

body.access-operator-staff .tab-btn.operator-nav-hidden,
body.access-operator-staff .tab-btn[hidden],
body.access-operator-staff details.nav-group[hidden] {
  display: none !important;
}

body.access-operator-staff .nav-branch-chip,
body.access-operator-staff #navSwitchLabBtn,
body.access-operator-staff #navSwitchLabMenuBtn,
body.access-operator-staff #activeBranchPill,
body.access-operator-staff [data-nav-key="switch-lab"] {
  display: none !important;
}
