/* ── Marks Entry Grid ─────────────────────────── */
.marks-grid {
    width: 100%;
    border-collapse: collapse;
}
.marks-grid th,
.marks-grid td {
    border: 1px solid var(--cui-border-color, #d8dbe0);
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
    text-align: center;
    vertical-align: middle;
}
.marks-grid thead th {
    background: var(--cui-tertiary-bg, #ebedef);
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.marks-grid thead th .th-max {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--cui-secondary-color);
}
.marks-grid tbody th {
    background: var(--cui-tertiary-bg);
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
}
.marks-grid tbody td.marks-cell {
    padding: 0;
    position: relative;
}
.marks-grid .marks-input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    padding: 0.3rem 0.2rem;
    font-size: 0.8rem;
    outline: none;
}
.marks-grid .marks-input:focus {
    background: var(--cui-primary-bg-subtle, #cfe2ff);
    font-weight: 600;
}
.marks-grid .marks-input.is-invalid {
    background: var(--cui-danger-bg-subtle, #f8d7da);
    color: var(--cui-danger, #e55353);
}
.marks-grid .absent-check {
    cursor: pointer;
}
.marks-grid tbody tr:hover {
    background: var(--cui-tertiary-bg-subtle, #f0f2f5);
}

/* ── Frozen first columns ─────────────────────── */
.marks-grid tbody th.frozen,
.marks-grid thead th.frozen {
    position: sticky;
    left: 0;
    z-index: 3;
}
.marks-grid thead th.frozen {
    z-index: 4;
}

/* ── Grade cell colours ───────────────────────── */
.grade-O      { color: #198754; font-weight: 700; }
.grade-A_PLUS { color: #198754; font-weight: 600; }
.grade-A      { color: #0d6efd; font-weight: 600; }
.grade-B_PLUS { color: #0d6efd; }
.grade-B      { color: #6c757d; }
.grade-C      { color: #6c757d; }
.grade-U      { color: #dc3545; font-weight: 600; }
.grade-W      { color: #dc3545; }
.grade-SA     { color: #dc3545; font-weight: 700; }

/* ── CGPA progress visual ─────────────────────── */
.cgpa-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}
.cgpa-ring svg {
    transform: rotate(-90deg);
}
.cgpa-ring .cgpa-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
}
