:root {
  --bg: #f5f0e7;
  --bg-soft: #fcfaf5;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: rgba(31, 41, 51, 0.1);
  --primary: #0f766e;
  --primary-deep: #0b4f4a;
  --accent: #d0a74d;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #027a48;
  --success-soft: #ecfdf3;
  --shadow: 0 24px 60px rgba(15, 39, 36, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cairo", sans-serif;
  font-size: 15px;
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 24%, transparent), transparent 30%),
    linear-gradient(135deg, var(--bg-soft) 0%, color-mix(in srgb, var(--bg) 50%, #edf4f1) 55%, color-mix(in srgb, var(--primary) 10%, #e7f1ed) 100%);
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 56px 24px 36px;
}

.brand-panel {
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}

.brand-mark {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.brand-mark__icon {
  width: 38px;
  height: 38px;
  display: block;
}

.brand-mark--small {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 1.4rem;
}

.brand-mark--small .brand-mark__icon {
  width: 26px;
  height: 26px;
}

.eyebrow,
.panel-badge,
.topbar-kicker {
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(255, 255, 255, 0.55);
  color: var(--primary-deep);
  font-size: 0.88rem;
  font-weight: 700;
}

.brand-panel h1,
.panel-head h2,
.topbar h2,
.filters-head h3,
.card-head h3,
.placeholder-card h3 {
  margin: 0;
  line-height: 1.15;
}

.brand-panel h1 {
  max-width: 760px;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  color: #18243d;
}

.landing-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.panel-head p,
.role-card small,
label span,
.filters-head p,
.card-head p,
.placeholder-card p,
.sidebar-brand p {
  color: var(--muted);
}

.metric-card,
.chart-card,
.filters-card,
.placeholder-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.auth-panel {
  width: 100%;
  max-width: 1220px;
  padding: 0;
  display: grid;
  place-items: center;
}

.view {
  width: min(100%, 1180px);
  padding: 34px;
  border-radius: 36px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  display: none;
}

.view.active {
  display: block;
}

.view-selection {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
  width: 100%;
}

.panel-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.panel-head p,
.filters-head p,
.card-head p,
.placeholder-card p {
  margin: 0;
  line-height: 1.7;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
  max-width: 1160px;
  margin: 0 auto;
}

.role-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 34px;
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  min-height: 220px;
  position: relative;
  box-shadow: 0 20px 45px rgba(15, 39, 36, 0.1);
}

.role-card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 18px 35px rgba(15, 118, 110, 0.12);
}

.role-card--disabled {
  opacity: 0.6;
  filter: grayscale(0.08);
}

.role-card--disabled:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.role-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(208, 167, 77, 0.22));
  color: var(--primary-deep);
  font-weight: 800;
}

.role-icon-svg {
  width: 28px;
  height: 28px;
  display: block;
}

.role-card strong {
  font-size: 1.55rem;
  color: #18243d;
}

.role-card small {
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 210px;
}

.role-card[data-role="admin"] .role-icon {
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.14), rgba(255, 191, 128, 0.28));
  color: #ff7a1a;
}

.role-card[data-role="lab"] .role-icon {
  background: linear-gradient(135deg, rgba(140, 82, 255, 0.14), rgba(221, 207, 255, 0.34));
  color: #8c52ff;
}

.role-card[data-role="doctor"] .role-icon {
  background: linear-gradient(135deg, rgba(90, 160, 150, 0.14), rgba(210, 241, 236, 0.34));
  color: #73a79f;
}

.role-card[data-role="patient"] .role-icon {
  background: linear-gradient(135deg, rgba(133, 154, 196, 0.14), rgba(220, 230, 248, 0.34));
  color: #7f96c7;
}

.role-soon {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #a3aab7;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
}

.landing-copyright {
  margin: 28px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.back-button,
.menu-button,
.logout-button,
.sidebar-close {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
  cursor: pointer;
  font-weight: 700;
}

.sidebar .logout-button,
.sidebar .sidebar-close {
  color: #fff;
}

.login-form,
.filters-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-form label,
.filters-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.login-form input,
.filters-form input,
.filters-form select {
  width: 100%;
  border: 1px solid rgba(24, 32, 38, 0.14);
  background: #fffdf9;
  border-radius: 18px;
  padding: 16px 18px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form input:focus,
.filters-form input:focus,
.filters-form select:focus {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.autocomplete {
  position: relative;
  z-index: 12;
}

.autocomplete-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(24, 32, 38, 0.1);
  background: #fffdf9;
  box-shadow: 0 18px 40px rgba(15, 39, 36, 0.16);
}

.autocomplete-option {
  border: 0;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.05);
  text-align: right;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

.autocomplete-option strong,
.autocomplete-option span {
  pointer-events: none;
}

.autocomplete-option__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  text-align: right;
}

.autocomplete-option__check {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 118, 110, 0.08);
  color: transparent;
  font-weight: 800;
  flex: 0 0 auto;
}

.autocomplete-option__check.is-selected {
  background: #0f766e;
  color: #ffffff;
}

.autocomplete-option--multiselect.is-selected {
  background: rgba(15, 118, 110, 0.12);
}

.autocomplete-option span {
  color: var(--muted);
  font-size: 0.84rem;
}

.autocomplete-option:hover {
  background: rgba(15, 118, 110, 0.1);
}

.autocomplete-option.is-empty {
  cursor: default;
  justify-content: center;
}

.form-message {
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.8;
}

.form-message.is-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.12);
}

.form-message.is-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(2, 122, 72, 0.12);
}

.submit-button,
.secondary-button {
  border: 0;
  border-radius: 18px;
  padding: 16px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 18px 32px rgba(10, 78, 73, 0.25);
}

.submit-button:disabled,
.secondary-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  position: relative;
}

.sidebar-backdrop {
  display: none;
}

.sidebar {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-top__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-brand p,
.sidebar-footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-left: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.34) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.42);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-link {
  border: 0;
  border-radius: 18px;
  padding: 14px 16px;
  text-align: right;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-link__content {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.nav-icon {
  width: 20px;
  min-width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.nav-label {
  white-space: nowrap;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(-2px);
}

.nav-link--group {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.accordion-indicator {
  font-size: 1rem;
  line-height: 1;
}

.nav-submenu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 12px;
  overflow: hidden;
  transition: max-height 0.24s ease, opacity 0.24s ease, margin-top 0.24s ease;
  max-height: 2000px;
  opacity: 1;
}

.nav-submenu.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: -4px;
  pointer-events: none;
}

.nav-sublink {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: right;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-sublink .nav-link__content {
  width: 100%;
}

.nav-sublink.active,
.nav-sublink:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateX(-2px);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.sidebar-copy {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  line-height: 1.6;
  text-align: center;
  width: 100%;
}

.sidebar-toggle {
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

@media (min-width: 921px) {
  .dashboard-shell {
    grid-template-columns: 228px 1fr;
  }

  .sidebar {
    padding: 14px 12px;
    gap: 14px;
  }

  .sidebar-nav {
    gap: 6px;
  }

  .nav-group {
    gap: 6px;
  }

  .sidebar-top {
    gap: 8px;
  }

  .sidebar-brand {
    gap: 10px;
  }

  .sidebar-brand strong {
    font-size: 0.95rem;
  }

  .sidebar-brand p {
    font-size: 0.78rem;
  }

  .nav-link {
    border-radius: 12px;
    padding: 10px 11px;
    font-size: 0.88rem;
  }

  .nav-sublink {
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 0.84rem;
  }

  .nav-link__content {
    gap: 8px;
  }

  .nav-icon {
    width: 16px;
    min-width: 16px;
    font-size: 0.88rem;
  }

  .nav-submenu {
    gap: 6px;
    padding-right: 8px;
    max-height: 2000px;
  }

  .accordion-indicator {
    font-size: 0.88rem;
  }

  .dashboard-main {
    padding: 20px;
    gap: 18px;
  }

  .topbar-heading {
    gap: 6px;
  }

  .topbar-kicker {
    padding: 6px 12px;
    font-size: 0.86rem;
  }

  .topbar-user {
    font-size: 0.9rem;
  }

  #sectionTitle {
    font-size: 1.95rem;
    line-height: 1.15;
  }

  .filters-card,
  .metric-card,
  .chart-card,
  .placeholder-card,
  .result-card,
  .price-card,
  .result-view-card,
  .account-summary-card,
  .account-table-wrap {
    border-radius: 20px;
  }

  .filters-card,
  .metric-card,
  .chart-card,
  .placeholder-card {
    padding: 18px;
  }

  .result-card,
  .price-card,
  .result-view-card,
  .account-summary-card {
    padding: 18px;
  }

  .account-table-wrap {
    padding: 10px;
  }

  .content-section {
    gap: 18px;
  }

  .filters-head,
  .card-head {
    margin-bottom: 14px;
  }

  .filters-head h3,
  .card-head h3,
  .placeholder-card h3 {
    font-size: 1.18rem;
  }

  .filters-head p,
  .card-head p,
  .placeholder-card p {
    font-size: 0.92rem;
    line-height: 1.65;
  }

  .summary-grid,
  .results-grid,
  .prices-grid,
  .charts-layout {
    gap: 14px;
  }

  .metric-card {
    gap: 8px;
  }

  .metric-card span {
    font-size: 0.88rem;
  }

  .metric-card strong {
    font-size: 1.28rem;
  }

  .chart-card--wide {
    min-height: 360px;
  }

  .account-table th,
  .account-table td {
    padding: 11px 10px;
    font-size: 0.9rem;
  }

  .login-form input,
  .filters-form input,
  .filters-form select {
    padding: 13px 15px;
    border-radius: 16px;
    font-size: 0.95rem;
  }

  .secondary-button,
  .menu-button {
    padding: 13px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
  }

  .payment-form__field input,
  .payment-form__field select,
  .payment-form__field textarea {
    min-height: 46px;
    padding: 11px 13px;
    font-size: 0.95rem;
  }

  .payment-form__field textarea {
    min-height: 92px;
  }

  .dashboard-shell.sidebar-collapsed {
    grid-template-columns: 74px 1fr;
  }

  .dashboard-shell.sidebar-collapsed .sidebar {
    padding: 14px 8px;
  }

  .dashboard-shell.sidebar-collapsed .sidebar-top {
    flex-direction: column;
    align-items: center;
  }

  .dashboard-shell.sidebar-collapsed .sidebar-top__actions {
    width: 100%;
    justify-content: center;
  }

  .dashboard-shell.sidebar-collapsed .sidebar-brand {
    justify-content: center;
  }

  .dashboard-shell.sidebar-collapsed .sidebar-brand > div:last-child,
  .dashboard-shell.sidebar-collapsed .accordion-indicator,
  .dashboard-shell.sidebar-collapsed .sidebar-copy {
    display: none;
  }

  .dashboard-shell.sidebar-collapsed .nav-submenu {
    display: none;
  }

  .dashboard-shell.sidebar-collapsed .nav-link,
  .dashboard-shell.sidebar-collapsed .nav-sublink,
  .dashboard-shell.sidebar-collapsed .logout-button {
    padding-inline: 0;
    text-align: center;
    justify-content: center;
  }

  .dashboard-shell.sidebar-collapsed .nav-link,
  .dashboard-shell.sidebar-collapsed .logout-button {
    min-height: 52px;
  }

  .dashboard-shell.sidebar-collapsed .nav-link__content {
    width: 100%;
    justify-content: center;
  }

  .dashboard-shell.sidebar-collapsed .nav-label {
    display: none;
  }
}

.dashboard-main {
  height: 100vh;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

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

.topbar-heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-kicker {
  margin: 0;
}

.topbar-user {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary-deep);
}

.sidebar-close {
  display: none;
}

.content-section {
  display: none;
  flex-direction: column;
  gap: 24px;
  overflow: visible;
}

.content-section.active {
  display: flex;
}

.filters-card,
.placeholder-card,
.chart-card,
.metric-card {
  border-radius: 28px;
  padding: 22px;
}

.filters-card {
  position: relative;
  overflow: visible;
  z-index: 8;
}

.filters-head,
.card-head {
  margin-bottom: 18px;
}

.filters-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.filters-form--results {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.filters-form--prices {
  grid-template-columns: 1fr 1.2fr 1.3fr auto;
}

.filters-form--lab {
  grid-template-columns: 1.2fr 1fr 1fr auto;
}

.filters-form--doctor {
  grid-template-columns: 1fr 1fr auto;
}

.filters-form--lab-price {
  grid-template-columns: 1.4fr auto;
}

.filters-form--expense-codes {
  grid-template-columns: 1.4fr auto auto;
}

.filters-form--payments {
  grid-template-columns: 1fr 1fr auto;
}

.filters-form--contract-claim {
  grid-template-columns: 1fr;
  gap: 18px;
}

.filters-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.contract-claim-field--company {
  width: 100%;
}

.contract-claim-field--company .autocomplete {
  max-width: 100%;
}

.contract-claim-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 280px));
  gap: 14px;
  justify-content: flex-start;
}

.contract-claim-actions {
  justify-content: flex-start;
  align-self: start;
  padding-top: 2px;
}

.contract-claim-actions .secondary-button,
.contract-claim-actions .export-button {
  min-width: 170px;
}

#contractClaimReportSection .filters-card {
  padding: 26px 28px;
}

#contractClaimReportSection .filters-head {
  margin-bottom: 18px;
}

#contractClaimReportSection .account-table-wrap {
  width: 100%;
  overflow-x: auto;
}

#contractClaimReportSection .account-table {
  min-width: 1040px;
}

.filters-span-2 {
  grid-column: span 2;
}

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

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  font-size: 1.45rem;
  color: var(--primary-deep);
}

.charts-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 18px;
}

.chart-card--wide {
  min-height: 420px;
}

.chart-card--span-2 {
  grid-column: span 2;
}

.line-chart {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.line-chart__svg-wrap {
  height: 240px;
  padding: 18px 8px 4px;
  border-radius: 22px;
  background:
    linear-gradient(to top, rgba(15, 118, 110, 0.03) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(135deg, rgba(15, 118, 110, 0.06), rgba(208, 167, 77, 0.04));
}

.line-chart__svg {
  width: 100%;
  height: 100%;
}

.line-chart__labels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  max-height: 160px;
  overflow: auto;
}

.line-chart__label {
  padding: 12px;
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.05);
}

.line-chart__label strong,
.bar-item__head strong {
  display: block;
}

.line-chart__label span,
.bar-item__head span,
.empty-state {
  color: var(--muted);
}

.pie-chart {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 18px;
  align-items: center;
}

.pie-chart__visual {
  display: flex;
  justify-content: center;
}

.pie-chart__donut {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.pie-chart__center {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  background: var(--surface-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  padding: 12px;
}

.pie-chart__center-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.pie-chart__center-value {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
}

.pie-chart__legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pie-chart__legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(15, 118, 110, 0.08);
}

.pie-chart__legend-head,
.pie-chart__legend-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pie-chart__legend-meta {
  color: var(--muted);
}

.pie-chart__legend-meta strong {
  color: var(--text);
}

.pie-chart__swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 12px;
}

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

.bar-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

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

.result-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  border-radius: 28px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.result-card__top,
.result-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.result-card__top h3,
.result-card__id {
  margin: 0;
}

.result-card__id {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 6px;
}

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

.result-card__meta span {
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.result-card__meta strong {
  word-break: break-word;
}

.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.is-complete {
  background: rgba(2, 122, 72, 0.1);
  color: var(--success);
}

.status-pill.is-pending {
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.preview-result-button {
  width: 100%;
}

.result-card__actions--dual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.lab-visits-table-wrap {
  padding: 10px;
}

#labVisitsGrid.lab-visits-grid--table {
  display: block;
}

#labVisitsGrid.lab-visits-grid--table > * {
  width: 100%;
}

.lab-visits-table {
  min-width: 980px;
}

.lab-visits-table__sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.lab-visits-table__actions-cell {
  white-space: nowrap;
}

.lab-visits-table__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lab-visits-table__action {
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.lab-visits-table__action--ghost {
  background: rgba(15, 118, 110, 0.08);
  color: var(--primary-deep);
}

.lab-visits-empty-cell {
  text-align: center !important;
  color: var(--muted);
  font-weight: 700;
  padding: 20px 12px !important;
}

@media (max-width: 768px) {
  .lab-visits-col-date,
  .lab-visits-col-branch,
  .lab-visits-col-mobile {
    display: none;
  }

  .lab-visits-table .lab-visits-col-name {
    width: 40%;
  }

  .lab-visits-table .lab-visits-col-status {
    width: 18%;
    text-align: center;
    white-space: nowrap;
  }

  .lab-visits-table .lab-visits-col-actions {
    width: 22%;
  }

  .lab-visits-table__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .lab-visits-table__action {
    width: 100%;
    min-width: auto;
    min-height: 40px;
    padding: 10px 12px;
    font-size: 11px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .lab-visits-table__sub {
    display: none;
  }
}

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

.account-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.price-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  border-radius: 28px;
  padding: 22px;
}

.price-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.price-card__top h3,
.price-card__code {
  margin: 0;
}

.price-card__code {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.price-card__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.price-card__meta span {
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.price-card__meta strong {
  word-break: break-word;
}

.price-card__notes {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(31, 41, 51, 0.08);
}

.price-card__notes-label {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.price-card__notes-text {
  margin: 0;
  line-height: 1.7;
}

.expense-card__button {
  min-width: 110px;
  flex-shrink: 0;
}

.expense-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

#paymentsTable th:nth-child(4),
#paymentsTable td:nth-child(4) {
  min-width: 280px;
  white-space: normal;
}

#paymentsTable th:last-child,
#paymentsTable td:last-child {
  text-align: center;
}

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

#testsTable th:first-child,
#testsTable td:first-child {
  width: 96px;
}

#testsTable th:nth-child(2),
#testsTable td:nth-child(2),
#testsTable th:nth-child(3),
#testsTable td:nth-child(3) {
  min-width: 180px;
}

#testsTable th:last-child,
#testsTable td:last-child {
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface-strong);
  overflow: visible;
  width: 220px;
  min-width: 220px;
  vertical-align: top;
}

#testsTable th:last-child {
  z-index: 3;
  background: rgba(15, 118, 110, 0.08);
}

#testsTable td:last-child::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -10px;
  width: 10px;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.14), rgba(15, 118, 110, 0));
  pointer-events: none;
}

.payments-actions {
  gap: 8px;
  flex-wrap: nowrap;
}

.payment-action-button {
  min-width: 82px;
  padding: 9px 12px;
  font-size: 0.9rem;
  border-radius: 14px;
}

.payment-action-button--danger {
  background: rgba(153, 27, 27, 0.08);
  color: #991b1b;
}

.payment-action-button--danger:hover {
  background: rgba(153, 27, 27, 0.14);
}

.table-actions-menu {
  position: relative;
  width: 100%;
}

.table-actions-menu[open] {
  z-index: 6;
}

.table-actions-menu__trigger {
  list-style: none;
  min-width: 96px;
  width: 100%;
}

.table-actions-menu__trigger::-webkit-details-marker {
  display: none;
}

.table-actions-menu__list {
  position: static;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(24, 32, 38, 0.1);
  background: #fffdf9;
  box-shadow: 0 10px 24px rgba(15, 39, 36, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.table-actions-menu__item {
  width: 100%;
  border: 0;
  background: rgba(15, 118, 110, 0.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  text-align: right;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

#testsTable td:last-child::before {
  display: none;
}

.table-actions-menu__item:hover {
  background: rgba(15, 118, 110, 0.12);
}

.table-actions-menu__item--disabled,
.table-actions-menu__item:disabled {
  background: rgba(31, 41, 51, 0.06);
  color: var(--muted);
  cursor: not-allowed;
}

.section-action-button {
  min-width: 132px;
  padding: 12px 18px;
  border-radius: 16px;
  font-size: 0.95rem;
}

.lab-unit-picker {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(15, 118, 110, 0.04);
  border: 1px solid rgba(15, 118, 110, 0.1);
}

.lab-unit-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lab-unit-picker__apply {
  min-width: 130px;
}

.lab-unit-picker__head strong {
  display: block;
  color: var(--primary-deep);
  margin-bottom: 4px;
}

.lab-unit-picker__head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.lab-unit-selected {
  min-height: 48px;
}

.lab-unit-selected__empty {
  margin: 0;
  color: var(--muted);
}

.lab-unit-selected-table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(15, 118, 110, 0.1);
  background: #ffffff;
}

.lab-unit-selected-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.lab-unit-selected-table th,
.lab-unit-selected-table td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid rgba(31, 41, 51, 0.08);
  vertical-align: middle;
}

.lab-unit-selected-table th {
  background: rgba(15, 118, 110, 0.06);
  color: var(--primary-deep);
  font-weight: 800;
}

.lab-unit-selected-table tbody tr:hover {
  background: rgba(15, 118, 110, 0.03);
}

.device-map-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.8fr) auto;
  gap: 14px;
  align-items: end;
}

.device-map-entry__button {
  min-height: 48px;
  white-space: nowrap;
}

#deviceModal {
  margin-top: 0;
  padding: 0;
  overflow: visible;
  min-height: calc(100vh - 220px);
  background: transparent;
  box-shadow: none;
  border: 0;
  border-radius: 0;
}

#deviceModal.filters-card {
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
  border-radius: 0;
}

#deviceModal .result-view-modal__header {
  position: static;
  top: auto;
  z-index: auto;
  background: transparent;
  padding: 0 0 18px;
  border-bottom: 0;
}

#devicesListView.hidden {
  display: none !important;
}

#devicesDataSection.is-editing > .filters-card:first-child,
#devicesDataSection.is-editing > #devicesListView {
  display: none !important;
}

.device-editor-view {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.device-editor-breadcrumb {
  padding: 0 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

#deviceModal .result-view-modal__body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

#deviceModal #deviceForm {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  min-height: 0;
  padding: 24px;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#deviceModal .device-map-picker {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#deviceModal #deviceMappingsTableWrap {
  flex: 1;
  min-height: 220px;
  max-height: 46vh;
  overflow: auto;
  padding-inline-start: 2px;
}

#deviceModal .result-view-modal__actions {
  justify-content: flex-start;
}

#deviceModal .result-view-modal__header h3 {
  font-size: 1.9rem;
  line-height: 1.2;
}

#deviceModal .result-view-modal__header p {
  font-size: 0.98rem;
  line-height: 1.7;
}

#devicesTable {
  table-layout: fixed;
}

#devicesTable th:nth-child(1),
#devicesTable td:nth-child(1) {
  width: 14%;
}

#devicesTable th:nth-child(2),
#devicesTable td:nth-child(2) {
  width: 30%;
}

#devicesTable th:nth-child(3),
#devicesTable td:nth-child(3) {
  width: 16%;
}

#devicesTable th:nth-child(4),
#devicesTable td:nth-child(4) {
  width: 14%;
}

#devicesTable th:nth-child(5),
#devicesTable td:nth-child(5) {
  width: 26%;
}

#devicesTable .payments-actions {
  justify-content: flex-end;
}

.lab-unit-chip {
  display: inline-flex;
  align-items: center;
}

.lab-unit-chip__remove {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(153, 27, 27, 0.08);
  color: #991b1b;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}

.lab-unit-chip__remove:hover {
  background: rgba(153, 27, 27, 0.14);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.table-pagination__summary {
  color: var(--muted);
  font-weight: 700;
}

.table-pagination__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-pagination__button {
  min-width: 44px;
  padding: 9px 14px;
}

.table-pagination__button--active {
  background: var(--primary);
  color: #fff;
}

.secondary-button--ghost {
  background: rgba(15, 118, 110, 0.08);
  color: var(--primary-deep);
  box-shadow: none;
}

.secondary-button--danger {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
  box-shadow: none;
}

.result-view-modal__dialog.expense-modal__dialog {
  width: min(92vw, 380px);
  height: auto;
  min-height: unset;
  max-height: none;
  margin: 14vh auto;
  overflow: visible;
}

.result-view-modal__dialog.expense-modal__dialog .result-view-modal__header {
  padding: 16px 18px 14px;
}

.result-view-modal__dialog.expense-modal__dialog .result-view-modal__body {
  flex: 0 0 auto;
  min-height: unset;
  overflow: visible;
  padding: 12px 18px 18px;
}

.result-view-modal__dialog.payment-modal__dialog {
  width: min(92vw, 520px);
  height: auto;
  min-height: unset;
  max-height: 82vh;
  margin: 10vh auto;
  overflow: hidden;
}

.result-view-modal__dialog.payment-modal__dialog .result-view-modal__header {
  padding: 16px 18px 14px;
}

.result-view-modal__dialog.payment-modal__dialog .result-view-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 18px 18px;
}

#testPricingTable {
  min-width: 100%;
}

#testPricingTable th:last-child,
#testPricingTable td:last-child {
  width: 110px;
  min-width: 110px;
  text-align: center;
}

.toast-stack {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(9, 32, 31, 0.94);
  color: #f7fbfa;
  box-shadow: 0 18px 34px rgba(10, 35, 33, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(-10px) scale(0.98);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.app-toast--success {
  background: linear-gradient(135deg, rgba(9, 82, 76, 0.96), rgba(14, 110, 101, 0.96));
}

.app-toast--error {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.96), rgba(153, 27, 27, 0.96));
}

.app-toast__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.app-toast__title,
.app-toast__text {
  margin: 0;
}

.app-toast__title {
  font-size: 0.96rem;
}

.app-toast__text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(247, 251, 250, 0.94);
}

.app-toast__close {
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  flex: 0 0 auto;
}

.app-toast__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.result-view-modal__dialog.test-modal__dialog {
  width: min(92vw, 860px);
  height: auto;
  min-height: unset;
  max-height: 86vh;
  margin: 7vh auto;
  overflow: hidden;
}

#labUnitModal .result-view-modal__header {
  gap: 12px;
}

#labUnitModal .result-view-modal__header > div:first-child {
  min-width: 0;
}

#labUnitModal .result-view-modal__header h3,
#labUnitModal .result-view-modal__header p {
  word-break: break-word;
}

.result-view-modal__dialog.test-modal__dialog .result-view-modal__header {
  padding: 16px 18px 14px;
}

.result-view-modal__dialog.test-modal__dialog .result-view-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 18px 18px;
}

.expense-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.expense-form__field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.expense-form__field span {
  color: var(--muted);
  font-weight: 700;
}

.expense-form__field input {
  width: 100%;
  text-align: right;
  font-size: 1.02rem;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.expense-form__field input:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

.expense-form__actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.payment-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.payment-form__field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-form__field span {
  color: var(--muted);
  font-weight: 700;
}

.payment-form__field input,
.payment-form__field select,
.payment-form__field textarea {
  width: 100%;
  text-align: right;
  font-size: 1rem;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.payment-form__field textarea {
  min-height: 100px;
  resize: vertical;
  font-family: "Cairo", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.8;
  color: var(--text);
  letter-spacing: 0;
}

.payment-form__field input:focus,
.payment-form__field select:focus,
.payment-form__field textarea:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

.payment-form__actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

#paymentCancelButton.result-view-modal__close {
  background: rgba(15, 118, 110, 0.08);
  color: var(--primary-deep);
}

#expenseCodesTable th:last-child,
#expenseCodesTable td:last-child {
  text-align: center;
}

#expenseCodesTable th:first-child,
#expenseCodesTable td:first-child {
  width: 120px;
  white-space: nowrap;
}

#expenseCodesTable th:nth-child(2),
#expenseCodesTable td:nth-child(2) {
  width: auto;
}

.price-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary-deep);
  font-weight: 800;
  white-space: nowrap;
}

.price-pill.is-unpriced {
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.account-summary-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  border-radius: 28px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-summary-card span {
  color: var(--muted);
}

.account-summary-card strong {
  font-size: 1.6rem;
  color: var(--primary-deep);
}

.account-table-wrap {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  border-radius: 28px;
  padding: 12px;
  overflow: auto;
}

.export-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.export-button {
  min-width: 160px;
}

.account-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.results-entry-table-wrap {
  display: block;
}

#resultsEntryVisitsGrid {
  display: none;
}

.results-entry-item--colored {
  --entry-shift-color: var(--primary);
}

.results-entry-recording-row.is-verified,
.results-entry-recording-card.is-verified {
  background: rgba(15, 118, 110, 0.06);
}

.results-entry-recording-input {
  width: 100%;
  min-width: 110px;
  border: 1px solid rgba(31, 41, 51, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  direction: ltr;
  text-align: left;
}

#resultsEntryRecordingSection input.results-entry-recording-input,
#resultsEntryRecordingSection textarea.results-entry-recording-input {
  direction: ltr !important;
  text-align: left !important;
}

.results-entry-recording-input:disabled {
  background: rgba(226, 232, 240, 0.75);
  color: var(--muted);
  cursor: not-allowed;
}

.results-entry-recording-test-name,
.results-entry-recording-result-input {
  font-weight: 800;
}

.results-entry-recording-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.results-entry-recording-range {
  white-space: pre-line;
  min-width: 180px;
  color: var(--muted);
  line-height: 1.7;
  direction: ltr;
  text-align: left;
}

.results-entry-recording-flag-input {
  min-width: 58px;
  max-width: 58px;
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
}

.results-entry-recording-table,
.results-entry-recording-table th,
.results-entry-recording-table td,
.results-entry-recording-card,
.results-entry-recording-card .result-card__top,
.results-entry-recording-card .result-card__meta,
.results-entry-recording-card .payment-form__field {
  direction: ltr;
}

.results-entry-recording-table th,
.results-entry-recording-table td,
.results-entry-recording-card .result-card__top,
.results-entry-recording-card .result-card__meta,
.results-entry-recording-card .payment-form__field span,
.results-entry-recording-card .result-card__id,
.results-entry-recording-card h3 {
  text-align: left;
}

.results-entry-recording-table th:last-child,
.results-entry-recording-table td:last-child {
  text-align: center;
}

.results-entry-recording-status-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 1rem;
}

.results-entry-recording-status-symbol.is-done {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.results-entry-recording-status-symbol.is-pending {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.results-entry-recording-test-cell {
  min-width: 260px;
  text-align: left;
}

.results-entry-recording-result-cell {
  min-width: 170px;
  text-align: left;
}

#resultsEntryRecordingGrid {
  display: none;
}

.results-entry-recording-card__inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.results-entry-recording-mobile-actions {
  display: none;
}

tr.results-entry-item--colored {
  color: inherit;
}

.result-card.results-entry-item--colored {
  background: var(--surface);
}

.account-table th,
.account-table td {
  padding: 14px 12px;
  text-align: right;
  border-bottom: 1px solid rgba(31, 41, 51, 0.08);
}

#resultsEntryRecordingSection .results-entry-recording-table,
#resultsEntryRecordingSection .results-entry-recording-table th,
#resultsEntryRecordingSection .results-entry-recording-table td {
  direction: ltr;
  text-align: left;
}

#resultsEntryRecordingSection .results-entry-recording-table th:last-child,
#resultsEntryRecordingSection .results-entry-recording-table td:last-child {
  text-align: center;
}

.account-table th {
  color: var(--primary-deep);
  background: rgba(15, 118, 110, 0.06);
  font-weight: 800;
}

.account-table tbody tr:hover {
  background: rgba(15, 118, 110, 0.03);
}

.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.pdf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
}

.pdf-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 1100px);
  height: min(90vh, 900px);
  margin: 5vh auto;
  border-radius: 28px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
}

.pdf-modal__header {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(31, 41, 51, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pdf-modal__header h3,
.pdf-modal__header p {
  margin: 0;
}

.pdf-modal__header p {
  color: var(--muted);
  margin-top: 4px;
}

.pdf-modal__close {
  border: 0;
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary-deep);
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.pdf-modal__body {
  flex: 1;
  min-height: 0;
  position: relative;
}

.pdf-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f8fafc;
}

.pdf-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(248, 250, 252, 0.94);
  z-index: 1;
}

.pdf-loading p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.pdf-loading__spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(15, 118, 110, 0.14);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

.app-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.62);
  backdrop-filter: blur(3px);
}

.app-loading-overlay__content {
  min-width: 210px;
  padding: 22px 26px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 118, 110, 0.12);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.app-loading-overlay__content p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.result-view-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
}

.result-view-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
}

.result-view-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 980px);
  height: min(88vh, 820px);
  margin: 6vh auto;
  border-radius: 28px;
  background: var(--surface-strong);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
}

.result-view-modal__header {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(31, 41, 51, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-view-modal__header h3,
.result-view-modal__header p {
  margin: 0;
}

.result-view-modal__header p {
  color: var(--muted);
  margin-top: 4px;
}

.result-view-modal__patient-name {
  color: var(--text) !important;
  font-weight: 800;
  font-size: 1rem;
  margin-top: 10px !important;
}

.result-view-modal__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-view-modal__export,
.result-view-modal__close {
  border: 0;
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary-deep);
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.result-view-modal__body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 22px;
  overflow: auto;
}

.result-view-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-view-table-wrap {
  border: 1px solid rgba(31, 41, 51, 0.08);
  border-radius: 22px;
  background: rgba(15, 118, 110, 0.04);
  overflow: auto;
  direction: ltr;
}

.result-view-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  direction: ltr;
  table-layout: fixed;
}

.result-view-table th,
.result-view-table td {
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(31, 41, 51, 0.08);
}

.result-view-table th {
  background: rgba(15, 118, 110, 0.08);
  color: var(--primary-deep);
  font-weight: 800;
}

.result-view-table tbody tr:hover {
  background: rgba(15, 118, 110, 0.03);
}

.result-view-table__reference-cell {
  white-space: pre-wrap;
  line-height: 1.8;
  min-width: 300px;
}

.result-view-table__test-cell {
  font-weight: 700;
}

.result-view-table__result-cell {
  font-weight: 800;
  text-align: center;
  width: 140px;
}

.result-view-table__unit-cell {
  text-align: center;
  white-space: nowrap;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

  .charts-layout {
    grid-template-columns: 1fr;
  }

  .chart-card--span-2 {
    grid-column: auto;
  }

  .pie-chart {
    grid-template-columns: 1fr;
  }

  .pie-chart__donut {
    width: 200px;
    height: 200px;
  }

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

  .results-grid {
    grid-template-columns: 1fr;
  }

  .results-entry-table-wrap {
    display: none;
  }

  #resultsEntryVisitsGrid {
    display: grid;
  }

  .results-entry-recording-table-wrap {
    display: none;
  }

  #resultsEntryRecordingGrid {
    display: grid;
  }

  .results-entry-recording-card__inputs {
    grid-template-columns: 1fr;
  }

  #resultsEntryRecordingSection {
    padding-bottom: 96px;
  }

  .results-entry-recording-mobile-actions {
    position: fixed;
    right: 14px;
    left: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 70;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 118, 110, 0.14);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(10px);
  }

  .results-entry-recording-mobile-actions .secondary-button,
  .results-entry-recording-mobile-actions .export-button {
    min-width: 0;
    width: 100%;
    justify-content: center;
  }

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

  .filters-form--contract-claim {
    grid-template-columns: 1fr;
  }

  .prices-grid {
    grid-template-columns: 1fr;
  }

  .filters-form--lab,
  .filters-form--lab-price,
  .filters-form--expense-codes,
  .filters-form--payments,
  .account-grid,
  .price-card__meta {
    grid-template-columns: 1fr;
  }

  .contract-claim-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 920px) {
  .auth-shell {
    padding: 36px 18px 28px;
  }

  .brand-panel {
    padding: 0;
  }

  .auth-panel {
    padding: 0;
  }

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

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

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
    z-index: 45;
  }

  .sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(82vw, 320px);
    max-width: 320px;
    transform: translateX(100%);
    transition: transform 0.24s ease;
    z-index: 50;
    height: 100vh;
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.22);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-flex;
  }

  .sidebar-toggle {
    display: none;
  }

  .dashboard-main {
    height: 100vh;
    padding: 22px;
    overflow-y: auto;
  }
}

@media (max-width: 560px) {
  .view,
  .filters-card,
  .metric-card,
  .chart-card,
  .placeholder-card {
    padding: 20px;
    border-radius: 24px;
  }

  .role-grid,
  .summary-grid,
  .filters-form,
  .filters-form--results,
  .filters-form--prices,
  .filters-form--lab,
  .filters-form--lab-price,
  .filters-form--expense-codes,
  .filters-form--contract-claim,
  .filters-form--payments,
  .result-card__meta,
  .price-card__meta,
  .results-grid,
  .prices-grid,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .filters-span-2 {
    grid-column: span 1;
  }

  .contract-claim-controls {
    grid-template-columns: 1fr;
  }

  .contract-claim-actions .secondary-button,
  .contract-claim-actions .export-button {
    min-width: 0;
  }

  .brand-panel h1 {
    font-size: 2rem;
  }

  .role-card {
    min-height: 190px;
    border-radius: 28px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
  }

  .topbar-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .topbar-actions {
    align-self: flex-start;
  }

  .menu-button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 52px;
    padding: 10px 14px;
    flex-shrink: 0;
  }

  .account-table {
    min-width: 100%;
  }

  #contractClaimReportSection .account-table,
  #testsStatisticsReportSection .account-table,
  #testsStatisticsContractReportSection .account-table,
  #testsStatisticsLabReportSection .account-table,
  #expensesTotalReportSection .account-table {
    min-width: 100%;
  }

  .account-table .account-table__mobile-hidden {
    display: none;
  }

  .account-table th.account-table__mobile-primary,
  .account-table td.account-table__mobile-primary {
    width: 65%;
  }

  .account-table th.account-table__mobile-secondary,
  .account-table td.account-table__mobile-secondary {
    width: 35%;
    white-space: nowrap;
  }

  #testsStatisticsReportSection .account-table th.account-table__mobile-primary,
  #testsStatisticsReportSection .account-table td.account-table__mobile-primary {
    width: 32%;
  }

  #testsStatisticsReportSection .account-table th.account-table__mobile-secondary,
  #testsStatisticsReportSection .account-table td.account-table__mobile-secondary {
    width: 17%;
    text-align: center;
    white-space: nowrap;
    font-size: 0.88rem;
    padding-inline: 8px;
  }

  #contractClaimReportSection .account-table th.account-table__mobile-primary,
  #contractClaimReportSection .account-table td.account-table__mobile-primary {
    width: 68%;
  }

  #contractClaimReportSection .account-table th.account-table__mobile-secondary,
  #contractClaimReportSection .account-table td.account-table__mobile-secondary {
    width: 32%;
    text-align: left;
  }

  #testsStatisticsContractReportSection .account-table th.account-table__mobile-primary,
  #testsStatisticsContractReportSection .account-table td.account-table__mobile-primary,
  #testsStatisticsLabReportSection .account-table th.account-table__mobile-primary,
  #testsStatisticsLabReportSection .account-table td.account-table__mobile-primary,
  #expensesTotalReportSection .account-table th.account-table__mobile-primary,
  #expensesTotalReportSection .account-table td.account-table__mobile-primary {
    width: 68%;
  }

  #testsStatisticsContractReportSection .account-table th.account-table__mobile-secondary,
  #testsStatisticsContractReportSection .account-table td.account-table__mobile-secondary,
  #testsStatisticsLabReportSection .account-table th.account-table__mobile-secondary,
  #testsStatisticsLabReportSection .account-table td.account-table__mobile-secondary,
  #expensesTotalReportSection .account-table th.account-table__mobile-secondary,
  #expensesTotalReportSection .account-table td.account-table__mobile-secondary {
    width: 32%;
    text-align: left;
  }

  #testPricingTable th,
  #testPricingTable td {
    padding: 10px 8px;
    font-size: 0.84rem;
  }

  #testPricingTable th.account-table__mobile-primary,
  #testPricingTable td.account-table__mobile-primary {
    width: 44%;
    white-space: normal;
    word-break: break-word;
  }

  #testPricingTable th.account-table__mobile-secondary,
  #testPricingTable td.account-table__mobile-secondary {
    width: 28%;
    text-align: left;
    white-space: nowrap;
  }

  #testPricingTable th:last-child,
  #testPricingTable td:last-child {
    width: 28%;
    min-width: 88px;
  }

  #testPricingTable .payment-action-button {
    min-width: 0;
    width: 100%;
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  #labUnitsTable {
    min-width: 100%;
    table-layout: fixed;
  }

  #labUnitsTable th,
  #labUnitsTable td {
    padding: 10px 6px;
    font-size: 0.82rem;
  }

  #labUnitsTable th:nth-child(1),
  #labUnitsTable td:nth-child(1) {
    width: 18%;
  }

  #labUnitsTable th:nth-child(2),
  #labUnitsTable td:nth-child(2) {
    width: 34%;
    white-space: normal;
    word-break: break-word;
  }

  #labUnitsTable th:nth-child(3),
  #labUnitsTable td:nth-child(3) {
    display: none;
  }

  #labUnitsTable th:last-child,
  #labUnitsTable td:last-child {
    width: 48%;
  }

  #labUnitsTable .payments-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  #labUnitsTable .payment-action-button {
    width: 100%;
    min-width: 0;
    padding: 8px 8px;
    font-size: 0.8rem;
  }

  #devicesTable {
    min-width: 100%;
    table-layout: fixed;
  }

  #devicesTable th,
  #devicesTable td {
    padding: 10px 6px;
    font-size: 0.82rem;
  }

  #devicesTable th:nth-child(1),
  #devicesTable td:nth-child(1) {
    width: 18%;
  }

  #devicesTable th:nth-child(2),
  #devicesTable td:nth-child(2) {
    width: 34%;
    white-space: normal;
    word-break: break-word;
  }

  #devicesTable th:nth-child(3),
  #devicesTable td:nth-child(3) {
    width: 18%;
  }

  #devicesTable th:nth-child(4),
  #devicesTable td:nth-child(4) {
    display: none;
  }

  #devicesTable th:nth-child(5),
  #devicesTable td:nth-child(5) {
    width: 30%;
  }

  #devicesTable .payments-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  #devicesTable .payment-action-button {
    width: 100%;
    min-width: 0;
    padding: 8px 8px;
    font-size: 0.8rem;
  }

  .toast-stack {
    top: 12px;
    left: 12px;
    width: calc(100vw - 24px);
  }

  .app-toast {
    padding: 12px 14px;
    border-radius: 16px;
  }

  .app-toast__close {
    padding: 7px 10px;
    font-size: 0.8rem;
  }

  .result-card__top,
  .result-card__actions,
  .price-card__top,
  .result-view-card__top {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-card__actions--dual {
    grid-template-columns: 1fr;
  }

  .result-view-table {
    min-width: 100%;
    table-layout: auto;
  }

  .result-view-table thead {
    display: none;
  }

  .result-view-table tbody,
  .result-view-table tr {
    display: block;
  }

  .result-view-table tr {
    padding: 12px 0;
    border-bottom: 1px solid rgba(31, 41, 51, 0.08);
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(90px, 0.8fr) minmax(70px, 0.7fr);
    gap: 8px 12px;
    align-items: start;
  }

  .result-view-table td {
    display: block;
    border-bottom: 0;
    padding: 0;
  }

  .result-view-table__test-cell::before,
  .result-view-table__result-cell::before,
  .result-view-table__unit-cell::before,
  .result-view-table__reference-cell::before {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 4px;
  }

  .result-view-table__test-cell::before {
    content: "Test";
  }

  .result-view-table__result-cell::before {
    content: "Result";
  }

  .result-view-table__unit-cell::before {
    content: "Unit";
  }

  .result-view-table__reference-cell::before {
    content: "Reference Range.";
  }

  .result-view-table__reference-cell {
    grid-column: 1 / -1;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px dashed rgba(31, 41, 51, 0.12);
  }

  .result-view-table__result-cell,
  .result-view-table__unit-cell {
    text-align: left;
    width: auto;
  }

  .pdf-modal__dialog {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .result-view-modal__dialog {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .result-view-modal__dialog.expense-modal__dialog {
    width: min(92vw, 360px);
    height: auto;
    min-height: unset;
    max-height: none;
    margin: 12vh auto;
    border-radius: 24px;
  }

  .result-view-modal__dialog.payment-modal__dialog {
    width: min(92vw, 360px);
    height: auto;
    min-height: unset;
    max-height: 86vh;
    margin: 8vh auto;
    border-radius: 24px;
  }

  .result-view-modal__dialog.test-modal__dialog {
    width: min(94vw, 540px);
    height: auto;
    min-height: unset;
    max-height: 88vh;
    margin: 6vh auto;
    border-radius: 24px;
  }

  #labUnitModal .result-view-modal__dialog.test-modal__dialog {
    width: min(96vw, 620px);
    max-height: 92vh;
    margin: 4vh auto;
    border-radius: 22px;
  }

  #labUnitModal .result-view-modal__header {
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  #labUnitModal .result-view-modal__actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
    order: 2;
  }

  #labUnitModal .result-view-modal__header > div:first-child {
    order: 1;
    width: 100%;
  }

  #labUnitModal .result-view-modal__header h3 {
    margin-bottom: 6px;
    font-size: 1.08rem;
    line-height: 1.5;
  }

  #labUnitModal .result-view-modal__header p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.7;
  }

  #labUnitModal .result-view-modal__export,
  #labUnitModal .result-view-modal__close,
  #labUnitModal .lab-unit-picker__apply {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    text-align: center;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.9rem;
  }

  #labUnitModal .result-view-modal__body {
    padding: 12px 12px 16px;
  }

  #deviceModal .result-view-modal__header {
    padding: 0 0 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #deviceModal .result-view-modal__actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
    order: 2;
  }

  #deviceModal .result-view-modal__header > div:first-child {
    order: 1;
    width: 100%;
  }

  #deviceModal .result-view-modal__header h3 {
    margin-bottom: 4px;
    font-size: 1.16rem;
    line-height: 1.45;
  }

  #deviceModal .result-view-modal__header p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
  }

  #deviceModal .result-view-modal__export,
  #deviceModal .result-view-modal__close,
  #deviceModal .device-map-entry__button {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    text-align: center;
    padding: 9px 10px;
    border-radius: 12px;
    font-size: 0.84rem;
  }

  #deviceModal .result-view-modal__body {
    padding: 0;
  }

  .device-editor-breadcrumb {
    padding: 0 0 10px;
    font-size: 0.74rem;
    line-height: 1.6;
  }

  #deviceModal #deviceForm {
    gap: 12px;
    padding: 14px;
    border-radius: 0;
  }

  #deviceModal #deviceMappingsTableWrap {
    min-height: 240px;
    max-height: 52vh;
  }

  #deviceModal .autocomplete-menu {
    max-height: 260px;
    padding: 6px;
    border-radius: 14px;
  }

  #deviceModal .autocomplete-option {
    padding: 10px 12px;
    border-radius: 12px;
    gap: 10px;
  }

  #deviceModal .autocomplete-option strong {
    font-size: 0.86rem;
    line-height: 1.45;
  }

  #deviceModal .autocomplete-option span {
    font-size: 0.75rem;
  }

  #deviceModal .autocomplete-option__check {
    width: 24px;
    height: 24px;
    font-size: 0.78rem;
  }

  #deviceModal .payment-form__field input,
  #deviceModal .payment-form__field select {
    min-height: 42px;
    padding: 10px 12px;
    font-size: 0.88rem;
  }

  #deviceModal .lab-unit-selected-table {
    min-width: 100%;
  }

  #deviceModal .lab-unit-selected-table th,
  #deviceModal .lab-unit-selected-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  #deviceModal .lab-unit-chip__remove {
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  #labUnitModal .payment-form__field input,
  #labUnitModal .payment-form__field textarea {
    min-height: 44px;
  }

  #labUnitModal .autocomplete-menu {
    max-height: 220px;
  }

  .lab-unit-picker__head {
    flex-direction: column;
    align-items: stretch;
  }

  .test-form__grid {
    grid-template-columns: 1fr;
  }

  .device-map-entry {
    grid-template-columns: 1fr;
  }

  .device-map-entry__button {
    width: 100%;
  }

  #paymentsTable {
    min-width: 100%;
    table-layout: fixed;
  }

  #testsTable {
    min-width: 100%;
    table-layout: fixed;
  }

  #paymentsTable th,
  #paymentsTable td {
    padding: 10px 6px;
    font-size: 0.84rem;
  }

  #paymentsTable th:nth-child(1),
  #paymentsTable td:nth-child(1) {
    width: 22%;
    white-space: normal;
  }

  #paymentsTable th:nth-child(2),
  #paymentsTable td:nth-child(2) {
    width: 22%;
  }

  #paymentsTable th:nth-child(3),
  #paymentsTable td:nth-child(3) {
    width: 16%;
    white-space: normal;
  }

  #paymentsTable th:nth-child(4),
  #paymentsTable td:nth-child(4) {
    width: 22%;
    min-width: 0;
  }

  #paymentsTable th:nth-child(5),
  #paymentsTable td:nth-child(5) {
    width: 18%;
  }

  #testsTable th,
  #testsTable td {
    padding: 10px 6px;
    font-size: 0.82rem;
  }

  #testsTable th:nth-child(3),
  #testsTable td:nth-child(3),
  #testsTable th:nth-child(4),
  #testsTable td:nth-child(4) {
    display: none;
  }

  #testsTable th:nth-child(1),
  #testsTable td:nth-child(1) {
    width: 14%;
    min-width: 52px;
  }

  #testsTable th:nth-child(2),
  #testsTable td:nth-child(2) {
    width: 34%;
    white-space: normal;
    word-break: break-word;
  }

  #testsTable th:last-child,
  #testsTable td:last-child {
    width: 52%;
    min-width: 118px;
    padding-inline: 4px;
  }

  .table-actions-menu__trigger {
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.84rem;
  }

  .table-actions-menu__list {
    padding: 6px;
    border-radius: 14px;
  }

  .table-actions-menu__item {
    padding: 9px 10px;
    font-size: 0.8rem;
  }

  .payments-actions {
      flex-direction: column;
      align-items: stretch;
    gap: 6px;
  }

  .table-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .table-pagination__actions {
    justify-content: center;
  }

  .payment-action-button {
    min-width: 72px;
    padding: 8px 10px;
    font-size: 0.84rem;
  }

  .lab-unit-picker {
    padding: 14px;
    border-radius: 18px;
  }

  .autocomplete-option--multiselect {
    padding: 11px 12px;
  }

  .lab-unit-selected-table {
    min-width: 100%;
  }

  .lab-unit-selected-table th,
  .lab-unit-selected-table td {
    padding: 10px 8px;
    font-size: 0.84rem;
  }
}
