﻿/* ============================================
   COTIZACIONES - OPERACIONES LOGÍSTICA
   ============================================ */

.cotizaciones-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
}

.cotizaciones-main {
    min-width: 0;
}

.cotizaciones-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header Badge */
.header-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    margin-left: auto;
}

.badge-count {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* Lista de Cotizaciones */
.cotizaciones-list {
    display: flex;
    flex-direction: column;
}

.cotizacion-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    transition: var(--transition);
}

    .cotizacion-item:last-child {
        border-bottom: none;
    }

    .cotizacion-item:hover {
        background: var(--hover-bg);
    }

.cotizacion-item--principal {
    background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
    border-left: 4px solid var(--brand-green);
}

    .cotizacion-item--principal:hover {
        background: linear-gradient(135deg, #bbf7d0 0%, #dcfce7 100%);
    }

/* Info de Cotización */
.cotizacion-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cotizacion-numero {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-heading);
}

    .cotizacion-numero i {
        color: var(--brand-blue);
    }

.principal-badge {
    background: linear-gradient(135deg, var(--brand-green), #219150);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.cotizacion-notas {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Detalles de Cotización */
.cotizacion-detalles {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.cotizacion-detalle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

    .cotizacion-detalle i {
        color: var(--brand-blue);
        width: 16px;
    }

/* Acciones */
.cotizacion-acciones {
    display: flex;
    gap: 0.375rem;
}

/* Estado Vacío */
.cotizaciones-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

    .cotizaciones-empty i {
        font-size: 3.5rem;
        opacity: 0.3;
        margin-bottom: 1rem;
    }

    .cotizaciones-empty h4 {
        color: var(--text-heading);
        margin-bottom: 0.5rem;
    }

    .cotizaciones-empty p {
        margin: 0;
    }

/* Formulario de Vincular */
.form-check-custom {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem;
    background: #f8fafc;
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    cursor: pointer;
}

    .form-check-custom input {
        width: 18px;
        height: 18px;
        accent-color: var(--brand-green);
        cursor: pointer;
    }

    .form-check-custom label {
        display: flex;
        align-items: center;
        gap: 0.375rem;
        font-weight: 500;
        color: var(--text-heading);
        cursor: pointer;
        margin: 0;
    }

        .form-check-custom label i {
            color: #f59e0b;
        }

.btn-vincular {
    width: 100%;
    background: linear-gradient(135deg, var(--brand-green), var(--brand-teal));
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

    .btn-vincular:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    }

/* Sin cotizaciones disponibles */
.no-cotizaciones {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
}

    .no-cotizaciones i {
        font-size: 2.5rem;
        opacity: 0.4;
        margin-bottom: 0.75rem;
    }

    .no-cotizaciones p {
        margin: 0 0 0.25rem 0;
        color: var(--text-heading);
    }

/* Responsive */
@media (max-width: 1200px) {
    .cotizaciones-grid {
        grid-template-columns: 1fr;
    }

    .cotizaciones-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .cotizacion-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cotizacion-acciones {
        justify-content: flex-start;
    }
}



/* ============================================
   BOTÓN COTIZACIONES - OPERACIONES LOGÍSTICA
   ============================================ */

.btn-cotizaciones {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    border: none;
    box-shadow: var(--shadow-sm);
}

    .btn-cotizaciones:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
        background: linear-gradient(135deg, #7c3aed, #6d28d9);
        color: white;
    }

    .btn-cotizaciones:active {
        transform: translateY(0);
    }

    .btn-cotizaciones i {
        font-size: 1rem;
    }

/* Variante outline para usar en otros contextos */
.btn-cotizaciones--outline {
    background: transparent;
    color: #8b5cf6;
    border: 2px solid #8b5cf6;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

    .btn-cotizaciones--outline:hover {
        background: linear-gradient(135deg, #8b5cf6, #7c3aed);
        color: white;
        border-color: #8b5cf6;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    }

/* ============================================
   BOTONES DE APROBACIÓN DE COTIZACIÓN
   ============================================ */

/* Botón Aprobar - Verde con gradiente */
.btn-aprobar {
    background: linear-gradient(135deg, var(--brand-green), #219150);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

    .btn-aprobar:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(39, 174, 96, 0.35);
        background: linear-gradient(135deg, #219150, #1a7a42);
    }

    .btn-aprobar:active {
        transform: translateY(0);
    }

/* Botón Revocar - Naranja/Warning con outline */
.btn-revocar {
    background: transparent;
    color: #d97706;
    border: 2px solid #d97706;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

    .btn-revocar:hover {
        background: linear-gradient(135deg, #f59e0b, #d97706);
        color: white;
        border-color: #d97706;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }

    .btn-revocar:active {
        transform: translateY(0);
    }

/* Botón Crear Expediente */
.btn-crear-expediente {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

    .btn-crear-expediente:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(41, 128, 185, 0.35);
        color: white;
    }

/* Card de Aprobación */
.aprobacion-card {
    background: linear-gradient(135deg, #dcfce7, #d1fae5);
    border: 1px solid #86efac;
    border-radius: var(--border-radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.aprobacion-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

    .aprobacion-card-header i {
        font-size: 1.5rem;
        color: #166534;
    }

    .aprobacion-card-header strong {
        font-size: 1.125rem;
        color: #166534;
    }

.aprobacion-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(22, 101, 52, 0.3);
}

.aprobacion-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #166534;
}

    .aprobacion-info-item i {
        font-size: 1rem;
        opacity: 0.8;
    }

.aprobacion-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Estado Badge para Aprobada */
.estado-badge--aprobada {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border: 1px solid #86efac;
}

/* Responsive */
@media (max-width: 768px) {
    .aprobacion-actions {
        flex-direction: column;
    }

    .btn-aprobar,
    .btn-revocar,
    .btn-crear-expediente {
        width: 100%;
        justify-content: center;
    }
}


/* ============================================
   TIMELINE - ESTILOS COMPLETOS
   ============================================ */
.timeline-container {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.timeline-header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .timeline-header-title > i {
        font-size: 2.5rem;
        color: var(--brand-blue);
    }

    .timeline-header-title h2 {
        margin: 0;
        color: var(--text-heading);
        font-weight: 700;
    }

.timeline-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.timeline-header-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-notificar-masivo {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

    .btn-notificar-masivo:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }

/* Info Card */
.timeline-info-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.timeline-info-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
}

.timeline-info-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.timeline-info-card .info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .timeline-info-card .info-item i {
        color: var(--brand-blue);
    }

.timeline-info-card .info-label {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.timeline-info-card .info-value {
    color: var(--text-heading);
    font-weight: 600;
}

/* Progress Card */
.timeline-progress-card {
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--sidebar-border);
}

.progress-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.progress-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--brand-blue);
    line-height: 1;
}

    .progress-value.completed {
        color: var(--brand-green);
    }

.progress-bar-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin: 0.75rem 0;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-teal));
    border-radius: 4px;
    transition: width 0.5s ease;
}

    .progress-bar-fill.completed {
        background: linear-gradient(90deg, var(--brand-green), var(--brand-teal));
    }

.progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Alerts */
.timeline-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

    .timeline-alert > i {
        font-size: 1.25rem;
    }

.timeline-alert--success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.timeline-alert--error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
}

    .alert-close:hover {
        opacity: 1;
    }

/* Content Grid */
.timeline-content-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
}

/* Timeline Card */
.timeline-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.timeline-card-header {
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-heading);
}

    .timeline-card-title i {
        color: var(--brand-blue);
    }

.timeline-badges {
    display: flex;
    gap: 0.5rem;
}

.stat-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-badge--danger {
    background: #fee2e2;
    color: #991b1b;
}

.stat-badge--info {
    background: #dbeafe;
    color: #1e40af;
}

.btn-generar-hitos {
    background: linear-gradient(135deg, var(--brand-green), var(--brand-teal));
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: var(--transition);
}

    .btn-generar-hitos:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    }

.timeline-card-body {
    padding: 1.25rem;
}

/* Timeline Empty */
.timeline-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

    .timeline-empty i {
        font-size: 4rem;
        opacity: 0.3;
    }

    .timeline-empty h4 {
        color: var(--text-heading);
        margin: 1rem 0 0.5rem;
    }

/* Timeline Visual */
.timeline-visual {
    position: relative;
    padding-left: 40px;
}

    .timeline-visual::before {
        content: '';
        position: absolute;
        left: 14px;
        top: 0;
        bottom: 0;
        width: 3px;
        background: linear-gradient(180deg, var(--sidebar-border) 0%, #cbd5e1 100%);
        border-radius: 3px;
    }

.timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

    .timeline-item:last-child {
        padding-bottom: 0;
    }

.timeline-marker {
    position: absolute;
    left: -40px;
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 4px white;
    z-index: 1;
}

    .timeline-marker i {
        font-size: 1.25rem;
    }

.timeline-item.completed .timeline-marker i {
    color: var(--brand-green);
}

.timeline-item.alert .timeline-marker i {
    color: #dc2626;
    animation: pulse-icon 1.5s ease-in-out infinite;
}

.timeline-item.pending .timeline-marker i {
    color: var(--text-muted);
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.timeline-item-content {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--sidebar-border);
    transition: var(--transition);
}

    .timeline-item-content:hover {
        box-shadow: var(--shadow-sm);
    }

.timeline-item.completed .timeline-item-content {
    border-left-color: var(--brand-green);
    background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
}

.timeline-item.alert .timeline-item-content {
    border-left-color: #dc2626;
    background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
}

.timeline-item.selected .timeline-item-content {
    border-left-color: #f59e0b;
    box-shadow: 0 0 0 2px #fbbf24;
}

.timeline-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.timeline-item-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hito-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-blue);
}

.hito-nombre {
    font-weight: 600;
    color: var(--text-heading);
}

.hito-badges {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.hito-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.hito-badge--success {
    background: #dcfce7;
    color: #166534;
}

.hito-badge--danger {
    background: #fee2e2;
    color: #991b1b;
}

.hito-badge--warning {
    background: #fef3c7;
    color: #92400e;
}

.hito-badge--info {
    background: #dbeafe;
    color: #1e40af;
}

.hito-badge--secondary {
    background: #f1f5f9;
    color: #475569;
}

.timeline-item-actions {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

.action-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid;
    background: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.action-btn--success {
    border-color: var(--brand-green);
    color: var(--brand-green);
}

    .action-btn--success:hover {
        background: var(--brand-green);
        color: white;
    }

.action-btn--warning {
    border-color: #f59e0b;
    color: #f59e0b;
}

    .action-btn--warning:hover {
        background: #f59e0b;
        color: white;
    }

.action-btn--primary {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

    .action-btn--primary:hover {
        background: var(--brand-blue);
        color: white;
    }

.action-btn--danger {
    border-color: #dc2626;
    color: #dc2626;
}

    .action-btn--danger:hover {
        background: #dc2626;
        color: white;
    }

.timeline-item-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.date-item i {
    color: var(--brand-blue);
}

.timeline-item-obs {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

    .timeline-item-obs i {
        color: var(--brand-blue);
    }

/* Sidebar */
.timeline-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-card--success {
    border-color: var(--brand-green);
}

    .sidebar-card--success .sidebar-card-body {
        color: var(--brand-green);
    }

        .sidebar-card--success .sidebar-card-body i {
            font-size: 3rem;
            opacity: 0.7;
        }

.sidebar-card-header {
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-heading);
}

    .sidebar-card-header i {
        color: var(--brand-blue);
    }

.sidebar-card-body {
    padding: 1.25rem;
}

    .sidebar-card-body.p-0 {
        padding: 0;
    }

.sidebar-card .form-group {
    margin-bottom: 1rem;
}

.sidebar-card .form-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

    .sidebar-card .form-label i {
        color: var(--brand-blue);
    }

.sidebar-card .form-control {
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
}

    .sidebar-card .form-control:focus {
        border-color: var(--brand-blue);
        box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
        outline: none;
    }

.btn-agregar-hito {
    width: 100%;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

    .btn-agregar-hito:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
    }

/* Resumen */
.resumen-list {
    display: flex;
    flex-direction: column;
}

.resumen-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
}

    .resumen-item:last-child {
        border-bottom: none;
    }

.resumen-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.resumen-icon--success {
    background: #dcfce7;
    color: #166534;
}

.resumen-icon--warning {
    background: #fef3c7;
    color: #92400e;
}

.resumen-icon--danger {
    background: #fee2e2;
    color: #991b1b;
}

.resumen-icon--info {
    background: #dbeafe;
    color: #1e40af;
}

.resumen-label {
    flex: 1;
    color: var(--text-primary);
}

.resumen-value {
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.8125rem;
}

.resumen-value--success {
    background: #dcfce7;
    color: #166534;
}

.resumen-value--warning {
    background: #fef3c7;
    color: #92400e;
}

.resumen-value--danger {
    background: #fee2e2;
    color: #991b1b;
}

.resumen-value--info {
    background: #dbeafe;
    color: #1e40af;
}

/* Leyenda */
.leyenda-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.leyenda-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.leyenda-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.leyenda-color--success {
    background: #22c55e;
}

.leyenda-color--danger {
    background: #ef4444;
}

.leyenda-color--warning {
    background: #f59e0b;
}

.leyenda-color--secondary {
    background: #94a3b8;
}

.leyenda-icon--info {
    color: #3b82f6;
}

/* Modal Timeline */
.modal-timeline {
    border: none;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

    .modal-timeline .modal-header {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--sidebar-border);
    }

.modal-header--warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.modal-timeline .modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
}

    .modal-close:hover {
        opacity: 1;
    }

.modal-timeline .modal-body {
    padding: 1.5rem;
}

.modal-info-box {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.modal-info-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

    .modal-info-row:last-child {
        margin-bottom: 0;
    }

.modal-info-label {
    color: #1e40af;
    font-weight: 600;
}

.modal-info-value {
    color: #1e3a8a;
}

.form-switch-custom {
    background: #f8fafc;
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
}

    .form-switch-custom input {
        margin-right: 0.5rem;
    }

    .form-switch-custom label {
        font-weight: 600;
        color: var(--text-heading);
        cursor: pointer;
    }

    .form-switch-custom small {
        display: block;
        margin-top: 0.375rem;
        margin-left: 1.5rem;
        color: var(--text-muted);
    }

.modal-note {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #92400e;
}

.modal-timeline .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-modal-cancel {
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--sidebar-border);
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

    .btn-modal-cancel:hover {
        background: #e2e8f0;
    }

.btn-modal-submit {
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-modal-submit--warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

    .btn-modal-submit--warning:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }

.btn-modal-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Hitos Selector */
.hitos-selector {
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius);
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
}

.hito-selector-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

    .hito-selector-item:hover {
        background: #f8fafc;
    }

    .hito-selector-item input {
        margin-right: 0.75rem;
        accent-color: var(--brand-blue);
    }

.hito-selector-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hito-selector-name {
    font-weight: 500;
    color: var(--text-heading);
}

.hito-selector-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.hitos-selector-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-selector {
    background: var(--brand-blue);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

    .btn-selector:hover {
        background: var(--brand-blue-dark);
    }

.btn-selector--secondary {
    background: #f1f5f9;
    color: var(--text-primary);
}

    .btn-selector--secondary:hover {
        background: #e2e8f0;
    }

/* Responsive Timeline */
@media (max-width: 1200px) {
    .timeline-content-grid {
        grid-template-columns: 1fr;
    }

    .timeline-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 992px) {
    .timeline-info-grid {
        grid-template-columns: 1fr;
    }

    .timeline-progress-card {
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-header-actions {
        width: 100%;
        flex-direction: column;
    }

        .timeline-header-actions > * {
            width: 100%;
            justify-content: center;
        }

    .info-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .timeline-item-header {
        flex-direction: column;
    }

    .timeline-item-actions {
        margin-top: 0.75rem;
    }

    .timeline-sidebar {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   OPERACIONES - ALERTAS Y BOTÓN CREAR
   ============================================ */
.operacion-alert {
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

    .operacion-alert > i {
        font-size: 1.25rem;
        flex-shrink: 0;
        margin-top: 0.125rem;
    }

    .operacion-alert ul {
        margin: 0.5rem 0 0 0;
        padding-left: 1.25rem;
    }

.operacion-alert--error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
}

    .operacion-alert--error > i {
        color: #e53e3e;
    }

.operacion-alert--info {
    background: linear-gradient(135deg, #dbeafe, #e0f2fe);
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.btn-crear {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

    .btn-crear:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
    }

/* ============================================
   OPERACIONES LOGÍSTICA - EDIT
   ============================================ */
.operacion-edit-container {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.operacion-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.operacion-edit-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .operacion-edit-title > i {
        font-size: 2.5rem;
        color: var(--brand-blue);
    }

    .operacion-edit-title h2 {
        margin: 0;
        color: var(--text-heading);
        font-weight: 700;
    }

.operacion-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Grid Layout */
.operacion-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.operacion-edit-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Edit Cards */
.edit-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.edit-card-header {
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-heading);
}

    .edit-card-header i {
        color: var(--brand-blue);
        font-size: 1.1rem;
    }

.edit-card-body {
    padding: 1.25rem;
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.edit-card .form-group {
    margin-bottom: 1rem;
}

    .edit-card .form-group:last-child {
        margin-bottom: 0;
    }

    .edit-card .form-group.mb-0 {
        margin-bottom: 0;
    }

.edit-card .form-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

    .edit-card .form-label i {
        color: var(--brand-blue);
        font-size: 0.875rem;
    }

        .edit-card .form-label i.text-success {
            color: var(--brand-green);
        }

        .edit-card .form-label i.text-danger {
            color: #ef4444;
        }

.edit-card .form-control {
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: var(--transition);
    width: 100%;
}

    .edit-card .form-control:focus {
        border-color: var(--brand-blue);
        box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
        outline: none;
    }

    .edit-card .form-control::placeholder {
        color: var(--text-muted);
    }

.edit-card textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Edit Actions */
.edit-actions {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.btn-cancelar {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--sidebar-border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

    .btn-cancelar:hover {
        border-color: #dc3545;
        color: #dc3545;
        background: #fff5f5;
    }

.btn-guardar {
    background: linear-gradient(135deg, var(--brand-green), var(--brand-teal));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

    .btn-guardar:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    }

/* Responsive Edit */
@media (max-width: 992px) {
    .operacion-edit-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .operacion-edit-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .edit-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

        .edit-actions .btn-cancelar,
        .edit-actions .btn-guardar {
            width: 100%;
            justify-content: center;
        }
}

/* ============================================
   OPERACIONES LOGÍSTICA - DETAILS
   ============================================ */
.operacion-detail-container {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.operacion-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.operacion-detail-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.operacion-id {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .operacion-id i {
        font-size: 2rem;
        color: var(--brand-blue);
    }

    .operacion-id h2 {
        margin: 0;
        color: var(--text-heading);
        font-weight: 700;
    }

.operacion-badges {
    display: flex;
    gap: 0.5rem;
}

.operacion-detail-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-editar {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

    .btn-editar:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        color: white;
    }

.btn-volver {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--sidebar-border);
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

    .btn-volver:hover {
        border-color: var(--brand-blue);
        color: var(--brand-blue);
    }

/* Info Bar */
.operacion-info-bar {
    background: linear-gradient(135deg, #dbeafe, #e0f2fe);
    border: 1px solid #93c5fd;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

    .operacion-info-bar .info-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .operacion-info-bar .info-item i {
            color: var(--brand-blue);
        }

    .operacion-info-bar .info-label {
        color: var(--text-muted);
        font-weight: 500;
    }

    .operacion-info-bar .info-value {
        color: var(--text-heading);
        font-weight: 600;
    }

/* Grid Layout */
.operacion-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.operacion-detail-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Detail Cards */
.detail-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.detail-card-header {
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-heading);
}

    .detail-card-header i {
        color: var(--brand-blue);
        font-size: 1.1rem;
    }

.detail-card-body {
    padding: 1.25rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid #f1f5f9;
}

    .detail-row:last-child {
        border-bottom: none;
    }

    .detail-row.highlight {
        background: #f8fafc;
        margin: 0 -1.25rem;
        padding: 0.625rem 1.25rem;
    }

.detail-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.detail-value {
    color: var(--text-heading);
    font-weight: 500;
    text-align: right;
}

/* Ruta Visual */
.ruta-visual {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.ruta-punto {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
}

    .ruta-punto i {
        font-size: 1.5rem;
        margin-top: 0.25rem;
    }

    .ruta-punto.origen i {
        color: var(--brand-green);
    }

    .ruta-punto.destino i {
        color: #ef4444;
    }

.ruta-info {
    display: flex;
    flex-direction: column;
}

.ruta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ruta-value {
    font-weight: 600;
    color: var(--text-heading);
}

.ruta-fecha {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.ruta-linea {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem;
}

    .ruta-linea::before {
        content: '';
        width: 60px;
        height: 2px;
        background: linear-gradient(90deg, var(--brand-green), var(--brand-blue), #ef4444);
        border-radius: 2px;
    }

.transito-dias {
    font-size: 0.75rem;
    color: var(--brand-blue);
    font-weight: 600;
    margin-top: 0.375rem;
    white-space: nowrap;
}

/* Observaciones */
.observaciones-text {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Estado Form */
.estado-form {
    display: flex;
    gap: 0.75rem;
}

.estado-select {
    flex: 1;
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius);
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    transition: var(--transition);
}

    .estado-select:focus {
        border-color: var(--brand-blue);
        box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
        outline: none;
    }

.btn-cambiar-estado {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: var(--transition);
    white-space: nowrap;
}

    .btn-cambiar-estado:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }

/* Documentos Card */
.documentos-card {
    margin-bottom: 0;
}

.documentos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.documento-btn {
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.documento-btn--outline {
    background: transparent;
    color: var(--brand-blue);
    border: 1px solid var(--brand-blue);
}

    .documento-btn--outline:hover {
        background: var(--brand-blue);
        color: white;
    }

.documento-btn--primary {
    background: var(--brand-blue);
    color: white;
    border: 1px solid var(--brand-blue);
}

    .documento-btn--primary:hover {
        background: var(--brand-blue-dark);
        border-color: var(--brand-blue-dark);
        color: white;
    }

.documento-btn--outline-info {
    background: transparent;
    color: #0ea5e9;
    border: 1px solid #0ea5e9;
}

    .documento-btn--outline-info:hover {
        background: #0ea5e9;
        color: white;
    }

.documento-btn--info {
    background: #0ea5e9;
    color: white;
    border: 1px solid #0ea5e9;
}

    .documento-btn--info:hover {
        background: #0284c7;
        border-color: #0284c7;
        color: white;
    }

.documento-btn--secondary {
    background: #64748b;
    color: white;
    border: 1px solid #64748b;
}

    .documento-btn--secondary:hover {
        background: #475569;
        border-color: #475569;
        color: white;
    }

/* Responsive Details */
@media (max-width: 992px) {
    .operacion-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .operacion-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .operacion-detail-actions {
        width: 100%;
    }

        .operacion-detail-actions a {
            flex: 1;
            justify-content: center;
        }

    .ruta-visual {
        flex-direction: column;
        align-items: stretch;
    }

    .ruta-linea {
        padding: 0.5rem 0;
    }

        .ruta-linea::before {
            width: 2px;
            height: 30px;
        }

    .estado-form {
        flex-direction: column;
    }

    .documentos-grid {
        flex-direction: column;
    }

    .documento-btn {
        justify-content: center;
    }
}

/* ============================================
   OPERACIONES LOGÍSTICA - INDEX
   ============================================ */
.operaciones-container {
    padding: 1.5rem;
}

.operaciones-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.operaciones-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .operaciones-title i {
        font-size: 1.75rem;
        color: var(--brand-blue);
    }

    .operaciones-title h2 {
        margin: 0;
        color: var(--text-heading);
        font-weight: 700;
    }

.btn-nuevo-expediente {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

    .btn-nuevo-expediente:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        color: white;
    }

/* Filtros */
.operaciones-filtros {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.filtros-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
    min-width: 150px;
}

    .filtro-grupo label {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: flex;
        align-items: center;
        gap: 0.375rem;
    }

        .filtro-grupo label i {
            color: var(--brand-blue);
        }

.filtro-input,
.filtro-select {
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: var(--transition);
    background: #fff;
}

    .filtro-input:focus,
    .filtro-select:focus {
        border-color: var(--brand-blue);
        box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
        outline: none;
    }

.filtro-acciones {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-width: auto;
}

.btn-filtrar {
    background: var(--brand-blue);
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: var(--transition);
}

    .btn-filtrar:hover {
        background: var(--brand-blue-dark);
    }

.btn-limpiar {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--sidebar-border);
    padding: 0.625rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
}

    .btn-limpiar:hover {
        color: #dc3545;
        border-color: #dc3545;
    }

/* Estado vacío */
.operaciones-empty {
    background: var(--sidebar-bg);
    border: 2px dashed var(--sidebar-border);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

    .operaciones-empty i {
        font-size: 3rem;
        margin-bottom: 1rem;
        opacity: 0.5;
    }

    .operaciones-empty h4 {
        color: var(--text-heading);
        margin-bottom: 0.5rem;
    }

/* Tabla */
.operaciones-table-container {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.operaciones-table {
    width: 100%;
    border-collapse: collapse;
}

    .operaciones-table thead {
        background: linear-gradient(135deg, #f8fafc, #eef2f7);
    }

    .operaciones-table th {
        padding: 1rem;
        text-align: left;
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 2px solid var(--sidebar-border);
    }

    .operaciones-table td {
        padding: 0.875rem 1rem;
        border-bottom: 1px solid var(--sidebar-border);
        color: var(--text-primary);
        font-size: 0.875rem;
    }

    .operaciones-table tbody tr:hover {
        background: var(--hover-bg);
    }

    .operaciones-table tbody tr:last-child td {
        border-bottom: none;
    }

/* Badges */
.id-badge {
    font-weight: 700;
    color: var(--brand-blue);
}

.modo-badge,
.incoterm-badge {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-heading);
}

.tipo-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
}

    .tipo-badge.importacion {
        background: #dbeafe;
        color: #1e40af;
    }

    .tipo-badge.exportacion {
        background: #dcfce7;
        color: #166534;
    }

.estado-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

    .estado-badge.estado-pendiente {
        background: #fef3c7;
        color: #92400e;
    }

    .estado-badge.estado-entransito,
    .estado-badge.estado-enTransito {
        background: #dbeafe;
        color: #1e40af;
    }

    .estado-badge.estado-completado,
    .estado-badge.estado-completada {
        background: #dcfce7;
        color: #166534;
    }

    .estado-badge.estado-cancelado,
    .estado-badge.estado-cancelada {
        background: #fee2e2;
        color: #991b1b;
    }

.btn-ver {
    background: transparent;
    color: var(--brand-blue);
    border: 1px solid var(--brand-blue);
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: var(--transition);
}

    .btn-ver:hover {
        background: var(--brand-blue);
        color: white;
    }

/* Responsive */
@media (max-width: 992px) {
    .operaciones-table-container {
        overflow-x: auto;
    }

    .operaciones-table {
        min-width: 900px;
    }
}

@media (max-width: 768px) {
    .operaciones-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .filtros-form {
        flex-direction: column;
    }

    .filtro-grupo {
        width: 100%;
    }
}


/* ============================================
   ENVIAR EMAIL - ESTILOS
   ============================================ */
.email-container {
    max-width: 800px;
    margin: 0 auto;
}

.email-card {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--sidebar-border);
}

.email-card-header {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .email-card-header h4 {
        margin: 0;
        font-weight: 600;
        font-size: 1.25rem;
    }

    .email-card-header i {
        font-size: 1.5rem;
        opacity: 0.9;
    }

.email-card-body {
    padding: 1.5rem;
}

/* Sección de búsqueda de hilo */
.email-search-section {
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.email-search-header {
    background: rgba(41, 128, 185, 0.1);
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    font-weight: 600;
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
}

.email-search-body {
    padding: 1.25rem;
}

/* Resultado de búsqueda - Correo encontrado */
.email-found-card {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 1px solid #28a745;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

    .email-found-card h6 {
        color: #155724;
        font-weight: 700;
        margin-bottom: 0.75rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .email-found-card .email-detail {
        display: flex;
        margin-bottom: 0.375rem;
        font-size: 0.9rem;
    }

        .email-found-card .email-detail strong {
            color: #155724;
            min-width: 80px;
        }

        .email-found-card .email-detail span {
            color: #1e7e34;
        }

    .email-found-card .email-conversation-id {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px dashed rgba(21, 87, 36, 0.3);
        font-size: 0.75rem;
        color: #155724;
        opacity: 0.8;
    }

/* Resultado de búsqueda - No encontrado */
.email-not-found {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border: 1px solid #ffc107;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

    .email-not-found i {
        font-size: 1.25rem;
    }

/* Campos del formulario de email */
.email-form-section {
    background: #fff;
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.email-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.email-info-field {
    background: #f8fafc;
    border: 1px solid var(--sidebar-border);
    border-radius: var(--border-radius);
    padding: 0.875rem 1rem;
}

    .email-info-field label {
        display: block;
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 0.375rem;
    }

    .email-info-field .value {
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-heading);
    }

.email-destination-field {
    margin-bottom: 0;
}

    .email-destination-field label {
        font-weight: 600;
        color: var(--text-heading);
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.375rem;
    }

        .email-destination-field label i {
            color: var(--brand-blue);
        }

    .email-destination-field input {
        border: 2px solid var(--sidebar-border);
        border-radius: var(--border-radius);
        padding: 0.875rem 1rem;
        font-size: 1rem;
        transition: var(--transition);
    }

        .email-destination-field input:focus {
            border-color: var(--brand-blue);
            box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
            outline: none;
        }

    .email-destination-field .form-text {
        margin-top: 0.5rem;
        color: var(--text-muted);
        font-size: 0.8125rem;
    }

/* Botones de acción */
.email-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--sidebar-border);
}

.email-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.email-btn--reply {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

    .email-btn--reply:hover {
        background: linear-gradient(135deg, #218838, #1aa179);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    }

.email-btn--send {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
    color: white;
}

    .email-btn--send:hover {
        background: linear-gradient(135deg, var(--brand-blue-dark), var(--brand-blue));
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
    }

.email-btn--cancel {
    background: #6c757d;
    color: white;
    text-decoration: none;
}

    .email-btn--cancel:hover {
        background: #5a6268;
        color: white;
    }

/* Toast de notificaciones */
.email-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    min-width: 300px;
    max-width: 450px;
    animation: slideInRight 0.3s ease-out;
}

    .email-toast .alert {
        margin: 0;
        box-shadow: var(--shadow-lg);
        border: none;
    }

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .email-info-row {
        grid-template-columns: 1fr;
    }

    .email-actions {
        flex-direction: column;
    }

    .email-btn {
        width: 100%;
        justify-content: center;
    }
}



/* ============================================
   VARIANTES DE FORMULARIOS
   ============================================ */


/* Header variantes */
.form-card-header--edit {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
}

.form-card-header--info {
    background: linear-gradient(135deg, var(--brand-teal), var(--brand-blue));
}

.form-card-header--danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* Botones variantes */
.btn-submit--edit {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    text-decoration: none;
    color: white;
}

.btn-submit--danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* Título danger */
.page-title--danger {
    color: #c0392b;
}

    .page-title--danger i {
        color: #e74c3c;
    }

/* ============================================
   LISTA DE DETALLES
   ============================================ */
.detail-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: var(--body-bg);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--brand-blue);
}

.detail-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

    .detail-label i {
        color: var(--brand-blue);
    }

.detail-value {
    font-size: 1.0625rem;
    color: var(--text-heading);
    font-weight: 600;
}

/* ============================================
   ADVERTENCIA DE ELIMINACIÓN
   ============================================ */
.delete-warning {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

    .delete-warning i {
        font-size: 1.25rem;
    }


/* ============================================
   FORMULARIOS - CREAR/EDITAR ENTIDADES
   ============================================ */
.page-title {
    color: var(--text-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .page-title i {
        color: var(--brand-blue);
    }

.form-card {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--sidebar-border);
}

.form-card-header {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-card-body {
    padding: 1.5rem;
}

/* Campos del formulario */
.form-group {
    margin-bottom: 1.25rem;
}

    .form-group .form-label {
        color: var(--text-heading);
        font-weight: 600;
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.375rem;
    }

        .form-group .form-label i {
            color: var(--brand-blue);
            font-size: 0.9rem;
        }

    .form-group .form-control {
        border: 1px solid var(--sidebar-border);
        border-radius: var(--border-radius);
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
        transition: var(--transition);
        background: #fff;
    }

        .form-group .form-control:focus {
            border-color: var(--brand-blue);
            box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
            outline: none;
        }

        .form-group .form-control::placeholder {
            color: var(--text-muted);
        }

/* Botones del formulario */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--sidebar-border);
}

.btn-back {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--sidebar-border);
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

    .btn-back:hover {
        background: var(--hover-bg);
        color: var(--brand-blue);
        border-color: var(--brand-blue);
    }

.btn-submit {
    background: linear-gradient(135deg, var(--brand-green), var(--brand-teal));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

    .btn-submit:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        filter: brightness(1.05);
    }

/* Validación */
.validation-error {
    color: #dc3545;
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

.alert-validation {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

/* ============================================
   VARIABLES GLOBALES - COLORES DEL LOGO
   ============================================ */
:root {
    /* Colores del Logo */
    --brand-blue: #2980B9;
    --brand-blue-dark: #1B4F72;
    --brand-blue-light: #3498DB;
    --brand-green: #27AE60;
    --brand-teal: #1ABC9C;
    /* UI Colors */
    --sidebar-bg: #ffffff;
    --sidebar-border: #e7e7e8;
    --body-bg: #f5f5f9;
    --text-primary: #566a7f;
    --text-heading: #32475c;
    --text-muted: #a1acb8;
    --hover-bg: rgba(41, 128, 185, 0.08);
    --active-bg: rgba(41, 128, 185, 0.16);
    --active-color: var(--brand-blue);
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 8px;
    --border-radius-lg: 10px;
    --transition: all 0.2s ease-in-out;
    --shadow-sm: 0 2px 6px rgba(67, 89, 113, 0.08);
    --shadow-md: 0 4px 12px rgba(67, 89, 113, 0.12);
}

/* ============================================
   BASE STYLES
   ============================================ */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    min-height: 100vh;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-primary);
}

/* ============================================
   SIDEBAR - ESTILO SNEAT
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

    .sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: #d4d8dd;
        border-radius: 10px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: transparent;
    }

/* Logo Header */
.sidebar-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-heading);
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    transition: var(--transition);
}

    .sidebar-brand:hover {
        color: var(--brand-blue);
    }

/* Navigation */
.sidebar-nav {
    padding: 0.5rem 0;
}

.nav-section {
    margin-bottom: 0.25rem;
}

.nav-section-title {
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 1.5rem 1.5rem 0.625rem;
    margin: 0;
}

.nav-item {
    margin: 2px 0.875rem;
}

/* Nav Links */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9375rem;
    position: relative;
}

    .nav-link:hover {
        background: var(--hover-bg);
        color: var(--brand-blue);
    }

    .nav-link.active {
        background: var(--active-bg);
        color: var(--brand-blue);
        font-weight: 600;
    }

        .nav-link.active::before {
            content: '';
            position: absolute;
            left: -0.875rem;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 70%;
            background: var(--brand-blue);
            border-radius: 0 4px 4px 0;
        }

    .nav-link i {
        width: 22px;
        margin-right: 0.625rem;
        font-size: 1.125rem;
        opacity: 0.9;
    }

/* Dropdown Toggle */
.nav-dropdown {
    margin: 2px 0.875rem;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.625rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9375rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}

    .nav-dropdown-toggle:hover {
        background: var(--hover-bg);
        color: var(--brand-blue);
    }

    .nav-dropdown-toggle.active {
        background: var(--active-bg);
        color: var(--brand-blue);
    }

    .nav-dropdown-toggle i:first-child {
        width: 22px;
        margin-right: 0.625rem;
        font-size: 1.125rem;
    }

.nav-dropdown-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.nav-dropdown-toggle[aria-expanded="true"] .nav-dropdown-arrow {
    transform: rotate(90deg);
}

/* Dropdown Menu */
.nav-dropdown-menu {
    padding: 0.25rem 0 0.25rem 2.75rem;
}

.nav-dropdown-item {
    margin: 2px 0;
}

.nav-dropdown-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 0.875rem;
    position: relative;
}

    .nav-dropdown-link::before {
        content: '';
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--text-muted);
        margin-right: 0.75rem;
        transition: var(--transition);
    }

    .nav-dropdown-link:hover {
        color: var(--brand-blue);
        background: var(--hover-bg);
    }

        .nav-dropdown-link:hover::before {
            background: var(--brand-blue);
        }

    .nav-dropdown-link.active {
        color: var(--brand-blue);
        font-weight: 500;
    }

        .nav-dropdown-link.active::before {
            background: var(--brand-blue);
            box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.2);
        }

    .nav-dropdown-link i {
        display: none;
    }

/* Submenu Section Title */
.nav-submenu-title {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem 0.25rem;
    margin-top: 0.5rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.breadcrumb-nav .breadcrumb {
    margin: 0;
    background: none;
    padding: 0;
}

.breadcrumb-nav .breadcrumb-item a {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.breadcrumb-nav .breadcrumb-item.active {
    color: var(--text-heading);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

    .header-user:hover {
        background: var(--hover-bg);
    }

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

/* Content Area */
.content-area {
    padding: 1.5rem;
    min-height: calc(100vh - var(--header-height));
}

/* Sidebar Toggle */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-md);
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .content-area {
        padding: 1rem;
    }
}

/* Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

    .scroll-to-top:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(41, 128, 185, 0.4);
    }

    .scroll-to-top.show {
        opacity: 1;
        transform: translateY(0);
    }

/* Page Loader */
.page-loader {
    position: fixed;
    inset: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

    .page-loader.fade-out {
        opacity: 0;
        pointer-events: none;
    }

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--sidebar-border);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */
.dashboard-header {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
    color: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.metric-card {
    background: white;
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}

    .metric-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
    }

    .metric-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--brand-blue);
    }

    .metric-card.success::before {
        background: var(--brand-green);
    }

    .metric-card.warning::before {
        background: #f39c12;
    }

    .metric-card.info::before {
        background: var(--brand-teal);
    }

    .metric-card.danger::before {
        background: #e74c3c;
    }

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
}

.metric-label {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.metric-trend {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.chart-card {
    background: white;
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* List Items */
.list-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--brand-blue);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

    .list-item:hover {
        transform: translateX(4px);
    }

    .list-item.danger {
        border-left-color: #e74c3c;
    }

    .list-item.warning {
        border-left-color: #f39c12;
    }

    .list-item.success {
        border-left-color: var(--brand-green);
    }

    .list-item.info {
        border-left-color: var(--brand-teal);
    }

/* Table Card */
.table-card {
    background: white;
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

    .table-card .table {
        margin: 0;
    }

        .table-card .table thead th {
            background: #f9fafb;
            border: none;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.6875rem;
            letter-spacing: 0.5px;
            color: var(--text-muted);
            padding: 0.875rem 1rem;
        }

        .table-card .table tbody td {
            padding: 0.875rem 1rem;
            vertical-align: middle;
            border-bottom: 1px solid #f1f3f4;
        }

        .table-card .table tbody tr:hover {
            background: #fafbfc;
        }

/* Header de página */
.page-header {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--sidebar-border);
}

/* ============================================
   LISTADOS - ESTILOS COMPARTIDOS
   ============================================ */
.page-header {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--sidebar-border);
}

.table-container {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--sidebar-border);
}

.table-container .table-responsive {
    overflow-x: hidden;
}

.table-container .table thead th {
    background-color: var(--body-bg);
    border-top: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.025em;
    color: var(--text-primary);
    padding: 1rem;
}

.table-container .table tbody tr {
    transition: background-color 0.2s ease;
}

.table-container .table tbody tr:hover {
    background-color: var(--hover-bg);
}

/* ============================================
   AVATARES PARA LISTADOS
   ============================================ */
.entity-avatar,
.vendor-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

/* Variante verde para clientes */
.entity-avatar--green {
    background: linear-gradient(135deg, var(--brand-green), var(--brand-teal));
}

/* Variante azul para vendedores */
.entity-avatar--blue,
.vendor-avatar {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
}

.vendor-info {
    margin-left: 0.75rem; /* Espacio entre avatar y texto */
    min-width: 0;
}

.vendor-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-heading);
    margin-bottom: 0.125rem;
}

.vendor-email {
    font-size: 0.8125rem;
}

.vendor-email a {
    color: var(--brand-blue);
    text-decoration: none;
}

.vendor-email a:hover {
    text-decoration: underline;
}

/* Estadísticas */
.vendor-stats {
    text-align: center;
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-blue);
    display: block;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.stat-card {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sidebar-border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Indicadores de rendimiento */
.performance-indicator {
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.performance-excellent {
    background: linear-gradient(135deg, var(--brand-green), var(--brand-teal));
    color: white;
}

.performance-good {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    color: white;
}

.performance-average {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #212529;
}

.performance-new {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

/* Botones de acción */
.btn-group-actions {
    display: flex;
    gap: 0.375rem;
    justify-content: center;
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state i {
    color: var(--text-muted);
}

.empty-state h4 {
    color: var(--text-heading);
    margin-top: 1rem;
}

/* Texto con código */
.text-code {
    font-family: 'Consolas', 'Monaco', monospace;
    background: var(--body-bg);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--brand-blue);
}

/* Links de contacto */
.contact-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.contact-link:hover {
    color: var(--brand-blue);
}

.contact-link i {
    color: var(--text-muted);
    margin-right: 0.25rem;
}

/* ============================================
   CHECKBOX PERSONALIZADO
   ============================================ */
.form-check-custom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--body-bg);
    border-radius: var(--border-radius);
    margin-top: 1.75rem;
}

.form-check-custom .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    cursor: pointer;
}

.form-check-custom .form-check-input:checked {
    background-color: var(--brand-green);
    border-color: var(--brand-green);
}

.form-check-custom .form-check-label {
    font-weight: 600;
    color: var(--text-heading);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.form-check-custom .form-check-label i {
    color: var(--brand-green);
}

/* ============================================
   BADGES DE ESTADO
   ============================================ */
.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.status-badge--active {
    background: linear-gradient(135deg, var(--brand-green), var(--brand-teal));
    color: white;
}

.status-badge--inactive {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

/* ============================================
   ESTADO DE CUENTA
   ============================================ */
.estado-cuenta-container {
    padding-bottom: 100px;
}

/* Info del cliente */
.client-info-card {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    color: white;
    border-radius: var(--border-radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

    .client-info-card h4 {
        margin-bottom: 0.25rem;
        font-weight: 600;
    }

    .client-info-card .opacity-75 {
        opacity: 0.75;
    }

/* Saldo anterior */
.balance-info-card {
    background: linear-gradient(135deg, var(--brand-green), var(--brand-teal));
    color: white;
    border-radius: var(--border-radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* Card de filtros */
.filters-card {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sidebar-border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

    .filters-card h5 {
        color: var(--text-heading);
        font-weight: 600;
        margin-bottom: 1rem;
    }

/* Card de antigüedad */
.aging-card {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sidebar-border);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

    .aging-card h5 {
        color: var(--text-heading);
        font-weight: 600;
    }

/* Header de tabla con gradiente */
.table-header-purple {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

    .table-header-purple h5 {
        margin: 0;
        font-weight: 600;
    }

/* Filas de movimientos */
.movement-row-factura {
    background-color: rgba(220, 53, 69, 0.05);
}

    .movement-row-factura:hover {
        background-color: rgba(220, 53, 69, 0.1) !important;
    }

.movement-row-recibo {
    background-color: rgba(39, 174, 96, 0.05);
}

    .movement-row-recibo:hover {
        background-color: rgba(39, 174, 96, 0.1) !important;
    }

/* Responsive */
@media (max-width: 768px) {
    .estado-cuenta-container {
        padding-bottom: 120px;
    }
}


/* ============================================
   FACTURAS DE VENTA
   ============================================ */
.motivo-input {
    width: 120px !important;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
}

.factura-numero {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    color: var(--text-heading);
}

.factura-ncf {
    font-family: 'Consolas', 'Monaco', monospace;
    background: var(--body-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    color: var(--brand-blue);
}

.factura-fecha {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.factura-total {
    font-weight: 700;
    font-size: 1rem;
    color: var(--brand-green);
}

/* Estados de factura */
.estado-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.estado-badge--emitida {
    background: linear-gradient(135deg, var(--brand-green), var(--brand-teal));
    color: white;
}

.estado-badge--saldada {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
    color: white;
}

.estado-badge--anulada {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.estado-badge--borrador {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #212529;
}

.estado-badge--cotizacion {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

/* Acciones en tabla de facturas */
.acciones-factura {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

    .acciones-factura .form-select-sm {
        width: auto;
        min-width: 100px;
        font-size: 0.75rem;
    }

/* ============================================
   FORMULARIOS DE FACTURA (CREATE/EDIT)
   ============================================ */

/* Cards de formulario con header gradiente */
.invoice-card {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sidebar-border);
    overflow: hidden;
    height: 100%;
}

.invoice-card-header {
    background: linear-gradient(135deg, var(--brand-blue-dark), var(--brand-blue), var(--brand-teal));
    color: white;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-size: 0.875rem;
}

.invoice-card-body {
    padding: 1.5rem;
}

/* Sección de detalles */
.details-section {
    background: var(--body-bg);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--sidebar-border);
}

.section-title {
    color: var(--text-heading);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Botón agregar línea */
.btn-add-line {
    background: linear-gradient(135deg, var(--brand-green), var(--brand-teal));
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.8125rem;
    transition: var(--transition);
}

    .btn-add-line:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        color: white;
    }

/* Tabla de detalle de factura */
.invoice-table {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--sidebar-border);
}

    .invoice-table .table {
        margin-bottom: 0;
    }

        .invoice-table .table thead th {
            background: var(--body-bg);
            border-top: none;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.6875rem;
            letter-spacing: 0.025em;
            color: var(--text-primary);
            padding: 0.75rem 0.5rem;
            white-space: nowrap;
        }

        .invoice-table .table tbody td {
            padding: 0.5rem;
            vertical-align: middle;
            border-color: var(--sidebar-border);
        }

        .invoice-table .table .form-control,
        .invoice-table .table .form-select {
            font-size: 0.75rem;
            padding: 0.375rem 0.5rem;
            border-color: var(--sidebar-border);
        }

            .invoice-table .table .form-control:focus,
            .invoice-table .table .form-select:focus {
                border-color: var(--brand-blue);
                box-shadow: 0 0 0 2px rgba(41, 128, 185, 0.15);
            }

/* Card de totales */
.totals-card {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    border: 1px solid var(--sidebar-border);
    height: 100%;
}

    .totals-card h6 {
        color: var(--text-heading);
        font-weight: 600;
        margin-bottom: 1rem;
    }

.total-row {
    border-bottom: 1px solid var(--sidebar-border);
    padding: 0.625rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .total-row:last-child {
        border-bottom: none;
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--brand-blue);
        padding-top: 0.75rem;
    }

    .total-row input.form-control {
        text-align: right;
        font-weight: 600;
    }

/* Botones de acción del formulario */
.action-buttons {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid var(--sidebar-border);
}

/* Select2 ajustes */
.select2-container {
    width: 100% !important;
}

.select2-dropdown {
    z-index: 3000 !important;
    border-color: var(--sidebar-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.select2-container .select2-selection--single {
    height: 38px;
    border-color: var(--sidebar-border);
    border-radius: var(--border-radius);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    color: var(--text-primary);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

/* Input de motivo en tabla */
.motivo-input {
    width: 100px !important;
    font-size: 0.75rem;
}

/* Estilo para tabla responsive en facturas */
.invoice-table .table-responsive {
    overflow-x: auto;
}

/* Campo de descripción en tabla */
.invoice-table .descripcion {
    min-width: 120px;
}

/* Ancho de columnas específicas */
.invoice-table .col-cargo {
    width: 13%;
}

.invoice-table .col-equipo {
    width: 10%;
}

.invoice-table .col-descripcion {
    width: 14%;
}

.invoice-table .col-proveedor {
    width: 14%;
}

.invoice-table .col-cantidad {
    width: 7%;
}

.invoice-table .col-costo {
    width: 7%;
}

.invoice-table .col-precio {
    width: 8%;
}

.invoice-table .col-itbis {
    width: 6%;
}

.invoice-table .col-importe {
    width: 9%;
}

.invoice-table .col-moneda {
    width: 8%;
}

.invoice-table .col-acciones {
    width: 4%;
}