/* Marking, Cleverbees-style: status filter buttons and a card per student. */
.status-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0 16px; }
.status-tabs button { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: #44505e; font: 600 13px Inter, sans-serif; text-align: left; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.status-tabs button:hover { border-color: #c8d1dc; }
.status-tabs button[aria-pressed="true"] { border-color: transparent; box-shadow: 0 0 0 2px var(--tab, #1667d9), 0 6px 16px #17202e14; color: var(--ink); }
.status-tabs span { flex: 1; }
.status-tabs b { font: 700 20px/1 "Space Grotesk", Inter, sans-serif; color: var(--ink); }
.st { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--c); }
.st svg, .mbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.st.all { --c: #1aa3e8; color: #fff; } .st.all svg { fill: currentColor; stroke: none; }
.st.none { --c: #eef1f4; color: #596575; }
.st.present { --c: #43a047; color: #fff; }
.st.late { --c: #fb8c00; color: #fff; }
.st.absent { --c: #e53935; color: #fff; }
.status-tabs button:nth-child(1) { --tab: #1aa3e8; } .status-tabs button:nth-child(2) { --tab: #8a94a3; }
.status-tabs button:nth-child(3) { --tab: #43a047; } .status-tabs button:nth-child(4) { --tab: #fb8c00; } .status-tabs button:nth-child(5) { --tab: #e53935; }

.rest-all { min-height: 36px; padding: 0 14px; border: 1px solid #b7dcbc; border-radius: 10px; background: #eef8ef; color: #1f6b2a; font: 600 13px Inter, sans-serif; cursor: pointer; }
.rest-all:disabled { opacity: .5; cursor: default; }

.roster.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; align-items: start; }
.roster.rows { display: grid; grid-template-columns: 1fr; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mcard { position: relative; display: grid; grid-template-columns: 1fr; justify-items: center; gap: 8px; padding: 16px 12px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px #17202e0a; text-align: center; transition: border-color .15s, background-color .15s; }
.mcard.present { border-color: #bfe0c2; background: #f6fbf6; }
.mcard.late { border-color: #f6d39b; background: #fffaf2; }
.mcard.absent { border-color: #f3b6b2; background: #fff6f5; }
.mcard.dirty::after { content: ""; position: absolute; top: 10px; left: 10px; width: 8px; height: 8px; border-radius: 50%; background: #1667d9; }
.mavatar { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #eef1f5; color: #596575; font: 700 17px/1 "Space Grotesk", Inter, sans-serif; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ring, #e4e8ed); }
.mcard.present .mavatar { --ring: #43a047; } .mcard.late .mavatar { --ring: #fb8c00; } .mcard.absent .mavatar { --ring: #e53935; }
.mnames { display: grid; align-content: start; gap: 1px; min-width: 0; width: 100%; min-height: 58px; }
.mnames strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mnames small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mstate { margin-top: 3px; font-size: 11.5px; font-weight: 600; color: #8a94a3; }
.mcard.present .mstate { color: #2e7d32; } .mcard.late .mstate { color: #b26a00; } .mcard.absent .mstate { color: #c62828; }
.mmore { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #8a94a3; font-size: 18px; line-height: 1; cursor: pointer; }
.mmore:hover { background: #f0f2f5; color: var(--ink); }
.mmarks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.mbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border: 1px solid #e3e7ec; border-radius: 10px; background: #f7f8fa; cursor: pointer; transition: background-color .12s, color .12s, border-color .12s; }
.mbtn.present { color: #43a047; } .mbtn.late { color: #fb8c00; } .mbtn.absent { color: #e53935; }
.mbtn:hover { border-color: currentColor; }
.mbtn.present[aria-pressed="true"] { background: #43a047; border-color: #43a047; color: #fff; }
.mbtn.late[aria-pressed="true"] { background: #fb8c00; border-color: #fb8c00; color: #fff; }
.mbtn.absent[aria-pressed="true"] { background: #e53935; border-color: #e53935; color: #fff; }
.mmarks.wide { margin-bottom: 14px; } .mmarks.wide .mbtn { font: 600 13.5px Inter, sans-serif; min-height: 46px; }
.mlate { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; width: 100%; font-size: 11.5px; color: #8a5a00; }
.mlate > span { width: 100%; font-weight: 600; }
.mlate button { min-width: 32px; height: 28px; border: 1px solid #f3cf95; border-radius: 8px; background: #fff; color: #8a5a00; font: 600 12px Inter, sans-serif; cursor: pointer; }
.mlate button[aria-pressed="true"] { background: #fb8c00; border-color: #fb8c00; color: #fff; }
.mlate input { width: 56px; height: 28px; padding: 0 6px; border: 1px solid #f3cf95; border-radius: 8px; font: 12px Inter, sans-serif; }

/* List view: one line per student, marks on the right. */
.roster.rows .mnames { min-height: 0; }
.roster.rows .mcard { grid-template-columns: 44px minmax(0, 1fr) auto 32px; justify-items: stretch; align-items: center; gap: 12px; padding: 10px 14px; border: 0; border-bottom: 1px solid #f0f2f5; border-radius: 0; box-shadow: none; text-align: left; }
.roster.rows .mcard:last-child { border-bottom: 0; }
.roster.rows .mavatar { width: 40px; height: 40px; font-size: 14px; }
.roster.rows .mmore { position: static; grid-column: 4; grid-row: 1; }
.roster.rows .mmarks { grid-column: 3; grid-row: 1; width: auto; grid-template-columns: repeat(3, 44px); }
.roster.rows .mbtn { min-height: 38px; }
.roster.rows .mlate { grid-column: 2 / 4; justify-content: flex-start; }
.roster.rows .mlate > span { width: auto; margin-right: 4px; }
.roster.rows .mcard.dirty::after { top: 50%; left: 4px; margin-top: -4px; }

#dialog-body .detail-fields { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
#dialog-body .detail-fields label { display: grid; gap: 4px; font: 600 12.5px Inter, sans-serif; color: #44505e; }
#dialog-body .detail-fields label.excused { display: flex; align-items: center; gap: 8px; }
#dialog-body .detail-fields input[type=number], #dialog-body .detail-fields textarea { padding: 8px 10px; border: 1px solid #d5dbe3; border-radius: 9px; font: 14px Inter, sans-serif; }

@media (max-width: 760px) {
  .status-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .status-tabs button { flex-direction: column; gap: 4px; min-height: 0; padding: 8px 4px; text-align: center; font-size: 11px; }
  .status-tabs b { font-size: 15px; }
  .st { width: 32px; height: 32px; }
  .roster.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .roster.rows .mcard { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .roster.rows .mmore { display: none; }
  .roster.rows .mmarks { grid-template-columns: repeat(3, 40px); }
}

.whole-link { align-self: center; font: 600 13px Inter, sans-serif; color: var(--blue); text-decoration: none; }
.whole-link:hover { text-decoration: underline; }

/* Details dialog: late minutes with "Now", left early, note */
#dialog-body .with-now { display: flex; gap: 6px; }
#dialog-body .with-now input { flex: 1; min-width: 0; }
#dialog-body .now-btn { padding: 0 12px; border: 1px solid #c9d6ea; border-radius: 9px; background: #eef4ff; color: #1557b0; font: 600 12.5px Inter, sans-serif; cursor: pointer; }
#dialog-body .now-btn:disabled { opacity: .45; cursor: default; }
#dialog-body .hint { color: var(--muted); font-weight: 400; font-size: 11.5px; }
#dialog-body fieldset.early { display: grid; gap: 8px; margin: 0; padding: 10px 12px; border: 1px solid #e3e7ec; border-radius: 10px; }
#dialog-body fieldset.early legend { padding: 0 4px; font: 700 11.5px Inter, sans-serif; color: #596575; text-transform: uppercase; letter-spacing: .05em; }

/* The mark editor over other pages */
.mark-editor { z-index: 70; }
.mark-editor .seat-dialog { width: min(460px, 100%); }
.mark-editor .editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mark-editor .editor-actions p { margin: 0; }

.back-link { display: inline-block; margin: 0 0 8px; padding: 0; border: 0; background: none; color: var(--blue); font: 600 13px Inter, sans-serif; cursor: pointer; }
.back-link:hover { text-decoration: underline; }

.seat-all { margin-top: 8px; }

.mark-editor .dialog-head { align-items: flex-start; }
.mark-editor .editor-arrows { display: flex; gap: 6px; }
.mark-editor .editor-arrows .icon-button { font-size: 22px; }
.mark-editor .editor-arrows .icon-button:disabled { opacity: .35; }

/* The Choose / Late pop-up: four marks, then minutes late in one touch. */
.dialog-actions.four { grid-template-columns: repeat(4, 1fr); }
.late-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding: 10px; border: 1px solid #f3cf95; border-radius: 10px; background: #fffaf2; }
.late-quick > span { margin-right: 2px; color: #8a5a00; font: 600 12.5px Inter, sans-serif; }
.late-quick button { min-width: 40px; height: 34px; padding: 0 10px; border: 1px solid #f3cf95; border-radius: 8px; background: #fff; color: #8a5a00; font: 650 13px Inter, sans-serif; cursor: pointer; }
.late-quick button:hover { background: #fb8c00; border-color: #fb8c00; color: #fff; }
.late-quick button.now { background: #fb8c00; border-color: #fb8c00; color: #fff; }
.late-quick input { width: 70px; height: 34px; padding: 0 8px; border: 1px solid #f3cf95; border-radius: 8px; font: 13px Inter, sans-serif; }
.mlate.quiet { opacity: .75; }
.mlate.quiet:hover, .mlate.quiet:focus-within { opacity: 1; }
