:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --stroke: #e2e8f0;
  --text: #1f2a44;
  --muted: #64748b;
  --accent: #4f8cff;
  --accent-2: #10b981;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--stroke);
}

.brand {
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 13px;
}

.tag {
  font-size: 12px;
  color: var(--accent-2);
  font-weight: 600;
}

nav a {
  margin-left: 20px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

nav a:hover {
  color: var(--text);
}

.hero {
  max-width: 760px;
  margin: 56px auto 32px;
  padding: 0 24px;
  text-align: center;
}

.hero h1 {
  font-size: 34px;
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.panel {
  max-width: 860px;
  margin: 0 auto 32px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 16px;
}

.panel h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
  margin-bottom: 20px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 420px;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.form input {
  padding: 11px 13px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text);
}

.btn {
  align-self: flex-start;
  padding: 11px 22px;
  border: none;
  border-radius: 10px;
  background: var(--accent-2);
  color: white;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.result {
  font-size: 14px;
  min-height: 18px;
}

.result.ok {
  color: var(--accent-2);
}

.result.inline {
  margin: 0;
  flex: 1;
}

.hidden {
  display: none;
}

.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.link-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
}

.link-row input {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font-size: 14px;
}

.dashboard {
  display: grid;
  gap: 16px;
}

.household-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 16px;
}

.household-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.code {
  font-family: ui-monospace, monospace;
  background: #eef2ff;
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.learner-list {
  display: grid;
  gap: 10px;
}

.learner-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--stroke);
}

.learner-name {
  font-weight: 600;
}

.pct {
  font-weight: 700;
  color: var(--accent-2);
}

.track {
  grid-column: 1 / -1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.fill {
  height: 100%;
  background: var(--accent-2);
  border-radius: 999px;
}

.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--stroke);
  border-radius: 12px;
}

.small {
  font-size: 12px;
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text);
}

.btn.accent {
  background: var(--accent-2);
  color: white;
}

.panel.inner {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--stroke);
}

.form.compact label {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}

.form.compact input,
.form.compact textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font: inherit;
}

.fsm-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #d1fae5;
  color: #047857;
}

.fsm-badge.pending {
  background: #fef3c7;
  color: #b45309;
}

.fsm-meta {
  margin-bottom: 12px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.tile {
  padding: 18px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--bg);
}

.tile h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.tile p {
  color: var(--muted);
  font-size: 14px;
}

.foot {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-size: 13px;
}
