/* public/css/errors.css */
/* public/css/errors.css */
/* ============================================
   IMPORTAR ESTILOS BASE DE RULES
   ============================================ */
@import url('rules.css');

/* ============================================
   ESTILOS ESPECÍFICOS PARA ERRORES
   ============================================ */

/* Estadísticas rápidas*/
/* Ajustar grid para 3 columnas */
.error-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.error-stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.bg-warning-subtle { background: #fff3cd; }
.stat-icon.bg-success-subtle { background: #d4edda; }
.stat-icon.bg-danger-subtle { background: #f8d7da; }
.stat-icon.bg-info-subtle { background: #d1ecf1; }

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Severidad de error (nuevo) */
.error-severity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.error-severity.severity-critical {
    background: #f8d7da;
    color: #721c24;
}

/* Asegurar que severity-error sea rojo siempre */
.error-severity.severity-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.error-severity.severity-warning {
    background: #fff3cd;
    color: #856404;
}

.error-severity.severity-info {
    background: #d1ecf1;
    color: #0c5460;
}

.error-severity.severity-resolved {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Document type badge */
.document-type {
    display: inline-block;
    padding: 4px 8px;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-right: 8px;
}

.document-number {
    font-weight: 600;
    color: var(--gray-900);
}

/* Mensaje de error con expand */
.error-message-cell {
    max-width: 300px;
}

.error-message {
    color: var(--gray-700);
    line-height: 1.4;
}

.expand-error {
    color: var(--primary-600);
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 4px;
}

.expand-error:hover {
    text-decoration: underline;
}

/* Archivo original */
.original-file {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Ajustes responsive para errores */
@media (max-width: 768px) {
    .error-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .errors-table th:nth-child(4),
    .errors-table td:nth-child(4) {
        display: none; /* Oculta columna de archivo en móvil */
    }
}

/* Estadísticas rápidas */
.error-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.error-stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.bg-warning-subtle { background: #fff3cd; }
.stat-icon.bg-success-subtle { background: #d4edda; }
.stat-icon.bg-danger-subtle { background: #f8d7da; }
.stat-icon.bg-info-subtle { background: #d1ecf1; }

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Tabla de errores */
.errors-table-container {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.errors-table {
    width: 100%;
    border-collapse: collapse;
}

.errors-table th {
    text-align: left;
    padding: 16px 16px;
    background: var(--gray-50);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-200);
}

.errors-table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
    vertical-align: middle;
}

.errors-table tbody tr:hover td {
    background: var(--gray-50);
}

/* En errors.css */
.error-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.error-row:hover {
    background-color: #f5f5f5 !important;
}

.error-row .btn-action {
    cursor: pointer;
    pointer-events: auto;
}

/* Asegurar que los botones dentro de la fila no hereden el cursor pointer de la fila */
.error-row button {
    cursor: pointer;
}

/* Severidad de error */
.error-severity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.error-severity.severity-critical {
    background: #f8d7da;
    color: #721c24;
}

.error-severity.severity-warning {
    background: #fff3cd;
    color: #856404;
}

.error-severity.severity-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Severidad para "resuelto con errores" */
.error-severity.severity-resolved-with-errors {
    background: #fff3cd;
    color: #856404;
}


/* Documento */
.document-type {
    display: inline-block;
    padding: 4px 8px;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-right: 8px;
}

.document-number {
    font-weight: 600;
    color: var(--gray-900);
}

/* Mensaje de error */
.error-message-cell {
    max-width: 300px;
}

.error-message {
    color: var(--gray-700);
    line-height: 1.4;
}

.expand-error {
    color: var(--primary-600);
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 4px;
}

.expand-error:hover {
    text-decoration: underline;
}

/* Archivo original */
.original-file {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Fecha */
.error-date {
    color: var(--gray-600);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Acciones */
.actions-column {
    white-space: nowrap;
}

.btn-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: var(--gray-100);
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin: 0 4px;
}

.btn-action:hover {
    background: var(--primary-600);
    color: white;
}

/* Botón de editar (lápiz) */
.btn-action.btn-edit {
    background: var(--gray-100);
    color: #4b5563;
}

.btn-action.btn-edit:hover {
    background: #f59e0b;
    color: white;
}

/* Paginación */
.errors-pagination {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.pagination-info {
    color: var(--gray-600);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .error-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .error-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .errors-table td:nth-child(3),
    .errors-table th:nth-child(3) {
        display: none;
    }
}

/* ============================================
   FILTROS (desde rules.css adaptados)
   ============================================ */
.errors-filters {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.filter-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.filter-group {
    position: relative;
    flex: 1;
}

.filter-group .search-icon,
.filter-group .filter-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 14px;
    pointer-events: none;
}

.filter-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-fast);
    background: var(--gray-50);
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-500);
    background: white;
    box-shadow: 0 0 0 3px var(--primary-100);
}

.filter-input[type="date"] {
    padding: 12px 16px 12px 42px;
    font-family: inherit;
}

.filter-clear-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.filter-clear-btn:hover {
    background: var(--gray-200);
    color: var(--gray-900);
    border-color: var(--gray-400);
}

/* Badge para tipo de error */
.error-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.error-type-badge[data-type="VALIDATION_ERROR"] {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.error-type-badge[data-type="EXPORT_ERROR"] {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Badge para "resuelto con errores" */
.badge.bg-warning {
    background: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffeeba;
    font-weight: 500;
    padding: 6px 10px;
}

/* Estilos para badges en modal */
.error-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    background: var(--gray-100);
    color: var(--gray-700);
}

.error-type-badge[data-type="VALIDATION_ERROR"] {
    background: #fee2e2;
    color: #991b1b;
}

.error-type-badge[data-type="EXPORT_ERROR"] {
    background: #fee2e2;
    color: #991b1b;
}

.error-type-badge[data-type="PROCESSING_ERROR"] {
    background: #fef3c7;
    color: #92400e;
}

/* Ajustes para el modal */
.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.list-group-item {
    font-size: 14px;
    line-height: 1.5;
}