
/* ============================================================
   ESTILO DE FUENTE POR DEFECTO
   Basado en el estilo de la imagen: sans-serif, color #334759
   ============================================================ */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #334759;
    font-weight: normal;
}

/* Mejorar legibilidad en tablas */
table {
    font-size: 15px;
}

th, td {
    font-size: 15px;
    padding: 14px 12px;
}

/* ============================================================
   ESTILOS PARA LABELS DE FORMULARIOS
   ============================================================ */
.form-group label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: normal;
    color: #334759;
    margin-bottom: 8px;
    display: block;
}

.form-control, input, select, textarea {
    font-size: 15px;
    padding: 10px 12px;
}

/* Mejorar legibilidad en botones */
.btn {
    font-size: 15px;
    padding: 10px 16px;
}

/* ============================================================
   ESTILOS PARA SEARCH SECTION
   ============================================================ */
.search-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    flex-wrap: wrap;
    gap: 15px;
}

.search-section label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: normal;
    color: #334759;
    display: block;
    margin-bottom: 8px;
}

.search-section .form-group {
    margin-bottom: 0;
    width: auto;
    flex: 1;
    min-width: 150px;
}

.search-section .form-group:last-child {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
}

.search-section .form-group:last-child button {
    margin-left: 0;
}

/* ============================================================
   ESTILOS PARA FORM GROUP
   ============================================================ */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    border: 2px solid #ced4da;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    outline: none;
}

.align-center {
    text-align: center;
}

/* ============================================================
   ESTILOS PARA BOTONES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-left: 10px;
    transition: all 0.3s ease;
    color: white;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn:disabled {
    background-color: #6c757d !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-asignar {
    background-color: #28a745;
}

.btn-asignar:hover {
    background-color: #218838;
}

.btn-ver {
    background-color: #17a2b8;
}

.btn-ver:hover {
    background-color: #138496;
}

.btn-anular {
    background-color: #dc3545;
}

.btn-anular:hover {
    background-color: #c82333;
}

.btn-modificar {
    background-color: #ffc107;
    color: #000;
}

.btn-modificar:hover {
    background-color: #e0a800;
}

/* Estilos para botones deshabilitados */
.btn-disabled {
    opacity: 0.8 !important;
    cursor: not-allowed !important;
    background-color: #ccc !important;
    color: #333 !important;
}

.btn-disabled:hover {
    background-color: #ccc !important;
    opacity: 0.8 !important;
}

.btn-paginacion {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9em;
    transition: all 0.3s ease;
    min-width: 36px;
    text-align: center;
    justify-content: center;
    cursor: pointer;
}

.btn-paginacion:hover {
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
    border-color: #adb5bd;
}

.btn-paginacion.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-paginacion.active:hover {
    background: #0056b3;
    border-color: #0056b3;
    color: white;
}

/* ============================================================
   ESTILOS PARA TABLA
   ============================================================ */
.table-container {
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.table thead {
    background-color: #f8f9fa;
}

.table th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    color: #212529;
}

.table.table-striped tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: #f0f0f0;
}

/* ============================================================
   ESTILOS PARA PAGINACIÓN
   ============================================================ */
.paginacion-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.paginacion-info {
    color: #666;
    font-size: 0.9em;
}

.paginacion-controles {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 768px) {
    .paginacion-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .paginacion-controles {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn-paginacion {
        padding: 6px 10px;
        font-size: 0.85em;
        min-width: 32px;
    }
}

/* ============================================================
   ESTILOS PARA CONTENEDORES
   ============================================================ */
.btn-nueva-orden-container {
    margin-left: 20px;
}

/* ============================================================
   MODAL DE ASIGNACIONES - Ver y Gestionar Asignaciones
   ============================================================ */

.modal-asignaciones {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
}

.modal-asignaciones.active {
    display: flex !important;
}

.modal-asignaciones-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    margin: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 700;
    color: #2c3e50;
}

.modal-header .close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-header .close:hover {
    background-color: #e9ecef;
    color: #333;
}

.modal-body {
    flex: 1;
    padding: 20px 25px;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-radius: 0 0 8px 8px;
}

.asignaciones-content {
    min-height: 200px;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: #666;
    font-style: italic;
}

.sin-asignaciones {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: #999;
    font-style: italic;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.sin-asignaciones p {
    margin: 0;
}

/* Tabla de Asignaciones */
.asignaciones-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.asignaciones-table thead {
    background-color: #f8f9fa;
}

.asignaciones-table th {
    background-color: #007bff;
    color: white;
    font-weight: 700;
    text-align: left;
    padding: 12px 15px;
    border: none;
}

.asignaciones-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

.asignaciones-table td small {
    display: block;
    font-size: 11px;
    margin-top: 4px;
}

.tiempo-estimado {
    display: inline-block;
    padding: 4px 10px;
    background-color: #e7f3ff;
    color: #0056b3;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
}

.tiempo-transcurrido {
    display: inline-block;
    padding: 4px 10px;
    background-color: #fff3cd;
    color: #856404;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

.asignaciones-table tbody tr {
    transition: background-color 0.2s ease;
}

.asignaciones-table tbody tr:hover {
    background-color: #f8f9fa;
}

.asignaciones-table tbody tr:last-child td {
    border-bottom: none;
}

/* Estado Badges */
.estado-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.estado-asignado {
    background-color: #e7f3ff;
    color: #0056b3;
}

.estado-en-progreso {
    background-color: #fff3cd;
    color: #856404;
}

.estado-pausado {
    background-color: #f8d7da;
    color: #721c24;
}

.estado-finalizado {
    background-color: #d4edda;
    color: #155724;
}

.estado-anulado {
    background-color: #f5f5f5;
    color: #666;
}

/* Estilos para badges de estado de asignación */
.asignacion-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.asignacion-sin-asignacion {
    background-color: #e7f3ff;
    color: #0056b3;
}

.asignacion-anulado {
    background-color: #f8d7da;
    color: #721c24;
}

.asignacion-con-asignacion {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* Acciones en Asignaciones */
.asignacion-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-accion {
    padding: 5px 10px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.btn-accion-iniciar {
    background-color: #28a745;
    color: white;
}

.btn-accion-iniciar:hover {
    background-color: #218838;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.btn-accion-pausar {
    background-color: #ffc107;
    color: #333;
}

.btn-accion-pausar:hover {
    background-color: #e0a800;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.btn-accion-reanudar {
    background-color: #17a2b8;
    color: white;
}

.btn-accion-reanudar:hover {
    background-color: #138496;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.btn-accion-finalizar {
    background-color: #007bff;
    color: white;
}

.btn-accion-finalizar:hover {
    background-color: #0056b3;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.btn-accion-anular {
    background-color: #dc3545;
    color: white;
}

.btn-accion-anular:hover {
    background-color: #c82333;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-asignaciones-container {
        max-width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-header h2 {
        font-size: 1.1em;
    }

    .modal-body {
        padding: 15px 20px;
    }

    .modal-footer {
        padding: 12px 20px;
    }

    .asignaciones-table th,
    .asignaciones-table td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .btn-accion {
        padding: 4px 8px;
        font-size: 11px;
    }

    .asignacion-actions {
        gap: 4px;
    }

    .search-section {
        flex-direction: column;
        gap: 10px;
    }

    .search-section .form-group {
        width: 100%;
        min-width: auto;
    }

    .btn-nueva-orden-container {
        margin-left: 0;
        width: 100%;
    }

    .btn-nueva-orden-container .btn {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
}

/* ============================================================
   ESTILOS PARA ELEMENTOS PERSONALIZADOS (MANO DE OBRA Y PIEZAS)
   ============================================================ */

/* Sección de formulario de crear orden */
.info-section {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.info-section h3 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
    margin-top: 20px;
}

.info-section h3:first-child {
    margin-top: 0;
}

.info-group {
    background-color: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* Contenedor de elementos agregados */
.custom-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 6px;
    background-color: #e3f2fd;
    border-left: 4px solid #007bff;
    border-radius: 2px;
    font-size: 14px;
}

.custom-item-text {
    flex: 1;
    color: #334759;
    font-weight: 500;
}

.custom-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cantidad-badge {
    background-color: #007bff;
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.remove-item {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 3px 7px;
    border-radius: 2px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.2s;
}

.remove-item:hover {
    background-color: #c82333;
}

/* Contenedor de lista personalizado */
.custom-list-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Mensaje sin elementos */
.sin-elementos {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* Sección de búsqueda de chasis */
.prefix-suffix-section {
    background-color: #f5f5f5 !important;
    padding: 20px !important;
    border-radius: 6px !important;
    margin-bottom: 20px !important;
}

.form-group-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.form-item {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
}

.form-item label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
    font-size: 0.9em;
}

.form-item .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-item-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-item-buttons .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.form-item-buttons .btn-asignar {
    background-color: #3498db;
    color: white;
}

.form-item-buttons .btn-asignar:hover {
    background-color: #2980b9;
}

.form-item-buttons .btn-ver {
    background-color: #27ae60;
    color: white;
}

.form-item-buttons .btn-ver:hover {
    background-color: #229954;
}

/* Media Query para dispositivos móviles */
@media (max-width: 768px) {
    .form-group-horizontal {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-item {
        min-width: 100%;
    }
    
    .form-item-buttons {
        width: 100%;
    }
    
    .form-item-buttons .btn {
        flex: 1;
    }
}

/* ================================================================
   Typeahead genérico — compartido por todas las páginas del taller
   ================================================================ */
.sw-typeahead-wrap { position: relative; width: 100%; }
.sw-typeahead-input { width: 100%; }
.sw-typeahead-list {
    position: absolute; left: 0; right: 0; z-index: 9999;
    max-height: 240px; overflow-y: auto;
    margin: 2px 0 0; padding: 0; list-style: none;
    background: #fff; border: 1px solid #ced4da;
    border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.sw-typeahead-list li {
    padding: 8px 12px; cursor: pointer;
    font-size: 13px; line-height: 1.4; list-style: none;
}
.sw-typeahead-list li:hover,
.sw-typeahead-list li[aria-selected="true"] { background: #0d6efd; color: #fff; }
.sw-typeahead-list li.sw-empty { cursor: default; color: #6c757d; background: #f8f9fa; }
