:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --subtle: #475569;
  --line: #dbe4f0;
  --primary: #0f766e;
  --primary-ink: #ecfeff;
  --download: #2563eb;
  --active: #f97316;
  --error: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% -5%, #e2f1ff 0, transparent 35%),
    radial-gradient(circle at 90% -15%, #d1fae5 0, transparent 40%),
    var(--bg);
  font-family: "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
}

.app-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(140deg, #0ea5e9, #22c55e);
}

.session-meta {
  color: var(--subtle);
  font-size: 13px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

#loginView {
  max-width: 420px;
  margin: 32px auto;
}

h1,
h2 {
  margin: 0 0 10px;
}

.hint {
  margin: 0 0 16px;
  color: var(--subtle);
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--subtle);
}

input {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.primary {
  background: var(--primary);
  color: var(--primary-ink);
}

.ghost {
  background: #e2e8f0;
  color: #0f172a;
}

.error {
  color: var(--error);
  margin: 10px 0 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  background: #f8fafc;
  border: 1px solid #d9e4f0;
  border-radius: 12px;
  padding: 16px;
}

.metric-card span {
  display: block;
  color: var(--subtle);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric-card strong {
  font-size: 24px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.legend {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--subtle);
  margin-top: 8px;
}

.line {
  width: 16px;
  height: 3px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 999px;
}

.line-download {
  background: var(--download);
}

.line-active {
  background: var(--active);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  padding: 8px;
  text-align: left;
}

.hidden {
  display: none !important;
}

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

