.admin-body {
  min-height: 100vh;
  overflow-x: hidden;
}

.admin-header {
  position: relative;
  z-index: 20;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.admin-header-actions .button {
  min-height: 42px;
  padding: 8px 15px;
  font-size: 12px;
  box-shadow: 0 4px 0 var(--ink);
}

.admin-main {
  position: relative;
  z-index: 10;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 74px;
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 27px;
}

.admin-heading h1 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.4vw, 4.7rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.admin-lead {
  max-width: 46rem;
  margin-top: 13px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.8;
}

.admin-identity {
  flex: 0 0 auto;
  max-width: 280px;
  padding: 9px 13px;
  border: 1px solid rgba(47, 110, 83, 0.17);
  border-radius: 999px;
  color: var(--forest);
  background: rgba(220, 235, 213, 0.66);
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
}

.admin-identity.is-error {
  border-color: rgba(191, 90, 64, 0.24);
  color: #8e3e2a;
  background: #fbe4da;
}

.admin-panel {
  padding: clamp(18px, 2.5vw, 28px);
  border: 1.5px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 253, 246, 0.86);
  box-shadow:
    8px 8px 0 rgba(23, 63, 47, 0.07),
    var(--shadow-md);
  backdrop-filter: blur(8px);
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 19px;
  border-bottom: 1px solid rgba(23, 63, 47, 0.1);
}

.admin-toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-toolbar-right {
  margin-left: auto;
}

.admin-select-label {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
}

.admin-select {
  height: 38px;
  padding: 0 32px 0 11px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fffefa;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.admin-action-button {
  min-height: 38px;
  padding: 8px 14px;
  border-width: 1.5px;
  font-size: 12px;
  box-shadow: 0 4px 0 rgba(23, 63, 47, 0.75);
}

.admin-action-button:active {
  box-shadow: 0 2px 0 rgba(23, 63, 47, 0.75);
}

.admin-refresh {
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: rgba(238, 245, 233, 0.7);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.admin-refresh:hover {
  color: var(--ink);
  background: var(--mint);
}

.selection-summary {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-error {
  margin-top: 16px;
}

.admin-table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid rgba(23, 63, 47, 0.12);
  border-radius: 18px;
  background: #fffefa;
}

.admin-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  table-layout: auto;
}

.admin-table th {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(23, 63, 47, 0.1);
  color: var(--ink-soft);
  background: var(--mint-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: left;
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(23, 63, 47, 0.075);
  color: var(--ink);
  font-size: 12px;
  vertical-align: middle;
}

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

.admin-table tbody tr:hover {
  background: rgba(238, 245, 233, 0.52);
}

.admin-table tbody tr.is-self {
  background: rgba(220, 235, 213, 0.38);
}

.admin-check-cell {
  width: 43px;
  text-align: center !important;
}

.admin-check-cell input,
.admin-row-check {
  width: 16px;
  height: 16px;
  accent-color: var(--forest);
  cursor: pointer;
}

.admin-check-cell input:disabled,
.admin-row-check:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.admin-id {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
}

.admin-user-cell {
  min-width: 150px;
}

.admin-user-name {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 13px;
  font-weight: 700;
}

.role-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #7b5209;
  background: #fff0be;
  font-size: 9px;
  font-weight: 800;
  vertical-align: 1px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status-online {
  color: #266344;
  background: #e0f0dc;
}

.status-offline {
  color: #687a6f;
  background: #eef0e9;
}

.status-banned {
  color: #9c3e28;
  background: #fbe0d5;
}

.status-normal {
  color: #3f6f51;
  background: #e7f1e2;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  white-space: nowrap;
}

.row-action {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: #fffefa;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.row-action:hover {
  color: var(--ink);
  background: var(--mint-soft);
}

.row-action.is-danger {
  color: #a24832;
  border-color: rgba(191, 90, 64, 0.2);
}

.row-action.is-danger:hover {
  color: #fff9f2;
  background: #bf5a40;
}

.row-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.admin-self-label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.admin-loading {
  padding: 42px 20px !important;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.admin-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 52px 20px;
  color: var(--ink-soft);
  text-align: center;
}

.admin-empty > span {
  color: var(--gold);
  font-size: 38px;
  line-height: 1;
}

.admin-empty h2 {
  margin-top: 12px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
}

.admin-empty p {
  margin-top: 4px;
  font-size: 12px;
}

.admin-toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.admin-toast {
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 15px;
  border: 1.5px solid var(--ink);
  border-radius: 13px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(23, 63, 47, 0.16);
  font-size: 12px;
  font-weight: 700;
  animation: toast-in 220ms ease both;
}

.admin-toast.is-error {
  border-color: #9d4b32;
  color: #873d28;
  background: #fff2ea;
}

@media (max-width: 900px) {
  .admin-header,
  .admin-main {
    width: calc(100% - 32px);
  }

  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-identity {
    max-width: 100%;
  }
}

@media (max-width: 620px) {
  .admin-header {
    align-items: flex-start;
    padding-top: 13px;
  }

  .admin-header-actions {
    gap: 6px;
  }

  .admin-header-actions .button {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 10px;
  }

  .admin-main {
    padding-top: 21px;
  }

  .admin-heading h1 {
    font-size: 2.7rem;
  }

  .admin-lead {
    font-size: 12px;
  }

  .admin-panel {
    padding: 13px;
    border-radius: 21px;
  }

  .admin-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-toolbar-right {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .admin-action-button {
    flex: 1;
    min-width: 86px;
    padding-inline: 8px;
  }

  .admin-select {
    flex: 1;
    min-width: 84px;
  }

  .admin-table-wrap {
    border-radius: 14px;
  }

  .admin-toast-region {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
  }

  .admin-toast {
    max-width: none;
    text-align: center;
  }
}
