/* ════════════ PERFORMANCE SCORING ════════════ */

/* ── Inner page tabs ── */
.perf-page-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px;
  margin-bottom: var(--space-lg);
  width: fit-content;
}
.perf-tab {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.perf-tab svg { width: 14px; height: 14px; }
.perf-tab.active { background: var(--surface2); color: var(--accent); box-shadow: var(--shadow-sm); }
.perf-tab:hover:not(.active) { color: var(--text-soft); }

.perf-section { display: none; }
.perf-section.active { display: block; animation: fadeIn .2s ease; }

/* ── Month selector bar ── */
.month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
}
.month-bar__left { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.month-bar__title { font-size: 1rem; font-weight: 700; }
.month-bar__badge {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 700;
}
.month-select {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
}

/* ── Scoring grid ── */
.scoring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-md);
}

/* ── Score card ── */
.score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t);
}
.score-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }

.score-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.score-card__member { display: flex; align-items: center; gap: 10px; }
.score-card__name   { font-weight: 700; font-size: 0.9rem; }
.score-card__role   { font-size: 0.72rem; color: var(--muted); }

.score-card__total {
  text-align: right;
}
.score-card__total-val {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}
.score-card__total-label { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ── Category blocks ── */
.score-card__body { padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-md); }

.score-category {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
}
.score-cat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}
.score-cat__title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.score-cat__title svg { width: 13px; height: 13px; }
.score-cat__pts {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}

/* Category colors */
.cat-meets  .score-cat__title { color: var(--blue); }
.cat-meets  .score-cat__pts   { background: var(--blue-dim); color: var(--blue); }
.cat-design .score-cat__title { color: var(--purple); }
.cat-design .score-cat__pts   { background: rgba(168,85,247,.15); color: var(--purple); }
.cat-ai     .score-cat__title { color: var(--green); }
.cat-ai     .score-cat__pts   { background: var(--green-dim); color: var(--green); }

/* Meets input row */
.meets-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.meets-row label { font-size: 0.78rem; color: var(--muted); flex: 1; }
.meets-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface3);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
}
.stepper-btn {
  width: 22px; height: 22px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), color var(--t-fast);
}
.stepper-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.stepper-val {
  width: 28px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
}

/* Design weekly grid */
.design-weeks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.design-week {
  text-align: center;
}
.design-week label {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 3px;
}
.design-input {
  width: 100%;
  padding: 5px 4px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 700;
}
.design-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* AI checkboxes */
.ai-checks { display: flex; flex-direction: column; gap: 6px; }
.ai-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.ai-check-row:hover { background: var(--surface3); }
.ai-check-row.checked { background: var(--green-dim); border-color: var(--green); }
.ai-check-row.mandatory { border-color: var(--yellow); }
.ai-check-label { font-size: 0.78rem; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.ai-check-label svg { width: 13px; height: 13px; color: var(--muted); }
.ai-pts-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--muted);
}
.ai-check-row.checked .ai-pts-tag { background: var(--green-dim); color: var(--green); }

/* Custom checkbox */
.ai-checkbox { display: none; }

/* Progress bar inside card */
.score-card__bar {
  margin: 0 var(--space-md) var(--space-md);
}
.score-bar-track {
  height: 6px;
  background: var(--surface3);
  border-radius: 99px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .6s ease, background .4s;
}

/* Save button */
.score-card__footer {
  padding: var(--space-sm) var(--space-md) var(--space-md);
}
.score-save-btn {
  width: 100%;
  padding: 9px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.score-save-btn svg { width: 13px; height: 13px; }
.score-save-btn.unsaved  { background: var(--accent); color: #fff; }
.score-save-btn.unsaved:hover { background: var(--accent-dark); }
.score-save-btn.saved    { background: var(--green-dim); color: var(--green); border: 1px solid var(--green); }

/* ════════════ 6-MONTH BOARD ════════════ */

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.board-header__info h3 { font-size: 1rem; font-weight: 700; }
.board-header__info p  { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

.board-scroll { overflow-x: auto; }
.board-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 700px;
}
.board-table th {
  padding: 10px 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  background: var(--surface2);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  text-align: center;
}
.board-table th:first-child { text-align: left; border-radius: var(--radius-sm) 0 0 0; }
.board-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.board-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.85rem;
  vertical-align: middle;
  text-align: center;
}
.board-table td:first-child { text-align: left; }
.board-table tr:last-child td { border-bottom: none; }
.board-table tr:hover td { background: var(--surface2); }

.board-member-cell { display: flex; align-items: center; gap: 10px; }
.board-member-name { font-weight: 600; font-size: 0.875rem; }
.board-member-role { font-size: 0.7rem; color: var(--muted); }

.score-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
}
.score-chip.excellent { background: var(--green-dim);   color: var(--green); }
.score-chip.good      { background: var(--blue-dim);    color: var(--blue); }
.score-chip.average   { background: var(--yellow-dim);  color: var(--yellow); }
.score-chip.poor      { background: var(--red-dim);     color: var(--red); }
.score-chip.empty     { background: var(--surface3);    color: var(--muted); }

.avg-chip {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface3);
}

/* Vanish section */
.vanish-panel {
  margin-top: var(--space-lg);
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: var(--space-lg);
}
.vanish-panel h4 { color: var(--red); font-size: 0.9rem; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.vanish-panel h4 svg { width: 16px; height: 16px; }
.vanish-panel p  { font-size: 0.82rem; color: var(--text-soft); margin-bottom: var(--space-md); }
.vanish-month-checks { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--space-md); }
.vanish-month-check  {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--t);
}
.vanish-month-check.selected { background: var(--red-dim); border-color: var(--red); color: var(--red); }
.vanish-month-check input { accent-color: var(--red); }

/* Archives panel */
.archive-list { display: flex; flex-direction: column; gap: 8px; margin-top: var(--space-md); }
.archive-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}
.archive-item__label { font-weight: 600; }
.archive-item__meta  { color: var(--muted); font-size: 0.72rem; margin-top: 2px; }

/* ── Viewer mode: disable all interactive scoring inputs ── */
body.viewer-mode .stepper-btn         { pointer-events: none; opacity: .4; }
body.viewer-mode .design-input        { pointer-events: none; opacity: .7; background: var(--surface3); }
body.viewer-mode .ai-check-row        { pointer-events: none; cursor: default; }
body.viewer-mode .meets-stepper       { opacity: .7; }

/* ── Responsive ── */
@media (max-width: 760px) {
  .scoring-grid { grid-template-columns: 1fr; }
  .perf-page-tabs { width: 100%; }
  .perf-tab { flex: 1; justify-content: center; padding: 8px; font-size: .78rem; }
}
@media (max-width: 480px) {
  .design-weeks { grid-template-columns: repeat(2,1fr); }
}
