/* LOTS — Audit-Viewer */

#auditModal,
#auditDetailOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.audit-card {
  background: var(--card-bg, #1e1e2e);
  color: var(--text, #e2e8f0);
  border-radius: 12px;
  width: min(1100px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 50px rgba(0,0,0,0.5);
}

.audit-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border, #333);
}

.audit-card-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.audit-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border, #333);
  background: rgba(255,255,255,0.02);
}

.audit-filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
}

.audit-filters input,
.audit-filters select {
  font-size: 0.875rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border, #333);
  background: var(--input-bg, #0f0f1a);
  color: var(--text, #e2e8f0);
}

.audit-filter-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border, #333);
  align-items: center;
}

#auditStatus {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
}

.audit-table-wrapper {
  overflow: auto;
  flex: 1 1 auto;
}

#auditTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

#auditTable thead {
  position: sticky;
  top: 0;
  background: var(--card-bg, #1e1e2e);
  z-index: 1;
}

#auditTable th,
#auditTable td {
  text-align: left;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: top;
}

.audit-row { cursor: pointer; }
.audit-row:hover { background: rgba(168, 85, 247, 0.08); }

.audit-cell-time   { white-space: nowrap; color: var(--text-muted, #94a3b8); }
.audit-cell-action code,
#auditTable code   { background: rgba(255,255,255,0.06); padding: 1px 4px; border-radius: 4px; font-size: 0.8em; }
.audit-role        { color: var(--text-muted, #94a3b8); font-size: 0.75em; margin-left: 0.4em; }

.audit-detail-card {
  background: var(--card-bg, #1e1e2e);
  color: var(--text, #e2e8f0);
  border-radius: 12px;
  width: min(800px, 95vw);
  max-height: 90vh;
  overflow: auto;
  padding: 1.5rem;
  box-shadow: 0 12px 50px rgba(0,0,0,0.5);
}

.audit-detail-row { margin-bottom: 0.5rem; }
.audit-detail-pre {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 0.8em;
  overflow: auto;
  white-space: pre-wrap;
}
