/* Estilos Base y Resets */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1400px; /* Usamos este para ser consistentes */
    margin: auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

h1 {
    color: #1e3a8a;
    text-align: center;
    margin-bottom: 10px;
}

p.subtitle {
    text-align: center;
    margin-bottom: 25px;
    color: #64748b;
}

/* Estilos para el calendario */
  
        
/* Días de Montaje (Naranja) */
    .day-card.montaje {
        background-color: #ffca8d; /* Naranja vibrante */
        border: 2px solid #ffa217;
        color: rgb(255, 255, 255);
    }
        /* Nuevo estilo para días con múltiples montajes coincidentes */
.day-card.multiple-montaje {
    background-color: #d998ff; /* Morado (Purple) */
    border: 3px solid #b618ff;
    color: white; /* Para que el texto sea legible sobre el morado */
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

#prev-month, #next-month {
    background-color: #1e3a8a;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

#prev-month:hover, #next-month:hover {
    background-color: #1a2a6b;
}

#current-month-year {
    font-size: 1.5em;
    color: #1e3a8a;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

/* Estilos de los bloques del calendario y el menú (heredados) */
.day-card {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 15px; /* Valor original del calendario */
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    cursor: pointer;
    min-height: 150px; /* Valor original del calendario */
    text-decoration: none; /* Para los enlaces del menú */
    color: #333; /* Para los enlaces del menú */
}

/* Sobreescribimos .day-card para los enlaces del menú con una clase específica si es necesario */
.menu-grid .day-card {
    min-width: 180px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}


.day-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.day-card.verde { background-color: #dcfce7; border-color: #22c55e; }
.day-card.amarillo { background-color: #fef9c3; border-color: #f59e0b; }
.day-card.rojo { background-color: #fee2e2; border-color: #ef4444; }
.day-card.azul-claro { background-color: #e0f2fe; border-color: #3b82f6; }
.day-card.azul-oscuro { background-color: #bfdbfe; border-color: #1e40af; }
.day-card.out-of-month { background-color: #e2e8f0; border-color: #94a3b8; color: #94a3b8; }
.day-card.weekend-day {
    background-color: #f0f4f7;
    border-color: #d1d5db;
    color: #9ca3af;
}
.day-card.today { border: 2px solid #1e3a8a; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }

.day-card .date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.day-card .date-header .date {
    font-size: 1.2em;
    font-weight: bold;
    color: #1e40af;
}
.day-card .date-header .day-name {
    font-size: 0.9em;
    color: #64748b;
}
.hours-summary {
    font-size: 0.9em;
    color: #333;
    margin-bottom: 10px;
}
.hours-summary .occupied {
    font-weight: bold;
}
.task-list-summary {
    font-size: 0.8em;
    color: #64748b;
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.task-list-summary li {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 0;
}
.task-item-link {
    text-decoration: none;
    color: #64748b;
}
.weekend-day .task-item-link {
    color: #9ca3af !important;
}

/* Leyenda del calendario */
.legend-container {
    margin-top: 40px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.legend-item {
    display: inline-block;
    margin: 0 15px;
    font-size: 0.9em;
    color: #666;
}
.legend-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid #ddd;
}
.legend-color.verde { background-color: #dcfce7; border-color: #22c55e; }
.legend-color.amarillo { background-color: #fef9c3; border-color: #f59e0b; }
.legend-color.rojo { background-color: #fee2e2; border-color: #ef4444; }
.legend-color.azul-claro { background-color: #e0f2fe; border-color: #3b82f6; }
.legend-color.montaje {
    background-color: #ff9800; /* Igual que el día de montaje */
    border-color: #e65100;
}
.legend-color.multiple-montaje {
    background-color: #d998ff; /* Morado (Purple) */
    border: 2px solid #b618ff;
}
.legend-color.sin-montaje {
    background-color: white; /* Igual que el día sin montaje */
    border: 2px solid #8b8b8b;
}
.menu-grid {
    display: grid;
    /* 2. Define 4 columnas de igual ancho */
    grid-template-columns: repeat(4, 1fr); 
    
    /* 3. Mantiene el espaciado (gap) */
    gap: 15px;
    
    /* 4. Mantiene el centrado de la cuadrícula completa */
    justify-content: center;
    max-width: 800px; /* Ajusta este valor según necesites centrar el bloque */
    margin: auto; /* Centra el bloque .menu-grid en la página */
    padding: 20px;
}
/* ---------------------------------------------------- */
/* Estilos específicos para dispositivos móviles */
/* ---------------------------------------------------- */


@media (max-width: 800px) {
    .menu-grid {
        grid-template-columns: 1fr; 
    }
}
.day-card.admin-link {
    background-color: #e0f2fe;
}

/* Reset básico para elementos de formulario */
input, select, button, textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.1;
    margin:auto;
}

/* Estilos de Formularios Generales */
.form-card {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: auto;
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
select:not([multiple]) {
    width: 100%;
    padding: 0.5rem 0.6rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:not([multiple]):focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.7rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-primary-small {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    white-space: nowrap;
    display: inline-block;
}

.btn-primary-small:hover {
    background-color: #0056b3;
}

.message-error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.message-success {
    color: #28a745;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.no-users-message {
    text-align: center;
    padding: 1.5rem;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 1rem;
}

/* ========================================================================= */
/* Estilos del Menú de Navegación                                           */
/* ========================================================================= */

.nav-menu {
    background: #fff;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    /* Si el menú es fijo en algún momento, asegúrate de que no cause problemas en móvil.
       Si no usas position: fixed; para el menú principal, no debería haber problema de scroll. */
    /* position: fixed; /* Si lo tienes, piensa si lo necesitas en móvil */
    /* top: 0; */
    /* left: 0; */
    /* width: 100%; */
    /* z-index: 1000; */
}

.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.nav-menu a:hover {
    background: #007bff;
    color: #fff;
}

/* ========================================================================= */
/* Estilos de Bloques del Menú Principal (ej. en index.html)               */
/* ========================================================================= */

.menu-bloques {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    padding: 1rem;
    max-width: 800px;
    margin: auto;
}

.bloque {
    display: block;
    text-align: center;
    background: #ffffff;
    padding: 1.2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.bloque:hover {
    background-color: #007bff;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bloque:active,
.bloque:focus {
    outline: none;
    background-color: #0056b3;
    color: #fff;
}

/* ========================================================================= */
/* Estilos de Formularios de Filtro (ej. en ver_tarea.php)                  */
/* ========================================================================= */
.filter-form {
    margin-bottom: 1.5rem; /* Espacio debajo del formulario de filtro */
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-wrap: wrap; /* Permite que los elementos se envuelvan en pantallas pequeñas */
    gap: 0.8rem; /* Espacio entre los elementos del formulario */
    align-items: flex-end; /* Alinea los elementos a la parte inferior (útil con labels y inputs) */
}

.filter-form label {
    margin-bottom: 0; /* Anula el margin-bottom del label general */
    display: flex; /* Para alinear el input/select con su label */
    flex-direction: column; /* Coloca el input debajo del label */
    font-weight: normal; /* Labels de filtro pueden ser más ligeros */
    font-size: 0.85rem;
}

.filter-form input[type="date"],
.filter-form select.filter-select {
    /* Herada del input/select general, pero con ajustes */
    width: auto; /* Permite que el ancho se ajuste al contenido */
    max-width: 150px; /* Limita el ancho para que no sean demasiado grandes */
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    margin-bottom: 0; /* Anula el margin-bottom general */
}

.filter-form input[type="date"] {
    min-width: 120px; /* Asegura un ancho mínimo para los campos de fecha */
}

/* El botón de filtrar se manejará con .btn-primary-small */
.filter-form .btn-primary-small {
    margin-left: revert; /* Empuja el botón a la derecha si hay espacio */
    margin-top: 1rem; /* Espacio superior para que no se pegue al elemento anterior en móvil */
    align-self: flex-end; /* Alinea el botón a la parte inferior si el contenedor es un flex container */
}


/* ========================================================================= */
/* Estilos de Tabla de Administración (kodiadmin.php y ver_tarea.php)       */
/* ========================================================================= */

/* Contenedor principal de la página de administración/listado */
.admin-main-content {
    max-width: 1000px; /* Aumentado para las tareas si es necesario, o déjalo en 900px */
    margin: auto;
    padding: 1rem;
    box-sizing: border-box;
}

h2 {
    text-align: center;
    color: #333;
    margin-bottom: 1.5rem;
}

/* Contenedor para scroll horizontal en tablas grandes (responsive) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    color: #333;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    cursor: grab; /* cursor de agarre */
    user-select: none; /* evitar selección de texto al arrastrar */
}

.table-responsive.active {
    cursor: grabbing; /* cursor cuando arrastras */
}


/* Estilos de la tabla (usada tanto en kodiadmin como en ver_tarea) */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
    min-width: 768px; /* Ajusta este valor según el ancho de tus columnas para evitar el colapso excesivo antes del scroll */
}

.admin-table th,
.admin-table td {
    border: 1px solid #eee;
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: middle;
}

.admin-table thead tr {
    background: #007bff;
    color: #000000;
}

.admin-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.admin-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Formularios inline dentro de las celdas de la tabla */
.form-inline {
    display: inline-block;
    margin: 0;
    vertical-align: middle;
}

/* Estilos base para los botones/enlaces dentro de la tabla */
.admin-table .btn {
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    color: white; /* Color de texto base para botones de tabla */
    text-decoration: none; /* Para enlaces que se ven como botones */
    display: inline-block; /* Permite control de padding/margin */
    transition: background-color 0.2s ease-in-out;
}

/* Estilo para el botón/enlace de eliminar */
a.btn.btn-info {
 color: #000000;
}


/* Estilo para el botón/enlace de eliminar */
.admin-table .btn-delete {
    background: #dc3545; /* Rojo */
}

.admin-table .btn-delete:hover {
    background-color: #c82333; /* Rojo más oscuro */
}

/* Estilo para el botón/enlace de editar (nuevo) */
.admin-table .btn-edit {
    background: #ffc107; /* Amarillo/Naranja de advertencia */
    color: #333; /* Texto oscuro para contraste */
    margin-right: 0.5rem; /* Espacio entre botones si hay varios */
}

.admin-table .btn-edit:hover {
    background-color: #e0a800; /* Naranja más oscuro */
}

/* Clase para el select de rol dentro de la tabla (ya existía, pero la dejo para recordar) */
.admin-table select.rol-select {
    max-width: 120px;
    width: auto;
    padding: 0.2rem 0.4rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out;
    cursor: pointer;

    /* Para personalizar la apariencia del select */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.65em auto;
    padding-right: 1.5rem;
}

.admin-table select.rol-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.admin-table select.rol-select:hover {
    border-color: #999;
}

/* Alineación de la columna de acciones y celdas de texto */
.admin-table td:last-child {
    text-align: center;
    white-space: nowrap;
}

.text-center-cell { /* Nueva clase para centrar texto en cualquier celda */
    text-align: center;
}

.no-actions-text { /* Estilo para el guion cuando no hay acciones */
    color: #6c757d; /* Color gris suave */
    font-style: italic;
    font-size: 0.9rem;
}

/* ========================================================================= */
/* Estilos para el Historial de Tareas (en editar_tarea.php)                 */
/* ========================================================================= */

.task-log {
  background: #fdfdfd;
  padding: 1.2rem;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-top: 2rem; /* Espacio superior para separarlo del formulario */
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.task-log h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #555;
  text-align: center; /* Centrar el título del historial */
}

.task-log ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.task-log li {
  background-color: #f9f9f9;
  border-bottom: 1px dashed #eee;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  color: #444;
}

.task-log li:last-child {
  border-bottom: none;
}

/* Si usas .no-actions-text para el mensaje "No hay historial" */
.task-log .no-actions-text {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 0.5rem;
}
/* Calendario tareas*/
table {
    border-collapse: collapse;
    width: 100%;
    font-family: monospace;
    font-size: 14px;
}
th, td {
    border: 1px solid #888;
    padding: 4px 6px;
    text-align: center;
    vertical-align: middle;
}
th {
    background: #eee;
    position: sticky;
    top: 0;
    z-index: 2;
}
thead th:nth-child(1),
tbody td:nth-child(1) {
    position: sticky;
    left: 0;
    background: #f5f5f5;
    z-index: 3;
    min-width: 100px;
}
thead th:nth-child(2),
tbody td:nth-child(2) {
    position: sticky;
    left: 100px;
    background: #f5f5f5;
    z-index: 3;
    min-width: 120px;
    text-align: left;
    padding-left: 6px;
}
thead th:nth-child(3),
tbody td:nth-child(3) {
    position: sticky;
    left: 220px;
    background: #f5f5f5;
    z-index: 3;
    min-width: 220px;
    text-align: left;
    padding-left: 6px;
}
thead th:nth-child(4),
tbody td:nth-child(4) {
    position: sticky;
    left: 440px;
    background: #f5f5f5;
    z-index: 3;
    min-width: 80px;
}
thead th:nth-child(5),
tbody td:nth-child(5) {
    position: sticky;
    left: 520px;
    background: #f5f5f5;
    z-index: 3;
    min-width: 120px;
}
thead th:nth-child(6),
tbody td:nth-child(6) {
    position: sticky;
    left: 640px;
    z-index: 3;
    min-width: 120px;
}
td.ocupado {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

/* Estos colores deben ser coherentes con los de las filas */
/* Estados colores generales para filas */
tr.estado-registrada, td.estado-registrada {
    background-color: #d1e7dd; /* Verde muy claro - Tarea creada */
    color: #0f5132; /* Verde oscuro */
    font-weight: bold;
}

tr.estado-aceptada, td.estado-aceptada {
    background-color: #cff4fc; /* Azul cielo muy claro - Tarea lista */
    color: #055160; /* Azul petróleo oscuro */
    font-weight: bold;
}

tr.estado-pendiente, td.estado-pendiente {
    background-color: #fff3cd; /* Amarillo pastel - A la espera */
    color: #664d03; /* Marrón oscuro */
    font-weight: bold;
}

/* Estado genérico "en proceso" - Usado si no hay una clase específica de área */
tr.estado-en-proceso, td.estado-en-proceso {
    background-color: #dbe4ff; /* Azul lavanda claro - Procesando (genérico) */
    color: #3f51b5; /* Azul índigo */
    font-weight: bold;
}

tr.estado-finalizado, td.estado-finalizado {
    background-color: #fa5858; /* Verde suave - Completado */
    color: #000000; /* Verde oscuro casi negro */
    font-weight: bold;
}

tr.estado-cancelada, td.estado-cancelada {
    background-color: #f8d7da; /* Rojo muy claro - Anulada */
    color: #842029; /* Rojo oscuro */
    font-weight: bold;
    text-decoration: line-through;
}

/* --- Colores específicos para CADA ÁREA (fases "en proceso") --- */
/* Estas clases se aplicarían directamente a la CELDA de estado si quieres color por área */
/* Si quieres que TODA LA FILA cambie de color según el área, el PHP debería poner tr.estado-[nombre_area] */
/* Por ahora, aplicamos a la celda del estado para no afectar la fila completa de 'en-proceso' */

/* Oficina Técnica */
td.estado-oficina-tecnica {
    background-color: #e0f2f7; /* Azul pálido */
    color: #2196f3; /* Azul medio */
}

/* Soldadura Alta Frecuencia */
td.estado-soldadura-alta-frecuencia {
    background-color: #fff3e0; /* Naranja/Amarillo claro */
    color: #ff9800; /* Naranja vibrante */
}

/* Corte (tall) */
td.estado-tall { /* La clave es 'tall', aunque se muestre 'Corte' */
    background-color: #fce4ec; /* Rosa muy claro */
    color: #e91e63; /* Rosa oscuro */
}

/* Costura */
td.estado-costura {
    background-color: #e8f5e9; /* Verde claro */
    color: #4caf50; /* Verde medio */
}

/* Taller */
td.estado-taller {
    background-color: #ede7f6; /* Morado muy claro */
    color: #673ab7; /* Morado oscuro */
}

/* Acabados */
td.estado-acabats { /* La clave es 'acabats', aunque se muestre 'Acabados' */
    background-color: #fffde7; /* Crema */
    color: #ffc107; /* Amarillo ámbar */
}

/* Montaje */
td.estado-muntatge { /* La clave es 'muntatge', aunque se muestre 'Montaje' */
    background-color: #e1f5fe; /* Azul cielo muy claro */
    color: #03a9f4; /* Azul cielo */
}

/* Gerencia */
td.estado-gerencia {
    background-color: #f3e5f5; /* Púrpura muy claro */
    color: #9c27b0; /* Púrpura */
}

/* Administración */
td.estado-administracion {
    background-color: #e0f7fa; /* Cian muy claro */
    color: #00bcd4; /* Cian */
}

/* Expediciones */
td.estado-expedicions {
    background-color: #ffe0b2; /* Naranja muy claro */
    color: #fb8c00; /* Naranja */
}

/* Envío */
td.estado-enviament {
    background-color: #b3e5fc; /* Azul pálido fuerte */
    color: #0288d1; /* Azul intenso */
}

/* Otros */
td.estado-otros {
    background-color: #cfd8dc; /* Gris muy claro */
    color: #546e7a; /* Gris oscuro */
}

/* Para los días ocupados en el calendario (celdas de la derecha) */
.calendario-table td.ocupado {
    background-color: #f0f0f0; /* Gris muy claro */
    color: #333; /* Texto oscuro */
}
.calendario-table td.ocupado a {
    color: #333; /* Color del enlace dentro de la celda ocupada */
}

.fin-semana {
    background-color: #c7c417;
    color: #6d6d6d;}
    .calendario-table {
        min-width: 1200px; /* o el ancho necesario para mostrar todas las columnas */
        border-collapse: collapse;
        margin-top: 1rem;
        background: #fdfdfd;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        border-radius: 8px;
        overflow: hidden;
    }

.estado-finalitzat {
    opacity: 0.6;
}
.fecha-entrega {
    color: #fff;
    font-weight: bold;
}
    
/* Horas disponibles */
    .resumen-horas {
        margin-bottom: 20px;
        padding: 10px;
        background: #f9f9f9;
        border-left: 5px solid #4caf50;
        font-size: 14px;
    }
    .resumen-horas h3 {
        margin-top: 0;
    }
    .resumen-horas ul {
        margin: 0;
        padding-left: 20px;
    }
    .resumen-horas li {
        margin-bottom: 4px;
    }
    .flex-horiz {
        display: flex;
        gap: 2rem;
        align-items: flex-start;
        flex-wrap: wrap; /* opcional, por si el espacio es reducido */
    }
    
    .flex-horiz > div {
        min-width: 300px;
    }
    .resumen-horas {
        justify-content: center;
    }
    /* Estilo para las celdas de gestión externa */
td.gest-externa {
    background-color: #f7e6a0; /* Color amarillo claro para indicar gestión externa */
    border: 1px dashed #d4c585; /* Borde discontinuo para diferenciarlo del trabajo interno */
}

/* Estilos para el calendario de produccion */
.capacity-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.capacity-table th, .capacity-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}
.capacity-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}
/* AÑADIR ESTE ESTILO PARA EL CONTENEDOR */
.table-container {
    max-height: 500px;
    overflow-y: auto;
    position: relative;
    border: 1px solid #ddd;
    margin-top: 20px;
}
/* AÑADIR ESTE ESTILO PARA LA CABECERA FIJA */
.capacity-table thead th {
    position: sticky;
    top: 0;
    background-color: #f2f2f2;
    z-index: 10;
}
/* Estilos para las filas y celdas */
.capacity-table tr.status-blanco td {
    background-color: #fff; /* Blanco */
}
.capacity-table tr.status-normal td {
    background-color: #d4edda; /* Verde claro */
}
.capacity-table tr.status-alto td {
    background-color: #fff3cd; /* Amarillo claro */
}
.capacity-table tr.status-saturado td {
    background-color: #f8d7da; /* Rojo claro */
    font-weight: bold;
}
/* Estilos para la leyenda */
.legend-container {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}
.legend-container ul {
    list-style-type: none;
    padding: 0;
}
.legend-container li {
    margin-bottom: 8px;
}
.legend-container li::before {
    content: '•';
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}
.legend-container li.status-blanco::before { color: #888; }
.legend-container li.status-normal::before { color: #28a745; }
.legend-container li.status-alto::before { color: #ffc107; }
.legend-container li.status-saturado::before { color: #dc3545; }
/* Estilos para los colores de la leyenda */
.legend-container .status-blanco {
    background-color: #fff;
}
.legend-container .status-normal {
    background-color: #d4edda;
}
.legend-container .status-alto {
    background-color: #fff3cd;
}
.legend-container .status-saturado {
    background-color: #f8d7da;
}

/* Opcional: Para el borde de los "puntos" de la leyenda */
.legend-container .status-blanco::before {
    border: 1px solid #ccc;
}
/*Detalles tarea*/
.tabs-container {
    margin-top: 30px;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
}
.tabs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    border-bottom: 2px solid #ccc;
}
.tab-link {
    padding: 10px 15px;
    cursor: pointer;
    background-color: #eee;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    margin-right: 5px;
    border: 1px solid #ccc;
    border-bottom: none;
    font-weight: bold;
}
.tab-link.current {
    background-color: #fff;
    border-bottom: 2px solid #fff;
    color: #007bff;
}
.tab-content {
    display: none;
    padding: 20px 0;
}
.tab-content.current {
    display: block;
}
.upload-form, .note-form {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    background-color: #fafafa;
}
.upload-form input[type="file"], .note-form textarea {
    display: block;
    width: 100%;
    margin-bottom: 10px;
}
.attachment-list, .note-list {
    list-style: none;
    padding: 0;
}
.attachment-item {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}
.image-thumbnail {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.image-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.file-icon {
    font-size: 2em;
    margin-right: 15px;
    color: #007bff;
}
.file-link {
    text-decoration: none;
    color: #0056b3;
    font-weight: bold;
}
.note-list li {
    background-color: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

/* Botón de Eliminar para tablas, con tamaño pequeño */
.btn-danger-small {
    background-color: #dc3545; /* Fondo rojo */
    color: #fff; /* Texto blanco */
    border: 1px solid #dc3545; /* Borde rojo */
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    text-decoration: none; /* Asegura que no tenga subrayado */
    display: inline-block; /* Permite aplicar padding y margin */
}

.btn-danger-small:hover {
    background-color: #c82333; /* Rojo más oscuro al pasar el ratón */
    border-color: #c82333;
}
/* ------------------------------------------- */
/* ESTILOS PARA EL CONTADOR ROJO DE NOTIFICACIÓN */
/* ------------------------------------------- */

/* 1. Hace que el elemento padre (el enlace) sirva de referencia para el posicionamiento */
.pendientes-link {
    position: relative; 
}

/* 2. Estilo y posicionamiento del contador */
.badge-pendiente {
    /* Posicionamiento absoluto para flotar fuera del enlace */
    position: absolute;
    top: -10px;    /* Mueve la burbuja 10px hacia arriba */
    right: -10px;  /* Mueve la burbuja 10px hacia la derecha */
    
    /* Estilo visual y tamaño */
    background-color: #dc3545 !important; /* Asegura el color rojo (Bootstrap danger) */
    color: white; 
    padding: 0.5em 0.5em; 
    font-size: 0.9em; 
    line-height: 1; 
    min-width: 1.5em; /* Asegura un círculo/píldora mínimo */
    text-align: center;
    
    /* Borde blanco para destacarlo (opcional, estilo WhatsApp) */
    border: 2px solid white; 
    border-radius: 60px;
    
    /* Asegura que no se muestre si está vacío (aunque el PHP ya lo maneja) */
    display: inline-block;
}
.header-controls {
    display: flex; /* Permite que los elementos se coloquen uno al lado del otro */
    justify-content: space-between; /* Distribuye el espacio entre los elementos */
    align-items: center; /* Alinea verticalmente los elementos */
    margin-bottom: 20px; /* Añade un espacio debajo del contenedor */

}

.btn.btn-primary-small {
    text-decoration: none;
}

   /* Control calidad */

        .seccion { margin-top: 20px; padding: 15px; border: 1px solid #f0f0f0; border-radius: 6px; background-color: #f9f9f9; }
        .item { margin-bottom: 15px; padding: 10px; border-bottom: 1px dotted #ccc; }
        .item:last-child { border-bottom: none; }
        label { font-weight: bold; display: block; margin-bottom: 5px; }
        input[type="text"], input[type="number"], textarea { width: 98%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; margin-top: 5px; }
        .opciones input[type="radio"] { margin-right: 2px; }
        .opciones label { display: inline-block; font-weight: normal; margin-right: 15px; }
        .opciones .number-input, .opciones .text-input-opc { width: auto; min-width: 150px; margin-left: 10px; display: inline-block; }
        .opciones .text-input-opc { width: 200px; } /* Ajuste de ancho para el campo de texto opcional */
        .btn-group { margin-top: 30px; text-align: right; }
        .btn-group button { padding: 10px 20px; margin-left: 10px; border: none; border-radius: 4px; cursor: pointer; }
        .btn-finalizar { background-color: #007bff; color: white; }
        .btn-bloqueado { background-color: #f44336; color: white; opacity: 0.6; cursor: not-allowed; }
        .error-message { 
             background-color: #fdd; 
             border: 1px solid #f00; 
             color: #a00; 
             padding: 10px; 
             border-radius: 5px; 
             margin-bottom: 20px; 
        }
        .info-message { 
             background-color: #d9edf7; 
             border: 1px solid #bce8f1; 
             color: #31708f; 
             padding: 10px; 
             border-radius: 5px; 
             margin-bottom: 20px; 
        }
        
        /* CAMBIOS DE ESTILO CLAVE */
        h2 { 
            display: flex; 
            align-items: center; 
            justify-content: space-between; 
        }
        .btn-toggle { 
            padding: 5px 10px; 
            background-color: #5bc0de; 
            color: white; 
            border: none; 
            border-radius: 4px; 
            cursor: pointer; 
            font-size: 14px; 
            margin-left: 15px; 
        }