body.admin:has(#login:not([hidden])) {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

#login {
  width: min(420px, 100% - 32px);
  margin: auto;
}

.dash {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brandmark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 16px;
  border-bottom: 1px solid var(--line);
  font: 600 18px/1 var(--display);
  letter-spacing: -0.01em;
  color: var(--text);
}

.brandmark img {
  width: 28px;
  height: 28px;
}

.brandmark i {
  font-style: normal;
  color: var(--accent);
}

.brandmark em {
  margin-left: auto;
  font: 500 11px/1 var(--body);
  font-style: normal;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--line-2);
  padding: 4px 8px;
  border-radius: 99px;
}

.brandmark.big {
  justify-content: center;
  border: 0;
  padding: 0 0 4px;
  font-size: 22px;
}

.brandmark.big img {
  width: 34px;
  height: 34px;
}

.side-foot {
  display: grid;
  gap: 10px;
}

.who {
  color: var(--dim);
  font-size: 12px;
}

.who b {
  color: var(--muted);
  font-weight: 600;
}

.nav {
  display: grid;
  gap: 4px;
  flex: 1;
}

.nav-item {
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--surface-2);
  color: var(--text);
}

.content {
  padding: 32px clamp(20px, 4vw, 48px);
  width: min(100%, 1040px);
}

.view {
  display: grid;
  gap: 14px;
  align-content: start;
}

.view-title {
  margin: 0;
  font-size: 26px;
}

.form {
  display: grid;
  gap: 12px;
}

.err {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bad) 14%, transparent);
  color: var(--bad);
  font-size: 14px;
  font-weight: 600;
}

.err[hidden] {
  display: none;
}

.oauth {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.oauth-or {
  color: var(--dim);
  font-size: 13px;
  text-align: center;
}

.oauth-btn.discord {
  --glow: #5865f2;
}

.oauth-btn.google {
  --glow: #ea4335;
}

.group {
  margin-top: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.card .k {
  color: var(--muted);
  font-size: 13px;
}

.card .v {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.card .sub {
  color: var(--dim);
  font-size: 12.5px;
}

.list {
  display: grid;
  gap: 2px;
}

.line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.line-amt {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.line small {
  color: var(--dim);
  font-size: 12.5px;
}

.empty {
  color: var(--dim);
  font-size: 14px;
  padding: 8px 2px;
}

.tools {
  display: flex;
  gap: 14px;
}

.pick {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.input.sel {
  width: auto;
  min-width: 160px;
}

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

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

.table th {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

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

.table .mono {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.pill.ok {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok);
}

.pill.warn {
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--gold);
}

.pill.bad {
  background: color-mix(in srgb, var(--bad) 16%, transparent);
  color: var(--bad);
}

.pager {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-end;
}

.pager-info {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.row-text {
  display: grid;
  gap: 2px;
}

.row-text b {
  font-weight: 600;
  line-height: 1.3;
}

.row-text small {
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.35;
}

.input.num {
  width: 110px;
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s var(--ease);
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease);
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.switch input:focus-visible + span {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .dash {
    grid-template-columns: 1fr;
  }

  .side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-item,
  .switch span,
  .switch span::after {
    transition: none;
  }
}
