:root {
  color-scheme: light;
  --ink: #15202b;
  --muted: #64748b;
  --subtle: #eef3f7;
  --line: #d9e2ea;
  --panel: #ffffff;
  --page: #f4f7fa;
  --nav: #101d2b;
  --teal: #0f766e;
  --teal-2: #14b8a6;
  --blue: #2563eb;
  --amber: #d97706;
  --rose: #e11d48;
  --green: #15803d;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(360px, 0.9fr);
  background: #f8fafc;
}

.is-hidden,
.login-shell.is-hidden,
.app-shell.is-locked {
  display: none !important;
}

.landing-shell {
  min-height: 100vh;
  background: #ffffff;
}

.landing-nav {
  min-height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  position: sticky;
  top: 0;
  z-index: 5;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.landing-hero {
  min-height: calc(100vh - 72px);
  background-size: cover;
  background-position: center;
  color: white;
  display: flex;
  align-items: center;
  padding: 44px 6vw 92px;
}

.landing-copy-block {
  width: min(760px, 100%);
}

.landing-copy-block h1 {
  margin: 10px 0 16px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

.landing-copy-block p {
  color: #e6f3f4;
  font-size: 18px;
  line-height: 1.65;
  max-width: 720px;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0;
}

.ghost-button.light {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border-color: rgba(255, 255, 255, 0.42);
}

.landing-stats,
.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.landing-plan-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.landing-stats div {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.12);
}

.landing-band,
.landing-plans {
  padding: 34px 6vw;
}

.landing-feature-card,
.landing-plan-card {
  position: relative;
  overflow: hidden;
  min-height: 188px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.landing-feature-card::before,
.landing-plan-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.landing-feature-card.blue::before {
  background: linear-gradient(90deg, var(--blue), #7c3aed);
}

.landing-feature-card.amber::before {
  background: linear-gradient(90deg, var(--amber), var(--rose));
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  background: #e7f8f5;
  color: var(--teal);
}

.landing-feature-card.blue .feature-icon {
  background: #eff6ff;
  color: var(--blue);
}

.landing-feature-card.amber .feature-icon {
  background: #fff7ed;
  color: var(--amber);
}

.feature-icon svg,
.plan-mini-specs svg {
  width: 19px;
  height: 19px;
}

.landing-feature-card strong,
.landing-plan-card strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.3;
}

.landing-feature-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.landing-plan-card {
  min-height: 214px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.landing-plan-card.featured {
  border-color: rgba(15, 118, 110, 0.38);
  box-shadow: 0 18px 40px rgba(15, 118, 110, 0.14);
}

.plan-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef2ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.landing-plan-card.featured .plan-badge {
  background: #e7f8f5;
  color: var(--teal);
}

.plan-status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(21, 128, 61, 0.12);
}

.landing-plan-card em {
  display: block;
  color: var(--ink);
  font-style: normal;
  font-size: 22px;
  font-weight: 900;
}

.plan-mini-specs {
  display: grid;
  gap: 9px;
  margin-top: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.plan-mini-specs span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--ink);
}

.toggle-line input {
  width: 18px;
  height: 18px;
}

.login-visual {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(16, 29, 43, 0.92), rgba(15, 118, 110, 0.78)),
    url("https://images.unsplash.com/photo-1582719471384-894fbb16e074?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
  color: white;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
}

.brand.large .brand-mark {
  width: 52px;
  height: 52px;
}

.login-copy {
  max-width: 660px;
}

.login-copy h1 {
  margin: 8px 0 12px;
  font-size: clamp(34px, 5vw, 60px);
  letter-spacing: 0;
  line-height: 1.03;
}

.login-copy p:last-child {
  color: #d9e7f3;
  font-size: 17px;
  line-height: 1.7;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.login-stats div {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.login-stats strong,
.login-stats span,
.credential-box strong,
.credential-box span {
  display: block;
}

.login-stats span {
  color: #cfe0e8;
  font-size: 13px;
  margin-top: 4px;
}

.login-panel {
  align-self: center;
  justify-self: center;
  width: min(420px, calc(100% - 32px));
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
  display: grid;
  gap: 16px;
}

.login-panel h2 {
  margin: 4px 0 0;
  font-size: 28px;
}

.login-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.credential-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.credential-box strong {
  color: var(--ink);
}

.login-message {
  min-height: 20px;
  margin: 0;
  color: var(--rose);
  font-size: 13px;
  font-weight: 800;
}

.session-pill {
  min-height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--nav);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  gap: 28px;
}

.brand,
.tenant-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  padding: 4px 6px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #14b8a6;
  color: white;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.brand span,
.tenant-card strong,
.tenant-card span {
  display: block;
}

.brand span,
.tenant-card span {
  color: #b6c6d7;
  font-size: 12px;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d9e7f3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
}

.nav-item svg,
.icon-button svg,
.primary-button svg,
.ghost-button svg {
  width: 18px;
  height: 18px;
}

.whatsapp-logo {
  fill: currentColor;
  flex: 0 0 auto;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.tenant-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar-actions,
.panel-heading,
.section-divider,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar-actions select {
  width: 230px;
}

.primary-button,
.ghost-button,
.whatsapp-button,
.icon-button {
  border: 1px solid var(--line);
  min-height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.primary-button {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}

.primary-button:hover {
  background: #0b625c;
}

.ghost-button:hover,
.whatsapp-button:hover,
.icon-button:hover {
  border-color: #b9c7d4;
  background: #f8fafc;
}

.whatsapp-button {
  background: #16a34a;
  border-color: #16a34a;
  color: white;
  min-height: 38px;
  gap: 5px;
  padding: 0 8px;
}

.whatsapp-button .whatsapp-logo {
  width: 22px;
  height: 22px;
}

.whatsapp-button:hover {
  background: #15803d;
  border-color: #15803d;
}

.whatsapp-button.light {
  background: rgba(22, 163, 74, 0.9);
  border-color: rgba(255, 255, 255, 0.36);
  color: white;
}

.floating-whatsapp {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  min-height: 50px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  background: #16a34a;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 40px rgba(21, 128, 61, 0.34);
  text-decoration: none;
  font-weight: 900;
}

.floating-whatsapp::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border: 1px solid rgba(22, 163, 74, 0.26);
}

.floating-whatsapp svg {
  width: 30px;
  height: 30px;
}

.floating-whatsapp:hover {
  background: #15803d;
  transform: translateY(-1px);
}

.icon-button {
  width: 42px;
  padding: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid,
.category-grid,
.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card,
.category-card,
.plan-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.metric-card span,
.report-title-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 28px;
  letter-spacing: 0;
}

.metric-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.metric-card[data-tone="blue"] {
  border-top: 4px solid var(--blue);
}

.metric-card[data-tone="teal"] {
  border-top: 4px solid var(--teal-2);
}

.metric-card[data-tone="amber"] {
  border-top: 4px solid var(--amber);
}

.metric-card[data-tone="rose"] {
  border-top: 4px solid var(--rose);
}

#lab-announcements {
  display: grid;
  gap: 12px;
  margin: -6px 0 20px;
}

.offer-marquee,
.newsletter-alert {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.offer-marquee {
  min-height: 46px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
}

.offer-marquee > span {
  width: 44px;
  display: grid;
  place-items: center;
  color: var(--amber);
}

.offer-marquee div {
  overflow: hidden;
  white-space: nowrap;
}

.offer-marquee p {
  display: inline-block;
  margin: 0;
  padding-left: 100%;
  font-weight: 900;
  color: #92400e;
  animation: offer-scroll 18s linear infinite;
}

.newsletter-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-left: 4px solid var(--blue);
}

.newsletter-alert > span {
  color: var(--blue);
  margin-top: 2px;
}

.newsletter-alert strong {
  display: block;
  margin-bottom: 3px;
}

.newsletter-alert p {
  margin: 0;
  color: var(--muted);
}

@keyframes offer-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

.dashboard-grid,
.builder-grid,
.masters-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.billing-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.module-tabs,
.segment-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.module-tab,
.segment-control button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  min-height: 40px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
}

.module-tab.active,
.segment-control button.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

.module-tab svg {
  width: 16px;
  height: 16px;
}

.lab-section-panel {
  margin-top: 16px;
}

.masters-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel,
.form-panel,
.preview-panel,
.records-panel {
  padding: 20px;
}

.records-panel {
  margin-top: 20px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2,
.section-divider h2 {
  margin: 2px 0 0;
  font-size: 18px;
  letter-spacing: 0;
}

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

.mini-form {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfdff;
  color: var(--ink);
}

textarea {
  padding-top: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(20, 184, 166, 0.18);
  border-color: var(--teal);
}

.align-field {
  align-self: end;
  min-height: 42px;
}

.wide {
  grid-column: 1 / -1;
}

.section-divider {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table,
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.report-table th {
  background: #102033;
  color: white;
  text-align: left;
  padding: 11px 10px;
  white-space: nowrap;
}

.data-table td,
.report-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  vertical-align: middle;
}

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

.rate-input {
  width: 120px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 800;
}

.bill-paper {
  margin-top: 18px;
  min-height: 680px;
  border: 1px solid #cbd5e1;
  background: white;
  padding: 26px 28px 76px;
  color: #0f172a;
  position: relative;
}

.bill-header {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
  border-bottom: 3px solid #102033;
  min-height: 122px;
  padding-bottom: 12px;
  margin-bottom: 8px;
}

.bill-brand-block {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}

.bill-brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #172033;
  color: white;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  flex: 0 0 auto;
}

.bill-brand-block h2 {
  margin: 2px 0 6px;
  font-size: 26px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bill-brand-block p {
  max-width: 360px;
  line-height: 1.45;
  font-size: 13px;
}

.bill-brand-block p,
.bill-meta-card em,
.bill-party-grid span,
.bill-note {
  color: var(--muted);
  margin: 0;
}

.bill-meta-card {
  width: 230px;
  flex: 0 0 230px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.bill-meta-card > span {
  display: grid;
  place-items: center;
  min-height: 36px;
  background: #211827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.bill-meta-card > strong {
  display: block;
  padding: 15px 14px;
  font-size: 18px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

.bill-meta-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.bill-meta-card div:last-child {
  border-bottom: 0;
}

.bill-meta-card em {
  font-style: normal;
  font-size: 12px;
}

.bill-meta-card b {
  font-size: 12px;
}

.bill-party-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0 18px;
}

.bill-party-grid div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-right: 1px solid #e2e8f0;
  background: #fbfdff;
}

.bill-party-grid div:last-child {
  border-right: 0;
}

.bill-party-grid span {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.bill-party-grid strong {
  font-size: 13px;
}

.bill-items-table {
  table-layout: fixed;
}

.bill-items-table th {
  background: #0f2e63;
  font-size: 13px;
}

.bill-items-table th:first-child,
.bill-items-table td:first-child {
  width: 70px;
}

.bill-items-table th:last-child,
.bill-items-table td:last-child {
  width: 180px;
}

.bill-items-table td {
  height: 34px;
}

.bill-items-table th.amount-cell,
.bill-items-table td.amount-cell {
  text-align: right;
}

.bill-total-box {
  max-width: 340px;
  margin: 18px 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bill-total-box div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.bill-grand-total {
  background: #173879;
  color: white;
  border-radius: 8px;
  padding: 12px 14px !important;
  border-bottom: 0;
  font-size: 18px;
}

.bill-grand-total span {
  color: #e2e8f0;
}

.bill-note {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.bill-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 22px;
  padding-top: 14px;
  border-top: 1px solid #cbd5e1;
  color: var(--muted);
  font-size: 12px;
}

.bill-footer strong {
  color: #0f172a;
  min-width: 180px;
  text-align: center;
  border-top: 1px solid #64748b;
  padding-top: 8px;
}

.empty-state {
  color: var(--muted);
  font-weight: 800;
  padding: 20px 0;
}

.pill,
.flag-pill {
  min-height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background: #e7f8f5;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  border: 0;
}

.pill.warning,
.flag-pill.review {
  background: #fff7ed;
  color: var(--amber);
}

.flag-pill.low {
  background: #eff6ff;
  color: var(--blue);
}

.flag-pill.high {
  background: #fff1f2;
  color: var(--rose);
}

.flag-pill.pending {
  background: #e2e8f0;
  color: var(--muted);
}

.pill.danger {
  background: #fff1f2;
  color: var(--rose);
}

.pill.blue {
  background: #eff6ff;
  color: var(--blue);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 900;
  padding: 0;
  cursor: pointer;
}

.link-button.danger {
  color: var(--rose);
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pagination-bar .ghost-button:disabled,
.row-actions .link-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.search-input {
  max-width: 300px;
}

.category-card {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.category-card strong {
  font-size: 16px;
}

.category-card span,
.queue-list span,
.compact-list span,
.plan-card span,
.roadmap-grid span {
  color: var(--muted);
  font-size: 13px;
}

.queue-list,
.compact-list {
  display: grid;
  gap: 10px;
}

.queue-item,
.compact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.test-entry {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.selected-tests-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.selected-test-item,
.report-test-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selected-test-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
}

.selected-test-item strong,
.report-test-heading strong {
  display: block;
  font-size: 14px;
}

.selected-test-item span,
.report-test-heading span,
.report-test-heading em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  margin-top: 2px;
}

.icon-button.small {
  width: 34px;
  height: 34px;
}

.report-test-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.report-test-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.parameter-section {
  background: #102033;
  color: #ffffff;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.test-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) minmax(96px, 0.8fr) minmax(92px, 0.7fr) 76px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.widal-entry {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.widal-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 0.8fr) minmax(90px, 0.7fr) 76px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.widal-row:last-child {
  border-bottom: 0;
}

.widal-head {
  background: #102033;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.widal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.widal-table-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
  overflow-x: auto;
}

.widal-form-head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.widal-form-head strong,
.widal-field > span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.widal-form-head span,
.widal-field em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.widal-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.clinical-note-field {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.clinical-note-field textarea {
  width: 100%;
  min-height: 58px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #ffffff;
}

.report-test-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 120px;
  gap: 10px;
  align-items: end;
}

.report-test-options.widal-options {
  grid-template-columns: minmax(150px, 0.9fr) minmax(160px, 1fr) 120px 120px;
}

.report-test-options.widal-table-options {
  grid-template-columns: minmax(150px, 0.9fr) minmax(160px, 1fr) 120px 120px;
}

.final-impression-field select {
  color: var(--ink);
  font-weight: 900;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: #fbfdff;
}

.test-meta {
  display: grid;
  gap: 4px;
}

.test-meta strong {
  font-size: 14px;
}

.test-meta span {
  color: var(--muted);
  font-size: 12px;
}

.report-paper {
  min-height: 760px;
  background: white;
  border: 1px solid #cbd5e1;
  padding: 28px;
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 3px solid var(--teal);
  padding-bottom: 18px;
}

.report-header h2 {
  margin: 0;
  font-size: 24px;
}

.report-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.report-badge {
  align-self: start;
  white-space: nowrap;
  background: #e7f8f5;
  color: var(--teal);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 900;
  font-size: 13px;
}

.patient-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.patient-strip span,
.signature-row span,
.verified-signature span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.patient-strip strong,
.verified-signature strong,
.report-title-row strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.verified-signature strong span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
}

.report-table .abnormal {
  color: var(--rose);
  font-weight: 900;
}

.test-heading-row td {
  background: #102033;
  color: #ffffff;
  font-weight: 900;
  text-transform: uppercase;
}

.clinical-note-row td {
  background: #fbfdff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.clinical-note-row strong {
  color: var(--ink);
}

.note-content {
  display: grid;
  gap: 6px;
}

.note-content p,
.note-content ul {
  margin: 0;
}

.note-content ul {
  padding-left: 20px;
}

.note-content li {
  margin: 2px 0;
}

.final-impression-preview td {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 12px 14px;
}

.final-impression-preview span {
  display: inline-block;
  margin-left: 10ch;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.results-table .parameter-cell {
  text-align: left;
}

.widal-format-preview-row td {
  background: #ffffff;
}

.widal-table-format {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  margin: 0;
  background: #ffffff;
}

.widal-table-format th,
.widal-table-format td {
  border: 1px solid var(--line);
  padding: 9px 10px;
  text-align: center;
  color: var(--ink);
  font-size: 14px;
}

.widal-column-head th {
  background: #f8fafc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 900;
}

.widal-method-head td {
  text-align: left;
  font-weight: 900;
  font-size: 16px;
}

.widal-result-head td {
  text-align: left;
}

.widal-result-head td + td {
  text-align: center;
  font-weight: 900;
}

.widal-antigen {
  text-align: left !important;
}

.widal-table-format select {
  min-width: 54px;
  padding: 6px 8px;
  text-align: center;
}

.verification-row {
  margin-top: 22px;
}

.interpretation {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.interpretation p {
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.5;
}

.qr-box {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 10px;
  background: #fff;
  text-align: center;
}

.qr-box canvas {
  width: 82px;
  height: 82px;
  margin: 0 auto 8px;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(13, 7px);
  gap: 2px;
  margin: 0 auto 8px;
}

.qr-cell {
  width: 7px;
  height: 7px;
  background: #e2e8f0;
}

.qr-cell.on {
  background: #0f172a;
}

.qr-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.signature-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
  align-items: flex-end;
}

.verified-signature {
  text-align: center;
}

.signature-image-frame {
  height: 40px;
  display: grid;
  place-items: end center;
  margin-bottom: 6px;
}

.signature-image-frame img {
  max-width: 180px;
  max-height: 46px;
  object-fit: contain;
}

.signature-image-frame:not(.has-signature) {
  border-bottom: 1px solid var(--ink);
  margin-inline: auto;
  width: 190px;
  height: 38px;
}

.signature-line {
  padding-top: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  align-self: end;
}

.signature-row .qr-box {
  justify-self: end;
  width: 112px;
  min-height: 112px;
}

.signature-preview {
  min-height: 64px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdff;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.signature-preview img {
  max-width: 220px;
  max-height: 54px;
  object-fit: contain;
}

.signature-preview {
  min-height: 72px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fbfdff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.signature-preview img {
  max-width: 220px;
  max-height: 64px;
  object-fit: contain;
}

.plan-card {
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.plan-card.featured {
  border-color: var(--teal);
  box-shadow: 0 20px 44px rgba(15, 118, 110, 0.16);
}

.plan-card h3 {
  margin: 0;
  font-size: 18px;
}

.plan-card strong {
  font-size: 28px;
}

.plan-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 13px;
}

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.roadmap-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 6px;
  background: #fbfdff;
}

.referral-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr 0.8fr;
  gap: 14px;
}

.referral-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.referral-card span,
.referral-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.referral-card strong {
  font-size: 24px;
  letter-spacing: 0;
}

.referral-card input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
  background: white;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  min-width: 220px;
  border-radius: 8px;
  padding: 12px 14px;
  background: #102033;
  color: white;
  box-shadow: var(--shadow);
  transition: 180ms ease;
  z-index: 10;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .brand div:last-child,
  .nav-item,
  .tenant-card div {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
  }

  .metric-grid,
  .category-grid,
  .plan-grid,
  .roadmap-grid,
  .landing-feature-grid,
  .landing-plan-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .builder-grid,
  .masters-grid,
  .referral-grid,
  .billing-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 48vh;
    padding: 24px;
  }

  .login-stats {
    grid-template-columns: 1fr;
  }

  .landing-nav,
  .landing-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .landing-nav-actions {
    width: 100%;
    justify-content: stretch;
  }

  .landing-nav-actions > * {
    flex: 1 1 auto;
  }

  .floating-whatsapp {
    right: 16px;
    bottom: 16px;
    width: 50px;
    min-height: 50px;
    padding: 0;
  }

  .floating-whatsapp span:last-child {
    display: none;
  }

  .landing-hero {
    min-height: auto;
    padding: 34px 20px 52px;
  }

  .landing-copy-block h1 {
    font-size: 38px;
  }

  .landing-stats,
  .landing-feature-grid,
  .landing-plan-preview {
    grid-template-columns: 1fr;
  }

  .login-panel {
    margin: 18px 0;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    height: auto;
    z-index: 5;
    flex-direction: row;
    align-items: center;
    padding: 12px;
    gap: 10px;
    overflow-x: auto;
  }

  .brand {
    min-width: 54px;
  }

  .nav-list {
    display: flex;
  }

  .nav-item {
    width: 46px;
    height: 42px;
    padding: 0;
  }

  .tenant-card {
    display: none;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .panel-heading,
  .section-divider,
  .report-header,
  .signature-row,
  .topbar-actions,
  .report-title-row,
  .bill-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions select,
  .search-input {
    max-width: none;
    width: 100%;
  }

  .metric-grid,
  .category-grid,
  .plan-grid,
  .roadmap-grid,
  .referral-grid,
  .form-grid,
  .widal-form,
  .report-test-options,
  .report-test-options.widal-options,
  .test-row,
  .widal-row,
  .patient-strip,
  .billing-workspace,
  .verification-row {
    grid-template-columns: 1fr;
  }

  .report-paper,
  .bill-paper {
    padding: 16px;
    overflow-x: auto;
  }

  .bill-header,
  .bill-total-box,
  .bill-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .bill-meta-card {
    min-width: 0;
  }

  .bill-party-grid {
    grid-template-columns: 1fr;
  }

  .bill-party-grid div {
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .bill-party-grid div:last-child {
    border-bottom: 0;
  }
}

@media print {
  @page {
    size: A4;
    margin: 9mm;
  }

  body {
    background: white;
  }

  .sidebar,
  .topbar,
  .form-panel,
  .records-panel,
  .toast {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .builder-grid {
    display: block;
    padding: 0;
  }

  .preview-panel {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .report-paper {
    border: 0;
    min-height: auto;
    padding: 0;
  }

  .bill-paper {
    border: 0;
    margin: 0;
    min-height: calc(297mm - 18mm);
    padding: 0 0 24mm;
    box-shadow: none;
  }

  .print-shell {
    padding: 0;
    margin: 0;
    background: white;
  }

  .print-shell .bill-header {
    align-items: flex-start;
    flex-direction: row;
    min-height: 31mm;
  }

  .print-shell .bill-brand-block p {
    max-width: 340px;
  }

  .print-shell .bill-meta-card {
    width: 220px;
    flex-basis: 220px;
    min-width: 220px;
  }

  .print-shell .bill-party-grid {
    grid-template-columns: 1.2fr 0.8fr 1fr;
  }

  .print-shell .bill-party-grid div {
    border-right: 1px solid #e2e8f0;
    border-bottom: 0;
  }

  .print-shell .bill-party-grid div:last-child {
    border-right: 0;
  }

  .print-shell .bill-footer {
    align-items: center;
    flex-direction: row;
    left: 0;
    right: 0;
    bottom: 0;
  }

  .bill-brand-mark,
  .bill-meta-card > span,
  .bill-items-table th,
  .bill-grand-total {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
