/* German Dominion - Staff access -> Roles & permissions (2026-08-24).
   Scoped to this feature's own ids/classes. Colours come from the page's
   existing custom properties with literal fallbacks, so the panel keeps
   working if a variable is ever renamed in the shared stylesheet. */

/* ---- sub-navigation inside the Staff access tab ------------------------- */
.access-subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--bone-18, rgba(242,246,239,0.18));
  padding-bottom: 12px;
}
.access-subnav .access-sub-btn {
  background: transparent;
  border: 1px solid var(--bone-18, rgba(242,246,239,0.18));
  border-radius: 999px;
  color: var(--bone-62, rgba(242,246,239,0.62));
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 7px 16px;
}
.access-subnav .access-sub-btn:hover { color: var(--bone, #f2f6ef); }
.access-subnav .access-sub-btn.active {
  background: var(--bone, #f2f6ef);
  border-color: var(--bone, #f2f6ef);
  color: var(--bg-0, #040706);
}

/* ---- the Roles cell on the administrators table ------------------------- */
.access-role-cell { min-width: 190px; }
.access-role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 7px;
}
.access-role-chip {
  font-size: 12px;
  color: var(--bone, #f2f6ef);
  border: 1px solid var(--bone-18, rgba(242,246,239,0.18));
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.access-role-chip.is-none { color: var(--bone-62, rgba(242,246,239,0.62)); }
.access-roles-btn { font-size: 12px; padding: 5px 11px; }

/* ---- the roles picker on the Add-a-staff-member form -------------------- */
.access-add-roles { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 12px 0 4px; }
.access-add-roles-label { font-size: 12px; color: var(--bone-62, rgba(242,246,239,0.62)); }
.access-add-roles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  flex: 1 1 320px;
  min-width: 0;
}
.access-add-roles-grid .roles-check { flex: 0 0 auto; }

/* The per-role section count beside a role checkbox. */
.roles-lock-note {
  flex: none;
  font-size: 11px;
  color: var(--bone-62, rgba(242,246,239,0.62));
}

/* ---- roles layout ------------------------------------------------------- */
.roles-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .roles-layout { grid-template-columns: minmax(0, 1fr); }
}

.roles-list { display: flex; flex-direction: column; gap: 8px; }
.roles-item {
  position: relative;
  text-align: left;
  background: transparent;
  border: 1px solid var(--bone-18, rgba(242,246,239,0.18));
  border-radius: 10px;
  color: var(--bone, #f2f6ef);
  cursor: pointer;
  font: inherit;
  padding: 11px 14px;
}
.roles-item:hover { border-color: var(--bone-34, rgba(242,246,239,0.34)); }
.roles-item.active {
  border-color: var(--bone, #f2f6ef);
  background: var(--bone-08, rgba(242,246,239,0.08));
}
.roles-item-name { display: block; font-size: 14px; }
.roles-item-meta {
  display: block;
  font-size: 12px;
  color: var(--bone-62, rgba(242,246,239,0.62));
  margin-top: 3px;
}
.roles-item-tag {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone-62, rgba(242,246,239,0.62));
}

/* ---- the editor --------------------------------------------------------- */
.roles-editor-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.roles-field { display: flex; flex-direction: column; gap: 5px; }
.roles-field span { font-size: 12px; color: var(--bone-62, rgba(242,246,239,0.62)); }
.roles-field input { font: inherit; }
#roles-emoji { width: 76px; text-align: center; }
#roles-name { min-width: 190px; }

.roles-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 9px 16px;
  margin: 6px 0 18px;
}
.roles-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--bone, #f2f6ef);
  cursor: pointer;
  user-select: none;
}
.roles-check input { width: 16px; height: 16px; cursor: pointer; flex: none; }
.roles-check.is-locked { color: var(--bone-62, rgba(242,246,239,0.62)); cursor: not-allowed; }
.roles-check.is-locked input { cursor: not-allowed; }
.roles-check-label { flex: 1 1 auto; min-width: 0; }
.roles-lock,
.access-section-lock {
  flex: none;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bone-62, rgba(242,246,239,0.62));
  border: 1px solid var(--bone-18, rgba(242,246,239,0.18));
  border-radius: 999px;
  padding: 1px 7px;
}
/* The per-member editor in admin.js reuses the lock pill; give its rows the
   same greyed treatment so a locked row reads the same in both places. */
.access-section-check.is-locked { color: var(--bone-62, rgba(242,246,239,0.62)); cursor: not-allowed; }
.access-section-check.is-locked input { cursor: not-allowed; }

.roles-presets { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.roles-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.roles-status { font-size: 12px; color: var(--bone-62, rgba(242,246,239,0.62)); }
.roles-owner-note {
  font-size: 13px;
  color: var(--bone-62, rgba(242,246,239,0.62));
  border-left: 2px solid var(--bone-34, rgba(242,246,239,0.34));
  padding-left: 12px;
  margin: 0 0 14px;
}
