/* ── Review queue page ───────────────────────────────────────────────── */
.review-queue-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 32px 60px;
}
@media (max-width: 680px) { .review-queue-page { padding: 20px 16px 48px; } }
.page-heading {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 4px;
}
.page-sub {
  font-size: .87rem;
  color: var(--st);
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}
.queue-section-header {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--st);
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.queue-item {
  background: var(--wh);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s, border-color .15s;
}
.queue-item:hover {
  box-shadow: 0 4px 16px rgba(0,113,175,.12);
  transform: translateY(-2px);
  border-color: var(--accent);
}
.queue-item__info { flex: 1; min-width: 0; }
.queue-item__title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-item__meta {
  font-size: .78rem;
  color: var(--st);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
/* PI-6 — reviewer-facing change summary line in the review queue */
.queue-item__summary {
  margin-top: 6px;
  font-size: .8rem;
  color: var(--st);
  line-height: 1.4;
  word-break: break-word;
}
.queue-item__days {
  font-weight: 800;
  color: var(--or);
  background: var(--warning-tint);
  padding: 2px 8px;
  border-radius: 100px;
}
.queue-item__outcome {
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
}
.outcome--approved { background: var(--success-tint); color: var(--success); }
.outcome--returned { background: var(--danger-tint); color: var(--danger); }

/* PI-98 (GV-12) — pending-row direction pill: "Awaiting your review" (the
   current user is the nominated reviewer) vs "Submitted by you" (the current
   user is the submitter, waiting on the reviewer). */
.queue-item__direction {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 100px;
  white-space: nowrap;
}
.queue-item__direction--inbox {
  background: var(--info-tint);
  color: var(--info);
  border: 1px solid var(--info-border);
}
.queue-item__direction--outbox {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Admin page ──────────────────────────────────────────────────────── */
.admin-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}
.admin-stat-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
/* TM-9962 — with the Administrator-only Deleted tile there are 6 tiles;
   keep them all on one line (they share the row width evenly). Defined
   before the responsive overrides so the small-screen collapse still wins. */
.admin-stat-row--6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .admin-stat-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px) { .admin-stat-row { grid-template-columns: repeat(2, 1fr); } }
.admin-stat-card {
  background: var(--wh);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 14px;
  text-align: center;
  cursor: pointer;
  /* Allow the tile to shrink below its content width so 6 fit one line. */
  min-width: 0;
  transition: box-shadow .15s, border-color .15s, transform .1s;
}
.admin-stat-card:hover {
  box-shadow: 0 4px 14px rgba(0,113,175,.1);
  transform: translateY(-1px);
}
.admin-stat-card:focus-visible {
  outline: 2px solid var(--vb);
  outline-offset: 2px;
}
.admin-stat-card--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,113,175,.15);
}
.admin-stat-card__num {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.1;
}
.admin-stat-card__label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--st);
  margin-top: 4px;
}
.admin-stat-card--all       .admin-stat-card__num { color: var(--accent); }
.admin-stat-card--published .admin-stat-card__num { color: var(--success); }
.admin-stat-card--draft     .admin-stat-card__num { color: var(--solid-draft); }
.admin-stat-card--review    .admin-stat-card__num { color: var(--warning); }
.admin-stat-card--retired   .admin-stat-card__num { color: var(--danger); }
/* TM-9962 — Administrator-only "Deleted" scorecard tile. */
.admin-stat-card--deleted   .admin-stat-card__num { color: var(--purple-fg); }

.admin-section {
  background: var(--wh);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 22px;
  /* PI-33 — `clip` (not `hidden`): both clip the table to the rounded corners,
     but `hidden` makes this box a scroll container, which captures the sticky
     table header (.admin-table th) so it scrolls away / rows overlap it instead
     of pinning. `clip` does not create a scroll container, so the header pins to
     the viewport as intended. */
  overflow: clip;
}
.admin-section__header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-section__title {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-size: .88rem;
  font-weight: 700;
  color: var(--heading);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.admin-table th {
  text-align: left;
  padding: 9px 14px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--st);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  /* PI-33 — keep the column headers visible while the list scrolls. Pinned just
     below the sticky shell header (3px accent bar + 56px header = 59px). The
     background is opaque so rows never show through, and the divider is drawn
     with box-shadow because border-collapse drops a cell's own border when it
     detaches to stick.
     NOTE: this only pins if no ancestor is a scroll container — the wrapping
     .admin-section therefore uses `overflow: clip` (NOT `hidden`) so it can still
     clip to its rounded corners without capturing this sticky header. */
  position: sticky;
  top: 59px;
  z-index: 30;
  box-shadow: inset 0 -1px 0 var(--border);
}
.admin-table th:hover { color: var(--heading); }
.admin-table th .sort-arrow { margin-left: 4px; opacity: .4; }
.admin-table th.sorted .sort-arrow { opacity: 1; color: var(--accent); }
/* PI-22 — keyboard-navigable sort control: the clickable content is a focusable
   span that fills the header cell (so the whole header stays clickable as
   before), inherits the header look, shows a visible focus ring, and gives a
   >=44px activation target (accessibility AC). Padding moves from the <th> to
   the span so no click area is lost. */
.admin-table th.admin-table__th--sortable { padding: 0; }
.admin-table th .admin-table__sort {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 9px 14px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  box-sizing: border-box;
}
.admin-table th .admin-table__sort:focus-visible {
  outline: 2px solid var(--vb);
  outline-offset: -2px;
}
.admin-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--wash);
  color: var(--gr);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-2); cursor: pointer; }

/* ── Admin table checkbox + views column ── */
.admin-table td.cb-cell, .admin-table th.cb-cell {
  width: 36px; text-align: center; padding: 0 6px;
}
.admin-table .views-col { text-align: right; font-size: .78rem; }
.admin-table__clone-btn {
  background: none; border: none; cursor: pointer; font-size: .9rem;
  padding: 2px 6px; border-radius: 4px; opacity: 0;
  transition: opacity .14s;
}
.admin-table tr:hover .admin-table__clone-btn { opacity: 1; }

/* ── Admin bulk action bar ── */
.bulk-action-bar {
  position: sticky; bottom: 0; z-index: 20;
  background: var(--dn); color: var(--on-brand);
  border-radius: 10px 10px 0 0;
  padding: 12px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.18);
}
.bulk-action-bar__count {
  font-size: .84rem; font-weight: 600; flex: 1;
}
.bulk-action-bar__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 16px; border-radius: 5px; font-size: .82rem;
  font-weight: 600; cursor: pointer; border: 2px solid rgba(255,255,255,.4);
  background: transparent; color: var(--on-brand); transition: background .15s, color .15s, border-color .15s;
}
.bulk-action-bar__btn:hover:not(:disabled) { background: rgba(255,255,255,.15); }
.bulk-action-bar__btn:disabled { opacity: .38; cursor: not-allowed; }
.bulk-action-bar__btn--danger { border-color: var(--danger); color: var(--danger-soft); }
.bulk-action-bar__btn--danger:hover:not(:disabled) { background: rgba(231,76,60,.25); }

/* ── PI-22 Governance page (combined Admin inventory + Review queue) ──── */
.governance-page {
  /* PI-22 — explicit width:100% so the page fills the available space on BOTH
     tabs. Without it, #app being a flex column + margin:0 auto makes the page
     shrink to its content width, so the narrow Review-queue cards collapsed the
     layout narrower than the wide All-dashboards table. */
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 32px 60px;
}
@media (max-width: 680px) { .governance-page { padding: 20px 16px 48px; } }

/* Tabs: All dashboards | Review queue */
.gov-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.gov-tab {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--st);
  cursor: pointer;
  padding: 10px 14px;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color .12s, border-color .12s;
}
.gov-tab:hover { color: var(--heading); }
.gov-tab.active { color: var(--heading); border-bottom-color: var(--or); }
.gov-tab:focus-visible { outline: 2px solid var(--vb); outline-offset: 2px; }
.gov-tab__cnt {
  background: var(--chip);
  color: var(--st);
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 8px;
}
.gov-tab.active .gov-tab__cnt { background: var(--dn); color: var(--on-brand); }

/* Inventory toolbar: search + live "Showing N of M" count.
   Matches the mockup .toolbar — sits directly under the tabs, above the
   bordered table card (no surrounding border/padding). */
.gov-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 14px 0 8px;
}
.gov-search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--dn);
  border-radius: 22px;
  padding: 6px 14px;
  background: var(--wh);
  color: var(--heading);
}
.gov-search input {
  border: 0;
  outline: 0;
  font: inherit;
  width: 100%;
  background: transparent;
  color: var(--gr);
}
.gov-count {
  color: var(--st);
  font-size: .78rem;
  white-space: nowrap;
}

/* Tiles + table tuned to the mockup, scoped to the Governance page so the
   legacy standalone Admin page is unaffected. Rounded (12px) tiles with a blue
   inset active indicator, mockup tile-number colors, and a rounded bordered
   table card. */
.governance-page .admin-stat-card { border-radius: 12px; }
.governance-page .admin-stat-card--active {
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--vb);
}
.governance-page .admin-stat-card--all       .admin-stat-card__num { color: var(--accent); }
.governance-page .admin-stat-card--published .admin-stat-card__num { color: var(--success); }
.governance-page .admin-stat-card--draft     .admin-stat-card__num { color: var(--st); }
.governance-page .admin-stat-card--review    .admin-stat-card__num { color: var(--or); }
.governance-page .admin-stat-card--retired   .admin-stat-card__num { color: var(--danger); }
.governance-page .admin-stat-card--deleted   .admin-stat-card__num { color: var(--purple-fg); }
.governance-page .admin-section { border-radius: 12px; }

/* Review queue body embedded in the Governance "Review queue" tab. */
.governance-page .review-queue-body { margin-top: 4px; }
.governance-page .queue-section-header:first-child { margin-top: 8px; }

/* ── Settings page ───────────────────────────────────────────────────── */
.settings-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 32px 60px;
}
@media (max-width: 680px) { .settings-page { padding: 20px 16px 48px; } }

.settings-section {
  background: var(--wh);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 24px;
  overflow: hidden;
}
.settings-section__header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
}
.settings-section__title {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--heading);
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-section__sub {
  font-size: .78rem;
  color: var(--st);
  margin-top: 1px;
}
.settings-section__body {
  padding: 16px 22px;
}

/* Domain rows */
.domain-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--wash);
  transition: background .1s;
  border-radius: 6px;
}
.domain-row:last-child { border-bottom: none; }
.domain-row:hover { background: var(--surface-2); }
.domain-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(0,0,0,.08);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.domain-review-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: .68rem;
  font-weight: 600;
  color: var(--warning);
  background: var(--warning-tint);
  border: 1px solid var(--warning-border);
  border-radius: 4px;
  vertical-align: middle;
}
.domain-review-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: .82rem;
  color: var(--st);
  line-height: 1.4;
  cursor: pointer;
}
.domain-review-toggle input {
  margin-top: 3px;
  flex-shrink: 0;
}
.domain-row__name {
  flex: 1;
  font-size: .92rem;
  font-weight: 700;
  color: var(--heading);
}
.domain-row__count {
  font-size: .74rem;
  color: var(--st);
  background: var(--bg);
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid var(--border);
}
.domain-row__actions {
  display: flex;
  gap: 6px;
}
.btn-settings-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: .8rem;
  font-weight: 600;
  font-family: inherit;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  color: var(--accent);
  cursor: pointer;
  transition: background .1s, border-color .1s;
}
.btn-settings-edit:hover { background: var(--wash-blue); border-color: var(--accent); }
.btn-settings-del {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: .8rem;
  font-weight: 600;
  font-family: inherit;
  background: none;
  border: 1.5px solid var(--danger-border);
  border-radius: 6px;
  color: var(--danger);
  cursor: pointer;
  transition: background .1s, border-color .1s;
}
.btn-settings-del:hover { background: var(--danger-tint); border-color: var(--danger); }

/* Inline domain edit form */
.domain-edit-form {
  background: var(--surface-2);
  border: 1.5px solid var(--vb);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 6px 0;
  display: none;
}
.domain-edit-form.open { display: block; }
.domain-edit-form__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.domain-edit-form__label {
  font-size: .74rem;
  font-weight: 700;
  color: var(--st);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.domain-edit-input {
  flex: 1;
  min-width: 160px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: .86rem;
  font-family: inherit;
  outline: none;
  transition: border-color .12s;
}
.domain-edit-input:focus { border-color: var(--accent); }
.domain-color-preview {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.12);
  flex-shrink: 0;
  cursor: pointer;
}
.domain-edit-form__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 0;
}
.domain-edit-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .1s, border-color .1s;
}
.domain-edit-swatch:hover { transform: scale(1.18); }
.domain-edit-swatch.selected { border-color: var(--heading); transform: scale(1.12); }
.domain-edit-form__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

/* Taxonomy tag list */
.tax-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.tax-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 12px;
  background: var(--wash-blue);
  border: 1px solid var(--info-border);
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--heading);
}
.tax-tag-chip__remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .75rem;
  color: var(--st);
  padding: 0 1px;
  line-height: 1;
  transition: color .1s;
}
.tax-tag-chip__remove:hover { color: var(--danger); }
.tax-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tax-add-input {
  flex: 1;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: .85rem;
  font-family: inherit;
  outline: none;
  transition: border-color .12s;
}
.tax-add-input:focus { border-color: var(--accent); }

/* ── PI-6 — Trust Score weights config surface (admin) ───────────────────── */
.gov-weights {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.gov-weights__summary {
  cursor: pointer;
  padding: 14px 18px;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-weight: 700;
  color: var(--heading);
  display: flex;
  align-items: center;
  gap: 10px;
}
.gov-weights__prov {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--st);
  background: var(--wash-blue);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 8px;
}
.gov-weights__body { padding: 4px 18px 18px; }
.gov-weights__note {
  font-size: .82rem;
  color: var(--st);
  margin: 0 0 16px;
  line-height: 1.5;
}
.gov-weights__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.gov-weight-row { display: flex; flex-direction: column; gap: 4px; }
.gov-weight-row__label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--heading);
}
.gov-weight-row__input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text);
  font-size: .85rem;
  font-family: inherit;
  outline: none;
  transition: border-color .12s;
}
.gov-weight-row__input:focus { border-color: var(--accent); }
.gov-weights__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* PI-35 — AI Models governance panel (catalog table + BYO connect form). */
.gov-models__table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  margin: 6px 0 4px;
}
.gov-models__table th,
.gov-models__table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.gov-models__table th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.gov-models__actions { display: flex; gap: 6px; }
.gov-models__connect { margin-top: 12px; }
.gov-models__connect-head {
  font-family: var(--pi-head, inherit);
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 4px;
}
.gov-models__form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.gov-models__form input,
.gov-models__form select {
  flex: 1 1 160px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: .85rem;
  font-family: inherit;
  outline: none;
}
.gov-models__form input:focus,
.gov-models__form select:focus { border-color: var(--accent); }
