/**
 * BIBH Quiz Builder - Front-end Styles
 * Inherits from BIBH Classroom Suite design system
 */

/* ========================================
   THEME RESET - override Astra table border colour
   ======================================== */
.bibh-qb-heatmap td,
.bibh-qb-heatmap th,
.bibh-qb-reports td,
.bibh-qb-reports th,
.bibh-qb-student-dashboard td,
.bibh-qb-student-dashboard th {
  border: none !important;
}

/* ========================================
   QUIZ LIST - Stats Grid
   ======================================== */

.bibh-qb-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .bibh-qb-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .bibh-qb-stats-grid {
    grid-template-columns: 1fr;
  }
}

.bibh-qb-stat-card {
  background: var(--bibh-white);
  border-radius: var(--bibh-radius-md);
  padding: 20px;
  border-left: 4px solid var(--bibh-primary);
  box-shadow: var(--bibh-shadow-sm);
  transition: all 0.2s ease;
}

.bibh-qb-stat-card:hover {
  box-shadow: var(--bibh-shadow-md);
  transform: translateY(-2px);
}

.bibh-qb-stat-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--bibh-dark);
  line-height: 1;
  margin-bottom: 8px;
  font-family: var(--bibh-font);
}

.bibh-qb-stat-card__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--bibh-text-muted);
  font-weight: 600;
  font-family: var(--bibh-font);
}

/* Color variants for stat cards */
.bibh-qb-stat-card--success {
  border-left-color: var(--bibh-success);
}

.bibh-qb-stat-card--warning {
  border-left-color: var(--bibh-warning);
}

.bibh-qb-stat-card--danger {
  border-left-color: var(--bibh-danger);
}

.bibh-qb-stat-card--secondary {
  border-left-color: var(--bibh-secondary);
}

/* ========================================
   QUIZ BUILDER - Section Wrapper
   ======================================== */

.bibh-qb-builder {
  max-width: var(--bibh-container);
  margin: 0 auto;
  padding: 24px;
}

.bibh-qb-builder__section {
  background: var(--bibh-white);
  border-radius: var(--bibh-radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--bibh-shadow-sm);
}

.bibh-qb-builder__section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--bibh-dark);
  margin-bottom: 20px;
  font-family: var(--bibh-font);
}

/* ========================================
   QUESTION SEARCH
   ======================================== */

.bibh-qb-question-search {
  margin-bottom: 20px;
}

.bibh-qb-question-search input {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  border: 1px solid var(--bibh-border);
  border-radius: var(--bibh-radius-sm);
  font-family: var(--bibh-font);
  transition: all 0.2s ease;
}

.bibh-qb-question-search input:focus {
  outline: none;
  border-color: var(--bibh-primary);
  box-shadow: 0 0 0 3px var(--bibh-primary-light);
}

.bibh-qb-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

@media (max-width: 768px) {
  .bibh-qb-search-results {
    grid-template-columns: 1fr;
  }
}

.bibh-qb-search-result {
  background: var(--bibh-neutral-light);
  border: 1px solid var(--bibh-border);
  border-radius: var(--bibh-radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.bibh-qb-search-result:hover {
  background: var(--bibh-white);
  border-color: var(--bibh-primary);
  box-shadow: var(--bibh-shadow-sm);
}

.bibh-qb-search-result__text {
  font-size: 13px;
  color: var(--bibh-text);
  line-height: 1.4;
  font-weight: 500;
  font-family: var(--bibh-font);
}

.bibh-qb-search-result__points {
  font-size: 11px;
  color: var(--bibh-text-muted);
  font-family: var(--bibh-font);
}

.bibh-qb-search-result__btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  background: var(--bibh-primary);
  color: var(--bibh-white);
  border: none;
  border-radius: var(--bibh-radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: var(--bibh-font);
}

.bibh-qb-search-result__btn:hover {
  background: var(--bibh-primary-dark);
}

/* ========================================
   QUIZ QUESTIONS LIST
   ======================================== */

.bibh-qb-quiz-questions {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bibh-qb-quiz-question {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bibh-neutral-light);
  border: 1px solid var(--bibh-border);
  border-radius: var(--bibh-radius-sm);
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.bibh-qb-quiz-question:hover {
  background: var(--bibh-white);
  box-shadow: var(--bibh-shadow-sm);
}

.bibh-qb-quiz-question--dragging {
  opacity: 0.5;
  background: var(--bibh-primary-light);
}

.bibh-qb-quiz-question__handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--bibh-text-muted);
  cursor: grab;
  flex-shrink: 0;
  font-size: 16px;
}

.bibh-qb-quiz-question__handle:active {
  cursor: grabbing;
}

.bibh-qb-quiz-question__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bibh-primary);
  color: var(--bibh-white);
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  font-family: var(--bibh-font);
}

.bibh-qb-quiz-question__text {
  flex-grow: 1;
  font-size: 13px;
  color: var(--bibh-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  font-family: var(--bibh-font);
}

.bibh-qb-quiz-question__points {
  width: 50px;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid var(--bibh-border);
  border-radius: var(--bibh-radius-sm);
  text-align: center;
  font-family: var(--bibh-font);
}

.bibh-qb-quiz-question__remove {
  padding: 6px 10px;
  font-size: 12px;
  background: var(--bibh-danger);
  color: var(--bibh-white);
  border: none;
  border-radius: var(--bibh-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-family: var(--bibh-font);
  flex-shrink: 0;
}

.bibh-qb-quiz-question__remove:hover {
  background: #b91c1c;
}

/* ========================================
   ASSIGNMENT SECTION
   ======================================== */

.bibh-qb-assign-section {
  margin-top: 20px;
}

.bibh-qb-assign-group {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bibh-neutral-light);
  border-radius: var(--bibh-radius-sm);
}

.bibh-qb-assign-group__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--bibh-dark);
  margin-bottom: 12px;
  font-family: var(--bibh-font);
}

.bibh-qb-assign-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--bibh-text);
  font-family: var(--bibh-font);
}

.bibh-qb-assign-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ========================================
   STUDENT QUIZ - Question Card
   ======================================== */

.bibh-qb-question-card {
  background: var(--bibh-white);
  border-radius: var(--bibh-radius-md);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--bibh-shadow-sm);
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.bibh-qb-question-card--active {
  border-color: var(--bibh-primary);
  box-shadow: var(--bibh-shadow-md);
}

.bibh-qb-question-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.bibh-qb-question-card__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bibh-primary);
  color: var(--bibh-white);
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  font-family: var(--bibh-font);
}

.bibh-qb-question-card__text {
  font-size: 16px;
  font-weight: 600;
  color: var(--bibh-dark);
  line-height: 1.5;
  flex-grow: 1;
  font-family: var(--bibh-font);
}

.bibh-qb-question-card__image {
  margin: 16px 0;
  max-width: 100%;
  border-radius: var(--bibh-radius-sm);
  overflow: hidden;
  background: var(--bibh-neutral-light);
}

.bibh-qb-question-card__image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   ANSWER OPTIONS
   ======================================== */

.bibh-qb-answer-options {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bibh-qb-answer-option {
  position: relative;
}

.bibh-qb-answer-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bibh-qb-answer-option label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bibh-neutral-light);
  border: 2px solid var(--bibh-border);
  border-radius: var(--bibh-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: var(--bibh-text);
  line-height: 1.5;
  font-weight: 500;
  font-family: var(--bibh-font);
}

.bibh-qb-answer-option label:hover {
  background: var(--bibh-white);
  border-color: var(--bibh-primary);
}

.bibh-qb-answer-option input[type="radio"]:checked + label {
  background: var(--bibh-primary-light);
  border-color: var(--bibh-primary);
  color: var(--bibh-dark);
  font-weight: 600;
}

.bibh-qb-answer-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bibh-primary);
  color: var(--bibh-white);
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  font-family: var(--bibh-font);
}

.bibh-qb-answer-option input[type="radio"]:checked ~ .bibh-qb-answer-key,
.bibh-qb-answer-option label .bibh-qb-answer-key {
  background: var(--bibh-primary);
}

/* ========================================
   RESULTS & REVIEW
   ======================================== */

.bibh-qb-score-display {
  background: linear-gradient(135deg, var(--bibh-primary), var(--bibh-primary-dark));
  border-radius: var(--bibh-radius-md);
  padding: 40px;
  text-align: center;
  margin-bottom: 32px;
  color: var(--bibh-white);
  box-shadow: var(--bibh-shadow-md);
}

.bibh-qb-score-display__value {
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
  font-family: var(--bibh-font);
}

.bibh-qb-score-display__label {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.95;
  margin-bottom: 20px;
  font-family: var(--bibh-font);
}

.bibh-qb-score-display__bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--bibh-radius-pill);
  overflow: hidden;
  margin-top: 20px;
}

.bibh-qb-score-display__bar-fill {
  height: 100%;
  background: var(--bibh-accent);
  border-radius: var(--bibh-radius-pill);
  transition: width 0.6s ease;
}

/* Review Section */
.bibh-qb-review-section {
  margin-bottom: 32px;
}

.bibh-qb-review-question {
  background: var(--bibh-white);
  border-radius: var(--bibh-radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--bibh-shadow-sm);
  border-left: 4px solid var(--bibh-primary);
  transition: all 0.2s ease;
}

.bibh-qb-review-question:hover {
  box-shadow: var(--bibh-shadow-md);
}

.bibh-qb-review-question__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bibh-primary);
  color: var(--bibh-white);
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
  margin-right: 10px;
  font-family: var(--bibh-font);
}

.bibh-qb-review-question__text {
  font-size: 14px;
  font-weight: 600;
  color: var(--bibh-dark);
  margin-bottom: 16px;
  font-family: var(--bibh-font);
}

.bibh-qb-review-answers {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bibh-qb-review-answer {
  padding: 12px 14px;
  border-radius: var(--bibh-radius-sm);
  border: 2px solid var(--bibh-border);
  font-size: 13px;
  color: var(--bibh-text);
  background: var(--bibh-white);
  font-weight: 500;
  font-family: var(--bibh-font);
}

.bibh-qb-review-answer--correct {
  background: var(--bibh-success-light);
  border-color: var(--bibh-success);
  color: var(--bibh-dark);
}

.bibh-qb-review-answer--incorrect {
  background: var(--bibh-danger-light);
  border-color: var(--bibh-danger);
  color: var(--bibh-dark);
}

.bibh-qb-review-answer--student-choice {
  border-color: var(--bibh-primary);
  border-width: 2px;
}

.bibh-qb-review-answer__indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  margin-right: 8px;
}

/* ========================================
   STATUS BADGES
   ======================================== */

.bibh-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--bibh-radius-pill);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--bibh-font);
}

.bibh-badge--draft {
  background: #f3f4f6;
  color: var(--bibh-text-muted);
}

.bibh-badge--published {
  background: var(--bibh-primary-light);
  color: var(--bibh-primary-dark);
}

.bibh-badge--archived {
  background: #e5e7eb;
  color: #6b7280;
}

.bibh-badge--not_started {
  background: var(--bibh-neutral-light);
  color: var(--bibh-text);
}

.bibh-badge--in_progress {
  background: var(--bibh-warning-light);
  color: var(--bibh-dark);
}

.bibh-badge--submitted {
  background: var(--bibh-success-light);
  color: var(--bibh-success);
}

.bibh-badge--overdue {
  background: var(--bibh-danger-light);
  color: var(--bibh-danger);
}

/* ========================================
   QUIZ CARDS - Classroom-matching styles
   ======================================== */

/* Teacher quiz cards: teal left border like classroom cards */
.bibh-teacher-hub .bibh-card--quiz {
  border-left: 4px solid var(--bibh-primary);
}

.bibh-teacher-hub .bibh-card--quiz-draft {
  border-left-color: var(--bibh-neutral);
}

.bibh-teacher-hub .bibh-card--quiz-archived {
  border-left-color: #9ca3af;
}

/* Student quiz cards: colour by status */
.bibh-student-hub .bibh-card--quiz {
  border-left: 4px solid var(--bibh-secondary);
}

.bibh-student-hub .bibh-card--quiz-not_started {
  border-left-color: var(--bibh-neutral);
}

.bibh-student-hub .bibh-card--quiz-in_progress {
  border-left-color: var(--bibh-accent);
}

.bibh-student-hub .bibh-card--quiz-submitted {
  border-left-color: var(--bibh-primary);
}

/* Meta text (date, small info) */
.bibh-meta {
  font-size: 0.85rem;
  color: var(--bibh-text-muted);
  font-family: var(--bibh-font);
}

/* Stats row inside cards */
.bibh-card__stats {
  margin-top: 12px;
}

/* Inline footer actions (no border-top, sits beside date) */
.bibh-card__actions--inline {
  border-top: none;
  padding-top: 0;
}

/* Student score pill */
.bibh-qb-score-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
}

.bibh-qb-score-pill__value {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--bibh-font);
  line-height: 1;
}

.bibh-qb-score-pill__value--pass {
  color: var(--bibh-primary);
}

.bibh-qb-score-pill__value--fail {
  color: var(--bibh-danger, #dc2626);
}

.bibh-qb-score-pill__detail {
  font-size: 0.85rem;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
  .bibh-qb-builder {
    padding: 16px;
  }

  .bibh-qb-builder__section {
    padding: 16px;
  }

  .bibh-qb-question-card {
    padding: 20px;
  }

  .bibh-qb-score-display {
    padding: 30px;
  }

  .bibh-qb-score-display__value {
    font-size: 48px;
  }

  .bibh-qb-quiz-question {
    flex-wrap: wrap;
  }

  .bibh-qb-quiz-question__text {
    flex-basis: 100%;
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .bibh-qb-quiz-question {
    gap: 8px;
    padding: 10px;
  }

  .bibh-qb-quiz-question__handle {
    width: 24px;
    height: 24px;
  }

  .bibh-qb-quiz-question__number {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .bibh-qb-answer-option label {
    padding: 12px 14px;
    font-size: 13px;
  }

  .bibh-qb-question-card {
    padding: 16px;
  }

  .bibh-qb-question-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .bibh-qb-question-card__number {
    width: 32px;
    height: 32px;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.bibh-qb-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--bibh-text-muted);
}

.bibh-qb-empty-state__icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.bibh-qb-empty-state__text {
  font-size: 14px;
  font-family: var(--bibh-font);
  line-height: 1.6;
}

.bibh-qb-loading {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--bibh-primary);
  border-radius: 50%;
  animation: bibh-qb-pulse 1.5s ease-in-out infinite;
}

@keyframes bibh-qb-pulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* Disabled state */
.bibh-qb-disabled {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

/* ============================================================
 *  CLASS HEATMAP + STUDENT REPORTS
 *  Layout structure inspired by Total Recall v3 (blocks & tables only).
 *  Typography + palette are the BIBH standard - League Spartan +
 *  --bibh-primary / --bibh-secondary / --bibh-accent / --bibh-dark,
 *  inherited from the Classroom Suite sidebar scope. Severity/surface
 *  tokens that have no brand equivalent are namespaced under
 *  --bibh-qb-* so admin overrides of the BIBH palette keep working.
 * ============================================================ */

/* Scoped tokens: brand palette is inherited; these fill gaps. */
.bibh-qb-heatmap,
.bibh-qb-reports,
.bibh-qb-student-dashboard {
  --bibh-qb-sev-low:   #E38A4A; /* 50–69% - amber, harmonises with accent */
  --bibh-qb-sev-high:  #C95E4A; /* <50% - terracotta, harmonises with palette */
  --bibh-qb-surface:   #F4F7F5; /* soft off-white surface */
  --bibh-qb-border:    #DDE5E2; /* muted border */
  --bibh-qb-muted:     #7A8F8C; /* muted secondary text */
  --bibh-qb-ink:       #1A2A2E; /* body copy */

  font-family: var(--bibh-font, 'League Spartan', sans-serif);
  color: var(--bibh-qb-ink);
  font-size: 14px;
  line-height: 1.5;
}
.bibh-qb-heatmap .bibh-qb-hm-header,
.bibh-qb-reports .bibh-qb-hm-header {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.bibh-qb-heatmap .bibh-qb-hm-header h1,
.bibh-qb-reports .bibh-qb-hm-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
  line-height: 1.2;
  margin: 0 0 2px;
}
.bibh-qb-heatmap .bibh-qb-hm-header h1 em,
.bibh-qb-reports .bibh-qb-hm-header h1 em {
  font-style: normal;
  color: var(--bibh-primary, #3F8170);
}
.bibh-qb-heatmap .bibh-qb-hm-header p,
.bibh-qb-reports .bibh-qb-hm-header p {
  font-size: 13px;
  color: var(--bibh-qb-muted);
  margin: 0;
}

/* Filter form (both views). */
.bibh-qb-heatmap .bibh-qb-hm-filters,
.bibh-qb-reports .bibh-qb-rpt-builder {
  background: #fff;
  border-radius: 30px;
  padding: 20px 22px;
  border: 1px solid var(--bibh-qb-border);
  margin-bottom: 18px;
}
.bibh-qb-heatmap .bibh-qb-hm-filters__row,
.bibh-qb-reports .bibh-qb-rpt-builder__row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.bibh-qb-reports .bibh-qb-rpt-builder__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
  margin-bottom: 4px;
}
.bibh-qb-reports .bibh-qb-rpt-builder__sub {
  font-size: 13px;
  color: var(--bibh-qb-muted);
  margin-bottom: 18px;
}

/* Form field. */
.bibh-qb-heatmap .bibh-qb-ff,
.bibh-qb-reports .bibh-qb-ff {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 130px;
  flex: 1;
}
.bibh-qb-heatmap .bibh-qb-ff--wide,
.bibh-qb-reports .bibh-qb-ff--wide {
  flex: 2;
  min-width: 220px;
}
.bibh-qb-heatmap .bibh-qb-ff--apply,
.bibh-qb-reports .bibh-qb-ff--apply {
  flex: 0 0 auto;
  min-width: 0;
}
.bibh-qb-heatmap .bibh-qb-ff label,
.bibh-qb-reports .bibh-qb-ff label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--bibh-qb-muted);
}
.bibh-qb-heatmap .bibh-qb-ff input,
.bibh-qb-heatmap .bibh-qb-ff select,
.bibh-qb-reports .bibh-qb-ff input,
.bibh-qb-reports .bibh-qb-ff select {
  padding: 8px 11px;
  border-radius: 30px;
  border: 1.5px solid var(--bibh-qb-border);
  font-family: inherit;
  font-size: 13px;
  color: var(--bibh-dark, #203D48);
  background: #fff;
  outline: none;
}
.bibh-qb-heatmap .bibh-qb-ff input:focus,
.bibh-qb-heatmap .bibh-qb-ff select:focus,
.bibh-qb-reports .bibh-qb-ff input:focus,
.bibh-qb-reports .bibh-qb-ff select:focus {
  border-color: var(--bibh-primary, #3F8170);
}

/* Buttons (scoped). */
.bibh-qb-heatmap .bibh-qb-btn,
.bibh-qb-reports .bibh-qb-btn {
  padding: 8px 15px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
}
.bibh-qb-heatmap .bibh-qb-btn--navy,
.bibh-qb-reports .bibh-qb-btn--navy { background: var(--bibh-dark, #203D48); color: #fff; }
.bibh-qb-heatmap .bibh-qb-btn--navy:hover,
.bibh-qb-reports .bibh-qb-btn--navy:hover { filter: brightness(.88); }
.bibh-qb-heatmap .bibh-qb-btn--green,
.bibh-qb-reports .bibh-qb-btn--green { background: var(--bibh-primary, #3F8170); color: #fff; }
.bibh-qb-heatmap .bibh-qb-btn--green:hover,
.bibh-qb-reports .bibh-qb-btn--green:hover { filter: brightness(.9); }
.bibh-qb-heatmap .bibh-qb-btn--ghost,
.bibh-qb-reports .bibh-qb-btn--ghost {
  background: transparent; border: 1.5px solid var(--bibh-qb-border); color: var(--bibh-dark, #203D48);
}
.bibh-qb-heatmap .bibh-qb-btn--ghost:hover,
.bibh-qb-reports .bibh-qb-btn--ghost:hover { border-color: var(--bibh-primary, #3F8170); color: var(--bibh-primary, #3F8170); }

/* Quick-range chip row. */
.bibh-qb-heatmap .bibh-qb-hm-presets,
.bibh-qb-reports .bibh-qb-rpt-presets {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--bibh-qb-border);
  align-items: center;
}
.bibh-qb-heatmap .bibh-qb-hm-presets__label,
.bibh-qb-reports .bibh-qb-rpt-presets__label {
  font-size: 12px;
  color: var(--bibh-qb-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.bibh-qb-heatmap .bibh-qb-chip,
.bibh-qb-reports .bibh-qb-chip {
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
  border: 1.5px solid var(--bibh-qb-border);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.bibh-qb-heatmap .bibh-qb-chip:hover,
.bibh-qb-reports .bibh-qb-chip:hover { border-color: var(--bibh-primary, #3F8170); color: var(--bibh-primary, #3F8170); }
.bibh-qb-heatmap .bibh-qb-chip.is-active,
.bibh-qb-reports .bibh-qb-chip.is-active { background: var(--bibh-dark, #203D48); color: #fff; border-color: var(--bibh-dark, #203D48); }

/* Pills (shared shape across heatmap + reports + student dashboard). */
.bibh-qb-heatmap .bibh-qb-pill,
.bibh-qb-reports .bibh-qb-pill,
.bibh-qb-student-dashboard .bibh-qb-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.bibh-qb-heatmap .bibh-qb-pg-p,
.bibh-qb-reports .bibh-qb-pg-p,
.bibh-qb-student-dashboard .bibh-qb-pg-p { background: rgba(63,129,112,.12); color: var(--bibh-primary, #3F8170); }
.bibh-qb-heatmap .bibh-qb-po-p,
.bibh-qb-reports .bibh-qb-po-p,
.bibh-qb-student-dashboard .bibh-qb-po-p { background: rgba(227,138,74,.15); color: var(--bibh-qb-sev-low); }
.bibh-qb-heatmap .bibh-qb-pr-p,
.bibh-qb-reports .bibh-qb-pr-p,
.bibh-qb-student-dashboard .bibh-qb-pr-p { background: rgba(201,94,74,.12); color: var(--bibh-qb-sev-high); }
.bibh-qb-heatmap .bibh-qb-pgr-p,
.bibh-qb-reports .bibh-qb-pgr-p,
.bibh-qb-student-dashboard .bibh-qb-pgr-p { background: var(--bibh-qb-border); color: var(--bibh-qb-muted); }

/* ───── Heatmap grid ───── */
.bibh-qb-heatmap__grid {
  background: #fff;
  border-radius: 30px;
  overflow: auto;
}
.bibh-qb-hm-table {
  border-collapse: collapse;
  width: 100%;
  margin: 0;
}
.bibh-qb-hm-table th {
  background: var(--bibh-dark, #203D48);
  color: #fff;
  padding: 8px 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.bibh-qb-hm-table th.bibh-qb-hm-table__student-col {
  text-align: left;
  min-width: 160px;
  padding-left: 14px;
}
.bibh-qb-hm-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--bibh-qb-surface) !important;
  text-align: center;
  background: #fff;
}
.bibh-qb-hm-table td:first-child {
  text-align: left;
  padding-left: 14px;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
  font-size: 13px;
}
.bibh-qb-hm-cell {
  width: 34px;
  height: 26px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin: auto;
  cursor: default;
}
.bibh-qb-hm-g { background: rgba(63,129,112,.18); color: var(--bibh-primary, #3F8170); }
.bibh-qb-hm-o { background: rgba(227,138,74,.2);  color: var(--bibh-qb-sev-low); }
.bibh-qb-hm-r { background: rgba(201,94,74,.15);  color: var(--bibh-qb-sev-high); }
.bibh-qb-hm-n { background: var(--bibh-qb-border); color: var(--bibh-qb-muted); }
.bibh-qb-hm-table tr:last-child td { border-bottom: none; }
.bibh-qb-hm-table .bibh-qb-hm-row:hover td { background: var(--bibh-qb-surface); }
.bibh-qb-hm-table .bibh-qb-hm-row--class-avg td { background: rgba(32,61,72,.04); }
.bibh-qb-hm-table .bibh-qb-hm-row--class-avg td:first-child {
  font-weight: 700;
  color: var(--bibh-qb-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.bibh-qb-hm-table__empty {
  padding: 28px 16px;
  color: var(--bibh-qb-muted);
  font-size: 13px;
  text-align: center;
}

/* Insights box. */
.bibh-qb-insights {
  background: #e8f5f7;
  border-radius: 30px;
  padding: 18px 22px;
  margin-top: 16px;
  border: 1px solid #c5e6ec;
}
.bibh-qb-insights h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.bibh-qb-insight {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bibh-qb-border);
}
.bibh-qb-insight:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.bibh-qb-insight__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--bibh-dark, #203D48);
  min-width: 88px;
  padding-top: 1px;
  flex-shrink: 0;
}
.bibh-qb-insight__text {
  font-size: 13px;
  color: var(--bibh-qb-ink);
  line-height: 1.55;
}

/* ───── Report toolbar ───── */
.bibh-qb-reports .bibh-qb-rpt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.bibh-qb-reports .bibh-qb-rpt-toolbar__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
}
.bibh-qb-reports .bibh-qb-rpt-toolbar__actions {
  display: flex;
  gap: 8px;
}

/* ───── Print-friendly report page ───── */
.bibh-qb-rpt-page {
  background: #fff;
  border-radius: 30px;
  padding: 28px 32px;
  border: 1px solid var(--bibh-qb-border);
}
.bibh-qb-rpt-logo {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--bibh-primary, #3F8170);
  margin-bottom: 3px;
}
.bibh-qb-rpt-school {
  font-size: 13px;
  color: var(--bibh-qb-muted);
}
.bibh-qb-rpt-divider {
  border: none;
  border-top: 2px solid var(--bibh-dark, #203D48);
  margin: 14px 0 18px;
}
.bibh-qb-rpt-student {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.bibh-qb-rpt-student__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bibh-accent, #F3D76A);
  color: var(--bibh-dark, #203D48);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.bibh-qb-rpt-student__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
}
.bibh-qb-rpt-student__detail {
  font-size: 12px;
  color: var(--bibh-qb-muted);
}
.bibh-qb-rpt-student__period {
  font-size: 12px;
  color: var(--bibh-primary, #3F8170);
  font-weight: 700;
}

.bibh-qb-rpt-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.bibh-qb-rpt-stat {
  border-left: 3px solid var(--bibh-primary, #3F8170);
  padding: 10px 12px;
  background: var(--bibh-qb-surface);
  border-radius: 0 7px 7px 0;
}
.bibh-qb-rpt-stat--r { border-color: var(--bibh-qb-sev-high); }
.bibh-qb-rpt-stat--o { border-color: var(--bibh-qb-sev-low); }
.bibh-qb-rpt-stat__v {
  font-size: 22px;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
  line-height: 1.1;
}
.bibh-qb-rpt-stat__l {
  font-size: 10px;
  color: var(--bibh-qb-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.bibh-qb-rpt-section { margin-bottom: 20px; }
.bibh-qb-rpt-section--note .bibh-qb-rpt-note-body {
  background: rgba(243,215,106,0.12);
  border-left: 3px solid var(--bibh-accent, #F3D76A);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--bibh-dark, #203D48);
  white-space: pre-wrap;
}
.bibh-qb-rpt-section h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--bibh-dark, #203D48);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--bibh-qb-border);
}
.bibh-qb-rpt-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.bibh-qb-rpt-tbl th {
  text-align: left;
  padding: 6px 9px;
  background: var(--bibh-qb-surface);
  color: var(--bibh-qb-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--bibh-qb-border);
}
.bibh-qb-rpt-tbl td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--bibh-qb-border);
  vertical-align: middle;
}
.bibh-qb-rpt-tbl tr:last-child td { border-bottom: none; }
.bibh-qb-rpt-tbl__lo {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--bibh-qb-muted);
}

/* Class view - horizontal bars per student. */
.bibh-qb-rpt-class-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.bibh-qb-rpt-class-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--bibh-qb-border);
  font-size: 13px;
}
.bibh-qb-rpt-class-row:last-child { border-bottom: none; }
.bibh-qb-rpt-class-row__name {
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
  min-width: 160px;
}
.bibh-qb-rpt-class-row__bar {
  flex: 1;
  height: 7px;
  background: var(--bibh-qb-border);
  border-radius: 6px;
  overflow: hidden;
}
.bibh-qb-rpt-class-row__bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width .3s;
}
.bibh-qb-bar-g { background: var(--bibh-primary, #3F8170); }
.bibh-qb-bar-o { background: var(--bibh-qb-sev-low); }
.bibh-qb-bar-r { background: var(--bibh-qb-sev-high); }
.bibh-qb-bar-n { background: var(--bibh-qb-border); }
.bibh-qb-rpt-class-row__pct {
  min-width: 60px;
  text-align: right;
}

.bibh-qb-rpt-footer {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--bibh-qb-border);
  font-size: 11px;
  color: var(--bibh-qb-muted);
  display: flex;
  justify-content: space-between;
}

/* ───── Print media ───── */
@media print {
  body { background: #fff !important; }
  .bibh-sidebar, .bibh-qb-hm-header, .bibh-qb-hm-filters,
  .bibh-qb-rpt-builder, .bibh-qb-rpt-toolbar { display: none !important; }
  .bibh-qb-rpt-page { border: none; padding: 0; border-radius: 0; }
  .bibh-qb-rpt-divider { border-top-color: #000; }
}

/* ============================================================
 *  STUDENT DASHBOARD WIDGET (spec §6.2)
 *  Embedded in the classroom suite's student hub dashboard.
 *  Layout blocks/tables inspired by Total Recall v3; typography
 *  + palette inherit from the BIBH design tokens on the suite
 *  sidebar scope. Severity + surface tokens reuse the shared
 *  --bibh-qb-* namespace defined above.
 * ============================================================ */

.bibh-qb-student-dashboard {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Section titles */
.bibh-qb-student-dashboard .bibh-qb-sd-section-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
  margin: 0 0 4px;
  line-height: 1.2;
}
.bibh-qb-student-dashboard .bibh-qb-sd-section-title p {
  font-size: 13px;
  color: var(--bibh-qb-muted);
  margin: 0;
}

/* Block headers (used above each card) */
.bibh-qb-student-dashboard .bibh-qb-sd-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-block-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
  margin: 0;
  letter-spacing: .2px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-block-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--bibh-primary, #3F8170);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-block-link:hover {
  color: var(--bibh-dark, #203D48);
}

/* Shared card surface */
.bibh-qb-student-dashboard .bibh-qb-sd-card {
  background: #fff;
  border: 1px solid var(--bibh-qb-border);
  border-radius: 30px;
  padding: 18px 20px;
}

/* ───── Stats row ───── */
.bibh-qb-student-dashboard .bibh-qb-sd-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-stat {
  background: #fff;
  border: 1px solid var(--bibh-qb-border);
  border-top: 4px solid var(--bibh-dark, #203D48);
  border-radius: 30px;
  padding: 16px 18px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-stat--accent    { border-top-color: var(--bibh-accent, #F3D76A); }
.bibh-qb-student-dashboard .bibh-qb-sd-stat--secondary { border-top-color: var(--bibh-secondary, #91D1DB); }
.bibh-qb-student-dashboard .bibh-qb-sd-stat--primary   { border-top-color: var(--bibh-primary, #3F8170); }

.bibh-qb-student-dashboard .bibh-qb-sd-stat__v {
  font-size: 32px;
  font-weight: 800;
  color: var(--bibh-dark, #203D48);
  line-height: 1;
  letter-spacing: -.5px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-stat__v--sm {
  font-size: 22px;
  letter-spacing: 0;
}
.bibh-qb-student-dashboard .bibh-qb-sd-stat__l {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  color: var(--bibh-qb-muted);
}
.bibh-qb-student-dashboard .bibh-qb-sd-stat__t {
  font-size: 12px;
  color: var(--bibh-qb-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ───── Activity / streak card ───── */
.bibh-qb-student-dashboard .bibh-qb-sd-activity {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
}
.bibh-qb-student-dashboard .bibh-qb-sd-activity__count {
  font-size: 42px;
  font-weight: 800;
  color: var(--bibh-primary, #3F8170);
  line-height: 1;
  letter-spacing: -1px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-activity__heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-activity__sub {
  font-size: 12px;
  color: var(--bibh-qb-muted);
  margin-top: 2px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-activity__bar {
  display: flex;
  gap: 6px;
  align-items: center;
}
.bibh-qb-student-dashboard .bibh-qb-sd-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid transparent;
  background: var(--bibh-qb-border);
  color: var(--bibh-qb-muted);
}
.bibh-qb-student-dashboard .bibh-qb-sd-dot--done {
  background: var(--bibh-primary, #3F8170);
  color: #fff;
  border-color: var(--bibh-primary, #3F8170);
}
.bibh-qb-student-dashboard .bibh-qb-sd-dot--today {
  background: #fff;
  color: var(--bibh-primary, #3F8170);
  border-color: var(--bibh-primary, #3F8170);
}
.bibh-qb-student-dashboard .bibh-qb-sd-dot--miss {
  background: var(--bibh-qb-surface);
  color: var(--bibh-qb-muted);
  border-color: var(--bibh-qb-border);
}

/* ───── Two-column: This Week + LO spotlight ───── */
.bibh-qb-student-dashboard .bibh-qb-sd-cols {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 18px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-col { min-width: 0; }

/* ───── "This Week" table ───── */
.bibh-qb-student-dashboard .bibh-qb-sd-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-tbl thead th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--bibh-qb-muted);
  padding: 0 0 10px;
  border-bottom: 1px solid var(--bibh-qb-border);
  font-weight: 700;
}
.bibh-qb-student-dashboard .bibh-qb-sd-tbl tbody td {
  padding: 12px 8px 12px 0;
  border-bottom: 1px solid var(--bibh-qb-surface);
  vertical-align: middle;
}
.bibh-qb-student-dashboard .bibh-qb-sd-tbl tbody tr:last-child td {
  border-bottom: none;
}
.bibh-qb-student-dashboard .bibh-qb-sd-tbl__title {
  color: var(--bibh-dark, #203D48);
  font-weight: 700;
  text-decoration: none;
}
.bibh-qb-student-dashboard .bibh-qb-sd-tbl__title:hover {
  color: var(--bibh-primary, #3F8170);
}
.bibh-qb-student-dashboard .bibh-qb-sd-tbl__due {
  font-size: 12px;
  font-weight: 700;
  color: var(--bibh-qb-muted);
}
.bibh-qb-student-dashboard .bibh-qb-sd-tbl__due.is-urgent {
  color: var(--bibh-qb-sev-high);
}

/* ───── LO spotlight ───── */
.bibh-qb-student-dashboard .bibh-qb-sd-los {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-lo {
  border-radius: 30px;
  padding: 14px 16px;
  border: 1px solid var(--bibh-qb-border);
  background: var(--bibh-qb-surface);
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: start;
}
.bibh-qb-student-dashboard .bibh-qb-sd-lo--best {
  background: rgba(63,129,112,.07);
  border-color: rgba(63,129,112,.22);
}
.bibh-qb-student-dashboard .bibh-qb-sd-lo--worst {
  background: rgba(201,94,74,.06);
  border-color: rgba(201,94,74,.22);
}
.bibh-qb-student-dashboard .bibh-qb-sd-lo__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  color: var(--bibh-qb-muted);
  grid-column: 1;
}
.bibh-qb-student-dashboard .bibh-qb-sd-lo__code {
  font-size: 14px;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
  grid-column: 1;
}
.bibh-qb-student-dashboard .bibh-qb-sd-lo__title {
  font-size: 12px;
  color: var(--bibh-qb-ink);
  grid-column: 1 / -1;
  line-height: 1.4;
}
.bibh-qb-student-dashboard .bibh-qb-sd-lo__pct {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: start;
}
.bibh-qb-student-dashboard .bibh-qb-sd-lo .bibh-qb-sd-btn {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 4px;
}

/* ───── Recent Activity feed ───── */
.bibh-qb-student-dashboard .bibh-qb-sd-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.bibh-qb-student-dashboard .bibh-qb-sd-feed__item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--bibh-qb-surface);
}
.bibh-qb-student-dashboard .bibh-qb-sd-feed__item:last-child { border-bottom: none; }
.bibh-qb-student-dashboard .bibh-qb-sd-feed__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bibh-qb-student-dashboard .bibh-qb-sd-feed__icon--assigned {
  background: rgba(63,129,112,.12);
  color: var(--bibh-primary, #3F8170);
}
.bibh-qb-student-dashboard .bibh-qb-sd-feed__icon--self {
  background: rgba(243,215,106,.25);
  color: var(--bibh-dark, #203D48);
}
.bibh-qb-student-dashboard .bibh-qb-sd-feed__body { min-width: 0; }
.bibh-qb-student-dashboard .bibh-qb-sd-feed__title {
  display: block;
  font-weight: 700;
  color: var(--bibh-dark, #203D48);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bibh-qb-student-dashboard .bibh-qb-sd-feed__title:hover {
  color: var(--bibh-primary, #3F8170);
}
.bibh-qb-student-dashboard .bibh-qb-sd-feed__meta {
  font-size: 12px;
  color: var(--bibh-qb-muted);
}

/* ───── Buttons ───── */
.bibh-qb-student-dashboard .bibh-qb-sd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1.2;
  transition: filter .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.bibh-qb-student-dashboard .bibh-qb-sd-btn--primary {
  background: var(--bibh-primary, #3F8170);
  color: #fff;
}
.bibh-qb-student-dashboard .bibh-qb-sd-btn--primary:hover { filter: brightness(.9); color: #fff; }
.bibh-qb-student-dashboard .bibh-qb-sd-btn--ghost {
  background: #fff;
  color: var(--bibh-dark, #203D48);
  border-color: var(--bibh-qb-border);
}
.bibh-qb-student-dashboard .bibh-qb-sd-btn--ghost:hover {
  border-color: var(--bibh-primary, #3F8170);
  color: var(--bibh-primary, #3F8170);
}

/* ───── Empty states ───── */
.bibh-qb-student-dashboard .bibh-qb-sd-empty {
  text-align: center;
  padding: 18px 10px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-empty strong {
  display: block;
  font-size: 15px;
  color: var(--bibh-dark, #203D48);
  margin-bottom: 4px;
}
.bibh-qb-student-dashboard .bibh-qb-sd-empty p {
  font-size: 13px;
  color: var(--bibh-qb-muted);
  margin: 0 0 12px;
}

/* ───── Responsive ───── */
@media (max-width: 960px) {
  .bibh-qb-student-dashboard .bibh-qb-sd-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .bibh-qb-student-dashboard .bibh-qb-sd-cols {
    grid-template-columns: 1fr;
  }
  .bibh-qb-student-dashboard .bibh-qb-sd-activity {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 12px;
  }
  .bibh-qb-student-dashboard .bibh-qb-sd-activity__bar {
    justify-content: center;
    flex-wrap: wrap;
  }
}
@media (max-width: 560px) {
  .bibh-qb-student-dashboard .bibh-qb-sd-stats {
    grid-template-columns: 1fr;
  }
  .bibh-qb-student-dashboard .bibh-qb-sd-feed__item {
    grid-template-columns: 28px 1fr;
    grid-template-rows: auto auto;
  }
  .bibh-qb-student-dashboard .bibh-qb-sd-feed__icon {
    width: 28px;
    height: 28px;
  }
  .bibh-qb-student-dashboard .bibh-qb-sd-feed__score {
    grid-column: 2;
  }
}

/* ── History table: Flashcards source pill (teal accent) ─────────────── */
.bibh-qb-reports .bibh-qb-pill--fc {
  background: #e0f4f1;
  color: #1a6b5e;
}


/* ══════════════════════════════════════════════════════════════════════════
   Student Profile - dashboard redesign (.bibh-sp)
   ══════════════════════════════════════════════════════════════════════════ */

.bibh-sp {
  font-family: var(--bibh-font, 'League Spartan', sans-serif);
}

/* ── Breadcrumb ── */
.bibh-sp-breadcrumb { font-size: 13px; color: var(--bibh-qb-muted); margin-bottom: 14px; }
.bibh-sp-breadcrumb a { color: var(--bibh-primary, #3F8170); text-decoration: none; font-weight: 700; }
.bibh-sp-breadcrumb a:hover { text-decoration: underline; }

/* ── Student switcher ── */
.bibh-sp-switcher { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.bibh-sp-switcher__pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 30px;
  border: 1px solid var(--bibh-qb-border); background: #fff;
  color: var(--bibh-dark, #203D48); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: border-color .15s, background .15s, color .15s;
  font-family: inherit;
}
.bibh-sp-switcher__pill:hover { border-color: var(--bibh-primary, #3F8170); }
.bibh-sp-switcher__pill.is-active {
  background: var(--bibh-primary, #3F8170);
  border-color: var(--bibh-primary, #3F8170);
  color: #fff;
}
.bibh-sp-switcher__av {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(63,129,112,.12); color: var(--bibh-primary, #3F8170);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.bibh-sp-switcher__pill.is-active .bibh-sp-switcher__av {
  background: rgba(255,255,255,.25); color: #fff;
}

/* ── Header card ── */
.bibh-sp-hcard {
  background: #e8f5f7; border: 1px solid #c5e6ec; border-radius: 30px;
  padding: 22px 26px; display: grid;
  grid-template-columns: 1fr auto; gap: 20px; align-items: center;
  margin-bottom: 12px;
}
.bibh-sp-hcard__left { display: flex; align-items: center; gap: 16px; }
.bibh-sp-hcard__avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--bibh-accent, #F3D76A); color: var(--bibh-dark, #203D48);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.bibh-sp-hcard__name  { font-size: 20px; font-weight: 700; color: var(--bibh-dark, #203D48); margin-bottom: 3px; line-height: 1.1; }
.bibh-sp-hcard__email { font-size: 13px; color: var(--bibh-qb-muted); }

/* ── KPI tiles ── */
.bibh-sp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bibh-sp-kpi {
  background: #fff; border: 1px solid #c5e6ec; border-radius: 20px;
  padding: 12px 14px; text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
.bibh-sp-kpi__val        { font-size: 22px; font-weight: 700; color: var(--bibh-dark, #203D48); line-height: 1; }
.bibh-sp-kpi__val--sm    { font-size: 15px; }
.bibh-sp-kpi__val--pass  { color: var(--bibh-primary, #3F8170); }
.bibh-sp-kpi__val--mid   { color: #E38A4A; }
.bibh-sp-kpi__val--fail  { color: #C95E4A; }
.bibh-sp-kpi__val--muted { color: var(--bibh-qb-muted); }
.bibh-sp-kpi__lbl {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--bibh-qb-muted);
}

/* ── LO spotlight chips ── */
.bibh-sp-lo-spotlight { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.bibh-sp-lo-chip {
  border-radius: 20px; padding: 11px 15px; border: 1px solid;
  display: flex; align-items: center; gap: 10px;
}
.bibh-sp-lo-chip--best  { background: rgba(63,129,112,.07); border-color: rgba(63,129,112,.22); }
.bibh-sp-lo-chip--worst { background: rgba(201,94,74,.06);  border-color: rgba(201,94,74,.22); }
.bibh-sp-lo-chip__info  { flex: 1; min-width: 0; }
.bibh-sp-lo-chip__code  { font-size: 12px; font-weight: 700; color: var(--bibh-dark, #203D48); }
.bibh-sp-lo-chip__title {
  font-size: 12px; color: var(--bibh-qb-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bibh-sp-lo-chip__pct { font-size: 14px; font-weight: 700; flex-shrink: 0; }
.bibh-sp-lo-chip--best  .bibh-sp-lo-chip__pct { color: var(--bibh-primary, #3F8170); }
.bibh-sp-lo-chip--worst .bibh-sp-lo-chip__pct { color: #C95E4A; }
.bibh-sp-lo-chip__badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; flex-shrink: 0; white-space: nowrap;
}
.bibh-sp-lo-chip--best  .bibh-sp-lo-chip__badge { background: rgba(63,129,112,.12); color: var(--bibh-primary, #3F8170); }
.bibh-sp-lo-chip--worst .bibh-sp-lo-chip__badge { background: rgba(201,94,74,.10);  color: #C95E4A; }

/* ── Date range bar ── */
.bibh-sp-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.bibh-sp-range__presets { display: flex; gap: 6px; flex-wrap: wrap; }
.bibh-sp-preset {
  padding: 5px 14px; border-radius: 30px; border: 1px solid var(--bibh-qb-border);
  background: #fff; font-size: 12px; font-weight: 600;
  color: var(--bibh-dark, #203D48); cursor: pointer; font-family: inherit; transition: all .15s;
}
.bibh-sp-preset.is-active { background: var(--bibh-dark, #203D48); border-color: var(--bibh-dark, #203D48); color: #fff; }
.bibh-sp-range__custom { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.bibh-sp-range__sep    { font-size: 12px; color: var(--bibh-qb-muted); }
input.bibh-sp-date-input {
  border: 1px solid var(--bibh-qb-border) !important; border-radius: 30px !important;
  padding: 5px 10px; font-size: 12px; color: var(--bibh-dark, #203D48);
  background: #fff; font-family: inherit;
}
.bibh-sp-apply-btn {
  padding: 5px 14px; border-radius: 30px; border: none;
  background: var(--bibh-primary, #3F8170); color: #fff;
  font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
}

/* ── Tab nav ── */
.bibh-sp-tabs {
  display: flex; gap: 2px; border-bottom: 2px solid var(--bibh-qb-border);
  margin-bottom: 20px; flex-wrap: wrap; align-items: flex-end;
}
.bibh-sp-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; font-size: 13px; font-weight: 700;
  color: var(--bibh-qb-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; text-decoration: none;
  transition: color .15s, border-color .15s; white-space: nowrap;
}
.bibh-sp-tab:hover   { color: var(--bibh-dark, #203D48); }
.bibh-sp-tab.is-active { color: var(--bibh-primary, #3F8170); border-bottom-color: var(--bibh-primary, #3F8170); }
.bibh-sp-tab--folder { /* no overrides - inherits all styles from .bibh-sp-tab */ }

/* ── Section cards ── */
.bibh-sp-card {
  background: #fff; border: 1px solid #e2e5ea;
  border-radius: 30px; overflow: hidden; margin-bottom: 16px;
}
.bibh-sp-card__head {
  background: var(--bibh-qb-surface, #F4F7F5); padding: 11px 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .7px; color: var(--bibh-qb-muted);
  display: flex; align-items: center; justify-content: space-between;
}
.bibh-sp-card__head a {
  font-size: 11px; font-weight: 700; color: var(--bibh-primary, #3F8170);
  text-decoration: none; text-transform: uppercase; letter-spacing: .5px;
}
.bibh-sp-card__head a:hover { text-decoration: underline; }
.bibh-sp-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px; background: var(--bibh-qb-border); color: var(--bibh-qb-muted); font-size: 11px; font-weight: 700; }
.bibh-sp-card__body       { padding: 0 20px; }
.bibh-sp-card__body--lo   { padding: 12px 20px; }
.bibh-sp-card__body--notes { padding: 16px 20px; }

/* ── Overview 2×2 card grid ── */
.bibh-sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.bibh-sp-grid .bibh-sp-card { margin-bottom: 0; }

/* ── Activity feed ── */
.bibh-sp-feed { list-style: none; padding: 0; margin: 0; }
.bibh-sp-feed__item {
  display: grid; grid-template-columns: 32px 1fr auto;
  gap: 12px; align-items: center; padding: 11px 0;
  border-bottom: 1px solid #eaecf0;
  transition: background .1s;
}
.bibh-sp-feed__item:last-child { border-bottom: none; }
.bibh-sp-feed__item:hover { background: #f5f9fb; margin: 0 -20px; padding: 11px 20px; }
.bibh-sp-feed__icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bibh-sp-feed__icon--assigned { background: rgba(63,129,112,.12); color: var(--bibh-primary, #3F8170); }
.bibh-sp-feed__icon--sc       { background: rgba(243,215,106,.25); color: var(--bibh-dark, #203D48); }
.bibh-sp-feed__icon--fc       { background: rgba(145,209,219,.18); color: var(--bibh-dark, #203D48); }
.bibh-sp-feed__body  { min-width: 0; }
.bibh-sp-feed__title {
  font-size: 13px; font-weight: 700; color: var(--bibh-dark, #203D48);
  margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bibh-sp-feed__title a { color: var(--bibh-primary, #3F8170); text-decoration: none; }
.bibh-sp-feed__title a:hover { text-decoration: underline; }
.bibh-sp-feed__meta { font-size: 11px; color: var(--bibh-qb-muted); display: flex; align-items: center; gap: 5px; }
.bibh-sp-feed__dot  { opacity: .45; }

/* ── LO bar rows (overview sidebar) ── */
.bibh-sp-lo-row {
  display: grid; grid-template-columns: 52px 1fr 36px;
  gap: 8px; align-items: center; padding: 7px 0;
  border-bottom: 1px solid #eaecf0;
  transition: background .1s;
}
.bibh-sp-lo-row:last-child { border-bottom: none; }
.bibh-sp-lo-row:hover { background: #f5f9fb; margin: 0 -20px; padding: 7px 20px; }
.bibh-sp-lo-row__code  { font-size: 11px; font-weight: 700; color: var(--bibh-dark, #203D48); }
.bibh-sp-lo-row__track { height: 6px; background: var(--bibh-qb-border); border-radius: 4px; overflow: hidden; }
.bibh-sp-lo-row__fill  { height: 100%; border-radius: 4px; transition: width .4s; }
.bibh-sp-lo-row__pct   { font-size: 11px; font-weight: 700; text-align: right; }

/* ── Quiz / FC rows ── */
.bibh-sp-quiz-list { padding: 0; }
.bibh-sp-qrow {
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: 12px; align-items: center; padding: 12px 0;
  border-bottom: 1px solid #eaecf0;
  transition: background .1s;
}
.bibh-sp-qrow:last-child { border-bottom: none; }
.bibh-sp-qrow:hover { background: #f5f9fb; margin: 0 -20px; padding: 12px 20px; }
.bibh-sp-qrow__title  { font-size: 13px; font-weight: 700; color: var(--bibh-dark, #203D48); margin-bottom: 2px; }
.bibh-sp-qrow__meta   { font-size: 11px; color: var(--bibh-qb-muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.bibh-sp-qrow__cards  { font-size: 12px; color: var(--bibh-qb-muted); white-space: nowrap; }

/* ── Compact quiz rows (Overview card - source badge + date inline in meta) ── */
.bibh-sp-qrow--compact { grid-template-columns: 1fr auto auto; }
.bibh-sp-qrow--compact .bibh-sp-qrow__info { min-width: 0; }
.bibh-sp-qrow--compact .bibh-sp-qrow__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Folder overview rows (Overview card) ── */
.bibh-sp-folder-ov-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-bottom: 1px solid #eaecf0;
  transition: background .1s;
}
.bibh-sp-folder-ov-row:last-child { border-bottom: none; }
.bibh-sp-folder-ov-row:hover { background: #f5f9fb; }
.bibh-sp-folder-ov-row__title {
  flex: 1; font-size: 13px; font-weight: 700; color: var(--bibh-dark, #203D48);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-decoration: none;
}
.bibh-sp-folder-ov-row__title:hover { color: var(--bibh-primary, #3F8170); }
.bibh-sp-folder-ov-row__date { font-size: 11px; color: var(--bibh-qb-muted); flex-shrink: 0; }

/* ── Notes preview (Overview card) ── */
.bibh-sp-note-preview {
  font-size: 13px; color: var(--bibh-dark, #203D48);
  line-height: 1.6; margin: 0;
}

/* ── Source type labels ── */
.bibh-sp-src {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.bibh-sp-src--assigned { background: rgba(63,129,112,.10); color: var(--bibh-primary, #3F8170); }
.bibh-sp-src--sc       { background: rgba(243,215,106,.22); color: var(--bibh-dark, #203D48); }
.bibh-sp-src--fc       { background: rgba(145,209,219,.18); color: var(--bibh-dark, #203D48); }

/* ── Score pills ── */
.bibh-sp-pill {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.bibh-sp-pill--g { background: rgba(63,129,112,.12); color: var(--bibh-primary, #3F8170); }
.bibh-sp-pill--o { background: rgba(227,138,74,.15);  color: #E38A4A; }
.bibh-sp-pill--r { background: rgba(201,94,74,.12);   color: #C95E4A; }
.bibh-sp-pill--n { background: var(--bibh-qb-border); color: var(--bibh-qb-muted); }

/* ── Status pills (Completed / In Progress / Not Started) ── */
.bibh-sp-status {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.bibh-sp-status--completed   { background: rgba(63,129,112,.10);  color: var(--bibh-primary, #3F8170); }
.bibh-sp-status--in-progress { background: rgba(227,138,74,.15);  color: #E38A4A; }
.bibh-sp-status--not-started { background: var(--bibh-qb-border); color: var(--bibh-qb-muted); }

/* ── Review link ── */
.bibh-sp-review-link {
  display: inline-block; padding: 5px 12px; border-radius: 30px;
  font-size: 12px; font-weight: 700; color: var(--bibh-primary, #3F8170);
  border: 1px solid var(--bibh-qb-border); text-decoration: none;
  white-space: nowrap; transition: border-color .15s;
}
.bibh-sp-review-link:hover { border-color: var(--bibh-primary, #3F8170); }
.bibh-sp-review-link--empty { color: var(--bibh-qb-muted); border-color: transparent; }

/* ── LO card grid (LO Scores tab) ── */
.bibh-sp-lo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; padding: 16px 0;
}
.bibh-sp-lo-card { border: 1px solid var(--bibh-qb-border); border-radius: 20px; padding: 14px 16px; }
.bibh-sp-lo-card__code  {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--bibh-qb-muted); margin-bottom: 3px;
}
.bibh-sp-lo-card__title { font-size: 12px; color: var(--bibh-qb-ink); margin-bottom: 10px; line-height: 1.3; }
.bibh-sp-lo-card__score { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.bibh-sp-lo-card__track { height: 6px; background: var(--bibh-qb-border); border-radius: 4px; overflow: hidden; }
.bibh-sp-lo-card__fill  { height: 100%; border-radius: 4px; transition: width .4s; }

/* ── Activity timeline ── */
.bibh-sp-timeline { list-style: none; margin: 0; padding: 8px 0; position: relative; }
.bibh-sp-timeline::before {
  content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px;
  width: 2px; background: var(--bibh-qb-border);
}
.bibh-sp-tl-item {
  display: grid; grid-template-columns: 20px 1fr; gap: 14px;
  align-items: start; padding: 4px 0; position: relative;
}
.bibh-sp-tl-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bibh-qb-border); border: 2px solid #fff;
  flex-shrink: 0; position: relative; z-index: 1; margin-top: 2px;
}
.bibh-sp-tl-dot--assigned { background: var(--bibh-primary, #3F8170); }
.bibh-sp-tl-dot--sc       { background: var(--bibh-accent, #F3D76A); }
.bibh-sp-tl-dot--fc       { background: var(--bibh-secondary, #91D1DB); }
.bibh-sp-tl-content {
  padding: 1px 0 12px;
  border-bottom: 1px solid var(--bibh-qb-surface);
}
.bibh-sp-tl-item:last-child .bibh-sp-tl-content { border-bottom: none; }
.bibh-sp-tl-main  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.bibh-sp-tl-title { font-size: 13px; font-weight: 700; color: var(--bibh-dark, #203D48); }
.bibh-sp-tl-title a { color: inherit; text-decoration: none; }
.bibh-sp-tl-title a:hover { color: var(--bibh-primary, #3F8170); }
.bibh-sp-tl-date  { font-size: 11px; color: var(--bibh-qb-muted); }

/* ── Notes ── */
.bibh-sp-notes-hint { font-size: 13px; color: var(--bibh-qb-muted); margin-bottom: 14px; line-height: 1.5; }
.bibh-sp-notes-area {
  width: 100%; border: 1px solid var(--bibh-qb-border); border-radius: 16px;
  padding: 14px 16px; font-size: 13px; font-family: inherit; color: var(--bibh-qb-ink);
  resize: vertical; min-height: 160px; margin-bottom: 12px;
  transition: border-color .15s; box-sizing: border-box;
}
.bibh-sp-notes-area:focus { outline: none; border-color: var(--bibh-primary, #3F8170); }
.bibh-sp-notes-actions { display: flex; align-items: center; gap: 12px; }
.bibh-sp-save-btn {
  padding: 8px 20px; border-radius: 30px; border: none;
  background: var(--bibh-primary, #3F8170); color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.bibh-sp-notes-status { font-size: 13px; color: var(--bibh-qb-muted); }

/* ── Empty states ── */
.bibh-sp-empty {
  font-size: 13px; color: var(--bibh-qb-muted);
  text-align: center; padding: 28px 10px; font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .bibh-sp-hcard { grid-template-columns: 1fr; }
  .bibh-sp-kpis  { grid-template-columns: repeat(2, 1fr); }
  .bibh-sp-grid  { grid-template-columns: 1fr; }
  .bibh-sp-lo-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .bibh-sp-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .bibh-sp-lo-grid { grid-template-columns: 1fr; }
  .bibh-sp-lo-spotlight { grid-template-columns: 1fr; }
  .bibh-sp-qrow { grid-template-columns: 1fr auto; }
  .bibh-sp-qrow .bibh-sp-src { display: none; }
  .bibh-sp-qrow--compact { grid-template-columns: 1fr auto; }
  .bibh-sp-range__custom { margin-left: 0; flex-wrap: wrap; }
}

/* ==========================================================================
   Heatmap v2 - Signal dots + key (Track 6)
   Dots indicate which data sources (quiz / flashcards / budget lab) contribute
   to each blended cell score. Shown only when multiple signals are present.
   ========================================================================== */

/* Row of signal dots inside a heatmap cell */
.bibh-qb-hm-signals {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 3px;
  line-height: 1;
}

/* Individual dot */
.bibh-qb-hm-sig {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Quiz signal - teal (primary brand colour) */
.bibh-qb-hm-sig--quiz {
  background-color: var(--bibh-primary, #2C7D7A);
  opacity: 0.85;
}

/* Flashcard signal - yellow (accent) */
.bibh-qb-hm-sig--fc {
  background-color: var(--bibh-accent, #F3D76A);
  opacity: 0.95;
}

/* Budget Lab signal - amber */
.bibh-qb-hm-sig--bl {
  background-color: var(--bibh-qb-sev-low, #f59e0b);
  opacity: 0.9;
}

/* Signal key row - shown below the heatmap table when FC or BL data is present */
.bibh-qb-hm-signal-key {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 16px;
  font-size: 11px;
  color: var(--bibh-qb-muted, #6b7280);
}

.bibh-qb-hm-sig-key-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  color: var(--bibh-dark, #203D48);
}

/* The dots in the key are slightly larger so they're legible as legend swatches */
.bibh-qb-hm-signal-key .bibh-qb-hm-sig {
  width: 6px;
  height: 6px;
}

.bibh-qb-hm-sig-key-note {
  font-style: italic;
  color: var(--bibh-qb-muted, #6b7280);
}

