:root {
  --bg: #f5f6f4;
  --panel: #fbfbfa;
  --border: #dcdfda;
  --text: #1b2430;
  --muted: #5b6b66;
  --brand: #2f6f5e;
  --brand-dark: #1f4a3d;
  --brand-soft: #eaf2ee;
  --danger: #b3413a;
  --success: #2f6f5e;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(20, 30, 25, 0.06);
}

* { 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(--brand); }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .brand { font-weight: 700; }

.topbar nav a {
  margin-left: 1rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
}

.topbar nav a.active, .topbar nav a:hover { color: var(--brand); }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.container.narrow { max-width: 620px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 0 0 0.75rem; }

.muted { color: var(--muted); font-size: 0.9rem; }

.field { margin-bottom: 1.1rem; }
.field label.field-label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field .help { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }

input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

textarea { min-height: 90px; resize: vertical; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }

.error-box {
  background: #fdecea;
  border: 1px solid #f3c1ba;
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.error-box ul { margin: 0; padding-left: 1.2rem; }

.notice-box {
  background: var(--brand-soft);
  border: 1px solid #c9dcd4;
  color: var(--brand-dark);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.field-error { color: var(--danger); font-size: 0.85rem; margin-top: 0.3rem; }

.progress-track {
  background: #e6eaee;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.progress-fill { background: var(--brand); height: 100%; }
.progress-label { color: var(--muted); font-size: 0.82rem; margin-bottom: 1.5rem; }

.scale-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.scale-option {
  flex: 1 1 auto;
  min-width: 46px;
  text-align: center;
}
.scale-option input { position: absolute; opacity: 0; pointer-events: none; }
.scale-option label {
  display: block;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.3rem;
  cursor: pointer;
  font-weight: 600;
  background: #fff;
}
.scale-option input:checked + label {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.scale-endlabels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.35rem;
}

.checkbox-list label, .radio-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  padding: 0.35rem 0;
  cursor: pointer;
}
.checkbox-list input, .radio-list input { width: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table th, table td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); }
table th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge.pending { background: #fff3cd; color: #8a6100; }
.badge.completed { background: #e2f6e9; color: var(--success); }
.badge.expired, .badge.revoked { background: #f1f1f1; color: var(--muted); }

.stat-grid { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat-card {
  flex: 1 1 140px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.stat-card .value { font-size: 1.6rem; font-weight: 700; }
.stat-card .label { color: var(--muted); font-size: 0.82rem; }

.chart-wrap { max-width: 520px; margin: 1rem auto; }

.review-summary dt { font-weight: 600; margin-top: 0.9rem; }
.review-summary dd { margin: 0.2rem 0 0; color: var(--text); }

.login-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 15%, rgba(47, 111, 94, 0.08), transparent 32rem),
    var(--bg);
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.login-card {
  width: 100%;
  max-width: 390px;
  padding: 2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.login-brand img { flex: 0 0 auto; }
.login-brand h1 { margin: 0; font-size: 1.55rem; line-height: 1.2; }
.login-brand p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.82rem; }

.microsoft-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
}

.microsoft-mark {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 2px;
}
.microsoft-mark i:nth-child(1) { background: #f25022; }
.microsoft-mark i:nth-child(2) { background: #7fba00; }
.microsoft-mark i:nth-child(3) { background: #00a4ef; }
.microsoft-mark i:nth-child(4) { background: #ffb900; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
  margin: 1.25rem 0;
}
.login-divider::before, .login-divider::after {
  content: "";
  height: 1px;
  background: var(--border);
  flex: 1;
}
.login-divider span { white-space: nowrap; }
.login-form .field { margin-bottom: 0.9rem; }
.login-submit { width: 100%; }
.login-footnote { color: var(--muted); text-align: center; font-size: 0.75rem; margin: 1.25rem 0 0; }

.no-access-panel {
  max-width: 560px;
  margin: 4rem auto 0;
  text-align: center;
  padding: 2.25rem;
}
.no-access-panel h1 { margin-top: 0.75rem; }

@media (max-width: 480px) {
  .container { padding: 1rem 0.75rem 2rem; }
  .panel { padding: 1rem; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .login-container { padding: 1rem; }
  .login-card { padding: 1.4rem; }
}
