/* --- audit-viewer-styles.css (Versión 2.2 - Diseño Forense y Administrativo) --- */

/* --- Contenedor Principal y Fuentes --- */
.becor-audit-viewer-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 12px;
    margin: 2em auto;
    padding: 20px;
    background-color: #fdfdfd;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

/* --- Sección de Filtros (Rediseñada) --- */
.audit-filters-form {
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}
.filter-title {
    margin: 0 0 20px 0;
    font-size: 1.4em;
    font-weight: 600;
    color: #34495e;
}
.filter-fieldset {
    border: 1px solid #dce4e6;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}
.filter-fieldset legend {
    font-weight: 600;
    color: #34495e;
    padding: 0 10px;
    font-size: 1.1em;
}
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    align-items: end;
}
.filter-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #555;
    font-size: 1em;
    display: block;
}
.filter-group input[type="text"],
.filter-group input[type="date"],
.filter-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 1em;
}
.filter-group input:focus, .filter-group select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    outline: none;
}
.date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}
.filter-actions .button {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.filter-actions .button:active { transform: translateY(1px); }
.filter-actions .button-primary { background-color: #3498db; color: white; }
.filter-actions .button-primary:hover { background-color: #2980b9; }
.filter-actions .button-secondary { background-color: #ecf0f1; color: #34495e; }
.filter-actions .button-secondary:hover { background-color: #dce4e6; }

/* --- Lista de Registros de Auditoría (Mejorada) --- */
.audit-log-list {
    margin: 0;
    padding: 0;
    list-style-type: none;
}
.audit-log-entry {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    transition: box-shadow 0.2s ease-in-out;
}
.audit-log-entry:hover { box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); }

.log-main-info { flex: 3; min-width: 300px; }
.log-description {
    font-size: 1.1em;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.5;
}
.log-description p { margin: 0; }
.denial-reason {
    margin-top: 8px !important;
    font-size: 0.9em;
    color: #c0392b;
    background-color: #fcf2f2;
    padding: 5px 8px;
    border-radius: 4px;
    border-left: 3px solid #c0392b;
}
.denial-reason strong { color: #a53125; }

.log-meta {
    font-size: 1em;
    color: #7f8c8d;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 15px; /* row-gap, column-gap */
}
.log-meta strong { color: #5d6d7e; }

.log-side-info {
    flex: 1;
    min-width: 240px;
    background-color: #f8f9f9;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.log-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.status-label, .event-type-label {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}
/* Colores de etiquetas */
.status-success { background-color: #27ae60; }
.status-failure { background-color: #c0392b; }
.status-warning { background-color: #f39c12; }
.status-denied  { background-color: #7f8c8d; } /* Nuevo */
.status-info    { background-color: #3498db; }
.event-type-label { background-color: #8e44ad; }

.log-technical-details {
    font-size: 0.95em;
    color: #5d6d7e;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.log-technical-details .detail-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.log-technical-details strong {
    white-space: nowrap;
}
.log-technical-details code {
    background-color: #ecf0f1;
    padding: 3px 6px;
    border-radius: 4px;
    color: #34495e;
    word-break: break-all;
    font-size: 1em;
    cursor: help;
}

.no-results-found {
    text-align: center;
    padding: 30px;
    background-color: #fff;
    border: 1px dashed #ccc;
    border-radius: 8px;
    color: #777;
}

/* --- Paginación --- */
.tablenav.bottom { margin-top: 20px; border-top: 2px solid #f0f0f0; padding-top: 15px; }
.pagination-links ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 5px; }
.pagination-links .page-numbers { padding: 6px 12px; border: 1px solid #ccc; text-decoration: none; border-radius: 6px; transition: all 0.2s ease; }
.pagination-links .page-numbers:hover { background-color: #f0f0f0; border-color: #aaa; }
.pagination-links .page-numbers.current { background-color: #34495e; color: #fff; border-color: #34495e; }

/* --- ESTILOS PARA IMPRESIÓN --- */
@media print {
    body, .becor-audit-viewer-container { background: #fff !important; color: #000 !important; box-shadow: none !important; border: none !important; margin: 0 !important; padding: 0 !important; width: 100%; font-size: 9pt; }
    .audit-filters-form, .tablenav.bottom { display: none !important; }
    .audit-log-entry { border: 1px solid #ccc; padding: 10px; margin-bottom: 10px; page-break-inside: avoid; display: block; }
    .log-main-info, .log-side-info { flex: none; width: 100%; padding: 0; background: none; }
    .log-description { font-size: 1em; margin-bottom: 8px; }
    .log-meta { font-size: 0.85em; margin-bottom: 8px; }
    .log-tags { margin-bottom: 8px; }
    .status-label, .event-type-label { border: 1px solid #000; color: #000 !important; background-color: #fff !important; -webkit-print-color-adjust: economy; color-adjust: economy; padding: 2px 6px; }
    .log-technical-details code { background-color: #f0f0f0 !important; -webkit-print-color-adjust: exact; color-adjust: exact; border: 1px solid #ccc; padding: 4px; }
}