/* audit.css — 감사 로그 페이지.
 *
 * Layout pattern matches users.css / inquiries.css for visual
 * consistency. Color tokens are CSS variables only.
 */

.audit-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 24px 28px;
    box-sizing: border-box;
    gap: 14px;
    overflow: hidden;
}
.audit-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}
.audit-pane-head h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}
.audit-sub-tabs {
    display: inline-flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 3px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.audit-sub {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.audit-sub.active {
    background: rgba(255, 255, 255, 0.85);
    color: var(--accent);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.audit-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.audit-filter {
    appearance: none;
    -webkit-appearance: none;
    padding: 9px 32px 9px 12px;
    font-size: 13px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    outline: none;
    min-width: 130px;
    font-family: inherit;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.audit-filter:hover {
    border-color: rgba(0, 0, 0, 0.12);
    background-color: rgba(255, 255, 255, 0.92);
}
.audit-filter:focus {
    border-color: var(--accent);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 144, 234, 0.1);
}

.audit-table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.audit-table {
    width: 100%;
    border-collapse: collapse;
}
.audit-table th,
.audit-table td {
    padding: 10px 14px;
    text-align: left;
    font-size: 12.5px;
    vertical-align: top;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.audit-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.audit-table tbody tr:last-child td { border-bottom: 0; }

.audit-col-time { white-space: nowrap; font-family: ui-monospace, SFMono-Regular, monospace; }
.audit-col-sha  { font-family: ui-monospace, SFMono-Regular, monospace; }

.audit-col-preview pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 12px;
    color: var(--text-primary);
    max-height: 7em;
    overflow: hidden;
}
.audit-error {
    margin-top: 6px;
    font-size: 11px;
    color: var(--danger, #d33);
}

/* Statement-kind / ref-kind badges. INSERT green, UPDATE blue,
   DELETE red, DDL purple, OTHER grey. ref_kind: branch=blue, tag=amber. */
.audit-kind-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
    margin-right: 6px;
}
.audit-kind-INSERT { background: #d1fae5; color: #065f46; }
.audit-kind-UPDATE { background: #dbeafe; color: #1e40af; }
.audit-kind-DELETE { background: #fee2e2; color: #991b1b; }
.audit-kind-DDL    { background: #ede9fe; color: #6d28d9; }
.audit-kind-branch { background: #dbeafe; color: #1e40af; }
.audit-kind-tag    { background: #fef3c7; color: #92400e; }

.audit-ok   { color: #16a34a; font-weight: 600; }
.audit-fail { color: #dc2626; font-weight: 600; }

.audit-pane-foot {
    text-align: center;
    flex-shrink: 0;
    padding-top: 6px;
}
.audit-no-more { color: var(--text-tertiary); font-size: 12px; }

.audit-empty {
    padding: 36px;
    text-align: center;
    color: var(--text-primary);
    font-size: 14px;
}
