/**
 * aud.css - Estilos del modulo de auditoria
 * @version 1.0.0
 * @author Equipo ERP
 * @date 2026-07-02
 */

:root {
    --aud-primary: #0f4c81;
    --aud-primary-soft: #e8f1f8;
    --aud-danger: #b42318;
    --aud-warning: #c7791a;
    --aud-success: #127c56;
    --aud-info: #0c7ea8;
    --aud-ink: #1f2d3d;
    --aud-muted: #66758a;
    --aud-line: #d6e0ea;
    --aud-panel: #f7fafc;
}

.aud-filter-card,
.aud-chart-card,
.aud-component-card,
.aud-table-card {
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.aud-filter-card .card-header,
.aud-chart-card .card-header,
.aud-component-card .card-header,
.aud-table-card .card-header {
    background: linear-gradient(135deg, #ffffff 0%, #f3f8fc 100%);
    border-bottom: 1px solid var(--aud-line);
}

.aud-help {
    background: linear-gradient(135deg, #f8fbfe 0%, #eef5fb 100%);
}

.aud-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.aud-scope-ribbon {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--aud-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.aud-scope-ribbon span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f5f9fc;
    border: 1px solid var(--aud-line);
}

.aud-kpi-grid {
    margin-bottom: 8px;
}

.aud-kpi-card {
    border: 1px solid var(--aud-line);
    border-left: 5px solid var(--aud-primary);
    border-radius: 12px;
    overflow: hidden;
}

.aud-kpi-card .card-body {
    padding: 14px 16px;
}

.aud-kpi-label {
    display: block;
    color: var(--aud-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.aud-kpi-value {
    display: block;
    margin-top: 8px;
    color: var(--aud-ink);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}

.aud-kpi-card.tone-total {
    border-left-color: var(--aud-primary);
}

.aud-kpi-card.tone-users {
    border-left-color: var(--aud-info);
}

.aud-kpi-card.tone-components {
    border-left-color: #635bff;
}

.aud-kpi-card.tone-audit {
    border-left-color: var(--aud-success);
}

.aud-kpi-card.tone-error {
    border-left-color: var(--aud-danger);
}

.aud-kpi-card.tone-warn {
    border-left-color: var(--aud-warning);
}

.aud-chart-surface {
    height: 320px;
    width: 100%;
}

.aud-component-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 320px;
}

.aud-component-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--aud-line);
    border-left: 4px solid var(--aud-primary);
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbfd 100%);
}

.aud-component-row strong {
    color: var(--aud-ink);
    font-size: 0.92rem;
}

.aud-component-row span {
    color: var(--aud-muted);
    font-size: 0.83rem;
}

.aud-component-total {
    min-width: 52px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--aud-primary-soft);
    color: var(--aud-primary);
    font-weight: 800;
}

.aud-component-empty {
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--aud-muted);
    border: 1px dashed var(--aud-line);
    border-radius: 14px;
    background: #fbfdff;
}

#tblAud thead th {
    background: #f4f8fb;
    border-top: 0;
    color: #233445;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

#tblAud tbody td {
    vertical-align: middle;
}

.aud-date-cell strong,
.aud-user-cell strong,
.aud-origin-cell strong,
.aud-message-cell strong {
    color: var(--aud-ink);
}

.aud-date-cell .small,
.aud-user-cell .small,
.aud-origin-cell .small,
.aud-message-cell .small {
    color: var(--aud-muted);
}

.aud-context-chip {
    display: inline-block;
    max-width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f7fafc;
    border: 1px solid var(--aud-line);
    color: #2c3d4f;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: normal;
}

.aud-modal-shell {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.aud-modal-shell .modal-header {
    background: linear-gradient(135deg, var(--aud-primary), var(--aud-info));
    color: #fff;
    border-bottom: 0;
}

.aud-modal-shell .modal-footer {
    background: #f8fafc;
    border-top: 1px solid var(--aud-line);
}

.aud-detail-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.aud-context-pre {
    margin: 0;
    padding: 14px;
    min-height: 260px;
    max-height: 420px;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid var(--aud-line);
    background: #0f1720;
    color: #d5e4f3;
    font-size: 0.84rem;
    line-height: 1.5;
}

@media (max-width: 767.98px) {
    .aud-kpi-value {
        font-size: 1.45rem;
    }

    .aud-chart-surface,
    .aud-component-board,
    .aud-component-empty {
        min-height: 240px;
        height: 240px;
    }
}
