/* Settings: the organisation, people and roles, tokens, the audit trail (web/settingspages.py).
   Tokens only; both themes work. See DESIGN.md, "Settings and roles". */

/* The sections of Settings: tabs in a bordered strip above the page's panels. */
.subnav { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); min-width: 0; }
.subnav > .tabs { border-bottom: 0; }

/* A role. Owner filled with the accent, admin and developer outlined (admin stronger), viewer muted. */
.chip.role-chip { --c: var(--ink-2); --cb: transparent; border-color: var(--line-strong); }
.chip.role-chip.is-owner { --c: var(--accent); --cb: var(--accent-bg); border-color: transparent; }
.chip.role-chip.is-admin { --c: var(--ink); border-color: var(--ink-3); }
.chip.role-chip.is-viewer { --c: var(--ink-3); --cb: var(--muted-bg); border-color: transparent; }

/* How many people hold each role: one track, a segment per role sized by its people, and a key. */
.rolebar { display: grid; gap: var(--sp-3); min-width: 0; }
.rolebar-track { display: flex; gap: 2px; height: 8px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.rolebar-track > span { min-width: 6px; }
.rolebar-key { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); color: var(--ink-2); font-size: var(--fs-2); }
.rolebar-key > span { display: inline-flex; align-items: center; gap: var(--sp-3); white-space: nowrap; }
.rolebar-key > span.is-zero { color: var(--ink-3); }
.rolebar-key b { font: 600 var(--fs-2)/1 var(--font-mono); color: var(--ink); }
.rolebar-key > span.is-zero b { color: var(--ink-3); font-weight: 500; }
.rolebar-key i { width: 10px; height: 8px; border-radius: 2px; }
.rolebar .is-owner { background: var(--accent); }
.rolebar .is-admin { background: var(--ink-2); }
.rolebar .is-developer { background: var(--ink-3); opacity: .65; }
.rolebar .is-viewer { background: var(--line-strong); }

/* People: the role select and its Save button stay on one line. */
.role-form { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: nowrap; min-width: 0; }
.role-form > .select { min-width: 0; max-width: 8.5rem; }
.tbl.people tr.is-you > td { background: var(--surface-2); }

/* The permission matrix: one mark per cell, the condition under it. The reader's own role column is tinted. */
.perm { table-layout: fixed; }
.perm col.role-col { width: 6.5rem; }
.perm th.role, .perm td.cell { text-align: center; }
.perm th.role { white-space: normal; line-height: 1.25; }
.perm th.role .role-n { display: block; color: var(--ink-3); font: 500 var(--fs-1)/1.3 var(--font-mono); }
.perm th.role.is-yours, .perm td.cell.is-yours { background: var(--accent-bg); }
.perm td.cell { padding-left: var(--sp-2); padding-right: var(--sp-2); }
.mk { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 3px; font: 600 11px/1 var(--font-mono); vertical-align: middle; }
.mk.is-yes { background: var(--win); color: var(--surface); }
.mk.is-if { background: repeating-linear-gradient(135deg, var(--warn-bg) 0 4px, var(--surface) 4px 7px); box-shadow: inset 0 0 0 1px var(--warn); color: var(--warn); }
.mk.is-no { box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-3); }
.perm .if { display: block; color: var(--ink-3); font-size: var(--fs-1); line-height: 1.25; white-space: normal; }
.perm td.sc { font: 400 var(--fs-1)/1.4 var(--font-mono); color: var(--ink-2); white-space: normal; overflow-wrap: anywhere; }
.perm td.what { white-space: normal; }
.perm td.what > .sub { display: block; color: var(--ink-3); font-size: var(--fs-1); }
.perm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5); color: var(--ink-2); font-size: var(--fs-2); }
.perm-key { display: inline-flex; align-items: center; gap: var(--sp-3); }

/* Tokens: the expiry field is short. */
.token-days { width: 7rem; }
.tbl.is-list tr.is-muted > td { color: var(--ink-3); }

/* Audit: a dot per action group, and the way a change came in. */
.audit-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.audit-dot.is-people { background: var(--accent); }
.audit-dot.is-tokens { background: var(--feed); }
.audit-dot.is-webhooks { background: var(--read); }
.audit-dot.is-settings { background: var(--warn); }
.audit-dot.is-uploads { background: var(--win); }
.audit-dot.is-statuses { background: var(--write); }
.audit-dot.is-deletions { background: var(--fail); }
.audit-dot.is-signins { background: var(--ink-3); }
.via { font-size: var(--fs-2); }
.via.is-api, .via.is-ci { font-family: var(--font-mono); font-size: var(--fs-1); }
.audit-groups .count-link.is-zero { color: var(--ink-3); }
.audit-groups .count-link.is-zero > b { color: var(--ink-3); font-weight: 500; }
