.citadel-audit-open {
  overflow: hidden;
}

.product-audit-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 8, 15, 0.86);
}

.product-audit-overlay[hidden] {
  display: none !important;
}

.product-audit {
  box-sizing: border-box;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    'heading detail'
    'summary detail'
    'filters detail'
    'message detail'
    'table detail'
    'pagination detail';
  column-gap: 22px;
  row-gap: 12px;
  width: min(1480px, 100%);
  height: min(900px, calc(100dvh - 40px));
  min-height: 0;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(160, 174, 192, 0.28);
  border-radius: 14px;
  background: #131d28;
  color: #f3f6fb;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
}

.product-audit > h4 {
  grid-area: heading;
  margin: 0;
  font-size: 1.2rem;
}

.product-audit-close {
  position: absolute;
  top: 18px;
  right: 24px;
  z-index: 2;
}

.product-audit-summary {
  grid-area: summary;
  margin: 0;
  color: #b9c9d9;
  font-size: 0.9rem;
}

.product-audit-filters {
  grid-area: filters;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 0;
}

.product-audit-filters label {
  display: flex;
  flex: 1 1 155px;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  font-size: 0.82rem;
}

.product-audit-filters input,
.product-audit-filters select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(160, 174, 192, 0.35);
  border-radius: 6px;
  background: #1b2937;
  color: inherit;
}

.product-audit-message {
  grid-area: message;
  margin: 0;
  font-size: 0.84rem;
  color: #b9c9d9;
}

.product-audit-table-wrapper {
  grid-area: table;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(160, 174, 192, 0.2);
  border-radius: 8px;
}

.product-audit-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.product-audit-table th,
.product-audit-table td {
  padding: 11px 9px;
  text-align: left;
  border-bottom: 1px solid rgba(160, 174, 192, 0.16);
  overflow-wrap: anywhere;
}

.product-audit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #213143;
  white-space: nowrap;
}

.product-audit-table tbody tr:hover {
  background: rgba(160, 174, 192, 0.08);
}

.product-audit-pagination {
  grid-area: pagination;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.product-audit-detail {
  grid-area: detail;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  margin-top: 40px;
  padding: 18px;
  border: 1px solid rgba(160, 174, 192, 0.25);
  border-radius: 10px;
  background: #192635;
  overflow-wrap: anywhere;
}

.product-audit-detail h4 {
  margin-top: 0;
}

.product-audit-detail pre {
  max-height: 65vh;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: #0b141d;
  color: #dbe8f6;
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre;
}

@media (max-width: 950px) {
  .product-audit-overlay {
    padding: 10px;
  }

  .product-audit {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    height: calc(100dvh - 20px);
    padding: 18px;
    overflow-y: auto;
  }

  .product-audit > h4 {
    padding-right: 80px;
  }

  .product-audit-close {
    top: 12px;
    right: 16px;
  }

  .product-audit-table-wrapper {
    min-height: 260px;
    max-height: 42dvh;
    flex-shrink: 0;
  }

  .product-audit-detail {
    margin-top: 0;
    min-height: 280px;
    overflow: visible;
    flex-shrink: 0;
  }

  .product-audit-detail pre {
    max-height: 320px;
  }
}
