:root {
  --purple: #7b2fd9;
  --blue: #2f6bff;
  --ink: #161a2e;
  --slate: #5b6180;
  --mist: #f5f6fb;
  --line: #dfe2ef;
  --white: #fff;
  --ok: #e6f6ec;
  --ok-ink: #14613a;
  --bad: #fdeaea;
  --bad-ink: #9b1c1c;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 15px/1.55 Manrope, Helvetica, Arial, sans-serif;
}

a { color: var(--blue); }
a:hover { color: var(--purple); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

h1 { margin: 0 0 6px; font-size: 28px; font-weight: 800; line-height: 1.2; }
h2 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
h3 { margin: 18px 0 8px; font-size: 15px; font-weight: 800; }
p { margin: 0 0 10px; }

.shell { display: flex; min-height: 100vh; }

.side {
  flex: 0 0 230px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 16px;
  background: var(--ink);
  color: var(--white);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 17px; font-weight: 800; }
.brand span { font-size: 12px; color: #c8cce0; }

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 10px;
  background: var(--white);
  color: var(--purple);
  font-size: 17px;
  font-weight: 800;
}

.menu { display: flex; flex-direction: column; gap: 6px; }

.menu a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
}

.menu a:hover { background: #2a3050; }
.menu a[aria-current] { background: var(--purple); }

.signout { margin-top: auto; }

.signout button {
  width: 100%;
  border-color: #343a58;
  background: transparent;
  color: #c8cce0;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 24px;
}

.page-head p, .muted { color: var(--slate); }
.muted { font-size: 13px; }

.card {
  min-width: 0;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

fieldset.card { min-width: 0; }
legend { float: left; width: 100%; margin-bottom: 12px; padding: 0; font-size: 18px; font-weight: 800; }
legend + * { clear: both; }

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  color: var(--white);
}

.hero span { font-size: 13px; font-weight: 600; }
.hero h1 { margin-top: 4px; }
.hero p { margin: 0; }

.hero-button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--white);
  color: var(--purple);
  font-weight: 700;
  text-decoration: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat span { display: block; font-size: 13px; font-weight: 600; color: var(--slate); }
.stat strong { display: block; margin-top: 6px; font: 500 34px/1.2 var(--mono); }
.stat small { display: block; margin-top: 4px; font-size: 12px; color: var(--slate); }

.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > * { flex: 2 1 280px; }
.split > .wide { flex: 3 1 420px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 420px; border-collapse: collapse; font-size: 14px; }
th { padding: 8px; border-bottom: 1px solid var(--line); color: var(--slate); font-size: 13px; font-weight: 600; text-align: left; }
td { padding: 12px 8px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 0; }
.strong { font-weight: 700; }
.mono { font-family: var(--mono); }

.line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; }
.line.small { margin-top: 10px; font-size: 13px; font-weight: 400; }

.bar { height: 10px; margin: 8px 0 18px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar.thin { height: 7px; margin: 4px 0 0; }
.bar > div { height: 100%; border-radius: 6px; background: var(--purple); }
.bar.thin > div { background: var(--blue); }
.w0 { width: 0; } .w5 { width: 5%; } .w10 { width: 10%; } .w15 { width: 15%; }
.w20 { width: 20%; } .w25 { width: 25%; } .w30 { width: 30%; } .w35 { width: 35%; }
.w40 { width: 40%; } .w45 { width: 45%; } .w50 { width: 50%; } .w55 { width: 55%; }
.w60 { width: 60%; } .w65 { width: 65%; } .w70 { width: 70%; } .w75 { width: 75%; }
.w80 { width: 80%; } .w85 { width: 85%; } .w90 { width: 90%; } .w95 { width: 95%; }
.w100 { width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: 700 14px/1.2 Manrope, Helvetica, Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.chip:hover, button:hover { border-color: var(--purple); color: var(--ink); }
.chip[aria-current], button[aria-pressed="true"] { border-color: var(--purple); background: var(--purple); color: var(--white); }

button.primary { border-color: var(--purple); background: var(--purple); color: var(--white); }
button.primary:hover { border-color: var(--ink); background: var(--ink); color: var(--white); }

label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--slate); }

input[type="text"], input:not([type]), input[type="password"], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: 400 14px/1.5 Manrope, Helvetica, Arial, sans-serif;
}

textarea { resize: vertical; }

.custom { margin-top: 14px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; }
.inline input { flex: 1 1 220px; width: auto; }

.checks { display: flex; flex-wrap: wrap; gap: 8px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}

.check:has(input:checked) { border-color: var(--purple); background: #f3ecfd; }
.check input { accent-color: var(--purple); }

.email {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.notice.ok { background: var(--ok); color: var(--ok-ink); }
.notice.error { background: var(--bad); color: var(--bad-ink); }

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.column { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.column h2 { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 15px; }

.lead {
  display: block;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
}

.lead:hover { border-color: var(--purple); color: var(--ink); }
.lead strong { display: block; font-size: 13px; font-weight: 800; overflow-wrap: anywhere; }
.lead span { display: block; color: var(--slate); }
.lead .mono { margin-top: 6px; color: var(--ink); }

.back { font-size: 14px; font-weight: 600; }
.big-score { font-size: 38px; font-weight: 500; color: var(--purple); }

dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 14px 0 0; font-size: 14px; }
dt { color: var(--slate); font-weight: 600; }
dd { margin: 0; overflow-wrap: anywhere; }

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }

.login {
  width: 100%;
  max-width: 380px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.login .logo { border: 1px solid var(--line); }
.login h1 { margin: 14px 0 0; font-size: 24px; }
.login p { color: var(--slate); }
.login .notice { margin-bottom: 12px; }
.login button { width: 100%; margin-top: 14px; }

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat strong { font-size: 28px; }
  .shell { flex-direction: column; }
  .side { flex: none; gap: 12px; padding: 12px 16px; }
  .menu { flex-direction: row; overflow-x: auto; }
  .menu a { flex: none; min-height: 44px; font-size: 14px; }
  .signout { margin-top: 0; }
  .main { padding: 20px 16px; }
  h1 { font-size: 24px; }
  dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dd { margin-bottom: 8px; }
}
