/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  height: 100%;
  font-family: Arial, sans-serif;
  background: #000 url("../img/fondo.webp") no-repeat center center fixed;
  background-size: cover;
  color: #ddd;
  overflow-x: hidden;
  transition: opacity 1.2s ease;
}

/* Oculta elementos */
.hidden {
  display: none !important;
}

/* Contenedor general - tabla flotante con margen */
body > *:not(.modal) {
  max-width: 1200px;
  margin: 15px auto;
  background: rgba(20, 20, 20, 0.85);
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.9);
  padding: 0;
}

/* NAV_SUP */
#nav_sup {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  font-size: 1rem;
  background: rgba(30,30,30,0.7);
  border-bottom: 1px solid #444;
  color: #eee;
  flex-direction: row-reverse;

}

.language-selector button {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  margin-right: 8px;
  color: #eee;
  transition: color 0.3s ease;
}
.language-selector button:hover {
  color: #1e90ff;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #444;
  background: rgba(25, 25, 25, 0.85);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  max-height: 50px;
  width: auto;
  border-radius: 6px;
}

.logo_med {
  max-height: 300px;
  width: auto;
  border-radius: 6px;
  align-items: center;

}

.site-title {
  font-size: 1.8rem;
  color: #eee;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #eee;
}

.user-info {
  font-size: 1rem;
}

.btn {
  background-color: #1e90ff;
  border: none;
  padding: 8px 14px;
  color: white;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
  font-size: 1rem;
  user-select: none;
}

.btn:hover {
  background-color: #0056b3;
}

/* Nav principal - menú horizontal */
#nav_mn_1 {
  background: rgba(25, 25, 25, 0.85);
  border-top: 1px solid #444;
  border-bottom: 1px solid #444;
}

.menu-horizontal {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 10px 0;
}

.menu-horizontal li a {
  color: #eee;
  font-size: 1.1rem;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

.menu-horizontal li a:hover,
.menu-horizontal li a.active {
  background-color: #1e90ff;
  color: white;
}

/* Main dividido en tres secciones verticales con ajuste dinámico */
main {
  display: flex;
  gap: 15px;
  padding: 20px 30px;
  min-height: 400px;
  background: rgba(30, 30, 30, 0.85);
  border-radius: 0 0 10px 10px;
}

/* Left y right pueden ocultarse si están vacíos */
#left:empty,
#right:empty {
  display: none;
}

/* Ajuste dinámico flex para content según presencia de left y right */
/* Nota: Este selector no funciona para ajustar flex directamente, usamos JS para esto */

#left,
#right {
  flex: 1;
  background: rgba(40, 40, 40, 0.8);
  border-radius: 6px;
  padding: 15px;
  min-height: 200px;
  color: #ccc;
  overflow-y: auto;
}

#content {
  flex: 2;
  background: rgba(50, 50, 50, 0.9);
  border-radius: 6px;
  padding: 25px;
  color: #eee;
  min-height: 200px;
  overflow-y: auto;
}

/* Lower - frase */
#lower {
  text-align: center;
  padding: 12px 0;
  font-style: italic;
  color: #888;
  background: rgba(25, 25, 25, 0.85);
  border-top: 1px solid #444;
  border-bottom: 1px solid #444;
  margin: 20px 30px 0 30px;
  border-radius: 6px;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px 30px;
  font-size: 0.9rem;
  color: #bbb;
  background: rgba(25, 25, 25, 0.85);
  border-top: 1px solid #444;
  border-radius: 0 0 10px 10px;
  margin: 0 30px 30px 30px;
}

/* Modal fondo oscuro transparente */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Contenido del modal */
.modal-content {
  background-color: #222;
  padding: 1.5rem;
  border-radius: 10px;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
  color: #fff;
  position: relative;
}

/* Botón cerrar */
.close {
  position: absolute;
  top: 0.3rem;
  right: 0.5rem;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
}

/* iframe para login */
.modal-content iframe {
  width: 100%;
  height: 300px;
  border: none;
  border-radius: 6px;
  background-color: #111;
}

/* Fade in para body */
.fade-in {
  animation: fadeInAnim 0.8s ease forwards;
}

@keyframes fadeInAnim {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */

@media (max-width: 900px) {
  main {
    flex-direction: column;
    padding: 15px;
  }

  #left, #right {
    min-height: 150px;
    width: 100%;
  }

  #content {
    min-height: 200px;
    width: 100%;
    margin-bottom: 15px;
  }

  #nav_mn_1 ul {
    flex-direction: column;
    gap: 10px;
    padding: 15px 0;
  }

  #nav_mn_1 li a {
    padding: 10px;
    font-size: 1.2rem;
  }
}

@media (max-width: 400px) {
  .header-left h1 {
    font-size: 1.2rem;
  }

  .header-right {
    font-size: 0.9rem;
  }

  .btn {
    padding: 6px 10px;
    font-size: 0.9rem;
  }
}
/* ==== Estilos para el formulario Registro de Horas ==== */

.registro-horas-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #222;
}

.registro-horas-titulo {
  text-align: center;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  color: #2c3e50;
}

.registro-horas-mensaje {
  background-color: #e0f7e9;
  border: 1px solid #27ae60;
  color: #27ae60;
  padding: 0.75rem 1rem;
  margin-bottom: 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
}

.registro-horas-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.registro-horas-group {
  display: flex;
  flex-direction: column;
}

.registro-horas-label {
  margin-bottom: 0.3rem;
  font-weight: 600;
  color: #34495e;
}

.registro-horas-input,
.registro-horas-select,
.registro-horas-textarea {
  padding: 0.5rem 0.75rem;
  border: 1.8px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.25s ease;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.registro-horas-input:focus,
.registro-horas-select:focus,
.registro-horas-textarea:focus {
  border-color: #2980b9;
  outline: none;
  box-shadow: 0 0 6px rgba(41, 128, 185, 0.3);
}

.registro-horas-textarea {
  resize: vertical;
  min-height: 100px;
}

.registro-horas-resumen {
  background-color: #f7f9fc;
  border: 1px solid #2980b9;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: 700;
  color: #2980b9;
}

.registro-horas-btn-guardar {
  background-color: #2980b9;
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  align-self: center;
  width: 100%;
  max-width: 180px;
}

.registro-horas-btn-guardar:hover,
.registro-horas-btn-guardar:focus {
  background-color: #1c5980;
  outline: none;
}

@media (max-width: 600px) {
  .registro-horas-container {
    padding: 1rem;
  }
  .registro-horas-btn-guardar {
    max-width: 100%;
  }
}
/* ==== Tabla principal y responsiva con prefijo único ==== */

.tabla-principal {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #000;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-radius: 10px;
  overflow: hidden;
  table-layout: fixed;
}

.tabla-principal thead {
  background: linear-gradient(90deg, #2980b9, #3498db);
  color: #fff;
  font-weight: 700;
  user-select: none;
}

.tabla-principal thead th {
  padding: 14px 18px;
  text-align: left;
  white-space: nowrap;
}

.tabla-principal tbody tr {
  border-bottom: 1px solid #e1e8f0;
  transition: background-color 0.3s ease;
}

.tabla-principal tbody tr:hover {
  background-color: #f0f8ff;
}

.tabla-principal tbody td {
  padding: 12px 18px;
  vertical-align: middle;
  word-wrap: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tabla-principal tbody tr:last-child {
  border-bottom: none;
}

/* Acciones columna */
.tabla-principal .acciones {
  text-align: center;
  white-space: nowrap;
}

/* Botones tabla */
.tabla-principal .btn-tabla {
  background-color: #2980b9;
  border: none;
  color: #fff;
  padding: 6px 12px;
  margin: 0 3px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  user-select: none;
  display: inline-block;
  text-decoration: none;
}

.tabla-principal .btn-tabla.eliminar {
  background-color: #e74c3c;
}

.tabla-principal .btn-tabla:hover,
.tabla-principal .btn-tabla:focus {
  opacity: 0.85;
  outline: none;
}

/* Responsive - Móvil */
@media (max-width: 768px) {
  .tabla-principal thead {
    display: none;
  }
  .tabla-principal, 
  .tabla-principal tbody, 
  .tabla-principal tr, 
  .tabla-principal td {
    display: block;
    width: 100%;
  }
  .tabla-principal tr {
    margin-bottom: 1rem;
    border: 1px solid #d1d9e6;
    border-radius: 10px;
    padding: 10px 15px;
  }
  .tabla-principal tbody td {
    padding-left: 50%;
    position: relative;
    text-align: left;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
    border: none;
    border-bottom: 1px solid #eee;
  }
  .tabla-principal tbody td:last-child {
    border-bottom: none;
  }
  .tabla-principal tbody td::before {
    content: attr(data-label);
    position: absolute;
    left: 15px;
    top: 12px;
    font-weight: 700;
    color: #2980b9;
    white-space: nowrap;
  }
}

/* -----------------------pop up editar-------------------------- */
#modal-editar.modal-overlay {
  display: none; /* oculto por defecto */
  /* ... */
}
#modal-editar.modal-overlay.active {
  display: flex;
}

