:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --card: #15161a;
  --muted: #9398a4;
  --text: #f2f3f5;
  --border: #2a2d35;
  --accent: #f4b740;
  --danger: #cf4b4b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(11, 11, 13, 0.92);
  backdrop-filter: blur(8px);
}

.topbar h1 {
  margin: 0;
  font-size: 1.05rem;
}

.topbar p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-status {
  font-size: 0.86rem;
  color: var(--muted);
}

.container {
  max-width: 1200px;
  margin: 1.25rem auto;
  padding: 0 1rem 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.warning {
  border-color: var(--accent);
}

.grid {
  display: grid;
  gap: 0.85rem;
}

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

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

.full {
  grid-column: 1 / -1;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.86rem;
  gap: 0.38rem;
}

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

input,
textarea,
select {
  width: 100%;
  background: #111319;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
}

button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #1a1d25;
  color: var(--text);
  padding: 0.6rem 0.8rem;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: #1a1204;
  border-color: #d0992f;
  font-weight: 600;
}

button.danger {
  background: var(--danger);
  border-color: #a53e3e;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tab.active {
  border-color: var(--accent);
  color: var(--accent);
}

.right {
  margin-left: auto;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

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

.stat {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
}

.stat p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.stat h4 {
  margin: 0.35rem 0 0;
  font-size: 1.2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

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

th {
  color: var(--muted);
  font-weight: 500;
}

.actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

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

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.three,
  .grid.two {
    grid-template-columns: 1fr;
  }
}
