:root {
  color-scheme: light;
  --ink: #171815;
  --muted: #62665e;
  --line: #d8dbd2;
  --paper: #f4f4ee;
  --card: #fffef9;
  --blue: #1149ee;
  --blue-dark: #0a31ad;
  --green: #15734f;
  --red: #a22b2b;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.wordmark { margin: 0; color: var(--blue); font-size: 1.1rem; font-weight: 850; letter-spacing: .13em; text-transform: lowercase; }
.eyebrow { margin: 0 0 .55rem; color: var(--blue); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 50% 0, #fff 0, var(--paper) 48rem); }
.login-shell { width: min(100%, 31rem); }
.login-card { padding: clamp(2rem, 6vw, 3.4rem); border: 1px solid var(--line); border-radius: 1.35rem; background: var(--card); box-shadow: 0 1.2rem 4rem rgba(29, 32, 23, .08); }
.login-card .wordmark { margin-bottom: 3.5rem; }
.login-card h1 { margin: 0; max-width: 10ch; font-size: clamp(2.2rem, 7vw, 3.5rem); line-height: .98; letter-spacing: -.055em; }
.lede { margin: 1.25rem 0 2rem; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.proof-stage { min-height: 4.4rem; display: flex; align-items: center; }
.proof-note, .quiet { color: var(--muted); font-size: .86rem; line-height: 1.5; }
.email-form { margin-top: 1.35rem; }
.email-form label { display: block; margin-bottom: .45rem; font-size: .82rem; font-weight: 750; }
.email-form input { width: 100%; padding: .9rem 1rem; border: 1px solid #b9beb3; border-radius: .72rem; background: #fff; color: var(--ink); }
.email-form input:focus { outline: 3px solid rgba(17, 73, 238, .2); border-color: var(--blue); }
.email-form button, .admin-identity button { width: 100%; margin-top: .75rem; padding: .9rem 1rem; border: 0; border-radius: .72rem; background: var(--blue); color: #fff; font-weight: 800; }
.email-form button:hover, .admin-identity button:hover { background: var(--blue-dark); }
.notice { margin: 1.5rem 0 0; padding: 1rem 1.1rem; border-radius: .75rem; font-size: .94rem; line-height: 1.55; }
.notice.success { background: #e7f5ed; color: var(--green); }
.notice.error { background: #fae8e6; color: var(--red); }

.dashboard-page { min-height: 100vh; display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 2rem 1.25rem 1.2rem; border-right: 1px solid #252721; background: #171815; color: #fff; }
.sidebar .wordmark { color: #fff; }
.sidebar-label { margin: .3rem 0 2rem; color: #9da294; font-size: .72rem; letter-spacing: .15em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: .35rem; }
.sidebar nav a, .sidebar nav span { padding: .72rem .8rem; border-radius: .58rem; color: #afb3a8; text-decoration: none; font-size: .9rem; }
.sidebar nav a:hover, .sidebar nav a:focus-visible { background: #2a2c26; color: #fff; }
.sidebar nav span { opacity: .55; }
.admin-identity { margin-top: auto; padding-top: 1.5rem; border-top: 1px solid #34362f; }
.admin-identity strong, .admin-identity span { display: block; overflow: hidden; text-overflow: ellipsis; }
.admin-identity strong { font-size: .88rem; }
.admin-identity span { margin-top: .25rem; color: #92978b; font-size: .72rem; line-height: 1.4; }
.admin-identity button { margin-top: 1rem; padding: .65rem .8rem; background: #30332b; }
.dashboard { min-width: 0; padding: clamp(2rem, 5vw, 4.5rem); }
.dashboard-header { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2.5rem; }
.dashboard-header h1 { margin: 0; font-size: clamp(2.3rem, 5vw, 4.7rem); line-height: .98; letter-spacing: -.06em; }
.period { margin: 0; color: var(--muted); text-align: right; font-size: .78rem; line-height: 1.5; }
.period strong { color: var(--ink); font-size: 1rem; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.metric-grid article, .summary-card, .empty-state { border: 1px solid var(--line); border-radius: .9rem; background: var(--card); }
.metric-grid article { min-height: 8.5rem; display: flex; flex-direction: column; justify-content: space-between; padding: 1rem; }
.metric-grid span { color: var(--muted); font-size: .78rem; }
.metric-grid strong { font-size: 2.65rem; line-height: 1; letter-spacing: -.06em; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .8rem; }
.summary-card { padding: 1.4rem; }
.summary-card h2, .empty-state h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.025em; }
.summary-card dl { margin: 1.5rem 0 0; }
.summary-card dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-top: 1px solid #e8e9e3; }
.summary-card dt { color: var(--muted); font-size: .84rem; }
.summary-card dd { margin: 0; font-weight: 750; text-align: right; }
.generated { color: var(--muted); font-size: .74rem; }
.empty-state { max-width: 46rem; padding: 2rem; }
.empty-state p:last-child { margin-bottom: 0; color: var(--muted); }
.beta-control { margin-top: 2.5rem; padding: clamp(1.4rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: .9rem; background: var(--card); scroll-margin-top: 2rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.section-heading h2 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.section-heading > strong { color: var(--muted); font-size: .82rem; }
.section-intro { max-width: 46rem; color: var(--muted); line-height: 1.6; }
.beta-invite { margin: 1.5rem 0; padding: 1rem; border-radius: .75rem; background: #f1f3ff; }
.beta-invite label { display: block; margin-bottom: .5rem; font-size: .8rem; font-weight: 750; }
.beta-invite > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; }
.beta-invite input { min-width: 0; padding: .75rem .85rem; border: 1px solid #b9beb3; border-radius: .58rem; }
.beta-invite button, .tester-list button { padding: .72rem 1rem; border: 0; border-radius: .58rem; background: var(--blue); color: #fff; font-weight: 750; }
.tester-list { display: grid; }
.tester-list article { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-top: 1px solid #e8e9e3; }
.tester-list article > div { min-width: 0; }
.tester-list article strong, .tester-list article span { display: block; overflow-wrap: anywhere; }
.tester-list article span { margin-top: .25rem; color: var(--muted); font-size: .76rem; }
.tester-list form { flex: none; }
.tester-list button.secondary { background: #eceee7; color: var(--ink); }
.tester-empty { margin: 0; padding: 1.2rem 0 0; border-top: 1px solid #e8e9e3; color: var(--muted); }

@media (max-width: 900px) {
  .dashboard-page { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; }
  .sidebar nav { display: none; }
  .admin-identity { margin: 0; padding: 0; border: 0; text-align: right; }
  .admin-identity button { width: auto; margin-top: .5rem; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .dashboard { padding: 1.35rem; }
  .dashboard-header { align-items: start; flex-direction: column; }
  .period { text-align: left; }
  .summary-grid { grid-template-columns: 1fr; }
  .beta-invite > div { grid-template-columns: 1fr; }
}
