/* ── TABLES (.grades-table is the app's general table) ── */
.grades-table-wrap { overflow-x: auto; }
.grades-table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 12.5px; }
.grades-table th, .grades-table td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 7px 9px; white-space: nowrap; }
.grades-table th:first-child, .grades-table td:first-child { border-left: 1px solid var(--line); }
.grades-table thead tr:first-child th { border-top: 1px solid var(--line); }
.grades-table thead th { background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 11.5px; text-align: center; }
.grades-table thead tr:first-child th:first-child { border-top-left-radius: 10px; }
.grades-table thead tr:first-child th:last-child { border-top-right-radius: 10px; }
.grades-table thead tr:last-child th { color: var(--muted); font-weight: 400; }
.grades-table .name-cell { background: var(--surface); font-weight: 500; position: sticky; left: 0; z-index: 1; min-width: 140px; text-align: left; }
.grades-table tbody tr { transition: background-color var(--dur-1); }
.grades-table tbody tr:hover td, .grades-table tbody tr:hover .name-cell { background: var(--surface-2); }
.grades-table input[type="number"], .grades-table input[data-sid] { width: 56px; height: 30px; border: none; text-align: center; background: transparent; font-size: 13px; color: var(--ink); outline: none; padding: 2px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.grades-table input[type="number"]:focus, .grades-table input[data-sid]:focus { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.grades-sex-header { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin: 16px 0 6px; padding: 6px 0; border-bottom: 2px solid; }
.grades-sex-header.male { color: var(--sky-ink); border-color: var(--sky-line); }
.grades-sex-header.female { color: var(--blush-ink); border-color: var(--blush-line); }

/* ── GRADES PAGE ── */
.gr-page { max-width: 1400px; margin: 0 auto; }
.gr-head { padding: 12px 16px; margin-bottom: 14px; }
.gr-head-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gr-head-row h1 { font-size: 22px; margin-right: 4px; }
.gr-head-row .form-control { width: auto; min-height: 34px; padding: 5px 10px; }
.gr-head-sub { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.gr-weights { display: flex; gap: 6px; flex-wrap: wrap; }
.gr-weights b { font-weight: 700; margin-left: 2px; }
.gr-body.view-swap { animation: rise var(--dur-3) var(--ease-out); }
.gr-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 26px; padding: 0 9px; border-radius: var(--r-pill); font-family: var(--font-display); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.gr-chip-none { background: var(--surface-2); color: var(--ink-2); }
input.gr-missing { background: var(--butter) !important; }
input.gr-missing:focus { background: var(--accent-soft) !important; }

/* Spreadsheet */
.gr-sheet-wrap { overflow: auto; max-height: calc(100vh - 230px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.gr-sheet-wrap .grades-table { font-size: 12.5px; }
.gr-sheet-wrap .grades-table th, .gr-sheet-wrap .grades-table td { padding: 0 8px; height: 36px; text-align: center; }
.gr-sheet-wrap .grades-table th:first-child, .gr-sheet-wrap .grades-table td:first-child { border-left: none; }
.gr-sheet-wrap .grades-table thead tr:first-child th { border-top: none; border-radius: 0; }
.gr-sheet-wrap thead th { position: sticky; z-index: 3; background: var(--surface); }
.gr-sheet-wrap thead tr:nth-child(1) th { top: 0; }
.gr-sheet-wrap thead tr:nth-child(2) th { top: 36px; }
.gr-sheet-wrap thead tr:nth-child(3) th { top: 72px; background: var(--surface-2); }
.gr-sheet-wrap thead .name-cell { z-index: 4; vertical-align: bottom; padding-bottom: 8px; }
.gr-sheet-wrap .name-cell { min-width: 220px; text-align: left !important; padding: 0 12px !important; }
.gr-sheet-wrap td.name-cell { display: flex; align-items: center; gap: 10px; height: 36px; border-bottom: none; box-shadow: inset 0 -1px 0 var(--line); }
.gr-sheet-wrap .name-cell .avatar-i { width: 24px; height: 24px; font-size: 10px; }
.gr-grp { font-family: var(--font-display); font-size: 13px !important; color: var(--ink) !important; text-align: left !important; }
.gr-grp small { font-family: var(--font-ui); font-weight: 500; color: var(--muted); margin-left: 6px; font-size: 11px; }
.gr-grp.gr-ww { box-shadow: inset 0 3px 0 var(--sky-line); }
.gr-grp.gr-pt { box-shadow: inset 0 3px 0 var(--lilac-line); }
.gr-grp.gr-qa { box-shadow: inset 0 3px 0 var(--butter-line); }
.gr-act { max-width: 120px; overflow: hidden; text-overflow: ellipsis; font-weight: 500 !important; }
.gr-sum { color: var(--muted) !important; }
.gr-hps { font-size: 11px !important; }
.gr-calc { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.gr-desc { font-size: 11.5px; color: var(--ink-2); }
/* The term grade, the number teachers submit, stays in view at the right edge however far the sheet scrolls. */
.gr-sheet-wrap .gr-fin { position: sticky; right: 0; z-index: 2; background: var(--surface); box-shadow: inset 2px 0 0 var(--line); }
.gr-sheet-wrap thead th.gr-fin { z-index: 4; }
.gr-sheet-wrap tr.gr-sex td.gr-fin { background: var(--surface-2); }
.gr-sex td { height: 28px !important; background: var(--surface-2) !important; font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: left !important; }
.gr-sex td.name-cell { display: table-cell !important; height: 28px !important; padding: 0 12px !important; }
.gr-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.gr-legend-swatch { width: 14px; height: 14px; border-radius: 4px; background: var(--butter); margin-left: 8px; }
/* Keyboard hints mean nothing on a touch screen. */
@media (pointer: coarse) { .gr-keys { display: none; } }

/* Learners */
.gl { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.gl-list-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: 72px; }
.gl-tools { display: flex; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.gl-tools .form-control { min-height: 34px; padding: 5px 10px; }
.gl-list { max-height: calc(100vh - 240px); overflow: auto; }
.gl-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: none; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: var(--ink); transition: background-color var(--dur-1); }
.gl-row:hover { background: var(--surface-2); }
.gl-row.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.gl-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-spark { display: flex; align-items: flex-end; gap: 2px; height: 20px; }
.gl-spark span { width: 4px; border-radius: 1px; background: var(--line-strong); }
.gl-spark span.hi { background: var(--sage-line); } .gl-spark span.lo { background: var(--rose-line); }
.gl-detail.view-swap { animation: rise var(--dur-3) var(--ease-out); }
.gl-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.gl-head h2 { font-size: 22px; }
.gl-head .muted { font-size: 12px; }
.gl-big { text-align: right; }
.gl-big .num { font-family: var(--font-display); font-size: 64px; font-weight: 800; line-height: .9; letter-spacing: -.04em; margin-bottom: 6px; }
.gl-body { padding: 14px 20px 18px; }
.gl-comp { display: grid; grid-template-columns: 190px 1fr 60px; align-items: center; gap: 14px; padding: 8px 0; font-size: 13px; }
.gl-bar { height: 12px; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.gl-bar span { display: block; height: 100%; border-radius: 12px; width: var(--w); animation: grow-x var(--dur-4) var(--ease-out) both; transform-origin: left; }
@keyframes grow-x { from { transform: scaleX(0); } }
.gl-comp b { text-align: right; }
.gl-acts { margin-top: 12px; }
.gl-act { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.gl-act .chip { justify-content: center; }
.gl-act-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-score { display: inline-flex; align-items: center; gap: 6px; }
.gl-score input { width: 70px; min-height: 34px; text-align: center; padding: 4px; }

/* One activity */
.ge-acts { display: flex; gap: 10px; overflow-x: auto; padding: 4px 4px 12px; scrollbar-width: thin; }
.ge-act { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 180px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; color: var(--ink);
  transition: transform var(--dur-2) var(--ease-spring), border-color var(--dur-2), box-shadow var(--dur-2); }
.ge-act:hover { transform: translateY(-2px); }
.ge-act.sel { border-color: var(--press-color); box-shadow: 3px 3px 0 var(--press-color); transform: translate(-1px, -1px); }
.ge-act b { font-size: 13px; font-weight: 600; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ge-act .muted { font-size: 11px; }
.ge-prog { width: 100%; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.ge-prog span { display: block; height: 100%; background: var(--accent); }
.ge-card { max-width: 820px; overflow: hidden; }
.ge-card.view-swap { animation: rise var(--dur-3) var(--ease-out); }
.ge-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 20px 10px; }
.ge-head h2 { font-size: 22px; margin-top: 4px; }
.ge-progress { display: flex; align-items: center; gap: 12px; padding: 0 20px 16px; font-size: 13px; border-bottom: 1px solid var(--line); }
.ge-bar { flex: 1; height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.ge-bar span { display: block; height: 100%; background: var(--accent); border-radius: 10px; transition: width var(--dur-3) var(--ease-out); }
.ge-row { display: grid; grid-template-columns: 30px 34px minmax(0, 1fr) auto auto 26px; align-items: center; gap: 12px; padding: 9px 20px; border-top: 1px solid var(--line); transition: background-color var(--dur-2); }
.ge-row:first-child { border-top: none; }
.ge-row:focus-within { background: var(--accent-soft); }
.ge-n { font-size: 12px; color: var(--muted); text-align: right; }
.ge-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ge-score { display: inline-flex; align-items: center; gap: 6px; }
.ge-score input { width: 78px; min-height: 44px; font-family: var(--font-display); font-size: 20px; font-weight: 700; text-align: center; border-radius: 10px; padding: 4px; }
.ge-ok { color: var(--green); opacity: 0; transform: scale(.5); transition: opacity var(--dur-2), transform var(--dur-3) var(--ease-spring); display: flex; }
.ge-ok .ico { width: 20px; height: 20px; }
.ge-row.done .ge-ok { opacity: 1; transform: none; }
@media (max-width: 900px) { .gl { grid-template-columns: minmax(0, 1fr); } .gl-list-col { position: static; } .gl-list { max-height: 320px; } .gl-comp { grid-template-columns: 120px 1fr 50px; } }

/* Handed in? — collected / missing / late / excused (grade-tools.js) */
.ge-status { width: auto; min-width: 96px; padding: 3px 6px; font-size: 12px; }
.ge-status.ws-collected { color: var(--green); }
.ge-status.ws-missing { color: var(--red); font-weight: 700; }
.ge-status.ws-late { color: var(--orange); }
.ge-status.ws-excused { color: var(--text-muted); }

/* Phones: a learner's grades in a sheet (grade-weights.js _openGradeSheet). */
.gl-sheet { position: relative; padding: 0 4px 12px; }
.gl-sheet > .card { border: 0; box-shadow: none; }
.gl-sheet-close { position: absolute; top: 8px; right: 12px; z-index: 1; }
.gl-sheet .gl-head { padding-right: 52px; }
@media (max-width: 700px) {
  .gl-detail { display: none; }
  .gl-list-col { max-height: none; }
  .ge-score input { min-height: 48px; }
}

/* ── DepEd E-Class Record classes (src/deped/): the page's own parts — the
   grade sheet, the learner card (.gl-*), the app's banners (.sid-banner,
   .plan-draft-banner), drawer lists (.sid-list, .sid-row, .sid-code) — with
   only these few additions ── */
.gr-deped-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.gr-weights .dp-template-chip { white-space: normal; max-width: 100%; }
.grades-table .gr-desc small { display: block; color: var(--muted); font-size: 11px; }
input.gr-locked { cursor: pointer; color: var(--ink-2); }
input.gr-locked[data-locked="view"] { cursor: default; }
.dp-strand { margin: 0 0 12px; }
.dp-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.dp-work { margin: 16px 0 12px; }
.dp-work .eyebrow { display: block; margin-bottom: 2px; }
.dp-work .gl-act-name { white-space: normal; }
.dp-total .gl-act-name b { font-weight: 600; }
.dp-term-filter { margin: 0 0 8px; max-width: 100%; overflow-x: auto; }
.dp-tags .sid-row[hidden] { display: none; }
.dp-tags .form-control, .dp-awards .sid-code .form-control { width: auto; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.dp-awards .sid-code .form-control { width: 72px; text-align: center; }
