/* NEXUSTAT web app — brand tokens from "NEXUSTAT Brand Guidelines" */
:root {
  --brown: #210E0A;      /* primary: logo, headings, text, lines */
  --taupe: #B99C4B;      /* accent: the Insight Spark, key figures */
  --blue: #CED9D9;       /* secondary background, chart fills */
  --navy: #201D3E;       /* dark background, second chart series */
  --cream: #E7DCAD;      /* warm background */
  --offwhite: #EDEDED;   /* page background */
  --paper: #FAF8F3;
  --line: #D9D3C4;
  --muted: #6B5E57;
  --danger: #9B2C1F;
  --ok: #2F6B3A;
  --radius: 10px;
  --ar: 'Readex Pro', system-ui, sans-serif;
  --en: 'Finlandica', 'Readex Pro', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--offwhite); color: var(--brown);
  font-family: var(--ar); font-size: 17px; line-height: 1.8;
  font-variant-numeric: tabular-nums;
}
a { color: var(--brown); }
.splash { min-height: 100vh; display: grid; place-items: center; }

/* Auth screens */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 32px 28px;
}
.auth-card .logo { display: block; width: 210px; max-width: 70%; margin: 0 auto 24px; }
.auth-card h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.auth-card p.lead { color: var(--muted); margin: 0 0 20px; font-size: 15px; }

label { display: block; font-size: 14px; font-weight: 500; margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=text], select {
  width: 100%; font: inherit; font-size: 16px; color: var(--brown);
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--taupe); outline-offset: 1px; }
input.code { font-family: var(--en); letter-spacing: .35em; text-align: center; font-size: 24px; direction: ltr; }

button {
  font: inherit; font-weight: 500; font-size: 16px; cursor: pointer;
  border-radius: 8px; padding: 10px 18px; border: 1px solid var(--brown);
  background: var(--brown); color: var(--offwhite);
}
button.secondary { background: transparent; color: var(--brown); }
button.link { background: none; border: none; color: var(--muted); padding: 4px 0; text-decoration: underline; font-size: 14px; }
button[disabled] { opacity: .55; cursor: progress; }
.actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 22px; flex-wrap: wrap; }
.actions.end { justify-content: flex-end; }

.msg { border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 14px 0 0; }
.msg.error { background: #F6E3DF; color: var(--danger); }
.msg.ok { background: #E3EFE1; color: var(--ok); }
.msg.note { background: var(--cream); color: var(--brown); }

.qr { display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 12px 0; }
.qr img { width: 190px; height: 190px; }
.secret { font-family: var(--en); direction: ltr; text-align: center; font-size: 13px; word-break: break-all; color: var(--muted); }
ol.steps { padding-inline-start: 20px; margin: 0; font-size: 15px; }

/* App shell */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.top .logo { height: 30px; }
.top .who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.top select { width: auto; padding: 6px 10px; font-size: 14px; }
nav.tabs { display: flex; gap: 4px; padding: 0 24px; background: var(--paper); border-bottom: 1px solid var(--line); overflow-x: auto; }
nav.tabs button {
  background: none; color: var(--muted); border: none; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 12px 14px; white-space: nowrap;
}
nav.tabs button[aria-current=page] { color: var(--brown); border-bottom-color: var(--taupe); }
.page { max-width: 1100px; margin: 0 auto; padding: 28px 24px 64px; }
.page h2 { font-size: 24px; font-weight: 600; margin: 0 0 6px; }
.page .sub { color: var(--muted); margin: 0 0 24px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { font-size: 15px; font-weight: 500; color: var(--muted); margin: 0 0 6px; }
.card .figure { font-family: var(--en); font-size: 34px; line-height: 1.2; }
.card .figure small { font-size: 16px; color: var(--muted); }
.card p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.spark { width: 22px; height: 22px; vertical-align: middle; margin-inline-start: 6px; }

.soon { border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); background: var(--paper); }
.soon strong { color: var(--brown); display: block; font-size: 18px; margin-bottom: 4px; }

table.data { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 15px; }
table.data th { text-align: start; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #F3EFE6; }
table.data td { padding: 10px 14px; border-bottom: 1px solid #ECE7DC; }
table.data tr:last-child td { border-bottom: none; }
td.ltr, .ltr { direction: ltr; text-align: end; font-family: var(--en); }
.pill { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; background: var(--blue); }
.pill.trial { background: var(--cream); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 18px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.badge-synthetic { display: inline-block; background: var(--navy); color: var(--offwhite); font-size: 12px; border-radius: 6px; padding: 2px 8px; }

@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  .top .logo { height: 24px; }
  nav.tabs { padding: 0 8px; }
  .page { padding: 20px 16px 48px; }
}
