:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #072635;
  --muted: #707070;
  --line: #edf1f5;
  --teal: #01f0d0;
  --teal-soft: #d8fcf7;
  --purple-soft: #f4f0fe;
  --blue-soft: #e0f3fa;
  --pink-soft: #ffe6ee;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(7, 38, 53, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

.header-bar {
  height: 72px;
  background: var(--card);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow);
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 28px;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 999px;
}

.nav a.active {
  background: var(--teal);
}

.doctor-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.doctor-profile img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.doctor-profile strong {
  display: block;
  font-size: 13px;
}

.doctor-profile small {
  color: var(--muted);
  font-size: 12px;
}

.main-section {
  display: grid;
  grid-template-columns: 360px minmax(500px, 1fr) 360px;
  gap: 28px;
  margin-top: 28px;
  align-items: start;
}

.main-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 22px;
}

.patients-card {
  padding: 24px 8px 24px 24px;
  height: calc(100vh - 130px);
  min-height: 720px;
  display: flex;
  flex-direction: column;
}

.patients-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 18px;
}

.search-icon {
  font-size: 22px;
  cursor: pointer;
}

.patient-list {
  overflow: auto;
  padding-right: 8px;
}

.patient-row {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 16px 12px;
  border-radius: 0;
  cursor: pointer;
  color: var(--ink);
}

.patient-row.active {
  background: var(--teal-soft);
}

.patient-row img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #f2f2f2;
}

.patient-row strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.patient-row small {
  color: var(--muted);
  font-size: 13px;
}

.patient-row .dots {
  margin-left: auto;
  font-weight: 900;
  font-size: 18px;
}

.main-stack,
.right-stack {
  display: grid;
  gap: 28px;
}

.diagnosis-history {
  padding: 24px;
}

.chart-panel {
  display: flex;
  gap: 24px;
  align-items: center;
  background: #f4f0fe;
  border-radius: 12px;
  padding: 27px;
  width: 100%;
}

.chart-panel > div:first-child {
  flex: 1;
  min-width: 0;
  position: relative;
  height: 250px;
}

.chart-panel > div:last-child {
  width: 160px;
  flex-shrink: 0;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* margin-bottom: 10px; */
  font-weight: 800;
}

.chart-head select {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
}

.bp-stat {
  padding: 4px 0 16px;
  border-bottom: 1px solid rgba(7, 38, 53, 0.12);
  margin-bottom: 14px;
}

.bp-stat:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.bp-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.pink {
  background: #e66fd2;
}
.dot.purple {
  background: #8c6fe6;
}

.bp-value {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}

.trend {
  font-size: 12px;
  color: var(--ink);
}

.vitals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.vital-card {
  min-height: 170px;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.vital-card.blue {
  background: #e0f3fa 0% 0% no-repeat padding-box;
}
.vital-card.pink {
  background: #ffe6e9 0% 0% no-repeat padding-box;
}
.vital-card.pinky {
  background: #ffd9e1 0% 0% no-repeat padding-box;
}

.vital-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  display: grid;
  place-items: center;
  font-size: 36px;
}

.vital-title {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 2px;
  padding-top: 10px;
}

.vital-value {
  font-size: 25px;
  line-height: 1;
  font-weight: 600;
  margin-bottom: 14px;
}

.vital-status {
  font-size: 10px;
  color: var(--ink);
}

.table-card {
  padding: 24px;
}

.table-div {
  max-height: 250px;
  overflow: auto;
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 14px;
}

thead th {
  background: #f6f7f8;
  text-align: left;
  padding: 16px;
  font-size: 13px;
}

thead th:first-child {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

thead th:last-child {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}

tbody td {
  padding: 17px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.profile-card {
  padding: 32px 28px;
  text-align: center;
}

.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 24px;
}

.profile-card h2 {
  font-size: 26px;
  margin-bottom: 24px;
}

.profile-info {
  display: grid;
  gap: 18px;
  text-align: left;
  margin-bottom: 28px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.info-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f6f7f8;
  font-size: 20px;
}

.info-row small {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

.info-row strong {
  font-size: 14px;
}

.btn {
  border: 0;
  background: var(--teal);
  padding: 16px 30px;
  border-radius: 999px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  min-width: 220px;
}

.lab-card {
  padding: 24px;
}

.lab-list {
  display: grid;
  gap: 2px;
}

.lab-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 4px;
  font-size: 14px;
}

.lab-item:nth-child(even) {
  background: #f6f7f8;
}

.download {
  font-size: 22px;
  text-decoration: none;
  color: var(--ink);
}

.loading,
.error {
  padding: 16px;
  background: #f6f7f8;
  border-radius: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

.error {
  color: #9f1239;
  background: #fff1f2;
}

@media (max-width: 1180px) {
  .main-section {
    grid-template-columns: 300px 1fr;
  }

  .right-stack {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .page {
    padding: 14px;
  }

  .header-bar {
    height: auto;
    border-radius: 24px;
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .main-section {
    grid-template-columns: 1fr;
  }

  .patients-card {
    height: auto;
    min-height: auto;
  }

  .patient-list {
    max-height: 420px;
  }

  .chart-panel {
    flex-direction: column;
  }

  .chart-panel > div:last-child {
    width: 100%;
  }

  .vitals-grid,
  .right-stack {
    grid-template-columns: 1fr;
  }

  .profile-photo {
    width: 140px;
    height: 140px;
  }
}
