/* ── Access-group editor: the page around the two lists ────────────────────
   Three questions down the page — що це за область (і що вона відкриває зараз),
   що вона покриває, хто нею користується. The gap is the panel gap the rest of
   the app uses; `.actions` inside brings its own top margin. */
.area-editor { display: flex; flex-direction: column; gap: 16px; }
.area-editor > form { display: flex; flex-direction: column; gap: 16px; }
.area-editor .actions { margin: 0; }

/* The readout under the name: what the *stored* composition adds up to. The
   checkbox lists show one ticked row; these numbers show the dozen units and the
   thousand cards behind it (accounts/services/access_groups.py:reach). */
/* Said out loud, because the lists below are live and these numbers are not: they
   change on save, which is also when the page reloads. Worn with `.eyebrow`, which
   is already this typography — only the rule above it and the spacing are new. */
.reach-caption {
  margin: 6px 0 0; padding-top: 16px; border-top: 1px solid var(--border);
  letter-spacing: 1.6px;
}
.reach {
  display: grid; gap: 14px 24px;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  margin-top: 14px;
}
.reach-cell { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
/* The cell labels wear `.stat-head` — the same mono caption the dashboard tiles
   use, and this readout is the same kind of instrument. */
.reach-num {
  font-family: var(--font-mono); font-weight: 700; font-size: 27px; line-height: 1;
  letter-spacing: -1px; color: var(--text-strong);
}
.reach-sub { font-size: 12px; color: var(--muted); line-height: 1.35; }
.reach-warn {
  display: flex; align-items: center; gap: 8px; margin: 14px 0 0;
  font-size: 12.5px; color: var(--warn);
}
.reach-warn .icon { width: 15px; height: 15px; flex: none; }

/* ── Access-group editor: who holds the area ───────────────────────────────
   A list, not a table: a handful of accounts, and per row only the login, the
   person behind it, the role, and — rarely — that this area decides nothing for
   that login. Four table headers over three rows promised columns to scan where
   three of them repeated one value. */
.holder-add {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 4px;
}
/* The shrink half of that `flex` is what keeps a «логін — звання Прізвище Ім'я
   Батькович» option from pushing the page past a 390px phone, and what lets it
   happen is `min-width: 0` — stated for every control at once in
   `components/forms.css`, not here. */
.holder-add select { flex: 1 1 240px; width: auto; max-width: 380px; }
.holder-list { list-style: none; margin: 0; padding: 0; }
.holder-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: var(--radius);
}
.holder-row:hover { background: var(--panel-2); }
.holder-list > li + li { border-top: 1px solid var(--border); }
.holder-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: flex-end; }
.holder-drop { margin: 0; }
/* Quiet until wanted: taking access away is one click, and a red box per row makes
   the list read as a list of problems. */
.holder-drop .btn { opacity: .55; }
.holder-row:hover .holder-drop .btn,
.holder-drop .btn:focus-visible { opacity: 1; }
.holder-empty { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  /* Одне поле на рядок: the select and its «Надати доступ» button side by side left
     the select ~180px wide for a «логін — ПІБ» option nobody could then read. Both
     take the row, in the order they are answered — the button being `.btn-block`'s
     rule, which cannot be put on the markup because it holds only at this width. */
  .holder-add select { flex: 1 1 100%; max-width: none; }
  .holder-add .btn { width: 100%; justify-content: center; }

  /* Badges drop to a second line under the identity; the remove button stays on
     the first one, beside the login it belongs to (auto-placement would push it
     below the full-width badge row instead — hence the named areas). */
  .holder-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'who drop' 'tags tags';
    row-gap: 6px;
  }
  .holder-who { grid-area: who; }
  .holder-tags { grid-area: tags; justify-content: flex-start; }
  .holder-drop { grid-area: drop; align-self: start; }
}
