/* ============================================================
   PYTHON COACH V2 — Teacher Dashboard Styles
   Sprint 1: layout and spacing scaffolding only.
   All values use v2-base.css tokens — no hardcoded colours.
   ============================================================ */

body[data-v2-teacher] {
    background: var(--surface);
}

/* ── MAIN SCROLL AREA ────────────────────────────────────────
   Offset by topbar height so content starts below the fixed bar.
   ────────────────────────────────────────────────────────── */
#teacher-main {
    padding-top: calc(var(--topbar-h) + 32px);
    padding-bottom: 48px;
    min-height: 100vh;
}

/* ── CONTENT WRAPPER ─────────────────────────────────────────
   Centred column, constrained width, horizontal gutter.
   ────────────────────────────────────────────────────────── */
#teacher-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── PAGE HEADER ROW ─────────────────────────────────────────
   Heading left, primary action button right.
   Stacks to column on narrow viewports.
   ────────────────────────────────────────────────────────── */
.teacher-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.teacher-page-header h1 {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
    line-height: 1.2;
}

@media (max-width: 768px) {
    .teacher-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ── BUTTONS ─────────────────────────────────────────────────
   Duolingo 3D-press style: flat face + bottom shadow border.
   .teacher-btn-new     — header action (right side)
   .teacher-btn-create-first — empty-state CTA (centred)
   Both are inert in Sprint 1 (disabled).
   ────────────────────────────────────────────────────────── */
.teacher-btn-new,
.teacher-btn-create-first {
    display: inline-block;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-inverse);
    background: var(--primary);
    border: none;
    border-bottom: 3px solid var(--primary-dark);
    border-radius: var(--radius-sm);
    padding: 10px 22px;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s, border-bottom-width 0.1s;
    white-space: nowrap;
}

.teacher-btn-new:hover:not(:disabled),
.teacher-btn-create-first:hover:not(:disabled) {
    filter: brightness(1.08);
}

.teacher-btn-new:active:not(:disabled),
.teacher-btn-create-first:active:not(:disabled) {
    transform: translateY(1px);
    border-bottom-width: 1px;
}

.teacher-btn-new:disabled,
.teacher-btn-create-first:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* ── EMPTY STATE ─────────────────────────────────────────────
   Centred column shown when no classrooms exist.
   Hidden by teacher.js when classroom cards are rendered.
   ────────────────────────────────────────────────────────── */
.teacher-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 64px 16px;
    text-align: center;
}

.teacher-empty-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.teacher-empty-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ── CLASSROOM GRID ──────────────────────────────────────────
   Single-column list, constrained width, centred.
   Loading and error paragraphs span all columns.
   ────────────────────────────────────────────────────────── */
.classroom-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 680px;
    margin: 0 auto;
}

.classroom-grid__loading,
.classroom-grid__empty,
.classroom-grid__error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

.classroom-grid__error { color: var(--text-secondary); }

/* ── CLASSROOM CARD ──────────────────────────────────────────
   Flex column; actions row pushed to the bottom via margin-top: auto.
   ────────────────────────────────────────────────────────── */
.classroom-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-self: start;
    transition: border-color 0.15s;
}

.classroom-card:hover {
    border-color: var(--primary);
}

.classroom-card--archived { opacity: 0.6; }

.classroom-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 1rem;
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius) var(--radius) 0 0;
}

.classroom-card__header:hover {
    background: var(--surface);
}

.classroom-card__header-text {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.classroom-card__chevron {
    font-size: 1rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    display: inline-block;
    flex-shrink: 0;
}

.classroom-card.is-open .classroom-card__chevron {
    transform: rotate(90deg);
}

.classroom-card__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0 1rem 1rem;
}

.classroom-card__body[hidden] {
    display: none;
}

.classroom-card__name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

/* ── JOIN CODE ROW ───────────────────────────────────────────
   Monospace code + inline copy button on a tinted surface.
   ────────────────────────────────────────────────────────── */
.classroom-card__code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 8px 12px;
}

.classroom-card__code {
    font-family: var(--mono);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    letter-spacing: 0.03em;
}

.classroom-card__copy-btn {
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 0.9rem;
    padding: 2px 4px;
    cursor: pointer;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
    transition: background 0.15s;
    line-height: 1;
}

.classroom-card__copy-btn:hover { background: var(--border); }

/* ── CARD META ───────────────────────────────────────────────
   Student count line.
   ────────────────────────────────────────────────────────── */
.classroom-card__meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ── STATUS BADGES ───────────────────────────────────────────
   Active: accent blue. Archived: muted neutral. No green/red.
   ────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius-xs);
    padding: 3px 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

.badge--active {
    background: var(--primary);
    color: var(--text-inverse);
}

.badge--archived {
    background: var(--border);
    color: var(--text-secondary);
}

/* ── CREATE MODAL ACTIONS ────────────────────────────────────
   Two-button footer row: Cancel (ghost) left, Create (primary) right.
   v2-shell.css .pc-modal-* covers the overlay, card, header, and title.
   ────────────────────────────────────────────────────────── */
.teacher-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.teacher-btn-cancel {
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 22px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.teacher-btn-cancel:hover {
    background: var(--surface);
    border-color: var(--border-dark);
}

/* ── ARCHIVED TOGGLE ─────────────────────────────────────────
   Text-style button below the active grid. Subdued — should not
   compete with "New Classroom". Hidden when no archived classes exist.
   ────────────────────────────────────────────────────────── */
.teacher-toggle-archived {
    display: block;
    margin-top: 1rem;
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.teacher-toggle-archived:hover { color: var(--text); }

/* ── ARCHIVE INLINE CONFIRM ──────────────────────────────────
   Replaces the Archive button in .classroom-card__actions.
   Stays in the flex row — no layout shift.
   No red anywhere (deuteranopia-safe).
   ────────────────────────────────────────────────────────── */
.classroom-card__inline-confirm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.classroom-card__confirm-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.classroom-card__confirm-yes,
.classroom-card__confirm-remove-yes {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-inverse);
    background: var(--primary);
    border: none;
    border-radius: var(--radius-xs);
    padding: 5px 12px;
    cursor: pointer;
    transition: filter 0.15s;
    white-space: nowrap;
}

.classroom-card__confirm-yes:hover:not(:disabled),
.classroom-card__confirm-remove-yes:hover:not(:disabled) { filter: brightness(1.08); }
.classroom-card__confirm-yes:disabled,
.classroom-card__confirm-remove-yes:disabled { opacity: 0.45; cursor: not-allowed; }

.classroom-card__confirm-cancel,
.classroom-card__confirm-remove-cancel,
.classroom-card__confirm-reset-cancel {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.classroom-card__confirm-cancel:hover:not(:disabled),
.classroom-card__confirm-remove-cancel:hover:not(:disabled),
.classroom-card__confirm-reset-cancel:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--border-dark);
}

.classroom-card__confirm-cancel:disabled,
.classroom-card__confirm-remove-cancel:disabled,
.classroom-card__confirm-reset-cancel:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── STUDENT ROSTER ──────────────────────────────────────────
   Toggled panel inside each card showing enrolled students.
   ────────────────────────────────────────────────────────── */
.classroom-card__roster {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.classroom-card__student-row {
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.classroom-card__student-row:last-child {
    border-bottom: none;
}

.classroom-card__student-name {
    font-size: 0.875rem;
    color: var(--text);
}

.classroom-card__student-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.classroom-card__roster-empty,
.classroom-card__roster-loading,
.classroom-card__roster-error {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    margin: 0;
}

/* ── REMOVE STUDENT BUTTON ───────────────────────────────────
   Subtle text-link below email; must not compete with card actions.
   ────────────────────────────────────────────────────────── */
.classroom-card__student-btns {
    display: flex;
    gap: 12px;
    align-items: center;
    align-self: flex-start;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.classroom-card__student-remove,
.classroom-card__student-reset {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.classroom-card__student-remove:hover,
.classroom-card__student-reset:hover { color: var(--text); }

/* Transient status text shown after a reset completes or fails. */
.classroom-card__student-reset-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.classroom-card__student-reset-status--error {
    color: var(--text);
}

.classroom-card__student-remove-error {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ── STUDENT NAME INLINE EDIT ────────────────────────────────
   Pencil icon next to the student name; visible on hover only.
   Input + Save/Cancel replace the name-wrap contents in place.
   ────────────────────────────────────────────────────────── */
.classroom-card__student-name-wrap {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.classroom-card__student-edit-name {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.4;
    padding: 0 4px;
    font-size: 0.85em;
    line-height: 1;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.classroom-card__student-name-wrap:hover .classroom-card__student-edit-name {
    opacity: 1;
}

.classroom-card__student-name-input {
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-xs);
    padding: 1px 6px;
    width: 14ch;
    min-width: 0;
    box-sizing: border-box;
    outline-offset: 2px;
}

.classroom-card__student-name-input:focus {
    border-color: var(--primary);
}

.classroom-card__student-name-save,
.classroom-card__student-name-cancel {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 0 4px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.classroom-card__student-name-save:hover,
.classroom-card__student-name-cancel:hover { color: var(--text); }

.classroom-card__student-name-save:disabled,
.classroom-card__student-name-cancel:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── INLINE RENAME INPUT ─────────────────────────────────────
   Replaces the <h3> in .classroom-card__header while editing.
   Matches h3 typography so the transition feels in-place.
   ────────────────────────────────────────────────────────── */
.classroom-card__name-input {
    font-family: var(--font);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
    background: var(--surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-xs);
    padding: 2px 6px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    outline-offset: 2px;
}

.classroom-card__name-input:disabled {
    opacity: 0.6;
}

/* ── DELETE INLINE CONFIRM ───────────────────────────────────
   "Yes, delete" uses a darker fill to distinguish from "Yes"
   in the Archive confirm — same layout, slightly different tone.
   ────────────────────────────────────────────────────────── */
.classroom-card__confirm-delete-yes {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-inverse);
    background: var(--text);
    border: none;
    border-radius: var(--radius-xs);
    padding: 5px 12px;
    cursor: pointer;
    transition: filter 0.15s;
    white-space: nowrap;
}

.classroom-card__confirm-delete-yes:hover:not(:disabled) { filter: brightness(1.15); }
.classroom-card__confirm-delete-yes:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── CARD ACTION ERROR ───────────────────────────────────────
   Transient one-line error appended below the actions row.
   Auto-removed by JS after 4 seconds.
   ────────────────────────────────────────────────────────── */
.classroom-card__action-error {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ── CO-TEACHER SECTION ──────────────────────────────────────
   Visually distinct from student roster — dashed top border
   and section heading. Sits between the roster and the action
   buttons row in the card body.
   ────────────────────────────────────────────────────────── */
.classroom-card__coteacher-section {
    border-top: 1px dashed var(--border);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.classroom-card__section-heading {
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0;
}

/* ── CO-TEACHER LIST ─────────────────────────────────────────
   Same stacked row pattern as .classroom-card__student-row.
   ────────────────────────────────────────────────────────── */
.classroom-card__coteacher-list {
    display: flex;
    flex-direction: column;
}

.classroom-card__coteacher-row {
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.classroom-card__coteacher-row:last-child {
    border-bottom: none;
}

.classroom-card__coteacher-name {
    font-size: 0.875rem;
    color: var(--text);
}

.classroom-card__coteacher-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.classroom-card__coteacher-empty,
.classroom-card__coteacher-loading {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    padding: 0.25rem 0;
}

/* ── REMOVE CO-TEACHER BUTTON ────────────────────────────────
   Matches .classroom-card__student-remove exactly.
   ────────────────────────────────────────────────────────── */
.classroom-card__coteacher-remove {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 0;
    margin-top: 0.25rem;
    align-self: flex-start;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.classroom-card__coteacher-remove:hover { color: var(--text); }

.classroom-card__coteacher-remove-error {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ── ADD CO-TEACHER ROW ──────────────────────────────────────
   Email input + Add button on one line.
   ────────────────────────────────────────────────────────── */
.classroom-card__coteacher-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.classroom-card__coteacher-input {
    flex: 1;
    min-width: 0;
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 6px 10px;
    box-sizing: border-box;
    outline-offset: 2px;
}

.classroom-card__coteacher-input:focus {
    border-color: var(--primary);
}

.classroom-card__coteacher-add-btn {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.classroom-card__coteacher-add-btn:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--border-dark);
}

.classroom-card__coteacher-add-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── CO-TEACHER FEEDBACK MESSAGE ─────────────────────────────
   One-line status below the add row.
   Blue (--primary) for success — deuteranopia safe, no green.
   ────────────────────────────────────────────────────────── */
.classroom-card__coteacher-msg {
    font-size: 0.8rem;
    margin: 0;
}

.classroom-card__coteacher-msg--ok  { color: var(--primary); }
.classroom-card__coteacher-msg--err { color: var(--text-secondary); }

/* ── OWNER BADGE ─────────────────────────────────────────────
   Inline pill beside the owner's name in the co-teacher list.
   Muted — should not compete with the Active/Archived badges.
   ────────────────────────────────────────────────────────── */
.classroom-card__owner-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 1px 6px;
    vertical-align: middle;
    line-height: 1.4;
}

/* ── TAB BAR ─────────────────────────────────────────────────
   Underline-style tabs inside each classroom card body.
   ────────────────────────────────────────────────────────── */
.classroom-card__tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-top: 0.25rem;
}

.classroom-card__tab {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 14px;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.classroom-card__tab:hover {
    color: var(--text);
}

.classroom-card__tab.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ── TAB PANELS ──────────────────────────────────────────────
   Each panel is shown/hidden by JS. No layout shift on switch.
   ────────────────────────────────────────────────────────── */
.classroom-card__tab-panel {
    padding-top: 0.75rem;
}

.classroom-card__tab-panel[hidden] {
    display: none;
}

.classroom-card__tab-panel .classroom-card__coteacher-section {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

/* ── CURRICULUM LIST ─────────────────────────────────────────
   27-row lesson unlock list inside the Curriculum tab panel.
   ────────────────────────────────────────────────────────── */
.classroom-card__curriculum-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.classroom-card__curriculum-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.classroom-card__curriculum-row:last-child {
    border-bottom: none;
}

.classroom-card__curriculum-lesson-title {
    font-size: 0.875rem;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

.classroom-card__curriculum-toggle {
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.classroom-card__curriculum-toggle:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--border-dark);
}

.classroom-card__curriculum-toggle.is-unlocked {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--surface);
}

.classroom-card__curriculum-toggle:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.classroom-card__curriculum-loading,
.classroom-card__curriculum-empty {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    padding: 0.5rem 0;
    text-align: center;
}

/* ── CARD HEADER ICON BUTTONS ────────────────────────────────
   Compact icon-only action buttons in the card header.
   Appear to the left of the collapse chevron.
   ────────────────────────────────────────────────────────── */
.classroom-card__header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.classroom-card__header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 1.15rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.classroom-card__header-icon-btn:hover:not([disabled]) {
    background: var(--border);
    color: var(--text);
}

.classroom-card__header-icon-btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── TOOLTIP ─────────────────────────────────────────────────
   Text from data-tooltip attribute; appears above the button.
   ────────────────────────────────────────────────────────── */
.classroom-card__header-icon-btn[data-tooltip]:hover::before,
.classroom-card__header-icon-btn[data-tooltip]:hover::after {
    pointer-events: none;
}

.classroom-card__header-icon-btn[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--bg);
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    z-index: 300;
}

.classroom-card__header-icon-btn[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--text);
    z-index: 300;
}


/* ── BILLING MODAL ───────────────────────────────────────────
   Sprint 17e-C: PO/Invoice flow overlay and card.
   z-index: 1000 (exceeds tooltip z-index 300).
   ─────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-box {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.modal-box h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    padding-right: 32px;
}

.modal-subtitle {
    margin: 0 0 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-payment-label {
    margin: 0 0 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.modal-payment-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.payment-toggle-btn {
    border: 1px solid var(--border, #ccc);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    background: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.payment-toggle-btn[aria-pressed="true"] {
    background: #EEC252;
    color: #1a1a1a;
    border-color: #EEC252;
}

.payment-toggle-btn[aria-pressed="false"]:hover {
    background: var(--surface);
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.modal-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.modal-field input {
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 8px 12px;
    font-size: 0.9rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    width: 100%;
    box-sizing: border-box;
}

.modal-field input:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}

.optional-label {
    font-weight: 400;
    color: var(--text-secondary);
}

.modal-error {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #EEC252;
    border-radius: var(--radius-xs);
    font-size: 0.875rem;
    color: #1a1a1a;
}

.modal-error[hidden] {
    display: none;
}

.status-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #EEC252;
    color: #1a1a1a;
    border-radius: var(--radius-xs);
    padding: 2px 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    margin-bottom: 16px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-card-note {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-footer-note {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text);
    background: var(--surface);
}
