/* Dashboard de Horarios de Trabajadores - Diseño con listas y barras horizontales */
.worker-dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Usar el estilo fichaje-canvas original sin fondo blanco */
.fichaje-canvas {
    display: block;
    padding: 12px 12px 20px 12px;
    margin-bottom: 15px;
}

.fichaje-canvas.error {
    border-left-color: red;
}

.fichaje-canvas.success {
    border-left-color: #000b82;
}

.fichaje-canvas.warning {
    border-left-color: orange;
}

/* Mensajes de estado */
.status-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
}

.status-message svg {
    opacity: 0.7;
}

.status-message h3 {
    margin: 0;
    color: #fff;
}

/* Animación de carga */
.loading-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Header del dashboard */
.dashboard-header {
    display: flex;
    justify-content: center;
    align-items: center;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-selector label {
    font-weight: 600;
    color: #fff;
}

.date-selector input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wp-element-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.wp-element-button svg {
    width: 16px;
    height: 16px;
}

/* Lista de trabajadores */
.workers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.worker-item {
    display: block;
    padding: 15px;
}

.worker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.worker-name {
    font-size: 18px;
    font-weight: 600;
    color: #eee;
    margin: 0;
}

.worker-summary {
    font-size: 12px;
    color: #888;
    font-weight: normal;
}

/* Lista de trabajos */
.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.job-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border-left: 3px solid #ddd;
    margin-bottom: 8px;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.job-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.job-title svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.job-name {
    font-weight: 600;
    color: #eee;
    margin: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-time-info {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 2px;
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
}

.job-schedule {
    font-size: 12px;
    color: #ccc;
    font-weight: 500;
}

.job-status {
    font-size: 11px;
    font-weight: 500;
    color: #fff;
}

.job-time-relative {
    font-size: 11px;
    color: #88ff00;
    font-style: italic;
    margin-top: -4px;
}

.job-progress-container {
    width: 100%;
}

.job-progress-bar {
    width: 100%;
    height: 22px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.job-progress-fill {
    height: 100%;
    background: #8f0;
    transition: width 0.5s ease;
}

.job-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 500;
    color: #fff;
    z-index: 2;
}

.job-status {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: #ccc;
    margin-left: 10px;
}

/* Estados de trabajos */
.job-item.no-iniciado {
    border-left-color: #9e9e9e;
}

.job-item.no-iniciado .job-progress-fill {
    background: rgba(158, 158, 158, 0.3);
}

.job-item.no-iniciado .job-title svg {
    color: #9e9e9e;
}

.job-item.en-progreso {
    border-left-color: #FF9800;
    animation: progress-pulse 2s ease-in-out infinite;
}

.job-item.en-progreso .job-progress-fill {
    background: #FF9800;
}

.job-item.en-progreso .job-title svg {
    color: #FF9800;
    animation: icon-pulse 1.5s ease-in-out infinite;
}

.job-item.completado {
    border-left-color: #8f0;
}

.job-item.completado .job-progress-fill {
    background: #7cb342;
}

.job-item.completado .job-title svg {
    color: #8f0;
}

.job-item.deberia-iniciar {
    border-left-color: #FF9800;
}

.job-item.deberia-iniciar .job-progress-fill {
    background: #FF9800;
}

.job-item.deberia-iniciar .job-title svg {
    color: #FF9800;
}

.job-item.vencido .job-progress-fill {
    background: #F44336;
}

.job-item.vencido .job-title svg {
    color: #F44336;
}

/* Animaciones para estados */
@keyframes progress-pulse {
    0% {
        border-left-color: #FF9800;
        box-shadow: 0 0 0 rgba(255, 152, 0, 0.4);
    }

    50% {
        border-left-color: #ffffff;
        box-shadow: 0 0 10px 5px rgba(255, 255, 255, 0.6);
    }

    100% {
        border-left-color: #FF9800;
        box-shadow: 0 0 0 rgba(255, 152, 0, 0.4);
    }
}

@keyframes icon-pulse {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 0.8;
        transform: scale(1);
    }
}

@keyframes blink-border {
    0% {
        border-left-color: #F44336;
        box-shadow: 0 0 3px rgba(244, 67, 54, 0.2);
        opacity: 1;
    }

    50% {
        border-left-color: #ff5722;
        box-shadow: 0 0 10px 5px F44336;
        opacity: 0.85;
    }

    100% {
        border-left-color: #F44336;
        box-shadow: 0 0 3px rgba(244, 67, 54, 0.2);
        opacity: 1;
    }
}

.job-item.vencido {
    border-left-color: #F44336;
    animation: blink-border 2s ease-in-out infinite;
}

/* Header del dashboard usando el estilo fichaje-canvas */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h2 {
    margin: 0;
    color: #eee;
    flex: 1;
}

.date-selector {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
}

.date-selector label {
    font-weight: 600;
    color: #fff;
}

.date-selector input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Usar el estilo de botones existente */
.wp-element-button {
    padding: 8px 15px !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

/* Grid de trabajadores usando fichaje-canvas */
.workers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.worker-block {
    display: block;
    border-radius: 5px;
    border: 1px solid #fff;
    border-left: 4px solid #0073aa;
    padding: 10px 10px 24px 10px;
    background: white;
}

.worker-name {
    margin: 0 0 15px 0;
    color: #eee;
    font-size: 18px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 4px;
}

.tasks-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Rectángulos de tareas usando el estilo de botones wp-element-button */
.task-rectangle {
    position: relative;
    width: 120px;
    height: 140px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    border: none;
    text-decoration: none;
}

.task-rectangle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Barra de progreso usando el estilo existente */
.task-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000b82;
    transition: height 0.5s ease;
    z-index: 1;
    display: block;
}

.task-info {
    position: relative;
    z-index: 2;
    padding: 8px;
    background: rgba(255, 255, 255, 0.95);
    margin-top: auto;
    text-align: center;
    font-size: 12px;
    line-height: 1.3;
    display: block;
    overflow: hidden;
}

.centro-name {
    display: block;
    font-weight: 600;
    color: #eee;
    margin-bottom: 4px;
}

.time-range {
    display: block;
    color: #ccc;
    font-size: 11px;
}

.progress-text {
    display: block;
    color: #88ff00;
    font-weight: 600;
    font-size: 10px;
    margin-top: 2px;
}

/* Estados de tareas usando los colores del sistema existente */
.task-rectangle.no-iniciado {
    background-color: #f0f0f0;
    color: #ccc;
}

.task-rectangle.no-iniciado .task-progress {
    background: #ccc;
}

.task-rectangle.en-progreso {
    background-color: #ff9800;
    color: #3D3D3D;
}

.task-rectangle.en-progreso .task-progress {
    background: #e08700;
}

.task-rectangle.completado {
    background-color: #00cc00;
    color: #FFFFFF;
}

.task-rectangle.completado .task-progress {
    background: #000b82;
}

.task-rectangle.completado .task-info {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

.task-rectangle.deberia-iniciar {
    background-color: #ff9800;
    color: #3D3D3D;
}

.task-rectangle.deberia-iniciar .task-progress {
    background: #e08700;
}

.task-rectangle.vencido {
    background-color: #dc3545;
    color: #FFFFFF;
    animation: blink 1s infinite;
}

.task-rectangle.vencido .task-progress {
    background: #c82333;
}

.task-rectangle.vencido .task-info {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

/* Animación de parpadeo para tareas vencidas */
@keyframes blink {

    0%,
    50% {
        opacity: 1;
        transform: scale(1);
    }

    51%,
    100% {
        opacity: 0.6;
        transform: scale(0.98);
    }
}

/* Estados de carga y error */
#loading-indicator {
    text-align: center;
    padding: 40px;
    color: #ccc;
    font-size: 16px;
}

#error-message {
    margin: 20px 0;
    padding: 15px;
    border-left: 4px solid #dc3232;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.no-data h3 {
    color: #555;
    margin-bottom: 10px;
}

/* Estadísticas usando el estilo fichaje-canvas */
.dashboard-stats h3 {
    margin: 0 0 15px 0;
    color: #eee;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #0073aa;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #88ff00;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Leyenda usando el estilo fichaje-canvas */
.legend h3 {
    margin: 0 0 15px 0;
    color: #eee;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 4px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

.color-sample {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.color-sample.no-iniciado {
    background-color: #f0f0f0;
}

.color-sample.en-progreso {
    background: linear-gradient(to top, #e08700 50%, #ff9800 50%);
}

.color-sample.completado {
    background-color: #00cc00;
}

.color-sample.deberia-iniciar {
    background-color: #ff9800;
}

.color-sample.vencido {
    background-color: #dc3545;
    animation: blink 1s infinite;
}

/* Responsive adaptado al estilo fichaje-canvas */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .workers-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .legend-items {
        flex-direction: column;
        gap: 8px;
    }

    .task-rectangle {
        width: 100px;
        height: 120px;
    }

    .tasks-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .worker-dashboard-container {
        padding: 0 10px;
    }

    .fichaje-canvas {
        padding: 8px 8px 16px 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .task-rectangle {
        width: 80px;
        height: 100px;
    }

    .task-info {
        font-size: 10px;
        padding: 4px;
    }
}

/* Estadísticas del dashboard - más discretas */
.dashboard-stats {
    margin-bottom: 10px;
}

.dashboard-stats h3 {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: #ccc;
    font-weight: normal;
    text-decoration: none;
}

.dashboard-stats .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.stat-item {
    text-align: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

.stat-number {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #88ff00;
    margin-bottom: 2px;
}

.stat-label {
    display: block;
    font-size: 10px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}



/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }

    .job-header {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .job-title {
        justify-content: flex-start;
    }

    .job-time-info {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .dashboard-stats .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .dashboard-stats .stats-grid {
        grid-template-columns: 1fr;
    }

    .date-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .date-selector input[type="date"] {
        width: 100%;
    }

    .worker-dashboard-container {
        padding: 0 10px;
    }

    .fichaje-canvas {
        padding: 8px 8px 16px 8px;
    }
}

.map-container {
    min-width: 50%;
}