/* ==========================================================================
   TABLA DE CONTENIDOS
   1. Variables Globales
   2. Reset y Estilos Base
   3. Cabecera y Menú
   4. Componentes Generales (Botones y Utilidades)
   5. Módulos de Inicio (Slider e Información)
   6. Formularios (Incluye estados bloqueados)
   7. Panel de Administración
   8. Reportes y Filtros (Pestañas y Cuadrículas)
   9. Inicio de Sesión (Login)
   10. Pie de Página
   11. Media Queries (Adaptación a Móviles)
   ========================================================================== */

/* --- 1. Variables Globales --- */
:root {
  /* Paleta Institucional */
  --color-primario: #006341; /* Verde */
  --color-secundario: #58595B; /* Gris */
  --color-acento: #C5A866; /* Dorado */
  --color-peligro: #dc3545; /* Rojo para alertas/logout */
  
  /* Radios y Espaciados */
  --radio-pildora: 50px;
}

/* --- 2. Reset y Estilos Base --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-secundario);
  background-image: url('../IMG/fondoformu.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
}

/* --- 3. Cabecera y Menú --- */
header {
  background-color: var(--color-primario);
  color: white;
  padding: 10px 20px;
  position: relative;
  z-index: 10;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo img {
  height: 50px;
}

.menu-toggle {
  display: none;
  font-size: 24px;
  cursor: pointer;
}

.menu {
  display: flex;
  list-style: none;
  gap: 15px;
}

.menu li a {
  color: white;
  text-decoration: none;
  padding: 8px 12px;
  display: block;
  transition: background-color 0.3s ease, border-radius 0.3s ease;
}

.menu li a:hover {
  background-color: var(--color-acento);
  border-radius: 4px;
}

/* Clase específica para Cerrar Sesión en el menú superior */
.menu li a.menu-logout {
  color: #ffb3b3; /* Un rojo claro para que resalte sobre el verde sin lastimar la vista */
  font-weight: bold;
}

.menu li a.menu-logout:hover {
  background-color: var(--color-peligro);
  color: white;
  border-radius: 4px;
}

/* --- 4. Componentes Generales (Botones y Utilidades) --- */
.btn-pildora {
  background-color: var(--color-primario);
  color: white;
  border: 2px solid var(--color-primario);
  padding: 12px 28px;
  cursor: pointer;
  border-radius: var(--radio-pildora);
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.btn-pildora:hover {
  background-color: var(--color-acento);
  border-color: var(--color-acento);
  color: white;
  box-shadow: 0 4px 15px rgba(197, 168, 102, 0.4);
}

.btn-secundario {
  background-color: var(--color-secundario);
  border-color: var(--color-secundario);
}

.btn-secundario:hover {
  background-color: var(--color-acento);
  border-color: var(--color-acento);
  color: white;
  box-shadow: 0 4px 15px rgba(197, 168, 102, 0.4);
}

.capitalize { text-transform: capitalize; }
.uppercase { text-transform: uppercase; }

/* --- 5. Módulos de Inicio (Slider e Información) --- */
.slider-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 80px auto 40px auto;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.slider-wrapper {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.slider-wrapper img {
  width: 100%;
  flex-shrink: 0;
  object-fit: cover;
  height: 300px;
}

.slider-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  padding: 0 10px;
  box-sizing: border-box;
}

.slider-nav button {
  background-color: rgba(0, 99, 65, 0.8);
  border: none;
  color: white;
  font-size: 24px;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.slider-nav button:hover {
  background-color: rgba(0, 99, 65, 1);
}

.contenedor-info {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  max-width: 1000px;
  margin: 40px auto;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  text-align: center;
}

.contenedor-info .titulo {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
  color: white;
}

.contenedor-info p {
  margin-bottom: 20px;
}

/* --- 6. Formularios --- */
.contenedor-formulario {
  max-width: 720px;
  margin: 40px auto;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-top: 6px solid var(--color-primario);
}

.contenedor-formulario h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--color-primario);
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--color-primario);
  font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background-color: #fefefe;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  color: var(--color-secundario);
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--color-primario);
  outline: none;
  box-shadow: 0 0 5px rgba(0, 99, 65, 0.2);
}

.form-group input:disabled,
.form-group textarea:disabled,
.form-group select:disabled {
  background-color: #e9ecef;
  color: #555;
  font-weight: bold;
  border: 1px solid #ced4da;
  cursor: not-allowed;
  opacity: 1;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.full-width {
  grid-column: 1 / -1;
}

.submit-button {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 30px;
}

/* --- 7. Panel de Administración --- */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 20px 30px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  max-width: 1400px;
  margin: 30px auto;
  border-left: 6px solid var(--color-primario);
}

.admin-header .info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.admin-header img {
  height: 60px;
}

.admin-header h1 {
  font-size: 1.5rem;
  color: var(--color-primario);
  margin: 0;
}

.admin-header p {
  margin: 0;
  color: var(--color-secundario);
}

/* Botón de Cerrar Sesión en panel admin */
.btn-salir {
  color: var(--color-peligro);
  text-decoration: none;
  font-weight: bold;
  padding: 10px 24px;
  border: 2px solid var(--color-peligro);
  border-radius: var(--radio-pildora);
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-salir:hover {
  background-color: var(--color-peligro);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 0, 25, 0.4);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto 40px auto;
}

.admin-modulo {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 40px 30px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border-top: 4px solid var(--color-primario);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.admin-modulo figure { margin-bottom: 20px; }
.admin-modulo img { height: 70px; object-fit: contain; }
.admin-modulo h3 { color: var(--color-primario); margin-bottom: 15px; font-size: 1.2rem; }
.admin-modulo p { color: var(--color-secundario); font-size: 14px; margin-bottom: 25px; }

/* --- 8. Reportes y Filtros (Pestañas y Cuadrículas) --- */
.tabs-container {
  display: flex;
  gap: 5px;
  margin-bottom: 0; 
  padding-left: 10px;
  max-width: 1400px; 
  margin: 0 auto;
  overflow-x: auto; 
}

.tab-button {
  padding: 12px 25px;
  background-color: #d1d8dd; 
  border: none;
  border-radius: 8px 8px 0 0; 
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  color: var(--color-secundario);
  transition: all 0.2s ease;
}

.tab-button:hover { background-color: #c0c6ca; }

.tab-button.active {
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--color-primario); 
  border-top: 4px solid var(--color-primario);
  box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
  z-index: 2; 
}

.filtros {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 0 8px 8px 8px;
  margin: 0 auto 30px auto;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  position: relative;
  z-index: 1;
  max-width: 1400px; 
}

.filtros input[type="text"],
.filtros input[type="date"],
.filtros select {
  padding: 10px 15px;
  margin: 5px;
  border: 1px solid #ccc;
  border-radius: var(--radio-pildora);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  color: var(--color-secundario);
}

.grid-resultados {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1400px; 
  margin: 0 auto;
}

/* --- 9. Inicio de Sesión (Login) --- */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 380px;
  text-align: center;
  border-top: 6px solid var(--color-primario);
}

.login-container .logos {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 1.5rem;
}

.login-container .logos img { height: 45px; max-width: 45%; object-fit: contain; }
.login-container h2 { color: var(--color-primario); margin-bottom: 1.5rem; font-weight: bold; font-size: 1.5rem; }

/* --- 10. Pie de Página --- */
footer.pie-pagina {
  background-color: var(--color-primario);
  color: white;
  padding: 20px;
  margin-top: 40px;
}

.pie-pagina .grupo-1 {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  margin-bottom: 10px;
}

.pie-pagina .box { flex: 1 1 250px; margin: 10px; }
.pie-pagina .box h2 { margin-bottom: 10px; font-size: 18px; }

.social-icons a {
  color: #fff;
  background-color: var(--color-secundario);
  margin: 0 5px;
  padding: 10px;
  border-radius: 50%;
  display: inline-block;
  font-size: 18px;
  text-decoration: none;
}

.social-icons a:hover { background-color: var(--color-acento); }

.pie-pagina .grupo-2 {
  text-align: center;
  font-size: 14px;
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- 11. Media Queries --- */
@media (max-width: 768px) {
  .menu {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: var(--color-primario);
    padding-top: 10px;
  }
  .menu li { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); }
  .menu-toggle { display: block; color: white; }
  .menu.active { display: flex; }
  .slider-wrapper img { height: 200px; }
  .admin-header { flex-direction: column; text-align: center; gap: 20px; }
  .admin-header .info { flex-direction: column; }
  .pie-pagina .grupo-1 { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .contenedor-formulario { margin: 20px; padding: 20px; }
  .filtros input[type="text"], .filtros input[type="date"], .filtros select { width: 100%; margin: 5px 0; }
}


/* Ajustes para los iconos SVG */
.svg-container svg {
    width: 60px; /* Tamaño del icono */
    height: 60px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.admin-modulo:hover svg {
    transform: scale(1.1); /* Ligera animación al pasar el mouse */
    stroke: #006400; /* Cambio a verde institucional al hover */
}