:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #111114;
  --panel-2: #17171b;
  --line: #2b2b31;
  --text: #f7f7f8;
  --muted: #b7b7c1;
  --dim: #85858f;
  --pink: #ff006e;
  --blue: #4cc9f0;
  --yellow: #ffd166;
  --green: #69db7c;
  --red: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 0, 110, 0.14), transparent 28rem),
    radial-gradient(circle at 90% 10%, rgba(76, 201, 240, 0.12), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  padding: 28px;
  background: rgba(17, 17, 20, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.4);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.mark {
  width: 38px;
  height: 38px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  transform: rotate(45deg);
}

.mark span {
  border-radius: 8px;
}

.mark span:nth-child(1) { background: var(--pink); }
.mark span:nth-child(2) { background: var(--blue); }
.mark span:nth-child(3) { background: var(--yellow); }
.mark span:nth-child(4) { background: var(--green); }

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 23px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

h3 {
  font-size: 15px;
  line-height: 1.25;
}

p,
label,
td,
th,
.small {
  font-size: 13px;
  line-height: 1.45;
}

.muted {
  color: var(--muted);
}

.dim {
  color: var(--dim);
}

.field {
  display: grid;
  gap: 6px;
  margin: 14px 0;
}

.field span {
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0b0d;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(76, 201, 240, 0.8);
  box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.12);
}

.primary,
.secondary,
.danger,
.ghost {
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.primary {
  background: linear-gradient(135deg, var(--pink), #8338ec);
  border-color: transparent;
}

.secondary {
  background: #202026;
}

.danger {
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.45);
}

.ghost {
  background: transparent;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.86);
  backdrop-filter: blur(18px);
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  color: var(--text);
  background: var(--panel-2);
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

.card {
  background: rgba(17, 17, 20, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metric {
  display: grid;
  gap: 6px;
}

.metric strong {
  font-size: 28px;
  line-height: 1;
}

.section {
  margin-top: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: rgba(17, 17, 20, 0.88);
}

th,
td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: #101014;
}

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

.status,
.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.status.high,
.status.critical,
.status.banned,
.status.suspended {
  color: #ffd1d1;
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.12);
}

.status.queued,
.status.reviewing,
.status.law_enforcement_review {
  color: #ffe6a6;
  border-color: rgba(255, 209, 102, 0.45);
  background: rgba(255, 209, 102, 0.12);
}

.status.resolved,
.status.active,
.status.approved {
  color: #c8ffd2;
  border-color: rgba(105, 219, 124, 0.42);
  background: rgba(105, 219, 124, 0.1);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions button {
  padding: 7px 8px;
  border-radius: 8px;
  background: #202026;
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 12px;
}

.row-actions .danger {
  background: rgba(255, 107, 107, 0.12);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 12px;
}

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

.log-row {
  display: grid;
  grid-template-columns: 132px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.log-row:last-child {
  border-bottom: 0;
}

.json {
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d8d8e0;
  background: #0b0b0d;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  background: #151519;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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