/* Control Center — Users, Roles and access governance */
.theme-control .app-main {
  background:
    radial-gradient(circle at 93% 2%, rgba(15, 141, 103, .055), transparent 260px),
    var(--canvas);
}

.control-page-header { margin-bottom: 16px; }
.control-page-header .page-eyebrow { color: var(--emerald-700); }
.control-page-header h1 { font-size: clamp(1.35rem, 1.8vw, 1.8rem); }
.title-ar {
  display: inline-block;
  margin-inline-start: 5px;
  color: var(--navy-900);
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: .77em;
  font-weight: 700;
  letter-spacing: 0;
}

.control-tabs {
  display: flex;
  align-items: center;
  gap: 25px;
  margin: 0 5px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.control-tabs::-webkit-scrollbar { display: none; }
.control-tab {
  position: relative;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 0 2px;
  color: var(--ink-500);
  background: transparent;
  border: 0;
  font-size: .72rem;
  font-weight: 700;
}
.control-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--emerald-600);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
}
.control-tab:hover { color: var(--navy-900); }
.control-tab.active { color: var(--emerald-700); }
.control-tab.active::after { transform: none; }
.tab-count {
  min-width: 19px;
  display: inline-grid;
  place-items: center;
  padding: 2px 5px;
  color: var(--ink-500);
  background: #edf2f5;
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 800;
}

/* Users */
.directory-surface {
  margin-top: 15px;
  overflow: hidden;
  border-radius: 14px;
}
.directory-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.directory-search { width: min(390px, 42vw); }
.directory-search .app-input { height: 40px; background: #fbfcfd; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.btn-app.compact { min-height: 36px; padding: 7px 11px; font-size: .68rem; }
.add-user-compact { display: none; }
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
}
.filter-field { flex: 0 1 150px; margin: 0; }
.filter-field .app-select {
  min-height: 36px;
  padding: 7px 31px 7px 10px;
  color: var(--ink-700);
  background-color: #fff;
  font-size: .67rem;
  font-weight: 700;
}
.filter-button { min-height: 36px; padding-block: 7px; box-shadow: none; }
.clear-filters { padding: 8px 5px; color: var(--ink-500); background: transparent; border: 0; font-size: .67rem; }
.clear-filters:hover { color: var(--emerald-700); }
.user-table-wrap { overflow-x: auto; }
.user-table { width: 100%; min-width: 1070px; border-collapse: collapse; }
.user-table th {
  height: 43px;
  padding: 8px 10px;
  color: var(--ink-700);
  background: #f7f9fb;
  border-bottom: 1px solid var(--line);
  font-size: .65rem;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}
.user-table td {
  height: 74px;
  padding: 9px 10px;
  border-bottom: 1px solid #e7edf1;
  color: var(--ink-700);
  font-size: .66rem;
  vertical-align: middle;
}
.user-table tbody tr { transition: background .15s ease; }
.user-table tbody tr:hover { background: #f8fbfa; }
.user-table tbody tr:last-child td { border-bottom: 0; }
.select-column { width: 34px; text-align: center !important; }
.select-column input, .module-select input {
  width: 15px;
  height: 15px;
  accent-color: var(--emerald-600);
}
.actions-column { width: 54px; text-align: center !important; }
.user-identity { min-width: 188px; display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #d8e2e8;
}
.user-avatar.initials {
  display: grid;
  place-items: center;
  color: #fff;
  border: 0;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.tone-sage { background: #437b67; }
.tone-gold { background: #aa7d3d; }
.tone-blue { background: #3d6f91; }
.tone-purple { background: #755e9a; }
.tone-coral { background: #a4574f; }
.tone-rose { background: #9d526d; }
.tone-slate { background: #536879; }
.identity-copy, .bilingual-cell, .login-time { display: grid; gap: 2px; }
.identity-copy strong, .bilingual-cell strong, .login-time strong { color: var(--ink-900); font-size: .67rem; font-weight: 800; }
.identity-copy small, .bilingual-cell small, .login-time small { color: var(--ink-500); font-size: .59rem; }
.identity-copy .identity-ar { width: max-content; color: var(--ink-700); font-family: "IBM Plex Sans Arabic", sans-serif; }
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  color: #4c5864;
  background: #eef2f5;
  border: 1px solid #dfe6eb;
  border-radius: 5px;
  font-size: .61rem;
  font-weight: 700;
  white-space: nowrap;
}
.role-badge small { font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .58rem; }
.role-badge.admin { color: #7b4a16; background: #fff3e3; border-color: #f0d5ae; }
.role-badge.editor, .role-badge.reporter { color: #315c88; background: #eaf2fb; border-color: #cbdcf0; }
.role-badge.reviewer, .role-badge.designer { color: #665092; background: #f1edfb; border-color: #dbd2ef; }
.role-badge.publisher { color: #354d61; background: #edf1f4; }
.directory-status {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: .59rem;
  font-weight: 800;
  white-space: nowrap;
}
.directory-status small { font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .56rem; }
.directory-status.active { color: #087051; background: #e5f5ef; border-color: #b9e5d5; }
.directory-status.invited { color: #674d99; background: #f0ebfb; border-color: #d9cfef; }
.directory-status.inactive { color: #b03c3c; background: #fdecec; border-color: #f3caca; }
.row-menu {
  width: 31px;
  height: 31px;
  display: inline-grid;
  place-items: center;
  color: var(--ink-700);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.row-menu:hover { color: var(--emerald-700); border-color: #acd7c9; }
.user-card-list { display: none; }
.directory-footer {
  min-height: 57px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  color: var(--ink-500);
  background: #fbfcfd;
  border-top: 1px solid var(--line);
  font-size: .63rem;
}
.pagination-mini { display: flex; align-items: center; gap: 4px; }
.pagination-mini button, .role-catalog-foot button {
  min-width: 29px;
  height: 29px;
  color: var(--ink-700);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: .64rem;
}
.pagination-mini button:hover, .pagination-mini button.active, .role-catalog-foot button.active { color: var(--emerald-700); background: #fff; border-color: #98d0be; }
.rows-per-page { justify-self: end; display: flex; align-items: center; gap: 7px; }
.rows-per-page select { padding: 4px; color: var(--ink-700); background: transparent; border: 0; }
.placeholder-panel { min-height: 320px; display: grid; place-items: center; align-content: center; gap: 12px; margin-top: 15px; padding: 40px; text-align: center; }
.placeholder-panel > i { color: var(--emerald-600); font-size: 2rem; }
.placeholder-panel h2 { max-width: 480px; margin: 0; color: var(--navy-900); font-size: 1rem; }

.modal-head p { margin: 4px 0 0; color: var(--ink-500); font-size: .66rem; }
.add-user-card { width: min(100%, 670px); }
.add-user-form, .create-role-modal-body { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-span-2 { grid-column: 1 / -1; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; }
.field-label small { color: var(--ink-500); font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .6rem; font-weight: 500; }
.invitation-switch { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.invitation-switch > input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 34px; height: 19px; flex: 0 0 auto; background: #bcc9d1; border-radius: 999px; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s ease; }
.invitation-switch > input:checked + .switch-track { background: var(--emerald-600); }
.invitation-switch > input:checked + .switch-track::after { transform: translateX(15px); }
.invitation-switch > span:last-child { display: grid; gap: 2px; }
.invitation-switch strong { color: var(--ink-700); font-size: .65rem; }
.invitation-switch small { color: var(--ink-500); font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .58rem; }

/* Roles & permissions */
.control-roles-page { width: min(100%, 1760px); }
.roles-page-header { margin-bottom: 18px; }
.mobile-create-role { display: none; }
.roles-workspace {
  display: grid;
  grid-template-columns: 226px minmax(560px, 1fr) 192px 248px;
  align-items: stretch;
  gap: 12px;
}
.role-catalog, .role-editor, .role-summary, .create-role-panel { min-width: 0; }
.role-catalog { display: flex; flex-direction: column; overflow: hidden; }
.role-catalog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 13px 9px; }
.role-catalog-head h2, .permission-head h2, .role-summary h2, .create-role-panel h2 { margin: 0; color: var(--navy-900); font-size: .78rem; font-weight: 800; }
.role-catalog-head p { margin: 3px 0 0; color: var(--ink-500); font-size: .56rem; }
.catalog-add { width: 30px; height: 30px; display: grid; place-items: center; color: var(--navy-900); background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.role-search { display: block; margin: 0 11px 9px; }
.role-search .app-input { min-height: 36px; padding-block: 7px; font-size: .62rem; }
.role-list { flex: 1; display: grid; align-content: start; }
.role-item {
  width: 100%;
  min-height: 57px;
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  color: var(--ink-700);
  background: transparent;
  border: 0;
  border-top: 1px solid #eef2f4;
  text-align: left;
}
.role-item:hover { background: #f8fbfa; }
.role-item.active { color: #076849; background: linear-gradient(90deg, #e2f4ed, #f5fbf8); box-shadow: inset 3px 0 var(--emerald-600); }
.role-icon { width: 27px; height: 27px; display: grid; place-items: center; color: #476174; background: #edf2f5; border-radius: 7px; font-size: .78rem; }
.role-icon.gold { color: #a7731c; background: #fff3dc; }
.role-icon.green { color: #087357; background: #dff3ec; }
.role-icon.blue { color: #3a6696; background: #e6eef8; }
.role-icon.purple, .role-icon.violet { color: #665095; background: #eee9f8; }
.role-icon.rose { color: #a3516c; background: #f8e9ef; }
.role-icon.cyan, .role-icon.teal { color: #277886; background: #e4f4f5; }
.role-icon.amber { color: #a66c16; background: #fff0d9; }
.role-icon.indigo, .role-icon.navy { color: #345374; background: #e9eff5; }
.role-copy { min-width: 0; display: grid; gap: 3px; }
.role-copy strong { overflow: hidden; color: var(--ink-900); font-size: .61rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.role-item.active .role-copy strong { color: #076849; }
.role-copy small { overflow: hidden; color: var(--ink-500); font-size: .51rem; text-overflow: ellipsis; white-space: nowrap; }
.role-users { display: flex; align-items: baseline; gap: 2px; color: var(--ink-700); font-size: .55rem; font-weight: 800; white-space: nowrap; }
.role-users small { font-size: .48rem; font-weight: 600; }
.role-catalog-foot { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 9px 10px; color: var(--ink-500); background: #fbfcfd; border-top: 1px solid var(--line); font-size: .53rem; }
.role-catalog-foot > span:last-child { display: flex; gap: 2px; }
.role-catalog-foot button { min-width: 24px; height: 24px; padding: 0; }
.role-editor { display: grid; align-content: start; gap: 12px; }
.role-editor-head { position: relative; padding: 16px 15px 0; overflow: hidden; }
.role-title-line { display: flex; align-items: center; gap: 8px; }
.role-title-line h2 { margin: 0; color: var(--navy-900); font-size: 1.04rem; font-weight: 800; }
.role-editor-head > p { max-width: 560px; margin: 5px 0 15px; color: var(--ink-500); font-size: .61rem; line-height: 1.5; }
.role-head-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; }
.role-tabs { display: flex; align-items: center; gap: 24px; overflow-x: auto; scrollbar-width: none; }
.role-tabs button { position: relative; height: 38px; display: flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 0; color: var(--ink-500); background: transparent; border: 0; font-size: .59rem; font-weight: 800; }
.role-tabs button::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: var(--emerald-600); transform: scaleX(0); }
.role-tabs button.active { color: var(--emerald-700); }
.role-tabs button.active::after { transform: none; }
.role-tabs button span { min-width: 18px; padding: 2px 4px; background: #eef2f4; border-radius: 999px; font-size: .49rem; }
.permission-surface { overflow: hidden; }
.permission-head { min-height: 65px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.permission-head p { margin: 4px 0 0; color: var(--ink-500); font-size: .55rem; }
.permission-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.permission-legend { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-700); font-size: .49rem; white-space: nowrap; }
.legend-box, .summary-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.legend-box.full, .summary-dot.full { background: var(--emerald-600); }
.legend-box.limited, .summary-dot.limited { background: #f0b63e; }
.legend-box.none, .summary-dot.none { background: #fff; border: 1px solid #cbd6de; }
.permission-table-wrap { overflow-x: auto; }
.permission-table { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; }
.permission-table th:first-child { width: 42%; text-align: left; }
.permission-table thead th { height: 33px; padding: 6px 5px; color: var(--ink-500); background: #fafcfd; border-bottom: 1px solid var(--line); font-size: .48rem; font-weight: 800; text-align: center; }
.permission-table td, .permission-table tbody th { height: 33px; padding: 5px; border-bottom: 1px solid #edf1f4; text-align: center; }
.permission-group + .permission-group .permission-module-row > * { border-top: 8px solid #f5f7f9; }
.permission-module-row { background: #fff; }
.permission-module-row > * { height: 47px !important; }
.module-name { display: flex; align-items: flex-start; gap: 7px; padding-left: 4px; }
.module-name > i { margin-top: 3px; color: var(--ink-700); font-size: .55rem; }
.module-name > span { display: grid; gap: 3px; text-align: left; }
.module-name strong { color: var(--ink-900); font-size: .56rem; font-weight: 800; }
.module-name strong small { margin-left: 5px; color: var(--ink-500); font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .51rem; font-weight: 600; }
.module-name span > small { color: var(--ink-500); font-size: .48rem; font-weight: 500; }
.capability-name { display: flex; align-items: center; gap: 5px; padding-left: 18px; color: var(--ink-700); font-size: .52rem; font-weight: 600; }
.capability-name > i { color: #c1ccd3; }
.capability-name > small { display: none; margin-left: auto; color: var(--emerald-700); font-size: .44rem; }
.permission-check {
  position: relative;
  width: 14px;
  height: 14px;
  margin: 0;
  appearance: none;
  background: #fff;
  border: 1px solid #cbd6de;
  border-radius: 3px;
  cursor: pointer;
  vertical-align: middle;
}
.permission-check:checked { background: var(--emerald-600); border-color: var(--emerald-600); }
.permission-check:checked::after { content: ""; position: absolute; top: 1px; left: 4px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.permission-check.limited:checked { background: #fff7e7; border-color: #eeb747; }
.permission-check.limited:checked::after { top: 5px; left: 3px; width: 6px; height: 0; border: 0; border-top: 2px solid #e4a322; transform: none; }
.mobile-permissions { display: none; }

.role-summary { overflow: hidden; }
.summary-section { padding: 15px 13px; border-bottom: 1px solid var(--line); }
.permission-donut {
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  margin: 14px auto 11px;
  background: conic-gradient(var(--emerald-600) 0 68%, #efc04c 68% 88%, #dfe5e9 88% 100%);
  border-radius: 50%;
}
.permission-donut::before { content: ""; grid-area: 1 / 1; width: 66px; height: 66px; background: #fff; border-radius: 50%; }
.permission-donut span { z-index: 1; grid-area: 1 / 1; display: grid; gap: 1px; text-align: center; }
.permission-donut strong { color: var(--navy-900); font-size: 1rem; }
.permission-donut small { color: var(--ink-500); font-size: .42rem; }
.summary-legend, .module-overview dl { display: grid; gap: 8px; margin: 0; }
.summary-legend > div, .module-overview dl > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.summary-legend dt { display: flex; align-items: center; gap: 6px; color: var(--ink-700); font-size: .52rem; font-weight: 600; }
.summary-legend dd { margin: 0; color: var(--ink-900); font-size: .53rem; font-weight: 800; }
.summary-total { margin-top: 3px; padding-top: 9px; border-top: 1px solid var(--line); }
.module-overview dl { margin-top: 13px; }
.module-overview dt { color: var(--ink-700); font-size: .53rem; font-weight: 700; }
.module-overview dd { min-width: 38px; margin: 0; padding: 3px 7px; color: #087051; background: #e4f4ee; border-radius: 999px; font-size: .49rem; font-weight: 800; text-align: center; }
.module-overview dd.low { color: #8a691d; background: #fff1d5; }
.role-activity { display: grid; gap: 12px; }
.role-activity h2 { margin-bottom: 1px; }
.role-activity > div { display: flex; align-items: flex-start; gap: 7px; }
.role-activity > div > i { color: var(--ink-500); font-size: .72rem; }
.role-activity span { display: grid; gap: 2px; }
.role-activity small { color: var(--ink-500); font-size: .47rem; }
.role-activity strong { color: var(--ink-900); font-size: .53rem; }
.role-activity time { color: var(--ink-500); font-size: .47rem; }
.summary-help { display: flex; align-items: center; gap: 8px; margin: 13px; padding: 9px; color: #315f96; background: #edf4fa; border-radius: 8px; }
.summary-help span { display: grid; }
.summary-help strong { color: var(--navy-900); font-size: .54rem; }
.summary-help small { margin-top: 2px; font-size: .48rem; }

.create-role-panel { display: flex; flex-direction: column; overflow: hidden; }
.create-role-panel > header { display: flex; justify-content: space-between; gap: 8px; padding: 15px 13px; border-bottom: 1px solid var(--line); }
.create-role-panel > header p { margin: 3px 0 0; color: var(--ink-500); font-size: .53rem; }
.create-role-panel > header button { width: 26px; height: 26px; display: grid; place-items: center; color: var(--ink-500); background: transparent; border: 0; }
.create-role-form { flex: 1; display: flex; flex-direction: column; gap: 13px; padding: 13px; }
.create-role-form .field-label { font-size: .58rem; }
.create-role-form .app-input, .create-role-form .app-select { min-height: 36px; padding: 7px 9px; font-size: .57rem; }
.create-role-form .app-textarea { min-height: 82px; font-size: .57rem; }
.field-label em { margin-left: 2px; color: var(--danger); font-style: normal; }
.module-select { display: grid; gap: 7px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.module-select legend { width: auto; margin: 0 0 4px; padding: 0; color: var(--ink-700); font-size: .58rem; font-weight: 800; }
.module-select legend small { float: right; margin-left: 8px; color: var(--emerald-700); font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .5rem; }
.module-select label { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--ink-700); font-size: .54rem; font-weight: 600; }
.module-select label small { margin-left: auto; color: var(--ink-500); font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .49rem; }
.create-role-form footer { display: flex; justify-content: flex-end; gap: 7px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.create-role-form footer .btn-app { min-height: 35px; padding: 7px 9px; font-size: .55rem; }
.create-role-modal-body .module-select { grid-column: 1 / -1; grid-template-columns: repeat(2, 1fr); }
.create-role-modal-body .module-select legend { grid-column: 1 / -1; }

@media (max-width: 1500px) {
  .roles-workspace { grid-template-columns: 226px minmax(540px, 1fr) 192px; }
  .create-role-panel { display: none; }
  .mobile-create-role { display: flex; }
}

@media (max-width: 1180px) {
  .control-roles-page { width: min(100%, 1280px); }
  .roles-workspace { grid-template-columns: 220px minmax(520px, 1fr) 190px; }
}

@media (max-width: 980px) {
  .roles-workspace { grid-template-columns: 210px minmax(0, 1fr); }
  .role-summary { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .role-summary .summary-help { align-self: end; }
  .role-summary > * { border-right: 1px solid var(--line); }
  .role-head-actions { position: static; margin-bottom: 8px; }
  .permission-head { display: grid; }
  .permission-tools { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .control-page-header { margin-bottom: 12px; }
  .control-page-header h1 { display: grid; gap: 3px; }
  .title-ar { margin: 0; font-size: .68em; }
  .desktop-actions { display: none; }
  .control-tabs { gap: 20px; margin-inline: 0; }
  .control-tab { min-height: 39px; font-size: .66rem; }
  .directory-surface { margin-top: 11px; border-radius: 11px; }
  .directory-toolbar { min-height: 57px; padding: 9px; }
  .directory-search { width: 100%; }
  .directory-search .app-input { min-height: 38px; font-size: .68rem; }
  .toolbar-actions .compact, .toolbar-actions .desktop-only { display: none; }
  .add-user-compact { width: 39px; height: 39px; display: grid; flex: 0 0 auto; padding: 0; border-radius: 50%; box-shadow: none; }
  .add-user-compact span { display: none; }
  .filter-bar { gap: 7px; padding: 8px 9px; overflow-x: auto; }
  .desktop-only { display: none !important; }
  .filter-field { flex: 0 0 120px; }
  .filter-field .app-select { min-height: 34px; font-size: .6rem; }
  .filter-button { width: 35px; flex: 0 0 35px; padding: 0; }
  .filter-button span { display: none; }
  .user-table-wrap { display: none; }
  .user-card-list { display: grid; }
  .user-card {
    min-height: 70px;
    display: grid;
    grid-template-columns: 36px 1fr 28px;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border-bottom: 1px solid #e8edf1;
  }
  .user-card[hidden] { display: none; }
  .user-card.active { background: #f3faf7; }
  .user-card .row-menu { width: 28px; height: 30px; background: transparent; border: 0; }
  .mobile-user-copy { min-width: 0; display: grid; gap: 2px; }
  .mobile-user-copy > strong { color: var(--ink-900); font-size: .66rem; }
  .mobile-user-copy > small { width: max-content; color: var(--ink-500); font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .58rem; }
  .mobile-user-meta { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 3px; color: var(--ink-700); font-size: .53rem; }
  .mobile-user-meta .directory-status { padding: 2px 5px; font-size: .48rem; }
  .directory-footer { min-height: 50px; grid-template-columns: 1fr auto; padding: 8px 11px; }
  .directory-footer .pagination-mini { justify-self: end; }
  .add-user-form, .create-role-modal-body { grid-template-columns: 1fr; gap: 12px; }
  .form-span-2, .create-role-modal-body .module-select { grid-column: auto; }
  .roles-page-header { display: flex; align-items: flex-start; }
  .mobile-create-role { display: flex; }
  .mobile-create-role .btn-app { width: 42px; height: 42px; padding: 0; border-radius: 50%; font-size: 0; }
  .mobile-create-role .btn-app i { font-size: 1rem; }
  .roles-workspace { display: flex; flex-direction: column; gap: 10px; }
  .role-catalog { order: 0; display: block; }
  .role-catalog-head { padding: 10px 11px 5px; }
  .role-catalog-head p, .catalog-add, .role-search, .role-catalog-foot { display: none; }
  .role-list { display: block; }
  .role-item { display: none; }
  .role-item.active { min-height: 50px; display: grid; border-top: 0; box-shadow: none; }
  .role-editor { order: 1; }
  .role-editor-head { padding: 13px 12px 0; }
  .role-title-line h2 { font-size: .9rem; }
  .role-editor-head > p { margin-bottom: 10px; font-size: .58rem; }
  .role-head-actions { display: none; }
  .role-tabs { gap: 20px; }
  .role-tabs button { height: 36px; font-size: .56rem; }
  .permission-head { min-height: 90px; padding: 12px; }
  .permission-tools { gap: 8px; }
  .permission-tools .btn-app { margin-left: auto; min-height: 30px; padding: 5px 8px; }
  .permission-table-wrap { display: none; }
  .mobile-permissions { display: grid; }
  .permission-mobile-card { position: relative; padding: 11px 12px; border-top: 1px solid var(--line); }
  .permission-mobile-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .permission-mobile-card header > span { display: flex; align-items: center; gap: 6px; }
  .permission-mobile-card header strong { color: var(--ink-900); font-size: .64rem; }
  .permission-mobile-card header small { color: var(--ink-500); font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .53rem; }
  .permission-mobile-card header button { color: var(--ink-500); background: transparent; border: 0; font-size: .48rem; }
  .permission-mobile-card > small { position: absolute; top: 13px; right: 46px; color: var(--emerald-700); font-size: .43rem; }
  .mobile-access-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; padding: 9px; background: #f7f9fa; border-radius: 8px; }
  .mobile-access-grid label { display: grid; justify-items: center; gap: 7px; color: var(--ink-500); font-size: .48rem; }
  .permission-mobile-card.collapsed { min-height: 49px; }
  .role-summary { order: 2; display: block; }
  .role-summary > * { border-right: 0; }
  .role-summary .module-overview, .role-summary .role-activity, .role-summary .summary-help { display: none; }
  .summary-section:first-child { display: grid; grid-template-columns: 1fr 95px; align-items: center; }
  .summary-section:first-child h2 { grid-column: 1 / -1; }
  .permission-donut { grid-column: 1; grid-row: 2; width: 82px; height: 82px; margin-inline: 6px; }
  .permission-donut::before { width: 60px; height: 60px; }
  .summary-legend { grid-column: 2; grid-row: 2; }
  .create-role-panel { display: none; }
  .create-role-modal-body .module-select { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .control-users-page, .control-roles-page { padding-inline: 11px; }
  .control-tabs { gap: 16px; }
  .directory-toolbar { gap: 7px; }
  .mobile-user-meta { align-items: flex-end; }
  .user-avatar { width: 34px; height: 34px; flex-basis: 34px; }
  .permission-legend { font-size: .45rem; }
  .permission-tools { gap: 6px; }
}
