/* Advisory Science tuition tracker, brand system.
   Colours are the AdSci palette. Display font is Shantell Sans on the student
   app (student-facing) and Montserrat on the dashboard (parent-facing). */

:root {
  --teal-dark: #1B4D5C;
  --teal: #1A8A7D;
  --salmon: #F5A898;
  --lavender: #D4C2DF;
  --mint: #B8D8D0;
  --gold: #E8D48A;
  --cream: #FAF5EE;

  --green: #2E8B57;
  --amber: #D99A2B;
  --red: #C0392B;
  --grey: #9AA3A8;

  --ink: #17323B;
  --muted: #5C6B72;
  --line: #E4DCD2;
  --card: #FFFFFF;

  --radius: 14px;
  --shadow: 0 2px 10px rgba(27, 77, 92, .08);
  /* Montserrat throughout, including the student app. Shantell Sans is for
     worksheets and student-facing graphics, not for interface chrome. */
  --display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 18px 80px; }
.wrap.wide { max-width: 1120px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
header.bar {
  background: var(--teal-dark);
  color: #fff;
  padding: 16px 18px;
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
header.bar .inner {
  max-width: 880px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
header.bar.wide .inner { max-width: 1120px; }
header.bar h1 {
  font-family: var(--display);
  font-size: 20px; font-weight: 700; margin: 0; letter-spacing: .2px;
}
header.bar .sub { font-size: 12.5px; opacity: .85; margin: 0; width: 100%; }
header.bar .spacer { flex: 1; }

/* ── Type ───────────────────────────────────────────────────────────────── */
h2 { font-family: var(--display); color: var(--teal-dark); font-size: 22px; margin: 28px 0 10px; }
h3 { font-size: 16px; color: var(--teal-dark); margin: 0 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }
.rule { height: 2px; background: var(--salmon); border: 0; margin: 6px 0 18px; width: 64px; border-radius: 2px; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card.rail { border-left: 6px solid var(--teal); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
button, .btn {
  font-family: var(--body); font-size: 15px; font-weight: 600;
  border-radius: 10px; border: 1px solid transparent;
  padding: 11px 18px; cursor: pointer; background: var(--teal); color: #fff;
  transition: transform .08s ease, filter .15s ease;
}
button:hover, .btn:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--teal-dark); border-color: var(--line); }
button.small { padding: 7px 12px; font-size: 13.5px; }

/* ── RAG buttons ────────────────────────────────────────────────────────── */
.rag-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.rag-btn {
  background: #fff; color: var(--ink); border: 2px solid var(--line);
  border-radius: 12px; padding: 12px 6px; font-size: 13px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 6px; line-height: 1.25;
  text-align: center;
}
.rag-btn .dot { width: 20px; height: 20px; border-radius: 50%; display: block; }
.rag-btn[data-s="green"] .dot { background: var(--green); }
.rag-btn[data-s="amber"] .dot { background: var(--amber); }
.rag-btn[data-s="red"] .dot { background: var(--red); }
.rag-btn[data-s="not_taught"] .dot { background: var(--grey); }
.rag-btn.on[data-s="green"] { border-color: var(--green); background: #EAF5EF; }
.rag-btn.on[data-s="amber"] { border-color: var(--amber); background: #FBF3E3; }
.rag-btn.on[data-s="red"] { border-color: var(--red); background: #FAEDEB; }
.rag-btn.on[data-s="not_taught"] { border-color: var(--grey); background: #F1F3F4; }

/* ── Unit list ──────────────────────────────────────────────────────────── */
.unit {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; margin-bottom: 8px; cursor: pointer; text-align: left; width: 100%;
  font-family: var(--body); font-weight: 400; color: var(--ink);
}
.unit:hover { border-color: var(--teal); }
.unit .status { width: 16px; height: 16px; border-radius: 50%; flex: none; margin-top: 4px; background: #E9ECEE; }
.unit .status.green { background: var(--green); }
.unit .status.amber { background: var(--amber); }
.unit .status.red { background: var(--red); }
.unit .status.not_taught { background: var(--grey); }
.unit .body { flex: 1; min-width: 0; }
.unit .code { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .4px; }
.unit .name { font-size: 15px; font-weight: 600; color: var(--teal-dark); }
.unit .chev { color: var(--muted); font-size: 18px; flex: none; }

.subject-head {
  display: flex; align-items: center; gap: 10px;
  margin: 24px 0 10px; font-family: var(--display);
  font-size: 18px; font-weight: 700; color: var(--teal-dark);
}
.subject-head .swatch { width: 14px; height: 14px; border-radius: 4px; }
.paper-tag {
  font-family: var(--body); font-size: 11px; font-weight: 700; letter-spacing: .5px;
  background: var(--cream); border: 1px solid var(--line); color: var(--muted);
  padding: 2px 8px; border-radius: 20px; text-transform: uppercase;
}

/* ── Progress bar ───────────────────────────────────────────────────────── */
.meter { display: flex; height: 12px; border-radius: 20px; overflow: hidden; background: #E9ECEE; margin: 10px 0 6px; }
.meter span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* ── Wizard ─────────────────────────────────────────────────────────────── */
.wiz-progress { font-size: 13px; color: var(--muted); font-weight: 600; }
.wiz-track { height: 6px; background: #E9ECEE; border-radius: 20px; overflow: hidden; margin: 8px 0 20px; }
.wiz-track span { display: block; height: 100%; background: var(--teal); transition: width .25s ease; }
.blurb { background: var(--cream); border-left: 4px solid var(--gold); padding: 12px 14px; border-radius: 8px; font-size: 15px; }
.subs { margin: 12px 0 0; padding-left: 20px; font-size: 14px; color: var(--muted); }
.subs li { margin-bottom: 3px; }
.ht-note { font-size: 13.5px; color: var(--teal); font-weight: 600; margin-top: 10px; }

.nav-row { display: flex; gap: 10px; margin-top: 20px; align-items: center; }
.nav-row .spacer { flex: 1; }

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.stat .n { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: 12.5px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.table-scroll { overflow-x: auto; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; color: #fff; }
.pill.green { background: var(--green); }
.pill.amber { background: var(--amber); }
.pill.red { background: var(--red); }
.pill.not_taught { background: var(--grey); }
.pill.unrated { background: #C9D1D4; color: var(--ink); }

footer.bar { background: var(--teal); color: #fff; text-align: center; padding: 14px; font-size: 13px; margin-top: 40px; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--teal-dark); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.2); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.toast.show { opacity: 1; }

.hidden { display: none !important; }

@media (max-width: 520px) {
  .rag-row { grid-template-columns: repeat(2, 1fr); }
  header.bar h1 { font-size: 17px; }
}
