/* vb.css - Estilos para el modal Visto Bueno - ACTUALIZADO CON CABECERA STICKY Y SCROLL MEJORADO */
.modal-vb {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    overflow: hidden;
}

.modal-vb-content {
    max-width: 95%;
    width: 1200px;
    max-height: 90vh;
    margin: 2% auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* HEADER MEJORADO CON TÍTULO SEPARADO */
.vb-header.sticky-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 20px 25px 15px 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
}

.vb-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.vb-title h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: white;
}

.vb-header-info {
    display: flex;
    align-items: center;
    gap: 30px;
    width: 100%;
    flex-wrap: nowrap;
    overflow: hidden;
}

.vb-header-info .header-item {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.vb-header-info .header-item strong {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 600;
}

.vb-header-info .header-item span {
    font-weight: 500;
}

/* X DE CERRAR MEJORADA - ESTILO UNIFICADO */
.close-modal-vb {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #333;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.close-modal-vb:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

.close-identificacion {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #333;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.close-identificacion:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

/* ESTADO IDÉNTICO AL MODAL PEDIDO */
.status-pedido {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-citado { background: #ffc107; color: #000; }
.status-taller { background: #17a2b8; color: #fff; }
.status-proceso { background: #6f42c1; color: #fff; }
.status-cerrado_pagado { background: #28a745; color: #fff; }
.status-cerrado { background: #6c757d; color: #fff; }

/* BODY MEJORADO CON SCROLL VERTICAL EN TABLA */
.vb-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.vb-section {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.vb-section:last-of-type {
    border-bottom: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.section-header h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 18px;
}

/* TABLA OPTIMIZADA CON SCROLL VERTICAL Y CABECERA FIJA - MEJORADO */
.vb-table-container {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Scroll vertical para la tabla */
    position: relative;
    border: 1px solid #e0e0e0; /* Borde como en pedido */
}

.vb-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    border-radius: 6px;
    overflow: hidden;
    table-layout: fixed;
    height: auto;
}

/* CABECERA DE TABLA STICKY - MEJORADO COMO PEDIDO */
.vb-table thead {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #34495e;
    display: table-header-group;
}

.vb-table th {
    background: #34495e;
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 35;
    border-bottom: 2px solid #2c3e50;
}

/* ANCHOS OPTIMIZADOS PARA EVITAR SCROLL HORIZONTAL */
.vb-table th:nth-child(1), .vb-table td:nth-child(1) { width: 5%; min-width: 40px; } /* # */
.vb-table th:nth-child(2), .vb-table td:nth-child(2) { width: 8%; min-width: 60px; } /* Origen */
.vb-table th:nth-child(3), .vb-table td:nth-child(3) { width: 32%; min-width: 200px; } /* DESCRIPCIÓN */
.vb-table th:nth-child(4), .vb-table td:nth-child(4) { width: 18%; min-width: 150px; } /* TÉCNICO */
.vb-table th:nth-child(5), .vb-table td:nth-child(5) { width: 15%; min-width: 120px; } /* USUARIO */
.vb-table th:nth-child(6), .vb-table td:nth-child(6) { width: 22%; min-width: 150px; } /* FECHA || HORA */

.vb-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

.vb-table tbody tr:hover {
    background: #f8f9fa;
}

/* CONTROLES DE FORMULARIO COMPACTOS */
.select-tecnico {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
}

.select-tecnico:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.input-usuario {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
    background: #f8f9fa;
    color: #6c757d;
}

/* FOOTER IDÉNTICO AL MODAL PEDIDO */
.vb-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    border-radius: 0 0 12px 12px;
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* SCROLLBAR PERSONALIZADO - IDÉNTICO AL MODAL PEDIDO */
.vb-table-container::-webkit-scrollbar {
    width: 6px;
}

.vb-table-container::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.vb-table-container::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
    border: 2px solid #f8f9fa;
}

.vb-table-container::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

.vb-table-container {
    scrollbar-width: thin;
    scrollbar-color: #3498db #f8f9fa;
}

/* Scroll personalizado para el body del modal */
.vb-body::-webkit-scrollbar {
    width: 8px;
}

.vb-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.vb-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.vb-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* RESPONSIVE PARA CABECERA */
@media (max-width: 1400px) {
    .vb-header-info {
        gap: 20px;
    }
    
    .vb-header-info .header-item {
        font-size: 13px;
    }
    
    .vb-header-info .header-item strong {
        font-size: 11px;
    }
}

@media (max-width: 1200px) {
    .vb-header-info {
        gap: 15px;
        flex-wrap: wrap;
        row-gap: 10px;
    }
    
    .vb-header-info .header-item {
        min-width: calc(33.333% - 15px);
    }
    
    /* Ajustar anchos de tabla en pantallas más pequeñas */
    .vb-table th:nth-child(1), .vb-table td:nth-child(1) { width: 4%; }
    .vb-table th:nth-child(2), .vb-table td:nth-child(2) { width: 7%; }
    .vb-table th:nth-child(3), .vb-table td:nth-child(3) { width: 30%; }
    .vb-table th:nth-child(4), .vb-table td:nth-child(4) { width: 17%; }
    .vb-table th:nth-child(5), .vb-table td:nth-child(5) { width: 14%; }
    .vb-table th:nth-child(6), .vb-table td:nth-child(6) { width: 18%; }
}

/* PARA PANTALLAS MUY PEQUEÑAS */
@media (max-width: 768px) {
    .vb-table {
        table-layout: auto;
        min-width: 600px;
    }
    
    .vb-table th,
    .vb-table td {
        white-space: nowrap;
    }
    
    .modal-vb-content {
        margin: 5% auto;
        width: 98%;
        max-height: 95vh;
    }
    
    .vb-header-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .vb-header-info .header-item {
        min-width: 100%;
    }
    
    .vb-table th:nth-child(1), .vb-table td:nth-child(1) { width: 4%; }
    .vb-table th:nth-child(2), .vb-table td:nth-child(2) { width: 7%; }
    .vb-table th:nth-child(3), .vb-table td:nth-child(3) { width: 28%; }
    .vb-table th:nth-child(4), .vb-table td:nth-child(4) { width: 16%; }
    .vb-table th:nth-child(5), .vb-table td:nth-child(5) { width: 13%; }
    .vb-table th:nth-child(6), .vb-table td:nth-child(6) { width: 17%; }
}

/* ESTILOS MEJORADOS PARA EL MODAL DE IDENTIFICACIÓN - MISMO ESTILO QUE VB */
.modal-identificacion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002;
}

.modal-identificacion-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.identificacion-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
}

.identificacion-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: white;
}

.identificacion-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.identificacion-body p {
    margin-bottom: 20px;
    color: #495057;
    line-height: 1.5;
    font-size: 14px;
}

.scanner-section {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.scanner-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.scanner-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.scanner-input input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#identificacionInfo {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

#identificacionInfo span {
    font-size: 14px;
}

#identificacionNombre {
    color: #28a745;
    font-weight: 600;
}

.identificacion-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    border-radius: 0 0 12px 12px;
}

/* Responsive para modal de identificación */
@media (max-width: 768px) {
    .modal-identificacion-content {
        margin: 5% auto;
        width: 95%;
        max-height: 95vh;
    }
    
    .scanner-input {
        flex-direction: column;
    }
    
    .scanner-input input {
        width: 100%;
    }
    
    .identificacion-footer {
        flex-direction: column;
    }
    
    .identificacion-footer button {
        width: 100%;
        justify-content: center;
    }
}

/* ANIMACIONES PARA NOTIFICACIONES */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ESTILOS PARA LOADING Y ERROR */
.loading-pedido, .error-pedido {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* GARANTIZAR QUE NO HAY SCROLL DOBLE */
.vb-table-container {
    overflow: auto;
}

.vb-table,
.vb-table tbody,
.vb-table thead,
.vb-table tr {
    overflow: visible;
}

/* Estados de carga */
.loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    color: #6c757d;
}

.empty-state {
    text-align: center;
    padding: 30px 15px;
    color: #6c757d;
    font-style: italic;
}


/* ESTILOS PARA MODO SOLO LECTURA */
/* ESTILOS PARA MODO SOLO LECTURA */
/* ESTILOS PARA MODO SOLO LECTURA */

/* ESTILOS PARA MODO SOLO LECTURA */
.solo-lectura-badge {
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modo-solo-lectura .vb-table-container {
    opacity: 0.8;
    background: #f8f9fa;
}

.modo-solo-lectura .select-tecnico {
    background: #e9ecef;
    cursor: not-allowed;
}

.tecnico-texto {
    font-weight: 500;
    color: #495057;
}

/* Overlay visual para modo solo lectura */
.modo-solo-lectura-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.7);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.modo-solo-lectura-mensaje {
    background: #dc3545;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Estilo para items en modo solo lectura */
.modo-solo-lectura .descripcion-item {
    color: #6c757d !important;
    font-style: italic;
}


/* ESTILOS PARA MODO SOLO LECTURA */
/* ESTILOS PARA MODO SOLO LECTURA */
/* ESTILOS PARA MODO SOLO LECTURA */