/*
 * 360Gyan UI v2 ("Subject Colours"): page and shell styles.
 * Loaded after style.css / style2.css / custom.css and after ui/tokens.css + ui/components.css.
 * Colours, sizes and fonts come from ui/tokens.css; shared pieces (buttons, chips, cards, panels,
 * notes, fields) live in ui/components.css. This file only lays out specific pages.
 * Rules here are scoped to body.ui-v2 (teacher shell and teacher pages) or body.ui-v2-auth (login), or to
 * v2 classes used on specific pages. Anything every page needs (cards, forms, tables, tabs, filter chips,
 * the page background, older classes) is in ui/bridge.css instead.
 */

/* ---------------------------------------------------------------- Shell */

body.ui-v2 .v2-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--v2-side-w);
    background: var(--v2-card);
    border-right: 1px solid var(--v2-line);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 12px 12px;
    z-index: 1030;
    overflow-y: auto;
    transition: transform .25s ease;
}

body.ui-v2 .v2-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 8px 6px;
    text-decoration: none;
}

body.ui-v2 .v2-brand img {
    width: 64px;
    height: auto;
}

body.ui-v2 .v2-nav-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

body.ui-v2 .v2-nav-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--v2-muted);
    padding: 0 10px 4px;
}

body.ui-v2 .v2-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--v2-ink-soft);
    font-size: 13.5px;
    text-decoration: none !important;
    line-height: 1.3;
}

body.ui-v2 .v2-nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    color: var(--v2-muted);
}

body.ui-v2 .v2-nav-link:hover {
    background: var(--v2-surface-hover);
    color: var(--v2-ink);
}

body.ui-v2 .v2-nav-link.active {
    background: var(--v2-primary-soft);
    color: var(--v2-primary);
    font-weight: 600;
}

body.ui-v2 .v2-nav-link.active i {
    color: var(--v2-primary);
}

body.ui-v2 .v2-nav-link:focus-visible,
body.ui-v2 .v2-icon-btn:focus-visible,
body.ui-v2 .v2-context-btn:focus-visible {
    outline: 3px solid var(--v2-primary);
    outline-offset: 2px;
}

body.ui-v2 .v2-side-foot {
    margin-top: auto;
    padding: 12px 10px 4px;
    border-top: 1px solid var(--v2-line);
    font-size: 11.5px;
    color: var(--v2-muted);
}

body.ui-v2 .v2-backdrop {
    display: none;
}

/* Top bar (re-uses the legacy .header positioning, re-skinned) */
body.ui-v2 .header.v2-topbar {
    left: var(--v2-side-w);
    width: calc(100% - var(--v2-side-w));
    height: var(--v2-top-h);
    padding: 0 24px;
    background: var(--v2-card);
    border-bottom: 1px solid var(--v2-line);
    gap: 12px;
}

body.ui-v2 .v2-topbar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

body.ui-v2 .v2-icon-btn.v2-burger {
    display: none;
}

body.ui-v2 .v2-context-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--v2-line);
    background: var(--v2-card);
    box-shadow: var(--v2-btn-shadow);
    border-radius: var(--v2-btn-radius);
    padding: 7px 12px;
    font-weight: var(--v2-weight-bold);
    font-size: 13px;
    color: var(--v2-ink);
    max-width: 340px;
}

body.ui-v2 .v2-context-btn:hover {
    background: var(--v2-surface-hover);
    border-color: var(--v2-line-strong);
}

body.ui-v2 .v2-context-btn .v2-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--subj, var(--v2-neutral));
    flex: none;
}

body.ui-v2 .v2-context-btn .v2-context-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.ui-v2 .v2-context-btn .v2-context-placeholder {
    font-weight: 500;
    color: var(--v2-muted);
}

body.ui-v2 .v2-context-menu {
    width: 340px;
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    box-shadow: var(--v2-shadow-menu);
}

body.ui-v2 .v2-context-menu h6 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--v2-muted);
    margin: 4px 0 8px;
    font-weight: 600;
}

body.ui-v2 .v2-context-menu .v2-pick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

body.ui-v2 .v2-context-menu .v2-pick {
    border: 1px solid var(--v2-line);
    background: var(--v2-card);
    border-radius: var(--v2-radius-sm);
    padding: 6px 10px;
    font-size: 12.5px;
    color: var(--v2-ink);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

body.ui-v2 .v2-context-menu .v2-pick::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background: var(--subj, transparent);
}

body.ui-v2 .v2-context-menu .v2-pick:not([style*="--subj"])::before {
    display: none;
}

body.ui-v2 .v2-context-menu .v2-pick.active {
    background: var(--v2-primary-fill);
    border-color: var(--v2-primary-fill);
    color: var(--v2-on-color);
}

body.ui-v2 .v2-context-menu .v2-pick.active::before {
    background: var(--v2-card);
}

body.ui-v2 .v2-context-hint {
    font-size: 12px;
    color: var(--v2-muted);
    margin: 0;
}

body.ui-v2 .v2-top-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.ui-v2 .v2-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    padding: 4px 6px;
    border-radius: 10px;
    text-align: left;
}

body.ui-v2 .v2-profile-btn:hover {
    background: var(--v2-surface-hover);
}

body.ui-v2 .v2-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--v2-primary-fill);
    color: var(--v2-on-color);
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 13px;
    flex: none;
}

body.ui-v2 .v2-profile-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

body.ui-v2 .v2-profile-meta b {
    font-size: 13px;
    font-weight: 600;
    color: var(--v2-ink);
}

body.ui-v2 .v2-profile-meta small {
    font-size: 11.5px;
    color: var(--v2-muted);
}

/* Main content area */
body.ui-v2 .main-content {
    margin-left: var(--v2-side-w);
    padding-top: calc(var(--v2-top-h) + 20px) !important;
    margin-top: 0 !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.ui-v2 .main-content > .page-content {
    flex: 1;
}

/* Mobile: sidebar becomes an off-canvas panel */
@media (max-width: 991.98px) {
    body.ui-v2 .v2-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--v2-shadow-drawer);
    }

    body.ui-v2.v2-nav-open .v2-sidebar {
        transform: translateX(0);
    }

    body.ui-v2.v2-nav-open .v2-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: var(--v2-overlay);
        z-index: 1025;
    }

    body.ui-v2 .header.v2-topbar {
        left: 0;
        width: 100%;
        padding: 0 12px;
    }

    body.ui-v2 .v2-icon-btn.v2-burger {
        display: inline-grid;
    }

    body.ui-v2 .main-content {
        margin-left: 0;
    }

    body.ui-v2 .v2-profile-meta,
    body.ui-v2 .v2-hide-sm {
        display: none;
    }

    body.ui-v2 .v2-context-btn {
        max-width: 52vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ui-v2 .v2-sidebar {
        transition: none;
    }
}

/* ---------------------------------------------------------------- Lesson plan accordion */

body.ui-v2 #lessonAccordionDiv > h5 {
    font-size: 15px;
    font-weight: 600;
    margin: 8px 0 12px;
}

body.ui-v2 #lessonAccordionMain .accordion-item {
    border: 1px solid var(--v2-line);
    border-radius: 12px !important;
    overflow: hidden;
    margin-bottom: 8px;
    background: var(--v2-card);
}

body.ui-v2 #lessonAccordionMain .accordion-button {
    padding: 14px 16px;
    font-weight: 500;
    color: var(--v2-ink);
    background: var(--v2-card);
    box-shadow: none !important;
}

body.ui-v2 #lessonAccordionMain .accordion-button:not(.collapsed) {
    background: var(--v2-primary-soft);
    color: var(--v2-ink);
}

body.ui-v2 #lessonAccordionMain .accordion-collapse {
    background: var(--v2-surface-sunken) !important;
}

body.ui-v2 .lesson-title {
    max-width: calc(100% - 440px);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

body.ui-v2 .v2-lesson-name {
    font-weight: 600;
}

body.ui-v2 .v2-progress {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--v2-muted);
    font-weight: 400;
}

/* ---------------------------------------------------------------- Assessment list */

body.ui-v2 #lsAssessList > .card {
    border: 0 !important;
    background: transparent !important;
}

body.ui-v2 #lsAssessList .nav-tabs {
    margin-top: 0 !important;
    padding: 0 4px;
}

body.ui-v2 #lsAssessList .nav-tabs .nav-link {
    padding: 10px 14px;
}

body.ui-v2 .v2-tab-count {
    font-weight: 500;
    color: var(--v2-muted);
    font-size: 12.5px;
}

body.ui-v2 #lsAssessList .table-responsive {
    max-height: none !important;
    overflow-y: visible !important;
}

body.ui-v2 #lsAssessList .table-bordered > :not(caption) > * > * {
    border-width: 0 0 1px 0;
}

body.ui-v2 #lsAssessList .table td {
    padding: 12px 10px;
    font-size: 13.5px;
}

body.ui-v2 .v2-assess-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--v2-ink);
}

body.ui-v2 .btn-dropdown.v2-actions-btn {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 12px !important;
    border-radius: var(--v2-radius-sm) !important;
    border: 1px solid var(--v2-line) !important;
    background: var(--v2-card) !important;
    box-shadow: var(--v2-btn-shadow) !important;
    color: var(--v2-ink) !important;
    font-size: var(--v2-btn-font-size-sm) !important;
    font-weight: var(--v2-weight-bold);
    white-space: nowrap;
    transition: var(--v2-btn-transition);
}

body.ui-v2 .btn-dropdown.v2-actions-btn i {
    color: var(--v2-muted) !important;
    font-size: 12px !important;
}

body.ui-v2 .btn-dropdown.v2-actions-btn:hover {
    background: var(--v2-surface-hover) !important;
    border-color: var(--v2-line-strong) !important;
}

body.ui-v2 #lsAssessList .nav-tabs .nav-link.active .v2-tab-count {
    color: inherit;
    opacity: .75;
}

body.ui-v2 #lsAssessList .table thead th {
    padding: 10px !important;
}

/* New assessment chooser */
body.ui-v2 .v2-chooser {
    border-radius: 16px;
    border: 0;
}

body.ui-v2 .v2-chooser .modal-header {
    border-bottom: 1px solid var(--v2-line);
    align-items: flex-start;
}

body.ui-v2 .v2-chooser .modal-title {
    font-weight: 600;
    font-size: 18px;
}

body.ui-v2 .v2-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 575.98px) {
    body.ui-v2 .v2-type-grid {
        grid-template-columns: 1fr;
    }
}

body.ui-v2 .v2-type {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--v2-line);
    border-radius: 14px;
    text-decoration: none !important;
    color: var(--v2-ink);
    background: var(--v2-card);
    transition: border-color .15s, background-color .15s;
}

body.ui-v2 .v2-type:hover,
body.ui-v2 .v2-type:focus-visible {
    border-color: var(--v2-primary);
    background: var(--v2-primary-soft);
    color: var(--v2-ink);
    outline: none;
}

body.ui-v2 .v2-type b {
    font-size: 14.5px;
    font-weight: 600;
}

body.ui-v2 .v2-type small {
    color: var(--v2-muted);
    font-size: 12.5px;
    line-height: 1.45;
}

body.ui-v2 .v2-type-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--v2-primary-soft);
    color: var(--v2-primary);
    display: grid;
    place-items: center;
    font-size: 20px;
    margin-bottom: 4px;
}

body.ui-v2 .v2-type:hover .v2-type-icon {
    background: var(--v2-primary-fill);
    color: var(--v2-on-color);
}

body.ui-v2 .lesson-actions {
    right: 3.25rem;
    gap: 6px;
    align-items: center;
}

/* Rows with no expand arrow (student Interactions / Homework lesson lists): nothing to leave room for,
   so the buttons sit at the right edge like the learning outcome rows of the lesson plan */
body.ui-v2 .accordion-header:not(:has(> .accordion-button)) > .lesson-actions {
    right: 16px;
}

/* Row actions (View, Add concept, Reject ...) are drawn as small secondary buttons (see .v2-btn-sm) */
body.ui-v2 .lesson-actions span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: var(--v2-radius-sm);
    border: 1px solid var(--v2-line);
    background: var(--v2-card);
    box-shadow: var(--v2-btn-shadow);
    font-size: 12px;
    font-weight: var(--v2-weight-bold);
    color: var(--v2-ink);
    white-space: nowrap;
    transition: var(--v2-btn-transition);
}

body.ui-v2 .lesson-actions span:hover {
    background: var(--v2-surface-hover);
    border-color: var(--v2-line-strong);
}

body.ui-v2 .lesson-actions span.v2-action-danger:hover {
    background: var(--v2-bad-soft);
    border-color: var(--v2-bad);
}

body.ui-v2 .lesson-actions i.bi {
    font-size: 1rem;
}

body.ui-v2 .lesson-actions .v2-action-danger {
    color: var(--v2-bad);
}

@media (max-width: 991.98px) {
    body.ui-v2 .lesson-title {
        max-width: 100%;
    }

    body.ui-v2 .lesson-actions {
        position: static;
        transform: none;
        padding: 0 16px 12px;
        flex-wrap: wrap;
    }
}

/* ---------------------------------------------------------------- Teacher home */

body.ui-v2 .v2-home {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

body.ui-v2 .v2-grid {
    display: grid;
    gap: 16px;
}

body.ui-v2 .v2-grid-main {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}

@media (max-width: 991.98px) {
    body.ui-v2 .v2-grid-main {
        grid-template-columns: 1fr;
    }
}

body.ui-v2 .v2-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

body.ui-v2 .v2-tile {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 4px 12px;
    align-items: start;
    align-content: start;
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    text-decoration: none !important;
    color: var(--v2-ink);
    background: var(--v2-card);
    transition: border-color .15s, background-color .15s;
}

body.ui-v2 .v2-tile:hover {
    border-color: var(--v2-line-strong);
    background: var(--v2-surface-subtle);
    color: var(--v2-ink);
}

body.ui-v2 .v2-tile-icon {
    grid-row: span 2;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--v2-primary-soft);
    color: var(--v2-primary);
    display: grid;
    place-items: center;
    font-size: 20px;
}

body.ui-v2 .v2-tile b {
    font-size: 13.5px;
    font-weight: 600;
}

body.ui-v2 .v2-tile small {
    font-size: 12px;
    color: var(--v2-muted);
    line-height: 1.4;
}

body.ui-v2 .v2-classes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

body.ui-v2 .v2-class {
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--v2-card);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--v2-ink);
    cursor: pointer;
}

body.ui-v2 .v2-class:hover {
    border-color: var(--v2-primary);
    background: var(--v2-primary-soft);
}

body.ui-v2 .v2-class b {
    font-size: 17px;
    font-weight: 600;
}

body.ui-v2 .v2-class small {
    font-size: 12px;
    color: var(--v2-muted);
}

body.ui-v2 .v2-notes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: 420px;
    overflow-y: auto;
}

body.ui-v2 .v2-note {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-top: 1px solid var(--v2-line);
}

body.ui-v2 .v2-note:first-child {
    border-top: 0;
}

body.ui-v2 .v2-note-date {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--v2-muted);
    background: var(--v2-surface-muted);
    border-radius: 999px;
    padding: 2px 8px;
    text-align: center;
    white-space: nowrap;
}

body.ui-v2 .v2-note a {
    color: var(--v2-ink);
    text-decoration: none;
    font-size: 13.5px;
    line-height: 1.45;
}

body.ui-v2 .v2-note a:hover {
    color: var(--v2-primary);
    text-decoration: underline;
}

/* ---------------------------------------------------------------- Login */

body.ui-v2-auth {
    font-family: var(--v2-font);
    background: var(--v2-bg) !important;
    color: var(--v2-ink);
}

body.ui-v2-auth .dashboard-bg {
    background: var(--v2-bg) !important;
    min-height: 100vh;
}

body.ui-v2-auth .bg-decorations {
    display: none;
}

body.ui-v2-auth .v2-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

body.ui-v2-auth .v2-auth-brand {
    background: var(--v2-primary-fill);
    color: var(--v2-on-color);
    padding: 48px clamp(24px, 5vw, 64px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
}

body.ui-v2-auth .v2-auth-brand h2 {
    font-family: var(--v2-font);
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 600;
    line-height: 1.2;
    color: var(--v2-on-color);
    margin: 0;
    max-width: 18ch;
}

body.ui-v2-auth .v2-auth-brand p {
    color: var(--v2-brand-tint);
    font-size: 15px;
    max-width: 44ch;
    margin: 0;
}

body.ui-v2-auth .v2-auth-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.ui-v2-auth .v2-auth-subjects span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--v2-auth-chip-bg);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--v2-on-color);
}

body.ui-v2-auth .v2-auth-subjects span::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: var(--subj);
}

body.ui-v2-auth .v2-auth-brand small {
    color: var(--v2-brand-tint-2);
    font-size: 12px;
}

body.ui-v2-auth .v2-auth-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

/* Neutralise the legacy fixed-width auth wrappers (kept so field/icon styles still apply) */
body.ui-v2-auth .v2-auth-form.auth-container {
    width: auto;
    margin: 0;
}

body.ui-v2-auth .v2-auth-card.form-wrapper {
    width: 100%;
    max-width: 420px;
    background: transparent !important;
}

body.ui-v2-auth .v2-auth-card .form-container,
body.ui-v2-auth .v2-auth-card .auth-form {
    width: 100%;
}

body.ui-v2-auth .form-heading {
    margin-bottom: 28px !important;
}

body.ui-v2-auth .form-heading .title {
    font-family: var(--v2-font);
    font-size: 26px;
    font-weight: 600;
    color: var(--v2-ink);
}

body.ui-v2-auth .form-heading .subtitle {
    color: var(--v2-muted);
    font-size: 14px;
}

body.ui-v2-auth .auth-form {
    width: 100%;
}

body.ui-v2-auth .input-field-group,
body.ui-v2-auth #schoolDiv,
body.ui-v2-auth #varkDiv,
body.ui-v2-auth #schoolDiv .row,
body.ui-v2-auth #varkDiv .row {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

body.ui-v2-auth .input-field-group {
    padding: 0;
}

body.ui-v2-auth .input-field-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--v2-ink);
    margin-bottom: 6px;
}

body.ui-v2-auth .input-field-group label + br {
    display: none;
}

body.ui-v2-auth .custom-input-field .ot-input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--v2-input-border) !important;
    border-radius: 11px !important;
    background: var(--v2-card) !important;
    font-size: 15px;
    color: var(--v2-ink);
    box-shadow: none !important;
}

body.ui-v2-auth .custom-input-field .ot-input:focus {
    border-color: var(--v2-primary) !important;
    box-shadow: 0 0 0 3px var(--v2-primary-soft) !important;
}

body.ui-v2-auth .auth-form .submit-btn {
    width: 100%;
    height: 50px;
    border-radius: var(--v2-radius-lg) !important;
    background: var(--v2-primary-fill) !important;
    border: 0 !important;
    box-shadow: var(--v2-btn-shadow-solid) !important;
    color: var(--v2-on-color) !important;
    font-family: var(--v2-font);
    font-weight: var(--v2-weight-bold);
    font-size: var(--v2-text-lg);
    margin-top: 12px !important;
    transition: var(--v2-btn-transition);
}

body.ui-v2-auth .auth-form .submit-btn:hover {
    background: var(--v2-primary-dark) !important;
}

body.ui-v2-auth .auth-form .submit-btn:active {
    background: var(--v2-primary-darker) !important;
    transform: translateY(1px);
}

body.ui-v2-auth .auth-form .submit-btn:focus-visible {
    outline: 3px solid var(--v2-primary);
    outline-offset: 3px;
}

body.ui-v2-auth .v2-auth-help {
    margin-top: 16px;
    font-size: 12.5px;
    color: var(--v2-muted);
}

body.ui-v2-auth .alert {
    width: 100%;
    border-radius: 11px;
    font-size: 13.5px;
    margin-top: 12px;
}

@media (max-width: 860px) {
    body.ui-v2-auth .v2-auth {
        grid-template-columns: 1fr;
    }

    body.ui-v2-auth .v2-auth-brand {
        padding: 28px 20px;
        gap: 16px;
    }

    body.ui-v2-auth .v2-auth-brand .v2-auth-subjects,
    body.ui-v2-auth .v2-auth-brand small {
        display: none;
    }
}

/* Deep insight score cards (.v2-insight-*, .v2-bullet) moved to ui/components.css */

/* ---------------------------------------------------------------- Student distribution (lesson / concept / LO insight)
 * Unscoped: these pages are also reachable by other staff roles. */

.v2-dist {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 4px;
    font-family: var(--v2-font);
}

.v2-dist-bar {
    display: flex;
    gap: 3px;
    height: 26px;
    border-radius: 8px;
    overflow: hidden;
}

.v2-dist-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    color: var(--v2-on-color);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.v2-dist-low { background: var(--v2-band-low); }
.v2-dist-mid { background: var(--v2-band-mid); }
.v2-dist-high { background: var(--v2-band-high); }

.v2-dist-mid.v2-dist-seg { color: var(--v2-warn-ink); }

.v2-dist-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

.v2-dist-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--v2-line);
    background: var(--v2-card);
    border-radius: 999px;
    padding: 4px 12px 4px 9px;
    font-size: 12.5px;
    color: var(--v2-ink);
    cursor: pointer;
    font-family: inherit;
}

.v2-dist-item:hover:not([disabled]) {
    border-color: var(--v2-primary);
    background: var(--v2-primary-soft);
}

.v2-dist-item:focus-visible {
    outline: 3px solid var(--v2-primary);
    outline-offset: 2px;
}

.v2-dist-item[disabled] {
    opacity: .55;
    cursor: default;
}

.v2-dist-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex: none;
}

.v2-dist-total {
    margin-left: auto;
    font-size: 12px;
    color: var(--v2-muted);
}

.v2-dist-empty {
    border: 1px dashed var(--v2-line-dashed);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--v2-muted);
    background: var(--v2-surface-sunken);
    font-size: 13px;
}

/* Drill-down pages: one card per lesson / concept / outcome */
.v2-drilldown .row > [id^="gauge-container-"],
.v2-drilldown .col-9 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 0 !important;
}

body.ui-v2 .v2-drilldown > .card.ot-card {
    padding: 8px 20px !important;
    background: transparent !important;
    border: 0 !important;
}

body.ui-v2 .v2-drilldown [id^="gauge-container-"] {
    background: var(--v2-card);
    border: 1px solid var(--v2-line);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 12px !important;
}

body.ui-v2 .v2-drilldown .card.ot-card.mt-1 {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
}

body.ui-v2 .v2-drilldown .gauge-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--v2-ink);
    text-decoration: none !important;
}

body.ui-v2 .v2-drilldown .gauge-title.cursor-pointer::after {
    content: "  \2192";
    color: var(--v2-primary);
}

body.ui-v2 .v2-drilldown .gauge-title.cursor-pointer:hover {
    color: var(--v2-primary);
}

body.ui-v2 .v2-drilldown .passFail a {
    display: inline-block;
    text-decoration: none !important;
    font-size: 12.5px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    margin-top: 6px;
}

body.ui-v2 .v2-drilldown .passFail a.text-danger { background: var(--v2-bad-soft); color: var(--v2-bad) !important; }
body.ui-v2 .v2-drilldown .passFail a.text-success { background: var(--v2-good-soft); color: var(--v2-good) !important; }

body.ui-v2 .v2-drilldown .small[style*="gap:300px"] {
    gap: 8px !important;
}

/* ---------------------------------------------------------------- Shell fixes */

/* Legacy CSS forces .header to display:block, which left the bar contents top-aligned */
body.ui-v2 .header.v2-topbar {
    display: flex !important;
    align-items: center;
}

body.ui-v2 .v2-topbar-inner {
    height: 100%;
}

/* Logo row lines up with the top bar */
body.ui-v2 .v2-brand {
    height: var(--v2-top-h);
    margin: -16px -12px 0;
    padding: 0 20px;
    border-bottom: 1px solid var(--v2-line);
}

body.ui-v2 .v2-brand img {
    width: auto;
    height: 40px;
}

/* Footer sits at the bottom on every page, whatever the page's own wrapper is */
body.ui-v2 .main-content > .footer {
    margin-top: auto !important;
}

/* Some views leave .page-content unclosed, so the footer ends up inside it. Only on those pages,
   let .page-content fill the height and push its footer down. */
body.ui-v2 .main-content > .page-content:has(> .footer) {
    display: flex;
    flex-direction: column;
}

body.ui-v2 .main-content > .page-content > .footer {
    margin-top: auto !important;
}

body.ui-v2 .v2-drilldown .card.ot-card > .row,
body.ui-v2 .v2-drilldown > .card.ot-card > .row {
    margin-left: 0;
    margin-right: 0;
}

body.ui-v2 .v2-drilldown .row > [id^="gauge-container-"] {
    padding-left: 18px;
    padding-right: 18px;
}

/* ---------------------------------------------------------------- Lesson plan: concept / learning outcome rows */

/* wrapper around the per-section completion buttons is not an action pill */
body.ui-v2 .lesson-actions span.v2-plain {
    border: 0;
    background: transparent;
    padding: 0;
}

body.ui-v2 .lo-item {
    position: relative;
    padding-right: 200px !important;
    min-height: 64px;
}

body.ui-v2 .lesson-actions.v2-lo-actions {
    right: 16px;
}

body.ui-v2 .lesson-actions.v2-lo-actions i.bi {
    font-size: 1rem !important;
}

@media (max-width: 991.98px) {
    body.ui-v2 .lo-item {
        padding-right: 16px !important;
        flex-wrap: wrap;
    }

    body.ui-v2 .lesson-actions.v2-lo-actions {
        position: static;
        transform: none;
        padding: 8px 0 0;
    }
}

/* ---------------------------------------------------------------- Interactions: count summary */

body.ui-v2 .miscCountSpan {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    vertical-align: middle;
}

body.ui-v2 .miscCountSpan label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 400;
}

body.ui-v2 .v2-interaction-parts {
    font-size: 12.5px;
    color: var(--v2-muted);
    font-weight: 400;
}

body.ui-v2-auth .v2-auth-eyebrow {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--v2-brand-tint-2);
}

body.ui-v2-auth .v2-auth-brand h2 {
    max-width: 24ch;
}

/* ---------------------------------------------------------------- Interactions: level counts + note */

body.ui-v2 .v2-level-counts {
    display: inline-flex;
    gap: 4px;
}

/* ---------------------------------------------------------------- Dashboard tiles: each card has its own colour on hover */

body.ui-v2 .v2-tile { --tile: var(--v2-primary); --tile-soft: var(--v2-primary-soft); }
body.ui-v2 .v2-tile:nth-child(8n+1) { --tile: var(--v2-accent-1); --tile-soft: var(--v2-accent-1-soft); }
body.ui-v2 .v2-tile:nth-child(8n+2) { --tile: var(--v2-accent-2); --tile-soft: var(--v2-accent-2-soft); }
body.ui-v2 .v2-tile:nth-child(8n+3) { --tile: var(--v2-accent-3); --tile-soft: var(--v2-accent-3-soft); }
body.ui-v2 .v2-tile:nth-child(8n+4) { --tile: var(--v2-accent-4); --tile-soft: var(--v2-accent-4-soft); }
body.ui-v2 .v2-tile:nth-child(8n+5) { --tile: var(--v2-accent-5); --tile-soft: var(--v2-accent-5-soft); }
body.ui-v2 .v2-tile:nth-child(8n+6) { --tile: var(--v2-accent-6); --tile-soft: var(--v2-accent-6-soft); }
body.ui-v2 .v2-tile:nth-child(8n+7) { --tile: var(--v2-accent-7); --tile-soft: var(--v2-accent-7-soft); }
body.ui-v2 .v2-tile:nth-child(8n+8) { --tile: var(--v2-accent-8); --tile-soft: var(--v2-accent-8-soft); }

body.ui-v2 .v2-tile .v2-tile-icon {
    background: var(--tile-soft);
    color: var(--tile);
    transition: background-color .15s, color .15s;
}

body.ui-v2 .v2-tile:hover,
body.ui-v2 .v2-tile:focus-visible {
    border-color: var(--tile);
    background: var(--tile-soft);
}

body.ui-v2 .v2-tile:hover .v2-tile-icon,
body.ui-v2 .v2-tile:focus-visible .v2-tile-icon {
    background: var(--tile);
    color: var(--v2-on-color);
}

body.ui-v2 .v2-tile:hover b {
    color: var(--tile);
}

@media (prefers-reduced-motion: reduce) {
    body.ui-v2 .v2-tile .v2-tile-icon { transition: none; }
}

/* ---------------------------------------------------------------- Lesson plan count chips */

body.ui-v2 .v2-ls-chips {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    font-weight: 400;
}

body.ui-v2 .lo-text .v2-ls-chips {
    margin-top: 10px;
}

body.ui-v2 .v2-ls-chips:empty::before {
    content: "Counting\2026";
    font-size: 11.5px;
    color: var(--v2-muted);
    padding: 2px 0;
}

/* Section markers (A, B ...) on concept rows and in the key: disabled buttons used as status squares,
   green when that section has finished the concept. Not faded like a disabled action button. */
body.ui-v2 button.btn.conceptSectionBtn {
    opacity: 1;
    cursor: default;
    box-shadow: none !important;
    border-radius: var(--v2-radius-xs) !important;
}

body.ui-v2 button.btn.conceptSectionBtn:not(.btn-success) {
    background: var(--v2-card);
    border: 1px solid var(--v2-line-strong);
    color: var(--v2-muted);
}

/* concept rows carry section buttons + checkbox + 3 actions on the right */
body.ui-v2 [id^="conceptAccordionMain"] .lesson-title {
    max-width: calc(100% - 520px);
}

@media (max-width: 991.98px) {
    body.ui-v2 [id^="conceptAccordionMain"] .lesson-title {
        max-width: 100%;
    }
}

/* Subject cards without marked assessments are not links */
.v2-insight-card.is-empty .gauge-container {
    cursor: default;
}

.v2-insight-card.is-empty:hover,
.v2-insight-card.is-empty:focus-within {
    border-color: var(--v2-line) !important;
}

/* ---------------------------------------------------------------- Account settings (Change username / password)
 * Not scoped to body.ui-v2: every backend role uses these two pages.
 * Cards, fields, notes and buttons are the shared ones (v2-card, v2-field, v2-callout, v2-form-actions, v2-btn). */

.v2-account {
    font-family: var(--v2-font);
    color: var(--v2-ink);
    max-width: 980px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.v2-account :is(h1, label, p, span, a, button, input, small, li, div) {
    font-family: inherit;
}

.v2-account-eyebrow {
    font-size: var(--v2-text-sm);
    color: var(--v2-muted);
}

.v2-account-head h1 {
    font-size: var(--v2-text-2xl);
    font-weight: var(--v2-weight-bold);
    margin: 2px 0 4px;
    color: var(--v2-ink);
}

.v2-account-head p {
    margin: 0;
    color: var(--v2-muted);
    font-size: var(--v2-text-base);
}

.v2-account-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 767.98px) {
    .v2-account-grid {
        grid-template-columns: 1fr;
    }
}

.v2-account-who {
    display: flex;
    align-items: center;
    gap: 12px;
}

.v2-account-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--v2-primary-soft);
    color: var(--v2-primary);
    font-weight: var(--v2-weight-bold);
    font-size: 17px;
}

.v2-account-name {
    font-weight: var(--v2-weight-bold);
    font-size: var(--v2-text-lg);
    line-height: 1.3;
    word-break: break-word;
}

.v2-account-role {
    font-size: var(--v2-text-sm);
    color: var(--v2-muted);
}

.v2-account-login {
    margin: 16px 0;
    padding: 10px 12px;
    border-radius: var(--v2-radius-md);
    background: var(--v2-bg);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.v2-account-login span {
    font-size: 12px;
    color: var(--v2-muted);
}

.v2-account-login b {
    font-weight: var(--v2-weight-bold);
    word-break: break-all;
}

.v2-account-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.v2-account-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--v2-ink);
    font-size: var(--v2-text-base);
    text-decoration: none;
}

.v2-account-nav a i {
    width: 16px;
    color: var(--v2-muted);
}

.v2-account-nav a:hover {
    background: var(--v2-surface-hover);
    color: var(--v2-ink);
}

.v2-account-nav a.active {
    background: var(--v2-primary-soft);
    color: var(--v2-primary);
    font-weight: var(--v2-weight-bold);
}

.v2-account-nav a.active i {
    color: var(--v2-primary);
}

.v2-account .v2-account-main {
    padding: 24px;
}

/* Read-only profile details (student profile) */
.v2-account-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0;
    margin: 0 0 8px;
}

.v2-account-details > div {
    padding: 12px 0;
    border-bottom: 1px solid var(--v2-line);
    margin-right: 16px;
}

.v2-account-details dt {
    font-size: var(--v2-text-sm);
    font-weight: var(--v2-weight-medium);
    color: var(--v2-muted);
    margin-bottom: 2px;
}

.v2-account-details dd {
    margin: 0;
    font-size: var(--v2-text-base);
    color: var(--v2-ink);
    overflow-wrap: anywhere;
}

.v2-account .v2-callout {
    margin-bottom: 20px;
}

/* Password field with a show / hide button inside it */
.v2-account-secret {
    position: relative;
}

.v2-account .v2-account-secret .form-control {
    padding-right: 46px;
}

.v2-account-eye {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: var(--v2-radius-sm);
    background: transparent;
    color: var(--v2-muted);
}

.v2-account-eye:hover,
.v2-account-eye:focus-visible {
    background: var(--v2-surface-hover);
    color: var(--v2-ink);
}

/* Live password rules */
.v2-account-rules {
    list-style: none;
    margin: -6px 0 16px;
    padding: 12px 14px;
    border-radius: var(--v2-radius-md);
    background: var(--v2-bg);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 6px 16px;
    font-size: 13px;
    color: var(--v2-muted);
}

.v2-account-rules li::before,
.v2-account-match::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    display: inline-block;
    width: 18px;
}

.v2-account-rules li::before {
    content: "\f111";
    font-weight: 400;
    font-size: 11px;
}

.v2-account-rules li.is-ok {
    color: var(--v2-good);
}

.v2-account-rules li.is-ok::before {
    content: "\f00c";
    font-weight: 900;
    font-size: 12px;
}

.v2-account-match {
    font-size: 13px;
    margin: -8px 0 16px;
}

.v2-account-match:empty {
    display: none;
}

.v2-account-match.is-ok {
    color: var(--v2-good);
}

.v2-account-match.is-ok::before {
    content: "\f00c";
}

.v2-account-match.is-bad {
    color: var(--v2-bad);
}

.v2-account-match.is-bad::before {
    content: "\f00d";
}

/* ---------------------------------------------------------------- Lesson plan "View" modals (lesson, concept, learning outcome)
 * Each summary section is its own card with its count as a chip; the tables inside use .v2-table-card. */

body.ui-v2 :is(#lsDetailsModal, #showLoDetailsModal) .modal-body > .row > [class*="col"] > b {
    display: block;
    font-size: var(--v2-text-xs);
    font-weight: var(--v2-weight-bold);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--v2-muted);
    margin: 4px 0 8px;
}

body.ui-v2 :is(#lsDetailsModal, #showLoDetailsModal) .accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.ui-v2 :is(#lsDetailsModal, #showLoDetailsModal) .accordion-item {
    border: 1px solid var(--v2-line) !important;
    border-radius: var(--v2-radius-lg) !important;
    overflow: hidden;
    background: var(--v2-card);
}

body.ui-v2 :is(#lsDetailsModal, #showLoDetailsModal) .accordion-button {
    gap: 8px;
    padding: 14px 16px;
    font-weight: var(--v2-weight-bold);
    border-radius: 0 !important;
    box-shadow: none;
}

body.ui-v2 :is(#lsDetailsModal, #showLoDetailsModal) .accordion-body {
    padding: 16px;
    border-top: 1px solid var(--v2-line);
}

/* filter row (type dropdowns, search, "New" button) above each section's table: one consistent gap below it */
body.ui-v2 :is(#lsDetailsModal, #showLoDetailsModal) .accordion-body > .row:first-child {
    row-gap: 12px;
    margin-bottom: 12px;
}

body.ui-v2 :is(#lsDetailsModal, #showLoDetailsModal) .accordion-body > .row:first-child > [class*="col"] {
    margin-bottom: 0 !important;
}

body.ui-v2 :is(#lsDetailsModal, #showLoDetailsModal) .accordion-body > .row:first-child + .table-responsive {
    margin-top: 0 !important;
}

/* note line between the filter row and the table (Assignments) */
body.ui-v2 :is(#lsDetailsModal, #showLoDetailsModal) .accordion-body > .row:first-child + [class*="col-"] {
    margin: 0 0 12px !important;
    padding: 0;
}

body.ui-v2 .v2-acc-count label {
    margin: 0;
    font-weight: inherit;
    cursor: inherit;
}

/* open section: the header is tinted, so its count chip turns white */
body.ui-v2 :is(#lsDetailsModal, #showLoDetailsModal) .accordion-button:not(.collapsed) .v2-acc-count {
    background: var(--v2-card);
}

/* ---------------------------------------------------------------- Super admin: Schools list (school/index) */

body.ui-v2 .v2-school-table .v2-school-name {
    font-weight: var(--v2-weight-medium);
    color: var(--v2-ink);
}

body.ui-v2 .v2-school-table .v2-school-code {
    font-size: var(--v2-text-sm);
    color: var(--v2-muted);
}

body.ui-v2 .v2-school-table td {
    vertical-align: middle;
}

/* ---------------------------------------------------------------- Super admin: log tables (loginLog/*) */

body.ui-v2 .v2-log-table td {
    vertical-align: top;
}

/* file paths, URLs and traces are long unbroken strings: let them wrap instead of widening the table */
body.ui-v2 .v2-log-table .v2-log-path {
    min-width: 200px;
    max-width: 340px;
    overflow-wrap: anywhere;
    font-size: var(--v2-text-sm);
}

body.ui-v2 .v2-log-table .v2-log-link {
    color: var(--v2-primary);
    cursor: pointer;
    min-width: 220px;
}

body.ui-v2 .v2-log-table .v2-log-link:hover,
body.ui-v2 .v2-log-table .v2-log-link:focus-visible {
    text-decoration: underline;
}

/* Super admin pages: space between the page heading and the first card */
body.ui-v2-admin .v2-page-head {
    margin-bottom: 16px;
}

body.ui-v2 .v2-school-table .dropdown-item {
    font-size: var(--v2-text-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ================================================================ Festive theme
 * Shared layout of the festival decoration. Active only while <html data-festival="<slug>"> is set
 * (partials/v2-theme-init.blade.php, UI.setFestival()). The colours, banner background and motif come from the
 * festival's own token sheet, css/ui/festivals/<slug>.css (--v2-fest-*); this block only places them.
 *   - a coloured stripe under the top bar
 *   - the festival motif next to the logo
 *   - the dashboard heading becomes a banner with the greeting and a row of motifs along its bottom edge
 */

:root[data-festival] body.ui-v2 .header.v2-topbar {
    border-bottom-color: transparent;
    background-image: var(--v2-fest-stripe);
    background-size: 100% 3px;
    background-position: left bottom;
    background-repeat: no-repeat;
}

:root[data-festival] body.ui-v2 .v2-brand::after {
    content: "";
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    margin-left: auto;
    background: var(--v2-fest-motif-fill);
    -webkit-mask: var(--v2-fest-motif) center / contain no-repeat;
    mask: var(--v2-fest-motif) center / contain no-repeat;
}

:root[data-festival] body.ui-v2 .v2-home > .v2-page-head {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    align-items: center;
    padding: 22px 24px 40px;
    border: 1px solid var(--v2-fest-banner-line);
    border-radius: var(--v2-radius);
    background: var(--v2-fest-banner);
    box-shadow: var(--v2-shadow-sm);
}

/* row of motifs along the bottom edge, like a garland */
:root[data-festival] body.ui-v2 .v2-home > .v2-page-head::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 8px;
    height: 20px;
    z-index: -1;
    opacity: .5;
    background: var(--v2-fest-motif-fill);
    /* each tile is wider than the motif (the SVG keeps its shape, centred), which spaces the motifs out */
    -webkit-mask: var(--v2-fest-motif) left center / 46px 18px round no-repeat;
    mask: var(--v2-fest-motif) left center / 46px 18px round no-repeat;
}

/* greeting above the "Good morning" heading; each festival sheet shows only its own */
.v2-festival-greeting {
    display: none;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: var(--v2-text-sm);
    font-weight: var(--v2-weight-bold, 600);
    color: var(--v2-fest-greeting-ink, var(--v2-primary));
}

.v2-festival-greeting::before {
    content: "";
    width: 16px;
    height: 16px;
    background: var(--v2-fest-motif-fill);
    -webkit-mask: var(--v2-fest-motif) center / contain no-repeat;
    mask: var(--v2-fest-motif) center / contain no-repeat;
}

/* festival menu in the teacher top bar (gift button #v2FestivalBtn) */
body.ui-v2 #v2FestivalBtn.is-on {
    color: var(--v2-primary);
    background: var(--v2-primary-soft);
}

body.ui-v2 .v2-festival-menu {
    min-width: 210px;
    padding: 6px;
}

body.ui-v2 .v2-festival-menu-title {
    padding: 6px 10px 8px;
    font-size: var(--v2-text-sm);
    font-weight: var(--v2-weight-bold, 600);
    color: var(--v2-muted);
}

body.ui-v2 .v2-festival-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--v2-radius-sm);
    font-size: var(--v2-text-md);
    text-transform: none;
}

body.ui-v2 .v2-festival-menu .dropdown-item i {
    visibility: hidden;
    color: var(--v2-primary);
}

body.ui-v2 .v2-festival-menu .dropdown-item.active {
    color: var(--v2-primary);
    background: var(--v2-primary-soft);
    font-weight: var(--v2-weight-bold, 600);
}

body.ui-v2 .v2-festival-menu .dropdown-item.active i {
    visibility: visible;
}

/* ---------------------------------------------------------------- Principal pages (role 5)
 * Deep insight / teacher performance: principal-panel.partials.insight-head, score cards (UI.html.scoreCard)
 * and lesson / concept rows (principal-panel.partials.insight-dist).
 */

body.ui-v2 .v2-insight-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

body.ui-v2 .v2-insight-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

body.ui-v2 .v2-insight-page .v2-panel {
    padding: 18px 20px 20px;
}

body.ui-v2 .v2-insight-row {
    background: var(--v2-card);
    border: 1px solid var(--v2-line);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color .15s;
}

body.ui-v2 .v2-insight-row + .v2-insight-row {
    margin-top: 12px;
}

body.ui-v2 .v2-insight-row:hover,
body.ui-v2 .v2-insight-row:focus-within {
    border-color: var(--v2-primary);
}

body.ui-v2 .v2-insight-row-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: var(--v2-ink);
    text-decoration: none;
}

body.ui-v2 .v2-insight-row-head .v2-score-title {
    font-weight: 600;
    font-size: 15px;
    overflow-wrap: anywhere;
}

body.ui-v2 a.v2-insight-row-head:hover .v2-score-title {
    color: var(--v2-primary);
}

body.ui-v2 a.v2-insight-row-head:focus-visible {
    outline: none;
    box-shadow: var(--v2-focus-ring);
    border-radius: 8px;
}

body.ui-v2 .v2-insight-row-head .v2-insight-open {
    margin-top: 0;
    white-space: nowrap;
}

/* Principal home: three destinations side by side on wide screens */
@media (min-width: 992px) {
    body.ui-v2 .v2-tiles.v2-tiles-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Principal: School Details */
body.ui-v2 .v2-school-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

body.ui-v2 .v2-school-fact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--v2-surface-muted);
    min-width: 0;
}

body.ui-v2 .v2-school-fact span {
    font-size: 12px;
    color: var(--v2-muted);
}

body.ui-v2 .v2-school-fact b {
    font-weight: 600;
    color: var(--v2-ink);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

body.ui-v2 .v2-school-panel .tab-pane > .form-control {
    max-width: 360px;
    margin-top: 14px !important;
}

/* Password pop-ups on /school (super admin) and /schoolDetails (principal): partials.v2-set-password-field */
.v2-set-password {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.v2-set-password .v2-account-secret .form-control {
    padding-right: 46px;
}

.v2-set-password .v2-account-rules {
    margin: 0;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.v2-set-password .v2-callout code {
    font-size: inherit;
    font-weight: 600;
    color: inherit;
    background: var(--v2-card);
    padding: 1px 6px;
    border-radius: 6px;
    white-space: nowrap;
}

.v2-set-password .v2-form-actions {
    margin-top: 4px;
}
