/* ═══════════ 📒 Notas (gradebook.js) + aviso do records-store ═══════════ */

.rs-banner {
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.3);
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.5;
}
.rs-banner code { font-size: 0.68rem; color: var(--orange); }

.nt-filters { margin-bottom: 10px; }
.nt-filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.nt-sel { width: auto; min-width: 150px; max-width: 220px; padding: 6px 9px; }
.nt-periods { margin: 0; }
.nt-hint { font-size: 0.66rem; color: var(--muted2); line-height: 1.45; }
.nt-hint b { color: var(--text); }

.nt-save-ind { font-size: 0.66rem; font-weight: 800; color: var(--muted2); min-width: 70px; text-align: right; }
.nt-save-ind.saving { color: var(--gold); }
.nt-save-ind.ok { color: var(--green); }
.nt-save-ind.err { color: var(--red); }
.nt-save-ind a { color: inherit; }

/* ── Configuração inicial ── */
.nt-setup {
  background: var(--bg2);
  border: 1px dashed var(--border2);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.nt-setup-title { font-size: 0.82rem; margin-bottom: 10px; }
.nt-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.nt-mode {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 11px; border-radius: 10px; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border);
  transition: border-color .12s, background .12s;
}
.nt-mode:hover { border-color: var(--border2); }
.nt-mode.active { border-color: var(--gold); background: var(--gold3); }
.nt-mode-ic { font-size: 1.3rem; line-height: 1; }
.nt-mode-lb { font-weight: 800; font-size: 0.78rem; }
.nt-mode.active .nt-mode-lb { color: var(--gold); }
.nt-mode-ds { font-size: 0.64rem; color: var(--muted2); margin-top: 2px; line-height: 1.4; }

.nt-empty { text-align: center; padding: 26px 16px; background: var(--bg2); border-radius: 12px; border: 1px solid var(--border); }

/* ── Indicadores ── */
.nt-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.nt-stat {
  flex: 1; min-width: 92px;
  padding: 8px 10px; border-radius: 9px;
  background: var(--bg2); border: 1px solid var(--border);
}
.nt-stat-v { font-size: 1.05rem; font-weight: 900; color: var(--text); }
.nt-stat-l { font-size: 0.6rem; color: var(--muted2); font-weight: 700; margin-top: 1px; }
.nt-stat.bad .nt-stat-v { color: var(--red); }
.nt-stat.warn .nt-stat-v { color: var(--orange); }
.nt-stat-mode { cursor: pointer; }
.nt-stat-mode:hover { border-color: var(--border2); }

.nt-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.nt-toolbar .nt-hint { flex: 1; min-width: 200px; }

/* ── Grade ── */
.nt-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
  -webkit-overflow-scrolling: touch;
}
.nt-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.74rem; }
.nt-table th, .nt-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}
.nt-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg3);
  font-size: 0.66rem; color: var(--muted2); font-weight: 800;
  vertical-align: bottom;
}
.nt-table tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
.nt-c-n { width: 30px; color: var(--muted); font-size: 0.64rem; }
.nt-c-name {
  text-align: left !important;
  position: sticky; left: 0; z-index: 1;
  background: var(--bg2);
  min-width: 150px; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis;
}
thead .nt-c-name { z-index: 3; background: var(--bg3); }
.nt-nm { cursor: pointer; font-weight: 700; }
.nt-nm:hover { color: var(--teal); text-decoration: underline; }

th.nt-c-a { cursor: pointer; min-width: 92px; max-width: 150px; white-space: normal !important; }
th.nt-c-a:hover { background: var(--card2); color: var(--text); }
th.nt-rec { background: rgba(167, 139, 250, 0.08); }
.nt-h-t { color: var(--text); font-size: 0.7rem; line-height: 1.25; }
.nt-h-s { font-weight: 600; margin-top: 2px; }
.nt-h-p { font-size: 0.56rem; margin-top: 3px; color: var(--muted); }
.nt-h-p.on { color: var(--green); }

.nt-in {
  width: 62px; min-height: 32px;
  text-align: center;
  font: inherit; font-weight: 800; font-size: 0.82rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 4px;
}
.nt-in:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.25); background: var(--bg3); }
.nt-in.st-low { color: var(--red); }
.nt-in.st-f { color: var(--orange); background: rgba(251, 146, 60, 0.08); }
.nt-in.st-d { color: var(--muted2); font-style: italic; }
.nt-in.st-err { border-color: var(--red); box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.3); }

.nt-c-f { min-width: 74px; position: sticky; right: 0; background: var(--bg2); border-left: 1px solid var(--border); }
thead .nt-c-f { background: var(--bg3); }
.nt-final { display: inline-block; min-width: 38px; padding: 2px 7px; border-radius: 7px; font-weight: 900; font-size: 0.84rem; }
.nt-final.ok { color: var(--green); background: rgba(52, 211, 153, 0.1); }
.nt-final.low { color: var(--red); background: rgba(248, 113, 113, 0.1); }
.nt-final.none { color: var(--muted); }
.nt-final-p { display: block; font-size: 0.54rem; color: var(--muted2); font-weight: 700; margin-top: 1px; }
.nt-table tfoot td { background: var(--bg3); font-weight: 800; font-size: 0.7rem; border-bottom: 0; }
.nt-table tfoot .nt-c-name, .nt-table tfoot .nt-c-f { background: var(--bg3); }
.nt-foot-n { font-size: 0.54rem; color: var(--muted); font-weight: 600; }

/* ── Modais ── */
.nt-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.nt-kinds { display: flex; flex-wrap: wrap; gap: 5px; }
.nt-kind {
  padding: 6px 10px; border-radius: 15px; cursor: pointer; user-select: none;
  background: var(--bg3); border: 1px solid var(--border);
  font-size: 0.7rem; font-weight: 700; color: var(--muted2);
}
.nt-kind:hover { color: var(--text); }
.nt-kind.active { background: var(--gold3); border-color: var(--gold); color: var(--gold); }
.nt-check { display: flex; gap: 8px; align-items: center; font-size: 0.74rem; margin: 8px 0; cursor: pointer; }
.nt-check input { width: 16px; height: 16px; accent-color: var(--gold); }
.nt-menu { display: flex; flex-direction: column; gap: 7px; }
.nt-menu .btn { justify-content: center; min-height: 40px; }
.nt-copy-list { max-height: 300px; overflow-y: auto; }

.nt-paste-ta { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; }
.nt-paste-prev { max-height: 290px; overflow-y: auto; margin-top: 6px; }
.nt-pv-table { width: 100%; border-collapse: collapse; font-size: 0.7rem; }
.nt-pv-table th { text-align: left; color: var(--muted2); font-size: 0.6rem; padding: 4px; border-bottom: 1px solid var(--border); }
.nt-pv-table td { padding: 3px 4px; border-bottom: 1px solid var(--border); }
.nt-pv-raw { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted2); }
.nt-pv-sel { padding: 3px 5px; font-size: 0.68rem; min-width: 160px; }
.nt-pv-val { font-weight: 900; text-align: center; }
.nt-pv { font-size: 0.6rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.nt-pv.ok { color: var(--green); background: rgba(52, 211, 153, 0.1); }
.nt-pv.warn { color: var(--orange); background: rgba(251, 146, 60, 0.1); }
.nt-pv.bad { color: var(--red); background: rgba(248, 113, 113, 0.1); }
.nt-pv.muted { color: var(--muted2); }
.nt-pv-row-bad td { opacity: 0.8; }

/* ── Notas do aluno (perfil e portais) ── */
.nt-pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.nt-pt-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 11px; padding: 11px 12px; }
.nt-pt-subj { font-weight: 900; font-size: 0.86rem; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.nt-pt-crit { font-size: 0.58rem; color: var(--muted2); font-weight: 700; margin-left: auto; }
.nt-pt-period { border-top: 1px solid var(--border); padding-top: 6px; margin-top: 6px; }
.nt-pt-period:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.nt-pt-ph { display: flex; align-items: center; gap: 8px; font-size: 0.7rem; font-weight: 800; color: var(--muted2); margin-bottom: 4px; }
.nt-pt-ph .nt-final { margin-left: auto; }
.nt-pt-ph .nt-final-p { display: inline; }
.nt-pt-item { display: flex; justify-content: space-between; gap: 8px; font-size: 0.72rem; padding: 3px 0; }
.nt-pt-v { font-weight: 900; white-space: nowrap; }
.nt-pt-v small { color: var(--muted); font-weight: 600; }
.nt-pt-v.low { color: var(--red); }
.nt-pt-lock { font-size: 0.62rem; opacity: 0.7; }

@media (max-width: 600px) {
  .nt-sel { max-width: none; flex: 1; }
  .nt-stat { min-width: 76px; padding: 6px 8px; }
  .nt-stat-v { font-size: 0.92rem; }
  .nt-c-name { min-width: 112px; max-width: 132px; }
  .nt-in { width: 52px; }
  th.nt-c-a { min-width: 70px; }
  .nt-pt-grid { grid-template-columns: 1fr; }
}
