/* =========================
   MENÚ DE PERFIL
========================= */

.header-actions {
  position: relative;
  display: flex;
  align-items: center;
}

.perfil-wrapper {
  position: relative;
}

.perfil-boton {
  min-height: 46px;
  max-width: 260px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.perfil-boton:hover,
.perfil-boton[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.22);
}

.perfil-avatar {
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #117b5f;
  font-weight: 800;
}

.perfil-datos-header {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.perfil-nombre-header,
.perfil-rol-header {
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perfil-nombre-header {
  font-weight: 700;
  font-size: 14px;
}

.perfil-rol-header {
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.8;
}

.perfil-menu {
  position: absolute;
  z-index: 5000;
  top: calc(100% + 9px);
  right: 0;
  width: min(290px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid #dedbd5;
  border-radius: 15px;
  background: #fff;
  color: #222;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.18);
}

.perfil-menu[hidden] {
  display: none !important;
}

.perfil-menu-info {
  padding: 17px;
}

.perfil-menu-nombre {
  margin-bottom: 12px;
  color: #116f57;
  font-size: 18px;
  font-weight: 800;
}

.perfil-menu-linea {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: #666;
  font-size: 13px;
}

.perfil-menu-linea strong {
  max-width: 160px;
  overflow-wrap: anywhere;
  color: #222;
  text-align: right;
}

.perfil-menu-separador {
  height: 1px;
  background: #ece9e4;
}

.perfil-menu-opcion {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 17px;
  border: 0;
  background: #fff;
  color: #222;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  text-align: left;
}

.perfil-menu-opcion:hover {
  background: #f4f7f6;
}

.perfil-menu-opcion.peligro {
  color: #b42318;
}

.perfil-menu-opcion.peligro:hover {
  background: #fff1f0;
}

/* =========================
   MODAL CAMBIAR CONTRASEÑA
========================= */

#mCambiarPassword.modal {
  position: fixed !important;
  inset: 0 !important;

  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;

  width: 100vw !important;
  max-width: none !important;
  min-width: 0 !important;

  height: 100vh !important;
  max-height: none !important;
  min-height: 0 !important;

  margin: 0 !important;
  padding: 20px !important;

  border: 0 !important;
  border-radius: 0 !important;

  z-index: 9000;

  display: none;
  align-items: center;
  justify-content: center;

  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.48);
}

#mCambiarPassword.modal.open {
  display: flex;
}

#mCambiarPassword[hidden] {
  display: none !important;
}

#mCambiarPassword .modal-box {
  position: relative !important;

  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;

  width: min(100%, 480px) !important;
  max-width: 480px !important;
  min-width: 0 !important;

  max-height: calc(100vh - 40px);
  overflow-y: auto;

  margin: 0 !important;
  padding: 22px;

  border-radius: 18px;
  background: #fff;

  box-sizing: border-box;

  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.28);
}

#mCambiarPassword .modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}

#mCambiarPassword .modal-header h3 {
  margin: 0;
  font-size: 22px;
}

#mCambiarPassword .modal-subtitulo {
  margin: 6px 0 0;
  color: #777;
  font-size: 13px;
  line-height: 1.45;
}

#mCambiarPassword .modal-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 0;
  border-radius: 50%;
  background: #f1f1ef;
  color: #333;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

#mCambiarPassword .modal-close:hover {
  background: #e7e7e3;
}

#mCambiarPassword .form-group {
  margin-bottom: 16px;
}

#mCambiarPassword .form-group label {
  display: block;
  margin-bottom: 7px;
  color: #333;
  font-weight: 600;
  font-size: 14px;
}

#mCambiarPassword .password-control {
  position: relative;
}

#mCambiarPassword .password-control input {
  width: 100%;
  height: 45px;
  padding: 0 48px 0 13px;
  border: 1px solid #d7d4ce;
  border-radius: 10px;
  background: #fff;
  color: #222;
  font: inherit;
  box-sizing: border-box;
}

#mCambiarPassword .password-control input:focus {
  outline: 0;
  border-color: #1d9e75;
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.14);
}

#mCambiarPassword .password-ver {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 36px;
  height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

#mCambiarPassword .password-ver:hover {
  background: #edf4f1;
}

#mCambiarPassword .password-ayuda {
  display: block;
  margin-top: 6px;
  color: #777;
  font-size: 12px;
}

#mCambiarPassword .password-mensaje {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 9px;
  background: #fff1f0;
  color: #b42318;
  font-size: 13px;
}

#mCambiarPassword .password-mensaje.exito {
  background: #eaf8f2;
  color: #087553;
}

#mCambiarPassword .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

#mCambiarPassword .modal-actions .btn {
  min-width: 130px;
}

body.modal-open {
  overflow: hidden;
}

.perfil-menu-opcion[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .perfil-rol-header {
    display: none;
  }

  .perfil-nombre-header {
    max-width: 95px;
  }

  .perfil-boton {
    max-width: 175px;
  }

  .perfil-menu {
    position: fixed;
    top: 65px;
    right: 12px;
  }

  #mCambiarPassword.modal {
    align-items: flex-end;
    padding: 10px;
  }

  #mCambiarPassword .modal-box {
    width: 100%;
    max-height: 90vh;
    border-radius: 18px 18px 10px 10px;
  }

  #mCambiarPassword .modal-actions {
    flex-direction: column-reverse;
  }

  #mCambiarPassword .modal-actions .btn {
    width: 100%;
  }
}