/* ========================================
   LISTADOS Y TABLAS - ERP V&A
   ======================================== */

/* Contenedor principal */
.erp-listing-container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 24px;
    font-family: var(--erp-font, "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* Header del listado */
.erp-listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0;
    border-bottom: none;
}

.erp-listing-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.erp-listing-header h2 {
    margin: 0;
    color: #1F354B;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.erp-listing-subtitle {
    margin: 0;
    color: #A7A3A3;
    font-size: 14px;
    font-weight: 400;
}

.erp-listing-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Filtros */
.erp-listing-filters {
    background: #ffffff;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.erp-filter-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.erp-filter-field {
    flex: 1;
    min-width: 180px;
}

.erp-filter-field label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #1F354B;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.erp-search-input,
.erp-filter-select,
.erp-filter-input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #F5F7FA;
    text-transform: uppercase;
    color: #0D181C;
}

.erp-listing-container .erp-search-input,
input.erp-search-input {
    background-image: none !important;
    padding-left: 15px !important;
    box-sizing: border-box;
}
.erp-listing-container .erp-search-input::before,
.erp-listing-container .erp-search-input::after,
.erp-filter-field:has(.erp-search-input)::before,
.erp-filter-field:has(.erp-search-input)::after {
    content: none !important;
    display: none !important;
}

.erp-search-input:focus,
.erp-filter-select:focus,
.erp-filter-input:focus {
    outline: none;
    border-color: #3F526D;
    box-shadow: 0 0 0 2px rgba(63, 82, 109, 0.15);
    background-color: #ffffff;
}

.erp-filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233F526D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 38px;
    cursor: pointer;
}

/* Botones de filtro */
.erp-btn-light {
    background-color: #fff;
    color: #3F526D;
    border: 1px solid #d1d5db;
}

.erp-btn-light:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

/* Tabla */
.erp-listing-results {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.erp-table-wrapper {
    overflow-x: auto;
}

.erp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.erp-table thead {
    background: #1F354B;
    color: #ffffff !important;
}

.erp-table thead th {
    background-color: #1F354B;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 12px;
    padding: 11px 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: none;
    white-space: nowrap;
}
.erp-table thead th:hover {
    background: #2a4560;
}

.erp-table thead th[data-sort]::after {
    content: "⇅";
    margin-left: 8px;
    opacity: 0.5;
    font-size: 12px;
}

.erp-table thead th[data-sort].sorted-asc::after {
    content: "▲";
    opacity: 1;
}

.erp-table thead th[data-sort].sorted-desc::after {
    content: "▼";
    opacity: 1;
}

.erp-table tbody tr {
    border-bottom: 1px solid #f0f2f5;
    transition: background-color 0.15s ease;
}

.erp-table tbody tr:hover {
    background-color: #F5F7FA;
}

.erp-table tbody tr:last-child {
    border-bottom: none;
}

.erp-table tbody td {
    padding: 10px 12px;
    color: #0D181C;
    font-size: 13px;
}

.erp-table tbody td strong {
    color: #1F354B;
    font-weight: 600;
}

/* No results */
.erp-no-results {
    text-align: center;
    padding: 40px 20px !important;
    color: #666;
    font-style: italic;
}

/* Badges de estado */
.erp-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
}

.erp-badge-activo,
.erp-badge-vigente {
    background-color: #dcfce7;
    color: #16a34a;
}

.erp-badge-inactivo,
.erp-badge-vencida {
    background-color: #fee2e2;
    color: #dc2626;
}

.erp-badge-suspendido,
.erp-badge-cancelada {
    background-color: #e5e7eb;
    color: #6b7280;
}

.erp-badge-pendiente {
    background-color: #fef3c7;
    color: #d97706;
}

.erp-badge-en-proceso {
    background-color: #dbeafe;
    color: #3F526D;
}

.erp-badge-completado,
.erp-badge-renovada {
    background-color: #dcfce7;
    color: #16a34a;
}

.erp-badge-cancelado {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Acciones en tabla */
.erp-actions {
    white-space: nowrap;
}

.erp-btn-icon {
    display: inline-block;
    padding: 6px 10px;
    margin: 0 3px;
    background-color: #f3f4f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 16px;
}

.erp-btn-icon:hover {
    background-color: #3F526D;
    border-color: #3F526D;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(63, 82, 109, 0.3);
}

.erp-btn-delete-agente {
    background-color: #FEE2E2;
    border-color: #FECACA;
    color: #991B1B;
}
.erp-btn-delete-agente:hover {
    background-color: #DC2626 !important;
    border-color: #DC2626 !important;
    color: #FFFFFF;
    box-shadow: 0 2px 5px rgba(220, 38, 38, 0.4);
}

/* Paginación */
.erp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
}

.erp-pagination-btn {
    padding: 8px 15px;
    border: 1px solid #d1d5db;
    background-color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #1e293b;
}

.erp-pagination-btn:hover:not(:disabled) {
    background-color: #3F526D;
    color: #fff;
    border-color: #3F526D;
}

.erp-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.erp-pagination-btn.active {
    background-color: #1F354B;
    color: #fff;
    border-color: #1F354B;
}

.erp-pagination-info {
    color: #666;
    font-size: 14px;
}

/* Loading */
.erp-loading {
    text-align: center;
    padding: 40px;
}

.erp-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #1F354B;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.erp-loading p {
    color: #666;
    font-size: 14px;
}

/* Botones generales */
.erp-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.erp-btn-primary {
    background-color: #3F526D;
    color: #ffffff;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.erp-btn-primary:hover {
    background-color: #1F354B;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(31, 53, 75, 0.25);
}

.erp-btn-secondary {
    background-color: #3F526D;
    color: #ffffff;
    border: 1px solid #3F526D;
    border-radius: 8px;
}

.erp-btn-secondary:hover {
    background-color: #1F354B;
    border-color: #1F354B;
    color: #ffffff !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .erp-listing-container {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .erp-listing-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .erp-listing-title-group {
        width: 100%;
    }
    
    .erp-listing-subtitle {
        font-size: 13px;
    }
    
    .erp-listing-actions {
        width: 100%;
    }
    
    .erp-listing-actions .erp-btn {
        width: 100%;
        text-align: center;
    }
    
    .erp-filter-row {
        flex-direction: column;
    }
    
    .erp-filter-field {
        width: 100%;
        min-width: 100%;
    }
    
    .erp-table-wrapper {
        overflow-x: scroll;
    }
    
    .erp-table {
        min-width: 800px;
    }
    
    .erp-table thead th,
    .erp-table tbody td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .erp-pagination {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .erp-pagination-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .erp-listing-header h2 {
        font-size: 22px;
    }
    
    .erp-table {
        font-size: 12px;
    }
    
    .erp-table thead th {
        font-size: 11px;
        padding: 8px 6px;
    }
    
    .erp-table tbody td {
        padding: 8px 6px;
    }
    
    .erp-btn-icon {
        font-size: 14px;
        padding: 5px 8px;
    }
    
    .erp-badge {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* Scrollbar personalizado para tablas */
.erp-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.erp-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.erp-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.erp-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.erp-table tbody tr {
    animation: fadeIn 0.3s ease;
}

/* Estados de carga en filas */
.erp-table tbody tr.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Highlight de búsqueda */
.erp-highlight {
    background-color: #ffeb3b;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Tooltips */
.erp-tooltip {
    position: relative;
}

.erp-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background-color: #1e293b;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.erp-tooltip:hover::after {
    opacity: 1;
}

/* Mensaje de error */
.erp-error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
}

/* ========================================
   SEMANA 3 - FILTROS AVANZADOS
   ======================================== */

/* Contador de resultados */
.erp-results-counter {
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #3F526D;
}

/* Botón outline para exportar */
.erp-btn-outline {
    background: transparent;
    color: #3F526D;
    border: 2px solid #3F526D;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.erp-btn-outline:hover {
    background: #3F526D;
    color: #fff;
}

/* Filtros con labels */
.erp-filter-field label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #23282d;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Paginación mejorada */
.erp-pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
    gap: 10px;
}
.erp-pagination-dots {
    padding: 0 8px;
    color: #A7A3A3;
}

/* Badges nuevos */
.erp-badge-pagado { background: #dcfce7; color: #16a34a; }
.erp-badge-en-gracia, .erp-badge-en_gracia, .erp-badge-mes_en_curso { background: #fef3c7; color: #d97706; }
.erp-badge-vencido { background: #fee2e2; color: #dc2626; }
.erp-badge-lapse { background: #fee2e2; color: #dc2626; }
.erp-badge-cancelled { background: #e5e7eb; color: #6b7280; }
.erp-badge-cash_surrender { background: #dbeafe; color: #3F526D; }
.erp-badge-revisar { background: #fee2e2; color: #dc2626; font-weight: 700; }
.erp-badge-no-revisar { background: #f1f5f9; color: #94a3b8; }
.erp-badge-nueva { background: #dbeafe; color: #3F526D; font-weight: 700; }
.erp-badge-leida { background: #e5e7eb; color: #6b7280; }
.erp-badge-negociacion { background: #fef3c7; color: #d97706; }
.erp-badge-acepta { background: #dcfce7; color: #16a34a; }
.erp-badge-rechaza { background: #fee2e2; color: #dc2626; }

/* Prioridades */
.erp-badge-prioridad-alta { background: #fee2e2; color: #dc2626; font-weight: 700; }
.erp-badge-prioridad-media { background: #fef3c7; color: #d97706; }
.erp-badge-prioridad-baja { background: #dcfce7; color: #16a34a; }

/* Fila no leída */
.erp-row-unread { background-color: #f1f5f9 !important; }
.erp-row-unread:hover { background-color: #e2e8f0 !important; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
/* VISTA DE DETALLE DE PÓLIZA - S3 Final */
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.erp-poliza-detail { max-width:1100px; margin:0 auto; }
.erp-detail-header { display:flex; justify-content:space-between; align-items:center;
    padding:20px; background:#f8fafc; border-radius:12px; margin-bottom:20px; flex-wrap:wrap; gap:10px; }
.erp-detail-title h2 { margin:0 10px 0 0; display:inline; }
.erp-badge-lg { font-size:14px; padding:6px 14px; }
.erp-detail-actions { display:flex; gap:8px; flex-wrap:wrap; }

/* Tabs */
.erp-detail-tabs { display:flex; border-bottom:2px solid #e5e7eb; margin-bottom:20px; flex-wrap:wrap; }
.erp-tab { padding:10px 18px; border:none; background:none; cursor:pointer;
    font-size:14px; color:#64748b; border-bottom:3px solid transparent; transition:all .2s; }
.erp-tab:hover { color:#1F354B; }
.erp-tab.active { color:#1F354B; border-bottom-color:#1F354B; font-weight:600; }
.erp-tab-content { display:none; }
.erp-tab-content.active { display:block; }

/* Grid de datos */
.erp-detail-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:16px; }
.erp-detail-item { padding:12px 16px; background:#fff; border:1px solid #e5e7eb; border-radius:8px; }
.erp-label { display:block; font-size:12px; color:#64748b; text-transform:uppercase;
    letter-spacing:.5px; margin-bottom:4px; }
.erp-value { font-size:15px; color:#1e293b; }
.erp-value-highlight { font-size:18px; font-weight:700; color:#1F354B; }

/* Documentos */
.erp-docs-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:16px; }
.erp-doc-card { text-align:center; padding:20px; border:1px dashed #d1d5db; border-radius:8px; }
.erp-doc-icon { font-size:32px; display:block; margin-bottom:8px; }
.erp-doc-label { display:block; font-size:13px; color:#A7A3A3; margin-bottom:10px; }
.erp-doc-missing { color:#dc2626; font-size:12px; }
.erp-btn-sm { padding:4px 12px; font-size:12px; }

/* Timeline */
.erp-timeline { position:relative; padding-left:30px; }
.erp-timeline::before { content:""; position:absolute; left:10px; top:0; bottom:0;
    width:2px; background:#e5e7eb; }
.erp-timeline-item { position:relative; margin-bottom:20px; padding:12px 16px;
    background:#fff; border:1px solid #e5e7eb; border-radius:8px; }
.erp-timeline-item::before { content:""; position:absolute; left:-25px; top:16px;
    width:10px; height:10px; background:#1F354B; border-radius:50%; }
.erp-timeline-date { font-size:12px; color:#64748b; margin-bottom:4px; }

/* Modal */
.erp-modal { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.5);
    z-index:9999; display:flex; align-items:center; justify-content:center; }
.erp-modal-content { background:#fff; padding:30px; border-radius:12px;
    max-width:500px; width:90%; }
.erp-modal-content textarea { width:100%; margin:10px 0; padding:10px;
    border:1px solid #d1d5db; border-radius:6px; }
.erp-modal-actions { display:flex; gap:10px; justify-content:flex-end; }

/* Badges estados póliza */
.erp-badge-borrador { background:#94a3b8; color:#fff; }
.erp-badge-en_revision { background:#fef3c7; color:#d97706; }
.erp-badge-aprobada { background:#dbeafe; color:#3F526D; }
.erp-badge-enviada_metlife { background:#f3e8ff; color:#7c3aed; }
.erp-badge-emitida { background:#dcfce7; color:#16a34a; }
.erp-badge-rechazada { background:#fee2e2; color:#dc2626; }
.erp-badge-cancelada { background:#e5e7eb; color:#6b7280; }

/* Botones extra */
.erp-btn-warning { background:#ffc107; color:#333; border:none; padding:8px 16px;
    border-radius:4px; cursor:pointer; }
.erp-notice { padding:20px; background:#fef3c7; border:1px solid #fde68a;
    border-radius:8px; text-align:center; }
.erp-msg-success { padding:12px; background:#dcfce7; color:#166534; border-radius:6px; }
.erp-msg-error { padding:12px; background:#fee2e2; color:#991b1b; border-radius:6px; }
.erp-total-row { background:#f0f0f0; }
.erp-empty { color:#6c757d; font-style:italic; padding:20px; text-align:center; }

/* =====================================================
   BOTONES DE ACCIÓN - GESTIÓN DE ESTADOS (Semana 3)
   ===================================================== */
.erp-btn-sm {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 2px;
    white-space: nowrap;
}
.erp-btn-sm:hover { opacity: 0.85; transform: translateY(-1px); }
.erp-btn-sm.loading { opacity: 0.5; pointer-events: none; }

.erp-btn-success { background: #DCFCE7; color: #166534; }
.erp-btn-warning { background: #FEF3C7; color: #92400E; }
.erp-btn-danger  { background: #FEE2E2; color: #991B1B; }
.erp-btn-dark    { background: #1E293B; color: #E2E8F0; }
.erp-btn-secondary { background: #64748B; color: #F1F5F9; }

/* Badge de estado en recibos */
.erp-badge-pendiente  { background: #fef3c7; color: #d97706; }
.erp-badge-en_gracia  { background: #fef3c7; color: #d97706; }
.erp-badge-vencido    { background: #fee2e2; color: #dc2626; }
.erp-badge-pagado     { background: #dcfce7; color: #16a34a; }
.erp-badge-cancelado  { background: #e5e7eb; color: #6b7280; }
.erp-badge-mes_en_curso { background: #fef3c7; color: #d97706; }
.erp-badge-lapse        { background: #fee2e2; color: #dc2626; }
.erp-badge-cancelled    { background: #e5e7eb; color: #6b7280; }
.erp-badge-cash_surrender { background: #dbeafe; color: #3F526D; }
.erp-badge-revisar      { background: #fee2e2; color: #dc2626; font-weight: 700; }
.erp-badge-no-revisar   { background: #f1f5f9; color: #94a3b8; }

/* Badges para nuevos estatus de servicio */
.erp-badge-ingreso {
    background-color: #dbeafe;
    color: #3F526D;
}
.erp-badge-en-revision {
    background-color: #fef3c7;
    color: #d97706;
}
.erp-badge-en-proceso {
    background-color: #dcfce7;
    color: #16a34a;
}
.erp-badge-tramite-suspendido {
    background-color: #fee2e2;
    color: #dc2626;
}
.erp-badge-reingreso {
    background-color: #f3e8ff;
    color: #7c3aed;
}
.erp-badge-cancelado {
    background-color: #fee2e2;
    color: #dc2626;
}
.erp-badge-gerente-list {
    background: linear-gradient(135deg, #065f46, #047857);
    color: #ecfdf5;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    vertical-align: middle;
    margin-left: 6px;
}

.erp-badge-pendiente {
    background-color: #fef3c7;
    color: #d97706;
}
.erp-badge-completado,
.erp-badge-entregada {
    background-color: #dcfce7;
    color: #16a34a;
}
.erp-badge-dia-cargo {
    background-color: #dbeafe;
    color: #3F526D;
    font-weight: 700;
    min-width: 28px;
    display: inline-block;
    text-align: center;
}
.erp-badge-na {
    background-color: #f1f5f9;
    color: #94a3b8;
}

/* ========================================
   SEMANA 7 - NAVEGACION LISTADOS (OBSOLETO P4)
   ======================================== */
.erp-listing-nav {
    display: none; /* P4: eliminado — se usa sidebar */
}
.erp-btn-nav {
    display: none;
}

/* ========================================
   SEMANA 7 - VISTA DETALLE GENERICA
   ======================================== */
.erp-detalle-container {
    max-width: 1200px; margin: 30px auto; padding: 0 20px;
}
.erp-detalle-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px; background: #f8fafc; border-radius: 12px;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.erp-detalle-title h2 {
    margin: 0 12px 0 0; display: inline; font-size: 24px; color: #1e293b;
}
.erp-detalle-meta-info {
    display: flex; gap: 16px; font-size: 12px; color: #64748b;
}
.erp-detalle-section {
    margin-top: 24px; padding-top: 20px; border-top: 1px solid #e5e7eb;
}
.erp-detalle-section h3 {
    font-size: 18px; color: #1e293b; margin: 0 0 16px;
}
@media (max-width: 768px) {
    .erp-detalle-header { flex-direction: column; }
    .erp-detalle-meta-info { flex-direction: column; gap: 4px; }
}

/* === Pestañas de producto en listado de recibos === */
.erp-listing-product-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 0 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.erp-lst-tab {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Work Sans', sans-serif;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #3F526D;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.erp-lst-tab:hover {
    background: #f0f2f5;
    border-color: #3F526D;
}
.erp-lst-tab.erp-lst-tab-active {
    background: #1F354B;
    color: #fff;
    border-color: #1F354B;
}

/* === Sticky thead en todos los listados === */
.erp-listing-container .erp-table-wrapper {
    max-height: 75vh;
    overflow-y: auto;
}
.erp-listing-container .erp-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* === Edición inline en Cobranza === */
.erp-inline-edit {
    cursor: pointer;
    position: relative;
}
.erp-inline-edit:hover {
    background-color: #E8F0FE !important;
}
.erp-inline-input {
    width: 100%;
    min-width: 120px;
    padding: 3px 5px;
    border: 2px solid #3F526D;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Work Sans', sans-serif;
}
select.erp-inline-input {
    min-width: 140px;
}
.erp-inline-saving {
    color: #3F526D;
    font-style: italic;
    font-size: 11px;
}

/* === Roles sin edición inline: quitar cursor pointer === */
body.erp-role-agente .erp-inline-date,
body.erp-role-agente .erp-inline-select,
body.erp-role-gerente .erp-inline-date,
body.erp-role-gerente .erp-inline-select {
    cursor: default !important;
    pointer-events: none;
}

/* P3/N5: Badges categoría de agente */
.erp-badge-agente-prospecto {
    background: #FEF3C7 !important;
    color: #92400E !important;
    border: 1px solid #F59E0B;
}
.erp-badge-agente-nuevo {
    background: #DBEAFE !important;
    color: #1E40AF !important;
    border: 1px solid #3B82F6;
}
.erp-badge-agente-en-crecimiento {
    background: #D1FAE5 !important;
    color: #065F46 !important;
    border: 1px solid #10B981;
}
.erp-badge-agente-consolidado {
    background: #EDE9FE !important;
    color: #5B21B6 !important;
    border: 1px solid #8B5CF6;
}