:root {
    --ink: #12211b;
    --muted: #64746d;
    --paper: #f4f8f6;
    --card: #ffffff;
    --line: #dbe5e0;
    --brand: #087a5b;
    --brand-dark: #055a43;
    --mint: #dff5eb;
    --amber: #a86500;
    --red: #b42318;
    --shadow: 0 18px 48px rgba(18, 33, 27, .08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: radial-gradient(circle at 15% 0%, #dff5eb 0, transparent 30rem), var(--paper);
    font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--brand); }
code { padding: .1rem .35rem; border-radius: .35rem; background: #edf2ef; }
h1, h2 { margin: 0; letter-spacing: -.035em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
h2 { font-size: 1.35rem; }
p { color: var(--muted); }
.topbar, .container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 38px 0 22px; }
.container { padding-bottom: 48px; }
.narrow { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card, .setup { width: min(440px, 100%); }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 16px; background: var(--brand); color: white; font-weight: 850; box-shadow: 0 10px 24px rgba(8,122,91,.25); }
.eyebrow { display: block; color: var(--brand); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.card { position: relative; padding: 24px; border: 1px solid rgba(219,229,224,.85); border-radius: 20px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 10px 0 20px; }
.stat { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.7); }
.stat span { display: block; color: var(--muted); font-size: .82rem; }
.stat strong { font-size: 1.9rem; letter-spacing: -.04em; }
.success-stat strong { color: var(--brand); }
.error-stat strong { color: var(--red); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.grid .card { overflow: hidden; }
.step { position: absolute; top: 17px; right: 18px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--brand-dark); font-weight: 850; }
.stack { display: grid; gap: 14px; margin-top: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.form-row button { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: #34463e; font-size: .85rem; font-weight: 720; }
input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #c8d6cf; border-radius: 10px; background: white; color: var(--ink); font: inherit; }
input:focus { outline: 3px solid rgba(8,122,91,.14); border-color: var(--brand); }
input[type=file] { padding: 7px; }
button, .button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 10px 16px; border: 0; border-radius: 11px; background: var(--brand); color: white; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--brand-dark); }
button:disabled { opacity: .45; cursor: not-allowed; }
.button.secondary { margin-top: 12px; background: var(--ink); }
.ghost { min-height: 38px; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.alert { margin: 0 0 18px; padding: 13px 15px; border-radius: 12px; border: 1px solid transparent; }
.alert.success { color: #0b6048; background: #e5f7ef; border-color: #bde8d5; }
.alert.warning { color: #704500; background: #fff4d6; border-color: #f0d58a; }
.alert.error { color: #8b1d15; background: #ffebe9; border-color: #f4c4bf; }
.table-card { margin-top: 18px; padding: 0; overflow: hidden; }
.section-heading { display: flex; align-items: end; justify-content: space-between; padding: 22px 24px; }
.privacy-note { padding: 6px 10px; border-radius: 999px; background: var(--mint); color: var(--brand-dark); font-size: .75rem; font-weight: 800; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid #edf1ef; }
th { color: var(--muted); background: #f8faf9; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
td { min-width: 130px; }
td.detail { max-width: 260px; color: var(--red); font-size: .82rem; }
.badge { display: inline-block; padding: 4px 9px; border-radius: 999px; background: #edf1ef; font-size: .75rem; font-weight: 800; }
.badge.invited { color: #145a8a; background: #e7f2fb; }
.badge.joined { color: var(--brand-dark); background: var(--mint); }
.badge.error { color: var(--red); background: #ffebe9; }
.empty { padding: 38px; color: var(--muted); text-align: center; }
small { color: var(--muted); }
footer { padding: 26px 8px; color: var(--muted); text-align: center; font-size: .82rem; }

@media (max-width: 850px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .topbar { padding-top: 24px; }
    .topbar h1 { font-size: 1.55rem; }
    .stats { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .section-heading { align-items: flex-start; gap: 16px; flex-direction: column; }
}
