:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d7dde8;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --danger: #b42318;
  --ok: #087443;
  --shadow: 0 18px 45px rgba(24, 33, 52, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.hero,
.toolbar,
.actions,
.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.05;
}

h2 {
  font-size: 20px;
}

.panel-head p,
.toolbar p {
  margin-top: 6px;
  color: var(--muted);
}

.grid,
.admin-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.admin-stack {
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.compact {
  max-width: 460px;
}

.stack {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

input,
textarea,
button,
.link-button {
  border-radius: 7px;
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 112px;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

button,
.link-button {
  border: 0;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  min-height: 42px;
  padding: 0 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  white-space: nowrap;
}

button:hover,
.link-button:hover {
  background: var(--brand-dark);
}

button:disabled {
  background: #9aa4b2;
  cursor: not-allowed;
}

button.danger {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #f3b8b3;
}

button.secondary {
  background: #eef2f6;
  color: #344054;
}

button.secondary:hover {
  background: #d7dde8;
}

.compact-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.result {
  margin-top: 14px;
}

.notice {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.notice.success {
  border-color: #a6e6c5;
  background: #effdf5;
}

.notice.error {
  border-color: #f3b8b3;
  background: #fff1f0;
  color: var(--danger);
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  overflow-wrap: normal;
  white-space: nowrap;
}

.link-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 300px;
}

.link-cell a {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.ok {
  background: #dcfae6;
  color: var(--ok);
}

.badge.error {
  background: #fee4e2;
  color: var(--danger);
}

.search {
  display: flex;
  gap: 8px;
  min-width: min(420px, 100%);
}

.search button {
  flex: 0 0 auto;
}

.batch-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pagination,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 14px;
}

.active-page,
.active-page:hover {
  background: var(--brand);
  color: #fff;
}

.row-actions {
  flex-wrap: nowrap;
}

.check-col {
  width: 44px;
  text-align: center;
}

th:nth-child(2),
td:nth-child(2),
th:nth-child(6),
td:nth-child(6),
th:nth-child(7),
td:nth-child(7),
th:nth-child(8),
td:nth-child(8),
th:nth-child(9),
td:nth-child(9) {
  white-space: nowrap;
}

th:nth-child(3),
td:nth-child(3) {
  min-width: 160px;
}

th:nth-child(4),
td:nth-child(4) {
  min-width: 260px;
  white-space: nowrap;
}

th:nth-child(5),
td:nth-child(5) {
  min-width: 360px;
}

.deleted-account-table {
  min-width: 980px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--brand);
}

.hidden {
  display: none !important;
}

.muted {
  opacity: 0.62;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  background: #101828;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  transition: 0.18s ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 24px, 1400px);
    padding-top: 18px;
  }

  .hero,
  .toolbar,
  .actions,
  .split {
    align-items: stretch;
    flex-direction: column;
  }

  .grid,
  .admin-layout,
  .admin-stack {
    grid-template-columns: 1fr;
  }

  .batch-bar button {
    width: 100%;
  }

  .pagination {
    justify-content: flex-start;
  }

  .row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    min-width: 0;
    width: 100%;
  }
}
