[data-patient-portal-root] {
  position: relative;
  z-index: 3;
  margin: 0 0 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid rgba(41, 113, 122, .18);
  border-radius: 24px;
  background: linear-gradient(135deg, #f4fbfa 0%, #ffffff 70%);
  box-shadow: 0 18px 45px rgba(31, 76, 83, .12);
}

.patient-portal-card__intro h3 { margin: .35rem 0 .5rem; color: #183f47; font-size: clamp(1.25rem, 2.4vw, 1.7rem); }
.patient-portal-card__intro p { max-width: 42rem; margin: 0; color: #5b7075; line-height: 1.6; }
.patient-portal-card__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.patient-portal-card__status { min-height: 1.5rem; margin-top: .8rem; color: #527078; }
.patient-portal-card__status.is-success { color: #16745b; }

.patient-portal-button {
  min-height: 44px;
  padding: .7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.patient-portal-button:hover { transform: translateY(-1px); }
.patient-portal-button:focus-visible { outline: 3px solid rgba(227, 162, 87, .6); outline-offset: 2px; }
.patient-portal-button:disabled { cursor: wait; opacity: .65; transform: none; }
.patient-portal-form--register .patient-portal-form__submit:disabled { cursor: not-allowed; }
.patient-portal-button--primary { color: #fff; background: #267985; box-shadow: 0 8px 18px rgba(38, 121, 133, .22); }
.patient-portal-button--secondary { color: #267985; border-color: rgba(38, 121, 133, .35); background: #fff; }
.patient-portal-button--danger { color: #a53b3b; border-color: rgba(165, 59, 59, .25); background: #fff7f7; }
.patient-portal-button--small { min-height: 36px; padding: .45rem .75rem; font-size: .84rem; }

.patient-portal-modal { position: fixed; z-index: 2147483000; inset: 0; display: none; align-items: center; justify-content: center; padding: 1rem; box-sizing: border-box; }
.patient-portal-modal.is-open { display: flex; }
.patient-portal-modal__backdrop { position: absolute; inset: 0; background: rgba(10, 34, 39, .7); backdrop-filter: blur(5px); }
.patient-portal-modal__panel { position: relative; z-index: 1; width: min(100%, 620px); max-height: min(92vh, 820px); overflow: auto; padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid rgba(255,255,255,.35); border-radius: 24px; background: #fff; box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.patient-portal-modal:not(.is-auth-modal) .patient-portal-modal__panel { width: min(760px, calc(100vw - 32px)); }
.patient-portal-modal__close { position: absolute; top: .8rem; right: .8rem; width: 42px; height: 42px; border: 0; border-radius: 50%; color: #44636a; background: #eef6f5; font-size: 1.5rem; cursor: pointer; }
.patient-portal-modal__eyebrow { color: #d18a3f; font-size: .75rem; font-weight: 800; letter-spacing: .13em; }
.patient-portal-modal h2 { margin: .5rem 3rem 1.2rem 0; color: #183f47; font-size: clamp(1.45rem, 4vw, 2rem); }
.patient-portal-modal__status { min-height: 1.5rem; margin-top: 1rem; color: #526b70; line-height: 1.45; }
.patient-portal-modal__status.is-error { color: #b23d3d; }
.patient-portal-modal__status.is-reservation-conflict { text-align: center; font-weight: 800; }
.patient-portal-modal__status.is-success { color: #14755c; }
.patient-portal-modal__status.is-loading { color: #267985; }
.patient-portal-modal__status:empty { display: none; min-height: 0; margin: 0; }
.patient-portal-form { display: grid; gap: .85rem; }
.patient-portal-field { display: grid; gap: .35rem; color: #35545a; font-size: .88rem; font-weight: 700; }
.patient-portal-field__heading { display: flex; align-items: baseline; gap: .45rem; min-width: 0; }
.patient-portal-field__error { color: #c62828; font-size: .78rem; font-weight: 800; }
.patient-portal-field input, .patient-portal-field select { width: 100%; min-height: 46px; box-sizing: border-box; padding: .7rem .8rem; border: 1px solid #c9dada; border-radius: 11px; color: #183f47; background: #fbfefe; font: inherit; }
.patient-portal-field input:focus, .patient-portal-field select:focus { outline: 3px solid rgba(38, 121, 133, .16); border-color: #267985; }
.patient-portal-consent { display: flex; gap: .6rem; align-items: flex-start; color: #526b70; font-size: .87rem; line-height: 1.45; }
.patient-portal-consent input { margin-top: .22rem; accent-color: #267985; }
.patient-portal-form__submit { width: 100%; margin-top: .35rem; }
.patient-portal-form__alternate { border: 0; color: #267985; background: transparent; font-size: .9rem; }
.patient-portal-booking-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-height: 36px;
  margin: -.35rem 0 .8rem;
  padding: .42rem .82rem;
  border: 1px solid rgba(38, 121, 133, .4);
  border-radius: 10px;
  color: #1f7180;
  background: #fff;
  font-size: .8rem;
  line-height: 1;
  white-space: nowrap;
}
.patient-portal-booking-back:hover,
.patient-portal-booking-back:focus-visible {
  color: #fff;
  border-color: #267985;
  background: #267985;
  outline: none;
}
.patient-portal-booking-recovery {
  display: flex;
  justify-content: center;
  margin-top: .7rem;
}
.patient-portal-booking-recovery .patient-portal-button {
  width: 100%;
}
.patient-portal-public-complete-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1cm;
  margin-top: 1.25rem;
}
.patient-portal-help, .patient-portal-countdown { color: #5b7075; line-height: 1.55; }
.patient-portal-countdown { text-align: center; font-size: .9rem; }
.patient-portal-dashboard__header { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.patient-portal-dashboard__greeting { color: #183f47; font-size: 1.15rem; font-weight: 800; }
.patient-portal-tabs { display: flex; flex-wrap: wrap; gap: .65rem; margin-bottom: 1rem; }
.patient-portal-list { display: grid; gap: .75rem; color: #526b70; }
.patient-portal-reservation { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem; border: 1px solid #d8e6e5; border-radius: 15px; background: #f8fcfb; }
.patient-portal-reservation div { display: grid; gap: .25rem; }
.patient-portal-reservation strong { color: #183f47; }
.patient-portal-reservation span { color: #60777b; font-size: .9rem; }

body.patient-portal-modal-open { overflow: hidden; }
@media (max-width: 600px) {
  .patient-portal-card__actions, .patient-portal-tabs { display: grid; grid-template-columns: 1fr; }
  .patient-portal-button { width: 100%; }
  .patient-portal-modal { padding: .5rem; }
  .patient-portal-modal__panel { max-height: 96vh; border-radius: 18px; }
  .patient-portal-reservation { align-items: stretch; flex-direction: column; }
}

/* Portal de pacientes: modal compacto, sin desplazamiento para autenticacion. */
.patient-portal-modal__backdrop {
  background: linear-gradient(135deg, rgba(9, 48, 66, .82), rgba(14, 137, 164, .58));
  backdrop-filter: blur(8px);
}

.patient-portal-modal__panel {
  box-sizing: border-box;
  min-width: 0;
  width: min(620px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 28px);
  padding: 22px 26px 20px;
  overflow: auto;
  border: 1px solid rgba(21, 159, 216, .28);
  border-radius: 26px;
  background: linear-gradient(145deg, #ffffff 0%, #f1fbfd 100%);
  box-shadow: 0 28px 80px rgba(9, 65, 85, .34), 0 0 0 1px rgba(255,255,255,.5) inset;
}

.patient-portal-modal__panel::before {
  position: absolute;
  top: 0;
  right: 30px;
  left: 30px;
  height: 4px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #159fd8, #45c6ba);
  content: "";
}

.patient-portal-modal.is-auth-modal .patient-portal-modal__panel {
  overflow: hidden;
}

.patient-portal-modal__panel { overflow: hidden; overflow-x: hidden; }
.patient-portal-booking-form--modern { gap: 8px; }
.patient-portal-booking-section { min-width: 0; }
.patient-portal-booking-section h3 { margin: 4px 0 6px; color: #214b5a; font-size: .82rem; }
.patient-portal-choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; min-width: 0; }
.patient-portal-choice { min-width: 0; min-height: 48px; padding: 7px 8px; border: 1px solid #c7dfe2; border-radius: 12px; color: #245764; background: rgba(255,255,255,.82); font: inherit; font-size: .76rem; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease; }
.patient-portal-choice strong, .patient-portal-choice span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patient-portal-choice span { margin-top: 2px; color: #6a858b; font-size: .68rem; }
.patient-portal-choice:hover, .patient-portal-choice:focus-visible { border-color: #159fd8; background: #eefaff; outline: none; transform: translateY(-1px); }
.patient-portal-choice.is-selected { border-color: #159fd8; color: #fff; background: linear-gradient(135deg, #159fd8, #147eaf); box-shadow: 0 7px 16px rgba(21,159,216,.22); }
.patient-portal-choice.is-selected span { color: rgba(255,255,255,.86); }
.patient-portal-choice--time { min-height: 38px; color: #237181; font-weight: 800; }
.patient-portal-booking-form--modern .patient-portal-form__submit { margin-top: 3px; }
.patient-portal-booking-form--calendar { gap: 10px; }
.patient-portal-public-contact { display: grid; gap: 9px; padding: 14px; border: 1px solid #c7e3e6; border-radius: 15px; background: #f5fcfd; }
.patient-portal-public-contact h3 { margin: 0; color: #214b5a; font-size: .95rem; }
.patient-portal-public-contact p { margin: 0; color: #5b7075; font-size: .78rem; line-height: 1.45; }
.patient-portal-picker-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.patient-portal-picker { width: 100%; min-height: 48px; padding: .7rem .9rem; border: 1px solid #b8dce1; border-radius: 13px; color: #237181; background: #f4fbfc; font: inherit; font-weight: 800; cursor: pointer; }
.patient-portal-picker:disabled { cursor: not-allowed; opacity: .6; }
.patient-portal-submodal { position: absolute; z-index: 4; inset: 0; display: grid; place-items: center; padding: 14px; border-radius: 26px; background: rgba(8,48,64,.66); backdrop-filter: blur(7px); }
.patient-portal-submodal__panel { position: relative; width: min(100%, 560px); max-height: calc(100% - 8px); box-sizing: border-box; overflow: hidden; padding: 24px; border: 1px solid rgba(255,255,255,.65); border-radius: 22px; background: linear-gradient(145deg, #ffffff, #effbfd); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.patient-portal-confirm { position: absolute; z-index: 6; inset: 0; display: grid; place-items: center; padding: 16px; border-radius: 24px; background: rgba(8,48,64,.7); backdrop-filter: blur(7px); }
.patient-portal-confirm__panel { width: min(100%, 430px); box-sizing: border-box; padding: 25px; border: 1px solid rgba(255,255,255,.7); border-radius: 20px; background: linear-gradient(145deg, #ffffff, #effbfd); box-shadow: 0 24px 70px rgba(0,0,0,.3); text-align: center; }
.patient-portal-confirm__panel h3 { margin: 8px 0 10px; color: #214b5a; font-size: clamp(1.2rem, 3vw, 1.5rem); }
.patient-portal-confirm__panel p { margin: 0; color: #5b7075; line-height: 1.5; }
.patient-portal-confirm__actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.patient-portal-confirm__actions .patient-portal-button { min-width: 145px; }
.patient-portal-submodal__panel h3 { margin: 6px 38px 18px 0; color: #214b5a; font-size: clamp(1.15rem, 3vw, 1.45rem); }
.patient-portal-submodal__back { margin: 0 0 14px; }
.patient-portal-submodal__close { position: absolute; top: 12px; right: 12px; width: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 50%; color: #237181; background: #e8f7fa; font-size: 1.3rem; cursor: pointer; }
.patient-portal-calendar__nav { display: grid; grid-template-columns: 38px 1fr 38px; gap: 8px; align-items: center; margin-bottom: 12px; color: #237181; text-align: center; text-transform: capitalize; }
.patient-portal-calendar__nav-button { min-height: 36px; padding: 0; border: 1px solid #c4e0e3; border-radius: 10px; color: #237181; background: #fff; font-size: 1.35rem; cursor: pointer; }
.patient-portal-calendar__nav-button:disabled { opacity: .35; cursor: default; }
.patient-portal-calendar__weekdays, .patient-portal-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.patient-portal-calendar__weekdays { margin-bottom: 6px; color: #6a858b; font-size: .7rem; font-weight: 800; text-align: center; }
.patient-portal-calendar__day { min-width: 0; min-height: 53px; padding: 5px 3px; border: 1px solid #dcebed; border-radius: 10px; color: #a4b4b7; background: #f7fbfb; text-align: center; }
button.patient-portal-calendar__day { border-color: #9ed5dc; color: #237181; background: #fff; cursor: pointer; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
button.patient-portal-calendar__day:hover, button.patient-portal-calendar__day:focus-visible { border-color: #159fd8; background: #eefaff; outline: none; transform: translateY(-1px); }
.patient-portal-calendar__day strong, .patient-portal-calendar__day small { display: block; }
.patient-portal-calendar__day strong { font-size: .95rem; }
.patient-portal-calendar__day small { margin-top: 3px; color: #1597bf; font-size: .63rem; font-weight: 800; }
.patient-portal-submodal__hint, .patient-portal-submodal__selected { margin: 12px 0 0; color: #6a858b; font-size: .78rem; text-align: center; }
.patient-portal-hours-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.patient-portal-hour { min-height: 42px; border: 1px solid #9ed5dc; border-radius: 11px; color: #237181; background: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.patient-portal-hour:hover, .patient-portal-hour:focus-visible { border-color: #159fd8; color: #fff; background: linear-gradient(135deg, #159fd8, #147eaf); outline: none; }

.patient-portal-modal__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 8px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #159fd8, #28b9a8);
  box-shadow: 0 8px 18px rgba(21, 159, 216, .24);
  font: 700 25px/1 Arial, sans-serif;
}

.patient-portal-modal__close {
  z-index: 6;
  top: 14px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #b9dfe5;
  border-radius: 50%;
  color: #176b7b;
  background: #f3fcfd;
  box-shadow: 0 5px 14px rgba(26, 111, 128, .14);
  font: 700 1.45rem/1 Arial, sans-serif;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.patient-portal-modal__close:hover,
.patient-portal-modal__close:focus-visible {
  color: #fff;
  border-color: #159fd8;
  background: #159fd8;
  box-shadow: 0 8px 18px rgba(21, 159, 216, .3);
  outline: none;
  transform: rotate(4deg) scale(1.05);
}

/* La sesión permanece activa aunque el paciente cierre la ventana con la X. */
.patient-portal-modal.is-session-locked .patient-portal-modal__close {
  display: grid;
}

.patient-portal-modal.is-session-locked .patient-portal-modal__backdrop {
  cursor: default;
}

.patient-portal-modal__eyebrow {
  color: #1597bf;
  font-size: .68rem;
  letter-spacing: .17em;
}

.patient-portal-modal h2 {
  margin: .35rem 3rem .8rem 0;
  color: #214b5a;
  font-size: clamp(1.35rem, 3.4vw, 1.85rem);
  line-height: 1.12;
}

.patient-portal-modal__content { min-width: 0; }

.patient-portal-form {
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.patient-portal-form--register {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.patient-portal-form--register .patient-portal-field {
  gap: 3px;
  min-width: 0;
  font-size: .76rem;
}

.patient-portal-form--register .patient-portal-field input,
.patient-portal-form--register .patient-portal-field select {
  min-height: 39px;
  padding: .48rem .68rem;
  border-radius: 10px;
  font-size: .86rem;
}

.patient-portal-form--register .patient-portal-field:nth-child(1) { grid-area: rut; }
.patient-portal-form--register .patient-portal-field:nth-child(2) { grid-area: nombres; }
.patient-portal-form--register .patient-portal-field:nth-child(3) { grid-area: apellidos; }
.patient-portal-form--register .patient-portal-field:nth-child(4) { grid-area: email; }
.patient-portal-form--register .patient-portal-field:nth-child(5) { grid-area: telefono; }
.patient-portal-form--register .patient-portal-field:nth-child(6) { grid-area: direccion; }
.patient-portal-form--register .patient-portal-field:nth-child(7) { grid-area: region; }
.patient-portal-form--register .patient-portal-field:nth-child(8) { grid-area: ciudad; }
.patient-portal-form--register .patient-portal-field:nth-child(9) { grid-area: comuna; }

.patient-portal-form--register {
  grid-template-areas:
    "rut email"
    "nombres apellidos"
    "telefono direccion"
    "region ciudad"
    "comuna comuna";
}

.patient-portal-form--register .patient-portal-consent,
.patient-portal-form--register .patient-portal-form__submit,
.patient-portal-form--register .patient-portal-form__alternate {
  grid-column: 1 / -1;
}

.patient-portal-form--register .patient-portal-consent {
  gap: .45rem;
  margin-top: 1px;
  font-size: .73rem;
  line-height: 1.3;
}

.patient-portal-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 2px;
  border-radius: 11px;
  background: linear-gradient(135deg, #159fd8, #147eaf);
  box-shadow: 0 9px 18px rgba(21, 159, 216, .22);
}

.patient-portal-form__alternate {
  min-height: 24px;
  padding: 0;
  font-size: .78rem;
}

.patient-portal-modal__status {
  min-height: 1.15rem;
  margin-top: .55rem;
  font-size: .78rem;
}

@media (max-width: 600px) {
  .patient-portal-modal { padding: 10px; }
  .patient-portal-modal__panel {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    max-height: calc(100vh - 20px);
    padding: 18px 16px 15px;
    border-radius: 21px;
  }

  .patient-portal-modal__panel::before { right: 20px; left: 20px; }
  .patient-portal-modal__mark { width: 34px; height: 34px; margin-bottom: 6px; border-radius: 11px; font-size: 22px; }
  .patient-portal-modal h2 { margin-bottom: .6rem; font-size: 1.35rem; }
  .patient-portal-form--register { gap: 7px 8px; }
  .patient-portal-form--register .patient-portal-field input,
  .patient-portal-form--register .patient-portal-field select { min-height: 37px; padding: .42rem .55rem; font-size: .8rem; }
  .patient-portal-form--register .patient-portal-consent { font-size: .68rem; }
  .patient-portal-button { width: auto; }
  .patient-portal-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .patient-portal-choice { min-height: 44px; padding: 6px 5px; font-size: .7rem; }
  .patient-portal-choice span { font-size: .6rem; }
  .patient-portal-choice--time { min-height: 36px; font-size: .76rem; }
  .patient-portal-picker-summary { gap: 7px; }
  .patient-portal-picker { min-height: 44px; padding: .55rem .6rem; font-size: .78rem; }
  .patient-portal-submodal { padding: 8px; }
  .patient-portal-submodal__panel { padding: 18px 14px; border-radius: 19px; }
  .patient-portal-confirm { padding: 10px; border-radius: 20px; }
  .patient-portal-confirm__panel { padding: 20px 14px; border-radius: 18px; }
  .patient-portal-confirm__actions { flex-direction: column-reverse; }
  .patient-portal-confirm__actions .patient-portal-button { width: 100%; }
  .patient-portal-public-complete-actions { flex-direction: column; align-items: stretch; }
  .patient-portal-public-complete-actions .patient-portal-button { width: 100%; }
  .patient-portal-calendar__weekdays, .patient-portal-calendar { gap: 4px; }
  .patient-portal-calendar__day { min-height: 48px; }
  .patient-portal-hours-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
}

#pageReserva .reservation-account-links > button[data-patient-portal-resume] {
  grid-column: 2 / 5;
  justify-self: center;
  margin-top: 4px;
  min-height: 36px;
  padding: .55rem 1rem !important;
  border: 1px solid rgba(38, 121, 133, .35) !important;
  border-radius: 10px;
  background: #fff !important;
}
@media (max-width: 900px) {
  #pageReserva .reservation-account-links > button[data-patient-portal-resume] {
    grid-column: 1 / -1;
    width: min(100%, 240px);
  }
}

.patient-portal-auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 3px 0 0;
  color: #789198;
  font-size: .78rem;
  text-align: center;
}
.patient-portal-auth-divider::before,
.patient-portal-auth-divider::after {
  flex: 1;
  height: 1px;
  background: #d7e7e9;
  content: "";
}
.patient-portal-google {
  display: flex;
  justify-content: center;
  min-height: 40px;
}
.patient-portal-google.is-error {
  color: #b23d3d;
  font-size: .78rem;
  line-height: 1.4;
  text-align: center;
}
/* Glycemia survey before authenticated booking */
.patient-portal-glycemia-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}
.patient-portal-form__intro{margin:0 0 16px;color:#58717d;font-size:13px;line-height:1.55}
.patient-portal-glycemia-question{min-height:82px}
.patient-portal-glycemia-value-field,.patient-portal-glycemia-comment-field,.patient-portal-form__actions{grid-column:1/-1}
.patient-portal-glycemia-comment-field textarea{resize:vertical;min-height:78px}
.patient-portal-form__actions{display:flex;justify-content:flex-end;gap:10px;margin-top:4px}
@media(max-width:700px){.patient-portal-glycemia-form{grid-template-columns:1fr}.patient-portal-glycemia-value-field,.patient-portal-glycemia-comment-field,.patient-portal-form__actions{grid-column:auto}.patient-portal-form__actions{flex-direction:column-reverse}.patient-portal-form__actions button{width:100%}}

/* Dashboard de paciente: inspirado en el portal anterior, con estructura modal moderna. */
.patient-portal-dashboard {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
}

.patient-portal-dashboard__sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 14px 12px;
  border: 1px solid #d7eaed;
  border-radius: 19px;
  background: linear-gradient(180deg, #f4fbfc 0%, #eaf7f8 100%);
}

.patient-portal-dashboard__profile {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 5px 4px 15px;
  border-bottom: 1px solid #d4e7e9;
}

.patient-portal-dashboard__avatar {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #159fd8, #28b9a8);
  box-shadow: 0 7px 14px rgba(21, 159, 216, .2);
  font-size: 1rem;
  font-weight: 900;
}

.patient-portal-dashboard__profile div { min-width: 0; }
.patient-portal-dashboard__profile span { display: block; color: #719099; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.patient-portal-dashboard__profile strong { display: block; min-width: 0; margin-top: 2px; color: #214b5a; font-size: .78rem; line-height: 1.28; overflow-wrap: anywhere; white-space: normal; }
.patient-portal-dashboard__nav-label { display: block; margin: 17px 5px 7px; color: #1597bf; font-size: .62rem; font-weight: 900; letter-spacing: .15em; }
.patient-portal-dashboard__nav { display: grid; gap: 5px; }

.patient-portal-dashboard__nav-button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: .55rem .62rem;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #3b6470;
  background: transparent;
  font-size: .76rem;
  text-align: left;
}

.patient-portal-dashboard__nav-button:hover,
.patient-portal-dashboard__nav-button:focus-visible,
.patient-portal-dashboard__nav-button.is-active {
  border-color: #b7e0e4;
  color: #116d80;
  background: #fff;
  box-shadow: 0 5px 13px rgba(40, 118, 132, .09);
  outline: none;
}

.patient-portal-dashboard__nav-button.is-active { color: #fff; background: linear-gradient(135deg, #159fd8, #147eaf); box-shadow: 0 8px 16px rgba(21, 159, 216, .2); }
.patient-portal-dashboard__nav-icon { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border-radius: 7px; color: #1597bf; background: #e4f7f8; font-size: .86rem; font-weight: 900; }
.patient-portal-dashboard__nav-button.is-active .patient-portal-dashboard__nav-icon { color: #147eaf; background: rgba(255,255,255,.88); }
.patient-portal-dashboard__sidebar-footer { margin-top: auto; padding-top: 15px; }
.patient-portal-dashboard__logout { width: 100%; min-height: 37px; border: 1px solid #f1c9c9; border-radius: 10px; color: #b23d3d; background: #fff7f7; font-size: .76rem; }
.patient-portal-dashboard__logout:hover { border-color: #e5a9a9; background: #fff0f0; }

.patient-portal-dashboard__main { min-width: 0; padding: 3px 2px 0; }
.patient-portal-dashboard__view-header { padding: 0 2px 16px; border-bottom: 1px solid #dcebed; }
.patient-portal-dashboard__view-eyebrow { color: #1597bf; font-size: .66rem; font-weight: 900; letter-spacing: .16em; }
.patient-portal-dashboard__view-header h3 { margin: 6px 0 4px; color: #214b5a; font-size: clamp(1.35rem, 3vw, 1.82rem); line-height: 1.1; }
.patient-portal-dashboard__view-header p { margin: 0; color: #6a858b; font-size: .82rem; line-height: 1.5; }
.patient-portal-dashboard__view-body { min-height: 158px; padding-top: 17px; }
.patient-portal-dashboard .patient-portal-reservation { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 15px; align-items: center; padding: 15px; border: 1px solid #cfe5e7; border-radius: 16px; background: linear-gradient(135deg, #f7fcfc, #edf8f8); box-shadow: 0 7px 17px rgba(40, 118, 132, .06); }
.patient-portal-dashboard .patient-portal-reservation + .patient-portal-reservation { margin-top: 9px; }
.patient-portal-dashboard .patient-portal-reservation strong { color: #214b5a; font-size: .94rem; }
.patient-portal-dashboard .patient-portal-reservation span { display: block; margin-top: 5px; color: #60777b; font-size: .78rem; line-height: 1.45; }
.patient-portal-dashboard .patient-portal-reservation .patient-portal-button { white-space: nowrap; }
.patient-portal-dashboard__empty { display: grid; min-height: 170px; place-items: center; align-content: center; padding: 18px; border: 1px dashed #b9dfe3; border-radius: 16px; background: #f8fcfc; text-align: center; }
.patient-portal-dashboard__empty-icon { display: grid; width: 40px; height: 40px; place-items: center; margin-bottom: 7px; border-radius: 13px; color: #1597bf; background: #e4f7f8; font-size: 1.25rem; }
.patient-portal-dashboard__empty strong { color: #214b5a; font-size: .92rem; }
.patient-portal-dashboard__empty p { max-width: 350px; margin: 6px 0 13px; color: #6a858b; font-size: .78rem; line-height: 1.5; }
.patient-portal-dashboard__details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.patient-portal-detail-card { display: grid; gap: 6px; padding: 13px 14px; border: 1px solid #cfe5e7; border-radius: 14px; background: #f8fcfc; }
.patient-portal-detail-card:first-child { grid-column: 1 / -1; }
.patient-portal-detail-card span { color: #719099; font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.patient-portal-detail-card strong { overflow-wrap: anywhere; color: #214b5a; font-size: .88rem; }
.patient-portal-dashboard__note { grid-column: 1 / -1; margin: 3px 0 0; color: #6a858b; font-size: .75rem; line-height: 1.5; }

html.theme-dark .patient-portal-dashboard__sidebar,
html[data-theme="dark"] .patient-portal-dashboard__sidebar { border-color: #2d5966; background: linear-gradient(180deg, #112e39 0%, #0e2731 100%); }
html.theme-dark .patient-portal-dashboard__profile,
html[data-theme="dark"] .patient-portal-dashboard__profile,
html.theme-dark .patient-portal-dashboard__view-header,
html[data-theme="dark"] .patient-portal-dashboard__view-header { border-color: #2d5966; }
html.theme-dark .patient-portal-dashboard__profile span,
html[data-theme="dark"] .patient-portal-dashboard__profile span,
html.theme-dark .patient-portal-dashboard__profile strong,
html[data-theme="dark"] .patient-portal-dashboard__profile strong,
html.theme-dark .patient-portal-dashboard__view-header h3,
html[data-theme="dark"] .patient-portal-dashboard__view-header h3,
html.theme-dark .patient-portal-dashboard .patient-portal-reservation strong,
html[data-theme="dark"] .patient-portal-dashboard .patient-portal-reservation strong,
html.theme-dark .patient-portal-detail-card strong,
html[data-theme="dark"] .patient-portal-detail-card strong { color: #f4ffff; }
html.theme-dark .patient-portal-dashboard__nav-button,
html[data-theme="dark"] .patient-portal-dashboard__nav-button { color: #b5d1d7; }
html.theme-dark .patient-portal-dashboard__nav-button:hover,
html[data-theme="dark"] .patient-portal-dashboard__nav-button:hover,
html.theme-dark .patient-portal-dashboard__nav-button:focus-visible,
html[data-theme="dark"] .patient-portal-dashboard__nav-button:focus-visible { border-color: #3f7b87; color: #f4ffff; background: #173844; }
html.theme-dark .patient-portal-dashboard__nav-button.is-active,
html[data-theme="dark"] .patient-portal-dashboard__nav-button.is-active { color: #062630; background: linear-gradient(135deg, #73e1df, #45c6ba); }
html.theme-dark .patient-portal-dashboard__nav-button.is-active .patient-portal-dashboard__nav-icon,
html[data-theme="dark"] .patient-portal-dashboard__nav-button.is-active .patient-portal-dashboard__nav-icon { color: #126778; background: rgba(255,255,255,.85); }
html.theme-dark .patient-portal-dashboard .patient-portal-reservation,
html[data-theme="dark"] .patient-portal-dashboard .patient-portal-reservation,
html.theme-dark .patient-portal-dashboard__empty,
html[data-theme="dark"] .patient-portal-dashboard__empty,
html.theme-dark .patient-portal-detail-card,
html[data-theme="dark"] .patient-portal-detail-card { border-color: #356875; background: #102b36; }
html.theme-dark .patient-portal-dashboard__view-header p,
html[data-theme="dark"] .patient-portal-dashboard__view-header p,
html.theme-dark .patient-portal-dashboard .patient-portal-reservation span,
html[data-theme="dark"] .patient-portal-dashboard .patient-portal-reservation span,
html.theme-dark .patient-portal-dashboard__empty p,
html[data-theme="dark"] .patient-portal-dashboard__empty p,
html.theme-dark .patient-portal-dashboard__note,
html[data-theme="dark"] .patient-portal-dashboard__note { color: #b5d1d7; }
html.theme-dark .patient-portal-detail-card span,
html[data-theme="dark"] .patient-portal-detail-card span { color: #8eb8c1; }

@media (prefers-color-scheme: dark) {
  html:not(.theme-light):not([data-theme="light"]) .patient-portal-dashboard__sidebar { border-color: #2d5966; background: linear-gradient(180deg, #112e39 0%, #0e2731 100%); }
  html:not(.theme-light):not([data-theme="light"]) .patient-portal-dashboard__profile strong,
  html:not(.theme-light):not([data-theme="light"]) .patient-portal-dashboard__view-header h3,
  html:not(.theme-light):not([data-theme="light"]) .patient-portal-dashboard .patient-portal-reservation strong { color: #f4ffff; }
}

@media (max-width: 700px) {
  .patient-portal-dashboard { grid-template-columns: 1fr; gap: 13px; }
  .patient-portal-dashboard__sidebar { padding: 11px; }
  .patient-portal-dashboard__profile { padding-bottom: 10px; }
  .patient-portal-dashboard__nav-label { margin-top: 11px; }
  .patient-portal-dashboard__nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .patient-portal-dashboard__nav-button { min-height: 39px; font-size: .72rem; }
  .patient-portal-dashboard__sidebar-footer { padding-top: 9px; }
  .patient-portal-dashboard__main { padding-top: 0; }
  .patient-portal-dashboard .patient-portal-reservation { grid-template-columns: 1fr; gap: 12px; }
  .patient-portal-dashboard .patient-portal-reservation .patient-portal-button { width: 100%; }
}

@media (max-width: 430px) {
  .patient-portal-dashboard__nav { grid-template-columns: 1fr; }
  .patient-portal-dashboard__details { grid-template-columns: 1fr; }
  .patient-portal-detail-card:first-child,
  .patient-portal-dashboard__note { grid-column: auto; }
}

/* Portal publico: aspecto claro y cercano al sistema anterior, incluso si el dispositivo usa tema oscuro. */
.patient-portal-modal.is-dashboard-modal { color-scheme: light; }
.patient-portal-modal.is-dashboard-modal .patient-portal-modal__panel {
  width: min(960px, calc(100vw - 28px));
  max-width: 960px;
  padding: 18px 22px 22px;
  border: 1px solid #d9dedc;
  border-radius: 8px;
  background: #fff;
  color: #365664;
  box-shadow: 0 24px 70px rgba(29, 68, 79, .22);
}
.patient-portal-modal.is-dashboard-modal .patient-portal-modal__panel::before { background: #2aa9c0; }
.patient-portal-modal.is-dashboard-modal .patient-portal-modal__mark,
.patient-portal-modal.is-dashboard-modal .patient-portal-modal__eyebrow,
.patient-portal-modal.is-dashboard-modal .patient-portal-modal__panel > h2 { display: none; }
.patient-portal-modal.is-dashboard-modal .patient-portal-modal__close { position: absolute; top: 12px; right: 12px; z-index: 8; color: #27748b; background: #f5fbfc; border-color: #c7e0e5; }
.patient-portal-modal.is-dashboard-modal .patient-portal-modal__content { margin-top: 0; }
.patient-portal-dashboard__topbar { display: grid; grid-template-columns: minmax(90px, 142px) minmax(0, 1fr); align-items: center; gap: 20px; min-height: 78px; padding: 2px 62px 13px 4px; border-bottom: 1px solid #d9dedc; }
.patient-portal-dashboard__topbar { display: none; position: relative !important; top: auto !important; right: auto !important; bottom: auto !important; left: auto !important; width: 100%; height: auto !important; min-height: 78px; box-sizing: border-box; overflow: visible; background: #fff !important; color: #365664 !important; box-shadow: none !important; z-index: 2; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__topbar { display: flex !important; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__topbar { display: grid !important; grid-template-columns: minmax(90px, 142px) minmax(0, 1fr); }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__topbar::before,
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__topbar::after { display: none !important; content: none !important; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__logo { display: block !important; width: min(142px, 100%) !important; max-width: 100% !important; height: auto !important; max-height: 68px !important; object-fit: contain !important; object-position: left center !important; }
.patient-portal-dashboard__top-info { display: grid; justify-items: end; gap: 3px; min-width: 0; max-width: 100%; color: #496a76; font-size: .72rem; text-align: right; }
.patient-portal-dashboard__top-info > strong { max-width: 100%; padding-right: 2px; color: #1f5264; font-size: .84rem; line-height: 1.35; overflow-wrap: anywhere; }
.patient-portal-dashboard__top-info time { color: #6f858b; font-size: .67rem; text-transform: capitalize; }
.patient-portal-dashboard__top-info a { color: #137b9e; font-size: .7rem; font-weight: 800; text-decoration: none; }
.patient-portal-dashboard { grid-template-columns: 175px minmax(0, 1fr); gap: 18px; margin-top: 17px; }
.patient-portal-dashboard__sidebar { padding: 12px 10px; border: 1px solid #d7eaed; border-radius: 18px; background: linear-gradient(180deg, #f6fcfd 0%, #edf8f9 100%); box-shadow: 0 9px 24px rgba(38, 121, 133, .08); }
.patient-portal-dashboard__profile { padding: 5px 4px 14px; border-bottom-color: #d4e7e9; }
.patient-portal-dashboard__avatar { width: 32px; height: 32px; flex-basis: 32px; border-radius: 50%; color: #247b9a; background: #e3f3f6; box-shadow: none; font-size: .88rem; }
.patient-portal-dashboard__profile span { color: #748486; font-size: .6rem; }
.patient-portal-dashboard__profile strong { color: #315d6e; font-size: .73rem; }
.patient-portal-dashboard__nav-label { margin: 15px 5px 6px; color: #247e9d; font-size: .58rem; }
.patient-portal-dashboard__nav { gap: 1px; }
.patient-portal-dashboard__nav-button { min-height: 40px; padding: .52rem .58rem; border: 1px solid transparent; border-radius: 11px; color: #3b6470; background: transparent; font-size: .7rem; font-weight: 800; box-shadow: none; }
.patient-portal-dashboard__nav-button:hover,
.patient-portal-dashboard__nav-button:focus-visible { border-color: #b7e0e4; color: #116d80; background: #fff; box-shadow: 0 5px 13px rgba(40, 118, 132, .09); outline: none; }
.patient-portal-dashboard__nav-button.is-active { border-color: transparent; border-left: 0; color: #fff; background: linear-gradient(135deg, #159fd8, #147eaf); box-shadow: 0 8px 16px rgba(21, 159, 216, .2); }
.patient-portal-dashboard__nav-icon { display: grid; width: 22px; height: 22px; flex-basis: 22px; place-items: center; border-radius: 8px; color: #1597bf; background: #e4f7f8; font-size: .86rem; font-weight: 900; }
.patient-portal-dashboard__nav-icon svg { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.patient-portal-dashboard__nav-button.is-active .patient-portal-dashboard__nav-icon { color: #147eaf; background: rgba(255,255,255,.9); }
.patient-portal-dashboard__sidebar-footer { padding-top: 15px; }
.patient-portal-dashboard__logout { display: flex; min-height: 39px; align-items: center; justify-content: center; gap: 7px; border: 1px solid #efcaca; border-radius: 11px; color: #b23d3d; background: linear-gradient(135deg, #fffafa, #fff2f2); font-size: .7rem; font-weight: 800; box-shadow: 0 5px 13px rgba(178, 61, 61, .06); }
.patient-portal-dashboard__logout:hover { border-color: #e2aaaa; color: #a52f35; background: #fff0f0; box-shadow: 0 7px 15px rgba(178, 61, 61, .1); }
.patient-portal-dashboard__logout-icon { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 7px; color: currentColor; background: #ffe5e5; }
.patient-portal-dashboard__logout-icon svg { display: block; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.patient-portal-dashboard__main { padding: 0 1px; }
.patient-portal-dashboard__view-header { padding: 0 0 12px; border-bottom-color: #cbd9dc; }
.patient-portal-dashboard__view-eyebrow { color: #2583a2; font-size: .59rem; }
.patient-portal-dashboard__view-header h3 { margin: 5px 0 3px; color: #275a6b; font-size: clamp(1.15rem, 3vw, 1.55rem); font-weight: 500; }
.patient-portal-dashboard__view-header p { color: #66818a; font-size: .74rem; }
.patient-portal-dashboard__view-body { padding-top: 13px; }
.patient-portal-dashboard .patient-portal-reservation { padding: 13px; border-radius: 4px; border-color: #cbdfe3; background: #f8fbfb; box-shadow: none; }
.patient-portal-dashboard .patient-portal-reservation strong { color: #285967; font-size: .84rem; }
.patient-portal-dashboard .patient-portal-reservation span { color: #647d84; font-size: .72rem; }
.patient-portal-dashboard__empty { min-height: 145px; border-radius: 4px; border-color: #bfd9dd; background: #fbfdfd; }
.patient-portal-dashboard__empty strong { color: #285967; }
.patient-portal-dashboard__empty p { color: #6d858b; font-size: .72rem; }
.patient-portal-personal-form { display: grid; width: 100%; box-sizing: border-box; gap: 16px; }
.patient-portal-dashboard__details { display: block; width: 100%; box-sizing: border-box; }
.patient-portal-personal-group { position: relative; min-width: 0; width: 100%; box-sizing: border-box; margin: 0; padding: 20px 18px 18px; border: 1px solid #dcebed; border-radius: 16px; background: linear-gradient(145deg, #ffffff 0%, #f7fbfc 100%); box-shadow: 0 8px 22px rgba(38, 121, 133, .06); }
.patient-portal-personal-group::before { position: absolute; top: 0; right: 26px; left: 26px; height: 3px; border-radius: 0 0 8px 8px; background: linear-gradient(90deg, #159fd8, #45c6ba); content: ''; }
.patient-portal-personal-group legend { width: auto; max-width: 100%; padding: 0 8px; color: #285967; background: #fff; font-size: .78rem; font-weight: 900; letter-spacing: .01em; }
.patient-portal-personal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 14px; }
.patient-portal-personal-field { display: grid; min-width: 0; gap: 5px; }
.patient-portal-personal-field > span { color: #5b7881; font-size: .67rem; font-weight: 800; letter-spacing: .02em; }
.patient-portal-personal-field input,
.patient-portal-personal-field select { width: 100%; min-height: 42px; box-sizing: border-box; padding: .55rem .7rem; border: 1px solid #d1e2e5; border-radius: 10px; color: #315d6b; background: #fff; font: 600 .77rem Manrope, sans-serif; box-shadow: 0 2px 7px rgba(38, 121, 133, .04); transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.patient-portal-personal-field input:focus,
.patient-portal-personal-field select:focus { border-color: #2298b2; outline: none; background: #fbfeff; box-shadow: 0 0 0 3px rgba(34, 152, 178, .13); }
.patient-portal-personal-field input[name="rut_readonly"] { color: #6d858b; background: #f1f7f8; }
.patient-portal-personal-form .patient-portal-form__actions { justify-content: flex-end; gap: 10px; margin-top: 1px; }
.patient-portal-personal-form .patient-portal-form__actions .patient-portal-button { min-height: 42px; border-radius: 10px; font-size: .77rem; }
.patient-portal-glycemia-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 11px 12px; border: 1px solid #cfdee0; border-radius: 4px; background: #fbfdfd; }
.patient-portal-glycemia-row + .patient-portal-glycemia-row { margin-top: 7px; }
.patient-portal-glycemia-row span { color: #66818a; font-size: .7rem; }
.patient-portal-glycemia-row strong { color: #237b96; font-size: .85rem; }
.patient-portal-glycemia-row p { grid-column: 1 / -1; margin: 4px 0 0; color: #667e83; font-size: .7rem; }
.patient-portal-dashboard__security { padding: 18px; border: 1px solid #d0dfe1; border-radius: 4px; background: #fbfdfd; color: #416570; font-size: .78rem; line-height: 1.55; }
.patient-portal-dashboard__security strong { color: #285967; font-size: .9rem; }
.patient-portal-dashboard__security p { margin: 8px 0 0; }

html.theme-dark .patient-portal-modal.is-dashboard-modal .patient-portal-modal__panel,
html[data-theme="dark"] .patient-portal-modal.is-dashboard-modal .patient-portal-modal__panel,
html:not(.theme-light):not([data-theme="light"]) .patient-portal-modal.is-dashboard-modal .patient-portal-modal__panel { background: #fff !important; color: #365664 !important; }
html.theme-dark .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__sidebar,
html[data-theme="dark"] .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__sidebar,
html:not(.theme-light):not([data-theme="light"]) .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__sidebar { border-color: #d7eaed !important; background: linear-gradient(180deg, #f6fcfd 0%, #edf8f9 100%) !important; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__profile span { color: #748486 !important; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__profile strong,
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__view-header h3,
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard .patient-portal-reservation strong,
.patient-portal-modal.is-dashboard-modal .patient-portal-detail-card strong { color: #285967 !important; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__nav-button { color: #3b6470 !important; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__nav-button:hover,
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__nav-button:focus-visible { color: #116d80 !important; background: #fff !important; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__nav-button.is-active { color: #fff !important; background: linear-gradient(135deg, #159fd8, #147eaf) !important; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__nav-button.is-active .patient-portal-dashboard__nav-icon { color: #147eaf !important; background: rgba(255,255,255,.9) !important; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__view-header p,
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard .patient-portal-reservation span,
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__empty p,
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__note { color: #66818a !important; }

@media (max-width: 700px) {
  .patient-portal-modal.is-dashboard-modal .patient-portal-modal__panel { padding: 14px 12px 16px; }
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__topbar { display: grid !important; grid-template-columns: minmax(82px, 112px) minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 58px 12px 4px; }
  .patient-portal-dashboard__logo { width: min(100%, 112px); }
  .patient-portal-dashboard__top-info { font-size: .65rem; }
  .patient-portal-dashboard__contact-actions { flex-wrap: wrap; }
  .patient-portal-dashboard { margin-top: 12px; }
  .patient-portal-dashboard__nav-button { min-height: 34px; font-size: .65rem; }
  .patient-portal-personal-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__topbar { grid-template-columns: 82px minmax(0, 1fr); gap: 8px; padding-right: 54px; }
  .patient-portal-dashboard__logo { width: 82px; }
  .patient-portal-dashboard__top-info { justify-items: end; text-align: right; }
  .patient-portal-dashboard__top-info > strong { font-size: .72rem; }
  .patient-portal-dashboard__nav { grid-template-columns: 1fr 1fr; }
  .patient-portal-dashboard__nav-button { min-height: 39px; }
}

/* Ajustes finales del portal publico y de los registros historicos. */
.patient-portal-modal.is-dashboard-modal .patient-portal-modal__panel { overflow: auto !important; }
.patient-portal-modal.is-dashboard-modal .patient-portal-modal__content { overflow: visible; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__avatar { display: block; object-fit: contain; padding: 5px; border: 1px solid #c7e1e5; background: #eef8f9; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__profile { align-items: flex-start; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__profile > div { flex: 1 1 auto; min-width: 0; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__profile strong { overflow: visible !important; text-overflow: clip !important; white-space: normal !important; overflow-wrap: anywhere; line-height: 1.3; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__profile strong {
  color: #214b5a !important;
  font-size: .84rem !important;
  font-weight: 800 !important;
  letter-spacing: .01em;
}
.patient-portal-dashboard__contact-actions { display: flex; align-items: stretch; justify-content: flex-end; gap: 7px; width: 100%; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__consultation { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 9px; border: 1px solid #c6e0e5; border-radius: 8px; color: #24758e; background: #f5fbfc; text-decoration: none; transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease; }
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__consultation:hover { border-color: #8bc6d1; background: #edf8fa; transform: translateY(-1px); box-shadow: 0 5px 12px rgba(35, 111, 128, .1); }
.patient-portal-dashboard__consultation--whatsapp { border-color: #bfe4d0 !important; color: #1b8e58 !important; background: #f4fcf7 !important; }
.patient-portal-dashboard__consultation--whatsapp:hover { border-color: #7dcc9f !important; background: #ebfaf1 !important; }
.patient-portal-dashboard__consultation-icon { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; color: #fff; background: #258eae; font-size: .8rem; }
.patient-portal-dashboard__whatsapp-icon { flex: 0 0 25px; width: 25px; height: 25px; color: #25d366; }
.patient-portal-dashboard__consultation small,
.patient-portal-dashboard__consultation strong { display: block; }
.patient-portal-dashboard__consultation small { color: #6d858b; font-size: .58rem; font-weight: 700; }
.patient-portal-dashboard__consultation strong { margin-top: 1px; color: #24758e; font-size: .75rem; letter-spacing: .02em; }
.patient-portal-dashboard__consultation--whatsapp small { color: #5c8d71; }
.patient-portal-dashboard__consultation--whatsapp strong { color: #238452; font-size: .68rem; }
.patient-portal-glycemia-heading { padding: 0 0 10px; border-bottom: 1px solid #cbd9dc; }
.patient-portal-glycemia-heading > span { color: #2583a2; font-size: .6rem; font-weight: 900; letter-spacing: .13em; }
.patient-portal-glycemia-heading h3 { margin: 5px 0 3px; color: #285967; font-size: 1.35rem; font-weight: 500; }
.patient-portal-glycemia-heading .patient-portal-form__intro { margin: 0; font-size: .75rem; }
.patient-portal-glycemia-panel { max-width: 760px; margin: 0 auto; padding-top: 0; }
.patient-portal-glycemia-panel .patient-portal-glycemia-heading { padding: 20px 20px 16px; border: 1px solid #cbdfe3; border-radius: 16px; background: linear-gradient(135deg, #f7fcfc, #edf8f8); }
.patient-portal-glycemia-entry-form { width: min(100%, 620px); margin: 0 auto; padding: 18px 0 20px; gap: 11px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.patient-portal-glycemia-entry-form .patient-portal-field { grid-template-columns: 180px minmax(0, 1fr); align-items: center; gap: 10px; color: #526f77; font-size: .72rem; }
.patient-portal-glycemia-entry-form .patient-portal-field > span { text-align: right; }
.patient-portal-glycemia-entry-form .patient-portal-field input { min-height: 34px; padding: .4rem .5rem; border-radius: 3px; }
.patient-portal-glycemia-entry-form .patient-portal-field select { box-sizing: border-box; width: 100%; min-height: 42px; padding: .55rem 2.5rem .55rem .75rem; border: 1px solid #bcd5da; border-radius: 12px; color: #315d6b; background: #fbfefe; background-image: linear-gradient(45deg, transparent 50%, #2583a2 50%), linear-gradient(135deg, #2583a2 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 12px) 18px; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; font: 700 .78rem Manrope, sans-serif; appearance: none; cursor: pointer; }
.patient-portal-glycemia-entry-form .patient-portal-field select:focus { border-color: #159fd8; outline: 3px solid rgba(21, 159, 216, .12); }
.patient-portal-glycemia-entry-form .patient-portal-glycemia-custom-field > span { align-self: center; }
.patient-portal-time-picker { display: flex; align-items: center; gap: 8px; width: 100%; }
.patient-portal-time-picker__trigger { width: 100%; min-height: 42px; padding: .55rem .75rem; border: 1px solid #bcd5da; border-radius: 12px; color: #315d6b; background: #fbfefe; font: 700 .78rem Manrope, sans-serif; text-align: left; cursor: pointer; }
.patient-portal-time-picker__trigger::after { float: right; width: 7px; height: 7px; margin-top: 2px; border-right: 2px solid #2583a2; border-bottom: 2px solid #2583a2; content: ''; transform: rotate(45deg); }
.patient-portal-time-picker__trigger:focus { border-color: #159fd8; outline: 3px solid rgba(21, 159, 216, .12); }
.patient-portal-time-picker__separator { color: #2583a2; font-size: 1rem; font-weight: 900; }
.patient-portal-glycemia-time-modal { position: absolute; z-index: 60; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(16, 67, 80, .42); backdrop-filter: blur(5px); }
.patient-portal-glycemia-time-modal[hidden] { display: none !important; }
.patient-portal-glycemia-time-modal__panel { width: min(350px, 100%); box-sizing: border-box; padding: 18px; border: 1px solid #d2e9eb; border-radius: 22px; background: linear-gradient(145deg, #fff, #f2fbfc); box-shadow: 0 24px 65px rgba(18, 78, 94, .25); }
.patient-portal-glycemia-time-modal__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: #285967; font-size: .95rem; }
.patient-portal-glycemia-time-modal__close { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #c6e0e5; border-radius: 50%; color: #24758e; background: #f5fbfc; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.patient-portal-glycemia-clock { position: relative; width: min(270px, 100%); aspect-ratio: 1; margin: 0 auto; border: 1px solid #c5e0e3; border-radius: 50%; background: radial-gradient(circle, #fff 0 22%, #edf8f9 22.5% 23%, #f7fcfc 23.5%); box-shadow: inset 0 0 0 9px rgba(213, 237, 239, .48); }
.patient-portal-glycemia-clock__options { position: absolute; inset: 0; }
.patient-portal-glycemia-clock__option { position: absolute; width: 35px; height: 35px; padding: 0; border: 1px solid transparent; border-radius: 50%; color: #315d6b; background: transparent; font: 800 .69rem Manrope, sans-serif; transform: translate(-50%, -50%); cursor: pointer; }
.patient-portal-glycemia-clock__option:hover, .patient-portal-glycemia-clock__option:focus-visible { border-color: #159fd8; color: #fff; background: #159fd8; outline: none; }
.patient-portal-glycemia-clock__option.is-selected { color: #fff; background: linear-gradient(135deg, #159fd8, #1ab4a9); box-shadow: 0 5px 12px rgba(21, 159, 216, .25); }
.patient-portal-glycemia-clock__center { position: absolute; top: 50%; left: 50%; display: grid; width: 58px; height: 58px; place-items: center; border: 5px solid #dff5ef; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #19a9a5, #159fd8); font-size: .9rem; font-weight: 900; transform: translate(-50%, -50%); }
.patient-portal-glycemia-value-row { position: relative; display: block; width: 100%; }
.patient-portal-glycemia-value-row input { box-sizing: border-box; width: 100%; min-height: 42px !important; padding-right: 52px !important; border-radius: 12px !important; }
.patient-portal-glycemia-value-row > span { position: absolute; top: 50%; right: 13px; margin: 0; transform: translateY(-50%); pointer-events: none; }
.patient-portal-glycemia-date-picker { position: relative; width: 100%; }
.patient-portal-glycemia-date-trigger { width: 100%; min-height: 42px; padding: .55rem 2.5rem .55rem .75rem; border: 1px solid #bcd5da; border-radius: 12px; color: #315d6b; background: #fbfefe; font: 700 .78rem Manrope, sans-serif; text-align: left; cursor: pointer; }
.patient-portal-glycemia-date-trigger::after { position: absolute; top: 50%; right: 14px; width: 8px; height: 8px; border-right: 2px solid #2583a2; border-bottom: 2px solid #2583a2; content: ''; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.patient-portal-glycemia-date-trigger:focus { border-color: #159fd8; outline: 3px solid rgba(21, 159, 216, .12); }
.patient-portal-glycemia-calendar-modal { position: absolute; z-index: 60; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(16, 67, 80, .42); backdrop-filter: blur(5px); }
.patient-portal-glycemia-calendar-modal[hidden] { display: none !important; }
.patient-portal-glycemia-calendar-modal__panel { width: min(370px, 100%); box-sizing: border-box; padding: 18px; border: 1px solid #d2e9eb; border-radius: 22px; background: linear-gradient(145deg, #fff, #f2fbfc); box-shadow: 0 24px 65px rgba(18, 78, 94, .25); }
.patient-portal-glycemia-calendar-modal__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: #285967; font-size: .95rem; }
.patient-portal-glycemia-calendar-modal__close { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #c6e0e5; border-radius: 50%; color: #24758e; background: #f5fbfc; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.patient-portal-glycemia-calendar-modal__close:hover { border-color: #8bc6d1; background: #edf8fa; }
.patient-portal-glycemia-date-popover { position: static; width: auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.patient-portal-glycemia-date-popover[hidden] { display: none !important; }
.patient-portal-glycemia-date-head { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; gap: 6px; }
.patient-portal-glycemia-date-nav { width: 32px; height: 32px; border: 1px solid #c7e1e4; border-radius: 10px; color: #2583a2; background: #f3fbfc; font-size: 1.15rem; cursor: pointer; }
.patient-portal-glycemia-date-nav:disabled { opacity: .4; cursor: not-allowed; }
.patient-portal-glycemia-date-selectors { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(78px, .8fr); gap: 5px; }
.patient-portal-glycemia-date-selectors select { min-width: 0; min-height: 32px; padding: .25rem .45rem; border: 1px solid #c7e1e4; border-radius: 8px; color: #315d6b; background: #f7fcfc; font: 700 .68rem Manrope, sans-serif; }
.patient-portal-glycemia-date-weekdays, .patient-portal-glycemia-date-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 10px; text-align: center; }
.patient-portal-glycemia-date-weekdays span { color: #79939a; font-size: .62rem; font-weight: 900; }
.patient-portal-glycemia-date-day { min-height: 29px; padding: 0; border: 1px solid transparent; border-radius: 8px; color: #315d6b; background: #fff; font: 700 .68rem Manrope, sans-serif; cursor: pointer; }
.patient-portal-glycemia-date-day:hover:not(:disabled) { border-color: #8bcbd4; background: #edf9fa; }
.patient-portal-glycemia-date-day.is-selected { color: #fff; border-color: #159fd8; background: linear-gradient(135deg, #159fd8, #1ab4a9); }
.patient-portal-glycemia-date-day.is-today { box-shadow: inset 0 0 0 2px #d1edf0; }
.patient-portal-glycemia-date-day:disabled { color: #b4c3c7; background: #f4f7f7; cursor: not-allowed; }
.patient-portal-glycemia-value-row > span { color: #60777b; font-size: .7rem; font-weight: 500; }
.patient-portal-glycemia-entry-form .patient-portal-form__actions { justify-content: center; margin-top: 7px; }
.patient-portal-glycemia-entry-form .patient-portal-form__actions { justify-content: flex-end; margin-top: 8px; }
.patient-portal-glycemia-entry-form .patient-portal-button { min-width: 115px; min-height: 42px; padding: .55rem 1rem; border-radius: 14px; font-size: .76rem; }
.patient-portal-glycemia-table { overflow: hidden; border: 1px solid #c7dce0; border-radius: 4px; background: #fff; }
.patient-portal-glycemia-table__head,
.patient-portal-glycemia-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(82px, .85fr) minmax(200px, 1.5fr) 95px; align-items: center; gap: 10px; padding: 8px 10px; }
.patient-portal-glycemia-table__head { color: #fff; background: #3d718b; font-size: .68rem; }
.patient-portal-glycemia-table__head strong:nth-child(n+2) { text-align: center; }
.patient-portal-glycemia-record + .patient-portal-glycemia-record { border-top: 1px solid #c7dce0; }
.patient-portal-glycemia-row { min-height: 34px; padding-top: 5px; padding-bottom: 5px; background: #fbfdfd; }
.patient-portal-glycemia-row span { color: #526f77; font-size: .7rem; }
.patient-portal-glycemia-row .patient-portal-glycemia-row__comment { line-height: 1.35; font-weight: 900 !important; color: #102f3f !important; }
.patient-portal-glycemia-row .patient-portal-button { justify-self: center; min-height: 26px; padding: .25rem .55rem; border-radius: 3px; font-size: .66rem; }
.patient-portal-glycemia-detail { display: grid; grid-template-columns: auto auto 1fr; gap: 8px 14px; align-items: center; padding: 8px 10px 10px; border-top: 1px dashed #c7dce0; color: #60777b; background: #f4fafb; font-size: .68rem; }
.patient-portal-glycemia-detail[hidden] { display: none !important; }
.patient-portal-glycemia-detail strong { color: #247b96; }
.patient-portal-glycemia-latest { margin-bottom: 13px; padding: 14px 16px; border: 1px solid #cfe5e7; border-radius: 14px; background: linear-gradient(135deg, #f7fcfc, #edf8f8); }
.patient-portal-glycemia-latest > span,
.patient-portal-glycemia-chart > span { color: #2583a2; font-size: .6rem; font-weight: 900; letter-spacing: .13em; }
.patient-portal-glycemia-latest strong { display: block; margin-top: 5px; color: #285967; font-size: 1rem; }
.patient-portal-glycemia-latest p { margin: 4px 0 0; color: #66818a; font-size: .73rem; }
.patient-portal-glycemia-reference-note { margin: 8px 0 13px; color: #78939b; font-size: .68rem; line-height: 1.4; }
.patient-portal-glycemia-moment-summary { margin: 0 0 16px; padding: 16px; border: 1px solid #cfe5e7; border-radius: 16px; background: linear-gradient(145deg, #fbfefe, #f1fafb); }
.patient-portal-glycemia-moment-summary > span { color: #2583a2; font-size: .6rem; font-weight: 900; letter-spacing: .13em; }
.patient-portal-glycemia-moment-summary h4 { margin: 5px 0 3px; color: #285967; font-size: 1.02rem; }
.patient-portal-glycemia-moment-summary > p { margin: 0 0 12px; color: #78939b; font-size: .67rem; line-height: 1.4; }
.patient-portal-glycemia-moment-table { overflow-x: auto; border: 1px solid #c7dce0; border-radius: 12px; background: #fff; }
.patient-portal-glycemia-moment-table__head,
.patient-portal-glycemia-moment-table__row { display: grid; grid-template-columns: minmax(150px, 1.45fr) 72px minmax(105px, 1fr) minmax(130px, 1.15fr) minmax(120px, 1.15fr); gap: 8px; align-items: center; min-width: 680px; padding: 9px 10px; }
.patient-portal-glycemia-moment-table__head { color: #fff; background: #3d718b; font-size: .64rem; }
.patient-portal-glycemia-moment-table__head strong:not(:first-child) { text-align: center; }
.patient-portal-glycemia-moment-table__row { min-height: 48px; border-top: 1px solid #e0edef; color: #526f77; font-size: .69rem; }
.patient-portal-glycemia-moment-table__row:first-of-type { border-top: 0; }
.patient-portal-glycemia-moment-table__row > div { display: grid; gap: 3px; }
.patient-portal-glycemia-moment-table__row > div strong { color: #285967; font-size: .72rem; }
.patient-portal-glycemia-moment-table__row > div small { color: #78939b; font-size: .59rem; line-height: 1.3; }
.patient-portal-glycemia-moment-table__row > span { text-align: center; }
.patient-portal-glycemia-moment-table__row > strong { text-align: center; font-size: .67rem; }
.patient-portal-glycemia-moment-table__row > strong.is-bajo { color: #2d7da0; }
.patient-portal-glycemia-moment-table__row > strong.is-medio { color: #23845d; }
.patient-portal-glycemia-moment-table__row > strong.is-alto { color: #b87319; }
.patient-portal-glycemia-moment-table__row > strong.is-muy-alto { color: #bb4545; }
.patient-portal-glycemia-moment-table__row > strong.is-empty { color: #78939b; }
.patient-portal-glycemia-history__toolbar { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.patient-portal-glycemia-history__toolbar .patient-portal-button { min-height: 36px; border-radius: 12px; font-size: .72rem; }
.patient-portal-glycemia-summary-modal { position: absolute; z-index: 90; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(16, 67, 80, .46); backdrop-filter: blur(6px); }
.patient-portal-glycemia-summary-modal__card { width: min(780px, 100%); max-height: min(88vh, 760px); overflow: auto; box-sizing: border-box; padding: 22px; border: 1px solid #d2e9eb; border-radius: 24px; background: linear-gradient(145deg, #fff, #f2fbfc); box-shadow: 0 25px 70px rgba(18, 78, 94, .28); }
.patient-portal-glycemia-summary-modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 15px; border-bottom: 1px solid #d5e7e9; }
.patient-portal-glycemia-summary-modal__header > div:first-child > span { color: #2583a2; font-size: .6rem; font-weight: 900; letter-spacing: .14em; }
.patient-portal-glycemia-summary-modal__header h3 { margin: 5px 0 3px; color: #285967; font-size: 1.35rem; font-weight: 600; }
.patient-portal-glycemia-summary-modal__header p { margin: 0; color: #66818a; font-size: .73rem; }
.patient-portal-glycemia-summary-modal__close { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid #c6e0e5; border-radius: 50%; color: #24758e; background: #f5fbfc; font-size: 1.35rem; line-height: 1; cursor: pointer; }
.patient-portal-glycemia-summary-modal__close:hover { border-color: #8bc6d1; background: #edf8fa; }
.patient-portal-glycemia-summary-modal__footer { display: flex; justify-content: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid #d5e7e9; }
.patient-portal-glycemia-summary-modal__footer .patient-portal-button { min-width: 106px; min-height: 38px; border-radius: 12px; font-size: .72rem; }
.patient-portal-glycemia-calendar-view-modal { position: absolute; z-index: 90; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(16, 67, 80, .46); backdrop-filter: blur(6px); }
.patient-portal-glycemia-calendar-view-modal__card { width: min(720px, 100%); max-height: min(88vh, 760px); overflow: auto; box-sizing: border-box; padding: 22px; border: 1px solid #d2e9eb; border-radius: 24px; background: linear-gradient(145deg, #fff, #f2fbfc); box-shadow: 0 25px 70px rgba(18, 78, 94, .28); }
.patient-portal-glycemia-calendar-view-modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 15px; border-bottom: 1px solid #d5e7e9; }
.patient-portal-glycemia-calendar-view-modal__header > div:first-child > span { color: #2583a2; font-size: .6rem; font-weight: 900; letter-spacing: .14em; }
.patient-portal-glycemia-calendar-view-modal__header h3 { margin: 5px 0 3px; color: #285967; font-size: 1.35rem; font-weight: 600; }
.patient-portal-glycemia-calendar-view-modal__header p { margin: 0; color: #66818a; font-size: .73rem; }
.patient-portal-glycemia-calendar-view-modal__close { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid #c6e0e5; border-radius: 50%; color: #24758e; background: #f5fbfc; font-size: 1.35rem; line-height: 1; cursor: pointer; }
.patient-portal-glycemia-calendar-view-modal__close:hover { border-color: #8bc6d1; background: #edf8fa; }
.patient-portal-glycemia-calendar-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 13px; }
.patient-portal-glycemia-calendar-filter { min-height: 34px; padding: .45rem .72rem; border: 1px solid #c3dfe3; border-radius: 999px; color: #2b7183; background: #fff; font: 700 .67rem Manrope, sans-serif; cursor: pointer; }
.patient-portal-glycemia-calendar-filter:hover, .patient-portal-glycemia-calendar-filter.is-active { border-color: #159fd8; color: #fff; background: linear-gradient(135deg, #159fd8, #1ab4a9); box-shadow: 0 6px 15px rgba(21, 159, 216, .2); }
.patient-portal-glycemia-calendar-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 16px; }
.patient-portal-glycemia-calendar-stats > div { min-height: 68px; padding: 11px 12px; border: 1px solid #cfe5e7; border-radius: 13px; background: #fbfefe; }
.patient-portal-glycemia-calendar-stats span { display: block; color: #2583a2; font-size: .57rem; font-weight: 900; letter-spacing: .1em; }
.patient-portal-glycemia-calendar-stats strong { display: block; margin-top: 7px; color: #285967; font-size: .88rem; line-height: 1.25; }
.patient-portal-glycemia-calendar-month { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 8px; margin-bottom: 9px; text-align: center; }
.patient-portal-glycemia-calendar-month strong { color: #285967; font-size: .95rem; text-transform: capitalize; }
.patient-portal-glycemia-calendar-month__nav { width: 34px; height: 34px; padding: 0; border: 1px solid #c7e1e4; border-radius: 10px; color: #2583a2; background: #f3fbfc; font-size: 1.2rem; cursor: pointer; }
.patient-portal-glycemia-calendar-month__nav:disabled { opacity: .4; cursor: not-allowed; }
.patient-portal-glycemia-calendar-weekdays, .patient-portal-glycemia-calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; text-align: center; }
.patient-portal-glycemia-calendar-weekdays { margin-bottom: 5px; }
.patient-portal-glycemia-calendar-weekdays span { color: #78939b; font-size: .61rem; font-weight: 900; }
.patient-portal-glycemia-calendar-day { display: grid; min-height: 52px; place-items: center; align-content: center; gap: 2px; padding: 4px 2px; border: 1px solid #dcebed; border-radius: 10px; color: #315d6b; background: #fff; font: 800 .72rem Manrope, sans-serif; cursor: pointer; }
.patient-portal-glycemia-calendar-day:hover, .patient-portal-glycemia-calendar-day.is-selected { border-color: #159fd8; background: #edf9fa; }
.patient-portal-glycemia-calendar-day.is-selected { color: #fff; background: linear-gradient(135deg, #159fd8, #1ab4a9); box-shadow: 0 6px 14px rgba(21, 159, 216, .18); }
.patient-portal-glycemia-calendar-day.has-records small { color: #1594ad; font-size: .58rem; font-weight: 900; }
.patient-portal-glycemia-calendar-day.is-selected small { color: #fff; }
.patient-portal-glycemia-calendar-selected-day { margin-top: 17px; padding: 14px; border: 1px solid #cfe5e7; border-radius: 15px; background: #fbfefe; }
.patient-portal-glycemia-calendar-selected-day h4 { margin: 0 0 9px; color: #285967; font-size: .88rem; }
.patient-portal-glycemia-calendar-selected-day > p { margin: 0; color: #78939b; font-size: .7rem; }
.patient-portal-glycemia-calendar-measurement { display: grid; grid-template-columns: 75px 105px 1fr; gap: 9px; align-items: center; padding: 8px 0; border-top: 1px solid #e1eff0; }
.patient-portal-glycemia-calendar-measurement:first-of-type { border-top: 0; }
.patient-portal-glycemia-calendar-measurement strong { color: #285967; font-size: .75rem; }
.patient-portal-glycemia-calendar-measurement span { color: #247b96; font-size: .78rem; font-weight: 800; }
.patient-portal-glycemia-calendar-measurement small { color: #66818a; font-size: .66rem; }
.patient-portal-glycemia-calendar-note { margin: 12px 0 0; color: #78939b; font-size: .65rem; line-height: 1.45; }
.patient-portal-glycemia-chart { margin-top: 16px; padding: 17px 18px 13px; border: 1px solid #cfe5e7; border-radius: 16px; background: #fbfefe; }
.patient-portal-glycemia-chart h4 { margin: 5px 0 3px; color: #285967; font-size: 1.1rem; }
.patient-portal-glycemia-chart p { margin: 0 0 9px; color: #66818a; font-size: .73rem; }
.patient-portal-glycemia-chart svg { display: block; width: 100%; height: auto; min-height: 210px; overflow: visible; }
.patient-portal-glycemia-chart__grid { stroke: #dcebed; stroke-width: 1; }
.patient-portal-glycemia-chart__axis { fill: #78939b; font: 600 11px Manrope, sans-serif; }
.patient-portal-glycemia-chart__area-line { fill: none; stroke: #2585a0; stroke-linecap: round; stroke-linejoin: round; stroke-width: 4; }
.patient-portal-glycemia-chart__point { fill: #fff; stroke: #159fd8; stroke-width: 4; }
.patient-portal-glycemia-chart__value { fill: #285967; font: 800 11px Manrope, sans-serif; }
.patient-portal-glycemia-chart__label { fill: #66818a; font: 600 10px Manrope, sans-serif; }
.patient-portal-glycemia-chart__day-divider { stroke: #8fb8c0; stroke-width: 1.5; stroke-dasharray: 5 5; }
.patient-portal-glycemia-chart__day-label { fill: #285967; font: 800 10px Manrope, sans-serif; }
@media (max-width: 600px) {
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__consultation { align-self: stretch; }
  .patient-portal-glycemia-entry-form .patient-portal-field { grid-template-columns: 1fr; gap: 4px; }
  .patient-portal-glycemia-entry-form .patient-portal-field > span { text-align: left; }
  .patient-portal-glycemia-table { overflow-x: auto; }
  .patient-portal-glycemia-table__head, .patient-portal-glycemia-row { min-width: 560px; grid-template-columns: 110px 82px minmax(200px, 1fr) 92px; }
  .patient-portal-glycemia-detail { grid-template-columns: 1fr; gap: 4px; }
  .patient-portal-glycemia-calendar-modal { padding: 14px; }
  .patient-portal-glycemia-calendar-modal__panel { padding: 15px; border-radius: 18px; }
  .patient-portal-glycemia-time-modal { padding: 14px; }
  .patient-portal-glycemia-time-modal__panel { padding: 15px; border-radius: 18px; }
  .patient-portal-glycemia-history__toolbar { justify-content: stretch; }
  .patient-portal-glycemia-history__toolbar .patient-portal-button { width: 100%; }
  .patient-portal-glycemia-summary-modal { padding: 12px; }
  .patient-portal-glycemia-summary-modal__card { padding: 16px; border-radius: 19px; }
  .patient-portal-glycemia-summary-modal__header h3 { font-size: 1.12rem; }
  .patient-portal-glycemia-calendar-view-modal { padding: 12px; }
  .patient-portal-glycemia-calendar-view-modal__card { padding: 16px; border-radius: 19px; }
  .patient-portal-glycemia-calendar-view-modal__header h3 { font-size: 1.12rem; }
  .patient-portal-glycemia-calendar-view-modal__header p { max-width: 245px; }
  .patient-portal-glycemia-calendar-filters { gap: 6px; }
  .patient-portal-glycemia-calendar-filter { padding-left: .58rem; padding-right: .58rem; font-size: .62rem; }
  .patient-portal-glycemia-calendar-stats { grid-template-columns: 1fr 1fr; }
  .patient-portal-glycemia-calendar-stats > div:last-child { grid-column: 1 / -1; }
  .patient-portal-glycemia-calendar-measurement { grid-template-columns: 62px 92px 1fr; gap: 6px; }
}
@media (max-width: 700px) {
  .patient-portal-personal-group { padding: 18px 13px 14px; border-radius: 13px; }
  .patient-portal-personal-grid { grid-template-columns: 1fr; gap: 11px; }
  .patient-portal-personal-form .patient-portal-form__actions { flex-direction: column-reverse; }
  .patient-portal-personal-form .patient-portal-form__actions .patient-portal-button { width: 100%; }
  .patient-portal-glycemia-panel .patient-portal-glycemia-heading { padding: 17px 15px 14px; border-radius: 13px; }
  .patient-portal-glycemia-entry-form { padding: 16px 15px 17px; border-radius: 0 0 13px 13px; }
}

@media (min-width: 701px) {
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__sidebar { position: sticky; top: 0; align-self: start; z-index: 3; }
}

/* Datos personales compactos: el modal conserva su alto y solo se desplaza su contenido. */
.patient-portal-modal.is-dashboard-modal .patient-portal-modal__panel { height: min(92vh, 820px); max-height: min(92vh, 820px); }
.patient-portal-personal-form { gap: 10px; }
.patient-portal-personal-group { padding: 14px 15px 13px; border-radius: 13px; }
.patient-portal-personal-grid { gap: 8px 10px; }
.patient-portal-personal-field { gap: 3px; }
.patient-portal-personal-field > span { font-size: .62rem; }
.patient-portal-personal-field input,
.patient-portal-personal-field select,
.patient-portal-personal-field .patient-portal-date-trigger { min-height: 35px; padding: .38rem .55rem; border-radius: 8px; font-size: .7rem; }
.patient-portal-personal-form .patient-portal-form__actions { margin-top: 0; }
.patient-portal-personal-form .patient-portal-form__actions .patient-portal-button { min-height: 36px; border-radius: 9px; font-size: .7rem; }
@media (max-width: 700px) {
  .patient-portal-modal.is-dashboard-modal .patient-portal-modal__panel { height: calc(100vh - 20px); max-height: calc(100vh - 20px); }
  .patient-portal-personal-group { padding: 13px 12px 12px; }
  .patient-portal-personal-grid { gap: 7px; }
}

.patient-portal-date-picker { position: relative; min-width: 0; }
.patient-portal-date-trigger { display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: space-between; padding: .55rem .7rem; border: 1px solid #d1e2e5; border-radius: 10px; color: #315d6b; background: #fff; font: 600 .77rem Manrope, sans-serif; cursor: pointer; box-shadow: 0 2px 7px rgba(38, 121, 133, .04); }
.patient-portal-date-trigger::after { color: #1b9bb2; content: '▾'; font-size: .8rem; }
.patient-portal-date-trigger:hover,
.patient-portal-date-trigger:focus-visible { border-color: #2298b2; outline: none; box-shadow: 0 0 0 3px rgba(34, 152, 178, .13); }
.patient-portal-date-picker__popover { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: min(285px, calc(100vw - 54px)); box-sizing: border-box; padding: 13px; border: 1px solid #d4e8eb; border-radius: 15px; background: #fff; box-shadow: 0 18px 42px rgba(24, 78, 94, .2); }
.patient-portal-date-picker__head { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 8px; margin-bottom: 10px; }
.patient-portal-date-picker__selectors { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(68px, .85fr); gap: 5px; }
.patient-portal-date-picker__select,
.patient-portal-personal-field select { appearance: none; -webkit-appearance: none; padding-right: 27px !important; background-color: #fff; background-image: linear-gradient(45deg, transparent 50%, #1b91a9 50%), linear-gradient(135deg, #1b91a9 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-repeat: no-repeat; background-size: 5px 5px, 5px 5px; }
.patient-portal-personal-field select { cursor: pointer; }
.patient-portal-personal-field select:hover { border-color: #9bcbd3; background-color: #fbfeff; }
.patient-portal-date-picker__select { width: 100%; min-height: 32px; box-sizing: border-box; padding: .35rem .45rem; border: 1px solid #cfe5e8; border-radius: 8px; color: #285967; background-color: #f6fbfc; font: 800 .68rem Manrope, sans-serif; cursor: pointer; }
.patient-portal-date-picker__select--year { min-width: 68px; }
.patient-portal-date-picker__select:focus { border-color: #2298b2; outline: none; box-shadow: 0 0 0 3px rgba(34, 152, 178, .13); }
.patient-portal-date-picker__nav { width: 30px; height: 30px; padding: 0; border: 1px solid #cfe5e8; border-radius: 9px; color: #1685a0; background: #f5fbfc; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.patient-portal-date-picker__nav:hover { border-color: #8cc9d3; background: #eaf8fa; }
.patient-portal-date-picker__weekdays,
.patient-portal-date-picker__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.patient-portal-date-picker__weekdays span { padding: 3px 0; color: #78939b; font-size: .59rem; font-weight: 900; text-align: center; }
.patient-portal-date-picker__days > span { min-height: 30px; }
.patient-portal-date-picker__day { min-height: 30px; padding: 0; border: 1px solid transparent; border-radius: 8px; color: #315d6b; background: #fff; font: 700 .68rem Manrope, sans-serif; cursor: pointer; }
.patient-portal-date-picker__day:hover:not(:disabled) { border-color: #8bcbd4; background: #edf9fa; }
.patient-portal-date-picker__day.is-selected { color: #fff; border-color: #159fd8; background: linear-gradient(135deg, #159fd8, #1ab4a9); }
.patient-portal-date-picker__day.is-today { box-shadow: inset 0 0 0 2px #d1edf0; }
.patient-portal-date-picker__day:disabled { color: #b4c3c7; background: #f4f7f7; cursor: not-allowed; }
.patient-portal-success-modal { position: absolute; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(13, 58, 72, .42); backdrop-filter: blur(5px); }
.patient-portal-success-modal__card { width: min(420px, 100%); box-sizing: border-box; padding: 30px 28px 26px; border: 1px solid rgba(214, 236, 238, .95); border-radius: 24px; background: linear-gradient(145deg, #fff, #f1fbfc); box-shadow: 0 24px 65px rgba(18, 78, 94, .25); text-align: center; }
.patient-portal-success-modal__icon { display: grid; width: 62px; height: 62px; place-items: center; margin: 0 auto 14px; border: 6px solid #dff5ef; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #19a9a5, #159fd8); box-shadow: 0 9px 20px rgba(25, 169, 165, .2); font-size: 1.9rem; font-weight: 900; }
.patient-portal-success-modal__eyebrow { display: block; margin-bottom: 7px; color: #1b9d9b; font-size: .62rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.patient-portal-success-modal__card h3 { margin: 0; color: #285967; font-size: 1.32rem; line-height: 1.25; }
.patient-portal-success-modal__card p { max-width: 300px; margin: 10px auto 21px; color: #66818a; font-size: .82rem; line-height: 1.55; }
.patient-portal-success-modal__card .patient-portal-button { min-width: 125px; min-height: 40px; border-radius: 10px; font-size: .78rem; }
@media (max-width: 700px) {
  .patient-portal-dashboard__contact-actions { justify-content: stretch; }
  .patient-portal-dashboard__contact-actions .patient-portal-dashboard__consultation { flex: 1 1 0; }
  .patient-portal-dashboard__consultation { padding-left: 7px !important; padding-right: 7px !important; }
  .patient-portal-dashboard__consultation strong { font-size: .66rem; }
}
@media (max-width: 500px) {
  .patient-portal-dashboard__contact-actions { flex-direction: column; width: auto; align-items: stretch; }
  .patient-portal-dashboard__contact-actions .patient-portal-dashboard__consultation { flex: none; }
  .patient-portal-success-modal__card { padding: 27px 20px 23px; }
  .patient-portal-success-modal__card h3 { font-size: 1.16rem; }
}

/* Dashboard header and layout: keep the close control out of the patient's text area. */
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__topbar {
  position: relative !important;
  inset: auto !important;
  display: grid !important;
  grid-template-columns: minmax(82px, 142px) minmax(0, 1fr) !important;
  gap: clamp(8px, 2vw, 18px) !important;
  min-height: 92px !important;
  height: auto !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  padding: 12px 68px 13px 4px !important;
  transform: none !important;
}
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__top-info {
  position: static !important;
  inset: auto !important;
  display: grid !important;
  width: 100%;
  min-width: 0;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  overflow: visible !important;
}
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__top-info > strong {
  position: static !important;
  display: block !important;
  width: calc(100% - 48px);
  max-width: calc(100% - 48px);
  box-sizing: border-box;
  margin: 0 0 0 auto !important;
  padding: 0 !important;
  line-height: 1.35 !important;
  text-align: right !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
.patient-portal-modal.is-dashboard-modal .patient-portal-modal__close {
  position: absolute !important;
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 2147483647 !important;
  top: 14px !important;
  right: 14px !important;
  width: 42px !important;
  height: 42px !important;
  color: #176b7b !important;
  background: #f3fcfd !important;
  border: 1px solid #b9dfe5 !important;
}
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__logo {
  position: static !important;
  inset: auto !important;
  align-self: center !important;
  justify-self: start !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  vertical-align: middle !important;
}
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__top-info time,
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__contact-actions {
  position: static !important;
  inset: auto !important;
  height: auto !important;
  margin: 0 !important;
  transform: none !important;
}

@media (max-width: 760px) {
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 13px !important;
  }
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__sidebar,
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__main {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__nav {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__nav-button {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 430px) {
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__topbar {
    grid-template-columns: 76px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding-right: 62px !important;
  }
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__logo {
    width: 76px !important;
  }
}

/* One-tap personal-data selectors, rendered above the portal modal. */
.patient-portal-personal-select { min-width: 0; }
.patient-portal-personal-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  padding: .55rem .7rem;
  border: 1px solid #d1e2e5;
  border-radius: 10px;
  color: #315d6b;
  background: #fff;
  box-shadow: 0 2px 7px rgba(38,121,133,.04);
  font: 600 .77rem Manrope, sans-serif;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.patient-portal-personal-select__trigger::after {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-right: 2px solid #1b91a9;
  border-bottom: 2px solid #1b91a9;
  transform: rotate(45deg) translateY(-2px);
}
.patient-portal-personal-select__trigger:hover,
.patient-portal-personal-select__trigger:focus-visible { border-color: #2298b2; outline: none; box-shadow: 0 0 0 3px rgba(34,152,178,.13); }
.patient-portal-personal-select__trigger:disabled { opacity: .65; cursor: wait; }
.patient-portal-personal-select__menu {
  z-index: 2147483005;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #b9d4da;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(18,58,69,.24);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.patient-portal-personal-select__option {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #315d6b;
  background: transparent;
  font: 600 .77rem Manrope, sans-serif;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.patient-portal-personal-select__option:hover,
.patient-portal-personal-select__option:focus-visible,
.patient-portal-personal-select__option[aria-selected="true"] { color: #155b70; background: #e8f5f7; outline: none; }
.patient-portal-personal-select--country .patient-portal-personal-select__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.patient-portal-personal-select--country .patient-portal-personal-select__trigger > span,
.patient-portal-personal-select--country .patient-portal-personal-select__option > span { flex: 1; }
.patient-portal-personal-select__flag {
  width: 24px;
  height: 18px;
  flex: 0 0 24px;
  object-fit: cover;
  border-radius: 2px;
}

/* Hide the patient portal's top-right X in login, dashboard and mobile views. */
.patient-portal-modal .patient-portal-modal__close { display: none !important; }

.patient-portal-glycemia-questionnaire-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 54, 67, .58);
}
.patient-portal-glycemia-questionnaire-modal__card {
  width: min(760px, 100%);
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 20px 22px;
  border: 1px solid #b9d8df;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(21, 73, 87, .3);
}
.patient-portal-glycemia-questionnaire-modal__header { margin-bottom: 12px; }
.patient-portal-glycemia-questionnaire-modal__header > span {
  color: #168ead;
  font: 800 .72rem Manrope, sans-serif;
  letter-spacing: .12em;
}
.patient-portal-glycemia-questionnaire-modal__header h3 { margin: 5px 0 4px; color: #245c6d; font: 800 1.1rem Manrope, sans-serif; }
.patient-portal-glycemia-questionnaire-modal__header p { margin: 0; color: #52717a; font-size: .86rem; line-height: 1.35; }
.patient-portal-glycemia-questionnaire { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.patient-portal-glycemia-question { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin: 0; padding: 8px 10px; border: 1px solid #d3e6ea; border-radius: 10px; }
.patient-portal-glycemia-question legend { grid-column: 1 / -1; padding: 0; color: #315d6b; font-size: .76rem; font-weight: 700; line-height: 1.2; }
.patient-portal-glycemia-question label { display: inline-flex; align-items: center; gap: 4px; color: #315d6b; font-size: .74rem; font-weight: 700; }
.patient-portal-glycemia-questionnaire__comment { display: grid; grid-column: 1 / -1; gap: 4px; margin-top: 2px; color: #315d6b; font-size: .76rem; font-weight: 700; }
.patient-portal-glycemia-questionnaire__comment textarea { min-height: 52px; resize: vertical; padding: 7px; border: 1px solid #b9d4da; border-radius: 8px; font: inherit; }
.patient-portal-glycemia-questionnaire .patient-portal-form__actions { grid-column: 1 / -1; justify-content: flex-end; margin-top: 2px; }
@media (max-width: 640px) {
  .patient-portal-glycemia-questionnaire-modal__card { padding: 16px 14px; }
  .patient-portal-glycemia-questionnaire { grid-template-columns: 1fr; }
  .patient-portal-glycemia-question { grid-template-columns: 1fr auto; }
  .patient-portal-glycemia-question legend { grid-column: 1 / -1; }
}

.patient-portal-personal-photo-field {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 5px 12px;
  align-items: center;
  min-width: 0;
}
.patient-portal-personal-photo-field > span { grid-column: 1 / -1; color: #5b7881; font-size: .67rem; font-weight: 800; }
.patient-portal-personal-photo-preview { width: 70px; height: 70px; box-sizing: border-box; border: 1px solid #c7e1e5; border-radius: 50%; object-fit: cover; background: #eef8f9; }
.patient-portal-personal-photo-field input[type="file"] { width: 100%; min-width: 0; box-sizing: border-box; padding: 7px; border: 1px dashed #b9d4da; border-radius: 9px; color: #315d6b; background: #fbfeff; font-size: .72rem; }
.patient-portal-personal-photo-field small { grid-column: 2 / -1; color: #718b92; font-size: .62rem; line-height: 1.3; }
@media (max-width: 640px) {
  .patient-portal-personal-photo-field { grid-template-columns: 68px minmax(0, 1fr); gap: 5px 9px; }
  .patient-portal-personal-photo-preview { width: 62px; height: 62px; }
}

/* Avatar del paciente: mantener la fotografía visible y legible en el portal. */
.patient-portal-dashboard__avatar,
.patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__avatar {
  width: 64px !important;
  height: 64px !important;
  flex: 0 0 64px !important;
  padding: 0 !important;
  border-radius: 50%;
  object-fit: cover !important;
  overflow: hidden;
}

/* Aislar el modal de recorte de los estilos generales del portal. */
.photo-crop-overlay,
.photo-crop-overlay * {
  box-sizing: border-box !important;
}
.photo-crop-overlay {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 16px !important;
}
.photo-crop-overlay .photo-crop-panel {
  display: flex !important;
  position: relative !important;
  flex-direction: column !important;
  width: min(500px, calc(100vw - 32px)) !important;
  height: auto !important;
  max-height: calc(100vh - 32px) !important;
  margin: 0 !important;
  padding: 22px !important;
  overflow: auto !important;
  transform: none !important;
  background: #fff !important;
  color: #173b52 !important;
}
.photo-crop-overlay .photo-crop-head,
.photo-crop-overlay .photo-crop-actions {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  flex: 0 0 auto !important;
  float: none !important;
  transform: none !important;
}
.photo-crop-overlay .photo-crop-head {
  align-items: flex-start !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 0 16px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #173b52 !important;
  box-shadow: none !important;
}
.photo-crop-overlay .photo-crop-head > div {
  display: block !important;
  position: static !important;
  min-width: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: #173b52 !important;
}
.photo-crop-overlay .photo-crop-head h2 {
  display: block !important;
  position: static !important;
  margin: 0 0 5px !important;
  color: #173b52 !important;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-transform: none !important;
}
.photo-crop-overlay .photo-crop-head p {
  display: block !important;
  position: static !important;
  margin: 0 !important;
  color: #668399 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}
.photo-crop-overlay .photo-crop-head .x {
  display: inline-grid !important;
  position: static !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  margin: 0 0 0 12px !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid #b9c8cc !important;
  border-radius: 4px !important;
  background: #f7fbfc !important;
  color: #173b52 !important;
  font-size: 1.1rem !important;
  line-height: 1 !important;
}
.photo-crop-overlay .photo-crop-stage {
  flex: 0 0 auto !important;
  width: min(360px, 100%) !important;
  height: min(360px, calc(100vw - 76px)) !important;
  min-height: 220px !important;
  margin: 0 auto !important;
}
.photo-crop-overlay .photo-crop-zoom,
.photo-crop-overlay .photo-crop-hint,
.photo-crop-overlay .photo-crop-error {
  flex: 0 0 auto !important;
}
.photo-crop-overlay .photo-crop-actions {
  align-items: center !important;
  justify-content: flex-end !important;
  width: 100% !important;
  margin: 10px 0 0 !important;
}
.photo-crop-overlay .photo-crop-actions button {
  position: static !important;
  min-height: 42px !important;
  transform: none !important;
}

/* Dar más espacio al modal principal del portal de pacientes. */
.patient-portal-modal.is-dashboard-modal .patient-portal-modal__panel {
  width: min(1180px, calc(100vw - 20px)) !important;
  max-width: 1180px !important;
}

@media (max-width: 600px) {
  .patient-portal-modal.is-dashboard-modal .patient-portal-modal__panel {
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
  }
}

@media (min-width: 701px) {
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard {
    grid-template-columns: 230px minmax(0, 1fr) !important;
    gap: 20px !important;
  }
  .patient-portal-modal.is-dashboard-modal .patient-portal-dashboard__sidebar {
    width: 230px !important;
    box-sizing: border-box !important;
  }
}

.patient-portal-glycemia-range-filter {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  padding: 15px 16px;
  border: 1px solid #cfe5e7;
  border-radius: 16px;
  background: linear-gradient(145deg, #fbfefe, #f1fafb);
}
.patient-portal-glycemia-range-filter__header {
  display: grid;
  gap: 3px;
}
.patient-portal-glycemia-range-filter__header span {
  color: #2583a2;
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .13em;
}
.patient-portal-glycemia-range-filter__header strong {
  color: #285967;
  font-size: .98rem;
}
.patient-portal-glycemia-range-filter__header small,
.patient-portal-glycemia-range-filter__status {
  color: #66818a;
  font-size: .68rem;
}
.patient-portal-glycemia-range-filter__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.patient-portal-glycemia-day-filter__field {
  width: min(100%, 420px);
}
.patient-portal-glycemia-range-filter__field {
  display: grid;
  gap: 5px;
  color: #315d6b;
  font-size: .68rem;
  font-weight: 800;
}
.patient-portal-glycemia-range-filter__field-label { color: #315d6b; font-size: .68rem; font-weight: 800; }
.patient-portal-glycemia-calendar-trigger {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: .55rem .75rem;
  border: 1px solid #bcd5da;
  border-radius: 12px;
  color: #285967;
  background: #fff;
  font: 800 .76rem Manrope, sans-serif;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.patient-portal-glycemia-calendar-trigger:hover,
.patient-portal-glycemia-calendar-trigger:focus-visible { border-color: #159fd8; outline: 0; box-shadow: 0 0 0 3px rgba(21, 159, 216, .13); }
.patient-portal-glycemia-calendar-trigger:active { transform: translateY(1px); }
.patient-portal-glycemia-calendar-trigger__icon { color: #159fd8; font-size: .9rem; }
.patient-portal-glycemia-calendar { position: absolute; z-index: 20; width: min(292px, calc(100vw - 42px)); margin-top: 7px; padding: 12px; border: 1px solid #cfe5e7; border-radius: 16px; background: #fff; box-shadow: 0 18px 40px rgba(24, 79, 95, .18); }
.patient-portal-glycemia-range-filter__field { position: relative; }
.patient-portal-glycemia-calendar__header { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; gap: 6px; margin-bottom: 10px; color: #285967; text-align: center; }
.patient-portal-glycemia-calendar__header strong { font-size: .78rem; }
.patient-portal-glycemia-calendar__nav { width: 30px; height: 30px; border: 0; border-radius: 9px; color: #2585a0; background: #edf8fa; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.patient-portal-glycemia-calendar__nav:hover:not(:disabled), .patient-portal-glycemia-calendar__nav:focus-visible { color: #fff; background: #159fd8; outline: 0; }
.patient-portal-glycemia-calendar__nav:disabled { opacity: .35; cursor: not-allowed; }
.patient-portal-glycemia-calendar__weekdays, .patient-portal-glycemia-calendar__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.patient-portal-glycemia-calendar__weekdays { margin-bottom: 5px; color: #78939b; font-size: .62rem; font-weight: 900; text-align: center; }
.patient-portal-glycemia-calendar__days { min-height: 188px; }
.patient-portal-glycemia-calendar__day { min-height: 30px; border: 0; border-radius: 9px; color: #285967; background: transparent; font: 800 .7rem Manrope, sans-serif; cursor: pointer; }
.patient-portal-glycemia-calendar__day:hover:not(:disabled), .patient-portal-glycemia-calendar__day:focus-visible { color: #fff; background: #159fd8; outline: 0; }
.patient-portal-glycemia-calendar__day.is-selected { color: #fff; background: linear-gradient(135deg, #159fd8, #1ab4a9); box-shadow: 0 5px 12px rgba(21, 159, 216, .2); }
.patient-portal-glycemia-calendar__day.is-today:not(.is-selected) { box-shadow: inset 0 0 0 2px #1ab4a9; }
.patient-portal-glycemia-calendar__day.is-disabled { color: #c2d2d5; background: transparent; cursor: not-allowed; }
.patient-portal-glycemia-calendar__day.has-records:not(.is-selected) { color: #176d82; background: #eaf8fa; box-shadow: inset 0 0 0 1px #b9e1e6; }
.patient-portal-glycemia-calendar__day.has-records:not(.is-selected):hover { color: #fff; background: #159fd8; }
.patient-portal-glycemia-calendar__hint { display: block; margin-top: 9px; color: #78939b; font-size: .6rem; line-height: 1.35; text-align: center; }
.patient-portal-glycemia-range-filter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.patient-portal-glycemia-range-filter__actions .patient-portal-button {
  min-height: 36px;
  border-radius: 11px;
  font-size: .7rem;
}
.patient-portal-glycemia-range-filter__status {
  margin: 0;
}
.patient-portal-glycemia-range-filter__empty {
  margin: 12px 0;
  padding: 14px;
  border: 1px dashed #b9d7dc;
  border-radius: 12px;
  color: #66818a;
  background: #f7fcfc;
  font-size: .72rem;
  text-align: center;
}

@media (max-width: 600px) {
  .patient-portal-glycemia-range-filter {
    padding: 13px;
  }
  .patient-portal-glycemia-range-filter__fields {
    grid-template-columns: 1fr;
  }
  .patient-portal-glycemia-range-filter__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .patient-portal-glycemia-range-filter__actions .patient-portal-button {
    width: 100%;
  }
}

.patient-portal-reservation-alert{position:fixed;inset:0;z-index:2147483647!important;display:grid;place-items:center;padding:20px;background:rgba(13,38,52,.68);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}
.patient-portal-reservation-alert__panel{width:min(100%,460px);box-sizing:border-box;padding:30px 32px 28px;border:1px solid #e7edf0;border-radius:22px;background:#fff;text-align:center;box-shadow:0 28px 90px rgba(7,31,45,.3);animation:patientReservationAlertIn .2s ease-out}
.patient-portal-reservation-alert__icon{display:grid;place-items:center;width:58px;height:58px;margin:0 auto 16px;border-radius:18px;background:linear-gradient(145deg,#e4545c,#f17b63);color:#fff;font:900 36px/1 Arial,sans-serif;box-shadow:0 10px 24px rgba(207,61,70,.23)}
.patient-portal-reservation-alert__eyebrow{display:block;margin-bottom:7px;color:#d34e57;font-size:11px;font-weight:900;letter-spacing:.16em}
.patient-portal-reservation-alert__panel h2{margin:0 0 10px;color:#173e56;font:800 23px/1.2 "Manrope",Arial,sans-serif}
.patient-portal-reservation-alert__panel p{margin:0;color:#607b89;font:700 15px/1.6 "Manrope",Arial,sans-serif}
.patient-portal-reservation-alert__close{min-width:136px;margin-top:22px;padding:12px 20px;border:0;border-radius:11px;background:#277d89;color:#fff;font:800 14px "Manrope",Arial,sans-serif;cursor:pointer}
.patient-portal-reservation-alert__close:hover{background:#1b6874}
.patient-portal-reservation-alert__close:focus-visible{outline:3px solid #7bd6de;outline-offset:3px}
@keyframes patientReservationAlertIn{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:520px){.patient-portal-reservation-alert__panel{padding:25px 21px 22px;border-radius:18px}.patient-portal-reservation-alert__panel h2{font-size:20px}.patient-portal-reservation-alert__panel p{font-size:14px}}

.patient-portal-selected-doctor { display: grid; gap: 5px; padding: 13px 15px; border: 1px solid #bfe3eb; border-radius: 13px; color: #173f50; background: linear-gradient(135deg,#effbfc,#fff); font-weight: 800; }
.patient-portal-selected-doctor span { color: #1386a3; font-size: .82rem; font-weight: 700; }

.patient-portal-field[hidden] { display: none !important; }

/* Reserva de horas adicionales y conflictos de horario. */
.patient-portal-reservation-actions { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.patient-portal-hour:disabled, .patient-portal-hour:disabled:hover { background: #edf1f2; border-color: #d5dfe1; color: #6f8388; cursor: not-allowed; opacity: .75; box-shadow: none; }
.patient-portal-hour--conflict,.patient-portal-hour--conflict:hover,.patient-portal-hour--conflict:focus-visible{background:#edf1f2;border-color:#d5dfe1;color:#71858a;cursor:help;opacity:1;box-shadow:none;outline:2px solid transparent}
.patient-portal-hour--conflict:focus-visible{outline-color:#d88b56;outline-offset:2px}
.patient-portal-hour-conflict-notice{position:absolute;z-index:5;box-sizing:border-box;display:flex;align-items:flex-start;gap:8px;width:min(300px,calc(100% - 24px));padding:8px 10px;border:1px solid #f0d3b3;border-radius:9px;background:#fff8ed;color:#744c21;box-shadow:0 8px 22px rgba(63,48,20,.16);font-size:.73rem;line-height:1.35;font-weight:700;pointer-events:none}
.patient-portal-hour-conflict-notice[hidden]{display:none}
.patient-portal-hour-conflict-notice__icon{display:grid;place-items:center;flex:none;width:19px;height:19px;border-radius:50%;background:#d9853f;color:#fff;font-weight:900}
@media (max-width: 600px) { .patient-portal-reservation-actions .patient-portal-button--primary { width: 100%; } }

/* Detalle de la encuesta de glicemia. */
.patient-portal-glycemia-row__time { font-weight: 800; }
.patient-portal-glycemia-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; line-height: 1.5; }
.patient-portal-glycemia-detail .patient-portal-glycemia-detail__time, .patient-portal-glycemia-detail .patient-portal-glycemia-answer__question { color: #193c4c; font-weight: 800; }
.patient-portal-glycemia-detail .patient-portal-glycemia-detail__answer-title { grid-column: 1 / -1; }
.patient-portal-glycemia-detail .patient-portal-glycemia-answer__response { color: #bf242c; font-weight: 800; }
.patient-portal-glycemia-detail .patient-portal-glycemia-answer__response.is-unanswered { color: #60777b; }
@media (max-width: 700px) { .patient-portal-glycemia-detail { grid-template-columns: 1fr; } }

/* Gráfico de glicemias del portal del paciente. */
.patient-portal-glycemia-chart__scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.patient-portal-glycemia-chart__area { fill: #1596b1; opacity: .08; }
.patient-portal-glycemia-chart__value { paint-order: stroke; stroke: #fbfefe; stroke-width: 5px; stroke-linejoin: round; fill: #17445e; font-size: 12px; }
.patient-portal-glycemia-chart__grid { stroke: #d7e9ed; }


/* Documento de identidad en el registro y la reserva pública. */
.patient-portal-field[hidden] { display: none !important; }
.patient-portal-document-choices {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .3rem 0 .45rem;
}
.patient-portal-document-choices label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid #b9dce6;
  border-radius: 999px;
  padding: .55rem .85rem;
  background: #f4fbfd;
  color: #174157;
  font-weight: 700;
  cursor: pointer;
}
.patient-portal-document-choices label:has(input:checked) {
  border-color: #079bb1;
  background: #dff7f8;
  box-shadow: 0 0 0 2px rgba(7,155,177,.12);
}
.patient-portal-document-choices input { accent-color: #079bb1; }
.patient-portal-field select[name="passport_country"] {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid #b9dce6;
  border-radius: .8rem;
  padding: .6rem .8rem;
  background: #fff;
  color: #174157;
}

.patient-portal-form--register .patient-portal-document-choices { grid-area: document; }
.patient-portal-form--register .patient-portal-field:has([name="rut"]),
.patient-portal-form--register .patient-portal-field:has([name="passport_number"]) { grid-area: identity; }
.patient-portal-form--register .patient-portal-field:has([name="passport_country"]) { grid-area: country; }
.patient-portal-form--register .patient-portal-field:has([name="nombres"]) { grid-area: nombres; }
.patient-portal-form--register .patient-portal-field:has([name="apellidos"]) { grid-area: apellidos; }
.patient-portal-form--register .patient-portal-field:has([name="email"]) { grid-area: email; }
.patient-portal-form--register .patient-portal-field:has([name="telefono"]) { grid-area: telefono; }
.patient-portal-form--register .patient-portal-field:has([name="direccion"]) { grid-area: direccion; }
.patient-portal-form--register .patient-portal-field:has([name="region_id"]) { grid-area: region; }
.patient-portal-form--register .patient-portal-field:has([name="city_id"]) { grid-area: ciudad; }
.patient-portal-form--register .patient-portal-field:has([name="commune_id"]) { grid-area: comuna; }
.patient-portal-form--register {
  grid-template-areas:
    "document document"
    "identity email"
    "nombres apellidos"
    "telefono direccion"
    "region ciudad"
    "comuna comuna";
}
.patient-portal-form--register:has([name="document_type"][value="passport"]:checked) {
  grid-template-areas:
    "document document"
    "identity country"
    "nombres apellidos"
    "email telefono"
    "direccion direccion"
    "region ciudad"
    "comuna comuna";
}

/* Lista de países con bandera, igual a la ficha médica. */
.patient-portal-field select[name="passport_country"][hidden] { display: none !important; }
.patient-portal-country-combo { position: relative; width: 100%; }
.patient-portal-country-combo > input { padding-right: 44px !important; }
.patient-portal-country-flag,
.patient-portal-country-emoji {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.patient-portal-country-flag { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(18,57,77,.12); }
.patient-portal-country-emoji { font: 17px/1 "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }
.patient-portal-country-flag[hidden],
.patient-portal-country-emoji[hidden],
.patient-portal-country-menu[hidden] { display: none !important; }
.patient-portal-country-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  max-height: 210px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #cce4eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(13,52,72,.2);
}
.patient-portal-country-menu.opens-up { top: auto; bottom: calc(100% + 3px); }
.patient-portal-country-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #173f59;
  text-align: left;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
}
.patient-portal-country-option img { flex: 0 0 auto; width: 20px; height: 15px; object-fit: cover; border-radius: 2px; }
.patient-portal-country-option:hover,
.patient-portal-country-option:focus { background: #e9f8fa; outline: none; color: #087f96; }
.patient-portal-country-empty { display: block; padding: 10px; color: #688594; font-size: .78rem; }
