/* ============================================================
   Module-wise Performance Record — v0.6.0
   Reuses the existing portal palette, spacing and controls.
   ============================================================ */

.kmv-card-top-compact {
  margin-bottom: 24px;
}

.kmv-student-summary {
  padding: 0 0 26px;
}

.kmv-student-summary-primary span,
.kmv-student-summary-grid span,
.kmv-performance-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.65px;
  text-transform: uppercase;
}

.kmv-student-summary-primary h2 {
  margin: 0;
  color: var(--km-blue);
  font-size: 25px;
  line-height: 1.25;
}

.kmv-student-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.kmv-student-summary-grid strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.kmv-record-section {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.kmv-record-section:last-child {
  padding-bottom: 0;
}

.kmv-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.kmv-section-heading h2 {
  margin: 0;
  color: var(--km-blue);
  font-size: 21px;
  line-height: 1.3;
}

.kmv-verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  white-space: nowrap;
}

.kmv-performance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.kmv-performance-summary > div {
  min-width: 0;
  padding: 17px 18px;
}

.kmv-performance-summary > div + div {
  border-left: 1px solid var(--line);
}

.kmv-performance-summary strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.kmv-section-action {
  margin-top: 16px;
}

.kmv-section-message {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  color: #526378;
  font-size: 14px;
  line-height: 1.55;
}

.kmv-section-message-warning {
  border-color: #ffe4a3;
  background: #fffdf5;
  color: var(--warning-text);
}

.kmv-certificate-list {
  display: grid;
  gap: 12px;
}

.kmv-certificate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.kmv-certificate-row-main h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.4;
}

.kmv-certificate-row-action {
  min-width: 150px;
  text-align: right;
}

.kmv-certificate-row-action a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 9px;
  background: var(--km-blue);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.kmv-certificate-row-action a:hover {
  background: #00428f;
}

.kmv-record-main {
  flex: 1;
  margin: 0 auto;
  padding-top: 40px;
  padding-bottom: 48px;
}

.kmv-performance-page {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(0, 48, 112, 0.08);
}

.kmv-performance-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 28px;
  border-bottom: 1px solid var(--line);
}

.kmv-performance-title-row h1 {
  margin: 0;
  color: var(--km-blue);
  font-size: 30px;
  line-height: 1.25;
}

.kmv-performance-identity {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 28px;
  padding: 26px 28px;
}

.kmv-performance-summary-large {
  margin: 0 28px 28px;
}

.kmv-module-section {
  padding: 0 28px 28px;
}

.kmv-module-section h2 {
  margin: 0 0 14px;
  color: var(--km-blue);
  font-size: 20px;
}

.kmv-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.kmv-module-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 14px;
}

.kmv-module-table th,
.kmv-module-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.kmv-module-table th {
  background: #f6f9fc;
  color: #526378;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.kmv-module-table th:nth-child(2),
.kmv-module-table th:nth-child(3),
.kmv-module-table td:nth-child(2),
.kmv-module-table td:nth-child(3) {
  width: 150px;
  text-align: center;
}

.kmv-module-table tbody tr:last-child td {
  border-bottom: 0;
}

.kmv-module-table td:first-child {
  color: var(--ink);
  font-weight: 700;
}

.kmv-module-table td:nth-child(2),
.kmv-module-table td:nth-child(3) {
  color: var(--km-blue);
  font-weight: 800;
}

.kmv-performance-footer-note {
  padding: 20px 28px 24px;
  border-top: 1px solid var(--line);
  background: #fbfdff;
}

.kmv-performance-footer-note p {
  margin: 0;
  color: #526378;
  font-size: 13px;
  line-height: 1.6;
}

.kmv-performance-footer-note p + p {
  margin-top: 6px;
}

.kmv-performance-footer-note strong {
  color: var(--ink);
}

.kmv-performance-link-card {
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 48, 112, 0.06);
}

.kmv-performance-link-card h2 {
  margin: 0;
  color: var(--km-blue);
  font-size: 18px;
}

.kmv-performance-link-card p {
  margin: 6px 0 0;
  color: #526378;
  font-size: 14px;
}

@media (max-width: 760px) {
  .kmv-student-summary-grid,
  .kmv-performance-identity {
    grid-template-columns: 1fr;
  }

  .kmv-performance-summary {
    grid-template-columns: 1fr;
  }

  .kmv-performance-summary > div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .kmv-certificate-row {
    grid-template-columns: 1fr;
  }

  .kmv-certificate-row-action {
    min-width: 0;
    text-align: left;
  }

  .kmv-performance-title-row,
  .kmv-performance-link-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .kmv-performance-title-row,
  .kmv-performance-identity,
  .kmv-module-section,
  .kmv-performance-footer-note {
    padding-left: 20px;
    padding-right: 20px;
  }

  .kmv-performance-summary-large {
    margin-left: 20px;
    margin-right: 20px;
  }
}

.kmv-grading-scale {
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft, #f8fafc);
}

.kmv-grading-scale h2 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

.kmv-grading-scale-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.kmv-grading-scale-list span {
    white-space: nowrap;
}

.kmv-grading-scale-list strong {
    color: var(--ink);
    margin-right: 3px;
}

@media (max-width: 640px) {
    .kmv-grading-scale-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 14px;
    }

    .kmv-grading-scale-list span {
        white-space: normal;
    }
}

@media (max-width: 540px) {
  .kmv-performance-title-row h1 {
    font-size: 24px;
  }

  .kmv-module-table th,
  .kmv-module-table td {
    padding: 12px;
  }

  .kmv-module-table th:nth-child(2),
  .kmv-module-table th:nth-child(3),
  .kmv-module-table td:nth-child(2),
  .kmv-module-table td:nth-child(3) {
    width: 105px;
  }
}


@media print {
  .kmv-performance-link-card {
    display: none !important;
  }
}

/* ============================================================
   Search-results integration refinement — v0.6.1
   Keeps the original production certificate-card appearance.
   ============================================================ */

.kmv-result-content {
  min-width: 0;
}

.kmv-performance-result h2 {
  margin-bottom: 12px;
}

.kmv-performance-result-meta {
  margin-top: 0;
}

.kmv-result-service-alert {
  margin-bottom: 14px;
}

.kmv-alert-warning {
  border: 1px solid #ffe4a3;
  background: #fffdf5;
  color: var(--warning-text);
}

.kmv-result-note {
  margin: 16px 0 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  color: #526378;
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .kmv-performance-result h2 {
    margin-bottom: 10px;
  }
}
