/* Hồ sơ học sinh — đợt 12 Agent B. Chỉ biến màu app.css. */

body:has(#v-hoso:not([hidden])) .page-head { display: none; }

#v-hoso { display: grid; gap: 16px; }
#v-hoso[hidden] { display: none; }

.hs-skel { display: grid; gap: 16px; }
.hs-skel .sk-block { min-height: 88px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface-2), var(--surface-hover), var(--surface-2)); background-size: 200% 100%; animation: hs-shimmer 1.2s ease-in-out infinite; }
.hs-skel .sk-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hs-skel .sk-kpi { min-height: 96px; border-radius: var(--r); background: var(--surface-2); }
.hs-skel .sk-chart { min-height: 240px; }
.hs-skel .sk-table { min-height: 160px; }
@media (max-width: 767px) {
  .hs-skel .sk-kpis { grid-template-columns: 1fr 1fr; }
}

@keyframes hs-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hs-skel .sk-block { animation: none; }
}

.hs-head .asg-title-row { align-items: center; gap: 10px; }
.hs-trend {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted);
}
.hs-trend.tone-good {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--green) 30%, var(--border));
}
.hs-trend.tone-warn {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--amber) 30%, var(--border));
}

.hs-kpis { margin: 0; }
.hs-kpi-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 4px; border-radius: 50%;
  font-size: 11px; font-weight: 700; line-height: 1;
  color: var(--text-muted); background: var(--surface-2);
  border: 1px solid var(--border); cursor: help; vertical-align: middle;
}

.hs-chart-card { display: grid; gap: 12px; }
.hs-chart-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 16px;
}
.hs-chart-title { font-size: 17px; font-weight: 700; color: var(--text-strong); margin: 0; }
.hs-chart-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hs-seg {
  display: inline-flex; padding: 3px; gap: 2px;
  border-radius: var(--r-sm); background: var(--surface-2);
}
.hs-seg button {
  border: 0; background: transparent; color: var(--text-muted);
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: calc(var(--r-sm) - 2px);
  cursor: pointer; white-space: nowrap; min-height: 32px;
}
.hs-seg button[aria-pressed="true"] {
  background: var(--surface); color: var(--text-strong);
  box-shadow: var(--shadow);
}
.hs-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.hs-legend {
  display: flex; flex-wrap: wrap; gap: 12px 16px;
  font-size: 12px; color: var(--text-muted);
}
.hs-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hs-leg-line {
  width: 18px; height: 0; border-top: 2px solid var(--accent); display: inline-block;
}
.hs-leg-dash {
  width: 18px; height: 0; border-top: 1.5px dashed var(--text-faint); display: inline-block;
}
.hs-leg-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block;
}
.hs-leg-hollow {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--text-faint); background: transparent; display: inline-block;
}

.hs-plot-wrap { position: relative; width: 100%; min-height: 220px; }
.hs-plot-svg {
  width: 100%; height: 220px; display: block;
  touch-action: manipulation;
}
.hs-plot-svg .hs-line {
  fill: none; stroke: var(--accent); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.hs-plot-svg .hs-avg {
  fill: none; stroke: var(--text-faint); stroke-width: 1.5;
  stroke-dasharray: 4 4; vector-effect: non-scaling-stroke;
}
.hs-plot-svg .hs-zero {
  fill: none; stroke: var(--border-strong); stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.hs-plot-svg .hs-grid {
  stroke: var(--border-soft); stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.hs-plot-svg .hs-axis {
  fill: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums;
}
.hs-plot-svg .hs-cross {
  stroke: var(--text-muted); stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.hs-plot-svg .hs-dot {
  fill: var(--accent); stroke: var(--surface); stroke-width: 2;
  cursor: pointer;
}
.hs-plot-svg .hs-dot.tone-good { fill: var(--green); }
.hs-plot-svg .hs-dot.tone-accent { fill: var(--accent); }
.hs-plot-svg .hs-dot.tone-warn { fill: var(--amber); }
.hs-plot-svg .hs-dot.tone-bad { fill: var(--red); }
.hs-plot-svg .hs-dot-miss {
  fill: var(--surface); stroke: var(--text-faint); stroke-width: 1.5; cursor: default;
}
.hs-plot-svg .hs-dot-pend {
  fill: var(--surface); stroke: var(--text-faint); stroke-width: 1.5;
  stroke-dasharray: 2 2; cursor: default;
}
.hs-plot-svg .hs-hit { fill: transparent; cursor: pointer; }
.hs-plot-svg .hs-base {
  stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke;
}
.hs-tip {
  position: absolute; z-index: 3; pointer-events: none;
  max-width: min(280px, 90%);
  padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-strong);
  border: 1px solid var(--border); box-shadow: var(--shadow-pop);
  font-size: 12px; line-height: 1.4;
}
.hs-tip[hidden] { display: none; }
.hs-tip b { font-weight: 700; }

.hs-heat-card { display: grid; gap: 12px; }
.hs-heat-title { font-size: 17px; font-weight: 700; color: var(--text-strong); margin: 0; }
.hs-heat-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hs-heat {
  width: 100%; border-collapse: separate; border-spacing: 4px;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.hs-heat th {
  text-align: center; font-weight: 600; color: var(--text-muted);
  padding: 6px 8px; font-size: 12px;
}
.hs-heat th.hs-heat-topic { text-align: left; min-width: 120px; }
.hs-heat td {
  text-align: center; padding: 8px 6px; border-radius: var(--r-sm);
  border: 1px solid var(--border-soft); color: var(--text-strong);
  min-width: 56px;
}
.hs-heat .hs-topic {
  text-align: left; font-weight: 600; color: var(--text-strong);
  background: transparent; border: 0; padding-left: 0;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hs-heat td.band-good,
.hs-topic-cells > span.band-good {
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--green) 28%, var(--border));
}
.hs-heat td.band-accent,
.hs-topic-cells > span.band-accent {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}
.hs-heat td.band-warn,
.hs-topic-cells > span.band-warn {
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--amber) 28%, var(--border));
}
.hs-heat td.band-bad,
.hs-topic-cells > span.band-bad {
  background: color-mix(in srgb, var(--red) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--red) 28%, var(--border));
}
.hs-heat td.band-sparse,
.hs-topic-cells > span.band-sparse {
  background: var(--surface-2); color: var(--text-muted); border-color: var(--border-soft);
}
.hs-heat td.band-empty,
.hs-topic-cells > span.band-empty {
  background: transparent; color: var(--text-faint); border-color: transparent;
}
.hs-heat-leg {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  font-size: 12px; color: var(--text-muted);
}
.hs-heat-leg i {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  margin-right: 4px; vertical-align: -1px;
  border: 1px solid var(--border);
}
.hs-heat-leg .lg-good { background: color-mix(in srgb, var(--green) 40%, var(--surface)); }
.hs-heat-leg .lg-accent { background: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.hs-heat-leg .lg-warn { background: color-mix(in srgb, var(--amber) 40%, var(--surface)); }
.hs-heat-leg .lg-bad { background: color-mix(in srgb, var(--red) 40%, var(--surface)); }
.hs-heat-leg .lg-sparse { background: var(--surface-2); }
.hs-advice {
  margin: 0; font-size: 13px; color: var(--text); line-height: 1.45;
}
.hs-advice strong { color: var(--text-strong); font-weight: 700; }

/* Thẻ chủ đề trên điện thoại */
.hs-topic-cards { display: none; gap: 10px; }
.hs-topic-card {
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 12px 14px; background: var(--surface-2); display: grid; gap: 8px;
}
.hs-topic-card b {
  font-size: 14px; color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hs-topic-cells {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.hs-topic-cells span {
  display: grid; gap: 2px; justify-items: center;
  padding: 6px 4px; border-radius: var(--r-sm);
  font-size: 12px; font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-soft);
}
.hs-topic-cells .lv { font-size: 11px; color: var(--text-muted); font-weight: 600; }

.hs-list-card { display: grid; gap: 12px; }
.hs-list-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px;
}
.hs-list-title { font-size: 17px; font-weight: 700; color: var(--text-strong); margin: 0; }
.hs-items { width: 100%; border-collapse: collapse; font-size: 13px; }
.hs-items th {
  text-align: left; font-weight: 600; color: var(--text-muted);
  padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 12px;
  white-space: nowrap;
}
.hs-items td {
  padding: 10px; border-bottom: 1px solid var(--border-soft);
  vertical-align: middle; color: var(--text);
}
.hs-items .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hs-score-cell {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-strong);
}
.hs-score-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none;
}
.hs-score-dot.tone-good { background: var(--green); }
.hs-score-dot.tone-accent { background: var(--accent); }
.hs-score-dot.tone-warn { background: var(--amber); }
.hs-score-dot.tone-bad { background: var(--red); }
.hs-sig {
  display: inline-flex; align-items: center; gap: 6px; color: var(--amber);
}
.hs-sig svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.hs-mcards { display: none; gap: 8px; }
.hs-mrow {
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 12px 14px; background: var(--surface-2);
  display: grid; gap: 8px;
}
.hs-mrow-top {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
}
.hs-mrow-name {
  font-weight: 700; color: var(--text-strong); font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hs-mrow-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.hs-mrow-acts { display: flex; gap: 8px; }

@media (max-width: 767px) {
  .hs-desk { display: none; }
  .hs-mcards { display: grid; }
  .hs-heat-desk { display: none; }
  .hs-topic-cards { display: grid; }
}

/* ——— Khối trên trang lớp ——— */
.cls-attn { display: grid; gap: 12px; }
.cls-attn-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 17px; font-weight: 700; color: var(--text-strong); margin: 0;
}
.cls-attn-title .cls-attn-n {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
}
.cls-attn-list { display: grid; gap: 8px; }
.cls-attn-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--border-soft);
  border-radius: var(--r); background: var(--surface-2);
}
.cls-attn-av {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); flex: none;
}
.cls-attn-main { min-width: 0; display: grid; gap: 2px; }
.cls-attn-name {
  font-size: 14px; font-weight: 700; color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cls-attn-why {
  font-size: 13px; color: var(--text); line-height: 1.4;
  display: flex; align-items: flex-start; gap: 6px;
}
.cls-attn-why svg {
  width: 16px; height: 16px; flex: none; margin-top: 1px;
  stroke: var(--amber); fill: none; stroke-width: 2;
}
.cls-attn-why.kind-drop svg { stroke: var(--amber); }
.cls-attn-why.kind-missed svg { stroke: var(--text-muted); }
.cls-attn-why.kind-weak svg { stroke: var(--accent); }
.cls-attn-why.kind-risk svg { stroke: var(--red); }
.cls-attn-why strong { font-weight: 700; color: var(--text-strong); }

.cls-dup { display: grid; gap: 8px; }
.cls-dup > summary {
  cursor: pointer; list-style: none;
  font-size: 15px; font-weight: 700; color: var(--text-strong);
  padding: 4px 0; display: flex; align-items: center; gap: 8px;
}
.cls-dup > summary::-webkit-details-marker { display: none; }
.cls-dup > summary::before {
  content: ''; width: 0; height: 0;
  border-left: 5px solid var(--text-muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 120ms ease;
}
.cls-dup[open] > summary::before { transform: rotate(90deg); }
.cls-dup-n { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.cls-dup-list { display: grid; gap: 8px; margin-top: 4px; }
.cls-dup-row {
  display: grid; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border-soft);
  border-radius: var(--r); background: var(--surface-2);
}
.cls-dup-pair {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  font-size: 14px; color: var(--text-strong);
}
.cls-dup-pair b { font-weight: 700; }
.cls-dup-why {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
}
.cls-dup-meta { font-size: 12px; color: var(--text-muted); }
.cls-dup-acts {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.cls-merge-chip {
  display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; margin-left: 6px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  vertical-align: middle; white-space: nowrap;
}
.cls-stu-name-link {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; font-weight: 700; color: var(--accent);
  cursor: pointer; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.cls-stu-name-link:hover { text-decoration: underline; }
.cls-stu-name-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.cls-stu-acts {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end;
}
.cls-stu.has-acts {
  grid-template-columns: 1fr auto auto;
}
@media (max-width: 767px) {
  .cls-attn-row {
    grid-template-columns: auto 1fr;
  }
  .cls-attn-row .btn-sm {
    grid-column: 1 / -1; width: 100%; min-height: 44px;
  }
  .cls-stu.has-acts { grid-template-columns: 1fr auto; }
  .cls-stu.has-acts .cls-stu-acts {
    grid-column: 1 / -1; width: 100%;
  }
  .cls-stu.has-acts .cls-stu-acts .btn-sm {
    flex: 1 1 auto; min-height: 44px; justify-content: center;
  }
  .cls-dup-acts .btn-sm { min-height: 44px; }
}

.hs-merge-pick { display: grid; gap: 10px; margin: 12px 0; }
.hs-merge-opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--r); background: var(--surface-2); cursor: pointer;
}
.hs-merge-opt:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.modal .hs-merge-opt input[type="radio"],
.hs-merge-opt input {
  flex: none; width: 18px; height: 18px; min-height: 0; padding: 0;
  margin: 2px 0 0; accent-color: var(--accent);
}
.hs-merge-opt > div { flex: 1; min-width: 0; }
.hs-merge-hint { margin: 4px 0 0; font-size: 14px; color: var(--text-muted); }
.hs-merge-opt b { display: block; color: var(--text-strong); }
.hs-merge-opt span { font-size: 12px; color: var(--text-muted); }

.hs-dlg-acts { justify-content: flex-end; }
