.audit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.audit-filters input,
.audit-filters select {
    height: 42px;
    padding: 0 0.75rem;
    border: 1px solid #d6e4e8;
    border-radius: 10px;
    font: inherit;
    min-width: 140px;
}

.audit-filters .ms-datepicker {
    flex: 0 0 160px;
    min-width: 160px;
}

.audit-table-wrap {
    overflow-x: auto;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.audit-table th,
.audit-table td {
    padding: 0.7rem 0.65rem;
    border-bottom: 1px solid #e8eef0;
    text-align: left;
    vertical-align: top;
}

.audit-table th {
    color: #5b7380;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.audit-badge {
    display: inline-flex;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.audit-badge.create { background: #e7f8f0; color: #0f8f79; }
.audit-badge.update { background: #e8f2fb; color: #1d4ed8; }
.audit-badge.delete { background: #fde8e8; color: #b42318; }

.audit-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.audit-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
}

.audit-modal[hidden] { display: none; }

.audit-modal-card {
    width: min(960px, 100%);
    max-height: 88vh;
    overflow: auto;
    background: #fff;
    border-radius: 16px;
}

.audit-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #e8eef0;
}

.audit-modal-head h3 { margin: 0; }

.audit-modal-head button {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
}

.audit-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.2rem 0;
}

.audit-meta strong {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
}

.audit-diff {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem 1.2rem 1.3rem;
}

.audit-diff section {
    border: 1px solid #e8eef0;
    border-radius: 12px;
    background: #f8fafc;
    min-width: 0;
}

.audit-diff h4 {
    margin: 0;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid #e8eef0;
    font-size: 0.85rem;
}

.audit-diff pre {
    margin: 0;
    padding: 0.9rem;
    max-height: 420px;
    overflow: auto;
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 800px) {
    .audit-diff { grid-template-columns: 1fr; }
}
