:root {
  --bg: #f4efe7;
  --bg-alt: #eadcc5;
  --panel: rgba(255, 252, 246, 0.88);
  --panel-strong: #fffaf1;
  --text: #19150f;
  --muted: #6e6458;
  --line: rgba(25, 21, 15, 0.12);
  --brand: #b45520;
  --brand-dark: #7a3414;
  --green: #2f7d4c;
  --red: #a63c2f;
  --shadow: 0 22px 64px rgba(99, 65, 32, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(180, 85, 32, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(47, 125, 76, 0.12), transparent 22%),
    linear-gradient(135deg, var(--bg) 0%, #f9f3ea 35%, var(--bg-alt) 100%);
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.07)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 42px,
      rgba(25, 21, 15, 0.028) 42px,
      rgba(25, 21, 15, 0.028) 43px
    );
}

.shell {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.hero,
.panel,
.control-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero,
.panel {
  padding: 30px;
}

.panel,
.dashboard {
  margin-top: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  font: 500 12px/1 "IBM Plex Mono", monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 16px;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 0.96;
}

.hero-copy,
.muted,
li,
.feedback {
  color: var(--muted);
  line-height: 1.6;
}

.metric-grid,
.stats-row,
.moderation-grid {
  display: grid;
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 26px;
}

.metric-card,
.stat-card {
  border-radius: 22px;
  border: 1px solid rgba(25, 21, 15, 0.08);
  background: var(--panel-strong);
  padding: 18px;
}

.metric-label,
.stat-card span {
  display: block;
  margin-bottom: 8px;
  font: 500 0.78rem/1 "IBM Plex Mono", monospace;
  color: var(--muted);
}

.auth-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}

.auth-card--empty {
  grid-template-columns: 1fr auto;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  object-fit: cover;
  border: 2px solid rgba(180, 85, 32, 0.24);
}

.pill-row,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row > * {
  flex: 0 0 auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(47, 125, 76, 0.12);
  color: var(--green);
  font: 500 0.82rem/1 "IBM Plex Mono", monospace;
}

.dashboard {
  display: grid;
  gap: 18px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.control-block {
  overflow: hidden;
}

.control-block summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
  padding: 24px 28px;
}

.control-block summary::-webkit-details-marker {
  display: none;
}

.control-body {
  padding: 0 28px 28px;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(25, 21, 15, 0.08);
  color: var(--muted);
  font: 500 0.85rem/1 "IBM Plex Mono", monospace;
}

.status-badge.online {
  background: rgba(47, 125, 76, 0.14);
  color: var(--green);
}

.status-badge.offline {
  background: rgba(166, 60, 47, 0.12);
  color: var(--red);
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(25, 21, 15, 0.12);
  border-radius: 16px;
  background: rgba(255, 252, 246, 0.9);
  color: var(--text);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 18px;
}

.moderation-grid {
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.1fr);
}

.inline-form > input,
.moderation-grid > input {
  min-width: 0;
}

.primary-button,
.ghost-button,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.button-row .ghost-button,
.button-row .action-button,
.inline-form .ghost-button,
.inline-form .primary-button {
  white-space: nowrap;
}

.primary-button,
.action-button {
  background: linear-gradient(135deg, var(--brand) 0%, #d5762c 100%);
  color: #fffaf3;
}

.ghost-button {
  background: transparent;
  color: var(--text);
  border-color: rgba(25, 21, 15, 0.12);
}

.action-button.warning {
  background: linear-gradient(135deg, #914126 0%, #b93f2e 100%);
}

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

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
}

.data-list {
  margin: 12px 0 0;
  padding-left: 18px;
}

.table-shell {
  margin-top: 12px;
  border: 1px solid rgba(25, 21, 15, 0.08);
  border-radius: 20px;
  overflow: hidden;
  background: var(--panel-strong);
}

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

.table-shell th,
.table-shell td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 15, 0.08);
}

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

.empty-state {
  padding: 20px;
  color: var(--muted);
}

.feedback {
  min-height: 24px;
  margin: 12px 0 0;
}

.feedback.success {
  color: var(--green);
}

.feedback.error {
  color: var(--red);
}

code {
  font-family: "IBM Plex Mono", monospace;
}

@media (max-width: 920px) {
  .metric-grid,
  .stats-row,
  .moderation-grid,
  .auth-card,
  .auth-card--empty,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .button-row > * {
    flex: 1 1 180px;
  }

  .button-row .ghost-button,
  .button-row .action-button,
  .inline-form .ghost-button,
  .inline-form .primary-button {
    width: 100%;
  }

  .control-block summary,
  .list-header {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .button-row > * {
    flex-basis: 100%;
  }
}
