﻿/* ================================================
   RESET & BASE
   ================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text);
}

@media (min-width: 768px) {
    html { font-size: 15px; }
}

body {
    background-color: var(--color-page-bg);
}

a {
    color: var(--color-primary);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

/* Bootstrap overrides aligned with tokens */
.btn-primary {
    --bs-btn-bg: var(--color-primary);
    --bs-btn-border-color: var(--color-primary-dark);
    --bs-btn-hover-bg: var(--color-primary-dark);
    --bs-btn-hover-border-color: var(--color-uac-navy);
    --bs-btn-active-bg: var(--color-uac-navy);
    --bs-btn-active-border-color: var(--color-uac-navy);
}

.btn-outline-primary {
    --bs-btn-color: var(--color-primary);
    --bs-btn-border-color: var(--color-primary);
    --bs-btn-hover-bg: var(--color-primary);
    --bs-btn-hover-border-color: var(--color-primary);
}

.card {
    border-color: var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(21, 88, 192, 0.15);
}

/* ================================================
   SIDEBAR SHELL
   ================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(165deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-mid) 45%, var(--sidebar-bg-end) 100%);
    color: #fff;
}

aside.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1030;
}

.offcanvas.sidebar {
    width: var(--sidebar-width) !important;
    background: linear-gradient(165deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-mid) 45%, var(--sidebar-bg-end) 100%) !important;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-inner::-webkit-scrollbar { width: 4px; }
.sidebar-inner::-webkit-scrollbar-track { background: transparent; }
.sidebar-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* ================================================
   SIDEBAR: BRAND
   ================================================ */
.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    width: auto;
    height: 56px;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.sidebar-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
}

/* ================================================
   SIDEBAR: PROFILE CARD
   ================================================ */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.06);
    margin: 16px 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.1);
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

/* The whole profile card links to Settings */
.sidebar-profile:hover,
.sidebar-profile.active {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
}

.sidebar-profile-gear {
    color: rgba(255,255,255,0.45);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-profile:hover .sidebar-profile-gear,
.sidebar-profile.active .sidebar-profile-gear {
    color: var(--sidebar-accent);
}

.sidebar-avatar {
    font-size: 2.4rem;
    color: var(--sidebar-accent);
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-avatar-img {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 204, 0, 0.45);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.sidebar-profile-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-profile-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-profile-meta {
    font-size: 0.70rem;
    color: rgba(255,255,255,0.5);
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 4px 20px 8px;
}

/* ================================================
   SIDEBAR: NAV
   ================================================ */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 4px 10px;
    gap: 2px;
}

.sidebar-nav .nav-link,
.sidebar-footer .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.855rem;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.sidebar-nav .nav-link i,
.sidebar-footer .nav-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
    opacity: 0.72;
}

.nav-icon--sm {
    width: 16px;
    height: 16px;
}

.sidebar-nav .nav-link.active .nav-icon,
.sidebar-nav .nav-group-toggle.active .nav-icon,
.nav-group-item.active .nav-icon {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(78%) sepia(66%) saturate(600%) hue-rotate(6deg) brightness(103%) contrast(101%);
}

.sidebar-nav .nav-link:hover .nav-icon,
.sidebar-nav .nav-group-toggle:hover .nav-icon,
.nav-group-item:hover .nav-icon {
    opacity: 0.95;
}

.sidebar-avatar-fallback {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 204, 0, 0.45);
    background: rgba(255, 255, 255, 0.12);
    padding: 0.35rem;
    box-sizing: border-box;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    transform: translateX(3px);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(90deg, rgba(255,204,0,0.22) 0%, rgba(255,204,0,0.06) 100%);
    color: var(--sidebar-text-active);
    border-left: 3px solid var(--sidebar-accent);
    padding-left: 11px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.855rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.nav-group-toggle i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-group-toggle .nav-icon {
    filter: brightness(0) invert(1);
    opacity: 0.72;
}

.nav-group-toggle .toggle-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform var(--transition-normal);
}

.nav-group-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    transform: translateX(3px);
}

.nav-group-toggle.active {
    background: linear-gradient(90deg, rgba(255,204,0,0.22) 0%, rgba(255,204,0,0.06) 100%);
    color: var(--sidebar-text-active);
    border-left: 3px solid var(--sidebar-accent);
    padding-left: 11px;
}

.nav-group-toggle[aria-expanded="true"] .toggle-arrow {
    transform: rotate(-180deg);
}

.nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height var(--transition-normal), opacity var(--transition-normal);
}

.nav-group-items.show {
    max-height: 500px;
    opacity: 1;
}

.nav-group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    font-weight: 400;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
    border-left: 2px solid transparent;
}

.nav-group-item i {
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.nav-group-item .nav-icon {
    filter: brightness(0) invert(1);
    opacity: 0.55;
}

.nav-group-item:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
}

.nav-group-item.active {
    background: rgba(255,204,0,0.15);
    color: var(--sidebar-accent);
    border-left-color: var(--sidebar-accent);
}

.nav-group-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 8px 10px;
}

.sidebar-spacer { flex: 1; }

.sidebar-footer {
    padding: 8px 10px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer .nav-link:hover {
    background: rgba(248,113,113,0.1);
    color: #f87171;
    transform: translateX(3px);
}

/* ================================================
   MOBILE TOPBAR
   ================================================ */
.mobile-topbar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(90deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1029;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.topbar-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.topbar-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.03em;
}

.sidebar-toggle {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.2);
}

/* ================================================
   MAIN CONTENT
   ================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--color-page-bg);
}

.content-wrapper {
    padding: 28px 32px;
    max-width: 1400px;
}

@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
        padding-top: 62px;
    }

    .content-wrapper {
        padding: 20px 16px;
    }
}

/* ================================================
   CLASSROOM SUB-NAV
   ================================================ */
.classroom-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-uac-gold);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

.classroom-context-subject {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
    min-width: 0;
}

.classroom-context-code {
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--color-uac-navy);
    color: var(--color-primary-contrast);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-1);
    letter-spacing: 0.02em;
}

.classroom-context-title {
    font-family: var(--font-display);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-2);
    color: var(--color-uac-navy);
}

.classroom-context-module {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: var(--space-1);
    font-size: var(--font-size-1);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

.classroom-context-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin: 0;
}

.classroom-context-fact dt {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--font-size-0);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.classroom-context-fact dd {
    margin: 0;
    font-size: var(--font-size-1);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.classroom-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    margin-bottom: var(--space-5);
}

.classroom-subnav-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-1);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.classroom-subnav-link:hover {
    background: var(--color-surface-muted);
    color: var(--color-primary);
}

.classroom-subnav-link.active {
    background: var(--color-primary);
    color: var(--color-primary-contrast);
    border-color: var(--color-primary-dark);
    box-shadow: 0 2px 8px rgba(21, 88, 192, 0.25);
}

.classroom-subnav-link .subnav-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.classroom-subnav-link.active .subnav-icon {
    filter: brightness(0) invert(1);
}

/* Activities submenu (Blackboard/Canvas-style grouped nav) */
.classroom-subnav-group {
    position: relative;
}

.classroom-subnav-parent {
    cursor: pointer;
    background: var(--color-surface);
}

.classroom-subnav-parent .subnav-caret {
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.classroom-subnav-parent[aria-expanded="true"] .subnav-caret {
    transform: rotate(180deg);
}

.classroom-submenu {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    z-index: 30;
    min-width: 230px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
}

.classroom-submenu.collapsing {
    height: auto;
}

.classroom-submenu-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-1);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.classroom-submenu-link i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.classroom-submenu-link:hover {
    background: var(--color-surface-muted);
    color: var(--color-primary);
}

.classroom-submenu-link.active {
    background: var(--color-primary);
    color: var(--color-primary-contrast);
    border-color: var(--color-primary-dark);
    box-shadow: 0 2px 8px rgba(21, 88, 192, 0.25);
}

/* ================================================
   SCHEDULE ACCORDION (LoadModule, GradesEncoding)
   ================================================ */
.schedule-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.schedule-accordion .accordion-item,
.schedule-accordion .card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md) !important;
    overflow: hidden;
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow-1);
}

.schedule-accordion .card-header,
.schedule-accordion .accordion-header {
    background: var(--color-surface-muted);
    border-bottom: 1px solid var(--color-border);
    padding: 0;
}

.schedule-accordion .accordion-button,
.schedule-accordion .card-header .btn-link {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    padding: var(--space-4) var(--space-5);
    font-size: var(--font-size-2);
}

.schedule-accordion .accordion-button:not(.collapsed) {
    background: linear-gradient(90deg, rgba(21, 88, 192, 0.08) 0%, transparent 100%);
    color: var(--color-primary);
    box-shadow: none;
}

.schedule-accordion .accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.schedule-level-icon {
    color: var(--color-primary);
    margin-right: var(--space-2);
}

.schedule-section-title {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-2);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.schedule-period-title {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-1);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.schedule-class-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-surface-muted);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
}

.schedule-class-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.schedule-table-wrap {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-4);
}

.schedule-table-wrap .table {
    margin-bottom: 0;
}

.schedule-table-wrap thead {
    background: var(--color-surface-muted);
}

.schedule-table-wrap thead th {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-1);
    color: var(--color-text-muted);
    border-bottom-color: var(--color-border);
}

/* ================================================
   PAGE ALERTS
   ================================================ */
.page-alerts {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.page-alerts .alert {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-1);
}

/* ================================================
   FLOATING HELP BUTTON & PANEL
   ================================================ */
.help-fab {
    position: fixed;
    right: var(--space-5);
    bottom: var(--space-5);
    z-index: var(--z-dropdown);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-3);
    height: 44px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-uac-navy), var(--color-primary));
    color: var(--color-primary-contrast);
    font-family: var(--font-body);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-1);
    box-shadow: var(--shadow-2);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.help-fab:hover,
.help-fab:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-3);
    color: var(--color-primary-contrast);
}

.help-fab:focus-visible {
    outline: 3px solid var(--color-uac-gold);
    outline-offset: 2px;
}

.help-fab .bi,
.help-fab-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.help-fab-icon {
    filter: brightness(0) invert(1);
    width: 18px;
    height: 18px;
}

.help-fab-label {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .help-fab {
        right: var(--space-4);
        bottom: var(--space-4);
        padding: 0;
        width: 40px;
        height: 40px;
        justify-content: center;
    }

    .help-fab-label {
        display: none;
    }
}

/* Floating launcher for pinned classrooms — stacks above the per-page help button.
   The bottom offset keeps it just clear of the help FAB: help height (44) + a 12px gap. */
.pinned-fab {
    position: fixed;
    right: var(--space-5);
    bottom: calc(var(--space-5) + 56px);
    z-index: var(--z-dropdown);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-uac-gold, #c9960c), var(--color-primary));
    color: #fff;
    box-shadow: var(--shadow-2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pinned-fab:hover,
.pinned-fab:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-3);
    color: #fff;
}

.pinned-fab:focus-visible {
    outline: 3px solid var(--color-uac-gold, #c9960c);
    outline-offset: 2px;
}

.pinned-fab .bi {
    font-size: 1.1rem;
    line-height: 1;
}

/* While a floating button is being dragged: kill the hover lift/transition so it tracks the
   pointer exactly, and show the grabbing cursor. Position is driven by inline left/top from site.js. */
.help-fab.fab-dragging,
.pinned-fab.fab-dragging {
    transform: none;
    transition: none;
    cursor: grabbing;
    user-select: none;
}

.pinned-fab-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--color-danger, #b71c1c);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pinned-list { display: grid; gap: var(--space-2); }

.pinned-list-link {
    display: grid;
    gap: 2px;
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    text-decoration: none;
    color: var(--color-text);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.pinned-list-link:hover {
    border-color: var(--color-primary);
    background: var(--color-surface-muted);
    color: var(--color-text);
}

.pinned-list-code { font-weight: 700; color: var(--color-primary); font-size: 0.8rem; }
.pinned-list-name { font-weight: 600; }
.pinned-list-section { font-size: 0.8rem; color: var(--color-text-muted, #5a6780); }

@media (max-width: 575.98px) {
    /* Mobile help FAB is 40px, so stack the pinned FAB at 40 + a 10px gap above it. */
    .pinned-fab { right: var(--space-4); bottom: calc(var(--space-4) + 50px); width: 40px; height: 40px; }
}

.help-panel {
    width: min(420px, 100%);
    background: var(--color-surface);
    color: var(--color-text);
}

.help-panel-header {
    background: linear-gradient(135deg, var(--color-uac-navy), var(--color-primary));
    color: var(--color-primary-contrast);
}

.help-panel-header .offcanvas-title {
    color: var(--color-primary-contrast);
}

.help-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.16);
    font-size: 1.1rem;
}

.help-panel-body {
    padding: var(--space-5);
}

.help-panel-intro {
    margin: 0 0 var(--space-5);
    color: var(--color-text-muted);
    font-size: var(--font-size-2);
    line-height: 1.5;
}

.help-section + .help-section {
    margin-top: var(--space-5);
}

.help-section-heading {
    margin: 0 0 var(--space-3);
    font-size: var(--font-size-1);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-uac-navy);
}

.help-section-list {
    margin: 0;
    padding-left: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.help-section-list li {
    line-height: 1.5;
    color: var(--color-text);
}

@media (prefers-reduced-motion: reduce) {
    .help-fab {
        transition: none;
    }
}

/* ================================================
   OUTLOOK-STYLE CALENDAR VIEW
   ================================================ */
.outlook-calendar-shell {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: var(--space-4);
}

.outlook-calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}

.outlook-calendar-toolbar-left,
.outlook-calendar-toolbar-right {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.outlook-calendar-title {
    margin: 0;
    font-size: var(--font-size-3);
    font-weight: var(--font-weight-semibold);
    color: var(--color-uac-navy);
}

.outlook-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface-muted);
}

.outlook-weekday-header {
    background: #eef3fb;
    color: var(--color-text-muted);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-1);
    font-weight: var(--font-weight-semibold);
    border-bottom: 1px solid var(--color-border);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.outlook-day-cell {
    min-height: 128px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-2);
}

.outlook-day-cell:nth-child(7n) {
    border-right: none;
}

.outlook-day-cell.is-outside-month {
    background: #f9fbff;
}

.outlook-day-cell.is-today {
    box-shadow: inset 0 0 0 2px var(--color-primary);
}

.outlook-day-number {
    font-size: var(--font-size-1);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.outlook-day-cell.is-today .outlook-day-number {
    color: var(--color-primary);
}

.outlook-day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.outlook-event-chip {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #e8f0ff;
    border-left: 3px solid #6d8fd6;
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    text-decoration: none;
    color: var(--color-text);
    min-height: 36px;
}

.outlook-event-chip:hover {
    background: #dce9ff;
    color: var(--color-text);
}

.outlook-event-chip.is-class-event {
    background: #e2fff0;
    border-left-color: var(--color-success);
}

.outlook-event-chip.is-class-event:hover {
    background: #d5fae8;
}

.outlook-event-chip.is-disabled {
    pointer-events: none;
}

.outlook-event-time {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.1;
}

.outlook-event-subject {
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.outlook-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-top: var(--space-3);
    color: var(--color-text-muted);
    font-size: var(--font-size-1);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot--class {
    background: var(--color-success);
}

.legend-dot--other {
    background: #6d8fd6;
}

.outlook-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface-muted);
}

.outlook-week-column {
    min-height: 420px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
}

.outlook-week-column:last-child {
    border-right: none;
}

.outlook-week-column.is-today {
    box-shadow: inset 0 0 0 2px var(--color-primary);
}

.outlook-weekday-date {
    display: block;
    font-size: 11px;
    font-weight: var(--font-weight-regular);
    color: var(--color-text-muted);
}

.outlook-week-events {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-2);
}

.outlook-empty-text {
    color: var(--color-text-muted);
    font-size: var(--font-size-1);
}

.outlook-day-timeline {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.outlook-day-slot-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    min-height: 42px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.outlook-day-slot-row:last-child {
    border-bottom: none;
}

.outlook-day-slot-time {
    padding: var(--space-2) var(--space-3);
    border-right: 1px solid var(--color-border);
    font-size: var(--font-size-1);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
}

.outlook-day-slot-events {
    padding: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.outlook-day-slot-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    min-width: 180px;
    max-width: 100%;
    background: #e8f0ff;
    border-left: 3px solid #6d8fd6;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    text-decoration: none;
    color: var(--color-text);
}

.outlook-day-slot-chip:hover {
    background: #dce9ff;
    color: var(--color-text);
}

.outlook-day-slot-chip.is-class-event {
    background: #e2fff0;
    border-left-color: var(--color-success);
}

.outlook-day-slot-chip.is-class-event:hover {
    background: #d5fae8;
}

.outlook-day-slot-chip.is-disabled {
    pointer-events: none;
}

.outlook-day-overflow-note {
    margin-top: var(--space-3);
    color: var(--color-text-muted);
    font-size: var(--font-size-1);
    font-style: italic;
}

.outlook-empty-state {
    background: var(--color-surface-muted);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    padding: var(--space-5);
    text-align: center;
}

@media (max-width: 991.98px) {
    .outlook-day-cell {
        min-height: 108px;
    }

    .outlook-week-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .outlook-week-column {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }
}

@media (max-width: 767.98px) {
    .outlook-calendar-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .outlook-weekday-header {
        display: none;
    }

    .outlook-day-cell {
        min-height: auto;
        border-right: none;
    }

    .outlook-day-slot-row {
        grid-template-columns: 1fr;
    }

    .outlook-day-slot-time {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }
}

/* Collapsible module-content / lesson nodes (Module Builder + Classroom lecture tree).
   The caret is injected by site.js and grouped with the title; collapsing hides the node's body. */
.smh-collapse-titlewrap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* The collapse (caret) and description (info) controls sit to the right of the title and are sized
   as real, easy-to-hit buttons rather than bare icons. */
.smh-collapse-toggle,
.smh-desc-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--color-border, #d8e1ef);
    border-radius: var(--radius-sm, 8px);
    background: var(--color-surface, #fff);
    color: var(--color-text-muted, #5a6780);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition-fast, 0.15s ease),
                color var(--transition-fast, 0.15s ease),
                border-color var(--transition-fast, 0.15s ease);
}

.smh-collapse-toggle:hover,
.smh-desc-toggle:hover,
.smh-desc-toggle.active {
    background: var(--color-surface-muted, #f7f9fc);
    border-color: var(--color-primary, #1558c0);
    color: var(--color-primary, #1558c0);
}

.smh-collapse-toggle:focus-visible,
.smh-desc-toggle:focus-visible {
    outline: 2px solid var(--color-primary, #1558c0);
    outline-offset: 2px;
}

.smh-collapse-toggle .bi {
    display: inline-block;
    transition: transform var(--transition-fast, 0.15s ease);
}

.smh-collapse-toggle.is-collapsed .bi {
    transform: rotate(-90deg);
}

.smh-tree-content.smh-collapsed > .smh-collapse-body,
.smh-tree-lesson.smh-collapsed > .smh-collapse-body {
    display: none;
}

/* Module description is hidden by default and revealed by its own toggle (site.js), keeping the
   tree compact while still letting a teacher peek at a module's description on demand. */
.smh-desc-hidden {
    display: none;
}

/* The module row is draggable for reordering, which otherwise makes its description un-selectable
   and shows a move cursor over it. The description carries draggable="false" so a press there
   selects text (to copy) instead of starting a drag; restore the normal text cursor and selection. */
.smh-tree-content .subject-item-meta {
    cursor: text;
    -webkit-user-select: text;
    user-select: text;
}

/* Reordering is driven by the grip handle only (the row itself is not draggable), so the grip is
   the sole grab affordance and everything else on the row stays selectable. */
.smh-drag-handle {
    cursor: grab;
}

.smh-drag-handle:active {
    cursor: grabbing;
}
