:root {
  color-scheme: light;
  --bg: #eef3ec;
  --ink: #19221b;
  --muted: #667067;
  --line: #d5dfd3;
  --panel: #fbfdf8;
  --accent: #1f7a4b;
  --accent-2: #bf6f28;
  --accent-3: #245c92;
  --accent-4: #9b3f3f;
  --shadow: 0 18px 50px rgba(25, 34, 27, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(31, 122, 75, 0.08), transparent 38%),
    radial-gradient(circle at 85% 10%, rgba(191, 111, 40, 0.12), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 30px clamp(18px, 4vw, 48px) 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 0.95;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.range-tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
}

.range-tabs button,
.logout,
.login-form button {
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.range-tabs button {
  padding: 9px 12px;
  background: transparent;
  color: var(--muted);
}

.range-tabs button.active {
  background: var(--ink);
  color: #fff;
}

.logout {
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
}

.dashboard {
  padding: 0 clamp(18px, 4vw, 48px) 48px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.metric-card,
.chart-panel,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

.metric-card span,
.panel-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
}

.chart-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.chart-panel {
  min-height: 330px;
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.chart {
  width: 100%;
  height: 250px;
}

.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.axis {
  stroke: #c5d0c3;
  stroke-width: 1;
}

.line {
  fill: none;
  stroke-width: 3;
}

.area {
  opacity: 0.14;
}

.dot {
  stroke: var(--panel);
  stroke-width: 2;
}

.empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-shell {
  width: min(440px, 100%);
}

.login-panel {
  padding: 28px;
}

.login-panel h1 {
  font-size: 32px;
  line-height: 1.05;
}

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

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

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 13px 14px;
}

.login-form button {
  padding: 14px;
  background: var(--accent);
  color: #fff;
}

@media (max-width: 980px) {
  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .range-tabs {
    overflow-x: auto;
  }

  .metric-grid,
  .chart-layout {
    grid-template-columns: 1fr;
  }
}
