/* SPARK platform — app chrome + content styling.
   Recreated from screenshots in uploads/Braintrust Spark.pdf (pages 2-3). */
@import url('../../colors_and_type.css');

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--font-body); }
body { background: var(--bg-3); color: var(--fg-1); font-size: 14px; }

/* ------ Layout ------ */
.spark-app { display: grid; grid-template-columns: 72px 1fr; min-height: 100vh; }

/* ------ Sidebar ------ */
.spark-sidebar {
  background: var(--ink-navy); color: white;
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0 16px;
  position: sticky; top: 0; height: 100vh;
}
.spark-sidebar .spark-logo {
  width: 40px; height: 40px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: center;
}
.spark-sidebar .spark-logo img { width: 32px; }
.spark-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0 10px; flex: 1; }
.spark-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 0; border-radius: 10px;
  color: rgba(255,255,255,0.72); cursor: pointer;
  font-size: 10px; font-weight: 600;
  transition: all 140ms var(--ease-out);
}
.spark-nav-item svg { width: 20px; height: 20px; stroke-width: 1.75; }
.spark-nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.spark-nav-item.active { background: rgba(188,168,255,0.16); color: white; }
.spark-nav-item.active svg { color: #bca8ff; }
.spark-nav-spacer { flex: 1; }

/* ------ Content frame ------ */
.spark-content { padding: 20px 28px 60px; }
.spark-breadcrumb {
  display: flex; gap: 8px; font-size: 13px; color: var(--fg-2);
  margin-bottom: 22px;
}
.spark-breadcrumb a { color: var(--fg-2); border: none; }
.spark-breadcrumb a:hover { color: var(--ink-900); }
.spark-breadcrumb .sep { color: var(--fg-3); }
.spark-breadcrumb .current { color: var(--ink-900); font-weight: 600; }

/* ------ Page header ------ */
.spark-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px;
}
.spark-tabs {
  display: inline-flex; gap: 2px; padding: 4px; background: var(--ink-navy);
  border-radius: 12px; margin-bottom: 18px;
}
.spark-tab {
  padding: 8px 18px; font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.7); cursor: pointer;
  border-radius: 9px; transition: all 140ms var(--ease-out);
}
.spark-tab.active { background: rgba(188,168,255,0.25); color: white; }
.spark-tab:hover:not(.active) { color: white; }

/* ------ Card (the main white container) ------ */
.spark-card {
  background: white; border-radius: 18px; padding: 22px 24px;
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
  border: 1px solid var(--border-1);
}
.spark-card h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 20px; letter-spacing: -0.01em; margin: 0 0 16px;
}
.spark-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.spark-card-head h2 { margin: 0; }

/* Toggle — program/student or foundational/math */
.spark-toggle {
  display: inline-flex; padding: 3px; background: var(--bg-3);
  border-radius: 10px; border: 1px solid var(--border-1);
}
.spark-toggle button {
  padding: 7px 16px; font-size: 13px; font-weight: 600;
  background: transparent; border: none; border-radius: 7px;
  cursor: pointer; color: var(--fg-2);
}
.spark-toggle button.active { background: var(--ink-900); color: white; }

/* Filter row (selects) */
.spark-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.spark-select {
  background: white; border: 1px solid var(--border-1); border-radius: 12px;
  padding: 10px 14px; font-size: 13px; color: var(--fg-1);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; font-weight: 500;
}
.spark-select .lbl { color: var(--fg-2); font-weight: 600; margin-right: 6px; }
.spark-select:hover { border-color: var(--ink-400); }
.spark-select .chev { color: var(--fg-3); }

/* Stat row */
.spark-stat-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
  padding: 16px; background: var(--bg-3); border-radius: 14px;
  border: 1px solid var(--border-1);
}
.spark-stat-cell { text-align: left; position: relative; padding: 0 8px; }
.spark-stat-cell + .spark-stat-cell { border-left: 1px solid var(--border-1); }
.spark-stat-value {
  font-family: var(--font-display); font-weight: 900;
  font-size: 44px; letter-spacing: -0.03em; line-height: 1;
  color: var(--bt-pink);
}
.spark-stat-value.c-blue { color: var(--bt-blue); }
.spark-stat-value.c-green { color: var(--bt-green); }
.spark-stat-label {
  font-size: 11px; color: var(--fg-2); margin-top: 8px;
  font-weight: 600; letter-spacing: 0.01em;
}
.spark-stat-pill {
  position: absolute; top: -6px; right: 6px;
  background: var(--bt-green); color: white;
  font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  padding: 3px 8px; border-radius: 999px; text-transform: uppercase;
}

/* Section divider */
.spark-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 14px;
}
.spark-section-head h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 16px; margin: 0;
}
.spark-download { display:flex; gap:14px; font-size: 13px; }
.spark-download a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--bt-blue); border: none; font-weight: 600;
}
.spark-download a svg { width: 14px; height: 14px; }

/* Legend */
.spark-legend { display: flex; gap: 14px; font-size: 11px; color: var(--fg-2); }
.spark-legend span { display: inline-flex; align-items: center; gap: 5px; }
.spark-legend .dot { width: 8px; height: 8px; border-radius: 999px; }

/* ------ Table ------ */
.spark-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spark-table thead th {
  text-align: left; padding: 10px 12px;
  background: var(--bg-3); border-top: 1px solid var(--border-1);
  border-bottom: 1px solid var(--border-1);
  font-weight: 700; font-size: 12px; color: var(--fg-1);
}
.spark-table thead th:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.spark-table thead th:last-child { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.spark-table tbody td {
  padding: 12px; border-bottom: 1px solid var(--border-1);
  color: var(--ink-900); vertical-align: middle;
}
.spark-table tbody tr:hover { background: var(--bg-3); }
.spark-table a.link { color: var(--bt-blue); text-decoration: underline; border: none; font-weight: 600; }
.spark-checkbox {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--ink-300); background: white; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.spark-checkbox.checked { background: var(--bt-blue); border-color: var(--bt-blue); }
.spark-checkbox.checked::after {
  content: ""; width: 8px; height: 4px; border: 2px solid white;
  border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px);
}

/* Status pill for %growth */
.spark-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.spark-pill .dot { width: 7px; height: 7px; border-radius: 999px; }
.spark-pill.exceptional { background: #defaec; color: #007a3f; }
.spark-pill.exceptional .dot { background: #00c063; }
.spark-pill.strong      { background: #e0f4ff; color: #0b6fa8; }
.spark-pill.strong .dot { background: #0fb5f2; }
.spark-pill.emerging    { background: #ffe2f2; color: #b8377f; }
.spark-pill.emerging .dot { background: #fa86d1; }
.spark-pill.limited     { background: #ffe2ce; color: #b24700; }
.spark-pill.limited .dot { background: #fe6600; }
.spark-pill.mastered    { background: #e6e6eb; color: #3a3a42; }
.spark-pill.mastered .dot { background: #8a8a93; }

/* ------ Chart (growth lollipop) ------ */
.spark-chart { padding: 14px 0 0; }
.spark-chart-inner {
  display: grid; grid-template-columns: 36px 1fr; gap: 12px;
  height: 240px;
}
.spark-y-axis {
  display: flex; flex-direction: column; justify-content: space-between;
  font-size: 10px; color: var(--fg-3); text-align: right; padding-top: 4px;
}
.spark-plot {
  position: relative; background:
    repeating-linear-gradient(to top, transparent 0, transparent 22px,
      var(--border-1) 22px, var(--border-1) 23px);
  border-bottom: 1.5px solid var(--ink-400);
}
.spark-bar-row {
  position: absolute; inset: 0;
  display: flex; justify-content: space-around; align-items: flex-end;
  padding: 0 10px;
}
.spark-lollipop {
  flex: 1; height: 100%; position: relative;
  display: flex; flex-direction: column-reverse; align-items: center;
}
.spark-lolli-line {
  width: 1.5px; background: var(--bt-green); position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
}
.spark-lolli-pre, .spark-lolli-post {
  position: absolute; left: 50%; transform: translate(-50%, 50%);
  width: 9px; height: 9px; border-radius: 999px;
  border: 1.5px solid white;
}
.spark-lolli-pre { background: var(--bt-orange); }
.spark-lolli-post { background: var(--bt-blue); width: 10px; height: 10px; border-radius: 2px; transform: translate(-50%, 50%) rotate(0); }
.spark-x-labels {
  grid-column: 2 / 3;
  display: flex; justify-content: space-around; padding: 4px 10px 0;
  font-size: 9px; color: var(--fg-3);
}
.spark-x-labels span { flex: 1; text-align: center; }

/* Assessment bar chart (pre/post) */
.spark-bars {
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px;
  height: 220px; align-items: end; padding: 0 40px;
  border-bottom: 1.5px solid var(--ink-400); position: relative;
}
.spark-bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.spark-bar-col .bar {
  width: 100%; max-width: 140px; border-radius: 4px 4px 0 0;
  position: relative;
}
.spark-bar-col .bar.pre { background: var(--bt-pink); height: 88%; }
.spark-bar-col .bar.post { background: var(--bt-blue); opacity: 0.85; height: 100%; }
.spark-bar-col .lbl { font-size: 11px; color: var(--fg-2); font-weight: 600; }
.spark-bar-chart-callout {
  position: absolute; top: 55%; left: 50%; transform: translate(-50%, -50%);
  background: white; border: 1px solid var(--border-1); border-radius: 8px;
  padding: 8px 12px; font-size: 11px; color: var(--fg-1);
  box-shadow: var(--shadow-md); z-index: 2; min-width: 180px;
}

/* Attendance block */
.spark-attendance {
  background: white; border: 1px solid var(--border-1); border-radius: 16px;
  padding: 20px;
}
.spark-attendance-value {
  font-family: var(--font-display); font-weight: 900;
  font-size: 56px; color: var(--bt-green); line-height: 1;
  letter-spacing: -0.03em;
}
.spark-attendance-avg { font-size: 13px; color: var(--fg-2); margin-top: 10px; }
.spark-attendance-sess { font-size: 13px; color: var(--fg-1); margin-top: 14px; font-weight: 600; }
.spark-attendance-sess small { display: block; font-weight: 400; color: var(--fg-2); margin-top: 2px; font-size: 12px; }

/* Side-by-side layout for attendance/strengths */
.spark-split { display: grid; grid-template-columns: 260px 1fr; gap: 14px; }

/* Strengths/challenges */
.spark-strengths table { width: 100%; font-size: 13px; border-collapse: collapse; }
.spark-strengths th {
  text-align: left; padding: 8px 10px; background: var(--bg-3);
  font-size: 11px; font-weight: 700;
}
.spark-strengths td { padding: 8px 10px; border-bottom: 1px solid var(--border-1); }

/* Top bar / page title */
.spark-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border-1);
}
.spark-topbar h1 {
  font-family: var(--font-display); font-weight: 900;
  font-size: 28px; letter-spacing: -0.01em; margin: 0;
}
.spark-topbar .spark-user {
  display: flex; align-items: center; gap: 10px;
  background: white; padding: 6px 14px 6px 6px; border-radius: 999px;
  border: 1px solid var(--border-1);
  font-size: 13px; font-weight: 600;
}
.spark-topbar .avatar {
  width: 30px; height: 30px; border-radius: 999px; background: var(--bt-cyan);
  color: white; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
