/* MVP-specific styles for TJW-MVP-03 Semester Grading (Ocean Breeze palette) */

.mvp-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 991.98px) {
  .mvp-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .mvp-stepper {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mvp-step-link {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.mvp-step-link:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
  color: var(--ink);
}

.mvp-step-link.is-active {
  border-color: var(--sob-navy);
  background: var(--surface-selected);
  color: var(--on-selected);
  box-shadow: inset 0 0 0 1px var(--sob-navy);
}

.mvp-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--surface-sunken);
  color: var(--sob-navy);
  border: 1px solid var(--border);
}

.mvp-step-link.is-active .mvp-step-num {
  background: var(--sob-navy);
  color: #fff;
  border-color: var(--sob-navy);
}

.mvp-step-text strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.mvp-step-text small {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
}

.weight-total-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
}

.weight-total-pill.is-valid {
  background: var(--success-100);
  color: var(--success-text);
}

.weight-total-pill.is-invalid {
  background: var(--danger-100);
  color: var(--danger-text);
}

.sem-table-wrap {
  max-height: 640px;
  overflow: auto;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.sem-matrix {
  min-width: 980px;
}

.sem-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  vertical-align: bottom;
}

.sem-matrix .sem-col-cat-cw {
  background: #edf5f8;
}

.sem-matrix .sem-col-cat-mid {
  background: #f3f1fb;
}

.sem-matrix .sem-col-cat-fin {
  background: #eef7f0;
}

.sem-matrix .sem-col-subtotal {
  background: #f8fafb;
  font-weight: 700;
}

.sem-matrix .sem-col-total {
  background: #eaf3f6;
  font-weight: 700;
}

.sem-cell-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
}

.sem-cell-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sem-cell-input {
  width: 74px;
  height: 32px;
  min-height: 32px;
  padding: 0 6px;
  font-size: 13px;
  text-align: right;
}

.sem-cell-input.is-missing {
  border-color: #e8c766;
  background: #fffdf4;
}

.sem-cell-input.is-zero {
  border-color: var(--warning-strong);
  background: #fff9e6;
}

.sem-cell-absent-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--ink-muted);
  cursor: pointer;
  white-space: nowrap;
}

.sem-cell-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 16px;
  font-size: 11px;
}

.sem-row-incomplete td:first-child {
  box-shadow: inset 4px 0 0 var(--sob-red);
}

.sem-row-absent td:first-child {
  box-shadow: inset 4px 0 0 var(--neutral-600);
}

.sem-row-complete td:first-child {
  box-shadow: inset 4px 0 0 var(--sob-green);
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}

.cat-badge.COURSEWORK {
  background: var(--info-100);
  color: var(--sob-navy);
}

.cat-badge.MIDTERM {
  background: #ede9fe;
  color: #4c1d95;
}

.cat-badge.FINAL {
  background: var(--success-100);
  color: var(--success-text);
}

.omr-source-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 10px;
  font-weight: 700;
}

/* N9 (MVP-08): app.css bundles daisyUI's ".stack" stacked-cards component, whose child rules
   (opacity .7/.9 and z-index 2/3) collide with this app's own ".stack" flex-column layout utility and
   rendered most page content at 70% opacity. Neutralise only those visual side effects here
   (MVP pages only; the shared compiled app.css and grading_demo are untouched). */
.stack > :nth-child(n) {
  opacity: 1;
  z-index: auto;
}

/* M5 (MVP-08): 409 explanations inside a gradebook cell wrap instead of being clipped. */
.sem-cell-meta [data-cell-error] {
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 160px;
  line-height: 1.3;
}
