:root {
  --navy: #0b3787;
  --navy-hover: #082a69;
  --ink: #111418;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f4f4f5;
  --card: #ffffff;
  --tile: #f4f5f7;
  --field: #f3f4f6;
  --error: #b42318;
  --radius: 12px;
  font-family: Roboto, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); min-height: 100vh; font-size: 15px; line-height: 1.45; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 896px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.brand img { display: block; height: 44px; width: auto; }
.header-title { border-left: 1px solid var(--line); padding-left: 16px; }
.header-title h1 { margin: 0; color: var(--navy); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.header-title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

main.wrap { padding-top: 28px; padding-bottom: 48px; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(16, 24, 40, .06); padding: 22px; margin-bottom: 18px; }
.card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 14px; font-weight: 700; }
.card-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #eef1f6; color: var(--navy); }
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Lookup form */
.lookup-card { max-width: 404px; margin: 0 auto; padding: 28px; }
form label { display: block; font-size: 13px; font-weight: 500; margin: 0 0 8px; }
form select, form input {
  width: 100%; height: 36px; margin-bottom: 20px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--field);
  font: inherit; font-size: 13px; color: var(--ink);
}
form select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
form input::placeholder { color: #9ca3af; }
form select:focus, form input:focus { outline: 2px solid var(--navy); outline-offset: 1px; background: #fff; }
.turnstile { min-height: 65px; margin-bottom: 12px; }
.form-error { color: var(--error); font-size: 13px; margin: 0 0 12px; }

.btn-primary, .btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 8px; font: inherit; font-weight: 500; font-size: 13px; cursor: pointer; }
.btn-primary { width: 100%; height: 36px; border: 0; background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-hover); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-secondary { height: 32px; padding: 0 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn-secondary:hover { background: var(--tile); }

/* Dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 4px; text-transform: uppercase; color: var(--muted); font-size: 11px; letter-spacing: .03em; }
.student-name { margin: 0; font-size: 18px; font-weight: 700; }

.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0; }
.info-grid.two { grid-template-columns: repeat(2, 1fr); }
.info-grid dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.info-grid dd { margin: 0; font-weight: 500; font-size: 14px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #e5e7eb; color: #374151; font-size: 11px; font-weight: 500; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.bad { background: #fee2e2; color: #991b1b; }
.badge.info { background: #e0e9ff; color: var(--navy); }

/* Timeline */
.timeline { position: relative; height: 104px; margin: 0 8px; }
.timeline .track { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; border-radius: 999px; background: #e7eaf0; overflow: hidden; }
.timeline .fill { height: 100%; background: var(--navy); border-radius: 999px; }
.timeline .marker { position: absolute; bottom: 3px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--navy); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--navy); }
.timeline .stem { width: 1px; background: #c7ccd6; }
.timeline .label { text-align: center; white-space: nowrap; font-size: 10px; line-height: 1.25; }
.timeline .label b { display: block; font-weight: 600; font-size: 10px; }
.timeline .label span { color: var(--muted); }
.timeline .marker.done .dot { background: #fff; }
.timeline-caption { text-align: right; color: var(--muted); font-size: 12px; margin: 10px 0 0; }

/* Exams */
.exam-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.exam { background: var(--tile); border-radius: 10px; padding: 14px 8px; text-align: center; }
.exam .t { color: var(--muted); font-size: 12px; }
.exam .g { font-size: 18px; font-weight: 700; margin: 6px 0; }
.exam .d { color: var(--muted); font-size: 11px; }
.avg-row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 14px; border-radius: 10px; background: var(--tile); color: var(--muted); font-size: 14px; }
.avg-row strong { color: var(--navy); font-size: 20px; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat { background: var(--tile); border-radius: 10px; padding: 20px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.stat strong { font-size: 22px; font-weight: 700; }
.stat strong.accent { color: var(--navy); }
.stat span { color: var(--muted); font-size: 12px; }
.stat-icon { color: var(--muted); }

@media (max-width: 720px) {
  .header-title h1 { font-size: 18px; }
  .brand img { height: 34px; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .exam-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: 1fr; }
  .timeline .label { display: none; }
  .timeline { height: 40px; }
}
@media (max-width: 420px) {
  .header-inner { gap: 12px; }
  .header-title p { display: none; }
  .exam-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-head { flex-direction: column; }
}
