.page-section {
  padding: 24px;
}

.page-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-heading-title {
  margin: 0 0 6px;
}

.page-heading-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
}

.documents-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.documents-header-title {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.documents-header > div,
.audit-section-head > div {
  animation: pageFadeUp 480ms var(--ease-standard) both;
}

.documents-header-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.5;
}

.dashboard-alert {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--modal-surface);
  color: var(--text);
}

.dashboard-alert-error {
  border-color: rgba(255, 255, 255, 0.16);
  background: var(--modal-surface-strong);
}

.dashboard-alert strong {
  font-size: 15px;
}

.dashboard-alert span {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

.audit-page {
  display: grid;
}

.audit-shell-card {
  background: var(--modal-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 24px;
}

.audit-shell-card:hover {
  transform: translateY(-3px);
}

.audit-summary-row,
.audit-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.audit-summary-pill,
.audit-detail-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--modal-surface);
  padding: 18px;
}

.audit-summary-pill:hover,
.audit-detail-panel:hover {
  background: var(--modal-surface-strong);
  border-color: rgba(255,255,255,0.13);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0,0,0,0.16);
}

.audit-summary-value,
.audit-detail-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.audit-summary-label,
.audit-detail-label,
.audit-table-subtitle,
.audit-muted {
  color: var(--text-soft);
}

.audit-detail-label {
  margin-bottom: 8px;
  font-size: 14px;
}

.audit-header-actions,
.audit-inline-actions,
.audit-table-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.audit-inline-actions {
  margin-bottom: 24px;
}

.audit-section-head {
  margin-bottom: 14px;
}

.audit-section-title {
  margin: 0 0 4px;
  font-size: 20px;
}

.audit-table-card {
  overflow: hidden;
}

.audit-table-card tbody tr {
  animation: rowFadeIn 360ms var(--ease-standard) both;
}

.audit-table-card tbody tr:nth-child(1) { animation-delay: 40ms; }
.audit-table-card tbody tr:nth-child(2) { animation-delay: 80ms; }
.audit-table-card tbody tr:nth-child(3) { animation-delay: 120ms; }
.audit-table-card tbody tr:nth-child(4) { animation-delay: 160ms; }
.audit-table-card tbody tr:nth-child(5) { animation-delay: 200ms; }
.audit-table-card tbody tr:nth-child(6) { animation-delay: 240ms; }

.audit-table-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.audit-table-subtitle {
  font-size: 13px;
}

.audit-table-modern {
  min-width: 980px;
}

.audit-table-modern td,
.audit-table-modern th {
  white-space: normal;
}

.audit-description-cell {
  min-width: 240px;
  line-height: 1.5;
}

.audit-change-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  line-height: 1.5;
}

.audit-change-list li + li {
  margin-top: 4px;
}

.audit-change-list li {
  transition: color 180ms var(--ease-standard), transform 180ms var(--ease-standard);
}

.audit-change-list li:hover {
  color: var(--text);
  transform: translateX(2px);
}

.dashboard-is-loading .table-card,
.documents-page.is-loading .documents-table-card {
  position: relative;
}

.dashboard-is-loading .table-card::after,
.documents-page.is-loading .documents-table-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 18, 20, 0.12), rgba(17, 18, 20, 0.24));
  pointer-events: none;
}

.audit-danger-button {
  border-color: rgba(255, 255, 255, 0.16);
  background: var(--modal-surface);
}

.audit-danger-button:hover {
  background: var(--modal-surface-strong);
  border-color: rgba(255, 255, 255, 0.2);
}

.detail-table {
  margin-bottom: 16px;
  width: auto;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.audit-table,
.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.audit-table-head {
  text-align: left;
  border-bottom: 1px solid #ccc;
  padding: 8px;
}

.audit-table-cell {
  border-bottom: 1px solid #eee;
  padding: 8px;
}

@keyframes pageFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rowFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .audit-summary-row,
  .audit-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-section {
    padding: 18px;
  }

  .audit-shell-card {
    padding: 18px;
  }

  .documents-header-title {
    font-size: 24px;
  }

  .audit-header-actions,
  .audit-inline-actions,
  .audit-table-actions {
    align-items: stretch;
  }

  .audit-header-actions .btn,
  .audit-inline-actions .btn,
  .audit-table-actions .action-link {
    width: 100%;
    justify-content: center;
  }
}
