.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.roles-admin { max-width: 1320px; margin: auto; color: #242b38; min-width: 0; }
.roles-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.roles-heading h1 { margin: 8px 0; font-size: 32px; font-weight: 600; }
.roles-heading p:last-child { margin: 0; color: #6b7280; font-size: 14px; }
.roles-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.roles-stats > div { background: #fff; padding: 18px 20px; border-radius: 8px; border-left: 3px solid #ddff75; }
.roles-stats > div:nth-child(2) { border-color: #ed0765; }
.roles-stats > div:nth-child(3) { border-color: #8ed1c2; }
.roles-stats small { display: block; color: #788392; font-size: 11px; letter-spacing: 1px; }
.roles-stats b { display: block; margin-top: 7px; font-size: 25px; }
.roles-feedback { padding: 12px; border-radius: 6px; background: #eaf5d5; font-size: 13px; }
.roles-feedback.error { background: #ffe8f1; color: #9f124b; }
.roles-layout { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(0, 1.7fr); gap: 18px; align-items: start; min-width: 0; }
.roles-directory, .role-editor { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 1px 3px #242b3810; min-width: 0; }
.roles-list-tools { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }
.roles-list-tools label { display: block; width: 100%; font-size: 12px; color: #6b7280; }
.roles-list-tools input { display: block; width: 100%; box-sizing: border-box; margin-top: 7px; padding: 12px; border: 1px solid #dce0e5; border-radius: 7px; }
.roles-list-tools strong { white-space: nowrap; font-size: 12px; color: #788392; }
.role-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; width: 100%; box-sizing: border-box; padding: 14px 12px; border: 0; border-bottom: 1px solid #e9ebef; background: #fff; text-align: left; color: #242b38; cursor: pointer; }
.role-row:hover, .role-row.selected { background: #f4f8e8; }
.role-row:focus-visible, .select-all:focus-visible, .roles-list-tools input:focus-visible, .editor-actions button:focus-visible, #new-role-dialog button:focus-visible { outline: 3px solid #8ed1c2; outline-offset: 2px; }
.role-row:disabled, button:disabled, input:disabled { opacity: .55; cursor: not-allowed; }
.role-row strong { overflow-wrap: anywhere; }
.role-row small, .role-row em { color: #788392; }
.role-row em { grid-column: 1 / -1; font-size: 11px; font-style: normal; }
.role-badge { display: inline-block; padding: 3px 7px; border-radius: 99px; background: #eaf5d5; font-size: 11px; white-space: nowrap; }
.role-badge.built-in { background: #e7edf5; }
.editor-heading { display: flex; align-items: center; gap: 10px; }
.editor-heading h2 { margin: 0; overflow-wrap: anywhere; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.permission-grid fieldset { min-width: 0; padding: 14px; border: 1px solid #e9ebef; border-radius: 8px; }
.permission-grid legend { padding: 0 5px; font-weight: 600; }
.select-all { float: right; border: 0; background: transparent; color: #9f124b; cursor: pointer; font-size: 12px; }
.permission-grid label { display: grid; grid-template-columns: auto 1fr; gap: 5px 8px; padding: 10px 0; border-top: 1px solid #f0f1f3; }
.permission-grid label:focus-within { outline: 2px solid #8ed1c2; outline-offset: 2px; border-radius: 3px; }
.permission-grid label span { font-size: 13px; }
.permission-grid label small { grid-column: 2; color: #788392; font-size: 11px; }
.editor-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.role-empty, .editor-empty { color: #788392; }
.role-skeleton { height: 62px; margin: 8px 0; border-radius: 6px; background: #f0f2f4; }
#new-role-dialog { border: 0; border-radius: 10px; padding: 0; box-shadow: 0 12px 50px #242b3840; max-width: min(440px, calc(100vw - 30px)); }
#new-role-dialog .dialog-body { position: relative; padding: 25px; }
#new-role-dialog .dialog-close { position: absolute; top: 12px; right: 12px; border: 0; background: transparent; font-size: 24px; cursor: pointer; }
#new-role-dialog .dialog-body label { display: block; color: #6b7280; font-size: 13px; }
#new-role-dialog .dialog-body input { display: block; width: 100%; box-sizing: border-box; margin-top: 7px; padding: 11px; border: 1px solid #dce0e5; border-radius: 7px; }
#new-role-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@media (max-width: 850px) { .roles-layout { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .roles-heading { align-items: flex-start; flex-direction: column; } .roles-heading h1 { font-size: 27px; } .roles-stats, .permission-grid { grid-template-columns: 1fr; } .roles-list-tools { align-items: start; flex-direction: column; } .roles-directory, .role-editor { padding: 15px; } .roles-heading .pink-button { width: 100%; } .editor-actions { flex-direction: column; } }
