select {
  font: inherit;
}

.field select {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  background: rgba(4, 14, 26, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
}

.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(66, 232, 180, 0.1);
}

.field select:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}

.main-navigation {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.nav-button {
  min-height: 38px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  background: transparent;
  border: 0;
  border-radius: 10px;
}

.nav-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-button.active {
  color: #032219;
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(38, 215, 163, 0.18);
}

.users-heading {
  align-items: center;
}

.users-heading .primary-button {
  min-width: 160px;
}

.page-message {
  min-height: 22px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.page-message.error {
  color: var(--danger);
}

.page-message.success {
  color: var(--accent);
}

.user-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.compact-metric {
  display: grid;
  gap: 11px;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.13);
}

.compact-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-metric strong {
  font-size: 30px;
  letter-spacing: -0.045em;
}

.users-panel {
  overflow: hidden;
}

.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.users-toolbar h2 {
  margin: 7px 0 0;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.search-field {
  width: min(100%, 330px);
}

.search-field input {
  width: 100%;
  height: 44px;
  padding: 0 15px;
  color: var(--text);
  outline: none;
  background: rgba(4, 14, 26, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 13px;
}

.search-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(66, 232, 180, 0.1);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.table-shell {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  padding: 16px 13px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.users-table th {
  color: #8299b4;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.users-table tbody tr:last-child td {
  border-bottom: 0;
}

.users-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.022);
}

.user-identity-cell {
  min-width: 190px;
}

.user-display-name {
  overflow-wrap: anywhere;
}

.user-username,
.updated-cell {
  color: var(--muted);
  font-size: 11px;
}

.password-cell {
  min-width: 150px;
}

.password-value {
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.password-unavailable {
  color: #f5b76b;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.password-hidden {
  color: #b9ccff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.role-pill,
.account-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}

.role-pill {
  padding: 6px 9px;
  color: #b9ccff;
  background: rgba(76, 141, 255, 0.1);
  border-radius: 999px;
}

.role-pill.user {
  color: #c8d6e6;
  background: rgba(148, 163, 184, 0.1);
}

.role-pill.mod {
  color: #83efd0;
  background: rgba(38, 215, 163, 0.1);
}

.account-status::before {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  content: "";
}

.account-status.active {
  color: var(--accent);
}

.account-status.disabled {
  color: var(--danger);
}

.actions-column {
  text-align: right !important;
}

.table-actions-cell {
  min-width: 340px;
}

.dashboard.user-dashboard .status-grid {
  grid-template-columns: minmax(0, 1fr);
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.table-action {
  min-height: 34px;
  padding: 0 10px;
  color: #dce8f6;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.table-action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.34);
}

.table-action.danger {
  color: #ff9aaa;
}

.table-action.success {
  color: var(--accent);
}

.table-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow-y: auto;
  background: rgba(1, 8, 16, 0.76);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(100%, 560px);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  padding: clamp(24px, 4vw, 34px);
  background: #0b1b2e;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.small-modal {
  width: min(100%, 500px);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.modal-header h2 {
  margin: 7px 0 0;
  font-size: 27px;
  letter-spacing: -0.035em;
}

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0 0 3px;
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.modal-form,
.password-fields {
  display: grid;
  gap: 18px;
}

.modal-message {
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
  }

  .main-navigation {
    order: 3;
    width: 100%;
  }

  .nav-button {
    flex: 1;
  }

  .user-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .user-metrics {
    grid-template-columns: 1fr;
  }

  .users-heading .primary-button,
  .search-field {
    width: 100%;
  }

  .users-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .table-shell {
    overflow: visible;
  }

  .users-table,
  .users-table tbody,
  .users-table tr,
  .users-table td {
    display: block;
    width: 100%;
  }

  .users-table thead {
    display: none;
  }

  .users-table tr {
    margin-bottom: 12px;
    padding: 15px;
    background: rgba(5, 16, 29, 0.56);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;
  }

  .users-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  }

  .users-table td::before {
    flex: 0 0 auto;
    color: #8299b4;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    content: attr(data-label);
  }

  .users-table td:last-child {
    border-bottom: 0;
  }

  .user-identity-cell {
    display: flex !important;
    align-items: flex-end !important;
    flex-direction: column;
  }

  .table-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .modal-backdrop {
    align-items: start;
    padding: 12px;
  }

  .modal-card {
    max-height: none;
    padding: 22px;
    border-radius: 19px;
  }
}
