/**
 * Estilos zona Proyectos
 * Listado, filtros, paginación y modal fullscreen con tabs (Información, Tareas, Documentos, Galería)
 */

/* Header y filtros */
.proyectos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.proyectos-filters {
    padding: 20px;
}

.proyectos-filters .filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.proyectos-filters .filters-bar-search {
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.proyectos-filter-select {
    min-width: 160px;
}

.proyectos-table-wrapper {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.proyectos-table-wrapper.proyectos-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.proyectos-table-wrapper.proyectos-table-scroll .proyectos-table {
    min-width: 700px;
}

.proyectos-table {
    width: 100%;
    border-collapse: collapse;
}

.proyectos-table thead th {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.proyectos-table .entity-th-filters th {
    padding: 6px 8px;
    vertical-align: middle;
}

.proyectos-table .entity-th-filters .form-input-sm,
.proyectos-table .entity-th-filters .entity-col-filter-input {
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    font-size: 12px;
}

.proyecto-row.row-selected {
    background-color: #eff6ff;
}

.proyecto-row.row-selected:hover {
    background-color: #dbeafe;
}

.proyectos-selection-bar.selection-bar {
    margin-top: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.proyectos-selection-bar .selection-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.proyectos-selection-bar .selection-bar-actions {
    display: flex;
    gap: 8px;
}

.proyectos-selection-bar .selection-bar-btn.btn-primary {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.proyectos-selection-bar .selection-bar-btn.btn-primary:hover {
    background: #2563eb;
}

.proyectos-selection-bar .selection-bar-btn.btn-danger {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.proyectos-selection-bar .selection-bar-btn.btn-danger:hover {
    background: #b91c1c;
}

.proyecto-eliminar-dialog {
    padding: 8px 0;
}

.proyecto-eliminar-dialog .proyecto-eliminar-lista {
    margin: 12px 0;
    padding-left: 20px;
    max-height: 160px;
    overflow-y: auto;
}

.proyecto-eliminar-dialog .proyecto-eliminar-instruction {
    margin: 16px 0 8px;
    font-size: 14px;
}

.proyecto-eliminar-dialog .proyecto-eliminar-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: flex-end;
}

.proyecto-eliminar-dialog .btn-danger {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.proyecto-eliminar-dialog .btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.proyecto-eliminar-dialog .btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.proyectos-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #111827;
}

.proyectos-table tbody tr:last-child td {
    border-bottom: none;
}

.proyecto-row {
    cursor: pointer;
    transition: background-color 0.15s;
}

.proyecto-row:hover {
    background-color: #f9fafb;
}

.proyecto-name-cell {
    font-weight: 500;
    color: #111827;
}

.proyecto-color-badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    vertical-align: middle;
}

.proyectos-pagination {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.proyectos-pagination .pagination-btn {
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.proyectos-pagination .pagination-btn:hover:not(.disabled) {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.proyectos-pagination .pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.proyectos-pagination .pagination-info {
    font-size: 13px;
    color: #6b7280;
}

/* Modal crear proyecto */
.proyecto-modal-create,
.proyecto-modal-tarea {
    padding: 0;
}

.proyecto-modal-create-header,
.proyecto-modal-tarea-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.proyecto-modal-create-header h2,
.proyecto-modal-tarea-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.proyecto-modal-create-body,
.proyecto-modal-tarea form {
    padding: 24px;
}

.proyecto-color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.proyecto-color-option {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.proyecto-color-option:hover {
    transform: scale(1.08);
}

.proyecto-color-option.selected {
    border-color: #111827;
    box-shadow: 0 0 0 2px #fff;
}

/* Fullscreen modal (estilo documento-edit-fullscreen) */
.proyecto-fullscreen-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f9fafb;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.proyecto-edit-fullscreen {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.proyecto-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.proyecto-edit-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.proyecto-edit-header-left .btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #3b82f6;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
}

.proyecto-edit-header-left .btn-back:hover {
    background: #eff6ff;
}

.proyecto-edit-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.proyecto-edit-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

.proyecto-edit-sidebar {
    width: 240px;
    flex-shrink: 0;
    padding: 24px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.proyecto-thumbnail-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.proyecto-thumbnail-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.proyecto-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.proyecto-thumbnail-placeholder {
    color: #9ca3af;
    font-size: 13px;
}

.proyecto-upload-thumb {
    width: 100%;
}

.proyecto-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
}

.proyecto-meta-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.proyecto-edit-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.proyecto-tabs {
    display: flex;
    gap: 4px;
    padding: 16px 24px 0;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.proyecto-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: color 0.15s, background 0.15s;
}

.proyecto-tab:hover {
    color: #111827;
    background: #f9fafb;
}

.proyecto-tab.active {
    color: #3b82f6;
    background: #eff6ff;
}

.proyecto-tab-panels {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f9fafb;
}

.proyecto-tab-panel {
    display: none;

}

.proyecto-tab-panel.active {
    display: block;
}

.proyecto-edit-section {
    margin-bottom: 20px;
}

.proyecto-edit-section label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.proyecto-edit-section .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.proyecto-edit-section textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

/* Tareas */
.proyecto-tareas-toolbar,
.proyecto-docs-toolbar,
.proyecto-galeria-toolbar {
    margin-bottom: 20px;
}

.proyecto-tareas-grupo {
    margin-bottom: 24px;
}

.proyecto-tareas-grupo-title {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.proyecto-tareas-grupo-list {
    overflow-x: auto;
}

.proyecto-tareas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.proyecto-tareas-table thead {
    background: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
}

.proyecto-tareas-table th {
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.proyecto-tareas-table tbody tr.proyecto-tarea-item {
    cursor: pointer;
    transition: background-color 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

.proyecto-tareas-table tbody tr.proyecto-tarea-item:hover {
    background-color: #f8fafc;
}

.proyecto-tareas-table tbody tr.proyecto-tarea-item:last-child {
    border-bottom: none;
}

.proyecto-tareas-table td {
    padding: 12px 14px;
    vertical-align: middle;
}

.proyecto-tarea-cell-nombre {
    min-width: 180px;
    max-width: 280px;
}

.proyecto-tarea-nombre-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.proyecto-tarea-nombre-wrap .proyecto-tarea-titulo {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.proyecto-tarea-desc-corta {
    font-size: 12px;
    color: #64748b;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.proyecto-tarea-cell-prioridad {
    white-space: nowrap;
}

.proyecto-tarea-cell-crono {
    font-family: ui-monospace, monospace;
}

.proyecto-tarea-cell-tiempo-restante {
    min-width: 120px;
}

.proyecto-tarea-cell-estado {
    white-space: nowrap;
}

.proyecto-tareas-table .proyecto-tarea-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    white-space: nowrap;
}

.proyecto-tarea-titulo {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.proyecto-tarea-prioridad {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.proyecto-tarea-prioridad.prioridad-critica { background: #fecaca; color: #991b1b; }
.proyecto-tarea-prioridad.prioridad-muy-alta { background: #fed7aa; color: #9a3412; }
.proyecto-tarea-prioridad.prioridad-alta { background: #fef3c7; color: #92400e; }
.proyecto-tarea-prioridad.prioridad-media { background: #dbeafe; color: #1e40af; }
.proyecto-tarea-prioridad.prioridad-baja { background: #e5e7eb; color: #4b5563; }

.proyecto-tarea-estado {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 8px;
    text-transform: capitalize;
}

.proyecto-tarea-estado.estado-pendiente {
    background: #fef3c7;
    color: #92400e;
}

.proyecto-tarea-estado.estado-progreso {
    background: #dbeafe;
    color: #1e40af;
}

.proyecto-tarea-estado.estado-completada {
    background: #d1fae5;
    color: #065f46;
}

.proyecto-tarea-estado.estado-cancelada {
    background: #f3f4f6;
    color: #6b7280;
}

.proyecto-tarea-meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.proyecto-tarea-tiempos {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.proyecto-tarea-tiempo-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.proyecto-tarea-tiempo-row:last-of-type {
    margin-bottom: 0;
}

.proyecto-tarea-tiempo-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    min-width: 110px;
}

.proyecto-tarea-crono-display {
    font-family: ui-monospace, monospace;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    background: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.proyecto-tarea-tiempo-restante {
    font-size: 14px;
    font-weight: 500;
    color: #1e40af;
}

.proyecto-tarea-tiempo-restante.vencido {
    color: #b91c1c;
}

.proyecto-tarea-fecha-fin-row {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
}

.proyecto-tarea-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Descripción rica (contenteditable) */
.proyecto-tarea-descripcion-toolbar {
    margin-bottom: 6px;
}

.proyecto-tarea-descripcion-editor {
    min-height: 120px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
}

.proyecto-detalle-descripcion img{
    width: 100%;
}

.proyecto-tarea-descripcion-editor:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Documentos y galería */
.proyecto-doc-item,
.proyecto-galeria-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
}

.proyecto-doc-item a {
    color: #3b82f6;
    text-decoration: none;
}

.proyecto-doc-item a:hover {
    text-decoration: underline;
}

.proyecto-galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.proyecto-galeria-item {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

.proyecto-galeria-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.proyecto-galeria-item .proyecto-galeria-eliminar {
    margin: 8px;
}

/* Sortable en tabla */
.proyectos-table th.sortable {
    cursor: pointer;
}

.proyectos-table th.sortable:hover {
    color: #111827;
}

.proyectos-table th.sort-asc::after,
.proyectos-table th.sort-desc::after {
    content: '';
    margin-left: 4px;
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.proyectos-table th.sort-asc::after {
    border-bottom: 4px solid currentColor;
}

.proyectos-table th.sort-desc::after {
    border-top: 4px solid currentColor;
}

/* Modal detalle de tarea */
.proyecto-detalle-tarea {
    padding: 0.25rem 0;
}
.proyecto-detalle-section {
    margin-bottom: 1.25rem;
}
.proyecto-detalle-section label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 6px;
}
.proyecto-detalle-estado {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}
.proyecto-detalle-estado.estado-pendiente { background: #fef3c7; color: #92400e; }
.proyecto-detalle-estado.estado-en-progreso { background: #dbeafe; color: #1e40af; }
.proyecto-detalle-estado.estado-completada { background: #d1fae5; color: #065f46; }
.proyecto-detalle-estado.estado-cancelada { background: #f3f4f6; color: #6b7280; }
.proyecto-detalle-prioridad {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}
.proyecto-detalle-prioridad.prioridad-critica { background: #fecaca; color: #991b1b; }
.proyecto-detalle-prioridad.prioridad-muy-alta { background: #fed7aa; color: #9a3412; }
.proyecto-detalle-prioridad.prioridad-alta { background: #fef3c7; color: #92400e; }
.proyecto-detalle-prioridad.prioridad-media { background: #dbeafe; color: #1e40af; }
.proyecto-detalle-prioridad.prioridad-baja { background: #e5e7eb; color: #4b5563; }
.proyecto-detalle-tiempo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.proyecto-detalle-sesion,
.proyecto-detalle-total {
    font-size: 14px;
    color: #374151;
}
.proyecto-detalle-descripcion {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.proyecto-detalle-descripcion p { margin: 0 0 0.5em; }
.proyecto-detalle-descripcion p:last-child { margin-bottom: 0; }
.proyecto-detalle-fecha {
    margin: 8px 0 0;
    font-size: 13px;
    color: #6b7280;
}
.proyecto-detalle-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Modal motivo de pausa (cronómetro) */
.proyecto-pausa-modal {
    padding: 0.25rem 0;
}
.proyecto-pausa-texto {
    margin: 0 0 1rem;
    font-size: 14px;
    color: #4b5563;
}
.proyecto-pausa-opciones {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1rem;
}
.proyecto-pausa-opcion {
    text-align: left;
    justify-content: flex-start;
}
.proyecto-pausa-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@media (max-width: 768px) {
    .proyecto-edit-body {
        flex-direction: column;
    }
    .proyecto-edit-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    .proyecto-thumbnail-wrap {
        width: 80px;
        aspect-ratio: 1;
    }
}
