:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #181b1f;
  --panel-soft: #20242a;
  --text: #f3f4f6;
  --muted: #a7b0bd;
  --line: #303741;
  --brand: #26d0a8;
  --accent: #f2c14e;
  --danger: #f97066;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

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

.sidebar {
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  background: #14171a;
}

.brand {
  display: grid;
  gap: 4px;
  margin-bottom: 28px;
}

.brand strong {
  font-size: 18px;
}

.brand span,
.nav a,
.meta {
  color: var(--muted);
}

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

.nav a {
  border-radius: 8px;
  padding: 10px 12px;
  text-decoration: none;
}

.nav a[aria-current="page"],
.nav a:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.main {
  padding: 28px;
}

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

.topbar h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric,
.module {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

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

.module {
  min-height: 150px;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.module header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.module h2 {
  margin: 0;
  font-size: 18px;
}

.module p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.status {
  color: #111315;
  background: var(--brand);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

.logout {
  margin-top: 24px;
}

.logout button,
.login-form button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 14px;
  background: var(--brand);
  color: #101214;
  font-weight: 800;
  cursor: pointer;
}

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

.auth-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 28px;
}

.auth-brand {
  margin-bottom: 22px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111417;
  color: var(--text);
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
}

.login-form input:focus {
  border-color: var(--brand);
  outline: 2px solid rgb(38 208 168 / 20%);
}

.alert {
  border: 1px solid rgb(249 112 102 / 45%);
  border-radius: 8px;
  background: rgb(249 112 102 / 12%);
  color: #ffd7d3;
  margin-bottom: 16px;
  padding: 12px;
}

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

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

  .summary,
  .modules {
    grid-template-columns: 1fr;
  }

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