:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #1d2b32;
  --muted: #64727a;
  --line: #dce3e7;
  --green: #187252;
  --blue: #245f9f;
  --amber: #9c6a12;
  --shadow: 0 10px 28px rgba(28, 43, 50, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  color: var(--text);
  background: var(--bg);
  font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
.auth-page {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand small, .auth-card p { color: var(--muted); }
.alert {
  padding: 10px 12px;
  margin: 16px 0;
  border-radius: 7px;
  background: #fff1f1;
  color: #9a1b1b;
  border: 1px solid #f0c5c5;
}
.sidebar {
  min-height: 100vh;
  padding: 24px 18px;
  background: #13272f;
  color: #eef7f5;
  position: sticky;
  top: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #2da66f;
  font-weight: 800;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand strong, .brand small { display: block; }
.brand small { color: #a9bfba; margin-top: 2px; }
nav { display: grid; gap: 6px; }
nav a, .moodle-link {
  display: block;
  padding: 10px 12px;
  border-radius: 7px;
  color: #d8e7e3;
  text-decoration: none;
}
nav a.active, nav a:hover, .moodle-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.moodle-link { margin-top: 28px; color: #9bd9bc; }
.user-box {
  display: grid;
  gap: 3px;
  margin-top: 28px;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.14);
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.user-box span { color: #a9bfba; font-size: 13px; overflow-wrap: anywhere; }
.user-box a { color: #9bd9bc; text-decoration: none; font-weight: 700; margin-top: 4px; }
.main { padding: 28px; max-width: 1280px; width: 100%; }
.page-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.eyebrow { color: var(--green); font-weight: 700; text-transform: uppercase; font-size: 12px; margin: 0 0 4px; }
h1 { margin: 0; font-size: 28px; line-height: 1.15; }
h2 { margin: 0 0 14px; font-size: 18px; }
.page-header p { margin: 8px 0 0; color: var(--muted); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button.secondary { background: #e5ecef; color: var(--text); }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.metrics article, .panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.metrics article { padding: 18px; }
.metrics span { display: block; font-size: 32px; font-weight: 800; color: var(--blue); }
.metrics p { margin: 4px 0 0; color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { padding: 18px; margin-bottom: 18px; }
.list { display: grid; gap: 8px; }
.list a {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
}
.list span, small { color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
td small { display: block; margin-top: 2px; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #e9f5ef; color: var(--green); font-size: 12px; font-weight: 700; }
.form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 700; }
.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
}
.inline-check input { width: auto; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  color: var(--text);
  font: inherit;
  background: #fff;
}
textarea { resize: vertical; }
.row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { padding: 18px; }
.card p { color: var(--muted); }
dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; }
dt { color: var(--muted); }
dd { margin: 0; }
.checks { padding-left: 18px; margin: 0; color: var(--muted); }
.brand-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.preview-top {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: var(--green);
  color: #fff;
}
.preview-top p { margin: 2px 0 0; color: rgba(255,255,255,0.8); }
.preview-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(255,255,255,0.18);
  overflow: hidden;
  font-weight: 800;
}
.preview-logo img { width: 100%; height: 100%; object-fit: cover; }
.preview-hero { padding: 18px; }
.preview-hero h2 { color: var(--blue); font-size: 24px; }
.preview-hero p { color: var(--muted); }
.candidate-hero {
  padding: 28px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.candidate-hero h1 {
  color: var(--blue);
  max-width: 760px;
}
.candidate-hero p:not(.eyebrow) {
  color: var(--muted);
  max-width: 760px;
  margin: 10px 0 0;
}

@media (max-width: 840px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; min-height: auto; }
  .main { padding: 18px; }
  .page-header, .grid.two { grid-template-columns: 1fr; display: grid; }
  .metrics, .row { grid-template-columns: 1fr; }
}
