html[data-bs-theme="dark"] body {
  color: #f5f7fa;
}

html[data-bs-theme="dark"] .text-secondary,
html[data-bs-theme="dark"] .text-muted,
html[data-bs-theme="dark"] .navbar-text,
html[data-bs-theme="dark"] .text-body-secondary,
html[data-bs-theme="dark"] small.text-secondary,
html[data-bs-theme="dark"] .small.text-secondary {
  color: rgba(235, 239, 244, 0.88) !important;
}

html[data-bs-theme="dark"] .card-text,
html[data-bs-theme="dark"] .form-text,
html[data-bs-theme="dark"] .lead {
  color: rgba(235, 239, 244, 0.92) !important;
}

html[data-bs-theme="dark"] .bg-secondary,
html[data-bs-theme="dark"] .card.bg-secondary,
html[data-bs-theme="dark"] .navbar.bg-secondary,
html[data-bs-theme="dark"] footer.bg-secondary {
  background-color: #313740 !important;
}

html[data-bs-theme="dark"] .border-dark-subtle {
  border-color: rgba(255, 255, 255, 0.18) !important;
}

html[data-bs-theme="dark"] .table-dark {
  --bs-table-color: #f5f7fa;
  --bs-table-striped-color: #f5f7fa;
}

html[data-bs-theme="dark"] .btn-outline-light {
  --bs-btn-color: #f5f7fa;
}

header {
  position: sticky;
  top: 0;
  z-index: 1030;
}

html[data-bs-theme="dark"] .navbar.bg-secondary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.tm-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(92vw, 360px);
  pointer-events: none;
}

.tm-toast {
  pointer-events: auto;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.7rem 0.85rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  transform: translateY(-8px);
  opacity: 0;
  animation: tmToastIn 0.25s ease-out forwards;
}

.tm-toast-danger {
  background: #8b1d28;
  color: #ffecef;
  border-color: rgba(255, 207, 214, 0.35);
}

.tm-toast-title {
  display: block;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.tm-toast-message {
  display: block;
  font-size: 0.92rem;
  line-height: 1.25;
}

.tm-toast-hide {
  opacity: 0 !important;
  transform: translateY(-8px) !important;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes tmToastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.audit-summary-card {
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

.audit-summary-value {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 0.25rem;
}

.audit-empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.audit-entry-card {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.audit-entry-card:last-of-type {
  border-bottom: 0;
}

.audit-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.audit-action-neutral {
  color: #cfd7e2;
  background: rgba(255, 255, 255, 0.1);
}

.audit-action-success {
  color: #b7ffd9;
  background: rgba(52, 211, 153, 0.18);
}

.audit-action-warning {
  color: #ffe5a3;
  background: rgba(245, 158, 11, 0.2);
}

.audit-action-danger {
  color: #ffd2d2;
  background: rgba(248, 113, 113, 0.2);
}

.audit-entity-id {
  color: rgba(235, 239, 244, 0.86);
  font-size: 0.82rem;
}

.audit-change-list {
  display: grid;
  gap: 0.45rem;
}

.audit-change-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.55rem;
  padding: 0.45rem 0.65rem;
  background: rgba(0, 0, 0, 0.16);
}

.audit-change-field {
  font-size: 0.8rem;
  font-weight: 700;
  color: #dbe3ee;
}

.audit-change-values {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
}

.audit-change-from {
  color: rgba(235, 239, 244, 0.7);
}

.audit-change-to {
  color: #ffffff;
  font-weight: 600;
}

.audit-json-view {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.6rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 991.98px) {
  .navbar-collapse .navbar-user-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }
}