/* HMS-882 — Audit Results admin index matched to Figma 600:27685
   (ON-SITE OPS - Audit Results): one connected four-card KPI strip, a
   fixed-proportion table with Figma's icon headers and status chips, and a
   Show-per-page + numbered pagination footer. */

.audit-results__section {
  margin-top: 1rem;
}

/* ------------------------------------------------------------- KPI strip */

/* Figma's KPIs frame is a radius-16, clipsContent container; the four
   Statistic Cards sit flush inside it, their 1px #E4E5E9 strokes overlapping
   into single divider lines. The wrap's border + overflow:hidden reproduce
   that: one outer edge, hairline dividers, rounded corners. */
.audit-results__kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--wa-color-surface-border);
  border-radius: 1rem;
  background: var(--wa-color-surface-default);
}

.audit-results__kpi {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
}

.audit-results__kpi + .audit-results__kpi {
  box-shadow: inset 1px 0 0 var(--wa-color-surface-border);
}

.audit-results__kpi-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--wa-color-text-normal);
}

.audit-results__kpi-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.audit-results__kpi-stat {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.audit-results__kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--wa-color-text-normal);
}

.audit-results__kpi-desc {
  font-size: 0.875rem;
  line-height: 1.2;
  color: var(--wa-color-text-quiet);
}

/* Figma's icon tile: 48px, #EAEFF2 fill, 6px radius, 1px #7194A5 stroke,
   18px brand glyph — identical on all four cards. */
.audit-results__kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 6px;
  background: #eaeff2; /* Figma tile fill — same literal as reports-hub/chatbot KPI icons */
  border: 1px solid #7194a5; /* Figma tile stroke */
  color: var(--wa-color-brand);
  font-size: 1.125rem;
}

/* -------------------------------------------------------- section rhythm */

.audit-results__section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.audit-results__heading {
  min-width: 0;
}

.audit-results__section-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--wa-color-text-normal);
}

.audit-results__desc {
  margin: 0;
  font-size: 1rem;
  color: var(--wa-color-text-quiet);
}

/* --------------------------------------------------------------- tables */

/* Specificity must outrank `.admin-table-wrap table`'s min-width:
   max-content so the fixed tracks hold like the Figma columns. */
.admin-table-wrap .audit-results__table {
  min-width: 62rem;
}

.audit-results__table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.audit-results__table th,
.audit-results__table td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: middle;
  font-size: 1rem;
  font-weight: 400;
  color: var(--wa-color-text-normal);
  border-bottom: 1px solid var(--wa-color-surface-border);
  overflow-wrap: break-word;
}

/* Figma header band: #F1F2F3 fill, 16px/600 #1B1D26 label, 16px icon in the
   same ink — the icon is not quieted. */
.audit-results__table thead th {
  background: var(--wa-color-surface-lowered);
  font-weight: 600;
}

.audit-results__table thead th i {
  margin-right: 0.625rem;
}

.audit-results__table tbody tr:last-child td {
  border-bottom: none;
}

.audit-results__hotel {
  font-weight: 600;
}

/* --------------------------------------------------------------- badges */

/* Figma status chip: 12px/600 label with a leading glyph, 8px/12px padding,
   6px radius — Pending warning, Approved-equivalent success, Denied danger. */
.audit-results__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.audit-results__badge--warning {
  background: var(--wa-color-warning-fill-quiet);
  color: var(--wa-color-warning-on-quiet);
}

.audit-results__badge--success {
  background: var(--wa-color-success-fill-quiet);
  color: var(--wa-color-success-on-quiet);
}

.audit-results__badge--danger {
  background: var(--wa-color-danger-fill-quiet);
  color: var(--wa-color-danger-on-quiet);
}

.audit-results__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* The row's two PATCH forms wrap single wa-buttons — display:contents lets
   them sit in the actions flex row like sibling buttons (HMS-885 pattern). */
.audit-results__row-form {
  display: contents;
}

/* ------------------------------------------------------------ pagination */

/* Figma Pagination Full: Show-per-page select left, "X–Y of Z" centered,
   bordered numbered-button group right. */
.audit-results__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.audit-results__per-page {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--wa-color-text-quiet);
}

.audit-results__count {
  margin: 0;
  margin-inline: auto;
  font-size: 0.875rem;
  color: var(--wa-color-text-quiet);
  white-space: nowrap;
}

.audit-results__pages {
  display: flex;
}

.audit-results__pages .series-nav {
  display: flex;
  align-items: stretch;
}

.audit-results__pages .series-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.625rem;
  padding: 0.125rem 0.375rem;
  border: 1px solid var(--wa-color-surface-border);
  border-radius: 0;
  margin-left: -1px;
  background: var(--wa-color-surface-default);
  color: var(--wa-color-text-normal);
  font-size: 0.875rem;
  text-decoration: none;
}

.audit-results__pages .series-nav a:first-child {
  margin-left: 0;
  border-radius: var(--wa-border-radius-s) 0 0 var(--wa-border-radius-s);
}

.audit-results__pages .series-nav a:last-child {
  border-radius: 0 var(--wa-border-radius-s) var(--wa-border-radius-s) 0;
}

.audit-results__pages .series-nav a[href]:hover {
  background: var(--wa-color-surface-lowered);
}

.audit-results__pages .series-nav a[aria-current="page"] {
  background: var(--wa-color-brand-fill-loud);
  border-color: var(--wa-color-brand-fill-loud);
  color: var(--wa-color-brand-on-loud);
}

.audit-results__pages .series-nav a[aria-disabled]:not([aria-current="page"]) {
  opacity: 0.4;
  cursor: default;
}

.audit-results__empty {
  text-align: center;
  color: var(--wa-color-text-quiet);
  padding: 1.5rem;
}

/* ---------------------------------------------------------- narrow screens */

@media (max-width: 48rem) {
  .audit-results__kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .audit-results__kpi {
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--wa-color-surface-border);
    border-radius: 0.5rem;
  }

  .audit-results__kpi + .audit-results__kpi {
    box-shadow: none;
  }

  .audit-results__kpi-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
}
