/* ================================================= */
/* ============== ESTRUCTURA PRINCIPAL ============= */
/* ================================================= */

.tp-tareas-contenedor {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.tp-proyecto-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.08); 
    border: 1px solid #e5e7eb;
    margin-bottom: 30px; 
    overflow: hidden; 
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 3;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tp-proyecto-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08), 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tp-proyecto-header {
    padding: 20px 32px;
    border-bottom: 2px solid rgba(134, 21, 66, 0.1); 
    box-sizing: border-box;
}

.tp-proyecto-info {
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.tp-proyecto-nombre {
    font-size: 1.4rem; 
    font-weight: 800; 
    line-height: 1.3;
    margin-bottom: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    text-transform: uppercase;
}

.tp-proyecto-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.tp-proyecto-meta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem; 
}

.tp-proyecto-tareas-count {
    font-weight: 600; 
    font-size: 0.9rem;
    padding: 0.35rem 0.75rem; 
    border-radius: 9999px; 
    transition: all 0.2s ease;
}

/* ================================================= */
/* ============== LISTA DE TAREAS ================== */
/* ================================================= */

.tp-tareas-lista {
    padding: 16px 0;
    width: 100%;
    box-sizing: border-box;
}

.tp-tarea-item {
    margin: 0 24px 14px 24px; 
    border-radius: 10px; 
    border: 1px solid #e5e7eb;
    background: white;
    transition: all 0.2s ease;
    width: calc(100% - 48px);
    box-sizing: border-box;
    overflow: visible;
    cursor: pointer;
    border-left-width: 6px;
    border-left-style: solid;
}

.tp-tarea-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03); 
    border-color: #d1d5db; 
}

.tp-tarea-item.active {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #f1f5f9; 
}

.tp-tarea-header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    border-bottom: 1px solid transparent; 
}

.tp-tarea-item.active .tp-tarea-header {
    border-bottom-color: #e5e7eb; 
}

.tp-tarea-estado-container {
    display: flex;
    align-items: center; 
    justify-content: center;
    flex-shrink: 0;
}

.tp-tarea-estado-indicador {
    font-size: 1.2rem; 
    width: 40px;
    height: 40px;
    border-radius: 50%; 
    background: #eff6ff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-tarea-info-contenido {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    align-self: center; 
}

.tp-tarea-titulo-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px; 
    width: 100%;
}

.tp-tarea-nombre {
    font-size: 1.05rem; 
    font-weight: 700;
    color: #1f2937;
    white-space: normal; 
   text-transform: uppercase;
}

.tp-tarea-estatus-header {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem; 
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    max-width: fit-content;
    white-space: nowrap;
}

.tp-tarea-acciones-header {
    display: flex;
    align-items: center;
    gap: 12px; 
    flex-shrink: 0;
    margin-left: auto; 
    align-self: center; 
}

.tp-tarea-info-dias {
    display: flex;
    flex-direction: column; 
    align-items: center;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 8px; 
    border: 2px solid; 
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 130px;
}

.tp-tarea-dias-restantes {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.tp-dias-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.tp-dias-texto {
    font-size: 0.9rem;
    font-weight: 800; 
    text-align: center;
}

.tp-tarea-expand-icon {
    font-size: 0.8rem; 
}

.tp-tarea-item.active .tp-tarea-expand-icon {
    color: #861542; 
}

/* ================================================= */
/* ============== DETALLES EXPANDIDOS ============== */
/* ================================================= */

.tp-tarea-detalles-wrapper {
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.tp-tarea-detalles {
    padding: 12px 24px; 
    animation: tp-slideDown 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

@keyframes tp-slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tp-detalles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    padding: 12px 16px; 
    background: #f8fafc; 
    border-radius: 10px;
    border: 1px solid #eef1f4;
    gap: 16px; 
}

.tp-detalle-item {
    display: flex;
    flex-direction: column; 
    align-items: center; 
    text-align: center;
    padding: 10px 0; 
    border-right: 1px solid #e5e7eb;
}

.tp-detalle-item:last-child {
    border-right: none;
}

.tp-detalle-icono-container-column {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); 
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%; 
    flex-shrink: 0;
    margin-bottom: 8px; 
}

.tp-detalle-icono {
    font-size: 1.1rem; 
    color: #4b5563;
}

.tp-detalle-label {
    font-size: 0.75rem;
    font-weight: 600; 
    color: #6b7280;
    text-transform: uppercase;
    margin: 0; 
    line-height: 1.2;
}

.tp-detalle-value {
    font-size: 1rem;
    font-weight: 700; 
    color: #1f2937;
    word-break: break-word; 
    white-space: normal;
    line-height: 1.2;
    margin: 0; 
    padding-top: 2px;
}

.tp-tarea-footer {
    padding-top: 12px;
    display: flex;
    justify-content: flex-end; 
    border-top: 1px solid #e5e7eb;
    margin-top: 12px; 
}

.tp-ver-tarea-btn {
    background-color: #861542; 
    color: white;
    border: none;
    padding: 8px 16px; 
    border-radius: 6px; 
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-ver-tarea-btn:hover {
    background-color: #6a1035;
}

.tp-ver-tarea-btn:active {
    transform: scale(0.98);
}

/* ================================================= */
/* ============== FILTROS ========================== */
/* ================================================= */

.tp-filtros-container {
    background: white;
    border-radius: 14px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    max-width: 700px;
    width: 100%;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 4;
    box-sizing: border-box;
}

.tp-search-filter-wrapper {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 0.8rem;
    width: 100%;
    box-sizing: border-box;
}

.tp-search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.tp-search-input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-sizing: border-box;
}

.tp-search-input:focus {
    outline: none;
    border-color: #861542;
    background: white;
    box-shadow: 0 0 0 3px rgba(134, 21, 66, 0.1);
}

.tp-search-icon {
    position: absolute;
    left: 0.9rem;
    color: #861542;
    font-size: 1rem;
}

.tp-search-clear-btn {
    position: absolute;
    right: 0.9rem;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tp-search-clear-btn:hover {
    background: #f1f3f5;
    color: #495057;
}

.tp-filter-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: auto;
}

.tp-filter-icon {
    color: #861542;
    font-size: 1rem;
}

.tp-search-results-info {
    text-align: center;
    padding: 0.6rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    font-size: 0.9rem;
    color: #495057;
    border: 1px solid #dee2e6;
}

.tp-results-count {
    background: #861542;
    color: white;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-weight: 600;
    margin-right: 0.4rem;
}

/* ================================================= */
/* ============== ESTADOS SIN RESULTADOS =========== */
/* ================================================= */

.tp-no-resultados {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.tp-no-resultados-icon {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.tp-no-resultados h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.tp-no-resultados p {
    font-size: 1rem;
    color: #6b7280;
}

/* ================================================= */
/* ============== RESPONSIVE ======================= */
/* ================================================= */

@media (max-width: 768px) {
    .tp-proyecto-header {
        padding: 16px 20px;
    }
    
    .tp-tarea-item {
        margin: 0 16px 14px 16px; 
        width: calc(100% - 32px);
    }

    .tp-tarea-header {
        flex-direction: row; 
        flex-wrap: wrap; 
        gap: 10px;
    }

    .tp-tarea-acciones-header {
        margin-left: 0; 
        width: auto;
        justify-content: flex-end;
    }

    .tp-tarea-info-dias {
        min-width: 120px;
        padding: 6px 10px;
    }
    
    .tp-tarea-footer {
        justify-content: center;
    }

    .tp-ver-tarea-btn {
        width: 100%; 
        justify-content: center;
    }
    
    .tp-detalles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .tp-tarea-item {
        width: 100% !important;
        margin: 0 0 14px 0 !important;
        border-left-width: 5px;
        box-sizing: border-box;
    }

    .tp-tarea-header {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 12px;
        padding: 14px 16px !important;
        position: relative;
    }

    .tp-tarea-expand-icon {
        position: absolute;
        top: 14px;
        right: 16px;
        font-size: 1rem;
        color: #861542;
    }

    .tp-tarea-info-contenido {
        width: 100% !important;
    }

    .tp-tarea-acciones-header {
        width: 100% !important;
        justify-content: flex-start !important;
        margin-left: 0 !important;
        gap: 8px;
    }

    .tp-tarea-info-dias {
        width: 100% !important;
        min-width: unset !important;
        margin-top: 8px;
        justify-content: flex-start !important;
        flex-direction: row !important;
    }

    .tp-detalles-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .tp-detalle-item {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid #e5e7eb !important;
        border-right: none !important;
    }

    .tp-detalle-item:last-child {
        border-bottom: none !important;
    }

    .tp-detalle-label, .tp-detalle-value {
        text-align: left !important;
        width: 100% !important;
    }
}