#rolesPermissionsPanel.admin-page {
  display: block;
  min-height: 0;
  height: 100vh;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

#rolesPermissionsPanel .access-groups-root {
  padding-bottom: 40px;
}

.access-groups-root {
  --ag-ink: #18181b;
  --ag-muted: #66666c;
  --ag-border: #e2e2e5;
  --ag-border-strong: #cfcfd4;
  --ag-subtle: #f6f6f7;
  --ag-surface: #ffffff;
  --ag-brand: #29292d;
  --ag-brand-dark: #111113;
  --ag-brand-soft: #ececef;
  --ag-brand-faint: #f5f5f6;
  --ag-danger: #b83b35;
  --ag-danger-soft: #fbeceb;
  --ag-shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04), 0 7px 20px rgba(24, 24, 27, 0.04);
  --ag-shadow-md: 0 18px 50px rgba(24, 24, 27, 0.09), 0 3px 10px rgba(24, 24, 27, 0.04);
  --ag-ease: cubic-bezier(0.22, 1, 0.36, 1);
  display: grid;
  gap: 20px;
  min-width: 0;
  color: var(--ag-ink);
}

.access-groups-root h2,
.access-groups-root h3,
.access-groups-root h4,
.access-groups-root p {
  margin: 0;
}

.access-groups-root input,
.access-groups-root select,
.access-groups-root textarea {
  box-sizing: border-box;
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--ag-border);
  border-radius: 12px !important;
  padding: 10px 13px;
  color: var(--ag-ink);
  background: #fff;
  font: inherit;
  transition: border-color 180ms var(--ag-ease), box-shadow 180ms var(--ag-ease), background 180ms var(--ag-ease);
}

.access-groups-root textarea {
  min-height: 84px;
  line-height: 1.45;
  resize: vertical;
}

.access-groups-root input:focus,
.access-groups-root select:focus,
.access-groups-root textarea:focus {
  border-color: var(--ag-brand);
  outline: 3px solid rgba(39, 39, 42, 0.14);
  outline-offset: 0;
  box-shadow: 0 0 0 1px rgba(39, 39, 42, 0.08);
}

.access-groups-root input[readonly],
.access-groups-root textarea[readonly] {
  color: #4b4b51;
  background: var(--ag-subtle);
  cursor: default;
}

.ag-page-head,
.ag-page-actions,
.ag-list-head,
.ag-group-item-top,
.ag-group-meta,
.ag-editor-head,
.ag-section-head,
.ag-editor-footer,
.ag-editor-actions,
.ag-danger-zone,
.ag-modal-head,
.ag-modal-actions {
  display: flex;
  align-items: center;
}

.ag-page-head {
  position: relative;
  overflow: hidden;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  padding: 22px 24px;
  border: 1px solid rgba(212, 212, 216, 0.82);
  border-radius: 20px !important;
  background:
    radial-gradient(circle at 88% -30%, rgba(24, 24, 27, 0.08), transparent 40%),
    linear-gradient(135deg, #ffffff 0%, #f5f5f6 100%);
  box-shadow: var(--ag-shadow-sm);
}

.ag-page-copy {
  min-width: 0;
}

.ag-page-copy h2 {
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.ag-page-summary {
  margin-top: 7px !important;
  color: var(--ag-muted);
  max-width: 640px;
  font-size: 14px;
  line-height: 1.5;
}

.ag-page-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 12px;
}

.ag-summary-count,
.ag-count,
.ag-section-count,
.ag-status-dot,
.ag-group-meta,
.ag-field small,
.ag-section-head p,
.ag-danger-zone p {
  color: var(--ag-muted);
  font-size: 12px;
  font-weight: 700;
}

.ag-summary-count {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(39, 39, 42, 0.12);
  border-radius: 999px !important;
  color: var(--ag-brand-dark);
  background: rgba(255, 255, 255, 0.76);
  white-space: nowrap;
}

.ag-module-badge {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 999px !important;
  color: #fff;
  background: var(--ag-brand-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 7px 16px rgba(24, 24, 27, 0.16);
}

.ag-module-badge .ag-icon {
  width: 15px;
  height: 15px;
}

.ag-primary-action,
.ag-secondary-action,
.ag-quiet-action,
.ag-danger-action,
.ag-icon-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px !important;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 180ms var(--ag-ease), border-color 180ms var(--ag-ease), color 180ms var(--ag-ease), transform 180ms var(--ag-ease), box-shadow 180ms var(--ag-ease);
}

.ag-primary-action {
  color: #fff;
  background: linear-gradient(135deg, #343438, var(--ag-brand-dark));
  box-shadow: 0 8px 18px rgba(24, 24, 27, 0.2);
}

.ag-primary-action:hover:not(:disabled) {
  background: var(--ag-brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(24, 24, 27, 0.25);
}

.ag-primary-action:active:not(:disabled),
.ag-secondary-action:active:not(:disabled),
.ag-quiet-action:active:not(:disabled),
.ag-danger-action:active:not(:disabled),
.ag-icon-action:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.ag-secondary-action {
  color: #323236;
  border-color: #d1d1d5;
  background: #fff;
}

.ag-secondary-action:hover:not(:disabled),
.ag-quiet-action:hover:not(:disabled) {
  color: var(--ag-brand-dark);
  border-color: rgba(39, 39, 42, 0.45);
  background: #f3f3f4;
}

.ag-quiet-action {
  color: #55555b;
  background: transparent;
}

.ag-danger-action {
  color: var(--ag-danger);
  background: var(--ag-danger-soft);
}

.ag-danger-action:hover:not(:disabled) {
  background: #f4d5d1;
}

.ag-icon-action {
  width: 44px;
  padding: 0;
  color: #606066;
  background: #fff;
  border-color: var(--ag-border);
}

.ag-icon-action:hover:not(:disabled) {
  color: var(--ag-brand-dark);
  border-color: rgba(39, 39, 42, 0.45);
  background: #f3f3f4;
}

.ag-primary-action:disabled,
.ag-secondary-action:disabled,
.ag-quiet-action:disabled,
.ag-danger-action:disabled,
.ag-icon-action:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.ag-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.ag-workbench {
  display: grid;
  grid-template-columns: minmax(288px, 324px) minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
  align-items: start;
}

.ag-list-panel,
.ag-editor-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ag-border);
  border-radius: 20px !important;
  background: var(--ag-surface);
  box-shadow: var(--ag-shadow-md);
  animation: ag-panel-enter 260ms var(--ag-ease) both;
}

.ag-list-panel {
  display: flex;
  flex-direction: column;
  max-height: min(690px, calc(100vh - 214px));
  position: sticky;
  top: 16px;
}

.ag-list-head {
  justify-content: space-between;
  gap: 12px;
  padding: 17px 17px 12px;
}

.ag-list-head > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ag-list-head h3,
.ag-editor-head h3,
.ag-section-head h4,
.ag-modal-head h3 {
  color: var(--ag-ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
}

.ag-count,
.ag-section-count {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 99px !important;
  color: var(--ag-brand-dark);
  background: var(--ag-brand-soft);
}

.ag-list-head .ag-quiet-action {
  min-height: 34px;
  padding: 0 8px;
}

.ag-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 0 10px;
  border: 1px solid var(--ag-border);
  border-radius: 10px !important;
  color: #77777d;
  background: var(--ag-subtle);
}

.ag-search-field:focus-within {
  border-color: var(--ag-brand);
  outline: 3px solid rgba(39, 39, 42, 0.12);
}

.ag-search-field input {
  min-height: 38px;
  padding: 0;
  border: 0;
  outline: 0 !important;
  background: transparent;
}

.ag-group-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding: 0 9px 11px;
}

.ag-group-item {
  position: relative;
  width: 100%;
  display: grid;
  gap: 9px;
  overflow: hidden;
  padding: 14px 13px 13px 16px;
  border: 1px solid transparent;
  border-radius: 14px !important;
  color: var(--ag-ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 180ms var(--ag-ease), border-color 180ms var(--ag-ease), transform 180ms var(--ag-ease), box-shadow 180ms var(--ag-ease);
}

.ag-group-item:hover {
  border-color: #dedee2;
  background: #f7f7f8;
  transform: translateY(-1px);
}

.ag-group-item.is-selected {
  border-color: #b9b9bf;
  background: linear-gradient(135deg, #f3f3f4, #eaeaed);
  box-shadow: inset 3px 0 0 var(--ag-brand), 0 8px 18px rgba(24, 24, 27, 0.07);
}

.ag-group-item-top {
  justify-content: space-between;
  gap: 10px;
}

.ag-group-item-top strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-status-dot {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #444449;
}

.ag-status-dot::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #27272a;
  content: "";
}

.ag-status-dot.is-disabled {
  color: #77777c;
}

.ag-status-dot.is-disabled::before {
  background: #a1a1a6;
}

.ag-group-scope {
  overflow: hidden;
  color: #606066;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-group-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(130, 150, 154, 0.18);
  padding-top: 8px;
}

.ag-group-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ag-group-meta .ag-icon {
  width: 14px;
  height: 14px;
}

.ag-list-empty,
.ag-editor-empty,
.ag-load-failure,
.ag-loading {
  color: var(--ag-muted);
  text-align: center;
}

.ag-list-empty {
  display: grid;
  gap: 6px;
  padding: 30px 16px;
  font-size: 13px;
  line-height: 1.45;
}

.ag-list-empty strong {
  color: var(--ag-ink);
}

.ag-editor-form {
  display: grid;
  gap: 0;
}

.ag-editor-head {
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 22px;
  border-bottom: 1px solid var(--ag-border);
  background:
    radial-gradient(circle at 96% 0, rgba(24, 24, 27, 0.07), transparent 34%),
    linear-gradient(180deg, #ffffff, #fafafa);
}

.ag-editor-head .eyebrow {
  margin-bottom: 4px;
}

.ag-editor-subtitle {
  max-width: 560px;
  margin-top: 7px !important;
  color: var(--ag-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.ag-editor-head-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.ag-policy-stat {
  min-height: 44px;
  display: grid;
  grid-template-columns: 16px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--ag-border);
  border-radius: 12px !important;
  color: var(--ag-brand-dark);
  background: rgba(255, 255, 255, 0.82);
}

.ag-policy-stat .ag-icon {
  grid-row: 1 / -1;
  width: 16px;
  height: 16px;
}

.ag-policy-stat strong {
  font-size: 13px;
  line-height: 1;
}

.ag-policy-stat small {
  color: var(--ag-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.ag-switch {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #55555b;
  font-size: 13px;
  font-weight: 800;
  user-select: none;
}

.ag-switch input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.ag-switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 99px !important;
  background: #a8a8ae;
  transition: background 160ms ease;
}

.ag-switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  content: "";
  transition: transform 160ms ease;
}

.ag-switch input:checked + .ag-switch-track {
  background: var(--ag-brand);
}

.ag-switch input:checked + .ag-switch-track::after {
  transform: translateX(16px);
}

.ag-switch input:focus-visible + .ag-switch-track {
  outline: 3px solid rgba(39, 39, 42, 0.2);
  outline-offset: 2px;
}

.ag-identity-section,
.ag-section,
.ag-danger-zone {
  padding: 22px 26px;
}

.ag-identity-section {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(250px, 1.25fr);
  gap: 14px;
  border-bottom: 1px solid var(--ag-border);
}

.ag-field {
  display: grid;
  gap: 7px;
}

.ag-field-label,
.ag-level-field legend {
  color: #3f3f44;
  font-size: 12px;
  font-weight: 800;
}

.ag-field small {
  line-height: 1.4;
}

.ag-section {
  border-bottom: 1px solid var(--ag-border);
}

.ag-section-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.ag-section-head > div:first-child {
  display: grid;
  gap: 5px;
}

.ag-section-head p {
  max-width: 530px;
  font-weight: 600;
  line-height: 1.45;
}

.ag-member-search {
  flex: 1 1 260px;
  margin: 0;
}

.ag-member-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ag-member-view {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--ag-border);
  border-radius: 12px !important;
  background: var(--ag-subtle);
}

.ag-member-view-option {
  min-height: 36px;
  border: 0;
  border-radius: 9px !important;
  padding: 0 11px;
  cursor: pointer;
  color: var(--ag-muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  transition: color 180ms var(--ag-ease), background 180ms var(--ag-ease), box-shadow 180ms var(--ag-ease);
}

.ag-member-view-option:hover {
  color: var(--ag-brand-dark);
}

.ag-member-view-option.is-selected {
  color: var(--ag-brand-dark);
  background: #fff;
  box-shadow: 0 2px 8px rgba(16, 38, 33, 0.08);
}

.ag-member-view-option:focus-visible {
  outline: 3px solid rgba(39, 39, 42, 0.16);
  outline-offset: 1px;
}

.ag-member-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 284px;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.ag-member-option {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 64px;
  padding: 10px 11px;
  border: 1px solid var(--ag-border);
  border-radius: 13px !important;
  cursor: pointer;
  background: #fff;
  transition: background 180ms var(--ag-ease), border-color 180ms var(--ag-ease), box-shadow 180ms var(--ag-ease), opacity 150ms ease, transform 150ms ease;
}

.ag-member-option:hover {
  border-color: #bdbdc3;
  box-shadow: var(--ag-shadow-sm);
}

.ag-member-option.is-selected {
  border-color: #b8b8be;
  background: linear-gradient(135deg, #f5f5f6, #ececef);
  box-shadow: inset 3px 0 0 var(--ag-brand);
}

.ag-member-option.is-leaving {
  opacity: 0;
  transform: scale(0.97);
}

.ag-member-option input {
  width: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: var(--ag-brand);
}

.ag-member-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.ag-member-copy strong,
.ag-member-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-member-copy strong {
  color: #343438;
  font-size: 13px;
  line-height: 1.3;
}

.ag-member-copy small,
.ag-member-copy em {
  color: var(--ag-muted);
  font-size: 11px;
  font-style: normal;
}

.ag-member-copy em {
  color: #a15b28;
}

.ag-member-empty {
  grid-column: 1 / -1;
  min-height: 132px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  margin: 0;
  padding: 20px;
  color: var(--ag-muted);
  font-size: 13px;
  text-align: center;
}

.ag-member-empty .ag-icon {
  width: 24px;
  height: 24px;
  color: var(--ag-brand);
}

.ag-member-empty strong {
  color: var(--ag-ink);
}

.ag-scopes-head {
  align-items: flex-start;
}

.ag-scope-list {
  display: grid;
  gap: 12px;
}

.ag-scope-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(220px, 1.25fr) auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ag-border);
  border-radius: 16px !important;
  background: linear-gradient(145deg, #fafafa, #f4f4f5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 180ms var(--ag-ease), box-shadow 180ms var(--ag-ease);
}

.ag-scope-row:focus-within {
  border-color: #b9b9bf;
  box-shadow: 0 8px 24px rgba(24, 24, 27, 0.07);
}

.ag-scope-row .ag-field {
  min-width: 0;
}

.ag-all-scope {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border: 1px dashed #d3d3d7;
  border-radius: 12px !important;
  color: #626268;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.ag-level-field {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ag-level-field legend {
  margin-bottom: 7px;
  padding: 0;
}

.ag-level-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-height: 66px;
}

.ag-level-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  border: 1px solid var(--ag-border);
  border-radius: 12px !important;
  padding: 10px 12px;
  cursor: pointer;
  color: #57575d;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  transition: color 180ms var(--ag-ease), background 180ms var(--ag-ease), border-color 180ms var(--ag-ease), transform 180ms var(--ag-ease), box-shadow 180ms var(--ag-ease);
}

.ag-level-option:hover {
  border-color: #bdbdc3;
  transform: translateY(-1px);
  box-shadow: var(--ag-shadow-sm);
}

.ag-level-option input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.ag-level-option:has(input:checked) {
  border-color: var(--ag-brand);
  color: #fff;
  background: linear-gradient(135deg, #343438, #151518);
  box-shadow: 0 8px 18px rgba(24, 24, 27, 0.18);
}

.ag-level-option:has(input:focus-visible) {
  outline: 3px solid rgba(39, 39, 42, 0.2);
  outline-offset: 2px;
}

.ag-level-option-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ag-level-option-copy strong {
  font-size: 13px;
  line-height: 1.2;
}

.ag-level-option-copy small {
  overflow: hidden;
  color: var(--ag-muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-level-option:has(input:checked) small {
  color: rgba(255, 255, 255, 0.78);
}

.ag-level-preview {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  color: var(--ag-muted);
}

.ag-level-preview-copy {
  font-size: 11px;
  font-weight: 700;
}

.ag-capability-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.ag-capability {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #d8d8dc;
  border-radius: 999px !important;
  color: var(--ag-brand-dark);
  background: #f1f1f3;
  font-size: 10px;
  font-weight: 800;
}

.ag-capability.is-danger {
  border-color: #efd0cc;
  color: var(--ag-danger);
  background: var(--ag-danger-soft);
}

.ag-remove-scope {
  color: #8a4b45;
  background: #fff;
}

.ag-remove-scope:hover:not(:disabled) {
  color: var(--ag-danger);
  border-color: #d89d98;
  background: var(--ag-danger-soft);
}

.ag-scope-empty {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px dashed #d4d4d8;
  border-radius: 12px !important;
  color: var(--ag-muted);
  background: var(--ag-subtle);
  font-size: 13px;
  font-weight: 700;
}

.ag-editor-footer {
  position: sticky;
  z-index: 5;
  bottom: 0;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--ag-border);
  background: rgba(251, 253, 252, 0.92);
  backdrop-filter: blur(12px);
  transition: box-shadow 180ms var(--ag-ease), background 180ms var(--ag-ease);
}

.ag-editor-form.is-dirty .ag-editor-footer {
  background: rgba(244, 250, 248, 0.96);
  box-shadow: 0 -12px 28px rgba(16, 38, 33, 0.07);
}

.ag-editor-actions {
  justify-content: flex-end;
  gap: 8px;
}

.ag-form-status {
  min-height: 17px;
  color: var(--ag-brand-dark);
  font-size: 13px;
  font-weight: 700;
}

.ag-save-feedback {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ag-dirty-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ag-muted);
  font-size: 11px;
  font-weight: 800;
}

.ag-dirty-state::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #9aaba7;
  content: "";
}

.ag-dirty-state.is-dirty {
  color: #8a5a12;
}

.ag-dirty-state.is-dirty::before {
  background: #d58a16;
  box-shadow: 0 0 0 4px rgba(213, 138, 22, 0.12);
}

.ag-save-action {
  min-width: 118px;
}

.ag-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ag-spin 700ms linear infinite;
}

.ag-spinner[hidden] {
  display: none;
}

.ag-form-status.is-error {
  color: var(--ag-danger);
}

.ag-danger-zone {
  justify-content: space-between;
  gap: 18px;
  background: #fffafa;
}

.ag-danger-zone > div {
  display: grid;
  gap: 4px;
}

.ag-danger-zone strong {
  color: #783c37;
  font-size: 13px;
}

.ag-danger-zone p {
  line-height: 1.45;
}

.ag-editor-empty,
.ag-load-failure {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 420px;
  align-content: center;
  padding: 36px;
}

.ag-editor-empty > .ag-icon,
.ag-load-failure > .ag-icon {
  width: 34px;
  height: 34px;
  color: var(--ag-brand);
}

.ag-editor-empty h3,
.ag-load-failure h2 {
  color: var(--ag-ink);
  font-size: 18px;
}

.ag-editor-empty p,
.ag-load-failure p {
  max-width: 340px;
  line-height: 1.5;
}

.ag-loading {
  min-height: 180px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}

.ag-notice {
  position: fixed;
  z-index: 1200;
  top: 22px;
  right: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid #d2d2d6;
  border-radius: 13px !important;
  color: #242428;
  background: #f7f7f8;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 16px 40px rgba(16, 38, 33, 0.16);
  animation: ag-toast-enter 260ms var(--ag-ease) both;
  transition: opacity 160ms ease, transform 160ms ease;
}

.ag-notice.is-leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.ag-notice .ag-icon {
  width: 16px;
  height: 16px;
}

.ag-modal-backdrop {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(5px);
  animation: ag-fade-in 180ms ease-out both;
}

.ag-modal {
  width: min(100%, 520px);
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px !important;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.25);
  animation: ag-modal-enter 260ms var(--ag-ease) both;
}

@keyframes ag-panel-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ag-toast-enter {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ag-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ag-modal-enter {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ag-spin {
  to { transform: rotate(360deg); }
}

.ag-modal-head {
  justify-content: space-between;
  gap: 12px;
}

.ag-modal-head .eyebrow {
  margin-bottom: 4px;
}

.ag-modal-actions {
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 1080px) {
  .ag-workbench {
    grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
  }

  .ag-member-options {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 860px) {
  .ag-workbench {
    grid-template-columns: 1fr;
  }

  .ag-list-panel {
    position: static;
    max-height: 360px;
  }

  .ag-member-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ag-page-head,
  .ag-page-actions,
  .ag-section-head,
  .ag-editor-footer,
  .ag-danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .ag-page-head {
    padding: 20px 18px;
  }

  .ag-page-actions {
    justify-content: flex-start;
  }

  .ag-page-actions .ag-primary-action {
    width: 100%;
  }

  .ag-editor-head,
  .ag-identity-section {
    grid-template-columns: 1fr;
  }

  .ag-editor-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ag-editor-head-meta {
    width: 100%;
    flex-wrap: wrap;
  }

  .ag-editor-head-meta .ag-switch {
    margin-left: auto;
  }

  .ag-identity-section,
  .ag-section,
  .ag-danger-zone {
    padding: 18px 16px;
  }

  .ag-editor-head,
  .ag-editor-footer {
    padding: 18px 16px;
  }

  .ag-member-options {
    grid-template-columns: 1fr;
  }

  .ag-member-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .ag-member-view {
    width: 100%;
  }

  .ag-member-view-option {
    width: 100%;
  }

  .ag-scope-row {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .ag-scope-row > .ag-field:nth-child(1),
  .ag-scope-row > .ag-field:nth-child(2),
  .ag-level-field {
    grid-column: 1 / -1;
  }

  .ag-remove-scope {
    grid-column: 2;
    grid-row: 1;
  }

  .ag-level-picker {
    grid-template-columns: 1fr;
  }

  .ag-level-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .ag-capability-list {
    justify-content: flex-start;
  }

  .ag-editor-actions,
  .ag-editor-actions .ag-primary-action,
  .ag-editor-actions .ag-quiet-action {
    width: 100%;
  }

  .ag-modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .ag-notice {
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .access-groups-root *,
  .access-groups-root *::before,
  .access-groups-root *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
