/* AI Workforce (js/views/agents.js) and the agent detail page
   (js/views/agent-detail.js) — epic #2426 round 3. Everything else on
   these two views already reuses the shared component classes in
   app.css; this file adds only what those do not cover.

   Do not add rules here for other views — this stylesheet is scoped by
   ownership, not by selector, and nothing enforces the boundary but this
   comment. */

/* #18 — the two-party promotion sign-off panel (request → owner +
   department-head approvals, pending state, reject) carries more than
   the single reason line `.mai-promo` (app.css) was built for under
   Promote/Demote: a request line, sign-off progress, and Approve/Reject.
   Narrow + right-aligned reads fine for one line; it does not for a
   short paragraph plus two buttons. */
.mai-promo.is-pending-request {
  max-width: 46ch;
  justify-items: stretch;
  text-align: left;
}

.mai-promo.is-pending-request .mai-actions {
  justify-content: flex-end;
}

.mai-promo-request-status p {
  margin: 0 0 var(--space-1) 0;
}

/* #11 — a health pill now carries the breached-metric sentence
   (`health_reason`, e.g. "median confidence 61% is below the fleet
   threshold 85%") underneath it, not squeezed onto the pill's own line. */
.mai-health-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

@media (max-width: 480px) {
  .mai-promo.is-pending-request {
    max-width: none;
  }
}

/* C6 ("platform agents shown only in a collapsed 'Platform' group") — a
   native <details>/<summary>, closed by default: no JS state to wire, a
   free disclosure triangle, and a real accessible name for free. */
.mai-agents-platform {
  margin-top: var(--space-2);
}

.mai-agents-platform > summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--mai-ink-2);
  padding: var(--space-2) 0;
}

.mai-agents-platform[open] > summary {
  margin-bottom: var(--space-2);
}

/* Round-4 m5: Admin › Models provider × data-class grid. */
.mai-policy-grid th, .mai-policy-grid td { padding: var(--space-2) var(--space-3); vertical-align: middle; }
.mai-policy-grid thead th { white-space: normal; max-width: 12ch; font-weight: 500; }
.mai-center { text-align: center; }

/* Round-5 #19: one action bar on every agent; disabled buttons carry their
 * reason in one terse line underneath ("No Decision Specialist node: Pause, Run now"). */
.mai-agent-actionbar { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); }
.mai-agent-actionbar .mai-actions { flex-wrap: wrap; justify-content: flex-end; }
.mai-agent-actionbar .btn[disabled] { cursor: not-allowed; }
.mai-agent-actionbar-reasons { margin: 0; text-align: right; max-width: 380px; }

/* Round-5 #25 / #31: AI Workforce market filter; policy tables wrap their
 * headers instead of clipping at 1440 px. */
.mai-agents-filters { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; }
#policy-ceilings th, #policy-ready-to-promote th { white-space: normal; }
