/* ROOVI area styles: super (platform, users, audit log). Owned by the super area owner.
   Uses the tokens and components from css/app.css. Every selector is scoped under a class
   prefixed "super-" so areas never collide. Mobile first (390px), no horizontal scroll. */

/* ----- shared layout ----- */
.super-stack { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.super-platform { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.super-meta { margin: 0; }
.super-slot:empty { display: none; }

/* Two columns on wide screens: AI on the left, e-mail and sign-in on the right. */
.super-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.super-col { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.super-col > .card + .card { margin-top: 0; }
@media (min-width: 960px) {
  .super-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ----- platform panels ----- */
.super-panel .card-title { margin-bottom: var(--space-2); }
.super-intro { margin: 0 0 var(--space-4); font-size: 14px; line-height: 1.5; }
.super-form { gap: var(--space-4); }
.super-form .field { margin-bottom: 0; }
.super-actions { gap: var(--space-2); }
.super-actions .btn { flex: 0 1 auto; }
.super-form-error { margin: 0; }

.super-key {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.super-subtitle { margin: 0 0 var(--space-2); font-size: 16px; font-weight: 700; }
.super-key-form { display: flex; flex-direction: column; gap: var(--space-3); }
.super-key-form .field { margin-bottom: 0; }
.super-key-status {
  display: flex; align-items: flex-start; gap: var(--space-2);
  margin: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.super-key-status.super-key-set { background: var(--accent-tint); border-color: var(--accent-border); color: var(--accent-strong); }
.super-key-icon { display: inline-flex; flex: none; margin-top: 2px; }
.super-test-result { margin-top: var(--space-3); }
.super-test-result:empty { display: none; }
.super-channels .choices { gap: var(--space-2); }
.super-channels .choice { cursor: default; }

/* ----- users and audit: controls ----- */
.super-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--space-3); }
.super-controls .field { margin-bottom: var(--space-3); }
@media (min-width: 640px) {
  .super-controls { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}
.super-count { margin: 0; }
.super-users-status:empty { display: none; }

/* ----- tables ----- */
.super-table .table td { vertical-align: middle; }
.super-user { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; min-width: 0; text-align: left; }
.super-user-name { font-weight: 600; overflow-wrap: anywhere; }
.super-role-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.super-role-select { min-width: 160px; width: auto; max-width: 100%; }
.super-role-hint { display: block; max-width: 22ch; }
.super-code { font-family: var(--mono); font-size: 12px; color: var(--text-secondary); overflow-wrap: anywhere; }
a.super-code { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.super-action, .super-entity { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; text-align: left; }
.super-action-label, .super-entity-name { font-weight: 600; }
.super-when { white-space: nowrap; }
.super-detail { min-width: 0; text-align: left; }
.super-detail > summary {
  display: inline-flex; align-items: center;
  min-height: var(--tap);
  font-size: 13px; font-weight: 600; color: var(--accent-strong); cursor: pointer;
}
.super-detail-body {
  margin-top: var(--space-1);
  max-height: 260px; overflow: auto;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* On phones the table turns into stacked cards (app.css): let long cells use the full width. */
@media (max-width: 639px) {
  .super-table .table td { align-items: center; }
  .super-table .table td.super-detail-col { align-items: flex-start; flex-direction: column; text-align: left; }
  .super-table .table td.super-detail-col::before { margin-bottom: 2px; }
  .super-table .super-detail, .super-table .super-detail-body { width: 100%; }
  .super-role-cell { align-items: flex-end; }
  .super-role-hint { text-align: right; max-width: none; }
  .super-user { justify-content: flex-end; }
}
