:root {
  --clinical-50: #eaf4fb;
  --clinical-100: #d7eaf7;
  --clinical-200: #b8d8ee;
  --clinical-300: #83bbdf;
  --clinical-400: #4f9dcc;
  --clinical-500: #2d7fb2;
  --clinical-600: #1e5a8a;
  --clinical-700: #16486f;
  --clinical-800: #123a59;
  --clinical-900: #0d2e47;
  --accent-teal: #0f766e;
  --accent-teal-soft: #e6f4f2;
  --success: #166534;
  --success-soft: #f0fdf4;
  --success-border: rgba(22, 101, 52, 0.22);
  --info-soft: #e8eef6;
  --info-border: #cbd5e1;
  --attention-soft: #fef3c7;
  --attention-border: rgba(180, 83, 9, 0.3);
  --risk-soft: #fee2e2;
  --risk-border: rgba(180, 35, 24, 0.28);
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: var(--clinical-600);
  --primary-700: var(--clinical-700);
  --primary-50: var(--clinical-50);
  --primary-100: var(--clinical-100);
  --good: var(--success);
  --warn: #b45309;
  --bad: #b42318;
  --color-background-secondary: var(--surface-2);
  --color-background-primary: var(--surface);
  --color-background-tertiary: var(--clinical-100);
  --color-background-info: var(--info-soft);
  --color-border-secondary: #cbd5e1;
  --color-border-tertiary: var(--border);
  --color-border-info: var(--info-border);
  --color-text-secondary: var(--muted);
  --color-text-tertiary: #94a3b8;
  --color-text-primary: var(--text);
  --color-text-info: var(--clinical-700);
  --color-background-success: var(--success-soft);
  --color-border-success: var(--success-border);
  --color-text-success: var(--success);
  --color-background-warning: var(--attention-soft);
  --color-border-warning: var(--attention-border);
  --color-text-warning: var(--warn);
  --color-background-danger: var(--risk-soft);
  --color-border-danger: var(--risk-border);
  --color-text-danger: var(--bad);
  --focus: rgba(30, 90, 138, 0.24);
  --radius: 8px;
  --radius-sm: 6px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --page-header-min-height: 76px;
  --page-header-padding-x: var(--space-6);
  --page-title-size: 22px;
  --page-title-line-height: 1.2;
  --page-title-weight: 950;
  --page-subtitle-size: 13px;
  --page-subtitle-line-height: 1.45;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-6: 24px;
  --space-8: 32px;
  --sidebar-w: 280px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: 0;
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
  border-radius: var(--radius-sm);
}

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 240px;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  min-height: var(--page-header-min-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--page-header-padding-x);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar__context {
  min-width: 0;
  margin-right: auto;
  color: var(--text);
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.site-page-heading {
  min-width: 0;
}

.site-page-title {
  margin: 0;
  color: var(--text);
  font-size: var(--page-title-size);
  font-weight: var(--page-title-weight);
  line-height: var(--page-title-line-height);
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.site-page-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--page-subtitle-size);
  font-weight: 500;
  line-height: var(--page-subtitle-line-height);
}

.hero .site-page-title {
  color: inherit;
}

.content {
  overflow: auto;
  padding: var(--space-6);
}

.content--revamped {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--space-6);
  background: var(--clinical-700);
  color: #fff;
}

.brand__logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.brand__logo svg {
  width: 20px;
  height: 20px;
}

.brand__title {
  font-weight: 900;
  letter-spacing: 0.2px;
}

.brand__subtitle {
  font-size: 12px;
  opacity: 0.9;
}

.sidebar__inner {
  padding: var(--space-6);
  overflow: auto;
  flex: 1;
}

.profile {
  display: flex;
  gap: 12px;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  margin-bottom: var(--space-6);
  box-shadow: none;
}

.profile-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: 0.04em;
}

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

.profile__name {
  font-weight: 900;
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.profile__role {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.profile__meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 6px 9px;
  max-width: 190px;
}

.profile-chip svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

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

.nav__label {
  margin: 0 0 9px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: #334155;
  font-weight: 750;
  font-size: 14px;
  transition: 140ms ease;
}

.nav__item svg {
  width: 17px;
  height: 17px;
}

.nav__item:hover {
  background: #f8fafc;
  border-color: var(--border);
}

.nav__item.is-active {
  background: var(--primary-50);
  border-color: rgba(30, 90, 138, 0.22);
  color: var(--clinical-800);
}

.nav__badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 18px;
  min-width: 20px;
  text-align: center;
}

.sidebar__footer {
  padding: var(--space-6);
  border-top: 1px solid var(--border);
}

.sidebar__footer .link {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  color: #334155;
  cursor: pointer;
  font-weight: 800;
}

.sidebar__footer .link:hover {
  background: #f8fafc;
  color: var(--text);
}

.sidebar__footer .link svg {
  width: 16px;
  height: 16px;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #334155;
  transition: 140ms ease;
}

.icon-btn:hover {
  background: #f8fafc;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.search {
  position: relative;
  width: min(520px, 46vw);
}

.search input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  outline: none;
  transition: 140ms ease;
}

.search input:focus {
  border-color: rgba(30, 90, 138, 0.55);
  box-shadow: 0 0 0 3px var(--focus);
}

input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.search .search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  width: 17px;
  height: 17px;
}

.search-results {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1000;
  overflow: hidden;
}

.search-result-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  color: inherit;
  font: inherit;
  text-align: left;
}

.search-result-item:last-child {
  border-bottom: 0;
}

.search-result-item:hover {
  background: #f8fafc;
}

.search-result-item--status {
  cursor: default;
  justify-content: flex-start;
}

.search-result-item--status:hover {
  background: #fff;
}

.patient-name {
  font-size: 14px;
  font-weight: 850;
  color: var(--text);
  text-align: left;
}

.patient-meta {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  text-align: left;
}

.patient-result-main {
  min-width: 0;
  flex: 1 1 auto;
}

.patient-result-action {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: var(--space-4);
}

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

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

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}

.card--flat {
  box-shadow: none;
}

.card__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: -0.01em;
}

.card__desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.hero {
  background: var(--clinical-700);
  color: #fff;
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.16);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: none;
}

.hero::before {
  content: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.hero__eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  opacity: 0.8;
  font-weight: 750;
}

.hero__title {
  margin: 0 0 8px;
  font-size: var(--page-title-size);
  font-weight: var(--page-title-weight);
  line-height: var(--page-title-line-height);
  letter-spacing: -0.015em;
}

.hero__sub {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  max-width: 650px;
}

.hero__date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.hero__date svg {
  width: 15px;
  height: 15px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.stack > * + * {
  margin-top: var(--space-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 900;
  cursor: pointer;
  transition: 140ms ease;
  white-space: nowrap;
  font-size: 14px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-700);
}

.btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: #0f172a;
}

.btn-secondary:hover {
  background: #f8fafc;
}

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: #475569;
}

.btn-quiet:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--primary-700);
}

.btn-ghost:hover {
  background: var(--primary-50);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: #334155;
  font-size: 12px;
  background: #fff;
  font-weight: 750;
}

.stat {
  display: flex;
  align-items: center;
  gap: 13px;
}

.stat__icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  border: 1px solid rgba(30, 90, 138, 0.14);
  background: var(--primary-50);
  color: var(--primary);
}

.stat__icon svg {
  width: 20px;
  height: 20px;
}

.stat__label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat__value {
  margin: 3px 0 0;
  font-weight: 950;
  font-size: 28px;
  letter-spacing: 0;
  line-height: 1;
}

.kpi-card {
  padding: 17px;
}

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

body.has-active-patient .kpi-grid {
  display: none;
}

.kpi-filter-card {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.kpi-filter-card:hover {
  border-color: rgba(30, 90, 138, 0.42);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.kpi-filter-card.is-zero {
  background: #f8fafc;
}

.kpi-filter-card.is-zero .stat__icon,
.kpi-filter-card.is-zero .stat__value {
  opacity: 0.58;
}

.kpi-filter-card .stat {
  min-width: 0;
}

.kpi-filter-card .stat__label {
  line-height: 1.3;
}

.kpi-filter-card__arrow {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--muted);
}

.dashboard-operational-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

body.has-active-patient .dashboard-segmentation-card--modules {
  display: none;
}

.dashboard-start-card,
.needs-action-card,
.dashboard-segmentation-card {
  border: 1px solid #e6ecf2;
  border-radius: 18px;
  background: #fffefe;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.dashboard-start-card {
  padding: 24px 30px 28px;
}

.dashboard-stats-card,
.dashboard-segmentation-card {
  padding: 20px;
}

body.has-active-patient .dashboard-segmentation-card {
  display: none;
}

.visit-workspace {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid #eef3f8;
}

.visit-find-panel {
  display: grid;
  gap: 18px;
}

.visit-action-panel {
  display: grid;
  gap: 14px;
  max-width: 940px;
  padding: 16px;
  border: 1px solid #e5ecf3;
  border-radius: 14px;
  background: #f7fbff;
}

.visit-action-head h3 {
  margin: 0 0 2px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.visit-action-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.visit-search-row {
  width: min(100%, 820px);
  display: grid;
  grid-template-columns: minmax(360px, 620px) auto;
  align-items: start;
  gap: 16px;
}

.visit-patient-search {
  width: 100%;
}

.visit-patient-search input {
  min-height: 50px;
  border-color: #d7e0ea;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 650;
}

.visit-patient-search input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.visit-add-patient-btn {
  min-height: 50px;
  padding-inline: 16px;
  border-color: var(--primary);
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(30, 90, 138, 0.14);
  font-weight: 800;
  white-space: nowrap;
}

.visit-add-patient-btn:hover {
  background: var(--primary-700);
  border-color: var(--primary-700);
}

.visit-step-panel {
  overflow: hidden;
}

.dashboard-segmentation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.segmentation-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-stats-card .segmentation-totals {
  grid-template-columns: 1fr;
  margin-bottom: 0;
}

.segmentation-total {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.segmentation-total span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.segmentation-total svg {
  width: 15px;
  height: 15px;
}

.segmentation-total b {
  color: var(--text);
  font-size: 24px;
  font-weight: 950;
  line-height: 1;
}

.segmentation-total .segmentation-total__value {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 3px;
  text-align: right;
}

.segmentation-total .segmentation-total__value small {
  max-width: 120px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
}

.segmentation-total.is-eligible {
  border-color: rgba(161, 98, 7, 0.24);
  background: #fefce8;
}

.segmentation-total.is-scheduled,
.segmentation-total.is-module-total {
  border-color: rgba(30, 90, 138, 0.22);
  background: var(--primary-50);
}

.segmentation-total.is-completed {
  border-color: var(--success-border);
  background: var(--success-soft);
}

.segmentation-chart {
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.segmentation-chart:empty {
  display: none;
}

.segmentation-chart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: 12px;
  font-weight: 950;
}

.segmentation-chart__head--legend {
  justify-content: flex-end;
}

.segmentation-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.segmentation-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
}

.segmentation-legend span::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #64748b;
}

.segmentation-legend .is-eligible::before,
.segmentation-bar-segment.is-eligible,
.segmentation-state-chip.is-eligible {
  background: #fde68a;
}

.segmentation-legend .is-scheduled::before,
.segmentation-bar-segment.is-scheduled,
.segmentation-state-chip.is-scheduled {
  background: #bfdbfe;
}

.segmentation-legend .is-completed::before,
.segmentation-bar-segment.is-completed,
.segmentation-state-chip.is-completed {
  background: #bbf7d0;
}

.segmentation-legend .is-module::before,
.segmentation-state-chip.is-tone-neutral,
.segmentation-state-chip.is-metric-1 {
  background: var(--info-soft);
}

.segmentation-state-chip.is-tone-attention,
.segmentation-state-chip.is-metric-2 {
  background: var(--attention-soft);
}

.segmentation-state-chip.is-tone-good,
.segmentation-state-chip.is-metric-3 {
  background: var(--success-soft);
}

.segmentation-state-chip.is-tone-risk,
.segmentation-state-chip.is-metric-4 {
  background: var(--risk-soft);
}

.segmentation-chart__bars {
  display: grid;
  gap: 9px;
}

.segmentation-bar-row {
  display: grid;
  grid-template-columns: minmax(116px, 180px) minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
}

.segmentation-bar-label {
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmentation-bar-track {
  height: 18px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
}

.segmentation-bar-fill {
  display: flex;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
}

.segmentation-bar-segment {
  display: block;
  min-width: 0;
  height: 100%;
}

.segmentation-bar-row b {
  color: #334155;
  font-size: 12px;
  font-weight: 950;
  text-align: right;
}

.segmentation-bar-row.is-unavailable {
  opacity: 0.62;
}

.segmentation-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 0;
}

.segmentation-module {
  display: flex;
  min-width: 0;
  min-height: 220px;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e3eaf2;
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.segmentation-module:hover {
  border-color: rgba(15, 118, 110, 0.24);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.segmentation-module.is-unavailable {
  cursor: default;
  opacity: 0.72;
  transform: none;
}

.segmentation-module__summary {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.segmentation-module__icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(30, 90, 138, 0.18);
  border-radius: 10px;
  background: #eff7fc;
  color: var(--primary);
}

.segmentation-module.is-unavailable .segmentation-module__icon {
  background: #eef2f7;
  color: #64748b;
}

.segmentation-module__icon svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.2;
}

.segmentation-module__body {
  min-width: 0;
}

.segmentation-module__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.segmentation-module__head h3 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.25;
}

.segmentation-module__total {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  text-align: left;
}

.segmentation-module__total b {
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
}

.segmentation-module__total small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
}

.segmentation-module__states {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  align-items: start;
}

.segmentation-metric {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #eef2f7;
  color: #334155;
  width: 100%;
}

.segmentation-metric:last-child {
  border-bottom: 0;
}

.segmentation-metric span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.segmentation-metric strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  text-align: right;
}

.segmentation-metric.is-zero strong {
  color: #64748b;
}

.segmentation-metric.is-tone-attention:not(.is-zero) strong {
  color: #92400e;
}

.segmentation-metric.is-tone-good:not(.is-zero) strong {
  color: var(--success);
}

.segmentation-metric.is-tone-risk:not(.is-zero) {
  margin: 1px 0;
  padding: 8px 10px;
  border: 1px solid var(--risk-border);
  border-radius: var(--radius-sm);
  background: var(--risk-soft);
}

.segmentation-metric.is-tone-risk:not(.is-zero) span,
.segmentation-metric.is-tone-risk:not(.is-zero) strong {
  color: var(--bad);
}

.segmentation-metric--coverage {
  display: grid;
  gap: 7px;
}

.segmentation-metric__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.segmentation-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.segmentation-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.segmentation-module__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--accent-teal);
  font-size: 12px;
  font-weight: 950;
}

.segmentation-module__action svg {
  width: 14px;
  height: 14px;
}

.segmentation-state-chip {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #334155;
  width: 100%;
}

.segmentation-state-chip.is-eligible {
  border-color: rgba(161, 98, 7, 0.22);
}

.segmentation-state-chip.is-scheduled {
  border-color: rgba(30, 90, 138, 0.2);
}

.segmentation-state-chip.is-completed {
  border-color: var(--success-border);
}

.segmentation-state-chip.is-metric-1 {
  border-color: var(--info-border);
}

.segmentation-state-chip.is-metric-2 {
  border-color: var(--attention-border);
}

.segmentation-state-chip.is-metric-3 {
  border-color: var(--success-border);
}

.segmentation-state-chip.is-metric-4 {
  border-color: var(--risk-border);
}

.segmentation-state-chip.is-tone-neutral {
  border-color: var(--info-border);
}

.segmentation-state-chip.is-tone-attention {
  border-color: var(--attention-border);
}

.segmentation-state-chip.is-tone-good {
  border-color: var(--success-border);
}

.segmentation-state-chip.is-tone-risk {
  border-color: var(--risk-border);
}

.segmentation-state-chip.is-tone-attention b,
.segmentation-state-chip.is-tone-attention em {
  color: #92400e;
}

.segmentation-state-chip.is-tone-good b,
.segmentation-state-chip.is-tone-good em {
  color: var(--success);
}

.segmentation-state-chip.is-tone-risk b,
.segmentation-state-chip.is-tone-risk em {
  color: var(--bad);
}

.segmentation-state-chip b {
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  overflow-wrap: anywhere;
}

.segmentation-state-chip em {
  color: #475569;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: right;
}

.segmentation-module__detail {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.segmentation-module__detail span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.segmentation-module__detail strong {
  min-width: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: right;
}

.segmentation-state {
  padding: 26px 16px;
  border: 0;
  border-radius: var(--radius);
  background: #f8fafc;
  text-align: center;
}

.segmentation-state h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 950;
}

.segmentation-state p {
  max-width: 420px;
  margin: 6px auto 14px;
  color: var(--muted);
  font-size: 13px;
}

.segmentation-state--error {
  border-color: rgba(180, 35, 24, 0.25);
  background: rgba(180, 35, 24, 0.04);
}

.segmentation-state--error .empty-icon {
  color: var(--bad);
  background: rgba(180, 35, 24, 0.08);
}

.needs-action-card {
  padding: 18px;
}

body.has-active-patient .needs-action-card {
  display: none;
}

.needs-action-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.needs-action-heading {
  min-width: 0;
}

.needs-action-heading .card__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.needs-action-title-badge {
  min-width: 24px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #FCEBEB;
  color: #A32D2D;
  font-size: 12px;
  font-weight: 950;
}

.needs-action-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.needs-action-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.needs-action-filter select {
  min-height: 36px;
  padding: 6px 34px 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.needs-action-refresh {
  flex: 0 0 40px;
}

.needs-action-severity {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.needs-action-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 14px;
}

.needs-action-tab {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  transition: 140ms ease;
}

.needs-action-tab:hover {
  border-color: rgba(30, 90, 138, 0.32);
  background: #f8fafc;
}

.needs-action-tab.is-active {
  border-color: rgba(30, 90, 138, 0.34);
  background: var(--primary-50);
  color: var(--clinical-800);
}

.needs-action-tab.is-empty {
  opacity: 0.45;
}

.needs-action-tab svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.needs-action-tab b {
  min-width: 22px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
}

.needs-action-tab.is-active b {
  background: var(--primary);
  color: #fff;
}

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

.needs-action-item {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 84px;
  padding: 10px 12px 10px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.needs-action-item__bar {
  align-self: stretch;
  border-radius: var(--radius-sm);
  background: #64748b;
}

.needs-action-item.is-critical .needs-action-item__bar {
  background: #b42318;
}

.needs-action-item.is-high .needs-action-item__bar {
  background: #c2410c;
}

.needs-action-item.is-medium .needs-action-item__bar {
  background: #ca8a04;
}

.needs-action-item.is-low .needs-action-item__bar {
  background: var(--primary);
}

.needs-action-item__main {
  min-width: 0;
}

.needs-action-item__top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.needs-action-badge,
.needs-action-category {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.needs-action-badge {
  text-transform: uppercase;
}

.needs-action-badge.is-critical {
  min-height: 0;
  padding: 2px 7px;
  border-radius: 4px;
  background: #FCEBEB;
  color: #A32D2D;
  font-size: 11px;
  text-transform: none;
}

.needs-action-badge.is-high {
  background: #fff7ed;
  color: #9a3412;
}

.needs-action-badge.is-medium {
  background: #fefce8;
  color: #854d0e;
}

.needs-action-badge.is-low {
  background: var(--primary-50);
  color: var(--clinical-800);
}

.needs-action-category {
  min-height: 0;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--color-background-secondary);
  color: var(--color-text-tertiary);
  font-size: 11px;
}

.needs-action-item h3 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.needs-action-item p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.needs-action-item__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.needs-action-item__meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.needs-action-item__meta svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  color: #64748b;
}

.needs-action-item__meta .ti {
  width: 13px;
  flex: 0 0 13px;
  color: #64748b;
  font-size: var(--page-subtitle-size);
  line-height: var(--page-subtitle-line-height);
  line-height: 1;
}

.needs-action-open {
  min-height: 36px;
  padding: 8px 11px;
}

.needs-action-state {
  padding: 24px 16px;
  border: 0;
  border-radius: var(--radius);
  background: #f8fafc;
  text-align: center;
}

.needs-action-state h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 950;
}

.needs-action-state p {
  max-width: 420px;
  margin: 6px auto 14px;
  color: var(--muted);
  font-size: 13px;
}

.needs-action-state--error {
  border-color: rgba(180, 35, 24, 0.25);
  background: rgba(180, 35, 24, 0.04);
}

.needs-action-state--error .empty-icon {
  color: var(--bad);
  background: rgba(180, 35, 24, 0.08);
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.workflow-grid.is-full-width {
  grid-template-columns: minmax(0, 1fr);
}

.workflow-grid.is-full-width .side-column {
  display: none;
}

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

.side-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 90px;
}

.flow-card {
  overflow: hidden;
}

.dashboard-start-card.flow-card {
  overflow: visible;
}

.flow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.stepper {
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  background: transparent;
  position: relative;
}

.stepper::before {
  content: "";
  position: absolute;
  left: calc(16.666% + 14px);
  right: calc(16.666% + 14px);
  top: 13px;
  height: 1px;
  background: #e6edf5;
  pointer-events: none;
}

.step {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  min-width: 0;
  z-index: 1;
}

.step::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: min(210px, 84%);
  height: 30px;
  background: #fffefe;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: -1;
}

.step > div {
  min-width: 116px;
}

.step span {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d7e0ea;
  font-weight: 850;
  color: #64748b;
  font-size: 12px;
  z-index: 1;
}

.step span svg {
  width: 14px;
  height: 14px;
}

.step.is-active {
  background: transparent;
  box-shadow: none;
}

.step.is-active span {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 8px rgba(30, 90, 138, 0.14);
}

.step.is-complete {
  background: transparent;
}

.step.is-complete span {
  background: var(--success);
  border-color: var(--success-border);
  color: #fff;
}

.step.is-complete strong {
  color: var(--success);
}

.step.is-upcoming {
  background: transparent;
}

.step.is-upcoming span {
  background: #f8fafc;
  color: #94a3b8;
}

.step.is-upcoming strong,
.step.is-upcoming small {
  color: #94a3b8;
}

.step strong {
  display: block;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step.is-active strong {
  color: #0f172a;
  font-weight: 850;
}

.step small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-workspace {
  padding: 44px 24px;
  text-align: center;
}

.empty-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: var(--radius);
  background: var(--primary-50);
  color: var(--primary);
}

.empty-icon svg {
  width: 26px;
  height: 26px;
}

.today-patients-card {
  padding: 0;
}

.today-patients-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.today-patients-head .card__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
  font-size: 15px;
  font-weight: 800;
}

.today-patients-count {
  min-width: 22px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #eaf4fb;
  color: var(--primary);
  padding: 0 7px;
  font-size: 11px;
  font-weight: 850;
}

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

.today-patient-list-head {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(130px, 0.7fr) minmax(130px, 0.7fr) minmax(150px, 0.7fr);
  gap: 12px;
  padding: 0 12px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.today-patient-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(130px, 0.7fr) minmax(130px, 0.7fr) minmax(150px, 0.7fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: 140ms ease;
}

.today-patient-row:hover {
  border-color: rgba(30, 90, 138, 0.28);
  box-shadow: var(--shadow-sm);
}

.today-patient-avatar {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  font-size: 13px;
}

.today-patient-main {
  min-width: 0;
}

.today-patient-main strong,
.today-patient-main span,
.today-patient-meta,
.today-patient-time {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-patient-main strong {
  font-size: 14px;
  font-weight: 950;
}

.today-patient-main span,
.today-patient-meta,
.today-patient-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.today-patient-action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.today-patient-action svg,
.today-patient-row svg {
  width: 18px;
  height: 18px;
  color: currentColor;
}

.today-patients-empty {
  padding: 36px 24px;
  border: 1px solid #dce6ef;
  border-radius: 16px;
  background: #f8fbfd;
  text-align: center;
}

.today-patients-empty .empty-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: #eaf4fb;
}

.today-patients-empty .empty-icon svg {
  width: 20px;
  height: 20px;
}

.today-patients-empty h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.today-patients-empty p {
  max-width: 420px;
  margin: 7px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.today-patients-empty__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.today-patients-empty--error {
  border-color: rgba(180, 35, 24, 0.25);
  background: rgba(180, 35, 24, 0.04);
}

.today-patients-empty--error .empty-icon {
  color: var(--bad);
  background: rgba(180, 35, 24, 0.08);
}

.today-patients-empty--transferred {
  border-color: rgba(30, 90, 138, 0.22);
  background: #f8fbff;
}

.today-patients-empty--transferred .empty-icon {
  color: #174ea6;
  background: #e8f0fe;
}

.patient-card {
  overflow: hidden;
  padding: 0;
}

.patient-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.patient-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.patient-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.patient-avatar.today-patient-avatar {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  font-size: 13px;
}

.patient-title {
  margin: 0;
  font-size: 19px;
  font-weight: 950;
  letter-spacing: 0;
}

.patient-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.patient-family-number {
  margin: 4px 0 0;
  color: var(--success);
  font-size: 12px;
  font-weight: 850;
}

.patient-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 850;
  border: 1px solid var(--border);
  background: #fff;
  color: #334155;
}

.tag--red {
  color: var(--clinical-800);
  border-color: rgba(30, 90, 138, 0.18);
  background: var(--primary-50);
}

.tag--green {
  color: var(--success);
  border-color: var(--success-border);
  background: var(--success-soft);
}

.patient-card__body {
  padding: 22px;
}

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

.patient-actions > .btn {
  min-height: 36px;
  height: 36px;
  padding: 7px 12px;
  border-radius: var(--radius);
}

.patient-action-export {
  color: var(--text);
  border: 1px solid var(--border);
  background: transparent;
}

.patient-action-export:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-2);
}

.patient-action-export:disabled {
  cursor: wait;
  opacity: 0.7;
}

.patient-action-divider {
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: var(--border);
}

.patient-export-error {
  flex-basis: 100%;
  margin: 2px 0 0;
  color: var(--bad);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.patient-action-primary {
  color: #fff;
  border: 1px solid #1D3557;
  background: #1D3557;
  box-shadow: 0 1px 2px rgba(29, 53, 87, 0.16);
}

.patient-action-primary:hover {
  border-color: #162a45;
  background: #162a45;
}

.patient-action-close {
  width: 36px;
  min-width: 36px;
  padding: 7px;
  color: var(--text);
  border: 1px solid var(--border);
  background: transparent;
}

.patient-action-close:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-2);
}

.patient-export-modal__card {
  width: min(520px, calc(100vw - 28px));
}

.patient-export-modal__message {
  margin: 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.6;
}

.patient-export-modules {
  min-width: 0;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.patient-export-modules legend {
  margin-bottom: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

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

.patient-export-module-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.patient-export-module-option:has(input:checked) {
  border-color: #8fb0cf;
  background: #eef5fb;
  color: var(--primary);
}

.patient-export-module-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.patient-export-modules__state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
}

.patient-export-modules__state svg {
  width: 16px;
  height: 16px;
}

.patient-export-password-field {
  margin-top: 16px;
}

.patient-export-password-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.patient-export-password-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  outline: none;
}

.patient-export-password-field input:focus {
  border-color: #8fb0cf;
  box-shadow: 0 0 0 3px rgba(29, 53, 87, .08);
}

.patient-export-modal__error {
  margin: 12px 0 0;
  padding: 9px 11px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: #fff1f2;
  color: #be123c;
  font-size: 12px;
  font-weight: 750;
}

@media (max-width: 560px) {
  .patient-export-modules__list {
    grid-template-columns: 1fr;
  }
}

.patient-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.patient-detail-group {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: #fff;
}

.patient-detail-group h4 {
  margin: 0 0 13px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

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

.checkup-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.general-checkup-topbar {
  min-height: var(--page-header-min-height);
  padding: 0 var(--page-header-padding-x);
  gap: 18px;
}

.general-checkup-topbar__left {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.general-checkup-topbar__title {
  min-width: 0;
}

.general-checkup-topbar .page-title {
  margin: 0;
  font-size: var(--page-title-size);
  line-height: var(--page-title-line-height);
  font-weight: var(--page-title-weight);
}

.general-checkup-topbar__back {
  flex: 0 0 auto;
}

.general-checkup-topbar + .content {
  padding-top: 24px;
}

.checkup-history-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.general-checkup-page .patient-card__head {
  align-items: center;
  padding: 26px 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom-color: #e2e8f0;
}

.general-checkup-page .patient-avatar {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
  font-size: 20px;
  box-shadow: 0 8px 18px rgba(30, 90, 138, 0.14);
}

.general-checkup-page .patient-title {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 950;
}

.general-checkup-page .patient-subtitle {
  margin-top: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.checkup-history-item[open] {
  border-color: #dbe4ee;
  box-shadow: var(--shadow-sm);
}

.checkup-history-summary {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px 16px;
  cursor: pointer;
  list-style: none;
}

.checkup-history-summary::-webkit-details-marker {
  display: none;
}

.checkup-history-summary:hover {
  background: var(--surface-2);
}

.checkup-history-date,
.checkup-history-main {
  display: flex;
  min-width: 0;
}

.checkup-history-date {
  align-items: center;
  gap: 8px;
  color: var(--primary-700);
  font-size: 13px;
  font-weight: 850;
}

.checkup-history-date svg,
.checkup-history-chevron {
  width: 17px;
  height: 17px;
}

.checkup-history-main {
  flex-direction: column;
}

.checkup-history-main strong {
  font-size: 14px;
}

.checkup-history-main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkup-history-chevron {
  color: var(--muted);
  transition: transform 150ms ease;
}

.checkup-history-item[open] .checkup-history-chevron {
  transform: rotate(180deg);
}

.checkup-history-details {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-top: 1px solid var(--border);
  background: #fbfdff;
}

.general-checkup-page .checkup-history-details {
  border-top-color: #e2e8f0;
}

.checkup-record-columns {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.05fr) minmax(220px, 1fr);
  gap: 28px;
  align-items: start;
}

.checkup-detail-section h4 {
  margin: 0 0 9px;
  font-size: 13px;
}

.general-checkup-page .checkup-detail-section h4 {
  margin-bottom: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
  font-size: 13px;
  font-weight: 850;
}

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

.checkup-detail-grid--vitals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.checkup-detail {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.checkup-detail span,
.checkup-detail strong {
  display: block;
}

.checkup-detail span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.checkup-detail strong {
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.checkup-readonly-grid {
  display: grid;
  gap: 13px;
}

.checkup-readonly-item {
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.75);
}

.checkup-readonly-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.checkup-readonly-label,
.checkup-readonly-value {
  display: block;
}

.checkup-readonly-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}

.checkup-readonly-value {
  margin-top: 4px;
  color: #0f172a;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.4;
}

.checkup-readonly-item--wide .checkup-readonly-value {
  font-weight: 750;
  line-height: 1.5;
}

.checkup-medicine-history-list {
  display: grid;
  gap: 8px;
  margin-top: 7px;
}

.checkup-medicine-history-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 9px;
  border: 1px solid #dbe7f0;
  border-radius: var(--radius-sm);
  background: #fff;
}

.checkup-medicine-history-number {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.checkup-medicine-history-row strong {
  color: #0f172a;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.checkup-vital-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.checkup-vital-metric {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: baseline;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.75);
  border-radius: 0;
  background: transparent;
}

.checkup-vital-metric:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.checkup-vital-metric span,
.checkup-vital-metric strong {
  display: block;
}

.checkup-vital-metric span {
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.checkup-vital-metric strong {
  margin-top: 0;
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  text-align: right;
}

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

.recorded-condition-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.recorded-condition-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: var(--primary);
}

.detail-item {
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.detail-label {
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  margin-top: 7px;
  font-size: 13px;
  font-weight: 850;
  min-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0f172a;
}

.patient-detail-group .detail-item {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.patient-detail-group .detail-item--wide {
  grid-column: 1 / -1;
}

.patient-detail-group .detail-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  text-transform: none;
  letter-spacing: 0;
}

.patient-detail-group .detail-value {
  margin-top: 4px;
  min-height: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .patient-details,
  .patient-detail-fields {
    grid-template-columns: 1fr;
  }
}

.service-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

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

.service-card {
  display: flex;
  gap: 13px;
  justify-content: space-between;
  align-items: center;
  min-height: 122px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  transition: 140ms ease;
}

.service-card.is-eligible {
  cursor: pointer;
}

.service-card.is-eligible:hover {
  border-color: rgba(30, 90, 138, 0.28);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.service-card.is-eligible:focus-visible {
  outline: 3px solid rgba(30, 90, 138, 0.22);
  outline-offset: 2px;
  border-color: rgba(30, 90, 138, 0.42);
}

.service-card.is-disabled {
  background: #f8fafc;
  border-style: dashed;
  opacity: 1;
  color: #64748b;
}

.service-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.service-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--primary);
  background: var(--primary-50);
  border: 1px solid rgba(30, 90, 138, 0.14);
}

.service-icon svg {
  width: 20px;
  height: 20px;
}

.service-card.is-disabled .service-icon {
  background: #eef2f7;
  color: #64748b;
  border-color: var(--border);
}

.service-card.is-disabled .service-title,
.service-card.is-disabled .service-desc {
  color: #64748b;
}

.service-title {
  margin: 0;
  font-size: 14px;
  font-weight: 950;
}

.service-desc {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.service-disabled-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  margin-top: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.service-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.service-history-slot {
  display: contents;
}

.service-history-action {
  min-height: 40px;
}

.rule-applied {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border-radius: var(--radius);
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.rule-applied svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex: 0 0 16px;
  margin-top: 1px;
}

.worker-module-card {
  padding: 22px;
}

.worker-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.worker-module-form {
  display: grid;
  grid-template-columns: 1.3fr minmax(130px, 0.6fr) minmax(170px, 0.8fr) minmax(170px, 0.8fr);
  gap: 12px;
  align-items: start;
}

.immunization-vaccine-picker {
  min-width: 0;
}

.immunization-vaccine-select {
  min-height: 46px;
  padding: 11px 38px 11px 13px;
  border-radius: var(--radius);
  line-height: 1.35;
  background-color: #fff;
}

.immunization-vaccine-select optgroup {
  color: #334155;
  font-weight: 950;
}

.immunization-vaccine-select option {
  color: #0f172a;
  padding: 8px 10px;
  line-height: 1.45;
}

.worker-checkup-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkup-book-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.checkup-book-progress span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.checkup-book-progress b {
  width: 22px;
  height: 22px;
  display: inline-grid;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--primary-700);
  font-size: 11px;
}

.checkup-book-progress em {
  min-width: 0;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkup-book-progress span.is-active {
  border-color: rgba(30, 90, 138, 0.35);
  background: var(--primary-50);
  color: var(--primary-700);
}

.checkup-book-progress span.is-active b,
.checkup-book-progress span.is-complete b {
  background: var(--primary);
  color: #fff;
}

.checkup-book-progress span.is-complete {
  color: var(--primary-700);
}

.worker-checkup-span {
  grid-column: span 2;
}

.worker-checkup-half {
  grid-column: span 2;
}

.worker-checkup-section {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-height: 22px;
  margin-top: 10px;
  color: var(--primary-700);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.worker-checkup-section::after {
  content: none;
}

.worker-checkup-panel {
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.checkup-book-page {
  min-height: 0;
}

.checkup-book-page[hidden] {
  display: none;
}

.worker-checkup-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.worker-checkup-panel__head span {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--primary-50);
  color: var(--primary-700);
  font-size: 12px;
  font-weight: 950;
}

.worker-checkup-panel__head h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
}

.worker-checkup-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.checkup-book-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 -16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(8px);
}

.checkup-book-actions .worker-module-status {
  margin-right: auto;
}

.worker-checkup-vitals {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.worker-checkup-vitals__bp {
  grid-column: span 1;
}

.worker-checkup-form .fieldline {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  gap: 5px;
}

.worker-checkup-form .fieldline > span:first-child {
  color: #475569;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.worker-checkup-form .fieldline > input,
.worker-checkup-form .fieldline > select {
  height: 40px;
}

.worker-checkup-form .fieldline > input,
.worker-checkup-form .fieldline > select,
.worker-checkup-form .fieldline > textarea,
.worker-checkup-form .medicine-row select,
.worker-checkup-form .referral-destination-field select,
.worker-checkup-form .referral-notes-field textarea {
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.worker-checkup-form .fieldline > input:focus,
.worker-checkup-form .fieldline > select:focus,
.worker-checkup-form .fieldline > textarea:focus,
.worker-checkup-form .medicine-row select:focus,
.worker-checkup-form .referral-destination-field select:focus,
.worker-checkup-form .referral-notes-field textarea:focus {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(30, 90, 138, 0.45), 0 0 0 3px rgba(30, 90, 138, 0.1);
}

.condition-tags-field {
  position: relative;
  grid-column: 1 / -1;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.condition-tags-hidden {
  display: none;
}

.condition-tags-input {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  position: relative;
  padding: 6px 36px 6px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  cursor: text;
}

.condition-tags-input:focus-within {
  background: #fff;
  border-color: rgba(30, 90, 138, 0.45);
  box-shadow: 0 0 0 3px rgba(30, 90, 138, 0.1);
}

.condition-tags-list {
  display: contents;
}

.fieldline .condition-tags-placeholder {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.fieldline .condition-tags-input input {
  flex: 1 1 150px;
  min-width: 110px;
  width: auto;
  min-height: 28px;
  border: 0;
  outline: 0;
  padding: 2px 4px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
}

.fieldline .condition-tags-input input:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.condition-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 5px 9px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-50);
  color: var(--primary-700);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.fieldline .condition-tag span {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.condition-tag svg {
  width: 13px;
  height: 13px;
}

.condition-tags-affordance {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--primary-700);
  cursor: pointer;
}

.condition-tags-affordance:hover {
  background: var(--primary-50);
}

.condition-tags-affordance svg {
  width: 15px;
  height: 15px;
}

.condition-tags-menu {
  position: absolute;
  z-index: 15;
  top: calc(100% + 5px);
  left: 0;
  width: min(420px, 100%);
  max-height: 210px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow);
}

.condition-tags-menu button,
.condition-tags-menu span {
  width: 100%;
  display: block;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 13px;
  font-weight: 800;
}

.fieldline .condition-tags-menu span {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.condition-tags-menu button {
  cursor: pointer;
}

.condition-tags-menu button:hover {
  background: var(--surface-2);
}

.medicine-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.medicine-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 156px 34px;
  gap: 10px;
  align-items: end;
}

.medicine-row.is-empty {
  grid-template-columns: minmax(220px, 1fr) 34px;
}

.medicine-row.is-empty:not(.is-removable) {
  grid-template-columns: 1fr;
}

.medicine-row.is-empty .checkupMedicineSelect {
  grid-column: 1;
}

.medicine-row select,
.medicine-qty-field input {
  height: 40px;
}

.worker-checkup-form .medicine-row select {
  min-height: 48px;
  height: 48px;
  padding: 10px 38px 10px 14px;
  line-height: 1.35;
  font-size: 16px;
}

.medicine-qty-field {
  display: grid;
  gap: 5px;
}

.medicine-qty-field[hidden] {
  display: none;
}

.worker-checkup-form .medicine-qty-field span,
.worker-checkup-form .referral-destination-field span,
.worker-checkup-form .referral-notes-field span {
  display: block;
  margin: 0;
  color: #475569;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-transform: uppercase;
}

.worker-checkup-form .referral-destination-field--plain span {
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.medicine-qty-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.medicine-qty-field input {
  width: 100%;
  height: 46px;
  min-height: 46px;
  padding: 11px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.medicine-unit-label {
  min-width: 0;
  display: grid;
  place-items: center;
  border-left: 1px solid rgba(203, 213, 225, 0.85);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.worker-checkup-form .medicine-qty-control:focus-within {
  border-color: rgba(30, 90, 138, 0.45);
  box-shadow: inset 0 0 0 1px rgba(30, 90, 138, 0.45), 0 0 0 3px rgba(30, 90, 138, 0.1);
}

.worker-checkup-form .medicine-qty-control input:focus {
  box-shadow: none;
}

.medicine-qty-field input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.medicine-row-remove {
  width: 34px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.medicine-row-remove:hover {
  border-color: rgba(180, 35, 24, 0.32);
  background: #fef2f2;
  color: var(--bad);
}

.medicine-row-remove svg {
  width: 15px;
  height: 15px;
}

.medicine-batch-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 0;
}

.fieldline .medicine-meta-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  width: fit-content;
  min-height: 0;
  margin: 0;
  padding: 5px 10px;
  border: 0.5px solid;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.medicine-meta-chip svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.fieldline .medicine-meta-chip__label {
  display: inline;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.medicine-meta-chip__value {
  font-size: 12px;
  font-weight: 800;
}

.medicine-meta-chip--neutral {
  color: #334155;
  border-color: var(--color-border-tertiary);
  background: var(--color-background-secondary);
}

.medicine-meta-chip--neutral .medicine-meta-chip__label {
  color: #475569;
}

.medicine-meta-chip--neutral .medicine-meta-chip__value {
  color: var(--color-text-primary);
}

.medicine-meta-chip--neutral.is-out-of-stock .medicine-meta-chip__value {
  color: var(--color-text-danger);
}

.medicine-meta-chip--expiry.is-safe {
  color: var(--color-text-success);
  border-color: var(--color-border-success);
  background: var(--color-background-success);
}

.medicine-meta-chip--expiry.is-warning {
  color: var(--color-text-warning);
  border-color: var(--color-border-warning);
  background: var(--color-background-warning);
}

.medicine-meta-chip--expiry.is-expired {
  color: var(--color-text-danger);
  border-color: var(--color-border-danger);
  background: var(--color-background-danger);
}

.medicine-meta-chip--expiry .medicine-meta-chip__label,
.medicine-meta-chip--expiry .medicine-meta-chip__value {
  color: inherit;
}

.medicine-add-btn {
  width: fit-content;
  min-height: 34px;
  margin-top: 4px;
  padding: 7px 10px;
  font-size: 12px;
}

.worker-checkup-referral {
  display: grid !important;
  gap: 10px !important;
}

.referral-destination-field,
.referral-notes-field {
  display: grid;
  gap: 5px;
}

.referral-destination-field select {
  width: 100%;
  height: 40px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
}

.medicine-given-field,
.worker-checkup-referral,
.worker-checkup-notes {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.worker-checkup-notes textarea {
  min-height: 72px;
  resize: vertical;
}

.blood-pressure-input {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  color: var(--muted);
}

.blood-pressure-input input {
  min-width: 0;
  height: 40px;
  text-align: center;
  color: var(--text);
  font-weight: 400;
}

.blood-pressure-input input::placeholder {
  color: #94a3b8;
  font-weight: 400;
  opacity: 1;
}

.blood-pressure-input b {
  color: var(--muted);
  font-weight: 650;
}

.worker-checkup-form textarea {
  min-height: 88px;
  resize: vertical;
}

.field-note {
  display: block;
  margin-top: 6px;
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
}
.field-note--muted {
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
}

.field-note--info {
  color: var(--primary-700);
}

.worker-module-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 2px;
}

.worker-module-status {
  flex: 1;
  min-width: 180px;
  font-size: 13px;
  font-weight: 850;
}

.worker-module-status.is-success {
  color: var(--success);
}

.worker-module-status.is-error {
  color: var(--bad);
}

.service-record-toast {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  background: var(--success-soft);
}

.guide-card {
  padding: 20px;
}

.guide-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary-50);
  color: var(--primary);
  margin-bottom: 14px;
}

.rule-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.rule-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #475569;
  font-size: 13px;
  line-height: 1.35;
}

.rule-row svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
  flex: 0 0 17px;
  margin-top: 1px;
}

.selected-service {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-top: 10px;
}

.selected-service .service-icon {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.selected-service strong {
  display: block;
  font-size: 14px;
}

.selected-service span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

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

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.list-item:hover {
  background: #f8fafc;
}

.list-item__main {
  min-width: 0;
  flex: 1;
}

.list-item__title {
  margin: 0;
  font-weight: 900;
  font-size: 14px;
}

.list-item__sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.list-item__right {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-only {
  display: none;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 40;
  display: none;
}

.backdrop.is-show,
.backdrop.show {
  display: block;
}

.notif-menu {
  position: absolute;
  top: 64px;
  right: 18px;
  width: min(420px, calc(100vw - 28px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
  z-index: 1001;
  overflow: hidden;
}

.notif-menu.is-open {
  display: block;
}

.notif-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.notif-title {
  font-weight: 950;
  color: #0f172a;
}

.notif-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.notif-list {
  max-height: 340px;
  overflow: auto;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  cursor: pointer;
}

.notif-item:hover {
  background: #f8fafc;
}

.notif-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 6px;
  background: #3b82f6;
  flex: 0 0 10px;
}

.notif-item.is-read .notif-dot {
  background: rgba(15, 23, 42, 0.18);
}

.notif-main {
  min-width: 0;
}

.notif-text {
  font-weight: 750;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.2;
}

.notif-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.notif-footer {
  padding: 12px 14px;
}

#notifBtn {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #ffffff;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
}

.modal.is-open {
  display: block;
}

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

.modal__card {
  position: relative;
  margin: 7vh auto 0;
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.patient-modal__card[data-mode="general-checkup"] {
  width: min(820px, calc(100vw - 28px));
  margin-top: 4vh;
}

.patient-modal__card[data-mode="general-checkup"] .modal__body {
  padding: 14px 16px 0;
  background: var(--surface-2);
}

.patient-modal__card[data-mode="general-checkup"] .patient-modal__modules {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.patient-modal__card[data-mode="general-checkup"] .condition-tags-menu {
  position: static;
  width: 100%;
  max-height: 180px;
  margin-top: 6px;
  box-shadow: none;
}

.patient-modal__card[data-mode="general-checkup"] .checkup-fixed-date {
  cursor: default;
  color: #334155;
  background: var(--surface-2);
}

.modal__head,
.modal__foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 16px;
}

.modal__head {
  border-bottom: 1px solid var(--border);
}

.modal__foot {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 950;
}

.modal__subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.modal__body {
  padding: 16px;
}

.fieldline {
  display: block;
}

.fieldline span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.fieldline input,
.fieldline select,
.fieldline textarea {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  outline: none;
}

.checkbox-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.checkbox-field:hover {
  border-color: rgba(30, 90, 138, 0.3);
  background: #f8fafc;
}

.checkbox-field input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-field span {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 850;
}

.fieldline input:focus,
.fieldline select:focus,
.fieldline textarea:focus {
  border-color: rgba(30, 90, 138, 0.45);
  box-shadow: 0 0 0 3px var(--focus);
}

.patient-modal__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.patient-modal__span {
  grid-column: 1 / -1;
}

.fieldline--block {
  display: grid;
  gap: 8px;
}

.address-structure {
  display: grid;
  gap: 12px;
}

.address-structure__locked {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.address-structure__inside,
.address-structure__outside {
  display: grid;
  gap: 12px;
}

.address-structure__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.address-locked-input {
  background: var(--surface-2) !important;
  color: var(--muted) !important;
  cursor: default;
}

.address-structure__hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.family-link-field {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.family-link-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.family-link-heading > div {
  display: grid;
  gap: 2px;
}

.family-link-label {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.family-link-heading small,
.family-link-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.family-link-combobox {
  display: grid;
}

.family-link-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.family-link-search-wrap:focus-within {
  border-color: #7aa8c8;
  box-shadow: none;
}

.family-link-combobox.is-open .family-link-search-wrap {
  border-radius: 6px 6px 0 0;
}

.family-link-search-wrap svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #64748b;
}

.family-link-search-wrap input {
  width: 100%;
  min-height: 24px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none !important;
}

.family-link-search-wrap input::-webkit-search-cancel-button {
  display: none;
}

.family-link-search-clear {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.family-link-search-clear svg {
  width: 15px;
  height: 15px;
}

.family-link-suggestions {
  max-height: 230px;
  overflow-y: auto;
  margin-top: -1px;
  padding: 0;
  border: 1px solid var(--border);
  border-top-width: 0.5px;
  border-radius: 0 0 6px 6px;
  background: #fff;
  box-shadow: none;
}

.family-link-suggestion {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.family-link-suggestion:hover,
.family-link-suggestion:focus-visible {
  background: var(--surface-2);
}

.family-link-suggestion:last-child {
  border-bottom: 0;
}

.family-link-suggestion__left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
}

.family-link-suggestion__icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  border: 0;
  border-radius: 50%;
  background: var(--info-soft);
  color: var(--primary);
}

.family-link-suggestion__icon svg {
  width: 15px;
  height: 15px;
}

.family-link-suggestion__body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.family-link-suggestion__title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.family-link-suggestion__title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-link-suggestion__title strong {
  color: #172033;
  font-size: 13px;
  font-weight: 750;
}

.family-link-number-badge {
  flex: 0 0 auto;
  margin: 0;
  padding: 1px 7px;
  border: 0.5px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.family-link-suggestion__meta {
  margin: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-link-suggestion__chevron {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: #94a3b8;
}

.family-link-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  text-align: left;
}

.family-link-selected {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid var(--success-border);
  border-radius: var(--radius);
  background: var(--success-soft);
}

.family-link-selected > svg {
  width: 18px;
  height: 18px;
  color: var(--success);
}

.family-link-selected > div {
  display: grid;
  gap: 4px;
}

.family-link-selected__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.family-link-selected__title strong {
  min-width: 0;
  overflow: hidden;
  color: #14532d;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-link-selected span {
  margin: 0;
  color: #3f5f4c;
  font-size: 11px;
  font-weight: 700;
}

.family-link-selected .family-link-number-badge {
  margin: 0;
  color: #315d7d;
  font-size: 9px;
  font-weight: 900;
}

.family-link-selected button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #3f5f4c;
  cursor: pointer;
}

.family-link-selected button:hover {
  background: rgba(22, 101, 52, 0.1);
}

.family-link-selected button svg {
  width: 15px;
  height: 15px;
}

.family-link-hint {
  margin: 0;
  line-height: 1.35;
}

.address-structure [hidden] {
  display: none !important;
}

.patient-modal__scope {
  margin-top: var(--space-3);
  padding: 10px 12px;
  border: 1px solid rgba(30, 90, 138, 0.18);
  border-radius: var(--radius);
  background: var(--primary-50);
  color: var(--clinical-800);
  font-size: 13px;
  font-weight: 650;
}

.patient-modal__error {
  margin-top: var(--space-3);
  padding: 10px 12px;
  border: 1px solid rgba(180, 35, 24, 0.25);
  border-radius: var(--radius);
  background: rgba(180, 35, 24, 0.06);
  color: var(--bad);
  font-size: 13px;
  font-weight: 800;
}

.duplicate-patient-dialog {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.52);
}

.duplicate-patient-card {
  width: min(560px, 100%);
  max-height: min(620px, calc(100vh - 96px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.duplicate-patient-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.duplicate-patient-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
  font-weight: 950;
}

.duplicate-patient-head p {
  margin: 6px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.duplicate-patient-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px 16px;
  list-style: none;
}

.duplicate-patient-item {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
  padding: 10px 12px;
  border: 1px solid #d7e2ee;
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.duplicate-patient-item strong {
  grid-column: 1 / -1;
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
}

.duplicate-patient-item span {
  min-width: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.duplicate-patient-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.patient-modal__modules {
  display: grid;
  gap: 14px;
}

.patient-modal__saved {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.patient-modal__saved h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 950;
}

.patient-modal__saved p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.patient-modal__card[data-mode="family-planning"] .patient-modal__saved h3 {
  font-weight: 750;
}

.patient-modal__card[data-mode="family-planning"] .patient-modal__saved p {
  font-weight: 600;
}

.patient-modal__card[data-mode="family-planning"] .checkbox-field span,
.patient-modal__card[data-mode="family-planning"] .family-choice span,
.patient-modal__card[data-mode="family-planning"] .family-step-heading {
  font-weight: 850 !important;
}

.patient-modal__card[data-mode="family-planning"] .checkbox-field {
  font-weight: 500 !important;
}

.patient-modal__avatar {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  font-size: 13px;
}

.patient-modal__rule {
  margin-top: 0;
}

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

@media (max-width: 900px) {
  .address-structure__locked,
  .address-structure__row {
    grid-template-columns: 1fr;
  }
}

.module-choice {
  min-height: 112px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: 140ms ease;
}

.module-choice.is-eligible:hover {
  border-color: rgba(30, 90, 138, 0.28);
  box-shadow: var(--shadow-sm);
}

.module-choice.is-disabled {
  cursor: not-allowed;
  border-style: dashed;
  background: #f8fafc;
  opacity: 0.72;
}

.module-choice__icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(30, 90, 138, 0.14);
  border-radius: var(--radius-sm);
  background: var(--primary-50);
  color: var(--primary);
}

.module-choice.is-disabled .module-choice__icon {
  background: #eef2f7;
  border-color: var(--border);
  color: #64748b;
}

.module-choice__icon svg {
  width: 18px;
  height: 18px;
}

.module-choice__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.module-choice__body strong {
  font-size: 13px;
  font-weight: 950;
}

.module-choice__body span,
.module-choice__body em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.module-choice__body em {
  color: var(--primary);
  font-style: normal;
  font-weight: 850;
}

.module-choice.is-disabled .module-choice__body em {
  color: #64748b;
}

.mother-entry-grid .module-choice {
  min-height: 92px;
}

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

.mother-form-grid textarea {
  resize: vertical;
}

.mother-readonly-value {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 900;
}

.mother-modal-actions {
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.mother-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
}

.mother-progress span {
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--border);
  color: transparent;
}

.mother-progress span.is-active,
.mother-progress span.is-complete {
  background: var(--primary);
}

.family-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.family-progress span {
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--border);
  color: transparent;
}

.family-progress span.is-active,
.family-progress span.is-complete {
  background: var(--primary);
}

.family-modal-grid {
  row-gap: 12px;
}

.family-step-copy,
.family-step-heading {
  grid-column: 1 / -1;
}

.family-step-copy {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.family-step-heading {
  margin-top: 4px;
  color: var(--clinical-800);
  font-size: 13px;
  font-weight: 850;
}

/* Keep every table column label in readable sentence/title case. */
table th {
  text-transform: none !important;
}

.family-ob-aligned-checkbox {
  display: flex;
  align-items: flex-end;
}

.family-ob-aligned-checkbox .checkbox-field {
  box-sizing: border-box;
  width: 100%;
}

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

.family-check,
.family-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.family-check input,
.family-choice input {
  margin: 0;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

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

.family-choice--compact {
  min-height: 42px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.family-choice--compact span {
  line-height: 1.2;
}

.family-switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.family-switch-row {
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.family-switch-row.is-on {
  border-color: #fed7aa;
  background: #fff7ed;
}

.family-switch-row:has(.family-switch-control input:checked) {
  border-color: #fed7aa;
  background: #fff7ed;
}

.family-switch-label {
  color: #1e293b;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.28;
}

.family-switch-control {
  position: relative;
  width: 44px;
  height: 24px;
  flex: 0 0 44px;
}

.family-switch-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.family-switch-control span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .16s ease;
}

.family-switch-control span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .22);
  transition: transform .16s ease;
}

.family-switch-control input:checked + span {
  background: var(--primary);
}

.family-switch-control input:checked + span::after {
  transform: translateX(20px);
}

.family-pregnancy-gate {
  display: grid;
  gap: 10px;
}

.family-pregnancy-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 750;
}

.family-pregnancy-status.is-safe {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.family-pregnancy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.family-pregnancy-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: #1e293b;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.28;
}

.family-pregnancy-check.is-on {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.family-pregnancy-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 18px;
  accent-color: var(--primary);
}

.family-conditional-panel {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: #f8fafc;
}

.is-spinning {
  animation: spin 0.8s linear infinite;
}

.btn.is-saving {
  cursor: wait;
}

.btn.is-saving svg,
.btn.is-saving [data-feather] {
  animation: spin 0.8s linear infinite;
  transform-origin: center;
}

.icon-btn.is-spinning {
  animation: none;
}

.icon-btn.is-spinning svg,
.icon-btn.is-spinning [data-feather] {
  animation: spin 0.8s linear infinite;
  transform-origin: center;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

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

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

  .dashboard-stats-card .segmentation-totals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .side-column {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .segmentation-modules {
    grid-template-columns: 1fr;
  }

  .segmentation-module__states {
    grid-template-columns: 1fr;
  }

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

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

  .search {
    width: min(520px, 55vw);
  }

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

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

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

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

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

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

  .medicine-row {
    grid-template-columns: minmax(0, 1fr) 150px 34px;
  }

  .medicine-row.is-empty {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .medicine-row.is-empty:not(.is-removable) {
    grid-template-columns: 1fr;
  }

  .worker-checkup-vitals__bp {
    grid-column: span 2;
  }

  .worker-checkup-span {
    grid-column: span 2;
  }

  .worker-checkup-half {
    grid-column: span 1;
  }
}

@media (max-width: 780px) {
  .general-checkup-topbar {
    min-height: auto;
    padding: 12px 16px;
  }

  .general-checkup-topbar .page-title {
    font-size: 22px;
  }

  .checkup-history-summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .checkup-history-date {
    grid-column: 1 / -1;
  }

  .checkup-detail-grid,
  .checkup-detail-grid--vitals {
    grid-template-columns: 1fr;
  }

  .checkup-record-columns {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .checkup-vital-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-105%);
    transition: 180ms ease;
    z-index: 50;
  }

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

  .mobile-only {
    display: inline-grid;
  }

  .content {
    padding: var(--space-4);
  }

  .topbar {
    padding: 0 var(--space-4);
  }

  .search {
    display: block;
    flex: 1;
    width: auto;
  }

  .hero__content {
    align-items: flex-start;
    flex-direction: column;
  }

  .side-column {
    grid-template-columns: 1fr;
  }

  .patient-modal__grid {
    grid-template-columns: 1fr;
  }

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

  .patient-modal__module-grid {
    grid-template-columns: 1fr;
  }

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

  .family-check-grid,
  .family-switch-grid,
  .family-pregnancy-grid,
  .family-progress {
    grid-template-columns: 1fr;
  }

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

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

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

  .worker-checkup-panel {
    padding: 14px;
  }

  .worker-checkup-panel__grid {
    grid-template-columns: 1fr;
  }

  .checkup-book-progress {
    grid-template-columns: 1fr;
  }

  .checkup-book-page {
    min-height: 0;
  }

  .worker-checkup-vitals {
    grid-template-columns: 1fr;
  }

  .medicine-row {
    grid-template-columns: minmax(0, 1fr) 146px 34px;
  }

  .worker-checkup-vitals__bp {
    grid-column: auto;
  }

  .worker-checkup-span {
    grid-column: auto;
  }

  .worker-checkup-half {
    grid-column: auto;
  }

  .worker-module-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .today-patient-list-head {
    display: none;
  }

  .today-patient-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .today-patient-meta,
  .today-patient-time {
    grid-column: 1;
  }

  .today-patient-action {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
  }

  .segmentation-chart__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-stats-card .segmentation-totals {
    grid-template-columns: 1fr;
  }

  .segmentation-bar-row {
    grid-template-columns: minmax(92px, 128px) minmax(0, 1fr) 64px;
  }

  .needs-action-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .needs-action-item {
    grid-template-columns: 5px minmax(0, 1fr);
  }

  .needs-action-open {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .grid.cols-4,
  .kpi-grid,
  .stepper,
  .patient-details {
    grid-template-columns: 1fr;
  }

  .stepper::before {
    display: none;
  }

  .patient-card__head,
  .flow-header,
  .service-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .service-card {
    align-items: stretch;
    flex-direction: column;
  }

  .service-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .patient-identity {
    align-items: flex-start;
  }

  .needs-action-head,
  .segmentation-totals,
  .needs-action-severity {
    grid-template-columns: 1fr;
  }

  .visit-search-row {
    grid-template-columns: 1fr;
  }

  .visit-add-patient-btn {
    justify-content: center;
    width: 100%;
  }

  .segmentation-module__states {
    grid-template-columns: 1fr;
  }

  .segmentation-bar-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .segmentation-bar-row b {
    text-align: left;
  }

  .segmentation-bar-label {
    white-space: normal;
  }

  .needs-action-controls {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .needs-action-filter,
  .needs-action-filter select {
    width: 100%;
  }

  .needs-action-item h3,
  .needs-action-item p {
    white-space: normal;
  }
}

@media (max-width: 460px) {
  .medicine-row {
    grid-template-columns: minmax(0, 1fr) 146px;
  }

  .medicine-row:not(.is-empty) .checkupMedicineSelect {
    grid-column: 1 / -1;
  }

  .medicine-row:not(.is-empty) .medicine-qty-field {
    grid-column: 1;
  }

  .medicine-row.is-empty {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .medicine-row.is-empty:not(.is-removable) {
    grid-template-columns: 1fr;
  }

  .medicine-row-remove {
    grid-column: 2;
    justify-self: end;
  }

  .medicine-batch-chips {
    grid-column: 1 / -1;
  }
}
