/*
 * access_requests.css — Early-Access Requests admin review queue.
 * Built from the existing OSR system, mirroring bug.css: Stone Wall .panel
 * surfaces, 1px Mortar borders, single accent (var(--color-accent)), Void Red
 * (var(--color-danger)) for the declined tone, border-radius:0. No new colors —
 * all tokens reference base.css. Reuses .module-view__title/__tagline, .panel,
 * .field / .field__input / .field__label, .btn, .admin-table / .admin-row /
 * .admin__list-panel (admin.css), .profile__loading (profile.css), and the
 * .action-modal chrome for the approve/decline modals.
 */

/* ---- list: fills the content shell so columns breathe (like bugs-admin) ---- */

.access-requests {
  max-width: 100%;
}

.access-requests.access-requests--detail {
  max-width: 980px;
}

.access-requests__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.access-requests__filter {
  flex: 1 1 180px;
  margin: 0;
}

/* ---- rows ---------------------------------------------------------------- */

.access-requests__row {
  cursor: pointer;
}

.access-requests__row:hover,
.access-requests__row:focus-visible {
  background: var(--color-surface-hover);
}

.access-requests__row:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.access-requests__email {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-requests__note-preview {
  max-width: 24rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-muted);
}

.access-requests__created {
  white-space: nowrap;
  color: var(--color-text-muted);
}

/* ---- status badge (dot + always-present word; never color-only) ---------- */

.ar-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  white-space: nowrap;
}

.ar-status__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--color-text-muted);
  flex-shrink: 0;
}

.ar-status__word {
  font-size: var(--text-sm);
}

/* New = accent (needs attention); reviewed = accent; approved = heal-green;
   declined = danger + dimmed word. Color is supportive only — the word is
   always present. */
.ar-status--new .ar-status__dot,
.ar-status--reviewed .ar-status__dot {
  background: var(--color-accent);
}

.ar-status--approved .ar-status__dot {
  background: var(--color-heal);
}

.ar-status--declined .ar-status__dot {
  background: var(--color-danger);
}

.ar-status--declined .ar-status__word {
  color: var(--color-text-muted);
}

/* ---- detail view --------------------------------------------------------- */

.access-requests__back {
  margin-bottom: var(--space-md);
}

.access-requests__detail {
  padding: var(--space-lg);
}

.access-requests__detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.access-requests__detail-title {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  color: var(--color-heading);
  margin: 0;
  word-break: break-word;
}

.access-requests__fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs) var(--space-md);
  margin-bottom: var(--space-lg);
}

.access-requests__field {
  display: contents;
}

.access-requests__field-label {
  font-family: var(--font-heading-ui);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--ls-cinzel-caps);
  color: var(--color-text-muted);
}

.access-requests__field-value {
  color: var(--color-text);
  word-break: break-word;
}

/* Admin-only soft warnings (EC-1/EC-2) — an account / pending invite may already
   exist for this email. A caution stripe, not an error: the admin decides. */
.access-requests__hints {
  margin-bottom: var(--space-lg);
}

.access-requests__hint {
  margin: 0 0 var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.95rem;
}

.access-requests__hint:last-child {
  margin-bottom: 0;
}

.access-requests__note {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
  margin-bottom: var(--space-lg);
}

.access-requests__note-label {
  font-family: var(--font-heading-ui);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--ls-cinzel-caps);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-xs);
}

.access-requests__note-body {
  margin: 0;
  /* Preserve the requester's line breaks; the value is set via textContent so
     stored HTML/script never executes. */
  white-space: pre-wrap;
  word-break: break-word;
  line-height: var(--lh-body);
}

.access-requests__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.access-requests__terminal-note {
  margin: 0;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ---- inline result (invite link / messages) ------------------------------ */

.access-requests__result {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface);
}

.access-requests__result--error {
  border-left-color: var(--color-danger);
  background: var(--color-danger-bg);
}

.access-requests__result-msg {
  margin: 0 0 var(--space-sm);
}

.access-requests__result-msg:last-child {
  margin-bottom: 0;
}

.access-requests__link-row {
  display: flex;
  gap: var(--space-sm);
  align-items: stretch;
}

.access-requests__link-input {
  flex: 1 1 auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.access-requests__copy {
  flex: 0 0 auto;
}

/* ---- decline reason field (in the modal) --------------------------------- */

.access-requests__reason {
  resize: vertical;
  min-height: 4.5rem;
  font-family: var(--font-body);
  width: 100%;
}
