/* Gängeviertel Selfservice — admin screens (wave 2)
   Groups, members, requests, imports, people and the audit log. Page-specific
   rules only; the system (tokens, type, buttons, cards, rows, focus) lives in
   design-system.css. One accent, one radius family, one hairline. */

/* ================================================================== */
/* Group members — an operator workspace for one group                */
/* ================================================================== */

/* The identity header reads like the member-facing group page: category as an
   eyebrow, the name as the hero, state badges under it, description last. */
.page-group-members .page-head { align-items: flex-start; }
.page-group-members .page-head-text { max-width: 62ch; }
.page-group-members .group-cat {
  display: inline-block;
  padding: 0;
  margin: 0 0 var(--s-2);
  background: transparent;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.page-group-members .group-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
}
.page-group-members .page-head .lede { margin-top: var(--s-4); }

/* Members are the centre of the page: one row per person, the name and role
   first, contact and expiry as quiet meta, actions pinned to the right. */
.page-group-members .member-list .row {
  gap: var(--s-3);
  padding-block: var(--s-4);
}
.page-group-members .member-list .row-main { gap: 0.05rem; }
.page-group-members .member-row .row-title { gap: var(--s-2); }
.page-group-members .member-row .row-title strong { font-size: 1rem; }
/* Expiry reads as a distinct line: tabular figures so dates align down the list. */
.page-group-members .member-expiry {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.page-group-members .member-expiry svg { width: 16px; height: 16px; flex: none; }

/* The select-all row sits flush under the filter, above the first rule. */
.page-group-members .bulk-head {
  margin-top: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.page-group-members .bulk-head .bulk-select-all { min-height: 1.5rem; margin: 0; }

/* The floating bulk bar is anchored to the selection: one red left edge ties it
   to the system accent while the surface + shadow keep it above the list. */
.page-group-members .bulk-bar { border-left: 3px solid var(--accent); }
.page-group-members .bulk-count {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Requests: open and closed read as two quiet sub-lists under one heading. */
.page-group-members .requests-subhead {
  margin: var(--s-4) 0 var(--s-2);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.page-group-members .requests-subhead:first-of-type { margin-top: 0; }

/* The add-a-person search and its candidates mirror the members list. */
.page-group-members .add-search .rows .row { gap: var(--s-3); padding-block: var(--s-3); }

/* Group details and settings stay collapsed panels; the danger zone reads last
   and clearly destructive (border already set in app.css). */

/* ================================================================== */
/* Group import — discovery table, defaults, results                  */
/* ================================================================== */

.page-group-import .page-head { align-items: flex-start; }

/* The search + defaults flow as one column of panels; the discovery table is
   the main surface. A full-width checkbox column stays tight in card mode. */
.page-group-import .search-form {
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.page-group-import .import-table td:first-child {
  width: 2.75rem;
  text-align: center;
}
.page-group-import .import-table td:first-child input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--accent);
}
.page-group-import .import-table .cell-sub { line-height: 1.45; }

/* The primary action is the one filled button; the results list is a record of
   what happened, not the job itself, so it stays compact. */
.page-group-import .import-results { margin-bottom: var(--s-2); }
.page-group-import .import-results .row { gap: var(--s-3); padding-block: var(--s-3); }
.page-group-import .import-results .row-main { gap: 0.05rem; }

/* ================================================================== */
/* Member import result — a legible outcome table                     */
/* ================================================================== */

.page-import .page-head { align-items: flex-start; }
.page-import .form-actions { margin-top: var(--s-4); }
/* Row numbers are meta: tabular, quiet, and never wrap, so the outcome column
   starts on the same line for every row. */
.page-import .import-result-table td:first-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ================================================================== */
/* People + person — a directory, one diagnostic story                */
/* ================================================================== */

/* The directory rows stay light: name and handle, a single quiet action. */
.page-people .rows .row { gap: var(--s-3); padding-block: var(--s-4); }
.page-people .rows .row-main { gap: 0.05rem; }
.page-people .people-count { color: var(--muted); font-size: 0.875rem; }

/* The person page opens with identity (avatar, name, contact) and then tells
   one story: groups, then requests, then the raw Authentik data. */
.page-person .page-head { align-items: center; }
.page-person .identity {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-width: 0;
}
.page-person .identity .avatar-lg {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.4rem;
}
.page-person .identity h1 { margin: 0; }
.page-person .identity .lede { margin: var(--s-1) 0 0; }
.page-person .rows .row { gap: var(--s-3); padding-block: var(--s-3); }
.page-person .rows .row-main { gap: 0.05rem; }
.page-person .rows .row-title { gap: var(--s-2); }

/* Raw Authentik groups: managed rows carry their role and drift; the rest are
   plain names. A tight list reads better than long pills that wrap oddly. */
.page-person .authentik-managed .row { gap: var(--s-3); padding-block: var(--s-3); }
.page-person .authentik-managed .row-title { gap: var(--s-2); }
.page-person .authentik-managed .row-sub { display: block; }
.page-person .authentik-other { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ================================================================== */
/* Audit — a dense, readable event log                                 */
/* ================================================================== */

/* Time is meta: tabular figures so the column aligns, nowrap so it never folds. */
.page-audit .audit-table .audit-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* The action is the event, not a status: plain text, not a wall of identical
   grey pills. Group and details stay quiet so the actor and action lead. */
.page-audit .audit-table .audit-action { font-weight: 600; }
.page-audit .audit-table .cell-sub { line-height: 1.45; }
/* At wide widths the action filter holds the longest sentence-case options
   ("Person hinzugefügt", "Erinnerung an alte Anfragen"). Give that column the
   extra room so the selected value is not clipped; narrower widths keep the
   auto-fit grid from app.css. */
@media (min-width: 1000px) {
  .page-audit .filter-grid {
    grid-template-columns: minmax(12rem, 1.4fr) repeat(4, minmax(8rem, 1fr));
  }
}
/* Filters are one control surface; the export is the single quiet action at the
   far end of that surface. */
.page-audit .audit-filters .filter-actions {
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}
.page-audit .audit-filters .filter-export { margin-inline-start: auto; }

/* Compact screens: the member rows and directory rows keep their 44px targets
   and never push the name under the checkbox. */
@media (max-width: 560px) {
  .page-group-members .member-list .row,
  .page-people .rows .row,
  .page-person .rows .row { gap: var(--s-3); }
  .page-group-members .member-expiry { font-size: 0.8125rem; }
}
