.users-page {
  --u-accent: #3789b2;
  --u-accent-strong: #267398;
  --u-surface: #fff;
  --u-surface-soft: #f3f7f9;
  --u-border: #d7e3e9;
  --u-text: #173d54;
  --u-muted: #617b8a;
  min-width: 0;
  color: var(--u-text);
}

.users-page *,
.users-dialog *,
.users-actions-menu *,
.users-toast-region * {
  box-sizing: border-box;
}

.users-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--u-border);
}

.users-page__header h2 {
  color: var(--u-text);
  font: 750 clamp(25px, 2.4vw, 33px)/1.18 "Sora", sans-serif;
  letter-spacing: -.04em;
}

.users-page__subtitle {
  max-width: 630px;
  margin: 8px 0 0;
  color: var(--u-muted);
  font-size: 14px;
  line-height: 1.5;
}

.users-page__header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.users-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font: 750 12px/1 "Source Sans 3", sans-serif;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.users-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.users-button--primary {
  border-color: #2e7fa6;
  color: #fff;
  background: #347fa5;
  box-shadow: 0 6px 16px rgba(32, 105, 144, .18);
}

.users-button--primary:hover:not(:disabled) {
  border-color: #216a8e;
  background: #2a7298;
  transform: translateY(-1px);
}

.users-button--secondary {
  border-color: #b8ccd6;
  color: #365e73;
  background: var(--u-surface);
}

.users-button--secondary:hover:not(:disabled) {
  border-color: #82a9bb;
  color: #245e7d;
  background: #edf5f8;
}

.users-button--danger {
  border-color: #b95149;
  color: #fff;
  background: #b95149;
}

.users-button--danger:hover:not(:disabled) {
  background: #9e4039;
}

.users-button:focus-visible,
.users-actions-trigger:focus-visible,
.users-filter-clear:focus-visible,
.users-actions-menu button:focus-visible,
.users-dialog__close:focus-visible {
  outline: 3px solid rgba(71, 156, 199, .32);
  outline-offset: 2px;
}

.users-button:disabled {
  cursor: not-allowed;
  opacity: .58;
  transform: none;
}

.users-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.users-summary__card {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  min-height: 96px;
  padding: 15px;
  border: 1px solid var(--u-border);
  border-radius: 12px;
  background: var(--u-surface);
  box-shadow: 0 5px 16px rgba(23, 61, 84, .045);
}

.users-summary__icon {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #397e9f;
  background: #e9f3f7;
}

.users-summary__icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.users-summary__card--green .users-summary__icon {
  color: #3d8063;
  background: #eaf5ef;
}

.users-summary__card--slate .users-summary__icon {
  color: #687f8c;
  background: #edf2f4;
}

.users-summary__card--amber .users-summary__icon {
  color: #8b6c34;
  background: #f7f1e5;
}

.users-summary__card > div {
  display: grid;
  min-width: 0;
}

.users-summary__card span:not(.users-summary__icon) {
  overflow: hidden;
  color: var(--u-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .045em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.users-summary__card strong {
  margin: 1px 0;
  color: var(--u-text);
  font: 750 23px/1.2 "Sora", sans-serif;
}

.users-summary__card small {
  overflow: hidden;
  color: #78909d;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-filters {
  display: grid;
  grid-template-columns: minmax(230px, 1.5fr) repeat(3, minmax(145px, .7fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--u-border);
  border-radius: 12px;
  background: var(--u-surface-soft);
}

.users-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.users-field label {
  color: #587181;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
}

.users-field input,
.users-field select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #c5d5dd;
  border-radius: 8px;
  outline: 0;
  color: #294e63;
  background: var(--u-surface);
  font: 600 12px/1.2 "Source Sans 3", sans-serif;
}

.users-field input:focus,
.users-field select:focus {
  border-color: #5495b5;
  box-shadow: 0 0 0 3px rgba(52, 127, 165, .14);
}

.users-search-control {
  position: relative;
}

.users-search-control svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #78909d;
  stroke-width: 1.8;
  transform: translateY(-50%);
}

.users-search-control input {
  padding-left: 35px;
}

.users-filter-clear {
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  color: #4f6f80;
  background: transparent;
  font: 750 11px/1.2 "Source Sans 3", sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.users-filter-clear:hover:not(:disabled) {
  color: #276a8c;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.users-filter-clear:disabled {
  cursor: default;
  opacity: .45;
}

.users-page__status {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-height: 38px;
  padding: 11px 2px 8px;
  color: var(--u-muted);
  font-size: 11px;
  font-weight: 700;
}

.users-page__status p {
  margin: 0;
}

.users-table-wrap {
  overflow: visible;
  border: 1px solid var(--u-border);
  border-radius: 12px;
  background: var(--u-surface);
  box-shadow: 0 8px 24px rgba(24, 58, 80, .055);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.users-table th,
.users-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #e5edf1;
  text-align: left;
  vertical-align: middle;
}

.users-table th {
  height: 44px;
  color: #687f8c;
  background: #f2f6f8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.users-table th:first-child {
  border-top-left-radius: 11px;
}

.users-table th:last-child {
  width: 64px;
  border-top-right-radius: 11px;
  text-align: center;
}

.users-table tbody tr {
  transition: background-color 140ms ease;
}

.users-table tbody tr:hover {
  background: #f7fafb;
}

.users-table tbody tr:last-child td {
  border-bottom: 0;
}

.users-table time {
  color: #5c7584;
  font-size: 11px;
  white-space: nowrap;
}

.users-identity,
.users-dialog__affected,
.users-dialog__profile {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.users-table .users-identity {
  max-width: min(240px, 28vw);
}

.users-identity > span:last-child {
  display: grid;
  min-width: 0;
}

.users-identity strong {
  overflow: hidden;
  color: #24495f;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-identity small {
  color: #81949f;
  font-size: 9px;
}

.users-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid #b9d5e2;
  border-radius: 50%;
  color: #2b6f91;
  background: #e6f2f7;
  font: 800 12px/1 "Sora", sans-serif;
}

.users-avatar--large {
  flex-basis: 48px;
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.users-role,
.users-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.users-role--superadmin {
  border-color: #dbc797;
  color: #765c20;
  background: #f8f2e4;
}

.users-role--admin {
  border-color: #b6d5e4;
  color: #2d6d8d;
  background: #eaf4f8;
}

.users-role--consultor {
  border-color: #c9d6dc;
  color: #546d7a;
  background: #f0f4f5;
}

.users-status {
  border-color: transparent;
}

.users-status i {
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
}

.users-status--active {
  color: #347b59;
  background: #eaf5ef;
}

.users-status--inactive {
  color: #85615e;
  background: #f5eeee;
}

.users-table td.users-actions-cell {
  width: 64px;
  text-align: center;
}

.users-actions-trigger {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #577383;
  background: transparent;
  cursor: pointer;
}

.users-actions-trigger:hover,
.users-actions-trigger[aria-expanded="true"] {
  border-color: #c1d4dd;
  color: #286e91;
  background: #edf5f8;
}

.users-actions-trigger svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.users-actions-menu {
  position: fixed;
  z-index: 1390;
  display: grid;
  width: 218px;
  padding: 6px;
  border: 1px solid #cbd9e0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(7, 35, 52, .24);
}

.users-actions-menu button {
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  color: #36596d;
  background: transparent;
  font: 700 12px/1.2 "Source Sans 3", sans-serif;
  text-align: left;
  cursor: pointer;
}

.users-actions-menu button:hover,
.users-actions-menu button:focus {
  color: #205f80;
  background: #edf5f8;
  outline: 0;
}

.users-actions-menu [role="separator"] {
  height: 1px;
  margin: 4px;
  background: #e0e8ec;
}

.users-actions-menu button.is-danger {
  color: #a3423c;
}

.users-actions-menu button.is-danger:hover,
.users-actions-menu button.is-danger:focus {
  background: #fff0ef;
}

.users-skeleton {
  display: grid;
  gap: 8px;
}

.users-skeleton span {
  height: 66px;
  border-radius: 10px;
  background: linear-gradient(90deg, #edf3f5 25%, #f8fafb 50%, #edf3f5 75%);
  background-size: 200% 100%;
  animation: users-skeleton 1.2s ease-in-out infinite;
}

@keyframes users-skeleton {
  to { background-position: -200% 0; }
}

.users-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 34px;
  border: 1px dashed #c6d7df;
  border-radius: 12px;
  color: var(--u-muted);
  background: var(--u-surface-soft);
  text-align: center;
}

.users-empty > span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #4d839e;
  background: #e5f0f5;
}

.users-empty svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.users-empty h3 {
  margin: 12px 0 4px;
  color: var(--u-text);
  font: 700 16px/1.3 "Sora", sans-serif;
}

.users-empty p {
  max-width: 420px;
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.5;
}

.users-dialog {
  z-index: 1400;
  width: min(620px, calc(100% - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #d2dfe5;
  border-radius: 15px;
  color: #24495e;
  background: #fff;
  box-shadow: 0 28px 90px rgba(4, 25, 38, .4);
}

.users-dialog:has(.users-dialog__create-grid) {
  width: min(820px, calc(100% - 32px));
}

.users-dialog::backdrop {
  z-index: 1395;
  background: rgba(3, 20, 31, .7);
  backdrop-filter: blur(3px);
}

.users-dialog__shell {
  display: flex;
  flex-direction: column;
  max-height: min(760px, calc(100dvh - 32px));
}

.users-dialog__header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #dce6eb;
  background: #f7fafb;
}

.users-dialog__header p {
  margin: 0 0 4px;
  color: #397da0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.users-dialog__header h3 {
  margin: 0;
  color: #173e55;
  font: 750 20px/1.25 "Sora", sans-serif;
  letter-spacing: -.03em;
}

.users-dialog__header span {
  display: block;
  margin-top: 5px;
  color: #667e8c;
  font-size: 12px;
}

.users-dialog__close {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #617b89;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.users-dialog__close:hover {
  border-color: #c8d8df;
  background: #edf3f5;
}

.users-dialog__body {
  display: grid;
  flex: 1 1 auto;
  gap: 15px;
  padding: 22px 24px;
  overflow-y: auto;
}

.users-dialog__body label,
.users-dialog__column label {
  display: grid;
  gap: 6px;
  color: #405e6e;
  font-size: 11px;
  font-weight: 800;
}

.users-dialog__body label > small,
.users-dialog__column label > small {
  color: #768c98;
  font-size: 10px;
  font-weight: 600;
}

.users-dialog__body input,
.users-dialog__body select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #bdcfd8;
  border-radius: 8px;
  outline: 0;
  color: #284c61;
  background: #fff;
  font: 600 13px/1.2 "Source Sans 3", sans-serif;
}

.users-dialog__body input:focus,
.users-dialog__body select:focus {
  border-color: #4f93b5;
  box-shadow: 0 0 0 3px rgba(52, 127, 165, .15);
}

.users-dialog__body input[readonly] {
  color: #6c818c;
  background: #edf2f4;
  cursor: not-allowed;
}

.users-dialog__create-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
}

.users-dialog__column {
  display: grid;
  align-content: start;
  gap: 15px;
}

.users-dialog__password-grid {
  display: grid;
  gap: 14px;
}

.users-password-control {
  position: relative;
}

.users-password-control input {
  padding-right: 66px;
}

.users-password-control button {
  position: absolute;
  top: 50%;
  right: 6px;
  min-height: 30px;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  color: #36708e;
  background: transparent;
  font: 750 10px/1 "Source Sans 3", sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
}

.users-password-control button:hover {
  background: #edf4f7;
}

.users-password-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid #dae4e9;
  border-radius: 9px;
  background: #f6f9fa;
  list-style: none;
}

.users-password-rules li {
  color: #758b97;
  font-size: 10px;
  font-weight: 700;
}

.users-password-rules li::before {
  content: "○";
  margin-right: 5px;
}

.users-password-rules li.is-valid {
  color: #2f7e58;
}

.users-password-rules li.is-valid::before {
  content: "✓";
}

.users-dialog__body label.users-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid #d5e1e6;
  border-radius: 9px;
  background: #f7fafb;
}

.users-dialog__body label.users-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.users-switch > i {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #aebfc8;
  transition: background-color 150ms ease;
}

.users-switch > i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform 150ms ease;
}

.users-switch input:checked + i {
  background: #348663;
}

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

.users-switch input:focus-visible + i {
  outline: 3px solid rgba(71, 156, 199, .32);
  outline-offset: 2px;
}

.users-switch > span {
  display: grid;
}

.users-switch strong {
  color: #3c5b6b;
  font-size: 11px;
}

.users-switch small {
  color: #778d98;
  font-size: 9px;
}

.users-dialog__profile {
  padding: 11px;
  border: 1px solid #d7e2e7;
  border-radius: 9px;
  background: #f7fafb;
}

.users-dialog__profile > div {
  display: grid;
}

.users-dialog__profile strong {
  color: #244b61;
  font-size: 13px;
}

.users-dialog__profile span {
  color: #748a96;
  font-size: 9px;
}

.users-dialog__affected {
  padding: 10px 12px;
  border-radius: 9px;
  background: #edf4f7;
}

.users-confirmation {
  display: grid;
  margin: 0;
  border: 1px solid #d9e4e9;
  border-radius: 9px;
  overflow: hidden;
}

.users-confirmation > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  padding: 10px 12px;
  border-bottom: 1px solid #e1e9ed;
}

.users-confirmation > div:last-child {
  border-bottom: 0;
}

.users-confirmation dt {
  color: #6e8490;
  font-size: 10px;
  font-weight: 800;
}

.users-confirmation dd {
  margin: 0;
  color: #304f61;
  font-size: 11px;
  font-weight: 700;
}

.users-danger-note {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid #e3c1bd;
  border-radius: 9px;
  color: #8f443e;
  background: #fff5f4;
}

.users-danger-note span {
  font-size: 10px;
}

.users-dialog__error {
  min-height: 18px;
  margin: 0;
  color: #a43e37;
  font-size: 11px;
  font-weight: 750;
}

.users-dialog__error:not(:empty) {
  padding: 9px 10px;
  border: 1px solid #e5c2bf;
  border-radius: 8px;
  background: #fff3f2;
}

.users-dialog__footer {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 24px;
  border-top: 1px solid #dce6eb;
  background: #f7fafb;
}

.users-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: users-spin 650ms linear infinite;
}

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

.users-toast-region {
  position: fixed;
  z-index: 1410;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(360px, calc(100vw - 28px));
  gap: 9px;
  pointer-events: none;
}

.users-toast {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 8px 10px 14px;
  border: 1px solid #bcd7c8;
  border-radius: 10px;
  color: #2d6048;
  background: #f2fbf6;
  box-shadow: 0 14px 34px rgba(6, 31, 44, .23);
  pointer-events: auto;
  animation: users-toast-in 180ms ease-out both;
}

.users-toast--error {
  border-color: #e1b8b4;
  color: #913f39;
  background: #fff4f3;
}

.users-toast--warning {
  border-color: #ddcb9f;
  color: #775b22;
  background: #fff9ec;
}

.users-toast__mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.users-toast p {
  margin: 0;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.users-toast button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  color: currentColor;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

@keyframes users-toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

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

html[data-theme="dark"] .users-page {
  --u-surface: #132936;
  --u-surface-soft: #102531;
  --u-border: #2b4655;
  --u-text: #ecf4f7;
  --u-muted: #93a9b4;
}

html[data-theme="dark"] .users-field input,
html[data-theme="dark"] .users-field select,
html[data-theme="dark"] .users-table {
  border-color: #365362;
  color: #d7e5eb;
  background: #132936;
}

html[data-theme="dark"] .users-table th {
  color: #8ca3ae;
  background: #1a3442;
}

html[data-theme="dark"] .users-table th,
html[data-theme="dark"] .users-table td {
  border-color: #294653;
}

html[data-theme="dark"] .users-table tbody tr:hover {
  background: #19333f;
}

html[data-theme="dark"] .users-identity strong {
  color: #edf6f9;
}

html[data-theme="dark"] .users-table time,
html[data-theme="dark"] .users-identity small {
  color: #91a7b2;
}

html[data-theme="dark"] .users-role--admin,
html[data-theme="dark"] .users-avatar {
  border-color: #346078;
  color: #8ac4df;
  background: #183b4d;
}

html[data-theme="dark"] .users-role--superadmin {
  border-color: #695c37;
  color: #dec680;
  background: #3a3321;
}

html[data-theme="dark"] .users-role--consultor {
  border-color: #465d69;
  color: #b7c8d0;
  background: #243946;
}

html[data-theme="dark"] .users-status--active {
  color: #83c9a5;
  background: #183c2e;
}

html[data-theme="dark"] .users-status--inactive {
  color: #c9a09b;
  background: #402b2c;
}

html[data-theme="dark"] .users-actions-trigger {
  color: #a1b6c0;
}

html[data-theme="dark"] .users-actions-trigger:hover,
html[data-theme="dark"] .users-actions-trigger[aria-expanded="true"] {
  border-color: #416172;
  color: #9bd0e8;
  background: #1b3a49;
}

html[data-theme="dark"] .users-actions-menu {
  border-color: #385463;
  background: #152b38;
}

html[data-theme="dark"] .users-actions-menu button {
  color: #c3d4dc;
}

html[data-theme="dark"] .users-actions-menu button:hover,
html[data-theme="dark"] .users-actions-menu button:focus {
  color: #a8d7ea;
  background: #1e3b49;
}

html[data-theme="dark"] .users-actions-menu [role="separator"] {
  background: #304b59;
}

html[data-theme="dark"] .users-dialog {
  border-color: #35515f;
  color: #c7d7de;
  background: #142a36;
}

html[data-theme="dark"] .users-dialog__header,
html[data-theme="dark"] .users-dialog__footer {
  border-color: #304a58;
  background: #102531;
}

html[data-theme="dark"] .users-dialog__header h3 {
  color: #eef6f9;
}

html[data-theme="dark"] .users-dialog__header span,
html[data-theme="dark"] .users-dialog__body label,
html[data-theme="dark"] .users-dialog__column label {
  color: #9bb0ba;
}

html[data-theme="dark"] .users-dialog__body input,
html[data-theme="dark"] .users-dialog__body select {
  border-color: #3a5867;
  color: #e1ebef;
  background: #1a3441;
}

html[data-theme="dark"] .users-dialog__body input[readonly],
html[data-theme="dark"] .users-switch,
html[data-theme="dark"] .users-dialog__profile,
html[data-theme="dark"] .users-password-rules {
  border-color: #34505e;
  background: #102631;
}

html[data-theme="dark"] .users-switch strong,
html[data-theme="dark"] .users-dialog__profile strong,
html[data-theme="dark"] .users-confirmation dd {
  color: #dce8ed;
}

html[data-theme="dark"] .users-confirmation {
  border-color: #36515f;
}

html[data-theme="dark"] .users-confirmation > div {
  border-color: #2c4856;
}

@media (max-width: 1180px) {
  .users-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .users-filters {
    grid-template-columns: 1.3fr repeat(2, minmax(140px, .7fr));
  }

  .users-field:has([data-user-sort]) {
    grid-column: 1 / 2;
  }

  .users-filter-clear {
    grid-column: 3;
    grid-row: 2;
  }
}

@media (max-width: 900px) {
  .users-table th:nth-child(4),
  .users-table td:nth-child(4) {
    display: none;
  }

  .users-dialog__create-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .users-page__header {
    flex-direction: column;
    gap: 16px;
  }

  .users-page__header-actions {
    width: 100%;
  }

  .users-page__header-actions .users-button {
    flex: 1 1 0;
  }

  .users-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .users-summary__card {
    min-height: 88px;
    padding: 12px;
  }

  .users-filters {
    grid-template-columns: 1fr 1fr;
  }

  .users-field--search,
  .users-field:has([data-user-sort]) {
    grid-column: 1 / -1;
  }

  .users-filter-clear {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: start;
  }

  .users-table-wrap {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .users-table,
  .users-table tbody,
  .users-table tr,
  .users-table td {
    display: block;
    width: 100%;
  }

  .users-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .users-table tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 18px;
    margin-bottom: 10px;
    padding: 15px;
    border: 1px solid var(--u-border);
    border-radius: 12px;
    background: var(--u-surface);
  }

  .users-table td {
    padding: 0;
    border: 0;
  }

  .users-table td::before {
    display: block;
    margin-bottom: 4px;
    color: var(--u-muted);
    content: attr(data-label);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .users-table td:first-child {
    grid-column: 1 / -1;
    padding-right: 48px;
  }

  .users-table .users-identity {
    max-width: calc(100vw - 120px);
  }

  .users-table td:first-child::before,
  .users-table td:nth-child(4),
  .users-table .users-actions-cell::before {
    display: none;
  }

  .users-table td:nth-child(5) {
    grid-column: 1 / -1;
  }

  .users-table .users-actions-cell {
    position: absolute;
    top: 12px;
    right: 12px;
    width: auto;
  }

  .users-actions-trigger {
    border-color: #c8d7df;
  }

  .users-dialog,
  .users-dialog:has(.users-dialog__create-grid) {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 13px;
  }

  .users-dialog__shell {
    max-height: calc(100dvh - 16px);
  }

  .users-dialog__header {
    padding: 18px;
  }

  .users-dialog__body {
    padding: 18px;
  }

  .users-dialog__footer {
    padding: 13px 18px;
  }

  .users-dialog__footer .users-button {
    flex: 1 1 0;
  }

  .users-password-rules {
    grid-template-columns: 1fr;
  }

  .users-toast-region {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 420px) {
  .users-summary {
    grid-template-columns: 1fr;
  }

  .users-filters {
    grid-template-columns: 1fr;
  }

  .users-field--search,
  .users-field:has([data-user-sort]),
  .users-filter-clear {
    grid-column: auto;
  }

  .users-page__header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .users-dialog__footer {
    flex-direction: column-reverse;
  }
}

@media (prefers-reduced-motion: reduce) {
  .users-button,
  .users-skeleton span,
  .users-spinner,
  .users-toast {
    animation: none;
    transition: none;
  }
}
