:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #1b1c20;
  --panel-2: #24252a;
  --line: #3d3f47;
  --text: #f4f4f5;
  --muted: #9ca3af;
  --blue: #6667ff;
  --green: #00d084;
  --red: #ff4057;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top left, rgba(102,103,255,.18), transparent 34%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-panel {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(27, 28, 32, .86);
  box-shadow: 0 30px 90px rgba(0,0,0,.4);
}
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #7447ff, #0eb7ff);
  font-weight: 900;
}
.brand-mark.small { width: 34px; height: 34px; border-radius: 12px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
label { display: grid; gap: 8px; margin: 18px 0; color: var(--muted); font-weight: 700; font-size: 13px; }
input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #101116;
  color: var(--text);
}
button {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 16px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}
button:hover { border-color: #626677; transform: translateY(-1px); }
form button, #refreshButton { background: var(--blue); border-color: var(--blue); font-weight: 800; }
.message { min-height: 20px; color: var(--red); }
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: rgba(5,6,8,.84);
  border-right: 1px solid var(--line);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.nav-item, .logout {
  text-align: left;
  background: transparent;
  border-color: transparent;
  font-weight: 800;
}
.nav-item.active, .nav-item:hover {
  background: linear-gradient(180deg, #303137, #24252b);
  border-color: var(--line);
}
.logout { margin-top: auto; color: var(--muted); }
.workspace { min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(27,28,32,.78);
}
.topbar h1 { margin-bottom: 4px; }
.muted { color: var(--muted); }
.panel {
  max-width: 1240px;
  padding: 30px 32px 60px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.metric-value { font-size: 34px; font-weight: 900; }
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.list { display: grid; gap: 10px; }
.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
}
.pill {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(102,103,255,.14);
  color: #a9a9ff;
  font-size: 12px;
  font-weight: 800;
}
.progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #101116;
}
.progress span { display: block; height: 100%; background: var(--green); }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .grid, .two-col { grid-template-columns: 1fr; }
}
