/* Shared MaffsGuru dashboard styling (teacher_home pattern) */
/* Typography: 1.5rem minimum body text; 1.3rem secondary labels/eyebrows */
.mg-dashboard {
    font-size: 1.5rem;
    line-height: 1.55;
}

.mg-dashboard small,
.mg-dashboard .small,
.mg-dashboard .text-muted,
.mg-dashboard .text-secondary,
.mg-dashboard .card-intro,
.mg-dashboard .detail-list li {
    font-size: 1.5rem;
}

.mg-dashboard .section-eyebrow,
.mg-dashboard .detail-label,
.mg-dashboard h6,
.mg-dashboard .year-badge,
.mg-dashboard .info-badge {
    font-size: 1.3rem;
}

.mg-dashboard h5,
.mg-dashboard .card-header h5 {
    font-size: 1.75rem;
}

.mg-dashboard h4,
.mg-dashboard .welcome-panel h4 {
    font-size: 2rem;
}

/* Form controls — readable input and placeholder text */
.mg-dashboard .form-control,
.mg-dashboard .form-select,
.mg-dashboard textarea,
.mg-dashboard input[type="text"],
.mg-dashboard input[type="email"],
.mg-dashboard input[type="password"],
.mg-dashboard input[type="number"],
.mg-dashboard input[type="search"],
.mg-dashboard input[type="tel"],
.mg-dashboard input[type="url"],
.mg-dashboard input[type="date"],
.mg-dashboard input[type="time"],
.mg-lesson .form-control,
.mg-lesson .form-select,
.mg-lesson textarea,
.mg-lesson input[type="text"],
.mg-lesson input[type="email"],
.mg-lesson input[type="password"],
.mg-lesson input[type="number"],
.mg-lesson input[type="search"],
.mg-lesson input[type="tel"],
.mg-lesson input[type="url"],
.mg-lesson input[type="date"],
.mg-lesson input[type="time"],
.mg-lesson .mg-comment-input {
    font-size: 1.5rem !important;
    line-height: 1.5;
}

.mg-dashboard .form-control::placeholder,
.mg-dashboard .form-select::placeholder,
.mg-dashboard textarea::placeholder,
.mg-dashboard input::placeholder,
.mg-lesson .form-control::placeholder,
.mg-lesson textarea::placeholder,
.mg-lesson input::placeholder,
.mg-lesson .mg-comment-input::placeholder {
    font-size: 1.5rem !important;
    opacity: 0.65;
}

.mg-dashboard .form-control::-webkit-input-placeholder,
.mg-dashboard textarea::-webkit-input-placeholder,
.mg-lesson .form-control::-webkit-input-placeholder,
.mg-lesson textarea::-webkit-input-placeholder,
.mg-lesson .mg-comment-input::-webkit-input-placeholder {
    font-size: 1.5rem !important;
}

.mg-dashboard .form-label,
.mg-dashboard .form-check-label,
.mg-lesson .form-label,
.mg-lesson .form-check-label {
    font-size: 1.5rem;
}

/* Buttons — standard is btn btn-lg within dashboard shells */
.mg-dashboard .btn:not(.btn-close):not(.btn-link),
.mg-lesson .btn:not(.btn-close):not(.btn-link) {
    --bs-btn-padding-y: 0.625rem;
    --bs-btn-padding-x: 1.25rem;
    --bs-btn-font-size: 1.5rem;
    --bs-btn-border-radius: 0.5rem;
    padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);
    font-size: var(--bs-btn-font-size);
    border-radius: var(--bs-btn-border-radius);
    line-height: 1.5;
}

.mg-dashboard .dashboard-card {
    border: 0;
    border-radius: 0.75rem;
    box-shadow: 0 0.25rem 1rem rgba(15, 23, 42, 0.06);
}

.mg-dashboard .dashboard-card .card-header {
    background: #fff;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 1.1rem 1.35rem;
}

.mg-dashboard .dashboard-card .card-body {
    padding: 1.35rem;
}

.mg-dashboard .section-eyebrow {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6c757d;
}

.mg-dashboard .welcome-panel {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(25, 135, 84, 0.06));
    border: 1px solid rgba(13, 110, 253, 0.12);
    border-radius: 0.75rem;
    padding: 1.35rem 1.5rem;
}

.mg-dashboard .year-badge,
.mg-dashboard .info-badge {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 2rem;
    padding: 0.4rem 0.9rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: #0d6efd;
    white-space: nowrap;
}

.mg-dashboard .action-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    text-align: left;
    padding: 1rem 1.15rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #fff;
    color: #212529;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mg-dashboard .action-btn:hover,
.mg-dashboard .action-btn:focus {
    border-color: rgba(13, 110, 253, 0.35);
    background: rgba(13, 110, 253, 0.04);
    color: #0d6efd;
    box-shadow: 0 0.2rem 0.6rem rgba(13, 110, 253, 0.08);
}

.mg-dashboard .action-btn .action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 0.6rem;
    font-size: 2rem;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    flex-shrink: 0;
}

.mg-dashboard .action-btn.admin-action .action-icon,
.mg-dashboard .action-btn.student-action .action-icon {
    background: rgba(25, 135, 84, 0.14);
    color: #198754;
}

.mg-dashboard .action-btn.admin-action:hover,
.mg-dashboard .action-btn.admin-action:focus {
    border-color: rgba(255, 193, 7, 0.45);
    background: rgba(255, 193, 7, 0.08);
    color: #9a6700;
}

.mg-dashboard .action-btn.admin-action .action-icon {
    background: rgba(255, 193, 7, 0.18);
    color: #b78103;
}

.mg-dashboard .action-btn.student-action:hover,
.mg-dashboard .action-btn.student-action:focus {
    border-color: rgba(25, 135, 84, 0.35);
    background: rgba(25, 135, 84, 0.06);
    color: #198754;
}

.mg-dashboard .action-btn .action-copy strong {
    display: block;
    font-size: 1.5rem;
    line-height: 1.35;
}

.mg-dashboard .action-btn .action-copy span {
    display: block;
    font-size: 1.5rem;
    color: #6c757d;
    line-height: 1.45;
    margin-top: 0.15rem;
}

.mg-dashboard .action-btn-compact {
    padding: 0.8rem 1rem;
}

.mg-dashboard .action-btn-compact .action-icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.35rem;
}

.mg-dashboard .action-btn-compact .action-copy strong {
    font-size: 1.5rem;
}

.mg-dashboard .action-btn-compact .action-copy span {
    font-size: 1.5rem;
}

.mg-dashboard .guide-card {
    overflow: hidden;
    background: linear-gradient(135deg, #f8fbff 0%, #f4fbf7 100%);
    border: 1px solid rgba(13, 110, 253, 0.14);
}

.mg-dashboard .guide-card .guide-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(13, 110, 253, 0.12);
}

.mg-dashboard .guide-card .guide-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #0d6efd, #4c8dff);
    color: #fff;
    box-shadow: 0 0.35rem 0.9rem rgba(13, 110, 253, 0.25);
    flex-shrink: 0;
}

.mg-dashboard .guide-card .guide-header h5 {
    margin-bottom: 0.15rem;
    color: #1e293b;
}

.mg-dashboard .guide-tip {
    display: flex;
    gap: 1.15rem;
    height: 100%;
    padding: 1.35rem 1.4rem;
    border-radius: 0.75rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 0.15rem 0.5rem rgba(15, 23, 42, 0.04);
}

.mg-dashboard .guide-tip .guide-tip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 0.7rem;
    flex-shrink: 0;
    font-size: 1.35rem;
}

.mg-dashboard .guide-tip.primary-tip .guide-tip-icon {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.mg-dashboard .guide-tip.admin-tip .guide-tip-icon {
    background: rgba(255, 193, 7, 0.2);
    color: #b78103;
}

.mg-dashboard .guide-tip .guide-tip-label {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
}

.mg-dashboard .guide-tip.primary-tip .guide-tip-label {
    color: #0d6efd;
}

.mg-dashboard .guide-tip.admin-tip .guide-tip-label {
    color: #b78103;
}

.mg-dashboard .guide-tip p {
    margin-bottom: 0;
    color: #495057;
    line-height: 1.6;
    font-size: 1.4rem;
}

.mg-dashboard .alert-unassigned {
    border: 0;
    border-left: 4px solid #fd7e14;
    background: rgba(253, 126, 20, 0.08);
    border-radius: 0.6rem;
}

.mg-dashboard .detail-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mg-dashboard .detail-list li {
    display: flex;
    gap: 0.65rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    font-size: 1.5rem;
    color: #495057;
}

.mg-dashboard .detail-list li:last-child {
    border-bottom: 0;
}

.mg-dashboard .detail-list .detail-label {
    min-width: 7rem;
    font-weight: 600;
    color: #212529;
}

.mg-dashboard .card-intro {
    font-size: 1.6rem;
    color: #6c757d;
    line-height: 1.55;
}

.mg-dashboard .legend-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

.mg-dashboard .legend-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
    font-size: 1.5rem;
}

.mg-dashboard .legend-item:last-child {
    margin-bottom: 0;
}

.mg-dashboard #non-teaching-calendar {
    min-height: 70vh;
}

.mg-dashboard .fc-toolbar-title {
    font-size: 1.5rem !important;
    font-weight: 600;
}

.mg-dashboard .fc-event {
    font-size: 1.3rem;
    font-weight: 500;
}

#school-change-panel .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding-left: 0;
}

#school-change-panel input[type="checkbox"].form-check-input {
    opacity: 1;
    position: static;
    float: none;
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0.15rem 0 0;
    cursor: pointer;
}

#school-change-panel .form-check-label::before,
#school-change-panel .form-check-label::after {
    display: none;
}

#school-change-panel .form-check-label {
    flex: 1 1 auto;
    padding-left: 0;
    margin-bottom: 0;
    line-height: 1.55;
    cursor: pointer;
}

.mg-dashboard #assessment-template-form input[type="checkbox"] {
    opacity: 1;
    position: static;
    width: 1.6rem;
    height: 1.6rem;
    margin: 0;
    cursor: pointer;
}

.mg-dashboard #assessment-template-form input[type="number"] {
    min-width: 5rem;
}

.mg-dashboard #assessment-template-form .form-control-color {
    width: 3rem;
    height: 2.25rem;
    padding: 0.2rem;
}

.mg-dashboard #assessment-template-form .checkbox-label {
    font-size: 1.5rem;
    color: var(--body-color, #6c757d);
    margin-left: 0.35rem;
    padding-left: 0;
    cursor: pointer;
}

.mg-dashboard #assessment-template-form .checkbox-label::before,
.mg-dashboard #assessment-template-form .checkbox-label::after {
    display: none;
}

.mg-dashboard .homework-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 0.4rem;
    box-shadow: 0 0.1rem 0.3rem rgba(15, 23, 42, 0.04);
    background: #f8f8a5;
    /* border-bottom: 1px solid rgba(15, 23, 42, 0.08); */
}

.mg-dashboard .homework-item:last-child {
    border-bottom: 0;
}

.mg-dashboard .homework-due {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0d6efd;
    white-space: nowrap;
}

.mg-dashboard .homework-due--overdue,
.mg-dashboard .homework-due.homework-due--overdue {
    color: #dc3545;
}

.mg-dashboard .homework-item--overdue {
    background: rgba(220, 53, 69, 0.06);
    border-left: 3px solid #dc3545;
    padding: 0.85rem 0.75rem;
    border-radius: 0.4rem;
    margin-bottom: 0.5rem;
}

.mg-dashboard .homework-item-main {
    flex: 1 1 16rem;
    min-width: 0;
}

.mg-dashboard .homework-item-title a {
    font-weight: 600;
    color: #212529;
    text-decoration: none;
}

.mg-dashboard .homework-item-title a:hover {
    color: #0d6efd;
}

.mg-dashboard .homework-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-top: 0.25rem;
}

.mg-dashboard .homework-item-notes {
    font-style: italic;
}

.mg-dashboard .homework-item-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.mg-dashboard .homework-watch-badge {
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 600;
    color: #495057;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 2rem;
    padding: 0.2rem 0.65rem;
    white-space: nowrap;
}

.mg-dashboard .homework-section-label {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.mg-dashboard .homework-section-label--overdue {
    color: #dc3545;
}

.mg-dashboard .homework-section-label--upcoming {
    color: #0d6efd;
}

.homework-index-banner {
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 193, 7, 0.35);
}

/* Verify & enrolment pages */
.mg-dashboard .thumb {
    max-height: 52px;
    max-width: 90px;
    object-fit: cover;
    border-radius: 0.4rem;
    cursor: pointer;
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.mg-dashboard .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1.5rem;
}

.mg-dashboard .stat-card {
    border: 0;
    border-radius: 0.75rem;
    box-shadow: 0 0.25rem 1rem rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.mg-dashboard .stat-card .stat-card-body {
    padding: 1.25rem 1.35rem;
}

.mg-dashboard .stat-card.stat-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.16), rgba(255, 193, 7, 0.06));
    border: 1px solid rgba(255, 193, 7, 0.28);
}

.mg-dashboard .stat-card .stat-label {
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9a6700;
}

.mg-dashboard .stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: #212529;
}

.mg-dashboard .drop-zone {
    border: 2px dashed rgba(13, 110, 253, 0.35);
    background: rgba(13, 110, 253, 0.04);
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mg-dashboard .drop-zone:hover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.08);
}

.mg-dashboard .drop-zone.dragover {
    border-color: #0d6efd;
    background: #fff;
    box-shadow: 0 0.2rem 0.8rem rgba(13, 110, 253, 0.12);
}

.mg-dashboard .dropZone {
    border: 2px dashed rgba(13, 110, 253, 0.35);
    background: rgba(13, 110, 253, 0.04);
    border-radius: 0.75rem;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 10rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #495057;
}

.mg-dashboard .dropZone:hover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.08);
}

.mg-dashboard .success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: rgba(25, 135, 84, 0.14);
    color: #198754;
    font-size: 2.25rem;
}

.mg-dashboard .status-alert {
    border: 0;
    border-left: 4px solid #0dcaf0;
    background: rgba(13, 202, 240, 0.1);
    border-radius: 0.6rem;
}

.mg-dashboard .status-alert-warning {
    border: 0;
    border-left: 4px solid #ffc107;
    background: rgba(255, 193, 7, 0.14);
    border-radius: 0.6rem;
    color: #664d03;
}

.mg-dashboard .info-tile {
    padding: 1rem 1.1rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
}

.mg-dashboard .info-tile .info-tile-label {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.35rem;
}

.mg-dashboard .info-tile .info-tile-value {
    font-size: 1.6rem;
    font-weight: 600;
    color: #212529;
}

.mg-dashboard .step-card {
    padding: 1rem 1.1rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
}

.mg-dashboard .step-card h6 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.mg-dashboard .option-card {
    border-radius: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #fff;
    transition: all 0.2s ease;
    height: 100%;
}

.mg-dashboard .option-card:hover {
    border-color: rgba(13, 110, 253, 0.35);
    box-shadow: 0 0.2rem 0.8rem rgba(13, 110, 253, 0.08);
}

.mg-dashboard .option-card .option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.65rem;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.mg-dashboard .option-card .option-icon.tfx-icon {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.mg-dashboard .option-card .option-icon.excel-icon {
    background: rgba(25, 135, 84, 0.14);
    color: #198754;
}

body > .offcanvas-backdrop.show {
    z-index: 1055 !important;
}

.mg-dashboard .form-select,
.mg-dashboard .form-select option {
    color: #212529;
    background: #fff;
}

#homework-set-form input,
#homework-set-form select,
#homework-set-form textarea,
#homework-set-form button {
    opacity: 1;
    pointer-events: auto;
}

#homework-set-form .homework-student-select {
    position: static;
    width: 100%;
    min-height: 14rem;
    padding: 0.5rem;
    background: #fff;
    color: #212529;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 0.5rem;
}

#homework-set-form .homework-student-select option {
    padding: 0.35rem 0.5rem;
}

.homework-video-pill {
    padding: 0.75rem 0.9rem;
    border-radius: 0.5rem;
    background: rgba(13, 110, 253, 0.08);
    border: 1px solid rgba(13, 110, 253, 0.15);
    font-weight: 600;
    color: #212529;
}

.homework-form-section {
    margin-bottom: 1.25rem;
}

.homework-form-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.homework-set-btn {
    color: #0d6efd;
    cursor: pointer;
    line-height: 1;
}

.homework-set-btn:hover {
    color: #0a58ca;
}

/* Shared polished offcanvas panels (school guide, homework, etc.) */
.offcanvas.mg-offcanvas {
    width: min(24rem, 100vw);
    background: #f8fafc !important;
    border-left: 0;
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
    z-index: 1065 !important;
    position: fixed !important;
    pointer-events: auto;
}

.offcanvas.mg-offcanvas.mg-offcanvas--wide {
    width: min(30rem, 100vw);
}

.offcanvas.mg-offcanvas.mg-offcanvas--third {
    width: 33vw;
}

@media (max-width: 767.98px) {
    .offcanvas.mg-offcanvas.mg-offcanvas--third {
        width: 100vw;
    }
}

.offcanvas.mg-offcanvas.mg-offcanvas--adaptive {
    width: 90%;
}

@media (min-width: 768px) {
    .offcanvas.mg-offcanvas.mg-offcanvas--adaptive {
        width: 50%;
    }
}

@media (min-width: 992px) {
    .offcanvas.mg-offcanvas.mg-offcanvas--adaptive {
        width: 33%;
    }
}

.mg-offcanvas-header {
    position: relative;
    padding: 1.75rem 1.5rem 1.5rem;
    background: linear-gradient(135deg, #0d6efd 0%, #4f8cff 48%, #20c997 100%);
    color: #fff;
}

.mg-offcanvas-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.mg-offcanvas-close:hover {
    opacity: 1;
}

.mg-offcanvas-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1.5rem;
    margin-bottom: 0.85rem;
    backdrop-filter: blur(4px);
}

.mg-offcanvas-eyebrow {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.9;
}

.mg-offcanvas-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
}

.mg-offcanvas-lead {
    font-size: 1.5rem;
    line-height: 1.5;
    opacity: 0.92;
    max-width: none;
}

.mg-offcanvas-body {
    padding: 1.35rem 1.25rem 1.5rem;
    background: #f8fafc;
}

.mg-offcanvas-timeline {
    position: relative;
    padding-left: 0.15rem;
}

.mg-offcanvas-step {
    display: flex;
    gap: 0.9rem;
    padding-bottom: 1.15rem;
    position: relative;
}

.mg-offcanvas-step:not(.mg-offcanvas-step--last)::before {
    content: "";
    position: absolute;
    left: 1.28rem;
    top: 2.85rem;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, rgba(13, 110, 253, 0.35), rgba(13, 110, 253, 0.08));
}

.mg-offcanvas-step-marker {
    position: relative;
    flex-shrink: 0;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.15rem 0.5rem rgba(15, 23, 42, 0.08);
}

.mg-offcanvas-step-number {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: #fff;
    color: #0d6efd;
    font-size: 1.3rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid currentColor;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.mg-offcanvas-step-icon {
    font-size: 1.5rem;
}

.mg-offcanvas-step-marker--search {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.mg-offcanvas-step-marker--search .mg-offcanvas-step-number {
    color: #0d6efd;
    border-color: #0d6efd;
}

.mg-offcanvas-step-marker--select {
    background: rgba(25, 135, 84, 0.14);
    color: #198754;
}

.mg-offcanvas-step-marker--select .mg-offcanvas-step-number {
    color: #198754;
    border-color: #198754;
}

.mg-offcanvas-step-marker--missing {
    background: rgba(255, 193, 7, 0.2);
    color: #b58100;
}

.mg-offcanvas-step-marker--missing .mg-offcanvas-step-number {
    color: #b58100;
    border-color: #ffc107;
}

.mg-offcanvas-step-marker--save {
    background: rgba(111, 66, 193, 0.14);
    color: #6f42c1;
}

.mg-offcanvas-step-marker--save .mg-offcanvas-step-number {
    color: #6f42c1;
    border-color: #6f42c1;
}

.mg-offcanvas-step-content {
    flex: 1;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.75rem;
    padding: 0.85rem 0.95rem;
    box-shadow: 0 0.12rem 0.45rem rgba(15, 23, 42, 0.04);
}

.mg-offcanvas-step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.35rem;
}

.mg-offcanvas-step-text {
    font-size: 1.5rem;
    line-height: 1.5;
    color: #5c6773;
}

.mg-offcanvas-tip {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    margin: 0.35rem 0 1.15rem;
    padding: 0.95rem 1rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(32, 201, 151, 0.08));
    border: 1px solid rgba(13, 110, 253, 0.14);
}

.mg-offcanvas-tip-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #0d6efd;
    font-size: 1.3rem;
    box-shadow: 0 0.1rem 0.35rem rgba(13, 110, 253, 0.15);
}

.mg-offcanvas-tip strong {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
    color: #0d6efd;
}

.mg-offcanvas-tip p {
    font-size: 1.5rem;
    line-height: 1.45;
    color: #495057;
}

.mg-offcanvas-done-btn {
    padding: 0.7rem 1rem;
    font-weight: 600;
    border-radius: 0.65rem;
    box-shadow: 0 0.2rem 0.65rem rgba(13, 110, 253, 0.2);
}

.mg-offcanvas-header--success {
    background: linear-gradient(135deg, #198754 0%, #20c997 55%, #4f8cff 100%);
}

.mg-offcanvas-section {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.75rem;
    padding: 1rem 1rem 1.05rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.12rem 0.45rem rgba(15, 23, 42, 0.04);
}

.mg-offcanvas-section-head {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.mg-offcanvas-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.15rem;
}

.mg-offcanvas-section-hint {
    font-size: 1.3rem;
    line-height: 1.45;
    color: #6c757d;
    margin-bottom: 0;
}

.mg-offcanvas-marker {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0.15rem 0.45rem rgba(15, 23, 42, 0.08);
}

.mg-offcanvas-marker--video {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.mg-offcanvas-marker--students {
    background: rgba(25, 135, 84, 0.14);
    color: #198754;
}

.mg-offcanvas-marker--date {
    background: rgba(255, 193, 7, 0.2);
    color: #b58100;
}

.mg-offcanvas-marker--notes {
    background: rgba(111, 66, 193, 0.14);
    color: #6f42c1;
}

.mg-offcanvas-highlight {
    padding: 0.8rem 0.95rem;
    border-radius: 0.65rem;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(32, 201, 151, 0.08));
    border: 1px solid rgba(13, 110, 253, 0.16);
    font-weight: 600;
    color: #212529;
    line-height: 1.45;
}

.mg-offcanvas-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.mg-offcanvas-toolbar .btn {
    font-size: 1.5rem;
    padding: 0.625rem 1.25rem;
}

.mg-offcanvas-success-card {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 0.75rem;
    background: #fff;
    border: 1px solid rgba(25, 135, 84, 0.2);
    box-shadow: 0 0.15rem 0.5rem rgba(25, 135, 84, 0.08);
    margin-bottom: 1rem;
}

.mg-offcanvas-success-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(25, 135, 84, 0.14);
    color: #198754;
    font-size: 1.5rem;
}

.mg-offcanvas-form-actions {
    margin-top: 0.25rem;
    padding-top: 0.25rem;
}

#homework-set-form .homework-student-select {
    min-height: 11rem;
}

#homework-set-form .form-control,
#homework-set-form .homework-student-select {
    border-radius: 0.6rem;
    border-color: rgba(15, 23, 42, 0.12);
    font-size: 1.5rem;
}

#homework-set-form .form-control::placeholder,
#homework-set-form textarea::placeholder {
    font-size: 1.5rem;
    opacity: 0.65;
}

#homework-set-form .form-control:focus,
#homework-set-form .homework-student-select:focus {
    border-color: rgba(13, 110, 253, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

.mg-dashboard .editor-marks-col {
    min-width: 7rem;
}

.mg-dashboard .editor-marks-input[type="number"] {
    width: 6.5rem;
    min-width: 6.5rem;
    padding-inline: 0.75rem;
}

.exam-ruled-lines {
    margin-top: 0.5rem;
    padding-bottom: 0.5cm;
}

.exam-ruled-line {
    height: 1cm;
    border-bottom: 1.5px solid #6c757d;
    box-sizing: border-box;
}

.mg-dashboard .editor-figure-drop {
    min-height: 12rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Let drops hit the zone, not child previews/labels */
.mg-dashboard .editor-figure-drop > * {
    pointer-events: none;
}

.mg-dashboard .editor-figure-drop .form-check,
.mg-dashboard .editor-figure-drop .form-check * {
    pointer-events: auto;
}

.mg-dashboard .editor-figure-preview {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.mg-dashboard .exam-figure-img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.mg-dashboard .editor-figure-drop.is-compressing {
    opacity: 0.65;
    pointer-events: none;
}

.mg-dashboard .editor-figure-size-hint.text-success {
    color: #198754 !important;
}

/* --------------------------------------------------------------------------
   Help guides — reusable layout for how-to / feature documentation
   Use with .mg-dashboard.mg-guide on the page shell.
   -------------------------------------------------------------------------- */

.mg-guide {
    font-size: 1.5rem;
    line-height: 1.55;
}

.mg-guide .mg-guide-header {
    margin-bottom: 1.5rem;
}

.mg-guide .mg-guide-audience {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.mg-guide .mg-guide-audience--teacher {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.mg-guide .mg-guide-audience--student {
    background: rgba(25, 135, 84, 0.12);
    color: #198754;
}

.mg-guide .mg-guide-audience--both {
    background: rgba(111, 66, 193, 0.1);
    color: #6f42c1;
}

.mg-guide .mg-guide-toc {
    position: sticky;
    top: 1.25rem;
}

.mg-guide .mg-guide-toc-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 0.15rem 0.5rem rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.mg-guide .mg-guide-toc-header {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: #f8fafc;
}

.mg-guide .mg-guide-toc-header h6 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
}

.mg-guide .mg-guide-toc-list {
    margin: 0;
    padding: 0.65rem 0;
    list-style: none;
}

.mg-guide .mg-guide-toc-list a {
    display: block;
    padding: 0.45rem 1rem;
    font-size: 1.5rem;
    color: #495057;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mg-guide .mg-guide-toc-list a:hover,
.mg-guide .mg-guide-toc-list a:focus {
    background: rgba(13, 110, 253, 0.06);
    color: #0d6efd;
    border-left-color: #0d6efd;
}

.mg-guide .mg-guide-section {
    scroll-margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.mg-guide .mg-guide-section:last-child {
    margin-bottom: 0;
}

.mg-guide .mg-guide-text {
    font-size: 1.5rem;
    line-height: 1.65;
    color: #495057;
    margin-bottom: 1rem;
}

.mg-guide .mg-guide-text:last-child {
    margin-bottom: 0;
}

.mg-guide .mg-guide-figure {
    margin: 1.25rem 0;
}

.mg-guide .mg-guide-figure img {
    width: 100%;
    height: auto;
    border-radius: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 0.2rem 0.65rem rgba(15, 23, 42, 0.06);
}

.mg-guide .mg-guide-figure--wide img,
.mg-guide .mg-guide-figure--wide .mg-guide-figure-placeholder {
    max-width: 100%;
}

.mg-guide .mg-guide-figure-caption {
    margin-top: 0.55rem;
    font-size: 1.5rem;
    color: #6c757d;
    text-align: center;
}

.mg-guide .mg-guide-figure-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 14rem;
    padding: 2rem 1.5rem;
    border-radius: 0.75rem;
    border: 2px dashed rgba(13, 110, 253, 0.28);
    background: linear-gradient(135deg, #f8fbff 0%, #f4fbf7 100%);
    color: #6c757d;
    text-align: center;
}

.mg-guide .mg-guide-figure-placeholder i {
    font-size: 2rem;
    color: #0d6efd;
    opacity: 0.65;
}

.mg-guide .mg-guide-figure-placeholder strong {
    display: block;
    font-size: 1.5rem;
    color: #495057;
}

.mg-guide .mg-guide-figure-placeholder span {
    font-size: 1.3rem;
}

.mg-guide .guide-tip.student-tip .guide-tip-icon {
    background: rgba(25, 135, 84, 0.14);
    color: #198754;
}

.mg-guide .guide-tip.student-tip .guide-tip-label {
    color: #198754;
}

.mg-guide .mg-guide-callout {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    border-radius: 0.75rem;
    margin: 1.25rem 0;
    border: 1px solid transparent;
}

.mg-guide .mg-guide-callout-icon {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: #fff;
}

.mg-guide .mg-guide-callout-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #212529;
}

.mg-guide .mg-guide-callout-text {
    font-size: 1.5rem;
    line-height: 1.55;
    margin: 0;
    color: #495057;
}

.mg-guide .mg-guide-callout--info {
    background: rgba(13, 110, 253, 0.08);
    border-color: rgba(13, 110, 253, 0.18);
}

.mg-guide .mg-guide-callout--info .mg-guide-callout-icon {
    color: #0d6efd;
    box-shadow: 0 0.1rem 0.35rem rgba(13, 110, 253, 0.15);
}

.mg-guide .mg-guide-callout--warning {
    background: rgba(255, 193, 7, 0.12);
    border-color: rgba(255, 193, 7, 0.35);
}

.mg-guide .mg-guide-callout--warning .mg-guide-callout-icon {
    color: #b58100;
    box-shadow: 0 0.1rem 0.35rem rgba(255, 193, 7, 0.2);
}

.mg-guide .mg-guide-callout--success {
    background: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.22);
}

.mg-guide .mg-guide-callout--success .mg-guide-callout-icon {
    color: #198754;
    box-shadow: 0 0.1rem 0.35rem rgba(25, 135, 84, 0.18);
}

.mg-guide .mg-guide-timeline {
    position: relative;
    padding-left: 0.15rem;
    margin: 1rem 0 0;
}

.mg-guide .mg-guide-step {
    display: flex;
    gap: 0.9rem;
    padding-bottom: 1.15rem;
    position: relative;
}

.mg-guide .mg-guide-step:not(.mg-guide-step--last)::before {
    content: "";
    position: absolute;
    left: 1.28rem;
    top: 2.85rem;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, rgba(13, 110, 253, 0.35), rgba(13, 110, 253, 0.08));
}

.mg-guide .mg-guide-step-marker {
    position: relative;
    flex-shrink: 0;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
    box-shadow: 0 0.15rem 0.5rem rgba(15, 23, 42, 0.08);
}

.mg-guide .mg-guide-step-marker--student {
    background: rgba(25, 135, 84, 0.14);
    color: #198754;
}

.mg-guide .mg-guide-step-marker--admin {
    background: rgba(255, 193, 7, 0.2);
    color: #b58100;
}

.mg-guide .mg-guide-step-number {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: #fff;
    color: inherit;
    font-size: 1.3rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid currentColor;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.mg-guide .mg-guide-step-content {
    flex: 1;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.75rem;
    padding: 0.95rem 1.05rem;
    box-shadow: 0 0.12rem 0.45rem rgba(15, 23, 42, 0.04);
}

.mg-guide .mg-guide-step-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.4rem;
}

.mg-guide .mg-guide-step-text {
    font-size: 1.5rem;
    line-height: 1.55;
    color: #5c6773;
    margin-bottom: 0;
}

.mg-guide .mg-guide-key-points {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.mg-guide .mg-guide-key-points li {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.5rem 0;
    font-size: 1.5rem;
    line-height: 1.5;
    color: #495057;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.mg-guide .mg-guide-key-points li:last-child {
    border-bottom: 0;
}

.mg-guide .mg-guide-key-points li i {
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: #198754;
    font-size: 1.3rem;
}

.mg-guide .mg-guide-divider {
    margin: 1.75rem 0;
    border: 0;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.mg-guide .mg-guide-related .action-btn {
    margin-bottom: 0.65rem;
}

.mg-guide .mg-guide-related .action-btn:last-child {
    margin-bottom: 0;
}

.mg-guide .mg-guide-faq .accordion-button {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
}

.mg-guide .mg-guide-faq .accordion-button:not(.collapsed) {
    background: rgba(13, 110, 253, 0.06);
    color: #0d6efd;
}

.mg-guide .mg-guide-faq .accordion-body {
    font-size: 1.5rem;
    line-height: 1.6;
    color: #495057;
}

.mg-guide .mg-guide-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 12rem;
    padding: 2rem;
    border-radius: 0.75rem;
    background: #1e293b;
    color: #e2e8f0;
    text-align: center;
}

.mg-guide .mg-guide-video-placeholder i {
    font-size: 2.5rem;
    color: #fff;
    opacity: 0.85;
}

.mg-guide .mg-guide-video-placeholder span {
    font-size: 1.5rem;
    opacity: 0.8;
}

@media (max-width: 991.98px) {
    .mg-guide .mg-guide-toc {
        position: static;
        margin-bottom: 1rem;
    }
}
