/* ══════════════════════════════════════════════════════════════════════════════
   ShiftHR — Administration
   ──────────────────────────────────────────────────────────────────────────────
   Workspace Control's settings stack, member table, inline edit, action menus, add form,
   toggle rows, and admin-specific onboarding management UI.
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Workspace Control's profile settings (phase 3): each a kit Card; this is the stack and the details list ── */
.admin-settings { display: grid; gap: var(--space-5); }
.admin-details { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: .875rem; }
.admin-details dt { font-weight: 600; color: var(--color-neutral-700); }
.admin-details dd { margin: 0; color: var(--color-neutral-700); }

/* ── Plan and seats: the plan change card's one choice (S2): its name with the price badge, what it adds, its act ── */
.plan-choice { display: grid; justify-items: start; gap: var(--space-3); margin: var(--space-4) 0; }
.plan-choice-name { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: 1rem; font-weight: 600; color: var(--color-neutral-900); }
.plan-choice-adds { margin: 0; padding-left: var(--space-5); font-size: .875rem; color: var(--color-neutral-700); }

/* ── Admin Section ─────────────────────────────────────────────────────────── */
.admin-section { margin-bottom: 32px; }
.admin-subsection { margin-top: 24px; }
.admin-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.admin-section-header h2 { font-size: 1.2rem; font-weight: 700; }

/* ── Admin Add Form ────────────────────────────────────────────────────────── */
.admin-add-form {
    background: var(--color-surface); border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-md); padding: 20px; margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.admin-add-form h3 { font-size: 1rem; margin-bottom: 14px; }
/* The invite is a kit FormDialog (Lane MB, #1247): its step count in the footer's start, its add at the table's foot. */
.member-add-step { color: var(--color-neutral-600); font-size: var(--text-sm); }
.member-add-act { margin-top: var(--space-3); }

/* ── The Members table ─────────────────────────────────────────────────────── */
/* The table is the kit's DataGrid and its row menu a kit Popover of MenuItems (#1040): the grid
   lifts its own clip and stacking while a menu is open (the #711 / #965 halves, now the kit's). */
/* A retired seat's cells are dimmed, never its actions cell: opacity on the row would trap the open
   menu in the row's stacking context, half transparent under the later rows (#1040). */
.row-deactivated > td:not([data-col="actions"]) { opacity: .5; }
/* #1035: an invited member's invite state and Resend, in their one row's Invite cell. */
.member-invite-state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* The search and the filters above the table (Lane MB, #1247): one line, wrapping on a narrow page; the search takes the room. */
.member-table-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-3); }
.member-table-tools > :first-child { flex: 1 1 16rem; max-width: 28rem; }
/* "Showing n of N" and Show more, at the table's foot. */
.member-table-more { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-2); color: var(--color-neutral-600); font-size: var(--text-sm); }

/* ── A member's record (CB-2 (b), CB-3 (a)) ────────────────────────────────── */
.member-record-contacts { margin-top: var(--space-4); }
.member-record-contacts h3 { margin: 0 0 var(--space-2); font-size: 1rem; color: var(--color-neutral-900); }
.emergency-contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.emergency-contact-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); color: var(--color-neutral-900); }
.emergency-contact-phone { font-variant-numeric: tabular-nums; }

/* Members' Manage locations (CBA-L (a), MB-1 (a)): one row per place, its acts at the end. */
.work-location-heading { margin: var(--space-4) 0 var(--space-2); font-size: 1rem; color: var(--color-neutral-900); }
.work-location-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.work-location-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); color: var(--color-neutral-900); }
.work-location-actions { display: inline-flex; gap: var(--space-2); }

/* ── Inline Edit ───────────────────────────────────────────────────────────── */
.inline-edit-backdrop {
    position: fixed; inset: 0; z-index: 80;
}
.inline-edit {
    position: relative; z-index: 81;
    display: inline-flex; align-items: center; gap: 4px;
}

.action-cell { position: relative; }

/* ── Admin Toggle Row ──────────────────────────────────────────────────────── */
.admin-toggle-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.admin-toggle-label {
    flex: 1;
    cursor: pointer;
}

.admin-toggle-label strong {
    display: block;
    font-size: .85rem;
    color: var(--color-neutral-900);
    margin-bottom: 2px;
}

.admin-toggle-hint {
    display: block;
    font-size: .78rem;
    color: var(--color-neutral-500);
    line-height: 1.4;
}

/* Join-code card (#728) — view/regenerate/disable the workspace self-join code. */
.admin-actions-row { display: flex; gap: var(--space-3, 12px); margin-top: var(--space-3, 12px); }
.join-code-display { font-family: var(--font-mono); font-size: 1.05rem; letter-spacing: .08em; font-weight: 600; }

/* ── Access pages (#955): the Roles catalogue + the Access grants surface ─── */
/* The former access-control-* / delegation-* blocks left with the matrix page; errors and
   saves now ride the kit Banner / Toast, so nothing here styles a refusal. */
.access-catalogue {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

.access-bundle-desc {
    margin: 0 0 var(--space-2);
    font-size: .875rem;
    line-height: 1.5;
    color: var(--color-neutral-700);
}

.access-bundle-note {
    margin: 0 0 var(--space-2);
    font-size: .8rem;
    line-height: 1.45;
    color: var(--color-neutral-500);
}

.access-capability-list {
    margin: 0;
    padding-left: 18px;
    font-size: .85rem;
    line-height: 1.6;
    color: var(--color-neutral-700);
}

.access-grants {
    display: grid;
    gap: var(--space-4);
}

.access-tier-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    font-size: .9rem;
    color: var(--color-neutral-700);
}

.access-grants-table td { vertical-align: top; }
/* RA (a): a bundle's own text under its name (the card, the grants rows, the chosen bundle). */
.access-bundle-detail { margin: var(--space-2) 0 var(--space-3); }
.access-bundle-reach { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.access-row-actions { text-align: right; white-space: nowrap; }
.access-grant-off td { color: var(--color-neutral-500); }

.access-grant-form {
    display: grid;
    gap: var(--space-3);
    max-width: 560px;
}

.access-form-actions { display: flex; gap: var(--space-3); }

/* ── Rule messages inside a kit Banner (#942): one member-rule result per line. ── */
.rule-list {
    margin: 0;
    padding-left: var(--space-5);
}

.rule-list li + li {
    margin-top: var(--space-1);
}
