:root {
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --done: #16a34a;
  --partial: #d97706;
  --missing: #dc2626;
  --extra: #2563eb;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --line: #e5e7eb;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

nav.topbar {
  background: var(--accent);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
}
nav.topbar .brand { font-weight: 700; font-size: 17px; margin-right: 16px; }
nav.topbar a { color: #e0e7ff; padding: 8px 12px; border-radius: 8px; font-size: 14px; }
nav.topbar a:hover { background: rgba(255,255,255,.15); text-decoration: none; }
nav.topbar a.active { background: rgba(255,255,255,.22); color: #fff; }
nav.topbar .spacer { flex: 1; }
nav.topbar .who { font-size: 13px; color: #c7d2fe; margin-right: 8px; }
nav.topbar form { margin: 0; }
nav.topbar button.link {
  background: rgba(255,255,255,.15); color: #fff; border: 0; padding: 7px 12px;
  border-radius: 8px; cursor: pointer; font-size: 13px;
}

.container { max-width: 1100px; margin: 28px auto; padding: 0 20px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 28px 0 12px; }
.subtle { color: var(--muted); font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.flash {
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px;
}
.errorbox {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px;
}

label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 14px; font-family: inherit; background: #fff;
}
textarea { min-height: 160px; resize: vertical; }
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 0;
  padding: 10px 18px; border-radius: 9px; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn.ghost { background: #eef2ff; color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: #fee2e2; color: #991b1b; }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 4px; }
.stat {
  flex: 1; min-width: 120px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; text-align: center;
}
.stat .num { font-size: 28px; font-weight: 700; }
.stat .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat.done .num { color: var(--done); }
.stat.partial .num { color: var(--partial); }
.stat.missing .num { color: var(--missing); }
.stat.accent .num { color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:hover td { background: #fafafa; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px;
  font-weight: 700; color: #fff;
}
.badge.done { background: var(--done); }
.badge.partial { background: var(--partial); }
.badge.missing { background: var(--missing); }
.badge.role { background: #e0e7ff; color: var(--accent-dark); }

.task-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.task-item:last-child { border-bottom: 0; }
.task-item .evidence { color: var(--muted); font-size: 13px; font-style: italic; margin-top: 4px; }

.bar { background: var(--line); border-radius: 999px; height: 8px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.bar.high > span { background: var(--done); }
.bar.mid > span { background: var(--partial); }
.bar.low > span { background: var(--missing); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar form { display: flex; gap: 8px; align-items: center; margin: 0; }
.toolbar select, .toolbar input { width: auto; }
.rank { font-weight: 700; color: var(--muted); width: 28px; }

.login-wrap { max-width: 380px; margin: 80px auto; }
.login-wrap .card { padding: 28px; }
.muted-link { color: var(--muted); font-size: 13px; }
