/* ===== Users on a phone · directory, roles, groups and access ===== */

/* the pane runs with the page rather than scrolling inside itself */
#tab-users .workspace-pane { overflow: visible; padding-right: 0; }
#tab-users .filter-row { flex-wrap: wrap; gap: 0.5rem; }
#tab-users .filter-row input[type="text"] { flex: 1 1 100%; min-width: 0; min-height: var(--touch); }
#tab-users .filter-row select,
#tab-users .filter-row button { min-height: var(--touch); }


/* ─── List tables · lead card rows (workspace.css), the name on top and its facts wrapped under it ─── */

/* Directory · username leads with its role and state beside, email, worker and shift under */
#users-tbody > tr > td:nth-child(1) { order: 1; flex: 1 1 40%; font-size: 0.9rem; font-weight: 600; color: var(--text); }
#users-tbody > tr > td:nth-child(4) { order: 2; font-weight: 600; color: var(--text-sub); }
#users-tbody > tr > td:nth-child(6) { order: 3; }
#users-tbody > tr > td:nth-child(2) { overflow-wrap: anywhere; }
#users-tbody > tr > td:nth-child(3)::before,
#users-tbody > tr > td:nth-child(5)::before { content: "· "; color: var(--text-faint); }
#users-tbody > tr > td:nth-child(7) { order: 5; flex: 1 1 100%; font-size: 0.75rem; color: var(--text-faint); }
#users-tbody > tr > td:nth-child(7)::before { content: "Last in "; }

/* Roles · the name leads, how many routes it reaches rides at the end */
#roles-tbody > tr > td:nth-child(2) { order: 1; flex: 1 1 60%; font-size: 0.9rem; font-weight: 600; color: var(--text); }
#roles-tbody > tr > td:nth-child(3) { margin-left: auto; font-variant-numeric: tabular-nums; }
#roles-tbody > tr > td:nth-child(3)::after { content: " routes"; }

/* Groups · the name leads, its members wrap under, the list count at the end */
#groups-tbody > tr > td:nth-child(1) { order: 1; flex: 1 1 60%; font-size: 0.9rem; font-weight: 600; color: var(--text); }
#groups-tbody > tr > td:nth-child(2) { order: 5; flex: 1 1 100%; }
#groups-tbody > tr > td:nth-child(3) { order: 2; margin-left: auto; }
#groups-tbody > tr > td:nth-child(3)::after { content: " lists"; }


/* ─── Access · the level ladder spans the width, every rung and tick a thumb target ─── */
.perm-pane-head { gap: 0.6rem; }
.perm-pane-head .perm-level { flex: 1 1 100%; }
.perm-level { display: flex; }
.perm-level-btn { flex: 1; min-height: var(--touch); padding: 0 0.5rem; font-size: 0.85rem; }
.perm-row { min-height: 2.5rem; }
.perm-row input[type="checkbox"],
.perm-api-table input[type="checkbox"] { width: 22px; height: 22px; }
/* the methods keep their columns and scroll sideways, the group's name stays put beside them */
.perm-api-table tbody tr { height: var(--touch); }
.perm-api-table td:first-child,
.perm-api-table th:first-child { position: sticky; left: 0; z-index: var(--z-raise-1); background: var(--surface); white-space: normal; min-width: 9rem; }
/* a compare cell opens that role on that tab, so it's a thumb target too */
.perm-compare-cell { min-height: 2.25rem; padding: 0 0.5rem; }
.perm-compare-table td:first-child,
.perm-compare-table th:first-child { position: sticky; left: 0; z-index: var(--z-raise-1); background: var(--surface); }
/* the check-a-request pair shares a line, method narrow and path wide */
#users-inspector .perm-check { flex-wrap: wrap; }


/* ─── Panel · the selected user, role or group stacked under its list, one field per line ─── */
#tab-users .workspace-panel-body { overflow: visible; max-height: none; }
#tab-users .workspace-panel .tab-btn { min-height: var(--touch); }
#tab-users .workspace-panel .form-grid { grid-template-columns: minmax(0, 1fr); }
