$surface: #ffffff;
$border: #e2e8f0;
$primary: #1b64f2;
$muted: #6b7280;
$text: #0f172a;

:host {
  display: block;
}

.ehr-section {
  margin: 1.5rem auto;
  max-width: 1400px;
  background: $surface;
  border-radius: 24px;
  padding: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);

  @media (max-width: 768px) {
    padding: 1.5rem;
  }
}

.section-header {
  margin-bottom: 1.5rem;

  h2 {
    margin: 0;
    color: $text;
  }

  p {
    margin: 0.25rem 0 0;
    color: $muted;
  }
}

.card {
  border: 1px solid $border;
  border-radius: 20px;
  padding: 1.5rem;
  background: linear-gradient(170deg, rgba(248, 250, 255, 0.7), #fff);
  margin-bottom: 1.25rem;

  h3 {
    margin: 0 0 1rem;
    color: $text;
  }
}

.vital-signs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.vital-item {
  border-radius: 16px;
  padding: 1rem;
  background: rgba(27, 100, 242, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;

  label {
    color: $muted;
    font-size: 0.9rem;
  }

  span {
    font-size: 1.2rem;
    font-weight: 700;
    color: $primary;
  }
}

.timestamp {
  margin-top: 0.75rem;
  color: $muted;
  font-size: 0.9rem;
}

.record-item,
.lab-item {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: #fff;
}

.record-header,
.lab-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: $muted;
  margin-bottom: 0.5rem;
}

.record-type {
  font-weight: 600;
  color: $primary;
}

.diagnosis-code {
  margin-top: 0.5rem;
  font-weight: 600;
  color: #b45309;
}

.lab-status {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;

  &.status-completed {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
  }
  &.status-pending {
    background: rgba(234, 179, 8, 0.15);
    color: #b45309;
  }
  &.status-flagged {
    background: rgba(248, 113, 113, 0.15);
    color: #dc2626;
  }
}

.lab-result {
  font-size: 1.2rem;
  font-weight: 700;
  color: $text;
}

.lab-reference {
  color: $muted;
  font-size: 0.9rem;
}

.empty-state {
  padding: 1rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.05);
  color: $muted;
  text-align: center;
}

