:root {
  color-scheme: dark;
  --bg: #12110f;
  --panel: rgba(18, 17, 15, 0.70);
  --text: #f6f1e8;
  --muted: #a59f95;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #d4b36f;
  --accent-strong: #e4c986;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

body.auth-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 48% 32% at 58% 28%, rgba(212, 179, 111, 0.13), rgba(212, 179, 111, 0.035) 38%, transparent 70%),
    radial-gradient(ellipse 78% 62% at 50% 42%, rgba(255, 255, 255, 0.045), transparent 60%),
    linear-gradient(135deg, #12110f 0%, #191a18 48%, #0e1111 100%);
  color: var(--text);
}

body.auth-page::before {
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(22px);
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

a {
  color: inherit;
}

.topbar {
  align-items: center;
  background: rgba(18, 17, 15, 0.76);
  backdrop-filter: blur(24px);
  display: flex;
  gap: 32px;
  min-height: 56px;
  padding: 0 24px;
}

.auth-page .topbar {
  display: none;
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 18px;
}

.nav a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
}

.logout {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.logout span {
  color: var(--muted);
  font-size: 11px;
}

.logout button,
.button {
  align-items: center;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #171511;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  text-decoration: none;
}

.logout button {
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
}

.button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
}

.secondary-button:hover {
  background: #f2f4f7;
}

.page {
  margin: 0 auto;
  max-width: 1120px;
  padding: 32px 24px;
}

.auth-page .page {
  align-items: center;
  display: grid;
  max-width: none;
  min-height: 100vh;
  padding: 28px;
  position: relative;
  z-index: 1;
}

.page-header {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
}

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

h1 {
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 8px;
}

h2 {
  font-size: 14px;
  margin-bottom: 12px;
}

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

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

.grid-wide {
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
}

.panel {
  background: var(--panel);
  border: 0;
  border-radius: 8px;
  padding: 16px;
  backdrop-filter: blur(24px);
}

.metric h2 {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
}

.metric-value {
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .logout {
    margin-left: 0;
  }

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

  .grid-wide,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .auth-page .page {
    padding: 16px;
  }
}
