:root {
  color-scheme: light;
  --bg: #f6f7f5;
  --panel: #ffffff;
  --ink: #16212b;
  --muted: #65717d;
  --line: #dce1e5;
  --pulse: #e83f4f;
  --teal: #0f8f8a;
  --navy: #213447;
  --gold: #f2b857;
  --soft: #edf4f1;
  --shadow: 0 18px 48px rgba(22, 33, 43, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(22, 33, 43, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(22, 33, 43, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.app-header,
.app-shell {
  width: min(1180px, calc(100% - 36px));
  margin-inline: auto;
}

.app-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 20px 0 12px;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-weight: 850;
  gap: 10px;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  border: 3px solid var(--pulse);
  border-radius: 50%;
  height: 24px;
  position: relative;
  width: 24px;
}

.brand-mark::after {
  background: var(--teal);
  content: "";
  height: 3px;
  left: 8px;
  position: absolute;
  top: 8px;
  transform: rotate(-22deg);
  width: 21px;
}

.inline-form {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.app-shell {
  padding: 28px 0 64px;
}

.auth-grid {
  align-items: start;
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  min-height: calc(100vh - 104px);
  padding-top: 58px;
}

.auth-copy {
  max-width: 720px;
  padding-top: 24px;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(2.7rem, 8vw, 6.4rem);
  letter-spacing: 0;
  line-height: 0.94;
  margin-bottom: 22px;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: 0;
  line-height: 1.08;
  margin-bottom: 18px;
}

.lede {
  color: var(--muted);
  font-size: clamp(1.04rem, 2vw, 1.25rem);
  max-width: 680px;
}

.mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.mini-metrics span {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(22, 33, 43, 0.06);
  font-weight: 850;
  padding: 14px 18px;
}

.auth-panels {
  display: grid;
  gap: 14px;
}

.panel,
.stat-card,
.notice {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 34px rgba(22, 33, 43, 0.06);
}

.panel {
  padding: 22px;
}

.notice {
  border-left: 5px solid var(--teal);
  color: var(--navy);
  font-weight: 750;
  margin: 0;
  padding: 14px 16px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.92rem;
  font-weight: 750;
  gap: 6px;
  margin-bottom: 13px;
}

input,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 143, 138, 0.14);
  outline: none;
}

button,
.button-link {
  align-items: center;
  background: #fff;
  border: 1px solid var(--navy);
  border-radius: 8px;
  color: var(--navy);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 850;
  justify-content: center;
  min-height: 44px;
  padding: 10px 15px;
  text-decoration: none;
}

button.primary,
.button-link {
  background: var(--navy);
  color: #fff;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
}

.dashboard-hero,
.report-header {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.dashboard-hero h1,
.report-header h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  margin-bottom: 10px;
}

.stats-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
}

.stats-grid.compact {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.stat-card {
  min-height: 142px;
  padding: 20px;
}

.stat-card span,
.stat-card small {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  margin: 18px 0 10px;
}

.chart-panel {
  margin-bottom: 18px;
}

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

.legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9rem;
  gap: 8px;
}

.dot {
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.dot.bp {
  background: var(--pulse);
}

.dot.hr {
  background: var(--teal);
}

.trend-chart {
  align-items: end;
  background: linear-gradient(180deg, #fdfdfb 0%, var(--soft) 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(18, minmax(14px, 1fr));
  height: 220px;
  padding: 18px;
}

.trend-pair {
  align-items: end;
  display: grid;
  gap: 3px;
  grid-template-columns: 1fr 1fr;
  height: 100%;
}

.bar {
  border-radius: 999px 999px 3px 3px;
  display: block;
  min-height: 10px;
}

.bar.bp {
  background: var(--pulse);
}

.bar.hr {
  background: var(--teal);
}

.empty-state {
  align-items: center;
  background: var(--soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  min-height: 160px;
  padding: 22px;
}

.work-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  margin-bottom: 18px;
}

.field-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.token-panel code {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  margin: 16px 0;
  overflow-wrap: anywhere;
  padding: 14px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fine-print {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 18px;
}

@media print {
  .app-header,
  .report-header button {
    display: none;
  }

  body {
    background: #fff;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .panel,
  .stat-card {
    box-shadow: none;
  }
}

@media (max-width: 900px) {
  .auth-grid,
  .work-grid,
  .dashboard-hero,
  .report-header {
    grid-template-columns: 1fr;
  }

  .auth-grid,
  .dashboard-hero,
  .report-header {
    display: grid;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-header,
  .app-shell {
    width: min(100% - 26px, 1180px);
  }

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

  .auth-grid {
    padding-top: 18px;
  }

  .stats-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

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