/*
 * Q-Mgr Admin Components Styles
 * All admin page styles centralized here
 * Naming Convention: .qm-admin-[component]-[element]
 */

/* ================================
   Common Admin Page Styles
   ================================ */
.qm-admin-page {
    padding: 0;
}

.qm-admin-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Gap comes from the shared .page-header rule in app.css. */
    flex-wrap: wrap;
    gap: var(--q-row-gap, 8px);
}

.qm-admin-page .header-content h1 {
    margin: 0 0 4px;
    /* Size comes from .qm-main h1 — one home. This file loads LAST, so a size here beats every
       other rule in the app; it carried 28px and was a third competing definition. */
    color: var(--qm-text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.qm-admin-page .header-content h1 i {
    color: var(--qm-primary-text);
}

.qm-admin-page .subtitle {
    margin: 0;
    color: var(--qm-text-muted);
    font-size: var(--qm-text-base);
}

/* ================================
   System Settings Page
   ================================ */
.qm-admin-settings-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    overflow: hidden;
}

.qm-admin-settings-nav {
    background: var(--qm-bg-elevated);
    border-right: 1px solid var(--qm-border);
    padding: 16px 0;
}

.qm-admin-settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    color: var(--qm-text-muted);
    transition: var(--q-transition);
}

.qm-admin-settings-nav-item:hover {
    color: var(--qm-text-primary);
    background: var(--qm-bg-card-hover);
}

.qm-admin-settings-nav-item.active {
    color: var(--qm-primary-text);
    background: var(--qm-primary-light);
}

.qm-admin-settings-nav-item .rzi {
    font-size: var(--qm-text-xl);
}

.qm-admin-settings-content {
    padding: 24px;
}

.qm-admin-settings-section h3 {
    margin: 0 0 24px;
    font-size: var(--qm-text-lg);
    color: var(--qm-text-primary);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--qm-border);
}

.qm-admin-settings-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.qm-admin-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--qm-bg-elevated);
    border-radius: var(--qm-radius-md);
    border: 1px solid var(--qm-border);
}

.qm-admin-setting-item.toggle {
    padding: 12px 16px;
}

.qm-admin-setting-info label {
    display: block;
    font-weight: 500;
    color: var(--qm-text-primary);
    margin-bottom: 4px;
}

.qm-admin-setting-info p {
    margin: 0;
    font-size: var(--qm-text-base);
    color: var(--qm-text-muted);
}

/* Settings-page sections (e.g. Notification Settings): alert callouts, form grid,
   dividers, inline test-action rows */
.qm-admin-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--qm-radius-md);
    margin-bottom: 24px;
    font-size: var(--qm-text-base);
}

.qm-admin-alert p {
    margin: 0;
}

.qm-admin-alert i {
    font-size: var(--qm-text-lg);
    flex-shrink: 0;
}

.qm-admin-alert.info {
    background: color-mix(in srgb, var(--qm-info) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--qm-info) 30%, transparent);
    color: var(--qm-text-primary);
}

.qm-admin-alert.info i {
    color: var(--qm-primary-text);
}

.qm-admin-alert.success {
    background: color-mix(in srgb, var(--qm-success) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--qm-success) 30%, transparent);
    color: var(--qm-text-primary);
}

.qm-admin-alert.success i {
    color: var(--qm-success);
}

.qm-admin-alert.warning {
    background: color-mix(in srgb, var(--qm-warning) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--qm-warning) 30%, transparent);
    color: var(--qm-text-primary);
}

.qm-admin-alert.warning i {
    color: var(--qm-warning);
}

.qm-admin-alert.error {
    background: color-mix(in srgb, var(--qm-danger) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--qm-danger) 30%, transparent);
    color: var(--qm-text-primary);
}

.qm-admin-alert.error i {
    color: var(--qm-danger);
}

.qm-admin-settings-section .qm-admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--qm-border);
}

.qm-admin-settings-section .qm-admin-section-header h3 {
    margin: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.qm-admin-settings-section h4 {
    margin: 0 0 12px;
    font-size: var(--qm-text-md);
    color: var(--qm-text-primary);
}

.qm-admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.qm-admin-form-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.qm-admin-form-group.full-width {
    grid-column: 1 / -1;
}

.qm-admin-form-group.toggle-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--qm-bg-elevated);
    border-radius: var(--qm-radius-md);
    border: 1px solid var(--qm-border);
}

/* Not the switch's own label: display:block here outranked .q-switch.q-switch's inline-flex, and the switch in every
   toggle row collapsed to a zero-width box (found 2026-09-30 by notification-settings-ui, pressing Use SSL/TLS). */
.qm-admin-form-group.toggle-item label:not(.q-switch) {
    display: block;
    font-weight: 500;
    color: var(--qm-text-primary);
    margin-bottom: 2px;
}

.qm-admin-form-group.toggle-item .qm-admin-form-hint {
    margin-bottom: 0;
}

.qm-admin-form-hint {
    margin: 0 0 6px;
    font-size: var(--qm-text-base);
    color: var(--qm-text-muted);
}

.qm-admin-divider {
    height: 1px;
    background: var(--qm-border);
    margin: 24px 0;
}

.qm-admin-form-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .qm-admin-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================
   Customer Links Page
   ================================ */
.qm-admin-customer-links {
    max-width: 1200px;
}

.qm-admin-branch-selector {
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.qm-admin-branch-selector label {
    display: block;
    font-size: var(--qm-text-base);
    font-weight: 600;
    color: var(--qm-text-muted);
    margin-bottom: 8px;
}

.qm-admin-branch-selector .form-select {
    background: var(--qm-bg-elevated);
    border: 1px solid var(--qm-border);
    color: var(--qm-text-primary);
    padding: 12px 16px;
    border-radius: var(--qm-radius-md);
    font-size: var(--qm-text-md);
    max-width: 400px;
}

.qm-admin-branch-selector .form-select:focus {
    outline: var(--qm-focus-ring); outline-offset: var(--qm-focus-offset); box-shadow: none;
    border-color: var(--qm-primary);
}

.qm-admin-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.qm-admin-link-card {
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    padding: 24px;
    transition: var(--q-transition);
}

.qm-admin-link-card:hover {
    border-color: var(--qm-border-hover);
}

.qm-admin-link-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--qm-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: var(--qm-text-stat);
}

.qm-admin-link-card.kiosk .qm-admin-link-card-icon {
    background: rgba(var(--qm-primary-rgb), 0.2);
    color: var(--qm-primary-text);
}

.qm-admin-link-card.feedback .qm-admin-link-card-icon {
    background: rgba(var(--qm-danger-rgb), 0.15);
    color: var(--qm-danger);
}

.qm-admin-link-card.display .qm-admin-link-card-icon {
    background: rgba(var(--qm-success-rgb), 0.15);
    color: var(--qm-success);
}

.qm-admin-link-card.status .qm-admin-link-card-icon {
    background: rgba(var(--qm-warning-rgb), 0.15);
    color: var(--qm-warning);
}

.qm-admin-link-card-content h3 {
    margin: 0 0 8px;
    font-size: var(--qm-text-lg);
    font-weight: 600;
    color: var(--qm-text-primary);
}

.qm-admin-link-card-content p {
    margin: 0 0 16px;
    font-size: var(--qm-text-base);
    color: var(--qm-text-muted);
    line-height: 1.5;
}

.qm-admin-link-preview {
    background: var(--qm-bg-elevated);
    border-radius: var(--qm-radius-md);
    padding: 10px 14px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.qm-admin-link-preview code {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--qm-text-sm);
    color: var(--qm-primary-text);
    white-space: nowrap;
}

.qm-admin-link-card-actions {
    display: flex;
    gap: 10px;
}

.qm-admin-btn-preview,
.qm-admin-btn-share {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--qm-radius-md);
    font-size: var(--qm-text-base);
    font-weight: 500;
    cursor: pointer;
    transition: var(--q-transition);
}

.qm-admin-btn-preview {
    background: var(--qm-bg-elevated);
    border: 1px solid var(--qm-border);
    color: var(--qm-text-primary);
}

.qm-admin-btn-preview:hover {
    background: var(--qm-bg-card-hover);
    border-color: var(--qm-primary);
}

.qm-admin-btn-share {
    background: var(--qm-gradient-primary);
    border: none;
    color: var(--qm-text-on-primary);
}

.qm-admin-btn-share:hover {
    border-color: var(--qm-border-hover);
}

/* Quick Actions */
.qm-admin-quick-actions {
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    padding: 24px;
}

.qm-admin-quick-actions h3 {
    margin: 0 0 16px;
    font-size: var(--qm-text-md);
    font-weight: 600;
    color: var(--qm-text-primary);
}

.qm-admin-actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.qm-admin-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--qm-bg-elevated);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-md);
    color: var(--qm-text-primary);
    font-size: var(--qm-text-base);
    font-weight: 500;
    cursor: pointer;
    transition: var(--q-transition);
}

.qm-admin-action-btn i {
    font-size: var(--qm-text-lg);
    color: var(--qm-primary-text);
}

.qm-admin-action-btn:hover {
    background: rgba(var(--qm-primary-rgb), 0.1);
    border-color: var(--qm-primary);
}

/* ================================
   Branches Setup Page
   ================================ */
.qm-admin-branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.qm-admin-branch-card {
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    padding: 24px;
    transition: var(--q-transition);
}

.qm-admin-branch-card:hover {
    border-color: var(--qm-border-hover);
}

.qm-admin-branch-card.inactive {
    opacity: 0.6;
}

/* ================================
   Users Setup Page
   ================================ */
.qm-admin-users-table {
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    overflow: hidden;
}

.qm-admin-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--qm-gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--qm-text-on-primary);
    font-weight: 600;
    font-size: var(--qm-text-base);
}

.qm-admin-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--qm-radius-lg);
    font-size: var(--qm-text-sm);
    font-weight: 500;
}

.qm-admin-role-badge.admin {
    background: var(--qm-secondary-light);
    color: var(--qm-primary-text);
}

.qm-admin-role-badge.manager {
    background: var(--qm-primary-light);
    color: var(--qm-primary-text);
}

.qm-admin-role-badge.operator {
    background: rgba(var(--qm-success-rgb), 0.15);
    color: var(--qm-success);
}

/* ================================
   Service Types Setup
   ================================ */
.qm-admin-service-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.qm-admin-service-type-card {
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.qm-admin-service-type-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--qm-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--qm-text-stat);
}

/* ================================
   Counters Setup
   ================================ */
.qm-admin-counters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.qm-admin-counter-card {
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    padding: 20px;
}

.qm-admin-counter-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--qm-radius-lg);
    font-size: var(--qm-text-xs);
    font-weight: 600;
}

.qm-admin-counter-status.online {
    background: rgba(var(--qm-success-rgb), 0.15);
    color: var(--qm-accent-green);
}

.qm-admin-counter-status.offline {
    background: rgba(var(--qm-danger-rgb), 0.15);
    color: var(--qm-danger);
}

.qm-admin-counter-status.busy {
    background: rgba(var(--qm-warning-rgb), 0.15);
    color: var(--qm-warning);
}

/* ================================
   Printer Settings
   ================================ */
.qm-admin-printer-settings {
    max-width: 800px;
}

.qm-admin-printer-card {
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.qm-admin-printer-preview {
    background: var(--qm-bg-elevated);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    padding: 20px;
    font-family: monospace;
    text-align: center;
}

/* ================================
   Industry Settings
   ================================ */
.qm-admin-industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.qm-admin-industry-card {
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: var(--q-transition);
}

.qm-admin-industry-card:hover {
    border-color: var(--qm-primary);
}

.qm-admin-industry-card.selected {
    border-color: var(--qm-primary);
    background: rgba(var(--qm-primary-rgb), 0.05);
}

/* ================================
   Integrations Setup
   ================================ */
.qm-admin-integration-card {
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.qm-admin-integration-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--qm-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--qm-text-stat);
    background: var(--qm-bg-elevated);
}

.qm-admin-integration-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--qm-radius-lg);
    font-size: var(--qm-text-sm);
    font-weight: 500;
}

.qm-admin-integration-status.connected {
    background: rgba(var(--qm-success-rgb), 0.15);
    color: var(--qm-accent-green);
}

.qm-admin-integration-status.disconnected {
    background: rgba(var(--qm-danger-rgb), 0.15);
    color: var(--qm-danger);
}

/* ================================
   API Clients Setup
   ================================ */
.qm-admin-api-client-card {
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    padding: 24px;
}

.qm-admin-api-key-display {
    background: var(--qm-bg-elevated);
    border-radius: var(--qm-radius-md);
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--qm-text-base);
    color: var(--qm-primary-text);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ================================
   Feedback Management
   ================================ */
.qm-admin-feedback-card {
    background: var(--qm-bg-card);
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-lg);
    padding: 20px;
}

.qm-admin-rating-stars {
    display: flex;
    gap: 4px;
    color: var(--qm-warning);
}

.qm-admin-rating-stars i.empty {
    color: var(--qm-text-muted);
}

/* ================================
   Responsive Adjustments
   ================================ */
@media (max-width: 992px) {
    .qm-admin-settings-container {
        grid-template-columns: 1fr;
    }

    .qm-admin-settings-nav {
        display: flex;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--qm-border);
        padding: 0;
    }

    .qm-admin-settings-nav-item {
        flex-direction: column;
        padding: 12px 16px;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }

    .qm-admin-settings-nav-item.active {
        border-bottom-color: var(--qm-primary);
        border-left: none;
    }
}

@media (max-width: 768px) {
    .qm-admin-page .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .qm-admin-page .page-header .rz-button {
        width: 100%;
    }

    .qm-admin-links-grid {
        grid-template-columns: 1fr;
    }

    .qm-admin-link-card-actions {
        flex-direction: column;
    }

    .qm-admin-actions-grid {
        flex-direction: column;
    }

    .qm-admin-action-btn {
        justify-content: center;
    }

    .qm-admin-branch-selector .form-select {
        max-width: 100%;
    }

    .qm-admin-branches-grid {
        grid-template-columns: 1fr;
    }

    .qm-admin-service-types-grid {
        grid-template-columns: 1fr;
    }

    .qm-admin-counters-grid {
        grid-template-columns: 1fr;
    }

    .qm-admin-industry-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .qm-admin-page .header-content h1 {
        font-size: var(--qm-text-stat);
    }

    .qm-admin-setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .qm-admin-setting-item > *:last-child {
        width: 100%;
    }

    .qm-admin-integration-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ================================
   Wave B (2026-11-27): rules that were in component <style> blocks and stay global
   ================================ */

/* The mark book's shared rules (was MarkBookStyles.razor, a component holding only this block): the banners, the link style
   and a cell's autosave mark, used by the mark book and the sections that render without it (the AMIS sheet, report cards,
   the term panel). Every class is the mark book's own (mb-). */
.mb-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 7px 10px; border-radius: var(--qm-radius-md); font-size: var(--qm-text-base); min-width: 0; }
.mb-banner > span:not(.mb-banner__actions) { flex: 1 1 260px; min-width: 0; }
.mb-banner__actions { display: inline-flex; flex-wrap: wrap; gap: var(--q-row-gap); margin-left: auto; }
.mb-banner--info { background: var(--qm-bg-secondary); color: var(--qm-text-primary); border: 1px solid var(--qm-border); }
.mb-banner--warn { background: rgba(var(--qm-warning-rgb), 0.12); color: var(--qm-text-primary); border: 1px solid var(--qm-warning); }
.mb-banner--danger { background: rgba(var(--qm-danger-rgb), 0.08); color: var(--qm-text-primary); border: 1px solid var(--qm-danger); }
.mb-link { color: var(--qm-primary-text); font-weight: 600; }
/* PLAN@137df98d §35: a cell's autosave state (MarkBookSaveMark). */
.mb-savemark { display: inline-flex; align-items: center; flex: none; margin-left: 2px; font-size: var(--qm-text-xs); line-height: 1; }
.mb-savemark--saved { color: var(--qm-success); }
.mb-savemark--failed { color: var(--qm-danger); }
.mb-savemark__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--qm-text-muted); }
@media (prefers-reduced-motion: no-preference) {
    .mb-savemark--saving .mb-savemark__dot { animation: mb-savemark-pulse 0.9s ease-in-out infinite; }
    @keyframes mb-savemark-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
}

/* The Student List's own rules (was StudentRosterStyles.razor, a component holding only this block, rendered by StudentRoster):
   the roster page and its dialogs (lists, view, move classes, tidy names, import). Every class is the page's own
   (roster-, stu-, vocab-, rv-, move-, mc-, consent-, class-color-, batch-). */
/* ---------------- Vocabulary editor ---------------- */

.vocab-note {
    margin: 0 0 14px;
    padding: 9px 12px;
    border-radius: var(--qm-radius-sm);
    background: var(--qm-bg-elevated);
    color: var(--qm-text-secondary);
    font-size: var(--qm-text-sm);
    line-height: 1.5;
}

/* Sortable headers: the heading is the button, so the whole label is the target. */
.roster-sort { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; border-radius: var(--qm-radius-sm); min-height: 24px; }
.roster-sort:hover, .roster-sort.on { color: var(--qm-text-primary); }
.roster-sort:focus-visible { outline: var(--qm-focus-ring); outline-offset: 2px; }
.roster-sort__n { font-size: var(--qm-text-xs); background: var(--qm-primary); color: var(--qm-text-on-primary); border-radius: 999px; padding: 0 5px; line-height: 1.4; }
/* A class heading is QListGroup; only its pill is the roster own. */
.roster-group .class-pill { font-size: var(--qm-text-sm); }
.roster-opt { color: var(--qm-text-secondary); }
.rv-section { display: flex; flex-direction: column; gap: 8px; padding-bottom: var(--qm-block-gap); margin-bottom: var(--qm-block-gap); border-bottom: 1px solid var(--qm-border); }
.rv-section:last-child { border-bottom: 0; margin-bottom: 0; }
.rv-h { font-size: var(--qm-text-sm); color: var(--qm-text-muted); margin: 0; }
.rv-presets { display: flex; flex-wrap: wrap; gap: var(--q-row-gap); }
.rv-level { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: center; }
.rv-level__n { font-size: var(--qm-text-sm); color: var(--qm-text-secondary); }
.rv-level__controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.rv-level__controls .rv-field { flex: 1 1 180px; min-width: 0; }
.rv-level__row { display: flex; gap: 8px; align-items: center; flex: 0 1 auto; min-width: 0; }
.rv-level__row .rv-dir { width: 170px; min-width: 0; }
/* A phone: the label above, the field across the whole width, the direction and remove underneath. */
@media (max-width: 560px) {
    .rv-level { grid-template-columns: 1fr; gap: 4px; padding-bottom: 8px; border-bottom: 1px dashed var(--qm-border); }
    .rv-level__controls .rv-field { flex-basis: 100%; }
    .rv-level__row { flex: 1 1 100%; }
    .rv-level__row .rv-dir { flex: 1 1 auto; width: auto; }
}
.rv-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; }
@media (max-width: 480px) { .rv-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rv-note { margin: 0; font-size: var(--qm-text-sm); color: var(--qm-text-muted); }
/* Drag to reorder: the grip, the row being dragged, and where it will land. */
.vocab-drag { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 32px; flex: none; border: 0; background: none;
    color: var(--qm-text-muted); cursor: grab; touch-action: none; border-radius: var(--qm-radius-sm); }
.vocab-drag:hover { color: var(--qm-text-primary); background: var(--qm-bg-secondary); }
.vocab-drag:focus-visible { outline: var(--qm-focus-ring); outline-offset: 1px; }
.vocab-row.vocab-dragging { position: relative; z-index: 5; box-shadow: var(--qm-shadow-md); background: var(--qm-bg-card); cursor: grabbing; opacity: .95; }
.vocab-row.vocab-drop-before { box-shadow: inset 0 3px 0 var(--qm-primary); }
.vocab-row.vocab-drop-after { box-shadow: inset 0 -3px 0 var(--qm-primary); }
/* A ticked row is marked across its whole width by QListRow (--q-list-sel), so a hundred ticks can be checked by eye. */
/* The frame (QTableFrame) carries the border and corners; the grid inside fills it. */
.roster-frame { --qtf-head-bg: var(--qm-bg-secondary); border: 1px solid var(--qm-border); border-radius: var(--qm-radius-lg); background: var(--qm-bg-card); }
.roster-frame > .roster-table { border: 0; border-radius: 0; }
.roster-table[data-row-select="on"] .roster-row:not(.roster-header) { cursor: pointer; }
.vocab-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--q-row-gap); margin-bottom: 8px; }
.move-intro { margin: 0 0 var(--qm-field-gap); color: var(--qm-text-secondary); }
.move-preview { margin-top: var(--qm-block-gap); display: flex; flex-direction: column; gap: var(--qm-block-gap); }
.move-table { width: 100%; }
.move-refusals { border: 1px solid var(--qm-danger); border-radius: var(--qm-radius-md); padding: 8px 12px; background: rgba(var(--qm-danger-rgb), 0.06); }
.move-refusals ul, .move-notes { margin: 4px 0 0; padding-left: 18px; }
.move-notes { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; color: var(--qm-text-secondary); }
.move-notes li { display: flex; gap: 6px; align-items: flex-start; }
.vocab-toolbar-count { font-size: var(--qm-text-sm); color: var(--qm-text-muted); }
.vocab-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.vocab-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-sm);
    background: var(--qm-bg-card);
}

/* A retired entry is still readable — students already in it keep it — so it dims rather than
   disappears. Hiding it would make "why can nobody pick S.6 any more" unanswerable. */
.vocab-row.retired { opacity: .55; }
.vocab-row.retired .vocab-name { text-decoration: line-through; }

.vocab-color {
    width: 30px; height: 30px; padding: 0;
    border: 1px solid var(--qm-border); border-radius: var(--qm-radius-sm);
    background: none; cursor: pointer; flex-shrink: 0;
}

.vocab-name {
    flex: 1 1 auto; min-width: 0;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: var(--qm-radius-sm);
    background: transparent;
    color: var(--qm-text-primary);
    font-family: var(--qm-font-primary);
    font-size: var(--qm-text-base);
}

.vocab-name:hover { border-color: var(--qm-border); }
.vocab-name:focus { outline: none; border-color: var(--qm-primary); background: var(--qm-bg-elevated); }

.vocab-name-static { flex: 1 1 auto; font-size: var(--qm-text-base); padding: 6px 9px; }

.vocab-field {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-sm);
    background: var(--qm-bg-card);
    color: var(--qm-text-primary);
    font-family: var(--qm-font-primary);
    font-size: var(--qm-text-sm);
}
.vocab-field:focus { outline: none; border-color: var(--qm-primary); }
.vocab-level { width: 72px; }

/* A class row carries a swatch, name, level, usage, teacher chip and four buttons: on a phone it wraps
   with the name on its own line rather than squeezing the name to nothing. */
@media (max-width: 640px) {
    .vocab-row { flex-wrap: wrap; }
    .vocab-row .vocab-name { flex: 1 1 60%; }
}

.vocab-usage {
    font-size: var(--qm-text-xs);
    color: var(--qm-text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Who holds the class, on the row where the class is edited. Tinted from --qm-primary-rgb so
   it follows the theme with no [data-theme="light"] override. */
.vocab-ct {
    display: inline-flex; align-items: center; gap: 5px;
    max-width: 150px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(var(--qm-primary-rgb), 0.10);
    color: var(--qm-primary-text);
    font-size: var(--qm-text-xs);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.vocab-ct span { overflow: hidden; text-overflow: ellipsis; }
.vocab-ct:hover { background: rgba(var(--qm-primary-rgb), 0.18); }

/* An unheld class is the state this feature fails silently in, so it reads as a gap rather
   than as another chip. */
.vocab-ct-none {
    background: transparent;
    border: 1px dashed var(--qm-border);
    color: var(--qm-text-muted);
}
.vocab-ct-none:hover { background: var(--qm-bg-elevated); color: var(--qm-text-secondary); }

.vocab-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; flex-shrink: 0;
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-sm);
    background: var(--qm-bg-card);
    color: var(--qm-text-secondary);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}

.vocab-btn:hover:not(:disabled) { color: var(--qm-primary-text); border-color: var(--qm-primary); }
.vocab-btn.on { color: var(--qm-primary-text); border-color: var(--qm-primary); }
.vocab-btn.danger:hover:not(:disabled) { color: var(--qm-danger); border-color: var(--qm-danger); }
.vocab-btn:disabled { opacity: .35; cursor: not-allowed; }
.vocab-btn:focus-visible { outline: var(--qm-focus-ring); outline-offset: 1px; }

.vocab-add {
    display: flex; align-items: center; gap: 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--qm-border);
}

.vocab-add .vocab-name { border-color: var(--qm-border); }

/* ---------------- Roster chips ---------------- */

.roster-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: var(--qm-text-xs);
    font-weight: 600;
    vertical-align: middle;
    background: var(--qm-bg-elevated);
    color: var(--qm-text-secondary);
    border: 1px solid var(--qm-border);
}

.roster-chip.tier-medium { background: rgba(var(--qm-warning-rgb), .16); color: var(--qm-text-primary); border-color: rgba(var(--qm-warning-rgb), .5); }
.roster-chip-tier { font-weight: 500; opacity: .85; }
.roster-chip.tier-high   { background: rgba(var(--qm-danger-rgb), .12);  color: var(--qm-danger);       border-color: rgba(var(--qm-danger-rgb), .28); }
.roster-chip.restriction { background: rgba(var(--qm-danger-rgb), .15);  color: var(--qm-danger);       border-color: rgba(var(--qm-danger-rgb), .35); font-weight: 700; }
.roster-chip.more        { color: var(--qm-text-muted); cursor: default; }
.roster-chip.overdue     { border-style: dashed; }
.roster-chip.teaching    { background: rgba(var(--qm-primary-rgb), .08); color: var(--qm-primary-text); border-color: rgba(var(--qm-primary-rgb), .22); max-width: 100%; white-space: normal; }

.roster-concern-note { margin: 0 0 12px; font-size: var(--qm-text-sm); line-height: 1.5; color: var(--qm-text-secondary); }

/* ---------------- Tabbed student profile ---------------- */
/* The strip itself is QTabs now and carries its own look, its own scroll and its own count
   badge; only the PANEL below it is this page's. */

.stu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.stu-grid > .span-2 { grid-column: 1 / -1; }

/* The class picker with its "Add a class" beside it (2026-10-01). */
.stu-class-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stu-class-field > .q-btn { align-self: flex-start; }
.stu-class-ask { font-size: var(--qm-text-sm); color: var(--qm-text-muted); }

/* Managed in SACC (integration plan Phase 4): the fields the school office owns are read-only, and the dialog says why. */
.stu-managed-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 13px;
    margin-bottom: 16px;
    border-radius: var(--qm-radius-sm);
    background: rgba(var(--qm-info-rgb), .08);
    border: 1px solid rgba(var(--qm-info-rgb), .25);
    color: var(--qm-text-primary);
    font-size: var(--qm-text-base);
}

/* The fees balance from SACC, beside the band (welfare.fees.view only). */
.stu-fees-balance {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-self: end;
}
.stu-fees-balance-label { font-size: var(--qm-text-sm); color: var(--qm-text-muted); }
.stu-fees-balance-amount { font-size: var(--qm-text-base); font-weight: 600; color: var(--qm-text-primary); }
.stu-fees-balance-asat { font-size: var(--qm-text-sm); color: var(--qm-text-muted); }

.stu-form-error {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 13px;
    margin-bottom: 16px;
    border-radius: var(--qm-radius-sm);
    background: rgba(var(--qm-danger-rgb), .1);
    border: 1px solid rgba(var(--qm-danger-rgb), .3);
    color: var(--qm-danger);
    font-size: var(--qm-text-base);
}

/* Two small nudges, not a wobble. Enough to catch the eye of someone who pressed Save and is
   already looking at the button rather than the top of the dialog. */

.stu-note-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    margin-bottom: 16px;
    border-radius: var(--qm-radius-sm);
    background: var(--qm-bg-elevated);
    color: var(--qm-text-secondary);
    font-size: var(--qm-text-sm);
}

@media (max-width: 640px) {
    .stu-grid { grid-template-columns: 1fr; }
    .stu-grid > .span-2 { grid-column: 1; }
}

/* ---------------- Summary, filters and the bulk bar (plan STUDENT_ROSTER_AND_LIST_STANDARD §2) ----------------
   Every rule here is scoped under a roster-* class: a Razor style block is not scoped, so a bare
   shared name (.q-filter-bar, .q-bulkbar__bulk) restyled here would restyle every page. */
.roster-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-bottom: var(--qm-page-header-gap); font-size: var(--qm-text-sm); color: var(--qm-text-secondary); }
.roster-sum { display: inline-flex; gap: 4px; align-items: baseline; padding: 0; border: 0; background: none; color: inherit; font: inherit; }
/* 24px is WCAG 2.2 SC 2.5.8's minimum target: the compacted line measured 19px (mobile-readiness). */
button.roster-sum { cursor: pointer; min-height: 24px; align-items: center; }
button.roster-sum:hover strong, button.roster-sum:focus-visible strong { text-decoration: underline; }
.roster-sum strong { color: var(--qm-text-primary); font-variant-numeric: tabular-nums; }
.roster-sum--warn strong { color: var(--qm-warning); }
.roster-sum--danger strong { color: var(--qm-danger); }
.roster-filters { display: flex; flex-wrap: wrap; gap: var(--q-row-gap); flex: 0 1 auto; min-width: 0; }
.roster-filters .roster-f { flex: 0 0 136px; margin-bottom: 0; }
.roster-filters .roster-f--class { flex: 0 0 160px; }
.roster-filters .roster-f--flags { flex-basis: 112px; }
/* Sort & columns and Export never shrink: squeezed, "Sort & columns" read "& columns" under Any flags (2026-10-04). */
.roster-export { display: flex; align-items: center; gap: var(--q-row-gap); flex: none; }
.roster-export .q-btn { flex: none; }
/* One line above the list on a desk when it FITS (2026-10-04: "compaction so the user does not have to scroll"): the
   filters keep their width while there is room and wrap only when the row runs out — held on one line with no shrink,
   the row ran past the page at 1280px and pushed Export and the search off it. */
@media (min-width: 1200px) {
    .roster-filters { flex: 0 1 auto; flex-wrap: wrap; }
}
/* A row is ONE line: the markers after the name never wrap it onto a second (the name ends in "…" first). */
.roster-row .q-list-row__line { flex-wrap: nowrap; overflow: hidden; }
.roster-row .q-list-row__line > :not(.q-list-row__name) { flex: none; }
/* On a desktop the table header already carries "select this page", so the bar's own select-all row is hidden
   until something is selected. On a phone the header is hidden, so the row stays — it is the only select-all. */
@media (min-width: 641px) {
    .roster-bulk .q-bulkbar__row--bulk:not(:has(.q-bulkbar__bulk)) { display: none; }
}
/* One row for filters, export and search on a desktop: the search yields width before a filter wraps. */
.roster-bulk .q-bulkbar__search { flex: 1 1 180px; max-width: 260px; }
.roster-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 var(--qm-block-gap, 10px); }

/* The roster offers more actions than the bar's one-line desktop row holds, and a row that
   does not wrap scrolls the page sideways — the one thing the layout must never do. */
.roster-bulk .q-bulkbar__row--bulk,
.roster-bulk .q-bulkbar__bulk { flex-wrap: wrap; }
.roster-bulk .q-bulkbar__bulk .dropdown { display: inline-flex; }
.roster-pager { margin-top: 10px; }

/* "All" above 200 rows renders through Virtualize; its spacer rows are table rows (QListRow handles them on a phone). */

.roster-tidy-lede { margin: 0 0 10px; font-size: var(--qm-text-base); color: var(--qm-text-secondary); }
.roster-tidy-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.roster-tidy-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 5px 8px; border-bottom: 1px solid var(--qm-border); font-size: var(--qm-text-base); }
.roster-tidy-from { color: var(--qm-text-muted); }
.roster-tidy-more { margin: 8px 0 0; font-size: var(--qm-text-sm); color: var(--qm-text-muted); }

.batch-clear {
    margin-left: auto; background: none; border: none; padding: 2px 6px; cursor: pointer;
    font: inherit; font-size: var(--qm-text-base); color: var(--qm-text-muted); text-decoration: underline;
}

.batch-done {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: rgba(var(--qm-success-rgb), 0.1); border: 1px solid var(--qm-success);
    border-radius: var(--qm-radius-md); padding: 10px 14px; margin-bottom: 16px; font-size: var(--qm-text-base);
}
.batch-done .q-icon { color: var(--qm-success); }

/* The list is a table of QListRow rows (lesson integrity plan Phase 4): the row, its height, tint, tick, code and name
   are styled once in q-components.css. What stays here is the roster own cells. */
.roster-header button.roster-sort { font-weight: 600; }
.roster-opt { white-space: nowrap; }
/* 24px of hit area, not 21: WCAG 2.2 SC 2.5.8. The student name is the row-opening control on
   a phone, so it is a target rather than an inline link in a sentence. */
/* The missing-classes panel at the check step. A warning the reader can ACT on, so it is a
   panel with controls rather than a tinted note — the rule QInfo's header states in reverse. */
.mc-panel {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--qm-warning);
    border-radius: var(--qm-radius-lg);
    background: rgba(var(--qm-primary-rgb), .04);
}

.mc-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--qm-text-md);
}

.mc-head .bi, .mc-head i { color: var(--qm-warning); }

.mc-lede {
    margin: 6px 0 12px;
    font-size: var(--qm-text-sm);
    color: var(--qm-text-secondary);
}

.mc-table th { white-space: nowrap; }
.mc-name { font-weight: 600; }

.mc-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mc-pick { flex: 0 1 220px; min-width: 170px; }

.mc-mapped {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0 0;
    font-size: var(--qm-text-sm);
    color: var(--qm-text-secondary);
}

.mc-chip {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(var(--qm-primary-rgb), .12);
    color: var(--qm-text-primary);
}

.mc-clear {
    background: none;
    border: 0;
    padding: 2px 6px;
    font: inherit;
    font-size: var(--qm-text-sm);
    color: var(--qm-text-muted);
    text-decoration: underline;
    cursor: pointer;
}

.roster-name-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
.roster-name-link:hover { color: var(--qm-primary-text); text-decoration: underline; }
.roster-name-link:focus-visible { outline: var(--qm-focus-ring); outline-offset: 2px; border-radius: var(--qm-radius-sm); }
.consent-icon { display: inline-flex; color: var(--qm-text-muted); opacity: 0.55; cursor: help; }
.consent-icon--given { color: var(--qm-success); opacity: 1; }
.consent-status { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: var(--qm-text-base); color: var(--qm-text-muted); }
.consent-status--given { color: var(--qm-success); font-weight: 600; }
.roster-group-taught { display: inline-flex; align-items: center; gap: 4px; font-size: var(--qm-text-xs); color: var(--qm-text-muted); }
/* A table cell (td) is never flex or grid (2026-10-04): it stops being a table cell and folds into its neighbour. One line, cut with "…". */
.roster-guardians { color: var(--qm-text-secondary); white-space: nowrap; }
.roster-guardian-line { display: inline-block; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.roster-guardian-rel { color: var(--qm-text-muted); }
.roster-guardian-more { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--qm-bg-secondary); color: var(--qm-text-secondary); font-size: var(--qm-text-xs); font-weight: 600; }
.roster-empty-guardians { font-style: italic; }
.class-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; color: var(--qm-surface-white); font-size: var(--qm-text-sm); font-weight: 600; }

.roster-ct { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font-size: var(--qm-text-xs); color: var(--qm-text-muted); min-width: 0; }
.roster-ct a, .roster-ct span { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-ct a:hover { color: var(--qm-primary-text); text-decoration: underline; }
.class-color-list { display: flex; flex-direction: column; gap: 10px; }
.class-color-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--qm-border); }
.class-color-row:last-child { border-bottom: none; }
.class-color-row input[type="color"] { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--qm-border); border-radius: var(--qm-radius-sm); background: var(--qm-bg-card); cursor: pointer; }

.roster-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; color: var(--qm-text-muted); text-align: center; }

/* .form-hint and the import log are shared (q-components.css); the pre-QImportPanel upload, preview, progress and summary
   classes nothing renders any more were deleted (welfare audit U14). */

/* Rules whose element sits under a child component drawn at a component's root (a QModal, QPhoneSheet, QPrintSheet or
   QTimelineItem with the component's class on it): isolation cannot reach them, so they stay here, each named by its own
   prefix. The rest of each component's rules are in its X.razor.css. */
/* AssessmentTaskPrint */
.atp-foot { margin-top: auto; }
/* AttendancePatternItem */
.wtp-item .q-timeline__card { border-style: dashed; background: transparent; }
/* BehaviourReportsTab */
.br-card { min-width: 0; }
/* ClassListPrint */
.cl-cols { min-width: 150px; }
/* NotInGroupSection */
.sreg-notingroup { margin-top: var(--qm-block-gap); }
/* OnReportCardPrint */
.orc-sheet, .orc-sheet * { color: #000; } /* literal: a print route, paper (black on white) */
/* OnReportRegisterSection */
.orr { margin-top: var(--qm-block-gap); }
/* ReportCardPrint */
.rc-only { min-width: 220px; }
.rc-only-class { min-width: 160px; }
/* StudentAttendanceCard */
.sa-card { margin-top: var(--qm-block-gap); }
/* StudentGuardiansDialog */
.sg-name-choice { margin-bottom: var(--qm-field-gap); }
/* StudentNoteDialog */
.snd-follow { margin-top: var(--qm-field-gap); }
/* SuspensionLetterPrint */
.sl-sheet, .sl-sheet * { color: #000; } /* literal: a print route, paper (black on white) */
/* WelfareLogForm */
.wl-form .wl-field { margin-bottom: var(--qm-field-gap); }
.wl-form .wl-type { margin-bottom: var(--qm-field-gap); }
.wl-form .wl-who > span, .wl-form .wl-source > span { min-width: 0; }
.wl-form .wl-plan > span { min-width: 0; }
.wl-form .wl-details { margin-bottom: var(--qm-field-gap); }
.wl-form .wl-details .q-input-wrapper, .wl-form .wl-details .q-checkbox { margin-bottom: var(--qm-field-gap); }
.wl-form .wl-error { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--qm-radius-md); border: 1px solid var(--qm-border); }
.wl-form .wl-error { margin-top: var(--qm-field-gap); color: var(--qm-danger); border-color: var(--qm-danger); }
.wl-form .wl-escalation p { margin: 4px 0 8px; color: var(--qm-text-secondary); }
/* WelfareTimelineFilters */
.wtf-filters .q-psheet__items { display: flex; flex-wrap: wrap; align-items: center; gap: var(--q-row-gap); min-width: 0; }
.wtf-filters .wtf-f { flex: 0 0 150px; margin-bottom: 0; }
.wtf-filters .wtf-f--wide { flex-basis: 190px; }
@media (max-width: 767.98px) {
    .wtf-filters .q-psheet__items { flex-direction: column; align-items: stretch; }
    .wtf-filters .wtf-f, .wtf-filters .wtf-f--wide { flex: 1 1 auto; }
}

/* The same convention for the Staff, Exams, Plans, Allocation and Welfare components (2026-11-27). Each block names its
   component; the reason is the one above unless the heading gives another. Print sheets keep paper colours: QPrintSheet draws
   the sheet (.x-sheet) at the root of the print route. */
/* AllocationBatchDialog */
.abd .q-modal__body { min-height: 0; }
/* AllocationLoadPanel: .alp is the class of the QCard at its root */
.alp { border: 1px solid var(--qm-border); border-radius: var(--qm-radius-md); background: var(--qm-bg-card); padding: 8px 10px; }
.alp--compact { border: 0; padding: 0; background: none; }
/* AllocationPreviewList */
.apl-more { margin-top: 6px; }
/* ProgrammeImport */
.pi-section { margin-top: var(--qm-block-gap); }
/* ExpectedVisitors */
.expected-visitors-consent-check { margin-top: 14px; }
/* PlatformSpotifySettings */
.spotify-connection-card { max-width: 640px; }
/* DepartmentsPanel: QTable draws the table and its rows */
@media (max-width: 640px) {
    .dp-table thead { display: none; }
    .dp-table .dp-wide { display: none; }
    .dp-table tr.dp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--qm-border); }
    .dp-table tr.dp-row td { padding: 0; border: 0; }
    .dp-table tr.dp-detail { display: block; }
    .dp-table tr.dp-detail > td { display: block; padding: 8px 10px 12px; }
}
/* ExamPapersGrid: the suggestion list is positioned over the page (position: fixed) outside the grid's own markup */
.epg-suggest { position: fixed; z-index: 1065; overflow-y: auto; background: var(--qm-bg-card); border: 1px solid var(--qm-border);
               border-radius: var(--qm-radius-md); box-shadow: var(--qm-shadow-md); font-size: var(--qm-text-sm); }
.epg-suggest[hidden] { display: none; }
.epg-suggest__opt { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; cursor: pointer; color: var(--qm-text-primary); }
.epg-suggest__opt:hover,
.epg-suggest__opt--hi { background: var(--qm-primary-light); }
.epg-suggest__opt--other { font-style: italic; }
.epg-suggest__sub { color: var(--qm-text-muted); font-size: var(--qm-text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ExamSeatingPrint */
.esp-sheet, .esp-sheet * { color: #14110f; } /* literal: a print route, paper (black on white) */
/* ExamSeriesChecksPanel: ExamCheckNotes and the panel's QCard draw the list */
.exc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.exc-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--qm-border); border-radius: var(--qm-radius-md); background: var(--qm-bg-card); }
.exc-item--hard { border-color: rgba(var(--qm-danger-rgb), 0.45); }
.exc-item--warn { border-color: rgba(var(--qm-warning-rgb), 0.55); }
.exc-item__label { font-weight: 700; }
/* ExamSeriesDialog: .esd-dialog is also the class of ExamSittingSheetDialog's QModal; both are mounted on ExamSeries, so its
   folds have always had this rule */
.esd-dialog .q-fold { margin-top: var(--qm-field-gap); }
/* ExamSeriesPrint (its named @page exp-a3 stays in the page's own <style>) */
.exp-sheet, .exp-sheet h1 { color: #111; } /* literal: a print route, paper (black on white) */
.q-print__sheet.exp-sheet--a3 { width: 420mm; max-width: 100%; }
/* ExamSeriesShareDialog: QShareCard draws the preview at its root */
.exsd-preview--status { max-width: 300px; }
.exsd-preview--square { max-width: 320px; }
@media (max-width: 720px) {
    .exsd-preview--status { max-width: 260px; }
}
/* ExamSeriesTimetable: examTimeGrid.js writes .ett-ghost on a copy it appends to the document while a sitting is dragged */
.ett-form-0 { --ett-c: var(--ett-form-0); --ett-c-rgb: var(--ett-form-0-rgb); }
.ett-form-1 { --ett-c: var(--ett-form-1); --ett-c-rgb: var(--ett-form-1-rgb); }
.ett-form-2 { --ett-c: var(--ett-form-2); --ett-c-rgb: var(--ett-form-2-rgb); }
.ett-form-3 { --ett-c: var(--ett-form-3); --ett-c-rgb: var(--ett-form-3-rgb); }
.ett-form-4 { --ett-c: var(--ett-form-4); --ett-c-rgb: var(--ett-form-4-rgb); }
.ett-ghost { position: fixed; z-index: 1080; pointer-events: none; opacity: .9; box-shadow: var(--qm-shadow-md); }
/* ExamSupervisions */
.sup-day { margin-bottom: var(--qm-block-gap); }
/* LessonLog */
.ll-lesson--suspended { opacity: .6; }
.ll-form .ll-lesson { display: flex; flex-direction: column; gap: 3px; padding: 5px 6px; border-radius: var(--qm-radius-sm); outline: none; position: relative; }
.ll-form .ll-lesson + .ll-lesson { border-top: 1px dashed var(--qm-border); }
.ll-form .ll-lesson:focus-visible,
.ll-form .ll-lesson:focus { outline: var(--qm-focus-ring); outline-offset: -2px; }
.ll-list .ll-lesson { outline: none; }
.ll-list .ll-lesson:focus-visible,
.ll-list .ll-lesson:focus { outline: var(--qm-focus-ring); outline-offset: -2px; }
/* LessonOverviewPrint */
.lop-scale { min-width: 140px; }
.lop-sheet, .lop-sheet * { color: #111; } /* literal: a print route, paper (black on white) */
.lop-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
/* The cells of the QLessonCounts table on this sheet too: isolation cannot reach them (QPrintSheet wraps the page), and the sheet's
   class outweighs .q-lc-table--print td in q-components.css, as the page's own <style> did by coming later. */
.lop-sheet .lop-table th, .lop-sheet .lop-table td { border: 1px solid #555; padding: 2px 5px; text-align: left; vertical-align: top; } /* literal: a print route, paper (black on white) */
.lop-sheet .lop-table thead th { font-weight: 700; }
/* LessonReports */
.lr-period { min-width: 160px; max-width: 220px; }
.lr-scale { min-width: 140px; max-width: 180px; }
.lr-sel { min-width: 170px; max-width: 260px; }
.lr-range { min-width: 0; }
.lr-card { margin-top: 14px; }
@media (max-width: 640px) { .lr-period, .lr-sel, .lr-scale { max-width: none; flex: 1 1 100%; } }
/* LessonReportsPrint */
.lrp-sheet, .lrp-sheet * { color: #111; } /* literal: a print route, paper (black on white) */
.lrp-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
/* The cells of the QLessonCounts table on this sheet too: isolation cannot reach them (QPrintSheet wraps the page), and the sheet's
   class outweighs .q-lc-table--print td in q-components.css, as the page's own <style> did by coming later. */
.lrp-sheet .lrp-table th, .lrp-sheet .lrp-table td { border: 1px solid #555; padding: 2px 5px; text-align: left; vertical-align: top; } /* literal: a print route, paper (black on white) */
.lrp-sheet .lrp-table thead th { font-weight: 700; }
.lrp-table--narrow { max-width: 560px; }
.lrp-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .lrp-columns { grid-template-columns: minmax(0, 1fr); } }
/* MyDutyShareDialog: QShareCard draws the preview at its root */
.mds-preview--status { max-width: 300px; }
.mds-preview--square { max-width: 320px; }
@media (max-width: 720px) {
    .mds-preview--status { max-width: 260px; }
}
/* MyInvigilationPrint */
.mip-sheet, .mip-sheet h1, .mip-sheet h2 { color: #111; } /* literal: a print route, paper (black on white) */
/* MyTeachingRecord: MyTeachingTab, which hosts it, writes .mtr-period on its own period picker too */
.mtr-period { min-width: 160px; max-width: 220px; }
.mtr-range { min-width: 0; }
@media (max-width: 640px) { .mtr-period { max-width: none; flex: 1 1 100%; } }
/* MyTeachingRecordPrint */
.mtrp-sheet, .mtrp-sheet * { color: #111; } /* literal: a print route, paper (black on white) */
.mtrp-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
/* The cells of the QLessonCounts table on this sheet too: isolation cannot reach them (QPrintSheet wraps the page), and the sheet's
   class outweighs .q-lc-table--print td in q-components.css, as the page's own <style> did by coming later. */
.mtrp-sheet .mtrp-table th, .mtrp-sheet .mtrp-table td { border: 1px solid #555; padding: 2px 5px; text-align: left; vertical-align: top; } /* literal: a print route, paper (black on white) */
.mtrp-sheet .mtrp-table thead th { font-weight: 700; }
/* NoticeShareDialog: QShareCard draws the preview at its root */
.nsd-preview--status { max-width: 300px; }
.nsd-preview--square { max-width: 320px; }
@media (max-width: 720px) {
    .nsd-preview--status { max-width: 260px; }
}
/* OptionBlockChooser */
.obc-form, .obc-block, .obc-class { min-width: 180px; }
/* PlanPrint */
.pp-sheet { font-size: 10pt; }
/* PlanSheetHead: the printed sheet family (.ps-*) that every print route rendering PlanSheetHead writes in its own sheet too */
.ps-box, .ps-box h3, .ps-fields, .ps-fields dd, .ps-table, .ps-table th, .ps-sign, .ps-sign strong, .ps-choices, .ps-text { color: #111; } /* literal: a print route, paper (black on white) */
.ps-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid #555; margin-bottom: 10px; } /* literal: a print route, paper (black on white) */
.ps-fields dt { font-size: 7.5pt; text-transform: uppercase; letter-spacing: 0.06em; color: #444; } /* literal: paper */ /* look: a printed form's field captions */
.ps-fields dd { margin: 1px 0 0; font-size: 10pt; min-height: 13pt; }
/* The three rules below reach markup the print routes draw themselves (a field cell, a choice, a signature line), never
   PlanSheetHead's own, so they live in the family sheet, not in PlanSheetHead.razor.css (isolation cannot reach them there). */
.ps-fields > div { border-right: 1px solid #999; border-bottom: 1px solid #999; padding: 4px 6px; min-height: 30px; } /* literal: a print route, paper (black on white) */
.ps-box { border: 1px solid #555; margin-bottom: 8px; break-inside: avoid; } /* literal: a print route, paper (black on white) */
.ps-box h3 { margin: 0; padding: 3px 6px; font-size: 9.5pt; font-weight: 700; border-bottom: 1px solid #999; } /* literal: a print route, paper (black on white) */
.ps-box .ps-hint { font-weight: 400; font-size: 8pt; color: #444; margin-left: 6px; } /* literal: a print route, paper (black on white) */
.ps-lines { background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(22px - 1px), #bbb calc(22px - 1px), #bbb 22px); -webkit-print-color-adjust: exact; print-color-adjust: exact; } /* literal: ruled writing lines on paper */
.ps-text { padding: 4px 6px; white-space: pre-wrap; font-size: 10pt; min-height: 22px; }
.ps-choices { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 5px 6px; font-size: 9.5pt; }
.ps-choices span::before { content: "☐ "; }
.ps-choices span.ps-on::before { content: "☒ "; }
.ps-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.ps-table th, .ps-table td { border: 1px solid #555; padding: 3px 5px; vertical-align: top; text-align: left; } /* literal: a print route, paper (black on white) */
.ps-table th { font-size: 8.5pt; }
.ps-table tr { break-inside: avoid; }
.ps-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 14px; font-size: 9pt; break-inside: avoid; }
.ps-sign div { border-top: 1px solid #333; padding-top: 3px; } /* literal: a print route, paper (black on white) */
.ps-sign strong { display: block; }
.ps-foot { margin-top: 10px; font-size: 7.5pt; color: #555; display: flex; justify-content: space-between; gap: 10px; } /* literal: a print route, paper (black on white) */
/* PlanSheetStamp */
.pss-ink--center { left: 50%; transform: translateX(-50%); }
.pss-ink--left { left: 0; }
.pss-ink--right { right: 0; }
/* RecordOfWorkBlankPrint and RecordOfWorkPrint: .rw-sheet is also RecordOfWorkSheet's QModal class, so the print rule names
   the print sheet (in :where(), keeping the specificity it had) */
:where(.q-print__sheet).rw-sheet { font-size: 9.5pt; color: #111; } /* literal: a print route, paper (black on white) */
/* RecordOfWorkPrompt */
.rw-prompt--ended { border-color: rgba(var(--qm-primary-rgb), 0.45); background: rgba(var(--qm-primary-rgb), 0.06); }
/* RecordOfWorkSheet: QModal draws .rw-sheet at its root, and the backdrop around it */
.rw-sheet .rw-sheet__entry { border: 0; padding: 0; background: transparent; }
@media (max-width: 639.98px) {
    .q-modal-backdrop:has(.rw-sheet) { align-items: flex-end; padding: 0; }
    .rw-sheet.q-modal { width: 100%; max-width: 100%; margin: 0; border-radius: var(--qm-radius-lg) var(--qm-radius-lg) 0 0;
                        max-height: calc(100dvh - 48px); padding-bottom: env(safe-area-inset-bottom); }
}
/* RecoverySchedulePrint */
.lrs-sheet, .lrs-sheet * { color: #14110f; } /* literal: a print route, paper (black on white) */
/* RotaPrint */
.rtp-sheet, .rtp-sheet * { color: #14110f; } /* literal: a print route, paper (black on white) */
@media screen and (max-width: 640px) {
    .rtp-sheet { overflow-x: auto; }
}
/* SchoolOfficeStaff */
.so-tiles { margin-bottom: var(--qm-block-gap); }
.so-link-person { margin-top: var(--qm-field-gap); }
/* SelfServiceSection */
.ss-slot--free { border-color: var(--qm-success); }
.ss-slot--mine { background: var(--qm-primary-light); border-color: var(--qm-primary); }
.ss-slot--taken, .ss-slot--classbusy { background: var(--qm-bg-secondary); }
.ss-slot--unavailable { background: var(--qm-bg-secondary); border-style: dashed; }
/* StaffAppraisalDetail */
.ad-step--current { border-color: var(--qm-primary); }
/* StaffDutyReportSettings: StaffMinutesSettings writes the same .drs-* names, and StaffTemplates mounts the two together */
.drs-template { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--qm-border); }
.drs-template__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.drs-template__head h4 { margin: 0; font-size: var(--qm-text-base); font-family: var(--qm-font-display); }
.drs-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.drs-section { border: 1px solid var(--qm-border); border-radius: var(--qm-radius-md); padding: 10px 12px; margin-top: 10px; min-width: 0; }
.drs-row-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.drs-readonly { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: var(--qm-text-base); }
/* StaffRecords */
.sr-pos { color: var(--qm-success); font-weight: 600; margin-left: 4px; }
.sr-neg { color: var(--qm-danger); font-weight: 600; margin-left: 4px; }
/* StaffReminderLadders */
.pol-card .rl-table .q-input-wrapper,
.pol-card .rl-table .q-select-wrapper { margin-bottom: 0; }
/* StaffRoutineWeekItem: QTimelineItem draws .st-week-item at its root */
.st-week-item .q-timeline__card { padding: 6px 12px; background: transparent; border-style: dashed; box-shadow: none; }
.st-week-item .q-timeline__marker { transform: scale(.72); opacity: .7; }
/* StaffSchoolOfficeCard */
.sso-now { margin-bottom: var(--qm-field-gap); }
/* StaffStructure */
.ss-toolbar, .ss-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ss-toolbar { justify-content: space-between; margin: 12px 0; }
.ss-import-actions { margin-top: 12px; justify-content: space-between; }
/* StaffSubjects */
.sj-retired { opacity: .65; }
/* StaffTimelineFilters: QPhoneSheet draws .stf-filters at its root */
.stf-filters .q-psheet__items { display: flex; flex-wrap: wrap; align-items: center; gap: var(--q-row-gap); min-width: 0; }
.stf-filters .stf-search { flex: 1 1 260px; max-width: 380px; margin-bottom: 0; }
.stf-filters .stf-sort { flex: 0 0 150px; margin-bottom: 0; }
.stf-filters .stf-chips > .q-fchips + .q-fchips { padding-left: 12px; border-left: 1px solid var(--qm-border); }
@media (max-width: 767.98px) {
    .stf-filters .q-psheet__items { flex-direction: column; align-items: stretch; }
    .stf-filters .stf-search, .stf-filters .stf-sort { flex: 1 1 auto; max-width: none; }
    .stf-filters .stf-chips > .q-fchips + .q-fchips { padding-left: 0; border-left: 0; }
}
/* TeachingReports */
.tr-card { margin-top: 14px; }
/* Timetable: RecordAssignmentsDialog and EndAssignmentDialog (also on StaffStructure) write .tt-muted and .tt-error too */
.tt-muted { font-size: var(--qm-text-sm); color: var(--qm-text-muted); margin: 6px 0 0; }
.tt-error { color: var(--qm-danger); font-size: var(--qm-text-base); margin: 8px 0 0; }
/* TimetablePrint (its named @page ttp-a3 stays in the page's own <style>) */
.ttp-pick { min-width: 220px; max-width: 340px; }
.ttp-duties-toggle { margin-bottom: 0; }
.q-print__sheet.ttp-sheet--a3 { width: 420mm; }
.ttp-m-breakcol { width: 3.2mm; }
/* WelfarePrintDialog */
.wpd .wpd-layout { margin-bottom: var(--qm-field-gap); }
/* WelfareTimelineReport */
.wr-sheet h2 { font-family: var(--qm-font-display); font-size: 12pt; margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 1px solid #c9c0bb; } /* literal: a printed document, paper */
.wr-sheet .wr-tiles { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; margin-bottom: 0; }
.wr-sheet .wr-tiles .q-stat { background: transparent; border: 1px solid #c9c0bb; border-radius: 3px; padding: 7px 9px; } /* literal: a printed document, paper */
.wr-sheet .wr-tiles .q-stat__value { font-family: inherit; font-size: 15pt; color: inherit; }
.wr-sheet .wr-tiles .q-stat__label { font-size: 7.5pt; letter-spacing: .05em; color: #5b524d; } /* literal: a printed document, paper */
@media print { .wr-sheet h2 { break-after: avoid; page-break-after: avoid; } }
/* Campaigns */
.campaigns-stats { margin-bottom: 20px; }
