/* ========================================
   ÓRDENES DE TRABAJO - ESTILOS ESPECÍFICOS
   ======================================== */

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --bg-light: #f9fafb;
}

/* Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.stat-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-icon.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-icon.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Barra de Acciones */
.action-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* Sección de Búsqueda */
.search-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.95) 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.1rem;
    z-index: 2;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-options-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn-clear-filters {
    align-self: flex-start;
    margin-top: 0.5rem;
}

.filter-group {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
    flex: 1;
    min-width: 250px;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    min-width: fit-content;
}

.filter-group .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

.filter-group .form-select:hover {
    border-color: #6366f1;
}

.filter-group .form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Tabla */
.table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

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

.data-table th {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 1rem 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.data-table th:hover {
    background: linear-gradient(135deg, #5558e3, #7c4ee4);
}

.data-table th i {
    margin-left: 0.5rem;
    opacity: 0.7;
}

.data-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Badges de Estado */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.badge i {
    font-size: 0.875rem;
}

/* Estados específicos con colores distintivos */
.badge-pendiente {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.badge-asignada {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #60a5fa;
}

.badge-programada {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #3730a3;
    border: 1px solid #818cf8;
}

.badge-proceso {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #92400e;
    border: 1px solid #fb923c;
}

.badge-completada {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #34d399;
}

.badge-cancelada {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    border: 1px solid #9ca3af;
}

/* Animación para el estado "En Proceso" */
.badge-proceso i.fa-spin {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge i {
    font-size: 0.75rem;
}

.status-badge.pendiente {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.en_proceso {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge.completada {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.cancelada {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Badges de Prioridad */
.prioridad-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.prioridad-badge.baja {
    background-color: #e0e7ff;
    color: #3730a3;
}

.prioridad-badge.media {
    background-color: #dbeafe;
    color: #1e40af;
}

.prioridad-badge.alta {
    background-color: #fed7aa;
    color: #92400e;
}

.prioridad-badge.urgente {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Botones de Acción */
.btn-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.btn-icon.view {
    background-color: #dbeafe;
    color: #1e40af;
}

.btn-icon.view:hover {
    background-color: #3b82f6;
    color: white;
    transform: translateY(-2px);
}

.btn-icon.edit {
    background-color: #fef3c7;
    color: #92400e;
}

.btn-icon.edit:hover {
    background-color: #f59e0b;
    color: white;
    transform: translateY(-2px);
}

.btn-icon.delete {
    background-color: #fee2e2;
    color: #991b1b;
}

.btn-icon.delete:hover {
    background-color: #ef4444;
    color: white;
    transform: translateY(-2px);
}

/* Bloquear scroll cuando modal está abierto */
body.modal-open {
    overflow: hidden;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content.large {
    max-width: 1000px;
}

.modal-content.modal-xl {
    max-width: 1400px;
}

.modal-content.modal-lg {
    max-width: 1000px;
}

.modal-header {
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.modal-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    backdrop-filter: blur(10px);
}

.modal-title-container h3 {
    margin: 0;
    font-size: 1.8rem;
    color: white;
    font-weight: 700;
}

.modal-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    line-height: 1;
    padding: 0;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2.5rem;
    background: #f8f9fa;
}

.modal-footer {
    padding: 2rem 2.5rem;
    background: white;
    border-top: 2px solid #e9ecef;
    border-radius: 0 0 20px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Form Grid Enhanced */
.form-grid-enhanced {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Form Cards */
.form-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.form-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    flex-shrink: 0;
}

.card-icon.primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.card-icon.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.card-icon.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.card-icon.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.card-icon.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.card-icon.secondary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.card-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: #1f2937;
    font-weight: 700;
}

.card-body {
    padding: 2rem;
}

/* Form Rows */
.form-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-row-2:last-child,
.form-row-3:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.form-group label i {
    color: #6366f1;
    font-size: 0.9rem;
}

.required {
    color: #ef4444;
    font-weight: 700;
}

/* Form Inputs Enhanced */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #1f2937;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-input:read-only {
    background: #f9fafb;
    cursor: not-allowed;
    color: #6b7280;
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236366f1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
    appearance: none;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-input-file {
    width: 100%;
    padding: 0.875rem;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #6b7280;
    transition: all 0.3s ease;
    background: #f9fafb;
    cursor: pointer;
}

.form-input-file:hover {
    border-color: #6366f1;
    background: white;
}

.form-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
}

.form-hint i {
    color: #9ca3af;
    font-size: 0.8rem;
}

/* Input with Button */
.input-with-button {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.input-with-button .form-select {
    flex: 1;
}

.btn-config {
    width: 48px;
    height: auto;
    min-height: 48px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-config:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Estado Vacío */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.empty-icon {
    font-size: 5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Detalles de Orden */
.orden-detalle {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.detalle-item {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.detalle-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.detalle-value {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1200px) {
    .modal-content.modal-xl {
        max-width: 95%;
    }

    .form-grid-enhanced {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-enhanced {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .form-row-2,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 1rem;
    }

    .modal-content.modal-xl {
        max-width: 100%;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-title-container {
        gap: 1rem;
    }

    .modal-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .modal-title-container h3 {
        font-size: 1.4rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .card-header {
        padding: 1.25rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .orden-detalle {
        grid-template-columns: 1fr;
    }

    .filter-options {
        flex-direction: column;
        width: 100%;
    }

    .filter-group {
        width: 100%;
    }

    .btn-clear-filters {
        width: 100%;
    }

    .action-bar {
        flex-direction: column;
    }

    .action-bar .btn {
        width: 100%;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

/* ========================================
   NOTIFICACIONES Y LOADING
   ======================================== */

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateX(400px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 500px;
    opacity: 0;
    pointer-events: none;
    font-size: 0.95rem;
    line-height: 1.6;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.notification-message {
    flex: 1;
    white-space: pre-line;
}

.notification.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.notification.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.notification.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.notification.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Loading Spinner */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading p {
    color: white;
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

/* ========================================
   NUEVOS ESTILOS - V2
   ======================================== */

/* Input con botón */
.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button .form-select {
    flex: 1;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Preview de fotos */
.photos-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 12px;
    min-height: 80px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid #e5e7eb;
    background: white;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-item:hover {
    border-color: #6366f1;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #f3f4f6;
}

/* Placeholder mientras carga la imagen */
.photo-item img[src=""] {
    display: none;
}

.photo-item img::before {
    content: "⏳";
    display: block;
    font-size: 2rem;
    text-align: center;
}

.btn-remove-photo {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.95);
    border: 2px solid white;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.btn-remove-photo:hover {
    background: #dc2626;
    transform: scale(1.15);
}

/* Estados de las fotos */
.photo-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    color: white;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: center;
}

.photo-status i {
    font-size: 0.7rem;
}

.photo-status.saved {
    background: linear-gradient(to top, rgba(34, 197, 94, 0.95), transparent);
}

.photo-item[data-archivo-id] {
    border-color: #22c55e;
}

.photo-item[data-archivo-id]:hover {
    border-color: #16a34a;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

/* Lista de configuración */
.config-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.config-item:last-child {
    border-bottom: none;
}

.config-item span {
    font-size: 0.95rem;
}

.btn-delete {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

/* Botones de iconos en acciones */
.btn-icon.btn-view {
    background: #dbeafe;
    color: #1e40af;
}

.btn-icon.btn-view:hover {
    background: #3b82f6;
    color: white;
}

.btn-icon.btn-pdf {
    background: #fee2e2;
    color: #dc2626;
}

.btn-icon.btn-pdf:hover {
    background: #dc2626;
    color: white;
}

.btn-icon.btn-edit {
    background: #fef3c7;
    color: #92400e;
}

.btn-icon.btn-edit:hover {
    background: #f59e0b;
    color: white;
}

.btn-icon.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-icon.btn-delete:hover {
    background: #dc2626;
    color: white;
}

/* Hint de formulario */
.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Detalles en modal */
.detalles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.detalle-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    padding: 1.5rem;
    border-radius: 16px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.detalle-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.detalle-section.full-width {
    grid-column: 1 / -1;
}

.detalle-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

.detalle-section h4 i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
}

.detalle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.detalle-item strong {
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
}

.detalle-item span {
    color: #6c757d;
    font-size: 0.95rem;
}

.detalle-label {
    font-weight: 600;
    color: var(--text-color);
}

.detalle-value {
    color: var(--text-muted);
    text-align: right;
}

.detalle-section p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ========================================
   MODAL DE GESTIÓN DE TÉCNICOS - COMPACTO
   ======================================== */

.modal-scroll {
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scroll suave y profesional */
.modal-scroll::-webkit-scrollbar {
    width: 8px;
}

.modal-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-scroll::-webkit-scrollbar-thumb {
    background: #6366f1;
    border-radius: 10px;
}

.modal-scroll::-webkit-scrollbar-thumb:hover {
    background: #4f46e5;
}

.tecnico-form-compact {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.tecnico-form-compact h4 {
    margin: 0 0 1.25rem 0;
    font-size: 1.1rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tecnico-form-compact h4 i {
    color: #6366f1;
}

.form-grid-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.form-actions-inline {
    display: flex;
    align-items: flex-end;
}

.btn-block {
    width: 100%;
}

.tecnicos-list-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.tecnicos-list-container h4 {
    margin: 0 0 1.25rem 0;
    font-size: 1.1rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tecnicos-list-container h4 i {
    color: #6366f1;
}

.table-wrapper {
    overflow-x: auto;
}

.table-compact {
    font-size: 0.9rem;
}

.table-compact th {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: #f9fafb;
    color: #1f2937;
    border-bottom: 2px solid #e5e7eb;
}

.table-compact td {
    padding: 0.75rem 1rem;
    color: #374151;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}

.table-compact tr {
    background: white;
    transition: background-color 0.2s ease;
}

.table-compact tr:hover {
    background: #f9fafb;
}

.table-compact td strong {
    color: #1f2937;
    font-weight: 600;
}

.badge-global,
.badge-cliente {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.badge-global {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.badge-global:hover {
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.badge-cliente {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.badge-cliente:hover {
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

@media (max-width: 1024px) {
    .form-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .modal-content.modal-lg {
        max-width: 95%;
    }

    .form-grid-compact {
        grid-template-columns: 1fr;
    }

    .modal-scroll {
        max-height: calc(90vh - 180px);
    }
}

/* ========================================
   ESTILOS MEJORADOS PARA MODALES
   ======================================== */

/* Modal de Detalles Mejorado */
.modal-detalles-mejorado {
    animation: slideInUp 0.3s ease-out;
}

.modal-header-detalles {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px 16px 0 0;
}

.modal-icon-detalles {
    background: rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.5rem;
}

.modal-header-detalles .modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.modal-header-detalles .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Badge de Modo Edición */
.editing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(245, 87, 108, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(245, 87, 108, 0);
    }
}

/* Cambio de color del header cuando está en modo edición */
#orden-modal-header.editing-mode {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

#orden-modal-icon.editing-mode {
    background: rgba(255, 255, 255, 0.25);
}

/* Modal de Confirmación de Eliminación */
.modal-confirm-delete {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.modal-confirm-content {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease-out;
}

.modal-confirm-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    animation: bounceIn 0.5s ease-out;
}

.modal-confirm-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 700;
}

.modal-confirm-message {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.modal-confirm-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff3cd;
    color: #856404;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    border: 1px solid #ffeeba;
}

.modal-confirm-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-confirm-cancel,
.btn-confirm-delete {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-confirm-cancel {
    background: #e9ecef;
    color: #495057;
}

.btn-confirm-cancel:hover {
    background: #dee2e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-confirm-delete {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.btn-confirm-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   ESTILOS PARA ÓRDENES ELIMINADAS
   ======================================== */

/* Fila de orden eliminada */
tr.orden-eliminada {
    background-color: #fff5f5;
    opacity: 0.7;
}

tr.orden-eliminada:hover {
    background-color: #ffe3e3;
    opacity: 0.85;
}

/* Badge de eliminada */
.badge-eliminada {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #ff6b6b;
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    animation: pulseDelete 2s ease-in-out infinite;
}

@keyframes pulseDelete {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255, 107, 107, 0);
    }
}

/* Botón de eliminar permanentemente */
.btn-delete-permanent {
    background: linear-gradient(135deg, #c92a2a 0%, #a61e4d 100%);
    color: white;
}

.btn-delete-permanent:hover {
    background: linear-gradient(135deg, #a61e4d 0%, #862e5c 100%);
    box-shadow: 0 4px 12px rgba(201, 42, 42, 0.4);
}

/* Deshabilitar edición en órdenes eliminadas */
.orden-eliminada .btn-edit[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   BOTONES DE RESTAURAR Y CAMBIO RÁPIDO
   ======================================== */

/* Botón de restaurar */
.btn-restore {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
}

.btn-restore:hover {
    background: linear-gradient(135deg, #37b24d 0%, #2f9e44 100%);
    box-shadow: 0 4px 12px rgba(55, 178, 77, 0.4);
    transform: translateY(-2px);
}

/* Botón de completar */
.btn-complete {
    background: linear-gradient(135deg, #4c6ef5 0%, #364fc7 100%);
    color: white;
}

.btn-complete:hover {
    background: linear-gradient(135deg, #364fc7 0%, #2f4099 100%);
    box-shadow: 0 4px 12px rgba(76, 110, 245, 0.4);
    transform: translateY(-2px);
}

/* Botón de iniciar */
.btn-start {
    background: linear-gradient(135deg, #ff922b 0%, #fd7e14 100%);
    color: white;
}

.btn-start:hover {
    background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%);
    box-shadow: 0 4px 12px rgba(253, 126, 20, 0.4);
    transform: translateY(-2px);
}

/* ========================================
   PAGINACIÓN
   ======================================== */

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.95) 100%);
    border-radius: 0 0 16px 16px;
    border-top: 1px solid var(--border-color);
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pagination-info span {
    font-weight: 700;
    color: var(--text-color);
}

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    border: 2px solid #e0e6ed;
    background: white;
    color: var(--text-color);
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    border-color: #6366f1;
    background: #f9fafb;
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-color: #6366f1;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Responsive para paginación */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 1rem;
    }

    .pagination {
        justify-content: center;
    }

    .pagination-info {
        text-align: center;
    }
}