/* Estilos Generales */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
    margin: 0;
}

/* Estilos para las páginas de Login y Registro */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.auth-card {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-card h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #0056b3;
}

.auth-card form p {
    text-align: left;
    display: flex;
    flex-direction: column;
}

.auth-card label {
    margin-bottom: 5px;
    font-weight: 500;
}

.auth-card input {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-bottom: 15px;
}

.auth-card button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.auth-card button:hover {
    background-color: #0056b3;
}

.auth-card .sublink {
    margin-top: 20px;
    font-size: 14px;
}

.auth-card .sublink a {
    color: #007bff;
    text-decoration: none;
}

/* === Estilos para Tooltips Inteligentes === */
.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted black;
  cursor: help;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 220px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  
  /* Posicionamiento base */
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -110px; /* Centrado por defecto */
  
  opacity: 0;
  transition: opacity 0.3s;
}

/* Modificador para cuando el tooltip se sale por la izquierda */
.tooltip .tooltiptext.right-aligned {
    left: 0;
    margin-left: 0;
}

/* Modificador para cuando se sale por la derecha */
.tooltip .tooltiptext.left-aligned {
    left: auto;
    right: 0;
    margin-left: 0;
}

.tooltip:hover .tooltiptext,
.tooltip:focus .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Estilo base para todos los botones y enlaces-botón */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    text-decoration: none; /* Quita el subrayado de los enlaces */
    transition: all 0.2s ease-in-out;
}

/* Botón Principal (Azul) */
.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Botón Secundario (Gris) */
.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}
.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Botón de Peligro (Rojo) */
.btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}
.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}
/* === Estilos para Formularios en Panel Lateral === */
.side-panel-form p {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.side-panel-form label {
    flex-basis: 40%; /* Ancho de la etiqueta */
    padding-right: 10px;
    text-align: right;
    font-weight: 500;
    font-size: 0.9em;
}

.side-panel-form input,
.side-panel-form select {
    flex-grow: 1; /* El campo de entrada ocupa el resto del espacio */
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* Estilo para los checkboxes, que se comportan diferente */
.side-panel-form p:has(input[type="checkbox"]) {
    justify-content: flex-start;
}

.side-panel-form p:has(input[type="checkbox"]) label {
    text-align: left;
    order: 2; /* Pone la etiqueta después del checkbox */
}

.side-panel-form p:has(input[type="checkbox"]) input {
    flex-grow: 0;
    margin-right: 10px;
}

/* === Estilos para la Tabla de Detalles (entry_list.html) === */

/* 1. Contenedor principal para dar márgenes */
.table-container {
    width: 95%; /* Hacemos que la "hoja" ocupe el 95% del ancho de la ventana */
    max-width: 95%; /* CAMBIO: Eliminamos el límite fijo de 1400px y lo hacemos porcentual */
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Estilo para hacer la tabla responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Estilos generales de la tabla */
.table {
    width: 100%;
    border-collapse: collapse;
}

/* Estilos para la cabecera (títulos) */
.table thead th {
    text-align: center;
    padding: 12px 15px;
    border-top: 2px solid #343a40;
    border-bottom: 2px solid #343a40;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap; /* Evita que los títulos se partan */
}

/* Estilos para las celdas y filas de datos */
.table tbody td {
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}

/* Alinear la primera columna (Nombre) a la izquierda */
.table tbody td:first-child {
    text-align: left;
    white-space: normal; /* Permitimos que los nombres largos sí se partan */
}

/* === Estilos para la cabecera de las páginas de contenido === */
.content-header {
    display: flex;
    justify-content: space-between; /* Empuja el título y el botón a los extremos */
    align-items: center; /* Los alinea verticalmente */
    margin-bottom: 1.5rem; /* Espacio antes de la tabla */
}

.content-header h2 {
    margin: 0; /* Quitamos el margen por defecto del h2 */
}

/* === Estilos para la cabecera de las páginas de contenido === */
.content-header {
    display: flex;
    justify-content: space-between; /* Empuja el título y el botón a los extremos */
    align-items: center; /* Los alinea verticalmente */
    margin-bottom: 1.5rem; /* Espacio antes de la tabla */
    border-bottom: 2px solid #343a40; /* Línea de separación como en la cabecera de la tabla */
    padding-bottom: 15px;
}

.content-header h2 {
    margin: 0; /* Quitamos el margen por defecto del h2 */
}

/* === Estilos para el pie de las páginas de contenido === */
.content-footer {
    display: flex;
    justify-content: flex-end; /* Alinea los elementos hijos (el botón) a la derecha */
    margin-top: 1.5rem; /* Espacio por encima del botón */
}
