/* ================== CONTENEDORES PRINCIPALES ================== */
.vpm-procesos-wrapper, 
.vpm-carga-masiva-wrapper, 
.vpm-dashboard-wrapper, 
.vpm-mi-proceso-wrapper {
    max-width: 1200px; 
    margin: 20px auto; 
    padding: 20px; 
    background: #fff; 
    border: 1px solid #ddd; 
    border-radius: 8px;
}

/* ================== TABLAS BASE ================== */
.vpm-procesos-table, 
.vpm-proceso-table, 
.vpm-vehiculos-table {
    width: 100%; 
    border-collapse: collapse; 
    margin: 20px 0;
}

.vpm-procesos-table th, 
.vpm-procesos-table td,
.vpm-proceso-table th, 
.vpm-proceso-table td,
.vpm-vehiculos-table th, 
.vpm-vehiculos-table td {
    border: 1px solid #ddd; 
    padding: 10px; 
    text-align: left;
}

.vpm-procesos-table th, 
.vpm-proceso-table th, 
.vpm-vehiculos-table th { 
    background: #f5f5f5; 
}

/* ================== MODAL DE PROCESOS ================== */
#vpm-proceso-modal {
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 1000;
}

#vpm-proceso-form {
    background: #fff; 
    padding: 30px; 
    border-radius: 8px; 
    max-width: 500px; 
    width: 90%;
}

#vpm-proceso-form label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: bold; 
}

#vpm-proceso-form input, 
#vpm-proceso-form select {
    width: 100%; 
    padding: 8px; 
    margin-bottom: 15px; 
    border: 1px solid #ddd; 
    border-radius: 4px;
}

/* ================== MÉTRICAS DEL DASHBOARD ================== */
.vpm-metricas { 
    display: flex; 
    gap: 20px; 
    margin-bottom: 30px; 
    flex-wrap: wrap; 
}

.vpm-metrica {
    flex: 1 1 200px; 
    background: #f9f9f9; 
    padding: 20px; 
    border-radius: 8px; 
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.vpm-metrica-valor { 
    font-size: 36px; 
    font-weight: bold; 
    display: block; 
    color: #333; 
}

.vpm-metrica-etiqueta { 
    font-size: 14px; 
    color: #666; 
}

/* ================== FILTROS ================== */
.vpm-filtros { 
    display: flex; 
    gap: 15px; 
    margin: 20px 0; 
}

.vpm-filtros select { 
    padding: 8px 12px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    min-width: 200px; 
}

.vpm-exportar { 
    margin: 20px 0; 
    text-align: right; 
}

/* ================== TABS DE MI PROCESO ================== */
.vpm-tabs { 
    display: flex; 
    gap: 10px; 
    margin: 20px 0; 
    border-bottom: 2px solid #ddd; 
    padding-bottom: 10px; 
}

.vpm-tab-button { 
    padding: 10px 20px; 
    background: none; 
    border: none; 
    border-radius: 4px 4px 0 0; 
    cursor: pointer; 
    font-size: 16px; 
    color: #666; 
}

.vpm-tab-button.active { 
    background: #007cba; 
    color: #fff; 
}

.vpm-tab-content { 
    display: none; 
    padding: 20px 0; 
}

.vpm-tab-content.active { 
    display: block; 
}

.vpm-selector-proceso { 
    margin: 20px 0; 
    padding: 15px; 
    background: #f9f9f9; 
    border-radius: 4px; 
}

/* ================== ARCHIVOS ADJUNTOS ================== */
.vpm-archivos-cell {
    min-width: 200px;
}

.vpm-archivo-item {
    margin: 5px 0;
    padding: 5px;
    background: #f9f9f9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vpm-archivo-item a {
    text-decoration: none;
    color: #0073aa;
}

.vpm-archivo-item .button {
    margin-left: 10px;
    padding: 2px 8px;
    font-size: 12px;
}

/* ================== TABLA GANTT (DASHBOARD) - CORREGIDA ================== */
.vpm-table-scroll {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 20px;
}

.vpm-vehiculos-table.vpm-gantt-table {
    min-width: 900px;
    width: auto;
    border-collapse: collapse;
    table-layout: fixed; /* Control de anchos */
}

/* Estilo general de celdas */
.vpm-vehiculos-table.vpm-gantt-table th,
.vpm-vehiculos-table.vpm-gantt-table td {
    white-space: nowrap;
    text-align: left;
    vertical-align: middle;
    height: 40px;
    line-height: 40px;
    border: 1px solid #ddd;
}

/* Cabeceras de procesos */
.vpm-vehiculos-table.vpm-gantt-table th {
    padding: 8px 12px;
    font-weight: bold;
    white-space: normal;
    width: 140px;
    min-width: 120px;
    max-width: 200px;
    height: auto;
    line-height: 1.4;
    background: #f5f5f5;
}

/* Columnas fijas (ID, VIN, Modelo) */
.vpm-vehiculos-table.vpm-gantt-table th:first-child,
.vpm-vehiculos-table.vpm-gantt-table th:nth-child(2),
.vpm-vehiculos-table.vpm-gantt-table th:nth-child(3),
.vpm-vehiculos-table.vpm-gantt-table td:first-child,
.vpm-vehiculos-table.vpm-gantt-table td:nth-child(2),
.vpm-vehiculos-table.vpm-gantt-table td:nth-child(3) {
    width: 110px;
    min-width: 100px;
    max-width: 150px;
    padding: 0 8px;
}

/* Celdas de progreso */
.vpm-vehiculos-table.vpm-gantt-table td.vpm-progreso-cell {
    position: relative;
    width: 140px;
    min-width: 120px;
    max-width: 200px;
    height: 40px;
    padding: 0 !important;
    background-color: #f9f9f9;
    overflow: hidden; /* Evita desbordes */
}

/* Barra de progreso */
.vpm-progreso-barra {
    position: absolute;
    top: 0;
    left: 0;
    height: 40px !important; /* Fuerza la altura */
    border-radius: 4px;
    transition: width 0.3s;
    z-index: 1;
}

/* Etiqueta de estado */
.vpm-progreso-etiqueta {
    position: absolute;
    left: 8px;
    top: 0;
    color: #333;
    font-size: 12px;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
    z-index: 2;
    line-height: 40px;
    pointer-events: none;
}

/* ================== TRUNCAR TEXTO EN CELDAS ================== */
.vpm-vehiculos-table.vpm-gantt-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px; /* Ajusta según el ancho deseado */
}

/* Ancho específico para la columna VIN (segunda columna) */
.vpm-vehiculos-table.vpm-gantt-table td:nth-child(2) {
    max-width: 120px;
}

/* Ancho para la columna Modelo (tercera columna) */
.vpm-vehiculos-table.vpm-gantt-table td:nth-child(3) {
    max-width: 100px;
}

/* Opcional: para las celdas de proceso (a partir de la cuarta columna) */
.vpm-vehiculos-table.vpm-gantt-table td:nth-child(n+4) {
    max-width: 140px;
}

/* ================== MODALES DE SUBPROCESOS ================== */
#vpm-subprocesos-modal,
#vpm-subproceso-modal {
    position: fixed;
    top: 0; left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.vpm-modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.vpm-subprocesos-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.vpm-subprocesos-table th,
.vpm-subprocesos-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.vpm-subprocesos-table th {
    background: #f5f5f5;
}

#vpm-subproceso-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

/* ================== GRÁFICO ================== */
.vpm-grafico-container {
    height: 300px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 30px 0;
}

.vpm-grafico-container canvas {
    min-width: 600px;
    height: 100% !important;
}

/* ================== TABLA DE MI PROCESO (compacta) ================== */
.vpm-mi-proceso-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.vpm-mi-proceso-table th,
.vpm-mi-proceso-table td {
    border: 1px solid #ddd;
    padding: 8px 5px;
    text-align: left;
    vertical-align: middle;
}

.vpm-mi-proceso-table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Columna de vehículo compacta */
.vpm-vehiculo-info {
    min-width: 120px;
    line-height: 1.3;
}

.vpm-vehiculo-info small {
    color: #666;
    font-size: 11px;
}

/* Estados con colores */
.vpm-estado-proceso {
    font-weight: 500;
    text-align: center;
    min-width: 80px;
}
.vpm-estado-proceso.enproceso { color: #007cba; }
.vpm-estado-proceso.completado { color: #46b450; }
.vpm-estado-proceso.espera { color: #ffb900; }
.vpm-estado-proceso.devuelto { color: #dc3232; }

/* Subprocesos */
.vpm-subproceso {
    text-align: center;
    min-width: 100px;
    background: #fafafa;
}
.vpm-subproceso .vpm-sub-nombre {
    display: block;
    font-weight: 500;
    margin-bottom: 3px;
}
.vpm-subproceso .vpm-sub-estado {
    display: block;
    font-size: 11px;
    margin: 3px 0;
}
.vpm-subproceso.enproceso { background: #e5f5ff; }
.vpm-subproceso.completado { background: #e3f5e3; }
.vpm-subproceso button {
    margin: 2px 0;
    padding: 2px 6px;
    font-size: 11px;
}

/* Botones pequeños */
.button-small {
    padding: 3px 8px;
    font-size: 11px;
    line-height: 1.5;
    border-radius: 3px;
    border: 1px solid #ccc;
    background: #f7f7f7;
    cursor: pointer;
    margin: 2px;
}
.button-small:hover {
    background: #e7e7e7;
}

/* Columna de acciones */
.vpm-acciones {
    min-width: 100px;
    white-space: nowrap;
}

/* Fila de archivos oculta */
.vpm-fila-archivos {
    background: #f9f9f9;
}
.vpm-fila-archivos td {
    padding: 15px !important;
}
.vpm-archivos-container {
    max-width: 600px;
}
.vpm-archivos-container h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

/* Scroll horizontal */
.vpm-table-scroll {
    overflow-x: auto;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ================== TABLA DE ARCHIVOS ADMIN ================== */
.vpm-admin-archivos-wrapper {
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.vpm-archivos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.vpm-archivos-table th,
.vpm-archivos-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.vpm-archivos-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.vpm-archivos-table tr:hover {
    background: #f9f9f9;
}

/* Versión responsive para móviles */
@media (max-width: 768px) {
    .vpm-mi-proceso-table {
        font-size: 12px;
    }
    .vpm-subproceso {
        min-width: 80px;
    }
    .vpm-acciones {
        min-width: 80px;
    }
}