:root {
  --bg: #f3efe7;
  --panel: rgba(255, 252, 246, 0.92);
  --panel-strong: #fffdf9;
  --ink: #1d2430;
  --muted: #6f7785;
  --line: rgba(29, 36, 48, 0.1);
  --brand: #0d8a72;
  --brand-deep: #0a5b4c;
  --accent: #f29a4a;
  --danger: #a63d40;
  --shadow: 0 20px 50px rgba(36, 43, 61, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(242, 154, 74, 0.22), transparent 30%),
    radial-gradient(circle at right, rgba(13, 138, 114, 0.16), transparent 28%),
    linear-gradient(180deg, #fbf8f1 0%, #efe6d7 100%);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
}

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

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.7);
  backdrop-filter: blur(20px);
}

.main {
  padding: 28px;
}

.brand {
  margin-bottom: 26px;
}

.brand__eyebrow,
.mono {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 12px;
}

.brand__title {
  margin: 10px 0 4px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand__subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.nav {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}

.nav button,
.ghost-button,
.action-button,
.tab-button,
.status-chip {
  border: 0;
}

.nav button {
  text-align: left;
  padding: 15px 16px;
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  transition: 180ms ease;
}

.nav button:hover,
.nav button.is-active {
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.nav__label {
  display: block;
  font-weight: 700;
}

.nav__detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-card,
.hero,
.panel,
.stat,
.login-card {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.sidebar-card {
  border-radius: var(--radius-lg);
  padding: 18px;
}

.sidebar-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.topbar__title h1,
.panel h2,
.panel h3,
.hero h2,
.login-card h1 {
  margin: 0;
  letter-spacing: -0.04em;
}

.topbar__title p,
.hero p,
.panel__header p,
.login-card p {
  color: var(--muted);
}

.topbar__actions,
.row-actions,
.form-actions,
.chips,
.tab-row,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-button,
.tab-button {
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.action-button {
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: white;
  font-weight: 700;
}

.hero {
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -70px -70px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 154, 74, 0.24), transparent 70%);
}

.hero__grid,
.grid-3,
.forms-grid,
.detail-grid,
.patient-layout,
.calendar-grid {
  display: grid;
  gap: 18px;
}

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

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

.patient-layout {
  grid-template-columns: 360px 1fr;
}

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

.stat {
  border-radius: var(--radius-lg);
  padding: 20px;
}

.stat__value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 10px 0 4px;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
}

.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.list,
.records,
.timeline {
  display: grid;
  gap: 12px;
}

.list-item,
.record-row,
.calendar-card,
.patient-card,
.timeline-event,
.detail-item,
.metric {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.list-item,
.record-row,
.patient-card,
.timeline-event,
.detail-item,
.metric {
  padding: 16px;
}

.calendar-card {
  min-height: 190px;
  padding: 14px;
}

.list-item__title,
.patient-card__title,
.record-row__title {
  font-weight: 700;
}

.list-item__meta,
.muted,
.record-row__meta,
.patient-card__meta {
  color: var(--muted);
  font-size: 14px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(13, 138, 114, 0.12);
  color: var(--brand-deep);
  font-weight: 700;
}

.status-chip.--warning {
  background: rgba(242, 154, 74, 0.18);
  color: #8f541c;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border-radius: 34px;
  overflow: hidden;
}

.login-card__visual {
  padding: 42px;
  background:
    radial-gradient(circle at top right, rgba(242, 154, 74, 0.3), transparent 30%),
    linear-gradient(160deg, #0d8a72 0%, #0f6c60 45%, #17324e 100%);
  color: white;
}

.login-card__visual ul {
  padding-left: 18px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
}

.login-card__form {
  padding: 42px;
  background: #fffdf8;
}

label {
  font-size: 14px;
  font-weight: 700;
}

.field-group {
  display: grid;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  background: white;
  color: var(--ink);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 20px;
}

.segment {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: white;
}

.segment.is-active {
  background: rgba(13, 138, 114, 0.1);
  border-color: rgba(13, 138, 114, 0.35);
}

.patient-card__header,
.calendar-card__day {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(13, 138, 114, 0.2), rgba(242, 154, 74, 0.18));
  font-weight: 800;
}

.detail-item strong,
.metric strong {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.tab-button.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: white;
}

.appointment {
  padding: 10px;
  border-radius: 14px;
  background: rgba(13, 138, 114, 0.1);
  margin-bottom: 10px;
  font-size: 13px;
}

.appointment.--video {
  background: rgba(242, 154, 74, 0.18);
}

.timeline-event {
  position: relative;
  padding-left: 18px;
}

.timeline-event::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

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

.empty-state {
  padding: 24px;
  border-radius: 18px;
  border: 1px dashed rgba(29, 36, 48, 0.2);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

@media (max-width: 1180px) {
  .shell,
  .patient-layout,
  .login-card,
  .hero__grid,
  .grid-3,
  .forms-grid,
  .detail-grid,
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .hero,
  .panel,
  .login-card__visual,
  .login-card__form {
    padding: 20px;
  }

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

.hm-screen {
  background: #f5f5f5;
  border: 1px solid #d7d7d7;
  border-radius: 18px;
  padding: 16px;
}

.hm-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 10px 12px 14px;
  border-bottom: 1px solid #d9d9d9;
}

.hm-topbar h3 {
  margin: 6px 0 4px;
  font-size: 34px;
  letter-spacing: -0.05em;
}

.hm-pill {
  border: 1px solid #d5d5d5;
  background: #fbfbfb;
  color: #4f4f4f;
  padding: 9px 14px;
  border-radius: 999px;
}

.hm-pill--danger {
  color: #8d6e6e;
}

.hm-track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 0;
  align-items: center;
}

.hm-track__step {
  position: relative;
  padding-top: 16px;
  text-align: center;
  color: #8a8a8a;
  font-size: 12px;
}

.hm-track__step span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin: 0 auto 6px;
  border-radius: 999px;
  background: #cfcfcf;
  color: #fff;
  font-size: 12px;
}

.hm-track__step.is-done span {
  background: #77b255;
}

.hm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.hm-trimester-bar {
  display: grid;
  grid-template-columns: 13fr 14fr 13fr;
  gap: 12px;
  align-items: end;
  padding: 2px 0 18px;
}

.hm-trimester {
  display: grid;
  gap: 4px;
  text-align: center;
  color: #6a6a6a;
}

.hm-trimester strong {
  font-size: 12px;
  font-weight: 700;
}

.hm-trimester small {
  font-size: 11px;
  color: #8b8b8b;
}

.hm-trimester__line {
  position: relative;
  display: block;
  height: 2px;
  background: #2f2f2f;
  margin-bottom: 2px;
}

.hm-trimester__line::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #2f2f2f;
}

.hm-form,
.hm-card,
.hm-accordion {
  background: #fafafa;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
}

.hm-form {
  padding: 14px;
}

.hm-card {
  padding: 12px;
  margin-top: 14px;
}

.hm-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.hm-field,
.hm-field-row,
.hm-grid {
  display: grid;
  gap: 8px;
}

.hm-field {
  margin-bottom: 10px;
}

.hm-field-row {
  grid-template-columns: 120px 1fr;
}

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

.hm-field label {
  font-size: 11px;
  font-weight: 800;
  color: #6b6b6b;
  text-transform: uppercase;
}

.hm-field input,
.hm-field select,
.hm-field textarea {
  border-radius: 6px;
  border: 1px solid #d6d6d6;
  background: #fff;
  padding: 9px 10px;
  color: #444;
  font-size: 13px;
}

.hm-accordions {
  display: grid;
  gap: 8px;
}

.hm-accordion__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7f7f7;
  color: #555;
  padding: 12px 14px;
  font-weight: 700;
  border-radius: 8px;
  border: 0;
}

.hm-accordion.is-open .hm-accordion__toggle {
  border-bottom: 1px solid #dedede;
  border-radius: 8px 8px 0 0;
}

.hm-accordion__content {
  padding: 12px 14px;
  color: #5c5c5c;
  font-size: 14px;
  line-height: 1.5;
}

.hm-mini-list {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 1180px) {
  .hm-layout,
  .hm-track,
  .hm-grid,
  .hm-field-row {
    grid-template-columns: 1fr;
  }
}

.app-frame {
  min-height: 100vh;
  background: #f5f5f5;
}

.app-header {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: #757575;
  color: #fff;
}

.app-header__brand {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.app-search {
  width: 310px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 34px;
  border-radius: 999px;
  background: #fff;
  color: #9d9d9d;
}

.app-search input {
  border: 0;
  padding: 0;
  background: transparent;
  color: #9d9d9d;
  font-size: 13px;
}

.app-header__spacer,
.app-rail__spacer {
  flex: 1;
}

.app-header__bell,
.app-header__user {
  background: transparent;
  border: 0;
  color: #fff;
}

.app-header__user {
  font-size: 13px;
}

.app-shell {
  display: grid;
  grid-template-columns: 84px 1fr;
  min-height: calc(100vh - 60px);
}

.app-rail {
  background: #757575;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 18px 0 14px;
}

.app-rail__button {
  width: 64px;
  min-height: 58px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding: 6px 4px;
}

.app-rail__button.is-active {
  background: rgba(255, 255, 255, 0.16);
}

.app-rail__icon {
  font-size: 20px;
}

.app-rail__label {
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  color: rgba(255, 255, 255, 0.95);
}

.app-main {
  padding: 22px 28px 28px;
  background: #fafafa;
}

.topbar__title h1,
.patient-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.panel,
.hero,
.stat,
.sidebar-card {
  background: #fff;
  border: 1px solid #e1e1e1;
  box-shadow: none;
}

.ghost-button,
.tab-button,
.hm-pill {
  background: #f6f6f6;
  border: 1px solid #dedede;
  color: #727272;
}

.action-button {
  background: #8e8e8e;
}

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

.patient-header__title p {
  margin: 6px 0 0;
  color: #555;
  font-size: 14px;
}

.patient-header__dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 10px;
  border-radius: 999px;
  background: #f6b0a5;
  vertical-align: middle;
}

.patient-header__tag {
  display: inline-grid;
  place-items: center;
  min-width: 14px;
  height: 14px;
  margin-left: 6px;
  padding: 0 2px;
  background: #8cc25a;
  color: #111;
  font-size: 11px;
  font-weight: 700;
}

.patient-page {
  background: #fff;
  border: 1px solid #dfdfdf;
}

.patient-header,
.patient-page,
.overview-screen,
.hm-screen {
  max-width: 1060px;
}

.patient-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid #e4e4e4;
  background: #f8f8f8;
}

.patient-tabs__button {
  border: 0;
  background: transparent;
  color: #8b8b8b;
  padding: 12px 18px;
  font-size: 12px;
}

.patient-tabs__button.is-active {
  background: #fff;
  color: #5e5e5e;
  border-bottom: 2px solid #cfcfcf;
}

.overview-screen {
  padding: 14px 18px 18px;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
  border-top: 1px solid #ececec;
  background: #fff;
}

.overview-grid > div {
  padding: 5px 10px;
  border-bottom: 1px solid #ececec;
  font-size: 12px;
  color: #7a7a7a;
}

.overview-grid__label {
  font-weight: 500;
}

.overview-grid__value {
  text-align: left;
  color: #606060;
}

.overview-timeline-toolbar {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.7fr;
  gap: 10px;
  margin-bottom: 14px;
}

.overview-input {
  height: 34px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #dcdcdc;
  color: #a0a0a0;
  font-size: 12px;
  padding: 0 12px;
}

.overview-input--search {
  border-radius: 999px;
}

.overview-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  margin-bottom: 12px;
}

.overview-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #545454;
}

.overview-filter__box {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid #bfbfbf;
  background: #fff;
  color: #737373;
  font-size: 11px;
}

.overview-year-row {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.overview-year {
  display: grid;
  gap: 6px;
}

.overview-year strong {
  font-size: 12px;
  color: #6b6b6b;
}

.overview-year span {
  display: block;
  height: 36px;
  background:
    linear-gradient(90deg, #9d9d9d 0 4%, transparent 4% 18%, #c4c4c4 18% 24%, transparent 24% 38%, #8c8c8c 38% 42%, transparent 42% 80%, #d3d3d3 80% 84%, transparent 84% 100%),
    linear-gradient(180deg, transparent 0 80%, #ccf08e 80% 100%);
  border-left: 1px solid #ececec;
  border-right: 1px solid #ececec;
}

.hm-screen {
  margin: 12px;
  background: #fff;
}

.hm-topbar__meta .muted {
  font-size: 12px;
}

.hm-form {
  min-height: 860px;
}

.hm-accordions {
  align-content: start;
}

.hm-topbar,
.hm-form,
.hm-card,
.hm-accordion {
  border-color: #e1e1e1;
  background: #fff;
}

.hm-section-title {
  color: #6e6e6e;
}

.hm-accordion__toggle {
  background: #fff;
  border-bottom: 1px solid #ececec;
  padding: 10px 14px;
  color: #8a8a8a;
  font-weight: 500;
}

.hm-accordion {
  border-radius: 4px;
  overflow: hidden;
}

.hm-accordion__content {
  padding: 12px 14px;
}

.overview-timeline-list {
  gap: 0;
}

.overview-entry {
  display: grid;
  grid-template-columns: 90px 18px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #f0f0f0;
}

.overview-entry__date {
  font-size: 12px;
  color: #4c4c4c;
}

.overview-entry__dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #d6d6d6;
}

.overview-entry__text {
  height: 12px;
  max-width: 320px;
  background: linear-gradient(90deg, #8d8d8d 0 38%, #dfdfdf 38% 100%);
  border-radius: 2px;
  color: transparent;
}

@media (max-width: 1180px) {
  .app-shell,
  .overview-grid,
  .overview-timeline-toolbar {
    grid-template-columns: 1fr;
  }

  .app-rail {
    flex-direction: row;
    justify-content: center;
    padding: 10px;
  }
}
