/* Reset básico */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Layout principal */
body {
  margin: 0;
  background: #f4f6fb;
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
header {
  width: 100%;
  background: #003366;
  box-shadow: 0 2px 10px rgba(0,0,0,0.14);
  color: white;
}
.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.7rem 2rem;
  box-sizing: border-box;
  flex-wrap: wrap;
}
.logo-titulo {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo-header {
  height: 50px;
  width: 50px;
  object-fit: contain;
}
.titulo-header {
  font-family: 'Georgia', serif;
  font-size: 2rem;
  font-weight: 700;
  color: #ffd700;
  letter-spacing: 2px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.usuario-foto {
  width: 46px;         /* Ancho y alto iguales */
  height: 46px;
  border-radius: 50%;  /* Esto hace círculo perfecto */
  border: 2px solid #ffd700;
  object-fit: cover;
  background: #fff;
  display: block;      /* Para que se respete tamaño */
   transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}


.usuario-foto:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
  filter: brightness(1.1);
}



.foto-wrapper {
  position: relative;
  display: inline-block;
}

.icono-editar {
  cursor: pointer;
  position: absolute;
  bottom: 0;
  right: 0;
  background: white;
  border-radius: 50%;
  padding: 2px;
  width: 20px;
  height: 20px;
  stroke: #003366;
  stroke-width: 2;
  transition: stroke 0.3s ease;
}

.icono-editar:hover {
  stroke: #ffd700;
}

.usuario-nombre {
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
}
.usuario-rol {
  font-weight: 600;
  color: #ffd700;
  font-size: 0.95rem;
}
.cerrar-sesion {
  color: #ffd700;
  text-decoration: none;
  font-weight: bold;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s;
  font-size: 0.96rem;
}
.cerrar-sesion:hover {
  color: #003366;
  background: #ffd700;
}

/* DASHBOARD */
main {
  flex: 1 1 auto;
  width: 100vw;
  min-height: 1px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: block;
}
.container {
  border-radius: 0;
  margin: 0;
  padding: 1rem 0;
  width: 100vw;
  min-width: 100vw;
  max-width: 100vw;
  box-sizing: border-box;
  text-align: center;
  min-height: 56vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* MENU OPCIONES */
.menu-opciones {
  margin: 1rem 0;
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  max-width: 180px;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  background: rgba(255,215,0,0.85);   /* Elegante y algo translúcido */
  box-shadow: 0 2px 6px rgba(0,0,0,0.11);
  border-radius: 12px;
  color: #003366;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
  margin-bottom: 0.2rem;
}

.menu-item:hover {
  background-color: #003366;
  color: #ffd700;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
}

.icono-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icono {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  margin-bottom: 0.18rem;
  margin-top: 0.05rem;
}

.texto-item {
  display: block;
  margin-top: 0.10rem;
  font-size: 1rem;
  color: #003366;
  font-weight: 700;
  text-align: center;
}

/* Responsive: para móvil los botones ocupan casi todo el ancho */

/* FOOTER */


/* Marca de agua */
.mark-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.20;
  pointer-events: none;
  user-select: none;
  text-align: center;
  color: #003366;
  font-family: 'Georgia', serif;
  font-size: 9rem;
  font-weight: bold;
  z-index: 0;
  white-space: nowrap;
}
.mark-watermark img {
  display: block;
  margin: 0 auto 1rem auto;
  width: 140px;
  height: auto;
  opacity: 0.25;
}



/* RESPONSIVO - MOBILE */


@media (max-width: 600px) {
  .header-main {
    flex-direction: column;
    align-items: center;        /* Lo importante: centrar todo horizontalmente */
    justify-content: center;    /* Opcional para centrar verticalmente en área */
    padding: 1rem 0.5rem;
    gap: 1rem;
  }

  .logo-titulo {
    justify-content: center;    /* Centra logo y título juntos */
    width: 100%;
  }

  .user-info {
    justify-content: center;    /* Centra la info usuario, foto y link */
    width: 100%;
    margin-top: 0.5rem;
  }


  .titulo-header {
    font-size: 1.24rem;
  }
  .usuario-nombre,
  .usuario-rol,
  .cerrar-sesion {
    font-size: 0.95rem;
  }
  .container {
    max-width: 99vw;
    width: 99vw;
    margin: 1.2rem 0;
    padding: 0.8rem 0.1rem;
    min-height: 66vh;
    border-radius: 0;
    box-shadow: none;
  }
  
  .menu-opciones {
    gap: 0.6rem;
  }
  .menu-item {
    width: 90vw;
    max-width: 95vw;
    font-size: 1rem;
    padding: 0.7rem 0.2rem;
  }
  .icono {
    width: 38px;
    height: 38px;
  }
  .mark-watermark {
    font-size: 3rem;
  }
  .mark-watermark img {
    width: 90px;
  }
}



/* Ultra pequeño */
@media (max-width: 370px) {
  .header-main {
    gap: 0.3rem;
  }
  .container {
    padding: 0.5rem 0.05rem;
    min-height: 70vh;
  }
  .footer {
    font-size: 0.85rem;
    padding: 6px 0;
  }
  .mark-watermark {
    font-size: 2rem;
  }
  .mark-watermark img {
    width: 44px;
  }
}


@media (max-width: 600px) {
  .menu-opciones {
    gap: 0.7rem;
  }
  .menu-item {
    min-width: 80vw;
    max-width: 95vw;
    width: 96vw;
    margin-bottom: 0.25rem;
    font-size: 0.97rem;
    padding: 0.5rem 0.2rem;
  }
  .icono {
    width: 28px;
    height: 28px;
  }
  .texto-item {
    font-size: 0.93rem;
    margin-top: 0.08rem;
  }
}

@media (max-width: 600px) {
  .menu-opciones {
    gap: 0.7rem;
  }
  .menu-item {
    min-width: 80vw;
    max-width: 95vw;
    width: 96vw;
    margin-bottom: 0.25rem;
    font-size: 0.97rem;
    padding: 0.5rem 0.2rem;
  }
  .icono {
    width: 28px;
    height: 28px;
  }
  .texto-item {
    font-size: 0.93rem;
    margin-top: 0.08rem;
  }
}


body.login-page {
  background: url('../img/fondo1.jpg') no-repeat center center fixed;
  background-size: cover;
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
}

.login-container {
  width: 360px;
  max-width: 95vw;
  margin: auto;
  margin-top: 56px;
  margin-bottom: 90px;
  background: rgba(255,255,255,0.93);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.16);
  text-align: center;
  padding: 2.5rem 3rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.login-container form label {
  display: block;
  font-weight: 600;
  margin: 1.2em 0 0.2em 0;
  text-align: left;
}

.login-container input[type="text"],
.login-container input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: 6px;
  border: 1.7px solid #ccc;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.login-container button[type="submit"] {
  width: 100%;
  background-color: #2575fc;
  color: white;
  padding: 14px 0;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-bottom: 12px;
}

.login-container button[type="submit"]:hover {
  background-color: #1a52b8;
}

.login-error-message {
  color: #d93025;
  font-size: 0.9rem;
  margin-top: -0.8rem;
  margin-bottom: 1rem;
  text-align: left;
}

input.error {
  border-color: #d93025;
  box-shadow: 0 0 6px rgba(217,48,37,0.3);
}

/* Footer */
body.login-page {
  background: url('../img/fondo1.jpg') no-repeat center center fixed;
  background-size: cover;
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
}

.login-container {
  width: 360px;
  max-width: 95vw;
  margin: auto;
  margin-top: 56px;
  margin-bottom: 90px;
  background: rgba(255,255,255,0.93);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.16);
  text-align: center;
  padding: 2.5rem 3rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.login-container form label {
  display: block;
  font-weight: 600;
  margin: 1.2em 0 0.2em 0;
  text-align: left;
}

.login-container input[type="text"],
.login-container input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: 6px;
  border: 1.7px solid #ccc;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.login-container button[type="submit"] {
  width: 100%;
  background-color: #2575fc;
  color: white;
  padding: 14px 0;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-bottom: 12px;
}

.login-container button[type="submit"]:hover {
  background-color: #1a52b8;
}

.login-error-message {
  color: #d93025;
  font-size: 1rem;
  margin: 12px 0 20px 0;   /* Espacio arriba y abajo */
  padding: 7px 0;
  text-align: center;
  font-weight: 500;
  background: rgba(255,255,255,0.96);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(217,48,37,0.10);
  min-height: 28px;        /* ¡Nunca menos que esto! */
  z-index: 2;
  display: block;
}


input.error {
  border-color: #d93025;
  box-shadow: 0 0 6px rgba(217,48,37,0.3);
}

/* Footer */
.footer {
  text-align: center;
  padding: 16px 0 20px 0;
  background-color: rgba(15, 18, 25, 0.88);
  color: white;
  font-size: 1.05rem;
  width: 100%;
  
  left: 0;
  bottom: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  letter-spacing: 0.04em;
  z-index: 10;

}

.input-wrapper {
  position: relative;
  margin-bottom: 18px;
}

.input-wrapper input[type="text"],
.input-wrapper input[type="password"] {
  width: 100%;
  padding: 10px 38px 10px 40px;    /* espacio a la izquierda para el icono, derecha para eye */
  border-radius: 8px;
  border: 1.6px solid #ccc;
  font-size: 1rem;
  background: #F2F4F5;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 30%;
  transform: translateY(-52%);
  width: 20px;
  height: 20px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}



.toggle-password {
  position: absolute;
  right: 8px;
  top: 30%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0;
}

.login-error-area {
  height: 26px;                /* reserva espacio para el error siempre */
  margin-bottom: 10px;
  text-align: center;
  color: #d93025;
  font-size: 1rem;
  font-weight: 500;
  transition: opacity 0.4s;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-error-area.active {
  opacity: 1;
}

/* Estilo para el select del rol */
#rol_id {
  width: 100%;
  padding: 8px 12px;
  font-size: 1rem;
  border: 1.8px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  color: #34495e;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  appearance: none; /* Quita el estilo por defecto */
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2334435e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

#rol_id:focus {
  outline: none;
  border-color: #27ae60;
  box-shadow: 0 0 6px rgba(39,174,96,0.5);
}

/* Opciones */
#rol_id option {
  padding: 8px;
  font-size: 1rem;
  color: #34495e;
  background-color: #fff;
}

/* Opciones al pasar el mouse */
#rol_id option:hover {
  background-color: #f0f8ff;
  color: #27ae60;
}

.input-group {
  position: relative;
  margin-bottom: 1.1rem;
}
.input-group .icon-input {
  position: absolute;
  left: 13px; /* Espacio lateral acorde al tamaño */
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 2;
}
input[type="text"], input[type="password"] {
  width: 100%;
  padding-left: 40px; /* > que el ancho SVG + espacio extra */
  padding-right: 42px;
  box-sizing: border-box;
  font-size: 1rem;
  border-radius: 7px;
  border: 1.8px solid #ccc;
  color: #34495e;
  background: #fff;
  line-height: 1.15;
}
input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: #989ca3;
  font-size: 1rem;
  font-family: inherit;
  margin-left: 0;
}
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.toggle-password svg { stroke: #1d72e7; width: 19px; height: 19px; }
.icon-input.user { stroke: #0ea960; }
.icon-input.password { stroke: #e1a300; }

#custom-loader-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(245,245,245,0.93);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s;
}
.custom-loader-spinner {
    border: 7px solid #f3f3f3;
    border-radius: 50%;
    border-top: 7px solid #4b70de;
    width: 68px; height: 68px;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}
@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}
.custom-loader-text {
    color: #2e3c5b;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 1px;
}
