/*
 * 360Gyan UI v2: shared building blocks.
 *
 * Buttons, chips, cards, panels, page headings, notes, form fields, progress bars and empty states.
 * Not scoped to a role: any page that uses these classes gets the new look, whoever is signed in.
 * All values come from ui/tokens.css. Page-specific layout stays in theme.css.
 */

/* ================================================================ Buttons
 *
 *   <button class="v2-btn v2-btn-primary">Save</button>
 *
 *   Colour:  v2-btn-primary | v2-btn-secondary (default) | v2-btn-soft | v2-btn-ghost
 *            v2-btn-success | v2-btn-danger | v2-btn-danger-outline | v2-btn-warning | v2-btn-info
 *   Size:    v2-btn-sm | (default) | v2-btn-lg     Shape: v2-btn-icon (square, icon only), v2-btn-block (full width)
 *   States:  :hover, :active, :focus-visible, .active (toggled on), :disabled / .disabled / [aria-disabled="true"]
 *
 * Each colour only sets the --btn-* variables below; the one .v2-btn rule draws them.
 *
 * Older views use Bootstrap / "ot" classes instead (ot-btn-primary alone is on ~1,500 buttons).
 * On every page (body.v2-site, set by all layouts) those get the same colours from the same rules, listed next to
 * each v2 class below, and are drawn by the "Older button classes" rule further down.
 *   primary:  ot-btn-primary, btn-primary, btn-ot-primary, btn-gradient-primary
 *   default:  ot-btn-secondary, btn-secondary, btn-outline-primary, btn-outline-secondary, btn-outline-dark,
 *             ot-btn-cancel, btn-gradient-secondary
 *   success:  ot-btn-success, btn-success          danger:  ot-btn-danger, btn-danger
 *   danger-outline: ot-btn-outline-danger, btn-outline-danger
 *   warning:  ot-btn-warning, ot-btnwarning, btn-warning    info: ot-btn-info, btn-info
 * btn-light is left alone: the text editor toolbars and dropdown pickers draw their own buttons with it.
 */

.v2-btn,
body.v2-site :is(.ot-btn-primary, .btn-primary, .btn-ot-primary, .btn-gradient-primary,
    .ot-btn-secondary, .btn-secondary, .btn-outline-primary, .btn-outline-secondary, .btn-outline-dark, .ot-btn-cancel, .btn-gradient-secondary,
    .ot-btn-success, .btn-success, .ot-btn-danger, .btn-danger, .ot-btn-outline-danger, .btn-outline-danger,
    .ot-btn-warning, .ot-btnwarning, .btn-warning, .ot-btn-info, .btn-info) {
    --btn-bg: var(--v2-card);
    --btn-fg: var(--v2-ink);
    --btn-border: var(--v2-line);
    --btn-bg-hover: var(--v2-surface-hover);
    --btn-fg-hover: var(--v2-ink);
    --btn-border-hover: var(--v2-line-strong);
    --btn-bg-active: var(--v2-track);
    --btn-shadow: var(--v2-btn-shadow);
}

.v2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--v2-btn-gap);
    min-height: var(--v2-btn-height);
    padding: var(--v2-btn-padding);
    border: 1px solid var(--btn-border);
    border-radius: var(--v2-btn-radius);
    background: var(--btn-bg);
    color: var(--btn-fg);
    box-shadow: var(--btn-shadow);
    font-family: var(--v2-font);
    font-size: var(--v2-btn-font-size);
    font-weight: var(--v2-weight-bold);
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: var(--v2-btn-transition);
}

.v2-btn:hover {
    background: var(--btn-bg-hover);
    border-color: var(--btn-border-hover);
    color: var(--btn-fg-hover);
}

.v2-btn:active {
    background: var(--btn-bg-active);
    box-shadow: none;
    transform: translateY(1px);
}

.v2-btn:focus-visible {
    outline: var(--v2-focus-outline);
    outline-offset: 2px;
}

.v2-btn i,
.v2-btn svg {
    font-size: 1.1em;
    line-height: 1;
    flex: none;
}

.v2-btn.active,
body.v2-site :is(.ot-btn-secondary, .btn-secondary, .btn-outline-primary, .btn-outline-secondary, .btn-outline-dark).active,
body.v2-site .btn-check:checked + :is(.ot-btn-secondary, .btn-secondary, .btn-outline-primary, .btn-outline-secondary, .btn-outline-dark) {
    --btn-bg: var(--v2-primary-soft);
    --btn-fg: var(--v2-primary);
    --btn-border: var(--v2-primary);
    --btn-bg-hover: var(--v2-primary-soft-hover);
    --btn-fg-hover: var(--v2-primary);
    --btn-border-hover: var(--v2-primary);
}

.v2-btn:disabled,
.v2-btn.disabled,
.v2-btn[aria-disabled="true"] {
    opacity: .5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    pointer-events: none;
}

.v2-btn-primary,
body.v2-site :is(.ot-btn-primary, .btn-primary, .btn-ot-primary, .btn-gradient-primary) {
    --btn-bg: var(--v2-primary-fill);
    --btn-fg: var(--v2-on-color);
    --btn-border: var(--v2-primary-fill);
    --btn-bg-hover: var(--v2-primary-fill-hover);
    --btn-fg-hover: var(--v2-on-color);
    --btn-border-hover: var(--v2-primary-fill-hover);
    --btn-bg-active: var(--v2-primary-fill-active);
    --btn-shadow: var(--v2-btn-shadow-solid);
}

.v2-btn-soft {
    --btn-bg: var(--v2-primary-soft);
    --btn-fg: var(--v2-primary);
    --btn-border: transparent;
    --btn-bg-hover: var(--v2-primary-soft-hover);
    --btn-fg-hover: var(--v2-primary-dark);
    --btn-border-hover: transparent;
    --btn-bg-active: var(--v2-primary-soft-hover);
    --btn-shadow: none;
}

.v2-btn-ghost {
    --btn-bg: transparent;
    --btn-fg: var(--v2-muted);
    --btn-border: transparent;
    --btn-bg-hover: var(--v2-surface-hover);
    --btn-fg-hover: var(--v2-ink);
    --btn-border-hover: transparent;
    --btn-shadow: none;
}

.v2-btn-success,
body.v2-site :is(.ot-btn-success, .btn-success) {
    --btn-bg: var(--v2-good-solid);
    --btn-fg: var(--v2-on-color);
    --btn-border: var(--v2-good-solid);
    --btn-bg-hover: var(--v2-good-solid-hover);
    --btn-fg-hover: var(--v2-on-color);
    --btn-border-hover: var(--v2-good-solid-hover);
    --btn-bg-active: var(--v2-good);
    --btn-shadow: var(--v2-btn-shadow-solid);
}

.v2-btn-danger,
body.v2-site :is(.ot-btn-danger, .btn-danger) {
    --btn-bg: var(--v2-bad-solid);
    --btn-fg: var(--v2-on-color);
    --btn-border: var(--v2-bad-solid);
    --btn-bg-hover: var(--v2-bad-solid-hover);
    --btn-fg-hover: var(--v2-on-color);
    --btn-border-hover: var(--v2-bad-solid-hover);
    --btn-bg-active: var(--v2-bad);
    --btn-shadow: var(--v2-btn-shadow-solid);
}

.v2-btn-danger-outline,
body.v2-site :is(.ot-btn-outline-danger, .btn-outline-danger) {
    --btn-fg: var(--v2-bad);
    --btn-bg-hover: var(--v2-bad-soft);
    --btn-fg-hover: var(--v2-bad);
    --btn-border-hover: var(--v2-bad);
    --btn-bg-active: var(--v2-bad-soft);
}

.v2-btn-warning,
body.v2-site :is(.ot-btn-warning, .ot-btnwarning, .btn-warning) {
    --btn-bg: var(--v2-warn-solid);
    --btn-fg: var(--v2-warn-ink);
    --btn-border: var(--v2-warn-solid);
    --btn-bg-hover: var(--v2-warn-solid-hover);
    --btn-fg-hover: var(--v2-warn-ink);
    --btn-border-hover: var(--v2-warn-solid-hover);
    --btn-bg-active: var(--v2-warn-solid-hover);
    --btn-shadow: var(--v2-btn-shadow-solid);
}

.v2-btn-info,
body.v2-site :is(.ot-btn-info, .btn-info) {
    --btn-bg: var(--v2-info-solid);
    --btn-fg: var(--v2-on-color);
    --btn-border: var(--v2-info-solid);
    --btn-bg-hover: var(--v2-info-solid-hover);
    --btn-fg-hover: var(--v2-on-color);
    --btn-border-hover: var(--v2-info-solid-hover);
    --btn-bg-active: var(--v2-info);
    --btn-shadow: var(--v2-btn-shadow-solid);
}

.v2-btn-sm {
    min-height: var(--v2-btn-height-sm);
    padding: var(--v2-btn-padding-sm);
    font-size: var(--v2-btn-font-size-sm);
    gap: 6px;
    border-radius: var(--v2-radius-sm);
}

.v2-btn-lg {
    min-height: var(--v2-btn-height-lg);
    padding: var(--v2-btn-padding-lg);
    font-size: var(--v2-btn-font-size-lg);
}

.v2-btn-icon {
    padding: 0;
    width: var(--v2-btn-height);
}

.v2-btn-icon.v2-btn-sm { width: var(--v2-btn-height-sm); }
.v2-btn-icon.v2-btn-lg { width: var(--v2-btn-height-lg); }

.v2-btn-block {
    width: 100%;
}

/* Older button classes on every page: same colours (set above), same shape.
   Display is left as the page had it, so existing layouts and show/hide code keep working. */
body.v2-site :is(.ot-btn-primary, .btn-primary, .btn-ot-primary, .btn-gradient-primary,
    .ot-btn-secondary, .btn-secondary, .btn-outline-primary, .btn-outline-secondary, .btn-outline-dark, .ot-btn-cancel, .btn-gradient-secondary,
    .ot-btn-success, .btn-success, .ot-btn-danger, .btn-danger, .ot-btn-outline-danger, .btn-outline-danger,
    .ot-btn-warning, .ot-btnwarning, .btn-warning, .ot-btn-info, .btn-info) {
    background: var(--btn-bg) !important;
    border: 1px solid var(--btn-border) !important;
    color: var(--btn-fg) !important;
    border-radius: var(--v2-btn-radius) !important;
    box-shadow: var(--btn-shadow) !important;
    font-family: var(--v2-font);
    font-size: var(--v2-btn-font-size);
    font-weight: var(--v2-weight-bold);
    line-height: 20px;
    padding: 9px 16px;
    text-decoration: none;
    white-space: nowrap;        /* icon and label stay on one line, like .v2-btn */
    transition: var(--v2-btn-transition);
}

body.v2-site :is(.ot-btn-primary, .btn-primary, .btn-ot-primary, .btn-gradient-primary,
    .ot-btn-secondary, .btn-secondary, .btn-outline-primary, .btn-outline-secondary, .btn-outline-dark, .ot-btn-cancel, .btn-gradient-secondary,
    .ot-btn-success, .btn-success, .ot-btn-danger, .btn-danger, .ot-btn-outline-danger, .btn-outline-danger,
    .ot-btn-warning, .ot-btnwarning, .btn-warning, .ot-btn-info, .btn-info):hover {
    background: var(--btn-bg-hover) !important;
    border-color: var(--btn-border-hover) !important;
    color: var(--btn-fg-hover) !important;
}

body.v2-site :is(.ot-btn-primary, .btn-primary, .btn-ot-primary, .btn-gradient-primary,
    .ot-btn-secondary, .btn-secondary, .btn-outline-primary, .btn-outline-secondary, .btn-outline-dark, .ot-btn-cancel, .btn-gradient-secondary,
    .ot-btn-success, .btn-success, .ot-btn-danger, .btn-danger, .ot-btn-outline-danger, .btn-outline-danger,
    .ot-btn-warning, .ot-btnwarning, .btn-warning, .ot-btn-info, .btn-info):active {
    background: var(--btn-bg-active) !important;
    box-shadow: none !important;
    transform: translateY(1px);
}

body.v2-site :is(.ot-btn-primary, .btn-primary, .btn-ot-primary, .btn-gradient-primary,
    .ot-btn-secondary, .btn-secondary, .btn-outline-primary, .btn-outline-secondary, .btn-outline-dark, .ot-btn-cancel, .btn-gradient-secondary,
    .ot-btn-success, .btn-success, .ot-btn-danger, .btn-danger, .ot-btn-outline-danger, .btn-outline-danger,
    .ot-btn-warning, .ot-btnwarning, .btn-warning, .ot-btn-info, .btn-info):focus-visible {
    outline: var(--v2-focus-outline);
    outline-offset: 2px;
}

body.v2-site :is(.ot-btn-primary, .btn-primary, .btn-ot-primary, .btn-gradient-primary,
    .ot-btn-secondary, .btn-secondary, .btn-outline-primary, .btn-outline-secondary, .btn-outline-dark, .ot-btn-cancel, .btn-gradient-secondary,
    .ot-btn-success, .btn-success, .ot-btn-danger, .btn-danger, .ot-btn-outline-danger, .btn-outline-danger,
    .ot-btn-warning, .ot-btnwarning, .btn-warning, .ot-btn-info, .btn-info):is(:disabled, .disabled) {
    opacity: .5;
    box-shadow: none !important;
}

body.v2-site :is(.ot-btn-primary, .btn-primary, .ot-btn-secondary, .btn-secondary, .btn-outline-primary, .btn-outline-secondary,
    .ot-btn-success, .btn-success, .ot-btn-danger, .btn-danger, .ot-btn-warning, .btn-warning, .ot-btn-info, .btn-info):is(.btn-sm) {
    padding: 5px 12px;
    font-size: var(--v2-btn-font-size-sm);
    border-radius: var(--v2-radius-sm) !important;
}

body.v2-site :is(.ot-btn-primary, .btn-primary, .ot-btn-secondary, .btn-secondary, .btn-outline-primary, .btn-outline-secondary,
    .ot-btn-success, .btn-success, .ot-btn-danger, .btn-danger, .ot-btn-warning, .btn-warning, .ot-btn-info, .btn-info):is(.btn-lg, .ot-btn-lg) {
    padding: 12px 22px;
    font-size: var(--v2-btn-font-size-lg);
}

/* Square icon button used in the top bar (feedback, notifications, menu) */
.v2-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--v2-btn-radius);
    border: 1px solid var(--v2-line);
    background: var(--v2-card);
    box-shadow: var(--v2-btn-shadow);
    display: inline-grid;
    place-items: center;
    color: var(--v2-muted);
    padding: 0 !important;
    text-decoration: none;
    transition: var(--v2-btn-transition);
}

.v2-icon-btn:hover {
    color: var(--v2-ink);
    background: var(--v2-surface-hover);
    border-color: var(--v2-line-strong);
}

.v2-icon-btn:focus-visible {
    outline: var(--v2-focus-outline);
    outline-offset: 2px;
}

.v2-icon-btn i {
    font-size: 17px;
}

/* ================================================================ Chips (small status labels)
 *   <span class="v2-chip v2-chip-good">Marked</span>    tones: good | warn | bad | info | muted | primary
 */

.v2-chip {
    display: inline-block;
    font-size: var(--v2-text-xs);
    font-weight: var(--v2-weight-bold);
    padding: 2px 8px;
    border-radius: var(--v2-radius-pill);
    white-space: nowrap;
    line-height: 1.5;
}

.v2-chip-good { background: var(--v2-good-soft); color: var(--v2-good); }
.v2-chip-warn { background: var(--v2-warn-soft); color: var(--v2-warn); }
.v2-chip-bad { background: var(--v2-bad-soft); color: var(--v2-bad); }
.v2-chip-info { background: var(--v2-info-soft); color: var(--v2-info); }
.v2-chip-muted { background: var(--v2-surface-muted); color: var(--v2-pill-ink); }
.v2-chip-primary { background: var(--v2-primary-soft); color: var(--v2-primary); }

/* Count chips: "Assets 109"   tones: assets | activities | assignments | questions | interactions; .is-zero greys out */
.v2-ls-chip {
    --chip-bg: var(--v2-surface-muted);
    --chip-fg: var(--v2-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: var(--v2-weight-medium);
    padding: 2px 9px;
    border-radius: var(--v2-radius-pill);
    background: var(--chip-bg);
    color: var(--chip-fg);
    white-space: nowrap;
    line-height: 1.6;
}

.v2-ls-chip b {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.v2-ls-assets       { --chip-bg: var(--v2-count-assets-bg);       --chip-fg: var(--v2-count-assets-fg); }
.v2-ls-activities   { --chip-bg: var(--v2-count-activities-bg);   --chip-fg: var(--v2-count-activities-fg); }
.v2-ls-assignments  { --chip-bg: var(--v2-count-assignments-bg);  --chip-fg: var(--v2-count-assignments-fg); }
.v2-ls-questions    { --chip-bg: var(--v2-count-questions-bg);    --chip-fg: var(--v2-count-questions-fg); }
.v2-ls-interactions { --chip-bg: var(--v2-count-interactions-bg); --chip-fg: var(--v2-count-interactions-fg); }

.v2-ls-chip.is-zero {
    --chip-bg: var(--v2-count-zero-bg);
    --chip-fg: var(--v2-count-zero-fg);
}

/* Level pill: "Lesson 2" */
.v2-level {
    font-size: 11.5px;
    padding: 1px 8px;
    border-radius: var(--v2-radius-xs);
    background: var(--v2-surface-muted);
    color: var(--v2-pill-ink);
    font-weight: var(--v2-weight-medium);
    white-space: nowrap;
}

.v2-level b {
    font-weight: 700;
    color: var(--v2-ink);
}

.v2-level.is-zero {
    opacity: .6;
}

/* Subject name with its colour dot. Set data-subj="MAT" (or --subj) on it or a parent. */
.v2-subject {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: var(--v2-weight-bold);
    font-size: var(--v2-text-sm);
    color: var(--subj, var(--v2-ink));
    white-space: nowrap;
}

.v2-subject::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background: var(--subj, var(--v2-neutral));
}

[data-subj="MAT"] { --subj: var(--v2-mat); }
[data-subj="SCI"] { --subj: var(--v2-sci); }
[data-subj="SOC"] { --subj: var(--v2-soc); }
[data-subj="ENG"] { --subj: var(--v2-eng); }
[data-subj="KAN"] { --subj: var(--v2-kan); }
[data-subj="HIN"] { --subj: var(--v2-hin); }

/* ================================================================ Page heading
 *   <div class="v2-page-head"><div><div class="v2-eyebrow">…</div><h1>…</h1></div><div class="v2-head-actions">buttons</div></div>
 */

.v2-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

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

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

/* One line under the heading (counts, what the page is for) */
.v2-page-sub {
    margin: 4px 0 0;
    font-size: var(--v2-text-md);
    color: var(--v2-muted);
}

/* Placeholder for an empty value ("—") */
.v2-muted-text {
    color: var(--v2-faint);
}

.v2-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ================================================================ Breadcrumbs
 *   <x-ui.breadcrumb :items="[['label' => 'Deep Insight', 'url' => …], ['label' => 'Science']]" context="9th Std B" />
 *   Every item with a url is a link; the last item is the current page.
 */

.v2-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px 12px;
    flex-wrap: wrap;
    margin: 0 0 6px;
}

.v2-breadcrumb ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--v2-text-sm);
    line-height: 20px;
}

.v2-breadcrumb li {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 2px;
}

/* first crumb's text lines up with the page heading */
.v2-breadcrumb li:first-child > :is(a, span) {
    margin-left: -8px;
}

.v2-breadcrumb li + li::before {
    content: "\203A";
    padding: 0 4px;
    color: var(--v2-faint);
    font-size: var(--v2-text-base);
}

.v2-breadcrumb a,
.v2-breadcrumb [aria-current] {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 360px;
    padding: 2px 8px;
    border-radius: var(--v2-radius-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-breadcrumb a {
    color: var(--v2-primary);
    font-weight: var(--v2-weight-medium);
    text-decoration: none;
    transition: background-color .15s ease;
}

.v2-breadcrumb a:hover,
.v2-breadcrumb a:focus-visible {
    background: var(--v2-primary-soft);
    color: var(--v2-primary-dark);
    text-decoration: none;
}

.v2-breadcrumb a:focus-visible {
    outline: none;
    box-shadow: var(--v2-focus-ring);
}

.v2-breadcrumb [aria-current] {
    color: var(--v2-ink);
    font-weight: var(--v2-weight-bold);
}

/* Subject crumb: colour dot like .v2-subject */
.v2-breadcrumb [data-subj]::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background: var(--subj, var(--v2-neutral));
}

.v2-breadcrumb .v2-chip {
    flex: none;
}

/* ================================================================ Cards and panels */

.v2-card {
    background: var(--v2-card);
    border: 1px solid var(--v2-line);
    border-radius: var(--v2-radius);
    padding: 20px;
}

.v2-panel {
    background: var(--v2-card);
    border: 1px solid var(--v2-line);
    border-radius: var(--v2-radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.v2-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.v2-panel-head h2 {
    font-family: var(--v2-font);
    font-size: var(--v2-text-lg);
    font-weight: var(--v2-weight-bold);
    margin: 0;
    color: var(--v2-ink);
}

.v2-panel-head a {
    font-size: var(--v2-text-sm);
    color: var(--v2-primary);
    font-weight: var(--v2-weight-medium);
    text-decoration: none;
}

/* ================================================================ Notes (callouts)
 *   <div class="v2-callout"><i class="fa-solid fa-circle-info"></i><span>…</span></div>   tones: (info) | is-error | is-good | is-warn
 */

.v2-callout {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--v2-radius-md);
    background: var(--v2-primary-soft);
    color: var(--v2-primary-dark);
    font-size: var(--v2-text-md);
}

.v2-callout i {
    margin-top: 3px;
}

.v2-callout.is-error { background: var(--v2-bad-soft); color: var(--v2-bad); }
.v2-callout.is-good { background: var(--v2-good-soft); color: var(--v2-good); }
.v2-callout.is-warn { background: var(--v2-warn-soft); color: var(--v2-warn); }

/* Small grey helper text */
.v2-hint {
    display: block;
    font-size: var(--v2-text-sm) !important;
    color: var(--v2-muted) !important;
    text-align: left !important;
    margin: 0 0 6px;
}

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

/* ================================================================ Form fields
 *   <div class="v2-field"><label>…</label><input class="form-control"><small class="v2-field-help">…</small></div>
 */

.v2-field {
    margin-bottom: 16px;
}

.v2-field label {
    display: block;
    font-family: var(--v2-font);
    font-weight: var(--v2-weight-bold);
    font-size: var(--v2-text-base);
    margin-bottom: 6px;
    color: var(--v2-ink);
}

.v2-field .form-control,
.v2-field .form-select {
    height: 44px;
    border-radius: var(--v2-radius-md);
    border: 1px solid var(--v2-line);
    font-family: var(--v2-font);
    font-size: var(--v2-text-base);
    padding: 0 12px;
    background-color: var(--v2-card);
    color: var(--v2-ink);
}

.v2-field .form-control:focus,
.v2-field .form-select:focus {
    border-color: var(--v2-primary);
    box-shadow: var(--v2-focus-ring);
}

.v2-field .form-control.is-invalid {
    border-color: var(--v2-bad);
}

.v2-field-help {
    display: block;
    margin-top: 6px;
    font-size: var(--v2-text-sm);
    color: var(--v2-muted);
}

/* Button row at the bottom of a form */
.v2-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--v2-line);
}

/* ================================================================ Progress bar
 *   <span class="v2-progress-bar"><span style="width:40%"></span></span>   colour follows --subj
 */

.v2-progress-bar {
    width: 72px;
    height: 6px;
    border-radius: 9px;
    background: var(--v2-track);
    overflow: hidden;
    display: inline-block;
}

.v2-progress-bar span {
    display: block;
    height: 100%;
    border-radius: 9px;
    background: var(--subj, var(--v2-primary));
}

/* ================================================================ Empty state */

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

@media (prefers-reduced-motion: reduce) {
    .v2-btn,
    .v2-icon-btn {
        transition: none;
    }

    .v2-btn:active {
        transform: none;
    }
}

/* ================================================================ Loading indicator
 *   <div class="v2-loading"><span class="v2-spinner"></span>Loading...</div>   (UI.html.loading('Loading...'))
 */

.v2-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    color: var(--v2-muted);
    font-size: 13px;
}

.v2-spinner {
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 50%;
    border: 2px solid var(--v2-track);
    border-top-color: var(--v2-primary);
    animation: v2-spin .8s linear infinite;
}

@keyframes v2-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .v2-spinner { animation-duration: 2.4s; }
}

/* ================================================================ Table card
 *   <div class="table-responsive v2-table-card"><table class="table">...</table></div>
 * A bordered, rounded table with a quiet heading row and row hover. Mark columns on the <th> with
 * data-v2-col="chip" / "num" to draw their cells as chips or numbers (ui-kit.js, also for AJAX rows).
 */

.v2-table-card {
    border: 1px solid var(--v2-line);
    border-radius: var(--v2-radius-lg);
    background: var(--v2-card);
    overflow: auto;
}

.v2-table-card > .table {
    margin: 0;
}

.v2-table-card .table > thead > tr > th {
    background: var(--v2-surface-subtle);
    color: var(--v2-muted);
    font-family: var(--v2-font);
    font-size: var(--v2-text-xs);
    font-weight: var(--v2-weight-bold);
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 10px 12px;
    border-bottom: 1px solid var(--v2-line);
    vertical-align: bottom;
}

.v2-table-card .table > tbody > tr > td {
    padding: 12px;
    font-size: var(--v2-text-md);
    color: var(--v2-ink);
    border-color: var(--v2-line);
    vertical-align: middle;
    background: transparent;
}

.v2-table-card .table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.v2-table-card .table > tbody > tr:hover > td {
    background: var(--v2-surface-hover-soft);
}

/* Grouping cell that spans several rows ("Belongs to", "Parent"). Rows merged with UI.groupRows (table.v2-grouped,
   e.g. assets with the same name) keep a plain cell. */
.v2-table-card .table > tbody > tr > td[rowspan] {
    background: var(--v2-surface-sunken);
    color: var(--v2-ink-soft);
    font-weight: var(--v2-weight-bold);
    vertical-align: top;
    border-right: 1px solid var(--v2-line);
}

/* "No data found" rows */
.v2-table-card .table > tbody > tr > td[colspan] {
    color: var(--v2-muted);
    text-align: center;
    padding: 20px 12px;
}

.v2-table-card .table td a:not(.btn):not(.v2-btn) {
    color: var(--v2-primary);
    font-weight: var(--v2-weight-medium);
    text-decoration: none;
}

.v2-table-card .table td a:not(.btn):not(.v2-btn):hover {
    text-decoration: underline;
}

.v2-table-card .v2-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.v2-table-card > nav,
.v2-table-card > .pagination {
    padding: 8px 12px;
}

/* ================================================================ Score cards (deep insight)
 * Teacher subject cards and the student / parent cards built by UI.html.scoreCard(). */

.v2-insight-card,
.v2-insight-key {
    font-family: var(--v2-font);
}

.v2-insight-key {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 12.5px;
    color: var(--v2-muted);
    padding: 6px 4px 2px;
}

.v2-insight-key span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.v2-insight-key i {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 3px;
}

.v2-insight-key .v2-key-fill { background: var(--v2-primary); }
.v2-insight-key .v2-key-marker { width: 3px; height: 14px; background: var(--v2-marker); }
.v2-insight-key .v2-band-low { background: var(--v2-band-low-soft); }
.v2-insight-key .v2-band-mid { background: var(--v2-band-mid-soft); }
.v2-insight-key .v2-band-high { background: var(--v2-band-high-soft); }

.v2-insight-card {
    background: var(--v2-card) !important;
    border: 1px solid var(--v2-line) !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    transition: border-color .15s;
}

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

.v2-insight-card .gauge-container {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    height: 100%;
    outline: none;
}

.v2-insight-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.v2-insight-card .v2-subject {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--v2-ink);
    white-space: normal;       /* long lesson / activity names wrap inside the card */
    overflow-wrap: anywhere;
}

.v2-insight-card .v2-subject::before {
    content: "";
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--subj, var(--v2-neutral));
}

.v2-insight-value {
    font-size: 30px;
    font-weight: 600;
    color: var(--v2-ink);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.v2-insight-value small {
    font-size: 16px;
    color: var(--v2-muted);
    margin-left: 2px;
}

.v2-bullet {
    position: relative;
    height: 26px;
}

.v2-bullet-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 8px;
    height: 10px;
    border-radius: 9px;
    background: var(--v2-track);
}

.v2-bullet-fill {
    position: absolute;
    left: 0;
    top: 10px;
    height: 6px;
    border-radius: 9px;
    background: var(--subj, var(--v2-primary));
}

.v2-bullet-marker {
    position: absolute;
    top: 2px;
    width: 3px;
    height: 22px;
    margin-left: -1px;
    border-radius: 2px;
    background: var(--v2-marker);
}

.v2-axis {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: var(--v2-muted);
    margin-top: -6px;
    font-variant-numeric: tabular-nums;
}

.v2-insight-meta,
.v2-insight-students {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 12.5px;
    color: var(--v2-muted);
}

.v2-insight-meta b,
.v2-insight-students b {
    color: var(--v2-ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.v2-insight-students {
    padding-top: 8px;
    border-top: 1px solid var(--v2-line);
}

.v2-insight-open {
    margin-top: auto;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--subj, var(--v2-primary));
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.v2-insight-key::before,
.v2-insight-key span::before {
    display: none !important;
}

/* Subject card: every mark is labelled on the card itself */
.v2-insight-intro {
    font-size: 13px;
    color: var(--v2-muted);
    padding: 4px 4px 0;
    font-family: var(--v2-font);
}

.v2-insight-intro::before {
    display: none !important;
}

.v2-insight-caption {
    font-size: 12.5px;
    color: var(--v2-muted);
    margin-top: 4px;
}

.v2-insight-legend,
.v2-insight-card ul.v2-insight-students {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--v2-ink);
}

.v2-insight-legend li,
.v2-insight-card ul.v2-insight-students li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.v2-insight-legend b {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.v2-sw-fill {
    display: inline-block;
    width: 18px;
    height: 6px;
    border-radius: 9px;
    background: var(--subj, var(--v2-primary));
    flex: none;
}

.v2-sw-marker {
    display: inline-block;
    width: 3px;
    height: 16px;
    margin: 0 7px 0 8px;
    border-radius: 2px;
    background: var(--v2-marker);
    flex: none;
}

.v2-insight-compare {
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    align-self: flex-start;
}

.v2-insight-compare.up { background: var(--v2-good-soft); color: var(--v2-good); }
.v2-insight-compare.down { background: var(--v2-warn-soft); color: var(--v2-warn); }

/* Score cards built by UI.html.scoreCard(): a second average marker, the card as a link, an action row */
.v2-bullet-marker.is-alt,
.v2-sw-marker.is-alt {
    background: var(--v2-mark-section);
}

.v2-insight-card {
    display: flex;
    flex-direction: column;
}

.v2-insight-card > .gauge-container {
    flex: 1;
}

.v2-insight-card a.gauge-container,
.v2-insight-card a.gauge-container:hover {
    color: inherit;
    text-decoration: none;
}

.v2-insight-card .gauge-container:focus-visible {
    box-shadow: var(--v2-focus-ring);
    border-radius: 14px;
}

.v2-insight-card .v2-insight-meta {
    gap: 6px;
}

.v2-insight-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--v2-line);
}

.v2-insight-card ul.v2-insight-students {
    padding-top: 10px;
    border-top: 1px solid var(--v2-line);
    font-size: 12.5px;
    color: var(--v2-muted);
}

/* ================================================================ Score rows (drill-down, one student's score)
 * Built by UI.html.scoreRow(); same card, title and pill look as the teacher lesson / concept rows. */

.v2-score-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.v2-score-row {
    background: var(--v2-card);
    border: 1px solid var(--v2-line);
    border-radius: 14px;
    font-family: var(--v2-font);
    transition: border-color .15s;
}

.v2-score-row:hover,
.v2-score-row:focus-within {
    border-color: var(--v2-line-strong);
}

.v2-score-row.is-dim .v2-score-main {
    opacity: .65;
}

.v2-score-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    color: inherit;
    text-decoration: none;
    border-radius: 14px;
    outline: none;
}

.v2-score-main:hover {
    color: inherit;
    text-decoration: none;
}

.v2-score-main.is-link {
    cursor: pointer;
}

.v2-score-main:focus-visible {
    box-shadow: var(--v2-focus-ring);
}

.v2-score-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--v2-ink);
}

.v2-score-head .la-arrow-right {
    color: var(--v2-primary);
    transition: transform .15s;
}

.v2-score-main.is-link:hover .v2-score-title {
    color: var(--v2-primary);
}

.v2-score-main.is-link:hover .la-arrow-right {
    transform: translateX(3px);
}

.v2-score-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-size: 12.5px;
    color: var(--v2-muted);
    margin-top: -4px;
}

.v2-score-meta b {
    color: var(--v2-ink);
    font-weight: 600;
}

/* the bar: grey track, solid fill to the score, ticks for the averages */
.v2-score-bar {
    position: relative;
    height: 26px;
    border-radius: 8px;
    background: var(--v2-track);
}

.v2-score-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    min-width: 48px;
    max-width: 100%;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v2-on-color);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.v2-score-fill.is-low,
.v2-score-swatch.is-low { background: var(--v2-band-low); }
.v2-score-fill.is-mid,
.v2-score-swatch.is-mid { background: var(--v2-band-mid); }
.v2-score-fill.is-high,
.v2-score-swatch.is-high { background: var(--v2-band-high); }
.v2-score-fill.is-mid { color: var(--v2-warn-ink); }

.v2-score-mark {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 3px;
    margin-left: -1px;
    border-radius: 2px;
    background: var(--v2-marker);
    box-shadow: 0 0 0 1.5px var(--v2-card);
}

.v2-score-mark.is-alt {
    background: var(--v2-mark-section);
}

/* letter beside a marker line (marker.tag): above the bar for the first, below for the second */
.v2-score-bar.has-tags { margin-top: 16px; }
.v2-score-bar.has-tags-below { margin-bottom: 16px; }

.v2-score-mark-tag {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: var(--v2-marker);
    white-space: nowrap;
}

.v2-score-mark-tag.is-above { bottom: calc(100% + 3px); }
.v2-score-mark-tag.is-below { top: calc(100% + 3px); }
.v2-score-mark.is-alt .v2-score-mark-tag { color: var(--v2-mark-section); }

.v2-score-pill-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--v2-marker);
    margin-left: -3px;
}

.v2-score-pill-tag.is-alt { color: var(--v2-mark-section); }

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

.v2-score-pill {
    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);
}

.v2-score-pill b {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.v2-score-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex: none;
}

.v2-score-tick {
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--v2-marker);
    flex: none;
    margin: 0 3px;
}

.v2-score-tick.is-alt {
    background: var(--v2-mark-section);
}

.v2-score-note {
    margin-left: auto;
    font-size: 12.5px;
    font-weight: 600;
}

.v2-score-note.is-up { color: var(--v2-good); }
.v2-score-note.is-down { color: var(--v2-warn); }

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

.v2-score-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 18px 16px;
}

@media (max-width: 575.98px) {
    .v2-score-note {
        margin-left: 0;
        flex-basis: 100%;
    }
}

/* ================================================================ Row actions
 * Several buttons in one table cell: <td><div class="v2-row-actions">buttons</div></td> */

.v2-row-actions {
    display: flex;
    flex-wrap: nowrap;          /* buttons side by side; the table scrolls sideways on narrow screens */
    align-items: center;
    gap: 6px;
}

.v2-row-actions > :empty {
    display: none;
}

/* ---------------------------------------------------------------- Thinking level tag
 * Icon + label under a learning outcome (Remember ... Create, "Activity based"), built by the lesson plan,
 * interactions and learning outcome report scripts. Kept small so the outcome text stays the main thing. */

.v2-level-icon {
    font-size: var(--v2-text-md) !important;
    margin-right: 4px;
}

.v2-level-label {
    font-size: var(--v2-text-md) !important;
    font-weight: var(--v2-weight-medium);
    margin: 0 12px 0 0;
}
