/* ================================================================
   ELGHIS · REDISEÑO DE MIS PACIENTES
   Capa aislada para el prototipo clínico.
   ================================================================ */

html.elghis-clinical-preview
#clinical-view
.clinical-content {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

html.elghis-clinical-preview
#clinical-view
.clinical-welcome {
  display: none;
}

html.elghis-clinical-preview
#clinical-view
.clinical-patients-section {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* Encabezado principal de pacientes */

html.elghis-clinical-preview
#clinical-view
.clinical-patients-heading {
  min-height: 190px;
  margin: 0 0 18px;
  padding: 28px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 0;
  border-radius: 25px;
  background:
    radial-gradient(
      circle at 91% 0,
      rgba(42, 170, 177, 0.29),
      transparent 23rem
    ),
    var(--ec-navy-800);
  color: #ffffff;
  box-shadow:
    0 18px 38px
    rgba(11, 58, 87, 0.19);
}

html.elghis-clinical-preview
#clinical-view
.clinical-patients-heading
.eyebrow {
  color: #a9ebea;
  font-size: 11px;
  letter-spacing: 0.14em;
}

html.elghis-clinical-preview
#clinical-patients-title {
  margin: 9px 0 7px;
  color: #ffffff;
  font-size: clamp(31px, 3vw, 43px);
  line-height: 1;
  letter-spacing: -0.045em;
}

html.elghis-clinical-preview
#clinical-view
.clinical-patients-heading p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  line-height: 1.55;
}

html.elghis-clinical-preview
#clinical-view
.clinical-patients-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

html.elghis-clinical-preview
#clinical-view
.clinical-patients-total {
  min-width: 98px;
  min-height: 70px;
  padding: 12px 18px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid
    rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  background:
    rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

html.elghis-clinical-preview
#clinical-view
.clinical-patients-total span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

html.elghis-clinical-preview
#clinical-view
.clinical-patients-total strong {
  margin-top: 3px;
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
}

html.elghis-clinical-preview
#open-clinical-patient-dialog-button {
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid #ffffff;
  border-radius: 14px;
  background: #effffc;
  color: var(--ec-text);
  font-weight: 800;
  box-shadow: none;
}

/* Listado */

html.elghis-clinical-preview
#clinical-patients-list {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(min(100%, 480px), 1fr)
    );
  gap: 16px;
}

html.elghis-clinical-preview
#clinical-patients-list > article {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--ec-border);
  border-radius: 21px;
  background: #ffffff;
  box-shadow: var(--ec-shadow-soft);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

html.elghis-clinical-preview
#clinical-patients-list > article:hover {
  transform: translateY(-3px);
  border-color: #bcd8de;
  box-shadow:
    0 18px 40px
    rgba(15, 62, 84, 0.11);
}

/* Encabezado de cada paciente */

html.elghis-clinical-preview
.clinical-patient-card-heading {
  padding-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom:
    1px solid var(--ec-border);
}

html.elghis-clinical-preview
.clinical-patient-card-heading > div:first-child,
html.elghis-clinical-preview
.clinical-patient-card-heading
.clinical-record-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

html.elghis-clinical-preview
.clinical-patient-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background:
    linear-gradient(
      145deg,
      var(--ec-teal-500),
      var(--ec-teal-700)
    );
  color: #ffffff;
  font-size: 17px;
  font-weight: 850;
}

html.elghis-clinical-preview
.clinical-patient-card-heading h3 {
  margin: 0;
  color: var(--ec-text);
  font-size: 20px;
  letter-spacing: -0.025em;
}

html.elghis-clinical-preview
.clinical-patient-card-heading small {
  margin-top: 5px;
  display: block;
  color: var(--ec-muted);
  font-size: 12px;
}

html.elghis-clinical-preview
.clinical-patient-status {
  min-height: 30px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.elghis-clinical-preview
.clinical-patient-status.active {
  background: var(--ec-success-bg);
  color: var(--ec-success-text);
}

/* Datos del paciente */

html.elghis-clinical-preview
.clinical-patient-details {
  padding: 18px 0;
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 15px 22px;
}

html.elghis-clinical-preview
.clinical-patient-details > div {
  min-width: 0;
}

html.elghis-clinical-preview
.clinical-patient-details span {
  display: block;
  color: #748a9d;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

html.elghis-clinical-preview
.clinical-patient-details strong {
  margin-top: 5px;
  display: block;
  overflow-wrap: anywhere;
  color: var(--ec-text);
  font-size: 13px;
  line-height: 1.4;
}

/* Pie de la tarjeta */

html.elghis-clinical-preview
.clinical-patient-card-footer {
  min-height: 48px;
  padding-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top:
    1px solid var(--ec-border);
}

html.elghis-clinical-preview
.clinical-patient-card-footer small {
  min-width: 0;
  overflow: hidden;
  color: #7d92a3;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.elghis-clinical-preview
.clinical-patient-open-button {
  min-height: 42px;
  padding: 0 17px;
  flex: 0 0 auto;
  border: 1px solid #aad3d8;
  border-radius: 12px;
  background: #ffffff;
  color: var(--ec-teal-700);
  font-size: 12px;
  font-weight: 800;
}

html.elghis-clinical-preview
.clinical-patient-open-button:hover {
  border-color: var(--ec-teal-600);
  background: var(--ec-teal-100);
}

/* Carga, mensaje y estado vacío */

html.elghis-clinical-preview
#clinical-patients-message {
  margin: 0 0 16px;
}

html.elghis-clinical-preview
.clinical-patients-loading,
html.elghis-clinical-preview
.clinical-patients-empty {
  grid-column: 1 / -1;
  min-height: 150px;
  padding: 28px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--ec-border);
  border-radius: 20px;
  background: #f8fbfc;
  color: var(--ec-muted);
}

/* Búsqueda */

html.elghis-clinical-preview
.elghis-patient-search-hidden {
  display: none !important;
}

/* Pie original */

html.elghis-clinical-preview
#clinical-view > .dashboard-footer {
  display: none;
}

/* Ajuste ligero del logotipo superior */

html.elghis-clinical-preview
#clinical-view
.elghis-official-header-logo,
html.elghis-clinical-preview
#clinical-patient-view
.elghis-official-header-logo {
  height: 61px;
  max-width: 96px;
}

@media (max-width: 1000px) {
  html.elghis-clinical-preview
  #clinical-view
  .clinical-patients-heading {
    align-items: flex-start;
  }

  html.elghis-clinical-preview
  #clinical-view
  .clinical-patients-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  html.elghis-clinical-preview
  #clinical-view
  .clinical-content {
    padding: 15px;
  }

  html.elghis-clinical-preview
  #clinical-view
  .clinical-patients-heading {
    min-height: 0;
    padding: 22px;
    display: grid;
  }

  html.elghis-clinical-preview
  #clinical-view
  .clinical-patients-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
  }

  html.elghis-clinical-preview
  #clinical-view
  .clinical-patients-total {
    min-width: 0;
  }

  html.elghis-clinical-preview
  #clinical-patients-list {
    grid-template-columns: 1fr;
  }

  html.elghis-clinical-preview
  .clinical-patient-details {
    grid-template-columns: 1fr 1fr;
  }

  html.elghis-clinical-preview
  #clinical-view
  .elghis-official-header-logo,
  html.elghis-clinical-preview
  #clinical-patient-view
  .elghis-official-header-logo {
    height: 54px;
    max-width: 86px;
  }
}

@media (max-width: 480px) {
  html.elghis-clinical-preview
  .clinical-patient-card-heading {
    display: grid;
  }

  html.elghis-clinical-preview
  .clinical-patient-status {
    justify-self: start;
  }

  html.elghis-clinical-preview
  .clinical-patient-details {
    grid-template-columns: 1fr;
  }

  html.elghis-clinical-preview
  .clinical-patient-card-footer {
    display: grid;
  }

  html.elghis-clinical-preview
  .clinical-patient-open-button {
    width: 100%;
  }
}
