.audit-log-modal .modal-dialog { width: min(1320px, calc(100vw - 24px)); max-width: 1320px; }
.audit-log-modal .modal-content { max-height: min(90vh, 820px); overflow: hidden; background: #050709; border: 1px solid #222933; border-radius: 10px; box-shadow: 0 28px 80px rgba(0,0,0,.64); }
.audit-log-modal .modal-header { align-items: flex-start; padding: 20px 22px 18px; background: #050709; border-color: #222933; }
.audit-log-modal .modal-header .panel-label { display: block; margin-bottom: 7px; color: #9ca5af; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.audit-log-modal .modal-header h2 { color: #f4f4f5; font-size: 20px; font-weight: 700; }
.audit-log-modal .modal-header p { margin: 8px 0 0; color: #c5cbd2; font-size: 12px; }
.audit-log-modal .modal-body { display: flex; min-height: 0; flex-direction: column; gap: 16px; padding: 16px 22px 20px; overflow: hidden; background: #050709; }
.audit-log-toolbar { display: grid; grid-template-columns: minmax(118px, .65fr) minmax(220px, 1.6fr) minmax(150px, .85fr) minmax(160px, .9fr) 38px; align-items: end; gap: 10px; }
.audit-log-source { min-width: 0; display: grid; gap: 5px; padding: 0 2px 5px; }
.audit-log-source > span { color: #8e98a3; font-size: 9px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.audit-log-source strong { display: inline-flex; min-width: 0; align-items: center; gap: 7px; color: #e4eaf0; font-size: 12px; font-weight: 650; }
.audit-log-source strong i { color: var(--dashboard-orange, #ff9800); font-size: 14px; }
.audit-log-search { position: relative; min-width: 0; }
.audit-log-search > i { position: absolute; z-index: 1; top: 50%; left: 12px; color: #9ca5af; font-size: 13px; transform: translateY(-50%); pointer-events: none; }
.audit-log-modal .audit-log-search .form-control,
.audit-log-modal .audit-log-filter .form-select { min-width: 0; min-height: 40px; color: #e4eaf0; background-color: #080c10; border-color: #29323b; font-size: 11px; }
.audit-log-modal .audit-log-search .form-control { padding-left: 36px; }
.audit-log-modal .audit-log-search .form-control::placeholder { color: #87919c; opacity: 1; }
.audit-log-modal .audit-log-search .form-control:focus,
.audit-log-modal .audit-log-filter .form-select:focus { border-color: rgba(255,151,0,.72); box-shadow: 0 0 0 3px rgba(255,151,0,.09); }
.audit-log-modal .audit-log-filter { min-width: 0; }
.audit-log-modal .audit-log-filter .form-select { padding-inline: 11px 32px; }
.audit-log-reset { width: 38px; height: 40px; display: inline-grid; place-items: center; color: #ffab2e; background: rgba(255,151,0,.04); border: 1px solid rgba(255,151,0,.5); border-radius: 7px; font-size: 15px; transition: background-color .15s ease, border-color .15s ease; }
.audit-log-reset:hover, .audit-log-reset:focus-visible { background: rgba(255,151,0,.12); border-color: #ff9800; outline: 0; }
.audit-log-table-wrap { min-height: 0; flex: 1 1 auto; overflow: auto; border-top: 1px solid rgba(255,255,255,.09); border-bottom: 1px solid rgba(255,255,255,.09); overscroll-behavior: contain; }
.audit-log-table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; color: #dbe3e9; font-size: 11px; }
.audit-log-table th { position: sticky; z-index: 1; top: 0; padding: 12px 10px; color: #8e98a3; background: #050709; font-size: 9px; font-weight: 650; letter-spacing: .045em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.audit-log-table th:nth-child(1) { width: 17%; }
.audit-log-table th:nth-child(2) { width: 13%; }
.audit-log-table th:nth-child(3) { width: 16%; }
.audit-log-table th:nth-child(4) { width: 26%; }
.audit-log-table th:nth-child(5) { width: 23%; }
.audit-log-table th:nth-child(6) { width: 5%; }
.audit-log-table td { height: 58px; padding: 9px 10px; border-top: 1px solid rgba(255,255,255,.075); vertical-align: middle; }
.audit-log-table tbody tr:first-child td { border-top: 0; }
.audit-log-date { color: #e0e7ec; font-weight: 650; white-space: nowrap; }
.audit-log-user { min-width: 0; display: grid; gap: 3px; color: #e2e8ed; font-weight: 650; overflow-wrap: anywhere; }
.audit-log-user-name { color: #e2e8ed; font-size: 11px; font-weight: 650; }
.audit-log-user-id { color: #84919b; font-size: 9px; font-weight: 500; }
.audit-log-action { color: #f0f4f6; font-weight: 650; text-transform: capitalize; }
.audit-log-target { overflow: hidden; color: #a4b0ba; text-overflow: ellipsis; white-space: nowrap; }
.audit-log-type { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid; border-radius: 5px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.audit-log-type::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ''; }
.audit-log-type.is-success { color: #20d98b; background: rgba(32,217,139,.07); border-color: rgba(32,217,139,.3); }
.audit-log-type.is-modification { color: #ffb02e; background: rgba(255,151,0,.07); border-color: rgba(255,151,0,.35); }
.audit-log-type.is-failure { color: #ff6674; background: rgba(255,93,108,.07); border-color: rgba(255,93,108,.35); }
.audit-log-detail-control { text-align: right; }
.audit-log-expand { width: 34px; height: 34px; display: inline-grid; place-items: center; color: #c5cfd7; background: #080b0f; border: 1px solid #2a3540; border-radius: 7px; transition: color .15s ease, border-color .15s ease, transform .15s ease; }
.audit-log-expand:hover, .audit-log-expand:focus-visible { color: #ffab2e; border-color: rgba(255,151,0,.65); outline: 0; }
.audit-log-expand i { transition: transform .15s ease; }
.audit-log-expand.is-open i { transform: rotate(180deg); }
.audit-log-details-row td { height: auto; padding: 0 10px 14px; }
.audit-log-details-content { padding: 12px 14px; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07); border-radius: 7px; }
.audit-log-json-details { max-height: 340px; margin: 0; overflow: auto; color: #d2dbe2; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 10px; line-height: 1.65; tab-size: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-log-no-details { color: #97a3ad; font-size: 10px; }
.audit-log-state { height: 170px !important; color: #97a3ad; text-align: center; }
.audit-log-state.is-error { color: #ff7d88; }
.audit-log-retry { margin-left: 10px; padding: 5px 9px; color: #ffb02e; background: transparent; border: 1px solid rgba(255,151,0,.45); border-radius: 5px; font-size: 10px; }
.audit-log-retry:hover, .audit-log-retry:focus-visible { background: rgba(255,151,0,.09); border-color: #ff9800; outline: 0; }
.audit-log-spinner { width: 16px; height: 16px; display: inline-block; margin-right: 9px; vertical-align: -3px; border: 2px solid rgba(255,255,255,.2); border-top-color: #ff9800; border-radius: 50%; animation: audit-log-spin .75s linear infinite; }
@keyframes audit-log-spin { to { transform: rotate(360deg); } }
.audit-log-footer { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 14px; color: #8e98a3; font-size: 10px; }
.audit-log-pagination { display: flex; align-items: center; gap: 6px; }
.audit-log-page { min-width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0 8px; color: #d2dbe2; background: #080b0f; border: 1px solid #29323b; border-radius: 7px; font-size: 11px; }
.audit-log-page:hover:not(:disabled), .audit-log-page:focus-visible { color: #ffb02e; border-color: rgba(255,151,0,.65); outline: 0; }
.audit-log-page.is-active { color: #111; background: #ff9800; border-color: #ff9800; }
.audit-log-page:disabled { opacity: .4; cursor: not-allowed; }
.audit-log-page-gap { padding-inline: 2px; color: #7f8b95; }

@media (max-width: 991px) {
    html body.dashboard-page .audit-log-modal { padding: 0 !important; }
    html body.dashboard-page .audit-log-modal .modal-dialog { width: 100%; height: 100vh; height: 100dvh; min-height: 0; max-width: none; margin: 0; }
    html body.dashboard-page .audit-log-modal .modal-content { height: 100%; max-height: none; border: 0; border-radius: 0; }
    html body.dashboard-page .audit-log-modal .modal-header { gap: 8px; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left)); }
    .audit-log-modal .modal-header > div { min-width: 0; }
    .audit-log-modal .modal-header .panel-label { margin-bottom: 6px; font-size: 10px; }
    .audit-log-modal .modal-header h2 { font-size: 22px; line-height: 1.3; }
    .audit-log-modal .modal-header p { margin-top: 6px; font-size: 13px; line-height: 1.4; }
    html body.dashboard-page .audit-log-modal .modal-header .btn-close { flex: 0 0 44px; width: 44px; height: 44px; margin: -4px -6px 0 auto; padding: 0; box-sizing: border-box; }
    .audit-log-modal .modal-body { padding: 14px max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
    .audit-log-toolbar { grid-template-columns: minmax(0, 1fr) minmax(120px, .7fr) 40px; gap: 8px; }
    .audit-log-source { grid-column: 1 / -1; }
    .audit-log-search { grid-column: 1 / -1; }
    .audit-log-reset { width: 40px; }
    .audit-log-table { min-width: 850px; }
    .audit-log-footer { align-items: flex-start; flex-direction: column; }
    .audit-log-pagination { max-width: 100%; flex-wrap: wrap; }
}

@media (max-width: 575px) {
    .audit-log-toolbar { grid-template-columns: minmax(0, 1fr) 40px; }
    .audit-log-modal .audit-log-filter { grid-column: 1 / -1; }
    .audit-log-modal .audit-log-filter .form-select { min-height: 44px; font-size: 14px; }
    .audit-log-modal .audit-log-search .form-control { min-height: 44px; font-size: 14px; }
    .audit-log-table { min-width: 790px; }
    .audit-log-table th, .audit-log-table td { padding-inline: 8px; }
    .audit-log-footer { font-size: 12px; }
}
